diff --git a/dist/404.html b/dist/404.html deleted file mode 100644 index a6675ec..0000000 --- a/dist/404.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - Page Not Found :( - - - -
-

Not found :(

-

Sorry, but the page you were trying to view does not exist.

-

It looks like this was the result of either:

- - - -
- - \ No newline at end of file diff --git a/dist/images/shirt-blank-black.png.tmp b/dist/images/shirt-blank-black.png.tmp deleted file mode 100644 index e69de29..0000000 diff --git a/dist/index.html b/dist/index.html deleted file mode 100644 index 5efa249..0000000 --- a/dist/index.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - fwos - - - - - - - - - - - -
-

FOUR WORDS ON SHIRTS

-
- -
- -
- -
-

So Hot Right Now

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-

Four

-

Wordsareto

-

On

-

Shirts

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-

Four

-

Wordsareto

-

On

-

Shirts

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-
-
-

The Best Shirt Ever

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-

Four

-

Words

-

On

-

Shirts

-
-
-
- - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/node_modules/grunt-autoprefixer/.travis.yml b/node_modules/grunt-autoprefixer/.travis.yml deleted file mode 100644 index cbace30..0000000 --- a/node_modules/grunt-autoprefixer/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli diff --git a/node_modules/grunt-autoprefixer/LICENSE-MIT b/node_modules/grunt-autoprefixer/LICENSE-MIT deleted file mode 100644 index 276b222..0000000 --- a/node_modules/grunt-autoprefixer/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Dmitry Nikitenko - -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/node_modules/grunt-autoprefixer/README.md b/node_modules/grunt-autoprefixer/README.md deleted file mode 100644 index f1c9b46..0000000 --- a/node_modules/grunt-autoprefixer/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# grunt-autoprefixer [![Build Status](https://travis-ci.org/nDmitry/grunt-autoprefixer.png?branch=master)](https://travis-ci.org/nDmitry/grunt-autoprefixer) - -> [Autoprefixer](https://github.com/ai/autoprefixer) parses CSS and adds vendor-prefixed CSS properties using the [Can I Use](http://caniuse.com/) database. - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-autoprefixer --save-dev -``` - -One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-autoprefixer'); -``` - -## The "autoprefixer" task - -### Overview -In your project's Gruntfile, add a section named `autoprefixer` to the data object passed into `grunt.initConfig()`. - -```js -grunt.initConfig({ - autoprefixer: { - options: { - // Task-specific options go here. - }, - your_target: { - // Target-specific file lists and/or options go here. - }, - }, -}) -``` - -### Options - -#### options.browsers -Type: `Array` -Default value: `['last 2 versions']` - -You can specify browsers actual for your project (by default, it’s -`'last 2 versions'`): - -```js -options: { - browsers: ['last 1 version', '> 1%', 'ie 8', 'ie 7'] -} -``` - -* `last n versions` is last `n` versions for each browser (for example, - [Google also uses](http://support.google.com/a/bin/answer.py?answer=33864) - “last 2 version” strategy). -* `> n%` is browser versions, which global usage statistics is more than `n`%. -* You can also set browsers directly. - -### Usage Example - -#### Default Options - -```js -grunt.initConfig({ - autoprefixer: { - dist: { - options: { - browsers: ['last 1 version', '> 1%', 'ie 8', 'ie 7'] - }, - files: { - 'dest/styles.css': ['src/something.css', 'src/whatever.css'] - } - } - }, -}) -``` - -## 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 - -* 07/16/2013 - 0.2.0 - Update the task according to Autoprefixer API changes. -* 04/19/2013 - 0.1.0 - Initial release. diff --git a/node_modules/grunt-autoprefixer/node_modules/.bin/autoprefixer b/node_modules/grunt-autoprefixer/node_modules/.bin/autoprefixer deleted file mode 120000 index e876d81..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/.bin/autoprefixer +++ /dev/null @@ -1 +0,0 @@ -../autoprefixer/bin/autoprefixer \ No newline at end of file diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/ChangeLog b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/ChangeLog deleted file mode 100644 index 2a8bb82..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/ChangeLog +++ /dev/null @@ -1,136 +0,0 @@ -== 0.7 (We Do Not Sow) -* Add vendor prefixes to selectors. -* Add ::selection and ::placeholder selectors support. -* Allow to load support data from Can I Use pull requests. -* Remove deprecated API. - -20130806: -* Add hyphens support. - -20130807: -* Add tab-size support. -* Add :fullscreen support. - -20130808: -* Allow to select browser versions by > and >= operator. -* Fix flex properties in transition. - -20130810: -* Add Firefox 25 data. - -20130824: -* Add Chrome 31 and 30 data. -* Fix CSS comments parsing (by vladkens). - -== 0.6 (As High As Honor) -* New faster API, which cache preprocessed data. Old API is deprecated. -* A lot of perfomance improvements. -* Add Opera 15 -webkit- prefix support. -* Update Chrome 29 and Safari 7 prefixes data. -* Add minor browsers in popularity select. -* Better syntax error messages. - -20130721: -* Add Chrome 30 data. - -20130728: -* Don’t remove non-standard -webkit-background-clip: text. -* Don’t remove IE hack on CSS parse. - -20130729: -* Add Opera 16 data. -* Fix “Invalid range in character class” error on Firefox. - -20130730: -* Fix correct clone comments inside keyframes (by Alexey Plutalov). -* Fix angle recalculation in gradients (by Roman Komarov). - -20130731: -* Add border-image support. - -== 0.5 (Ours is the Fury) -* Rewrite Autoprefixer to be more flexible. -* Use css, instead of Rework, to fix CSS parsing errors faster. -* Fix a lot of CSS parsing errors. - -20130616: -* More useful message for CSS parsing errors. -* Remove old WebKit gradient syntax. -* Fix parsing error on comment with braces. - -20130617: -* Remove old Mozilla border-radius. -* Don’t prefix old IE filter. -* Remove old background-clip, background-size and background-origin prefixes. -* Speed up regexps in values. -* Allow to hack property declarations. - -20130625: -* Convert flexbox properties to 2009 and 2012 specifications. -* Improve messages on syntax errors. - -20130626: -* Add Firefox 24 data. -* Add prefixes for font-feature-settings. - -20130629: -* Fix convert flex properties to old box-flex. - -== 0.4 (Winter Is Coming) -* Remove outdated prefixes. -* Add border-radius and box-shadow properties to database. -* Change degrees in webkit gradients. - -20130515: -* Add old syntax in gradient direction. -* Add old syntax for display: flex. -* Update browser global usage statistics. - -20130521: -* Add Firefox 23 data. - -20130524: -* Add Chrome 29 data. - -20130528: -* Fix compatibilty with Rework from git master. -* Add minor browsers to data, which can be selected only directly. - -20130530: -* Add Opera 15 and iOS 6.1 data. -* Fix iOS versions in properties and values data. - -20130603: -* Use latest Rework 0.15 with a lot of CSS parsing fixes. -* Update browsers usage statistics. - -== 0.3 (Growing Strong) -* Rename `autoprefixer.filter()` to `autoprefixer.rework()`. -* Use own filters instead of Rework’s `prefix` and `prefixValue`. -* Smarter value prefixer without false match “order” in “border”. -* 40% faster. -* Don’t add unnecessary properties instead of Rework’s `prefixValue`. -* Don’t change properties order. -* Sort properties and values in inspect output. -* Add main to component config (by Jonathan Ong). -* Fix documentation (by Sergey Leschina and Mark Vasilkov). - -20130424: -* Fix value override in prefixer. - -20130427: -* Prefix several same values in one property. -* Fix Windows support in binary. -* Improve print errors in binary. - -20130502: -* Don’t add -webkit- prefix to IE filter. -* Don’t duplicate prefixes on second run. - -== 0.2 (Hear Me Roar!) -* Update parse libraries. -* Use component package manager to build standalone script. -* Add inspect to standalone script. - -== 0.1 (Fire and Blood) -* Initial release. diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/LICENSE b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/LICENSE deleted file mode 100644 index 65c5ca8..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/LICENSE +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/README.md b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/README.md deleted file mode 100644 index de8bd09..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/README.md +++ /dev/null @@ -1,325 +0,0 @@ -# Autoprefixer - - - -Parse CSS and add vendor prefixes to CSS rules using values -from the [Can I Use](http://caniuse.com/). - -Write your CSS rules without vendor prefixes (in fact, forget about them -entirely): - -```js -var css = 'a { transition: transform 1s }'; -var prefixed = autoprefixer.compile(css); -``` - -Autoprefixer uses the data on current browser popularity -and properties support to apply prefixes for you: - -```css -a { - -webkit-transition: -webkit-transform 1s; - transition: -ms-transform 1s; - transition: transform 1s -} -``` - -Twitter account for news and releases: -[@autoprefixer](https://twitter.com/autoprefixer). - -Sponsored by [Evil Martians](http://evilmartians.com/). - -## Translations - -Документация на русском: [habrahabr.ru/company/evilmartians/blog/176909](http://habrahabr.ru/company/evilmartians/blog/176909/) - -## Features - -### Forget about prefixes - -The best tool is a tool you can't see that does the work for you. -This is the main idea behind Autoprefixer. - -Autoprefixer interface is simple: just forget about vendor prefixes -and write normal CSS according to latest W3C specs. You don’t need -a special language (like Sass) or special mixins. - -Because Autoprefixer is a postprocessor for CSS, -you can also use it with preprocessors, such as Sass, Stylus or LESS. - -### Actual data from Can I Use - -Autoprefixer uses the most recent data from [Can I Use](http://caniuse.com/), -understands which browsers are actual and popular and adds only the necessary -vendor prefixes. - -It also cleans your CSS from old prefixes (like prefixed `border-radius`, -produced by many CSS libraries): - -```css -a { - -webkit-border-radius: 5px; - border-radius: 5px -} -``` - -compiles to: - -```css -a { - border-radius: 5px -} -``` - -### Fast - -Autoprefixer is about 50 times faster than Compass and 10 times faster -than Stylus. - -On a Core i7 with 10 GB of RAM and SSD, benchmark with GitHub styles is: - -``` -~/Dev/autoprefixer$ ./node_modules/.bin/cake bench -Load GitHub styles -Autoprefixer: 257 ms -Compass: 13626 ms (53.0 times slower) -Rework: 213 ms (1.2 times faster) -Stylus: 2596 ms (10.1 times slower) -``` - -Unlike -prefix-free, Autoprefixer compiles CSS once on deploy and doesn’t hit -client-side performance. - -### Rewrite syntax - -Flexbox or gradients have different syntaxes in different browsers -(sometimes you need to recalculate angles, sometimes you need 2 old properties -instead of new one), but Autoprefixer hides this from you. - -Just code by latest W3C specs and Autoprefixer will produce the code -for old browsers: - -```css -a { - display: flex; -} -``` - -compiles to: - -```css -a { - display: -webkit-box; - display: -webkit-flex; - display: -moz-box; - display: -ms-flexbox; - display: flex -} -``` - -## Browsers - -You can specify the browsers you want to target in your project -(by default, it’s `last 2 versions`): - -```js -autoprefixer("last 1 version", "> 1%", "ie 8", "ie 7").compile(css); -``` - -* `last n versions` is last versions for each browser. Like “last 2 versions” - [strategy](http://support.google.com/a/bin/answer.py?answer=33864) in - Google. -* `> n%` is browser versions, selected by global usage statistics. -* `ff > 20` and `ff >= 20` is Firefox versions newer, that 20. -* `none` don’t set any browsers to clean CSS from any vendor prefixes. -* You can also set browsers directly. - -Blackberry and stock Android browsers will not be used in `last n versions`. -You can add them by name: - -```js -autoprefixer("last 1 version", "bb 10", "android 4").compile(css); -``` - -Browsers names are: - -You can get browsers codenames in -[data file](https://github.com/ai/autoprefixer/blob/master/data/browsers.coffee): -* `android` for old Android stock browser. -* `bb` for Blackberry browser. -* `chrome` for Google Chrome. -* `ff` for Mozilla Firefox. -* `ie` for Internet Explorer. -* `ios` for iOS Safari. -* `opera` for Opera. -* `safari` for desktop Safari. - -## Inspect - -You can check which browsers are selected and which properties will be prefixed: - -```js -inspect = autoprefixer("last 1 version").inspect(); -console.log(inspect); -``` - -## Usage - -### Ruby on Rails - -Add [autoprefixer-rails](https://github.com/ai/autoprefixer-rails) gem -to `Gemfile` and write CSS in a usual way: - -```ruby -gem "autoprefixer-rails" -``` - -### Middleman - -Add [middleman-autoprefixer](https://github.com/porada/middleman-autoprefixer) -gem to `Gemfile`: - -```ruby -gem "middleman-autoprefixer" -``` - -and activate the extension in your project’s `config.rb`: - -```ruby -activate :autoprefixer -``` - -### Ruby - -You can integrate Autoprefixer into your Sprockets environment -by `autoprefixer-rails` gem: - -```ruby -AutoprefixerRails.install(sprockets_env) -``` - -or process CSS from plain Ruby: - -```ruby -prefixed = AutoprefixerRails.compile(css) -``` - -### Grunt - -You can use the -[grunt-autoprefixer](https://github.com/nDmitry/grunt-autoprefixer) -plugin for Grunt. Install the npm package and add it to Gruntfile: - -```js -grunt.loadNpmTasks('grunt-autoprefixer'); -``` - -If you use Sass with `compress` output style and worry, that Autoprefixer -uncompress CSS, try [csso-grunt](https://github.com/t32k/grunt-csso). -It compress CSS back, but did it much better than Sass. - -### Prepros - -I you want to build your assets in GUI, try -[Prepros](http://alphapixels.com/prepros/). Just set “Auto Prefix CSS” -[checkbox](https://f.cloud.github.com/assets/3478693/930798/faa29892-0016-11e3-8901-87850de7aed2.jpg) -in right panel. - -### Compass - -If you use Compass binary to compile your styles, you can easy integrate -Autoprefixer with it. Install `autoprefixer-rails` gem: - -``` -gem install autoprefixer-rails csso-rails -``` - -and add post-compile hook to `config.rb`: - -```ruby -require 'autoprefixer-rails' -require 'csso' - -on_stylesheet_saved do |file| - css = File.read(file) - File.open(file, 'w') do |io| - io << Csso.optimize( AutoprefixerRails.compile(css) ) - end -end -``` - -If you use `compress` output style, Autoprefixer will uncompress CSS. -For this reason, we use [csso-rails](https://github.com/Vasfed/csso-rails) -to compress CSS back (it compress much better than Sass). - -If you need uncompressed CSS, remove `Csso.optimize` method call. - -You can set browsers array as second argument in `AutoprefixerRails.compile`. - -### Mincer - -To use Autoprefixer in [Mincer](https://github.com/nodeca/mincer), -install `autoprefixer` npm package and enable it: - -```js -environment.enable("autoprefixer"); -``` - -### Node.js - -Use `autoprefixer` npm package: - -```js -var autoprefixer = require('autoprefixer'); -var prefixed = autoprefixer.compile(css); -``` - -### JavaScript - -You can use Autoprefixer in the browser or a non-Node.js runtime -with [standalone version](https://raw.github.com/ai/autoprefixer-rails/master/vendor/autoprefixer.js). - -### Rework - -Autoprefixer can be also used as a -[Rework](https://github.com/visionmedia/rework) -filter, so you can combine it with other filters: - -```js -rework(css). - use( autoprefixer(['> 1%', 'opera 12.5']).rework ). - use( rework.references() ). - toString(); -``` - -### Sublime Text - -You can process your styles directly in Sublime Text with the -[sublime-autoprefixer](https://github.com/sindresorhus/sublime-autoprefixer) -plugin. - - -### Others - -You can use the `autoprefixer` binary to process CSS files using -any assets manager: - -``` -sudo npm install --global autoprefixer -autoprefixer *.css -``` - -See `autoprefixer -h` for help. - -## In-package Update - -I highly recommend to always have latest version of Autoprefixer. -But, some company has long test period before any libraries updater. -For this cases, you can update Can I Use data inside npm package: - -``` -autoprefixer --update -``` - -Note, that in-package update doesn’t get new properties or code fixes. It update -only browsers popularity and propeties support in new browsers versions. diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/bin/autoprefixer b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/bin/autoprefixer deleted file mode 100755 index e638a0b..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/bin/autoprefixer +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env node -(function() { - var Binary, binary; - - Binary = require('../lib/autoprefixer/binary'); - - binary = new Binary(process); - - binary.run(function() { - return process.exit(binary.status); - }); - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/data/browsers.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/data/browsers.js deleted file mode 100644 index 27f41d5..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/data/browsers.js +++ /dev/null @@ -1,53 +0,0 @@ -(function() { - module.exports = { - android: { - prefix: "-webkit-", - minor: true, - versions: [4.2, 4.1, 4, 3, 2.3, 2.2, 2.1], - popularity: [0.321169, 1.85246, 1.33629, 0.00573516, 1.95569, 0.17779, 0.0802922] - }, - bb: { - prefix: "-webkit-", - minor: true, - versions: [10, 7], - popularity: [0, 0.135764] - }, - chrome: { - prefix: "-webkit-", - future: [31, 30], - versions: [29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4], - popularity: [0.140505, 19.3814, 11.5297, 0.652935, 0.44631, 0.371925, 0.322335, 0.28101, 0.520695, 0.08265, 0.08265, 0.123975, 0.08265, 0.090915, 0.123975, 0.09918, 0.107445, 0.11571, 0.1653, 0.090915, 0.024795, 0.03306, 0.024795, 0.03306, 0.024795, 0.024795] - }, - ff: { - prefix: "-moz-", - future: [25, 24], - versions: [23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3.6, 3.5, 3, 2], - popularity: [0.421515, 11.1578, 1.69432, 0.31407, 0.21489, 0.18183, 0.23142, 0.438045, 0.23142, 0.13224, 0.13224, 0.256215, 0.123975, 0.13224, 0.074385, 0.074385, 0.04959, 0.057855, 0.057855, 0.090915, 0.305805, 0.04959, 0.090915, 0.024795] - }, - ie: { - prefix: "-ms-", - future: [11], - versions: [10, 9, 8, 7, 6, 5.5], - popularity: [9.16887, 4.45849, 6.40646, 0.369442, 0.167928, 0.009298] - }, - ios: { - prefix: "-webkit-", - future: [7], - versions: [6, 6.1, 5, 5.1, 4.2, 4.3, 4, 4.1, 3.2], - popularity: [3.541995, 3.541995, 0.3241295, 0.3241295, 0.03905175, 0.03905175, 0.00781035, 0.00781035, 0.00781035] - }, - opera: { - prefix: "-o-", - future: [16], - versions: [15, 12.1, 12, 11.6, 11.5, 11.1, 11, 10.6, 10.5, 10, 10.1, 9.5, 9.6], - popularity: [0.074385, 0.59508, 0.057855, 0.041325, 0.01653, 0.008265, 0.008265, 0.008265, 0.008392, 0.0123975, 0.0123975, 0.0041325, 0.0041325] - }, - safari: { - prefix: "-webkit-", - future: [7], - versions: [6, 5.1, 5, 4, 3.2, 3.1], - popularity: [2.01666, 1.23149, 0.36366, 0.107445, 0.008692, 0] - } - }; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/data/prefixes.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/data/prefixes.js deleted file mode 100644 index 79b760a..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/data/prefixes.js +++ /dev/null @@ -1,256 +0,0 @@ -(function() { - module.exports = { - "::placeholder": { - selector: true, - browsers: ["chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ie 10", "ie 11", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "::selection": { - selector: true, - browsers: ["ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25"] - }, - ":fullscreen": { - selector: true, - browsers: ["chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ie 11", "opera 15", "opera 16", "safari 5.1", "safari 6", "safari 7"] - }, - "@keyframes": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "align-content": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "align-items": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "align-self": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - animation: { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "animation-delay": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "animation-direction": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "animation-duration": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "animation-fill-mode": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "animation-iteration-count": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "animation-name": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "animation-play-state": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "animation-timing-function": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 12", "opera 15", "opera 16", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "backface-visibility": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ie 9", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "background-clip": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "ff 3.6", "opera 10", "opera 10.1"] - }, - "background-origin": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "ff 3.6", "opera 10", "opera 10.1"] - }, - "background-size": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "ff 3.6", "opera 10", "opera 10.1"] - }, - "border-bottom-left-radius": { - browsers: ["android 2.1", "chrome 4", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ios 3.2", "safari 3.1", "safari 3.2", "safari 4"], - transition: true - }, - "border-bottom-right-radius": { - browsers: ["android 2.1", "chrome 4", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ios 3.2", "safari 3.1", "safari 3.2", "safari 4"], - transition: true - }, - "border-image": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 12.1", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1"] - }, - "border-radius": { - browsers: ["android 2.1", "chrome 4", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ios 3.2", "safari 3.1", "safari 3.2", "safari 4"], - transition: true - }, - "border-top-left-radius": { - browsers: ["android 2.1", "chrome 4", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ios 3.2", "safari 3.1", "safari 3.2", "safari 4"], - transition: true - }, - "border-top-right-radius": { - browsers: ["android 2.1", "chrome 4", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ios 3.2", "safari 3.1", "safari 3.2", "safari 4"], - transition: true - }, - "box-shadow": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "bb 7", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "ff 3.5", "ff 3.6", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "safari 3.1", "safari 3.2", "safari 4", "safari 5"], - transition: true - }, - "box-sizing": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "bb 7", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "safari 3.1", "safari 3.2", "safari 4", "safari 5"] - }, - "break-after": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "break-before": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "break-inside": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - calc: { - props: ["*"], - browsers: ["bb 10", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 6", "ios 6.1", "safari 6"] - }, - "column-count": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "column-fill": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "column-gap": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "column-rule": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "column-rule-color": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "column-rule-style": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "column-rule-width": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "column-span": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "column-width": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - columns: { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "display-flex": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - filter: { - browsers: ["bb 10", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 6", "safari 7"], - transition: true - }, - flex: { - transition: true, - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "flex-basis": { - transition: true, - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "flex-direction": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "flex-flow": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "flex-grow": { - transition: true, - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "flex-shrink": { - transition: true, - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "flex-wrap": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "font-feature-settings": { - browsers: ["bb 10", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 7", "opera 15", "opera 16", "safari 7"] - }, - "font-kerning": { - browsers: ["bb 10", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 7", "opera 15", "opera 16", "safari 7"] - }, - "font-language-override": { - browsers: ["bb 10", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 7", "opera 15", "opera 16", "safari 7"] - }, - "font-variant-ligatures": { - browsers: ["bb 10", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ios 7", "opera 15", "opera 16", "safari 7"] - }, - hyphens: { - browsers: ["ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ie 10", "ie 11", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "safari 5.1", "safari 6", "safari 7"] - }, - "justify-content": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - "linear-gradient": { - props: ["background", "background-image", "border-image"], - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - order: { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ie 10", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - perspective: { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ie 9", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "perspective-origin": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ie 9", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "radial-gradient": { - props: ["background", "background-image", "border-image"], - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - "repeating-linear-gradient": { - props: ["background", "background-image", "border-image"], - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - "repeating-radial-gradient": { - props: ["background", "background-image", "border-image"], - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - "tab-size": { - browsers: ["ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 12.1"] - }, - transform: { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ie 9", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "transform-origin": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ie 9", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"], - transition: true - }, - "transform-style": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ie 9", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - }, - transition: { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - "transition-delay": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - "transition-duration": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - "transition-property": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - "transition-timing-function": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 4", "chrome 5", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "opera 10.5", "opera 10.6", "opera 11", "opera 11.1", "opera 11.5", "opera 11.6", "opera 12", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6"] - }, - "user-select": { - browsers: ["android 2.1", "android 2.2", "android 2.3", "android 3", "android 4", "android 4.1", "android 4.2", "bb 7", "bb 10", "chrome 6", "chrome 7", "chrome 8", "chrome 9", "chrome 10", "chrome 11", "chrome 12", "chrome 13", "chrome 14", "chrome 15", "chrome 16", "chrome 17", "chrome 18", "chrome 19", "chrome 20", "chrome 21", "chrome 22", "chrome 23", "chrome 24", "chrome 25", "chrome 26", "chrome 27", "chrome 28", "chrome 29", "chrome 30", "chrome 31", "ff 2", "ff 3", "ff 3.5", "ff 3.6", "ff 4", "ff 5", "ff 6", "ff 7", "ff 8", "ff 9", "ff 10", "ff 11", "ff 12", "ff 13", "ff 14", "ff 15", "ff 16", "ff 17", "ff 18", "ff 19", "ff 20", "ff 21", "ff 22", "ff 23", "ff 24", "ff 25", "ie 10", "ie 11", "ios 3.2", "ios 4", "ios 4.1", "ios 4.2", "ios 4.3", "ios 5", "ios 5.1", "ios 6", "ios 6.1", "ios 7", "opera 15", "opera 16", "safari 3.1", "safari 3.2", "safari 4", "safari 5", "safari 5.1", "safari 6", "safari 7"] - } - }; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer.js deleted file mode 100644 index f6e9066..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer.js +++ /dev/null @@ -1,105 +0,0 @@ -(function() { - var Autoprefixer, Browsers, CSS, Prefixes, autoprefixer, inspectCache, parse, stringify, - __slice = [].slice, - __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - parse = require('css-parse'); - - stringify = require('css-stringify'); - - Browsers = require('./autoprefixer/browsers'); - - Prefixes = require('./autoprefixer/prefixes'); - - CSS = require('./autoprefixer/css'); - - inspectCache = null; - - autoprefixer = function() { - var browsers, prefixes, reqs; - reqs = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - if (reqs.length === 0 || (reqs.length === 1 && (reqs[0] == null))) { - reqs = void 0; - } else if (reqs.length === 1 && reqs[0] instanceof Array) { - reqs = reqs[0]; - } - browsers = new Browsers(autoprefixer.data.browsers, reqs); - prefixes = new Prefixes(autoprefixer.data.prefixes, browsers); - return new Autoprefixer(prefixes, autoprefixer.data); - }; - - autoprefixer.data = { - browsers: require('../data/browsers'), - prefixes: require('../data/prefixes') - }; - - Autoprefixer = (function() { - function Autoprefixer(prefixes, data) { - this.prefixes = prefixes; - this.data = data; - this.rework = __bind(this.rework, this); - this.browsers = this.prefixes.browsers.selected; - } - - Autoprefixer.prototype.compile = function(str) { - var nodes, - _this = this; - nodes = this.catchParseErrors(function() { - return parse(_this.removeBadComments(str)); - }); - this.rework(nodes.stylesheet); - return stringify(nodes); - }; - - Autoprefixer.prototype.rework = function(stylesheet) { - var css; - css = new CSS(stylesheet); - this.prefixes.processor.add(css); - return this.prefixes.processor.remove(css); - }; - - Autoprefixer.prototype.inspect = function() { - inspectCache || (inspectCache = require('./autoprefixer/inspect')); - return inspectCache(this.prefixes); - }; - - Autoprefixer.prototype.catchParseErrors = function(callback) { - var e, error; - try { - return callback(); - } catch (_error) { - e = _error; - error = new Error("Can't parse CSS: " + e.message); - error.stack = e.stack; - error.css = true; - throw error; - } - }; - - Autoprefixer.prototype.removeBadComments = function(css) { - return css.replace(/\/\*[^\*]*\}[^\*]*\*\//g, ''); - }; - - return Autoprefixer; - - })(); - - autoprefixer["default"] = function() { - return this.instance || (this.instance = autoprefixer()); - }; - - autoprefixer.compile = function(str) { - return this["default"]().compile(str); - }; - - autoprefixer.rework = function(stylesheet) { - return this["default"]().rework(stylesheet); - }; - - autoprefixer.inspect = function() { - return this["default"]().inspect(); - }; - - module.exports = autoprefixer; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/binary.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/binary.js deleted file mode 100644 index 960b7c9..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/binary.js +++ /dev/null @@ -1,245 +0,0 @@ -(function() { - var Binary, autoprefixer, fs; - - autoprefixer = require('../autoprefixer'); - - fs = require('fs'); - - Binary = (function() { - function Binary(process) { - this["arguments"] = process.argv.slice(2); - this.stdin = process.stdin; - this.stderr = process.stderr; - this.stdout = process.stdout; - this.status = 0; - this.command = 'compile'; - this.inputFiles = []; - this.parseArguments(); - } - - Binary.prototype.help = function() { - var h; - h = []; - h.push('Usage: autoprefixer [OPTION...] FILES'); - h.push(''); - h.push('Parse CSS files and add prefixed properties and values.'); - h.push(''); - h.push('Options:'); - h.push(' -b, --browsers BROWSERS add prefixes for selected browsers'); - h.push(' -o, --output FILE set output CSS file'); - h.push(' -i, --inspect show selected browsers and properties'); - h.push(' -h, --help show help text'); - h.push(' -v, --version print program version'); - return h.join("\n"); - }; - - Binary.prototype.desc = function() { - var h; - h = []; - h.push('Files:'); - h.push(" By default, prefixed CSS will rewrite original files."); - h.push(" If you didn't set input files, " + "autoprefixer will read from stdin stream."); - h.push(" Output CSS will be written to stdout stream on " + "`-o -' argument or stdin input."); - h.push(''); - h.push('Browsers:'); - h.push(' Separate browsers by comma. For example, ' + "`-b \"> 1%, opera 12\"."); - h.push(" You can set browsers by global usage statictics: " + "`-b \"> 1%\"'"); - h.push(" or last version: `-b \"last 2 versions\"' (by default)."); - return h.join("\n"); - }; - - Binary.prototype.print = function(str) { - str = str.replace(/\n$/, ''); - return this.stdout.write(str + "\n"); - }; - - Binary.prototype.error = function(str) { - this.status = 1; - return this.stderr.write(str + "\n"); - }; - - Binary.prototype.version = function() { - return require('../../package.json').version; - }; - - Binary.prototype.parseArguments = function() { - var arg, args, _results; - args = this["arguments"].slice(); - _results = []; - while (args.length > 0) { - arg = args.shift(); - if (arg === '-h' || arg === '--help') { - _results.push(this.command = 'showHelp'); - } else if (arg === '-v' || arg === '--version') { - _results.push(this.command = 'showVersion'); - } else if (arg === '-i' || arg === '--inspect') { - _results.push(this.command = 'inspect'); - } else if (arg === '-u' || arg === '--update') { - _results.push(this.command = 'update'); - } else if (arg === '-b' || arg === '--browsers') { - _results.push(this.requirements = args.shift().split(',').map(function(i) { - return i.trim(); - })); - } else if (arg === '-o' || arg === '--output') { - _results.push(this.outputFile = args.shift()); - } else if (arg.match(/^-\w$/) || arg.match(/^--\w[\w-]+$/)) { - this.command = void 0; - this.error("autoprefixer: Unknown argument " + arg); - this.error(''); - _results.push(this.error(this.help())); - } else { - _results.push(this.inputFiles.push(arg)); - } - } - return _results; - }; - - Binary.prototype.showHelp = function(done) { - this.print(this.help()); - this.print(''); - this.print(this.desc()); - return done(); - }; - - Binary.prototype.showVersion = function(done) { - this.print("autoprefixer " + (this.version())); - return done(); - }; - - Binary.prototype.inspect = function(done) { - this.print(this.compiler().inspect()); - return done(); - }; - - Binary.prototype.update = function(done) { - var coffee, updater, - _this = this; - try { - coffee = require('coffee-script'); - } catch (_error) { - this.error("Install coffee-script npm package"); - return done(); - } - updater = require('./updater'); - updater.request(function() { - return _this.stdout.write('.'); - }); - updater.done(function() { - _this.print(''); - if (updater.changed.length === 0) { - _this.print('Everything up-to-date'); - } else { - _this.print('Update ' + updater.changed.join(' and ') + ' data'); - } - return done(); - }); - return updater.run(); - }; - - Binary.prototype.startWork = function() { - return this.waiting += 1; - }; - - Binary.prototype.endWork = function() { - this.waiting -= 1; - if (this.waiting <= 0) { - return this.doneCallback(); - } - }; - - Binary.prototype.compiler = function() { - return this.compilerCache || (this.compilerCache = autoprefixer(this.requirements)); - }; - - Binary.prototype.compileCSS = function(css, file) { - var error, prefixed, - _this = this; - try { - prefixed = this.compiler().compile(css); - } catch (_error) { - error = _error; - if (error.autoprefixer || error.css) { - this.error("autoprefixer: " + error.message); - } else { - this.error('autoprefixer: Internal error'); - } - if (error.css || !error.autoprefixer) { - if (error.stack != null) { - this.error(''); - this.error(error.stack); - } - } - } - if (!prefixed) { - return this.endWork(); - } - if (file === '-') { - this.print(prefixed); - return this.endWork(); - } else { - return fs.writeFile(file, prefixed, function(error) { - if (error) { - _this.error("autoprefixer: " + error); - } - return _this.endWork(); - }); - } - }; - - Binary.prototype.compile = function(done) { - var css, file, _fn, _i, _len, _ref, - _this = this; - this.waiting = 0; - this.doneCallback = done; - if (this.inputFiles.length === 0) { - this.startWork(); - this.outputFile || (this.outputFile = '-'); - css = ''; - this.stdin.resume(); - this.stdin.on('data', function(chunk) { - return css += chunk; - }); - return this.stdin.on('end', function() { - return _this.compileCSS(css, _this.outputFile); - }); - } else { - fs = require('fs'); - _ref = this.inputFiles; - _fn = function(file) { - return fs.readFile(file, function(error, css) { - if (error) { - return _this.error("autoprefixer: " + error); - } else { - css = css.toString(); - return _this.compileCSS(css, _this.outputFile || file); - } - }); - }; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - this.startWork(); - if (!fs.existsSync(file)) { - this.error("autoprefixer: File " + file + " doesn't exists"); - this.endWork(); - return; - } - _fn(file); - } - } - }; - - Binary.prototype.run = function(done) { - if (this.command) { - return this[this.command](done); - } else { - return done(); - } - }; - - return Binary; - - })(); - - module.exports = Binary; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/browsers.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/browsers.js deleted file mode 100644 index ef8cb6c..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/browsers.js +++ /dev/null @@ -1,160 +0,0 @@ -(function() { - var Browsers, utils; - - utils = require('./utils'); - - Browsers = (function() { - function Browsers(data, requirements) { - this.data = data; - this.selected = this.parse(requirements); - } - - Browsers.prototype.parse = function(requirements) { - var selected, - _this = this; - if (requirements == null) { - requirements = ['last 2 versions']; - } - if (!(requirements instanceof Array)) { - requirements = [requirements]; - } - selected = []; - requirements.map(function(req) { - var i, match, name, _ref; - _ref = _this.requirements; - for (name in _ref) { - i = _ref[name]; - if (match = req.match(i.regexp)) { - selected = selected.concat(i.select.apply(_this, match.slice(1))); - return; - } - } - return utils.error("Unknown browser requirement `" + req + "`"); - }); - return utils.uniq(selected); - }; - - Browsers.prototype.requirements = { - none: { - regexp: /^none$/i, - select: function() { - return []; - } - }, - lastVersions: { - regexp: /^last (\d+) versions?$/i, - select: function(versions) { - return this.browsers(function(data) { - if (data.minor) { - return []; - } else { - return data.versions.slice(0, versions); - } - }); - } - }, - globalStatistics: { - regexp: /^> (\d+(\.\d+)?)%$/, - select: function(popularity) { - return this.browsers(function(data) { - return data.versions.filter(function(version, i) { - return data.popularity[i] > popularity; - }); - }); - } - }, - newerThen: { - regexp: /^(\w+) (>=?)\s*([\d\.]+)/, - select: function(browser, sign, version) { - var data, filter; - data = this.data[browser]; - version = parseFloat(version); - if (!data) { - utils.error("Unknown browser " + browser); - } - if (sign === '>') { - filter = function(v) { - return v > version; - }; - } else if (sign === '>=') { - filter = function(v) { - return v >= version; - }; - } - return data.versions.filter(filter).map(function(v) { - return "" + browser + " " + v; - }); - } - }, - direct: { - regexp: /^(\w+) ([\d\.]+)$/, - select: function(browser, version) { - var data, first, last; - data = this.data[browser]; - version = parseFloat(version); - if (!data) { - utils.error("Unknown browser " + browser); - } - last = data.future ? data.future[0] : data.versions[0]; - first = data.versions[data.versions.length - 1]; - if (version > last) { - version = last; - } else if (version < first) { - version = first; - } - return ["" + browser + " " + version]; - } - } - }; - - Browsers.prototype.browsers = function(criteria) { - var browser, data, selected, versions, _ref; - selected = []; - _ref = this.data; - for (browser in _ref) { - data = _ref[browser]; - versions = criteria(data).map(function(version) { - return "" + browser + " " + version; - }); - selected = selected.concat(versions); - } - return selected; - }; - - Browsers.prototype.prefixes = function() { - var i, name; - return this.prefixesCache || (this.prefixesCache = utils.uniq((function() { - var _ref, _results; - _ref = this.data; - _results = []; - for (name in _ref) { - i = _ref[name]; - _results.push(i.prefix); - } - return _results; - }).call(this)).sort(function(a, b) { - return b.length - a.length; - })); - }; - - Browsers.prototype.prefix = function(browser) { - var name, version, _ref; - _ref = browser.split(' '), name = _ref[0], version = _ref[1]; - if (name === 'opera' && parseFloat(version) >= 15) { - return '-webkit-'; - } else { - return this.data[name].prefix; - } - }; - - Browsers.prototype.isSelected = function(browser) { - return this.selected.indexOf(browser) !== -1; - }; - - return Browsers; - - })(); - - module.exports = Browsers; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/css.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/css.js deleted file mode 100644 index 744a75e..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/css.js +++ /dev/null @@ -1,63 +0,0 @@ -(function() { - var CSS, Declaration, Keyframes, Rules; - - Rules = require('./rules'); - - Keyframes = require('./keyframes'); - - Declaration = require('./declaration'); - - CSS = (function() { - function CSS(stylesheet) { - this.stylesheet = stylesheet; - } - - CSS.prototype.eachKeyframes = function(callback) { - var rule; - this.number = 0; - while (this.number < this.stylesheet.rules.length) { - rule = this.stylesheet.rules[this.number]; - if (rule.keyframes) { - callback(new Keyframes(this, this.number, rule)); - } - this.number += 1; - } - return false; - }; - - CSS.prototype.containKeyframes = function(rule) { - return this.stylesheet.rules.some(function(i) { - return i.keyframes && i.name === rule.name && i.vendor === rule.vendor; - }); - }; - - CSS.prototype.addKeyframes = function(position, rule) { - if (this.containKeyframes(rule)) { - return; - } - this.stylesheet.rules.splice(position, 0, rule); - return this.number += 1; - }; - - CSS.prototype.removeKeyframes = function(position) { - this.stylesheet.rules.splice(position, 1); - return this.number -= 1; - }; - - CSS.prototype.eachRule = function(callback) { - return Rules.each(this.stylesheet.rules, callback); - }; - - CSS.prototype.eachDeclaration = function(callback) { - return this.eachRule(function(rule) { - return rule.each(callback); - }); - }; - - return CSS; - - })(); - - module.exports = CSS; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/declaration.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/declaration.js deleted file mode 100644 index 5ae9919..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/declaration.js +++ /dev/null @@ -1,124 +0,0 @@ -(function() { - var Declaration, utils; - - utils = require('./utils'); - - Declaration = (function() { - Declaration.register = function(klass) { - var name, _i, _len, _ref, _results; - _ref = klass.names; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - name = _ref[_i]; - _results.push(this.hacks[name] = klass); - } - return _results; - }; - - Declaration.hacks = {}; - - Declaration.load = function(rule, number, node) { - var klass, prefix, unprefixed, _ref; - _ref = this.split(node.property), prefix = _ref[0], unprefixed = _ref[1]; - klass = this.hacks[unprefixed]; - if (klass) { - return new klass(rule, number, node, prefix, unprefixed); - } else { - return new Declaration(rule, number, node, prefix, unprefixed); - } - }; - - Declaration.split = function(prop) { - var prefix, separator, unprefixed; - if (prop[0] === '-') { - separator = prop.indexOf('-', 1) + 1; - prefix = prop.slice(0, separator); - unprefixed = prop.slice(separator); - return [prefix, unprefixed]; - } else { - return ['', prop]; - } - }; - - function Declaration(rule, number, node, prefix, unprefixed) { - this.rule = rule; - this.number = number; - this.node = node; - this.prefix = prefix; - this.unprefixed = unprefixed; - this.prop = this.node.property; - this.value = this.node.value; - this.valuesCache = {}; - } - - Declaration.prototype.valueContain = function(strings) { - var _this = this; - return strings.some(function(i) { - return _this.value.indexOf(i) !== -1; - }); - }; - - Declaration.prototype.prefixProp = function(prefix, value) { - if (value == null) { - value = this.value; - } - if (this.rule.contain(prefix + this.unprefixed)) { - return; - } - return this.insertBefore(prefix + this.unprefixed, value); - }; - - Declaration.prototype.insertBefore = function(prop, value) { - var clone; - if (this.rule.contain(prop, value)) { - return; - } - clone = utils.clone(this.node, { - property: prop, - value: value - }); - this.rule.add(this.number, clone); - return this.number += 1; - }; - - Declaration.prototype.remove = function() { - return this.rule.removeDecl(this.number); - }; - - Declaration.prototype.prefixValue = function(prefix, value) { - var val; - val = this.valuesCache[prefix] || this.value; - return this.valuesCache[prefix] = value.addPrefix(prefix, val); - }; - - Declaration.prototype.setValue = function(value) { - return this.value = this.node.value = value; - }; - - Declaration.prototype.saveValues = function() { - var prefix, value, _ref, _results; - _ref = this.valuesCache; - _results = []; - for (prefix in _ref) { - value = _ref[prefix]; - if (this.rule.prefix && prefix !== this.rule.prefix) { - continue; - } - if (prefix === this.prefix) { - _results.push(this.setValue(value)); - } else if (!this.rule.byProp(prefix + this.unprefixed)) { - _results.push(this.insertBefore(this.prop, value)); - } else { - _results.push(void 0); - } - } - return _results; - }; - - return Declaration; - - })(); - - module.exports = Declaration; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-content.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-content.js deleted file mode 100644 index 31a84b1..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-content.js +++ /dev/null @@ -1,44 +0,0 @@ -(function() { - var AlignContent, FlexDeclaration, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - AlignContent = (function(_super) { - __extends(AlignContent, _super); - - AlignContent.names = ['align-content', 'flex-line-pack']; - - AlignContent.oldValues = { - 'flex-end': 'end', - 'flex-start': 'start', - 'space-between': 'justify', - 'space-around': 'distribute' - }; - - function AlignContent() { - AlignContent.__super__.constructor.apply(this, arguments); - this.unprefixed = 'align-content'; - this.prop = this.prefix + this.unprefixed; - } - - AlignContent.prototype.prefixProp = function(prefix) { - var oldValue, spec; - spec = this.flexSpec(prefix); - if (spec.v2012) { - oldValue = AlignContent.oldValues[this.value] || this.value; - this.insertBefore(prefix + 'flex-line-pack', oldValue); - } - if (spec.final) { - return AlignContent.__super__.prefixProp.apply(this, arguments); - } - }; - - return AlignContent; - - })(FlexDeclaration); - - module.exports = AlignContent; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-items.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-items.js deleted file mode 100644 index 681f60f..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-items.js +++ /dev/null @@ -1,45 +0,0 @@ -(function() { - var AlignItems, FlexDeclaration, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - AlignItems = (function(_super) { - __extends(AlignItems, _super); - - AlignItems.names = ['align-items', 'flex-align', 'box-align']; - - AlignItems.oldValues = { - 'flex-end': 'end', - 'flex-start': 'start' - }; - - function AlignItems() { - AlignItems.__super__.constructor.apply(this, arguments); - this.unprefixed = 'align-items'; - this.prop = this.prefix + this.unprefixed; - } - - AlignItems.prototype.prefixProp = function(prefix) { - var oldValue, spec; - spec = this.flexSpec(prefix); - oldValue = AlignItems.oldValues[this.value] || this.value; - if (spec.v2009) { - this.insertBefore(prefix + 'box-align', oldValue); - } - if (spec.v2012) { - this.insertBefore(prefix + 'flex-align', oldValue); - } - if (spec.final) { - return AlignItems.__super__.prefixProp.apply(this, arguments); - } - }; - - return AlignItems; - - })(FlexDeclaration); - - module.exports = AlignItems; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-self.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-self.js deleted file mode 100644 index aa221a6..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/align-self.js +++ /dev/null @@ -1,42 +0,0 @@ -(function() { - var AlignSelf, FlexDeclaration, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - AlignSelf = (function(_super) { - __extends(AlignSelf, _super); - - AlignSelf.names = ['align-self', 'flex-item-align']; - - AlignSelf.oldValues = { - 'flex-end': 'end', - 'flex-start': 'start' - }; - - function AlignSelf() { - AlignSelf.__super__.constructor.apply(this, arguments); - this.unprefixed = 'align-self'; - this.prop = this.prefix + this.unprefixed; - } - - AlignSelf.prototype.prefixProp = function(prefix) { - var oldValue, spec; - spec = this.flexSpec(prefix); - if (spec.v2012) { - oldValue = AlignSelf.oldValues[this.value] || this.value; - this.insertBefore(prefix + 'flex-item-align', oldValue); - } - if (spec.final) { - return AlignSelf.__super__.prefixProp.apply(this, arguments); - } - }; - - return AlignSelf; - - })(FlexDeclaration); - - module.exports = AlignSelf; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/background-clip.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/background-clip.js deleted file mode 100644 index 89598e9..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/background-clip.js +++ /dev/null @@ -1,26 +0,0 @@ -(function() { - var BackgroundClip, Declaration, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - Declaration = require('../declaration'); - - BackgroundClip = (function(_super) { - __extends(BackgroundClip, _super); - - BackgroundClip.names = ['background-clip']; - - function BackgroundClip() { - BackgroundClip.__super__.constructor.apply(this, arguments); - if (this.value.indexOf('text') !== -1) { - this.unprefixed = this.prop = '-nonstandard-background-clip'; - } - } - - return BackgroundClip; - - })(Declaration); - - module.exports = BackgroundClip; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/border-image.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/border-image.js deleted file mode 100644 index 5871005..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/border-image.js +++ /dev/null @@ -1,28 +0,0 @@ -(function() { - var BorderImage, Declaration, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - Declaration = require('../declaration'); - - BorderImage = (function(_super) { - __extends(BorderImage, _super); - - function BorderImage() { - _ref = BorderImage.__super__.constructor.apply(this, arguments); - return _ref; - } - - BorderImage.names = ['border-image']; - - BorderImage.prototype.prefixProp = function(prefix) { - return BorderImage.__super__.prefixProp.call(this, prefix, this.value.replace(/\s+fill(\s)/, '$1')); - }; - - return BorderImage; - - })(Declaration); - - module.exports = BorderImage; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/border-radius.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/border-radius.js deleted file mode 100644 index af80340..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/border-radius.js +++ /dev/null @@ -1,61 +0,0 @@ -(function() { - var BorderRadius, Declaration, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - Declaration = require('../declaration'); - - BorderRadius = (function(_super) { - var hor, mozilla, normal, ver, _i, _j, _len, _len1, _ref, _ref1; - - __extends(BorderRadius, _super); - - BorderRadius.names = ['border-radius']; - - BorderRadius.toMozilla = {}; - - BorderRadius.toNormal = {}; - - _ref = ['top', 'bottom']; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - ver = _ref[_i]; - _ref1 = ['left', 'right']; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - hor = _ref1[_j]; - normal = "border-" + ver + "-" + hor + "-radius"; - mozilla = "border-radius-" + ver + hor; - BorderRadius.names.push(normal); - BorderRadius.names.push(mozilla); - BorderRadius.toMozilla[normal] = mozilla; - BorderRadius.toNormal[mozilla] = normal; - } - } - - function BorderRadius() { - BorderRadius.__super__.constructor.apply(this, arguments); - if (this.prefix === '-moz-') { - this.unprefixed = BorderRadius.toNormal[this.unprefixed] || this.unprefixed; - this.prop = this.prefix + this.unprefixed; - } - } - - BorderRadius.prototype.prefixProp = function(prefix) { - var prop; - if (prefix === '-moz-') { - prop = BorderRadius.toMozilla[this.unprefixed] || this.unprefixed; - if (this.rule.contain(prefix + prop)) { - return; - } - return this.insertBefore(prefix + prop, this.value); - } else { - return BorderRadius.__super__.prefixProp.apply(this, arguments); - } - }; - - return BorderRadius; - - })(Declaration); - - module.exports = BorderRadius; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/display-flex.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/display-flex.js deleted file mode 100644 index aafb4a1..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/display-flex.js +++ /dev/null @@ -1,59 +0,0 @@ -(function() { - var DisplayFlex, FlexDeclaration, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - DisplayFlex = (function(_super) { - __extends(DisplayFlex, _super); - - DisplayFlex.names = ['display']; - - function DisplayFlex() { - var name, prefix, _ref; - DisplayFlex.__super__.constructor.apply(this, arguments); - _ref = FlexDeclaration.split(this.value), prefix = _ref[0], name = _ref[1]; - if (name === 'flex' || name === 'box' || name === 'flexbox') { - this.prefix = prefix; - this.unprefixed = 'display-flex'; - this.prop = this.prefix + this.unprefixed; - } else if (name === 'inline-flex' || name === 'inline-flexbox') { - this.prefix = prefix; - this.unprefixed = 'display-flex'; - this.prop = this.prefix + this.unprefixed; - this.inline = true; - } - } - - DisplayFlex.prototype.prefixProp = function(prefix) { - var spec; - if (this.unprefixed !== 'display-flex') { - return DisplayFlex.__super__.prefixProp.apply(this, arguments); - } else { - spec = this.flexSpec(prefix); - if (spec.v2009) { - if (!this.inline) { - this.prefixDisplay(prefix, 'box'); - } - } - if (spec.v2012) { - this.prefixDisplay(prefix, this.inline ? 'inline-flexbox' : 'flexbox'); - } - if (spec.final) { - return this.prefixDisplay(prefix, this.inline ? 'inline-flex' : 'flex'); - } - } - }; - - DisplayFlex.prototype.prefixDisplay = function(prefix, name) { - return this.insertBefore('display', prefix + name); - }; - - return DisplayFlex; - - })(FlexDeclaration); - - module.exports = DisplayFlex; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/filter.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/filter.js deleted file mode 100644 index fd586a2..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/filter.js +++ /dev/null @@ -1,26 +0,0 @@ -(function() { - var Declaration, Filter, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - Declaration = require('../declaration'); - - Filter = (function(_super) { - __extends(Filter, _super); - - Filter.names = ['filter']; - - function Filter() { - Filter.__super__.constructor.apply(this, arguments); - if (this.value.indexOf('DXImageTransform.Microsoft') !== -1) { - this.unprefixed = this.prop = '-ms-filter'; - } - } - - return Filter; - - })(Declaration); - - module.exports = Filter; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-basis.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-basis.js deleted file mode 100644 index 9e9970c..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-basis.js +++ /dev/null @@ -1,35 +0,0 @@ -(function() { - var FlexBasis, FlexDeclaration, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - FlexBasis = (function(_super) { - __extends(FlexBasis, _super); - - function FlexBasis() { - _ref = FlexBasis.__super__.constructor.apply(this, arguments); - return _ref; - } - - FlexBasis.names = ['flex-basis']; - - FlexBasis.prototype.prefixProp = function(prefix) { - var spec; - spec = this.flexSpec(prefix); - if (spec.v2012) { - this.insertBefore(prefix + 'flex', '0 1 ' + this.value); - } - if (spec.final) { - return FlexBasis.__super__.prefixProp.apply(this, arguments); - } - }; - - return FlexBasis; - - })(FlexDeclaration); - - module.exports = FlexBasis; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-declaration.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-declaration.js deleted file mode 100644 index 7218199..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-declaration.js +++ /dev/null @@ -1,30 +0,0 @@ -(function() { - var Declaration, FlexDeclaration, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - Declaration = require('../declaration'); - - FlexDeclaration = (function(_super) { - __extends(FlexDeclaration, _super); - - function FlexDeclaration() { - _ref = FlexDeclaration.__super__.constructor.apply(this, arguments); - return _ref; - } - - FlexDeclaration.prototype.flexSpec = function(prefix) { - return { - v2009: prefix === '-webkit-' || prefix === '-moz-', - v2012: prefix === '-ms-', - final: prefix === '-webkit-' - }; - }; - - return FlexDeclaration; - - })(Declaration); - - module.exports = FlexDeclaration; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-direction.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-direction.js deleted file mode 100644 index 35c7f98..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-direction.js +++ /dev/null @@ -1,37 +0,0 @@ -(function() { - var FlexDeclaration, FlexDirection, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - FlexDirection = (function(_super) { - __extends(FlexDirection, _super); - - FlexDirection.names = ['flex-direction', 'box-direction', 'box-orient']; - - function FlexDirection() { - FlexDirection.__super__.constructor.apply(this, arguments); - this.unprefixed = 'flex-direction'; - this.prop = this.prefix + this.unprefixed; - } - - FlexDirection.prototype.prefixProp = function(prefix) { - var spec; - spec = this.flexSpec(prefix); - if (spec.v2009) { - this.insertBefore(prefix + 'box-orient', this.value.indexOf('row') !== -1 ? 'horizontal' : 'vertical'); - this.insertBefore(prefix + 'box-direction', this.value.indexOf('reverse') !== -1 ? 'reverse' : 'normal'); - } - if (spec.v2012 || spec.final) { - return FlexDirection.__super__.prefixProp.apply(this, arguments); - } - }; - - return FlexDirection; - - })(FlexDeclaration); - - module.exports = FlexDirection; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-flow.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-flow.js deleted file mode 100644 index eec557d..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-flow.js +++ /dev/null @@ -1,35 +0,0 @@ -(function() { - var FlexDeclaration, FlexFlow, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - FlexFlow = (function(_super) { - __extends(FlexFlow, _super); - - function FlexFlow() { - _ref = FlexFlow.__super__.constructor.apply(this, arguments); - return _ref; - } - - FlexFlow.names = ['flex-flow']; - - FlexFlow.prototype.prefixProp = function(prefix) { - var spec; - spec = this.flexSpec(prefix); - if (spec.v2012) { - FlexFlow.__super__.prefixProp.apply(this, arguments); - } - if (spec.final) { - return FlexFlow.__super__.prefixProp.apply(this, arguments); - } - }; - - return FlexFlow; - - })(FlexDeclaration); - - module.exports = FlexFlow; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-grow.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-grow.js deleted file mode 100644 index 633ee88..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-grow.js +++ /dev/null @@ -1,38 +0,0 @@ -(function() { - var Flex, FlexDeclaration, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - Flex = (function(_super) { - __extends(Flex, _super); - - function Flex() { - _ref = Flex.__super__.constructor.apply(this, arguments); - return _ref; - } - - Flex.names = ['flex-grow']; - - Flex.prototype.prefixProp = function(prefix) { - var spec; - spec = this.flexSpec(prefix); - if (spec.v2009) { - this.insertBefore(prefix + 'box-flex', this.value); - } - if (spec.v2012) { - this.insertBefore(prefix + 'flex', this.value); - } - if (spec.final) { - return Flex.__super__.prefixProp.apply(this, arguments); - } - }; - - return Flex; - - })(FlexDeclaration); - - module.exports = Flex; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-shrink.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-shrink.js deleted file mode 100644 index 604bbc3..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-shrink.js +++ /dev/null @@ -1,35 +0,0 @@ -(function() { - var FlexDeclaration, FlexShrink, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - FlexShrink = (function(_super) { - __extends(FlexShrink, _super); - - function FlexShrink() { - _ref = FlexShrink.__super__.constructor.apply(this, arguments); - return _ref; - } - - FlexShrink.names = ['flex-shrink']; - - FlexShrink.prototype.prefixProp = function(prefix) { - var spec; - spec = this.flexSpec(prefix); - if (spec.v2012) { - this.insertBefore(prefix + 'flex', '0 ' + this.value); - } - if (spec.final) { - return FlexShrink.__super__.prefixProp.apply(this, arguments); - } - }; - - return FlexShrink; - - })(FlexDeclaration); - - module.exports = FlexShrink; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-wrap.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-wrap.js deleted file mode 100644 index b3d32f2..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex-wrap.js +++ /dev/null @@ -1,35 +0,0 @@ -(function() { - var FlexDeclaration, FlexWrap, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - FlexWrap = (function(_super) { - __extends(FlexWrap, _super); - - function FlexWrap() { - _ref = FlexWrap.__super__.constructor.apply(this, arguments); - return _ref; - } - - FlexWrap.names = ['flex-wrap']; - - FlexWrap.prototype.prefixProp = function(prefix) { - var spec; - spec = this.flexSpec(prefix); - if (spec.v2012) { - FlexWrap.__super__.prefixProp.apply(this, arguments); - } - if (spec.final) { - return FlexWrap.__super__.prefixProp.apply(this, arguments); - } - }; - - return FlexWrap; - - })(FlexDeclaration); - - module.exports = FlexWrap; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex.js deleted file mode 100644 index 9f6c5d5..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/flex.js +++ /dev/null @@ -1,40 +0,0 @@ -(function() { - var Flex, FlexDeclaration, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - Flex = (function(_super) { - __extends(Flex, _super); - - Flex.names = ['flex', 'box-flex']; - - function Flex() { - Flex.__super__.constructor.apply(this, arguments); - this.unprefixed = 'flex'; - this.prop = this.prefix + this.unprefixed; - } - - Flex.prototype.prefixProp = function(prefix) { - var first, spec; - spec = this.flexSpec(prefix); - if (spec.v2009) { - first = this.value.split(' ')[0]; - this.insertBefore(prefix + 'box-flex', first); - } - if (spec.v2012) { - Flex.__super__.prefixProp.apply(this, arguments); - } - if (spec.final) { - return Flex.__super__.prefixProp.apply(this, arguments); - } - }; - - return Flex; - - })(FlexDeclaration); - - module.exports = Flex; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/fullscreen.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/fullscreen.js deleted file mode 100644 index 4723b6a..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/fullscreen.js +++ /dev/null @@ -1,34 +0,0 @@ -(function() { - var Fullscreen, Selector, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - Selector = require('../selector'); - - Fullscreen = (function(_super) { - __extends(Fullscreen, _super); - - function Fullscreen() { - _ref = Fullscreen.__super__.constructor.apply(this, arguments); - return _ref; - } - - Fullscreen.names = [':fullscreen']; - - Fullscreen.prototype.prefixed = function(prefix) { - if ('-webkit-' === prefix) { - return ':-webkit-full-screen'; - } else if ('-moz-' === prefix) { - return ':-moz-full-screen'; - } else { - return ":" + prefix + "fullscreen"; - } - }; - - return Fullscreen; - - })(Selector); - - module.exports = Fullscreen; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/gradient.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/gradient.js deleted file mode 100644 index b36ddc4..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/gradient.js +++ /dev/null @@ -1,100 +0,0 @@ -(function() { - var Gradient, OldValue, Value, utils, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - OldValue = require('../old-value'); - - Value = require('../value'); - - utils = require('../utils'); - - Gradient = (function(_super) { - var i, _i, _len, _ref; - - __extends(Gradient, _super); - - Gradient.names = ['linear-gradient', 'repeating-linear-gradient', 'radial-gradient', 'repeating-radial-gradient']; - - Gradient.regexps = {}; - - _ref = Gradient.names; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - i = _ref[_i]; - Gradient.regexps[i] = new RegExp('(^|\\s|,)' + i + '\\(([^)]+)\\)', 'gi'); - } - - function Gradient(name, prefixes) { - this.name = name; - this.prefixes = prefixes; - this.regexp = Gradient.regexps[this.name]; - } - - Gradient.prototype.addPrefix = function(prefix, string) { - var _this = this; - return string.replace(this.regexp, function(all, before, params) { - params = params.trim().split(/\s*,\s*/); - if (params.length > 0) { - if (params[0].slice(0, 3) === 'to ') { - params[0] = _this.fixDirection(params[0]); - } else if (params[0].indexOf('deg') !== -1) { - params[0] = _this.fixAngle(params[0]); - } - } - return before + prefix + _this.name + '(' + params.join(', ') + ')'; - }); - }; - - Gradient.prototype.directions = { - top: 'bottom', - left: 'right', - bottom: 'top', - right: 'left' - }; - - Gradient.prototype.fixDirection = function(param) { - var value; - param = param.split(' '); - param.splice(0, 1); - param = (function() { - var _j, _len1, _results; - _results = []; - for (_j = 0, _len1 = param.length; _j < _len1; _j++) { - value = param[_j]; - _results.push(this.directions[value.toLowerCase()] || value); - } - return _results; - }).call(this); - return param.join(' '); - }; - - Gradient.prototype.roundFloat = function(float, digits) { - return parseFloat(float.toFixed(digits)); - }; - - Gradient.prototype.fixAngle = function(param) { - param = parseFloat(param); - param = Math.abs(450 - param) % 360; - param = this.roundFloat(param, 3); - return "" + param + "deg"; - }; - - Gradient.prototype.old = function(prefix) { - var regexp, string, type; - if (prefix === '-webkit-') { - type = this.name === 'linear-gradient' ? 'linear' : 'radial'; - string = '-gradient'; - regexp = utils.regexp("-webkit-(" + type + "-gradient|gradient\\(\\s*" + type + ")", false); - return new OldValue(prefix + this.name, string, regexp); - } else { - return new OldValue(prefix + this.name); - } - }; - - return Gradient; - - })(Value); - - module.exports = Gradient; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/justify-content.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/justify-content.js deleted file mode 100644 index 917fc0d..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/justify-content.js +++ /dev/null @@ -1,49 +0,0 @@ -(function() { - var FlexDeclaration, JustifyContent, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - JustifyContent = (function(_super) { - __extends(JustifyContent, _super); - - JustifyContent.names = ['justify-content', 'flex-pack', 'box-pack']; - - JustifyContent.oldValues = { - 'flex-end': 'end', - 'flex-start': 'start', - 'space-between': 'justify', - 'space-around': 'distribute' - }; - - function JustifyContent() { - JustifyContent.__super__.constructor.apply(this, arguments); - this.unprefixed = 'justify-content'; - this.prop = this.prefix + this.unprefixed; - } - - JustifyContent.prototype.prefixProp = function(prefix) { - var oldValue, spec; - spec = this.flexSpec(prefix); - oldValue = JustifyContent.oldValues[this.value] || this.value; - if (spec.v2009) { - if (this.value !== 'space-around') { - this.insertBefore(prefix + 'box-pack', oldValue); - } - } - if (spec.v2012) { - this.insertBefore(prefix + 'flex-pack', oldValue); - } - if (spec.final) { - return JustifyContent.__super__.prefixProp.apply(this, arguments); - } - }; - - return JustifyContent; - - })(FlexDeclaration); - - module.exports = JustifyContent; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/order.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/order.js deleted file mode 100644 index 746be80..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/order.js +++ /dev/null @@ -1,40 +0,0 @@ -(function() { - var FlexDeclaration, Order, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - FlexDeclaration = require('./flex-declaration'); - - Order = (function(_super) { - __extends(Order, _super); - - Order.names = ['order', 'flex-order', 'box-ordinal-group']; - - function Order() { - Order.__super__.constructor.apply(this, arguments); - this.unprefixed = 'order'; - this.prop = this.prefix + this.unprefixed; - } - - Order.prototype.prefixProp = function(prefix) { - var oldValue, spec; - spec = this.flexSpec(prefix); - if (spec.v2009) { - oldValue = parseInt(this.value) + 1; - this.insertBefore(prefix + 'box-ordinal-group', oldValue.toString()); - } - if (spec.v2012) { - this.insertBefore(prefix + 'flex-order', this.value); - } - if (spec.final) { - return Order.__super__.prefixProp.apply(this, arguments); - } - }; - - return Order; - - })(FlexDeclaration); - - module.exports = Order; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/placeholder.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/placeholder.js deleted file mode 100644 index 52f8f51..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/hacks/placeholder.js +++ /dev/null @@ -1,34 +0,0 @@ -(function() { - var Placeholder, Selector, _ref, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; - - Selector = require('../selector'); - - Placeholder = (function(_super) { - __extends(Placeholder, _super); - - function Placeholder() { - _ref = Placeholder.__super__.constructor.apply(this, arguments); - return _ref; - } - - Placeholder.names = ['::placeholder']; - - Placeholder.prototype.prefixed = function(prefix) { - if ('-webkit-' === prefix) { - return '::-webkit-input-placeholder'; - } else if ('-ms-' === prefix) { - return ':-ms-input-placeholder'; - } else { - return "::" + prefix + "placeholder"; - } - }; - - return Placeholder; - - })(Selector); - - module.exports = Placeholder; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/inspect.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/inspect.js deleted file mode 100644 index 1504d80..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/inspect.js +++ /dev/null @@ -1,89 +0,0 @@ -(function() { - var capitalize, names, prefix; - - capitalize = function(str) { - return str.slice(0, 1).toUpperCase() + str.slice(1); - }; - - names = { - ie: 'IE', - ff: 'Firefox', - ios: 'iOS' - }; - - prefix = function(name, transition, prefixes) { - var out; - out = ' ' + name + (transition ? '*' : '') + ': '; - out += prefixes.map(function(i) { - return i.replace(/^-(.*)-$/g, '$1'); - }).join(', '); - out += "\n"; - return out; - }; - - module.exports = function(prefixes) { - var browser, data, list, name, needTransition, out, props, string, transitionProp, useTransition, value, values, version, versions, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3, _ref4; - if (prefixes.browsers.selected.length === 0) { - return "No browsers selected"; - } - versions = []; - _ref = prefixes.browsers.selected; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - browser = _ref[_i]; - _ref1 = browser.split(' '), name = _ref1[0], version = _ref1[1]; - name = names[name] || capitalize(name); - if (versions[name]) { - versions[name].push(version); - } else { - versions[name] = [version]; - } - } - out = "Browsers:\n"; - for (browser in versions) { - list = versions[browser]; - out += ' ' + browser + ': ' + list.join(', ') + "\n"; - } - values = ''; - props = ''; - useTransition = false; - needTransition = (_ref2 = prefixes.add.transition) != null ? _ref2.prefixes : void 0; - _ref3 = prefixes.add; - for (name in _ref3) { - data = _ref3[name]; - if (data.prefixes) { - transitionProp = needTransition && prefixes.data[name].transition; - if (transitionProp) { - useTransition = true; - } - props += prefix(name, transitionProp, data.prefixes); - } - if (!data.values) { - continue; - } - if (prefixes.transitionProps.some(function(i) { - return i === name; - })) { - continue; - } - _ref4 = data.values; - for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { - value = _ref4[_j]; - string = prefix(value.name, false, value.prefixes); - if (values.indexOf(string) === -1) { - values += string; - } - } - } - if (useTransition) { - props += " * - can be used in transition\n"; - } - if (props !== '') { - out += "\nProperties:\n" + props; - } - if (values !== '') { - out += "\nValues:\n" + values; - } - return out; - }; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/keyframes.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/keyframes.js deleted file mode 100644 index 99cb925..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/keyframes.js +++ /dev/null @@ -1,49 +0,0 @@ -(function() { - var Keyframes, utils; - - utils = require('./utils'); - - Keyframes = (function() { - function Keyframes(css, number, rule) { - this.css = css; - this.number = number; - this.rule = rule; - this.prefix = this.rule.vendor; - } - - Keyframes.prototype.clone = function() { - return utils.clone(this.rule, { - keyframes: this.rule.keyframes.map(function(i) { - if (i.type === 'keyframe') { - return utils.clone(i, { - values: i.values.slice(), - declarations: i.declarations.map(function(decl) { - return utils.clone(decl); - }) - }); - } else { - return utils.clone(i); - } - }) - }); - }; - - Keyframes.prototype.cloneWithPrefix = function(prefix) { - var clone; - clone = this.clone(); - clone.vendor = prefix; - this.css.addKeyframes(this.number, clone); - return this.number += 1; - }; - - Keyframes.prototype.remove = function() { - return this.css.removeKeyframes(this.number); - }; - - return Keyframes; - - })(); - - module.exports = Keyframes; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/old-value.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/old-value.js deleted file mode 100644 index 38819e2..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/old-value.js +++ /dev/null @@ -1,29 +0,0 @@ -(function() { - var OldValue, utils; - - utils = require('./utils'); - - OldValue = (function() { - function OldValue(name, string, regexp) { - this.name = name; - this.string = string; - this.regexp = regexp; - this.regexp || (this.regexp = utils.regexp(this.name)); - this.string || (this.string = this.name); - } - - OldValue.prototype.check = function(value) { - if (value.indexOf(this.string) !== -1) { - return !!value.match(this.regexp); - } else { - return false; - } - }; - - return OldValue; - - })(); - - module.exports = OldValue; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/prefixes.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/prefixes.js deleted file mode 100644 index adcc5dd..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/prefixes.js +++ /dev/null @@ -1,186 +0,0 @@ -(function() { - var Prefixes, Processor, Selector, Value, utils; - - utils = require('./utils'); - - Processor = require('./processor'); - - Selector = require('./selector'); - - Value = require('./value'); - - Value.register(require('./hacks/gradient')); - - Selector.register(require('./hacks/placeholder')); - - Selector.register(require('./hacks/fullscreen')); - - Prefixes = (function() { - function Prefixes(data, browsers) { - var _ref; - this.data = data; - this.browsers = browsers; - _ref = this.preprocess(this.select(this.data)), this.add = _ref[0], this.remove = _ref[1]; - this.otherCache = {}; - this.processor = new Processor(this); - } - - Prefixes.prototype.transitionProps = ['transition', 'transition-property']; - - Prefixes.prototype.select = function(list) { - var add, all, data, name, selected, - _this = this; - selected = { - add: {}, - remove: {} - }; - for (name in list) { - data = list[name]; - add = data.browsers.filter(function(i) { - return _this.browsers.isSelected(i); - }).map(function(i) { - return _this.browsers.prefix(i); - }).sort(function(a, b) { - return b.length - a.length; - }); - all = utils.uniq(data.browsers.map(function(i) { - return _this.browsers.prefix(i); - })); - if (add.length) { - add = utils.uniq(add); - selected.add[name] = add; - if (add.length < all.length) { - selected.remove[name] = all.filter(function(i) { - return add.indexOf(i) === -1; - }); - } - } else { - selected.remove[name] = all; - } - } - return selected; - }; - - Prefixes.prototype.preprocess = function(selected) { - var add, name, old, prefix, prefixed, prefixes, prop, props, remove, selector, value, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1; - add = { - selectors: [] - }; - _ref = selected.add; - for (name in _ref) { - prefixes = _ref[name]; - if (this.data[name].selector) { - add.selectors.push(Selector.load(name, prefixes)); - } else { - props = this.data[name].transition ? this.transitionProps : this.data[name].props; - if (props) { - value = Value.load(name, prefixes); - for (_i = 0, _len = props.length; _i < _len; _i++) { - prop = props[_i]; - if (!add[prop]) { - add[prop] = {}; - } - if (!add[prop].values) { - add[prop].values = []; - } - add[prop].values.push(value); - } - } - if (!this.data[name].props) { - if (!add[name]) { - add[name] = {}; - } - add[name].prefixes = prefixes; - } - } - } - remove = { - selectors: [] - }; - _ref1 = selected.remove; - for (name in _ref1) { - prefixes = _ref1[name]; - if (this.data[name].selector) { - selector = Selector.load(name, prefixes); - for (_j = 0, _len1 = prefixes.length; _j < _len1; _j++) { - prefix = prefixes[_j]; - remove.selectors.push(selector.prefixed(prefix)); - } - } else { - props = this.data[name].transition ? this.transitionProps : this.data[name].props; - if (props) { - value = Value.load(name); - for (_k = 0, _len2 = prefixes.length; _k < _len2; _k++) { - prefix = prefixes[_k]; - old = value.old(prefix); - for (_l = 0, _len3 = props.length; _l < _len3; _l++) { - prop = props[_l]; - if (!remove[prop]) { - remove[prop] = {}; - } - if (!remove[prop].values) { - remove[prop].values = []; - } - remove[prop].values.push(old); - } - } - } - if (!this.data[name].props) { - for (_m = 0, _len4 = prefixes.length; _m < _len4; _m++) { - prefix = prefixes[_m]; - prefixed = prefix + name; - if (!remove[prefixed]) { - remove[prefixed] = {}; - } - remove[prefixed].remove = true; - } - } - } - } - return [add, remove]; - }; - - Prefixes.prototype.other = function(prefix) { - var _base; - return (_base = this.otherCache)[prefix] || (_base[prefix] = this.browsers.prefixes().filter(function(i) { - return i !== prefix; - })); - }; - - Prefixes.prototype.each = function(prop, callback) { - var prefix, _i, _len, _ref, _results; - if (this.add[prop] && this.add[prop].prefixes) { - _ref = this.add[prop].prefixes; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - prefix = _ref[_i]; - _results.push(callback(prefix)); - } - return _results; - } - }; - - Prefixes.prototype.values = function(type, prop) { - var data, global, values, _ref, _ref1; - data = this[type]; - global = (_ref = data['*']) != null ? _ref.values : void 0; - values = (_ref1 = data[prop]) != null ? _ref1.values : void 0; - if (global && values) { - return utils.uniq(global.concat(values)); - } else { - return global || values || []; - } - }; - - Prefixes.prototype.toRemove = function(prop) { - var _ref; - return (_ref = this.remove[prop]) != null ? _ref.remove : void 0; - }; - - return Prefixes; - - })(); - - module.exports = Prefixes; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/processor.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/processor.js deleted file mode 100644 index 0ab06d4..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/processor.js +++ /dev/null @@ -1,107 +0,0 @@ -(function() { - var Processor; - - Processor = (function() { - function Processor(prefixes) { - this.prefixes = prefixes; - } - - Processor.prototype.add = function(css) { - var selector, _i, _len, _ref, - _this = this; - css.eachKeyframes(function(keyframes) { - if (keyframes.prefix) { - return; - } - return _this.prefixes.each('@keyframes', function(prefix) { - return keyframes.cloneWithPrefix(prefix); - }); - }); - _ref = this.prefixes.add.selectors; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - selector = _ref[_i]; - css.eachRule(function(rule) { - if (!rule.selectors) { - return; - } - if (selector.check(rule.selectors)) { - return rule.prefixSelector(selector); - } - }); - } - css.eachDeclaration(function(decl, vendor) { - return _this.prefixes.each(decl.prop, function(prefix) { - if (vendor && vendor !== prefix) { - return; - } - if (decl.valueContain(_this.prefixes.other(prefix))) { - return; - } - return decl.prefixProp(prefix); - }); - }); - return css.eachDeclaration(function(decl, vendor) { - var prefix, value, _j, _k, _len1, _len2, _ref1, _ref2; - _ref1 = _this.prefixes.values('add', decl.unprefixed); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - value = _ref1[_j]; - if (!value.check(decl.value)) { - continue; - } - _ref2 = value.prefixes; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - prefix = _ref2[_k]; - if (vendor && vendor !== prefix) { - continue; - } - decl.prefixValue(prefix, value); - } - } - return decl.saveValues(); - }); - }; - - Processor.prototype.remove = function(css) { - var selector, _i, _len, _ref, - _this = this; - css.eachKeyframes(function(keyframes) { - if (_this.prefixes.toRemove(keyframes.prefix + '@keyframes')) { - return keyframes.remove(); - } - }); - _ref = this.prefixes.remove.selectors; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - selector = _ref[_i]; - css.eachRule(function(rule) { - if (!rule.selectors) { - return; - } - if (rule.selectors.indexOf(selector) !== -1) { - return rule.remove(); - } - }); - } - return css.eachDeclaration(function(decl, vendor) { - var checker, _j, _len1, _ref1; - if (_this.prefixes.toRemove(decl.prop)) { - decl.remove(); - return; - } - _ref1 = _this.prefixes.values('remove', decl.unprefixed); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - checker = _ref1[_j]; - if (checker.check(decl.value)) { - decl.remove(); - return; - } - } - }); - }; - - return Processor; - - })(); - - module.exports = Processor; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/rule.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/rule.js deleted file mode 100644 index 1408834..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/rule.js +++ /dev/null @@ -1,132 +0,0 @@ -(function() { - var Declaration, Rule, utils; - - utils = require('./utils'); - - Declaration = require('./declaration'); - - Declaration.register(require('./hacks/filter')); - - Declaration.register(require('./hacks/border-radius')); - - Declaration.register(require('./hacks/flex')); - - Declaration.register(require('./hacks/order')); - - Declaration.register(require('./hacks/flex-grow')); - - Declaration.register(require('./hacks/flex-wrap')); - - Declaration.register(require('./hacks/flex-flow')); - - Declaration.register(require('./hacks/align-self')); - - Declaration.register(require('./hacks/flex-basis')); - - Declaration.register(require('./hacks/flex-shrink')); - - Declaration.register(require('./hacks/align-items')); - - Declaration.register(require('./hacks/border-image')); - - Declaration.register(require('./hacks/display-flex')); - - Declaration.register(require('./hacks/align-content')); - - Declaration.register(require('./hacks/flex-direction')); - - Declaration.register(require('./hacks/justify-content')); - - Declaration.register(require('./hacks/background-clip')); - - Rule = (function() { - function Rule(rules, number, node, prefix) { - this.rules = rules; - this.number = number; - this.node = node; - this.prefix = prefix; - this.type = this.node.type; - this.declarations = this.node.declarations; - if (this.type === 'rule') { - this.selectors = this.node.selectors.join(', '); - } - } - - Rule.prototype.each = function(callback) { - var decl, item; - this.number = 0; - while (this.number < this.declarations.length) { - item = this.declarations[this.number]; - if (item.property) { - decl = Declaration.load(this, this.number, item); - callback(decl, decl.prefix || this.prefix); - } - this.number += 1; - } - return false; - }; - - Rule.prototype.prefixSelector = function(selector) { - var clone, prefix, prefixed, _i, _len, _ref, _results; - _ref = selector.prefixes; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - prefix = _ref[_i]; - prefixed = selector.replace(this.selectors, prefix); - if (!this.rules.contain(prefixed)) { - clone = utils.clone(this.node, { - selectors: prefixed.split(', ') - }); - _results.push(this.rules.add(this.number, clone)); - } else { - _results.push(void 0); - } - } - return _results; - }; - - Rule.prototype.contain = function(prop, value) { - if (value != null) { - return this.declarations.some(function(i) { - return i.property === prop && i.value === value; - }); - } else { - return this.declarations.some(function(i) { - return i.property === prop; - }); - } - }; - - Rule.prototype.byProp = function(prop) { - var decl, i, _i, _len, _ref; - _ref = this.declarations; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - decl = _ref[i]; - if (decl.property === prop) { - return Declaration.load(this, i, decl); - } - } - return null; - }; - - Rule.prototype.remove = function() { - return this.rules.remove(this.number); - }; - - Rule.prototype.add = function(position, decl) { - this.declarations.splice(position, 0, decl); - return this.number += 1; - }; - - Rule.prototype.removeDecl = function(position) { - this.declarations.splice(position, 1); - return this.number -= 1; - }; - - return Rule; - - })(); - - module.exports = Rule; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/rules.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/rules.js deleted file mode 100644 index 86d93f3..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/rules.js +++ /dev/null @@ -1,75 +0,0 @@ -(function() { - var Rule, Rules; - - Rule = require('./rule'); - - Rules = (function() { - Rules.each = function(list, callback) { - var rules; - rules = new Rules(list); - return rules.each(callback); - }; - - function Rules(list) { - this.list = list; - } - - Rules.prototype.each = function(callback) { - var i, keyframe, rule, _i, _len, _ref; - this.number = 0; - while (this.number < this.list.length) { - i = this.list[this.number]; - if (i.rules) { - Rules.each(i.rules, callback); - } - if (i.keyframes) { - _ref = i.keyframes; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - keyframe = _ref[_i]; - if (keyframe.type === 'keyframe') { - rule = new Rule(this, this.number, keyframe, i.vendor); - callback(rule); - } - } - } - if (i.declarations) { - rule = new Rule(this, this.number, i, i.vendor); - callback(rule); - } - this.number += 1; - } - return false; - }; - - Rules.prototype.contain = function(selector) { - var i, _i, _len, _ref; - _ref = this.list; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - i = _ref[_i]; - if (!i.selectors) { - continue; - } - if (i.selectors.join(', ') === selector) { - return true; - } - } - return false; - }; - - Rules.prototype.add = function(position, rule) { - this.list.splice(position, 0, rule); - return this.number += 1; - }; - - Rules.prototype.remove = function(position) { - this.list.splice(position, 1); - return this.number -= 1; - }; - - return Rules; - - })(); - - module.exports = Rules; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/selector.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/selector.js deleted file mode 100644 index 0a74eab..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/selector.js +++ /dev/null @@ -1,57 +0,0 @@ -(function() { - var Selector, utils; - - utils = require('./utils'); - - Selector = (function() { - Selector.register = function(klass) { - var name, _i, _len, _ref, _results; - _ref = klass.names; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - name = _ref[_i]; - _results.push(this.hacks[name] = klass); - } - return _results; - }; - - Selector.hacks = {}; - - Selector.load = function(name, prefixes) { - var klass; - klass = this.hacks[name]; - if (klass) { - return new klass(name, prefixes); - } else { - return new Selector(name, prefixes); - } - }; - - function Selector(name, prefixes) { - this.name = name; - this.prefixes = prefixes; - } - - Selector.prototype.check = function(selectors) { - return selectors.indexOf(this.name) !== -1; - }; - - Selector.prototype.prefixed = function(prefix) { - return this.name.replace(/^([^\w]*)/, '$1' + prefix); - }; - - Selector.prototype.regexp = function() { - return this.regexpCache || (this.regexpCache = new RegExp(utils.escapeRegexp(this.name), 'gi')); - }; - - Selector.prototype.replace = function(selectors, prefix) { - return selectors.replace(this.regexp(), this.prefixed(prefix)); - }; - - return Selector; - - })(); - - module.exports = Selector; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/updater.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/updater.js deleted file mode 100644 index ddeecec..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/updater.js +++ /dev/null @@ -1,195 +0,0 @@ -(function() { - var coffee, fs, https; - - coffee = require('coffee-script'); - - https = require('https'); - - fs = require('fs'); - - module.exports = { - browsers: { - firefox: 'ff', - chrome: 'chrome', - safari: 'safari', - ios_saf: 'ios', - opera: 'opera', - ie: 'ie', - bb: 'bb', - android: 'android' - }, - run: function() { - var i, updaters, _i, _len, _ref, _results; - updaters = __dirname + '/../../updaters/'; - _ref = fs.readdirSync(updaters).sort(); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - i = _ref[_i]; - if (!i.match(/\.(coffee|js)$/)) { - continue; - } - _results.push(require(updaters + i).apply(this)); - } - return _results; - }, - requests: 0, - doneCallbacks: [], - requestCallbacks: [], - done: function(callback) { - this.doneCallbacks || (this.doneCallbacks = []); - return this.doneCallbacks.push(callback); - }, - request: function(callback) { - this.requestCallbacks || (this.requestCallbacks = []); - return this.requestCallbacks.push(callback); - }, - github: function(path, callback) { - var _this = this; - this.requests += 1; - return https.get("https://raw.github.com/" + path, function(res) { - var data; - data = ''; - res.on('data', function(chunk) { - return data += chunk; - }); - return res.on('end', function() { - var func, _i, _j, _len, _len1, _ref, _ref1, _results; - callback(JSON.parse(data)); - _this.requests -= 1; - _ref = _this.requestCallbacks; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - func = _ref[_i]; - func(); - } - if (_this.requests === 0) { - _ref1 = _this.doneCallbacks.reverse(); - _results = []; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - func = _ref1[_j]; - _results.push(func()); - } - return _results; - } - }); - }); - }, - sort: function(browsers) { - return browsers.sort(function(a, b) { - a = a.split(' '); - b = b.split(' '); - if (a[0] > b[0]) { - return 1; - } else if (a[0] < b[0]) { - return -1; - } else { - return parseFloat(a[1]) - parseFloat(b[1]); - } - }); - }, - parse: function(data) { - var browser, interval, need, support, version, versions, _i, _len, _ref, _ref1; - need = []; - _ref = data.stats; - for (browser in _ref) { - versions = _ref[browser]; - for (interval in versions) { - support = versions[interval]; - _ref1 = interval.split('-'); - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - version = _ref1[_i]; - if (this.browsers[browser] && support.match(/\sx($|\s)/)) { - version = version.replace(/\.0$/, ''); - need.push(this.browsers[browser] + ' ' + version); - } - } - } - } - return this.sort(need); - }, - feature: function(file, callback) { - var url, - _this = this; - url = "Fyrd/caniuse/master/features-json/" + file; - return this.github(url, function(data) { - return callback(_this.parse(data)); - }); - }, - fork: function(fork, file, callback) { - var branch, url, user, _ref, - _this = this; - _ref = fork.split('/'), user = _ref[0], branch = _ref[1]; - url = "" + user + "/caniuse/" + branch + "/features-json/" + file; - return this.github(url, function(data) { - return callback(_this.parse(data)); - }); - }, - all: function(callback) { - var browsers, data, list, name, version, _i, _len, _ref; - browsers = require('../../data/browsers'); - list = []; - for (name in browsers) { - data = browsers[name]; - _ref = data.versions; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - version = _ref[_i]; - list.push(name + ' ' + version); - } - } - return callback(this.sort(list)); - }, - stringify: function(obj, indent) { - var key, local, processed, value, - _this = this; - if (indent == null) { - indent = ''; - } - if (obj instanceof Array) { - local = indent + ' '; - return ("[\n" + local) + obj.map(function(i) { - return _this.stringify(i, local); - }).join("\n" + local) + ("\n" + indent + "]"); - } else if (typeof obj === 'object') { - local = indent + ' '; - processed = []; - for (key in obj) { - value = obj[key]; - if (key.match(/'|-|@|:/)) { - key = "\"" + key + "\""; - } - value = this.stringify(value, local); - if (value[0] !== "\n") { - value = ' ' + value; - } - processed.push(key + ':' + value); - } - return "\n" + local + processed.join("\n" + local) + "\n"; - } else { - return JSON.stringify(obj); - } - }, - changed: [], - save: function(name, json) { - var content, file, key, sorted, _i, _len, _ref; - sorted = {}; - _ref = Object.keys(json).sort(); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - key = _ref[_i]; - sorted[key] = json[key]; - } - file = __dirname + ("/../../data/" + name); - content = "# Don't edit this files, because it's autogenerated.\n" + "# See updaters/ dir for generator. Run bin/update to update." + "\n\n"; - content += "module.exports =" + this.stringify(sorted) + ";\n"; - if (fs.existsSync(file + '.js')) { - file += '.js'; - content = coffee.compile(content); - } else { - file += '.coffee'; - } - if (fs.readFileSync(file).toString() !== content) { - this.changed.push(name); - return fs.writeFileSync(file, content); - } - } - }; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/utils.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/utils.js deleted file mode 100644 index a65dcd2..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/utils.js +++ /dev/null @@ -1,52 +0,0 @@ -(function() { - module.exports = { - error: function(text) { - var err; - err = new Error(text); - err.autoprefixer = true; - throw err; - }, - uniq: function(array) { - var filtered, i, _i, _len; - filtered = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - i = array[_i]; - if (filtered.indexOf(i) === -1) { - filtered.push(i); - } - } - return filtered; - }, - clone: function(obj, changes) { - var clone, key, value; - if (changes == null) { - changes = {}; - } - clone = {}; - for (key in obj) { - value = obj[key]; - if (!changes[key]) { - clone[key] = value; - } - } - for (key in changes) { - value = changes[key]; - clone[key] = value; - } - return clone; - }, - escapeRegexp: function(string) { - return string.replace(/([.?*+\^\$\[\]\\(){}|\-])/g, "\\$1"); - }, - regexp: function(word, escape) { - if (escape == null) { - escape = true; - } - if (escape) { - word = this.escapeRegexp(word); - } - return new RegExp('(^|\\s|,|\\()(' + word + '($|\\s|\\(|,))', 'gi'); - } - }; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/value.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/value.js deleted file mode 100644 index b7e8344..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/lib/autoprefixer/value.js +++ /dev/null @@ -1,67 +0,0 @@ -(function() { - var OldValue, Value, utils; - - utils = require('./utils'); - - OldValue = require('./old-value'); - - Value = (function() { - Value.register = function(klass) { - var name, _i, _len, _ref, _results; - _ref = klass.names; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - name = _ref[_i]; - _results.push(this.hacks[name] = klass); - } - return _results; - }; - - Value.hacks = {}; - - Value.load = function(name, prefixes) { - var klass; - klass = this.hacks[name]; - if (klass) { - return new klass(name, prefixes); - } else { - return new Value(name, prefixes); - } - }; - - Value.regexps = {}; - - Value.regexp = function(name) { - var _base; - return (_base = this.regexps)[name] || (_base[name] = utils.regexp(name)); - }; - - function Value(name, prefixes) { - this.name = name; - this.prefixes = prefixes; - this.regexp = Value.regexp(this.name); - } - - Value.prototype.check = function(value) { - if (value.indexOf(this.name) !== -1) { - return !!value.match(this.regexp); - } else { - return false; - } - }; - - Value.prototype.old = function(prefix) { - return new OldValue(prefix + this.name); - }; - - Value.prototype.addPrefix = function(prefix, string) { - return string.replace(this.regexp, '$1' + prefix + '$2'); - }; - - return Value; - - })(); - - module.exports = Value; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/.npmignore b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/.npmignore deleted file mode 100644 index 4a3c398..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -*.sock -test.css -test.js diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/.travis.yml b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/.travis.yml deleted file mode 100644 index 09d3ef3..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.10 diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/History.md b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/History.md deleted file mode 100644 index b9cc76a..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/History.md +++ /dev/null @@ -1,78 +0,0 @@ - -1.5.3 / 2013-09-10 -================== - - * add trim shim function. Closes #45 - * fix: parser now correctly parses attributes with whitespace before colon - -1.5.2 / 2013-07-28 -================== - - * fix another regexp for good old FF - -1.5.1 / 2013-07-23 -================== - - * fix // declaration hack. Closes #42 - * fix comments for several nodes (#34). - -1.5.0 / 2013-06-18 -================== - - * add error reporting - * fix @document with no vendor prefix - -1.4.0 / 2013-05-22 -================== - - * add `position` option support - * add .type to all nodes. Closes #18 - * fix comments within rulesets. Closes #30 - * fix handling of unterminated comment. Closes #24 - -1.3.0 / 2013-05-21 -================== - - * add @document parsing. Closes #29 - -1.2.0 / 2013-03-28 -================== - - * add support for @page at-rules with nested @margin at-rules. - * add @namespace support. - * add support for new @supports at-rule. - -1.1.0 / 2013-03-18 -================== - - * add comment parsing - -1.0.4 / 2012-09-17 -================== - - * fix keyframes float percentages - * fix an issue with comments containing slashes. - -1.0.3 / 2012-09-01 -================== - - * add component support - * fix unquoted data uris [rstacruz] - * fix keyframe names with no whitespace [rstacruz] - * fix excess semicolon support [rstacruz] - -1.0.2 / 2012-09-01 -================== - - * fix IE property hack support [rstacruz] - * fix quoted strings in declarations [rstacruz] - -1.0.1 / 2012-07-26 -================== - - * change "selector" to "selectors" array - -1.0.0 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/LICENSE b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/LICENSE deleted file mode 100644 index b740930..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 TJ Holowaychuk - -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/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/Makefile b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/Makefile deleted file mode 100644 index d78a055..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/Makefile +++ /dev/null @@ -1,8 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --require should \ - --reporter spec \ - --bail - -.PHONY: test diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/Readme.md b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/Readme.md deleted file mode 100644 index 1c05b32..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/Readme.md +++ /dev/null @@ -1,113 +0,0 @@ - -# css-parse - - JavaScript CSS parser for nodejs and the browser. - -## Example - -css: - -```css -body { - background: #eee; - color: #888; -} -``` - -parse tree: - -```json -{ - "type": "stylesheet", - "stylesheet": { - "rules": [ - { - "type": "rule", - "selectors": [ - "body" - ], - "declarations": [ - { - "type": "declaration", - "property": "background", - "value": "#eee" - }, - { - "type": "declaration", - "property": "color", - "value": "#888" - } - ] - } - ] - } -} -``` - -parse tree with `.position` enabled: - -```json -{ - "type": "stylesheet", - "stylesheet": { - "rules": [ - { - "type": "rule", - "selectors": [ - "body" - ], - "declarations": [ - { - "type": "declaration", - "property": "background", - "value": "#eee", - "position": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 19 - } - } - }, - { - "type": "declaration", - "property": "color", - "value": "#888", - "position": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 14 - } - } - } - ], - "position": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 5, - "column": 2 - } - } - } - ] - } -} -``` - -## Performance - - Parsed 15,000 lines of CSS (2mb) in 40ms on my macbook air. - -## License - - MIT diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/component.json b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/component.json deleted file mode 100644 index 4055a14..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/component.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "css-parse", - "repo": "visionmedia/css-parse", - "version": "1.5.3", - "description": "CSS parser", - "keywords": ["css", "parser", "stylesheet"], - "scripts": ["index.js"] -} diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/index.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/index.js deleted file mode 100644 index 944865b..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/index.js +++ /dev/null @@ -1,467 +0,0 @@ - -module.exports = function(css, options){ - options = options || {}; - - /** - * Positional. - */ - - var lineno = 1; - var column = 1; - - /** - * Update lineno and column based on `str`. - */ - - function updatePosition(str) { - var lines = str.match(/\n/g); - if (lines) lineno += lines.length; - var i = str.lastIndexOf('\n'); - column = ~i ? str.length - i : column + str.length; - } - - /** - * Mark position and patch `node.position`. - */ - - function position() { - var start = { line: lineno, column: column }; - if (!options.position) return positionNoop; - - return function(node){ - node.position = { - start: start, - end: { line: lineno, column: column } - }; - - whitespace(); - return node; - } - } - - /** - * Return `node`. - */ - - function positionNoop(node) { - whitespace(); - return node; - } - - /** - * Error `msg`. - */ - - function error(msg) { - var err = new Error(msg + ' near line ' + lineno + ':' + column); - err.line = lineno; - err.column = column; - err.source = css; - throw err; - } - - /** - * Parse stylesheet. - */ - - function stylesheet() { - return { - type: 'stylesheet', - stylesheet: { - rules: rules() - } - }; - } - - /** - * Opening brace. - */ - - function open() { - return match(/^{\s*/); - } - - /** - * Closing brace. - */ - - function close() { - return match(/^}/); - } - - /** - * Parse ruleset. - */ - - function rules() { - var node; - var rules = []; - whitespace(); - comments(rules); - while (css.charAt(0) != '}' && (node = atrule() || rule())) { - rules.push(node); - comments(rules); - } - return rules; - } - - /** - * Match `re` and return captures. - */ - - function match(re) { - var m = re.exec(css); - if (!m) return; - var str = m[0]; - updatePosition(str); - css = css.slice(str.length); - return m; - } - - /** - * Parse whitespace. - */ - - function whitespace() { - match(/^\s*/); - } - - /** - * Parse comments; - */ - - function comments(rules) { - var c; - rules = rules || []; - while (c = comment()) rules.push(c); - return rules; - } - - /** - * Parse comment. - */ - - function comment() { - var pos = position(); - if ('/' != css.charAt(0) || '*' != css.charAt(1)) return; - - var i = 2; - while (null != css.charAt(i) && ('*' != css.charAt(i) || '/' != css.charAt(i + 1))) ++i; - i += 2; - - var str = css.slice(2, i - 2); - column += 2; - updatePosition(str); - css = css.slice(i); - column += 2; - - return pos({ - type: 'comment', - comment: str - }); - } - - /** - * Parse selector. - */ - - function selector() { - var m = match(/^([^{]+)/); - if (!m) return; - return trim(m[0]).split(/\s*,\s*/); - } - - /** - * Parse declaration. - */ - - function declaration() { - var pos = position(); - - // prop - var prop = match(/^(\*?[-\/\*\w]+)\s*/); - if (!prop) return; - prop = trim(prop[0]); - - // : - if (!match(/^:\s*/)) return error("property missing ':'"); - - // val - var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/); - if (!val) return error('property missing value'); - - var ret = pos({ - type: 'declaration', - property: prop, - value: trim(val[0]) - }); - - // ; - match(/^[;\s]*/); - - return ret; - } - - /** - * Parse declarations. - */ - - function declarations() { - var decls = []; - - if (!open()) return error("missing '{'"); - comments(decls); - - // declarations - var decl; - while (decl = declaration()) { - decls.push(decl); - comments(decls); - } - - if (!close()) return error("missing '}'"); - return decls; - } - - /** - * Parse keyframe. - */ - - function keyframe() { - var m; - var vals = []; - var pos = position(); - - while (m = match(/^(from|to|\d+%|\.\d+%|\d+\.\d+%)\s*/)) { - vals.push(m[1]); - match(/^,\s*/); - } - - if (!vals.length) return; - - return pos({ - type: 'keyframe', - values: vals, - declarations: declarations() - }); - } - - /** - * Parse keyframes. - */ - - function atkeyframes() { - var pos = position(); - var m = match(/^@([-\w]+)?keyframes */); - - if (!m) return; - var vendor = m[1]; - - // identifier - var m = match(/^([-\w]+)\s*/); - if (!m) return error("@keyframes missing name"); - var name = m[1]; - - if (!open()) return error("@keyframes missing '{'"); - - var frame; - var frames = comments(); - while (frame = keyframe()) { - frames.push(frame); - frames = frames.concat(comments()); - } - - if (!close()) return error("@keyframes missing '}'"); - - return pos({ - type: 'keyframes', - name: name, - vendor: vendor, - keyframes: frames - }); - } - - /** - * Parse supports. - */ - - function atsupports() { - var pos = position(); - var m = match(/^@supports *([^{]+)/); - - if (!m) return; - var supports = trim(m[1]); - - if (!open()) return error("@supports missing '{'"); - - var style = comments().concat(rules()); - - if (!close()) return error("@supports missing '}'"); - - return pos({ - type: 'supports', - supports: supports, - rules: style - }); - } - - /** - * Parse media. - */ - - function atmedia() { - var pos = position(); - var m = match(/^@media *([^{]+)/); - - if (!m) return; - var media = trim(m[1]); - - if (!open()) return error("@media missing '{'"); - - var style = comments().concat(rules()); - - if (!close()) return error("@media missing '}'"); - - return pos({ - type: 'media', - media: media, - rules: style - }); - } - - /** - * Parse paged media. - */ - - function atpage() { - var pos = position(); - var m = match(/^@page */); - if (!m) return; - - var sel = selector() || []; - - if (!open()) return error("@page missing '{'"); - var decls = comments(); - - // declarations - var decl; - while (decl = declaration()) { - decls.push(decl); - decls = decls.concat(comments()); - } - - if (!close()) return error("@page missing '}'"); - - return pos({ - type: 'page', - selectors: sel, - declarations: decls - }); - } - - /** - * Parse document. - */ - - function atdocument() { - var pos = position(); - var m = match(/^@([-\w]+)?document *([^{]+)/); - if (!m) return; - - var vendor = trim(m[1]); - var doc = trim(m[2]); - - if (!open()) return error("@document missing '{'"); - - var style = comments().concat(rules()); - - if (!close()) return error("@document missing '}'"); - - return pos({ - type: 'document', - document: doc, - vendor: vendor, - rules: style - }); - } - - /** - * Parse import - */ - - function atimport() { - return _atrule('import'); - } - - /** - * Parse charset - */ - - function atcharset() { - return _atrule('charset'); - } - - /** - * Parse namespace - */ - - function atnamespace() { - return _atrule('namespace') - } - - /** - * Parse non-block at-rules - */ - - function _atrule(name) { - var pos = position(); - var m = match(new RegExp('^@' + name + ' *([^;\\n]+);')); - if (!m) return; - var ret = { type: name }; - ret[name] = trim(m[1]); - return pos(ret); - } - - /** - * Parse at rule. - */ - - function atrule() { - return atkeyframes() - || atmedia() - || atsupports() - || atimport() - || atcharset() - || atnamespace() - || atdocument() - || atpage(); - } - - /** - * Parse rule. - */ - - function rule() { - var pos = position(); - var sel = selector(); - - if (!sel) return; - comments(); - - return pos({ - type: 'rule', - selectors: sel, - declarations: declarations() - }); - } - - return stylesheet(); -}; - -/** - * Trim `str`. - */ - -function trim(str) { - return (str || '').replace(/^\s+|\s+$/g, ''); -} diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/package.json b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/package.json deleted file mode 100644 index b1eab10..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-parse/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "css-parse", - "version": "1.5.3", - "description": "CSS parser", - "keywords": [ - "css", - "parser", - "stylesheet" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "license": "MIT", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "main": "index", - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/css-parse.git" - }, - "readme": "\n# css-parse\n\n JavaScript CSS parser for nodejs and the browser.\n\n## Example\n\ncss:\n\n```css\nbody {\n background: #eee;\n color: #888;\n}\n```\n\nparse tree:\n\n```json\n{\n \"type\": \"stylesheet\",\n \"stylesheet\": {\n \"rules\": [\n {\n \"type\": \"rule\",\n \"selectors\": [\n \"body\"\n ],\n \"declarations\": [\n {\n \"type\": \"declaration\",\n \"property\": \"background\",\n \"value\": \"#eee\"\n },\n {\n \"type\": \"declaration\",\n \"property\": \"color\",\n \"value\": \"#888\"\n }\n ]\n }\n ]\n }\n}\n```\n\nparse tree with `.position` enabled:\n\n```json\n{\n \"type\": \"stylesheet\",\n \"stylesheet\": {\n \"rules\": [\n {\n \"type\": \"rule\",\n \"selectors\": [\n \"body\"\n ],\n \"declarations\": [\n {\n \"type\": \"declaration\",\n \"property\": \"background\",\n \"value\": \"#eee\",\n \"position\": {\n \"start\": {\n \"line\": 3,\n \"column\": 3\n },\n \"end\": {\n \"line\": 3,\n \"column\": 19\n }\n }\n },\n {\n \"type\": \"declaration\",\n \"property\": \"color\",\n \"value\": \"#888\",\n \"position\": {\n \"start\": {\n \"line\": 4,\n \"column\": 3\n },\n \"end\": {\n \"line\": 4,\n \"column\": 14\n }\n }\n }\n ],\n \"position\": {\n \"start\": {\n \"line\": 2,\n \"column\": 1\n },\n \"end\": {\n \"line\": 5,\n \"column\": 2\n }\n }\n }\n ]\n }\n}\n```\n\n## Performance\n\n Parsed 15,000 lines of CSS (2mb) in 40ms on my macbook air.\n\n## License\n\n MIT\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/css-parse/issues" - }, - "_id": "css-parse@1.5.3", - "dist": { - "shasum": "508c3beb4d4e80cb284a0c5be8995fdd35cdf6f9" - }, - "_from": "css-parse@~> 1.5.2", - "_resolved": "https://registry.npmjs.org/css-parse/-/css-parse-1.5.3.tgz" -} diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/.npmignore b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/.npmignore deleted file mode 100644 index 4a3c398..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -*.sock -test.css -test.js diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/.travis.yml b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/.travis.yml deleted file mode 100644 index 6e5919d..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/History.md b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/History.md deleted file mode 100644 index c9accae..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/History.md +++ /dev/null @@ -1,65 +0,0 @@ - -1.3.2 / 2013-10-18 -================== - - * fix whitespace and indentation in the Compressed compiler. - * add @namespace support - * add .stylesheet(node) - -1.3.1 / 2013-06-02 -================== - - * fix output of rules with no declarations for Identity compiler - * fix defaulting of options - -1.3.0 / 2013-05-28 -================== - - * add ignoring of empty rulesets. Closes #7 - * add separate compilers - * add @supports support - * add @page compilation support - * fix comment output. Closes #16 - * fix trailing ; with comments within rules - * fix comment indentation - -1.2.0 / 2013-05-21 -================== - - * add @document compilation. Closes #82 - -1.1.0 / 2013-03-19 -================== - - * add omission of comments when compressed - * add comment support - -1.0.5 / 2013-03-15 -================== - - * fix indentation of multiple selectors in @media. Closes #11 - -1.0.4 / 2012-11-15 -================== - - * fix indentation - -1.0.3 / 2012-09-04 -================== - - * add __@charset__ support [rstacruz] - -1.0.2 / 2012-09-01 -================== - - * add component support - -1.0.1 / 2012-07-26 -================== - - * add "selectors" array support - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/LICENSE b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/LICENSE deleted file mode 100644 index 0239d9c..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk - -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/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/Makefile b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/Makefile deleted file mode 100644 index d78a055..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/Makefile +++ /dev/null @@ -1,8 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --require should \ - --reporter spec \ - --bail - -.PHONY: test diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/Readme.md b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/Readme.md deleted file mode 100644 index 2755c94..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/Readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# css-stringify [![Build Status](https://travis-ci.org/visionmedia/css-stringify.png)](https://travis-ci.org/visionmedia/css-stringify) - - CSS compiler using the AST provided by [css-parse](https://github.com/visionmedia/css-parse). - -## Performance - - Formats 15,000 lines of CSS (2mb) in 23ms on my macbook air. - -## License - -(The MIT License) - -Copyright (c) 2012 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. diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/component.json b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/component.json deleted file mode 100644 index c4f438a..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/component.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "css-stringify", - "repo": "visionmedia/css-stringify", - "version": "1.3.2", - "description": "CSS compiler", - "keywords": ["css", "stringify", "stylesheet"], - "scripts": [ - "index.js", - "lib/compress.js", - "lib/identity.js" - ] -} diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/index.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/index.js deleted file mode 100644 index 193b75e..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/index.js +++ /dev/null @@ -1,27 +0,0 @@ - -/** - * Module dependencies. - */ - -var Compressed = require('./lib/compress'); -var Identity = require('./lib/identity'); - -/** - * Stringfy the given AST `node`. - * - * @param {Object} node - * @param {Object} [options] - * @return {String} - * @api public - */ - -module.exports = function(node, options){ - options = options || {}; - - var compiler = options.compress - ? new Compressed(options) - : new Identity(options); - - return compiler.compile(node); -}; - diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/lib/compress.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/lib/compress.js deleted file mode 100644 index 0a9b98b..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/lib/compress.js +++ /dev/null @@ -1,166 +0,0 @@ - -/** - * Expose compiler. - */ - -module.exports = Compiler; - -/** - * Initialize a new `Compiler`. - */ - -function Compiler(options) { - options = options || {}; -} - -/** - * Compile `node`. - */ - -Compiler.prototype.compile = function(node){ - return node.stylesheet - .rules.map(this.visit, this) - .join(''); -}; - -/** - * Visit `node`. - */ - -Compiler.prototype.visit = function(node){ - return this[node.type](node); -}; - -/** - * Visit comment node. - */ - -Compiler.prototype.comment = function(node){ - return ''; -}; - -/** - * Visit import node. - */ - -Compiler.prototype.import = function(node){ - return '@import ' + node.import + ';'; -}; - -/** - * Visit media node. - */ - -Compiler.prototype.media = function(node){ - return '@media ' - + node.media - + '{' - + node.rules.map(this.visit, this).join('') - + '}'; -}; - -/** - * Visit document node. - */ - -Compiler.prototype.document = function(node){ - var doc = '@' + (node.vendor || '') + 'document ' + node.document; - - return doc - + '{' - + node.rules.map(this.visit, this).join('') - + '}'; -}; - -/** - * Visit charset node. - */ - -Compiler.prototype.charset = function(node){ - return '@charset ' + node.charset + ';'; -}; - -/** - * Visit namespace node. - */ - -Compiler.prototype.namespace = function(node){ - return '@namespace ' + node.namespace + ';'; -}; - -/** - * Visit supports node. - */ - -Compiler.prototype.supports = function(node){ - return '@supports ' - + node.supports - + '{' - + node.rules.map(this.visit, this).join('') - + '}'; -}; - -/** - * Visit keyframes node. - */ - -Compiler.prototype.keyframes = function(node){ - return '@' - + (node.vendor || '') - + 'keyframes ' - + node.name - + '{' - + node.keyframes.map(this.visit, this).join('') - + '}'; -}; - -/** - * Visit keyframe node. - */ - -Compiler.prototype.keyframe = function(node){ - var decls = node.declarations; - - return node.values.join(',') - + '{' - + decls.map(this.visit, this).join('') - + '}'; -}; - -/** - * Visit page node. - */ - -Compiler.prototype.page = function(node){ - var sel = node.selectors.length - ? node.selectors.join(', ') - : ''; - - return '@page ' + sel - + '{' - + node.declarations.map(this.visit, this).join('') - + '}'; -}; - -/** - * Visit rule node. - */ - -Compiler.prototype.rule = function(node){ - var decls = node.declarations; - if (!decls.length) return ''; - - return node.selectors.join(',') - + '{' - + decls.map(this.visit, this).join('') - + '}'; -}; - -/** - * Visit declaration node. - */ - -Compiler.prototype.declaration = function(node){ - return node.property + ':' + node.value + ';'; -}; - diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/lib/identity.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/lib/identity.js deleted file mode 100644 index abf97f4..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/lib/identity.js +++ /dev/null @@ -1,205 +0,0 @@ - -/** - * Expose compiler. - */ - -module.exports = Compiler; - -/** - * Initialize a new `Compiler`. - */ - -function Compiler(options) { - options = options || {}; - this.indentation = options.indent; -} - -/** - * Compile `node`. - */ - -Compiler.prototype.compile = function(node){ - return this.stylesheet(node); -}; - -/** - * Visit `node`. - */ - -Compiler.prototype.visit = function(node){ - return this[node.type](node); -}; - -/** - * Visit stylesheet node. - */ - -Compiler.prototype.stylesheet = function(node){ - return node.stylesheet - .rules.map(this.visit, this) - .join('\n\n'); -}; - -/** - * Visit comment node. - */ - -Compiler.prototype.comment = function(node){ - return this.indent() + '/*' + node.comment + '*/'; -}; - -/** - * Visit import node. - */ - -Compiler.prototype.import = function(node){ - return '@import ' + node.import + ';'; -}; - -/** - * Visit media node. - */ - -Compiler.prototype.media = function(node){ - return '@media ' - + node.media - + ' {\n' - + this.indent(1) - + node.rules.map(this.visit, this).join('\n\n') - + this.indent(-1) - + '\n}'; -}; - -/** - * Visit document node. - */ - -Compiler.prototype.document = function(node){ - var doc = '@' + (node.vendor || '') + 'document ' + node.document; - - return doc + ' ' - + ' {\n' - + this.indent(1) - + node.rules.map(this.visit, this).join('\n\n') - + this.indent(-1) - + '\n}'; -}; - -/** - * Visit charset node. - */ - -Compiler.prototype.charset = function(node){ - return '@charset ' + node.charset + ';\n'; -}; - -/** - * Visit namespace node. - */ - -Compiler.prototype.namespace = function(node){ - return '@namespace ' + node.namespace + ';\n'; -}; - -/** - * Visit supports node. - */ - -Compiler.prototype.supports = function(node){ - return '@supports ' - + node.supports - + ' {\n' - + this.indent(1) - + node.rules.map(this.visit, this).join('\n\n') - + this.indent(-1) - + '\n}'; -}; - -/** - * Visit keyframes node. - */ - -Compiler.prototype.keyframes = function(node){ - return '@' - + (node.vendor || '') - + 'keyframes ' - + node.name - + ' {\n' - + this.indent(1) - + node.keyframes.map(this.visit, this).join('\n') - + this.indent(-1) - + '}'; -}; - -/** - * Visit keyframe node. - */ - -Compiler.prototype.keyframe = function(node){ - var decls = node.declarations; - - return this.indent() - + node.values.join(', ') - + ' {\n' - + this.indent(1) - + decls.map(this.visit, this).join('\n') - + this.indent(-1) - + '\n' + this.indent() + '}\n'; -}; - -/** - * Visit page node. - */ - -Compiler.prototype.page = function(node){ - var sel = node.selectors.length - ? node.selectors.join(', ') + ' ' - : ''; - - return '@page ' + sel - + '{\n' - + this.indent(1) - + node.declarations.map(this.visit, this).join('\n') - + this.indent(-1) - + '\n}'; -}; - -/** - * Visit rule node. - */ - -Compiler.prototype.rule = function(node){ - var indent = this.indent(); - var decls = node.declarations; - if (!decls.length) return ''; - - return node.selectors.map(function(s){ return indent + s }).join(',\n') - + ' {\n' - + this.indent(1) - + decls.map(this.visit, this).join('\n') - + this.indent(-1) - + '\n' + this.indent() + '}'; -}; - -/** - * Visit declaration node. - */ - -Compiler.prototype.declaration = function(node){ - return this.indent() + node.property + ': ' + node.value + ';'; -}; - -/** - * Increase, decrease or return current indentation. - */ - -Compiler.prototype.indent = function(level) { - this.level = this.level || 1; - - if (null != level) { - this.level += level; - return ''; - } - - return Array(this.level).join(this.indentation || ' '); -}; diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/package.json b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/package.json deleted file mode 100644 index 5dce07c..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/css-stringify/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "css-stringify", - "version": "1.3.2", - "description": "CSS compiler", - "keywords": [ - "css", - "stringify", - "stylesheet" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "devDependencies": { - "mocha": "*", - "should": "*", - "css-parse": "1.4.0" - }, - "main": "index", - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/css-stringify.git" - }, - "scripts": { - "test": "make test" - }, - "readme": "# css-stringify [![Build Status](https://travis-ci.org/visionmedia/css-stringify.png)](https://travis-ci.org/visionmedia/css-stringify)\n\n CSS compiler using the AST provided by [css-parse](https://github.com/visionmedia/css-parse).\n\n## Performance\n\n Formats 15,000 lines of CSS (2mb) in 23ms on my macbook air.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 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.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/css-stringify/issues" - }, - "_id": "css-stringify@1.3.2", - "dist": { - "shasum": "934786ed805071f6368999b92cf2853e0334985a" - }, - "_from": "css-stringify@~> 1.3.1", - "_resolved": "https://registry.npmjs.org/css-stringify/-/css-stringify-1.3.2.tgz" -} diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/package.json b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/package.json deleted file mode 100644 index d0dcabe..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "autoprefixer", - "version": "0.7.20130824", - "description": "Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website", - "keywords": [ - "css", - "prefix", - "rework" - ], - "author": { - "name": "Andrey Sitnik", - "email": "andrey@sitnik.ru" - }, - "license": "LGPL 3", - "repository": { - "type": "git", - "url": "https://github.com/ai/autoprefixer.git" - }, - "dependencies": { - "css-parse": "~> 1.5.2", - "css-stringify": "~> 1.3.1" - }, - "devDependencies": { - "coffee-script": "1.6.3", - "component": "0.17.0", - "fs-extra": "0.6.3", - "should": "1.2.2", - "stylus": "0.37.0", - "rework": "0.17.4", - "mocha": "1.12.0", - "glob": "3.2.6", - "nib": "1.0.1" - }, - "bin": { - "autoprefixer": "./bin/autoprefixer" - }, - "main": "lib/autoprefixer", - "scripts": { - "test": "mocha --reporter spec --require should --compilers coffee:coffee-script" - }, - "readme": "# Autoprefixer\n\n\n\nParse CSS and add vendor prefixes to CSS rules using values\nfrom the [Can I Use](http://caniuse.com/).\n\nWrite your CSS rules without vendor prefixes (in fact, forget about them\nentirely):\n\n```js\nvar css = 'a { transition: transform 1s }';\nvar prefixed = autoprefixer.compile(css);\n```\n\nAutoprefixer uses the data on current browser popularity\nand properties support to apply prefixes for you:\n\n```css\na {\n -webkit-transition: -webkit-transform 1s;\n transition: -ms-transform 1s;\n transition: transform 1s\n}\n```\n\nTwitter account for news and releases:\n[@autoprefixer](https://twitter.com/autoprefixer).\n\nSponsored by [Evil Martians](http://evilmartians.com/).\n\n## Translations\n\nДокументация на русском: [habrahabr.ru/company/evilmartians/blog/176909](http://habrahabr.ru/company/evilmartians/blog/176909/)\n\n## Features\n\n### Forget about prefixes\n\nThe best tool is a tool you can't see that does the work for you.\nThis is the main idea behind Autoprefixer.\n\nAutoprefixer interface is simple: just forget about vendor prefixes\nand write normal CSS according to latest W3C specs. You don’t need\na special language (like Sass) or special mixins.\n\nBecause Autoprefixer is a postprocessor for CSS,\nyou can also use it with preprocessors, such as Sass, Stylus or LESS.\n\n### Actual data from Can I Use\n\nAutoprefixer uses the most recent data from [Can I Use](http://caniuse.com/),\nunderstands which browsers are actual and popular and adds only the necessary\nvendor prefixes.\n\nIt also cleans your CSS from old prefixes (like prefixed `border-radius`,\nproduced by many CSS libraries):\n\n```css\na {\n -webkit-border-radius: 5px;\n border-radius: 5px\n}\n```\n\ncompiles to:\n\n```css\na {\n border-radius: 5px\n}\n```\n\n### Fast\n\nAutoprefixer is about 50 times faster than Compass and 10 times faster\nthan Stylus.\n\nOn a Core i7 with 10 GB of RAM and SSD, benchmark with GitHub styles is:\n\n```\n~/Dev/autoprefixer$ ./node_modules/.bin/cake bench\nLoad GitHub styles\nAutoprefixer: 257 ms\nCompass: 13626 ms (53.0 times slower)\nRework: 213 ms (1.2 times faster)\nStylus: 2596 ms (10.1 times slower)\n```\n\nUnlike -prefix-free, Autoprefixer compiles CSS once on deploy and doesn’t hit\nclient-side performance.\n\n### Rewrite syntax\n\nFlexbox or gradients have different syntaxes in different browsers\n(sometimes you need to recalculate angles, sometimes you need 2 old properties\ninstead of new one), but Autoprefixer hides this from you.\n\nJust code by latest W3C specs and Autoprefixer will produce the code\nfor old browsers:\n\n```css\na {\n display: flex;\n}\n```\n\ncompiles to:\n\n```css\na {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: -ms-flexbox;\n display: flex\n}\n```\n\n## Browsers\n\nYou can specify the browsers you want to target in your project\n(by default, it’s `last 2 versions`):\n\n```js\nautoprefixer(\"last 1 version\", \"> 1%\", \"ie 8\", \"ie 7\").compile(css);\n```\n\n* `last n versions` is last versions for each browser. Like “last 2 versions”\n [strategy](http://support.google.com/a/bin/answer.py?answer=33864) in\n Google.\n* `> n%` is browser versions, selected by global usage statistics.\n* `ff > 20` and `ff >= 20` is Firefox versions newer, that 20.\n* `none` don’t set any browsers to clean CSS from any vendor prefixes.\n* You can also set browsers directly.\n\nBlackberry and stock Android browsers will not be used in `last n versions`.\nYou can add them by name:\n\n```js\nautoprefixer(\"last 1 version\", \"bb 10\", \"android 4\").compile(css);\n```\n\nBrowsers names are:\n\nYou can get browsers codenames in\n[data file](https://github.com/ai/autoprefixer/blob/master/data/browsers.coffee):\n* `android` for old Android stock browser.\n* `bb` for Blackberry browser.\n* `chrome` for Google Chrome.\n* `ff` for Mozilla Firefox.\n* `ie` for Internet Explorer.\n* `ios` for iOS Safari.\n* `opera` for Opera.\n* `safari` for desktop Safari.\n\n## Inspect\n\nYou can check which browsers are selected and which properties will be prefixed:\n\n```js\ninspect = autoprefixer(\"last 1 version\").inspect();\nconsole.log(inspect);\n```\n\n## Usage\n\n### Ruby on Rails\n\nAdd [autoprefixer-rails](https://github.com/ai/autoprefixer-rails) gem\nto `Gemfile` and write CSS in a usual way:\n\n```ruby\ngem \"autoprefixer-rails\"\n```\n\n### Middleman\n\nAdd [middleman-autoprefixer](https://github.com/porada/middleman-autoprefixer)\ngem to `Gemfile`:\n\n```ruby\ngem \"middleman-autoprefixer\"\n```\n\nand activate the extension in your project’s `config.rb`:\n\n```ruby\nactivate :autoprefixer\n```\n\n### Ruby\n\nYou can integrate Autoprefixer into your Sprockets environment\nby `autoprefixer-rails` gem:\n\n```ruby\nAutoprefixerRails.install(sprockets_env)\n```\n\nor process CSS from plain Ruby:\n\n```ruby\nprefixed = AutoprefixerRails.compile(css)\n```\n\n### Grunt\n\nYou can use the\n[grunt-autoprefixer](https://github.com/nDmitry/grunt-autoprefixer)\nplugin for Grunt. Install the npm package and add it to Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-autoprefixer');\n```\n\nIf you use Sass with `compress` output style and worry, that Autoprefixer\nuncompress CSS, try [csso-grunt](https://github.com/t32k/grunt-csso).\nIt compress CSS back, but did it much better than Sass.\n\n### Prepros\n\nI you want to build your assets in GUI, try\n[Prepros](http://alphapixels.com/prepros/). Just set “Auto Prefix CSS”\n[checkbox](https://f.cloud.github.com/assets/3478693/930798/faa29892-0016-11e3-8901-87850de7aed2.jpg)\nin right panel.\n\n### Compass\n\nIf you use Compass binary to compile your styles, you can easy integrate\nAutoprefixer with it. Install `autoprefixer-rails` gem:\n\n```\ngem install autoprefixer-rails csso-rails\n```\n\nand add post-compile hook to `config.rb`:\n\n```ruby\nrequire 'autoprefixer-rails'\nrequire 'csso'\n\non_stylesheet_saved do |file|\n css = File.read(file)\n File.open(file, 'w') do |io|\n io << Csso.optimize( AutoprefixerRails.compile(css) )\n end\nend\n```\n\nIf you use `compress` output style, Autoprefixer will uncompress CSS.\nFor this reason, we use [csso-rails](https://github.com/Vasfed/csso-rails)\nto compress CSS back (it compress much better than Sass).\n\nIf you need uncompressed CSS, remove `Csso.optimize` method call.\n\nYou can set browsers array as second argument in `AutoprefixerRails.compile`.\n\n### Mincer\n\nTo use Autoprefixer in [Mincer](https://github.com/nodeca/mincer),\ninstall `autoprefixer` npm package and enable it:\n\n```js\nenvironment.enable(\"autoprefixer\");\n```\n\n### Node.js\n\nUse `autoprefixer` npm package:\n\n```js\nvar autoprefixer = require('autoprefixer');\nvar prefixed = autoprefixer.compile(css);\n```\n\n### JavaScript\n\nYou can use Autoprefixer in the browser or a non-Node.js runtime\nwith [standalone version](https://raw.github.com/ai/autoprefixer-rails/master/vendor/autoprefixer.js).\n\n### Rework\n\nAutoprefixer can be also used as a\n[Rework](https://github.com/visionmedia/rework)\nfilter, so you can combine it with other filters:\n\n```js\nrework(css).\n use( autoprefixer(['> 1%', 'opera 12.5']).rework ).\n use( rework.references() ).\n toString();\n```\n\n### Sublime Text\n\nYou can process your styles directly in Sublime Text with the\n[sublime-autoprefixer](https://github.com/sindresorhus/sublime-autoprefixer)\nplugin.\n\n\n### Others\n\nYou can use the `autoprefixer` binary to process CSS files using\nany assets manager:\n\n```\nsudo npm install --global autoprefixer\nautoprefixer *.css\n```\n\nSee `autoprefixer -h` for help.\n\n## In-package Update\n\nI highly recommend to always have latest version of Autoprefixer.\nBut, some company has long test period before any libraries updater.\nFor this cases, you can update Can I Use data inside npm package:\n\n```\nautoprefixer --update\n```\n\nNote, that in-package update doesn’t get new properties or code fixes. It update\nonly browsers popularity and propeties support in new browsers versions.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/ai/autoprefixer/issues" - }, - "_id": "autoprefixer@0.7.20130824", - "dist": { - "shasum": "8965b53d5c649ab8d96f1d33ceaa54f891632985" - }, - "_from": "autoprefixer@~0.7", - "_resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-0.7.20130824.tgz" -} diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/updaters/browsers.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/updaters/browsers.js deleted file mode 100644 index 3310d76..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/updaters/browsers.js +++ /dev/null @@ -1,66 +0,0 @@ -(function() { - module.exports = function() { - var minor, - _this = this; - minor = ['bb', 'android']; - return this.github('Fyrd/caniuse/master/data.json', function(data) { - var agent, browsers, caniuse, internal, intervals, normalize, _ref; - normalize = function(array) { - return array.reverse().filter(function(i) { - return i; - }); - }; - intervals = function(array) { - var i, interval, result, splited, sub, _i, _len; - result = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - interval = array[_i]; - splited = interval.split('-'); - sub = (function() { - var _j, _len1, _results; - _results = []; - for (_j = 0, _len1 = splited.length; _j < _len1; _j++) { - i = splited[_j]; - _results.push([i, interval, splited.length]); - } - return _results; - })(); - result = result.concat(sub); - } - return result; - }; - agent = function(name) { - var future, info, result, versions; - info = data.agents[name]; - future = normalize(info.versions.slice(-2)).map(function(i) { - return parseFloat(i); - }); - versions = intervals(normalize(info.versions.slice(0, -2))); - result = { - prefix: "-" + info.prefix + "-" - }; - if (minor.indexOf(name) !== -1) { - result.minor = true; - } - if (future.length) { - result.future = future; - } - result.versions = versions.map(function(i) { - return parseFloat(i[0]); - }); - result.popularity = versions.map(function(i) { - return info.usage_global[i[1]] / i[2]; - }); - return result; - }; - browsers = {}; - _ref = _this.browsers; - for (caniuse in _ref) { - internal = _ref[caniuse]; - browsers[internal] = agent(caniuse); - } - return _this.save('browsers', browsers); - }); - }; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/updaters/prefixes.js b/node_modules/grunt-autoprefixer/node_modules/autoprefixer/updaters/prefixes.js deleted file mode 100644 index df9a492..0000000 --- a/node_modules/grunt-autoprefixer/node_modules/autoprefixer/updaters/prefixes.js +++ /dev/null @@ -1,162 +0,0 @@ -(function() { - var __slice = [].slice; - - module.exports = function(updater) { - var prefix, prefixes, - _this = this; - prefixes = {}; - prefix = function() { - var data, name, names, _i, _j, _len, _results; - names = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), data = arguments[_i++]; - _results = []; - for (_j = 0, _len = names.length; _j < _len; _j++) { - name = names[_j]; - _results.push(prefixes[name] = data); - } - return _results; - }; - this.feature('border-radius.json', function(browsers) { - prefix('border-radius', { - browsers: browsers, - transition: true - }); - prefix('border-top-left-radius', { - browsers: browsers, - transition: true - }); - prefix('border-top-right-radius', { - browsers: browsers, - transition: true - }); - prefix('border-bottom-right-radius', { - browsers: browsers, - transition: true - }); - return prefix('border-bottom-left-radius', { - browsers: browsers, - transition: true - }); - }); - this.feature('css-boxshadow.json', function(browsers) { - return prefix('box-shadow', { - browsers: browsers, - transition: true - }); - }); - this.feature('css-animation.json', function(browsers) { - return prefix('animation', 'animation-name', 'animation-duration', 'animation-delay', 'animation-direction', 'animation-fill-mode', 'animation-iteration-count', 'animation-play-state', 'animation-timing-function', '@keyframes', { - browsers: browsers - }); - }); - this.feature('css-transitions.json', function(browsers) { - return prefix('transition', 'transition-property', 'transition-duration', 'transition-delay', 'transition-timing-function', { - browsers: browsers - }); - }); - this.feature('transforms2d.json', function(browsers) { - prefix('transform', 'transform-origin', 'perspective', 'perspective-origin', { - browsers: browsers, - transition: true - }); - return prefix('transform-style', 'backface-visibility', { - browsers: browsers - }); - }); - this.feature('css-gradients.json', function(browsers) { - return prefix('linear-gradient', 'repeating-linear-gradient', 'radial-gradient', 'repeating-radial-gradient', { - props: ['background', 'background-image', 'border-image'], - browsers: browsers - }); - }); - this.feature('css3-boxsizing.json', function(browsers) { - return prefix('box-sizing', { - browsers: browsers - }); - }); - this.feature('css-filters.json', function(browsers) { - return prefix('filter', { - browsers: browsers, - transition: true - }); - }); - this.feature('multicolumn.json', function(browsers) { - prefix('columns', 'column-width', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-width', { - browsers: browsers, - transition: true - }); - return prefix('column-count', 'column-rule-style', 'column-span', 'column-fill', 'break-before', 'break-after', 'break-inside', { - browsers: browsers - }); - }); - this.feature('user-select-none.json', function(browsers) { - return prefix('user-select', { - browsers: browsers - }); - }); - this.feature('flexbox.json', function(browsers) { - prefix('display-flex', { - browsers: browsers - }); - prefix('flex', 'flex-grow', 'flex-shrink', 'flex-basis', { - transition: true, - browsers: browsers - }); - return prefix('flex-direction', 'flex-wrap', 'flex-flow', 'justify-content', 'order', 'align-items', 'align-self', 'align-content', { - browsers: browsers - }); - }); - this.feature('calc.json', function(browsers) { - return prefix('calc', { - props: ['*'], - browsers: browsers - }); - }); - this.feature('background-img-opts.json', function(browsers) { - return prefix('background-clip', 'background-origin', 'background-size', { - browsers: browsers - }); - }); - this.feature('font-feature.json', function(browsers) { - return prefix('font-feature-settings', 'font-variant-ligatures', 'font-language-override', 'font-kerning', { - browsers: browsers - }); - }); - this.feature('border-image.json', function(browsers) { - return prefix('border-image', { - browsers: browsers - }); - }); - this.feature('css-selection.json', function(browsers) { - return prefix('::selection', { - selector: true, - browsers: browsers - }); - }); - this.feature('css-placeholder.json', function(browsers) { - return prefix('::placeholder', { - selector: true, - browsers: browsers - }); - }); - this.feature('css-hyphens.json', function(browsers) { - return prefix('hyphens', { - browsers: browsers - }); - }); - this.feature('fullscreen.json', function(browsers) { - return prefix(':fullscreen', { - selector: true, - browsers: browsers - }); - }); - this.feature('css3-tabsize.json', function(browsers) { - return prefix('tab-size', { - browsers: browsers - }); - }); - return this.done(function() { - return _this.save('prefixes', prefixes); - }); - }; - -}).call(this); diff --git a/node_modules/grunt-autoprefixer/package.json b/node_modules/grunt-autoprefixer/package.json deleted file mode 100644 index f731cd8..0000000 --- a/node_modules/grunt-autoprefixer/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "grunt-autoprefixer", - "description": "Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.", - "version": "0.2.20130806", - "homepage": "https://github.com/nDmitry/grunt-autoprefixer", - "author": { - "name": "Dmitry Nikitenko", - "email": "dima.nikitenko@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/nDmitry/grunt-autoprefixer.git" - }, - "bugs": { - "url": "https://github.com/nDmitry/grunt-autoprefixer/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/nDmitry/grunt-autoprefixer/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.6", - "grunt-contrib-clean": "~0.5", - "grunt-contrib-nodeunit": "~0.2", - "grunt": "~0.4", - "autoprefixer": "~0.7" - }, - "dependencies": { - "autoprefixer": "~0.7" - }, - "peerDependencies": { - "grunt": "~0.4" - }, - "keywords": [ - "gruntplugin", - "prefix", - "autoprefixer" - ], - "readme": "# grunt-autoprefixer [![Build Status](https://travis-ci.org/nDmitry/grunt-autoprefixer.png?branch=master)](https://travis-ci.org/nDmitry/grunt-autoprefixer)\n\n> [Autoprefixer](https://github.com/ai/autoprefixer) parses CSS and adds vendor-prefixed CSS properties using the [Can I Use](http://caniuse.com/) database.\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-autoprefixer --save-dev\n```\n\nOne the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-autoprefixer');\n```\n\n## The \"autoprefixer\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `autoprefixer` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n autoprefixer: {\n options: {\n // Task-specific options go here.\n },\n your_target: {\n // Target-specific file lists and/or options go here.\n },\n },\n})\n```\n\n### Options\n\n#### options.browsers\nType: `Array`\nDefault value: `['last 2 versions']`\n\nYou can specify browsers actual for your project (by default, it’s\n`'last 2 versions'`):\n\n```js\noptions: {\n browsers: ['last 1 version', '> 1%', 'ie 8', 'ie 7']\n}\n```\n\n* `last n versions` is last `n` versions for each browser (for example,\n [Google also uses](http://support.google.com/a/bin/answer.py?answer=33864)\n “last 2 version” strategy).\n* `> n%` is browser versions, which global usage statistics is more than `n`%.\n* You can also set browsers directly.\n\n### Usage Example\n\n#### Default Options\n\n```js\ngrunt.initConfig({\n autoprefixer: {\n dist: {\n options: {\n browsers: ['last 1 version', '> 1%', 'ie 8', 'ie 7']\n },\n files: {\n 'dest/styles.css': ['src/something.css', 'src/whatever.css']\n }\n }\n },\n})\n```\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\n\n* 07/16/2013 - 0.2.0 - Update the task according to Autoprefixer API changes.\n* 04/19/2013 - 0.1.0 - Initial release.\n", - "readmeFilename": "README.md", - "_id": "grunt-autoprefixer@0.2.20130806", - "dist": { - "shasum": "a791eee2c507294ca6175195249428a6d3211c54" - }, - "_from": "grunt-autoprefixer@~0.2.0", - "_resolved": "https://registry.npmjs.org/grunt-autoprefixer/-/grunt-autoprefixer-0.2.20130806.tgz" -} diff --git a/node_modules/grunt-autoprefixer/tasks/autoprefixer.js b/node_modules/grunt-autoprefixer/tasks/autoprefixer.js deleted file mode 100644 index e5dd2ad..0000000 --- a/node_modules/grunt-autoprefixer/tasks/autoprefixer.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * grunt-autoprefixer - * - * - * Copyright (c) 2013 Dmitry Nikitenko - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - var autoprefixer = require('autoprefixer'); - - grunt.registerMultiTask('autoprefixer', 'Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website.', function() { - - var options = this.options(), - compiler = autoprefixer(options.browsers); - - // Iterate over all specified file groups. - this.files.forEach(function(f) { - - // Concat specified files. - var src = f.src.filter(function(filepath) { - - // Warn on and remove invalid source files (if nonull was set). - if (!grunt.file.exists(filepath)) { - grunt.log.warn('Source file "' + filepath + '" not found.'); - return false; - } else { - return true; - } - - }).map(function(filepath) { - - // Read file source. - return grunt.file.read(filepath); - }).join(''); - - // Write the destination file. - grunt.file.write(f.dest, compiler.compile(src)); - - // Print a success message. - grunt.log.writeln('File "' + f.dest + '" created.'); - }); - }); - -}; diff --git a/node_modules/grunt-bower-install/.editorconfig b/node_modules/grunt-bower-install/.editorconfig deleted file mode 100644 index 18c9e3c..0000000 --- a/node_modules/grunt-bower-install/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -end_of_line = lf -trim_trailing_whitespace = true -insert_final_newline = true \ No newline at end of file diff --git a/node_modules/grunt-bower-install/.jshintrc b/node_modules/grunt-bower-install/.jshintrc deleted file mode 100644 index 874c4da..0000000 --- a/node_modules/grunt-bower-install/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "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, - "laxbreak": true -} diff --git a/node_modules/grunt-bower-install/.npmignore b/node_modules/grunt-bower-install/.npmignore deleted file mode 100644 index b20278c..0000000 --- a/node_modules/grunt-bower-install/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules/ -*log diff --git a/node_modules/grunt-bower-install/Gruntfile.js b/node_modules/grunt-bower-install/Gruntfile.js deleted file mode 100644 index 4f7fdb5..0000000 --- a/node_modules/grunt-bower-install/Gruntfile.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -module.exports = function (grunt) { - grunt.initConfig({ - nodeunit: { - files: ['test/**/*_test.js'] - }, - jshint: { - options: { - jshintrc: '.jshintrc' - }, - gruntfile: { - src: 'Gruntfile.js' - }, - lib: { - src: ['lib/**/*.js'] - }, - test: { - src: ['test/**/*.js'] - }, - }, - watch: { - gruntfile: { - files: '<%= jshint.gruntfile.src %>', - tasks: ['jshint:gruntfile'] - }, - lib: { - files: '<%= jshint.lib.src %>', - tasks: ['jshint:lib', 'nodeunit'] - }, - test: { - files: '<%= jshint.test.src %>', - tasks: ['jshint:test', 'nodeunit'] - } - } - }); - - grunt.loadTasks('tasks'); - - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - grunt.registerTask('default', ['jshint', 'nodeunit']); -}; diff --git a/node_modules/grunt-bower-install/LICENSE-MIT b/node_modules/grunt-bower-install/LICENSE-MIT deleted file mode 100644 index 3f09a28..0000000 --- a/node_modules/grunt-bower-install/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Stephen Sawchuk - -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/node_modules/grunt-bower-install/node_modules/wiredep/README.md b/node_modules/grunt-bower-install/node_modules/wiredep/README.md deleted file mode 100644 index c941c23..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# wiredep - -Wire dependencies to your source code. - -## Getting Started -Install the module with: `npm install wiredep --save` - -```js -var wiredep = require('wiredep')({ - directory: 'the directory of your Bower packages.', - bowerJson: 'your bower.json file contents.', - ignorePath: 'optional path to ignore from the injected filepath.', - htmlFile: 'the path to the HTML file to take control of.' -}); -``` - - -## 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/). - - -## License -Copyright (c) 2013 Stephen Sawchuk. Licensed under the MIT license. diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/bin/wiredep b/node_modules/grunt-bower-install/node_modules/wiredep/bin/wiredep deleted file mode 100644 index 8cedc8c..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/bin/wiredep +++ /dev/null @@ -1,37 +0,0 @@ -/* - * wiredep - * https://github.com/stephenplusplus/wiredep - * - * Copyright (c) 2013 Stephen Sawchuk - * Licensed under the MIT license. - */ - -'use strict'; - -var fs = require('fs'); -var helpers = require('../lib/helpers'); - -/** - * Wire up the html files with the bower stuff. - * - * @param {object} config the global configuration object - */ -module.exports = function (opts) { - var config = helpers.createStore(); - - config.set - ('warnings', []) - ('global-dependencies', helpers.createStore()) - ('bower.json', opts.bowerJson) - ('directory', opts.directory) - ('ignore-path', opts.ignorePath) - ('html-file', opts.htmlFile) - ('html', String(fs.readFileSync(opts.htmlFile))); - - require('../lib/detect-dependencies')(config); - require('../lib/inject-dependencies')(config); - - if (config.get('warnings')) { - helpers.warn(config.get('warnings')); - } -}; diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/lib/detect-dependencies.js b/node_modules/grunt-bower-install/node_modules/wiredep/lib/detect-dependencies.js deleted file mode 100644 index ebfed49..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/lib/detect-dependencies.js +++ /dev/null @@ -1,220 +0,0 @@ -/* - * detect-dependencies.js - * https://github.com/stephenplusplus/wiredep - * - * Copyright (c) 2013 Stephen Sawchuk - * Licensed under the MIT license. - */ - -'use strict'; - -var fs = require('fs'); -var path = require('path'); -var _ = require('lodash'); -var helpers = require('./helpers'); -var prop = helpers.prop; - - -/** - * Find the component's JSON configuration file. - * - * @param {object} config the global configuration object - * @param {string} component the name of the component to dig for - * @return {object} the component's config file - */ -var findComponentConfigFile = function (config, component) { - var componentConfigFile; - - ['.bower.json', - 'bower.json', - 'component.json', - 'package.json'].forEach(function (configFile) { - configFile = path.join(config.get('directory'), component, configFile); - - if (!_.isObject(componentConfigFile) && fs.existsSync(configFile)) { - componentConfigFile = JSON.parse(fs.readFileSync(configFile)); - } - }); - - return componentConfigFile; -}; - - -/** - * Find the main file the component refers to. It's not always main :( - * - * @param {object} config the global configuration object - * @param {string} component the name of the component to dig for - * @param {componentConfigFile} the component's config file - * @return {array} the array of paths to the component's primary file(s) - */ -var findMainFiles = function (config, component, componentConfigFile) { - var filePaths = []; - var file; - - if (_.isString(componentConfigFile.main)) { - // start by looking for what every component should have: config.main - filePaths = [componentConfigFile.main]; - } else if (_.isArray(componentConfigFile.main)) { - filePaths = componentConfigFile.main; - } else if (_.isArray(componentConfigFile.scripts)) { - // still haven't found it. is it stored in config.scripts, then? - filePaths = componentConfigFile.scripts; - } else { - file = path.join(config.get('directory'), component, componentConfigFile.name + '.js'); - if (fs.existsSync(file)) { - filePaths = [componentConfigFile.name + '.js']; - } - } - - return filePaths.map(function (file) { - return path.join(config.get('directory'), component, file); - }); -}; - - -/** - * Store the information our prioritizer will need to determine rank. - * - * @param {object} config the global configuration object - * @return {function} the iterator function, called on every component - */ -var gatherInfo = function (config) { - /** - * The iterator function, which is called on each component. - * - * @param {string} version the version of the component - * @param {string} component the name of the component - * @return {undefined} - */ - return function (version, component) { - var dep = config.get('global-dependencies').get(component) || { - main: '', - type: '', - name: '', - dependents: 0, - dependencies: {} - }; - - var componentConfigFile = findComponentConfigFile(config, component); - var warnings = config.get('warnings'); - - var mains = findMainFiles(config, component, componentConfigFile); - var fileTypes = _.chain(mains).map(function (main) { - return path.extname(main); - }).unique().value(); - - dep.main = mains; - dep.type = fileTypes; - dep.name = componentConfigFile.name; - dep.dependents += 1; - - if (dep.main.length === 0) { - // can't find the main file. this config file is useless! - warnings.push(component + ' was not injected in your file.'); - warnings.push( - 'Please go take a look in "' - + path.join(config.get('directory'), component) - + '" for the file you need, then manually include it in your file.'); - - config.set('warnings', warnings); - return; - } - - if (componentConfigFile.dependencies) { - dep.dependencies = componentConfigFile.dependencies; - - _.each(componentConfigFile.dependencies, gatherInfo(config)); - } - - config.get('global-dependencies').set(component, dep); - }; -}; - - -/** - * Compare two dependencies to determine priority. - * - * @param {object} dependency dependency a - * @param {object} lastDependency dependency b - * @return {number} the priority of dependency a in comparison to dependency b - */ -var dependencyComparator = function (dependency, lastDependency) { - return Object. - keys(dependency.dependencies). - filter(function (dependency) { - return dependency === lastDependency.name; - }).length ? 1 : 0; -}; - - -/** - * Some dependencies which we know should always come first. - */ -var eliteDependencies = [ - 'es5-shim', - 'jquery', - 'zepto', - 'modernizr' -]; - - -/** - * Sort the dependencies in the order we can best determine they're needed. - * - * @param {object} config the global configuration object - * @param {string} fileType the type of file to prioritize - * @return {array} the sorted items of 'path/to/main/files.ext' sorted by type - */ -var prioritizeDependencies = function (config, fileType) { - var eliteDependenciesCaught = []; - - var dependencies = - _.toArray(config.get('global-dependencies').get()). - filter(function (dependency) { - return _.contains(dependency.type, fileType); - }). - reduce(function (grouped, dependency) { - return grouped.push(dependency) && grouped.sort(dependencyComparator); - }, []). - filter(function (dependency) { - if (_.contains(eliteDependencies, dependency.name)) { - eliteDependenciesCaught.push(dependency.main); - } else { - return true; - } - }). - map(prop('main')); - - eliteDependenciesCaught. - forEach(function (dependency) { - dependencies.unshift(dependency); - }); - - return _ - (dependencies). - flatten(). - value(). - filter(function (main) { - return path.extname(main) === fileType; - }); -}; - - -/** - * Detect dependencies of the components from `bower.json`. - * - * @param {object} config the global configuration object. - * @return {object} config - */ -module.exports = function detect(config) { - _.each(config.get('bower.json').dependencies, gatherInfo(config)); - - config.set('global-dependencies-sorted', { - js: prioritizeDependencies(config, '.js'), - css: prioritizeDependencies(config, '.css'), - scss: prioritizeDependencies(config, '.scss') - }); - - return config; -}; diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/lib/helpers.js b/node_modules/grunt-bower-install/node_modules/wiredep/lib/helpers.js deleted file mode 100644 index 63ca31f..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/lib/helpers.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * helpers.js - * https://github.com/stephenplusplus/wiredep - * - * Copyright (c) 2013 Stephen Sawchuk - * Licensed under the MIT license. - */ - -'use strict'; - -var chalk = require('chalk'); - - -/** - * Returns a set/get style internal storage bucket. - * - * @return {object} the API to set and retrieve data - */ -module.exports.createStore = function () { - var bucket = {}; - - /** - * Sets a property on the store, with the given value. - * - * @param {string} property an identifier for the data - * @param {*} value the value of the data being stored - * @return {function} the set function itself to allow chaining - */ - var set = function (property, value) { - bucket[property] = value; - return set; - }; - - /** - * Returns the store item asked for, otherwise all of the items. - * - * @param {string|undefined} property the property being requested - * @return {*} the store item that was matched - */ - var get = function (property) { - if (!property) { - return bucket; - } - - return bucket[property]; - }; - - return { - set: set, - get: get - }; -}; - - -/** - * Return just a property from an object. - * - * @param {string} prop the key of the object to return - * @return {function} - */ -module.exports.prop = function (prop) { - return function (item) { - return item[prop]; - }; -}; - - -/** - * Quick litle buddy that pads and throws some warnings when something goes :( - * - * @param {array} messages an array of messages to be displayed - * @return {undefined} - */ -module.exports.warn = function (messages) { - if (!messages) { - throw new Error( - 'Hmm, we had some problems.' - + '\nMake sure to check out the GitHub page for help:' - + '\n' - + '\n https://github.com/stephenplusplus/wiredep' - ); - } - - // to prevent duplicate messages, we'll store what we've already presented. - var displayedMessages = {}; - messages.forEach(function (message, index) { - if (!displayedMessages[message]) { - displayedMessages[message] = true; - if (index % 2 === 0) { - console.log('\n' + chalk.bgMagenta(message)); - } else { - console.log(message); - } - } - }); -}; diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/lib/inject-dependencies.js b/node_modules/grunt-bower-install/node_modules/wiredep/lib/inject-dependencies.js deleted file mode 100644 index b292c03..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/lib/inject-dependencies.js +++ /dev/null @@ -1,130 +0,0 @@ -/* - * inject-dependencies.js - * https://github.com/stephenplusplus/wiredep - * - * Copyright (c) 2013 Stephen Sawchuk - * Licensed under the MIT license. - */ - -'use strict'; - -var fs = require('fs'); - -var globalDependenciesSorted; -var ignorePath; - -var regex = { - bower: /(([\s\t]*))(\n|\r|.)*?()/gi, - script: //gi, - stylesheet: /'; - }, - js: function (path) { - return ''; - } - }[blockType]; - - return spacing + replacePattern(path); -}; - - -/** - * Callback function after matching our regex from the HTML file. - * - * @param {array} match strings that were matched - * @param {string} startBlock the opening comment - * @param {string} spacing the type and size of indentation - * @param {string} blockType the type of block (js/css) - * @param {string} oldScripts the old block of scripts we'll remove - * @param {string} endBlock the closing comment - * @return {string} the new html - */ -var injectScripts = function (match, startBlock, spacing, blockType, oldScripts, endBlock, offset, string) { - blockType = blockType || 'js'; - - var html = startBlock; - var dependencies = globalDependenciesSorted[blockType] || []; - - string = string.substr(0, offset) + string.substr(offset + match.length); - - string. - replace(oldScripts, ''). - replace(regex.script, findScripts). - replace(regex.stylesheet, findStyleSheets); - - spacing = '\n' + spacing.replace(/\r|\n/g, ''); - - if (dependencies.length) { - dependencies. - map(function (path) { - return path.replace(/\\/g, '/').replace(ignorePath, ''); - }). - filter(function (path) { - return filesCaught.indexOf(path) === -1; - }). - forEach(function (path) { - html += replace(blockType, spacing, path); - }); - - return html += spacing + endBlock; - } else { - return match; - } -}; - - -/** - * Injects dependencies into the specified HTML file. - * - * @param {object} config the global configuration object. - * @return {object} config - */ -module.exports = function inject(config) { - globalDependenciesSorted = config.get('global-dependencies-sorted'); - ignorePath = config.get('ignore-path'); - - var htmlFile = config.get('html-file'); - var html = config.get('html'); - - // grab the html file and its contents, then drop our scripts in. - fs.writeFileSync(htmlFile, html.replace(regex.bower, injectScripts)); - - return config; -}; diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/chalk.js b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/chalk.js deleted file mode 100644 index d4887e1..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/chalk.js +++ /dev/null @@ -1,64 +0,0 @@ -'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/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js deleted file mode 100644 index 26dc10e..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js +++ /dev/null @@ -1,31 +0,0 @@ -'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/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index 8dfaf88..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "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/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/readme.md deleted file mode 100644 index 8be91a9..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,76 +0,0 @@ -# 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/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/has-color.js b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/has-color.js deleted file mode 100644 index 4fb6efa..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/has-color.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -module.exports = (function () { - var term; - - 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; - } - - term = process.env.TERM; - - if (!term) { - return false; - } - - term = term.toLowerCase(); - - return term.indexOf('color') !== -1 || term === 'xterm' || term === 'linux'; -})(); diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/package.json b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/package.json deleted file mode 100644 index 612d573..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "has-color", - "version": "0.1.1", - "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\n*Used 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 can be overriden by the user with the flags `--color` and `--no-color`.\n\n\n## License\n\nMIT License • © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "_id": "has-color@0.1.1", - "_from": "has-color@~0.1.0" -} diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/readme.md b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/readme.md deleted file mode 100644 index 5718180..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/node_modules/has-color/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# 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 can be overriden by the user with the flags `--color` and `--no-color`. - - -## License - -MIT License • © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/package.json b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/package.json deleted file mode 100644 index 8bd5907..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "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/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/readme.md b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/readme.md deleted file mode 100644 index 35c61d0..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/chalk/readme.md +++ /dev/null @@ -1,125 +0,0 @@ -# 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/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/lodash/README.md b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/lodash/README.md deleted file mode 100644 index 3eef601..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/lodash/README.md +++ /dev/null @@ -1,203 +0,0 @@ -# Lo-Dash v1.3.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/1.3.1/dist/lodash.js) and -[Production](https://raw.github.com/lodash/lodash/1.3.1/dist/lodash.min.js) - -* Lo-Dash compatibility builds (for legacy and modern environments):
-[Development](https://raw.github.com/lodash/lodash/1.3.1/dist/lodash.compat.js) and -[Production](https://raw.github.com/lodash/lodash/1.3.1/dist/lodash.compat.min.js) - -* Underscore compatibility builds:
-[Development](https://raw.github.com/lodash/lodash/1.3.1/dist/lodash.underscore.js) and -[Production](https://raw.github.com/lodash/lodash/1.3.1/dist/lodash.underscore.min.js) - -* CDN copies of ≤ v1.3.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.3.1/lodash.js), -[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.min.js),
-[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.compat.js), -[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.compat.min.js),
-[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.underscore.js), and -[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.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). - -## Features *not* in Underscore - - * 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 - * [_.debounce](http://lodash.com/docs#debounce) and [_.throttle](http://lodash.com/docs#throttle) accept an `options` argument for more control - * [_.createCallback](http://lodash.com/docs#createCallback) to customize how callback arguments are handled and support callback shorthands in mixins - * [_.findIndex](http://lodash.com/docs#findIndex) and [_.findKey](http://lodash.com/docs#findKey) for finding indexes and keys of collections - * [_.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) - * [_.parseInt](http://lodash.com/docs#parseInt) for consistent cross-environment behavior - * [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding - * [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support - * [_.support](http://lodash.com/docs#support) to flag environment features - * [_.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) - * [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects - * [_.unzip](http://lodash.com/docs#unzip) as the inverse of [_.zip](http://lodash.com/docs#zip) - * [_.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 - -## 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) - -## Support - -Lo-Dash has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.7 (Node bug [#5622](https://github.com/joyent/node/issues/5622) prevents 0.10.8-0.10.10 from working), Narwhal 0.3.2, PhantomJS 1.9.0, 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/dist/lodash.underscore'); -``` - -**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your 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.3.1 - - * Added missing `cache` property to the objects returned by `getObject` - * Ensured `maxWait` unit tests pass in Ringo - * Increased the `maxPoolSize` value - * Optimized `releaseArray` and `releaseObject` - -### v1.3.0 - - * Added `_.transform` method - * Added `_.chain` and `_.findWhere` aliases - * Added internal array and object pooling - * Added Istanbul test coverage reports to Travis CI - * Added `maxWait` option to `_.debounce` - * Added support for floating point numbers to `_.random` - * Added Volo configuration to package.json - * Adjusted UMD for `component build` - * Allowed more stable mixing of `lodash` and `underscore` build methods - * Ensured debounced function with, `leading` and `trailing` options, works as expected - * Ensured minified builds work with the Dojo builder - * Ensured minification avoids deoptimizing expressions containing boolean values - * Ensured unknown types return `false` in `_.isObject` and `_.isRegExp` - * Ensured `_.clone`, `_.flatten`, and `_.uniq` can be used as a `callback` for methods like `_.map` - * Ensured `_.forIn` works on objects with longer inheritance chains in IE < 9 - * Ensured `_.isPlainObject` returns `true` for empty objects in IE < 9 - * Ensured `_.max` and `_.min` chain correctly - * Ensured `clearTimeout` use doesn’t cause errors in Titanium - * Ensured that the `--stdout` build option doesn't write to a file - * Exposed memoized function’s `cache` - * Fixed `Error.prototype` iteration bugs - * Fixed "scripts" paths in component.json - * Made methods support customizing `_.indexOf` - * Made the build track dependencies of private functions - * Made the `template` pre-compiler build option avoid escaping non-ascii characters - * Made `_.createCallback` avoid binding functions if they don’t reference `this` - * Optimized the Closure Compiler minification process - * Optimized the large array cache for `_.difference`, `_.intersection`, and `_.uniq` - * Optimized internal `_.flatten` and `_.indexOf` use - * Reduced `_.unzip` and `_.zip` - * Removed special handling of arrays in `_.assign` and `_.defaults` - -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/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/lodash/dist/lodash.compat.js b/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/lodash/dist/lodash.compat.js deleted file mode 100644 index 7dc1deb..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/node_modules/lodash/dist/lodash.compat.js +++ /dev/null @@ -1,5909 +0,0 @@ -/** - * @license - * Lo-Dash 1.3.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) { - - /** 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 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 HTML entities */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/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 match "interpolate" template delimiters */ - var reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to detect functions containing a `this` reference */ - var reThis = (reThis = /\bthis\b/) && reThis.test(runInContext) && reThis; - - /** 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 leading whitespace and zeros to be removed */ - var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); - - /** 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 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' - }; - - /** Detect free variable `exports` */ - var freeExports = objectTypes[typeof exports] && exports; - - /** Detect free variable `module` */ - var freeModule = objectTypes[typeof module] && module && module.exports == freeExports && module; - - /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */ - var freeGlobal = objectTypes[typeof global] && global; - if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { - window = freeGlobal; - } - - /*--------------------------------------------------------------------------*/ - - /** - * A basic implementation of `_.indexOf` without support for binary searches - * or `fromIndex` constraints. - * - * @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. - * @returns {Number} Returns the index of the matched value or `-1`. - */ - function basicIndexOf(array, value, fromIndex) { - var index = (fromIndex || 0) - 1, - length = array.length; - - 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 {Mixed} 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]; - } - if (type != 'number' && type != 'string') { - type = 'object'; - } - var key = type == 'number' ? value : keyPrefix + value; - cache = cache[type] || (cache[type] = {}); - - return type == 'object' - ? (cache[key] && basicIndexOf(cache[key], value) > -1 ? 0 : -1) - : (cache[key] ? 0 : -1); - } - - /** - * Adds a given `value` to the corresponding cache object. - * - * @private - * @param {Mixed} 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') { - if ((typeCache[key] || (typeCache[key] = [])).push(value) == this.array.length) { - cache[type] = false; - } - } 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` 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 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; - - 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 cache.object === false - ? (releaseObject(result), null) - : 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, - 'criteria': null, - 'false': false, - 'firstArg': '', - 'index': 0, - 'init': '', - '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, - 'useKeys': false, - 'value': null - }; - } - - /** - * 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 - } - - /** - * 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=window] 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.com/#x11.1.5. - context = context ? _.defaults(window.Object(), context, _.pick(window, contextProps)) : window; - - /** 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, - concat = arrayRef.concat, - 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, - toString = objectProto.toString; - - /* 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`, `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`, `transform`, `union`, `uniq`, `unshift`, - * `unzip`, `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`, `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 - * passed, otherwise they return unwrapped values. - * - * @name _ - * @constructor - * @alias chain - * @category Chaining - * @param {Mixed} 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 {Mixed} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns a `lodash` instance. - */ - function lodashWrapper(value) { - 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 `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 an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9). - * - * @memberOf _.support - * @type Boolean - */ - support.argsClass = isArguments(arguments); - - /** - * 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 own properties are iterated after inherited properties (all but IE < 9). - * - * @memberOf _.support - * @type Boolean - */ - support.ownLast = props[0] != 'x'; - - /** - * 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 `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.useKeys) { - __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 - }; - - /** 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 : lodash.createCallback(callback, thisArg)", - 'array': "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, - 'array': false - }; - - /*--------------------------------------------------------------------------*/ - - /** - * 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} [idicator] Used to indicate binding by key or partially - * applying arguments from the right. - * @returns {Function} Returns the new bound function. - */ - function createBound(func, thisArg, partialArgs, indicator) { - var isFunc = isFunction(func), - isPartial = !partialArgs, - key = thisArg; - - // juggle arguments - if (isPartial) { - var rightIndicator = indicator; - partialArgs = thisArg; - } - else if (!isFunc) { - if (!indicator) { - throw new TypeError; - } - 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 = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args)) - : partialArgs; - } - 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.com/#x13.2.2 - var result = func.apply(thisBinding, args); - return isObject(result) ? result : thisBinding; - } - return func.apply(thisBinding, args); - } - return bound; - } - - /** - * Creates compiled iteration functions. - * - * @private - * @param {Object} [options1, options2, ...] The compile options object(s). - * array - 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. - * useKeys - A boolean to specify using `_.keys` for own property iteration. - * 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 = getObject(); - - // data properties - data.shadowedProps = shadowedProps; - // iterator options - data.array = data.bottom = data.loop = data.top = ''; - data.init = 'iterable'; - data.useHas = true; - data.useKeys = !!keys; - - // 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( - 'errorClass, errorProto, hasOwnProperty, isArguments, isArray, ' + - 'isString, keys, lodash, objectProto, objectTypes, nonEnumProps, ' + - 'stringClass, stringProto, toString', - 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' - ); - - releaseObject(data); - - // return the compiled function - return factory( - errorClass, errorProto, hasOwnProperty, isArguments, isArray, - isString, keys, lodash, 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) { - var 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 `basicIndexOf` function. - * - * @private - * @returns {Function} Returns the "indexOf" function. - */ - function getIndexOf(array, value, fromIndex) { - var result = (result = lodash.indexOf) === indexOf ? basicIndexOf : result; - return result; - } - - /** - * Creates a function that juggles arguments, allowing argument overloading - * for `_.flatten` and `_.uniq`, before passing them to the given `func`. - * - * @private - * @param {Function} func The function to wrap. - * @returns {Function} Returns the new function. - */ - function overloadWrapper(func) { - return function(array, flag, callback, thisArg) { - // juggle arguments - if (typeof flag != 'boolean' && flag != null) { - thisArg = callback; - callback = !(thisArg && thisArg[flag] === array) ? flag : undefined; - flag = false; - } - if (callback != null) { - callback = lodash.createCallback(callback, thisArg); - } - return func(array, flag, callback, thisArg); - }; - } - - /** - * 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 {Mixed} 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 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 {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 (!support.argsClass) { - isArguments = function(value) { - return value ? hasOwnProperty.call(value, 'callee') : false; - }; - } - - /** - * 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) { - return value ? (typeof value == 'object' && 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 a new 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 `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 ((support.enumPrototypes && typeof object == 'function') || - (support.nonEnumArgs && object.length && isArguments(object))) { - return shimKeys(object); - } - return nativeKeys(object); - }; - - /** - * 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 basicEach = createIterator(eachIteratorOptions); - - /** - * 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 property 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 = lodash.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=[]] Tracks traversed source objects. - * @param- {Array} [stackB=[]] Associates 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 != 'boolean' && deep != null) { - thisArg = callback; - callback = deep; - deep = false; - } - if (typeof callback == 'function') { - callback = (typeof thisArg == 'undefined') - ? callback - : lodash.createCallback(callback, thisArg, 1); - - 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 ? basicEach : forOwn)(value, function(objValue, key) { - result[key] = clone(objValue, deep, callback, undefined, stackA, stackB); - }); - - if (initedStack) { - releaseArray(stackA); - releaseArray(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 - * `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 {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) : undefined; - * }); - * - * 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] Allows 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); - - /** - * This method is similar to `_.find`, except that it returns the key of the - * 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 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 key of the found element, else `undefined`. - * @example - * - * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { - * return num % 2 == 0; - * }); - * // => 'b' - */ - function findKey(object, callback, thisArg) { - var result; - callback = lodash.createCallback(callback, thisArg); - forOwn(object, function(value, key, object) { - if (callback(value, key, object)) { - result = key; - return false; - } - }); - return result; - } - - /** - * 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); - - /** - * 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' } - */ - 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 ? (typeof value == 'object' && toString.call(value) == dateClass) : false; - } - - /** - * 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 || - (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 `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- {Array} [stackA=[]] Tracks traversed `a` objects. - * @param- {Array} [stackB=[]] Tracks traversed `b` objects. - * @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, stackA, stackB) { - // used to indicate that when comparing objects, `a` has at least the properties of `b` - var whereIndicator = callback === indicatorObject; - if (typeof callback == 'function' && !whereIndicator) { - callback = lodash.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 == String(b); - } - var isArr = className == arrayClass; - if (!isArr) { - // unwrap any `lodash` wrapped values - if (hasOwnProperty.call(a, '__wrapped__ ') || hasOwnProperty.call(b, '__wrapped__')) { - return isEqual(a.__wrapped__ || a, b.__wrapped__ || b, callback, thisArg, 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.com/#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 && !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); - } - }); - } - if (initedStack) { - releaseArray(stackA); - releaseArray(stackB); - } - 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 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 {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]); - } - - /** - * 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 && 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 {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 && objectTypes[typeof value]) && 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 property 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] Indicates that `stackA` and `stackB` are - * arrays of traversed objects, instead of source objects. - * @param- {Array} [stackA=[]] Tracks traversed source objects. - * @param- {Array} [stackB=[]] Associates values with 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 { - var initedStack = true; - stackA = getArray(); - stackB = getArray(); - - // 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 = lodash.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) { - 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) { - 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; - }); - } - - if (initedStack) { - 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` 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 indexOf = getIndexOf(), - isFunc = typeof callback == 'function', - result = {}; - - if (isFunc) { - callback = lodash.createCallback(callback, thisArg); - } else { - var props = concat.apply(arrayRef, nativeSlice.call(arguments, 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 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 = -1, - props = concat.apply(arrayRef, nativeSlice.call(arguments, 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); - forIn(object, function(value, key, object) { - if (callback(value, key, object)) { - result[key] = value; - } - }); - } - return result; - } - - /** - * An alternative to `_.reduce`, this method transforms an `object` to a new - * `accumulator` object which is the result of running each of its elements - * through the `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 {Mixed} [accumulator] The custom accumulator value. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} 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 = lodash.createCallback(callback, thisArg, 4); - - if (accumulator == null) { - if (isArr) { - accumulator = []; - } else { - var ctor = object && object.constructor, - proto = ctor && ctor.prototype; - - accumulator = createObject(proto); - } - } - (isArr ? basicEach : 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 a new array of property values. - * @example - * - * _.values({ 'one': 1, 'two': 2, 'three': 3 }); - * // => [1, 2, 3] (order is not guaranteed) - */ - 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, nativeSlice.call(arguments, 1)), - length = 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 `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, - indexOf = getIndexOf(), - length = collection ? collection.length : 0, - result = false; - - fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; - if (length && typeof length == 'number') { - result = (isString(collection) - ? collection.indexOf(target, fromIndex) - : indexOf(collection, target, fromIndex) - ) > -1; - } else { - basicEach(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 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 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 = lodash.createCallback(callback, thisArg); - - forEach(collection, function(value, key, collection) { - key = String(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 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 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 = lodash.createCallback(callback, thisArg); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if (!(result = !!callback(collection[index], index, collection))) { - break; - } - } - } else { - basicEach(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 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 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 = lodash.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 { - basicEach(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 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 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 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); - - 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; - basicEach(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 { - basicEach(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 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 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 = lodash.createCallback(callback, thisArg); - - forEach(collection, function(value, key, collection) { - key = String(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 = 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 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 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 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 = lodash.createCallback(callback, thisArg); - if (isArray(collection)) { - while (++index < length) { - result[index] = callback(collection[index], index, collection); - } - } else { - basicEach(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 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 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 - : lodash.createCallback(callback, thisArg); - - basicEach(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 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 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 - : lodash.createCallback(callback, thisArg); - - basicEach(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 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 = 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 { - basicEach(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 (support.unindexedChars && isString(collection)) { - iterable = collection.split(''); - } - callback = lodash.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 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 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 = lodash.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 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 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 = lodash.createCallback(callback, thisArg); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if ((result = callback(collection[index], index, collection))) { - break; - } - } - } else { - basicEach(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 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 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 = lodash.createCallback(callback, thisArg); - 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); - } - - /** - * 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, - indexOf = getIndexOf(), - length = array ? array.length : 0, - seen = concat.apply(arrayRef, nativeSlice.call(arguments, 1)), - result = []; - - var isLarge = length >= largeArraySize && indexOf === basicIndexOf; - - 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 similar to `_.find`, except that it returns the index of - * the 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 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 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); - while (++index < length) { - if (callback(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * 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, - * elements at the beginning of the array are returned as long as the `callback` - * returns truthy. 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 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|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 = lodash.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 `isShallow` - * is truthy, `array` will only be flattened a single level. If `callback` - * is passed, each element of `array` is passed through a `callback` before - * flattening. 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 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 indicate only flattening a single level. - * @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 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!'] - */ - var flatten = overloadWrapper(function flatten(array, isShallow, callback) { - var index = -1, - length = array ? array.length : 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (callback) { - value = callback(value, index, array); - } - // recursively flatten arrays (susceptible to call stack limits) - if (isArray(value)) { - push.apply(result, isShallow ? 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) { - 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 array ? basicIndexOf(array, value, fromIndex) : -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, elements at the end of the array are excluded from the result - * as long as the `callback` returns truthy. 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 properties 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 = lodash.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, - 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 === basicIndexOf && - (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 of the `array`. If a number `n` is passed, the - * last `n` elements of the `array` are returned. If a `callback` function - * is passed, elements at the end of the array are returned as long as the - * `callback` returns truthy. 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 properties 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 = lodash.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 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 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(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, elements at the beginning - * of the array are excluded from the result as long as the `callback` returns - * truthy. 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 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|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 = lodash.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 properties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to inspect. - * @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 ? 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; - } - - /** - * 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(array) { - if (!isArray(array)) { - arguments[0] = array ? nativeSlice.call(array) : arrayRef; - } - 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 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 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 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 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(['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 }] - */ - var uniq = overloadWrapper(function(array, isSorted, callback) { - var index = -1, - indexOf = getIndexOf(), - length = array ? array.length : 0, - result = []; - - var isLarge = !isSorted && length >= largeArraySize && indexOf === basicIndexOf, - 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; - }); - - /** - * The inverse of `_.zip`, this method splits groups of elements into arrays - * composed of elements from each group at their corresponding indexes. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to process. - * @returns {Array} Returns a new array of the composed arrays. - * @example - * - * _.unzip([['moe', 30, true], ['larry', 40, false]]); - * // => [['moe', 'larry'], [30, 40], [true, false]]; - */ - function unzip(array) { - var 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 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) { - return difference(array, nativeSlice.call(arguments, 1)); - } - - /** - * 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) { - return array ? unzip(arguments) : []; - } - - /** - * 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 _ - * @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 { - result[key[0]] = key[1]; - } - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * If `n` is greater than `0`, a function is created that is restricted to - * executing `func`, with the `this` binding and arguments of the created - * function, only after it is called `n` times. If `n` is less than `1`, - * `func` is executed immediately, without a `this` binding or additional - * arguments, and its result is returned. - * - * @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 support.fastBind || (nativeBind && arguments.length > 2) - ? nativeBind.call.apply(nativeBind, arguments) - : createBound(func, thisArg, nativeSlice.call(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 = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object), - index = -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, nativeSlice.call(arguments, 2), indicatorObject); - } - - /** - * 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]; - }; - } - - /** - * 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`. - * - * Note: All Lo-Dash methods, that accept a `callback` argument, use `_.createCallback`. - * - * @static - * @memberOf _ - * @category Functions - * @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. - * @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 }] - * - * // create mixins with support for "_.pluck" and "_.where" callback shorthands - * _.mixin({ - * 'toLookup': function(collection, callback, thisArg) { - * callback = _.createCallback(callback, thisArg); - * return _.reduce(collection, function(result, value, index, collection) { - * return (result[callback(value, index, collection)] = value, result); - * }, {}); - * } - * }); - * - * _.toLookup(stooges, 'name'); - * // => { 'moe': { 'name': 'moe', 'age': 40 }, 'larry': { 'name': 'larry', 'age': 50 } } - */ - 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' || (reThis && !reThis.test(fnToString.call(func)))) { - return func; - } - 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, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - } - return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - } - - /** - * Creates a function that will delay the execution of `func` until after - * `wait` milliseconds have elapsed since the last time it was invoked. Pass - * 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. - * [leading=false] A boolean to specify execution on the leading edge of the timeout. - * [maxWait] The maximum time `func` is allowed to be delayed before it's called. - * [trailing=true] A boolean to specify execution on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * var lazyLayout = _.debounce(calculateLayout, 300); - * jQuery(window).on('resize', lazyLayout); - * - * jQuery('#postbox').on('click', _.debounce(sendMail, 200, { - * 'leading': true, - * 'trailing': false - * }); - */ - function debounce(func, wait, options) { - var args, - result, - thisArg, - callCount = 0, - lastCalled = 0, - maxWait = false, - maxTimeoutId = null, - timeoutId = null, - trailing = true; - - function clear() { - clearTimeout(maxTimeoutId); - clearTimeout(timeoutId); - callCount = 0; - maxTimeoutId = timeoutId = null; - } - - function delayed() { - var isCalled = trailing && (!leading || callCount > 1); - clear(); - if (isCalled) { - if (maxWait !== false) { - lastCalled = new Date; - } - result = func.apply(thisArg, args); - } - } - - function maxDelayed() { - clear(); - if (trailing || (maxWait !== wait)) { - lastCalled = new Date; - result = func.apply(thisArg, args); - } - } - - 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; - } - return function() { - args = arguments; - thisArg = this; - callCount++; - - // avoid issues with Titanium and `undefined` timeout ids - // https://github.com/appcelerator/titanium_mobile/blob/3_1_0_GA/android/titanium/src/java/ti/modules/titanium/TitaniumModule.java#L185-L192 - clearTimeout(timeoutId); - - if (maxWait === false) { - if (leading && callCount < 2) { - result = func.apply(thisArg, args); - } - } else { - var now = new Date; - if (!maxTimeoutId && !leading) { - lastCalled = now; - } - var remaining = maxWait - (now - lastCalled); - if (remaining <= 0) { - clearTimeout(maxTimeoutId); - maxTimeoutId = null; - lastCalled = now; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - return result; - }; - } - - /** - * 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 timer id. - * @example - * - * _.defer(function() { alert('deferred'); }); - * // returns from the function before `alert` is called - */ - function defer(func) { - var args = nativeSlice.call(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, context); - } - - /** - * 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 timer 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 = nativeSlice.call(arguments, 2); - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * 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. 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); - * }); - */ - function memoize(func, resolver) { - function memoized() { - var cache = memoized.cache, - key = keyPrefix + (resolver ? resolver.apply(this, arguments) : 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; - - 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, nativeSlice.call(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, nativeSlice.call(arguments, 1), null, indicatorObject); - } - - /** - * Creates a function that, when executed, will only call the `func` function - * at most once per every `wait` milliseconds. Pass 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. - * [leading=true] A boolean to specify execution on the leading edge of the timeout. - * [trailing=true] A boolean to specify execution on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * var throttled = _.throttle(updatePosition, 100); - * jQuery(window).on('scroll', throttled); - * - * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { - * 'trailing': false - * })); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - 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 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(string).replace(reUnescapedHtml, escapeHtmlChar); - } - - /** - * This method 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 value = this.__wrapped__, - args = [value]; - - push.apply(args, arguments); - var result = func.apply(lodash, args); - return (value && typeof value == 'object' && value === result) - ? this - : new lodashWrapper(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.com/#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 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; - } else { - max = +max || 0; - } - var rand = nativeRandom(); - return (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 {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 - * - * 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. - * 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/dist/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.3.1\n\n * Added missing `cache` property to the objects returned by `getObject`\n * Ensured `maxWait` unit tests pass in Ringo\n * Increased the `maxPoolSize` value\n * Optimized `releaseArray` and `releaseObject`\n\n### v1.3.0\n\n * Added `_.transform` method\n * Added `_.chain` and `_.findWhere` aliases\n * Added internal array and object pooling\n * Added Istanbul test coverage reports to Travis CI\n * Added `maxWait` option to `_.debounce`\n * Added support for floating point numbers to `_.random`\n * Added Volo configuration to package.json\n * Adjusted UMD for `component build`\n * Allowed more stable mixing of `lodash` and `underscore` build methods\n * Ensured debounced function with, `leading` and `trailing` options, works as expected\n * Ensured minified builds work with the Dojo builder\n * Ensured minification avoids deoptimizing expressions containing boolean values\n * Ensured unknown types return `false` in `_.isObject` and `_.isRegExp`\n * Ensured `_.clone`, `_.flatten`, and `_.uniq` can be used as a `callback` for methods like `_.map`\n * Ensured `_.forIn` works on objects with longer inheritance chains in IE < 9\n * Ensured `_.isPlainObject` returns `true` for empty objects in IE < 9\n * Ensured `_.max` and `_.min` chain correctly\n * Ensured `clearTimeout` use doesn’t cause errors in Titanium\n * Ensured that the `--stdout` build option doesn't write to a file\n * Exposed memoized function’s `cache`\n * Fixed `Error.prototype` iteration bugs\n * Fixed \"scripts\" paths in component.json\n * Made methods support customizing `_.indexOf`\n * Made the build track dependencies of private functions\n * Made the `template` pre-compiler build option avoid escaping non-ascii characters\n * Made `_.createCallback` avoid binding functions if they don’t reference `this`\n * Optimized the Closure Compiler minification process\n * Optimized the large array cache for `_.difference`, `_.intersection`, and `_.uniq`\n * Optimized internal `_.flatten` and `_.indexOf` use\n * Reduced `_.unzip` and `_.zip`\n * Removed special handling of arrays in `_.assign` and `_.defaults`\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.3.1", - "_from": "lodash@~1.3.0" -} diff --git a/node_modules/grunt-bower-install/node_modules/wiredep/package.json b/node_modules/grunt-bower-install/node_modules/wiredep/package.json deleted file mode 100644 index 0576715..0000000 --- a/node_modules/grunt-bower-install/node_modules/wiredep/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "wiredep", - "version": "0.2.0", - "description": "Wire dependencies to your source code.", - "homepage": "https://github.com/stephenplusplus/wiredep", - "bugs": { - "url": "https://github.com/stephenplusplus/wiredep/issues" - }, - "author": { - "name": "Stephen Sawchuk", - "email": "sawchuk@gmail.com" - }, - "keywords": [ - "bower", - "package", - "management", - "inject", - "script", - "dependencies" - ], - "main": "bin/wiredep", - "files": [ - "bin/", - "lib/" - ], - "repository": { - "type": "git", - "url": "https://github.com/stephenplusplus/wiredep" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "devDependencies": { - "grunt-contrib-jshint": "~0.6.0", - "grunt-contrib-nodeunit": "~0.2.0", - "grunt-contrib-watch": "~0.5.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-clean": "~0.5.0" - }, - "dependencies": { - "lodash": "~1.3.0", - "chalk": "~0.1.1" - }, - "readme": "# wiredep\n\nWire dependencies to your source code.\n\n## Getting Started\nInstall the module with: `npm install wiredep --save`\n\n```js\nvar wiredep = require('wiredep')({\n directory: 'the directory of your Bower packages.',\n bowerJson: 'your bower.json file contents.',\n ignorePath: 'optional path to ignore from the injected filepath.',\n htmlFile: 'the path to the HTML file to take control of.'\n});\n```\n\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\n## License\nCopyright (c) 2013 Stephen Sawchuk. Licensed under the MIT license.\n", - "readmeFilename": "README.md", - "_id": "wiredep@0.2.0", - "dist": { - "shasum": "3758d56eb54278fbb7a133d9cb53eed502fc3c2b" - }, - "_from": "wiredep@~0.2.0", - "_resolved": "https://registry.npmjs.org/wiredep/-/wiredep-0.2.0.tgz" -} diff --git a/node_modules/grunt-bower-install/package.json b/node_modules/grunt-bower-install/package.json deleted file mode 100644 index 656aac7..0000000 --- a/node_modules/grunt-bower-install/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "grunt-bower-install", - "description": "Inject your Bower dependencies right into your HTML from Grunt.", - "version": "0.5.2", - "homepage": "http://stephenplusplus.github.io/grunt-bower-install", - "author": { - "name": "Stephen Sawchuk", - "email": "sawchuk@gmail.com", - "url": "http://github.com/stephenplusplus" - }, - "keywords": [ - "gruntplugin", - "html", - "grunt", - "bower", - "package manager", - "dependency management", - "javascript dependencies", - "component", - "postinstall" - ], - "repository": { - "type": "git", - "url": "git://github.com/stephenplusplus/grunt-bower-install.git" - }, - "bugs": { - "url": "https://github.com/stephenplusplus/grunt-bower-install/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/stephenplusplus/grunt-bower-install/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">=0.8.0", - "npm": ">=1.2.10" - }, - "scripts": { - "test": "grunt nodeunit" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-watch": "~0.2.0" - }, - "dependencies": { - "wiredep": "~0.2.0" - }, - "readme": "# grunt-bower-install\n\n> Inject your Bower dependencies right into your HTML from Grunt.\n\n## What is this?\n[Grunt](http://gruntjs.com) is great.\n\n[Bower](http://bower.io) is great.\n\n**And now they work great together.**\n\n`grunt-bower-install` is a Grunt plug-in, which finds your components and injects them directly into the HTML file you specify.\n\nWhether you're already using Bower and Grunt, or new to both, `grunt-bower-install` will be easy to plug in, as you will see in the steps below.\n\n_**do note**: Bower is still a young little birdy, so things are changing rapidly. Authors of Bower components must follow certain conventions and best practices in order for this plug-in to be as accurate as possible. It's not a perfect world out there, so needless to say, some Bower components may not work as well as others._\n\n## Getting Started\n\n*If you are new to Grunt, you will find a lot of answers to your questions in their [getting started guide](http://gruntjs.com/getting-started).\n\nTo install the module:\n```\nnpm install grunt-bower-install --save-dev\n```\n\nInclude the task in your Gruntfile:\n```js\ngrunt.loadNpmTasks('grunt-bower-install');\n```\n\nCreate a config block within your Gruntfile:\n```js\n'bower-install': {\n\n target: {\n\n // Point to the html file that should be updated\n // when you run `grunt bower-install`\n html: 'app/index.html',\n\n // Optional:\n // If your scripts shouldn't contain a certain\n // portion of a url, it can be excluded\n ignorePath: 'app/'\n }\n}\n```\n\nFor JavaScript dependencies, pop this in your HTML file:\n```html\n\n\n```\n\nInstall a Bower component:\n```\nbower install jquery --save\n```\n\nCall the Grunt task:\n```\ngrunt bower-install\n```\n\nYou're in business!\n```html\n\n\n\n```\n\n## Behind the Scenes\nThis plug-in uses [wiredep](https://github.com/stephenplusplus/wiredep), which takes a look at all of the components you have, then determines the best order to inject your scripts in to your HTML file.\n\nPutting script tags that aren't managed by `grunt-bower-install` is not advised, as anything between `` and `` will be overwritten with each command.\n\n## Examples\nA simple sample apple:\n[website](http://stephenplusplus.github.io/grunt-bower-install) | [github](https://github.com/stephenplusplus/grunt-bower-install/tree/gh-pages)\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## License\nCopyright (c) 2013 Stephen Sawchuk\nLicensed under the MIT license.\n", - "readmeFilename": "readme.md", - "_id": "grunt-bower-install@0.5.2", - "dist": { - "shasum": "77c05e486fe63eb89bb00834c4ceba7f2e66810b" - }, - "_from": "grunt-bower-install@~0.5.0", - "_resolved": "https://registry.npmjs.org/grunt-bower-install/-/grunt-bower-install-0.5.2.tgz" -} diff --git a/node_modules/grunt-bower-install/readme.md b/node_modules/grunt-bower-install/readme.md deleted file mode 100644 index 080a6b9..0000000 --- a/node_modules/grunt-bower-install/readme.md +++ /dev/null @@ -1,87 +0,0 @@ -# grunt-bower-install - -> Inject your Bower dependencies right into your HTML from Grunt. - -## What is this? -[Grunt](http://gruntjs.com) is great. - -[Bower](http://bower.io) is great. - -**And now they work great together.** - -`grunt-bower-install` is a Grunt plug-in, which finds your components and injects them directly into the HTML file you specify. - -Whether you're already using Bower and Grunt, or new to both, `grunt-bower-install` will be easy to plug in, as you will see in the steps below. - -_**do note**: Bower is still a young little birdy, so things are changing rapidly. Authors of Bower components must follow certain conventions and best practices in order for this plug-in to be as accurate as possible. It's not a perfect world out there, so needless to say, some Bower components may not work as well as others._ - -## Getting Started - -*If you are new to Grunt, you will find a lot of answers to your questions in their [getting started guide](http://gruntjs.com/getting-started). - -To install the module: -``` -npm install grunt-bower-install --save-dev -``` - -Include the task in your Gruntfile: -```js -grunt.loadNpmTasks('grunt-bower-install'); -``` - -Create a config block within your Gruntfile: -```js -'bower-install': { - - target: { - - // Point to the html file that should be updated - // when you run `grunt bower-install` - html: 'app/index.html', - - // Optional: - // If your scripts shouldn't contain a certain - // portion of a url, it can be excluded - ignorePath: 'app/' - } -} -``` - -For JavaScript dependencies, pop this in your HTML file: -```html - - -``` - -Install a Bower component: -``` -bower install jquery --save -``` - -Call the Grunt task: -``` -grunt bower-install -``` - -You're in business! -```html - - - -``` - -## Behind the Scenes -This plug-in uses [wiredep](https://github.com/stephenplusplus/wiredep), which takes a look at all of the components you have, then determines the best order to inject your scripts in to your HTML file. - -Putting script tags that aren't managed by `grunt-bower-install` is not advised, as anything between `` and `` will be overwritten with each command. - -## Examples -A simple sample apple: -[website](http://stephenplusplus.github.io/grunt-bower-install) | [github](https://github.com/stephenplusplus/grunt-bower-install/tree/gh-pages) - -## 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/). - -## License -Copyright (c) 2013 Stephen Sawchuk -Licensed under the MIT license. diff --git a/node_modules/grunt-bower-install/tasks/bower-install.js b/node_modules/grunt-bower-install/tasks/bower-install.js deleted file mode 100644 index 68e432f..0000000 --- a/node_modules/grunt-bower-install/tasks/bower-install.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * grunt-bower.js - * https://github.com/stephenplusplus/bower-install - * - * Copyright (c) 2013 Stephen Sawchuk - * Licensed under the MIT license. - */ - -var grunt = require('grunt'); -var wiredep = require('wiredep'); - - -/** - * Developers may still be using "component.json". That's fine, we can use that - * just the same. But if they are, we'll let them know it's deprecated. - * - * @return {object} bower's .json configuration object - */ -var findBowerJSON = function () { - - var bowerJSON; - - ['bower.json', 'component.json'].forEach(function (configFile) { - if (!bowerJSON && grunt.file.isFile(configFile)) { - bowerJSON = grunt.file.readJSON(configFile); - } - }); - - return bowerJSON; -}; - - -/** - * Try to use a `.bowerrc` file to find a custom directory. If it doesn't exist, - * we're going with "bower_components". - * - * @ return {string} the path to the bower component directory - */ -var findBowerDirectory = function () { - - var directory; - - if (grunt.file.isFile('.bowerrc')) { - directory = grunt.file.readJSON('.bowerrc').directory; - } - - if (!directory) { - ['bower_components', 'components'].forEach(function (dir) { - if (!directory && grunt.file.isDir(dir)) { - directory = dir; - } - }); - } - - if (!directory || !grunt.file.isDir(directory)) { - console.log( - 'Cannot find where you keep your Bower packages.' - + '\n' - + '\nWe tried looking for a `.bowerrc` file, but couldn\'t find a custom' - + '\n`directory` property defined. We then tried `bower_components`, but' - + '\nit looks like that doesn\'t exist either. As a last resort, we tried' - + '\nthe pre-1.0 `components` directory, but that also couldn\'t be found.' - + '\n' - + '\nUnfortunately, we can\'t proceed without knowing where the Bower' - + '\npackages you have installed are.' - + '\n' - ); - - grunt.fail.fatal('No Bower components found.'); - } - - return directory; -}; - - -module.exports = function (grunt) { - - grunt.registerMultiTask('bower-install', 'Inject all components in your HTML file.', function () { - - this.requiresConfig(['bower-install', this.target, 'html']); - - wiredep({ - directory: findBowerDirectory(), - bowerJson: findBowerJSON(), - ignorePath: this.data.ignorePath, - htmlFile: this.data.html - }); - }); -}; diff --git a/node_modules/grunt-bower-install/test/bower-install_test.js b/node_modules/grunt-bower-install/test/bower-install_test.js deleted file mode 100644 index d15bf92..0000000 --- a/node_modules/grunt-bower-install/test/bower-install_test.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var bower_install = require('../lib/grunt-bower-install'); - -/* - ======== 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) -*/ diff --git a/node_modules/grunt-concurrent/.gitattributes b/node_modules/grunt-concurrent/.gitattributes deleted file mode 100644 index 176a458..0000000 --- a/node_modules/grunt-concurrent/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto diff --git a/node_modules/grunt-concurrent/node_modules/lpad/lpad.js b/node_modules/grunt-concurrent/node_modules/lpad/lpad.js deleted file mode 100644 index 69a610f..0000000 --- a/node_modules/grunt-concurrent/node_modules/lpad/lpad.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; -var eol = require('os').EOL; - -var stdoutWrite = process.stdout.write; -var stderrWrite = process.stderr.write; - -var lpad = module.exports = function (str, pad) { - return pad ? pad + String(str).split(eol).join(eol + pad) : str; -}; - -lpad.stdout = function (pad) { - process.stdout.write = pad ? function (str) { - stdoutWrite.call(process.stdout, lpad(str, pad)); - } : stdoutWrite; -}; - -lpad.stderr = function (pad) { - process.stderr.write = pad ? function (str) { - stderrWrite.call(process.stderr, lpad(str, pad)); - } : stderrWrite; -}; diff --git a/node_modules/grunt-concurrent/node_modules/lpad/package.json b/node_modules/grunt-concurrent/node_modules/lpad/package.json deleted file mode 100644 index 673abd8..0000000 --- a/node_modules/grunt-concurrent/node_modules/lpad/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "lpad", - "version": "0.1.0", - "description": "Left pad each line in a string or stdout/stderr", - "keywords": [ - "pad", - "indent", - "cli", - "format", - "string" - ], - "homepage": "https://github.com/sindresorhus/lpad", - "bugs": { - "url": "https://github.com/sindresorhus/lpad/issues" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "main": "lpad.js", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/lpad.git" - }, - "scripts": { - "test": "mocha test-*.js" - }, - "devDependencies": { - "mocha": "~1.8.2" - }, - "engines": { - "node": ">=0.8.0" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "readme": "# lpad [![Build Status](https://secure.travis-ci.org/sindresorhus/lpad.png?branch=master)](http://travis-ci.org/sindresorhus/lpad)\n\nLeft pad each line in a string or stdout/stderr.\n\nThe stdout/stderr padding is especially useful in CLI tools when you don't directly control the output.\n\n\n![screenshot](screenshot.png)\n\n\n## Getting started\n\nInstall: `npm install lpad`\n\n\n## Documentation\n\n\n### lpad(string, pad)\n\nPads each line in a string with the supplied pad string.\n\n#### Example\n\n```js\nvar lpad = require('lpad');\nvar str = 'foo\\nbar';\n\nconsole.log(str);\n/*\nfoo\nbar\n*/\n\nconsole.log(lpad(str, ' '));\n/*\n foo\n bar\n*/\n```\n\n### lpad.stdout(pad)\n\nPads each line of `process.stdout` with the supplied pad string until the method is called again with no arguments.\n\n#### Example\n\n```js\nvar lpad = require('lpad');\nvar str = 'foo\\nbar';\n\nlpad.stdout(' '); // start padding\n\nconsole.log(str);\n/*\n foo\n bar\n*/\n\nlpad.stdout(); // end padding\n\nconsole.log(str);\n/*\nfoo\nbar\n*/\n```\n\n### lpad.stderr(pad)\n\nPads each line of `process.stderr` with the supplied pad string until the method is called again with no arguments.\n\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License)\n(c) [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "_id": "lpad@0.1.0", - "dist": { - "shasum": "e4c60c29139321c5970de493b496ae0d774cd2a7" - }, - "_from": "lpad@~0.1.0", - "_resolved": "https://registry.npmjs.org/lpad/-/lpad-0.1.0.tgz" -} diff --git a/node_modules/grunt-concurrent/node_modules/lpad/readme.md b/node_modules/grunt-concurrent/node_modules/lpad/readme.md deleted file mode 100644 index fd4a0a7..0000000 --- a/node_modules/grunt-concurrent/node_modules/lpad/readme.md +++ /dev/null @@ -1,77 +0,0 @@ -# lpad [![Build Status](https://secure.travis-ci.org/sindresorhus/lpad.png?branch=master)](http://travis-ci.org/sindresorhus/lpad) - -Left pad each line in a string or stdout/stderr. - -The stdout/stderr padding is especially useful in CLI tools when you don't directly control the output. - - -![screenshot](screenshot.png) - - -## Getting started - -Install: `npm install lpad` - - -## Documentation - - -### lpad(string, pad) - -Pads each line in a string with the supplied pad string. - -#### Example - -```js -var lpad = require('lpad'); -var str = 'foo\nbar'; - -console.log(str); -/* -foo -bar -*/ - -console.log(lpad(str, ' ')); -/* - foo - bar -*/ -``` - -### lpad.stdout(pad) - -Pads each line of `process.stdout` with the supplied pad string until the method is called again with no arguments. - -#### Example - -```js -var lpad = require('lpad'); -var str = 'foo\nbar'; - -lpad.stdout(' '); // start padding - -console.log(str); -/* - foo - bar -*/ - -lpad.stdout(); // end padding - -console.log(str); -/* -foo -bar -*/ -``` - -### lpad.stderr(pad) - -Pads each line of `process.stderr` with the supplied pad string until the method is called again with no arguments. - - -## License - -[MIT License](http://en.wikipedia.org/wiki/MIT_License) -(c) [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/grunt-concurrent/package.json b/node_modules/grunt-concurrent/package.json deleted file mode 100644 index 7606bb5..0000000 --- a/node_modules/grunt-concurrent/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "grunt-concurrent", - "version": "0.3.1", - "description": "Run grunt tasks concurrently", - "keywords": [ - "gruntplugin", - "concurrent", - "parallel", - "simultaneous", - "optimize", - "speed" - ], - "homepage": "https://github.com/sindresorhus/grunt-concurrent", - "bugs": { - "url": "https://github.com/sindresorhus/grunt-concurrent/issues" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/grunt-concurrent.git" - }, - "scripts": { - "test": "npm install nodemon -g && grunt" - }, - "dependencies": { - "lpad": "~0.1.0" - }, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-clean": "~0.4.0", - "grunt-simple-mocha": "~0.4.0", - "grunt-contrib-watch": "~0.4.0", - "grunt-nodemon": "0.0.2" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "licenses": { - "type": "MIT" - }, - "readme": "# grunt-concurrent [![Build Status](https://secure.travis-ci.org/sindresorhus/grunt-concurrent.png?branch=master)](http://travis-ci.org/sindresorhus/grunt-concurrent)\n\n> Run grunt tasks concurrently\n\nRunning slow tasks like Coffee and Sass concurrently can potentially improve your build time significantly. This task is also useful if you need to run multiple blocking tasks like `nodemon` and `watch` at once, as seen in the example config.\n\n![screenshot](screenshot.png)\n\n*Requires grunt 0.4*\n\nThis task is similar to [grunt-parallel](https://github.com/iammerrick/grunt-parallel), but more focused by leaving out support for shell scripts which results in a leaner config. It also has a smaller dependency size and pads the output of concurrent tasks, as seen above.\n\n\n## Getting Started\n\nIf you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:\n\n```sh\nnpm install grunt-concurrent --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-concurrent');\n```\n\n[grunt]: http://gruntjs.com\n[Getting Started]: https://github.com/gruntjs/grunt/wiki/Getting-started\n\n\n## Documentation\n\nSee the [Gruntfile](Gruntfile.js) in this repo for a full example.\n\nJust specify the tasks you want to run concurrently as an array in a target of this task as shown below.\n\n\n### Example config\n\nThis will first run the Coffee and Sass tasks at the same time, then the JSHint and Mocha tasks at the same time.\n\n```javascript\ngrunt.initConfig({\n\tconcurrent: {\n\t\ttarget1: ['coffee', 'sass'],\n\t\ttarget2: ['jshint', 'mocha']\n\t}\n});\n\ngrunt.loadNpmTasks('grunt-concurrent');\ngrunt.registerTask('default', ['concurrent:target1', 'concurrent:target2']);\n```\n\n### Logging concurrent output\n\nYou can optionally log the output of your concurrent tasks by specifying the `logConcurrentOutput` option. Here is an example config which runs [grunt-nodemon](https://github.com/ChrisWren/grunt-nodemon) to launch and monitor a node server and [grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch) to watch for asset changes all in one terminal tab:\n\n```javascript\ngrunt.initConfig({\n\tconcurrent: {\n\t\ttarget: {\n\t\t\ttasks: ['nodemon', 'watch'],\n\t\t\toptions: {\n\t\t\t\tlogConcurrentOutput: true\n\t\t\t}\n\t\t}\n\t}\n});\n\ngrunt.loadNpmTasks('grunt-concurrent');\ngrunt.registerTask('default', ['concurrent:target']);\n```\n\n*Note the output will be messy when combining certain tasks. This option is best used with tasks that don't exit like watch and nodemon to monitor the output of long-running concurrent tasks.*\n\n\n## Contribute\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style.\n\n\n## License\n\nMIT License\n(c) [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "_id": "grunt-concurrent@0.3.1", - "dist": { - "shasum": "0ceed6add526cc63f87fa40e90287988d9e17a8e" - }, - "_from": "grunt-concurrent@~0.3.0", - "_resolved": "https://registry.npmjs.org/grunt-concurrent/-/grunt-concurrent-0.3.1.tgz" -} diff --git a/node_modules/grunt-concurrent/readme.md b/node_modules/grunt-concurrent/readme.md deleted file mode 100644 index 6b9f64c..0000000 --- a/node_modules/grunt-concurrent/readme.md +++ /dev/null @@ -1,86 +0,0 @@ -# grunt-concurrent [![Build Status](https://secure.travis-ci.org/sindresorhus/grunt-concurrent.png?branch=master)](http://travis-ci.org/sindresorhus/grunt-concurrent) - -> Run grunt tasks concurrently - -Running slow tasks like Coffee and Sass concurrently can potentially improve your build time significantly. This task is also useful if you need to run multiple blocking tasks like `nodemon` and `watch` at once, as seen in the example config. - -![screenshot](screenshot.png) - -*Requires grunt 0.4* - -This task is similar to [grunt-parallel](https://github.com/iammerrick/grunt-parallel), but more focused by leaving out support for shell scripts which results in a leaner config. It also has a smaller dependency size and pads the output of concurrent tasks, as seen above. - - -## Getting Started - -If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command: - -```sh -npm install grunt-concurrent --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-concurrent'); -``` - -[grunt]: http://gruntjs.com -[Getting Started]: https://github.com/gruntjs/grunt/wiki/Getting-started - - -## Documentation - -See the [Gruntfile](Gruntfile.js) in this repo for a full example. - -Just specify the tasks you want to run concurrently as an array in a target of this task as shown below. - - -### Example config - -This will first run the Coffee and Sass tasks at the same time, then the JSHint and Mocha tasks at the same time. - -```javascript -grunt.initConfig({ - concurrent: { - target1: ['coffee', 'sass'], - target2: ['jshint', 'mocha'] - } -}); - -grunt.loadNpmTasks('grunt-concurrent'); -grunt.registerTask('default', ['concurrent:target1', 'concurrent:target2']); -``` - -### Logging concurrent output - -You can optionally log the output of your concurrent tasks by specifying the `logConcurrentOutput` option. Here is an example config which runs [grunt-nodemon](https://github.com/ChrisWren/grunt-nodemon) to launch and monitor a node server and [grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch) to watch for asset changes all in one terminal tab: - -```javascript -grunt.initConfig({ - concurrent: { - target: { - tasks: ['nodemon', 'watch'], - options: { - logConcurrentOutput: true - } - } - } -}); - -grunt.loadNpmTasks('grunt-concurrent'); -grunt.registerTask('default', ['concurrent:target']); -``` - -*Note the output will be messy when combining certain tasks. This option is best used with tasks that don't exit like watch and nodemon to monitor the output of long-running concurrent tasks.* - - -## Contribute - -In lieu of a formal styleguide, take care to maintain the existing coding style. - - -## License - -MIT License -(c) [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/grunt-concurrent/tasks/concurrent.js b/node_modules/grunt-concurrent/tasks/concurrent.js deleted file mode 100644 index 2a8671f..0000000 --- a/node_modules/grunt-concurrent/tasks/concurrent.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; -var lpad = require('lpad'); -var cpCache = []; - -module.exports = function (grunt) { - grunt.registerMultiTask('concurrent', 'Run grunt tasks concurrently', function () { - var spawnOptions; - var cb = this.async(); - var options = this.options(); - // Set the tasks based on the config format - var tasks = this.data.tasks || this.data; - - // Optionally log the task output - if (options.logConcurrentOutput) { - spawnOptions = { stdio: 'inherit' }; - } - - lpad.stdout(' '); - grunt.util.async.forEach(tasks, function (task, next) { - var cp = grunt.util.spawn({ - grunt: true, - args: [task].concat(grunt.option.flags()), - opts: spawnOptions - }, function (err, result, code) { - if (err || code > 0) { - grunt.warn(result.stderr || result.stdout); - } - grunt.log.writeln('\n' + result.stdout); - next(); - }); - - cpCache.push(cp); - }, function () { - lpad.stdout(); - cb(); - }); - }); -}; - -// make sure all child processes are killed when grunt exits -process.on('exit', function () { - cpCache.forEach(function (el) { - el.kill(); - }); -}); diff --git a/node_modules/grunt-contrib-clean/.jshintrc b/node_modules/grunt-contrib-clean/.jshintrc deleted file mode 100644 index 6b4c1a9..0000000 --- a/node_modules/grunt-contrib-clean/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "boss": true, - "eqnull": true, - "node": true, - "es5": true -} diff --git a/node_modules/grunt-contrib-clean/.npmignore b/node_modules/grunt-contrib-clean/.npmignore deleted file mode 100644 index 5cb6bfd..0000000 --- a/node_modules/grunt-contrib-clean/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp \ No newline at end of file diff --git a/node_modules/grunt-contrib-clean/.travis.yml b/node_modules/grunt-contrib-clean/.travis.yml deleted file mode 100644 index 5766191..0000000 --- a/node_modules/grunt-contrib-clean/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-clean/AUTHORS b/node_modules/grunt-contrib-clean/AUTHORS deleted file mode 100644 index 393d814..0000000 --- a/node_modules/grunt-contrib-clean/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -Tim Branyen (http://tbranyen.com/) -Tyler Kellen (http://goingslowly.com/) -Chris Talkington (http://christalkington.com/) -Sebastian Golasch (http://www.asciidisco.com/) -Vlad Filippov (http://vf.io) -"Cowboy" Ben Alman (http://benalman.com/) diff --git a/node_modules/grunt-contrib-clean/CHANGELOG b/node_modules/grunt-contrib-clean/CHANGELOG deleted file mode 100644 index 06c1603..0000000 --- a/node_modules/grunt-contrib-clean/CHANGELOG +++ /dev/null @@ -1,37 +0,0 @@ -v0.5.0: - date: 2013-07-15 - changes: - - Use rimraf directly, version 2.2.1 to fix issue on Windows. - - Add no-write option to mimic grunt.file.delete behavior. -v0.4.1: - date: 2013-04-16 - changes: - - Check if file exists to avoid trying to delete a non-existent file. -v0.4.0: - date: 2013-02-15 - changes: - - First official release for Grunt 0.4.0. -v0.4.0rc6: - date: 2013-01-18 - changes: - - Updating grunt/gruntplugin dependencies to rc6. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.4.0rc5: - date: 2013-01-09 - changes: - - Updating to work with grunt v0.4.0rc5. - - Switching to this.filesSrc api. -v0.4.0a: - date: 2012-12-07 - changes: - - Conversion to grunt v0.4 conventions. - - Remove node v0.6 and grunt v0.3 support. - - Add force option to bypass CWD check. -v0.3.0: - date: 2012-09-23 - changes: - - Options no longer accepted from global config key. -v0.2.0: - date: 2012-09-10 - changes: - - Refactored from grunt-contrib into individual repo. diff --git a/node_modules/grunt-contrib-clean/CONTRIBUTING.md b/node_modules/grunt-contrib-clean/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-clean/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-clean/Gruntfile.js b/node_modules/grunt-contrib-clean/Gruntfile.js deleted file mode 100644 index 79adb00..0000000 --- a/node_modules/grunt-contrib-clean/Gruntfile.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * grunt-contrib-clean - * http://gruntjs.com/ - * - * Copyright (c) 2013 Tim Branyen, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'tasks/*.js', - '<%= nodeunit.tests %>' - ], - options: { - jshintrc: '.jshintrc' - }, - }, - - // Configuration to be run (and then tested). - clean: { - short: ['tmp/sample_short'], - long: { - src: ['tmp/sample_long'], - }, - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'], - }, - }); - - // Actually load this plugin's task(s). - grunt.loadTasks('tasks'); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - // Setup a test helper to create some folders to clean. - grunt.registerTask('copy', 'Copy fixtures to a temp location.', function() { - grunt.file.copy('test/fixtures/sample_long/long.txt', 'tmp/sample_long/long.txt'); - grunt.file.copy('test/fixtures/sample_short/short.txt', 'tmp/sample_short/short.txt'); - }); - - // Whenever the 'test' task is run, first create some files to be cleaned, - // then run this plugin's task(s), then test the result. - grunt.registerTask('test', ['copy', 'clean', 'nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['jshint', 'test', 'build-contrib']); -}; diff --git a/node_modules/grunt-contrib-clean/LICENSE-MIT b/node_modules/grunt-contrib-clean/LICENSE-MIT deleted file mode 100644 index 9bf64d1..0000000 --- a/node_modules/grunt-contrib-clean/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Tim Branyen, 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/node_modules/grunt-contrib-clean/README.md b/node_modules/grunt-contrib-clean/README.md deleted file mode 100644 index ad90e0d..0000000 --- a/node_modules/grunt-contrib-clean/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# grunt-contrib-clean [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-clean.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-clean) - -> Clean files and folders. - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-clean --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-clean'); -``` - -*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-clean/tree/grunt-0.3-stable).* - - - -## Clean task -_Run this task with the `grunt clean` command._ - -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. - -*Due to the destructive nature of this task, always be cautious of the paths you clean.* -### Options - -#### force -Type: `Boolean` -Default: false - -This overrides this task from blocking deletion of folders outside current working dir (CWD). Use with caution. - -#### no-write -Type: `Boolean` -Default: false - -Will log messages of what would happen if the task was ran but doesn't actually delete the files. - -### Usage Examples - -There are three formats you can use to run this task. - -#### Short - -```js -clean: ["path/to/dir/one", "path/to/dir/two"] -``` - -#### Medium (specific targets with global options) - -```js -clean: { - build: ["path/to/dir/one", "path/to/dir/two"], - release: ["path/to/another/dir/one", "path/to/another/dir/two"] -}, -``` - -#### Long (specific targets with per target options) - -```js -clean: { - build: { - src: ["path/to/dir/one", "path/to/dir/two"] - } -} -``` - -## Release History - - * 2013-07-15   v0.5.0   Use rimraf directly, version 2.2.1 to fix issue on Windows. Add no-write option to mimic grunt.file.delete behavior. - * 2013-04-16   v0.4.1   Check if file exists to avoid trying to delete a non-existent file. - * 2013-02-15   v0.4.0   First official release for Grunt 0.4.0. - * 2013-01-18   v0.4.0rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. - * 2013-01-09   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Switching to this.filesSrc api. - * 2012-12-07   v0.4.0a   Conversion to grunt v0.4 conventions. Remove node v0.6 and grunt v0.3 support. Add force option to bypass CWD check. - * 2012-09-23   v0.3.0   Options no longer accepted from global config key. - * 2012-09-10   v0.2.0   Refactored from grunt-contrib into individual repo. - ---- - -Task submitted by [Tim Branyen](http://tbranyen.com/) - -*This file was generated on Mon Jul 15 2013 20:45:46.* diff --git a/node_modules/grunt-contrib-clean/docs/clean-examples.md b/node_modules/grunt-contrib-clean/docs/clean-examples.md deleted file mode 100644 index 267aea7..0000000 --- a/node_modules/grunt-contrib-clean/docs/clean-examples.md +++ /dev/null @@ -1,28 +0,0 @@ -# Usage Examples - -There are three formats you can use to run this task. - -## Short - -```js -clean: ["path/to/dir/one", "path/to/dir/two"] -``` - -## Medium (specific targets with global options) - -```js -clean: { - build: ["path/to/dir/one", "path/to/dir/two"], - release: ["path/to/another/dir/one", "path/to/another/dir/two"] -}, -``` - -## Long (specific targets with per target options) - -```js -clean: { - build: { - src: ["path/to/dir/one", "path/to/dir/two"] - } -} -``` \ No newline at end of file diff --git a/node_modules/grunt-contrib-clean/docs/clean-options.md b/node_modules/grunt-contrib-clean/docs/clean-options.md deleted file mode 100644 index a8d412a..0000000 --- a/node_modules/grunt-contrib-clean/docs/clean-options.md +++ /dev/null @@ -1,13 +0,0 @@ -# Options - -## force -Type: `Boolean` -Default: false - -This overrides this task from blocking deletion of folders outside current working dir (CWD). Use with caution. - -## no-write -Type: `Boolean` -Default: false - -Will log messages of what would happen if the task was ran but doesn't actually delete the files. diff --git a/node_modules/grunt-contrib-clean/docs/clean-overview.md b/node_modules/grunt-contrib-clean/docs/clean-overview.md deleted file mode 100644 index 62f8365..0000000 --- a/node_modules/grunt-contrib-clean/docs/clean-overview.md +++ /dev/null @@ -1,3 +0,0 @@ -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. - -*Due to the destructive nature of this task, always be cautious of the paths you clean.* \ No newline at end of file diff --git a/node_modules/grunt-contrib-clean/docs/overview.md b/node_modules/grunt-contrib-clean/docs/overview.md deleted file mode 100644 index d8014b6..0000000 --- a/node_modules/grunt-contrib-clean/docs/overview.md +++ /dev/null @@ -1 +0,0 @@ -*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-clean/tree/grunt-0.3-stable).* diff --git a/node_modules/grunt-contrib-clean/node_modules/.bin/rimraf b/node_modules/grunt-contrib-clean/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a4..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/AUTHORS b/node_modules/grunt-contrib-clean/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-clean/node_modules/rimraf/LICENSE b/node_modules/grunt-contrib-clean/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-clean/node_modules/rimraf/README.md b/node_modules/grunt-contrib-clean/node_modules/rimraf/README.md deleted file mode 100644 index 8fc6779..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/README.md +++ /dev/null @@ -1,26 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## 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. diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/bin.js b/node_modules/grunt-contrib-clean/node_modules/rimraf/bin.js deleted file mode 100755 index 29bfa8a..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/bin.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/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/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a109..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index 5c1147c..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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": "2.0.1", - "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* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2" -} diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/polyfills.js b/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index afc83b3..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,228 +0,0 @@ -var fs = require('fs') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// 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/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - 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') - - 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.end() - }) -}) diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/package.json b/node_modules/grunt-contrib-clean/node_modules/rimraf/package.json deleted file mode 100644 index 0948cd7..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "rimraf", - "version": "2.2.2", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~2" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~2" - }, - "_id": "rimraf@2.2.2", - "_from": "rimraf@~2.2.1" -} diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/rimraf.js b/node_modules/grunt-contrib-clean/node_modules/rimraf/rimraf.js deleted file mode 100644 index 55f8d9a..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,184 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - 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 (er.code === "EBUSY" && 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() - 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")) - 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") - rmkidsSync(p) - } -} - -function rmkidsSync (p) { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/test/run.sh b/node_modules/grunt-contrib-clean/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-clean/node_modules/rimraf/test/setup.sh b/node_modules/grunt-contrib-clean/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-contrib-clean/node_modules/rimraf/test/test-async.js b/node_modules/grunt-contrib-clean/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-contrib-clean/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-contrib-clean/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-contrib-clean/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-contrib-clean/package.json b/node_modules/grunt-contrib-clean/package.json deleted file mode 100644 index 15c6445..0000000 --- a/node_modules/grunt-contrib-clean/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "grunt-contrib-clean", - "description": "Clean files and folders.", - "version": "0.5.0", - "homepage": "https://github.com/gruntjs/grunt-contrib-clean", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-clean.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-clean/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-clean/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "dependencies": { - "rimraf": "~2.2.1" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.2.0", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-internal": "~0.4.4", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin" - ], - "contributors": [ - { - "name": "Tim Branyen", - "url": "http://tbranyen.com/" - }, - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com/" - }, - { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - { - "name": "Sebastian Golasch", - "url": "http://www.asciidisco.com/" - }, - { - "name": "Vlad Filippov", - "url": "http://vf.io" - }, - { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - } - ], - "readme": "# grunt-contrib-clean [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-clean.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-clean)\n\n> Clean files and folders.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-clean --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-contrib-clean');\n```\n\n*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-clean/tree/grunt-0.3-stable).*\n\n\n\n## Clean task\n_Run this task with the `grunt clean` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n\n*Due to the destructive nature of this task, always be cautious of the paths you clean.*\n### Options\n\n#### force\nType: `Boolean` \nDefault: false\n\nThis overrides this task from blocking deletion of folders outside current working dir (CWD). Use with caution.\n\n#### no-write\nType: `Boolean` \nDefault: false\n\nWill log messages of what would happen if the task was ran but doesn't actually delete the files.\n\n### Usage Examples\n\nThere are three formats you can use to run this task.\n\n#### Short\n\n```js\nclean: [\"path/to/dir/one\", \"path/to/dir/two\"]\n```\n\n#### Medium (specific targets with global options)\n\n```js\nclean: {\n build: [\"path/to/dir/one\", \"path/to/dir/two\"],\n release: [\"path/to/another/dir/one\", \"path/to/another/dir/two\"]\n},\n```\n\n#### Long (specific targets with per target options)\n\n```js\nclean: {\n build: {\n src: [\"path/to/dir/one\", \"path/to/dir/two\"]\n }\n}\n```\n\n## Release History\n\n * 2013-07-15   v0.5.0   Use rimraf directly, version 2.2.1 to fix issue on Windows. Add no-write option to mimic grunt.file.delete behavior.\n * 2013-04-16   v0.4.1   Check if file exists to avoid trying to delete a non-existent file.\n * 2013-02-15   v0.4.0   First official release for Grunt 0.4.0.\n * 2013-01-18   v0.4.0rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-09   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Switching to this.filesSrc api.\n * 2012-12-07   v0.4.0a   Conversion to grunt v0.4 conventions. Remove node v0.6 and grunt v0.3 support. Add force option to bypass CWD check.\n * 2012-09-23   v0.3.0   Options no longer accepted from global config key.\n * 2012-09-10   v0.2.0   Refactored from grunt-contrib into individual repo.\n\n---\n\nTask submitted by [Tim Branyen](http://tbranyen.com/)\n\n*This file was generated on Mon Jul 15 2013 20:45:46.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-clean@0.5.0", - "_from": "grunt-contrib-clean@~0.5.0" -} diff --git a/node_modules/grunt-contrib-clean/tasks/clean.js b/node_modules/grunt-contrib-clean/tasks/clean.js deleted file mode 100644 index 0f225c5..0000000 --- a/node_modules/grunt-contrib-clean/tasks/clean.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * grunt-contrib-clean - * http://gruntjs.com/ - * - * Copyright (c) 2013 Tim Branyen, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -var rimraf = require('rimraf'); - -module.exports = function(grunt) { - - function clean(filepath, options) { - if (!grunt.file.exists(filepath)) { - return false; - } - - grunt.log.write((options['no-write'] ? 'Not actually cleaning ' : 'Cleaning ') + filepath + '...'); - - // Only delete cwd or outside cwd if --force enabled. Be careful, people! - if (!options.force) { - if (grunt.file.isPathCwd(filepath)) { - grunt.verbose.error(); - grunt.fail.warn('Cannot delete the current working directory.'); - return false; - } else if (!grunt.file.isPathInCwd(filepath)) { - grunt.verbose.error(); - grunt.fail.warn('Cannot delete files outside the current working directory.'); - return false; - } - } - - try { - // Actually delete. Or not. - if (!options['no-write']) { - rimraf.sync(filepath); - } - grunt.log.ok(); - } catch (e) { - grunt.log.error(); - grunt.fail.warn('Unable to delete "' + filepath + '" file (' + e.message + ').', e); - } - } - - grunt.registerMultiTask('clean', 'Clean files and folders.', function() { - // Merge task-specific and/or target-specific options with these defaults. - var options = this.options({ - force: grunt.option('force') === true, - 'no-write': grunt.option('no-write') === true, - }); - - grunt.verbose.writeflags(options, 'Options'); - - // Clean specified files / dirs. - this.filesSrc.forEach(function(filepath) { - clean(filepath, options); - }); - }); - -}; diff --git a/node_modules/grunt-contrib-clean/test/clean_test.js b/node_modules/grunt-contrib-clean/test/clean_test.js deleted file mode 100644 index 4db2ef8..0000000 --- a/node_modules/grunt-contrib-clean/test/clean_test.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var grunt = require('grunt'); - -exports.clean = { - short: function(test) { - test.expect(1); - - var expected = grunt.file.exists('tmp/sample_short'); - test.equal(expected, false, 'should remove the short directory using clean'); - - test.done(); - }, - long: function(test) { - test.expect(1); - - var expected = grunt.file.exists('tmp/sample_long'); - test.equal(expected, false, 'should remove the long directory using clean'); - - test.done(); - } -}; diff --git a/node_modules/grunt-contrib-clean/test/fixtures/sample_long/long.txt b/node_modules/grunt-contrib-clean/test/fixtures/sample_long/long.txt deleted file mode 100644 index 83f9fcf..0000000 --- a/node_modules/grunt-contrib-clean/test/fixtures/sample_long/long.txt +++ /dev/null @@ -1 +0,0 @@ -txt diff --git a/node_modules/grunt-contrib-clean/test/fixtures/sample_short/short.txt b/node_modules/grunt-contrib-clean/test/fixtures/sample_short/short.txt deleted file mode 100644 index 83f9fcf..0000000 --- a/node_modules/grunt-contrib-clean/test/fixtures/sample_short/short.txt +++ /dev/null @@ -1 +0,0 @@ -txt diff --git a/node_modules/grunt-contrib-compass/README.md b/node_modules/grunt-contrib-compass/README.md deleted file mode 100644 index 038474a..0000000 --- a/node_modules/grunt-contrib-compass/README.md +++ /dev/null @@ -1,420 +0,0 @@ -# grunt-contrib-compass [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-compass.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-compass) - -> Compile Sass to CSS using Compass - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-compass --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-compass'); -``` - - - - -## Compass task -_Run this task with the `grunt compass` command._ - -[Compass](http://compass-style.org/) is an open-source authoring framework for the [Sass](http://sass-lang.com/) css preprocessor. It helps you build stylesheets faster with a huge library of Sass mixins and functions, advanced tools for spriting, and workflow improvements including file based Sass configuration and a simple pattern for building and using Compass extensions. - -This task requires you to have [Ruby](http://www.ruby-lang.org/en/downloads/), [Sass](http://sass-lang.com/tutorial.html), and [Compass](http://compass-style.org/install/) >=0.12.2 installed. If you're on OS X or Linux you probably already have Ruby installed; test with `ruby -v` in your terminal. When you've confirmed you have Ruby installed, run `gem update --system && gem install compass` to install Compass and Sass. - -Compass operates on a folder level. Because of this you don't specify any src/dest, but instead define the `sassDir` and `cssDir` options. - -### Options - -Compass doesn't expose all of its [options][config] through the CLI, which this task makes use of. If you need an option not mentioned below you can either specify a path to a config.rb file in the `config` option or embed it directly into the `raw` option. Options defined in your Gruntfile will override those specified in your config.rb or `raw` property. `config` and `raw` are mutually exclusive. - -#### config - -Type: `String` -Default: same path as your Gruntfile - -Specify the location of the Compass [configuration file][config] explicitly. - -#### raw - -Type: `String` - -String form of the Compass [configuration file][config]. - -#### basePath - -Type: `String` - -The the path Compass will run from. Defaults to the same path as your Gruntfile. - -###### banner - -Type: `String` - -Prepend the specified string to the output file. Useful for licensing -information. **Note:** This only works in combination with the `specify` option -and can conflict with sourcemap generation. - -#### app - -Type: `String` -Default: `stand_alone` - -Tell compass what kind of application it is integrating with. Can be `stand_alone` or `rails`. - -#### sassDir - -Type: `String` - -The source directory where you keep your Sass stylesheets. - -#### cssDir - -Type: `String` - -The target directory where you keep your CSS stylesheets. - -#### specify - -Type: `String|Array` - -Lets you specify which files you want to compile. Useful if you don't want to compile the whole folder. Globbing supported. Ignores filenames starting with underscore. Files must be in the directory you specified in `sassDir`. - -#### imagesDir - -Type: `String` - -The directory where you keep your images. - -#### javascriptsDir - -Type: `String` - -The directory where you keep your JavaScript files. - -#### fontsDir - -Type: `String` - -The directory where you keep your fonts. - -#### environment - -Type: `String` -Default: `development` - -Use sensible defaults for your current environment. Can be: `development` or `production` - -#### outputStyle - -Type: `String` - -CSS output mode. Can be: `nested`, `expanded`, `compact`, `compressed`. - -#### relativeAssets - -Type: `Boolean` - -Make Compass asset helpers generate relative urls to assets. - -#### noLineComments - -Type: `Boolean` - -Disable line comments. - -#### httpPath - -Type: `String` -Default: `/` - -The path to the project when running within the web server. - -#### cssPath - -Type: `String` - -The directory where the css stylesheets are kept. It is relative to the `projectPath`. Defaults to "stylesheets". - -#### httpStylesheetsPath - -Type: `String` -Default: `httpPath + "/" + cssDir` - -The full http path to stylesheets on the web server. - -#### sassPath - -Type: `String` -Default: `sass` - -The directory where the sass stylesheets are kept. It is relative to the `projectPath`. - -#### imagesPath - -Type: `String` -Default: `images` - -The directory where the images are kept. It is relative to the projectPath. - -#### httpImagesPath - -Type: `String` -Default: `httpPath + "/" + imagesDir` - -The full http path to images on the web server. - -#### generatedImagesDir - -Type: `String` -Default: value of `imagesDir` - -The directory where generated images are kept. It is relative to the `projectPath`. - -#### generatedImagesPath - -Type: `String` -Default: value of `projectPath/generatedImagesDir` - -The full path to where generated images are kept. - -#### httpGeneratedImagesPath - -Type: `String` -Default: `httpPath + "/" + generatedImagesDir` - -The full http path to generated images on the web server. - -#### javascriptsPath - -Type: `String` -Default: `projectPath/javascriptsDir` - -The full path to where javascripts are kept. - -#### httpJavascriptsPath - -Type: `String` -Default: `httpPath + "/" + javascriptsDir` - -The full http path to javascripts on the web server. - -#### fontsPath - -Type: `String` -Default: `projectPath/fontsDir` - -The full path to where font files are kept. - -#### httpFontsPath - -Type: `String` - -The full http path to font files on the web server. - -#### httpFontsDir - -Type: `String` - -The relative http path to font files on the web server. - -#### extensionsPath - -Type: `String` -Default: `project_root/extensions` - -The full http path to the ad-hoc extensions folder on the web server. This is used to access compass plugins that have been installed directly to the project (e.g. through [Bower](https://github.com/bower/bower)) instead of globally as gems. *Only Compass >=0.12.2* - -#### extensionsDir - -Type: `String` - -The relative http path to the ad-hoc extensions folder on the web server. *Only Compass >=0.12.2* - -#### assetCacheBuster - -Type: `Boolean` -Default: `true` - -If set to `false`, this disables the default asset cache buster. - -#### require - -Type: `String|Array` - -Require the given Ruby library before running commands. This is used to access Compass plugins without having a project configuration file. - -#### load - -Type: `String|Array` - -Load the framework or extensions found in the specified directory. - -#### loadAll - -Type: `String|Array` - -Load all the frameworks or extensions found in the specified directory. - -#### importPath - -Type: `String|Array` - -Makes files under the specified folder findable by Sass's @import directive. - -#### debugInfo - -Type: `Boolean` - -Causes the line number and file where a selector is defined to be emitted into the compiled CSS in a format that can be understood by the browser. Automatically disabled when using `outputStyle: 'compressed'`. - -#### quiet - -Type: `Boolean` - -Quiet mode. - -#### trace - -Type: `Boolean` - -Show a full stacktrace on error. - -#### force - -Type: `Boolean` - -Allows Compass to overwrite existing files. - -#### dryRun - -Type: `Boolean` - -Dry Run. Tells you what it plans to do. - -#### boring - -Type: `Boolean` - -Turn off colorized output. - -#### bundleExec - -Type: `Boolean` - -Run `compass compile` with [bundle exec](http://gembundler.com/v1.3/man/bundle-exec.1.html): `bundle exec compass compile`. - -#### clean - -Type: `Boolean` - -Remove generated files and the sass cache. Runs `compass clean` instead of `compass compile`. - - -[config]: http://compass-style.org/help/tutorials/configuration-reference/ - -### Usage Examples - -#### Example config - -```javascript -grunt.initConfig({ - compass: { // Task - dist: { // Target - options: { // Target options - sassDir: 'sass', - cssDir: 'css', - environment: 'production' - } - }, - dev: { // Another target - options: { - sassDir: 'sass', - cssDir: 'css' - } - } - } -}); - -grunt.loadNpmTasks('grunt-contrib-compass'); - -grunt.registerTask('default', ['jshint', 'compass']); -``` - - -#### Example usage - - -##### Use external config file - -```javascript -grunt.initConfig({ - compass: { - dist: { - options: { - config: 'config/config.rb' - } - } - } -}); -``` - -##### Override setting in external config file - -```javascript -grunt.initConfig({ - compass: { - dist: { - options: { - config: 'config/config.rb', // css_dir = 'dev/css' - cssDir: 'dist/css' - } - } - } -}); -``` - -##### Use `raw` option - -```javascript -grunt.initConfig({ - compass: { - dist: { - options: { - sassDir: 'sass', - cssDir: 'css', - raw: 'preferred_syntax = :sass\n' // Use `raw` since it's not directly available - } - } - } -}); -``` - - -## Release History - - * 2013-08-08   v0.5.0   Add `assetCacheBuster` option. - * 2013-07-28   v0.4.1   Fix `banner` option with `.css.scss` files. - * 2013-07-19   v0.4.0   Add `banner` option. Show compilation time. - * 2013-06-24   v0.3.0   Add `extensionDir` and `extensionPath` options. *Requires Compass >=0.12.2*. - * 2013-04-11   v0.2.0   Add `clean` option. Expose `raw` options as Grunt options. Fix detection of `Nothing to compile` situation. - * 2013-02-27   v0.1.3   Fixes bundleExec. - * 2013-02-17   v0.1.2   Ensure Gruntfile.js is included on npm. - * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0. - * 2013-02-05   v0.1.1rc8   Added new options: basePath specify, debugInfo. - * 2013-01-25   v0.1.1rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. - * 2013-01-10   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. - * 2012-10-22   v0.1.0   Initial release - ---- - -Task submitted by [Sindre Sorhus](http://github.com/sindresorhus) - -*This file was generated on Thu Aug 08 2013 20:44:21.* diff --git a/node_modules/grunt-contrib-compass/node_modules/async/LICENSE b/node_modules/grunt-contrib-compass/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-compass/node_modules/async/README.md b/node_modules/grunt-contrib-compass/node_modules/async/README.md deleted file mode 100644 index 9ff1acf..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/async/README.md +++ /dev/null @@ -1,1414 +0,0 @@ -# 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) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [doWhilst](#doWhilst) -* [until](#until) -* [doUntil](#doUntil) -* [forever](#forever) -* [waterfall](#waterfall) -* [compose](#compose) -* [applyEach](#applyEach) -* [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.map(['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/node_modules/grunt-contrib-compass/node_modules/async/component.json b/node_modules/grunt-contrib-compass/node_modules/async/component.json deleted file mode 100644 index bbb0115..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/node_modules/grunt-contrib-compass/node_modules/async/lib/async.js b/node_modules/grunt-contrib-compass/node_modules/async/lib/async.js deleted file mode 100755 index cb6320d..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/async/lib/async.js +++ /dev/null @@ -1,955 +0,0 @@ -/*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 = setImmediate; - } - 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* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\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* [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.map(['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", - "_id": "async@0.2.9", - "_from": "async@~0.2.0" -} diff --git a/node_modules/grunt-contrib-compass/node_modules/dargs/dargs.js b/node_modules/grunt-contrib-compass/node_modules/dargs/dargs.js deleted file mode 100644 index 507c9e4..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/dargs/dargs.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -module.exports = function (options, excludes) { - var args = []; - - Object.keys(options).forEach(function (key) { - var flag; - var val = options[key]; - - if (Array.isArray(excludes) && excludes.indexOf(key) !== -1) { - return; - } - - flag = key.replace(/[A-Z]/g, '-$&').toLowerCase(); - - if (val === true) { - args.push('--' + flag); - } - - if (typeof val === 'string') { - args.push('--' + flag, val); - } - - if (typeof val === 'number' && isNaN(val) === false) { - args.push('--' + flag, '' + val); - } - - if (Array.isArray(val)) { - val.forEach(function (arrVal) { - args.push('--' + flag, arrVal); - }); - } - }); - - return args; -}; diff --git a/node_modules/grunt-contrib-compass/node_modules/dargs/package.json b/node_modules/grunt-contrib-compass/node_modules/dargs/package.json deleted file mode 100644 index de7f0fa..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/dargs/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "dargs", - "version": "0.1.0", - "description": "Converts an object of options into an array of command-line arguments. Useful when calling command-line tools.", - "keywords": [ - "options", - "arguments", - "args", - "flags", - "cli" - ], - "homepage": "https://github.com/sindresorhus/dargs", - "bugs": { - "url": "https://github.com/sindresorhus/dargs/issues" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "main": "dargs.js", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/dargs.git" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "mocha": "~1.9.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "files": [ - "dargs.js" - ], - "readme": "# dargs [![Build Status](https://secure.travis-ci.org/sindresorhus/dargs.png?branch=master)](http://travis-ci.org/sindresorhus/dargs)\n\n> Converts an object of options into an array of command-line arguments\n\n\n## Getting started\n\nInstall: `npm install --save dargs`\n\n\n#### Example\n\n```js\nvar dargs = require('dargs');\n\nvar options = {\n\tfoo: 'bar',\n\thello: true, // results in only the key being used\n\tcake: false, // ignored\n\tcamelCase: 5, // camelCase is slugged to `camel-case`\n\tmultiple: ['value', 'value2'], // converted to multiple arguments\n\tsad: ':('\n};\n\nvar excludes = ['sad'];\n\nconsole.log(dargs(options, excludes));\n\n/*\n[\n\t'--foo', 'bar',\n\t'--hello',\n\t'--camel-case', '5',\n\t'--multiple', 'value',\n\t'--multiple', 'value2'\n]\n*/\n```\n\n\n## Documentation\n\n\n### options\n\nObject of options to convert to command-line arguments.\n\n\n### excludes\n\nArray of keys to exclude.\n\n\n\n## License\n\nMIT License • © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "_id": "dargs@0.1.0", - "_from": "dargs@~0.1.0" -} diff --git a/node_modules/grunt-contrib-compass/node_modules/dargs/readme.md b/node_modules/grunt-contrib-compass/node_modules/dargs/readme.md deleted file mode 100644 index e9df5ed..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/dargs/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# dargs [![Build Status](https://secure.travis-ci.org/sindresorhus/dargs.png?branch=master)](http://travis-ci.org/sindresorhus/dargs) - -> Converts an object of options into an array of command-line arguments - - -## Getting started - -Install: `npm install --save dargs` - - -#### Example - -```js -var dargs = require('dargs'); - -var options = { - foo: 'bar', - hello: true, // results in only the key being used - cake: false, // ignored - camelCase: 5, // camelCase is slugged to `camel-case` - multiple: ['value', 'value2'], // converted to multiple arguments - sad: ':(' -}; - -var excludes = ['sad']; - -console.log(dargs(options, excludes)); - -/* -[ - '--foo', 'bar', - '--hello', - '--camel-case', '5', - '--multiple', 'value', - '--multiple', 'value2' -] -*/ -``` - - -## Documentation - - -### options - -Object of options to convert to command-line arguments. - - -### excludes - -Array of keys to exclude. - - - -## License - -MIT License • © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/grunt-contrib-compass/node_modules/tmp/.npmignore b/node_modules/grunt-contrib-compass/node_modules/tmp/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-compass/node_modules/tmp/.travis.yml b/node_modules/grunt-contrib-compass/node_modules/tmp/.travis.yml deleted file mode 100644 index 0175d82..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.6" - - "0.8" - - "0.10" diff --git a/node_modules/grunt-contrib-compass/node_modules/tmp/README.md b/node_modules/grunt-contrib-compass/node_modules/tmp/README.md deleted file mode 100644 index 3a1a509..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/README.md +++ /dev/null @@ -1,162 +0,0 @@ -# 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/node_modules/grunt-contrib-compass/node_modules/tmp/lib/tmp.js b/node_modules/grunt-contrib-compass/node_modules/tmp/lib/tmp.js deleted file mode 100644 index 73cb03c..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/lib/tmp.js +++ /dev/null @@ -1,273 +0,0 @@ -/*! - * 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; -} - -process.addListener('uncaughtException', function _uncaughtExceptionThrown( err ) { - _uncaughtException = true; - _garbageCollector(); - - throw err; -}); - -process.addListener('exit', function _exit() { - _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/node_modules/grunt-contrib-compass/node_modules/tmp/package.json b/node_modules/grunt-contrib-compass/node_modules/tmp/package.json deleted file mode 100644 index 96b18b6..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "tmp", - "version": "0.0.21", - "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.21", - "dist": { - "shasum": "a21030368b57f1f439baae7f8c4c9344fa776053" - }, - "_from": "tmp@0.0.21", - "_resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.21.tgz" -} diff --git a/node_modules/grunt-contrib-compass/node_modules/tmp/test-all.sh b/node_modules/grunt-contrib-compass/node_modules/tmp/test-all.sh deleted file mode 100755 index 0fc4282..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test-all.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -for node in node06 node08 node; do - echo "Testing with $(${node} --version)..." - ${node} node_modules/vows/bin/vows test/*test.js -done diff --git a/node_modules/grunt-contrib-compass/node_modules/tmp/test.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test.js deleted file mode 100644 index 8058221..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test.js +++ /dev/null @@ -1,6 +0,0 @@ -process.on('uncaughtException', function ( err ) { - console.log('blah'); - throw err; -}); - -throw "on purpose" diff --git a/node_modules/grunt-contrib-compass/node_modules/tmp/test/base.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/base.js deleted file mode 100644 index 498d8fb..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test/base.js +++ /dev/null @@ -1,74 +0,0 @@ -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/node_modules/grunt-contrib-compass/node_modules/tmp/test/dir-test.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/dir-test.js deleted file mode 100644 index 9b89009..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test/dir-test.js +++ /dev/null @@ -1,183 +0,0 @@ -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/node_modules/grunt-contrib-compass/node_modules/tmp/test/file-test.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/file-test.js deleted file mode 100644 index 150ca11..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test/file-test.js +++ /dev/null @@ -1,165 +0,0 @@ -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/node_modules/grunt-contrib-compass/node_modules/tmp/test/graceful.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/graceful.js deleted file mode 100644 index c898656..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test/graceful.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-compass/node_modules/tmp/test/keep.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/keep.js deleted file mode 100644 index 9538605..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test/keep.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-compass/node_modules/tmp/test/name-test.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/name-test.js deleted file mode 100644 index a242c21..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test/name-test.js +++ /dev/null @@ -1,82 +0,0 @@ -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/node_modules/grunt-contrib-compass/node_modules/tmp/test/spawn.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/spawn.js deleted file mode 100644 index 6468eb3..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test/spawn.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-compass/node_modules/tmp/test/symlinkme/file.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/symlinkme/file.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-compass/node_modules/tmp/test/unsafe.js b/node_modules/grunt-contrib-compass/node_modules/tmp/test/unsafe.js deleted file mode 100644 index 73e4fb3..0000000 --- a/node_modules/grunt-contrib-compass/node_modules/tmp/test/unsafe.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/grunt-contrib-compass/package.json b/node_modules/grunt-contrib-compass/package.json deleted file mode 100644 index c235cc3..0000000 --- a/node_modules/grunt-contrib-compass/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "grunt-contrib-compass", - "description": "Compile Sass to CSS using Compass", - "version": "0.5.0", - "homepage": "https://github.com/gruntjs/grunt-contrib-compass", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-compass.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-compass/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-compass/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">=0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "dependencies": { - "tmp": "0.0.21", - "dargs": "~0.1.0", - "async": "~0.2.0" - }, - "devDependencies": { - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-jshint": "~0.6.0", - "grunt-contrib-nodeunit": "~0.2.0", - "grunt-contrib-internal": "~0.4.2", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin", - "compass", - "scss", - "sass", - "css", - "compile", - "preprocessor", - "style" - ], - "files": [ - "tasks/compass.js", - "tasks/lib/compass.js" - ], - "readme": "# grunt-contrib-compass [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-compass.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-compass)\n\n> Compile Sass to CSS using Compass\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-compass --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-contrib-compass');\n```\n\n\n\n\n## Compass task\n_Run this task with the `grunt compass` command._\n\n[Compass](http://compass-style.org/) is an open-source authoring framework for the [Sass](http://sass-lang.com/) css preprocessor. It helps you build stylesheets faster with a huge library of Sass mixins and functions, advanced tools for spriting, and workflow improvements including file based Sass configuration and a simple pattern for building and using Compass extensions.\n\nThis task requires you to have [Ruby](http://www.ruby-lang.org/en/downloads/), [Sass](http://sass-lang.com/tutorial.html), and [Compass](http://compass-style.org/install/) >=0.12.2 installed. If you're on OS X or Linux you probably already have Ruby installed; test with `ruby -v` in your terminal. When you've confirmed you have Ruby installed, run `gem update --system && gem install compass` to install Compass and Sass.\n\nCompass operates on a folder level. Because of this you don't specify any src/dest, but instead define the `sassDir` and `cssDir` options.\n\n### Options\n\nCompass doesn't expose all of its [options][config] through the CLI, which this task makes use of. If you need an option not mentioned below you can either specify a path to a config.rb file in the `config` option or embed it directly into the `raw` option. Options defined in your Gruntfile will override those specified in your config.rb or `raw` property. `config` and `raw` are mutually exclusive.\n\n#### config\n\nType: `String` \nDefault: same path as your Gruntfile\n\nSpecify the location of the Compass [configuration file][config] explicitly.\n\n#### raw\n\nType: `String`\n\nString form of the Compass [configuration file][config].\n\n#### basePath\n\nType: `String`\n\nThe the path Compass will run from. Defaults to the same path as your Gruntfile.\n\n###### banner\n\nType: `String`\n\nPrepend the specified string to the output file. Useful for licensing\ninformation. **Note:** This only works in combination with the `specify` option\nand can conflict with sourcemap generation.\n\n#### app\n\nType: `String` \nDefault: `stand_alone`\n\nTell compass what kind of application it is integrating with. Can be `stand_alone` or `rails`.\n\n#### sassDir\n\nType: `String`\n\nThe source directory where you keep your Sass stylesheets.\n\n#### cssDir\n\nType: `String`\n\nThe target directory where you keep your CSS stylesheets.\n\n#### specify\n\nType: `String|Array`\n\nLets you specify which files you want to compile. Useful if you don't want to compile the whole folder. Globbing supported. Ignores filenames starting with underscore. Files must be in the directory you specified in `sassDir`.\n\n#### imagesDir\n\nType: `String`\n\nThe directory where you keep your images.\n\n#### javascriptsDir\n\nType: `String`\n\nThe directory where you keep your JavaScript files.\n\n#### fontsDir\n\nType: `String`\n\nThe directory where you keep your fonts.\n\n#### environment\n\nType: `String` \nDefault: `development`\n\nUse sensible defaults for your current environment. Can be: `development` or `production`\n\n#### outputStyle\n\nType: `String`\n\nCSS output mode. Can be: `nested`, `expanded`, `compact`, `compressed`.\n\n#### relativeAssets\n\nType: `Boolean`\n\nMake Compass asset helpers generate relative urls to assets.\n\n#### noLineComments\n\nType: `Boolean`\n\nDisable line comments.\n\n#### httpPath\n\nType: `String` \nDefault: `/`\n\nThe path to the project when running within the web server.\n\n#### cssPath\n\nType: `String`\n\nThe directory where the css stylesheets are kept. It is relative to the `projectPath`. Defaults to \"stylesheets\".\n\n#### httpStylesheetsPath\n\nType: `String` \nDefault: `httpPath + \"/\" + cssDir`\n\nThe full http path to stylesheets on the web server.\n\n#### sassPath\n\nType: `String` \nDefault: `sass`\n\nThe directory where the sass stylesheets are kept. It is relative to the `projectPath`.\n\n#### imagesPath\n\nType: `String` \nDefault: `images`\n\nThe directory where the images are kept. It is relative to the projectPath.\n\n#### httpImagesPath\n\nType: `String` \nDefault: `httpPath + \"/\" + imagesDir`\n\nThe full http path to images on the web server.\n\n#### generatedImagesDir\n\nType: `String` \nDefault: value of `imagesDir`\n\nThe directory where generated images are kept. It is relative to the `projectPath`.\n\n#### generatedImagesPath\n\nType: `String` \nDefault: value of `projectPath/generatedImagesDir`\n\nThe full path to where generated images are kept.\n\n#### httpGeneratedImagesPath\n\nType: `String` \nDefault: `httpPath + \"/\" + generatedImagesDir`\n\nThe full http path to generated images on the web server.\n\n#### javascriptsPath\n\nType: `String` \nDefault: `projectPath/javascriptsDir`\n\nThe full path to where javascripts are kept.\n\n#### httpJavascriptsPath\n\nType: `String` \nDefault: `httpPath + \"/\" + javascriptsDir`\n\nThe full http path to javascripts on the web server.\n\n#### fontsPath\n\nType: `String` \nDefault: `projectPath/fontsDir`\n\nThe full path to where font files are kept.\n\n#### httpFontsPath\n\nType: `String`\n\nThe full http path to font files on the web server.\n\n#### httpFontsDir\n\nType: `String`\n\nThe relative http path to font files on the web server.\n\n#### extensionsPath\n\nType: `String` \nDefault: `project_root/extensions`\n\nThe full http path to the ad-hoc extensions folder on the web server. This is used to access compass plugins that have been installed directly to the project (e.g. through [Bower](https://github.com/bower/bower)) instead of globally as gems. *Only Compass >=0.12.2*\n\n#### extensionsDir\n\nType: `String`\n\nThe relative http path to the ad-hoc extensions folder on the web server. *Only Compass >=0.12.2*\n\n#### assetCacheBuster\n\nType: `Boolean` \nDefault: `true`\n\nIf set to `false`, this disables the default asset cache buster.\n\n#### require\n\nType: `String|Array`\n\nRequire the given Ruby library before running commands. This is used to access Compass plugins without having a project configuration file.\n\n#### load\n\nType: `String|Array`\n\nLoad the framework or extensions found in the specified directory.\n\n#### loadAll\n\nType: `String|Array`\n\nLoad all the frameworks or extensions found in the specified directory.\n\n#### importPath\n\nType: `String|Array`\n\nMakes files under the specified folder findable by Sass's @import directive.\n\n#### debugInfo\n\nType: `Boolean`\n\nCauses the line number and file where a selector is defined to be emitted into the compiled CSS in a format that can be understood by the browser. Automatically disabled when using `outputStyle: 'compressed'`.\n\n#### quiet\n\nType: `Boolean`\n\nQuiet mode.\n\n#### trace\n\nType: `Boolean`\n\nShow a full stacktrace on error.\n\n#### force\n\nType: `Boolean`\n\nAllows Compass to overwrite existing files.\n\n#### dryRun\n\nType: `Boolean`\n\nDry Run. Tells you what it plans to do.\n\n#### boring\n\nType: `Boolean`\n\nTurn off colorized output.\n\n#### bundleExec\n\nType: `Boolean`\n\nRun `compass compile` with [bundle exec](http://gembundler.com/v1.3/man/bundle-exec.1.html): `bundle exec compass compile`.\n\n#### clean\n\nType: `Boolean`\n\nRemove generated files and the sass cache. Runs `compass clean` instead of `compass compile`.\n\n\n[config]: http://compass-style.org/help/tutorials/configuration-reference/\n\n### Usage Examples\n\n#### Example config\n\n```javascript\ngrunt.initConfig({\n compass: { // Task\n dist: { // Target\n options: { // Target options\n sassDir: 'sass',\n cssDir: 'css',\n environment: 'production'\n }\n },\n dev: { // Another target\n options: {\n sassDir: 'sass',\n cssDir: 'css'\n }\n }\n }\n});\n\ngrunt.loadNpmTasks('grunt-contrib-compass');\n\ngrunt.registerTask('default', ['jshint', 'compass']);\n```\n\n\n#### Example usage\n\n\n##### Use external config file\n\n```javascript\ngrunt.initConfig({\n compass: {\n dist: {\n options: {\n config: 'config/config.rb'\n }\n }\n }\n});\n```\n\n##### Override setting in external config file\n\n```javascript\ngrunt.initConfig({\n compass: {\n dist: {\n options: {\n config: 'config/config.rb', // css_dir = 'dev/css'\n cssDir: 'dist/css'\n }\n }\n }\n});\n```\n\n##### Use `raw` option\n\n```javascript\ngrunt.initConfig({\n compass: {\n dist: {\n options: {\n sassDir: 'sass',\n cssDir: 'css',\n raw: 'preferred_syntax = :sass\\n' // Use `raw` since it's not directly available\n }\n }\n }\n});\n```\n\n\n## Release History\n\n * 2013-08-08   v0.5.0   Add `assetCacheBuster` option.\n * 2013-07-28   v0.4.1   Fix `banner` option with `.css.scss` files.\n * 2013-07-19   v0.4.0   Add `banner` option. Show compilation time.\n * 2013-06-24   v0.3.0   Add `extensionDir` and `extensionPath` options. *Requires Compass >=0.12.2*.\n * 2013-04-11   v0.2.0   Add `clean` option. Expose `raw` options as Grunt options. Fix detection of `Nothing to compile` situation.\n * 2013-02-27   v0.1.3   Fixes bundleExec.\n * 2013-02-17   v0.1.2   Ensure Gruntfile.js is included on npm.\n * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0.\n * 2013-02-05   v0.1.1rc8   Added new options: basePath specify, debugInfo.\n * 2013-01-25   v0.1.1rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-10   v0.1.1rc5   Updating to work with grunt v0.4.0rc5.\n * 2012-10-22   v0.1.0   Initial release\n\n---\n\nTask submitted by [Sindre Sorhus](http://github.com/sindresorhus)\n\n*This file was generated on Thu Aug 08 2013 20:44:21.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-compass@0.5.0", - "dist": { - "shasum": "c1434eee9e945d0f502fc97c9c647d9109699a42" - }, - "_from": "grunt-contrib-compass@~0.5.0", - "_resolved": "https://registry.npmjs.org/grunt-contrib-compass/-/grunt-contrib-compass-0.5.0.tgz" -} diff --git a/node_modules/grunt-contrib-compass/tasks/compass.js b/node_modules/grunt-contrib-compass/tasks/compass.js deleted file mode 100644 index 494dbf8..0000000 --- a/node_modules/grunt-contrib-compass/tasks/compass.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * grunt-contrib-compass - * http://gruntjs.com/ - * - * Copyright (c) 2013 Sindre Sorhus, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function (grunt) { - var compass = require('./lib/compass').init(grunt); - - function compile(args, cb) { - var child = grunt.util.spawn({ - cmd: args.shift(), - args: args - }, function (err, result, code) { - var success = code === 0; - - if (code === 127) { - return grunt.warn( - 'You need to have Ruby and Compass installed ' + - 'and in your system PATH for this task to work. ' + - 'More info: https://github.com/gruntjs/grunt-contrib-compass' - ); - } - - // `compass compile` exits with 1 and outputs "Nothing to compile" - // on stderr when it has nothing to compile. - // https://github.com/chriseppstein/compass/issues/993 - // Don't fail the task in this situation. - if (code === 1 && /Nothing to compile/g.test(result.stderr)) { - success = true; - } - - cb(success); - }); - child.stdout.pipe(process.stdout); - child.stderr.pipe(process.stderr); - } - - grunt.registerMultiTask('compass', 'Compile Sass to CSS using Compass', function () { - var options = this.options(); - var cb = this.async(); - - // display compilation time - if (!options.clean) { - options.time = true; - } - - // create a function to retroactively add a banner to the top of the - // generated files, if specified - var bannerCallback = compass.buildBannerCallback(grunt, options); - // create a temporary config file if there are 'raw' options or - // settings not supported as CLI arguments - var configContext = compass.buildConfigContext(options); - // get the array of arguments for the compass command - var args = compass.buildArgsArray(options); - - configContext(function (err, path) { - if (err) { - grunt.fail.warn(err); - } - - if (path) { - args.push('--config', path); - } - - compile(args, function () { - bannerCallback(); - cb(); - }); - }); - }); -}; diff --git a/node_modules/grunt-contrib-compass/tasks/lib/compass.js b/node_modules/grunt-contrib-compass/tasks/lib/compass.js deleted file mode 100644 index b425f2d..0000000 --- a/node_modules/grunt-contrib-compass/tasks/lib/compass.js +++ /dev/null @@ -1,185 +0,0 @@ -exports.init = function (grunt) { - 'use strict'; - var fs = require('fs'); - var tmp = require('tmp'); - var dargs = require('dargs'); - var path = require('path'); - var async = require('async'); - - var exports = {}; - - function camelCaseToUnderscore(str) { - return str - .replace(/([a-z])([A-Z])/g, '$1_$2') - .toLowerCase(); - } - - // Extracts the options that cannot be used as CLI parameter but only - // as 'raw' arguments. - // Returns an object: {raw: str, options: []} with the raw string to be - // used to generate a config and the list of used options. - exports.extractRawOptions = function extractRawOptions(options) { - var raw = options.raw || ''; - var supportedOptions = [ - 'http_path', - 'css_path', - 'http_stylesheets_path', - 'sass_path', - 'images_path', - 'http_images_path', - 'generated_images_dir', - 'generated_images_path', - 'http_generated_images_path', - 'javascripts_path', - 'http_javascripts_path', - 'fonts_path', - 'http_fonts_path', - 'http_fonts_dir', - 'extension_dir', - 'extension_path' - ]; - - var usedOptions = Object.keys(options).filter(function (option) { - var underscoredOption = camelCaseToUnderscore(option); - if (supportedOptions.indexOf(underscoredOption) >= 0) { - // naively escape double-quotes in the value - var value = options[option].replace(/"/, '\\"'); - raw += underscoredOption + ' = "' + value + '"\n'; - delete options[option]; - - return true; - } else if (underscoredOption === 'asset_cache_buster') { - // Special handling for asset_cache_buster as it doesn't take - // a string as argument, but either an inline-ruby block (which we don't - // support) or a `:none` symbol to disable it. - if (options[option] === false) { - raw += underscoredOption + ' :none'; - } - delete options[option]; - return true; - } - }); - - return {raw: raw, options: usedOptions}; - }; - - // Create a function to add a banner, if requested through the options. - exports.buildBannerCallback = function (grunt, options) { - if (!options.specify || !options.banner) { - if (options.banner && !options.specify) { - grunt.fail.warn('You can only use the `banner` option in combination with `specify.`'); - } - // Return a no-op if specify or banner aren't set. - return function () {}; - } - - var srcFiles = grunt.file.expand({ - filter: function (filePath) { - return path.basename(filePath)[0] !== '_'; - } - }, options.specify); - - var banner = options.banner; - delete options.banner; - - var destFiles = srcFiles.map(function (filename) { - return filename.replace(options.sassDir, options.cssDir).replace(/\.(css\.)?(scss|sass)$/i, '.css'); - }); - - return function () { - grunt.log.verbose.writeln('Writing CSS banners.'); - async.map(destFiles, function (filename) { - grunt.log.verbose.writeln('Writing CSS banner for ' + filename); - var content = grunt.file.read(filename); - grunt.file.write(filename, banner + grunt.util.linefeed + content); - }); - }; - }; - - // Create a config file on the fly if there are arguments not supported as - // CLI, returns a function that runs within the temprorary context. - exports.buildConfigContext = function (options) { - var rawOptions = exports.extractRawOptions(options); - if (options.raw && options.config) { - grunt.fail.warn('The options `raw` and `config` are mutually exclusive'); - } - - if (rawOptions.options.length > 0 && options.config) { - grunt.fail.warn('The option `config` cannot be combined with ' + - 'these options: ' + rawOptions.options.join(', ') + '.'); - } - - return function configContext(cb) { - if (rawOptions.raw) { - tmp.file(function (err, path, fd) { - if (err) { - return cb(err); - } - - // Dynamically create config.rb as a tmp file for the `raw` content - fs.writeSync(fd, new Buffer(rawOptions.raw), 0, rawOptions.raw.length); - cb(null, path); - }); - } else { - cb(null, null); - } - }; - }; - - // build the array of arguments to build the compass command - exports.buildArgsArray = function (options) { - var args = [options.clean ? 'clean' : 'compile']; - var basePath = options.basePath; - - grunt.verbose.writeflags(options, 'Options'); - - if (process.platform === 'win32') { - args.unshift('compass.bat'); - } else { - args.unshift('compass'); - } - - if (options.bundleExec) { - args.unshift('bundle', 'exec'); - } - - if (options.basePath) { - args.push(options.basePath); - } - - if (options.specify) { - var files = grunt.file.expand({ - filter: function (filePath) { - return path.basename(filePath)[0] !== '_'; - } - }, options.specify); - - if (files.length > 0) { - [].push.apply(args, files); - } else { - return grunt.log.writeln('`specify` option used, but no files were found.'); - } - } - - // add converted options - [].push.apply(args, dargs(options, [ - 'raw', - 'clean', - 'bundleExec', - 'basePath', - 'specify' - ])); - - // Compass doesn't have a long flag for this option: - // https://github.com/chriseppstein/compass/issues/1055 - if (options.importPath) { - args = args.map(function (el) { - return el.replace('--import-path', '-I'); - }); - } - - return args; - }; - - return exports; -}; diff --git a/node_modules/grunt-contrib-concat/.gitattributes b/node_modules/grunt-contrib-concat/.gitattributes deleted file mode 100644 index 176a458..0000000 --- a/node_modules/grunt-contrib-concat/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto diff --git a/node_modules/grunt-contrib-concat/.jshintrc b/node_modules/grunt-contrib-concat/.jshintrc deleted file mode 100644 index 6b4c1a9..0000000 --- a/node_modules/grunt-contrib-concat/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "boss": true, - "eqnull": true, - "node": true, - "es5": true -} diff --git a/node_modules/grunt-contrib-concat/.npmignore b/node_modules/grunt-contrib-concat/.npmignore deleted file mode 100644 index b785247..0000000 --- a/node_modules/grunt-contrib-concat/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp diff --git a/node_modules/grunt-contrib-concat/.travis.yml b/node_modules/grunt-contrib-concat/.travis.yml deleted file mode 100644 index 5766191..0000000 --- a/node_modules/grunt-contrib-concat/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/AUTHORS b/node_modules/grunt-contrib-concat/AUTHORS deleted file mode 100644 index 19a4a0d..0000000 --- a/node_modules/grunt-contrib-concat/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -"Cowboy" Ben Alman (http://benalman.com/) -Tyler Kellen (http://goingslowly.com/) -Dan Wolff (http://danwolff.se/) diff --git a/node_modules/grunt-contrib-concat/CHANGELOG b/node_modules/grunt-contrib-concat/CHANGELOG deleted file mode 100644 index 809cce0..0000000 --- a/node_modules/grunt-contrib-concat/CHANGELOG +++ /dev/null @@ -1,34 +0,0 @@ -v0.3.0: - date: 2013-04-25 - changes: - - Add option to process files with a custom function. -v0.2.0: - date: 2013-04-08 - changes: - - Dont normalize separator to allow user to set LF even on a Windows environment. -v0.1.3: - date: 2013-02-22 - changes: - - Support footer option. -v0.1.2: - date: 2013-02-15 - changes: - - First official release for Grunt 0.4.0. -v0.1.2rc6: - date: 2013-01-18 - changes: - - Updating grunt/gruntplugin dependencies to rc6. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.1.2rc5: - date: 2013-01-09 - changes: - - Updating to work with grunt v0.4.0rc5. - - Switching back to this.files api. -v0.1.1: - date: 2012-11-13 - changes: - - Switch to this.file api internally. -v0.1.0: - date: 2012-10-03 - changes: - - Work in progress, not yet officially released. diff --git a/node_modules/grunt-contrib-concat/CONTRIBUTING.md b/node_modules/grunt-contrib-concat/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-concat/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-concat/Gruntfile.js b/node_modules/grunt-contrib-concat/Gruntfile.js deleted file mode 100644 index 8217fdf..0000000 --- a/node_modules/grunt-contrib-concat/Gruntfile.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * grunt-contrib-concat - * http://gruntjs.com/ - * - * Copyright (c) 2012 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'tasks/*.js', - '<%= nodeunit.tests %>' - ], - options: { - jshintrc: '.jshintrc' - } - }, - - // Before generating any new files, remove any previously-created files. - clean: { - tests: ['tmp'] - }, - - // Configuration to be run (and then tested). - banner_property: 'AWESOME', - concat: { - default_options: { - files: { - 'tmp/default_options': ['test/fixtures/file1', 'test/fixtures/file2'] - } - }, - custom_options: { - options: { - separator: '\n;\n', - banner: '/* THIS TEST IS <%= banner_property %> */\n', - footer: 'dude' - }, - files: { - 'tmp/custom_options': ['test/fixtures/file1', 'test/fixtures/file2'] - } - }, - handling_invalid_files: { - src: ['test/fixtures/file1', 'invalid_file/should_warn/but_not_fail', 'test/fixtures/file2'], - dest: 'tmp/handling_invalid_files', - nonull: true, - }, - process_function: { - options: { - process: function(src, filepath) { - return '// Source: ' + filepath + '\n' + - src.replace(/file(\d)/, 'f$1'); - } - }, - files: { - 'tmp/process_function': ['test/fixtures/file1', 'test/fixtures/file2'] - } - }, - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'] - } - - }); - - // Actually load this plugin's task(s). - grunt.loadTasks('tasks'); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - // 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', 'concat', 'nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['jshint', 'test', 'build-contrib']); - -}; diff --git a/node_modules/grunt-contrib-concat/LICENSE-MIT b/node_modules/grunt-contrib-concat/LICENSE-MIT deleted file mode 100644 index 7f9d346..0000000 --- a/node_modules/grunt-contrib-concat/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 "Cowboy" Ben Alman, 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/node_modules/grunt-contrib-concat/README.md b/node_modules/grunt-contrib-concat/README.md deleted file mode 100644 index 1ac680b..0000000 --- a/node_modules/grunt-contrib-concat/README.md +++ /dev/null @@ -1,275 +0,0 @@ -# grunt-contrib-concat [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-concat.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-concat) - -> Concatenate files. - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-concat --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-concat'); -``` - - - - -## Concat task -_Run this task with the `grunt concat` command._ - -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. -### Options - -#### separator -Type: `String` -Default: `grunt.util.linefeed` - -Concatenated files will be joined on this string. If you're post-processing concatenated JavaScript files with a minifier, you may need to use a semicolon `';'` as the separator. - -#### banner -Type: `String` -Default: empty string - -This string will be prepended to the beginning of the concatenated output. It is processed using [grunt.template.process][], using the default options. - -_(Default processing options are explained in the [grunt.template.process][] documentation)_ - -#### footer -Type: `String` -Default: empty string - -This string will be appended to the end of the concatenated output. It is processed using [grunt.template.process][], using the default options. - -_(Default processing options are explained in the [grunt.template.process][] documentation)_ - -#### stripBanners -Type: `Boolean` `Object` -Default: `false` - -Strip JavaScript banner comments from source files. - -* `false` - No comments are stripped. -* `true` - `/* ... */` block comments are stripped, but _NOT_ `/*! ... */` comments. -* `options` object: - * By default, behaves as if `true` were specified. - * `block` - If true, _all_ block comments are stripped. - * `line` - If true, any contiguous _leading_ `//` line comments are stripped. - -#### process -Type: `Boolean` `Object` -Default: `false` - -Process source files as [templates][] before concatenating. - -* `false` - No processing will occur. -* `true` - Process source files using [grunt.template.process][] defaults. -* `options` object - Process source files using [grunt.template.process][], using the specified options. -* `function(src, filepath)` - Process source files using the given function, called once for each file. The returned value will be used as source code. - -_(Default processing options are explained in the [grunt.template.process][] documentation)_ - - [templates]: https://github.com/gruntjs/grunt/wiki/grunt.template - [grunt.template.process]: https://github.com/gruntjs/grunt/wiki/grunt.template#wiki-grunt-template-process - -### Usage Examples - -#### Concatenating with a custom separator - -In this example, running `grunt concat:dist` (or `grunt concat` because `concat` is a [multi task][]) will concatenate the three specified source files (in order), joining files with `;` and writing the output to `dist/built.js`. - -```js -// Project configuration. -grunt.initConfig({ - concat: { - options: { - separator: ';' - }, - dist: { - src: ['src/intro.js', 'src/project.js', 'src/outro.js'], - dest: 'dist/built.js' - } - } -}); -``` - -#### Banner comments - -In this example, running `grunt concat:dist` will first strip any preexisting banner comment from the `src/project.js` file, then concatenate the result with a newly-generated banner comment, writing the output to `dist/built.js`. - -This generated banner will be the contents of the `banner` template string interpolated with the config object. In this case, those properties are the values imported from the `package.json` file (which are available via the `pkg` config property) plus today's date. - -_Note: you don't have to use an external JSON file. It's also valid to create the `pkg` object inline in the config. That being said, if you already have a JSON file, you might as well reference it._ - -```js -// Project configuration. -grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - concat: { - options: { - stripBanners: true, - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + - '<%= grunt.template.today("yyyy-mm-dd") %> */' - }, - dist: { - src: ['src/project.js'], - dest: 'dist/built.js' - } - } -}); -``` - -#### Multiple targets - -In this example, running `grunt concat` will build two separate files. One "basic" version, with the main file essentially just copied to `dist/basic.js`, and another "with_extras" concatenated version written to `dist/with_extras.js`. - -While each concat target can be built individually by running `grunt concat:basic` or `grunt concat:extras`, running `grunt concat` will build all concat targets. This is because `concat` is a [multi task][]. - -```js -// Project configuration. -grunt.initConfig({ - concat: { - basic: { - src: ['src/main.js'], - dest: 'dist/basic.js' - }, - extras: { - src: ['src/main.js', 'src/extras.js'], - dest: 'dist/with_extras.js' - } - } -}); -``` - -#### Multiple files per target - -Like the previous example, in this example running `grunt concat` will build two separate files. One "basic" version, with the main file essentially just copied to `dist/basic.js`, and another "with_extras" concatenated version written to `dist/with_extras.js`. - -This example differs in that both files are built under the same target. - -Using the `files` object, you can have list any number of source-destination pairs. - -```js -// Project configuration. -grunt.initConfig({ - concat: { - basic_and_extras: { - files: { - 'dist/basic.js': ['src/main.js'], - 'dist/with_extras.js': ['src/main.js', 'src/extras.js'] - } - } - } -}); -``` - -#### Dynamic filenames - -Filenames can be generated dynamically by using `<%= %>` delimited underscore templates as filenames. - -In this example, running `grunt concat:dist` generates a destination file whose name is generated from the `name` and `version` properties of the referenced `package.json` file (via the `pkg` config property). - -```js -// Project configuration. -grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - concat: { - dist: { - src: ['src/main.js'], - dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js' - } - } -}); -``` - -#### Advanced dynamic filenames - -In this more involved example, running `grunt concat` will build two separate files (because `concat` is a [multi task][]). The destination file paths will be expanded dynamically based on the specified templates, recursively if necessary. - -For example, if the `package.json` file contained `{"name": "awesome", "version": "1.0.0"}`, the files `dist/awesome/1.0.0/basic.js` and `dist/awesome/1.0.0/with_extras.js` would be generated. - -```javascript -// Project configuration. -grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - dirs: { - src: 'src/files', - dest: 'dist/<%= pkg.name %>/<%= pkg.version %>' - }, - concat: { - basic: { - src: ['<%= dirs.src %>/main.js'], - dest: '<%= dirs.dest %>/basic.js' - }, - extras: { - src: ['<%= dirs.src %>/main.js', '<%= dirs.src %>/extras.js'], - dest: '<%= dirs.dest %>/with_extras.js' - } - } -}); -``` - -#### Invalid or Missing Files Warning -If you would like the `concat` task to warn if a given file is missing or invalid be sure to set `nonull` to `true`: - -```js -grunt.initConfig({ - concat: { - missing: { - src: ['src/invalid_or_missing_file'], - dest: 'compiled.js', - nonull: true, - }, - }, -}); -``` - -See [configuring files for a task](http://gruntjs.com/configuring-tasks#files) for how to configure file globbing in Grunt. - - -#### Custom process function -If you would like to do any custom processing before concatenating, use a custom process function: - -```js -runt.initConfig({ - concat: { - dist: { - options: { - // Replace all 'use strict' statements in the code with a single one at the top - banner: "'use strict';\n", - process: function(src, filepath) { - return '// Source: ' + filepath + '\n' + - src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1'); - }, - }, - files: { - 'dist/built.js': ['src/project.js'], - }, - }, - }, -}); -``` - -## Release History - - * 2013-04-25   v0.3.0   Add option to process files with a custom function. - * 2013-04-08   v0.2.0   Dont normalize separator to allow user to set LF even on a Windows environment. - * 2013-02-22   v0.1.3   Support footer option. - * 2013-02-15   v0.1.2   First official release for Grunt 0.4.0. - * 2013-01-18   v0.1.2rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. - * 2013-01-09   v0.1.2rc5   Updating to work with grunt v0.4.0rc5. Switching back to this.files api. - * 2012-11-13   v0.1.1   Switch to this.file api internally. - * 2012-10-03   v0.1.0   Work in progress, not yet officially released. - ---- - -Task submitted by ["Cowboy" Ben Alman](http://benalman.com/) - -*This file was generated on Thu Apr 25 2013 20:22:44.* diff --git a/node_modules/grunt-contrib-concat/docs/concat-examples.md b/node_modules/grunt-contrib-concat/docs/concat-examples.md deleted file mode 100644 index 9c6f42a..0000000 --- a/node_modules/grunt-contrib-concat/docs/concat-examples.md +++ /dev/null @@ -1,177 +0,0 @@ -# Usage Examples - -## Concatenating with a custom separator - -In this example, running `grunt concat:dist` (or `grunt concat` because `concat` is a [multi task][]) will concatenate the three specified source files (in order), joining files with `;` and writing the output to `dist/built.js`. - -```js -// Project configuration. -grunt.initConfig({ - concat: { - options: { - separator: ';' - }, - dist: { - src: ['src/intro.js', 'src/project.js', 'src/outro.js'], - dest: 'dist/built.js' - } - } -}); -``` - -## Banner comments - -In this example, running `grunt concat:dist` will first strip any preexisting banner comment from the `src/project.js` file, then concatenate the result with a newly-generated banner comment, writing the output to `dist/built.js`. - -This generated banner will be the contents of the `banner` template string interpolated with the config object. In this case, those properties are the values imported from the `package.json` file (which are available via the `pkg` config property) plus today's date. - -_Note: you don't have to use an external JSON file. It's also valid to create the `pkg` object inline in the config. That being said, if you already have a JSON file, you might as well reference it._ - -```js -// Project configuration. -grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - concat: { - options: { - stripBanners: true, - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + - '<%= grunt.template.today("yyyy-mm-dd") %> */' - }, - dist: { - src: ['src/project.js'], - dest: 'dist/built.js' - } - } -}); -``` - -## Multiple targets - -In this example, running `grunt concat` will build two separate files. One "basic" version, with the main file essentially just copied to `dist/basic.js`, and another "with_extras" concatenated version written to `dist/with_extras.js`. - -While each concat target can be built individually by running `grunt concat:basic` or `grunt concat:extras`, running `grunt concat` will build all concat targets. This is because `concat` is a [multi task][]. - -```js -// Project configuration. -grunt.initConfig({ - concat: { - basic: { - src: ['src/main.js'], - dest: 'dist/basic.js' - }, - extras: { - src: ['src/main.js', 'src/extras.js'], - dest: 'dist/with_extras.js' - } - } -}); -``` - -## Multiple files per target - -Like the previous example, in this example running `grunt concat` will build two separate files. One "basic" version, with the main file essentially just copied to `dist/basic.js`, and another "with_extras" concatenated version written to `dist/with_extras.js`. - -This example differs in that both files are built under the same target. - -Using the `files` object, you can have list any number of source-destination pairs. - -```js -// Project configuration. -grunt.initConfig({ - concat: { - basic_and_extras: { - files: { - 'dist/basic.js': ['src/main.js'], - 'dist/with_extras.js': ['src/main.js', 'src/extras.js'] - } - } - } -}); -``` - -## Dynamic filenames - -Filenames can be generated dynamically by using `<%= %>` delimited underscore templates as filenames. - -In this example, running `grunt concat:dist` generates a destination file whose name is generated from the `name` and `version` properties of the referenced `package.json` file (via the `pkg` config property). - -```js -// Project configuration. -grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - concat: { - dist: { - src: ['src/main.js'], - dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js' - } - } -}); -``` - -## Advanced dynamic filenames - -In this more involved example, running `grunt concat` will build two separate files (because `concat` is a [multi task][]). The destination file paths will be expanded dynamically based on the specified templates, recursively if necessary. - -For example, if the `package.json` file contained `{"name": "awesome", "version": "1.0.0"}`, the files `dist/awesome/1.0.0/basic.js` and `dist/awesome/1.0.0/with_extras.js` would be generated. - -```javascript -// Project configuration. -grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - dirs: { - src: 'src/files', - dest: 'dist/<%= pkg.name %>/<%= pkg.version %>' - }, - concat: { - basic: { - src: ['<%= dirs.src %>/main.js'], - dest: '<%= dirs.dest %>/basic.js' - }, - extras: { - src: ['<%= dirs.src %>/main.js', '<%= dirs.src %>/extras.js'], - dest: '<%= dirs.dest %>/with_extras.js' - } - } -}); -``` - -## Invalid or Missing Files Warning -If you would like the `concat` task to warn if a given file is missing or invalid be sure to set `nonull` to `true`: - -```js -grunt.initConfig({ - concat: { - missing: { - src: ['src/invalid_or_missing_file'], - dest: 'compiled.js', - nonull: true, - }, - }, -}); -``` - -See [configuring files for a task](http://gruntjs.com/configuring-tasks#files) for how to configure file globbing in Grunt. - - -## Custom process function -If you would like to do any custom processing before concatenating, use a custom process function: - -```js -runt.initConfig({ - concat: { - dist: { - options: { - // Replace all 'use strict' statements in the code with a single one at the top - banner: "'use strict';\n", - process: function(src, filepath) { - return '// Source: ' + filepath + '\n' + - src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1'); - }, - }, - files: { - 'dist/built.js': ['src/project.js'], - }, - }, - }, -}); -``` \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/docs/concat-options.md b/node_modules/grunt-contrib-concat/docs/concat-options.md deleted file mode 100644 index 1770378..0000000 --- a/node_modules/grunt-contrib-concat/docs/concat-options.md +++ /dev/null @@ -1,52 +0,0 @@ -# Options - -## separator -Type: `String` -Default: `grunt.util.linefeed` - -Concatenated files will be joined on this string. If you're post-processing concatenated JavaScript files with a minifier, you may need to use a semicolon `';'` as the separator. - -## banner -Type: `String` -Default: empty string - -This string will be prepended to the beginning of the concatenated output. It is processed using [grunt.template.process][], using the default options. - -_(Default processing options are explained in the [grunt.template.process][] documentation)_ - -## footer -Type: `String` -Default: empty string - -This string will be appended to the end of the concatenated output. It is processed using [grunt.template.process][], using the default options. - -_(Default processing options are explained in the [grunt.template.process][] documentation)_ - -## stripBanners -Type: `Boolean` `Object` -Default: `false` - -Strip JavaScript banner comments from source files. - -* `false` - No comments are stripped. -* `true` - `/* ... */` block comments are stripped, but _NOT_ `/*! ... */` comments. -* `options` object: - * By default, behaves as if `true` were specified. - * `block` - If true, _all_ block comments are stripped. - * `line` - If true, any contiguous _leading_ `//` line comments are stripped. - -## process -Type: `Boolean` `Object` -Default: `false` - -Process source files as [templates][] before concatenating. - -* `false` - No processing will occur. -* `true` - Process source files using [grunt.template.process][] defaults. -* `options` object - Process source files using [grunt.template.process][], using the specified options. -* `function(src, filepath)` - Process source files using the given function, called once for each file. The returned value will be used as source code. - -_(Default processing options are explained in the [grunt.template.process][] documentation)_ - - [templates]: https://github.com/gruntjs/grunt/wiki/grunt.template - [grunt.template.process]: https://github.com/gruntjs/grunt/wiki/grunt.template#wiki-grunt-template-process diff --git a/node_modules/grunt-contrib-concat/docs/concat-overview.md b/node_modules/grunt-contrib-concat/docs/concat-overview.md deleted file mode 100644 index f0c452b..0000000 --- a/node_modules/grunt-contrib-concat/docs/concat-overview.md +++ /dev/null @@ -1 +0,0 @@ -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/package.json b/node_modules/grunt-contrib-concat/package.json deleted file mode 100644 index 2dd4635..0000000 --- a/node_modules/grunt-contrib-concat/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "grunt-contrib-concat", - "description": "Concatenate files.", - "version": "0.3.0", - "homepage": "https://github.com/gruntjs/grunt-contrib-concat", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-concat.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-concat/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-concat/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.2.0", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-clean": "~0.4.0", - "grunt-contrib-internal": "~0.4.2", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin" - ], - "contributors": [ - { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com/" - }, - { - "name": "Dan Wolff", - "url": "http://danwolff.se/" - } - ], - "readme": "# grunt-contrib-concat [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-concat.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-concat)\n\n> Concatenate files.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-concat --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-contrib-concat');\n```\n\n\n\n\n## Concat task\n_Run this task with the `grunt concat` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n### Options\n\n#### separator\nType: `String`\nDefault: `grunt.util.linefeed`\n\nConcatenated files will be joined on this string. If you're post-processing concatenated JavaScript files with a minifier, you may need to use a semicolon `';'` as the separator.\n\n#### banner\nType: `String`\nDefault: empty string\n\nThis string will be prepended to the beginning of the concatenated output. It is processed using [grunt.template.process][], using the default options.\n\n_(Default processing options are explained in the [grunt.template.process][] documentation)_\n\n#### footer\nType: `String`\nDefault: empty string\n\nThis string will be appended to the end of the concatenated output. It is processed using [grunt.template.process][], using the default options.\n\n_(Default processing options are explained in the [grunt.template.process][] documentation)_\n\n#### stripBanners\nType: `Boolean` `Object`\nDefault: `false`\n\nStrip JavaScript banner comments from source files.\n\n* `false` - No comments are stripped.\n* `true` - `/* ... */` block comments are stripped, but _NOT_ `/*! ... */` comments.\n* `options` object:\n * By default, behaves as if `true` were specified.\n * `block` - If true, _all_ block comments are stripped.\n * `line` - If true, any contiguous _leading_ `//` line comments are stripped.\n\n#### process\nType: `Boolean` `Object`\nDefault: `false`\n\nProcess source files as [templates][] before concatenating.\n\n* `false` - No processing will occur.\n* `true` - Process source files using [grunt.template.process][] defaults.\n* `options` object - Process source files using [grunt.template.process][], using the specified options.\n* `function(src, filepath)` - Process source files using the given function, called once for each file. The returned value will be used as source code.\n\n_(Default processing options are explained in the [grunt.template.process][] documentation)_\n\n [templates]: https://github.com/gruntjs/grunt/wiki/grunt.template\n [grunt.template.process]: https://github.com/gruntjs/grunt/wiki/grunt.template#wiki-grunt-template-process\n\n### Usage Examples\n\n#### Concatenating with a custom separator\n\nIn this example, running `grunt concat:dist` (or `grunt concat` because `concat` is a [multi task][]) will concatenate the three specified source files (in order), joining files with `;` and writing the output to `dist/built.js`.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n concat: {\n options: {\n separator: ';'\n },\n dist: {\n src: ['src/intro.js', 'src/project.js', 'src/outro.js'],\n dest: 'dist/built.js'\n }\n }\n});\n```\n\n#### Banner comments\n\nIn this example, running `grunt concat:dist` will first strip any preexisting banner comment from the `src/project.js` file, then concatenate the result with a newly-generated banner comment, writing the output to `dist/built.js`.\n\nThis generated banner will be the contents of the `banner` template string interpolated with the config object. In this case, those properties are the values imported from the `package.json` file (which are available via the `pkg` config property) plus today's date.\n\n_Note: you don't have to use an external JSON file. It's also valid to create the `pkg` object inline in the config. That being said, if you already have a JSON file, you might as well reference it._\n\n```js\n// Project configuration.\ngrunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n concat: {\n options: {\n stripBanners: true,\n banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +\n '<%= grunt.template.today(\"yyyy-mm-dd\") %> */'\n },\n dist: {\n src: ['src/project.js'],\n dest: 'dist/built.js'\n }\n }\n});\n```\n\n#### Multiple targets\n\nIn this example, running `grunt concat` will build two separate files. One \"basic\" version, with the main file essentially just copied to `dist/basic.js`, and another \"with_extras\" concatenated version written to `dist/with_extras.js`.\n\nWhile each concat target can be built individually by running `grunt concat:basic` or `grunt concat:extras`, running `grunt concat` will build all concat targets. This is because `concat` is a [multi task][].\n\n```js\n// Project configuration.\ngrunt.initConfig({\n concat: {\n basic: {\n src: ['src/main.js'],\n dest: 'dist/basic.js'\n },\n extras: {\n src: ['src/main.js', 'src/extras.js'],\n dest: 'dist/with_extras.js'\n }\n }\n});\n```\n\n#### Multiple files per target\n\nLike the previous example, in this example running `grunt concat` will build two separate files. One \"basic\" version, with the main file essentially just copied to `dist/basic.js`, and another \"with_extras\" concatenated version written to `dist/with_extras.js`.\n\nThis example differs in that both files are built under the same target.\n\nUsing the `files` object, you can have list any number of source-destination pairs.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n concat: {\n basic_and_extras: {\n files: {\n 'dist/basic.js': ['src/main.js'],\n 'dist/with_extras.js': ['src/main.js', 'src/extras.js']\n }\n }\n }\n});\n```\n\n#### Dynamic filenames\n\nFilenames can be generated dynamically by using `<%= %>` delimited underscore templates as filenames.\n\nIn this example, running `grunt concat:dist` generates a destination file whose name is generated from the `name` and `version` properties of the referenced `package.json` file (via the `pkg` config property).\n\n```js\n// Project configuration.\ngrunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n concat: {\n dist: {\n src: ['src/main.js'],\n dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js'\n }\n }\n});\n```\n\n#### Advanced dynamic filenames\n\nIn this more involved example, running `grunt concat` will build two separate files (because `concat` is a [multi task][]). The destination file paths will be expanded dynamically based on the specified templates, recursively if necessary.\n\nFor example, if the `package.json` file contained `{\"name\": \"awesome\", \"version\": \"1.0.0\"}`, the files `dist/awesome/1.0.0/basic.js` and `dist/awesome/1.0.0/with_extras.js` would be generated.\n\n```javascript\n// Project configuration.\ngrunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n dirs: {\n src: 'src/files',\n dest: 'dist/<%= pkg.name %>/<%= pkg.version %>'\n },\n concat: {\n basic: {\n src: ['<%= dirs.src %>/main.js'],\n dest: '<%= dirs.dest %>/basic.js'\n },\n extras: {\n src: ['<%= dirs.src %>/main.js', '<%= dirs.src %>/extras.js'],\n dest: '<%= dirs.dest %>/with_extras.js'\n }\n }\n});\n```\n\n#### Invalid or Missing Files Warning\nIf you would like the `concat` task to warn if a given file is missing or invalid be sure to set `nonull` to `true`:\n\n```js\ngrunt.initConfig({\n concat: {\n missing: {\n src: ['src/invalid_or_missing_file'],\n dest: 'compiled.js',\n nonull: true,\n },\n },\n});\n```\n\nSee [configuring files for a task](http://gruntjs.com/configuring-tasks#files) for how to configure file globbing in Grunt.\n\n\n#### Custom process function\nIf you would like to do any custom processing before concatenating, use a custom process function:\n\n```js\nrunt.initConfig({\n concat: {\n dist: {\n options: {\n // Replace all 'use strict' statements in the code with a single one at the top\n banner: \"'use strict';\\n\",\n process: function(src, filepath) {\n return '// Source: ' + filepath + '\\n' +\n src.replace(/(^|\\n)[ \\t]*('use strict'|\"use strict\");?\\s*/g, '$1');\n },\n },\n files: {\n 'dist/built.js': ['src/project.js'],\n },\n },\n },\n});\n```\n\n## Release History\n\n * 2013-04-25   v0.3.0   Add option to process files with a custom function.\n * 2013-04-08   v0.2.0   Dont normalize separator to allow user to set LF even on a Windows environment.\n * 2013-02-22   v0.1.3   Support footer option.\n * 2013-02-15   v0.1.2   First official release for Grunt 0.4.0.\n * 2013-01-18   v0.1.2rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-09   v0.1.2rc5   Updating to work with grunt v0.4.0rc5. Switching back to this.files api.\n * 2012-11-13   v0.1.1   Switch to this.file api internally.\n * 2012-10-03   v0.1.0   Work in progress, not yet officially released.\n\n---\n\nTask submitted by [\"Cowboy\" Ben Alman](http://benalman.com/)\n\n*This file was generated on Thu Apr 25 2013 20:22:44.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-concat@0.3.0", - "_from": "grunt-contrib-concat@~0.3.0" -} diff --git a/node_modules/grunt-contrib-concat/tasks/concat.js b/node_modules/grunt-contrib-concat/tasks/concat.js deleted file mode 100644 index 8942d78..0000000 --- a/node_modules/grunt-contrib-concat/tasks/concat.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * grunt-contrib-concat - * http://gruntjs.com/ - * - * Copyright (c) 2012 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - // Internal lib. - var comment = require('./lib/comment').init(grunt); - - grunt.registerMultiTask('concat', 'Concatenate files.', function() { - // Merge task-specific and/or target-specific options with these defaults. - var options = this.options({ - separator: grunt.util.linefeed, - banner: '', - footer: '', - stripBanners: false, - process: false - }); - - // Normalize boolean options that accept options objects. - if (options.stripBanners === true) { options.stripBanners = {}; } - if (options.process === true) { options.process = {}; } - - // Process banner and footer. - var banner = grunt.template.process(options.banner); - var footer = grunt.template.process(options.footer); - - // Iterate over all src-dest file pairs. - this.files.forEach(function(f) { - // Concat banner + specified files + footer. - var src = banner + f.src.filter(function(filepath) { - // Warn on and remove invalid source files (if nonull was set). - if (!grunt.file.exists(filepath)) { - grunt.log.warn('Source file "' + filepath + '" not found.'); - return false; - } else { - return true; - } - }).map(function(filepath) { - // Read file source. - var src = grunt.file.read(filepath); - // Process files as templates if requested. - if (typeof options.process === 'function') { - src = options.process(src, filepath); - } else if (options.process) { - src = grunt.template.process(src, options.process); - } - // Strip banners if requested. - if (options.stripBanners) { - src = comment.stripBanner(src, options.stripBanners); - } - return src; - }).join(options.separator) + footer; - - // Write the destination file. - grunt.file.write(f.dest, src); - - // Print a success message. - grunt.log.writeln('File "' + f.dest + '" created.'); - }); - }); - -}; diff --git a/node_modules/grunt-contrib-concat/tasks/lib/comment.js b/node_modules/grunt-contrib-concat/tasks/lib/comment.js deleted file mode 100644 index 4a2a6d1..0000000 --- a/node_modules/grunt-contrib-concat/tasks/lib/comment.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * grunt-contrib-concat - * http://gruntjs.com/ - * - * Copyright (c) 2012 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -exports.init = function(/*grunt*/) { - var exports = {}; - - // Return the given source code with any leading banner comment stripped. - exports.stripBanner = function(src, options) { - if (!options) { options = {}; } - var m = []; - if (options.line) { - // Strip // ... leading banners. - m.push('(?:.*\\/\\/.*\\r?\\n)*\\s*'); - } - if (options.block) { - // Strips all /* ... */ block comment banners. - m.push('\\/\\*[\\s\\S]*?\\*\\/'); - } else { - // Strips only /* ... */ block comment banners, excluding /*! ... */. - m.push('\\/\\*[^!][\\s\\S]*?\\*\\/'); - } - var re = new RegExp('^\\s*(?:' + m.join('|') + ')\\s*', ''); - return src.replace(re, ''); - }; - - return exports; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/test/concat_test.js b/node_modules/grunt-contrib-concat/test/concat_test.js deleted file mode 100644 index 95a731b..0000000 --- a/node_modules/grunt-contrib-concat/test/concat_test.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -var grunt = require('grunt'); -var comment = require('../tasks/lib/comment').init(grunt); - -function getNormalizedFile(filepath) { - return grunt.util.normalizelf(grunt.file.read(filepath)); -} - -exports.concat = { - default_options: function(test) { - test.expect(1); - - var actual = getNormalizedFile('tmp/default_options'); - var expected = getNormalizedFile('test/expected/default_options'); - test.equal(actual, expected, 'should describe what the default behavior is.'); - - test.done(); - }, - custom_options: function(test) { - test.expect(1); - - var actual = getNormalizedFile('tmp/custom_options'); - var expected = getNormalizedFile('test/expected/custom_options'); - test.equal(actual, expected, 'should utilize custom banner, footer and separator.'); - - test.done(); - }, - handling_invalid_files: function(test) { - test.expect(1); - - var actual = getNormalizedFile('tmp/handling_invalid_files'); - var expected = getNormalizedFile('test/expected/handling_invalid_files'); - test.equal(actual, expected, 'will have warned, but should not fail.'); - - test.done(); - }, - strip_banner: function(test) { - test.expect(7); - - var src = getNormalizedFile('test/fixtures/banner.js'); - test.equal(comment.stripBanner(src), grunt.util.normalizelf('// Comment\n\n/* Comment */\n'), 'It should strip the top banner.'); - test.equal(comment.stripBanner(src, {block: true}), grunt.util.normalizelf('// Comment\n\n/* Comment */\n'), 'It should strip the top banner.'); - - src = getNormalizedFile('test/fixtures/banner2.js'); - test.equal(comment.stripBanner(src), grunt.util.normalizelf('\n/*! SAMPLE\n * BANNER */\n\n// Comment\n\n/* Comment */\n'), 'It should not strip the top banner.'); - test.equal(comment.stripBanner(src, {block: true}), grunt.util.normalizelf('// Comment\n\n/* Comment */\n'), 'It should strip the top banner.'); - - src = getNormalizedFile('test/fixtures/banner3.js'); - test.equal(comment.stripBanner(src), grunt.util.normalizelf('\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n'), 'It should not strip the top banner.'); - test.equal(comment.stripBanner(src, {block: true}), grunt.util.normalizelf('\n// This is\n// A sample\n// Banner\n\n// But this is not\n\n/* And neither\n * is this\n */\n'), 'It should not strip the top banner.'); - test.equal(comment.stripBanner(src, {line: true}), grunt.util.normalizelf('// But this is not\n\n/* And neither\n * is this\n */\n'), 'It should strip the top banner.'); - test.done(); - }, - process_function: function(test) { - test.expect(1); - - var actual = getNormalizedFile('tmp/process_function'); - var expected = getNormalizedFile('test/expected/process_function'); - test.equal(actual, expected, 'should have processed file content.'); - - test.done(); - } -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/test/expected/custom_options b/node_modules/grunt-contrib-concat/test/expected/custom_options deleted file mode 100644 index d0ac5ed..0000000 --- a/node_modules/grunt-contrib-concat/test/expected/custom_options +++ /dev/null @@ -1,4 +0,0 @@ -/* THIS TEST IS AWESOME */ -file1 -; -file2dude \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/test/expected/default_options b/node_modules/grunt-contrib-concat/test/expected/default_options deleted file mode 100644 index 66728af..0000000 --- a/node_modules/grunt-contrib-concat/test/expected/default_options +++ /dev/null @@ -1,2 +0,0 @@ -file1 -file2 \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/test/expected/handling_invalid_files b/node_modules/grunt-contrib-concat/test/expected/handling_invalid_files deleted file mode 100644 index 66728af..0000000 --- a/node_modules/grunt-contrib-concat/test/expected/handling_invalid_files +++ /dev/null @@ -1,2 +0,0 @@ -file1 -file2 \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/test/expected/process_function b/node_modules/grunt-contrib-concat/test/expected/process_function deleted file mode 100644 index b62a364..0000000 --- a/node_modules/grunt-contrib-concat/test/expected/process_function +++ /dev/null @@ -1,4 +0,0 @@ -// Source: test/fixtures/file1 -f1 -// Source: test/fixtures/file2 -f2 \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/test/fixtures/banner.js b/node_modules/grunt-contrib-concat/test/fixtures/banner.js deleted file mode 100644 index 61cf35d..0000000 --- a/node_modules/grunt-contrib-concat/test/fixtures/banner.js +++ /dev/null @@ -1,11 +0,0 @@ - -/* THIS - * IS - * A - * SAMPLE - * BANNER! - */ - -// Comment - -/* Comment */ diff --git a/node_modules/grunt-contrib-concat/test/fixtures/banner2.js b/node_modules/grunt-contrib-concat/test/fixtures/banner2.js deleted file mode 100644 index f8ff08c..0000000 --- a/node_modules/grunt-contrib-concat/test/fixtures/banner2.js +++ /dev/null @@ -1,7 +0,0 @@ - -/*! SAMPLE - * BANNER */ - -// Comment - -/* Comment */ diff --git a/node_modules/grunt-contrib-concat/test/fixtures/banner3.js b/node_modules/grunt-contrib-concat/test/fixtures/banner3.js deleted file mode 100644 index ef55520..0000000 --- a/node_modules/grunt-contrib-concat/test/fixtures/banner3.js +++ /dev/null @@ -1,10 +0,0 @@ - -// This is -// A sample -// Banner - -// But this is not - -/* And neither - * is this - */ diff --git a/node_modules/grunt-contrib-concat/test/fixtures/file1 b/node_modules/grunt-contrib-concat/test/fixtures/file1 deleted file mode 100644 index 08219db..0000000 --- a/node_modules/grunt-contrib-concat/test/fixtures/file1 +++ /dev/null @@ -1 +0,0 @@ -file1 \ No newline at end of file diff --git a/node_modules/grunt-contrib-concat/test/fixtures/file2 b/node_modules/grunt-contrib-concat/test/fixtures/file2 deleted file mode 100644 index 30d67d4..0000000 --- a/node_modules/grunt-contrib-concat/test/fixtures/file2 +++ /dev/null @@ -1 +0,0 @@ -file2 \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/.travis.yml b/node_modules/grunt-contrib-connect/.travis.yml deleted file mode 100644 index 5766191..0000000 --- a/node_modules/grunt-contrib-connect/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/AUTHORS b/node_modules/grunt-contrib-connect/AUTHORS deleted file mode 100644 index 388b81c..0000000 --- a/node_modules/grunt-contrib-connect/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -"Cowboy" Ben Alman (http://benalman.com) -Tyler Kellen (http://goingslowly.com) -Sindre Sorhus (http://sindresorhus.com) diff --git a/node_modules/grunt-contrib-connect/CHANGELOG b/node_modules/grunt-contrib-connect/CHANGELOG deleted file mode 100644 index 256d136..0000000 --- a/node_modules/grunt-contrib-connect/CHANGELOG +++ /dev/null @@ -1,52 +0,0 @@ -v0.5.0: - date: 2013-09-05 - changes: - - Add 'open' option. -v0.4.2: - date: 2013-09-05 - changes: - - Un-normalize options.base as it should be a string or an array as the user has set. - - Fix setting target hostname option. -v0.4.1: - date: 2013-09-02 - changes: - - Browse-able directory is the last item supplied to bases. - - Added directory option to override browse-able directory. -v0.4.0: - date: 2013-09-01 - changes: - - Fix logging of which server address. - - Ability to set multiple bases. - - Event emitted when server starts listening. - - Support for HTTPS. - - debug option added to display debug logging like the --debug flag. - - livereload option added to inject a livereload snippet into the page. -v0.3.0: - date: 2013-04-10 - changes: - - Add ability to listen on system-assigned port. -v0.2.0: - date: 2013-03-07 - changes: - - Upgrade connect dependency. -v0.1.2: - date: 2013-02-17 - changes: - - Ensure Gruntfile.js is included on npm. -v0.1.1: - date: 2013-02-15 - changes: - - First official release for Grunt 0.4.0. -v0.1.1rc6: - date: 2013-01-18 - changes: - - Updating grunt/gruntplugin dependencies to rc6. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.1.1rc5: - date: 2013-01-09 - changes: - - Updating to work with grunt v0.4.0rc5. -v0.1.0: - date: 2012-11-01 - changes: - - Work in progress, not yet officially released. diff --git a/node_modules/grunt-contrib-connect/CONTRIBUTING.md b/node_modules/grunt-contrib-connect/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-connect/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-connect/Gruntfile.js b/node_modules/grunt-contrib-connect/Gruntfile.js deleted file mode 100644 index b2e496c..0000000 --- a/node_modules/grunt-contrib-connect/Gruntfile.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * grunt-contrib-connect - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; -var path = require('path'); -var certs = path.join(__dirname, 'tasks', 'certs'); - -module.exports = function(grunt) { - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'tasks/*.js', - '<%= nodeunit.tests %>' - ], - options: { - jshintrc: '.jshintrc' - } - }, - - nodeunit: { - tests: ['test/*_test.js'] - }, - - connect: { - custom_base: { - options: { - base: 'test', - }, - }, - custom_port: { - options: { - port: 9000, - }, - }, - custom_https: { - options: { - port: 8001, - protocol: 'https', - } - }, - custom_https_certs: { - options: { - port: 8002, - protocol: 'https', - key: grunt.file.read(path.join(certs, 'server.key')).toString(), - cert: grunt.file.read(path.join(certs, 'server.crt')).toString(), - ca: grunt.file.read(path.join(certs, 'ca.crt')).toString(), - passphrase: 'grunt', - } - }, - custom_middleware: { - options: { - port: 9001, - base: '.', - middleware: function(connect, options) { - // Return array of whatever middlewares you want - return [ - connect.static(options.base), - function(req, res, next) { - res.end('Hello from port ' + options.port); - } - ]; - }, - }, - }, - multiple_base: { - options: { - base: ['test', 'docs'], - port: 9002, - }, - }, - multiple_base_directory: { - options: { - base: ['test', 'docs'], - directory: 'test/fixtures/', - port: 9003, - }, - }, - }, - }); - - grunt.loadTasks('tasks'); - - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - grunt.registerTask('test', ['connect', 'nodeunit']); - grunt.registerTask('default', ['jshint', 'test', 'build-contrib']); -}; diff --git a/node_modules/grunt-contrib-connect/LICENSE-MIT b/node_modules/grunt-contrib-connect/LICENSE-MIT deleted file mode 100644 index 8368849..0000000 --- a/node_modules/grunt-contrib-connect/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman, 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/node_modules/grunt-contrib-connect/README.md b/node_modules/grunt-contrib-connect/README.md deleted file mode 100644 index 94d75bd..0000000 --- a/node_modules/grunt-contrib-connect/README.md +++ /dev/null @@ -1,281 +0,0 @@ -# grunt-contrib-connect v0.5.0 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-connect.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-connect) - -> Start a connect web server. - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-connect --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-connect'); -``` - - - - -## Connect task -_Run this task with the `grunt connect` command._ - -Note that this server only runs as long as grunt is running. Once grunt's tasks have completed, the web server stops. This behavior can be changed with the [keepalive](#keepalive) option, and can be enabled ad-hoc by running the task like `grunt connect:keepalive`. - -This task was designed to be used in conjunction with another task that is run immediately afterwards, like the [grunt-contrib-qunit plugin](https://github.com/gruntjs/grunt-contrib-qunit) `qunit` task. -### Options - -#### port -Type: `Integer` -Default: `8000` - -The port on which the webserver will respond. The task will fail if the specified port is already in use. You can use the special values `0` or `'?'` to use a system-assigned port. - -#### protocol -Type: `String` -Default: `'http'` - -May be `'http'` or `'https'`. - -#### hostname -Type: `String` -Default: `'localhost'` - -The hostname the webserver will use. - -Setting it to `'*'` will make the server accessible from anywhere. - -#### base -Type: `String` or `Array` -Default: `'.'` - -The base (or root) directory from which files will be served. Defaults to the project Gruntfile's directory. - -Can be an array of bases to serve multiple directories. The last base given will be the directory to become browse-able. - -#### directory -Type: `String` -Default: `null` - -Set to the directory you wish to be browse-able. Used to override the `base` option browse-able directory. - -#### keepalive -Type: `Boolean` -Default: `false` - -Keep the server alive indefinitely. Note that if this option is enabled, any tasks specified after this task will _never run_. By default, once grunt's tasks have completed, the web server stops. This option changes that behavior. - -This option can also be enabled ad-hoc by running the task like `grunt connect:targetname:keepalive` - -#### debug -Type: `Boolean` -Default: `false` - -Set the `debug` option to true to enable logging instead of using the `--debug` flag. - -#### livereload -Type: `Boolean` or `Number` -Default: `false` - -Set to `true` or a port number to inject a live reload script tag into your page using [connect-livereload](https://github.com/intesso/connect-livereload). - -*This does not perform live reloading. It is intended to be used in tandem with grunt-contrib-watch or another task that will trigger a live reload server upon files changing.* - -#### open -Type: `Boolean` or `String` -Default: `false` - -Open the served page in your default browser. Specifying `true` opens the default server URL, while specifying a URL opens that URL. - -#### middleware -Type: `Function` -Default: - -```js -function(connect, options) { - var middlewares = []; - var directory = options.directory || options.base[options.base.length - 1]; - if (!Array.isArray(options.base)) { - options.base = [options.base]; - } - options.base.forEach(function(base) { - // Serve static files. - middlewares.push(connect.static(base)); - }); - // Make directory browse-able. - middlewares.push(connect.directory(directory)); - return middlewares; -} -``` - -Lets you add in your own Connect middlewares. This option expects a function that returns an array of middlewares. See the [project Gruntfile][] and [project unit tests][] for a usage example. - -[project Gruntfile]: Gruntfile.js -[project unit tests]: test/connect_test.js - -### Usage examples - -#### Basic Use -In this example, `grunt connect` (or more verbosely, `grunt connect:server`) will start a static web server at `http://localhost:9001/`, with its base path set to the `www-root` directory relative to the gruntfile, and any tasks run afterwards will be able to access it. - -```javascript -// Project configuration. -grunt.initConfig({ - connect: { - server: { - options: { - port: 9001, - base: 'www-root' - } - } - } -}); -``` - -If you want your web server to use the default options, just omit the `options` object. You still need to specify a target (`uses_defaults` in this example), but the target's configuration object can otherwise be empty or nonexistent. In this example, `grunt connect` (or more verbosely, `grunt connect:uses_defaults`) will start a static web server using the default options. - -```javascript -// Project configuration. -grunt.initConfig({ - connect: { - uses_defaults: {} - } -}); -``` - -#### Multiple Servers -You can specify multiple servers to be run alone or simultaneously by creating a target for each server. In this example, running either `grunt connect:site1` or `grunt connect:site2` will start the appropriate web server, but running `grunt connect` will run _both_. Note that any server for which the [keepalive](#keepalive) option is specified will prevent _any_ task or target from running after it. - -```javascript -// Project configuration. -grunt.initConfig({ - connect: { - site1: { - options: { - port: 9000, - base: 'www-roots/site1' - } - }, - site2: { - options: { - port: 9001, - base: 'www-roots/site2' - } - } - } -}); -``` - -#### Roll Your Own -Like the [Basic Use](#basic-use) example, this example will start a static web server at `http://localhost:9001/`, with its base path set to the `www-root` directory relative to the gruntfile. Unlike the other example, this is done by creating a brand new task. in fact, this plugin isn't even installed! - -```javascript -// Project configuration. -grunt.initConfig({ /* Nothing needed here! */ }); - -// After running "npm install connect --save-dev" to add connect as a dev -// dependency of your project, you can require it in your gruntfile with: -var connect = require('connect'); - -// Now you can define a "connect" task that starts a webserver, using the -// connect lib, with whatever options and configuration you need: -grunt.registerTask('connect', 'Start a custom static web server.', function() { - grunt.log.writeln('Starting static web server in "www-root" on port 9001.'); - connect(connect.static('www-root')).listen(9001); -}); -``` - -#### Support for HTTPS - -A default certificate authority, certificate and key file are provided and pre- -configured for use when `protocol` has been set to `https`. - -NOTE: The passphrase used on the files is `grunt` - -####### Advanced HTTPS config - -If the default certificate setup is unsuitable for your environment, OpenSSL -can be used to create a set of self-signed certificates with a local ca root. - -```shell -### Generate the CA key -### Set a passphrase and remember what it is -openssl genrsa -des3 -out ca.key 2048 -### Generate a CA root -openssl req -new -x509 -days 3650 -key ca.key -out ca.crt - -### Generate the server key -openssl genrsa -out server.key 1024 -### Generate the request to the self-signed CA root -openssl req -new -key server.key -out server.csr -### Generate the server certificate -openssl x509 -req -in server.csr -out server.crt -CA ca.crt -CAkey ca.key -CAcreateserial -days 3650 -``` - -For more details on the various options that can be set when configuring SSL, -please see the Node documentation for [TLS][]. - -Grunt configuration would become - -```javascript -// Project configuration. -grunt.initConfig({ - connect: { - server: { - options: { - protocol: 'https', - port: 8443, - key: grunt.file.read('server.key').toString(), - cert: grunt.file.read('server.crt').toString(), - ca: grunt.file.read('ca.crt').toString(), - passphrase: 'grunt', - }, - }, - }, -}); -``` - -[TLS]: http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener - -#### Grunt Events -The connect plugin will emit a grunt event, `connect.{taskName}.listening`, once the server has started. You can listen for this event to run things against a keepalive server, for example: - -```javascript -grunt.registerTask('jasmine-server', 'start web server for jasmine tests in browser', function() { - grunt.task.run('jasmine:tests:build'); - - grunt.event.once('connect.tests.listening', function(host, port) { - var specRunnerUrl = 'http://' + host + ':' + port + '/_SpecRunner.html'; - grunt.log.writeln('Jasmine specs available at: ' + specRunnerUrl); - require('open')(specRunnerUrl); - }); - - grunt.task.run('connect:tests:keepalive'); -}); -``` - - -## Release History - - * 2013-09-05   v0.5.0   Add 'open' option. - * 2013-09-05   v0.4.2   Un-normalize options.base as it should be a string or an array as the user has set. Fix setting target hostname option. - * 2013-09-02   v0.4.1   Browse-able directory is the last item supplied to bases. Added directory option to override browse-able directory. - * 2013-09-01   v0.4.0   Fix logging of which server address. Ability to set multiple bases. Event emitted when server starts listening. Support for HTTPS. debug option added to display debug logging like the --debug flag. livereload option added to inject a livereload snippet into the page. - * 2013-04-10   v0.3.0   Add ability to listen on system-assigned port. - * 2013-03-07   v0.2.0   Upgrade connect dependency. - * 2013-02-17   v0.1.2   Ensure Gruntfile.js is included on npm. - * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0. - * 2013-01-18   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. - * 2013-01-09   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. - * 2012-11-01   v0.1.0   Work in progress, not yet officially released. - ---- - -Task submitted by ["Cowboy" Ben Alman](http://benalman.com) - -*This file was generated on Thu Sep 05 2013 14:09:10.* diff --git a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect-livereload/.npmignore deleted file mode 100644 index 70659d8..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -examples/ -docs/ -src/ -test/ -spec/ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/.travis.yml b/node_modules/grunt-contrib-connect/node_modules/connect-livereload/.travis.yml deleted file mode 100644 index 33e2922..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: node_js -node_js: - - "0.11" - - "0.10" - - "0.8" - - "0.6" - -before_script: - - "npm install" - -script: - - "node_modules/mocha/bin/mocha" - -notifications: - email: andi.neck@intesso.com - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/LICENSE b/node_modules/grunt-contrib-connect/node_modules/connect-livereload/LICENSE deleted file mode 100644 index 70e8fef..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 intesso - -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/node_modules/grunt-contrib-connect/node_modules/connect-livereload/README.md b/node_modules/grunt-contrib-connect/node_modules/connect-livereload/README.md deleted file mode 100644 index 96f2fab..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/README.md +++ /dev/null @@ -1,56 +0,0 @@ -connect-livereload -================== -connect middleware for adding the livereload script to the response. -no browser plugin is needed. -if you are happy with a browser plugin, then you don't need this middleware. - -[![Build Status](https://travis-ci.org/intesso/connect-livereload.png)](https://travis-ci.org/intesso/connect-livereload) - -install -======= -```bash -npm install connect-livereload --save-dev -``` - -use -=== -this middleware can be used with a LiveReload server e.g. [grunt-reload](https://github.com/webxl/grunt-reload). - -In your connect or express application add this after the static and before the dynamic routes: -```javascript - var liveReloadPort = 35729; - var excludeList = ['.woff', '.flv']; - - app.use(require('connect-livereload')({ - port: liveReloadPort, - excludeList: excludeList - })); -``` - -please see the [examples](https://github.com/intesso/connect-livereload/tree/master/examples) for the app and Grunt configuration. - - -###note -if you add this middleware before the static middleware, it will lead to problems. -If you can't avoid that for some reason, you have to add all of the static file extensions to the `excludeList: ['.css', '.js', '.ico', '.png', 'ect...']` - -alternative -=========== -An alternative would be to install the [LiveReload browser plugin](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei). - - -credits -======= -* The middleware code is mainly extracted from: [grunt-contrib-livereload/util.js](https://github.com/gruntjs/grunt-contrib-livereload/blob/master/lib/utils.js) -* [LiveReload Creator](http://livereload.com/) - -tests -===== -run the tests with -``` -mocha -``` - -license -======= -[MIT License](https://github.com/intesso/connect-livereload/blob/master/LICENSE) diff --git a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/index.js b/node_modules/grunt-contrib-connect/node_modules/connect-livereload/index.js deleted file mode 100644 index 81fd62a..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/index.js +++ /dev/null @@ -1,87 +0,0 @@ -module.exports = function liveReload(opt) { - var opt = opt || {}; - var port = opt.port || 35729; - var excludeList = opt.excludeList || ['.woff', '.js', '.css', '.ico']; - - function getSnippet() { - /*jshint quotmark:false */ - var snippet = [ - "", - "", - "" - ].join('\n'); - return snippet; - }; - - function bodyExists(body) { - if (!body) return false; - return (~body.lastIndexOf("")); - } - - function snippetExists(body) { - if (!body) return true; - return (~body.lastIndexOf("/livereload.js?snipver=1")); - } - - function acceptsHtmlExplicit(req) { - var accept = req.headers["accept"]; - if (!accept) return false; - return (~accept.indexOf("html")); - } - - function isExcluded(req) { - var url = req.url; - var excluded = false; - if (!url) return true; - excludeList.forEach(function(exclude) { - if (~url.indexOf(exclude)) { - excluded = true; - } - }); - return excluded; - } - - return function(req, res, next) { - var writeHead = res.writeHead; - var write = res.write; - var end = res.end; - - if (!acceptsHtmlExplicit(req) || isExcluded(req)) { - return next(); - } - - res.push = function(chunk) { - res.data = (res.data || '') + chunk; - }; - - res.inject = res.write = function(string, encoding) { - res.write = write; - if (string !== undefined) { - var body = string instanceof Buffer ? string.toString(encoding) : string; - if ((bodyExists(body) || bodyExists(res.data)) && !snippetExists(body) && (!res.data || !snippetExists(res.data))) { - res.push(body.replace(/<\/body>/, function(w) { - return getSnippet() + w; - })); - return true; - } else { - return res.write(string, encoding); - } - } - return true; - }; - - res.end = function(string, encoding) { - res.writeHead = writeHead; - res.end = end; - var result = res.inject(string, encoding); - if (!result) return res.end(string, encoding); - if (res.data !== undefined && !res._header) res.setHeader('content-length', Buffer.byteLength(res.data, encoding)); - res.end(res.data, encoding); - }; - next(); - }; - -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/package.json b/node_modules/grunt-contrib-connect/node_modules/connect-livereload/package.json deleted file mode 100644 index 28ae8c6..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect-livereload/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "connect-livereload", - "description": "connect middleware for adding the livereload script to the response", - "version": "0.2.0", - "author": { - "name": "Andi Neck", - "email": "andi.neck@intesso.com" - }, - "contributors": [ - { - "name": "Andi Neck", - "email": "andi.neck@intesso.com" - } - ], - "dependencies": {}, - "devDependencies": { - "express": "~3.2.2", - "supertest": "~0.6.0", - "mocha": "~1.9.0" - }, - "keywords": [ - "connect", - "livereload", - "live-reload" - ], - "repository": { - "type": "git", - "url": "git://github.com/intesso/connect-livereload" - }, - "main": "index", - "engines": { - "node": "*" - }, - "readme": "connect-livereload\n==================\nconnect middleware for adding the livereload script to the response.\nno browser plugin is needed.\nif you are happy with a browser plugin, then you don't need this middleware.\n\n[![Build Status](https://travis-ci.org/intesso/connect-livereload.png)](https://travis-ci.org/intesso/connect-livereload)\n\ninstall\n=======\n```bash\nnpm install connect-livereload --save-dev\n```\n\nuse\n===\nthis middleware can be used with a LiveReload server e.g. [grunt-reload](https://github.com/webxl/grunt-reload).\n\nIn your connect or express application add this after the static and before the dynamic routes:\n```javascript\n var liveReloadPort = 35729;\n var excludeList = ['.woff', '.flv'];\n \n app.use(require('connect-livereload')({\n port: liveReloadPort,\n excludeList: excludeList\n }));\n```\n\nplease see the [examples](https://github.com/intesso/connect-livereload/tree/master/examples) for the app and Grunt configuration.\n\n\t\n###note \nif you add this middleware before the static middleware, it will lead to problems. \nIf you can't avoid that for some reason, you have to add all of the static file extensions to the `excludeList: ['.css', '.js', '.ico', '.png', 'ect...']`\n\nalternative\n===========\nAn alternative would be to install the [LiveReload browser plugin](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei).\n\n\ncredits\n=======\n* The middleware code is mainly extracted from: [grunt-contrib-livereload/util.js](https://github.com/gruntjs/grunt-contrib-livereload/blob/master/lib/utils.js)\n* [LiveReload Creator](http://livereload.com/)\n\ntests\n=====\nrun the tests with \n```\nmocha\n```\n\nlicense\n=======\n[MIT License](https://github.com/intesso/connect-livereload/blob/master/LICENSE)\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/intesso/connect-livereload/issues" - }, - "_id": "connect-livereload@0.2.0", - "dist": { - "shasum": "7573cf587846dffd02a3e65e3122b470dd615ec9" - }, - "_from": "connect-livereload@~0.2.0", - "_resolved": "https://registry.npmjs.org/connect-livereload/-/connect-livereload-0.2.0.tgz" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/.npmignore deleted file mode 100644 index 9046dde..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/.npmignore +++ /dev/null @@ -1,12 +0,0 @@ -*.markdown -*.md -.git* -Makefile -benchmarks/ -docs/ -examples/ -install.sh -support/ -test/ -.DS_Store -coverage.html diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/.travis.yml b/node_modules/grunt-contrib-connect/node_modules/connect/.travis.yml deleted file mode 100644 index a12e3f0..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/LICENSE b/node_modules/grunt-contrib-connect/node_modules/connect/LICENSE deleted file mode 100644 index 0c5d22d..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2010 Sencha Inc. -Copyright (c) 2011 LearnBoost -Copyright (c) 2011 TJ Holowaychuk - -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/node_modules/grunt-contrib-connect/node_modules/connect/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/Readme.md deleted file mode 100644 index 7d65f9c..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/Readme.md +++ /dev/null @@ -1,133 +0,0 @@ -[![build status](https://secure.travis-ci.org/senchalabs/connect.png)](http://travis-ci.org/senchalabs/connect) -# Connect - - Connect is an extensible HTTP server framework for [node](http://nodejs.org), providing high performance "plugins" known as _middleware_. - - Connect is bundled with over _20_ commonly used middleware, including - a logger, session support, cookie parser, and [more](http://senchalabs.github.com/connect). Be sure to view the 2.x [documentation](http://senchalabs.github.com/connect/). - -```js -var connect = require('connect') - , http = require('http'); - -var app = connect() - .use(connect.favicon()) - .use(connect.logger('dev')) - .use(connect.static('public')) - .use(connect.directory('public')) - .use(connect.cookieParser()) - .use(connect.session({ secret: 'my secret here' })) - .use(function(req, res){ - res.end('Hello from Connect!\n'); - }); - -http.createServer(app).listen(3000); -``` - -## Middleware - - - [csrf](http://www.senchalabs.org/connect/csrf.html) - - [basicAuth](http://www.senchalabs.org/connect/basicAuth.html) - - [bodyParser](http://www.senchalabs.org/connect/bodyParser.html) - - [json](http://www.senchalabs.org/connect/json.html) - - [multipart](http://www.senchalabs.org/connect/multipart.html) - - [urlencoded](http://www.senchalabs.org/connect/urlencoded.html) - - [cookieParser](http://www.senchalabs.org/connect/cookieParser.html) - - [directory](http://www.senchalabs.org/connect/directory.html) - - [compress](http://www.senchalabs.org/connect/compress.html) - - [errorHandler](http://www.senchalabs.org/connect/errorHandler.html) - - [favicon](http://www.senchalabs.org/connect/favicon.html) - - [limit](http://www.senchalabs.org/connect/limit.html) - - [logger](http://www.senchalabs.org/connect/logger.html) - - [methodOverride](http://www.senchalabs.org/connect/methodOverride.html) - - [query](http://www.senchalabs.org/connect/query.html) - - [responseTime](http://www.senchalabs.org/connect/responseTime.html) - - [session](http://www.senchalabs.org/connect/session.html) - - [static](http://www.senchalabs.org/connect/static.html) - - [staticCache](http://www.senchalabs.org/connect/staticCache.html) - - [vhost](http://www.senchalabs.org/connect/vhost.html) - - [subdomains](http://www.senchalabs.org/connect/subdomains.html) - - [cookieSession](http://www.senchalabs.org/connect/cookieSession.html) - -## Running Tests - -first: - - $ npm install -d - -then: - - $ make test - -## Authors - - Below is the output from [git-summary](http://github.com/visionmedia/git-extras). - - - project: connect - commits: 2033 - active : 301 days - files : 171 - authors: - 1414 Tj Holowaychuk 69.6% - 298 visionmedia 14.7% - 191 Tim Caswell 9.4% - 51 TJ Holowaychuk 2.5% - 10 Ryan Olds 0.5% - 8 Astro 0.4% - 5 Nathan Rajlich 0.2% - 5 Jakub Nešetřil 0.2% - 3 Daniel Dickison 0.1% - 3 David Rio Deiros 0.1% - 3 Alexander Simmerl 0.1% - 3 Andreas Lind Petersen 0.1% - 2 Aaron Heckmann 0.1% - 2 Jacques Crocker 0.1% - 2 Fabian Jakobs 0.1% - 2 Brian J Brennan 0.1% - 2 Adam Malcontenti-Wilson 0.1% - 2 Glen Mailer 0.1% - 2 James Campos 0.1% - 1 Trent Mick 0.0% - 1 Troy Kruthoff 0.0% - 1 Wei Zhu 0.0% - 1 comerc 0.0% - 1 darobin 0.0% - 1 nateps 0.0% - 1 Marco Sanson 0.0% - 1 Arthur Taylor 0.0% - 1 Aseem Kishore 0.0% - 1 Bart Teeuwisse 0.0% - 1 Cameron Howey 0.0% - 1 Chad Weider 0.0% - 1 Craig Barnes 0.0% - 1 Eran Hammer-Lahav 0.0% - 1 Gregory McWhirter 0.0% - 1 Guillermo Rauch 0.0% - 1 Jae Kwon 0.0% - 1 Jakub Nesetril 0.0% - 1 Joshua Peek 0.0% - 1 Jxck 0.0% - 1 AJ ONeal 0.0% - 1 Michael Hemesath 0.0% - 1 Morten Siebuhr 0.0% - 1 Samori Gorse 0.0% - 1 Tom Jensen 0.0% - -## Node Compatibility - - Connect `< 1.x` is compatible with node 0.2.x - - - Connect `1.x` is compatible with node 0.4.x - - - Connect (_master_) `2.x` is compatible with node 0.6.x - -## CLA - - [http://sencha.com/cla](http://sencha.com/cla) - -## License - -View the [LICENSE](https://github.com/senchalabs/connect/blob/master/LICENSE) file. The [Silk](http://www.famfamfam.com/lab/icons/silk/) icons used by the `directory` middleware created by/copyright of [FAMFAMFAM](http://www.famfamfam.com/). diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/index.js deleted file mode 100644 index 23240ee..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = process.env.CONNECT_COV - ? require('./lib-cov/connect') - : require('./lib/connect'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/cache.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/cache.js deleted file mode 100644 index 052fcdb..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/cache.js +++ /dev/null @@ -1,81 +0,0 @@ - -/*! - * Connect - Cache - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Expose `Cache`. - */ - -module.exports = Cache; - -/** - * LRU cache store. - * - * @param {Number} limit - * @api private - */ - -function Cache(limit) { - this.store = {}; - this.keys = []; - this.limit = limit; -} - -/** - * Touch `key`, promoting the object. - * - * @param {String} key - * @param {Number} i - * @api private - */ - -Cache.prototype.touch = function(key, i){ - this.keys.splice(i,1); - this.keys.push(key); -}; - -/** - * Remove `key`. - * - * @param {String} key - * @api private - */ - -Cache.prototype.remove = function(key){ - delete this.store[key]; -}; - -/** - * Get the object stored for `key`. - * - * @param {String} key - * @return {Array} - * @api private - */ - -Cache.prototype.get = function(key){ - return this.store[key]; -}; - -/** - * Add a cache `key`. - * - * @param {String} key - * @return {Array} - * @api private - */ - -Cache.prototype.add = function(key){ - // initialize store - var len = this.keys.push(key); - - // limit reached, invalidate LRU - if (len > this.limit) this.remove(this.keys.shift()); - - var arr = this.store[key] = []; - arr.createdAt = new Date; - return arr; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/connect.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/connect.js deleted file mode 100644 index 72961dc..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/connect.js +++ /dev/null @@ -1,92 +0,0 @@ -/*! - * Connect - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , proto = require('./proto') - , utils = require('./utils') - , path = require('path') - , basename = path.basename - , fs = require('fs'); - -// node patches - -require('./patch'); - -// expose createServer() as the module - -exports = module.exports = createServer; - -/** - * Framework version. - */ - -exports.version = '2.7.11'; - -/** - * Expose mime module. - */ - -exports.mime = require('./middleware/static').mime; - -/** - * Expose the prototype. - */ - -exports.proto = proto; - -/** - * Auto-load middleware getters. - */ - -exports.middleware = {}; - -/** - * Expose utilities. - */ - -exports.utils = utils; - -/** - * Create a new connect server. - * - * @return {Function} - * @api public - */ - -function createServer() { - function app(req, res, next){ app.handle(req, res, next); } - utils.merge(app, proto); - utils.merge(app, EventEmitter.prototype); - app.route = '/'; - app.stack = []; - for (var i = 0; i < arguments.length; ++i) { - app.use(arguments[i]); - } - return app; -}; - -/** - * Support old `.createServer()` method. - */ - -createServer.createServer = createServer; - -/** - * Auto-load bundled middleware with getters. - */ - -fs.readdirSync(__dirname + '/middleware').forEach(function(filename){ - if (!/\.js$/.test(filename)) return; - var name = basename(filename, '.js'); - function load(){ return require('./middleware/' + name); } - exports.middleware.__defineGetter__(name, load); - exports.__defineGetter__(name, load); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/index.js deleted file mode 100644 index 2618ddc..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/index.js +++ /dev/null @@ -1,50 +0,0 @@ - -/** - * Connect is a middleware framework for node, - * shipping with over 18 bundled middleware and a rich selection of - * 3rd-party middleware. - * - * var app = connect() - * .use(connect.logger('dev')) - * .use(connect.static('public')) - * .use(function(req, res){ - * res.end('hello world\n'); - * }) - * .listen(3000); - * - * Installation: - * - * $ npm install connect - * - * Middleware: - * - * - [logger](logger.html) request logger with custom format support - * - [csrf](csrf.html) Cross-site request forgery protection - * - [compress](compress.html) Gzip compression middleware - * - [basicAuth](basicAuth.html) basic http authentication - * - [bodyParser](bodyParser.html) extensible request body parser - * - [json](json.html) application/json parser - * - [urlencoded](urlencoded.html) application/x-www-form-urlencoded parser - * - [multipart](multipart.html) multipart/form-data parser - * - [timeout](timeout.html) request timeouts - * - [cookieParser](cookieParser.html) cookie parser - * - [session](session.html) session management support with bundled MemoryStore - * - [cookieSession](cookieSession.html) cookie-based session support - * - [methodOverride](methodOverride.html) faux HTTP method support - * - [responseTime](responseTime.html) calculates response-time and exposes via X-Response-Time - * - [staticCache](staticCache.html) memory cache layer for the static() middleware - * - [static](static.html) streaming static file server supporting `Range` and more - * - [directory](directory.html) directory listing middleware - * - [vhost](vhost.html) virtual host sub-domain mapping middleware - * - [favicon](favicon.html) efficient favicon server (with default icon) - * - [limit](limit.html) limit the bytesize of request bodies - * - [query](query.html) automatic querystring parser, populating `req.query` - * - [errorHandler](errorHandler.html) flexible error handler - * - * Links: - * - * - list of [3rd-party](https://github.com/senchalabs/connect/wiki) middleware - * - GitHub [repository](http://github.com/senchalabs/connect) - * - [test documentation](https://github.com/senchalabs/connect/blob/gh-pages/tests.md) - * - */ \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/basicAuth.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/basicAuth.js deleted file mode 100644 index bc7ec97..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/basicAuth.js +++ /dev/null @@ -1,103 +0,0 @@ - -/*! - * Connect - basicAuth - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , unauthorized = utils.unauthorized; - -/** - * Basic Auth: - * - * Enfore basic authentication by providing a `callback(user, pass)`, - * which must return `true` in order to gain access. Alternatively an async - * method is provided as well, invoking `callback(user, pass, callback)`. Populates - * `req.user`. The final alternative is simply passing username / password - * strings. - * - * Simple username and password - * - * connect(connect.basicAuth('username', 'password')); - * - * Callback verification - * - * connect() - * .use(connect.basicAuth(function(user, pass){ - * return 'tj' == user & 'wahoo' == pass; - * })) - * - * Async callback verification, accepting `fn(err, user)`. - * - * connect() - * .use(connect.basicAuth(function(user, pass, fn){ - * User.authenticate({ user: user, pass: pass }, fn); - * })) - * - * @param {Function|String} callback or username - * @param {String} realm - * @api public - */ - -module.exports = function basicAuth(callback, realm) { - var username, password; - - // user / pass strings - if ('string' == typeof callback) { - username = callback; - password = realm; - if ('string' != typeof password) throw new Error('password argument required'); - realm = arguments[2]; - callback = function(user, pass){ - return user == username && pass == password; - } - } - - realm = realm || 'Authorization Required'; - - return function(req, res, next) { - var authorization = req.headers.authorization; - - if (req.user) return next(); - if (!authorization) return unauthorized(res, realm); - - var parts = authorization.split(' '); - - if (parts.length !== 2) return next(utils.error(400)); - - var scheme = parts[0] - , credentials = new Buffer(parts[1], 'base64').toString() - , index = credentials.indexOf(':'); - - if ('Basic' != scheme || index < 0) return next(utils.error(400)); - - var user = credentials.slice(0, index) - , pass = credentials.slice(index + 1); - - // async - if (callback.length >= 3) { - var pause = utils.pause(req); - callback(user, pass, function(err, user){ - if (err || !user) return unauthorized(res, realm); - req.user = req.remoteUser = user; - next(); - pause.resume(); - }); - // sync - } else { - if (callback(user, pass)) { - req.user = req.remoteUser = user; - next(); - } else { - unauthorized(res, realm); - } - } - } -}; - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/bodyParser.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/bodyParser.js deleted file mode 100644 index 9f692cd..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/bodyParser.js +++ /dev/null @@ -1,61 +0,0 @@ - -/*! - * Connect - bodyParser - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var multipart = require('./multipart') - , urlencoded = require('./urlencoded') - , json = require('./json'); - -/** - * Body parser: - * - * Parse request bodies, supports _application/json_, - * _application/x-www-form-urlencoded_, and _multipart/form-data_. - * - * This is equivalent to: - * - * app.use(connect.json()); - * app.use(connect.urlencoded()); - * app.use(connect.multipart()); - * - * Examples: - * - * connect() - * .use(connect.bodyParser()) - * .use(function(req, res) { - * res.end('viewing user ' + req.body.user.name); - * }); - * - * $ curl -d 'user[name]=tj' http://local/ - * $ curl -d '{"user":{"name":"tj"}}' -H "Content-Type: application/json" http://local/ - * - * View [json](json.html), [urlencoded](urlencoded.html), and [multipart](multipart.html) for more info. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function bodyParser(options){ - var _urlencoded = urlencoded(options) - , _multipart = multipart(options) - , _json = json(options); - - return function bodyParser(req, res, next) { - _json(req, res, function(err){ - if (err) return next(err); - _urlencoded(req, res, function(err){ - if (err) return next(err); - _multipart(req, res, next); - }); - }); - } -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/compress.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/compress.js deleted file mode 100644 index 97b2449..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/compress.js +++ /dev/null @@ -1,157 +0,0 @@ -/*! - * Connect - compress - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var zlib = require('zlib'); - -/** - * Supported content-encoding methods. - */ - -exports.methods = { - gzip: zlib.createGzip - , deflate: zlib.createDeflate -}; - -/** - * Default filter function. - */ - -exports.filter = function(req, res){ - return /json|text|javascript/.test(res.getHeader('Content-Type')); -}; - -/** - * Compress: - * - * Compress response data with gzip/deflate. - * - * Filter: - * - * A `filter` callback function may be passed to - * replace the default logic of: - * - * exports.filter = function(req, res){ - * return /json|text|javascript/.test(res.getHeader('Content-Type')); - * }; - * - * Options: - * - * All remaining options are passed to the gzip/deflate - * creation functions. Consult node's docs for additional details. - * - * - `chunkSize` (default: 16*1024) - * - `windowBits` - * - `level`: 0-9 where 0 is no compression, and 9 is slow but best compression - * - `memLevel`: 1-9 low is slower but uses less memory, high is fast but uses more - * - `strategy`: compression strategy - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function compress(options) { - options = options || {}; - var names = Object.keys(exports.methods) - , filter = options.filter || exports.filter; - - return function compress(req, res, next){ - var accept = req.headers['accept-encoding'] - , vary = res.getHeader('Vary') - , write = res.write - , end = res.end - , stream - , method; - - // vary - if (!vary) { - res.setHeader('Vary', 'Accept-Encoding'); - } else if (!~vary.indexOf('Accept-Encoding')) { - res.setHeader('Vary', vary + ', Accept-Encoding'); - } - - // see #724 - req.on('close', function(){ - res.write = res.end = function(){}; - }); - - // proxy - - res.write = function(chunk, encoding){ - if (!this.headerSent) this._implicitHeader(); - return stream - ? stream.write(new Buffer(chunk, encoding)) - : write.call(res, chunk, encoding); - }; - - res.end = function(chunk, encoding){ - if (chunk) this.write(chunk, encoding); - return stream - ? stream.end() - : end.call(res); - }; - - res.on('header', function(){ - var encoding = res.getHeader('Content-Encoding') || 'identity'; - - // already encoded - if ('identity' != encoding) return; - - // default request filter - if (!filter(req, res)) return; - - // SHOULD use identity - if (!accept) return; - - // head - if ('HEAD' == req.method) return; - - // default to gzip - if ('*' == accept.trim()) method = 'gzip'; - - // compression method - if (!method) { - for (var i = 0, len = names.length; i < len; ++i) { - if (~accept.indexOf(names[i])) { - method = names[i]; - break; - } - } - } - - // compression method - if (!method) return; - - // compression stream - stream = exports.methods[method](options); - - // header fields - res.setHeader('Content-Encoding', method); - res.removeHeader('Content-Length'); - - // compression - - stream.on('data', function(chunk){ - write.call(res, chunk); - }); - - stream.on('end', function(){ - end.call(res); - }); - - stream.on('drain', function() { - res.emit('drain'); - }); - }); - - next(); - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/cookieParser.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/cookieParser.js deleted file mode 100644 index 5da23f2..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/cookieParser.js +++ /dev/null @@ -1,62 +0,0 @@ - -/*! - * Connect - cookieParser - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('./../utils') - , cookie = require('cookie'); - -/** - * Cookie parser: - * - * Parse _Cookie_ header and populate `req.cookies` - * with an object keyed by the cookie names. Optionally - * you may enabled signed cookie support by passing - * a `secret` string, which assigns `req.secret` so - * it may be used by other middleware. - * - * Examples: - * - * connect() - * .use(connect.cookieParser('optional secret string')) - * .use(function(req, res, next){ - * res.end(JSON.stringify(req.cookies)); - * }) - * - * @param {String} secret - * @return {Function} - * @api public - */ - -module.exports = function cookieParser(secret){ - return function cookieParser(req, res, next) { - if (req.cookies) return next(); - var cookies = req.headers.cookie; - - req.secret = secret; - req.cookies = {}; - req.signedCookies = {}; - - if (cookies) { - try { - req.cookies = cookie.parse(cookies); - if (secret) { - req.signedCookies = utils.parseSignedCookies(req.cookies, secret); - req.signedCookies = utils.parseJSONCookies(req.signedCookies); - } - req.cookies = utils.parseJSONCookies(req.cookies); - } catch (err) { - err.status = 400; - return next(err); - } - } - next(); - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/cookieSession.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/cookieSession.js deleted file mode 100644 index 402fd55..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/cookieSession.js +++ /dev/null @@ -1,117 +0,0 @@ - -/*! - * Connect - cookieSession - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('./../utils') - , Cookie = require('./session/cookie') - , debug = require('debug')('connect:cookieSession') - , signature = require('cookie-signature') - , crc32 = require('buffer-crc32'); - -/** - * Cookie Session: - * - * Cookie session middleware. - * - * var app = connect(); - * app.use(connect.cookieParser()); - * app.use(connect.cookieSession({ secret: 'tobo!', cookie: { maxAge: 60 * 60 * 1000 }})); - * - * Options: - * - * - `key` cookie name defaulting to `connect.sess` - * - `secret` prevents cookie tampering - * - `cookie` session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: null }` - * - `proxy` trust the reverse proxy when setting secure cookies (via "x-forwarded-proto") - * - * Clearing sessions: - * - * To clear the session simply set its value to `null`, - * `cookieSession()` will then respond with a 1970 Set-Cookie. - * - * req.session = null; - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function cookieSession(options){ - // TODO: utilize Session/Cookie to unify API - options = options || {}; - var key = options.key || 'connect.sess' - , trustProxy = options.proxy; - - return function cookieSession(req, res, next) { - - // req.secret is for backwards compatibility - var secret = options.secret || req.secret; - if (!secret) throw new Error('`secret` option required for cookie sessions'); - - // default session - req.session = {}; - var cookie = req.session.cookie = new Cookie(options.cookie); - - // pathname mismatch - if (0 != req.originalUrl.indexOf(cookie.path)) return next(); - - // cookieParser secret - if (!options.secret && req.secret) { - req.session = req.signedCookies[key] || {}; - req.session.cookie = cookie; - } else { - // TODO: refactor - var rawCookie = req.cookies[key]; - if (rawCookie) { - var unsigned = utils.parseSignedCookie(rawCookie, secret); - if (unsigned) { - var originalHash = crc32.signed(unsigned); - req.session = utils.parseJSONCookie(unsigned) || {}; - req.session.cookie = cookie; - } - } - } - - res.on('header', function(){ - // removed - if (!req.session) { - debug('clear session'); - cookie.expires = new Date(0); - res.setHeader('Set-Cookie', cookie.serialize(key, '')); - return; - } - - delete req.session.cookie; - - // check security - var proto = (req.headers['x-forwarded-proto'] || '').toLowerCase() - , tls = req.connection.encrypted || (trustProxy && 'https' == proto) - , secured = cookie.secure && tls; - - // only send secure cookies via https - if (cookie.secure && !secured) return debug('not secured'); - - // serialize - debug('serializing %j', req.session); - var val = 'j:' + JSON.stringify(req.session); - - // compare hashes, no need to set-cookie if unchanged - if (originalHash == crc32.signed(val)) return debug('unmodified session'); - - // set-cookie - val = 's:' + signature.sign(val, secret); - val = cookie.serialize(key, val); - debug('set-cookie %j', cookie); - res.setHeader('Set-Cookie', val); - }); - - next(); - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/csrf.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/csrf.js deleted file mode 100644 index e3c353e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/csrf.js +++ /dev/null @@ -1,73 +0,0 @@ -/*! - * Connect - csrf - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils'); - -/** - * Anti CSRF: - * - * CRSF protection middleware. - * - * By default this middleware generates a token named "_csrf" - * which should be added to requests which mutate - * state, within a hidden form field, query-string etc. This - * token is validated against the visitor's `req.session._csrf` - * property. - * - * The default `value` function checks `req.body` generated - * by the `bodyParser()` middleware, `req.query` generated - * by `query()`, and the "X-CSRF-Token" header field. - * - * This middleware requires session support, thus should be added - * somewhere _below_ `session()` and `cookieParser()`. - * - * Options: - * - * - `value` a function accepting the request, returning the token - * - * @param {Object} options - * @api public - */ - -module.exports = function csrf(options) { - options = options || {}; - var value = options.value || defaultValue; - - return function(req, res, next){ - // generate CSRF token - var token = req.session._csrf || (req.session._csrf = utils.uid(24)); - - // ignore these methods - if ('GET' == req.method || 'HEAD' == req.method || 'OPTIONS' == req.method) return next(); - - // determine value - var val = value(req); - - // check - if (val != token) return next(utils.error(403)); - - next(); - } -}; - -/** - * Default value function, checking the `req.body` - * and `req.query` for the CSRF token. - * - * @param {IncomingMessage} req - * @return {String} - * @api private - */ - -function defaultValue(req) { - return (req.body && req.body._csrf) - || (req.query && req.query._csrf) - || (req.headers['x-csrf-token']); -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/directory.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/directory.js deleted file mode 100644 index 1c925a7..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/directory.js +++ /dev/null @@ -1,229 +0,0 @@ - -/*! - * Connect - directory - * Copyright(c) 2011 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -// TODO: icon / style for directories -// TODO: arrow key navigation -// TODO: make icons extensible - -/** - * Module dependencies. - */ - -var fs = require('fs') - , parse = require('url').parse - , utils = require('../utils') - , path = require('path') - , normalize = path.normalize - , extname = path.extname - , join = path.join; - -/*! - * Icon cache. - */ - -var cache = {}; - -/** - * Directory: - * - * Serve directory listings with the given `root` path. - * - * Options: - * - * - `hidden` display hidden (dot) files. Defaults to false. - * - `icons` display icons. Defaults to false. - * - `filter` Apply this filter function to files. Defaults to false. - * - * @param {String} root - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function directory(root, options){ - options = options || {}; - - // root required - if (!root) throw new Error('directory() root path required'); - var hidden = options.hidden - , icons = options.icons - , filter = options.filter - , root = normalize(root); - - return function directory(req, res, next) { - if ('GET' != req.method && 'HEAD' != req.method) return next(); - - var accept = req.headers.accept || 'text/plain' - , url = parse(req.url) - , dir = decodeURIComponent(url.pathname) - , path = normalize(join(root, dir)) - , originalUrl = parse(req.originalUrl) - , originalDir = decodeURIComponent(originalUrl.pathname) - , showUp = path != root && path != root + '/'; - - // null byte(s), bad request - if (~path.indexOf('\0')) return next(utils.error(400)); - - // malicious path, forbidden - if (0 != path.indexOf(root)) return next(utils.error(403)); - - // check if we have a directory - fs.stat(path, function(err, stat){ - if (err) return 'ENOENT' == err.code - ? next() - : next(err); - - if (!stat.isDirectory()) return next(); - - // fetch files - fs.readdir(path, function(err, files){ - if (err) return next(err); - if (!hidden) files = removeHidden(files); - if (filter) files = files.filter(filter); - files.sort(); - - // content-negotiation - for (var key in exports) { - if (~accept.indexOf(key) || ~accept.indexOf('*/*')) { - exports[key](req, res, files, next, originalDir, showUp, icons); - return; - } - } - - // not acceptable - next(utils.error(406)); - }); - }); - }; -}; - -/** - * Respond with text/html. - */ - -exports.html = function(req, res, files, next, dir, showUp, icons){ - fs.readFile(__dirname + '/../public/directory.html', 'utf8', function(err, str){ - if (err) return next(err); - fs.readFile(__dirname + '/../public/style.css', 'utf8', function(err, style){ - if (err) return next(err); - if (showUp) files.unshift('..'); - str = str - .replace('{style}', style) - .replace('{files}', html(files, dir, icons)) - .replace('{directory}', dir) - .replace('{linked-path}', htmlPath(dir)); - res.setHeader('Content-Type', 'text/html'); - res.setHeader('Content-Length', str.length); - res.end(str); - }); - }); -}; - -/** - * Respond with application/json. - */ - -exports.json = function(req, res, files){ - files = JSON.stringify(files); - res.setHeader('Content-Type', 'application/json'); - res.setHeader('Content-Length', files.length); - res.end(files); -}; - -/** - * Respond with text/plain. - */ - -exports.plain = function(req, res, files){ - files = files.join('\n') + '\n'; - res.setHeader('Content-Type', 'text/plain'); - res.setHeader('Content-Length', files.length); - res.end(files); -}; - -/** - * Map html `dir`, returning a linked path. - */ - -function htmlPath(dir) { - var curr = []; - return dir.split('/').map(function(part){ - curr.push(part); - return '' + part + ''; - }).join(' / '); -} - -/** - * Map html `files`, returning an html unordered list. - */ - -function html(files, dir, useIcons) { - return '
      ' + files.map(function(file){ - var icon = '' - , classes = []; - - if (useIcons && '..' != file) { - icon = icons[extname(file)] || icons.default; - icon = ''; - classes.push('icon'); - } - - return '
    • ' - + icon + file + '
    • '; - - }).join('\n') + '
    '; -} - -/** - * Load and cache the given `icon`. - * - * @param {String} icon - * @return {String} - * @api private - */ - -function load(icon) { - if (cache[icon]) return cache[icon]; - return cache[icon] = fs.readFileSync(__dirname + '/../public/icons/' + icon, 'base64'); -} - -/** - * Filter "hidden" `files`, aka files - * beginning with a `.`. - * - * @param {Array} files - * @return {Array} - * @api private - */ - -function removeHidden(files) { - return files.filter(function(file){ - return '.' != file[0]; - }); -} - -/** - * Icon map. - */ - -var icons = { - '.js': 'page_white_code_red.png' - , '.c': 'page_white_c.png' - , '.h': 'page_white_h.png' - , '.cc': 'page_white_cplusplus.png' - , '.php': 'page_white_php.png' - , '.rb': 'page_white_ruby.png' - , '.cpp': 'page_white_cplusplus.png' - , '.swf': 'page_white_flash.png' - , '.pdf': 'page_white_acrobat.png' - , 'default': 'page_white.png' -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/errorHandler.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/errorHandler.js deleted file mode 100644 index 4a84edc..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/errorHandler.js +++ /dev/null @@ -1,86 +0,0 @@ -/*! - * Connect - errorHandler - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , fs = require('fs'); - -// environment - -var env = process.env.NODE_ENV || 'development'; - -/** - * Error handler: - * - * Development error handler, providing stack traces - * and error message responses for requests accepting text, html, - * or json. - * - * Text: - * - * By default, and when _text/plain_ is accepted a simple stack trace - * or error message will be returned. - * - * JSON: - * - * When _application/json_ is accepted, connect will respond with - * an object in the form of `{ "error": error }`. - * - * HTML: - * - * When accepted connect will output a nice html stack trace. - * - * @return {Function} - * @api public - */ - -exports = module.exports = function errorHandler(){ - return function errorHandler(err, req, res, next){ - if (err.status) res.statusCode = err.status; - if (res.statusCode < 400) res.statusCode = 500; - if ('test' != env) console.error(err.stack); - var accept = req.headers.accept || ''; - // html - if (~accept.indexOf('html')) { - fs.readFile(__dirname + '/../public/style.css', 'utf8', function(e, style){ - fs.readFile(__dirname + '/../public/error.html', 'utf8', function(e, html){ - var stack = (err.stack || '') - .split('\n').slice(1) - .map(function(v){ return '
  • ' + v + '
  • '; }).join(''); - html = html - .replace('{style}', style) - .replace('{stack}', stack) - .replace('{title}', exports.title) - .replace('{statusCode}', res.statusCode) - .replace(/\{error\}/g, utils.escape(err.toString())); - res.setHeader('Content-Type', 'text/html; charset=utf-8'); - res.end(html); - }); - }); - // json - } else if (~accept.indexOf('json')) { - var error = { message: err.message, stack: err.stack }; - for (var prop in err) error[prop] = err[prop]; - var json = JSON.stringify({ error: error }); - res.setHeader('Content-Type', 'application/json'); - res.end(json); - // plain text - } else { - res.writeHead(res.statusCode, { 'Content-Type': 'text/plain' }); - res.end(err.stack); - } - }; -}; - -/** - * Template title, framework authors may override this value. - */ - -exports.title = 'Connect'; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/favicon.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/favicon.js deleted file mode 100644 index ef54354..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/favicon.js +++ /dev/null @@ -1,80 +0,0 @@ -/*! - * Connect - favicon - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , utils = require('../utils'); - -/** - * Favicon: - * - * By default serves the connect favicon, or the favicon - * located by the given `path`. - * - * Options: - * - * - `maxAge` cache-control max-age directive, defaulting to 1 day - * - * Examples: - * - * Serve default favicon: - * - * connect() - * .use(connect.favicon()) - * - * Serve favicon before logging for brevity: - * - * connect() - * .use(connect.favicon()) - * .use(connect.logger('dev')) - * - * Serve custom favicon: - * - * connect() - * .use(connect.favicon('public/favicon.ico')) - * - * @param {String} path - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function favicon(path, options){ - var options = options || {} - , path = path || __dirname + '/../public/favicon.ico' - , maxAge = options.maxAge || 86400000 - , icon; // favicon cache - - return function favicon(req, res, next){ - if ('/favicon.ico' == req.url) { - if (icon) { - res.writeHead(200, icon.headers); - res.end(icon.body); - } else { - fs.readFile(path, function(err, buf){ - if (err) return next(err); - icon = { - headers: { - 'Content-Type': 'image/x-icon' - , 'Content-Length': buf.length - , 'ETag': '"' + utils.md5(buf) + '"' - , 'Cache-Control': 'public, max-age=' + (maxAge / 1000) - }, - body: buf - }; - res.writeHead(200, icon.headers); - res.end(icon.body); - }); - } - } else { - next(); - } - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/json.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/json.js deleted file mode 100644 index 17e5918..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/json.js +++ /dev/null @@ -1,86 +0,0 @@ - -/*! - * Connect - json - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , _limit = require('./limit'); - -/** - * noop middleware. - */ - -function noop(req, res, next) { - next(); -} - -/** - * JSON: - * - * Parse JSON request bodies, providing the - * parsed object as `req.body`. - * - * Options: - * - * - `strict` when `false` anything `JSON.parse()` accepts will be parsed - * - `reviver` used as the second "reviver" argument for JSON.parse - * - `limit` byte limit disabled by default - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function(options){ - var options = options || {} - , strict = options.strict !== false; - - var limit = options.limit - ? _limit(options.limit) - : noop; - - return function json(req, res, next) { - if (req._body) return next(); - req.body = req.body || {}; - - if (!utils.hasBody(req)) return next(); - - // check Content-Type - if ('application/json' != utils.mime(req)) return next(); - - // flag as parsed - req._body = true; - - // parse - limit(req, res, function(err){ - if (err) return next(err); - var buf = ''; - req.setEncoding('utf8'); - req.on('data', function(chunk){ buf += chunk }); - req.on('end', function(){ - var first = buf.trim()[0]; - - if (0 == buf.length) { - return next(utils.error(400, 'invalid json, empty body')); - } - - if (strict && '{' != first && '[' != first) return next(utils.error(400, 'invalid json')); - try { - req.body = JSON.parse(buf, options.reviver); - } catch (err){ - err.body = buf; - err.status = 400; - return next(err); - } - next(); - }); - }); - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/limit.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/limit.js deleted file mode 100644 index 09bd1c4..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/limit.js +++ /dev/null @@ -1,78 +0,0 @@ - -/*! - * Connect - limit - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils'), - brokenPause = utils.brokenPause; - -/** - * Limit: - * - * Limit request bodies to the given size in `bytes`. - * - * A string representation of the bytesize may also be passed, - * for example "5mb", "200kb", "1gb", etc. - * - * connect() - * .use(connect.limit('5.5mb')) - * .use(handleImageUpload) - * - * @param {Number|String} bytes - * @return {Function} - * @api public - */ - -module.exports = function limit(bytes){ - if ('string' == typeof bytes) bytes = utils.parseBytes(bytes); - if ('number' != typeof bytes) throw new Error('limit() bytes required'); - return function limit(req, res, next){ - var received = 0 - , len = req.headers['content-length'] - ? parseInt(req.headers['content-length'], 10) - : null; - - // self-awareness - if (req._limit) return next(); - req._limit = true; - - // limit by content-length - if (len && len > bytes) return next(utils.error(413)); - - // limit - if (brokenPause) { - listen(); - } else { - req.on('newListener', function handler(event) { - if (event !== 'data') return; - - req.removeListener('newListener', handler); - // Start listening at the end of the current loop - // otherwise the request will be consumed too early. - // Sideaffect is `limit` will miss the first chunk, - // but that's not a big deal. - // Unfortunately, the tests don't have large enough - // request bodies to test this. - process.nextTick(listen); - }); - }; - - next(); - - function listen() { - req.on('data', function(chunk) { - received += Buffer.isBuffer(chunk) - ? chunk.length : - Buffer.byteLength(chunk); - - if (received > bytes) req.destroy(); - }); - }; - }; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/logger.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/logger.js deleted file mode 100644 index de72244..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/logger.js +++ /dev/null @@ -1,339 +0,0 @@ -/*! - * Connect - logger - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var bytes = require('bytes'); - -/*! - * Log buffer. - */ - -var buf = []; - -/*! - * Default log buffer duration. - */ - -var defaultBufferDuration = 1000; - -/** - * Logger: - * - * Log requests with the given `options` or a `format` string. - * - * Options: - * - * - `format` Format string, see below for tokens - * - `stream` Output stream, defaults to _stdout_ - * - `buffer` Buffer duration, defaults to 1000ms when _true_ - * - `immediate` Write log line on request instead of response (for response times) - * - * Tokens: - * - * - `:req[header]` ex: `:req[Accept]` - * - `:res[header]` ex: `:res[Content-Length]` - * - `:http-version` - * - `:response-time` - * - `:remote-addr` - * - `:date` - * - `:method` - * - `:url` - * - `:referrer` - * - `:user-agent` - * - `:status` - * - * Formats: - * - * Pre-defined formats that ship with connect: - * - * - `default` ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"' - * - `short` ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms' - * - `tiny` ':method :url :status :res[content-length] - :response-time ms' - * - `dev` concise output colored by response status for development use - * - * Examples: - * - * connect.logger() // default - * connect.logger('short') - * connect.logger('tiny') - * connect.logger({ immediate: true, format: 'dev' }) - * connect.logger(':method :url - :referrer') - * connect.logger(':req[content-type] -> :res[content-type]') - * connect.logger(function(tokens, req, res){ return 'some format string' }) - * - * Defining Tokens: - * - * To define a token, simply invoke `connect.logger.token()` with the - * name and a callback function. The value returned is then available - * as ":type" in this case. - * - * connect.logger.token('type', function(req, res){ return req.headers['content-type']; }) - * - * Defining Formats: - * - * All default formats are defined this way, however it's public API as well: - * - * connect.logger.format('name', 'string or function') - * - * @param {String|Function|Object} format or options - * @return {Function} - * @api public - */ - -exports = module.exports = function logger(options) { - if ('object' == typeof options) { - options = options || {}; - } else if (options) { - options = { format: options }; - } else { - options = {}; - } - - // output on request instead of response - var immediate = options.immediate; - - // format name - var fmt = exports[options.format] || options.format || exports.default; - - // compile format - if ('function' != typeof fmt) fmt = compile(fmt); - - // options - var stream = options.stream || process.stdout - , buffer = options.buffer; - - // buffering support - if (buffer) { - var realStream = stream - , interval = 'number' == typeof buffer - ? buffer - : defaultBufferDuration; - - // flush interval - setInterval(function(){ - if (buf.length) { - realStream.write(buf.join('')); - buf.length = 0; - } - }, interval); - - // swap the stream - stream = { - write: function(str){ - buf.push(str); - } - }; - } - - return function logger(req, res, next) { - req._startTime = new Date; - - // immediate - if (immediate) { - var line = fmt(exports, req, res); - if (null == line) return; - stream.write(line + '\n'); - // proxy end to output logging - } else { - var end = res.end; - res.end = function(chunk, encoding){ - res.end = end; - res.end(chunk, encoding); - var line = fmt(exports, req, res); - if (null == line) return; - stream.write(line + '\n'); - }; - } - - - next(); - }; -}; - -/** - * Compile `fmt` into a function. - * - * @param {String} fmt - * @return {Function} - * @api private - */ - -function compile(fmt) { - fmt = fmt.replace(/"/g, '\\"'); - var js = ' return "' + fmt.replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g, function(_, name, arg){ - return '"\n + (tokens["' + name + '"](req, res, "' + arg + '") || "-") + "'; - }) + '";' - return new Function('tokens, req, res', js); -}; - -/** - * Define a token function with the given `name`, - * and callback `fn(req, res)`. - * - * @param {String} name - * @param {Function} fn - * @return {Object} exports for chaining - * @api public - */ - -exports.token = function(name, fn) { - exports[name] = fn; - return this; -}; - -/** - * Define a `fmt` with the given `name`. - * - * @param {String} name - * @param {String|Function} fmt - * @return {Object} exports for chaining - * @api public - */ - -exports.format = function(name, str){ - exports[name] = str; - return this; -}; - -/** - * Default format. - */ - -exports.format('default', ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'); - -/** - * Short format. - */ - -exports.format('short', ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms'); - -/** - * Tiny format. - */ - -exports.format('tiny', ':method :url :status :res[content-length] - :response-time ms'); - -/** - * dev (colored) - */ - -exports.format('dev', function(tokens, req, res){ - var status = res.statusCode - , len = parseInt(res.getHeader('Content-Length'), 10) - , color = 32; - - if (status >= 500) color = 31 - else if (status >= 400) color = 33 - else if (status >= 300) color = 36; - - len = isNaN(len) - ? '' - : len = ' - ' + bytes(len); - - return '\033[90m' + req.method - + ' ' + req.originalUrl + ' ' - + '\033[' + color + 'm' + res.statusCode - + ' \033[90m' - + (new Date - req._startTime) - + 'ms' + len - + '\033[0m'; -}); - -/** - * request url - */ - -exports.token('url', function(req){ - return req.originalUrl || req.url; -}); - -/** - * request method - */ - -exports.token('method', function(req){ - return req.method; -}); - -/** - * response time in milliseconds - */ - -exports.token('response-time', function(req){ - return new Date - req._startTime; -}); - -/** - * UTC date - */ - -exports.token('date', function(){ - return new Date().toUTCString(); -}); - -/** - * response status code - */ - -exports.token('status', function(req, res){ - return res.statusCode; -}); - -/** - * normalized referrer - */ - -exports.token('referrer', function(req){ - return req.headers['referer'] || req.headers['referrer']; -}); - -/** - * remote address - */ - -exports.token('remote-addr', function(req){ - if (req.ip) return req.ip; - var sock = req.socket; - if (sock.socket) return sock.socket.remoteAddress; - return sock.remoteAddress; -}); - -/** - * HTTP version - */ - -exports.token('http-version', function(req){ - return req.httpVersionMajor + '.' + req.httpVersionMinor; -}); - -/** - * UA string - */ - -exports.token('user-agent', function(req){ - return req.headers['user-agent']; -}); - -/** - * request header - */ - -exports.token('req', function(req, res, field){ - return req.headers[field.toLowerCase()]; -}); - -/** - * response header - */ - -exports.token('res', function(req, res, field){ - return (res._headers || {})[field.toLowerCase()]; -}); - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/methodOverride.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/methodOverride.js deleted file mode 100644 index aaf4014..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/methodOverride.js +++ /dev/null @@ -1,40 +0,0 @@ - -/*! - * Connect - methodOverride - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Method Override: - * - * Provides faux HTTP method support. - * - * Pass an optional `key` to use when checking for - * a method override, othewise defaults to _\_method_. - * The original method is available via `req.originalMethod`. - * - * @param {String} key - * @return {Function} - * @api public - */ - -module.exports = function methodOverride(key){ - key = key || "_method"; - return function methodOverride(req, res, next) { - req.originalMethod = req.originalMethod || req.method; - - // req.body - if (req.body && key in req.body) { - req.method = req.body[key].toUpperCase(); - delete req.body[key]; - // check X-HTTP-Method-Override - } else if (req.headers['x-http-method-override']) { - req.method = req.headers['x-http-method-override'].toUpperCase(); - } - - next(); - }; -}; - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/multipart.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/multipart.js deleted file mode 100644 index 7b26fae..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/multipart.js +++ /dev/null @@ -1,133 +0,0 @@ -/*! - * Connect - multipart - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var formidable = require('formidable') - , _limit = require('./limit') - , utils = require('../utils') - , qs = require('qs'); - -/** - * noop middleware. - */ - -function noop(req, res, next) { - next(); -} - -/** - * Multipart: - * - * Parse multipart/form-data request bodies, - * providing the parsed object as `req.body` - * and `req.files`. - * - * Configuration: - * - * The options passed are merged with [formidable](https://github.com/felixge/node-formidable)'s - * `IncomingForm` object, allowing you to configure the upload directory, - * size limits, etc. For example if you wish to change the upload dir do the following. - * - * app.use(connect.multipart({ uploadDir: path })); - * - * Options: - * - * - `limit` byte limit defaulting to none - * - `defer` defers processing and exposes the Formidable form object as `req.form`. - * `next()` is called without waiting for the form's "end" event. - * This option is useful if you need to bind to the "progress" event, for example. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function(options){ - options = options || {}; - - var limit = options.limit - ? _limit(options.limit) - : noop; - - return function multipart(req, res, next) { - if (req._body) return next(); - req.body = req.body || {}; - req.files = req.files || {}; - - if (!utils.hasBody(req)) return next(); - - // ignore GET - if ('GET' == req.method || 'HEAD' == req.method) return next(); - - // check Content-Type - if ('multipart/form-data' != utils.mime(req)) return next(); - - // flag as parsed - req._body = true; - - // parse - limit(req, res, function(err){ - if (err) return next(err); - - var form = new formidable.IncomingForm - , data = {} - , files = {} - , done; - - Object.keys(options).forEach(function(key){ - form[key] = options[key]; - }); - - function ondata(name, val, data){ - if (Array.isArray(data[name])) { - data[name].push(val); - } else if (data[name]) { - data[name] = [data[name], val]; - } else { - data[name] = val; - } - } - - form.on('field', function(name, val){ - ondata(name, val, data); - }); - - form.on('file', function(name, val){ - ondata(name, val, files); - }); - - form.on('error', function(err){ - if (!options.defer) { - err.status = 400; - next(err); - } - done = true; - }); - - form.on('end', function(){ - if (done) return; - try { - req.body = qs.parse(data); - req.files = qs.parse(files); - if (!options.defer) next(); - } catch (err) { - form.emit('error', err); - } - }); - - form.parse(req); - - if (options.defer) { - req.form = form; - next(); - } - }); - } -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/query.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/query.js deleted file mode 100644 index 93fc5d3..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/query.js +++ /dev/null @@ -1,46 +0,0 @@ -/*! - * Connect - query - * Copyright(c) 2011 TJ Holowaychuk - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var qs = require('qs') - , parse = require('../utils').parseUrl; - -/** - * Query: - * - * Automatically parse the query-string when available, - * populating the `req.query` object. - * - * Examples: - * - * connect() - * .use(connect.query()) - * .use(function(req, res){ - * res.end(JSON.stringify(req.query)); - * }); - * - * The `options` passed are provided to qs.parse function. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function query(options){ - return function query(req, res, next){ - if (!req.query) { - req.query = ~req.url.indexOf('?') - ? qs.parse(parse(req).query, options) - : {}; - } - - next(); - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/responseTime.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/responseTime.js deleted file mode 100644 index 62abc04..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/responseTime.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Connect - responseTime - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Reponse time: - * - * Adds the `X-Response-Time` header displaying the response - * duration in milliseconds. - * - * @return {Function} - * @api public - */ - -module.exports = function responseTime(){ - return function(req, res, next){ - var start = new Date; - - if (res._responseTime) return next(); - res._responseTime = true; - - res.on('header', function(){ - var duration = new Date - start; - res.setHeader('X-Response-Time', duration + 'ms'); - }); - - next(); - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session.js deleted file mode 100644 index 9be6c8b..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session.js +++ /dev/null @@ -1,356 +0,0 @@ - -/*! - * Connect - session - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Session = require('./session/session') - , debug = require('debug')('connect:session') - , MemoryStore = require('./session/memory') - , signature = require('cookie-signature') - , Cookie = require('./session/cookie') - , Store = require('./session/store') - , utils = require('./../utils') - , parse = utils.parseUrl - , crc32 = require('buffer-crc32'); - -// environment - -var env = process.env.NODE_ENV; - -/** - * Expose the middleware. - */ - -exports = module.exports = session; - -/** - * Expose constructors. - */ - -exports.Store = Store; -exports.Cookie = Cookie; -exports.Session = Session; -exports.MemoryStore = MemoryStore; - -/** - * Warning message for `MemoryStore` usage in production. - */ - -var warning = 'Warning: connection.session() MemoryStore is not\n' - + 'designed for a production environment, as it will leak\n' - + 'memory, and will not scale past a single process.'; - -/** - * Session: - * - * Setup session store with the given `options`. - * - * Session data is _not_ saved in the cookie itself, however - * cookies are used, so we must use the [cookieParser()](cookieParser.html) - * middleware _before_ `session()`. - * - * Examples: - * - * connect() - * .use(connect.cookieParser()) - * .use(connect.session({ secret: 'keyboard cat', key: 'sid', cookie: { secure: true }})) - * - * Options: - * - * - `key` cookie name defaulting to `connect.sid` - * - `store` session store instance - * - `secret` session cookie is signed with this secret to prevent tampering - * - `cookie` session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: null }` - * - `proxy` trust the reverse proxy when setting secure cookies (via "x-forwarded-proto") - * - * Cookie option: - * - * By default `cookie.maxAge` is `null`, meaning no "expires" parameter is set - * so the cookie becomes a browser-session cookie. When the user closes the - * browser the cookie (and session) will be removed. - * - * ## req.session - * - * To store or access session data, simply use the request property `req.session`, - * which is (generally) serialized as JSON by the store, so nested objects - * are typically fine. For example below is a user-specific view counter: - * - * connect() - * .use(connect.favicon()) - * .use(connect.cookieParser()) - * .use(connect.session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }})) - * .use(function(req, res, next){ - * var sess = req.session; - * if (sess.views) { - * res.setHeader('Content-Type', 'text/html'); - * res.write('

    views: ' + sess.views + '

    '); - * res.write('

    expires in: ' + (sess.cookie.maxAge / 1000) + 's

    '); - * res.end(); - * sess.views++; - * } else { - * sess.views = 1; - * res.end('welcome to the session demo. refresh!'); - * } - * } - * )).listen(3000); - * - * ## Session#regenerate() - * - * To regenerate the session simply invoke the method, once complete - * a new SID and `Session` instance will be initialized at `req.session`. - * - * req.session.regenerate(function(err){ - * // will have a new session here - * }); - * - * ## Session#destroy() - * - * Destroys the session, removing `req.session`, will be re-generated next request. - * - * req.session.destroy(function(err){ - * // cannot access session here - * }); - * - * ## Session#reload() - * - * Reloads the session data. - * - * req.session.reload(function(err){ - * // session updated - * }); - * - * ## Session#save() - * - * Save the session. - * - * req.session.save(function(err){ - * // session saved - * }); - * - * ## Session#touch() - * - * Updates the `.maxAge` property. Typically this is - * not necessary to call, as the session middleware does this for you. - * - * ## Session#cookie - * - * Each session has a unique cookie object accompany it. This allows - * you to alter the session cookie per visitor. For example we can - * set `req.session.cookie.expires` to `false` to enable the cookie - * to remain for only the duration of the user-agent. - * - * ## Session#maxAge - * - * Alternatively `req.session.cookie.maxAge` will return the time - * remaining in milliseconds, which we may also re-assign a new value - * to adjust the `.expires` property appropriately. The following - * are essentially equivalent - * - * var hour = 3600000; - * req.session.cookie.expires = new Date(Date.now() + hour); - * req.session.cookie.maxAge = hour; - * - * For example when `maxAge` is set to `60000` (one minute), and 30 seconds - * has elapsed it will return `30000` until the current request has completed, - * at which time `req.session.touch()` is called to reset `req.session.maxAge` - * to its original value. - * - * req.session.cookie.maxAge; - * // => 30000 - * - * Session Store Implementation: - * - * Every session store _must_ implement the following methods - * - * - `.get(sid, callback)` - * - `.set(sid, session, callback)` - * - `.destroy(sid, callback)` - * - * Recommended methods include, but are not limited to: - * - * - `.length(callback)` - * - `.clear(callback)` - * - * For an example implementation view the [connect-redis](http://github.com/visionmedia/connect-redis) repo. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -function session(options){ - var options = options || {} - , key = options.key || 'connect.sid' - , store = options.store || new MemoryStore - , cookie = options.cookie || {} - , trustProxy = options.proxy - , storeReady = true; - - // notify user that this store is not - // meant for a production environment - if ('production' == env && store instanceof MemoryStore) { - console.warn(warning); - } - - // generates the new session - store.generate = function(req){ - req.sessionID = utils.uid(24); - req.session = new Session(req); - req.session.cookie = new Cookie(cookie); - }; - - store.on('disconnect', function(){ storeReady = false; }); - store.on('connect', function(){ storeReady = true; }); - - return function session(req, res, next) { - // self-awareness - if (req.session) return next(); - - // Handle connection as if there is no session if - // the store has temporarily disconnected etc - if (!storeReady) return debug('store is disconnected'), next(); - - // pathname mismatch - if (0 != req.originalUrl.indexOf(cookie.path || '/')) return next(); - - // backwards compatibility for signed cookies - // req.secret is passed from the cookie parser middleware - var secret = options.secret || req.secret; - - // ensure secret is available or bail - if (!secret) throw new Error('`secret` option required for sessions'); - - // parse url - var originalHash - , originalId; - - // expose store - req.sessionStore = store; - - // grab the session cookie value and check the signature - var rawCookie = req.cookies[key]; - - // get signedCookies for backwards compat with signed cookies - var unsignedCookie = req.signedCookies[key]; - - if (!unsignedCookie && rawCookie) { - unsignedCookie = utils.parseSignedCookie(rawCookie, secret); - } - - // set-cookie - res.on('header', function(){ - if (!req.session) return; - var cookie = req.session.cookie - , proto = (req.headers['x-forwarded-proto'] || '').split(',')[0].toLowerCase().trim() - , tls = req.connection.encrypted || (trustProxy && 'https' == proto) - , secured = cookie.secure && tls - , isNew = unsignedCookie != req.sessionID; - - // only send secure cookies via https - if (cookie.secure && !secured) return debug('not secured'); - - // long expires, handle expiry server-side - if (!isNew && cookie.hasLongExpires) return debug('already set cookie'); - - // browser-session length cookie - if (null == cookie.expires) { - if (!isNew) return debug('already set browser-session cookie'); - // compare hashes and ids - } else if (originalHash == hash(req.session) && originalId == req.session.id) { - return debug('unmodified session'); - } - - var val = 's:' + signature.sign(req.sessionID, secret); - val = cookie.serialize(key, val); - debug('set-cookie %s', val); - res.setHeader('Set-Cookie', val); - }); - - // proxy end() to commit the session - var end = res.end; - res.end = function(data, encoding){ - res.end = end; - if (!req.session) return res.end(data, encoding); - debug('saving'); - req.session.resetMaxAge(); - req.session.save(function(err){ - if (err) console.error(err.stack); - debug('saved'); - res.end(data, encoding); - }); - }; - - // generate the session - function generate() { - store.generate(req); - } - - // get the sessionID from the cookie - req.sessionID = unsignedCookie; - - // generate a session if the browser doesn't send a sessionID - if (!req.sessionID) { - debug('no SID sent, generating session'); - generate(); - next(); - return; - } - - // generate the session object - var pause = utils.pause(req); - debug('fetching %s', req.sessionID); - store.get(req.sessionID, function(err, sess){ - // proxy to resume() events - var _next = next; - next = function(err){ - _next(err); - pause.resume(); - }; - - // error handling - if (err) { - debug('error %j', err); - if ('ENOENT' == err.code) { - generate(); - next(); - } else { - next(err); - } - // no session - } else if (!sess) { - debug('no session found'); - generate(); - next(); - // populate req.session - } else { - debug('session found'); - store.createSession(req, sess); - originalId = req.sessionID; - originalHash = hash(sess); - next(); - } - }); - }; -}; - -/** - * Hash the given `sess` object omitting changes - * to `.cookie`. - * - * @param {Object} sess - * @return {String} - * @api private - */ - -function hash(sess) { - return crc32.signed(JSON.stringify(sess, function(key, val){ - if ('cookie' != key) return val; - })); -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/cookie.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/cookie.js deleted file mode 100644 index cdce2a5..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/cookie.js +++ /dev/null @@ -1,140 +0,0 @@ - -/*! - * Connect - session - Cookie - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../../utils') - , cookie = require('cookie'); - -/** - * Initialize a new `Cookie` with the given `options`. - * - * @param {IncomingMessage} req - * @param {Object} options - * @api private - */ - -var Cookie = module.exports = function Cookie(options) { - this.path = '/'; - this.maxAge = null; - this.httpOnly = true; - if (options) utils.merge(this, options); - this.originalMaxAge = undefined == this.originalMaxAge - ? this.maxAge - : this.originalMaxAge; -}; - -/*! - * Prototype. - */ - -Cookie.prototype = { - - /** - * Set expires `date`. - * - * @param {Date} date - * @api public - */ - - set expires(date) { - this._expires = date; - this.originalMaxAge = this.maxAge; - }, - - /** - * Get expires `date`. - * - * @return {Date} - * @api public - */ - - get expires() { - return this._expires; - }, - - /** - * Set expires via max-age in `ms`. - * - * @param {Number} ms - * @api public - */ - - set maxAge(ms) { - this.expires = 'number' == typeof ms - ? new Date(Date.now() + ms) - : ms; - }, - - /** - * Get expires max-age in `ms`. - * - * @return {Number} - * @api public - */ - - get maxAge() { - return this.expires instanceof Date - ? this.expires.valueOf() - Date.now() - : this.expires; - }, - - /** - * Return cookie data object. - * - * @return {Object} - * @api private - */ - - get data() { - return { - originalMaxAge: this.originalMaxAge - , expires: this._expires - , secure: this.secure - , httpOnly: this.httpOnly - , domain: this.domain - , path: this.path - } - }, - - /** - * Check if the cookie has a reasonably large max-age. - * - * @return {Boolean} - * @api private - */ - - get hasLongExpires() { - var week = 604800000; - return this.maxAge > (4 * week); - }, - - /** - * Return a serialized cookie string. - * - * @return {String} - * @api public - */ - - serialize: function(name, val){ - return cookie.serialize(name, val, this.data); - }, - - /** - * Return JSON representation of this cookie. - * - * @return {Object} - * @api private - */ - - toJSON: function(){ - return this.data; - } -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/memory.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/memory.js deleted file mode 100644 index fb93939..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/memory.js +++ /dev/null @@ -1,129 +0,0 @@ - -/*! - * Connect - session - MemoryStore - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Store = require('./store'); - -/** - * Initialize a new `MemoryStore`. - * - * @api public - */ - -var MemoryStore = module.exports = function MemoryStore() { - this.sessions = {}; -}; - -/** - * Inherit from `Store.prototype`. - */ - -MemoryStore.prototype.__proto__ = Store.prototype; - -/** - * Attempt to fetch session by the given `sid`. - * - * @param {String} sid - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.get = function(sid, fn){ - var self = this; - process.nextTick(function(){ - var expires - , sess = self.sessions[sid]; - if (sess) { - sess = JSON.parse(sess); - expires = 'string' == typeof sess.cookie.expires - ? new Date(sess.cookie.expires) - : sess.cookie.expires; - if (!expires || new Date < expires) { - fn(null, sess); - } else { - self.destroy(sid, fn); - } - } else { - fn(); - } - }); -}; - -/** - * Commit the given `sess` object associated with the given `sid`. - * - * @param {String} sid - * @param {Session} sess - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.set = function(sid, sess, fn){ - var self = this; - process.nextTick(function(){ - self.sessions[sid] = JSON.stringify(sess); - fn && fn(); - }); -}; - -/** - * Destroy the session associated with the given `sid`. - * - * @param {String} sid - * @api public - */ - -MemoryStore.prototype.destroy = function(sid, fn){ - var self = this; - process.nextTick(function(){ - delete self.sessions[sid]; - fn && fn(); - }); -}; - -/** - * Invoke the given callback `fn` with all active sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.all = function(fn){ - var arr = [] - , keys = Object.keys(this.sessions); - for (var i = 0, len = keys.length; i < len; ++i) { - arr.push(this.sessions[keys[i]]); - } - fn(null, arr); -}; - -/** - * Clear all sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.clear = function(fn){ - this.sessions = {}; - fn && fn(); -}; - -/** - * Fetch number of sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.length = function(fn){ - fn(null, Object.keys(this.sessions).length); -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/session.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/session.js deleted file mode 100644 index 0dd4b40..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/session.js +++ /dev/null @@ -1,116 +0,0 @@ - -/*! - * Connect - session - Session - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../../utils'); - -/** - * Create a new `Session` with the given request and `data`. - * - * @param {IncomingRequest} req - * @param {Object} data - * @api private - */ - -var Session = module.exports = function Session(req, data) { - Object.defineProperty(this, 'req', { value: req }); - Object.defineProperty(this, 'id', { value: req.sessionID }); - if ('object' == typeof data) utils.merge(this, data); -}; - -/** - * Update reset `.cookie.maxAge` to prevent - * the cookie from expiring when the - * session is still active. - * - * @return {Session} for chaining - * @api public - */ - -Session.prototype.touch = function(){ - return this.resetMaxAge(); -}; - -/** - * Reset `.maxAge` to `.originalMaxAge`. - * - * @return {Session} for chaining - * @api public - */ - -Session.prototype.resetMaxAge = function(){ - this.cookie.maxAge = this.cookie.originalMaxAge; - return this; -}; - -/** - * Save the session data with optional callback `fn(err)`. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.save = function(fn){ - this.req.sessionStore.set(this.id, this, fn || function(){}); - return this; -}; - -/** - * Re-loads the session data _without_ altering - * the maxAge properties. Invokes the callback `fn(err)`, - * after which time if no exception has occurred the - * `req.session` property will be a new `Session` object, - * although representing the same session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.reload = function(fn){ - var req = this.req - , store = this.req.sessionStore; - store.get(this.id, function(err, sess){ - if (err) return fn(err); - if (!sess) return fn(new Error('failed to load session')); - store.createSession(req, sess); - fn(); - }); - return this; -}; - -/** - * Destroy `this` session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.destroy = function(fn){ - delete this.req.session; - this.req.sessionStore.destroy(this.id, fn); - return this; -}; - -/** - * Regenerate this request's session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.regenerate = function(fn){ - this.req.sessionStore.regenerate(this.req, fn); - return this; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/store.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/store.js deleted file mode 100644 index 54294cb..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/session/store.js +++ /dev/null @@ -1,84 +0,0 @@ - -/*! - * Connect - session - Store - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , Session = require('./session') - , Cookie = require('./cookie'); - -/** - * Initialize abstract `Store`. - * - * @api private - */ - -var Store = module.exports = function Store(options){}; - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Store.prototype.__proto__ = EventEmitter.prototype; - -/** - * Re-generate the given requests's session. - * - * @param {IncomingRequest} req - * @return {Function} fn - * @api public - */ - -Store.prototype.regenerate = function(req, fn){ - var self = this; - this.destroy(req.sessionID, function(err){ - self.generate(req); - fn(err); - }); -}; - -/** - * Load a `Session` instance via the given `sid` - * and invoke the callback `fn(err, sess)`. - * - * @param {String} sid - * @param {Function} fn - * @api public - */ - -Store.prototype.load = function(sid, fn){ - var self = this; - this.get(sid, function(err, sess){ - if (err) return fn(err); - if (!sess) return fn(); - var req = { sessionID: sid, sessionStore: self }; - sess = self.createSession(req, sess); - fn(null, sess); - }); -}; - -/** - * Create session from JSON `sess` data. - * - * @param {IncomingRequest} req - * @param {Object} sess - * @return {Session} - * @api private - */ - -Store.prototype.createSession = function(req, sess){ - var expires = sess.cookie.expires - , orig = sess.cookie.originalMaxAge; - sess.cookie = new Cookie(sess.cookie); - if ('string' == typeof expires) sess.cookie.expires = new Date(expires); - sess.cookie.originalMaxAge = orig; - req.session = new Session(req, sess); - return req.session; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/static.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/static.js deleted file mode 100644 index 093e73f..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/static.js +++ /dev/null @@ -1,95 +0,0 @@ -/*! - * Connect - static - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var send = require('send') - , utils = require('../utils') - , parse = utils.parseUrl - , url = require('url'); - -/** - * Static: - * - * Static file server with the given `root` path. - * - * Examples: - * - * var oneDay = 86400000; - * - * connect() - * .use(connect.static(__dirname + '/public')) - * - * connect() - * .use(connect.static(__dirname + '/public', { maxAge: oneDay })) - * - * Options: - * - * - `maxAge` Browser cache maxAge in milliseconds. defaults to 0 - * - `hidden` Allow transfer of hidden files. defaults to false - * - `redirect` Redirect to trailing "/" when the pathname is a dir. defaults to true - * - `index` Default file name, defaults to 'index.html' - * - * @param {String} root - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function(root, options){ - options = options || {}; - - // root required - if (!root) throw new Error('static() root path required'); - - // default redirect - var redirect = false !== options.redirect; - - return function static(req, res, next) { - if ('GET' != req.method && 'HEAD' != req.method) return next(); - var path = parse(req).pathname; - var pause = utils.pause(req); - - function resume() { - next(); - pause.resume(); - } - - function directory() { - if (!redirect) return resume(); - var pathname = url.parse(req.originalUrl).pathname; - res.statusCode = 301; - res.setHeader('Location', pathname + '/'); - res.end('Redirecting to ' + utils.escape(pathname) + '/'); - } - - function error(err) { - if (404 == err.status) return resume(); - next(err); - } - - send(req, path) - .maxage(options.maxAge || 0) - .root(root) - .index(options.index || 'index.html') - .hidden(options.hidden) - .on('error', error) - .on('directory', directory) - .pipe(res); - }; -}; - -/** - * Expose mime module. - * - * If you wish to extend the mime table use this - * reference to the "mime" module in the npm registry. - */ - -exports.mime = send.mime; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/staticCache.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/staticCache.js deleted file mode 100644 index 7354a8f..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/staticCache.js +++ /dev/null @@ -1,231 +0,0 @@ - -/*! - * Connect - staticCache - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , Cache = require('../cache') - , fresh = require('fresh'); - -/** - * Static cache: - * - * Enables a memory cache layer on top of - * the `static()` middleware, serving popular - * static files. - * - * By default a maximum of 128 objects are - * held in cache, with a max of 256k each, - * totalling ~32mb. - * - * A Least-Recently-Used (LRU) cache algo - * is implemented through the `Cache` object, - * simply rotating cache objects as they are - * hit. This means that increasingly popular - * objects maintain their positions while - * others get shoved out of the stack and - * garbage collected. - * - * Benchmarks: - * - * static(): 2700 rps - * node-static: 5300 rps - * static() + staticCache(): 7500 rps - * - * Options: - * - * - `maxObjects` max cache objects [128] - * - `maxLength` max cache object length 256kb - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function staticCache(options){ - var options = options || {} - , cache = new Cache(options.maxObjects || 128) - , maxlen = options.maxLength || 1024 * 256; - - console.warn('connect.staticCache() is deprecated and will be removed in 3.0'); - console.warn('use varnish or similar reverse proxy caches.'); - - return function staticCache(req, res, next){ - var key = cacheKey(req) - , ranges = req.headers.range - , hasCookies = req.headers.cookie - , hit = cache.get(key); - - // cache static - // TODO: change from staticCache() -> cache() - // and make this work for any request - req.on('static', function(stream){ - var headers = res._headers - , cc = utils.parseCacheControl(headers['cache-control'] || '') - , contentLength = headers['content-length'] - , hit; - - // dont cache set-cookie responses - if (headers['set-cookie']) return hasCookies = true; - - // dont cache when cookies are present - if (hasCookies) return; - - // ignore larger files - if (!contentLength || contentLength > maxlen) return; - - // don't cache partial files - if (headers['content-range']) return; - - // dont cache items we shouldn't be - // TODO: real support for must-revalidate / no-cache - if ( cc['no-cache'] - || cc['no-store'] - || cc['private'] - || cc['must-revalidate']) return; - - // if already in cache then validate - if (hit = cache.get(key)){ - if (headers.etag == hit[0].etag) { - hit[0].date = new Date; - return; - } else { - cache.remove(key); - } - } - - // validation notifiactions don't contain a steam - if (null == stream) return; - - // add the cache object - var arr = []; - - // store the chunks - stream.on('data', function(chunk){ - arr.push(chunk); - }); - - // flag it as complete - stream.on('end', function(){ - var cacheEntry = cache.add(key); - delete headers['x-cache']; // Clean up (TODO: others) - cacheEntry.push(200); - cacheEntry.push(headers); - cacheEntry.push.apply(cacheEntry, arr); - }); - }); - - if (req.method == 'GET' || req.method == 'HEAD') { - if (ranges) { - next(); - } else if (!hasCookies && hit && !mustRevalidate(req, hit)) { - res.setHeader('X-Cache', 'HIT'); - respondFromCache(req, res, hit); - } else { - res.setHeader('X-Cache', 'MISS'); - next(); - } - } else { - next(); - } - } -}; - -/** - * Respond with the provided cached value. - * TODO: Assume 200 code, that's iffy. - * - * @param {Object} req - * @param {Object} res - * @param {Object} cacheEntry - * @return {String} - * @api private - */ - -function respondFromCache(req, res, cacheEntry) { - var status = cacheEntry[0] - , headers = utils.merge({}, cacheEntry[1]) - , content = cacheEntry.slice(2); - - headers.age = (new Date - new Date(headers.date)) / 1000 || 0; - - switch (req.method) { - case 'HEAD': - res.writeHead(status, headers); - res.end(); - break; - case 'GET': - if (utils.conditionalGET(req) && fresh(req.headers, headers)) { - headers['content-length'] = 0; - res.writeHead(304, headers); - res.end(); - } else { - res.writeHead(status, headers); - - function write() { - while (content.length) { - if (false === res.write(content.shift())) { - res.once('drain', write); - return; - } - } - res.end(); - } - - write(); - } - break; - default: - // This should never happen. - res.writeHead(500, ''); - res.end(); - } -} - -/** - * Determine whether or not a cached value must be revalidated. - * - * @param {Object} req - * @param {Object} cacheEntry - * @return {String} - * @api private - */ - -function mustRevalidate(req, cacheEntry) { - var cacheHeaders = cacheEntry[1] - , reqCC = utils.parseCacheControl(req.headers['cache-control'] || '') - , cacheCC = utils.parseCacheControl(cacheHeaders['cache-control'] || '') - , cacheAge = (new Date - new Date(cacheHeaders.date)) / 1000 || 0; - - if ( cacheCC['no-cache'] - || cacheCC['must-revalidate'] - || cacheCC['proxy-revalidate']) return true; - - if (reqCC['no-cache']) return true; - - if (null != reqCC['max-age']) return reqCC['max-age'] < cacheAge; - - if (null != cacheCC['max-age']) return cacheCC['max-age'] < cacheAge; - - return false; -} - -/** - * The key to use in the cache. For now, this is the URL path and query. - * - * 'http://example.com?key=value' -> '/?key=value' - * - * @param {Object} req - * @return {String} - * @api private - */ - -function cacheKey(req) { - return utils.parseUrl(req).path; -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/timeout.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/timeout.js deleted file mode 100644 index dba4654..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/timeout.js +++ /dev/null @@ -1,55 +0,0 @@ -/*! - * Connect - timeout - * Ported from https://github.com/LearnBoost/connect-timeout - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var debug = require('debug')('connect:timeout'); - -/** - * Timeout: - * - * Times out the request in `ms`, defaulting to `5000`. The - * method `req.clearTimeout()` is added to revert this behaviour - * programmatically within your application's middleware, routes, etc. - * - * The timeout error is passed to `next()` so that you may customize - * the response behaviour. This error has the `.timeout` property as - * well as `.status == 408`. - * - * @param {Number} ms - * @return {Function} - * @api public - */ - -module.exports = function timeout(ms) { - ms = ms || 5000; - - return function(req, res, next) { - var id = setTimeout(function(){ - req.emit('timeout', ms); - }, ms); - - req.on('timeout', function(){ - if (res.headerSent) return debug('response started, cannot timeout'); - var err = new Error('Response timeout'); - err.timeout = ms; - err.status = 503; - next(err); - }); - - req.clearTimeout = function(){ - clearTimeout(id); - }; - - res.on('header', function(){ - clearTimeout(id); - }); - - next(); - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/urlencoded.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/urlencoded.js deleted file mode 100644 index cceafc0..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/urlencoded.js +++ /dev/null @@ -1,78 +0,0 @@ - -/*! - * Connect - urlencoded - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , _limit = require('./limit') - , qs = require('qs'); - -/** - * noop middleware. - */ - -function noop(req, res, next) { - next(); -} - -/** - * Urlencoded: - * - * Parse x-ww-form-urlencoded request bodies, - * providing the parsed object as `req.body`. - * - * Options: - * - * - `limit` byte limit disabled by default - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function(options){ - options = options || {}; - - var limit = options.limit - ? _limit(options.limit) - : noop; - - return function urlencoded(req, res, next) { - if (req._body) return next(); - req.body = req.body || {}; - - if (!utils.hasBody(req)) return next(); - - // check Content-Type - if ('application/x-www-form-urlencoded' != utils.mime(req)) return next(); - - // flag as parsed - req._body = true; - - // parse - limit(req, res, function(err){ - if (err) return next(err); - var buf = ''; - req.setEncoding('utf8'); - req.on('data', function(chunk){ buf += chunk }); - req.on('end', function(){ - try { - req.body = buf.length - ? qs.parse(buf, options) - : {}; - next(); - } catch (err){ - err.body = buf; - next(err); - } - }); - }); - } -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/vhost.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/vhost.js deleted file mode 100644 index abbb050..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/vhost.js +++ /dev/null @@ -1,40 +0,0 @@ - -/*! - * Connect - vhost - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Vhost: - * - * Setup vhost for the given `hostname` and `server`. - * - * connect() - * .use(connect.vhost('foo.com', fooApp)) - * .use(connect.vhost('bar.com', barApp)) - * .use(connect.vhost('*.com', mainApp)) - * - * The `server` may be a Connect server or - * a regular Node `http.Server`. - * - * @param {String} hostname - * @param {Server} server - * @return {Function} - * @api public - */ - -module.exports = function vhost(hostname, server){ - if (!hostname) throw new Error('vhost hostname required'); - if (!server) throw new Error('vhost server required'); - var regexp = new RegExp('^' + hostname.replace(/[^*\w]/g, '\\$&').replace(/[*]/g, '(?:.*?)') + '$', 'i'); - if (server.onvhost) server.onvhost(hostname); - return function vhost(req, res, next){ - if (!req.headers.host) return next(); - var host = req.headers.host.split(':')[0]; - if (!regexp.test(host)) return next(); - if ('function' == typeof server) return server(req, res, next); - server.emit('request', req, res); - }; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/patch.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/patch.js deleted file mode 100644 index 7cf0012..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/patch.js +++ /dev/null @@ -1,79 +0,0 @@ - -/*! - * Connect - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , res = http.ServerResponse.prototype - , setHeader = res.setHeader - , _renderHeaders = res._renderHeaders - , writeHead = res.writeHead; - -// apply only once - -if (!res._hasConnectPatch) { - - /** - * Provide a public "header sent" flag - * until node does. - * - * @return {Boolean} - * @api public - */ - - res.__defineGetter__('headerSent', function(){ - return this._header; - }); - - /** - * Set header `field` to `val`, special-casing - * the `Set-Cookie` field for multiple support. - * - * @param {String} field - * @param {String} val - * @api public - */ - - res.setHeader = function(field, val){ - var key = field.toLowerCase() - , prev; - - // special-case Set-Cookie - if (this._headers && 'set-cookie' == key) { - if (prev = this.getHeader(field)) { - val = Array.isArray(prev) - ? prev.concat(val) - : [prev, val]; - } - // charset - } else if ('content-type' == key && this.charset) { - val += '; charset=' + this.charset; - } - - return setHeader.call(this, field, val); - }; - - /** - * Proxy to emit "header" event. - */ - - res._renderHeaders = function(){ - if (!this._emittedHeader) this.emit('header'); - this._emittedHeader = true; - return _renderHeaders.call(this); - }; - - res.writeHead = function(){ - if (!this._emittedHeader) this.emit('header'); - this._emittedHeader = true; - return writeHead.apply(this, arguments); - }; - - res._hasConnectPatch = true; -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/proto.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/proto.js deleted file mode 100644 index b304cf7..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/proto.js +++ /dev/null @@ -1,230 +0,0 @@ - -/*! - * Connect - HTTPServer - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , utils = require('./utils') - , debug = require('debug')('connect:dispatcher'); - -// prototype - -var app = module.exports = {}; - -// environment - -var env = process.env.NODE_ENV || 'development'; - -/** - * Utilize the given middleware `handle` to the given `route`, - * defaulting to _/_. This "route" is the mount-point for the - * middleware, when given a value other than _/_ the middleware - * is only effective when that segment is present in the request's - * pathname. - * - * For example if we were to mount a function at _/admin_, it would - * be invoked on _/admin_, and _/admin/settings_, however it would - * not be invoked for _/_, or _/posts_. - * - * Examples: - * - * var app = connect(); - * app.use(connect.favicon()); - * app.use(connect.logger()); - * app.use(connect.static(__dirname + '/public')); - * - * If we wanted to prefix static files with _/public_, we could - * "mount" the `static()` middleware: - * - * app.use('/public', connect.static(__dirname + '/public')); - * - * This api is chainable, so the following is valid: - * - * connect() - * .use(connect.favicon()) - * .use(connect.logger()) - * .use(connect.static(__dirname + '/public')) - * .listen(3000); - * - * @param {String|Function|Server} route, callback or server - * @param {Function|Server} callback or server - * @return {Server} for chaining - * @api public - */ - -app.use = function(route, fn){ - // default route to '/' - if ('string' != typeof route) { - fn = route; - route = '/'; - } - - // wrap sub-apps - if ('function' == typeof fn.handle) { - var server = fn; - fn.route = route; - fn = function(req, res, next){ - server.handle(req, res, next); - }; - } - - // wrap vanilla http.Servers - if (fn instanceof http.Server) { - fn = fn.listeners('request')[0]; - } - - // strip trailing slash - if ('/' == route[route.length - 1]) { - route = route.slice(0, -1); - } - - // add the middleware - debug('use %s %s', route || '/', fn.name || 'anonymous'); - this.stack.push({ route: route, handle: fn }); - - return this; -}; - -/** - * Handle server requests, punting them down - * the middleware stack. - * - * @api private - */ - -app.handle = function(req, res, out) { - var stack = this.stack - , fqdn = ~req.url.indexOf('://') - , removed = '' - , slashAdded = false - , index = 0; - - function next(err) { - var layer, path, status, c; - - if (slashAdded) { - req.url = req.url.substr(1); - slashAdded = false; - } - - req.url = removed + req.url; - req.originalUrl = req.originalUrl || req.url; - removed = ''; - - // next callback - layer = stack[index++]; - - // all done - if (!layer || res.headerSent) { - // delegate to parent - if (out) return out(err); - - // unhandled error - if (err) { - // default to 500 - if (res.statusCode < 400) res.statusCode = 500; - debug('default %s', res.statusCode); - - // respect err.status - if (err.status) res.statusCode = err.status; - - // production gets a basic error message - var msg = 'production' == env - ? http.STATUS_CODES[res.statusCode] - : err.stack || err.toString(); - - // log to stderr in a non-test env - if ('test' != env) console.error(err.stack || err.toString()); - if (res.headerSent) return req.socket.destroy(); - res.setHeader('Content-Type', 'text/plain'); - res.setHeader('Content-Length', Buffer.byteLength(msg)); - if ('HEAD' == req.method) return res.end(); - res.end(msg); - } else { - debug('default 404'); - res.statusCode = 404; - res.setHeader('Content-Type', 'text/plain'); - if ('HEAD' == req.method) return res.end(); - res.end('Cannot ' + req.method + ' ' + utils.escape(req.originalUrl)); - } - return; - } - - try { - path = utils.parseUrl(req).pathname; - if (undefined == path) path = '/'; - - // skip this layer if the route doesn't match. - if (0 != path.toLowerCase().indexOf(layer.route.toLowerCase())) return next(err); - - c = path[layer.route.length]; - if (c && '/' != c && '.' != c) return next(err); - - // Call the layer handler - // Trim off the part of the url that matches the route - removed = layer.route; - req.url = req.url.substr(removed.length); - - // Ensure leading slash - if (!fqdn && '/' != req.url[0]) { - req.url = '/' + req.url; - slashAdded = true; - } - - debug('%s', layer.handle.name || 'anonymous'); - var arity = layer.handle.length; - if (err) { - if (arity === 4) { - layer.handle(err, req, res, next); - } else { - next(err); - } - } else if (arity < 4) { - layer.handle(req, res, next); - } else { - next(); - } - } catch (e) { - next(e); - } - } - next(); -}; - -/** - * Listen for connections. - * - * This method takes the same arguments - * as node's `http.Server#listen()`. - * - * HTTP and HTTPS: - * - * If you run your application both as HTTP - * and HTTPS you may wrap them individually, - * since your Connect "server" is really just - * a JavaScript `Function`. - * - * var connect = require('connect') - * , http = require('http') - * , https = require('https'); - * - * var app = connect(); - * - * http.createServer(app).listen(80); - * https.createServer(options, app).listen(443); - * - * @return {http.Server} - * @api public - */ - -app.listen = function(){ - var server = http.createServer(this); - return server.listen.apply(server, arguments); -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/directory.html b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/directory.html deleted file mode 100644 index 2d63704..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/directory.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - listing directory {directory} - - - - - -
    -

    {linked-path}

    - {files} -
    - - \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/error.html b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/error.html deleted file mode 100644 index a6d3faf..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/error.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - {error} - - - -
    -

    {title}

    -

    {statusCode} {error}

    -
      {stack}
    -
    - - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/favicon.ico b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/favicon.ico deleted file mode 100644 index 895fc96..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/favicon.ico and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page.png deleted file mode 100644 index 03ddd79..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_add.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_add.png deleted file mode 100644 index d5bfa07..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_add.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_attach.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_attach.png deleted file mode 100644 index 89ee2da..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_attach.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_code.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_code.png deleted file mode 100644 index f7ea904..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_code.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_copy.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_copy.png deleted file mode 100644 index 195dc6d..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_copy.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_delete.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_delete.png deleted file mode 100644 index 3141467..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_delete.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_edit.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_edit.png deleted file mode 100644 index 046811e..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_edit.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_error.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_error.png deleted file mode 100644 index f07f449..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_error.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_excel.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_excel.png deleted file mode 100644 index eb6158e..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_excel.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_find.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_find.png deleted file mode 100644 index 2f19388..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_find.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_gear.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_gear.png deleted file mode 100644 index 8e83281..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_gear.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_go.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_go.png deleted file mode 100644 index 80fe1ed..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_go.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_green.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_green.png deleted file mode 100644 index de8e003..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_green.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_key.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_key.png deleted file mode 100644 index d6626cb..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_key.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_lightning.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_lightning.png deleted file mode 100644 index 7e56870..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_lightning.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_link.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_link.png deleted file mode 100644 index 312eab0..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_link.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_paintbrush.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_paintbrush.png deleted file mode 100644 index 246a2f0..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_paintbrush.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_paste.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_paste.png deleted file mode 100644 index 968f073..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_paste.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_red.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_red.png deleted file mode 100644 index 0b18247..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_red.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_refresh.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_refresh.png deleted file mode 100644 index cf347c7..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_refresh.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_save.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_save.png deleted file mode 100644 index caea546..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_save.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white.png deleted file mode 100644 index 8b8b1ca..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_acrobat.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_acrobat.png deleted file mode 100644 index 8f8095e..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_acrobat.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_actionscript.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_actionscript.png deleted file mode 100644 index 159b240..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_actionscript.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_add.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_add.png deleted file mode 100644 index aa23dde..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_add.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_c.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_c.png deleted file mode 100644 index 34a05cc..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_c.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_camera.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_camera.png deleted file mode 100644 index f501a59..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_camera.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cd.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cd.png deleted file mode 100644 index 848bdaf..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cd.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_code.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_code.png deleted file mode 100644 index 0c76bd1..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_code.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_code_red.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_code_red.png deleted file mode 100644 index 87a6914..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_code_red.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_coldfusion.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_coldfusion.png deleted file mode 100644 index c66011f..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_coldfusion.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_compressed.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_compressed.png deleted file mode 100644 index 2b6b100..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_compressed.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_copy.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_copy.png deleted file mode 100644 index a9f31a2..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_copy.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cplusplus.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cplusplus.png deleted file mode 100644 index a87cf84..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cplusplus.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_csharp.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_csharp.png deleted file mode 100644 index ffb8fc9..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_csharp.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cup.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cup.png deleted file mode 100644 index 0a7d6f4..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_cup.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_database.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_database.png deleted file mode 100644 index bddba1f..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_database.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_delete.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_delete.png deleted file mode 100644 index af1ecaf..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_delete.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_dvd.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_dvd.png deleted file mode 100644 index 4cc537a..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_dvd.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_edit.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_edit.png deleted file mode 100644 index b93e776..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_edit.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_error.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_error.png deleted file mode 100644 index 9fc5a0a..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_error.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_excel.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_excel.png deleted file mode 100644 index b977d7e..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_excel.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_find.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_find.png deleted file mode 100644 index 5818436..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_find.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_flash.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_flash.png deleted file mode 100644 index 5769120..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_flash.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_freehand.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_freehand.png deleted file mode 100644 index 8d719df..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_freehand.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_gear.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_gear.png deleted file mode 100644 index 106f5aa..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_gear.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_get.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_get.png deleted file mode 100644 index e4a1ecb..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_get.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_go.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_go.png deleted file mode 100644 index 7e62a92..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_go.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_h.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_h.png deleted file mode 100644 index e902abb..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_h.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_horizontal.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_horizontal.png deleted file mode 100644 index 1d2d0a4..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_horizontal.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_key.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_key.png deleted file mode 100644 index d616484..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_key.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_lightning.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_lightning.png deleted file mode 100644 index 7215d1e..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_lightning.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_link.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_link.png deleted file mode 100644 index bf7bd1c..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_link.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_magnify.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_magnify.png deleted file mode 100644 index f6b74cc..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_magnify.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_medal.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_medal.png deleted file mode 100644 index d3fffb6..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_medal.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_office.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_office.png deleted file mode 100644 index a65bcb3..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_office.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paint.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paint.png deleted file mode 100644 index 23a37b8..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paint.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paintbrush.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paintbrush.png deleted file mode 100644 index f907e44..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paintbrush.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paste.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paste.png deleted file mode 100644 index 5b2cbb3..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_paste.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_php.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_php.png deleted file mode 100644 index 7868a25..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_php.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_picture.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_picture.png deleted file mode 100644 index 134b669..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_picture.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_powerpoint.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_powerpoint.png deleted file mode 100644 index c4eff03..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_powerpoint.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_put.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_put.png deleted file mode 100644 index 884ffd6..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_put.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_ruby.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_ruby.png deleted file mode 100644 index f59b7c4..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_ruby.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_stack.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_stack.png deleted file mode 100644 index 44084ad..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_stack.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_star.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_star.png deleted file mode 100644 index 3a1441c..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_star.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_swoosh.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_swoosh.png deleted file mode 100644 index e770829..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_swoosh.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_text.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_text.png deleted file mode 100644 index 813f712..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_text.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_text_width.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_text_width.png deleted file mode 100644 index d9cf132..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_text_width.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_tux.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_tux.png deleted file mode 100644 index 52699bf..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_tux.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_vector.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_vector.png deleted file mode 100644 index 4a05955..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_vector.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_visualstudio.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_visualstudio.png deleted file mode 100644 index a0a433d..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_visualstudio.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_width.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_width.png deleted file mode 100644 index 1eb8809..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_width.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_word.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_word.png deleted file mode 100644 index ae8ecbf..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_word.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_world.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_world.png deleted file mode 100644 index 6ed2490..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_world.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_wrench.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_wrench.png deleted file mode 100644 index fecadd0..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_wrench.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_zip.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_zip.png deleted file mode 100644 index fd4bbcc..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_white_zip.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_word.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_word.png deleted file mode 100644 index 834cdfa..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_word.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_world.png b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_world.png deleted file mode 100644 index b8895dd..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/icons/page_world.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/style.css b/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/style.css deleted file mode 100644 index 32b6507..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/public/style.css +++ /dev/null @@ -1,141 +0,0 @@ -body { - margin: 0; - padding: 80px 100px; - font: 13px "Helvetica Neue", "Lucida Grande", "Arial"; - background: #ECE9E9 -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ECE9E9)); - background: #ECE9E9 -moz-linear-gradient(top, #fff, #ECE9E9); - background-repeat: no-repeat; - color: #555; - -webkit-font-smoothing: antialiased; -} -h1, h2, h3 { - margin: 0; - font-size: 22px; - color: #343434; -} -h1 em, h2 em { - padding: 0 5px; - font-weight: normal; -} -h1 { - font-size: 60px; -} -h2 { - margin-top: 10px; -} -h3 { - margin: 5px 0 10px 0; - padding-bottom: 5px; - border-bottom: 1px solid #eee; - font-size: 18px; -} -ul { - margin: 0; - padding: 0; -} -ul li { - margin: 5px 0; - padding: 3px 8px; - list-style: none; -} -ul li:hover { - cursor: pointer; - color: #2e2e2e; -} -ul li .path { - padding-left: 5px; - font-weight: bold; -} -ul li .line { - padding-right: 5px; - font-style: italic; -} -ul li:first-child .path { - padding-left: 0; -} -p { - line-height: 1.5; -} -a { - color: #555; - text-decoration: none; -} -a:hover { - color: #303030; -} -#stacktrace { - margin-top: 15px; -} -.directory h1 { - margin-bottom: 15px; - font-size: 18px; -} -ul#files { - width: 100%; - height: 500px; -} -ul#files li { - padding: 0; -} -ul#files li img { - position: absolute; - top: 5px; - left: 5px; -} -ul#files li a { - position: relative; - display: block; - margin: 1px; - width: 30%; - height: 25px; - line-height: 25px; - text-indent: 8px; - float: left; - border: 1px solid transparent; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - overflow: hidden; - text-overflow: ellipsis; -} -ul#files li a.icon { - text-indent: 25px; -} -ul#files li a:focus, -ul#files li a:hover { - outline: none; - background: rgba(255,255,255,0.65); - border: 1px solid #ececec; -} -ul#files li a.highlight { - -webkit-transition: background .4s ease-in-out; - background: #ffff4f; - border-color: #E9DC51; -} -#search { - display: block; - position: fixed; - top: 20px; - right: 20px; - width: 90px; - -webkit-transition: width ease 0.2s, opacity ease 0.4s; - -moz-transition: width ease 0.2s, opacity ease 0.4s; - -webkit-border-radius: 32px; - -moz-border-radius: 32px; - -webkit-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03); - -moz-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03); - -webkit-font-smoothing: antialiased; - text-align: left; - font: 13px "Helvetica Neue", Arial, sans-serif; - padding: 4px 10px; - border: none; - background: transparent; - margin-bottom: 0; - outline: none; - opacity: 0.7; - color: #888; -} -#search:focus { - width: 120px; - opacity: 1.0; -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/lib/utils.js b/node_modules/grunt-contrib-connect/node_modules/connect/lib/utils.js deleted file mode 100644 index 35738b8..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/lib/utils.js +++ /dev/null @@ -1,404 +0,0 @@ - -/*! - * Connect - utils - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , crypto = require('crypto') - , parse = require('url').parse - , signature = require('cookie-signature') - , nodeVersion = process.versions.node.split('.'); - -// pause is broken in node < 0.10 -exports.brokenPause = parseInt(nodeVersion[0], 10) === 0 - && parseInt(nodeVersion[1], 10) < 10; - -/** - * Return `true` if the request has a body, otherwise return `false`. - * - * @param {IncomingMessage} req - * @return {Boolean} - * @api private - */ - -exports.hasBody = function(req) { - return 'transfer-encoding' in req.headers || 'content-length' in req.headers; -}; - -/** - * Extract the mime type from the given request's - * _Content-Type_ header. - * - * @param {IncomingMessage} req - * @return {String} - * @api private - */ - -exports.mime = function(req) { - var str = req.headers['content-type'] || ''; - return str.split(';')[0]; -}; - -/** - * Generate an `Error` from the given status `code` - * and optional `msg`. - * - * @param {Number} code - * @param {String} msg - * @return {Error} - * @api private - */ - -exports.error = function(code, msg){ - var err = new Error(msg || http.STATUS_CODES[code]); - err.status = code; - return err; -}; - -/** - * Return md5 hash of the given string and optional encoding, - * defaulting to hex. - * - * utils.md5('wahoo'); - * // => "e493298061761236c96b02ea6aa8a2ad" - * - * @param {String} str - * @param {String} encoding - * @return {String} - * @api private - */ - -exports.md5 = function(str, encoding){ - return crypto - .createHash('md5') - .update(str) - .digest(encoding || 'hex'); -}; - -/** - * Merge object b with object a. - * - * var a = { foo: 'bar' } - * , b = { bar: 'baz' }; - * - * utils.merge(a, b); - * // => { foo: 'bar', bar: 'baz' } - * - * @param {Object} a - * @param {Object} b - * @return {Object} - * @api private - */ - -exports.merge = function(a, b){ - if (a && b) { - for (var key in b) { - a[key] = b[key]; - } - } - return a; -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - - -/** - * Return a unique identifier with the given `len`. - * - * utils.uid(10); - * // => "FDaS435D2z" - * - * @param {Number} len - * @return {String} - * @api private - */ - -exports.uid = function(len) { - return crypto.randomBytes(Math.ceil(len * 3 / 4)) - .toString('base64') - .slice(0, len) - .replace(/\//g, '-') - .replace(/\+/g, '_'); -}; - -/** - * Sign the given `val` with `secret`. - * - * @param {String} val - * @param {String} secret - * @return {String} - * @api private - */ - -exports.sign = function(val, secret){ - console.warn('do not use utils.sign(), use https://github.com/visionmedia/node-cookie-signature') - return val + '.' + crypto - .createHmac('sha256', secret) - .update(val) - .digest('base64') - .replace(/=+$/, ''); -}; - -/** - * Unsign and decode the given `val` with `secret`, - * returning `false` if the signature is invalid. - * - * @param {String} val - * @param {String} secret - * @return {String|Boolean} - * @api private - */ - -exports.unsign = function(val, secret){ - console.warn('do not use utils.unsign(), use https://github.com/visionmedia/node-cookie-signature') - var str = val.slice(0, val.lastIndexOf('.')); - return exports.sign(str, secret) == val - ? str - : false; -}; - -/** - * Parse signed cookies, returning an object - * containing the decoded key/value pairs, - * while removing the signed key from `obj`. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -exports.parseSignedCookies = function(obj, secret){ - var ret = {}; - Object.keys(obj).forEach(function(key){ - var val = obj[key]; - if (0 == val.indexOf('s:')) { - val = signature.unsign(val.slice(2), secret); - if (val) { - ret[key] = val; - delete obj[key]; - } - } - }); - return ret; -}; - -/** - * Parse a signed cookie string, return the decoded value - * - * @param {String} str signed cookie string - * @param {String} secret - * @return {String} decoded value - * @api private - */ - -exports.parseSignedCookie = function(str, secret){ - return 0 == str.indexOf('s:') - ? signature.unsign(str.slice(2), secret) - : str; -}; - -/** - * Parse JSON cookies. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -exports.parseJSONCookies = function(obj){ - Object.keys(obj).forEach(function(key){ - var val = obj[key]; - var res = exports.parseJSONCookie(val); - if (res) obj[key] = res; - }); - return obj; -}; - -/** - * Parse JSON cookie string - * - * @param {String} str - * @return {Object} Parsed object or null if not json cookie - * @api private - */ - -exports.parseJSONCookie = function(str) { - if (0 == str.indexOf('j:')) { - try { - return JSON.parse(str.slice(2)); - } catch (err) { - // no op - } - } -}; - -/** - * Pause `data` and `end` events on the given `obj`. - * Middleware performing async tasks _should_ utilize - * this utility (or similar), to re-emit data once - * the async operation has completed, otherwise these - * events may be lost. Pause is only required for - * node versions less than 10, and is replaced with - * noop's otherwise. - * - * var pause = utils.pause(req); - * fs.readFile(path, function(){ - * next(); - * pause.resume(); - * }); - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -exports.pause = exports.brokenPause - ? require('pause') - : function () { - return { - end: noop, - resume: noop - } - } - -/** - * Strip `Content-*` headers from `res`. - * - * @param {ServerResponse} res - * @api private - */ - -exports.removeContentHeaders = function(res){ - Object.keys(res._headers).forEach(function(field){ - if (0 == field.indexOf('content')) { - res.removeHeader(field); - } - }); -}; - -/** - * Check if `req` is a conditional GET request. - * - * @param {IncomingMessage} req - * @return {Boolean} - * @api private - */ - -exports.conditionalGET = function(req) { - return req.headers['if-modified-since'] - || req.headers['if-none-match']; -}; - -/** - * Respond with 401 "Unauthorized". - * - * @param {ServerResponse} res - * @param {String} realm - * @api private - */ - -exports.unauthorized = function(res, realm) { - res.statusCode = 401; - res.setHeader('WWW-Authenticate', 'Basic realm="' + realm + '"'); - res.end('Unauthorized'); -}; - -/** - * Respond with 304 "Not Modified". - * - * @param {ServerResponse} res - * @param {Object} headers - * @api private - */ - -exports.notModified = function(res) { - exports.removeContentHeaders(res); - res.statusCode = 304; - res.end(); -}; - -/** - * Return an ETag in the form of `"-"` - * from the given `stat`. - * - * @param {Object} stat - * @return {String} - * @api private - */ - -exports.etag = function(stat) { - return '"' + stat.size + '-' + Number(stat.mtime) + '"'; -}; - -/** - * Parse the given Cache-Control `str`. - * - * @param {String} str - * @return {Object} - * @api private - */ - -exports.parseCacheControl = function(str){ - var directives = str.split(',') - , obj = {}; - - for(var i = 0, len = directives.length; i < len; i++) { - var parts = directives[i].split('=') - , key = parts.shift().trim() - , val = parseInt(parts.shift(), 10); - - obj[key] = isNaN(val) ? true : val; - } - - return obj; -}; - -/** - * Parse the `req` url with memoization. - * - * @param {ServerRequest} req - * @return {Object} - * @api private - */ - -exports.parseUrl = function(req){ - var parsed = req._parsedUrl; - if (parsed && parsed.href == req.url) { - return parsed; - } else { - return req._parsedUrl = parse(req.url); - } -}; - -/** - * Parse byte `size` string. - * - * @param {String} size - * @return {Number} - * @api private - */ - -exports.parseBytes = require('bytes'); - -function noop() {} \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/.npmignore deleted file mode 100644 index b512c09..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/.travis.yml b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/.travis.yml deleted file mode 100644 index 7a902e8..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 -notifications: - email: - recipients: - - brianloveswords@gmail.com \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/README.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/README.md deleted file mode 100644 index 0d9d8b8..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# buffer-crc32 - -[![Build Status](https://secure.travis-ci.org/brianloveswords/buffer-crc32.png?branch=master)](http://travis-ci.org/brianloveswords/buffer-crc32) - -crc32 that works with binary data and fancy character sets, outputs -buffer, signed or unsigned data and has tests. - -Derived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix - -# install -``` -npm install buffer-crc32 -``` - -# example -```js -var crc32 = require('buffer-crc32'); -// works with buffers -var buf = Buffer([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]) -crc32(buf) // -> - -// has convenience methods for getting signed or unsigned ints -crc32.signed(buf) // -> -1805997238 -crc32.unsigned(buf) // -> 2488970058 - -// will cast to buffer if given a string, so you can -// directly use foreign characters safely -crc32('自動販売機') // -> - -// and works in append mode too -var partialCrc = crc32('hey'); -var partialCrc = crc32(' ', partialCrc); -var partialCrc = crc32('sup', partialCrc); -var partialCrc = crc32(' ', partialCrc); -var finalCrc = crc32('bros', partialCrc); // -> -``` - -# tests -This was tested against the output of zlib's crc32 method. You can run -the tests with`npm test` (requires tap) - -# see also -https://github.com/alexgorbatchev/node-crc, `crc.buffer.crc32` also -supports buffer inputs and return unsigned ints (thanks @tjholowaychuk). - -# license -MIT/X11 diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/index.js deleted file mode 100644 index e29ce3e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/index.js +++ /dev/null @@ -1,88 +0,0 @@ -var Buffer = require('buffer').Buffer; - -var CRC_TABLE = [ - 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 bufferizeInt(num) { - var tmp = Buffer(4); - tmp.writeInt32BE(num, 0); - return tmp; -} - -function _crc32(buf, previous) { - if (!Buffer.isBuffer(buf)) { - buf = Buffer(buf); - } - if (Buffer.isBuffer(previous)) { - previous = previous.readUInt32BE(0); - } - var crc = ~~previous ^ -1; - for (var n = 0; n < buf.length; n++) { - crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); - } - return (crc ^ -1); -} - -function crc32() { - return bufferizeInt(_crc32.apply(null, arguments)); -} -crc32.signed = function () { - return _crc32.apply(null, arguments); -}; -crc32.unsigned = function () { - return _crc32.apply(null, arguments) >>> 0; -}; - -module.exports = crc32; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/package.json deleted file mode 100644 index 4bb469a..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Brian J. Brennan", - "email": "brianloveswords@gmail.com", - "url": "http://bjb.io" - }, - "name": "buffer-crc32", - "description": "A pure javascript CRC32 algorithm that plays nice with binary data", - "version": "0.2.1", - "contributors": [ - { - "name": "Vladimir Kuznetsov" - } - ], - "homepage": "https://github.com/brianloveswords/buffer-crc32", - "repository": { - "type": "git", - "url": "git://github.com/brianloveswords/buffer-crc32.git" - }, - "main": "index.js", - "scripts": { - "test": "./node_modules/.bin/tap tests/*.test.js" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.2.5" - }, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "# buffer-crc32\n\n[![Build Status](https://secure.travis-ci.org/brianloveswords/buffer-crc32.png?branch=master)](http://travis-ci.org/brianloveswords/buffer-crc32)\n\ncrc32 that works with binary data and fancy character sets, outputs\nbuffer, signed or unsigned data and has tests.\n\nDerived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix\n\n# install\n```\nnpm install buffer-crc32\n```\n\n# example\n```js\nvar crc32 = require('buffer-crc32');\n// works with buffers\nvar buf = Buffer([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00])\ncrc32(buf) // -> \n\n// has convenience methods for getting signed or unsigned ints\ncrc32.signed(buf) // -> -1805997238\ncrc32.unsigned(buf) // -> 2488970058\n\n// will cast to buffer if given a string, so you can\n// directly use foreign characters safely\ncrc32('自動販売機') // -> \n\n// and works in append mode too\nvar partialCrc = crc32('hey');\nvar partialCrc = crc32(' ', partialCrc);\nvar partialCrc = crc32('sup', partialCrc);\nvar partialCrc = crc32(' ', partialCrc);\nvar finalCrc = crc32('bros', partialCrc); // -> \n```\n\n# tests\nThis was tested against the output of zlib's crc32 method. You can run\nthe tests with`npm test` (requires tap)\n\n# see also\nhttps://github.com/alexgorbatchev/node-crc, `crc.buffer.crc32` also\nsupports buffer inputs and return unsigned ints (thanks @tjholowaychuk).\n\n# license\nMIT/X11\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/brianloveswords/buffer-crc32/issues" - }, - "_id": "buffer-crc32@0.2.1", - "_from": "buffer-crc32@0.2.1" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/tests/crc.test.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/tests/crc.test.js deleted file mode 100644 index bb0f9ef..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/buffer-crc32/tests/crc.test.js +++ /dev/null @@ -1,89 +0,0 @@ -var crc32 = require('..'); -var test = require('tap').test; - -test('simple crc32 is no problem', function (t) { - var input = Buffer('hey sup bros'); - var expected = Buffer([0x47, 0xfa, 0x55, 0x70]); - t.same(crc32(input), expected); - t.end(); -}); - -test('another simple one', function (t) { - var input = Buffer('IEND'); - var expected = Buffer([0xae, 0x42, 0x60, 0x82]); - t.same(crc32(input), expected); - t.end(); -}); - -test('slightly more complex', function (t) { - var input = Buffer([0x00, 0x00, 0x00]); - var expected = Buffer([0xff, 0x41, 0xd9, 0x12]); - t.same(crc32(input), expected); - t.end(); -}); - -test('complex crc32 gets calculated like a champ', function (t) { - var input = Buffer('शीर्षक'); - var expected = Buffer([0x17, 0xb8, 0xaf, 0xf1]); - t.same(crc32(input), expected); - t.end(); -}); - -test('casts to buffer if necessary', function (t) { - var input = 'शीर्षक'; - var expected = Buffer([0x17, 0xb8, 0xaf, 0xf1]); - t.same(crc32(input), expected); - t.end(); -}); - -test('can do signed', function (t) { - var input = 'ham sandwich'; - var expected = -1891873021; - t.same(crc32.signed(input), expected); - t.end(); -}); - -test('can do unsigned', function (t) { - var input = 'bear sandwich'; - var expected = 3711466352; - t.same(crc32.unsigned(input), expected); - t.end(); -}); - - -test('simple crc32 in append mode', function (t) { - var input = [Buffer('hey'), Buffer(' '), Buffer('sup'), Buffer(' '), Buffer('bros')]; - var expected = Buffer([0x47, 0xfa, 0x55, 0x70]); - for (var crc = 0, i = 0; i < input.length; i++) { - crc = crc32(input[i], crc); - } - t.same(crc, expected); - t.end(); -}); - - -test('can do signed in append mode', function (t) { - var input1 = 'ham'; - var input2 = ' '; - var input3 = 'sandwich'; - var expected = -1891873021; - - var crc = crc32.signed(input1); - crc = crc32.signed(input2, crc); - crc = crc32.signed(input3, crc); - - t.same(crc, expected); - t.end(); -}); - -test('can do unsigned in append mode', function (t) { - var input1 = 'bear san'; - var input2 = 'dwich'; - var expected = 3711466352; - - var crc = crc32.unsigned(input1); - crc = crc32.unsigned(input2, crc); - t.same(crc, expected); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/.npmignore deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/.npmignore +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/History.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/History.md deleted file mode 100644 index 1332808..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/History.md +++ /dev/null @@ -1,10 +0,0 @@ - -0.2.0 / 2012-10-28 -================== - - * bytes(200).should.eql('200b') - -0.1.0 / 2012-07-04 -================== - - * add bytes to string conversion [yields] diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/Makefile b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/Makefile deleted file mode 100644 index 8e8640f..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --reporter spec \ - --require should - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/Readme.md deleted file mode 100644 index 9325d5b..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/Readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# node-bytes - - Byte string parser / formatter. - -## Example: - -```js -bytes('1kb') -// => 1024 - -bytes('2mb') -// => 2097152 - -bytes('1gb') -// => 1073741824 - -bytes(1073741824) -// => 1gb -``` - -## Installation - -``` -$ npm install bytes -$ component install visionmedia/bytes.js -``` - -## License - -(The MIT License) - -Copyright (c) 2012 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. diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/component.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/component.json deleted file mode 100644 index 76a6057..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/component.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "bytes", - "description": "byte size string parser / serializer", - "keywords": ["bytes", "utility"], - "version": "0.1.0", - "scripts": ["index.js"] -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/index.js deleted file mode 100644 index 70b2e01..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/index.js +++ /dev/null @@ -1,39 +0,0 @@ - -/** - * Parse byte `size` string. - * - * @param {String} size - * @return {Number} - * @api public - */ - -module.exports = function(size) { - if ('number' == typeof size) return convert(size); - var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb)$/) - , n = parseFloat(parts[1]) - , type = parts[2]; - - var map = { - kb: 1 << 10 - , mb: 1 << 20 - , gb: 1 << 30 - }; - - return map[type] * n; -}; - -/** - * convert bytes into string. - * - * @param {Number} b - bytes to convert - * @return {String} - * @api public - */ - -function convert (b) { - var gb = 1 << 30, mb = 1 << 20, kb = 1 << 10; - if (b >= gb) return (Math.round(b / gb * 100) / 100) + 'gb'; - if (b >= mb) return (Math.round(b / mb * 100) / 100) + 'mb'; - if (b >= kb) return (Math.round(b / kb * 100) / 100) + 'kb'; - return b + 'b'; -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/package.json deleted file mode 100644 index 0db9bc9..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/bytes/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "bytes", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "description": "byte size string parser / serializer", - "version": "0.2.0", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "readme": "# node-bytes\n\n Byte string parser / formatter.\n\n## Example:\n\n```js\nbytes('1kb')\n// => 1024\n\nbytes('2mb')\n// => 2097152\n\nbytes('1gb')\n// => 1073741824\n\nbytes(1073741824)\n// => 1gb\n```\n\n## Installation\n\n```\n$ npm install bytes\n$ component install visionmedia/bytes.js\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 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.\n", - "readmeFilename": "Readme.md", - "_id": "bytes@0.2.0", - "_from": "bytes@0.2.0" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/History.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/History.md deleted file mode 100644 index 9e30179..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/History.md +++ /dev/null @@ -1,11 +0,0 @@ - -1.0.1 / 2013-04-15 -================== - - * Revert "Changed underlying HMAC algo. to sha512." - * Revert "Fix for timing attacks on MAC verification." - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/Makefile b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/Makefile deleted file mode 100644 index 4e9c8d3..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --require should \ - --reporter spec - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/Readme.md deleted file mode 100644 index 2559e84..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/Readme.md +++ /dev/null @@ -1,42 +0,0 @@ - -# cookie-signature - - Sign and unsign cookies. - -## Example - -```js -var cookie = require('cookie-signature'); - -var val = cookie.sign('hello', 'tobiiscool'); -val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI'); - -var val = cookie.sign('hello', 'tobiiscool'); -cookie.unsign(val, 'tobiiscool').should.equal('hello'); -cookie.unsign(val, 'luna').should.be.false; -``` - -## License - -(The MIT License) - -Copyright (c) 2012 LearnBoost <tj@learnboost.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. \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/index.js deleted file mode 100644 index ed62814..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/index.js +++ /dev/null @@ -1,42 +0,0 @@ - -/** - * Module dependencies. - */ - -var crypto = require('crypto'); - -/** - * Sign the given `val` with `secret`. - * - * @param {String} val - * @param {String} secret - * @return {String} - * @api private - */ - -exports.sign = function(val, secret){ - if ('string' != typeof val) throw new TypeError('cookie required'); - if ('string' != typeof secret) throw new TypeError('secret required'); - return val + '.' + crypto - .createHmac('sha256', secret) - .update(val) - .digest('base64') - .replace(/\=+$/, ''); -}; - -/** - * Unsign and decode the given `val` with `secret`, - * returning `false` if the signature is invalid. - * - * @param {String} val - * @param {String} secret - * @return {String|Boolean} - * @api private - */ - -exports.unsign = function(val, secret){ - if ('string' != typeof val) throw new TypeError('cookie required'); - if ('string' != typeof secret) throw new TypeError('secret required'); - var str = val.slice(0, val.lastIndexOf('.')); - return exports.sign(str, secret) == val ? str : false; -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/package.json deleted file mode 100644 index 83bea32..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie-signature/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "cookie-signature", - "version": "1.0.1", - "description": "Sign and unsign cookies", - "keywords": [ - "cookie", - "sign", - "unsign" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@learnboost.com" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "main": "index", - "readme": "\n# cookie-signature\n\n Sign and unsign cookies.\n\n## Example\n\n```js\nvar cookie = require('cookie-signature');\n\nvar val = cookie.sign('hello', 'tobiiscool');\nval.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');\n\nvar val = cookie.sign('hello', 'tobiiscool');\ncookie.unsign(val, 'tobiiscool').should.equal('hello');\ncookie.unsign(val, 'luna').should.be.false;\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 LearnBoost <tj@learnboost.com>\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", - "_id": "cookie-signature@1.0.1", - "_from": "cookie-signature@1.0.1" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/.travis.yml b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/.travis.yml deleted file mode 100644 index 320698a..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/README.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/README.md deleted file mode 100644 index 5187ed1..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) # - -cookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers. - -See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies. - -## how? - -``` -npm install cookie -``` - -```javascript -var cookie = require('cookie'); - -var hdr = cookie.serialize('foo', 'bar'); -// hdr = 'foo=bar'; - -var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff'); -// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' }; -``` - -## more - -The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values. - -### path -> cookie path - -### expires -> absolute expiration date for the cookie (Date object) - -### maxAge -> relative max age of the cookie from when the client receives it (seconds) - -### domain -> domain for the cookie - -### secure -> true or false - -### httpOnly -> true or false - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/index.js deleted file mode 100644 index db04ad3..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/index.js +++ /dev/null @@ -1,61 +0,0 @@ - -/// Serialize the a name value pair into a cookie string suitable for -/// http headers. An optional options object specified cookie parameters -/// -/// serialize('foo', 'bar', { httpOnly: true }) -/// => "foo=bar; httpOnly" -/// -/// @param {String} name -/// @param {String} val -/// @param {Object} options -/// @return {String} -var serialize = function(name, val, opt){ - var pairs = [name + '=' + encode(val)]; - opt = opt || {}; - - if (opt.maxAge) pairs.push('Max-Age=' + opt.maxAge); - if (opt.domain) pairs.push('Domain=' + opt.domain); - if (opt.path) pairs.push('Path=' + opt.path); - if (opt.expires) pairs.push('Expires=' + opt.expires.toUTCString()); - if (opt.httpOnly) pairs.push('HttpOnly'); - if (opt.secure) pairs.push('Secure'); - - return pairs.join('; '); -}; - -/// Parse the given cookie header string into an object -/// The object has the various cookies as keys(names) => values -/// @param {String} str -/// @return {Object} -var parse = function(str) { - var obj = {} - var pairs = str.split(/[;,] */); - - pairs.forEach(function(pair) { - var eq_idx = pair.indexOf('=') - var key = pair.substr(0, eq_idx).trim() - var val = pair.substr(++eq_idx, pair.length).trim(); - - // quoted values - if ('"' == val[0]) { - val = val.slice(1, -1); - } - - // only assign once - if (undefined == obj[key]) { - try { - obj[key] = decode(val); - } catch (e) { - obj[key] = val; - } - } - }); - - return obj; -}; - -var encode = encodeURIComponent; -var decode = decodeURIComponent; - -module.exports.serialize = serialize; -module.exports.parse = parse; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/package.json deleted file mode 100644 index 208cdad..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "author": { - "name": "Roman Shtylman", - "email": "shtylman@gmail.com" - }, - "name": "cookie", - "description": "cookie parsing and serialization", - "version": "0.0.5", - "repository": { - "type": "git", - "url": "git://github.com/shtylman/node-cookie.git" - }, - "keywords": [ - "cookie", - "cookies" - ], - "main": "index.js", - "scripts": { - "test": "mocha" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "1.x.x" - }, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "# cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) #\n\ncookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers.\n\nSee [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies.\n\n## how?\n\n```\nnpm install cookie\n```\n\n```javascript\nvar cookie = require('cookie');\n\nvar hdr = cookie.serialize('foo', 'bar');\n// hdr = 'foo=bar';\n\nvar cookies = cookie.parse('foo=bar; cat=meow; dog=ruff');\n// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' };\n```\n\n## more\n\nThe serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values.\n\n### path\n> cookie path\n\n### expires\n> absolute expiration date for the cookie (Date object)\n\n### maxAge\n> relative max age of the cookie from when the client receives it (seconds)\n\n### domain\n> domain for the cookie\n\n### secure\n> true or false\n\n### httpOnly\n> true or false\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/shtylman/node-cookie/issues" - }, - "_id": "cookie@0.0.5", - "_from": "cookie@0.0.5" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/mocha.opts b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/mocha.opts deleted file mode 100644 index e2bfcc5..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/mocha.opts +++ /dev/null @@ -1 +0,0 @@ ---ui qunit diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/parse.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/parse.js deleted file mode 100644 index d8c03ab..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/parse.js +++ /dev/null @@ -1,28 +0,0 @@ - -var assert = require('assert'); - -var cookie = require('..'); - -suite('parse'); - -test('basic', function() { - assert.deepEqual({ foo: 'bar' }, cookie.parse('foo=bar')); - assert.deepEqual({ foo: '123' }, cookie.parse('foo=123')); -}); - -test('ignore spaces', function() { - assert.deepEqual({ FOO: 'bar', baz: 'raz' }, - cookie.parse('FOO = bar; baz = raz')); -}); - -test('escaping', function() { - assert.deepEqual({ foo: 'bar=123456789&name=Magic+Mouse' }, - cookie.parse('foo="bar=123456789&name=Magic+Mouse"')); - - assert.deepEqual({ email: ' ",;/' }, - cookie.parse('email=%20%22%2c%3b%2f')); -}); - -test('ignore escaping error and return original value', function() { - assert.deepEqual({ foo: '%1', bar: 'bar' }, cookie.parse('foo=%1;bar=bar')); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/serialize.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/serialize.js deleted file mode 100644 index d38768d..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/cookie/test/serialize.js +++ /dev/null @@ -1,59 +0,0 @@ -// builtin -var assert = require('assert'); - -var cookie = require('..'); - -suite('serialize'); - -test('basic', function() { - assert.equal('foo=bar', cookie.serialize('foo', 'bar')); - assert.equal('foo=bar%20baz', cookie.serialize('foo', 'bar baz')); -}); - -test('path', function() { - assert.equal('foo=bar; Path=/', cookie.serialize('foo', 'bar', { - path: '/' - })); -}); - -test('secure', function() { - assert.equal('foo=bar; Secure', cookie.serialize('foo', 'bar', { - secure: true - })); - - assert.equal('foo=bar', cookie.serialize('foo', 'bar', { - secure: false - })); -}); - -test('domain', function() { - assert.equal('foo=bar; Domain=example.com', cookie.serialize('foo', 'bar', { - domain: 'example.com' - })); -}); - -test('httpOnly', function() { - assert.equal('foo=bar; HttpOnly', cookie.serialize('foo', 'bar', { - httpOnly: true - })); -}); - -test('maxAge', function() { - assert.equal('foo=bar; Max-Age=1000', cookie.serialize('foo', 'bar', { - maxAge: 1000 - })); -}); - -test('escaping', function() { - assert.deepEqual('cat=%2B%20', cookie.serialize('cat', '+ ')); -}); - -test('parse->serialize', function() { - - assert.deepEqual({ cat: 'foo=123&name=baz five' }, cookie.parse( - cookie.serialize('cat', 'foo=123&name=baz five'))); - - assert.deepEqual({ cat: ' ";/' }, cookie.parse( - cookie.serialize('cat', ' ";/'))); -}); - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/History.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/History.md deleted file mode 100644 index f023269..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/History.md +++ /dev/null @@ -1,62 +0,0 @@ - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/Readme.md deleted file mode 100644 index 15ee501..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/Readme.md +++ /dev/null @@ -1,115 +0,0 @@ - -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -``` -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - a('doing some work'); -}, 1200); -``` - -## License - -(The MIT License) - -Copyright (c) 2011 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/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/component.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/component.json deleted file mode 100644 index 4ad0971..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/component.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "0.7.2", - "keywords": ["debug", "log", "debugger"], - "scripts": ["index.js", "debug.js"], - "dependencies": {} -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/debug.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/debug.js deleted file mode 100644 index e47ba5b..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/debug.js +++ /dev/null @@ -1,124 +0,0 @@ - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - if (!debug.enabled(name)) return function(){}; - - return function(fmt){ - var curr = new Date; - var ms = curr - (debug[name] || curr); - debug[name] = curr; - - fmt = name - + ' ' - + fmt - + ' +' + debug.humanize(ms); - - // This hackery is required for IE8 - // where `console.log` doesn't have 'apply' - window.console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); - } -} - -/** - * The currently active debug mode names. - */ - -debug.names = []; -debug.skips = []; - -/** - * Enables a debug mode by name. This can include modes - * separated by a colon and wildcards. - * - * @param {String} name - * @api public - */ - -debug.enable = function(name) { - try { - localStorage.debug = name; - } catch(e){} - - var split = (name || '').split(/[\s,]+/) - , len = split.length; - - for (var i = 0; i < len; i++) { - name = split[i].replace('*', '.*?'); - if (name[0] === '-') { - debug.skips.push(new RegExp('^' + name.substr(1) + '$')); - } - else { - debug.names.push(new RegExp('^' + name + '$')); - } - } -}; - -/** - * Disable debug output. - * - * @api public - */ - -debug.disable = function(){ - debug.enable(''); -}; - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -debug.humanize = function(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -}; - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -debug.enabled = function(name) { - for (var i = 0, len = debug.skips.length; i < len; i++) { - if (debug.skips[i].test(name)) { - return false; - } - } - for (var i = 0, len = debug.names.length; i < len; i++) { - if (debug.names[i].test(name)) { - return true; - } - } - return false; -}; - -// persist - -if (window.localStorage) debug.enable(localStorage.debug); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/app.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/app.js deleted file mode 100644 index 05374d9..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/app.js +++ /dev/null @@ -1,19 +0,0 @@ - -var debug = require('../')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/browser.html b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/browser.html deleted file mode 100644 index 7510eee..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/browser.html +++ /dev/null @@ -1,24 +0,0 @@ - - - debug() - - - - - - - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/wildcards.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/wildcards.js deleted file mode 100644 index 1fdac20..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/wildcards.js +++ /dev/null @@ -1,10 +0,0 @@ - -var debug = { - foo: require('../')('test:foo'), - bar: require('../')('test:bar'), - baz: require('../')('test:baz') -}; - -debug.foo('foo') -debug.bar('bar') -debug.baz('baz') \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/worker.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/worker.js deleted file mode 100644 index 7f6d288..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/example/worker.js +++ /dev/null @@ -1,22 +0,0 @@ - -// DEBUG=* node example/worker -// DEBUG=worker:* node example/worker -// DEBUG=worker:a node example/worker -// DEBUG=worker:b node example/worker - -var a = require('../')('worker:a') - , b = require('../')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/index.js deleted file mode 100644 index e02c13b..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/index.js +++ /dev/null @@ -1,5 +0,0 @@ -if ('undefined' == typeof window) { - module.exports = require('./lib/debug'); -} else { - module.exports = require('./debug'); -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/lib/debug.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/lib/debug.js deleted file mode 100644 index 0b07aa1..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/lib/debug.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Module dependencies. - */ - -var tty = require('tty'); - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Enabled debuggers. - */ - -var names = [] - , skips = []; - -(process.env.DEBUG || '') - .split(/[\s,]+/) - .forEach(function(name){ - name = name.replace('*', '.*?'); - if (name[0] === '-') { - skips.push(new RegExp('^' + name.substr(1) + '$')); - } else { - names.push(new RegExp('^' + name + '$')); - } - }); - -/** - * Colors. - */ - -var colors = [6, 2, 3, 4, 5, 1]; - -/** - * Previous debug() call. - */ - -var prev = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Is stdout a TTY? Colored output is disabled when `true`. - */ - -var isatty = tty.isatty(2); - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function color() { - return colors[prevColor++ % colors.length]; -} - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -function humanize(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -} - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - function disabled(){} - disabled.enabled = false; - - var match = skips.some(function(re){ - return re.test(name); - }); - - if (match) return disabled; - - match = names.some(function(re){ - return re.test(name); - }); - - if (!match) return disabled; - var c = color(); - - function colored(fmt) { - var curr = new Date; - var ms = curr - (prev[name] || curr); - prev[name] = curr; - - fmt = ' \u001b[9' + c + 'm' + name + ' ' - + '\u001b[3' + c + 'm\u001b[90m' - + fmt + '\u001b[3' + c + 'm' - + ' +' + humanize(ms) + '\u001b[0m'; - - console.error.apply(this, arguments); - } - - function plain(fmt) { - fmt = new Date().toUTCString() - + ' ' + name + ' ' + fmt; - console.error.apply(this, arguments); - } - - colored.enabled = plain.enabled = true; - - return isatty || process.env.DEBUG_COLORS - ? colored - : plain; -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/package.json deleted file mode 100644 index 82a663f..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/debug/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "debug", - "version": "0.7.2", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*" - }, - "main": "lib/debug.js", - "browserify": "debug.js", - "engines": { - "node": "*" - }, - "component": { - "scripts": { - "debug/index.js": "index.js", - "debug/debug.js": "debug.js" - } - }, - "readme": "\n# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n \nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n \n ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\". \n\n## Wildcards\n\n The \"*\" character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. \n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n a('doing some work');\n}, 1200);\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 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/debug/issues" - }, - "_id": "debug@0.7.2", - "_from": "debug@*", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/.npmignore deleted file mode 100644 index 4fbabb3..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -/test/tmp/ -*.upload -*.un~ -*.http diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/.travis.yml b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/.travis.yml deleted file mode 100644 index cb931cb..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 - - "0.10" diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/LICENSE b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/LICENSE deleted file mode 100644 index 38d3c9c..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (C) 2011 Felix Geisendörfer - -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/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/Readme.md deleted file mode 100644 index 08e9eca..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/Readme.md +++ /dev/null @@ -1,419 +0,0 @@ -# Formidable - -[![Build Status](https://secure.travis-ci.org/felixge/node-formidable.png?branch=master)](http://travis-ci.org/felixge/node-formidable) - -## Purpose - -A node.js module for parsing form data, especially file uploads. - -## Current status - -This module was developed for [Transloadit](http://transloadit.com/), a service focused on uploading -and encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from -a large variety of clients and is considered production-ready. - -## Features - -* Fast (~500mb/sec), non-buffering multipart parser -* Automatically writing file uploads to disk -* Low memory footprint -* Graceful error handling -* Very high test coverage - -## Installation - -Via [npm](http://github.com/isaacs/npm): -``` -npm install formidable@latest -``` -Manually: -``` -git clone git://github.com/felixge/node-formidable.git formidable -vim my.js -# var formidable = require('./formidable'); -``` - -Note: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library. - -## Example - -Parse an incoming file upload. -```javascript -var formidable = require('formidable'), - http = require('http'), - util = require('util'); - -http.createServer(function(req, res) { - if (req.url == '/upload' && req.method.toLowerCase() == 'post') { - // parse a file upload - var form = new formidable.IncomingForm(); - - form.parse(req, function(err, fields, files) { - res.writeHead(200, {'content-type': 'text/plain'}); - res.write('received upload:\n\n'); - res.end(util.inspect({fields: fields, files: files})); - }); - - return; - } - - // show a file upload form - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); -}).listen(8080); -``` -## API - -### Formidable.IncomingForm -```javascript -var form = new formidable.IncomingForm() -``` -Creates a new incoming form. - -```javascript -form.encoding = 'utf-8'; -``` -Sets encoding for incoming form fields. - -```javascript -form.uploadDir = process.env.TMP || process.env.TMPDIR || process.env.TEMP || '/tmp' || process.cwd(); -``` -The directory for placing file uploads in. You can move them later on using -`fs.rename()`. The default directory is picked at module load time depending on -the first existing directory from those listed above. - -```javascript -form.keepExtensions = false; -``` -If you want the files written to `form.uploadDir` to include the extensions of the original files, set this property to `true`. - -```javascript -form.type -``` -Either 'multipart' or 'urlencoded' depending on the incoming request. - -```javascript -form.maxFieldsSize = 2 * 1024 * 1024; -``` -Limits the amount of memory a field (not file) can allocate in bytes. -If this value is exceeded, an `'error'` event is emitted. The default -size is 2MB. - -```javascript -form.maxFields = 0; -``` -Limits the number of fields that the querystring parser will decode. Defaults -to 0 (unlimited). - -```javascript -form.hash = false; -``` -If you want checksums calculated for incoming files, set this to either `'sha1'` or `'md5'`. - -```javascript -form.bytesReceived -``` -The amount of bytes received for this form so far. - -```javascript -form.bytesExpected -``` -The expected number of bytes in this form. - -```javascript -form.parse(request, [cb]); -``` -Parses an incoming node.js `request` containing form data. If `cb` is provided, all fields an files are collected and passed to the callback: - - -```javascript -form.parse(req, function(err, fields, files) { - // ... -}); - -form.onPart(part); -``` -You may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events processing which would occur otherwise, making you fully responsible for handling the processing. - -```javascript -form.onPart = function(part) { - part.addListener('data', function() { - // ... - }); -} -``` -If you want to use formidable to only handle certain parts for you, you can do so: -```javascript -form.onPart = function(part) { - if (!part.filename) { - // let formidable handle all non-file parts - form.handlePart(part); - } -} -``` -Check the code in this method for further inspiration. - - -### Formidable.File -```javascript -file.size = 0 -``` -The size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet. -```javascript -file.path = null -``` -The path this file is being written to. You can modify this in the `'fileBegin'` event in -case you are unhappy with the way formidable generates a temporary path for your files. -```javascript -file.name = null -``` -The name this file had according to the uploading client. -```javascript -file.type = null -``` -The mime type of this file, according to the uploading client. -```javascript -file.lastModifiedDate = null -``` -A date object (or `null`) containing the time this file was last written to. Mostly -here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/). -```javascript -file.hash = null -``` -If hash calculation was set, you can read the hex digest out of this var. - -#### Formidable.File#toJSON() - - This method returns a JSON-representation of the file, allowing you to - `JSON.stringify()` the file which is useful for logging and responding - to requests. - -### Events - - -#### 'progress' -```javascript -form.on('progress', function(bytesReceived, bytesExpected) { -}); -``` -Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar. - - - -#### 'field' -```javascript -form.on('field', function(name, value) { -}); -``` - -#### 'fileBegin' - -Emitted whenever a field / value pair has been received. -```javascript -form.on('fileBegin', function(name, file) { -}); -``` - -#### 'file' - -Emitted whenever a new file is detected in the upload stream. Use this even if -you want to stream the file to somewhere else while buffering the upload on -the file system. - -Emitted whenever a field / file pair has been received. `file` is an instance of `File`. -```javascript -form.on('file', function(name, file) { -}); -``` - -#### 'error' - -Emitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events. -```javascript -form.on('error', function(err) { -}); -``` - -#### 'aborted' - - -Emitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core). -```javascript -form.on('aborted', function() { -}); -``` - -##### 'end' -```javascript -form.on('end', function() { -}); -``` -Emitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response. - - - -## Changelog - -### v1.0.14 - -* Add failing hash tests. (Ben Trask) -* Enable hash calculation again (Eugene Girshov) -* Test for immediate data events (Tim Smart) -* Re-arrange IncomingForm#parse (Tim Smart) - -### v1.0.13 - -* Only update hash if update method exists (Sven Lito) -* According to travis v0.10 needs to go quoted (Sven Lito) -* Bumping build node versions (Sven Lito) -* Additional fix for empty requests (Eugene Girshov) -* Change the default to 1000, to match the new Node behaviour. (OrangeDog) -* Add ability to control maxKeys in the querystring parser. (OrangeDog) -* Adjust test case to work with node 0.9.x (Eugene Girshov) -* Update package.json (Sven Lito) -* Path adjustment according to eb4468b (Markus Ast) - -### v1.0.12 - -* Emit error on aborted connections (Eugene Girshov) -* Add support for empty requests (Eugene Girshov) -* Fix name/filename handling in Content-Disposition (jesperp) -* Tolerate malformed closing boundary in multipart (Eugene Girshov) -* Ignore preamble in multipart messages (Eugene Girshov) -* Add support for application/json (Mike Frey, Carlos Rodriguez) -* Add support for Base64 encoding (Elmer Bulthuis) -* Add File#toJSON (TJ Holowaychuk) -* Remove support for Node.js 0.4 & 0.6 (Andrew Kelley) -* Documentation improvements (Sven Lito, Andre Azevedo) -* Add support for application/octet-stream (Ion Lupascu, Chris Scribner) -* Use os.tmpDir() to get tmp directory (Andrew Kelley) -* Improve package.json (Andrew Kelley, Sven Lito) -* Fix benchmark script (Andrew Kelley) -* Fix scope issue in incoming_forms (Sven Lito) -* Fix file handle leak on error (OrangeDog) - -### v1.0.11 - -* Calculate checksums for incoming files (sreuter) -* Add definition parameters to "IncomingForm" as an argument (Math-) - -### v1.0.10 - -* Make parts to be proper Streams (Matt Robenolt) - -### v1.0.9 - -* Emit progress when content length header parsed (Tim Koschützki) -* Fix Readme syntax due to GitHub changes (goob) -* Replace references to old 'sys' module in Readme with 'util' (Peter Sugihara) - -### v1.0.8 - -* Strip potentially unsafe characters when using `keepExtensions: true`. -* Switch to utest / urun for testing -* Add travis build - -### v1.0.7 - -* Remove file from package that was causing problems when installing on windows. (#102) -* Fix typos in Readme (Jason Davies). - -### v1.0.6 - -* Do not default to the default to the field name for file uploads where - filename="". - -### v1.0.5 - -* Support filename="" in multipart parts -* Explain unexpected end() errors in parser better - -**Note:** Starting with this version, formidable emits 'file' events for empty -file input fields. Previously those were incorrectly emitted as regular file -input fields with value = "". - -### v1.0.4 - -* Detect a good default tmp directory regardless of platform. (#88) - -### v1.0.3 - -* Fix problems with utf8 characters (#84) / semicolons in filenames (#58) -* Small performance improvements -* New test suite and fixture system - -### v1.0.2 - -* Exclude node\_modules folder from git -* Implement new `'aborted'` event -* Fix files in example folder to work with recent node versions -* Make gently a devDependency - -[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.1...v1.0.2) - -### v1.0.1 - -* Fix package.json to refer to proper main directory. (#68, Dean Landolt) - -[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.0...v1.0.1) - -### v1.0.0 - -* Add support for multipart boundaries that are quoted strings. (Jeff Craig) - -This marks the beginning of development on version 2.0 which will include -several architectural improvements. - -[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.11...v1.0.0) - -### v0.9.11 - -* Emit `'progress'` event when receiving data, regardless of parsing it. (Tim Koschützki) -* Use [W3C FileAPI Draft](http://dev.w3.org/2006/webapi/FileAPI/) properties for File class - -**Important:** The old property names of the File class will be removed in a -future release. - -[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.10...v0.9.11) - -### Older releases - -These releases were done before starting to maintain the above Changelog: - -* [v0.9.10](https://github.com/felixge/node-formidable/compare/v0.9.9...v0.9.10) -* [v0.9.9](https://github.com/felixge/node-formidable/compare/v0.9.8...v0.9.9) -* [v0.9.8](https://github.com/felixge/node-formidable/compare/v0.9.7...v0.9.8) -* [v0.9.7](https://github.com/felixge/node-formidable/compare/v0.9.6...v0.9.7) -* [v0.9.6](https://github.com/felixge/node-formidable/compare/v0.9.5...v0.9.6) -* [v0.9.5](https://github.com/felixge/node-formidable/compare/v0.9.4...v0.9.5) -* [v0.9.4](https://github.com/felixge/node-formidable/compare/v0.9.3...v0.9.4) -* [v0.9.3](https://github.com/felixge/node-formidable/compare/v0.9.2...v0.9.3) -* [v0.9.2](https://github.com/felixge/node-formidable/compare/v0.9.1...v0.9.2) -* [v0.9.1](https://github.com/felixge/node-formidable/compare/v0.9.0...v0.9.1) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.1.0](https://github.com/felixge/node-formidable/commits/v0.1.0) - -## License - -Formidable is licensed under the MIT license. - -## Ports - -* [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable - -## Credits - -* [Ryan Dahl](http://twitter.com/ryah) for his work on [http-parser](http://github.com/ry/http-parser) which heavily inspired multipart_parser.js diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js deleted file mode 100644 index 49abc43..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +++ /dev/null @@ -1,71 +0,0 @@ -var assert = require('assert'); -require('../test/common'); -var multipartParser = require('../lib/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - parser = new MultipartParser(), - Buffer = require('buffer').Buffer, - boundary = '-----------------------------168072824752491622650073', - mb = 100, - buffer = createMultipartBuffer(boundary, mb * 1024 * 1024), - callbacks = - { partBegin: -1, - partEnd: -1, - headerField: -1, - headerValue: -1, - partData: -1, - end: -1, - }; - - -parser.initWithBoundary(boundary); -parser.onHeaderField = function() { - callbacks.headerField++; -}; - -parser.onHeaderValue = function() { - callbacks.headerValue++; -}; - -parser.onPartBegin = function() { - callbacks.partBegin++; -}; - -parser.onPartData = function() { - callbacks.partData++; -}; - -parser.onPartEnd = function() { - callbacks.partEnd++; -}; - -parser.onEnd = function() { - callbacks.end++; -}; - -var start = +new Date(), - nparsed = parser.write(buffer), - duration = +new Date - start, - mbPerSec = (mb / (duration / 1000)).toFixed(2); - -console.log(mbPerSec+' mb/sec'); - -assert.equal(nparsed, buffer.length); - -function createMultipartBuffer(boundary, size) { - var head = - '--'+boundary+'\r\n' - + 'content-disposition: form-data; name="field1"\r\n' - + '\r\n' - , tail = '\r\n--'+boundary+'--\r\n' - , buffer = new Buffer(size); - - buffer.write(head, 'ascii', 0); - buffer.write(tail, 'ascii', buffer.length - tail.length); - return buffer; -} - -process.on('exit', function() { - for (var k in callbacks) { - assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]); - } -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/json.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/json.js deleted file mode 100644 index eb8a724..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/json.js +++ /dev/null @@ -1,67 +0,0 @@ -var common = require('../test/common'), - http = require('http'), - util = require('util'), - formidable = common.formidable, - Buffer = require('buffer').Buffer, - port = common.port, - server; - -server = http.createServer(function(req, res) { - if (req.method !== 'POST') { - res.writeHead(200, {'content-type': 'text/plain'}) - res.end('Please POST a JSON payload to http://localhost:'+port+'/') - return; - } - - var form = new formidable.IncomingForm(), - fields = {}; - - form - .on('error', function(err) { - res.writeHead(500, {'content-type': 'text/plain'}); - res.end('error:\n\n'+util.inspect(err)); - console.error(err); - }) - .on('field', function(field, value) { - console.log(field, value); - fields[field] = value; - }) - .on('end', function() { - console.log('-> post done'); - res.writeHead(200, {'content-type': 'text/plain'}); - res.end('received fields:\n\n '+util.inspect(fields)); - }); - form.parse(req); -}); -server.listen(port); - -console.log('listening on http://localhost:'+port+'/'); - - -var request = http.request({ - host: 'localhost', - path: '/', - port: port, - method: 'POST', - headers: { 'content-type':'application/json', 'content-length':48 } -}, function(response) { - var data = ''; - console.log('\nServer responded with:'); - console.log('Status:', response.statusCode); - response.pipe(process.stdout); - response.on('end', function() { - console.log('\n') - process.exit(); - }); - // response.on('data', function(chunk) { - // data += chunk.toString('utf8'); - // }); - // response.on('end', function() { - // console.log('Response Data:') - // console.log(data); - // process.exit(); - // }); -}) - -request.write('{"numbers":[1,2,3,4,5],"nested":{"key":"value"}}'); -request.end(); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/post.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/post.js deleted file mode 100644 index f6c15a6..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/post.js +++ /dev/null @@ -1,43 +0,0 @@ -require('../test/common'); -var http = require('http'), - util = require('util'), - formidable = require('formidable'), - server; - -server = http.createServer(function(req, res) { - if (req.url == '/') { - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - } else if (req.url == '/post') { - var form = new formidable.IncomingForm(), - fields = []; - - form - .on('error', function(err) { - res.writeHead(200, {'content-type': 'text/plain'}); - res.end('error:\n\n'+util.inspect(err)); - }) - .on('field', function(field, value) { - console.log(field, value); - fields.push([field, value]); - }) - .on('end', function() { - console.log('-> post done'); - res.writeHead(200, {'content-type': 'text/plain'}); - res.end('received fields:\n\n '+util.inspect(fields)); - }); - form.parse(req); - } else { - res.writeHead(404, {'content-type': 'text/plain'}); - res.end('404'); - } -}); -server.listen(TEST_PORT); - -console.log('listening on http://localhost:'+TEST_PORT+'/'); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/upload.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/upload.js deleted file mode 100644 index 050cdd9..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/example/upload.js +++ /dev/null @@ -1,48 +0,0 @@ -require('../test/common'); -var http = require('http'), - util = require('util'), - formidable = require('formidable'), - server; - -server = http.createServer(function(req, res) { - if (req.url == '/') { - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - } else if (req.url == '/upload') { - var form = new formidable.IncomingForm(), - files = [], - fields = []; - - form.uploadDir = TEST_TMP; - - form - .on('field', function(field, value) { - console.log(field, value); - fields.push([field, value]); - }) - .on('file', function(field, file) { - console.log(field, file); - files.push([field, file]); - }) - .on('end', function() { - console.log('-> upload done'); - res.writeHead(200, {'content-type': 'text/plain'}); - res.write('received fields:\n\n '+util.inspect(fields)); - res.write('\n\n'); - res.end('received files:\n\n '+util.inspect(files)); - }); - form.parse(req); - } else { - res.writeHead(404, {'content-type': 'text/plain'}); - res.end('404'); - } -}); -server.listen(TEST_PORT); - -console.log('listening on http://localhost:'+TEST_PORT+'/'); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/index.js deleted file mode 100644 index 4cc88b3..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/file.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/file.js deleted file mode 100644 index e34c10e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/file.js +++ /dev/null @@ -1,72 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -var util = require('util'), - WriteStream = require('fs').WriteStream, - EventEmitter = require('events').EventEmitter, - crypto = require('crypto'); - -function File(properties) { - EventEmitter.call(this); - - this.size = 0; - this.path = null; - this.name = null; - this.type = null; - this.hash = null; - this.lastModifiedDate = null; - - this._writeStream = null; - - for (var key in properties) { - this[key] = properties[key]; - } - - if(typeof this.hash === 'string') { - this.hash = crypto.createHash(properties.hash); - } else { - this.hash = null; - } -} -module.exports = File; -util.inherits(File, EventEmitter); - -File.prototype.open = function() { - this._writeStream = new WriteStream(this.path); -}; - -File.prototype.toJSON = function() { - return { - size: this.size, - path: this.path, - name: this.name, - type: this.type, - mtime: this.lastModifiedDate, - length: this.length, - filename: this.filename, - mime: this.mime - }; -}; - -File.prototype.write = function(buffer, cb) { - var self = this; - if (self.hash) { - self.hash.update(buffer); - } - this._writeStream.write(buffer, function() { - self.lastModifiedDate = new Date(); - self.size += buffer.length; - self.emit('progress', self.size); - cb(); - }); -}; - -File.prototype.end = function(cb) { - var self = this; - if (self.hash) { - self.hash = self.hash.digest('hex'); - } - this._writeStream.end(function() { - self.emit('end'); - cb(); - }); -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/incoming_form.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/incoming_form.js deleted file mode 100644 index c2eeaf8..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/incoming_form.js +++ /dev/null @@ -1,535 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -var fs = require('fs'); -var util = require('util'), - path = require('path'), - File = require('./file'), - MultipartParser = require('./multipart_parser').MultipartParser, - QuerystringParser = require('./querystring_parser').QuerystringParser, - OctetParser = require('./octet_parser').OctetParser, - JSONParser = require('./json_parser').JSONParser, - StringDecoder = require('string_decoder').StringDecoder, - EventEmitter = require('events').EventEmitter, - Stream = require('stream').Stream, - os = require('os'); - -function IncomingForm(opts) { - if (!(this instanceof IncomingForm)) return new IncomingForm(opts); - EventEmitter.call(this); - - opts=opts||{}; - - this.error = null; - this.ended = false; - - this.maxFields = opts.maxFields || 1000; - this.maxFieldsSize = opts.maxFieldsSize || 2 * 1024 * 1024; - this.keepExtensions = opts.keepExtensions || false; - this.uploadDir = opts.uploadDir || os.tmpDir(); - this.encoding = opts.encoding || 'utf-8'; - this.headers = null; - this.type = null; - this.hash = false; - - this.bytesReceived = null; - this.bytesExpected = null; - - this._parser = null; - this._flushing = 0; - this._fieldsSize = 0; - this.openedFiles = []; - - return this; -}; -util.inherits(IncomingForm, EventEmitter); -exports.IncomingForm = IncomingForm; - -IncomingForm.prototype.parse = function(req, cb) { - this.pause = function() { - try { - req.pause(); - } catch (err) { - // the stream was destroyed - if (!this.ended) { - // before it was completed, crash & burn - this._error(err); - } - return false; - } - return true; - }; - - this.resume = function() { - try { - req.resume(); - } catch (err) { - // the stream was destroyed - if (!this.ended) { - // before it was completed, crash & burn - this._error(err); - } - return false; - } - - return true; - }; - - // Setup callback first, so we don't miss anything from data events emitted - // immediately. - if (cb) { - var fields = {}, files = {}; - this - .on('field', function(name, value) { - fields[name] = value; - }) - .on('file', function(name, file) { - files[name] = file; - }) - .on('error', function(err) { - cb(err, fields, files); - }) - .on('end', function() { - cb(null, fields, files); - }); - } - - // Parse headers and setup the parser, ready to start listening for data. - this.writeHeaders(req.headers); - - // Start listening for data. - var self = this; - req - .on('error', function(err) { - self._error(err); - }) - .on('aborted', function() { - self.emit('aborted'); - self._error(new Error('Request aborted')); - }) - .on('data', function(buffer) { - self.write(buffer); - }) - .on('end', function() { - if (self.error) { - return; - } - - var err = self._parser.end(); - if (err) { - self._error(err); - } - }); - - return this; -}; - -IncomingForm.prototype.writeHeaders = function(headers) { - this.headers = headers; - this._parseContentLength(); - this._parseContentType(); -}; - -IncomingForm.prototype.write = function(buffer) { - if (!this._parser) { - this._error(new Error('unintialized parser')); - return; - } - - this.bytesReceived += buffer.length; - this.emit('progress', this.bytesReceived, this.bytesExpected); - - var bytesParsed = this._parser.write(buffer); - if (bytesParsed !== buffer.length) { - this._error(new Error('parser error, '+bytesParsed+' of '+buffer.length+' bytes parsed')); - } - - return bytesParsed; -}; - -IncomingForm.prototype.pause = function() { - // this does nothing, unless overwritten in IncomingForm.parse - return false; -}; - -IncomingForm.prototype.resume = function() { - // this does nothing, unless overwritten in IncomingForm.parse - return false; -}; - -IncomingForm.prototype.onPart = function(part) { - // this method can be overwritten by the user - this.handlePart(part); -}; - -IncomingForm.prototype.handlePart = function(part) { - var self = this; - - if (part.filename === undefined) { - var value = '' - , decoder = new StringDecoder(this.encoding); - - part.on('data', function(buffer) { - self._fieldsSize += buffer.length; - if (self._fieldsSize > self.maxFieldsSize) { - self._error(new Error('maxFieldsSize exceeded, received '+self._fieldsSize+' bytes of field data')); - return; - } - value += decoder.write(buffer); - }); - - part.on('end', function() { - self.emit('field', part.name, value); - }); - return; - } - - this._flushing++; - - var file = new File({ - path: this._uploadPath(part.filename), - name: part.filename, - type: part.mime, - hash: self.hash - }); - - this.emit('fileBegin', part.name, file); - - file.open(); - this.openedFiles.push(file); - - part.on('data', function(buffer) { - self.pause(); - file.write(buffer, function() { - self.resume(); - }); - }); - - part.on('end', function() { - file.end(function() { - self._flushing--; - self.emit('file', part.name, file); - self._maybeEnd(); - }); - }); -}; - -function dummyParser(self) { - return { - end: function () { - self.ended = true; - self._maybeEnd(); - return null; - } - }; -} - -IncomingForm.prototype._parseContentType = function() { - if (this.bytesExpected === 0) { - this._parser = dummyParser(this); - return; - } - - if (!this.headers['content-type']) { - this._error(new Error('bad content-type header, no content-type')); - return; - } - - if (this.headers['content-type'].match(/octet-stream/i)) { - this._initOctetStream(); - return; - } - - if (this.headers['content-type'].match(/urlencoded/i)) { - this._initUrlencoded(); - return; - } - - if (this.headers['content-type'].match(/multipart/i)) { - var m; - if (m = this.headers['content-type'].match(/boundary=(?:"([^"]+)"|([^;]+))/i)) { - this._initMultipart(m[1] || m[2]); - } else { - this._error(new Error('bad content-type header, no multipart boundary')); - } - return; - } - - if (this.headers['content-type'].match(/json/i)) { - this._initJSONencoded(); - return; - } - - this._error(new Error('bad content-type header, unknown content-type: '+this.headers['content-type'])); -}; - -IncomingForm.prototype._error = function(err) { - if (this.error || this.ended) { - return; - } - - this.error = err; - this.pause(); - this.emit('error', err); - - if (Array.isArray(this.openedFiles)) { - this.openedFiles.forEach(function(file) { - file._writeStream.destroy(); - setTimeout(fs.unlink, 0, file.path); - }); - } -}; - -IncomingForm.prototype._parseContentLength = function() { - this.bytesReceived = 0; - if (this.headers['content-length']) { - this.bytesExpected = parseInt(this.headers['content-length'], 10); - } else if (this.headers['transfer-encoding'] === undefined) { - this.bytesExpected = 0; - } - - if (this.bytesExpected !== null) { - this.emit('progress', this.bytesReceived, this.bytesExpected); - } -}; - -IncomingForm.prototype._newParser = function() { - return new MultipartParser(); -}; - -IncomingForm.prototype._initMultipart = function(boundary) { - this.type = 'multipart'; - - var parser = new MultipartParser(), - self = this, - headerField, - headerValue, - part; - - parser.initWithBoundary(boundary); - - parser.onPartBegin = function() { - part = new Stream(); - part.readable = true; - part.headers = {}; - part.name = null; - part.filename = null; - part.mime = null; - - part.transferEncoding = 'binary'; - part.transferBuffer = ''; - - headerField = ''; - headerValue = ''; - }; - - parser.onHeaderField = function(b, start, end) { - headerField += b.toString(self.encoding, start, end); - }; - - parser.onHeaderValue = function(b, start, end) { - headerValue += b.toString(self.encoding, start, end); - }; - - parser.onHeaderEnd = function() { - headerField = headerField.toLowerCase(); - part.headers[headerField] = headerValue; - - var m; - if (headerField == 'content-disposition') { - if (m = headerValue.match(/\bname="([^"]+)"/i)) { - part.name = m[1]; - } - - part.filename = self._fileName(headerValue); - } else if (headerField == 'content-type') { - part.mime = headerValue; - } else if (headerField == 'content-transfer-encoding') { - part.transferEncoding = headerValue.toLowerCase(); - } - - headerField = ''; - headerValue = ''; - }; - - parser.onHeadersEnd = function() { - switch(part.transferEncoding){ - case 'binary': - case '7bit': - case '8bit': - parser.onPartData = function(b, start, end) { - part.emit('data', b.slice(start, end)); - }; - - parser.onPartEnd = function() { - part.emit('end'); - }; - break; - - case 'base64': - parser.onPartData = function(b, start, end) { - part.transferBuffer += b.slice(start, end).toString('ascii'); - - /* - four bytes (chars) in base64 converts to three bytes in binary - encoding. So we should always work with a number of bytes that - can be divided by 4, it will result in a number of buytes that - can be divided vy 3. - */ - var offset = parseInt(part.transferBuffer.length / 4) * 4; - part.emit('data', new Buffer(part.transferBuffer.substring(0, offset), 'base64')) - part.transferBuffer = part.transferBuffer.substring(offset); - }; - - parser.onPartEnd = function() { - part.emit('data', new Buffer(part.transferBuffer, 'base64')) - part.emit('end'); - }; - break; - - default: - return self._error(new Error('unknown transfer-encoding')); - } - - self.onPart(part); - }; - - - parser.onEnd = function() { - self.ended = true; - self._maybeEnd(); - }; - - this._parser = parser; -}; - -IncomingForm.prototype._fileName = function(headerValue) { - var m = headerValue.match(/\bfilename="(.*?)"($|; )/i); - if (!m) return; - - var filename = m[1].substr(m[1].lastIndexOf('\\') + 1); - filename = filename.replace(/%22/g, '"'); - filename = filename.replace(/&#([\d]{4});/g, function(m, code) { - return String.fromCharCode(code); - }); - return filename; -}; - -IncomingForm.prototype._initUrlencoded = function() { - this.type = 'urlencoded'; - - var parser = new QuerystringParser(this.maxFields) - , self = this; - - parser.onField = function(key, val) { - self.emit('field', key, val); - }; - - parser.onEnd = function() { - self.ended = true; - self._maybeEnd(); - }; - - this._parser = parser; -}; - -IncomingForm.prototype._initOctetStream = function() { - this.type = 'octet-stream'; - var filename = this.headers['x-file-name']; - var mime = this.headers['content-type']; - - var file = new File({ - path: this._uploadPath(filename), - name: filename, - type: mime - }); - - file.open(); - - this.emit('fileBegin', filename, file); - - this._flushing++; - - var self = this; - - self._parser = new OctetParser(); - - //Keep track of writes that haven't finished so we don't emit the file before it's done being written - var outstandingWrites = 0; - - self._parser.on('data', function(buffer){ - self.pause(); - outstandingWrites++; - - file.write(buffer, function() { - outstandingWrites--; - self.resume(); - - if(self.ended){ - self._parser.emit('doneWritingFile'); - } - }); - }); - - self._parser.on('end', function(){ - self._flushing--; - self.ended = true; - - var done = function(){ - self.emit('file', 'file', file); - self._maybeEnd(); - }; - - if(outstandingWrites === 0){ - done(); - } else { - self._parser.once('doneWritingFile', done); - } - }); -}; - -IncomingForm.prototype._initJSONencoded = function() { - this.type = 'json'; - - var parser = new JSONParser() - , self = this; - - if (this.bytesExpected) { - parser.initWithLength(this.bytesExpected); - } - - parser.onField = function(key, val) { - self.emit('field', key, val); - } - - parser.onEnd = function() { - self.ended = true; - self._maybeEnd(); - }; - - this._parser = parser; -}; - -IncomingForm.prototype._uploadPath = function(filename) { - var name = ''; - for (var i = 0; i < 32; i++) { - name += Math.floor(Math.random() * 16).toString(16); - } - - if (this.keepExtensions) { - var ext = path.extname(filename); - ext = ext.replace(/(\.[a-z0-9]+).*/, '$1'); - - name += ext; - } - - return path.join(this.uploadDir, name); -}; - -IncomingForm.prototype._maybeEnd = function() { - if (!this.ended || this._flushing || this.error) { - return; - } - - this.emit('end'); -}; - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/index.js deleted file mode 100644 index 7a6e3e1..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/index.js +++ /dev/null @@ -1,3 +0,0 @@ -var IncomingForm = require('./incoming_form').IncomingForm; -IncomingForm.IncomingForm = IncomingForm; -module.exports = IncomingForm; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/json_parser.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/json_parser.js deleted file mode 100644 index 6ce966b..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/json_parser.js +++ /dev/null @@ -1,35 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -var Buffer = require('buffer').Buffer - -function JSONParser() { - this.data = new Buffer(''); - this.bytesWritten = 0; -}; -exports.JSONParser = JSONParser; - -JSONParser.prototype.initWithLength = function(length) { - this.data = new Buffer(length); -} - -JSONParser.prototype.write = function(buffer) { - if (this.data.length >= this.bytesWritten + buffer.length) { - buffer.copy(this.data, this.bytesWritten); - } else { - this.data = Buffer.concat([this.data, buffer]); - } - this.bytesWritten += buffer.length; - return buffer.length; -} - -JSONParser.prototype.end = function() { - try { - var fields = JSON.parse(this.data.toString('utf8')) - for (var field in fields) { - this.onField(field, fields[field]); - } - } catch (e) {} - this.data = null; - - this.onEnd(); -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/multipart_parser.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/multipart_parser.js deleted file mode 100644 index 98a6856..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +++ /dev/null @@ -1,324 +0,0 @@ -var Buffer = require('buffer').Buffer, - s = 0, - S = - { PARSER_UNINITIALIZED: s++, - START: s++, - START_BOUNDARY: s++, - HEADER_FIELD_START: s++, - HEADER_FIELD: s++, - HEADER_VALUE_START: s++, - HEADER_VALUE: s++, - HEADER_VALUE_ALMOST_DONE: s++, - HEADERS_ALMOST_DONE: s++, - PART_DATA_START: s++, - PART_DATA: s++, - PART_END: s++, - END: s++ - }, - - f = 1, - F = - { PART_BOUNDARY: f, - LAST_BOUNDARY: f *= 2 - }, - - LF = 10, - CR = 13, - SPACE = 32, - HYPHEN = 45, - COLON = 58, - A = 97, - Z = 122, - - lower = function(c) { - return c | 0x20; - }; - -for (s in S) { - exports[s] = S[s]; -} - -function MultipartParser() { - this.boundary = null; - this.boundaryChars = null; - this.lookbehind = null; - this.state = S.PARSER_UNINITIALIZED; - - this.index = null; - this.flags = 0; -}; -exports.MultipartParser = MultipartParser; - -MultipartParser.stateToString = function(stateNumber) { - for (var state in S) { - var number = S[state]; - if (number === stateNumber) return state; - } -}; - -MultipartParser.prototype.initWithBoundary = function(str) { - this.boundary = new Buffer(str.length+4); - this.boundary.write('\r\n--', 'ascii', 0); - this.boundary.write(str, 'ascii', 4); - this.lookbehind = new Buffer(this.boundary.length+8); - this.state = S.START; - - this.boundaryChars = {}; - for (var i = 0; i < this.boundary.length; i++) { - this.boundaryChars[this.boundary[i]] = true; - } -}; - -MultipartParser.prototype.write = function(buffer) { - var self = this, - i = 0, - len = buffer.length, - prevIndex = this.index, - index = this.index, - state = this.state, - flags = this.flags, - lookbehind = this.lookbehind, - boundary = this.boundary, - boundaryChars = this.boundaryChars, - boundaryLength = this.boundary.length, - boundaryEnd = boundaryLength - 1, - bufferLength = buffer.length, - c, - cl, - - mark = function(name) { - self[name+'Mark'] = i; - }, - clear = function(name) { - delete self[name+'Mark']; - }, - callback = function(name, buffer, start, end) { - if (start !== undefined && start === end) { - return; - } - - var callbackSymbol = 'on'+name.substr(0, 1).toUpperCase()+name.substr(1); - if (callbackSymbol in self) { - self[callbackSymbol](buffer, start, end); - } - }, - dataCallback = function(name, clear) { - var markSymbol = name+'Mark'; - if (!(markSymbol in self)) { - return; - } - - if (!clear) { - callback(name, buffer, self[markSymbol], buffer.length); - self[markSymbol] = 0; - } else { - callback(name, buffer, self[markSymbol], i); - delete self[markSymbol]; - } - }; - - for (i = 0; i < len; i++) { - c = buffer[i]; - switch (state) { - case S.PARSER_UNINITIALIZED: - return i; - case S.START: - index = 0; - state = S.START_BOUNDARY; - case S.START_BOUNDARY: - if (index == boundary.length - 2) { - if (c != CR) { - return i; - } - index++; - break; - } else if (index - 1 == boundary.length - 2) { - if (c != LF) { - return i; - } - index = 0; - callback('partBegin'); - state = S.HEADER_FIELD_START; - break; - } - - if (c != boundary[index+2]) { - index = -2; - } - if (c == boundary[index+2]) { - index++; - } - break; - case S.HEADER_FIELD_START: - state = S.HEADER_FIELD; - mark('headerField'); - index = 0; - case S.HEADER_FIELD: - if (c == CR) { - clear('headerField'); - state = S.HEADERS_ALMOST_DONE; - break; - } - - index++; - if (c == HYPHEN) { - break; - } - - if (c == COLON) { - if (index == 1) { - // empty header field - return i; - } - dataCallback('headerField', true); - state = S.HEADER_VALUE_START; - break; - } - - cl = lower(c); - if (cl < A || cl > Z) { - return i; - } - break; - case S.HEADER_VALUE_START: - if (c == SPACE) { - break; - } - - mark('headerValue'); - state = S.HEADER_VALUE; - case S.HEADER_VALUE: - if (c == CR) { - dataCallback('headerValue', true); - callback('headerEnd'); - state = S.HEADER_VALUE_ALMOST_DONE; - } - break; - case S.HEADER_VALUE_ALMOST_DONE: - if (c != LF) { - return i; - } - state = S.HEADER_FIELD_START; - break; - case S.HEADERS_ALMOST_DONE: - if (c != LF) { - return i; - } - - callback('headersEnd'); - state = S.PART_DATA_START; - break; - case S.PART_DATA_START: - state = S.PART_DATA; - mark('partData'); - case S.PART_DATA: - prevIndex = index; - - if (index == 0) { - // boyer-moore derrived algorithm to safely skip non-boundary data - i += boundaryEnd; - while (i < bufferLength && !(buffer[i] in boundaryChars)) { - i += boundaryLength; - } - i -= boundaryEnd; - c = buffer[i]; - } - - if (index < boundary.length) { - if (boundary[index] == c) { - if (index == 0) { - dataCallback('partData', true); - } - index++; - } else { - index = 0; - } - } else if (index == boundary.length) { - index++; - if (c == CR) { - // CR = part boundary - flags |= F.PART_BOUNDARY; - } else if (c == HYPHEN) { - // HYPHEN = end boundary - flags |= F.LAST_BOUNDARY; - } else { - index = 0; - } - } else if (index - 1 == boundary.length) { - if (flags & F.PART_BOUNDARY) { - index = 0; - if (c == LF) { - // unset the PART_BOUNDARY flag - flags &= ~F.PART_BOUNDARY; - callback('partEnd'); - callback('partBegin'); - state = S.HEADER_FIELD_START; - break; - } - } else if (flags & F.LAST_BOUNDARY) { - if (c == HYPHEN) { - callback('partEnd'); - callback('end'); - state = S.END; - } else { - index = 0; - } - } else { - index = 0; - } - } - - if (index > 0) { - // when matching a possible boundary, keep a lookbehind reference - // in case it turns out to be a false lead - lookbehind[index-1] = c; - } else if (prevIndex > 0) { - // if our boundary turned out to be rubbish, the captured lookbehind - // belongs to partData - callback('partData', lookbehind, 0, prevIndex); - prevIndex = 0; - mark('partData'); - - // reconsider the current character even so it interrupted the sequence - // it could be the beginning of a new sequence - i--; - } - - break; - case S.END: - break; - default: - return i; - } - } - - dataCallback('headerField'); - dataCallback('headerValue'); - dataCallback('partData'); - - this.index = index; - this.state = state; - this.flags = flags; - - return len; -}; - -MultipartParser.prototype.end = function() { - var callback = function(self, name) { - var callbackSymbol = 'on'+name.substr(0, 1).toUpperCase()+name.substr(1); - if (callbackSymbol in self) { - self[callbackSymbol](); - } - }; - if ((this.state == S.HEADER_FIELD_START && this.index == 0) || - (this.state == S.PART_DATA && this.index == this.boundary.length)) { - callback(this, 'partEnd'); - callback(this, 'end'); - } else if (this.state != S.END) { - return new Error('MultipartParser.end(): stream ended unexpectedly: ' + this.explain()); - } -}; - -MultipartParser.prototype.explain = function() { - return 'state = ' + MultipartParser.stateToString(this.state); -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/octet_parser.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/octet_parser.js deleted file mode 100644 index 6e8b551..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/octet_parser.js +++ /dev/null @@ -1,20 +0,0 @@ -var EventEmitter = require('events').EventEmitter - , util = require('util'); - -function OctetParser(options){ - if(!(this instanceof OctetParser)) return new OctetParser(options); - EventEmitter.call(this); -} - -util.inherits(OctetParser, EventEmitter); - -exports.OctetParser = OctetParser; - -OctetParser.prototype.write = function(buffer) { - this.emit('data', buffer); - return buffer.length; -}; - -OctetParser.prototype.end = function() { - this.emit('end'); -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/querystring_parser.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/querystring_parser.js deleted file mode 100644 index 320ce5a..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +++ /dev/null @@ -1,27 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -// This is a buffering parser, not quite as nice as the multipart one. -// If I find time I'll rewrite this to be fully streaming as well -var querystring = require('querystring'); - -function QuerystringParser(maxKeys) { - this.maxKeys = maxKeys; - this.buffer = ''; -}; -exports.QuerystringParser = QuerystringParser; - -QuerystringParser.prototype.write = function(buffer) { - this.buffer += buffer.toString('ascii'); - return buffer.length; -}; - -QuerystringParser.prototype.end = function() { - var fields = querystring.parse(this.buffer, '&', '=', { maxKeys: this.maxKeys }); - for (var field in fields) { - this.onField(field, fields[field]); - } - this.buffer = ''; - - this.onEnd(); -}; - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/package.json deleted file mode 100644 index 4679a11..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "formidable", - "description": "A node.js module for parsing form data, especially file uploads.", - "homepage": "https://github.com/felixge/node-formidable", - "version": "1.0.14", - "devDependencies": { - "gently": "0.8.0", - "findit": "0.1.1", - "hashish": "0.0.4", - "urun": "~0.0.6", - "utest": "0.0.3", - "request": "~2.11.4" - }, - "directories": { - "lib": "./lib" - }, - "main": "./lib/index", - "scripts": { - "test": "node test/run.js", - "clean": "rm test/tmp/*" - }, - "engines": { - "node": ">=0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-formidable.git" - }, - "bugs": { - "url": "http://github.com/felixge/node-formidable/issues" - }, - "optionalDependencies": {}, - "readme": "# Formidable\n\n[![Build Status](https://secure.travis-ci.org/felixge/node-formidable.png?branch=master)](http://travis-ci.org/felixge/node-formidable)\n\n## Purpose\n\nA node.js module for parsing form data, especially file uploads.\n\n## Current status\n\nThis module was developed for [Transloadit](http://transloadit.com/), a service focused on uploading\nand encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from\na large variety of clients and is considered production-ready.\n\n## Features\n\n* Fast (~500mb/sec), non-buffering multipart parser\n* Automatically writing file uploads to disk\n* Low memory footprint\n* Graceful error handling\n* Very high test coverage\n\n## Installation\n\nVia [npm](http://github.com/isaacs/npm):\n```\nnpm install formidable@latest\n```\nManually:\n```\ngit clone git://github.com/felixge/node-formidable.git formidable\nvim my.js\n# var formidable = require('./formidable');\n```\n\nNote: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library.\n\n## Example\n\nParse an incoming file upload.\n```javascript\nvar formidable = require('formidable'),\n http = require('http'),\n util = require('util');\n\nhttp.createServer(function(req, res) {\n if (req.url == '/upload' && req.method.toLowerCase() == 'post') {\n // parse a file upload\n var form = new formidable.IncomingForm();\n\n form.parse(req, function(err, fields, files) {\n res.writeHead(200, {'content-type': 'text/plain'});\n res.write('received upload:\\n\\n');\n res.end(util.inspect({fields: fields, files: files}));\n });\n\n return;\n }\n\n // show a file upload form\n res.writeHead(200, {'content-type': 'text/html'});\n res.end(\n '
    '+\n '
    '+\n '
    '+\n ''+\n '
    '\n );\n}).listen(8080);\n```\n## API\n\n### Formidable.IncomingForm\n```javascript\nvar form = new formidable.IncomingForm()\n```\nCreates a new incoming form.\n\n```javascript\nform.encoding = 'utf-8';\n```\nSets encoding for incoming form fields.\n\n```javascript\nform.uploadDir = process.env.TMP || process.env.TMPDIR || process.env.TEMP || '/tmp' || process.cwd();\n```\nThe directory for placing file uploads in. You can move them later on using\n`fs.rename()`. The default directory is picked at module load time depending on\nthe first existing directory from those listed above.\n\n```javascript\nform.keepExtensions = false;\n```\nIf you want the files written to `form.uploadDir` to include the extensions of the original files, set this property to `true`.\n\n```javascript\nform.type\n```\nEither 'multipart' or 'urlencoded' depending on the incoming request.\n\n```javascript\nform.maxFieldsSize = 2 * 1024 * 1024;\n```\nLimits the amount of memory a field (not file) can allocate in bytes.\nIf this value is exceeded, an `'error'` event is emitted. The default\nsize is 2MB.\n\n```javascript\nform.maxFields = 0;\n```\nLimits the number of fields that the querystring parser will decode. Defaults\nto 0 (unlimited).\n\n```javascript\nform.hash = false;\n```\nIf you want checksums calculated for incoming files, set this to either `'sha1'` or `'md5'`.\n\n```javascript\nform.bytesReceived\n```\nThe amount of bytes received for this form so far.\n\n```javascript\nform.bytesExpected\n```\nThe expected number of bytes in this form.\n\n```javascript\nform.parse(request, [cb]);\n```\nParses an incoming node.js `request` containing form data. If `cb` is provided, all fields an files are collected and passed to the callback:\n\n\n```javascript\nform.parse(req, function(err, fields, files) {\n // ...\n});\n\nform.onPart(part);\n```\nYou may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events processing which would occur otherwise, making you fully responsible for handling the processing.\n\n```javascript\nform.onPart = function(part) {\n part.addListener('data', function() {\n // ...\n });\n}\n```\nIf you want to use formidable to only handle certain parts for you, you can do so:\n```javascript\nform.onPart = function(part) {\n if (!part.filename) {\n // let formidable handle all non-file parts\n form.handlePart(part);\n }\n}\n```\nCheck the code in this method for further inspiration.\n\n\n### Formidable.File\n```javascript\nfile.size = 0\n```\nThe size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet.\n```javascript\nfile.path = null\n```\nThe path this file is being written to. You can modify this in the `'fileBegin'` event in\ncase you are unhappy with the way formidable generates a temporary path for your files.\n```javascript\nfile.name = null\n```\nThe name this file had according to the uploading client.\n```javascript\nfile.type = null\n```\nThe mime type of this file, according to the uploading client.\n```javascript\nfile.lastModifiedDate = null\n```\nA date object (or `null`) containing the time this file was last written to. Mostly\nhere for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/).\n```javascript\nfile.hash = null\n```\nIf hash calculation was set, you can read the hex digest out of this var.\n\n#### Formidable.File#toJSON()\n\n This method returns a JSON-representation of the file, allowing you to\n `JSON.stringify()` the file which is useful for logging and responding\n to requests.\n\n### Events\n\n\n#### 'progress'\n```javascript\nform.on('progress', function(bytesReceived, bytesExpected) {\n});\n```\nEmitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar.\n\n\n\n#### 'field'\n```javascript\nform.on('field', function(name, value) {\n});\n```\n\n#### 'fileBegin'\n\nEmitted whenever a field / value pair has been received.\n```javascript\nform.on('fileBegin', function(name, file) {\n});\n```\n\n#### 'file'\n\nEmitted whenever a new file is detected in the upload stream. Use this even if\nyou want to stream the file to somewhere else while buffering the upload on\nthe file system.\n\nEmitted whenever a field / file pair has been received. `file` is an instance of `File`.\n```javascript\nform.on('file', function(name, file) {\n});\n```\n\n#### 'error'\n\nEmitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events.\n```javascript\nform.on('error', function(err) {\n});\n```\n\n#### 'aborted'\n\n\nEmitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core).\n```javascript\nform.on('aborted', function() {\n});\n```\n\n##### 'end'\n```javascript\nform.on('end', function() {\n});\n```\nEmitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response.\n\n\n\n## Changelog\n\n### v1.0.14\n\n* Add failing hash tests. (Ben Trask)\n* Enable hash calculation again (Eugene Girshov)\n* Test for immediate data events (Tim Smart)\n* Re-arrange IncomingForm#parse (Tim Smart)\n\n### v1.0.13\n\n* Only update hash if update method exists (Sven Lito)\n* According to travis v0.10 needs to go quoted (Sven Lito)\n* Bumping build node versions (Sven Lito)\n* Additional fix for empty requests (Eugene Girshov)\n* Change the default to 1000, to match the new Node behaviour. (OrangeDog)\n* Add ability to control maxKeys in the querystring parser. (OrangeDog)\n* Adjust test case to work with node 0.9.x (Eugene Girshov)\n* Update package.json (Sven Lito)\n* Path adjustment according to eb4468b (Markus Ast)\n\n### v1.0.12\n\n* Emit error on aborted connections (Eugene Girshov)\n* Add support for empty requests (Eugene Girshov)\n* Fix name/filename handling in Content-Disposition (jesperp)\n* Tolerate malformed closing boundary in multipart (Eugene Girshov)\n* Ignore preamble in multipart messages (Eugene Girshov)\n* Add support for application/json (Mike Frey, Carlos Rodriguez)\n* Add support for Base64 encoding (Elmer Bulthuis)\n* Add File#toJSON (TJ Holowaychuk)\n* Remove support for Node.js 0.4 & 0.6 (Andrew Kelley)\n* Documentation improvements (Sven Lito, Andre Azevedo)\n* Add support for application/octet-stream (Ion Lupascu, Chris Scribner)\n* Use os.tmpDir() to get tmp directory (Andrew Kelley)\n* Improve package.json (Andrew Kelley, Sven Lito)\n* Fix benchmark script (Andrew Kelley)\n* Fix scope issue in incoming_forms (Sven Lito)\n* Fix file handle leak on error (OrangeDog)\n\n### v1.0.11\n\n* Calculate checksums for incoming files (sreuter)\n* Add definition parameters to \"IncomingForm\" as an argument (Math-)\n\n### v1.0.10\n\n* Make parts to be proper Streams (Matt Robenolt)\n\n### v1.0.9\n\n* Emit progress when content length header parsed (Tim Koschützki)\n* Fix Readme syntax due to GitHub changes (goob)\n* Replace references to old 'sys' module in Readme with 'util' (Peter Sugihara)\n\n### v1.0.8\n\n* Strip potentially unsafe characters when using `keepExtensions: true`.\n* Switch to utest / urun for testing\n* Add travis build\n\n### v1.0.7\n\n* Remove file from package that was causing problems when installing on windows. (#102)\n* Fix typos in Readme (Jason Davies).\n\n### v1.0.6\n\n* Do not default to the default to the field name for file uploads where\n filename=\"\".\n\n### v1.0.5\n\n* Support filename=\"\" in multipart parts\n* Explain unexpected end() errors in parser better\n\n**Note:** Starting with this version, formidable emits 'file' events for empty\nfile input fields. Previously those were incorrectly emitted as regular file\ninput fields with value = \"\".\n\n### v1.0.4\n\n* Detect a good default tmp directory regardless of platform. (#88)\n\n### v1.0.3\n\n* Fix problems with utf8 characters (#84) / semicolons in filenames (#58)\n* Small performance improvements\n* New test suite and fixture system\n\n### v1.0.2\n\n* Exclude node\\_modules folder from git\n* Implement new `'aborted'` event\n* Fix files in example folder to work with recent node versions\n* Make gently a devDependency\n\n[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.1...v1.0.2)\n\n### v1.0.1\n\n* Fix package.json to refer to proper main directory. (#68, Dean Landolt)\n\n[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.0...v1.0.1)\n\n### v1.0.0\n\n* Add support for multipart boundaries that are quoted strings. (Jeff Craig)\n\nThis marks the beginning of development on version 2.0 which will include\nseveral architectural improvements.\n\n[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.11...v1.0.0)\n\n### v0.9.11\n\n* Emit `'progress'` event when receiving data, regardless of parsing it. (Tim Koschützki)\n* Use [W3C FileAPI Draft](http://dev.w3.org/2006/webapi/FileAPI/) properties for File class\n\n**Important:** The old property names of the File class will be removed in a\nfuture release.\n\n[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.10...v0.9.11)\n\n### Older releases\n\nThese releases were done before starting to maintain the above Changelog:\n\n* [v0.9.10](https://github.com/felixge/node-formidable/compare/v0.9.9...v0.9.10)\n* [v0.9.9](https://github.com/felixge/node-formidable/compare/v0.9.8...v0.9.9)\n* [v0.9.8](https://github.com/felixge/node-formidable/compare/v0.9.7...v0.9.8)\n* [v0.9.7](https://github.com/felixge/node-formidable/compare/v0.9.6...v0.9.7)\n* [v0.9.6](https://github.com/felixge/node-formidable/compare/v0.9.5...v0.9.6)\n* [v0.9.5](https://github.com/felixge/node-formidable/compare/v0.9.4...v0.9.5)\n* [v0.9.4](https://github.com/felixge/node-formidable/compare/v0.9.3...v0.9.4)\n* [v0.9.3](https://github.com/felixge/node-formidable/compare/v0.9.2...v0.9.3)\n* [v0.9.2](https://github.com/felixge/node-formidable/compare/v0.9.1...v0.9.2)\n* [v0.9.1](https://github.com/felixge/node-formidable/compare/v0.9.0...v0.9.1)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.1.0](https://github.com/felixge/node-formidable/commits/v0.1.0)\n\n## License\n\nFormidable is licensed under the MIT license.\n\n## Ports\n\n* [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable\n\n## Credits\n\n* [Ryan Dahl](http://twitter.com/ryah) for his work on [http-parser](http://github.com/ry/http-parser) which heavily inspired multipart_parser.js\n", - "readmeFilename": "Readme.md", - "dependencies": {}, - "_id": "formidable@1.0.14", - "_from": "formidable@1.0.14" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/common.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/common.js deleted file mode 100644 index 6a94295..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/common.js +++ /dev/null @@ -1,18 +0,0 @@ -var path = require('path'); - -var root = path.join(__dirname, '../'); -exports.dir = { - root : root, - lib : root + '/lib', - fixture : root + '/test/fixture', - tmp : root + '/test/tmp', -}; - -exports.port = 13532; - -exports.formidable = require('..'); -exports.assert = require('assert'); - -exports.require = function(lib) { - return require(exports.dir.lib + '/' + lib); -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/beta-sticker-1.png b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/beta-sticker-1.png deleted file mode 100644 index 20b1a7f..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/beta-sticker-1.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/binaryfile.tar.gz b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/binaryfile.tar.gz deleted file mode 100644 index 4a85af7..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/binaryfile.tar.gz and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/blank.gif b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/blank.gif deleted file mode 100755 index 75b945d..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/blank.gif and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt deleted file mode 100644 index e7a4785..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +++ /dev/null @@ -1 +0,0 @@ -I am a text file with a funky name! diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/menu_separator.png b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/menu_separator.png deleted file mode 100644 index 1c16a71..0000000 Binary files a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/menu_separator.png and /dev/null differ diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt deleted file mode 100644 index 9b6903e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +++ /dev/null @@ -1 +0,0 @@ -I am a plain text file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md deleted file mode 100644 index 3c9dbe3..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +++ /dev/null @@ -1,3 +0,0 @@ -* Opera does not allow submitting this file, it shows a warning to the - user that the file could not be found instead. Tested in 9.8, 11.51 on OSX. - Reported to Opera on 08.09.2011 (tracking email DSK-346009@bugs.opera.com). diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/encoding.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/encoding.js deleted file mode 100644 index fc22026..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/encoding.js +++ /dev/null @@ -1,24 +0,0 @@ -module.exports['menu_seperator.png.http'] = [ - {type: 'file', name: 'image', filename: 'menu_separator.png', fixture: 'menu_separator.png', - sha1: 'c845ca3ea794be298f2a1b79769b71939eaf4e54'} -]; - -module.exports['beta-sticker-1.png.http'] = [ - {type: 'file', name: 'sticker', filename: 'beta-sticker-1.png', fixture: 'beta-sticker-1.png', - sha1: '6abbcffd12b4ada5a6a084fe9e4584f846331bc4'} -]; - -module.exports['blank.gif.http'] = [ - {type: 'file', name: 'file', filename: 'blank.gif', fixture: 'blank.gif', - sha1: 'a1fdee122b95748d81cee426d717c05b5174fe96'} -]; - -module.exports['binaryfile.tar.gz.http'] = [ - {type: 'file', name: 'file', filename: 'binaryfile.tar.gz', fixture: 'binaryfile.tar.gz', - sha1: 'cfabe13b348e5e69287d677860880c52a69d2155'} -]; - -module.exports['plain.txt.http'] = [ - {type: 'file', name: 'file', filename: 'plain.txt', fixture: 'plain.txt', - sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'} -]; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/misc.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/misc.js deleted file mode 100644 index 4489176..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/misc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - 'empty.http': [], - 'empty-urlencoded.http': [], - 'empty-multipart.http': [], - 'minimal.http': [], -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js deleted file mode 100644 index f03b4f0..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports['generic.http'] = [ - {type: 'file', name: 'upload', filename: '', fixture: 'plain.txt', - sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'}, -]; - -module.exports['filename-name.http'] = [ - {type: 'file', name: 'upload', filename: 'plain.txt', fixture: 'plain.txt', - sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'}, -]; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/preamble.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/preamble.js deleted file mode 100644 index d2e4cfd..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/preamble.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports['crlf.http'] = [ - {type: 'file', name: 'upload', filename: 'plain.txt', fixture: 'plain.txt', - sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'}, -]; - -module.exports['preamble.http'] = [ - {type: 'file', name: 'upload', filename: 'plain.txt', fixture: 'plain.txt', - sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'}, -]; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js deleted file mode 100644 index eb76fdc..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +++ /dev/null @@ -1,21 +0,0 @@ -var properFilename = 'funkyfilename.txt'; - -function expect(filename) { - return [ - {type: 'field', name: 'title', value: 'Weird filename'}, - {type: 'file', name: 'upload', filename: filename, fixture: properFilename}, - ]; -}; - -var webkit = " ? % * | \" < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; -var ffOrIe = " ? % * | \" < > . ☃ ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; - -module.exports = { - 'osx-chrome-13.http' : expect(webkit), - 'osx-firefox-3.6.http' : expect(ffOrIe), - 'osx-safari-5.http' : expect(webkit), - 'xp-chrome-12.http' : expect(webkit), - 'xp-ie-7.http' : expect(ffOrIe), - 'xp-ie-8.http' : expect(ffOrIe), - 'xp-safari-5.http' : expect(webkit), -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/workarounds.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/workarounds.js deleted file mode 100644 index e59c5b2..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/js/workarounds.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports['missing-hyphens1.http'] = [ - {type: 'file', name: 'upload', filename: 'plain.txt', fixture: 'plain.txt', - sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'}, -]; -module.exports['missing-hyphens2.http'] = [ - {type: 'file', name: 'upload', filename: 'plain.txt', fixture: 'plain.txt', - sha1: 'b31d07bac24ac32734de88b3687dddb10e976872'}, -]; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/multipart.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/multipart.js deleted file mode 100644 index a476169..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +++ /dev/null @@ -1,72 +0,0 @@ -exports['rfc1867'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--\r\n', - parts: - [ { headers: { - 'content-disposition': 'form-data; name="field1"', - }, - data: 'Joe Blow\r\nalmost tricked you!', - }, - { headers: { - 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', - 'Content-Type': 'text/plain', - }, - data: '... contents of file1.txt ...\r', - } - ] - }; - -exports['noTrailing\r\n'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--', - parts: - [ { headers: { - 'content-disposition': 'form-data; name="field1"', - }, - data: 'Joe Blow\r\nalmost tricked you!', - }, - { headers: { - 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', - 'Content-Type': 'text/plain', - }, - data: '... contents of file1.txt ...\r', - } - ] - }; - -exports['emptyHeader'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - ': foo\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--\r\n', - expectError: true, - }; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js deleted file mode 100644 index 8e10ac9..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +++ /dev/null @@ -1,96 +0,0 @@ -var hashish = require('hashish'); -var fs = require('fs'); -var findit = require('findit'); -var path = require('path'); -var http = require('http'); -var net = require('net'); -var assert = require('assert'); - -var common = require('../common'); -var formidable = common.formidable; - -var server = http.createServer(); -server.listen(common.port, findFixtures); - -function findFixtures() { - var fixtures = []; - findit - .sync(common.dir.fixture + '/js') - .forEach(function(jsPath) { - if (!/\.js$/.test(jsPath)) return; - - var group = path.basename(jsPath, '.js'); - hashish.forEach(require(jsPath), function(fixture, name) { - fixtures.push({ - name : group + '/' + name, - fixture : fixture, - }); - }); - }); - - testNext(fixtures); -} - -function testNext(fixtures) { - var fixture = fixtures.shift(); - if (!fixture) return server.close(); - - var name = fixture.name; - var fixture = fixture.fixture; - - uploadFixture(name, function(err, parts) { - if (err) throw err; - - fixture.forEach(function(expectedPart, i) { - var parsedPart = parts[i]; - assert.equal(parsedPart.type, expectedPart.type); - assert.equal(parsedPart.name, expectedPart.name); - - if (parsedPart.type === 'file') { - var file = parsedPart.value; - assert.equal(file.name, expectedPart.filename); - if(expectedPart.sha1) assert.equal(file.hash, expectedPart.sha1); - } - }); - - testNext(fixtures); - }); -}; - -function uploadFixture(name, cb) { - server.once('request', function(req, res) { - var form = new formidable.IncomingForm(); - form.uploadDir = common.dir.tmp; - form.hash = "sha1"; - form.parse(req); - - function callback() { - var realCallback = cb; - cb = function() {}; - realCallback.apply(null, arguments); - } - - var parts = []; - form - .on('error', callback) - .on('fileBegin', function(name, value) { - parts.push({type: 'file', name: name, value: value}); - }) - .on('field', function(name, value) { - parts.push({type: 'field', name: name, value: value}); - }) - .on('end', function() { - res.end('OK'); - callback(null, parts); - }); - }); - - var socket = net.createConnection(common.port); - var file = fs.createReadStream(common.dir.fixture + '/http/' + name); - - file.pipe(socket, {end: false}); - socket.on('data', function () { - socket.end(); - }); - -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-json.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-json.js deleted file mode 100644 index 28e758e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-json.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var formidable = common.formidable; -var http = require('http'); -var assert = require('assert'); - -var testData = { - numbers: [1, 2, 3, 4, 5], - nested: { key: 'value' } -}; - -var server = http.createServer(function(req, res) { - var form = new formidable.IncomingForm(); - - form.parse(req, function(err, fields, files) { - assert.deepEqual(fields, testData); - - res.end(); - server.close(); - }); -}); - -var port = common.port; - -server.listen(port, function(err){ - assert.equal(err, null); - - var request = http.request({ - port: port, - method: 'POST', - headers: { - 'Content-Type': 'application/json' - } - }); - - request.write(JSON.stringify(testData)); - request.end(); -}); - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-octet-stream.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-octet-stream.js deleted file mode 100644 index 643d2c6..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/integration/test-octet-stream.js +++ /dev/null @@ -1,45 +0,0 @@ -var common = require('../common'); -var formidable = common.formidable; -var http = require('http'); -var fs = require('fs'); -var path = require('path'); -var hashish = require('hashish'); -var assert = require('assert'); - -var testFilePath = path.join(__dirname, '../fixture/file/binaryfile.tar.gz'); - -var server = http.createServer(function(req, res) { - var form = new formidable.IncomingForm(); - - form.parse(req, function(err, fields, files) { - assert.equal(hashish(files).length, 1); - var file = files.file; - - assert.equal(file.size, 301); - - var uploaded = fs.readFileSync(file.path); - var original = fs.readFileSync(testFilePath); - - assert.deepEqual(uploaded, original); - - res.end(); - server.close(); - }); -}); - -var port = common.port; - -server.listen(port, function(err){ - assert.equal(err, null); - - var request = http.request({ - port: port, - method: 'POST', - headers: { - 'Content-Type': 'application/octet-stream' - } - }); - - fs.createReadStream(testFilePath).pipe(request); -}); - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/common.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/common.js deleted file mode 100644 index 2b98598..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/common.js +++ /dev/null @@ -1,24 +0,0 @@ -var path = require('path'), - fs = require('fs'); - -try { - global.Gently = require('gently'); -} catch (e) { - throw new Error('this test suite requires node-gently'); -} - -exports.lib = path.join(__dirname, '../../lib'); - -global.GENTLY = new Gently(); - -global.assert = require('assert'); -global.TEST_PORT = 13532; -global.TEST_FIXTURES = path.join(__dirname, '../fixture'); -global.TEST_TMP = path.join(__dirname, '../tmp'); - -// Stupid new feature in node that complains about gently attaching too many -// listeners to process 'exit'. This is a workaround until I can think of a -// better way to deal with this. -if (process.setMaxListeners) { - process.setMaxListeners(10000); -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js deleted file mode 100644 index 75232aa..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +++ /dev/null @@ -1,80 +0,0 @@ -var common = require('../common'); -var CHUNK_LENGTH = 10, - multipartParser = require(common.lib + '/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - parser = new MultipartParser(), - fixtures = require(TEST_FIXTURES + '/multipart'), - Buffer = require('buffer').Buffer; - -Object.keys(fixtures).forEach(function(name) { - var fixture = fixtures[name], - buffer = new Buffer(Buffer.byteLength(fixture.raw, 'binary')), - offset = 0, - chunk, - nparsed, - - parts = [], - part = null, - headerField, - headerValue, - endCalled = ''; - - parser.initWithBoundary(fixture.boundary); - parser.onPartBegin = function() { - part = {headers: {}, data: ''}; - parts.push(part); - headerField = ''; - headerValue = ''; - }; - - parser.onHeaderField = function(b, start, end) { - headerField += b.toString('ascii', start, end); - }; - - parser.onHeaderValue = function(b, start, end) { - headerValue += b.toString('ascii', start, end); - } - - parser.onHeaderEnd = function() { - part.headers[headerField] = headerValue; - headerField = ''; - headerValue = ''; - }; - - parser.onPartData = function(b, start, end) { - var str = b.toString('ascii', start, end); - part.data += b.slice(start, end); - } - - parser.onEnd = function() { - endCalled = true; - } - - buffer.write(fixture.raw, 'binary', 0); - - while (offset < buffer.length) { - if (offset + CHUNK_LENGTH < buffer.length) { - chunk = buffer.slice(offset, offset+CHUNK_LENGTH); - } else { - chunk = buffer.slice(offset, buffer.length); - } - offset = offset + CHUNK_LENGTH; - - nparsed = parser.write(chunk); - if (nparsed != chunk.length) { - if (fixture.expectError) { - return; - } - puts('-- ERROR --'); - p(chunk.toString('ascii')); - throw new Error(chunk.length+' bytes written, but only '+nparsed+' bytes parsed!'); - } - } - - if (fixture.expectError) { - throw new Error('expected parse error did not happen'); - } - - assert.ok(endCalled); - assert.deepEqual(parts, fixture.parts); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js deleted file mode 100644 index 52ceedb..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +++ /dev/null @@ -1,104 +0,0 @@ -var common = require('../common'); -var WriteStreamStub = GENTLY.stub('fs', 'WriteStream'); - -var File = require(common.lib + '/file'), - EventEmitter = require('events').EventEmitter, - file, - gently; - -function test(test) { - gently = new Gently(); - file = new File(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.ok(file instanceof EventEmitter); - assert.strictEqual(file.size, 0); - assert.strictEqual(file.path, null); - assert.strictEqual(file.name, null); - assert.strictEqual(file.type, null); - assert.strictEqual(file.lastModifiedDate, null); - - assert.strictEqual(file._writeStream, null); - - (function testSetProperties() { - var file2 = new File({foo: 'bar'}); - assert.equal(file2.foo, 'bar'); - })(); -}); - -test(function open() { - var WRITE_STREAM; - file.path = '/foo'; - - gently.expect(WriteStreamStub, 'new', function (path) { - WRITE_STREAM = this; - assert.strictEqual(path, file.path); - }); - - file.open(); - assert.strictEqual(file._writeStream, WRITE_STREAM); -}); - -test(function write() { - var BUFFER = {length: 10}, - CB_STUB, - CB = function() { - CB_STUB.apply(this, arguments); - }; - - file._writeStream = {}; - - gently.expect(file._writeStream, 'write', function (buffer, cb) { - assert.strictEqual(buffer, BUFFER); - - gently.expect(file, 'emit', function (event, bytesWritten) { - assert.ok(file.lastModifiedDate instanceof Date); - assert.equal(event, 'progress'); - assert.equal(bytesWritten, file.size); - }); - - CB_STUB = gently.expect(function writeCb() { - assert.equal(file.size, 10); - }); - - cb(); - - gently.expect(file, 'emit', function (event, bytesWritten) { - assert.equal(event, 'progress'); - assert.equal(bytesWritten, file.size); - }); - - CB_STUB = gently.expect(function writeCb() { - assert.equal(file.size, 20); - }); - - cb(); - }); - - file.write(BUFFER, CB); -}); - -test(function end() { - var CB_STUB, - CB = function() { - CB_STUB.apply(this, arguments); - }; - - file._writeStream = {}; - - gently.expect(file._writeStream, 'end', function (cb) { - gently.expect(file, 'emit', function (event) { - assert.equal(event, 'end'); - }); - - CB_STUB = gently.expect(function endCb() { - }); - - cb(); - }); - - file.end(CB); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js deleted file mode 100644 index 25bd887..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +++ /dev/null @@ -1,756 +0,0 @@ -var common = require('../common'); -var MultipartParserStub = GENTLY.stub('./multipart_parser', 'MultipartParser'), - QuerystringParserStub = GENTLY.stub('./querystring_parser', 'QuerystringParser'), - EventEmitterStub = GENTLY.stub('events', 'EventEmitter'), - StreamStub = GENTLY.stub('stream', 'Stream'), - FileStub = GENTLY.stub('./file'); - -var formidable = require(common.lib + '/index'), - IncomingForm = formidable.IncomingForm, - events = require('events'), - fs = require('fs'), - path = require('path'), - Buffer = require('buffer').Buffer, - fixtures = require(TEST_FIXTURES + '/multipart'), - form, - gently; - -function test(test) { - gently = new Gently(); - gently.expect(EventEmitterStub, 'call'); - form = new IncomingForm(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.strictEqual(form.error, null); - assert.strictEqual(form.ended, false); - assert.strictEqual(form.type, null); - assert.strictEqual(form.headers, null); - assert.strictEqual(form.keepExtensions, false); - // Can't assume dir === '/tmp' for portability - // assert.strictEqual(form.uploadDir, '/tmp'); - // Make sure it is a directory instead - assert.doesNotThrow(function () { - assert(fs.statSync(form.uploadDir).isDirectory()); - }); - assert.strictEqual(form.encoding, 'utf-8'); - assert.strictEqual(form.bytesReceived, null); - assert.strictEqual(form.bytesExpected, null); - assert.strictEqual(form.maxFieldsSize, 2 * 1024 * 1024); - assert.strictEqual(form._parser, null); - assert.strictEqual(form._flushing, 0); - assert.strictEqual(form._fieldsSize, 0); - assert.ok(form instanceof EventEmitterStub); - assert.equal(form.constructor.name, 'IncomingForm'); - - (function testSimpleConstructor() { - gently.expect(EventEmitterStub, 'call'); - var form = IncomingForm(); - assert.ok(form instanceof IncomingForm); - })(); - - (function testSimpleConstructorShortcut() { - gently.expect(EventEmitterStub, 'call'); - var form = formidable(); - assert.ok(form instanceof IncomingForm); - })(); -}); - -test(function parse() { - var REQ = {headers: {}} - , emit = {}; - - gently.expect(form, 'writeHeaders', function(headers) { - assert.strictEqual(headers, REQ.headers); - }); - - var EVENTS = ['error', 'aborted', 'data', 'end']; - gently.expect(REQ, 'on', EVENTS.length, function(event, fn) { - assert.equal(event, EVENTS.shift()); - emit[event] = fn; - return this; - }); - - form.parse(REQ); - - (function testPause() { - gently.expect(REQ, 'pause'); - assert.strictEqual(form.pause(), true); - })(); - - (function testPauseCriticalException() { - form.ended = false; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'pause', function() { - throw ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - assert.strictEqual(form.pause(), false); - })(); - - (function testPauseHarmlessException() { - form.ended = true; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'pause', function() { - throw ERR; - }); - - assert.strictEqual(form.pause(), false); - })(); - - (function testResume() { - gently.expect(REQ, 'resume'); - assert.strictEqual(form.resume(), true); - })(); - - (function testResumeCriticalException() { - form.ended = false; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'resume', function() { - throw ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - assert.strictEqual(form.resume(), false); - })(); - - (function testResumeHarmlessException() { - form.ended = true; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'resume', function() { - throw ERR; - }); - - assert.strictEqual(form.resume(), false); - })(); - - (function testEmitError() { - var ERR = new Error('something bad happened'); - gently.expect(form, '_error',function(err) { - assert.strictEqual(err, ERR); - }); - emit.error(ERR); - })(); - - (function testEmitAborted() { - gently.expect(form, 'emit',function(event) { - assert.equal(event, 'aborted'); - }); - gently.expect(form, '_error'); - - emit.aborted(); - })(); - - - (function testEmitData() { - var BUFFER = [1, 2, 3]; - gently.expect(form, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - }); - emit.data(BUFFER); - })(); - - (function testEmitEnd() { - form._parser = {}; - - (function testWithError() { - var ERR = new Error('haha'); - gently.expect(form._parser, 'end', function() { - return ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - emit.end(); - })(); - - (function testWithoutError() { - gently.expect(form._parser, 'end'); - emit.end(); - })(); - - (function testAfterError() { - form.error = true; - emit.end(); - })(); - })(); - - (function testWithCallback() { - gently.expect(EventEmitterStub, 'call'); - var form = new IncomingForm(), - REQ = {headers: {}}, - parseCalled = 0; - - gently.expect(form, 'on', 4, function(event, fn) { - if (event == 'field') { - fn('field1', 'foo'); - fn('field1', 'bar'); - fn('field2', 'nice'); - } - - if (event == 'file') { - fn('file1', '1'); - fn('file1', '2'); - fn('file2', '3'); - } - - if (event == 'end') { - fn(); - } - return this; - }); - - gently.expect(form, 'writeHeaders'); - - gently.expect(REQ, 'on', 4, function() { - return this; - }); - - var parseCbOk = function (err, fields, files) { - assert.deepEqual(fields, {field1: 'bar', field2: 'nice'}); - assert.deepEqual(files, {file1: '2', file2: '3'}); - }; - form.parse(REQ, parseCbOk); - - var ERR = new Error('test'); - gently.expect(form, 'on', 3, function(event, fn) { - if (event == 'field') { - fn('foo', 'bar'); - } - - if (event == 'error') { - fn(ERR); - gently.expect(form, 'on'); - gently.expect(form, 'writeHeaders'); - gently.expect(REQ, 'on', 4, function() { - return this; - }); - } - return this; - }); - - form.parse(REQ, function parseCbErr(err, fields, files) { - assert.strictEqual(err, ERR); - assert.deepEqual(fields, {foo: 'bar'}); - }); - })(); - - (function testWriteOrder() { - gently.expect(EventEmitterStub, 'call'); - var form = new IncomingForm(); - var REQ = new events.EventEmitter(); - var BUF = {}; - var DATACB = null; - - REQ.on('newListener', function(event, fn) { - if ('data' === event) fn(BUF); - }); - - gently.expect(form, 'writeHeaders'); - gently.expect(form, 'write', function(buf) { - assert.strictEqual(buf, BUF); - }); - - form.parse(REQ); - })(); -}); - -test(function pause() { - assert.strictEqual(form.pause(), false); -}); - -test(function resume() { - assert.strictEqual(form.resume(), false); -}); - - -test(function writeHeaders() { - var HEADERS = {}; - gently.expect(form, '_parseContentLength'); - gently.expect(form, '_parseContentType'); - - form.writeHeaders(HEADERS); - assert.strictEqual(form.headers, HEADERS); -}); - -test(function write() { - var parser = {}, - BUFFER = [1, 2, 3]; - - form._parser = parser; - form.bytesExpected = 523423; - - (function testBasic() { - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, BUFFER.length); - assert.equal(bytesExpected, form.bytesExpected); - }); - - gently.expect(parser, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - return buffer.length; - }); - - assert.equal(form.write(BUFFER), BUFFER.length); - assert.equal(form.bytesReceived, BUFFER.length); - })(); - - (function testParserError() { - gently.expect(form, 'emit'); - - gently.expect(parser, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - return buffer.length - 1; - }); - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/parser error/i)); - }); - - assert.equal(form.write(BUFFER), BUFFER.length - 1); - assert.equal(form.bytesReceived, BUFFER.length + BUFFER.length); - })(); - - (function testUninitialized() { - delete form._parser; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/unintialized parser/i)); - }); - form.write(BUFFER); - })(); -}); - -test(function parseContentType() { - var HEADERS = {}; - - form.headers = {'content-type': 'application/x-www-form-urlencoded'}; - gently.expect(form, '_initUrlencoded'); - form._parseContentType(); - - // accept anything that has 'urlencoded' in it - form.headers = {'content-type': 'broken-client/urlencoded-stupid'}; - gently.expect(form, '_initUrlencoded'); - form._parseContentType(); - - var BOUNDARY = '---------------------------57814261102167618332366269'; - form.headers = {'content-type': 'multipart/form-data; boundary='+BOUNDARY}; - - gently.expect(form, '_initMultipart', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - form._parseContentType(); - - (function testQuotedBoundary() { - form.headers = {'content-type': 'multipart/form-data; boundary="' + BOUNDARY + '"'}; - - gently.expect(form, '_initMultipart', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - form._parseContentType(); - })(); - - (function testNoBoundary() { - form.headers = {'content-type': 'multipart/form-data'}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/no multipart boundary/i)); - }); - form._parseContentType(); - })(); - - (function testNoContentType() { - form.headers = {}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/no content-type/i)); - }); - form._parseContentType(); - })(); - - (function testUnknownContentType() { - form.headers = {'content-type': 'invalid'}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/unknown content-type/i)); - }); - form._parseContentType(); - })(); -}); - -test(function parseContentLength() { - var HEADERS = {}; - - form.headers = {}; - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, 0); - assert.equal(bytesExpected, 0); - }); - form._parseContentLength(); - - form.headers['content-length'] = '8'; - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, 0); - assert.equal(bytesExpected, 8); - }); - form._parseContentLength(); - assert.strictEqual(form.bytesReceived, 0); - assert.strictEqual(form.bytesExpected, 8); - - // JS can be evil, lets make sure we are not - form.headers['content-length'] = '08'; - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, 0); - assert.equal(bytesExpected, 8); - }); - form._parseContentLength(); - assert.strictEqual(form.bytesExpected, 8); -}); - -test(function _initMultipart() { - var BOUNDARY = '123', - PARSER; - - gently.expect(MultipartParserStub, 'new', function() { - PARSER = this; - }); - - gently.expect(MultipartParserStub.prototype, 'initWithBoundary', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - - form._initMultipart(BOUNDARY); - assert.equal(form.type, 'multipart'); - assert.strictEqual(form._parser, PARSER); - - (function testRegularField() { - var PART; - gently.expect(StreamStub, 'new', function() { - PART = this; - }); - - gently.expect(form, 'onPart', function(part) { - assert.strictEqual(part, PART); - assert.deepEqual - ( part.headers - , { 'content-disposition': 'form-data; name="field1"' - , 'foo': 'bar' - } - ); - assert.equal(part.name, 'field1'); - - var strings = ['hello', ' world']; - gently.expect(part, 'emit', 2, function(event, b) { - assert.equal(event, 'data'); - assert.equal(b.toString(), strings.shift()); - }); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'end'); - }); - }); - - PARSER.onPartBegin(); - PARSER.onHeaderField(new Buffer('content-disposition'), 0, 10); - PARSER.onHeaderField(new Buffer('content-disposition'), 10, 19); - PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 0, 14); - PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 14, 24); - PARSER.onHeaderEnd(); - PARSER.onHeaderField(new Buffer('foo'), 0, 3); - PARSER.onHeaderValue(new Buffer('bar'), 0, 3); - PARSER.onHeaderEnd(); - PARSER.onHeadersEnd(); - PARSER.onPartData(new Buffer('hello world'), 0, 5); - PARSER.onPartData(new Buffer('hello world'), 5, 11); - PARSER.onPartEnd(); - })(); - - (function testFileField() { - var PART; - gently.expect(StreamStub, 'new', function() { - PART = this; - }); - - gently.expect(form, 'onPart', function(part) { - assert.deepEqual - ( part.headers - , { 'content-disposition': 'form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"' - , 'content-type': 'text/plain' - } - ); - assert.equal(part.name, 'field2'); - assert.equal(part.filename, 'Sun"et.jpg'); - assert.equal(part.mime, 'text/plain'); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'data'); - assert.equal(b.toString(), '... contents of file1.txt ...'); - }); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'end'); - }); - }); - - PARSER.onPartBegin(); - PARSER.onHeaderField(new Buffer('content-disposition'), 0, 19); - PARSER.onHeaderValue(new Buffer('form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"'), 0, 85); - PARSER.onHeaderEnd(); - PARSER.onHeaderField(new Buffer('Content-Type'), 0, 12); - PARSER.onHeaderValue(new Buffer('text/plain'), 0, 10); - PARSER.onHeaderEnd(); - PARSER.onHeadersEnd(); - PARSER.onPartData(new Buffer('... contents of file1.txt ...'), 0, 29); - PARSER.onPartEnd(); - })(); - - (function testEnd() { - gently.expect(form, '_maybeEnd'); - PARSER.onEnd(); - assert.ok(form.ended); - })(); -}); - -test(function _fileName() { - // TODO - return; -}); - -test(function _initUrlencoded() { - var PARSER; - - gently.expect(QuerystringParserStub, 'new', function() { - PARSER = this; - }); - - form._initUrlencoded(); - assert.equal(form.type, 'urlencoded'); - assert.strictEqual(form._parser, PARSER); - - (function testOnField() { - var KEY = 'KEY', VAL = 'VAL'; - gently.expect(form, 'emit', function(field, key, val) { - assert.equal(field, 'field'); - assert.equal(key, KEY); - assert.equal(val, VAL); - }); - - PARSER.onField(KEY, VAL); - })(); - - (function testOnEnd() { - gently.expect(form, '_maybeEnd'); - - PARSER.onEnd(); - assert.equal(form.ended, true); - })(); -}); - -test(function _error() { - var ERR = new Error('bla'); - - gently.expect(form, 'pause'); - gently.expect(form, 'emit', function(event, err) { - assert.equal(event, 'error'); - assert.strictEqual(err, ERR); - }); - - form._error(ERR); - assert.strictEqual(form.error, ERR); - - // make sure _error only does its thing once - form._error(ERR); -}); - -test(function onPart() { - var PART = {}; - gently.expect(form, 'handlePart', function(part) { - assert.strictEqual(part, PART); - }); - - form.onPart(PART); -}); - -test(function handlePart() { - (function testUtf8Field() { - var PART = new events.EventEmitter(); - PART.name = 'my_field'; - - gently.expect(form, 'emit', function(event, field, value) { - assert.equal(event, 'field'); - assert.equal(field, 'my_field'); - assert.equal(value, 'hello world: €'); - }); - - form.handlePart(PART); - PART.emit('data', new Buffer('hello')); - PART.emit('data', new Buffer(' world: ')); - PART.emit('data', new Buffer([0xE2])); - PART.emit('data', new Buffer([0x82, 0xAC])); - PART.emit('end'); - })(); - - (function testBinaryField() { - var PART = new events.EventEmitter(); - PART.name = 'my_field2'; - - gently.expect(form, 'emit', function(event, field, value) { - assert.equal(event, 'field'); - assert.equal(field, 'my_field2'); - assert.equal(value, 'hello world: '+new Buffer([0xE2, 0x82, 0xAC]).toString('binary')); - }); - - form.encoding = 'binary'; - form.handlePart(PART); - PART.emit('data', new Buffer('hello')); - PART.emit('data', new Buffer(' world: ')); - PART.emit('data', new Buffer([0xE2])); - PART.emit('data', new Buffer([0x82, 0xAC])); - PART.emit('end'); - })(); - - (function testFieldSize() { - form.maxFieldsSize = 8; - var PART = new events.EventEmitter(); - PART.name = 'my_field'; - - gently.expect(form, '_error', function(err) { - assert.equal(err.message, 'maxFieldsSize exceeded, received 9 bytes of field data'); - }); - - form.handlePart(PART); - form._fieldsSize = 1; - PART.emit('data', new Buffer(7)); - PART.emit('data', new Buffer(1)); - })(); - - (function testFilePart() { - var PART = new events.EventEmitter(), - FILE = new events.EventEmitter(), - PATH = '/foo/bar'; - - PART.name = 'my_file'; - PART.filename = 'sweet.txt'; - PART.mime = 'sweet.txt'; - - gently.expect(form, '_uploadPath', function(filename) { - assert.equal(filename, PART.filename); - return PATH; - }); - - gently.expect(FileStub, 'new', function(properties) { - assert.equal(properties.path, PATH); - assert.equal(properties.name, PART.filename); - assert.equal(properties.type, PART.mime); - FILE = this; - - gently.expect(form, 'emit', function (event, field, file) { - assert.equal(event, 'fileBegin'); - assert.strictEqual(field, PART.name); - assert.strictEqual(file, FILE); - }); - - gently.expect(FILE, 'open'); - }); - - form.handlePart(PART); - assert.equal(form._flushing, 1); - - var BUFFER; - gently.expect(form, 'pause'); - gently.expect(FILE, 'write', function(buffer, cb) { - assert.strictEqual(buffer, BUFFER); - gently.expect(form, 'resume'); - // @todo handle cb(new Err) - cb(); - }); - - PART.emit('data', BUFFER = new Buffer('test')); - - gently.expect(FILE, 'end', function(cb) { - gently.expect(form, 'emit', function(event, field, file) { - assert.equal(event, 'file'); - assert.strictEqual(file, FILE); - }); - - gently.expect(form, '_maybeEnd'); - - cb(); - assert.equal(form._flushing, 0); - }); - - PART.emit('end'); - })(); -}); - -test(function _uploadPath() { - (function testUniqueId() { - var UUID_A, UUID_B; - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) { - assert.equal(uploadDir, form.uploadDir); - UUID_A = uuid; - }); - form._uploadPath(); - - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) { - UUID_B = uuid; - }); - form._uploadPath(); - - assert.notEqual(UUID_A, UUID_B); - })(); - - (function testFileExtension() { - form.keepExtensions = true; - var FILENAME = 'foo.jpg', - EXT = '.bar'; - - gently.expect(GENTLY.hijacked.path, 'extname', function(filename) { - assert.equal(filename, FILENAME); - gently.restore(path, 'extname'); - - return EXT; - }); - - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, name) { - assert.equal(path.extname(name), EXT); - }); - form._uploadPath(FILENAME); - })(); -}); - -test(function _maybeEnd() { - gently.expect(form, 'emit', 0); - form._maybeEnd(); - - form.ended = true; - form._flushing = 1; - form._maybeEnd(); - - gently.expect(form, 'emit', function(event) { - assert.equal(event, 'end'); - }); - - form.ended = true; - form._flushing = 0; - form._maybeEnd(); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js deleted file mode 100644 index bf2cd5e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +++ /dev/null @@ -1,50 +0,0 @@ -var common = require('../common'); -var multipartParser = require(common.lib + '/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - events = require('events'), - Buffer = require('buffer').Buffer, - parser; - -function test(test) { - parser = new MultipartParser(); - test(); -} - -test(function constructor() { - assert.equal(parser.boundary, null); - assert.equal(parser.state, 0); - assert.equal(parser.flags, 0); - assert.equal(parser.boundaryChars, null); - assert.equal(parser.index, null); - assert.equal(parser.lookbehind, null); - assert.equal(parser.constructor.name, 'MultipartParser'); -}); - -test(function initWithBoundary() { - var boundary = 'abc'; - parser.initWithBoundary(boundary); - assert.deepEqual(Array.prototype.slice.call(parser.boundary), [13, 10, 45, 45, 97, 98, 99]); - assert.equal(parser.state, multipartParser.START); - - assert.deepEqual(parser.boundaryChars, {10: true, 13: true, 45: true, 97: true, 98: true, 99: true}); -}); - -test(function parserError() { - var boundary = 'abc', - buffer = new Buffer(5); - - parser.initWithBoundary(boundary); - buffer.write('--ad', 'ascii', 0); - assert.equal(parser.write(buffer), 5); -}); - -test(function end() { - (function testError() { - assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain()); - })(); - - (function testRegular() { - parser.state = multipartParser.END; - assert.strictEqual(parser.end(), undefined); - })(); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js deleted file mode 100644 index 54d3e2d..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +++ /dev/null @@ -1,45 +0,0 @@ -var common = require('../common'); -var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser, - Buffer = require('buffer').Buffer, - gently, - parser; - -function test(test) { - gently = new Gently(); - parser = new QuerystringParser(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.equal(parser.buffer, ''); - assert.equal(parser.constructor.name, 'QuerystringParser'); -}); - -test(function write() { - var a = new Buffer('a=1'); - assert.equal(parser.write(a), a.length); - - var b = new Buffer('&b=2'); - parser.write(b); - assert.equal(parser.buffer, a + b); -}); - -test(function end() { - var FIELDS = {a: ['b', {c: 'd'}], e: 'f'}; - - gently.expect(GENTLY.hijacked.querystring, 'parse', function(str) { - assert.equal(str, parser.buffer); - return FIELDS; - }); - - gently.expect(parser, 'onField', Object.keys(FIELDS).length, function(key, val) { - assert.deepEqual(FIELDS[key], val); - }); - - gently.expect(parser, 'onEnd'); - - parser.buffer = 'my buffer'; - parser.end(); - assert.equal(parser.buffer, ''); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js deleted file mode 100644 index b35ffd6..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +++ /dev/null @@ -1,71 +0,0 @@ -var common = require('../common'); -var BOUNDARY = '---------------------------10102754414578508781458777923', - FIXTURE = TEST_FIXTURES+'/multi_video.upload', - fs = require('fs'), - http = require('http'), - formidable = require(common.lib + '/index'), - server = http.createServer(); - -server.on('request', function(req, res) { - var form = new formidable.IncomingForm(), - uploads = {}; - - form.uploadDir = TEST_TMP; - form.hash = 'sha1'; - form.parse(req); - - form - .on('fileBegin', function(field, file) { - assert.equal(field, 'upload'); - - var tracker = {file: file, progress: [], ended: false}; - uploads[file.name] = tracker; - file - .on('progress', function(bytesReceived) { - tracker.progress.push(bytesReceived); - assert.equal(bytesReceived, file.size); - }) - .on('end', function() { - tracker.ended = true; - }); - }) - .on('field', function(field, value) { - assert.equal(field, 'title'); - assert.equal(value, ''); - }) - .on('file', function(field, file) { - assert.equal(field, 'upload'); - assert.strictEqual(uploads[file.name].file, file); - }) - .on('end', function() { - assert.ok(uploads['shortest_video.flv']); - assert.ok(uploads['shortest_video.flv'].ended); - assert.ok(uploads['shortest_video.flv'].progress.length > 3); - assert.equal(uploads['shortest_video.flv'].file.hash, 'd6a17616c7143d1b1438ceeef6836d1a09186b3a'); - assert.equal(uploads['shortest_video.flv'].progress.slice(-1), uploads['shortest_video.flv'].file.size); - assert.ok(uploads['shortest_video.mp4']); - assert.ok(uploads['shortest_video.mp4'].ended); - assert.ok(uploads['shortest_video.mp4'].progress.length > 3); - assert.equal(uploads['shortest_video.mp4'].file.hash, '937dfd4db263f4887ceae19341dcc8d63bcd557f'); - - server.close(); - res.writeHead(200); - res.end('good'); - }); -}); - -server.listen(TEST_PORT, function() { - var stat, headers, request, fixture; - - stat = fs.statSync(FIXTURE); - request = http.request({ - port: TEST_PORT, - path: '/', - method: 'POST', - headers: { - 'content-type': 'multipart/form-data; boundary='+BOUNDARY, - 'content-length': stat.size, - }, - }); - fs.createReadStream(FIXTURE).pipe(request); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/run.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/run.js deleted file mode 100755 index 02d6d5c..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/run.js +++ /dev/null @@ -1 +0,0 @@ -require('urun')(__dirname) diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-connection-aborted.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-connection-aborted.js deleted file mode 100644 index 4ea4431..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-connection-aborted.js +++ /dev/null @@ -1,27 +0,0 @@ -var assert = require('assert'); -var http = require('http'); -var net = require('net'); -var formidable = require('../../lib/index'); - -var server = http.createServer(function (req, res) { - var form = new formidable.IncomingForm(); - var aborted_received = false; - form.on('aborted', function () { - aborted_received = true; - }); - form.on('error', function () { - assert(aborted_received, 'Error event should follow aborted'); - server.close(); - }); - form.on('end', function () { - throw new Error('Unexpected "end" event'); - }); - form.parse(req); -}).listen(0, 'localhost', function () { - var client = net.connect(server.address().port); - client.write( - "POST / HTTP/1.1\r\n" + - "Content-Length: 70\r\n" + - "Content-Type: multipart/form-data; boundary=foo\r\n\r\n"); - client.end(); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-content-transfer-encoding.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-content-transfer-encoding.js deleted file mode 100644 index 165628a..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-content-transfer-encoding.js +++ /dev/null @@ -1,48 +0,0 @@ -var assert = require('assert'); -var common = require('../common'); -var formidable = require('../../lib/index'); -var http = require('http'); - -var server = http.createServer(function(req, res) { - var form = new formidable.IncomingForm(); - form.uploadDir = common.dir.tmp; - form.on('end', function () { - throw new Error('Unexpected "end" event'); - }); - form.on('error', function (e) { - res.writeHead(500); - res.end(e.message); - }); - form.parse(req); -}); - -server.listen(0, function() { - var body = - '--foo\r\n' + - 'Content-Disposition: form-data; name="file1"; filename="file1"\r\n' + - 'Content-Type: application/octet-stream\r\n' + - '\r\nThis is the first file\r\n' + - '--foo\r\n' + - 'Content-Type: application/octet-stream\r\n' + - 'Content-Disposition: form-data; name="file2"; filename="file2"\r\n' + - 'Content-Transfer-Encoding: unknown\r\n' + - '\r\nThis is the second file\r\n' + - '--foo--\r\n'; - - var req = http.request({ - method: 'POST', - port: server.address().port, - headers: { - 'Content-Length': body.length, - 'Content-Type': 'multipart/form-data; boundary=foo' - } - }); - req.on('response', function (res) { - assert.equal(res.statusCode, 500); - res.on('data', function () {}); - res.on('end', function () { - server.close(); - }); - }); - req.end(body); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-issue-46.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-issue-46.js deleted file mode 100644 index 1939328..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/standalone/test-issue-46.js +++ /dev/null @@ -1,49 +0,0 @@ -var http = require('http'), - formidable = require('../../lib/index'), - request = require('request'), - assert = require('assert'); - -var host = 'localhost'; - -var index = [ - '
    ', - ' ', - ' ', - '
    ' -].join("\n"); - -var server = http.createServer(function(req, res) { - - // Show a form for testing purposes. - if (req.method == 'GET') { - res.writeHead(200, {'content-type': 'text/html'}); - res.end(index); - return; - } - - // Parse form and write results to response. - var form = new formidable.IncomingForm(); - form.parse(req, function(err, fields, files) { - res.writeHead(200, {'content-type': 'text/plain'}); - res.write(JSON.stringify({err: err, fields: fields, files: files})); - res.end(); - }); - -}).listen(0, host, function() { - - console.log("Server up and running..."); - - var server = this, - url = 'http://' + host + ':' + server.address().port; - - var parts = [ - {'Content-Disposition': 'form-data; name="foo"', 'body': 'bar'} - ] - - var req = request({method: 'POST', url: url, multipart: parts}, function(e, res, body) { - var obj = JSON.parse(body); - assert.equal("bar", obj.fields.foo); - server.close(); - }); - -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/tools/base64.html b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/tools/base64.html deleted file mode 100644 index 48ad92e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/tools/base64.html +++ /dev/null @@ -1,67 +0,0 @@ - - - Convert a file to a base64 request - - - - - - - -
    -
    -
    -
    -
    -
    -

    -Don't forget to save the output with windows (CRLF) line endings! -

    - - - diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/unit/test-file.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/unit/test-file.js deleted file mode 100644 index fc8f36e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/unit/test-file.js +++ /dev/null @@ -1,33 +0,0 @@ -var common = require('../common'); -var test = require('utest'); -var assert = common.assert; -var File = common.require('file'); - -var file; -var now = new Date; -test('IncomingForm', { - before: function() { - file = new File({ - size: 1024, - path: '/tmp/cat.png', - name: 'cat.png', - type: 'image/png', - lastModifiedDate: now, - filename: 'cat.png', - mime: 'image/png' - }) - }, - - '#toJSON()': function() { - var obj = file.toJSON(); - var len = Object.keys(obj).length; - assert.equal(1024, obj.size); - assert.equal('/tmp/cat.png', obj.path); - assert.equal('cat.png', obj.name); - assert.equal('image/png', obj.type); - assert.equal('image/png', obj.mime); - assert.equal('cat.png', obj.filename); - assert.equal(now, obj.mtime); - assert.equal(len, 8); - } -}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js deleted file mode 100644 index fe2ac1c..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +++ /dev/null @@ -1,63 +0,0 @@ -var common = require('../common'); -var test = require('utest'); -var assert = common.assert; -var IncomingForm = common.require('incoming_form').IncomingForm; -var path = require('path'); - -var form; -test('IncomingForm', { - before: function() { - form = new IncomingForm(); - }, - - '#_fileName with regular characters': function() { - var filename = 'foo.txt'; - assert.equal(form._fileName(makeHeader(filename)), 'foo.txt'); - }, - - '#_fileName with unescaped quote': function() { - var filename = 'my".txt'; - assert.equal(form._fileName(makeHeader(filename)), 'my".txt'); - }, - - '#_fileName with escaped quote': function() { - var filename = 'my%22.txt'; - assert.equal(form._fileName(makeHeader(filename)), 'my".txt'); - }, - - '#_fileName with bad quote and additional sub-header': function() { - var filename = 'my".txt'; - var header = makeHeader(filename) + '; foo="bar"'; - assert.equal(form._fileName(header), filename); - }, - - '#_fileName with semicolon': function() { - var filename = 'my;.txt'; - assert.equal(form._fileName(makeHeader(filename)), 'my;.txt'); - }, - - '#_fileName with utf8 character': function() { - var filename = 'my☃.txt'; - assert.equal(form._fileName(makeHeader(filename)), 'my☃.txt'); - }, - - '#_uploadPath strips harmful characters from extension when keepExtensions': function() { - form.keepExtensions = true; - - var ext = path.extname(form._uploadPath('fine.jpg?foo=bar')); - assert.equal(ext, '.jpg'); - - var ext = path.extname(form._uploadPath('fine?foo=bar')); - assert.equal(ext, ''); - - var ext = path.extname(form._uploadPath('super.cr2+dsad')); - assert.equal(ext, '.cr2'); - - var ext = path.extname(form._uploadPath('super.bar')); - assert.equal(ext, '.bar'); - }, -}); - -function makeHeader(filename) { - return 'Content-Disposition: form-data; name="upload"; filename="' + filename + '"'; -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/tool/record.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/tool/record.js deleted file mode 100644 index 9f1cef8..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/formidable/tool/record.js +++ /dev/null @@ -1,47 +0,0 @@ -var http = require('http'); -var fs = require('fs'); -var connections = 0; - -var server = http.createServer(function(req, res) { - var socket = req.socket; - console.log('Request: %s %s -> %s', req.method, req.url, socket.filename); - - req.on('end', function() { - if (req.url !== '/') { - res.end(JSON.stringify({ - method: req.method, - url: req.url, - filename: socket.filename, - })); - return; - } - - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - }); -}); - -server.on('connection', function(socket) { - connections++; - - socket.id = connections; - socket.filename = 'connection-' + socket.id + '.http'; - socket.file = fs.createWriteStream(socket.filename); - socket.pipe(socket.file); - - console.log('--> %s', socket.filename); - socket.on('close', function() { - console.log('<-- %s', socket.filename); - }); -}); - -var port = process.env.PORT || 8080; -server.listen(port, function() { - console.log('Recording connections on port %s', port); -}); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/.npmignore deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/.npmignore +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/Makefile b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/Makefile deleted file mode 100644 index 8e8640f..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --reporter spec \ - --require should - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/Readme.md deleted file mode 100644 index 273130d..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/Readme.md +++ /dev/null @@ -1,32 +0,0 @@ - -# node-fresh - - HTTP response freshness testing - -## fresh(req, res) - - Check freshness of `req` and `res` headers. - - When the cache is "fresh" __true__ is returned, - otherwise __false__ is returned to indicate that - the cache is now stale. - -## Example: - -```js -var req = { 'if-none-match': 'tobi' }; -var res = { 'etag': 'luna' }; -fresh(req, res); -// => false - -var req = { 'if-none-match': 'tobi' }; -var res = { 'etag': 'tobi' }; -fresh(req, res); -// => true -``` - -## Installation - -``` -$ npm install fresh -``` \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/index.js deleted file mode 100644 index b2f4d41..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/index.js +++ /dev/null @@ -1,49 +0,0 @@ - -/** - * Expose `fresh()`. - */ - -module.exports = fresh; - -/** - * Check freshness of `req` and `res` headers. - * - * When the cache is "fresh" __true__ is returned, - * otherwise __false__ is returned to indicate that - * the cache is now stale. - * - * @param {Object} req - * @param {Object} res - * @return {Boolean} - * @api public - */ - -function fresh(req, res) { - // defaults - var etagMatches = true; - var notModified = true; - - // fields - var modifiedSince = req['if-modified-since']; - var noneMatch = req['if-none-match']; - var lastModified = res['last-modified']; - var etag = res['etag']; - - // unconditional request - if (!modifiedSince && !noneMatch) return false; - - // parse if-none-match - if (noneMatch) noneMatch = noneMatch.split(/ *, */); - - // if-none-match - if (noneMatch) etagMatches = ~noneMatch.indexOf(etag) || '*' == noneMatch[0]; - - // if-modified-since - if (modifiedSince) { - modifiedSince = new Date(modifiedSince); - lastModified = new Date(lastModified); - notModified = lastModified <= modifiedSince; - } - - return !! (etagMatches && notModified); -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/package.json deleted file mode 100644 index d9fddb2..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/fresh/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "fresh", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "description": "HTTP response freshness testing", - "version": "0.1.0", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "readme": "\n# node-fresh\n\n HTTP response freshness testing\n\n## fresh(req, res)\n\n Check freshness of `req` and `res` headers.\n\n When the cache is \"fresh\" __true__ is returned,\n otherwise __false__ is returned to indicate that\n the cache is now stale.\n\n## Example:\n\n```js\nvar req = { 'if-none-match': 'tobi' };\nvar res = { 'etag': 'luna' };\nfresh(req, res);\n// => false\n\nvar req = { 'if-none-match': 'tobi' };\nvar res = { 'etag': 'tobi' };\nfresh(req, res);\n// => true\n```\n\n## Installation\n\n```\n$ npm install fresh\n```", - "readmeFilename": "Readme.md", - "_id": "fresh@0.1.0", - "_from": "fresh@0.1.0" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/History.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/History.md deleted file mode 100644 index c8aa68f..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/History.md +++ /dev/null @@ -1,5 +0,0 @@ - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/Makefile b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/Makefile deleted file mode 100644 index 4e9c8d3..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --require should \ - --reporter spec - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/Readme.md deleted file mode 100644 index 1cdd68a..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/Readme.md +++ /dev/null @@ -1,29 +0,0 @@ - -# pause - - Pause streams... - -## License - -(The MIT License) - -Copyright (c) 2012 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/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/index.js deleted file mode 100644 index 1b7b379..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/index.js +++ /dev/null @@ -1,29 +0,0 @@ - -module.exports = function(obj){ - var onData - , onEnd - , events = []; - - // buffer data - obj.on('data', onData = function(data, encoding){ - events.push(['data', data, encoding]); - }); - - // buffer end - obj.on('end', onEnd = function(data, encoding){ - events.push(['end', data, encoding]); - }); - - return { - end: function(){ - obj.removeListener('data', onData); - obj.removeListener('end', onEnd); - }, - resume: function(){ - this.end(); - for (var i = 0, len = events.length; i < len; ++i) { - obj.emit.apply(obj, events[i]); - } - } - }; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/package.json deleted file mode 100644 index 73cfe40..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/pause/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "pause", - "version": "0.0.1", - "description": "Pause streams...", - "keywords": [], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "main": "index", - "readme": "\n# pause\n\n Pause streams...\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 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", - "_id": "pause@0.0.1", - "_from": "pause@0.0.1" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/.gitmodules b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[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/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/.npmignore deleted file mode 100644 index e85ce2a..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -test -.travis.yml -benchmark.js -component.json -examples.js -History.md -Makefile diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/Readme.md deleted file mode 100644 index 27e54a4..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/Readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# 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/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/index.js deleted file mode 100644 index 590491e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/index.js +++ /dev/null @@ -1,387 +0,0 @@ -/** - * 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) 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; -}; - -/** - * Create a nullary object if possible - */ - -function createObject() { - return Object.create - ? Object.create(null) - : {}; -} - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = createObject(); - var t = createObject(); - 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(); - // 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 = createObject(); - 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; -} - -/** - * Restore Object.prototype. - * see pull-request #58 - */ - -function restoreProto(obj) { - if (!Object.create) return obj; - if (isArray(obj)) return obj; - if (obj && 'object' != typeof obj) return obj; - - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - obj[key] = restoreProto(obj[key]); - } - } - - obj.__proto__ = Object.prototype; - 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: createObject() }).base; - - return restoreProto(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 (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/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/package.json deleted file mode 100644 index c11401b..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/qs/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.6.5", - "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" - }, - "_id": "qs@0.6.5", - "_from": "qs@0.6.5" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/History.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/History.md deleted file mode 100644 index 20c5319..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/History.md +++ /dev/null @@ -1,25 +0,0 @@ - -0.1.0 / 2012-08-25 -================== - - * add options parameter to send() that is passed to fs.createReadStream() [kanongil] - -0.0.4 / 2012-08-16 -================== - - * allow custom "Accept-Ranges" definition - -0.0.3 / 2012-07-16 -================== - - * fix normalization of the root directory. Closes #3 - -0.0.2 / 2012-07-09 -================== - - * add passing of req explicitly for now (YUCK) - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/Makefile b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/Makefile deleted file mode 100644 index a9dcfd5..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/Makefile +++ /dev/null @@ -1,8 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --require should \ - --reporter spec \ - --bail - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/Readme.md deleted file mode 100644 index ea7b234..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/Readme.md +++ /dev/null @@ -1,128 +0,0 @@ -# send - - Send is Connect's `static()` extracted for generalized use, a streaming static file - server supporting partial responses (Ranges), conditional-GET negotiation, high test coverage, and granular events which may be leveraged to take appropriate actions in your application or framework. - -## Installation - - $ npm install send - -## Examples - - Small: - -```js -var http = require('http'); -var send = require('send'); - -var app = http.createServer(function(req, res){ - send(req, req.url).pipe(res); -}).listen(3000); -``` - - Serving from a root directory with custom error-handling: - -```js -var http = require('http'); -var send = require('send'); -var url = require('url'); - -var app = http.createServer(function(req, res){ - // your custom error-handling logic: - function error(err) { - res.statusCode = err.status || 500; - res.end(err.message); - } - - // your custom directory handling logic: - function redirect() { - res.statusCode = 301; - res.setHeader('Location', req.url + '/'); - res.end('Redirecting to ' + req.url + '/'); - } - - // transfer arbitrary files from within - // /www/example.com/public/* - send(req, url.parse(req.url).pathname) - .root('/www/example.com/public') - .on('error', error) - .on('directory', redirect) - .pipe(res); -}).listen(3000); -``` - -## API - -### Events - - - `error` an error occurred `(err)` - - `directory` a directory was requested - - `file` a file was requested `(path, stat)` - - `stream` file streaming has started `(stream)` - - `end` streaming has completed - -### .root(dir) - - Serve files relative to `path`. Aliased as `.from(dir)`. - -### .index(path) - - By default send supports "index.html" files, to disable this - invoke `.index(false)` or to supply a new index pass a string. - -### .maxage(ms) - - Provide a max-age in milliseconds for http caching, defaults to 0. - -### .hidden(bool) - - Enable or disable transfer of hidden files, defaults to false. - -## Error-handling - - By default when no `error` listeners are present an automatic response will be made, otherwise you have full control over the response, aka you may show a 5xx page etc. - -## Caching - - It does _not_ perform internal caching, you should use a reverse proxy cache such - as Varnish for this, or those fancy things called CDNs. If your application is small enough that it would benefit from single-node memory caching, it's small enough that it does not need caching at all ;). - -## Debugging - - To enable `debug()` instrumentation output export __DEBUG__: - -``` -$ DEBUG=send node app -``` - -## Running tests - -``` -$ npm install -$ make test -``` - -## License - -(The MIT License) - -Copyright (c) 2012 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. diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/index.js deleted file mode 100644 index f17158d..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/send'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/lib/send.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/lib/send.js deleted file mode 100644 index a3d94a6..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/lib/send.js +++ /dev/null @@ -1,474 +0,0 @@ - -/** - * Module dependencies. - */ - -var debug = require('debug')('send') - , parseRange = require('range-parser') - , Stream = require('stream') - , mime = require('mime') - , fresh = require('fresh') - , path = require('path') - , http = require('http') - , fs = require('fs') - , basename = path.basename - , normalize = path.normalize - , join = path.join - , utils = require('./utils'); - -/** - * Expose `send`. - */ - -exports = module.exports = send; - -/** - * Expose mime module. - */ - -exports.mime = mime; - -/** - * Return a `SendStream` for `req` and `path`. - * - * @param {Request} req - * @param {String} path - * @param {Object} options - * @return {SendStream} - * @api public - */ - -function send(req, path, options) { - return new SendStream(req, path, options); -} - -/** - * Initialize a `SendStream` with the given `path`. - * - * Events: - * - * - `error` an error occurred - * - `stream` file streaming has started - * - `end` streaming has completed - * - `directory` a directory was requested - * - * @param {Request} req - * @param {String} path - * @param {Object} options - * @api private - */ - -function SendStream(req, path, options) { - var self = this; - this.req = req; - this.path = path; - this.options = options || {}; - this.maxage(0); - this.hidden(false); - this.index('index.html'); -} - -/** - * Inherits from `Stream.prototype`. - */ - -SendStream.prototype.__proto__ = Stream.prototype; - -/** - * Enable or disable "hidden" (dot) files. - * - * @param {Boolean} path - * @return {SendStream} - * @api public - */ - -SendStream.prototype.hidden = function(val){ - debug('hidden %s', val); - this._hidden = val; - return this; -}; - -/** - * Set index `path`, set to a falsy - * value to disable index support. - * - * @param {String|Boolean} path - * @return {SendStream} - * @api public - */ - -SendStream.prototype.index = function(path){ - debug('index %s', path); - this._index = path; - return this; -}; - -/** - * Set root `path`. - * - * @param {String} path - * @return {SendStream} - * @api public - */ - -SendStream.prototype.root = -SendStream.prototype.from = function(path){ - this._root = normalize(path); - return this; -}; - -/** - * Set max-age to `ms`. - * - * @param {Number} ms - * @return {SendStream} - * @api public - */ - -SendStream.prototype.maxage = function(ms){ - if (Infinity == ms) ms = 60 * 60 * 24 * 365 * 1000; - debug('max-age %d', ms); - this._maxage = ms; - return this; -}; - -/** - * Emit error with `status`. - * - * @param {Number} status - * @api private - */ - -SendStream.prototype.error = function(status, err){ - var res = this.res; - var msg = http.STATUS_CODES[status]; - err = err || new Error(msg); - err.status = status; - if (this.listeners('error').length) return this.emit('error', err); - res.statusCode = err.status; - res.end(msg); -}; - -/** - * Check if the pathname is potentially malicious. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isMalicious = function(){ - return !this._root && ~this.path.indexOf('..'); -}; - -/** - * Check if the pathname ends with "/". - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.hasTrailingSlash = function(){ - return '/' == this.path[this.path.length - 1]; -}; - -/** - * Check if the basename leads with ".". - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.hasLeadingDot = function(){ - return '.' == basename(this.path)[0]; -}; - -/** - * Check if this is a conditional GET request. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isConditionalGET = function(){ - return this.req.headers['if-none-match'] - || this.req.headers['if-modified-since']; -}; - -/** - * Strip content-* header fields. - * - * @api private - */ - -SendStream.prototype.removeContentHeaderFields = function(){ - var res = this.res; - Object.keys(res._headers).forEach(function(field){ - if (0 == field.indexOf('content')) { - res.removeHeader(field); - } - }); -}; - -/** - * Respond with 304 not modified. - * - * @api private - */ - -SendStream.prototype.notModified = function(){ - var res = this.res; - debug('not modified'); - this.removeContentHeaderFields(); - res.statusCode = 304; - res.end(); -}; - -/** - * Check if the request is cacheable, aka - * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isCachable = function(){ - var res = this.res; - return (res.statusCode >= 200 && res.statusCode < 300) || 304 == res.statusCode; -}; - -/** - * Handle stat() error. - * - * @param {Error} err - * @api private - */ - -SendStream.prototype.onStatError = function(err){ - var notfound = ['ENOENT', 'ENAMETOOLONG', 'ENOTDIR']; - if (~notfound.indexOf(err.code)) return this.error(404, err); - this.error(500, err); -}; - -/** - * Check if the cache is fresh. - * - * @return {Boolean} - * @api private - */ - -SendStream.prototype.isFresh = function(){ - return fresh(this.req.headers, this.res._headers); -}; - -/** - * Redirect to `path`. - * - * @param {String} path - * @api private - */ - -SendStream.prototype.redirect = function(path){ - if (this.listeners('directory').length) return this.emit('directory'); - var res = this.res; - path += '/'; - res.statusCode = 301; - res.setHeader('Location', path); - res.end('Redirecting to ' + utils.escape(path)); -}; - -/** - * Pipe to `res. - * - * @param {Stream} res - * @return {Stream} res - * @api public - */ - -SendStream.prototype.pipe = function(res){ - var self = this - , args = arguments - , path = this.path - , root = this._root; - - // references - this.res = res; - - // invalid request uri - path = utils.decode(path); - if (-1 == path) return this.error(400); - - // null byte(s) - if (~path.indexOf('\0')) return this.error(400); - - // join / normalize from optional root dir - if (root) path = normalize(join(this._root, path)); - - // ".." is malicious without "root" - if (this.isMalicious()) return this.error(403); - - // malicious path - if (root && 0 != path.indexOf(root)) return this.error(403); - - // hidden file support - if (!this._hidden && this.hasLeadingDot()) return this.error(404); - - // index file support - if (this._index && this.hasTrailingSlash()) path += this._index; - - debug('stat "%s"', path); - fs.stat(path, function(err, stat){ - if (err) return self.onStatError(err); - if (stat.isDirectory()) return self.redirect(self.path); - self.emit('file', path, stat); - self.send(path, stat); - }); - - return res; -}; - -/** - * Transfer `path`. - * - * @param {String} path - * @api public - */ - -SendStream.prototype.send = function(path, stat){ - var options = this.options; - var len = stat.size; - var res = this.res; - var req = this.req; - var ranges = req.headers.range; - var offset = options.start || 0; - - // set header fields - this.setHeader(stat); - - // set content-type - this.type(path); - - // conditional GET support - if (this.isConditionalGET() - && this.isCachable() - && this.isFresh()) { - return this.notModified(); - } - - // adjust len to start/end options - len = Math.max(0, len - offset); - if (options.end !== undefined) { - var bytes = options.end - offset + 1; - if (len > bytes) len = bytes; - } - - // Range support - if (ranges) { - ranges = parseRange(len, ranges); - - // unsatisfiable - if (-1 == ranges) { - res.setHeader('Content-Range', 'bytes */' + stat.size); - return this.error(416); - } - - // valid (syntactically invalid ranges are treated as a regular response) - if (-2 != ranges) { - options.start = offset + ranges[0].start; - options.end = offset + ranges[0].end; - - // Content-Range - res.statusCode = 206; - res.setHeader('Content-Range', 'bytes ' - + ranges[0].start - + '-' - + ranges[0].end - + '/' - + len); - len = options.end - options.start + 1; - } - } - - // content-length - res.setHeader('Content-Length', len); - - // HEAD support - if ('HEAD' == req.method) return res.end(); - - this.stream(path, options); -}; - -/** - * Stream `path` to the response. - * - * @param {String} path - * @param {Object} options - * @api private - */ - -SendStream.prototype.stream = function(path, options){ - // TODO: this is all lame, refactor meeee - var self = this; - var res = this.res; - var req = this.req; - - // pipe - var stream = fs.createReadStream(path, options); - this.emit('stream', stream); - stream.pipe(res); - - // socket closed, done with the fd - req.on('close', stream.destroy.bind(stream)); - - // error handling code-smell - stream.on('error', function(err){ - // no hope in responding - if (res._header) { - console.error(err.stack); - req.destroy(); - return; - } - - // 500 - err.status = 500; - self.emit('error', err); - }); - - // end - stream.on('end', function(){ - self.emit('end'); - }); -}; - -/** - * Set content-type based on `path` - * if it hasn't been explicitly set. - * - * @param {String} path - * @api private - */ - -SendStream.prototype.type = function(path){ - var res = this.res; - if (res.getHeader('Content-Type')) return; - var type = mime.lookup(path); - var charset = mime.charsets.lookup(type); - debug('content-type %s', type); - res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); -}; - -/** - * Set reaponse header fields, most - * fields may be pre-defined. - * - * @param {Object} stat - * @api private - */ - -SendStream.prototype.setHeader = function(stat){ - var res = this.res; - if (!res.getHeader('Accept-Ranges')) res.setHeader('Accept-Ranges', 'bytes'); - if (!res.getHeader('ETag')) res.setHeader('ETag', utils.etag(stat)); - if (!res.getHeader('Date')) res.setHeader('Date', new Date().toUTCString()); - if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + (this._maxage / 1000)); - if (!res.getHeader('Last-Modified')) res.setHeader('Last-Modified', stat.mtime.toUTCString()); -}; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/lib/utils.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/lib/utils.js deleted file mode 100644 index 950e5a2..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/lib/utils.js +++ /dev/null @@ -1,47 +0,0 @@ - -/** - * Return an ETag in the form of `"-"` - * from the given `stat`. - * - * @param {Object} stat - * @return {String} - * @api private - */ - -exports.etag = function(stat) { - return '"' + stat.size + '-' + Number(stat.mtime) + '"'; -}; - -/** - * decodeURIComponent. - * - * Allows V8 to only deoptimize this fn instead of all - * of send(). - * - * @param {String} path - * @api private - */ - -exports.decode = function(path){ - try { - return decodeURIComponent(path); - } catch (err) { - return -1; - } -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/LICENSE b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/LICENSE deleted file mode 100644 index 451fc45..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -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/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/README.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/README.md deleted file mode 100644 index 6ca19bd..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# mime - -Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. - -## Install - -Install with [npm](http://github.com/isaacs/npm): - - npm install mime - -## API - Queries - -### mime.lookup(path) -Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. - - var mime = require('mime'); - - mime.lookup('/path/to/file.txt'); // => 'text/plain' - mime.lookup('file.txt'); // => 'text/plain' - mime.lookup('.TXT'); // => 'text/plain' - mime.lookup('htm'); // => 'text/html' - -### mime.default_type -Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) - -### mime.extension(type) -Get the default extension for `type` - - mime.extension('text/html'); // => 'html' - mime.extension('application/octet-stream'); // => 'bin' - -### mime.charsets.lookup() - -Map mime-type to charset - - mime.charsets.lookup('text/plain'); // => 'UTF-8' - -(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) - -## API - Defining Custom Types - -The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types). - -### mime.define() - -Add custom mime/extension mappings - - mime.define({ - 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], - 'application/x-my-type': ['x-mt', 'x-mtt'], - // etc ... - }); - - mime.lookup('x-sft'); // => 'text/x-some-format' - -The first entry in the extensions array is returned by `mime.extension()`. E.g. - - mime.extension('text/x-some-format'); // => 'x-sf' - -### mime.load(filepath) - -Load mappings from an Apache ".types" format file - - mime.load('./my_project.types'); - -The .types file format is simple - See the `types` dir for examples. diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/mime.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/mime.js deleted file mode 100644 index 48be0c5..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/mime.js +++ /dev/null @@ -1,114 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -function Mime() { - // Map of extension -> mime type - this.types = Object.create(null); - - // Map of mime type -> extension - this.extensions = Object.create(null); -} - -/** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * @param map (Object) type definitions - */ -Mime.prototype.define = function (map) { - for (var type in map) { - var exts = map[type]; - - for (var i = 0; i < exts.length; i++) { - if (process.env.DEBUG_MIME && this.types[exts]) { - console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + - this.types[exts] + ' to ' + type); - } - - this.types[exts[i]] = type; - } - - // Default extension is the first one we encounter - if (!this.extensions[type]) { - this.extensions[type] = exts[0]; - } - } -}; - -/** - * Load an Apache2-style ".types" file - * - * This may be called multiple times (it's expected). Where files declare - * overlapping types/extensions, the last file wins. - * - * @param file (String) path of file to load. - */ -Mime.prototype.load = function(file) { - - this._loading = file; - // Read file and split into lines - var map = {}, - content = fs.readFileSync(file, 'ascii'), - lines = content.split(/[\r\n]+/); - - lines.forEach(function(line) { - // Clean up whitespace/comments, and split into fields - var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); - map[fields.shift()] = fields; - }); - - this.define(map); - - this._loading = null; -}; - -/** - * Lookup a mime type based on extension - */ -Mime.prototype.lookup = function(path, fallback) { - var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); - - return this.types[ext] || fallback || this.default_type; -}; - -/** - * Return file extension associated with a mime type - */ -Mime.prototype.extension = function(mimeType) { - var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); - return this.extensions[type]; -}; - -// Default instance -var mime = new Mime(); - -// Load local copy of -// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -mime.load(path.join(__dirname, 'types/mime.types')); - -// Load additional types from node.js community -mime.load(path.join(__dirname, 'types/node.types')); - -// Default type -mime.default_type = mime.lookup('bin'); - -// -// Additional API specific to the default instance -// - -mime.Mime = Mime; - -/** - * Lookup a charset based on mime type. - */ -mime.charsets = { - lookup: function(mimeType, fallback) { - // Assume text types are utf8 - return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; - } -}; - -module.exports = mime; diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/package.json deleted file mode 100644 index 4e7b0fd..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - }, - "contributors": [ - { - "name": "Benjamin Thomas", - "email": "benjamin@benjaminthomas.org", - "url": "http://github.com/bentomas" - } - ], - "dependencies": {}, - "description": "A comprehensive library for mime-type mapping", - "devDependencies": {}, - "keywords": [ - "util", - "mime" - ], - "main": "mime.js", - "name": "mime", - "repository": { - "url": "https://github.com/broofa/node-mime", - "type": "git" - }, - "version": "1.2.11", - "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-mime/issues" - }, - "_id": "mime@1.2.11", - "_from": "mime@~1.2.9" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/test.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/test.js deleted file mode 100644 index 2cda1c7..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/test.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Usage: node test.js - */ - -var mime = require('./mime'); -var assert = require('assert'); -var path = require('path'); - -function eq(a, b) { - console.log('Test: ' + a + ' === ' + b); - assert.strictEqual.apply(null, arguments); -} - -console.log(Object.keys(mime.extensions).length + ' types'); -console.log(Object.keys(mime.types).length + ' extensions\n'); - -// -// Test mime lookups -// - -eq('text/plain', mime.lookup('text.txt')); // normal file -eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase -eq('text/plain', mime.lookup('dir/text.txt')); // dir + file -eq('text/plain', mime.lookup('.text.txt')); // hidden file -eq('text/plain', mime.lookup('.txt')); // nameless -eq('text/plain', mime.lookup('txt')); // extension-only -eq('text/plain', mime.lookup('/txt')); // extension-less () -eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less -eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized -eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default - -// -// Test extensions -// - -eq('txt', mime.extension(mime.types.text)); -eq('html', mime.extension(mime.types.htm)); -eq('bin', mime.extension('application/octet-stream')); -eq('bin', mime.extension('application/octet-stream ')); -eq('html', mime.extension(' text/html; charset=UTF-8')); -eq('html', mime.extension('text/html; charset=UTF-8 ')); -eq('html', mime.extension('text/html; charset=UTF-8')); -eq('html', mime.extension('text/html ; charset=UTF-8')); -eq('html', mime.extension('text/html;charset=UTF-8')); -eq('html', mime.extension('text/Html;charset=UTF-8')); -eq(undefined, mime.extension('unrecognized')); - -// -// Test node.types lookups -// - -eq('application/font-woff', mime.lookup('file.woff')); -eq('application/octet-stream', mime.lookup('file.buffer')); -eq('audio/mp4', mime.lookup('file.m4a')); -eq('font/opentype', mime.lookup('file.otf')); - -// -// Test charsets -// - -eq('UTF-8', mime.charsets.lookup('text/plain')); -eq(undefined, mime.charsets.lookup(mime.types.js)); -eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); - -// -// Test for overlaps between mime.types and node.types -// - -var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime(); -apacheTypes.load(path.join(__dirname, 'types/mime.types')); -nodeTypes.load(path.join(__dirname, 'types/node.types')); - -var keys = [].concat(Object.keys(apacheTypes.types)) - .concat(Object.keys(nodeTypes.types)); -keys.sort(); -for (var i = 1; i < keys.length; i++) { - if (keys[i] == keys[i-1]) { - console.warn('Warning: ' + - 'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] + - ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]); - } -} - -console.log('\nOK'); diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/types/mime.types b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/types/mime.types deleted file mode 100644 index da8cd69..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/types/mime.types +++ /dev/null @@ -1,1588 +0,0 @@ -# This file maps Internet media types to unique file extension(s). -# Although created for httpd, this file is used by many software systems -# and has been placed in the public domain for unlimited redisribution. -# -# The table below contains both registered and (common) unregistered types. -# A type that has no unique extension can be ignored -- they are listed -# here to guide configurations toward known types and to make it easier to -# identify "new" types. File extensions are also commonly used to indicate -# content languages and encodings, so choose them carefully. -# -# Internet media types should be registered as described in RFC 4288. -# The registry is at . -# -# MIME type (lowercased) Extensions -# ============================================ ========== -# application/1d-interleaved-parityfec -# application/3gpp-ims+xml -# application/activemessage -application/andrew-inset ez -# application/applefile -application/applixware aw -application/atom+xml atom -application/atomcat+xml atomcat -# application/atomicmail -application/atomsvc+xml atomsvc -# application/auth-policy+xml -# application/batch-smtp -# application/beep+xml -# application/calendar+xml -# application/cals-1840 -# application/ccmp+xml -application/ccxml+xml ccxml -application/cdmi-capability cdmia -application/cdmi-container cdmic -application/cdmi-domain cdmid -application/cdmi-object cdmio -application/cdmi-queue cdmiq -# application/cea-2018+xml -# application/cellml+xml -# application/cfw -# application/cnrp+xml -# application/commonground -# application/conference-info+xml -# application/cpl+xml -# application/csta+xml -# application/cstadata+xml -application/cu-seeme cu -# application/cybercash -application/davmount+xml davmount -# application/dca-rft -# application/dec-dx -# application/dialog-info+xml -# application/dicom -# application/dns -application/docbook+xml dbk -# application/dskpp+xml -application/dssc+der dssc -application/dssc+xml xdssc -# application/dvcs -application/ecmascript ecma -# application/edi-consent -# application/edi-x12 -# application/edifact -application/emma+xml emma -# application/epp+xml -application/epub+zip epub -# application/eshop -# application/example -application/exi exi -# application/fastinfoset -# application/fastsoap -# application/fits -application/font-tdpfr pfr -# application/framework-attributes+xml -application/gml+xml gml -application/gpx+xml gpx -application/gxf gxf -# application/h224 -# application/held+xml -# application/http -application/hyperstudio stk -# application/ibe-key-request+xml -# application/ibe-pkg-reply+xml -# application/ibe-pp-data -# application/iges -# application/im-iscomposing+xml -# application/index -# application/index.cmd -# application/index.obj -# application/index.response -# application/index.vnd -application/inkml+xml ink inkml -# application/iotp -application/ipfix ipfix -# application/ipp -# application/isup -application/java-archive jar -application/java-serialized-object ser -application/java-vm class -application/javascript js -application/json json -application/jsonml+json jsonml -# application/kpml-request+xml -# application/kpml-response+xml -application/lost+xml lostxml -application/mac-binhex40 hqx -application/mac-compactpro cpt -# application/macwriteii -application/mads+xml mads -application/marc mrc -application/marcxml+xml mrcx -application/mathematica ma nb mb -# application/mathml-content+xml -# application/mathml-presentation+xml -application/mathml+xml mathml -# application/mbms-associated-procedure-description+xml -# application/mbms-deregister+xml -# application/mbms-envelope+xml -# application/mbms-msk+xml -# application/mbms-msk-response+xml -# application/mbms-protection-description+xml -# application/mbms-reception-report+xml -# application/mbms-register+xml -# application/mbms-register-response+xml -# application/mbms-user-service-description+xml -application/mbox mbox -# application/media_control+xml -application/mediaservercontrol+xml mscml -application/metalink+xml metalink -application/metalink4+xml meta4 -application/mets+xml mets -# application/mikey -application/mods+xml mods -# application/moss-keys -# application/moss-signature -# application/mosskey-data -# application/mosskey-request -application/mp21 m21 mp21 -application/mp4 mp4s -# application/mpeg4-generic -# application/mpeg4-iod -# application/mpeg4-iod-xmt -# application/msc-ivr+xml -# application/msc-mixer+xml -application/msword doc dot -application/mxf mxf -# application/nasdata -# application/news-checkgroups -# application/news-groupinfo -# application/news-transmission -# application/nss -# application/ocsp-request -# application/ocsp-response -application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy -application/oda oda -application/oebps-package+xml opf -application/ogg ogx -application/omdoc+xml omdoc -application/onenote onetoc onetoc2 onetmp onepkg -application/oxps oxps -# application/parityfec -application/patch-ops-error+xml xer -application/pdf pdf -application/pgp-encrypted pgp -# application/pgp-keys -application/pgp-signature asc sig -application/pics-rules prf -# application/pidf+xml -# application/pidf-diff+xml -application/pkcs10 p10 -application/pkcs7-mime p7m p7c -application/pkcs7-signature p7s -application/pkcs8 p8 -application/pkix-attr-cert ac -application/pkix-cert cer -application/pkix-crl crl -application/pkix-pkipath pkipath -application/pkixcmp pki -application/pls+xml pls -# application/poc-settings+xml -application/postscript ai eps ps -# application/prs.alvestrand.titrax-sheet -application/prs.cww cww -# application/prs.nprend -# application/prs.plucker -# application/prs.rdf-xml-crypt -# application/prs.xsf+xml -application/pskc+xml pskcxml -# application/qsig -application/rdf+xml rdf -application/reginfo+xml rif -application/relax-ng-compact-syntax rnc -# application/remote-printing -application/resource-lists+xml rl -application/resource-lists-diff+xml rld -# application/riscos -# application/rlmi+xml -application/rls-services+xml rs -application/rpki-ghostbusters gbr -application/rpki-manifest mft -application/rpki-roa roa -# application/rpki-updown -application/rsd+xml rsd -application/rss+xml rss -application/rtf rtf -# application/rtx -# application/samlassertion+xml -# application/samlmetadata+xml -application/sbml+xml sbml -application/scvp-cv-request scq -application/scvp-cv-response scs -application/scvp-vp-request spq -application/scvp-vp-response spp -application/sdp sdp -# application/set-payment -application/set-payment-initiation setpay -# application/set-registration -application/set-registration-initiation setreg -# application/sgml -# application/sgml-open-catalog -application/shf+xml shf -# application/sieve -# application/simple-filter+xml -# application/simple-message-summary -# application/simplesymbolcontainer -# application/slate -# application/smil -application/smil+xml smi smil -# application/soap+fastinfoset -# application/soap+xml -application/sparql-query rq -application/sparql-results+xml srx -# application/spirits-event+xml -application/srgs gram -application/srgs+xml grxml -application/sru+xml sru -application/ssdl+xml ssdl -application/ssml+xml ssml -# application/tamp-apex-update -# application/tamp-apex-update-confirm -# application/tamp-community-update -# application/tamp-community-update-confirm -# application/tamp-error -# application/tamp-sequence-adjust -# application/tamp-sequence-adjust-confirm -# application/tamp-status-query -# application/tamp-status-response -# application/tamp-update -# application/tamp-update-confirm -application/tei+xml tei teicorpus -application/thraud+xml tfi -# application/timestamp-query -# application/timestamp-reply -application/timestamped-data tsd -# application/tve-trigger -# application/ulpfec -# application/vcard+xml -# application/vemmi -# application/vividence.scriptfile -# application/vnd.3gpp.bsf+xml -application/vnd.3gpp.pic-bw-large plb -application/vnd.3gpp.pic-bw-small psb -application/vnd.3gpp.pic-bw-var pvb -# application/vnd.3gpp.sms -# application/vnd.3gpp2.bcmcsinfo+xml -# application/vnd.3gpp2.sms -application/vnd.3gpp2.tcap tcap -application/vnd.3m.post-it-notes pwn -application/vnd.accpac.simply.aso aso -application/vnd.accpac.simply.imp imp -application/vnd.acucobol acu -application/vnd.acucorp atc acutc -application/vnd.adobe.air-application-installer-package+zip air -application/vnd.adobe.formscentral.fcdt fcdt -application/vnd.adobe.fxp fxp fxpl -# application/vnd.adobe.partial-upload -application/vnd.adobe.xdp+xml xdp -application/vnd.adobe.xfdf xfdf -# application/vnd.aether.imp -# application/vnd.ah-barcode -application/vnd.ahead.space ahead -application/vnd.airzip.filesecure.azf azf -application/vnd.airzip.filesecure.azs azs -application/vnd.amazon.ebook azw -application/vnd.americandynamics.acc acc -application/vnd.amiga.ami ami -# application/vnd.amundsen.maze+xml -application/vnd.android.package-archive apk -application/vnd.anser-web-certificate-issue-initiation cii -application/vnd.anser-web-funds-transfer-initiation fti -application/vnd.antix.game-component atx -application/vnd.apple.installer+xml mpkg -application/vnd.apple.mpegurl m3u8 -# application/vnd.arastra.swi -application/vnd.aristanetworks.swi swi -application/vnd.astraea-software.iota iota -application/vnd.audiograph aep -# application/vnd.autopackage -# application/vnd.avistar+xml -application/vnd.blueice.multipass mpm -# application/vnd.bluetooth.ep.oob -application/vnd.bmi bmi -application/vnd.businessobjects rep -# application/vnd.cab-jscript -# application/vnd.canon-cpdl -# application/vnd.canon-lips -# application/vnd.cendio.thinlinc.clientconf -application/vnd.chemdraw+xml cdxml -application/vnd.chipnuts.karaoke-mmd mmd -application/vnd.cinderella cdy -# application/vnd.cirpack.isdn-ext -application/vnd.claymore cla -application/vnd.cloanto.rp9 rp9 -application/vnd.clonk.c4group c4g c4d c4f c4p c4u -application/vnd.cluetrust.cartomobile-config c11amc -application/vnd.cluetrust.cartomobile-config-pkg c11amz -# application/vnd.collection+json -# application/vnd.commerce-battelle -application/vnd.commonspace csp -application/vnd.contact.cmsg cdbcmsg -application/vnd.cosmocaller cmc -application/vnd.crick.clicker clkx -application/vnd.crick.clicker.keyboard clkk -application/vnd.crick.clicker.palette clkp -application/vnd.crick.clicker.template clkt -application/vnd.crick.clicker.wordbank clkw -application/vnd.criticaltools.wbs+xml wbs -application/vnd.ctc-posml pml -# application/vnd.ctct.ws+xml -# application/vnd.cups-pdf -# application/vnd.cups-postscript -application/vnd.cups-ppd ppd -# application/vnd.cups-raster -# application/vnd.cups-raw -# application/vnd.curl -application/vnd.curl.car car -application/vnd.curl.pcurl pcurl -# application/vnd.cybank -application/vnd.dart dart -application/vnd.data-vision.rdz rdz -application/vnd.dece.data uvf uvvf uvd uvvd -application/vnd.dece.ttml+xml uvt uvvt -application/vnd.dece.unspecified uvx uvvx -application/vnd.dece.zip uvz uvvz -application/vnd.denovo.fcselayout-link fe_launch -# application/vnd.dir-bi.plate-dl-nosuffix -application/vnd.dna dna -application/vnd.dolby.mlp mlp -# application/vnd.dolby.mobile.1 -# application/vnd.dolby.mobile.2 -application/vnd.dpgraph dpg -application/vnd.dreamfactory dfac -application/vnd.ds-keypoint kpxx -application/vnd.dvb.ait ait -# application/vnd.dvb.dvbj -# application/vnd.dvb.esgcontainer -# application/vnd.dvb.ipdcdftnotifaccess -# application/vnd.dvb.ipdcesgaccess -# application/vnd.dvb.ipdcesgaccess2 -# application/vnd.dvb.ipdcesgpdd -# application/vnd.dvb.ipdcroaming -# application/vnd.dvb.iptv.alfec-base -# application/vnd.dvb.iptv.alfec-enhancement -# application/vnd.dvb.notif-aggregate-root+xml -# application/vnd.dvb.notif-container+xml -# application/vnd.dvb.notif-generic+xml -# application/vnd.dvb.notif-ia-msglist+xml -# application/vnd.dvb.notif-ia-registration-request+xml -# application/vnd.dvb.notif-ia-registration-response+xml -# application/vnd.dvb.notif-init+xml -# application/vnd.dvb.pfr -application/vnd.dvb.service svc -# application/vnd.dxr -application/vnd.dynageo geo -# application/vnd.easykaraoke.cdgdownload -# application/vnd.ecdis-update -application/vnd.ecowin.chart mag -# application/vnd.ecowin.filerequest -# application/vnd.ecowin.fileupdate -# application/vnd.ecowin.series -# application/vnd.ecowin.seriesrequest -# application/vnd.ecowin.seriesupdate -# application/vnd.emclient.accessrequest+xml -application/vnd.enliven nml -# application/vnd.eprints.data+xml -application/vnd.epson.esf esf -application/vnd.epson.msf msf -application/vnd.epson.quickanime qam -application/vnd.epson.salt slt -application/vnd.epson.ssf ssf -# application/vnd.ericsson.quickcall -application/vnd.eszigno3+xml es3 et3 -# application/vnd.etsi.aoc+xml -# application/vnd.etsi.cug+xml -# application/vnd.etsi.iptvcommand+xml -# application/vnd.etsi.iptvdiscovery+xml -# application/vnd.etsi.iptvprofile+xml -# application/vnd.etsi.iptvsad-bc+xml -# application/vnd.etsi.iptvsad-cod+xml -# application/vnd.etsi.iptvsad-npvr+xml -# application/vnd.etsi.iptvservice+xml -# application/vnd.etsi.iptvsync+xml -# application/vnd.etsi.iptvueprofile+xml -# application/vnd.etsi.mcid+xml -# application/vnd.etsi.overload-control-policy-dataset+xml -# application/vnd.etsi.sci+xml -# application/vnd.etsi.simservs+xml -# application/vnd.etsi.tsl+xml -# application/vnd.etsi.tsl.der -# application/vnd.eudora.data -application/vnd.ezpix-album ez2 -application/vnd.ezpix-package ez3 -# application/vnd.f-secure.mobile -application/vnd.fdf fdf -application/vnd.fdsn.mseed mseed -application/vnd.fdsn.seed seed dataless -# application/vnd.ffsns -# application/vnd.fints -application/vnd.flographit gph -application/vnd.fluxtime.clip ftc -# application/vnd.font-fontforge-sfd -application/vnd.framemaker fm frame maker book -application/vnd.frogans.fnc fnc -application/vnd.frogans.ltf ltf -application/vnd.fsc.weblaunch fsc -application/vnd.fujitsu.oasys oas -application/vnd.fujitsu.oasys2 oa2 -application/vnd.fujitsu.oasys3 oa3 -application/vnd.fujitsu.oasysgp fg5 -application/vnd.fujitsu.oasysprs bh2 -# application/vnd.fujixerox.art-ex -# application/vnd.fujixerox.art4 -# application/vnd.fujixerox.hbpl -application/vnd.fujixerox.ddd ddd -application/vnd.fujixerox.docuworks xdw -application/vnd.fujixerox.docuworks.binder xbd -# application/vnd.fut-misnet -application/vnd.fuzzysheet fzs -application/vnd.genomatix.tuxedo txd -# application/vnd.geocube+xml -application/vnd.geogebra.file ggb -application/vnd.geogebra.tool ggt -application/vnd.geometry-explorer gex gre -application/vnd.geonext gxt -application/vnd.geoplan g2w -application/vnd.geospace g3w -# application/vnd.globalplatform.card-content-mgt -# application/vnd.globalplatform.card-content-mgt-response -application/vnd.gmx gmx -application/vnd.google-earth.kml+xml kml -application/vnd.google-earth.kmz kmz -application/vnd.grafeq gqf gqs -# application/vnd.gridmp -application/vnd.groove-account gac -application/vnd.groove-help ghf -application/vnd.groove-identity-message gim -application/vnd.groove-injector grv -application/vnd.groove-tool-message gtm -application/vnd.groove-tool-template tpl -application/vnd.groove-vcard vcg -# application/vnd.hal+json -application/vnd.hal+xml hal -application/vnd.handheld-entertainment+xml zmm -application/vnd.hbci hbci -# application/vnd.hcl-bireports -application/vnd.hhe.lesson-player les -application/vnd.hp-hpgl hpgl -application/vnd.hp-hpid hpid -application/vnd.hp-hps hps -application/vnd.hp-jlyt jlt -application/vnd.hp-pcl pcl -application/vnd.hp-pclxl pclxl -# application/vnd.httphone -application/vnd.hydrostatix.sof-data sfd-hdstx -# application/vnd.hzn-3d-crossword -# application/vnd.ibm.afplinedata -# application/vnd.ibm.electronic-media -application/vnd.ibm.minipay mpy -application/vnd.ibm.modcap afp listafp list3820 -application/vnd.ibm.rights-management irm -application/vnd.ibm.secure-container sc -application/vnd.iccprofile icc icm -application/vnd.igloader igl -application/vnd.immervision-ivp ivp -application/vnd.immervision-ivu ivu -# application/vnd.informedcontrol.rms+xml -# application/vnd.informix-visionary -# application/vnd.infotech.project -# application/vnd.infotech.project+xml -# application/vnd.innopath.wamp.notification -application/vnd.insors.igm igm -application/vnd.intercon.formnet xpw xpx -application/vnd.intergeo i2g -# application/vnd.intertrust.digibox -# application/vnd.intertrust.nncp -application/vnd.intu.qbo qbo -application/vnd.intu.qfx qfx -# application/vnd.iptc.g2.conceptitem+xml -# application/vnd.iptc.g2.knowledgeitem+xml -# application/vnd.iptc.g2.newsitem+xml -# application/vnd.iptc.g2.newsmessage+xml -# application/vnd.iptc.g2.packageitem+xml -# application/vnd.iptc.g2.planningitem+xml -application/vnd.ipunplugged.rcprofile rcprofile -application/vnd.irepository.package+xml irp -application/vnd.is-xpr xpr -application/vnd.isac.fcs fcs -application/vnd.jam jam -# application/vnd.japannet-directory-service -# application/vnd.japannet-jpnstore-wakeup -# application/vnd.japannet-payment-wakeup -# application/vnd.japannet-registration -# application/vnd.japannet-registration-wakeup -# application/vnd.japannet-setstore-wakeup -# application/vnd.japannet-verification -# application/vnd.japannet-verification-wakeup -application/vnd.jcp.javame.midlet-rms rms -application/vnd.jisp jisp -application/vnd.joost.joda-archive joda -application/vnd.kahootz ktz ktr -application/vnd.kde.karbon karbon -application/vnd.kde.kchart chrt -application/vnd.kde.kformula kfo -application/vnd.kde.kivio flw -application/vnd.kde.kontour kon -application/vnd.kde.kpresenter kpr kpt -application/vnd.kde.kspread ksp -application/vnd.kde.kword kwd kwt -application/vnd.kenameaapp htke -application/vnd.kidspiration kia -application/vnd.kinar kne knp -application/vnd.koan skp skd skt skm -application/vnd.kodak-descriptor sse -application/vnd.las.las+xml lasxml -# application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop lbd -application/vnd.llamagraphics.life-balance.exchange+xml lbe -application/vnd.lotus-1-2-3 123 -application/vnd.lotus-approach apr -application/vnd.lotus-freelance pre -application/vnd.lotus-notes nsf -application/vnd.lotus-organizer org -application/vnd.lotus-screencam scm -application/vnd.lotus-wordpro lwp -application/vnd.macports.portpkg portpkg -# application/vnd.marlin.drm.actiontoken+xml -# application/vnd.marlin.drm.conftoken+xml -# application/vnd.marlin.drm.license+xml -# application/vnd.marlin.drm.mdcf -application/vnd.mcd mcd -application/vnd.medcalcdata mc1 -application/vnd.mediastation.cdkey cdkey -# application/vnd.meridian-slingshot -application/vnd.mfer mwf -application/vnd.mfmp mfm -application/vnd.micrografx.flo flo -application/vnd.micrografx.igx igx -application/vnd.mif mif -# application/vnd.minisoft-hp3000-save -# application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf daf -application/vnd.mobius.dis dis -application/vnd.mobius.mbk mbk -application/vnd.mobius.mqy mqy -application/vnd.mobius.msl msl -application/vnd.mobius.plc plc -application/vnd.mobius.txf txf -application/vnd.mophun.application mpn -application/vnd.mophun.certificate mpc -# application/vnd.motorola.flexsuite -# application/vnd.motorola.flexsuite.adsi -# application/vnd.motorola.flexsuite.fis -# application/vnd.motorola.flexsuite.gotap -# application/vnd.motorola.flexsuite.kmr -# application/vnd.motorola.flexsuite.ttc -# application/vnd.motorola.flexsuite.wem -# application/vnd.motorola.iprm -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry cil -# application/vnd.ms-asf -application/vnd.ms-cab-compressed cab -# application/vnd.ms-color.iccprofile -application/vnd.ms-excel xls xlm xla xlc xlt xlw -application/vnd.ms-excel.addin.macroenabled.12 xlam -application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb -application/vnd.ms-excel.sheet.macroenabled.12 xlsm -application/vnd.ms-excel.template.macroenabled.12 xltm -application/vnd.ms-fontobject eot -application/vnd.ms-htmlhelp chm -application/vnd.ms-ims ims -application/vnd.ms-lrm lrm -# application/vnd.ms-office.activex+xml -application/vnd.ms-officetheme thmx -# application/vnd.ms-opentype -# application/vnd.ms-package.obfuscated-opentype -application/vnd.ms-pki.seccat cat -application/vnd.ms-pki.stl stl -# application/vnd.ms-playready.initiator+xml -application/vnd.ms-powerpoint ppt pps pot -application/vnd.ms-powerpoint.addin.macroenabled.12 ppam -application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm -application/vnd.ms-powerpoint.slide.macroenabled.12 sldm -application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm -application/vnd.ms-powerpoint.template.macroenabled.12 potm -# application/vnd.ms-printing.printticket+xml -application/vnd.ms-project mpp mpt -# application/vnd.ms-tnef -# application/vnd.ms-wmdrm.lic-chlg-req -# application/vnd.ms-wmdrm.lic-resp -# application/vnd.ms-wmdrm.meter-chlg-req -# application/vnd.ms-wmdrm.meter-resp -application/vnd.ms-word.document.macroenabled.12 docm -application/vnd.ms-word.template.macroenabled.12 dotm -application/vnd.ms-works wps wks wcm wdb -application/vnd.ms-wpl wpl -application/vnd.ms-xpsdocument xps -application/vnd.mseq mseq -# application/vnd.msign -# application/vnd.multiad.creator -# application/vnd.multiad.creator.cif -# application/vnd.music-niff -application/vnd.musician mus -application/vnd.muvee.style msty -application/vnd.mynfc taglet -# application/vnd.ncd.control -# application/vnd.ncd.reference -# application/vnd.nervana -# application/vnd.netfpx -application/vnd.neurolanguage.nlu nlu -application/vnd.nitf ntf nitf -application/vnd.noblenet-directory nnd -application/vnd.noblenet-sealer nns -application/vnd.noblenet-web nnw -# application/vnd.nokia.catalogs -# application/vnd.nokia.conml+wbxml -# application/vnd.nokia.conml+xml -# application/vnd.nokia.isds-radio-presets -# application/vnd.nokia.iptv.config+xml -# application/vnd.nokia.landmark+wbxml -# application/vnd.nokia.landmark+xml -# application/vnd.nokia.landmarkcollection+xml -# application/vnd.nokia.n-gage.ac+xml -application/vnd.nokia.n-gage.data ngdat -application/vnd.nokia.n-gage.symbian.install n-gage -# application/vnd.nokia.ncd -# application/vnd.nokia.pcd+wbxml -# application/vnd.nokia.pcd+xml -application/vnd.nokia.radio-preset rpst -application/vnd.nokia.radio-presets rpss -application/vnd.novadigm.edm edm -application/vnd.novadigm.edx edx -application/vnd.novadigm.ext ext -# application/vnd.ntt-local.file-transfer -# application/vnd.ntt-local.sip-ta_remote -# application/vnd.ntt-local.sip-ta_tcp_stream -application/vnd.oasis.opendocument.chart odc -application/vnd.oasis.opendocument.chart-template otc -application/vnd.oasis.opendocument.database odb -application/vnd.oasis.opendocument.formula odf -application/vnd.oasis.opendocument.formula-template odft -application/vnd.oasis.opendocument.graphics odg -application/vnd.oasis.opendocument.graphics-template otg -application/vnd.oasis.opendocument.image odi -application/vnd.oasis.opendocument.image-template oti -application/vnd.oasis.opendocument.presentation odp -application/vnd.oasis.opendocument.presentation-template otp -application/vnd.oasis.opendocument.spreadsheet ods -application/vnd.oasis.opendocument.spreadsheet-template ots -application/vnd.oasis.opendocument.text odt -application/vnd.oasis.opendocument.text-master odm -application/vnd.oasis.opendocument.text-template ott -application/vnd.oasis.opendocument.text-web oth -# application/vnd.obn -# application/vnd.oftn.l10n+json -# application/vnd.oipf.contentaccessdownload+xml -# application/vnd.oipf.contentaccessstreaming+xml -# application/vnd.oipf.cspg-hexbinary -# application/vnd.oipf.dae.svg+xml -# application/vnd.oipf.dae.xhtml+xml -# application/vnd.oipf.mippvcontrolmessage+xml -# application/vnd.oipf.pae.gem -# application/vnd.oipf.spdiscovery+xml -# application/vnd.oipf.spdlist+xml -# application/vnd.oipf.ueprofile+xml -# application/vnd.oipf.userprofile+xml -application/vnd.olpc-sugar xo -# application/vnd.oma-scws-config -# application/vnd.oma-scws-http-request -# application/vnd.oma-scws-http-response -# application/vnd.oma.bcast.associated-procedure-parameter+xml -# application/vnd.oma.bcast.drm-trigger+xml -# application/vnd.oma.bcast.imd+xml -# application/vnd.oma.bcast.ltkm -# application/vnd.oma.bcast.notification+xml -# application/vnd.oma.bcast.provisioningtrigger -# application/vnd.oma.bcast.sgboot -# application/vnd.oma.bcast.sgdd+xml -# application/vnd.oma.bcast.sgdu -# application/vnd.oma.bcast.simple-symbol-container -# application/vnd.oma.bcast.smartcard-trigger+xml -# application/vnd.oma.bcast.sprov+xml -# application/vnd.oma.bcast.stkm -# application/vnd.oma.cab-address-book+xml -# application/vnd.oma.cab-feature-handler+xml -# application/vnd.oma.cab-pcc+xml -# application/vnd.oma.cab-user-prefs+xml -# application/vnd.oma.dcd -# application/vnd.oma.dcdc -application/vnd.oma.dd2+xml dd2 -# application/vnd.oma.drm.risd+xml -# application/vnd.oma.group-usage-list+xml -# application/vnd.oma.pal+xml -# application/vnd.oma.poc.detailed-progress-report+xml -# application/vnd.oma.poc.final-report+xml -# application/vnd.oma.poc.groups+xml -# application/vnd.oma.poc.invocation-descriptor+xml -# application/vnd.oma.poc.optimized-progress-report+xml -# application/vnd.oma.push -# application/vnd.oma.scidm.messages+xml -# application/vnd.oma.xcap-directory+xml -# application/vnd.omads-email+xml -# application/vnd.omads-file+xml -# application/vnd.omads-folder+xml -# application/vnd.omaloc-supl-init -application/vnd.openofficeorg.extension oxt -# application/vnd.openxmlformats-officedocument.custom-properties+xml -# application/vnd.openxmlformats-officedocument.customxmlproperties+xml -# application/vnd.openxmlformats-officedocument.drawing+xml -# application/vnd.openxmlformats-officedocument.drawingml.chart+xml -# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml -# application/vnd.openxmlformats-officedocument.extended-properties+xml -# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml -# application/vnd.openxmlformats-officedocument.presentationml.comments+xml -# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml -application/vnd.openxmlformats-officedocument.presentationml.presentation pptx -# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml -application/vnd.openxmlformats-officedocument.presentationml.slide sldx -# application/vnd.openxmlformats-officedocument.presentationml.slide+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml -application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx -# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml -# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml -# application/vnd.openxmlformats-officedocument.presentationml.tags+xml -application/vnd.openxmlformats-officedocument.presentationml.template potx -# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx -# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml -# application/vnd.openxmlformats-officedocument.theme+xml -# application/vnd.openxmlformats-officedocument.themeoverride+xml -# application/vnd.openxmlformats-officedocument.vmldrawing -# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.document docx -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx -# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml -# application/vnd.openxmlformats-package.core-properties+xml -# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml -# application/vnd.openxmlformats-package.relationships+xml -# application/vnd.quobject-quoxdocument -# application/vnd.osa.netdeploy -application/vnd.osgeo.mapguide.package mgp -# application/vnd.osgi.bundle -application/vnd.osgi.dp dp -application/vnd.osgi.subsystem esa -# application/vnd.otps.ct-kip+xml -application/vnd.palm pdb pqa oprc -# application/vnd.paos.xml -application/vnd.pawaafile paw -application/vnd.pg.format str -application/vnd.pg.osasli ei6 -# application/vnd.piaccess.application-licence -application/vnd.picsel efif -application/vnd.pmi.widget wg -# application/vnd.poc.group-advertisement+xml -application/vnd.pocketlearn plf -application/vnd.powerbuilder6 pbd -# application/vnd.powerbuilder6-s -# application/vnd.powerbuilder7 -# application/vnd.powerbuilder7-s -# application/vnd.powerbuilder75 -# application/vnd.powerbuilder75-s -# application/vnd.preminet -application/vnd.previewsystems.box box -application/vnd.proteus.magazine mgz -application/vnd.publishare-delta-tree qps -application/vnd.pvi.ptid1 ptid -# application/vnd.pwg-multiplexed -# application/vnd.pwg-xhtml-print+xml -# application/vnd.qualcomm.brew-app-res -application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb -# application/vnd.radisys.moml+xml -# application/vnd.radisys.msml+xml -# application/vnd.radisys.msml-audit+xml -# application/vnd.radisys.msml-audit-conf+xml -# application/vnd.radisys.msml-audit-conn+xml -# application/vnd.radisys.msml-audit-dialog+xml -# application/vnd.radisys.msml-audit-stream+xml -# application/vnd.radisys.msml-conf+xml -# application/vnd.radisys.msml-dialog+xml -# application/vnd.radisys.msml-dialog-base+xml -# application/vnd.radisys.msml-dialog-fax-detect+xml -# application/vnd.radisys.msml-dialog-fax-sendrecv+xml -# application/vnd.radisys.msml-dialog-group+xml -# application/vnd.radisys.msml-dialog-speech+xml -# application/vnd.radisys.msml-dialog-transform+xml -# application/vnd.rainstor.data -# application/vnd.rapid -application/vnd.realvnc.bed bed -application/vnd.recordare.musicxml mxl -application/vnd.recordare.musicxml+xml musicxml -# application/vnd.renlearn.rlprint -application/vnd.rig.cryptonote cryptonote -application/vnd.rim.cod cod -application/vnd.rn-realmedia rm -application/vnd.rn-realmedia-vbr rmvb -application/vnd.route66.link66+xml link66 -# application/vnd.rs-274x -# application/vnd.ruckus.download -# application/vnd.s3sms -application/vnd.sailingtracker.track st -# application/vnd.sbm.cid -# application/vnd.sbm.mid2 -# application/vnd.scribus -# application/vnd.sealed.3df -# application/vnd.sealed.csf -# application/vnd.sealed.doc -# application/vnd.sealed.eml -# application/vnd.sealed.mht -# application/vnd.sealed.net -# application/vnd.sealed.ppt -# application/vnd.sealed.tiff -# application/vnd.sealed.xls -# application/vnd.sealedmedia.softseal.html -# application/vnd.sealedmedia.softseal.pdf -application/vnd.seemail see -application/vnd.sema sema -application/vnd.semd semd -application/vnd.semf semf -application/vnd.shana.informed.formdata ifm -application/vnd.shana.informed.formtemplate itp -application/vnd.shana.informed.interchange iif -application/vnd.shana.informed.package ipk -application/vnd.simtech-mindmapper twd twds -application/vnd.smaf mmf -# application/vnd.smart.notebook -application/vnd.smart.teacher teacher -# application/vnd.software602.filler.form+xml -# application/vnd.software602.filler.form-xml-zip -application/vnd.solent.sdkm+xml sdkm sdkd -application/vnd.spotfire.dxp dxp -application/vnd.spotfire.sfs sfs -# application/vnd.sss-cod -# application/vnd.sss-dtf -# application/vnd.sss-ntf -application/vnd.stardivision.calc sdc -application/vnd.stardivision.draw sda -application/vnd.stardivision.impress sdd -application/vnd.stardivision.math smf -application/vnd.stardivision.writer sdw vor -application/vnd.stardivision.writer-global sgl -application/vnd.stepmania.package smzip -application/vnd.stepmania.stepchart sm -# application/vnd.street-stream -application/vnd.sun.xml.calc sxc -application/vnd.sun.xml.calc.template stc -application/vnd.sun.xml.draw sxd -application/vnd.sun.xml.draw.template std -application/vnd.sun.xml.impress sxi -application/vnd.sun.xml.impress.template sti -application/vnd.sun.xml.math sxm -application/vnd.sun.xml.writer sxw -application/vnd.sun.xml.writer.global sxg -application/vnd.sun.xml.writer.template stw -# application/vnd.sun.wadl+xml -application/vnd.sus-calendar sus susp -application/vnd.svd svd -# application/vnd.swiftview-ics -application/vnd.symbian.install sis sisx -application/vnd.syncml+xml xsm -application/vnd.syncml.dm+wbxml bdm -application/vnd.syncml.dm+xml xdm -# application/vnd.syncml.dm.notification -# application/vnd.syncml.ds.notification -application/vnd.tao.intent-module-archive tao -application/vnd.tcpdump.pcap pcap cap dmp -application/vnd.tmobile-livetv tmo -application/vnd.trid.tpt tpt -application/vnd.triscape.mxs mxs -application/vnd.trueapp tra -# application/vnd.truedoc -# application/vnd.ubisoft.webplayer -application/vnd.ufdl ufd ufdl -application/vnd.uiq.theme utz -application/vnd.umajin umj -application/vnd.unity unityweb -application/vnd.uoml+xml uoml -# application/vnd.uplanet.alert -# application/vnd.uplanet.alert-wbxml -# application/vnd.uplanet.bearer-choice -# application/vnd.uplanet.bearer-choice-wbxml -# application/vnd.uplanet.cacheop -# application/vnd.uplanet.cacheop-wbxml -# application/vnd.uplanet.channel -# application/vnd.uplanet.channel-wbxml -# application/vnd.uplanet.list -# application/vnd.uplanet.list-wbxml -# application/vnd.uplanet.listcmd -# application/vnd.uplanet.listcmd-wbxml -# application/vnd.uplanet.signal -application/vnd.vcx vcx -# application/vnd.vd-study -# application/vnd.vectorworks -# application/vnd.verimatrix.vcas -# application/vnd.vidsoft.vidconference -application/vnd.visio vsd vst vss vsw -application/vnd.visionary vis -# application/vnd.vividence.scriptfile -application/vnd.vsf vsf -# application/vnd.wap.sic -# application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo wtb -# application/vnd.wfa.wsc -# application/vnd.wmc -# application/vnd.wmf.bootstrap -# application/vnd.wolfram.mathematica -# application/vnd.wolfram.mathematica.package -application/vnd.wolfram.player nbp -application/vnd.wordperfect wpd -application/vnd.wqd wqd -# application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf stf -# application/vnd.wv.csp+wbxml -# application/vnd.wv.csp+xml -# application/vnd.wv.ssp+xml -application/vnd.xara xar -application/vnd.xfdl xfdl -# application/vnd.xfdl.webform -# application/vnd.xmi+xml -# application/vnd.xmpie.cpkg -# application/vnd.xmpie.dpkg -# application/vnd.xmpie.plan -# application/vnd.xmpie.ppkg -# application/vnd.xmpie.xlim -application/vnd.yamaha.hv-dic hvd -application/vnd.yamaha.hv-script hvs -application/vnd.yamaha.hv-voice hvp -application/vnd.yamaha.openscoreformat osf -application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg -# application/vnd.yamaha.remote-setup -application/vnd.yamaha.smaf-audio saf -application/vnd.yamaha.smaf-phrase spf -# application/vnd.yamaha.through-ngn -# application/vnd.yamaha.tunnel-udpencap -application/vnd.yellowriver-custom-menu cmp -application/vnd.zul zir zirz -application/vnd.zzazz.deck+xml zaz -application/voicexml+xml vxml -# application/vq-rtcpxr -# application/watcherinfo+xml -# application/whoispp-query -# application/whoispp-response -application/widget wgt -application/winhlp hlp -# application/wita -# application/wordperfect5.1 -application/wsdl+xml wsdl -application/wspolicy+xml wspolicy -application/x-7z-compressed 7z -application/x-abiword abw -application/x-ace-compressed ace -# application/x-amf -application/x-apple-diskimage dmg -application/x-authorware-bin aab x32 u32 vox -application/x-authorware-map aam -application/x-authorware-seg aas -application/x-bcpio bcpio -application/x-bittorrent torrent -application/x-blorb blb blorb -application/x-bzip bz -application/x-bzip2 bz2 boz -application/x-cbr cbr cba cbt cbz cb7 -application/x-cdlink vcd -application/x-cfs-compressed cfs -application/x-chat chat -application/x-chess-pgn pgn -application/x-conference nsc -# application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-debian-package deb udeb -application/x-dgc-compressed dgc -application/x-director dir dcr dxr cst cct cxt w3d fgd swa -application/x-doom wad -application/x-dtbncx+xml ncx -application/x-dtbook+xml dtb -application/x-dtbresource+xml res -application/x-dvi dvi -application/x-envoy evy -application/x-eva eva -application/x-font-bdf bdf -# application/x-font-dos -# application/x-font-framemaker -application/x-font-ghostscript gsf -# application/x-font-libgrx -application/x-font-linux-psf psf -application/x-font-otf otf -application/x-font-pcf pcf -application/x-font-snf snf -# application/x-font-speedo -# application/x-font-sunos-news -application/x-font-ttf ttf ttc -application/x-font-type1 pfa pfb pfm afm -application/font-woff woff -# application/x-font-vfont -application/x-freearc arc -application/x-futuresplash spl -application/x-gca-compressed gca -application/x-glulx ulx -application/x-gnumeric gnumeric -application/x-gramps-xml gramps -application/x-gtar gtar -# application/x-gzip -application/x-hdf hdf -application/x-install-instructions install -application/x-iso9660-image iso -application/x-java-jnlp-file jnlp -application/x-latex latex -application/x-lzh-compressed lzh lha -application/x-mie mie -application/x-mobipocket-ebook prc mobi -application/x-ms-application application -application/x-ms-shortcut lnk -application/x-ms-wmd wmd -application/x-ms-wmz wmz -application/x-ms-xbap xbap -application/x-msaccess mdb -application/x-msbinder obd -application/x-mscardfile crd -application/x-msclip clp -application/x-msdownload exe dll com bat msi -application/x-msmediaview mvb m13 m14 -application/x-msmetafile wmf wmz emf emz -application/x-msmoney mny -application/x-mspublisher pub -application/x-msschedule scd -application/x-msterminal trm -application/x-mswrite wri -application/x-netcdf nc cdf -application/x-nzb nzb -application/x-pkcs12 p12 pfx -application/x-pkcs7-certificates p7b spc -application/x-pkcs7-certreqresp p7r -application/x-rar-compressed rar -application/x-research-info-systems ris -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-silverlight-app xap -application/x-sql sql -application/x-stuffit sit -application/x-stuffitx sitx -application/x-subrip srt -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-t3vm-image t3 -application/x-tads gam -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-tex-tfm tfm -application/x-texinfo texinfo texi -application/x-tgif obj -application/x-ustar ustar -application/x-wais-source src -application/x-x509-ca-cert der crt -application/x-xfig fig -application/x-xliff+xml xlf -application/x-xpinstall xpi -application/x-xz xz -application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 -# application/x400-bp -application/xaml+xml xaml -# application/xcap-att+xml -# application/xcap-caps+xml -application/xcap-diff+xml xdf -# application/xcap-el+xml -# application/xcap-error+xml -# application/xcap-ns+xml -# application/xcon-conference-info-diff+xml -# application/xcon-conference-info+xml -application/xenc+xml xenc -application/xhtml+xml xhtml xht -# application/xhtml-voice+xml -application/xml xml xsl -application/xml-dtd dtd -# application/xml-external-parsed-entity -# application/xmpp+xml -application/xop+xml xop -application/xproc+xml xpl -application/xslt+xml xslt -application/xspf+xml xspf -application/xv+xml mxml xhvml xvml xvm -application/yang yang -application/yin+xml yin -application/zip zip -# audio/1d-interleaved-parityfec -# audio/32kadpcm -# audio/3gpp -# audio/3gpp2 -# audio/ac3 -audio/adpcm adp -# audio/amr -# audio/amr-wb -# audio/amr-wb+ -# audio/asc -# audio/atrac-advanced-lossless -# audio/atrac-x -# audio/atrac3 -audio/basic au snd -# audio/bv16 -# audio/bv32 -# audio/clearmode -# audio/cn -# audio/dat12 -# audio/dls -# audio/dsr-es201108 -# audio/dsr-es202050 -# audio/dsr-es202211 -# audio/dsr-es202212 -# audio/dv -# audio/dvi4 -# audio/eac3 -# audio/evrc -# audio/evrc-qcp -# audio/evrc0 -# audio/evrc1 -# audio/evrcb -# audio/evrcb0 -# audio/evrcb1 -# audio/evrcwb -# audio/evrcwb0 -# audio/evrcwb1 -# audio/example -# audio/fwdred -# audio/g719 -# audio/g722 -# audio/g7221 -# audio/g723 -# audio/g726-16 -# audio/g726-24 -# audio/g726-32 -# audio/g726-40 -# audio/g728 -# audio/g729 -# audio/g7291 -# audio/g729d -# audio/g729e -# audio/gsm -# audio/gsm-efr -# audio/gsm-hr-08 -# audio/ilbc -# audio/ip-mr_v2.5 -# audio/isac -# audio/l16 -# audio/l20 -# audio/l24 -# audio/l8 -# audio/lpc -audio/midi mid midi kar rmi -# audio/mobile-xmf -audio/mp4 mp4a -# audio/mp4a-latm -# audio/mpa -# audio/mpa-robust -audio/mpeg mpga mp2 mp2a mp3 m2a m3a -# audio/mpeg4-generic -# audio/musepack -audio/ogg oga ogg spx -# audio/opus -# audio/parityfec -# audio/pcma -# audio/pcma-wb -# audio/pcmu-wb -# audio/pcmu -# audio/prs.sid -# audio/qcelp -# audio/red -# audio/rtp-enc-aescm128 -# audio/rtp-midi -# audio/rtx -audio/s3m s3m -audio/silk sil -# audio/smv -# audio/smv0 -# audio/smv-qcp -# audio/sp-midi -# audio/speex -# audio/t140c -# audio/t38 -# audio/telephone-event -# audio/tone -# audio/uemclip -# audio/ulpfec -# audio/vdvi -# audio/vmr-wb -# audio/vnd.3gpp.iufp -# audio/vnd.4sb -# audio/vnd.audiokoz -# audio/vnd.celp -# audio/vnd.cisco.nse -# audio/vnd.cmles.radio-events -# audio/vnd.cns.anp1 -# audio/vnd.cns.inf1 -audio/vnd.dece.audio uva uvva -audio/vnd.digital-winds eol -# audio/vnd.dlna.adts -# audio/vnd.dolby.heaac.1 -# audio/vnd.dolby.heaac.2 -# audio/vnd.dolby.mlp -# audio/vnd.dolby.mps -# audio/vnd.dolby.pl2 -# audio/vnd.dolby.pl2x -# audio/vnd.dolby.pl2z -# audio/vnd.dolby.pulse.1 -audio/vnd.dra dra -audio/vnd.dts dts -audio/vnd.dts.hd dtshd -# audio/vnd.dvb.file -# audio/vnd.everad.plj -# audio/vnd.hns.audio -audio/vnd.lucent.voice lvp -audio/vnd.ms-playready.media.pya pya -# audio/vnd.nokia.mobile-xmf -# audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 ecelp4800 -audio/vnd.nuera.ecelp7470 ecelp7470 -audio/vnd.nuera.ecelp9600 ecelp9600 -# audio/vnd.octel.sbc -# audio/vnd.qcelp -# audio/vnd.rhetorex.32kadpcm -audio/vnd.rip rip -# audio/vnd.sealedmedia.softseal.mpeg -# audio/vnd.vmx.cvsd -# audio/vorbis -# audio/vorbis-config -audio/webm weba -audio/x-aac aac -audio/x-aiff aif aiff aifc -audio/x-caf caf -audio/x-flac flac -audio/x-matroska mka -audio/x-mpegurl m3u -audio/x-ms-wax wax -audio/x-ms-wma wma -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin rmp -# audio/x-tta -audio/x-wav wav -audio/xm xm -chemical/x-cdx cdx -chemical/x-cif cif -chemical/x-cmdf cmdf -chemical/x-cml cml -chemical/x-csml csml -# chemical/x-pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -# image/example -# image/fits -image/g3fax g3 -image/gif gif -image/ief ief -# image/jp2 -image/jpeg jpeg jpg jpe -# image/jpm -# image/jpx -image/ktx ktx -# image/naplps -image/png png -image/prs.btif btif -# image/prs.pti -image/sgi sgi -image/svg+xml svg svgz -# image/t38 -image/tiff tiff tif -# image/tiff-fx -image/vnd.adobe.photoshop psd -# image/vnd.cns.inf2 -image/vnd.dece.graphic uvi uvvi uvg uvvg -image/vnd.dvb.subtitle sub -image/vnd.djvu djvu djv -image/vnd.dwg dwg -image/vnd.dxf dxf -image/vnd.fastbidsheet fbs -image/vnd.fpx fpx -image/vnd.fst fst -image/vnd.fujixerox.edmics-mmr mmr -image/vnd.fujixerox.edmics-rlc rlc -# image/vnd.globalgraphics.pgb -# image/vnd.microsoft.icon -# image/vnd.mix -image/vnd.ms-modi mdi -image/vnd.ms-photo wdp -image/vnd.net-fpx npx -# image/vnd.radiance -# image/vnd.sealed.png -# image/vnd.sealedmedia.softseal.gif -# image/vnd.sealedmedia.softseal.jpg -# image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff xif -image/webp webp -image/x-3ds 3ds -image/x-cmu-raster ras -image/x-cmx cmx -image/x-freehand fh fhc fh4 fh5 fh7 -image/x-icon ico -image/x-mrsid-image sid -image/x-pcx pcx -image/x-pict pic pct -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-tga tga -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -# message/cpim -# message/delivery-status -# message/disposition-notification -# message/example -# message/external-body -# message/feedback-report -# message/global -# message/global-delivery-status -# message/global-disposition-notification -# message/global-headers -# message/http -# message/imdn+xml -# message/news -# message/partial -message/rfc822 eml mime -# message/s-http -# message/sip -# message/sipfrag -# message/tracking-status -# message/vnd.si.simp -# model/example -model/iges igs iges -model/mesh msh mesh silo -model/vnd.collada+xml dae -model/vnd.dwf dwf -# model/vnd.flatland.3dml -model/vnd.gdl gdl -# model/vnd.gs-gdl -# model/vnd.gs.gdl -model/vnd.gtw gtw -# model/vnd.moml+xml -model/vnd.mts mts -# model/vnd.parasolid.transmit.binary -# model/vnd.parasolid.transmit.text -model/vnd.vtu vtu -model/vrml wrl vrml -model/x3d+binary x3db x3dbz -model/x3d+vrml x3dv x3dvz -model/x3d+xml x3d x3dz -# multipart/alternative -# multipart/appledouble -# multipart/byteranges -# multipart/digest -# multipart/encrypted -# multipart/example -# multipart/form-data -# multipart/header-set -# multipart/mixed -# multipart/parallel -# multipart/related -# multipart/report -# multipart/signed -# multipart/voice-message -# text/1d-interleaved-parityfec -text/cache-manifest appcache -text/calendar ics ifb -text/css css -text/csv csv -# text/directory -# text/dns -# text/ecmascript -# text/enriched -# text/example -# text/fwdred -text/html html htm -# text/javascript -text/n3 n3 -# text/parityfec -text/plain txt text conf def list log in -# text/prs.fallenstein.rst -text/prs.lines.tag dsc -# text/vnd.radisys.msml-basic-layout -# text/red -# text/rfc822-headers -text/richtext rtx -# text/rtf -# text/rtp-enc-aescm128 -# text/rtx -text/sgml sgml sgm -# text/t140 -text/tab-separated-values tsv -text/troff t tr roff man me ms -text/turtle ttl -# text/ulpfec -text/uri-list uri uris urls -text/vcard vcard -# text/vnd.abc -text/vnd.curl curl -text/vnd.curl.dcurl dcurl -text/vnd.curl.scurl scurl -text/vnd.curl.mcurl mcurl -# text/vnd.dmclientscript -text/vnd.dvb.subtitle sub -# text/vnd.esmertec.theme-descriptor -text/vnd.fly fly -text/vnd.fmi.flexstor flx -text/vnd.graphviz gv -text/vnd.in3d.3dml 3dml -text/vnd.in3d.spot spot -# text/vnd.iptc.newsml -# text/vnd.iptc.nitf -# text/vnd.latex-z -# text/vnd.motorola.reflex -# text/vnd.ms-mediapackage -# text/vnd.net2phone.commcenter.command -# text/vnd.si.uricatalogue -text/vnd.sun.j2me.app-descriptor jad -# text/vnd.trolltech.linguist -# text/vnd.wap.si -# text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-asm s asm -text/x-c c cc cxx cpp h hh dic -text/x-fortran f for f77 f90 -text/x-java-source java -text/x-opml opml -text/x-pascal p pas -text/x-nfo nfo -text/x-setext etx -text/x-sfv sfv -text/x-uuencode uu -text/x-vcalendar vcs -text/x-vcard vcf -# text/xml -# text/xml-external-parsed-entity -# video/1d-interleaved-parityfec -video/3gpp 3gp -# video/3gpp-tt -video/3gpp2 3g2 -# video/bmpeg -# video/bt656 -# video/celb -# video/dv -# video/example -video/h261 h261 -video/h263 h263 -# video/h263-1998 -# video/h263-2000 -video/h264 h264 -# video/h264-rcdo -# video/h264-svc -video/jpeg jpgv -# video/jpeg2000 -video/jpm jpm jpgm -video/mj2 mj2 mjp2 -# video/mp1s -# video/mp2p -# video/mp2t -video/mp4 mp4 mp4v mpg4 -# video/mp4v-es -video/mpeg mpeg mpg mpe m1v m2v -# video/mpeg4-generic -# video/mpv -# video/nv -video/ogg ogv -# video/parityfec -# video/pointer -video/quicktime qt mov -# video/raw -# video/rtp-enc-aescm128 -# video/rtx -# video/smpte292m -# video/ulpfec -# video/vc1 -# video/vnd.cctv -video/vnd.dece.hd uvh uvvh -video/vnd.dece.mobile uvm uvvm -# video/vnd.dece.mp4 -video/vnd.dece.pd uvp uvvp -video/vnd.dece.sd uvs uvvs -video/vnd.dece.video uvv uvvv -# video/vnd.directv.mpeg -# video/vnd.directv.mpeg-tts -# video/vnd.dlna.mpeg-tts -video/vnd.dvb.file dvb -video/vnd.fvt fvt -# video/vnd.hns.video -# video/vnd.iptvforum.1dparityfec-1010 -# video/vnd.iptvforum.1dparityfec-2005 -# video/vnd.iptvforum.2dparityfec-1010 -# video/vnd.iptvforum.2dparityfec-2005 -# video/vnd.iptvforum.ttsavc -# video/vnd.iptvforum.ttsmpeg2 -# video/vnd.motorola.video -# video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.ms-playready.media.pyv pyv -# video/vnd.nokia.interleaved-multimedia -# video/vnd.nokia.videovoip -# video/vnd.objectvideo -# video/vnd.sealed.mpeg1 -# video/vnd.sealed.mpeg4 -# video/vnd.sealed.swf -# video/vnd.sealedmedia.softseal.mov -video/vnd.uvvu.mp4 uvu uvvu -video/vnd.vivo viv -video/webm webm -video/x-f4v f4v -video/x-fli fli -video/x-flv flv -video/x-m4v m4v -video/x-matroska mkv mk3d mks -video/x-mng mng -video/x-ms-asf asf asx -video/x-ms-vob vob -video/x-ms-wm wm -video/x-ms-wmv wmv -video/x-ms-wmx wmx -video/x-ms-wvx wvx -video/x-msvideo avi -video/x-sgi-movie movie -video/x-smv smv -x-conference/x-cooltalk ice diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/types/node.types b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/types/node.types deleted file mode 100644 index 55b2cf7..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/mime/types/node.types +++ /dev/null @@ -1,77 +0,0 @@ -# What: WebVTT -# Why: To allow formats intended for marking up external text track resources. -# http://dev.w3.org/html5/webvtt/ -# Added by: niftylettuce -text/vtt vtt - -# What: Google Chrome Extension -# Why: To allow apps to (work) be served with the right content type header. -# http://codereview.chromium.org/2830017 -# Added by: niftylettuce -application/x-chrome-extension crx - -# What: HTC support -# Why: To properly render .htc files such as CSS3PIE -# Added by: niftylettuce -text/x-component htc - -# What: HTML5 application cache manifes ('.manifest' extension) -# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps -# per https://developer.mozilla.org/en/offline_resources_in_firefox -# Added by: louisremi -text/cache-manifest manifest - -# What: node binary buffer format -# Why: semi-standard extension w/in the node community -# Added by: tootallnate -application/octet-stream buffer - -# What: The "protected" MP-4 formats used by iTunes. -# Why: Required for streaming music to browsers (?) -# Added by: broofa -application/mp4 m4p -audio/mp4 m4a - -# What: Video format, Part of RFC1890 -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -video/MP2T ts - -# What: EventSource mime type -# Why: mime type of Server-Sent Events stream -# http://www.w3.org/TR/eventsource/#text-event-stream -# Added by: francois2metz -text/event-stream event-stream - -# What: Mozilla App manifest mime type -# Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests -# Added by: ednapiranha -application/x-web-app-manifest+json webapp - -# What: Lua file types -# Why: Googling around shows de-facto consensus on these -# Added by: creationix (Issue #45) -text/x-lua lua -application/x-lua-bytecode luac - -# What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax -# Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown -# Added by: avoidwork -text/x-markdown markdown md mkd - -# What: ini files -# Why: because they're just text files -# Added by: Matthew Kastor -text/plain ini - -# What: DASH Adaptive Streaming manifest -# Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video -# Added by: eelcocramer -application/dash+xml mdp - -# What: OpenType font files - http://www.microsoft.com/typography/otspec/ -# Why: Browsers usually ignore the font MIME types and sniff the content, -# but Chrome, shows a warning if OpenType fonts aren't served with -# the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png. -# Added by: alrra -font/opentype otf diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/.npmignore b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/.npmignore deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/.npmignore +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/History.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/History.md deleted file mode 100644 index 82df7b1..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/History.md +++ /dev/null @@ -1,15 +0,0 @@ - -0.0.4 / 2012-06-17 -================== - - * changed: ret -1 for unsatisfiable and -2 when invalid - -0.0.3 / 2012-06-17 -================== - - * fix last-byte-pos default to len - 1 - -0.0.2 / 2012-06-14 -================== - - * add `.type` diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/Makefile b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/Makefile deleted file mode 100644 index 8e8640f..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --reporter spec \ - --require should - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/Readme.md b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/Readme.md deleted file mode 100644 index b2a67fe..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/Readme.md +++ /dev/null @@ -1,28 +0,0 @@ - -# node-range-parser - - Range header field parser. - -## Example: - -```js -assert(-1 == parse(200, 'bytes=500-20')); -assert(-2 == parse(200, 'bytes=malformed')); -parse(200, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 199 }])); -parse(1000, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 499 }])); -parse(1000, 'bytes=40-80').should.eql(arr('bytes', [{ start: 40, end: 80 }])); -parse(1000, 'bytes=-500').should.eql(arr('bytes', [{ start: 500, end: 999 }])); -parse(1000, 'bytes=-400').should.eql(arr('bytes', [{ start: 600, end: 999 }])); -parse(1000, 'bytes=500-').should.eql(arr('bytes', [{ start: 500, end: 999 }])); -parse(1000, 'bytes=400-').should.eql(arr('bytes', [{ start: 400, end: 999 }])); -parse(1000, 'bytes=0-0').should.eql(arr('bytes', [{ start: 0, end: 0 }])); -parse(1000, 'bytes=-1').should.eql(arr('bytes', [{ start: 999, end: 999 }])); -parse(1000, 'items=0-5').should.eql(arr('items', [{ start: 0, end: 5 }])); -parse(1000, 'bytes=40-80,-1').should.eql(arr('bytes', [{ start: 40, end: 80 }, { start: 999, end: 999 }])); -``` - -## Installation - -``` -$ npm install range-parser -``` \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/index.js b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/index.js deleted file mode 100644 index 9b0f7a8..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/index.js +++ /dev/null @@ -1,49 +0,0 @@ - -/** - * Parse "Range" header `str` relative to the given file `size`. - * - * @param {Number} size - * @param {String} str - * @return {Array} - * @api public - */ - -module.exports = function(size, str){ - var valid = true; - var i = str.indexOf('='); - - if (-1 == i) return -2; - - var arr = str.slice(i + 1).split(',').map(function(range){ - var range = range.split('-') - , start = parseInt(range[0], 10) - , end = parseInt(range[1], 10); - - // -nnn - if (isNaN(start)) { - start = size - end; - end = size - 1; - // nnn- - } else if (isNaN(end)) { - end = size - 1; - } - - // limit last-byte-pos to current length - if (end > size - 1) end = size - 1; - - // invalid - if (isNaN(start) - || isNaN(end) - || start > end - || start < 0) valid = false; - - return { - start: start, - end: end - }; - }); - - arr.type = str.slice(0, i); - - return valid ? arr : -1; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/package.json deleted file mode 100644 index efdf450..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/node_modules/range-parser/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "range-parser", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "description": "Range header field string parser", - "version": "0.0.4", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "readme": "\n# node-range-parser\n\n Range header field parser.\n\n## Example:\n\n```js\nassert(-1 == parse(200, 'bytes=500-20'));\nassert(-2 == parse(200, 'bytes=malformed'));\nparse(200, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 199 }]));\nparse(1000, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 499 }]));\nparse(1000, 'bytes=40-80').should.eql(arr('bytes', [{ start: 40, end: 80 }]));\nparse(1000, 'bytes=-500').should.eql(arr('bytes', [{ start: 500, end: 999 }]));\nparse(1000, 'bytes=-400').should.eql(arr('bytes', [{ start: 600, end: 999 }]));\nparse(1000, 'bytes=500-').should.eql(arr('bytes', [{ start: 500, end: 999 }]));\nparse(1000, 'bytes=400-').should.eql(arr('bytes', [{ start: 400, end: 999 }]));\nparse(1000, 'bytes=0-0').should.eql(arr('bytes', [{ start: 0, end: 0 }]));\nparse(1000, 'bytes=-1').should.eql(arr('bytes', [{ start: 999, end: 999 }]));\nparse(1000, 'items=0-5').should.eql(arr('items', [{ start: 0, end: 5 }]));\nparse(1000, 'bytes=40-80,-1').should.eql(arr('bytes', [{ start: 40, end: 80 }, { start: 999, end: 999 }]));\n```\n\n## Installation\n\n```\n$ npm install range-parser\n```", - "readmeFilename": "Readme.md", - "_id": "range-parser@0.0.4", - "_from": "range-parser@0.0.4" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/package.json deleted file mode 100644 index 2c00d3b..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/send/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "send", - "version": "0.1.1", - "description": "Better streaming static file server with Range and conditional-GET support", - "keywords": [ - "static", - "file", - "server" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": { - "debug": "*", - "mime": "~1.2.9", - "fresh": "0.1.0", - "range-parser": "0.0.4" - }, - "devDependencies": { - "mocha": "*", - "should": "*", - "supertest": "0.0.1", - "connect": "2.x" - }, - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/send.git" - }, - "main": "index", - "readme": "# send\n\n Send is Connect's `static()` extracted for generalized use, a streaming static file\n server supporting partial responses (Ranges), conditional-GET negotiation, high test coverage, and granular events which may be leveraged to take appropriate actions in your application or framework.\n\n## Installation\n\n $ npm install send\n\n## Examples\n\n Small:\n\n```js\nvar http = require('http');\nvar send = require('send');\n\nvar app = http.createServer(function(req, res){\n send(req, req.url).pipe(res);\n}).listen(3000);\n```\n\n Serving from a root directory with custom error-handling:\n\n```js\nvar http = require('http');\nvar send = require('send');\nvar url = require('url');\n\nvar app = http.createServer(function(req, res){\n // your custom error-handling logic:\n function error(err) {\n res.statusCode = err.status || 500;\n res.end(err.message);\n }\n\n // your custom directory handling logic:\n function redirect() {\n res.statusCode = 301;\n res.setHeader('Location', req.url + '/');\n res.end('Redirecting to ' + req.url + '/');\n }\n\n // transfer arbitrary files from within\n // /www/example.com/public/*\n send(req, url.parse(req.url).pathname)\n .root('/www/example.com/public')\n .on('error', error)\n .on('directory', redirect)\n .pipe(res);\n}).listen(3000);\n```\n\n## API\n\n### Events\n\n - `error` an error occurred `(err)`\n - `directory` a directory was requested\n - `file` a file was requested `(path, stat)`\n - `stream` file streaming has started `(stream)`\n - `end` streaming has completed\n\n### .root(dir)\n\n Serve files relative to `path`. Aliased as `.from(dir)`.\n\n### .index(path)\n\n By default send supports \"index.html\" files, to disable this\n invoke `.index(false)` or to supply a new index pass a string.\n\n### .maxage(ms)\n\n Provide a max-age in milliseconds for http caching, defaults to 0.\n\n### .hidden(bool)\n\n Enable or disable transfer of hidden files, defaults to false.\n\n## Error-handling\n\n By default when no `error` listeners are present an automatic response will be made, otherwise you have full control over the response, aka you may show a 5xx page etc.\n\n## Caching\n\n It does _not_ perform internal caching, you should use a reverse proxy cache such\n as Varnish for this, or those fancy things called CDNs. If your application is small enough that it would benefit from single-node memory caching, it's small enough that it does not need caching at all ;).\n\n## Debugging\n\n To enable `debug()` instrumentation output export __DEBUG__:\n\n```\n$ DEBUG=send node app\n```\n\n## Running tests\n\n```\n$ npm install\n$ make test\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 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.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/send/issues" - }, - "_id": "send@0.1.1", - "_from": "send@0.1.1" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/package.json b/node_modules/grunt-contrib-connect/node_modules/connect/package.json deleted file mode 100644 index 62793e8..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "connect", - "version": "2.7.11", - "description": "High performance middleware framework", - "keywords": [ - "framework", - "web", - "middleware", - "connect", - "rack" - ], - "repository": { - "type": "git", - "url": "git://github.com/senchalabs/connect.git" - }, - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "dependencies": { - "qs": "0.6.5", - "formidable": "1.0.14", - "cookie-signature": "1.0.1", - "buffer-crc32": "0.2.1", - "cookie": "0.0.5", - "send": "0.1.1", - "bytes": "0.2.0", - "fresh": "0.1.0", - "pause": "0.0.1", - "debug": "*" - }, - "devDependencies": { - "should": "*", - "mocha": "*", - "jade": "*", - "dox": "*" - }, - "main": "index", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "make" - }, - "readme": "[![build status](https://secure.travis-ci.org/senchalabs/connect.png)](http://travis-ci.org/senchalabs/connect)\n# Connect\n\n Connect is an extensible HTTP server framework for [node](http://nodejs.org), providing high performance \"plugins\" known as _middleware_.\n\n Connect is bundled with over _20_ commonly used middleware, including\n a logger, session support, cookie parser, and [more](http://senchalabs.github.com/connect). Be sure to view the 2.x [documentation](http://senchalabs.github.com/connect/).\n\n```js\nvar connect = require('connect')\n , http = require('http');\n\nvar app = connect()\n .use(connect.favicon())\n .use(connect.logger('dev'))\n .use(connect.static('public'))\n .use(connect.directory('public'))\n .use(connect.cookieParser())\n .use(connect.session({ secret: 'my secret here' }))\n .use(function(req, res){\n res.end('Hello from Connect!\\n');\n });\n\nhttp.createServer(app).listen(3000);\n```\n\n## Middleware\n\n - [csrf](http://www.senchalabs.org/connect/csrf.html)\n - [basicAuth](http://www.senchalabs.org/connect/basicAuth.html)\n - [bodyParser](http://www.senchalabs.org/connect/bodyParser.html)\n - [json](http://www.senchalabs.org/connect/json.html)\n - [multipart](http://www.senchalabs.org/connect/multipart.html)\n - [urlencoded](http://www.senchalabs.org/connect/urlencoded.html)\n - [cookieParser](http://www.senchalabs.org/connect/cookieParser.html)\n - [directory](http://www.senchalabs.org/connect/directory.html)\n - [compress](http://www.senchalabs.org/connect/compress.html)\n - [errorHandler](http://www.senchalabs.org/connect/errorHandler.html)\n - [favicon](http://www.senchalabs.org/connect/favicon.html)\n - [limit](http://www.senchalabs.org/connect/limit.html)\n - [logger](http://www.senchalabs.org/connect/logger.html)\n - [methodOverride](http://www.senchalabs.org/connect/methodOverride.html)\n - [query](http://www.senchalabs.org/connect/query.html)\n - [responseTime](http://www.senchalabs.org/connect/responseTime.html)\n - [session](http://www.senchalabs.org/connect/session.html)\n - [static](http://www.senchalabs.org/connect/static.html)\n - [staticCache](http://www.senchalabs.org/connect/staticCache.html)\n - [vhost](http://www.senchalabs.org/connect/vhost.html)\n - [subdomains](http://www.senchalabs.org/connect/subdomains.html)\n - [cookieSession](http://www.senchalabs.org/connect/cookieSession.html)\n\n## Running Tests\n\nfirst:\n\n $ npm install -d\n\nthen:\n\n $ make test\n\n## Authors\n\n Below is the output from [git-summary](http://github.com/visionmedia/git-extras).\n\n\n project: connect\n commits: 2033\n active : 301 days\n files : 171\n authors: \n 1414\tTj Holowaychuk 69.6%\n 298\tvisionmedia 14.7%\n 191\tTim Caswell 9.4%\n 51\tTJ Holowaychuk 2.5%\n 10\tRyan Olds 0.5%\n 8\tAstro 0.4%\n 5\tNathan Rajlich 0.2%\n 5\tJakub Nešetřil 0.2%\n 3\tDaniel Dickison 0.1%\n 3\tDavid Rio Deiros 0.1%\n 3\tAlexander Simmerl 0.1%\n 3\tAndreas Lind Petersen 0.1%\n 2\tAaron Heckmann 0.1%\n 2\tJacques Crocker 0.1%\n 2\tFabian Jakobs 0.1%\n 2\tBrian J Brennan 0.1%\n 2\tAdam Malcontenti-Wilson 0.1%\n 2\tGlen Mailer 0.1%\n 2\tJames Campos 0.1%\n 1\tTrent Mick 0.0%\n 1\tTroy Kruthoff 0.0%\n 1\tWei Zhu 0.0%\n 1\tcomerc 0.0%\n 1\tdarobin 0.0%\n 1\tnateps 0.0%\n 1\tMarco Sanson 0.0%\n 1\tArthur Taylor 0.0%\n 1\tAseem Kishore 0.0%\n 1\tBart Teeuwisse 0.0%\n 1\tCameron Howey 0.0%\n 1\tChad Weider 0.0%\n 1\tCraig Barnes 0.0%\n 1\tEran Hammer-Lahav 0.0%\n 1\tGregory McWhirter 0.0%\n 1\tGuillermo Rauch 0.0%\n 1\tJae Kwon 0.0%\n 1\tJakub Nesetril 0.0%\n 1\tJoshua Peek 0.0%\n 1\tJxck 0.0%\n 1\tAJ ONeal 0.0%\n 1\tMichael Hemesath 0.0%\n 1\tMorten Siebuhr 0.0%\n 1\tSamori Gorse 0.0%\n 1\tTom Jensen 0.0%\n\n## Node Compatibility\n\n Connect `< 1.x` is compatible with node 0.2.x\n\n\n Connect `1.x` is compatible with node 0.4.x\n\n\n Connect (_master_) `2.x` is compatible with node 0.6.x\n\n## CLA\n\n [http://sencha.com/cla](http://sencha.com/cla)\n\n## License\n\nView the [LICENSE](https://github.com/senchalabs/connect/blob/master/LICENSE) file. The [Silk](http://www.famfamfam.com/lab/icons/silk/) icons used by the `directory` middleware created by/copyright of [FAMFAMFAM](http://www.famfamfam.com/).\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/senchalabs/connect/issues" - }, - "_id": "connect@2.7.11", - "_from": "connect@~2.7.11" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/connect/test.js b/node_modules/grunt-contrib-connect/node_modules/connect/test.js deleted file mode 100644 index 92b7003..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/connect/test.js +++ /dev/null @@ -1,40 +0,0 @@ - -var connect = require('./'); -var app = connect(); - -app.use(connect.logger('dev')); -app.use(connect.bodyParser()); - -app.use(function(req, res, next){ - if (req.checkContinue) { - res.writeContinue(); - } - res.end('hello'); -}); - -var server = app.listen(3000); - -server.on('checkContinue', function(req, res){ - req.checkContinue = true; - app(req, res); -}); - - -// var http = require('http'); - -// var app = http.createServer(function(req, res){ -// console.log(req.headers); -// }); - -// app.on('checkContinue', function(req, res){ -// if ('application/json' == req.headers['content-type']) { -// res.writeContinue(); -// console.log('ok'); -// res.end('thanks') -// } else { -// res.writeHead(400); -// res.end('bad request, json only'); -// } -// }); - -// app.listen(3000); diff --git a/node_modules/grunt-contrib-connect/node_modules/open/.jshintignore b/node_modules/grunt-contrib-connect/node_modules/open/.jshintignore deleted file mode 100644 index 651665b..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/open/.jshintignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.git diff --git a/node_modules/grunt-contrib-connect/node_modules/open/.jshintrc b/node_modules/grunt-contrib-connect/node_modules/open/.jshintrc deleted file mode 100644 index 765fb34..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/open/.jshintrc +++ /dev/null @@ -1,27 +0,0 @@ -{ - "bitwise": true, - "curly": true, - "eqeqeq": true, - "forin": true, - "immed": true, - "latedef": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": true, - "plusplus": false, - "regexp": false, - "undef": true, - "strict": false, - "trailing": true, - - "eqnull": true, - "laxcomma": true, - - "node": true, - - "onevar": true, - "white": true, - - "indent": 2 -} diff --git a/node_modules/grunt-contrib-connect/node_modules/open/.npmignore b/node_modules/grunt-contrib-connect/node_modules/open/.npmignore deleted file mode 100644 index 77356c3..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/open/.npmignore +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-connect/node_modules/open/LICENSE b/node_modules/grunt-contrib-connect/node_modules/open/LICENSE deleted file mode 100644 index 42719e0..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/open/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Jay Jordan - -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/node_modules/grunt-contrib-connect/node_modules/open/README.md b/node_modules/grunt-contrib-connect/node_modules/open/README.md deleted file mode 100644 index 4fc0d54..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/open/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# open - -Open a file or url in the user's preferred application. - -# Usage - -```javascript -var open = require("open"); -open("http://www.google.com"); -``` - -`open` taks an optional argument specifying the program to be used to open the -file or URL. - -```javascript -open("http://www.google.com", "firefox"); -``` - -# Installation - - npm install open - -# How it works - -- on `win32` uses `start` -- on `darwin` uses `open` -- otherwise uses the `xdg-open` script from [freedesktop.org](http://portland.freedesktop.org/xdg-utils-1.0/xdg-open.html) - -# Warning - -The same care should be taken when calling open as if you were calling -[child_process.exec](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) -directly. If it is an executable it will run in a new shell. diff --git a/node_modules/grunt-contrib-connect/node_modules/open/lib/open.js b/node_modules/grunt-contrib-connect/node_modules/open/lib/open.js deleted file mode 100644 index aa23a3e..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/open/lib/open.js +++ /dev/null @@ -1,60 +0,0 @@ -var exec = require('child_process').exec - , path = require('path') - ; - - -/** - * open a file or uri using the default application for the file type. - * - * @return {ChildProcess} - the child process object. - * @param {string} target - the file/uri to open. - * @param {string} appName - (optional) the application to be used to open the - * file (for example, "chrome", "firefox") - * @param {function(Error)} callback - called with null on success, or - * an error object that contains a property 'code' with the exit - * code of the process. - */ - -module.exports = open; - -function open(target, appName, callback) { - var opener; - - if (typeof(appName) === 'function') { - callback = appName; - appName = null; - } - - switch (process.platform) { - case 'darwin': - if (appName) { - opener = 'open -a "' + escape(appName) + '"'; - } else { - opener = 'open'; - } - break; - case 'win32': - // if the first parameter to start is quoted, it uses that as the title - // so we pass a blank title so we can quote the file we are opening - if (appName) { - opener = 'start "" "' + escape(appName) + '"'; - } else { - opener = 'start ""'; - } - break; - default: - if (appName) { - opener = escape(appName); - } else { - // use Portlands xdg-open everywhere else - opener = path.join(__dirname, '../vendor/xdg-open'); - } - break; - } - - return exec(opener + ' "' + escape(target) + '"', callback); -} - -function escape(s) { - return s.replace(/"/g, '\\\"'); -} diff --git a/node_modules/grunt-contrib-connect/node_modules/open/package.json b/node_modules/grunt-contrib-connect/node_modules/open/package.json deleted file mode 100644 index 0999270..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/open/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "open", - "version": "0.0.4", - "description": "open a file or url in the user's preferred application", - "keywords": [ - "start", - "open", - "browser", - "editor", - "default" - ], - "homepage": "https://github.com/jjrdn/node-open", - "author": { - "name": "J Jordan", - "email": "jjrdn@styosis.com" - }, - "license": "MIT", - "contributors": [ - { - "name": "Victor Costan", - "email": "victor@costan.us", - "url": "http://www.costan.us" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/pwnall/node-open.git" - }, - "bugs": { - "url": "https://github.com/pwnall/node-open/issues" - }, - "engines": { - "node": ">= 0.6.0" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*" - }, - "optionalDependencies": {}, - "main": "lib/open.js", - "scripts": { - "test": "node_modules/mocha/bin/mocha" - }, - "readme": "# open\n\nOpen a file or url in the user's preferred application.\n\n# Usage\n\n```javascript\nvar open = require(\"open\");\nopen(\"http://www.google.com\");\n```\n\n`open` taks an optional argument specifying the program to be used to open the\nfile or URL.\n\n```javascript\nopen(\"http://www.google.com\", \"firefox\");\n```\n\n# Installation\n\n npm install open\n\n# How it works\n\n- on `win32` uses `start`\n- on `darwin` uses `open`\n- otherwise uses the `xdg-open` script from [freedesktop.org](http://portland.freedesktop.org/xdg-utils-1.0/xdg-open.html)\n\n# Warning\n\nThe same care should be taken when calling open as if you were calling\n[child_process.exec](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback)\ndirectly. If it is an executable it will run in a new shell.\n", - "readmeFilename": "README.md", - "_id": "open@0.0.4", - "_from": "open@0.0.4" -} diff --git a/node_modules/grunt-contrib-connect/node_modules/open/vendor/xdg-open b/node_modules/grunt-contrib-connect/node_modules/open/vendor/xdg-open deleted file mode 100755 index 13caac1..0000000 --- a/node_modules/grunt-contrib-connect/node_modules/open/vendor/xdg-open +++ /dev/null @@ -1,767 +0,0 @@ -#!/bin/sh -#--------------------------------------------- -# xdg-open -# -# Utility script to open a URL in the registered default application. -# -# Refer to the usage() function below for usage. -# -# Copyright 2009-2010, Fathi Boudra -# Copyright 2009-2010, Rex Dieter -# Copyright 2006, Kevin Krammer -# Copyright 2006, Jeremy White -# -# 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. -# -#--------------------------------------------- - -manualpage() -{ -cat << _MANUALPAGE -Name - - xdg-open -- opens a file or URL in the user's preferred - application - -Synopsis - - xdg-open { file | URL } - - xdg-open { --help | --manual | --version } - -Description - - xdg-open opens a file or URL in the user's preferred - application. If a URL is provided the URL will be opened in the - user's preferred web browser. If a file is provided the file - will be opened in the preferred application for files of that - type. xdg-open supports file, ftp, http and https URLs. - - xdg-open is for use inside a desktop session only. It is not - recommended to use xdg-open as root. - -Options - - --help - Show command synopsis. - - --manual - Show this manual page. - - --version - Show the xdg-utils version information. - -Exit Codes - - An exit code of 0 indicates success while a non-zero exit code - indicates failure. The following failure codes can be returned: - - 1 - Error in command line syntax. - - 2 - One of the files passed on the command line did not - exist. - - 3 - A required tool could not be found. - - 4 - The action failed. - -Examples - -xdg-open 'http://www.freedesktop.org/' - - Opens the freedesktop.org website in the user's default - browser. - -xdg-open /tmp/foobar.png - - Opens the PNG image file /tmp/foobar.png in the user's default - image viewing application. -_MANUALPAGE -} - -usage() -{ -cat << _USAGE - xdg-open -- opens a file or URL in the user's preferred - application - -Synopsis - - xdg-open { file | URL } - - xdg-open { --help | --manual | --version } - -_USAGE -} - -#@xdg-utils-common@ - -#---------------------------------------------------------------------------- -# Common utility functions included in all XDG wrapper scripts -#---------------------------------------------------------------------------- - -DEBUG() -{ - [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; - [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; - shift - echo "$@" >&2 -} - -# This handles backslashes but not quote marks. -first_word() -{ - read first rest - echo "$first" -} - -#------------------------------------------------------------- -# map a binary to a .desktop file -binary_to_desktop_file() -{ - search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - binary="`which "$1"`" - binary="`readlink -f "$binary"`" - base="`basename "$binary"`" - IFS=: - for dir in $search; do - unset IFS - [ "$dir" ] || continue - [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue - for file in "$dir"/applications/*.desktop "$dir"/applications/*/*.desktop "$dir"/applnk/*.desktop "$dir"/applnk/*/*.desktop; do - [ -r "$file" ] || continue - # Check to make sure it's worth the processing. - grep -q "^Exec.*$base" "$file" || continue - # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). - grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - if [ x"`readlink -f "$command"`" = x"$binary" ]; then - # Fix any double slashes that got added path composition - echo "$file" | sed -e 's,//*,/,g' - return - fi - done - done -} - -#------------------------------------------------------------- -# map a .desktop file to a binary -## FIXME: handle vendor dir case -desktop_file_to_binary() -{ - search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - desktop="`basename "$1"`" - IFS=: - for dir in $search; do - unset IFS - [ "$dir" ] && [ -d "$dir/applications" ] || continue - file="$dir/applications/$desktop" - [ -r "$file" ] || continue - # Remove any arguments (%F, %f, %U, %u, etc.). - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - readlink -f "$command" - return - done -} - -#------------------------------------------------------------- -# Exit script on successfully completing the desired operation - -exit_success() -{ - if [ $# -gt 0 ]; then - echo "$@" - echo - fi - - exit 0 -} - - -#----------------------------------------- -# Exit script on malformed arguments, not enough arguments -# or missing required option. -# prints usage information - -exit_failure_syntax() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - echo "Try 'xdg-open --help' for more information." >&2 - else - usage - echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." - fi - - exit 1 -} - -#------------------------------------------------------------- -# Exit script on missing file specified on command line - -exit_failure_file_missing() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 2 -} - -#------------------------------------------------------------- -# Exit script on failure to locate necessary tool applications - -exit_failure_operation_impossible() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 3 -} - -#------------------------------------------------------------- -# Exit script on failure returned by a tool application - -exit_failure_operation_failed() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 4 -} - -#------------------------------------------------------------ -# Exit script on insufficient permission to read a specified file - -exit_failure_file_permission_read() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 5 -} - -#------------------------------------------------------------ -# Exit script on insufficient permission to write a specified file - -exit_failure_file_permission_write() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 6 -} - -check_input_file() -{ - if [ ! -e "$1" ]; then - exit_failure_file_missing "file '$1' does not exist" - fi - if [ ! -r "$1" ]; then - exit_failure_file_permission_read "no permission to read file '$1'" - fi -} - -check_vendor_prefix() -{ - file_label="$2" - [ -n "$file_label" ] || file_label="filename" - file=`basename "$1"` - case "$file" in - [a-zA-Z]*-*) - return - ;; - esac - - echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2 - echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 - echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 - echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2 - exit 1 -} - -check_output_file() -{ - # if the file exists, check if it is writeable - # if it does not exists, check if we are allowed to write on the directory - if [ -e "$1" ]; then - if [ ! -w "$1" ]; then - exit_failure_file_permission_write "no permission to write to file '$1'" - fi - else - DIR=`dirname "$1"` - if [ ! -w "$DIR" ] || [ ! -x "$DIR" ]; then - exit_failure_file_permission_write "no permission to create file '$1'" - fi - fi -} - -#---------------------------------------- -# Checks for shared commands, e.g. --help - -check_common_commands() -{ - while [ $# -gt 0 ] ; do - parm="$1" - shift - - case "$parm" in - --help) - usage - echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." - exit_success - ;; - - --manual) - manualpage - exit_success - ;; - - --version) - echo "xdg-open 1.1.0 rc1" - exit_success - ;; - esac - done -} - -check_common_commands "$@" - -[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; -if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then - # Be silent - xdg_redirect_output=" > /dev/null 2> /dev/null" -else - # All output to stderr - xdg_redirect_output=" >&2" -fi - -#-------------------------------------- -# Checks for known desktop environments -# set variable DE to the desktop environments name, lowercase - -detectDE() -{ - # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 - unset GREP_OPTIONS - - if [ -n "${XDG_CURRENT_DESKTOP}" ]; then - case "${XDG_CURRENT_DESKTOP}" in - GNOME) - DE=gnome; - ;; - KDE) - DE=kde; - ;; - LXDE) - DE=lxde; - ;; - XFCE) - DE=xfce - esac - fi - - if [ x"$DE" = x"" ]; then - # classic fallbacks - if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; - elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; - elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate; - elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; - elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce - fi - fi - - if [ x"$DE" = x"" ]; then - # fallback to checking $DESKTOP_SESSION - case "$DESKTOP_SESSION" in - gnome) - DE=gnome; - ;; - LXDE|Lubuntu) - DE=lxde; - ;; - xfce|xfce4|'Xfce Session') - DE=xfce; - ;; - esac - fi - - if [ x"$DE" = x"" ]; then - # fallback to uname output for other platforms - case "$(uname 2>/dev/null)" in - Darwin) - DE=darwin; - ;; - esac - fi - - if [ x"$DE" = x"gnome" ]; then - # gnome-default-applications-properties is only available in GNOME 2.x - # but not in GNOME 3.x - which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3" - fi -} - -#---------------------------------------------------------------------------- -# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 -# It also always returns 1 in KDE 3.4 and earlier -# Simply return 0 in such case - -kfmclient_fix_exit_code() -{ - version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` - major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` - minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` - release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` - test "$major" -gt 3 && return $1 - test "$minor" -gt 5 && return $1 - test "$release" -gt 4 && return $1 - return 0 -} - -# This handles backslashes but not quote marks. -first_word() -{ - read first rest - echo "$first" -} - -last_word() -{ - read first rest - echo "$rest" -} - -open_darwin() -{ - open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_kde() -{ - if kde-open -v 2>/dev/null 1>&2; then - kde-open "$1" - else - if [ x"$KDE_SESSION_VERSION" = x"4" ]; then - kfmclient openURL "$1" - else - kfmclient exec "$1" - kfmclient_fix_exit_code $? - fi - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_gnome() -{ - if gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - else - gnome-open "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_mate() -{ - if gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - else - mate-open "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_xfce() -{ - exo-open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -#----------------------------------------- -# Recursively search .desktop file - -search_desktop_file() -{ - local default="$1" - local dir="$2" - local arg="$3" - - local file="" - # look for both vendor-app.desktop, vendor/app.desktop - if [ -r "$dir/$default" ]; then - file="$dir/$default" - elif [ -r "$dir/`echo $default | sed -e 's|-|/|'`" ]; then - file="$dir/`echo $default | sed -e 's|-|/|'`" - fi - - if [ -r "$file" ] ; then - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command_exec=`which $command 2>/dev/null` - arguments="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | last_word`" - arg_one="`echo $arg | sed 's/&/\\\\&/g'`" - arguments_exec="`echo $arguments | sed -e 's*%[fFuU]*"'"$arg_one"'"*g'`" - - if [ -x "$command_exec" ] ; then - if echo $arguments | grep -iq '%[fFuU]' ; then - echo START $command_exec $arguments_exec - eval $command_exec $arguments_exec - else - echo START $command_exec $arguments_exec "$arg" - eval $command_exec $arguments_exec "$arg" - fi - - if [ $? -eq 0 ]; then - exit_success - fi - fi - fi - - for d in $dir/*/; do - [ -d "$d" ] && search_desktop_file "$default" "$d" "$arg" - done -} - - -open_generic_xdg_mime() -{ - filetype="$2" - default=`xdg-mime query default "$filetype"` - if [ -n "$default" ] ; then - xdg_user_dir="$XDG_DATA_HOME" - [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" - - xdg_system_dirs="$XDG_DATA_DIRS" - [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ - -DEBUG 3 "$xdg_user_dir:$xdg_system_dirs" - for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do - search_desktop_file "$default" "$x/applications/" "$1" - done - fi -} - -open_generic_xdg_file_mime() -{ - filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` - open_generic_xdg_mime "$1" "$filetype" -} - -open_generic_xdg_x_scheme_handler() -{ - scheme="`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`" - if [ -n $scheme ]; then - filetype="x-scheme-handler/$scheme" - open_generic_xdg_mime "$1" "$filetype" - fi -} - -open_generic() -{ - # Paths or file:// URLs - if (echo "$1" | grep -q '^file://' || - ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'); then - - local file="$1" - - # Decode URLs - if echo "$file" | grep -q '^file:///'; then - file=${file#file://} - file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" - fi - check_input_file "$file" - - open_generic_xdg_file_mime "$file" - - if [ -f /etc/debian_version ] && - which run-mailcap 2>/dev/null 1>&2; then - run-mailcap --action=view "$file" - if [ $? -eq 0 ]; then - exit_success - fi - fi - - if mimeopen -v 2>/dev/null 1>&2; then - mimeopen -L -n "$file" - if [ $? -eq 0 ]; then - exit_success - fi - fi - fi - - open_generic_xdg_x_scheme_handler "$1" - - IFS=":" - for browser in $BROWSER; do - if [ x"$browser" != x"" ]; then - - browser_with_arg=`printf "$browser" "$1" 2>/dev/null` - if [ $? -ne 0 ]; then - browser_with_arg=$browser; - fi - - if [ x"$browser_with_arg" = x"$browser" ]; then - eval '$browser $1'$xdg_redirect_output; - else eval '$browser_with_arg'$xdg_redirect_output; - fi - - if [ $? -eq 0 ]; then - exit_success; - fi - fi - done - - exit_failure_operation_impossible "no method available for opening '$1'" -} - -open_lxde() -{ - # pcmanfm only knows how to handle file:// urls and filepaths, it seems. - if (echo "$1" | grep -q '^file://' || - ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:') - then - local file="$(echo "$1" | sed 's%^file://%%')" - - # handle relative paths - if ! echo "$file" | grep -q '^/'; then - file="$(pwd)/$file" - fi - - pcmanfm "$file" - - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -[ x"$1" != x"" ] || exit_failure_syntax - -url= -while [ $# -gt 0 ] ; do - parm="$1" - shift - - case "$parm" in - -*) - exit_failure_syntax "unexpected option '$parm'" - ;; - - *) - if [ -n "$url" ] ; then - exit_failure_syntax "unexpected argument '$parm'" - fi - url="$parm" - ;; - esac -done - -if [ -z "${url}" ] ; then - exit_failure_syntax "file or URL argument missing" -fi - -detectDE - -if [ x"$DE" = x"" ]; then - DE=generic -fi - -DEBUG 2 "Selected DE $DE" - -# if BROWSER variable is not set, check some well known browsers instead -if [ x"$BROWSER" = x"" ]; then - BROWSER=links2:elinks:links:lynx:w3m - if [ -n "$DISPLAY" ]; then - BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER - fi -fi - -case "$DE" in - kde) - open_kde "$url" - ;; - - gnome*) - open_gnome "$url" - ;; - - mate) - open_mate "$url" - ;; - - xfce) - open_xfce "$url" - ;; - - lxde) - open_lxde "$url" - ;; - - generic) - open_generic "$url" - ;; - - *) - exit_failure_operation_impossible "no method available for opening '$url'" - ;; -esac diff --git a/node_modules/grunt-contrib-connect/package.json b/node_modules/grunt-contrib-connect/package.json deleted file mode 100644 index 8e1b9c6..0000000 --- a/node_modules/grunt-contrib-connect/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "grunt-contrib-connect", - "description": "Start a connect web server.", - "version": "0.5.0", - "homepage": "https://github.com/gruntjs/grunt-contrib-connect", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-connect.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-connect/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-connect/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "dependencies": { - "connect": "~2.7.11", - "connect-livereload": "~0.2.0", - "open": "0.0.4" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.6.4", - "grunt-contrib-nodeunit": "~0.2.0", - "grunt-contrib-internal": "~0.4.6", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin", - "server", - "connect", - "http" - ], - "contributors": [ - { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com" - }, - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com" - }, - { - "name": "Sindre Sorhus", - "url": "http://sindresorhus.com" - } - ], - "readme": "# grunt-contrib-connect v0.5.0 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-connect.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-connect)\n\n> Start a connect web server.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-connect --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-contrib-connect');\n```\n\n\n\n\n## Connect task\n_Run this task with the `grunt connect` command._\n\nNote that this server only runs as long as grunt is running. Once grunt's tasks have completed, the web server stops. This behavior can be changed with the [keepalive](#keepalive) option, and can be enabled ad-hoc by running the task like `grunt connect:keepalive`.\n\nThis task was designed to be used in conjunction with another task that is run immediately afterwards, like the [grunt-contrib-qunit plugin](https://github.com/gruntjs/grunt-contrib-qunit) `qunit` task.\n### Options\n\n#### port\nType: `Integer` \nDefault: `8000`\n\nThe port on which the webserver will respond. The task will fail if the specified port is already in use. You can use the special values `0` or `'?'` to use a system-assigned port.\n\n#### protocol\nType: `String` \nDefault: `'http'`\n\nMay be `'http'` or `'https'`.\n\n#### hostname\nType: `String` \nDefault: `'localhost'`\n\nThe hostname the webserver will use.\n\nSetting it to `'*'` will make the server accessible from anywhere.\n\n#### base\nType: `String` or `Array` \nDefault: `'.'`\n\nThe base (or root) directory from which files will be served. Defaults to the project Gruntfile's directory.\n\nCan be an array of bases to serve multiple directories. The last base given will be the directory to become browse-able.\n\n#### directory\nType: `String` \nDefault: `null`\n\nSet to the directory you wish to be browse-able. Used to override the `base` option browse-able directory.\n\n#### keepalive\nType: `Boolean` \nDefault: `false`\n\nKeep the server alive indefinitely. Note that if this option is enabled, any tasks specified after this task will _never run_. By default, once grunt's tasks have completed, the web server stops. This option changes that behavior.\n\nThis option can also be enabled ad-hoc by running the task like `grunt connect:targetname:keepalive`\n\n#### debug\nType: `Boolean` \nDefault: `false`\n\nSet the `debug` option to true to enable logging instead of using the `--debug` flag.\n\n#### livereload\nType: `Boolean` or `Number` \nDefault: `false`\n\nSet to `true` or a port number to inject a live reload script tag into your page using [connect-livereload](https://github.com/intesso/connect-livereload).\n\n*This does not perform live reloading. It is intended to be used in tandem with grunt-contrib-watch or another task that will trigger a live reload server upon files changing.*\n\n#### open\nType: `Boolean` or `String`\nDefault: `false`\n\nOpen the served page in your default browser. Specifying `true` opens the default server URL, while specifying a URL opens that URL.\n\n#### middleware\nType: `Function` \nDefault:\n\n```js\nfunction(connect, options) {\n var middlewares = [];\n var directory = options.directory || options.base[options.base.length - 1];\n if (!Array.isArray(options.base)) {\n options.base = [options.base];\n }\n options.base.forEach(function(base) {\n // Serve static files.\n middlewares.push(connect.static(base));\n });\n // Make directory browse-able.\n middlewares.push(connect.directory(directory));\n return middlewares;\n}\n```\n\nLets you add in your own Connect middlewares. This option expects a function that returns an array of middlewares. See the [project Gruntfile][] and [project unit tests][] for a usage example.\n\n[project Gruntfile]: Gruntfile.js\n[project unit tests]: test/connect_test.js\n\n### Usage examples\n\n#### Basic Use\nIn this example, `grunt connect` (or more verbosely, `grunt connect:server`) will start a static web server at `http://localhost:9001/`, with its base path set to the `www-root` directory relative to the gruntfile, and any tasks run afterwards will be able to access it.\n\n```javascript\n// Project configuration.\ngrunt.initConfig({\n connect: {\n server: {\n options: {\n port: 9001,\n base: 'www-root'\n }\n }\n }\n});\n```\n\nIf you want your web server to use the default options, just omit the `options` object. You still need to specify a target (`uses_defaults` in this example), but the target's configuration object can otherwise be empty or nonexistent. In this example, `grunt connect` (or more verbosely, `grunt connect:uses_defaults`) will start a static web server using the default options.\n\n```javascript\n// Project configuration.\ngrunt.initConfig({\n connect: {\n uses_defaults: {}\n }\n});\n```\n\n#### Multiple Servers\nYou can specify multiple servers to be run alone or simultaneously by creating a target for each server. In this example, running either `grunt connect:site1` or `grunt connect:site2` will start the appropriate web server, but running `grunt connect` will run _both_. Note that any server for which the [keepalive](#keepalive) option is specified will prevent _any_ task or target from running after it.\n\n```javascript\n// Project configuration.\ngrunt.initConfig({\n connect: {\n site1: {\n options: {\n port: 9000,\n base: 'www-roots/site1'\n }\n },\n site2: {\n options: {\n port: 9001,\n base: 'www-roots/site2'\n }\n }\n }\n});\n```\n\n#### Roll Your Own\nLike the [Basic Use](#basic-use) example, this example will start a static web server at `http://localhost:9001/`, with its base path set to the `www-root` directory relative to the gruntfile. Unlike the other example, this is done by creating a brand new task. in fact, this plugin isn't even installed!\n\n```javascript\n// Project configuration.\ngrunt.initConfig({ /* Nothing needed here! */ });\n\n// After running \"npm install connect --save-dev\" to add connect as a dev\n// dependency of your project, you can require it in your gruntfile with:\nvar connect = require('connect');\n\n// Now you can define a \"connect\" task that starts a webserver, using the\n// connect lib, with whatever options and configuration you need:\ngrunt.registerTask('connect', 'Start a custom static web server.', function() {\n grunt.log.writeln('Starting static web server in \"www-root\" on port 9001.');\n connect(connect.static('www-root')).listen(9001);\n});\n```\n\n#### Support for HTTPS\n\nA default certificate authority, certificate and key file are provided and pre-\nconfigured for use when `protocol` has been set to `https`.\n\nNOTE: The passphrase used on the files is `grunt`\n\n####### Advanced HTTPS config\n\nIf the default certificate setup is unsuitable for your environment, OpenSSL\ncan be used to create a set of self-signed certificates with a local ca root.\n\n```shell\n### Generate the CA key\n### Set a passphrase and remember what it is\nopenssl genrsa -des3 -out ca.key 2048\n### Generate a CA root\nopenssl req -new -x509 -days 3650 -key ca.key -out ca.crt\n\n### Generate the server key\nopenssl genrsa -out server.key 1024\n### Generate the request to the self-signed CA root\nopenssl req -new -key server.key -out server.csr\n### Generate the server certificate\nopenssl x509 -req -in server.csr -out server.crt -CA ca.crt -CAkey ca.key -CAcreateserial -days 3650\n```\n\nFor more details on the various options that can be set when configuring SSL,\nplease see the Node documentation for [TLS][].\n\nGrunt configuration would become\n\n```javascript\n// Project configuration.\ngrunt.initConfig({\n connect: {\n server: {\n options: {\n protocol: 'https',\n port: 8443,\n key: grunt.file.read('server.key').toString(),\n cert: grunt.file.read('server.crt').toString(),\n ca: grunt.file.read('ca.crt').toString(),\n passphrase: 'grunt',\n },\n },\n },\n});\n```\n\n[TLS]: http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener\n\n#### Grunt Events\nThe connect plugin will emit a grunt event, `connect.{taskName}.listening`, once the server has started. You can listen for this event to run things against a keepalive server, for example:\n\n```javascript\ngrunt.registerTask('jasmine-server', 'start web server for jasmine tests in browser', function() {\n grunt.task.run('jasmine:tests:build');\n\n grunt.event.once('connect.tests.listening', function(host, port) {\n var specRunnerUrl = 'http://' + host + ':' + port + '/_SpecRunner.html';\n grunt.log.writeln('Jasmine specs available at: ' + specRunnerUrl);\n require('open')(specRunnerUrl);\n });\n\n grunt.task.run('connect:tests:keepalive');\n});\n```\n\n\n## Release History\n\n * 2013-09-05   v0.5.0   Add 'open' option.\n * 2013-09-05   v0.4.2   Un-normalize options.base as it should be a string or an array as the user has set. Fix setting target hostname option.\n * 2013-09-02   v0.4.1   Browse-able directory is the last item supplied to bases. Added directory option to override browse-able directory.\n * 2013-09-01   v0.4.0   Fix logging of which server address. Ability to set multiple bases. Event emitted when server starts listening. Support for HTTPS. debug option added to display debug logging like the --debug flag. livereload option added to inject a livereload snippet into the page.\n * 2013-04-10   v0.3.0   Add ability to listen on system-assigned port.\n * 2013-03-07   v0.2.0   Upgrade connect dependency.\n * 2013-02-17   v0.1.2   Ensure Gruntfile.js is included on npm.\n * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0.\n * 2013-01-18   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-09   v0.1.1rc5   Updating to work with grunt v0.4.0rc5.\n * 2012-11-01   v0.1.0   Work in progress, not yet officially released.\n\n---\n\nTask submitted by [\"Cowboy\" Ben Alman](http://benalman.com)\n\n*This file was generated on Thu Sep 05 2013 14:09:10.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-connect@0.5.0", - "dist": { - "shasum": "198b4550a7151aea707b4deff38f7a1764e1bafe" - }, - "_from": "grunt-contrib-connect@~0.5.0", - "_resolved": "https://registry.npmjs.org/grunt-contrib-connect/-/grunt-contrib-connect-0.5.0.tgz" -} diff --git a/node_modules/grunt-contrib-connect/tasks/certs/ca.crt b/node_modules/grunt-contrib-connect/tasks/certs/ca.crt deleted file mode 100644 index a11cf8a..0000000 --- a/node_modules/grunt-contrib-connect/tasks/certs/ca.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDczCCAlugAwIBAgIJAKdGg4YIc6/TMA0GCSqGSIb3DQEBBQUAMFAxCzAJBgNV -BAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMRAwDgYDVQQKDAdHcnVudEpTMRow -GAYDVQQDDBFodHRwczovL2xvY2FsaG9zdDAeFw0xMzAyMDcyMDI5NDVaFw0yMzAy -MDUyMDI5NDVaMFAxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMRAw -DgYDVQQKDAdHcnVudEpTMRowGAYDVQQDDBFodHRwczovL2xvY2FsaG9zdDCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANY8SGJgaPsW/MfKyXx5VgtdNM4X -UJCYK5EC6hjBOi8CT46l85vM5c6dall5IfGZPvJtxydM+bnevlhmgBr28Q0Z+ury -U/sgzCn9fs4nqJPCX62jxYJmJDDLxnqDWBq+TMyX1keGpfJ9V9TOd8S/PkKfa8AN -aglB4Nf4USEbcERIwKt5nLZA44n62E98zm78YKrOdkx/hB8nwOfiphVkyUnDGIXj -fTmWduoVEf4bLq91Wk6lgKzVq26IxFQRP5T59kX19XH0j/s0a3M+2rrT/dIH1NjZ -wgdYPBBXsIfLAAw3eB8OobUcI+ILlXUG/ezIxTCsC/fLEnzK7COnVd0iY8UCAwEA -AaNQME4wHQYDVR0OBBYEFDsffAk3JaQRD1xJb7g06pgpPrhyMB8GA1UdIwQYMBaA -FDsffAk3JaQRD1xJb7g06pgpPrhyMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF -BQADggEBAG8jDiUmZs/g4SyDeLRkos/vyEUaSzxolU9/7S4gbo7ckq35Uk+1dz8x -NfwIYmhdW5BsDK2HHC1lQ3HLyM5IeIQmULHacCPhbbEJ2dRtx3F4oRxeRn5jVWu3 -RI8CWAC7klH3WcE9cajY6WS/6EbpypMceT060hAPBXxPT7YTnY87VByj3Q/e4FMt -WnlvEuoFUfekayd4GFXhd+ReCL6xf8IXWmI6d5c/YJmY1p2AV8ILeXf0RDTfr832 -mxSuKzG+VopTJrUBkzkoSdYG9srftTlnSBE174rcgDzpqDDTFnwQYpMa5dIKOUHA -n/DK9mAnOaZHymcWl4bl/HSiXfMy/2U= ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-connect/tasks/certs/ca.key b/node_modules/grunt-contrib-connect/tasks/certs/ca.key deleted file mode 100644 index c1c2fd2..0000000 --- a/node_modules/grunt-contrib-connect/tasks/certs/ca.key +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,D6AD3B624B34C274 - -Vg+XXN7UnJRk9FQpHRXWxVZy21qwQZcfkICIx5vcUjQZKArpTVWUpGq9QCXhGuUR -NnzrdScjQCGBDrmlMCS7ENltE1WXImOzZfI9gvU+Tc0Yhze7Dou8QNvB59+7Kye/ -RYOkQH4KdUsw9IMEt2ELrxCnO9D2qwCofUJq9tdh/R5uqKPlybSKMBaiKDY/JV88 -rNAp9uJhgFoDsZb8rKLoZqFSgrGHbH+eg67A8ZmHDAf5hMFo7Bt1cL61w+iEFAvU -wFdecJK6RlZRRGBkOJ6y1Wq1WL2Vlp1WHQJOSsPoV+cuC2DqRyb+liH2lffcYnIS -0cL1jAZ3FQ7V+8kZ37sZmAvLm4ELD0A72PH3Zv54/DVkQCHA/BHsOGm95zW+BoN/ -DnoRqbBQ6weH55dPHGCdbhADMsEuFqS2cSPOO2cik4Uvmnoh0M/wZYBWxbFO6qSE -Za1E60wvdcPWPGnu320qC05DQjCGvCNWFudovKYbbUv6xyfxqjEw0I1FjdUzJsJR -gF9hEPe99sAbRGSvU3aNoksjTTdgJaVk5+DMSekMmTF9M/mY9VgWu9YHL8tsEUv0 -6BcHK2hWXfZWwf/+HJmgI9JBXUfxVCpeoh+VHK6kpDL2ezjXAd/3jK4EhANc24/7 -Lk47KCs+1F8JXAnma1Hkit3nNdyWql4rHM6W7j0+v8vAG1t7pbr9ixipLD7qp8Jl -x30j+GiffzbBOZ3JWUcUm0MYwrfen+0ed3qQmrv7DMgK6uiwyLZJMEDA+0Pu920L -Zw6Z7YkYHZWfPciWDBP+aXKzFayg6SSFnYLdUUOjNBc2DZGTr8UuR07xdK/dNNW4 -WE0Wlbxma6jwrU3qYmsPY/21x5e54cu4o0qZWrYWbAsvAKaqQIkR6mDI4KIQbJ7d -+tfKe5Hck4CsTZJbjszQ4EZYOtMHCHg8tPYZTOGEBUeG3CTe4VY0zmjv5Jg6YUmq -88Cnz0WyNXA1dDcQDp/vUWQZBUZbIVxk1iAB8ZhHO8z51GnZQAcKoOq2R4fDQhlE -BMSbcn3gKEXf5dqwR6caosQmFA+kIg8ydonMbysucuUeCfShx5s9SjVDaOVlsb1V -LMXtt/IPGaBnNAOKLgtczaViOWsFULMdC5lAbg60P+PnhadDPTV40uOj9dDp8Lji -uKd5oj8REGT/TxQGdGS87RntJced0ukkc09JVVXdHCTeUbQ8zujxq2jIXFycvNtk -8oTSmPUzIKhuhkBq4++MoiGnYk/Ya9UW5Byl4FIoSTJkFTgGOI18WW7V0CcZ9xPW -rdlo5OjNGf9FhsoNyUVkm1460iwUnknT/+AeCkGrIkh9NKXD6KR9hgR3mZN/k6/I -2o4PlUMSpf5i94gzscMrZ8YsuT3Cu4MK7IlpnRrtnxKQqBW8Kv7zq4Xk9LRcf1bQ -xbf5rq3/i/7J7lV7VAY1y+wmN+KidmQ8Q/souaetVW24zG2c2kHTNp5WgQd8lA0T -n5WrpYJXiLYyiCVtoNTIsne9tDcbkMfiHJqyAjnDYfMOsOuZkmU/jh8L8FBdjM3v -11zk/6XQK8c4hFM0MOMRHcCs3yGcyRAQn7VwaYHqM5qt6tzFLteL+w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-connect/tasks/certs/ca.srl b/node_modules/grunt-contrib-connect/tasks/certs/ca.srl deleted file mode 100644 index 13e7e2c..0000000 --- a/node_modules/grunt-contrib-connect/tasks/certs/ca.srl +++ /dev/null @@ -1 +0,0 @@ -BE1BAB345BC0CC88 diff --git a/node_modules/grunt-contrib-connect/tasks/certs/server.crt b/node_modules/grunt-contrib-connect/tasks/certs/server.crt deleted file mode 100644 index 2e4efc3..0000000 --- a/node_modules/grunt-contrib-connect/tasks/certs/server.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICmDCCAYACCQC+G6s0W8DMiDANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJV -UzETMBEGA1UECAwKU29tZS1TdGF0ZTEQMA4GA1UECgwHR3J1bnRKUzEaMBgGA1UE -AwwRaHR0cHM6Ly9sb2NhbGhvc3QwHhcNMTMwMjA3MjAzMjU1WhcNMjMwMjA1MjAz -MjU1WjBQMQswCQYDVQQGEwJVUzETMBEGA1UECAwKU29tZS1TdGF0ZTEQMA4GA1UE -CgwHR3J1bnRKUzEaMBgGA1UEAwwRaHR0cHM6Ly9sb2NhbGhvc3QwgZ8wDQYJKoZI -hvcNAQEBBQADgY0AMIGJAoGBAM6KcAJQb4fxTS/rDEx7rxaeAdEsGUzp03yMAzHz -l74oCTCqikzNFSn7A5pUAlU7W80hR81h7wuT6/gR9BkRRckN2LlNOkKuF5EjLwvc -K0B6zljerBbjrjEQ6DEm83uhgqrOtgynM3f0wYrQm2C4LKi82hlG2ApFzwsj8G3w -7MZFAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBABKCuy9DP25tRKQ+kd6d/N0IS8N2 -3rLKD79+MQ3Y3fSdwjJnCjEMa0oAOJnLnG14x2BYCSAd6HCnZ42yemMt1BwITASJ -dXK4lWDALf4VOKhVIJjcWw81970JBDXpPGhJ1t0D5k2CAJXb72WATGLX7UIuRdJ2 -7f7ZTlXo3KRbHMwE4B3BwT+e/MWfwndMuvsSxQBGclw8RpmeF1W/wCLvYvpCtDeW -exBJohEZs/cb0Tu2dkrborYAmhCGt2ujB5612PVRxttCTua0eM615XW1UGlBZBW1 -vSKglmeWDK022gATPvplWVNp98yMMYmNmu3DHutCbdFxslLyqYlpCXq/3co= ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-connect/tasks/certs/server.csr b/node_modules/grunt-contrib-connect/tasks/certs/server.csr deleted file mode 100644 index adef607..0000000 --- a/node_modules/grunt-contrib-connect/tasks/certs/server.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBjzCB+QIBADBQMQswCQYDVQQGEwJVUzETMBEGA1UECAwKU29tZS1TdGF0ZTEQ -MA4GA1UECgwHR3J1bnRKUzEaMBgGA1UEAwwRaHR0cHM6Ly9sb2NhbGhvc3QwgZ8w -DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM6KcAJQb4fxTS/rDEx7rxaeAdEsGUzp -03yMAzHzl74oCTCqikzNFSn7A5pUAlU7W80hR81h7wuT6/gR9BkRRckN2LlNOkKu -F5EjLwvcK0B6zljerBbjrjEQ6DEm83uhgqrOtgynM3f0wYrQm2C4LKi82hlG2ApF -zwsj8G3w7MZFAgMBAAGgADANBgkqhkiG9w0BAQUFAAOBgQCguHE/Ae/It4pKK73B -80Wehc0gglUXtPpLvu0n4NwGQ7kEybYrpR4EFnjD76Jt6oJ/vqfVB/8tLPRX3Mvq -8U+spcyD2km4stApbp3u6V8XxPlVcvY0YNzL1XIRv5p9ODCjF6+xnz2BEW/WjbfP -c29uUw2q+5OydPffx7Zd1YPABA== ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-connect/tasks/certs/server.key b/node_modules/grunt-contrib-connect/tasks/certs/server.key deleted file mode 100644 index ba75116..0000000 --- a/node_modules/grunt-contrib-connect/tasks/certs/server.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDOinACUG+H8U0v6wxMe68WngHRLBlM6dN8jAMx85e+KAkwqopM -zRUp+wOaVAJVO1vNIUfNYe8Lk+v4EfQZEUXJDdi5TTpCrheRIy8L3CtAes5Y3qwW -464xEOgxJvN7oYKqzrYMpzN39MGK0JtguCyovNoZRtgKRc8LI/Bt8OzGRQIDAQAB -AoGBAJG7eKEJZEjFaDMhZEIrGzWYM6wFs6xjaEf++toqCK2xzho6mu7p3b8LUFV6 -ZVMCWRn6G5G9QlAnBV66PEPbviKCi1SuarGQe3B7QsxdkUSpdg3RrmhrzsHsSjkW -YGBwF3XvOxiWv1tlkKLiizoIP9wGE503AK/vtR9n0jFTuseBAkEA/2ZjrtXwMdJX -XNfZGMrbyhH2/8fjKHdeOwAdGwp7scdd2B1BBqwfa4tttbQUfuWaWaA2gShcTHVK -PfJNdXvMVQJBAM8GqWdBgBL9kn4IO8j1fXdEa04+PZLCzLT0deCFbySUajv7BIzP -NvAYDNsMskdq1wnA+G0Nz2NADH57JcwaAjECQQCbza6J/eElw5ef/91kjnw+bW8s -4pflG8zUWWFoGaET9vd823vLwjz4snofGthWAWODwYT+jcygp/y+hY5TWU5xAkBV -kmpZPNDEiL2RjLOxiA9ZShWUnNN0o0JcFaPXry/WjeYvbr1dupT5vucpb+EM9hN2 -e6Xz5b5wRtwjN6HS8HkxAkBxrTNDV2/+8TYtUp6KzHOiXpF1iaC6MtLLUPsLvccT -C/TlBD8ZwvW02G6BLgJF/woJ273EmK3Oehlf9Uwgm9yv ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-connect/tasks/connect.js b/node_modules/grunt-contrib-connect/tasks/connect.js deleted file mode 100644 index 073d71f..0000000 --- a/node_modules/grunt-contrib-connect/tasks/connect.js +++ /dev/null @@ -1,143 +0,0 @@ -/* - * grunt-contrib-connect - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - var path = require('path'); - var connect = require('connect'); - var http = require('http'); - var https = require('https'); - var injectLiveReload = require('connect-livereload'); - var open = require('open'); - - grunt.registerMultiTask('connect', 'Start a connect web server.', function() { - // Merge task-specific options with these defaults. - var options = this.options({ - protocol: 'http', - port: 8000, - hostname: 'localhost', - base: '.', - directory: null, - keepalive: false, - debug: false, - livereload: false, - open: false, - middleware: function(connect, options) { - var middlewares = []; - var directory = options.directory || options.base[options.base.length - 1]; - if (!Array.isArray(options.base)) { - options.base = [options.base]; - } - options.base.forEach(function(base) { - // Serve static files. - middlewares.push(connect.static(base)); - }); - // Make directory browse-able. - middlewares.push(connect.directory(directory)); - return middlewares; - } - }); - - if (options.protocol !== 'http' && options.protocol !== 'https') { - grunt.fatal('protocol option must be \'http\' or \'https\''); - } - - // Connect requires the base path to be absolute. - if (Array.isArray(options.base)) { - options.base = options.base.map(function(base) { - return path.resolve(base); - }); - } else { - options.base = path.resolve(options.base); - } - - // Connect will listen to all interfaces if hostname is null. - if (options.hostname === '*') { - options.hostname = null; - } - - // Connect will listen to ephemeral port if asked - if (options.port === '?') { - options.port = 0; - } - - var middleware = options.middleware ? options.middleware.call(this, connect, options) : []; - - // If --debug was specified, enable logging. - if (grunt.option('debug') || options.debug === true) { - connect.logger.format('grunt', ('[D] server :method :url :status ' + - ':res[content-length] - :response-time ms').magenta); - middleware.unshift(connect.logger('grunt')); - } - - // Inject live reload snippet - if (options.livereload !== false) { - if (options.livereload === true) { - options.livereload = 35729; - } - middleware.unshift(injectLiveReload({port: options.livereload})); - } - - // Start server. - var done = this.async(); - var taskTarget = this.target; - var keepAlive = this.flags.keepalive || options.keepalive; - - var app = connect.apply(null, middleware); - var server = null; - - if (options.protocol === 'https') { - server = https.createServer({ - key: options.key || grunt.file.read(path.join(__dirname, 'certs', 'server.key')).toString(), - cert: options.cert || grunt.file.read(path.join(__dirname, 'certs', 'server.crt')).toString(), - ca: options.ca || grunt.file.read(path.join(__dirname, 'certs', 'ca.crt')).toString(), - passphrase: options.passphrase || 'grunt', - }, app); - } else { - server = http.createServer(app); - } - - server - .listen(options.port, options.hostname) - .on('listening', function() { - var address = server.address(); - grunt.log.writeln('Started connect web server on ' + (address.address || 'localhost') + ':' + address.port + '.'); - grunt.config.set('connect.' + taskTarget + '.options.hostname', address.address || 'localhost'); - grunt.config.set('connect.' + taskTarget + '.options.port', address.port); - - grunt.event.emit('connect.' + taskTarget + '.listening', (address.address || 'localhost'), address.port); - - if (options.open === true) { - open(options.protocol + '://' + address.address + ':' + address.port); - } else if (typeof options.open === 'string') { - open(options.open); - } - - if (!keepAlive) { - done(); - } - }) - .on('error', function(err) { - if (err.code === 'EADDRINUSE') { - grunt.fatal('Port ' + options.port + ' is already in use by another process.'); - } else { - grunt.fatal(err); - } - }); - - // So many people expect this task to keep alive that I'm adding an option - // for it. Running the task explicitly as grunt:keepalive will override any - // value stored in the config. Have fun, people. - if (keepAlive) { - // This is now an async task. Since we don't call the "done" - // function, this task will never, ever, ever terminate. Have fun! - grunt.log.write('Waiting forever...\n'); - } - }); -}; diff --git a/node_modules/grunt-contrib-copy/.jshintrc b/node_modules/grunt-contrib-copy/.jshintrc deleted file mode 100644 index e0cc7bb..0000000 --- a/node_modules/grunt-contrib-copy/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/node_modules/grunt-contrib-copy/.npmignore b/node_modules/grunt-contrib-copy/.npmignore deleted file mode 100644 index cf46a3f..0000000 --- a/node_modules/grunt-contrib-copy/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/.travis.yml b/node_modules/grunt-contrib-copy/.travis.yml deleted file mode 100644 index f2c257a..0000000 --- a/node_modules/grunt-contrib-copy/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_install: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/AUTHORS b/node_modules/grunt-contrib-copy/AUTHORS deleted file mode 100644 index fdde680..0000000 --- a/node_modules/grunt-contrib-copy/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Chris Talkington (http://christalkington.com/) -Tyler Kellen (http://goingslowly.com/) -Kyle Robinson Young (http://twitter.com/shamakry) -Nathan Bleigh (http://www.nathanbleigh.com) -Eric Clemmons (http://ericclemmons.github.com) \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/CHANGELOG b/node_modules/grunt-contrib-copy/CHANGELOG deleted file mode 100644 index ad096d1..0000000 --- a/node_modules/grunt-contrib-copy/CHANGELOG +++ /dev/null @@ -1,50 +0,0 @@ -v0.4.0: - date: 2013-03-26 - changes: - - Output summary by default ("Copied N files, created M folders"). Individual transaction output available via `--verbose`. -v0.4.0: - date: 2013-02-15 - changes: - - First official release for Grunt 0.4.0. -v0.4.0rc7: - date: 2013-01-23 - changes: - - Updating grunt/gruntplugin dependencies to rc7. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.4.0rc5: - date: 2013-01-14 - changes: - - Updating to work with grunt v0.4.0rc5. - - Conversion to grunt v0.4 conventions. - - Replace basePath with cwd. - - Empty directory support. -v0.3.2: - date: 2012-10-18 - changes: - - Pass copyOptions on single file copy. -v0.3.1: - date: 2012-10-12 - changes: - - Rename grunt-contrib-lib dep to grunt-lib-contrib. -v0.3.0: - date: 2012-09-24 - changes: - - General cleanup and consolidation. - - Global options depreciated. -v0.2.4: - date: 2012-09-18 - changes: - - No valid source check. -v0.2.3: - date: 2012-09-17 - changes: - - Path.sep fallback for node <= 0.7.9. -v0.2.2: - date: 2012-09-17 - changes: - - Single file copy support. - - Test refactoring. -v0.2.0: - date: 2012-09-07 - changes: - - Refactored from grunt-contrib into individual repo. diff --git a/node_modules/grunt-contrib-copy/CONTRIBUTING.md b/node_modules/grunt-contrib-copy/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-copy/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-copy/Gruntfile.js b/node_modules/grunt-contrib-copy/Gruntfile.js deleted file mode 100644 index 0657f60..0000000 --- a/node_modules/grunt-contrib-copy/Gruntfile.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * grunt-contrib-copy - * http://gruntjs.com/ - * - * Copyright (c) 2012 Chris Talkington, contributors - * Licensed under the MIT license. - */ - -module.exports = function(grunt) { - 'use strict'; - - // Make an empty dir for testing as git doesn't track empty folders. - grunt.file.mkdir('test/fixtures/empty_folder'); - grunt.file.mkdir('test/expected/copy_test_mix/empty_folder'); - - // Project configuration. - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'tasks/*.js', - '<%= nodeunit.tests %>' - ], - options: { - jshintrc: '.jshintrc' - } - }, - - // Before generating any new files, remove any previously-created files. - clean: { - test: ['tmp'] - }, - - test_vars: { - name: 'grunt-contrib-copy', - version: '0.1.0', - match: 'folder_one/*' - }, - - // Configuration to be run (and then tested). - copy: { - main: { - files: [ - {expand: true, cwd: 'test/fixtures', src: ['*.*'], dest: 'tmp/copy_test_files/'}, - {expand: true, cwd: 'test/fixtures', src: ['**'], dest: 'tmp/copy_test_mix/'}, - {expand: true, cwd: 'test/fixtures', src: ['<%= test_vars.match %>'], dest: 'tmp/copy_test_v<%= test_vars.version %>/'} - ] - }, - - flatten: { - files: [ - {expand: true, flatten: true, filter: 'isFile', src: ['test/fixtures/**'], dest: 'tmp/copy_test_flatten/'} - ] - }, - - single: { - files: [ - {src: ['test/fixtures/test.js'], dest: 'tmp/single.js'} - ] - }, - - verbose: { - files: [ - {expand: true, src: ['test/fixtures/**'], dest: 'tmp/copy_test_verbose/'} - ] - } - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'] - } - }); - - // Actually load this plugin's task(s). - grunt.loadTasks('tasks'); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - // 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', 'copy', 'nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['jshint', 'test', 'build-contrib']); -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/LICENSE-MIT b/node_modules/grunt-contrib-copy/LICENSE-MIT deleted file mode 100644 index 454a9e9..0000000 --- a/node_modules/grunt-contrib-copy/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 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/node_modules/grunt-contrib-copy/README.md b/node_modules/grunt-contrib-copy/README.md deleted file mode 100644 index 95120a4..0000000 --- a/node_modules/grunt-contrib-copy/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# grunt-contrib-copy [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-copy.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-copy) - -> Copy files and folders. - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-copy --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-copy'); -``` - -*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-copy/tree/grunt-0.3-stable).* - - - -## Copy task -_Run this task with the `grunt copy` command._ - -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. -### Options - -#### processContent -Type: `Function(content, srcpath)` - -This option is passed to `grunt.file.copy` as an advanced way to control the file contents that are copied. - -#### processContentExclude -Type: `String` - -This option is passed to `grunt.file.copy` as an advanced way to control which file contents are processed. - -### Usage Examples - -```js -copy: { - main: { - files: [ - {src: ['path/*'], dest: 'dest/', filter: 'isFile'}, // includes files in path - {src: ['path/**'], dest: 'dest/'}, // includes files in path and its subdirs - {expand: true, cwd: 'path/', src: ['**'], dest: 'dest/'}, // makes all src relative to cwd - {expand: true, flatten: true, src: ['path/**'], dest: 'dest/', filter: 'isFile'} // flattens results to a single level - ] - } -} -``` - - -## Release History - - * 2013-02-14   v0.4.0   First official release for Grunt 0.4.0. - * 2013-01-22   v0.4.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. - * 2013-01-13   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Conversion to grunt v0.4 conventions. Replace basePath with cwd. Empty directory support. - * 2012-10-17   v0.3.2   Pass copyOptions on single file copy. - * 2012-10-11   v0.3.1   Rename grunt-contrib-lib dep to grunt-lib-contrib. - * 2012-09-23   v0.3.0   General cleanup and consolidation. Global options depreciated. - * 2012-09-17   v0.2.4   No valid source check. - * 2012-09-16   v0.2.3   Path.sep fallback for node <= 0.7.9. - * 2012-09-16   v0.2.2   Single file copy support. Test refactoring. - * 2012-09-06   v0.2.0   Refactored from grunt-contrib into individual repo. - ---- - -Task submitted by [Chris Talkington](http://christalkington.com/) - -*This file was generated on Fri Feb 22 2013 09:26:58.* diff --git a/node_modules/grunt-contrib-copy/docs/copy-examples.md b/node_modules/grunt-contrib-copy/docs/copy-examples.md deleted file mode 100644 index bc23c8b..0000000 --- a/node_modules/grunt-contrib-copy/docs/copy-examples.md +++ /dev/null @@ -1,14 +0,0 @@ -# Usage Examples - -```js -copy: { - main: { - files: [ - {src: ['path/*'], dest: 'dest/', filter: 'isFile'}, // includes files in path - {src: ['path/**'], dest: 'dest/'}, // includes files in path and its subdirs - {expand: true, cwd: 'path/', src: ['**'], dest: 'dest/'}, // makes all src relative to cwd - {expand: true, flatten: true, src: ['path/**'], dest: 'dest/', filter: 'isFile'} // flattens results to a single level - ] - } -} -``` diff --git a/node_modules/grunt-contrib-copy/docs/copy-options.md b/node_modules/grunt-contrib-copy/docs/copy-options.md deleted file mode 100644 index 9959154..0000000 --- a/node_modules/grunt-contrib-copy/docs/copy-options.md +++ /dev/null @@ -1,11 +0,0 @@ -# Options - -## processContent -Type: `Function(content, srcpath)` - -This option is passed to `grunt.file.copy` as an advanced way to control the file contents that are copied. - -## processContentExclude -Type: `String` - -This option is passed to `grunt.file.copy` as an advanced way to control which file contents are processed. diff --git a/node_modules/grunt-contrib-copy/docs/copy-overview.md b/node_modules/grunt-contrib-copy/docs/copy-overview.md deleted file mode 100644 index f0c452b..0000000 --- a/node_modules/grunt-contrib-copy/docs/copy-overview.md +++ /dev/null @@ -1 +0,0 @@ -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/docs/overview.md b/node_modules/grunt-contrib-copy/docs/overview.md deleted file mode 100644 index 707b19e..0000000 --- a/node_modules/grunt-contrib-copy/docs/overview.md +++ /dev/null @@ -1 +0,0 @@ -*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-copy/tree/grunt-0.3-stable).* diff --git a/node_modules/grunt-contrib-copy/package.json b/node_modules/grunt-contrib-copy/package.json deleted file mode 100644 index a243998..0000000 --- a/node_modules/grunt-contrib-copy/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "grunt-contrib-copy", - "description": "Copy files and folders.", - "version": "0.4.1", - "homepage": "https://github.com/gruntjs/grunt-contrib-copy", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-copy.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-copy/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-copy/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.2.0", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-clean": "~0.4.0", - "grunt-contrib-internal": "~0.4.2", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin" - ], - "contributors": [ - { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com/" - }, - { - "name": "Kyle Robinson Young", - "url": "http://twitter.com/shamakry" - }, - { - "name": "Nathan Bleigh", - "url": "http://www.nathanbleigh.com" - }, - { - "name": "Eric Clemmons", - "url": "http://ericclemmons.github.com" - } - ], - "readme": "# grunt-contrib-copy [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-copy.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-copy)\n\n> Copy files and folders.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-copy --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-contrib-copy');\n```\n\n*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-copy/tree/grunt-0.3-stable).*\n\n\n\n## Copy task\n_Run this task with the `grunt copy` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n### Options\n\n#### processContent\nType: `Function(content, srcpath)`\n\nThis option is passed to `grunt.file.copy` as an advanced way to control the file contents that are copied.\n\n#### processContentExclude\nType: `String`\n\nThis option is passed to `grunt.file.copy` as an advanced way to control which file contents are processed.\n\n### Usage Examples\n\n```js\ncopy: {\n main: {\n files: [\n {src: ['path/*'], dest: 'dest/', filter: 'isFile'}, // includes files in path\n {src: ['path/**'], dest: 'dest/'}, // includes files in path and its subdirs\n {expand: true, cwd: 'path/', src: ['**'], dest: 'dest/'}, // makes all src relative to cwd\n {expand: true, flatten: true, src: ['path/**'], dest: 'dest/', filter: 'isFile'} // flattens results to a single level\n ]\n }\n}\n```\n\n\n## Release History\n\n * 2013-02-14   v0.4.0   First official release for Grunt 0.4.0.\n * 2013-01-22   v0.4.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-13   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Conversion to grunt v0.4 conventions. Replace basePath with cwd. Empty directory support.\n * 2012-10-17   v0.3.2   Pass copyOptions on single file copy.\n * 2012-10-11   v0.3.1   Rename grunt-contrib-lib dep to grunt-lib-contrib.\n * 2012-09-23   v0.3.0   General cleanup and consolidation. Global options depreciated.\n * 2012-09-17   v0.2.4   No valid source check.\n * 2012-09-16   v0.2.3   Path.sep fallback for node <= 0.7.9.\n * 2012-09-16   v0.2.2   Single file copy support. Test refactoring.\n * 2012-09-06   v0.2.0   Refactored from grunt-contrib into individual repo.\n\n---\n\nTask submitted by [Chris Talkington](http://christalkington.com/)\n\n*This file was generated on Fri Feb 22 2013 09:26:58.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-copy@0.4.1", - "_from": "grunt-contrib-copy@~0.4.1" -} diff --git a/node_modules/grunt-contrib-copy/tasks/copy.js b/node_modules/grunt-contrib-copy/tasks/copy.js deleted file mode 100644 index 46b83ea..0000000 --- a/node_modules/grunt-contrib-copy/tasks/copy.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * grunt-contrib-copy - * http://gruntjs.com/ - * - * Copyright (c) 2012 Chris Talkington, contributors - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt-contrib-copy/blob/master/LICENSE-MIT - */ - -module.exports = function(grunt) { - 'use strict'; - - var path = require('path'); - - grunt.registerMultiTask('copy', 'Copy files.', function() { - var kindOf = grunt.util.kindOf; - - var options = this.options({ - processContent: false, - processContentExclude: [] - }); - - var copyOptions = { - process: options.processContent, - noProcess: options.processContentExclude - }; - - grunt.verbose.writeflags(options, 'Options'); - - var dest; - var isExpandedPair; - var tally = { - dirs: 0, - files: 0 - }; - - this.files.forEach(function(filePair) { - isExpandedPair = filePair.orig.expand || false; - - filePair.src.forEach(function(src) { - if (detectDestType(filePair.dest) === 'directory') { - dest = (isExpandedPair) ? filePair.dest : unixifyPath(path.join(filePair.dest, src)); - } else { - dest = filePair.dest; - } - - if (grunt.file.isDir(src)) { - grunt.verbose.writeln('Creating ' + dest.cyan); - grunt.file.mkdir(dest); - tally.dirs++; - } else { - grunt.verbose.writeln('Copying ' + src.cyan + ' -> ' + dest.cyan); - grunt.file.copy(src, dest, copyOptions); - tally.files++; - } - }); - }); - - if (tally.dirs) { - grunt.log.write('Created ' + tally.dirs.toString().cyan + ' directories'); - } - - if (tally.files) { - grunt.log.write((tally.dirs ? ', copied ' : 'Copied ') + tally.files.toString().cyan + ' files'); - } - - grunt.log.writeln(); - }); - - var detectDestType = function(dest) { - if (grunt.util._.endsWith(dest, '/')) { - return 'directory'; - } else { - return 'file'; - } - }; - - var unixifyPath = function(filepath) { - if (process.platform === 'win32') { - return filepath.replace(/\\/g, '/'); - } else { - return filepath; - } - }; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/copy_test.js b/node_modules/grunt-contrib-copy/test/copy_test.js deleted file mode 100644 index 17923d5..0000000 --- a/node_modules/grunt-contrib-copy/test/copy_test.js +++ /dev/null @@ -1,48 +0,0 @@ -var grunt = require('grunt'); -var fs = require('fs'); - -exports.copy = { - main: function(test) { - 'use strict'; - - test.expect(3); - - var actual = fs.readdirSync('tmp/copy_test_files').sort(); - var expected = fs.readdirSync('test/expected/copy_test_files').sort(); - test.deepEqual(expected, actual, 'should copy several files'); - - actual = fs.readdirSync('tmp/copy_test_mix').sort(); - expected = fs.readdirSync('test/expected/copy_test_mix').sort(); - test.deepEqual(expected, actual, 'should copy a mix of folders and files'); - - actual = fs.readdirSync('tmp/copy_test_v0.1.0').sort(); - expected = fs.readdirSync('test/expected/copy_test_v0.1.0').sort(); - test.deepEqual(expected, actual, 'should parse both dest and src templates'); - - test.done(); - }, - - flatten: function(test) { - 'use strict'; - - test.expect(1); - - var actual = fs.readdirSync('tmp/copy_test_flatten').sort(); - var expected = fs.readdirSync('test/expected/copy_test_flatten').sort(); - test.deepEqual(expected, actual, 'should create a flat structure'); - - test.done(); - }, - - single: function(test) { - 'use strict'; - - test.expect(1); - - var actual = grunt.file.read('tmp/single.js'); - var expected = grunt.file.read('test/expected/single.js'); - test.equal(expected, actual, 'should allow for single file copy'); - - test.done(); - } -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_files/test.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_files/test.js deleted file mode 100644 index 68bec77..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_files/test.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_files/test2.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_files/test2.js deleted file mode 100644 index ea17b22..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_files/test2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('hello'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/one.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/one.js deleted file mode 100644 index de4091e..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/one.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){$.noConflict();}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/test.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/test.js deleted file mode 100644 index 68bec77..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/test.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/test2.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/test2.js deleted file mode 100644 index ea17b22..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/test2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('hello'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/two.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/two.js deleted file mode 100644 index 57ec08e..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_flatten/two.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){jQuery}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/folder_one/one.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/folder_one/one.js deleted file mode 100644 index de4091e..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/folder_one/one.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){$.noConflict();}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/folder_two/two.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/folder_two/two.js deleted file mode 100644 index 57ec08e..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/folder_two/two.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){jQuery}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/test.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/test.js deleted file mode 100644 index 68bec77..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/test.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/test2.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/test2.js deleted file mode 100644 index ea17b22..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_mix/test2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('hello'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/copy_test_v0.1.0/folder_one/one.js b/node_modules/grunt-contrib-copy/test/expected/copy_test_v0.1.0/folder_one/one.js deleted file mode 100644 index de4091e..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/copy_test_v0.1.0/folder_one/one.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){$.noConflict();}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/expected/single.js b/node_modules/grunt-contrib-copy/test/expected/single.js deleted file mode 100644 index 68bec77..0000000 --- a/node_modules/grunt-contrib-copy/test/expected/single.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/fixtures/.hidden b/node_modules/grunt-contrib-copy/test/fixtures/.hidden deleted file mode 100644 index a112b59..0000000 --- a/node_modules/grunt-contrib-copy/test/fixtures/.hidden +++ /dev/null @@ -1 +0,0 @@ -#This is a hidden file!!! \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/fixtures/folder_one/one.js b/node_modules/grunt-contrib-copy/test/fixtures/folder_one/one.js deleted file mode 100644 index de4091e..0000000 --- a/node_modules/grunt-contrib-copy/test/fixtures/folder_one/one.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){$.noConflict();}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/fixtures/folder_two/two.js b/node_modules/grunt-contrib-copy/test/fixtures/folder_two/two.js deleted file mode 100644 index 57ec08e..0000000 --- a/node_modules/grunt-contrib-copy/test/fixtures/folder_two/two.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){jQuery}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/fixtures/test.js b/node_modules/grunt-contrib-copy/test/fixtures/test.js deleted file mode 100644 index 68bec77..0000000 --- a/node_modules/grunt-contrib-copy/test/fixtures/test.js +++ /dev/null @@ -1 +0,0 @@ -$(document).ready(function(){}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-copy/test/fixtures/test2.js b/node_modules/grunt-contrib-copy/test/fixtures/test2.js deleted file mode 100644 index ea17b22..0000000 --- a/node_modules/grunt-contrib-copy/test/fixtures/test2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('hello'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/.jshintrc b/node_modules/grunt-contrib-cssmin/.jshintrc deleted file mode 100644 index e0cc7bb..0000000 --- a/node_modules/grunt-contrib-cssmin/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/node_modules/grunt-contrib-cssmin/.npmignore b/node_modules/grunt-contrib-cssmin/.npmignore deleted file mode 100644 index 5cb6bfd..0000000 --- a/node_modules/grunt-contrib-cssmin/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/.travis.yml b/node_modules/grunt-contrib-cssmin/.travis.yml deleted file mode 100644 index 5766191..0000000 --- a/node_modules/grunt-contrib-cssmin/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/AUTHORS b/node_modules/grunt-contrib-cssmin/AUTHORS deleted file mode 100644 index 1687ec4..0000000 --- a/node_modules/grunt-contrib-cssmin/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -Tim Branyen (http://goingslowly.com/) -Chris Talkington (http://christalkington.com/) -Thomas Boyt (http://www.thomasboyt.com/) -Liam Kaufman (http://liamkaufman.com/) -Jörn Zaefferer (http://bassistance.de) -Braden Anderson (http://google.com/profiles/bluej100) \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/CHANGELOG b/node_modules/grunt-contrib-cssmin/CHANGELOG deleted file mode 100644 index 2fb867e..0000000 --- a/node_modules/grunt-contrib-cssmin/CHANGELOG +++ /dev/null @@ -1,55 +0,0 @@ -v0.6.2: - date: 2013-09-14 - changes: - - Support relative URLs via clean-css ~1.1.1. -v0.6.1: - date: 2013-05-25 - changes: - - Support import in-lining vis clean-css ~1.0.4. -v0.6.0: - date: 2013-04-05 - changes: - - Update clean-css dependency to ~1.0.0 -v0.5.0: - date: 2013-03-14 - changes: - - Support for 'report' option (false by default) -v0.4.2: - date: 2013-03-10 - changes: - - Add banner option - - Support clean-css keepSpecialComments -v0.4.1: - date: 2013-02-17 - changes: - - Update clean-css dependency to ~0.10.0 -v0.4.0: - date: 2013-02-15 - changes: - - First official release for Grunt 0.4.0. -v0.4.0rc7: - date: 2013-01-23 - changes: - - Updating grunt/gruntplugin dependencies to rc7. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.4.0rc5: - date: 2013-01-09 - changes: - - Updating to work with grunt v0.4.0rc5. - - Switching to this.files api. -v0.3.2: - date: 2012-11-01 - changes: - - Update clean-css dep. -v0.3.1: - date: 2012-10-12 - changes: - - Rename grunt-contrib-lib dep to grunt-lib-contrib. -v0.3.0: - date: 2012-09-23 - changes: - - Options no longer accepted from global config key. -v0.2.0: - date: 2012-09-10 - changes: - - Refactored from grunt-contrib into individual repo. diff --git a/node_modules/grunt-contrib-cssmin/CONTRIBUTING.md b/node_modules/grunt-contrib-cssmin/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-cssmin/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-cssmin/Gruntfile.js b/node_modules/grunt-contrib-cssmin/Gruntfile.js deleted file mode 100644 index b3a56d8..0000000 --- a/node_modules/grunt-contrib-cssmin/Gruntfile.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * grunt-contrib-cssmin - * http://gruntjs.com/ - * - * Copyright (c) 2012 Tim Branyen, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'tasks/*.js', - '<%= nodeunit.tests %>' - ], - options: { - jshintrc: '.jshintrc' - } - }, - // Before generating any new files, remove any previously-created files. - clean: { - test: ['tmp'] - }, - - // Configuration to be run (and then tested). - cssmin: { - compress: { - files: { - 'tmp/style.css': ['test/fixtures/input_one.css', 'test/fixtures/input_two.css'] - } - }, - empty: { - files: { - 'tmp/idontexist.css': ['test/fixtures/idontexist.css'] - } - }, - with_banner: { - options: { - banner: '/* module name - my awesome css banner */' - }, - files: { - 'tmp/with-banner.css': ['test/fixtures/input_one.css', 'test/fixtures/input_two.css'] - } - }, - remove_first_comment: { - options: { - banner: '/* custom banner */', - keepSpecialComments: 0 - }, - files: { - 'tmp/remove_first_comment.css': ['test/fixtures/input_bannered.css'] - } - }, - inline_import: { - files: { - 'tmp/inline_import.css': ['test/fixtures/input_inline_import.css', 'test/fixtures/inner/input_inline_import.css'] - } - } - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'] - } - }); - - // Actually load this plugin's task(s). - grunt.loadTasks('tasks'); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - // 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', 'cssmin', 'nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['jshint', 'test', 'build-contrib']); - -}; diff --git a/node_modules/grunt-contrib-cssmin/LICENSE-MIT b/node_modules/grunt-contrib-cssmin/LICENSE-MIT deleted file mode 100644 index 6fc67a4..0000000 --- a/node_modules/grunt-contrib-cssmin/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Tim Branyen, 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/node_modules/grunt-contrib-cssmin/README.md b/node_modules/grunt-contrib-cssmin/README.md deleted file mode 100644 index 23fb9c1..0000000 --- a/node_modules/grunt-contrib-cssmin/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# grunt-contrib-cssmin [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-cssmin.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-cssmin) - -> Compress CSS files. - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-cssmin --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-cssmin'); -``` - -*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-cssmin/tree/grunt-0.3-stable).* - - - -## Cssmin task -_Run this task with the `grunt cssmin` command._ - -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. - -Files are compressed with [clean-css](https://github.com/GoalSmashers/clean-css). -### Options - -#### banner - -Type: `String` -Default: `null` - -Prefix the compressed source with the given banner, with a linebreak inbetween. - -#### keepSpecialComments - -Type: `String` `Number` -Default: `'*'` - -To keep or remove special comments, exposing the underlying option from [clean-css](https://github.com/GoalSmashers/clean-css).. `'*'` for keeping all (default), `1` for keeping first one, `0` for removing all. - -#### report -Choices: `false`, `'min'`, `'gzip'` -Default: `false` - -Either do not report anything, report only minification result, or report minification and gzip results. -This is useful to see exactly how well clean-css is performing but using `'gzip'` will make the task take 5-10x longer to complete. - -Example ouput using `'gzip'`: - -``` -Original: 198444 bytes. -Minified: 101615 bytes. -Gzipped: 20084 bytes. -``` -### Usage Examples - -#### Combine two files into one output file - -```js -cssmin: { - combine: { - files: { - 'path/to/output.css': ['path/to/input_one.css', 'path/to/input_two.css'] - } - } -} -``` - -#### Add a banner -```js -cssmin: { - add_banner: { - options: { - banner: '/* My minified css file */' - }, - files: { - 'path/to/output.css': ['path/to/**/*.css'] - } - } -} -``` - -#### Minify all contents of a release directory and add a `.min.css` extension -```js -cssmin: { - minify: { - expand: true, - cwd: 'release/css/', - src: ['*.css', '!*.min.css'], - dest: 'release/css/', - ext: '.min.css' - } -} -``` - - -## Release History - - * 2013-05-25   v0.6.1   Support import in-lining vis clean-css ~1.0.4. - * 2013-04-05   v0.6.0   Update clean-css dependency to ~1.0.0 - * 2013-03-14   v0.5.0   Support for 'report' option (false by default) - * 2013-03-10   v0.4.2   Add banner option Support clean-css keepSpecialComments - * 2013-02-17   v0.4.1   Update clean-css dependency to ~0.10.0 - * 2013-02-15   v0.4.0   First official release for Grunt 0.4.0. - * 2013-01-23   v0.4.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. - * 2013-01-09   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Switching to this.files api. - * 2012-11-01   v0.3.2   Update clean-css dep. - * 2012-10-12   v0.3.1   Rename grunt-contrib-lib dep to grunt-lib-contrib. - * 2012-09-23   v0.3.0   Options no longer accepted from global config key. - * 2012-09-10   v0.2.0   Refactored from grunt-contrib into individual repo. - ---- - -Task submitted by [Tim Branyen](http://goingslowly.com/) - -*This file was generated on Sat May 25 2013 18:52:13.* diff --git a/node_modules/grunt-contrib-cssmin/docs/cssmin-examples.md b/node_modules/grunt-contrib-cssmin/docs/cssmin-examples.md deleted file mode 100644 index 8fc4104..0000000 --- a/node_modules/grunt-contrib-cssmin/docs/cssmin-examples.md +++ /dev/null @@ -1,40 +0,0 @@ -# Usage Examples - -## Combine two files into one output file - -```js -cssmin: { - combine: { - files: { - 'path/to/output.css': ['path/to/input_one.css', 'path/to/input_two.css'] - } - } -} -``` - -## Add a banner -```js -cssmin: { - add_banner: { - options: { - banner: '/* My minified css file */' - }, - files: { - 'path/to/output.css': ['path/to/**/*.css'] - } - } -} -``` - -## Minify all contents of a release directory and add a `.min.css` extension -```js -cssmin: { - minify: { - expand: true, - cwd: 'release/css/', - src: ['*.css', '!*.min.css'], - dest: 'release/css/', - ext: '.min.css' - } -} -``` diff --git a/node_modules/grunt-contrib-cssmin/docs/cssmin-options.md b/node_modules/grunt-contrib-cssmin/docs/cssmin-options.md deleted file mode 100644 index 0c8e4de..0000000 --- a/node_modules/grunt-contrib-cssmin/docs/cssmin-options.md +++ /dev/null @@ -1,30 +0,0 @@ -# Options - -## banner - -Type: `String` -Default: `null` - -Prefix the compressed source with the given banner, with a linebreak inbetween. - -## keepSpecialComments - -Type: `String` `Number` -Default: `'*'` - -To keep or remove special comments, exposing the underlying option from [clean-css](https://github.com/GoalSmashers/clean-css).. `'*'` for keeping all (default), `1` for keeping first one, `0` for removing all. - -## report -Choices: `false`, `'min'`, `'gzip'` -Default: `false` - -Either do not report anything, report only minification result, or report minification and gzip results. -This is useful to see exactly how well clean-css is performing but using `'gzip'` will make the task take 5-10x longer to complete. - -Example ouput using `'gzip'`: - -``` -Original: 198444 bytes. -Minified: 101615 bytes. -Gzipped: 20084 bytes. -``` \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/docs/cssmin-overview.md b/node_modules/grunt-contrib-cssmin/docs/cssmin-overview.md deleted file mode 100644 index 38645da..0000000 --- a/node_modules/grunt-contrib-cssmin/docs/cssmin-overview.md +++ /dev/null @@ -1,3 +0,0 @@ -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. - -Files are compressed with [clean-css](https://github.com/GoalSmashers/clean-css). \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/docs/overview.md b/node_modules/grunt-contrib-cssmin/docs/overview.md deleted file mode 100644 index 19ab77e..0000000 --- a/node_modules/grunt-contrib-cssmin/docs/overview.md +++ /dev/null @@ -1 +0,0 @@ -*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-cssmin/tree/grunt-0.3-stable).* diff --git a/node_modules/grunt-contrib-cssmin/node_modules/.bin/cleancss b/node_modules/grunt-contrib-cssmin/node_modules/.bin/cleancss deleted file mode 120000 index 2a3439e..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/.bin/cleancss +++ /dev/null @@ -1 +0,0 @@ -../clean-css/bin/cleancss \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/History.md b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/History.md deleted file mode 100644 index bb0c935..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/History.md +++ /dev/null @@ -1,291 +0,0 @@ -1.1.3 / 2013-10-04 -================== - -* Fixed issue [#150](https://github.com/GoalSmashers/clean-css/issues/150) - minifying background:none. - -1.1.2 / 2013-09-29 -================== - -* Fixed issue [#149](https://github.com/GoalSmashers/clean-css/issues/149) - shorthand font property. - -1.1.1 / 2013-09-07 -================== - -* Fixed issue [#144](https://github.com/GoalSmashers/clean-css/issues/144) - skip URLs rebasing by default. - -1.1.0 / 2013-09-06 -================== - -* Fixed issue [#43](https://github.com/GoalSmashers/clean-css/issues/43) - `--debug` switch for minification stats. -* Fixed issue [#65](https://github.com/GoalSmashers/clean-css/issues/65) - full color name / hex shortening. -* Fixed issue [#84](https://github.com/GoalSmashers/clean-css/issues/84) - support for `@import` with media queries. -* Fixed issue [#124](https://github.com/GoalSmashers/clean-css/issues/124) - raise error on broken imports. -* Fixed issue [#126](https://github.com/GoalSmashers/clean-css/issues/126) - proper CSS expressions handling. -* Fixed issue [#129](https://github.com/GoalSmashers/clean-css/issues/129) - rebasing imported URLs. -* Fixed issue [#130](https://github.com/GoalSmashers/clean-css/issues/130) - better code modularity. -* Fixed issue [#135](https://github.com/GoalSmashers/clean-css/issues/135) - require node.js 0.8+. -* Renamed lib's `debug` option to `benchmark` when doing per-minification benchmarking. -* Added simplified comments processing & imports. - -1.0.12 / 2013-07-19 -=================== - -* Fixed issue [#121](https://github.com/GoalSmashers/clean-css/issues/121) - ability to skip `@import` processing. - -1.0.11 / 2013-07-08 -=================== - -* Fixed issue [#117](https://github.com/GoalSmashers/clean-css/issues/117) - line break escaping in comments. - -1.0.10 / 2013-06-13 -=================== - -* Fixed issue [#114](https://github.com/GoalSmashers/clean-css/issues/114) - comments in imported stylesheets. - -1.0.9 / 2013-06-11 -================== - -* Fixed issue [#113](https://github.com/GoalSmashers/clean-css/issues/113) - `@import` in comments. - -1.0.8 / 2013-06-10 -================== - -* Fixed issue [#112](https://github.com/GoalSmashers/clean-css/issues/112) - reducing `box-shadow` zeros. - -1.0.7 / 2013-06-05 -================== - -* Support for `@import` URLs starting with `//`. - By [@petetak](https://github.com/petetak). - -1.0.6 / 2013-06-04 -================== - -* Fixed issue [#110](https://github.com/GoalSmashers/clean-css/issues/110) - data URIs in URLs. - -1.0.5 / 2013-05-26 -================== - -* Fixed issue [#107](https://github.com/GoalSmashers/clean-css/issues/107) - data URIs in imported stylesheets. - -1.0.4 / 2013-05-23 -================== - -* Rewrite relative URLs in imported stylesheets. - By [@bluej100](https://github.com/bluej100). - -1.0.3 / 2013-05-20 -================== - -* Support alternative `@import` syntax with file name not wrapped inside `url()` statement. - By [@bluej100](https://github.com/bluej100). - -1.0.2 / 2013-04-29 -================== - -* Fixed issue [#97](https://github.com/GoalSmashers/clean-css/issues/97) - `--remove-empty` & FontAwesome. - -1.0.1 / 2013-04-08 -================== - -* Do not pick up `bench` and `test` while building `npm` package. - By [@sindresorhus](https://https://github.com/sindresorhus). - -1.0.0 / 2013-03-30 -================== - -* Fixed issue [#2](https://github.com/GoalSmashers/clean-css/issues/2) - resolving `@import` rules. -* Fixed issue [#44](https://github.com/GoalSmashers/clean-css/issues/44) - examples in `--help`. -* Fixed issue [#46](https://github.com/GoalSmashers/clean-css/issues/46) - preserving special characters in URLs and attributes. -* Fixed issue [#80](https://github.com/GoalSmashers/clean-css/issues/80) - quotation in multi line strings. -* Fixed issue [#83](https://github.com/GoalSmashers/clean-css/issues/83) - HSL to hex color conversions. -* Fixed issue [#86](https://github.com/GoalSmashers/clean-css/issues/86) - broken `@charset` replacing. -* Fixed issue [#88](https://github.com/GoalSmashers/clean-css/issues/88) - removes space in `! important`. -* Fixed issue [#92](https://github.com/GoalSmashers/clean-css/issues/92) - uppercase hex to short versions. - -0.10.2 / 2013-03-19 -=================== - -* Fixed issue [#79](https://github.com/GoalSmashers/clean-css/issues/79) - node.js 0.10.x compatibility. - -0.10.1 / 2013-02-14 -=================== - -* Fixed issue [#66](https://github.com/GoalSmashers/clean-css/issues/66) - line breaks without extra spaces should - be handled correctly. - -0.10.0 / 2013-02-09 -=================== - -* Switched from [optimist](https://github.com/substack/node-optimist) to - [commander](https://github.com/visionmedia/commander.js) for CLI processing. -* Changed long options from `--removeempty` to `--remove-empty` and from `--keeplinebreaks` to `--keep-line-breaks`. -* Fixed issue [#47](https://github.com/GoalSmashers/clean-css/issues/47) - commandline issues on Windows. -* Fixed issue [#49](https://github.com/GoalSmashers/clean-css/issues/49) - remove empty selectors from media query. -* Fixed issue [#52](https://github.com/GoalSmashers/clean-css/issues/52) - strip fraction zeros if not needed. -* Fixed issue [#58](https://github.com/GoalSmashers/clean-css/issues/58) - remove colon where possible. -* Fixed issue [#59](https://github.com/GoalSmashers/clean-css/issues/59) - content property handling. -* Fixed performance issue with replacing multiple `@charset` declarations and issue - with line break after `@charset` when using `keepLineBreaks` option. By [@rrjaime](https://github.com/rrjamie). -* Removed Makefile in favor to `npm run` commands (e.g. `make check` -> `npm run check`). - -0.9.1 / 2012-12-19 -================== - -* Fixed issue [#37](https://github.com/GoalSmashers/clean-css/issues/37) - converting - `white` and other colors in class names (reported by [@malgorithms](https://github.com/malgorithms)). - -0.9.0 / 2012-12-15 -================== - -* Added stripping quotation from font names (if possible). -* Added stripping quotation from `@keyframes` declaration, `animation` and - `animation-name` property. -* Added stripping quotations from attributes' value (e.g. `[data-target='x']`). -* Added better hex->name and name->hex color shortening. -* Added `font: normal` and `font: bold` shortening the same way as `font-weight` is. -* Refactored shorthand selectors and added `border-radius`, `border-style` - and `border-color` shortening. -* Added `margin`, `padding` and `border-width` shortening. -* Added removing line break after commas. -* Fixed removing whitespace inside media query definition. -* Added removing line breaks after a comma, so all declarations are one-liners now. -* Speed optimizations (~10% despite many new features). -* Added [JSHint](https://github.com/jshint/jshint/) validation rules via `make check`. - -0.8.3 / 2012-11-29 -================== - -* Fixed HSL/HSLA colors processing. - -0.8.2 / 2012-10-31 -================== - -* Fixed shortening hex colors and their relation to hashes in URLs. -* Cleanup by [@XhmikosR](https://github.com/XhmikosR). - -0.8.1 / 2012-10-28 -================== - -* Added better zeros processing for `rect(...)` syntax (clip property). - -0.8.0 / 2012-10-21 -================== - -* Added removing URLs quotation if possible. -* Rewrote breaks processing. -* Added `keepBreaks`/`-b` option to keep line breaks in the minimized file. -* Reformatted [lib/clean.js](/lib/clean.js) so it's easier to follow the rules. -* Minimized test data is now minimized with line breaks so it's easier to - compare the changes line by line. - -0.7.0 / 2012-10-14 -================== - -* Added stripping special comments to CLI (`--s0` and `--s1` options). -* Added stripping special comments to programmatic interface - (`keepSpecialComments` option). - -0.6.0 / 2012-08-05 -================== - -* Full Windows support with tests (./test.bat). - -0.5.0 / 2012-08-02 -================== - -* Made path to vows local. -* Explicit node.js 0.6 requirement. - -0.4.2 / 2012-06-28 -================== - -* Updated binary `-v` option (version). -* Updated binary to output help when no options given (but not in piped mode). -* Added binary tests. - -0.4.1 / 2012-06-10 -================== - -* Fixed stateless mode where calling `CleanCSS#process` directly was giving - errors (reported by [@facelessuser](https://github.com/facelessuser)). - -0.4.0 / 2012-06-04 -================== - -* Speed improvements up to 4x thanks to the rewrite of comments and CSS' content - processing. -* Stripping empty CSS tags is now optional (see [bin/cleancss](/bin/cleancss) for details). -* Improved debugging mode (see [test/bench.js](/test/bench.js)) -* Added `make bench` for a one-pass benchmark. - -0.3.3 / 2012-05-27 -================== - -* Fixed tests, [package.json](/package.json) for development, and regex - for removing empty declarations (thanks to [@vvo](https://github.com/vvo)). - -0.3.2 / 2012-01-17 -================== - -* Fixed output method under node.js 0.6 which incorrectly tried to close - `process.stdout`. - -0.3.1 / 2011-12-16 -================== - -* Fixed cleaning up `0 0 0 0` expressions. - -0.3.0 / 2011-11-29 -================== - -* Clean-css requires node.js 0.4.0+ to run. -* Removed node.js's 0.2.x 'sys' package dependency - (thanks to [@jmalonzo](https://github.com/jmalonzo) for a patch). - -0.2.6 / 2011-11-27 -================== - -* Fixed expanding `+` signs in `calc()` when mixed up with adjacent `+` selector. - -0.2.5 / 2011-11-27 -================== - -* Fixed issue with cleaning up spaces inside `calc`/`-moz-calc` declarations - (thanks to [@cvan](https://github.com/cvan) for reporting it). -* Fixed converting `#f00` to `red` in borders and gradients. - -0.2.4 / 2011-05-25 -================== - -* Fixed problem with expanding `none` to `0` in partial/full background - declarations. -* Fixed including clean-css library from binary (global to local). - -0.2.3 / 2011-04-18 -================== - -* Fixed problem with optimizing IE filters. - -0.2.2 / 2011-04-17 -================== - -* Fixed problem with space before color in `border` property. - -0.2.1 / 2011-03-19 -================== - -* Added stripping space before `!important` keyword. -* Updated repository location and author information in [package.json](/package.json). - -0.2.0 / 2011-03-02 -================== - -* Added options parsing via optimist. -* Changed code inclusion (thus the version bump). - -0.1.0 / 2011-02-27 -================== - -* First version of clean-css library. -* Implemented all basic CSS transformations. diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/LICENSE b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/LICENSE deleted file mode 100644 index 1509aa3..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2011-2013 GoalSmashers.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/node_modules/grunt-contrib-cssmin/node_modules/clean-css/README.md b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/README.md deleted file mode 100644 index 6a97ccb..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/README.md +++ /dev/null @@ -1,150 +0,0 @@ -[![NPM version](https://badge.fury.io/js/clean-css.png)](https://badge.fury.io/js/clean-css) -[![Build Status](https://secure.travis-ci.org/GoalSmashers/clean-css.png)](https://travis-ci.org/GoalSmashers/clean-css) -[![Dependency Status](https://gemnasium.com/GoalSmashers/clean-css.png)](https://gemnasium.com/GoalSmashers/clean-css) - -## What is clean-css? - -Clean-css is a [node.js](http://nodejs.org/) library for minifying CSS files. -It does the same job as YUI Compressor's CSS minifier, but much faster thanks -to many speed optimizations and node.js' V8 engine. - - -## Usage - -### What are the requirements? - -``` -node.js 0.8.0+ (tested on CentOS, Ubuntu, OS X 10.6+, and Windows 7+) -``` - -### How to install clean-css? - -``` -npm install clean-css -``` - -### How to use clean-css CLI? - -Clean-css accepts the following command line arguments (please make sure -you use `` as the very last argument to avoid potential issues): - -``` -cleancss [options] - --h, --help Output usage information --v, --version Output the version number --e, --remove-empty Remove empty declarations, e.g. a{} --b, --keep-line-breaks Keep line breaks ---s0 Remove all special comments, i.e. /*! comment */ ---s1 Remove all special comments but the first one --r, --root [root-path] A root path to which resolve absolute @import rules and rebase relative URLs --o, --output [output-file] Use [output-file] as output instead of STDOUT --s, --skip-import Disable the @import processing --d, --debug Shows debug information (minification time & compression efficiency) -``` - -#### Examples: - -To minify a **public.css** file into **public-min.css** do: - -``` -cleancss -o public-min.css public.css -``` - -To minify the same **public.css** into the standard output skip the `-o` parameter: - -``` -cleancss public.css -``` - -More likely you would like to concatenate a couple of files. -If you are on a Unix-like system: - -```bash -cat one.css two.css three.css | cleancss -o merged-and-minified.css -``` - -On Windows: - -```bat -type one.css two.css three.css | cleancss -o merged-and-minified.css -``` - -Or even gzip the result at once: - -```bash -cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz -``` - -### How to use clean-css programmatically? - -```js -var cleanCSS = require('clean-css'); -var source = 'a{font-weight:bold;}'; -var minimized = cleanCSS.process(source); -``` - -Process method accepts a hash as a second parameter, i.e., -`cleanCSS.process(source, options)` with the following options available: - -* `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one, `0` for removing all -* `keepBreaks` - whether to keep line breaks (default is false) -* `removeEmpty` - whether to remove empty elements (default is false) -* `benchmark` - turns on benchmarking mode measuring time spent on cleaning up - (run `npm run bench` to see example) -* `root` - path to resolve absolute `@import` rules and rebase relative URLs -* `relativeTo` - path with which to resolve relative `@import` rules and URLs -* `processImport` - whether to process `@import` rules - -### What are the clean-css' dev commands? - -First clone the source, then run: - -* `npm run bench` for clean-css benchmarks (see [test/bench.js](https://github.com/GoalSmashers/clean-css/blob/master/test/bench.js) for details) -* `npm run check` to check JS sources with [JSHint](https://github.com/jshint/jshint/) -* `npm test` for the test suite - -## Tips & Tricks - -### How to preserve a comment block? - -Use the `/*!` notation instead of the standard one `/*`: - -```css -/*! - Important comments included in minified output. -*/ -``` - -### How to rebase relative image URLs - -Clean-css will handle it automatically for you (since version 1.1) in the following cases: - -* When using the CLI: - 1. Use an output path via `-o/--output` to rebase URLs as relative to the output file. - 2. Use a root path via `-r/--root` to rebase URLs as absolute from the given root path. - 3. If you specify both then `-r/--root` takes precendence. -* When using clean-css as a library: - 1. Use a combination of `relativeTo` and `target` options for relative rebase (same as 1 in CLI). - 2. Use a combination of `relativeTo` and `root` options for absolute rebase (same as 2 in CLI). - 3. `root` takes precendence over `target` as in CLI. - -## Acknowledgments - -* Vincent Voyer ([@vvo](https://github.com/vvo)) for a patch with better - empty element regex and for inspiring us to do many performance improvements - in 0.4 release. -* Isaac ([@facelessuser](https://github.com/facelessuser)) for pointing out - a flaw in clean-css' stateless mode. -* Jan Michael Alonzo ([@jmalonzo](https://github.com/jmalonzo)) for a patch - removing node.js' old `sys` package. -* [@XhmikosR](https://github.com/XhmikosR) for suggesting new features - (option to remove special comments and strip out URLs quotation) and - pointing out numerous improvements (JSHint, media queries). -* Anthony Barre ([@abarre](https://github.com/abarre)) for improvements to - `@import` processing, namely introducing the `--skip-import` / - `processImport` options. - -## License - -Clean-css is released under the [MIT License](https://github.com/GoalSmashers/clean-css/blob/master/LICENSE). diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/bin/cleancss b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/bin/cleancss deleted file mode 100755 index 89521e4..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/bin/cleancss +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env node - -var util = require('util'); -var fs = require('fs'); -var path = require('path'); -var CleanCSS = require('../index'); - -var commands = require('commander'); - -var packageConfig = fs.readFileSync(path.join(path.dirname(fs.realpathSync(process.argv[1])), '../package.json')); -var buildVersion = JSON.parse(packageConfig).version; - -var isWindows = process.platform == 'win32'; - -// Specify commander options to parse command line params correctly -commands - .version(buildVersion, '-v, --version') - .usage('[options] ') - .option('-e, --remove-empty', 'Remove empty declarations, e.g. .a{}') - .option('-b, --keep-line-breaks', 'Keep line breaks') - .option('--s0', 'Remove all special comments, i.e. /*! comment */') - .option('--s1', 'Remove all special comments but the first one') - .option('-r, --root [root-path]', 'Set a root path to which resolve absolute @import rules') - .option('-o, --output [output-file]', 'Use [output-file] as output instead of STDOUT') - .option('-s, --skip-import', 'Disable the @import processing') - .option('-d, --debug', 'Shows debug information (minification time & compression efficiency)'); - -commands.on('--help', function() { - util.puts(' Examples:\n'); - util.puts(' %> cleancss one.css'); - util.puts(' %> cleancss -o one-min.css one.css'); - if (isWindows) { - util.puts(' %> type one.css two.css three.css | cleancss -o merged-and-minified.css'); - } else { - util.puts(' %> cat one.css two.css three.css | cleancss -o merged-and-minified.css'); - util.puts(' %> cat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz'); - } - util.puts(''); - process.exit(); -}); - -commands.parse(process.argv); - -var options = { - source: null, - target: null -}; -var cleanOptions = {}; -var fromStdin = !process.env['__DIRECT__'] && !process.stdin.isTTY; - -// If no sensible data passed in just print help and exit -if (!fromStdin && commands.args.length == 0) { - commands.outputHelp(); - return 0; -} - -// Now coerce commands into CleanCSS configuration... -if (commands.output) - cleanOptions.target = options.target = commands.output; -if (commands.removeEmpty) - cleanOptions.removeEmpty = true; -if (commands.keepLineBreaks) - cleanOptions.keepBreaks = true; -if (commands.s1) - cleanOptions.keepSpecialComments = 1; -if (commands.s0) - cleanOptions.keepSpecialComments = 0; -if (commands.root) - cleanOptions.root = commands.root; -if (commands.skipImport) - cleanOptions.processImport = false; -if (commands.debug) - options.debug = true; -if (commands.args.length > 0) { - var source = commands.args[0]; - options.source = source; - cleanOptions.relativeTo = path.dirname(path.resolve(source)); -} - -// ... and do the magic! -if (options.source) { - fs.readFile(options.source, 'utf8', function(error, data) { - if (error) - throw error; - output(minify(data)); - }); -} else { - var stdin = process.openStdin(); - stdin.setEncoding('utf-8'); - var data = ''; - stdin.on('data', function(chunk) { - data += chunk; - }); - stdin.on('end', function() { - output(minify(data)); - }); -} - -function minify(data) { - var minified; - - if (options.debug) { - var start = process.hrtime(); - minified = CleanCSS.process(data, cleanOptions); - var taken = process.hrtime(start); - - console.error('Minification time: %dms', ~~(taken[0] * 1e3 + taken[1] / 1e6)); - console.error('Compression efficiency: %d%', ~~((1 - minified.length / CleanCSS.originalSize) * 100)); - } else { - minified = CleanCSS.process(data, cleanOptions); - } - - return minified; -} - -function output(minified) { - if (options.target) - fs.writeFileSync(options.target, minified, 'utf8'); - else - process.stdout.write(minified); -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/index.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/index.js deleted file mode 100644 index d7b0503..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/clean'); diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/clean.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/clean.js deleted file mode 100644 index 8929233..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/clean.js +++ /dev/null @@ -1,285 +0,0 @@ -/** - * Clean-css - https://github.com/GoalSmashers/clean-css - * Released under the terms of MIT license - * - * Copyright (C) 2011-2013 GoalSmashers.com - */ - -var ColorShortener = require('./colors/shortener'); -var ColorHSLToHex = require('./colors/hsl-to-hex'); -var ColorRGBToHex = require('./colors/rgb-to-hex'); -var ColorLongToShortHex = require('./colors/long-to-short-hex'); - -var ShorthandNotations = require('./properties/shorthand-notations'); -var ImportInliner = require('./imports/inliner'); -var UrlRebase = require('./images/url-rebase'); - -var CommentsProcessor = require('./text/comments'); -var ExpressionsProcessor = require('./text/expressions'); -var FreeTextProcessor = require('./text/free'); -var UrlsProcessor = require('./text/urls'); - -var CleanCSS = { - process: function(data, options) { - var replace = function() { - if (typeof arguments[0] == 'function') - arguments[0](); - else - data = data.replace.apply(data, arguments); - }; - var lineBreak = process.platform == 'win32' ? '\r\n' : '\n'; - this.lineBreak = lineBreak; - - options = options || {}; - options.keepBreaks = options.keepBreaks || false; - - //active by default - if (options.processImport === undefined) - options.processImport = true; - - // replace function - if (options.benchmark) { - var originalReplace = replace; - replace = function(pattern, replacement) { - var name = typeof pattern == 'function' ? - /function (\w+)\(/.exec(pattern.toString())[1] : - pattern; - - var start = process.hrtime(); - originalReplace(pattern, replacement); - - var itTook = process.hrtime(start); - console.log('%d ms: ' + name, 1000 * itTook[0] + itTook[1] / 1000000.0); - }; - } - - var commentsProcessor = new CommentsProcessor( - 'keepSpecialComments' in options ? options.keepSpecialComments : '*', - options.keepBreaks, - lineBreak - ); - var expressionsProcessor = new ExpressionsProcessor(); - var freeTextProcessor = new FreeTextProcessor(); - var urlsProcessor = new UrlsProcessor(); - var importInliner = new ImportInliner(); - - if (options.processImport) { - // inline all imports - replace(function inlineImports() { - data = importInliner.process(data, { - root: options.root || process.cwd(), - relativeTo: options.relativeTo - }); - }); - } - - this.originalSize = data.length; - - replace(function escapeComments() { - data = commentsProcessor.escape(data); - }); - - // replace all escaped line breaks - replace(/\\(\r\n|\n)/mg, ''); - - // strip parentheses in urls if possible (no spaces inside) - replace(/url\((['"])([^\)]+)['"]\)/g, function(match, quote, url) { - if (url.match(/[ \t]/g) !== null || url.indexOf('data:') === 0) - return 'url(' + quote + url + quote + ')'; - else - return 'url(' + url + ')'; - }); - - // strip parentheses in animation & font names - replace(/(animation|animation\-name|font|font\-family):([^;}]+)/g, function(match, propertyName, fontDef) { - return propertyName + ':' + fontDef.replace(/['"]([\w\-]+)['"]/g, '$1'); - }); - - // strip parentheses in @keyframes - replace(/@(\-moz\-|\-o\-|\-webkit\-)?keyframes ([^{]+)/g, function(match, prefix, name) { - prefix = prefix || ''; - return '@' + prefix + 'keyframes ' + (name.indexOf(' ') > -1 ? name : name.replace(/['"]/g, '')); - }); - - // IE shorter filters, but only if single (IE 7 issue) - replace(/progid:DXImageTransform\.Microsoft\.(Alpha|Chroma)(\([^\)]+\))([;}'"])/g, function(match, filter, args, suffix) { - return filter.toLowerCase() + args + suffix; - }); - - replace(function escapeExpressions() { - data = expressionsProcessor.escape(data); - }); - - // strip parentheses in attribute values - replace(/\[([^\]]+)\]/g, function(match, content) { - var eqIndex = content.indexOf('='); - if (eqIndex < 0 && content.indexOf('\'') < 0 && content.indexOf('"') < 0) - return match; - - var key = content.substring(0, eqIndex); - var value = content.substring(eqIndex + 1, content.length); - - if (/^['"](?:[a-zA-Z][a-zA-Z\d\-_]+)['"]$/.test(value)) - return '[' + key + '=' + value.substring(1, value.length - 1) + ']'; - else - return match; - }); - - replace(function escapeFreeText() { - data = freeTextProcessor.escape(data); - }); - - replace(function escapeUrls() { - data = urlsProcessor.escape(data); - }); - - // line breaks - if (!options.keepBreaks) - replace(/[\r]?\n/g, ' '); - - // multiple whitespace - replace(/[\t ]+/g, ' '); - - // multiple semicolons (with optional whitespace) - replace(/;[ ]?;+/g, ';'); - - // multiple line breaks to one - replace(/ (?:\r\n|\n)/g, lineBreak); - replace(/(?:\r\n|\n)+/g, lineBreak); - - // remove spaces around selectors - replace(/ ([+~>]) /g, '$1'); - - // remove extra spaces inside content - replace(/([!\(\{\}:;=,\n]) /g, '$1'); - replace(/ ([!\)\{\};=,\n])/g, '$1'); - replace(/(?:\r\n|\n)\}/g, '}'); - replace(/([\{;,])(?:\r\n|\n)/g, '$1'); - replace(/ :([^\{\};]+)([;}])/g, ':$1$2'); - - // restore spaces inside IE filters (IE 7 issue) - replace(/progid:[^(]+\(([^\)]+)/g, function(match) { - return match.replace(/,/g, ', '); - }); - - // trailing semicolons - replace(/;\}/g, '}'); - - replace(function hsl2Hex() { - data = new ColorHSLToHex(data).process(); - }); - - replace(function rgb2Hex() { - data = new ColorRGBToHex(data).process(); - }); - - replace(function longToShortHex() { - data = new ColorLongToShortHex(data).process(); - }); - - replace(function shortenColors() { - data = new ColorShortener(data).process(); - }); - - // replace font weight with numerical value - replace(/(font\-weight|font):(normal|bold)([ ;\}!])(\w*)/g, function(match, property, weight, suffix, next) { - if (suffix == ' ' && next.length > 0 && !/[.\d]/.test(next)) - return match; - - if (weight == 'normal') - return property + ':400' + suffix + next; - else if (weight == 'bold') - return property + ':700' + suffix + next; - else - return match; - }); - - // zero + unit to zero - replace(/(\s|:|,)0(?:px|em|ex|cm|mm|in|pt|pc|%)/g, '$1' + '0'); - replace(/rect\(0(?:px|em|ex|cm|mm|in|pt|pc|%)/g, 'rect(0'); - - // fraction zeros removal - replace(/\.([1-9]*)0+(\D)/g, function(match, nonZeroPart, suffix) { - return (nonZeroPart ? '.' : '') + nonZeroPart + suffix; - }); - - // restore 0% in hsl/hsla - replace(/(hsl|hsla)\(([^\)]+)\)/g, function(match, colorFunction, colorDef) { - var tokens = colorDef.split(','); - if (tokens[1] == '0') - tokens[1] = '0%'; - if (tokens[2] == '0') - tokens[2] = '0%'; - return colorFunction + '(' + tokens.join(',') + ')'; - }); - - // none to 0 - replace(/(border|border-top|border-right|border-bottom|border-left|outline):none/g, '$1:0'); - - // background:none to background:0 0 - replace(/background:none([;}])/g, 'background:0 0$1'); - - // multiple zeros into one - replace(/box-shadow:0 0 0 0([^\.])/g, 'box-shadow:0 0$1'); - replace(/:0 0 0 0([^\.])/g, ':0$1'); - replace(/([: ,=\-])0\.(\d)/g, '$1.$2'); - - replace(function shorthandNotations() { - data = new ShorthandNotations(data).process(); - }); - - // restore rect(...) zeros syntax for 4 zeros - replace(/rect\(\s?0(\s|,)0[ ,]0[ ,]0\s?\)/g, 'rect(0$10$10$10)'); - - // remove universal selector when not needed (*#id, *.class etc) - replace(/\*([\.#:\[])/g, '$1'); - - // Restore spaces inside calc back - replace(/calc\([^\}]+\}/g, function(match) { - return match.replace(/\+/g, ' + '); - }); - - replace(function restoreUrls() { - data = urlsProcessor.restore(data); - }); - replace(function rebaseUrls() { - data = UrlRebase.process(data, options); - }); - replace(function restoreFreeText() { - data = freeTextProcessor.restore(data); - }); - replace(function restoreComments() { - data = commentsProcessor.restore(data); - }); - replace(function restoreExpressions() { - data = expressionsProcessor.restore(data); - }); - - // move first charset to the beginning - replace(function moveCharset() { - // get first charset in stylesheet - var match = data.match(/@charset [^;]+;/); - var firstCharset = match ? match[0] : null; - if (!firstCharset) - return; - - // reattach first charset and remove all subsequent - data = firstCharset + - (options.keepBreaks ? lineBreak : '') + - data.replace(new RegExp('@charset [^;]+;(' + lineBreak + ')?', 'g'), ''); - }); - - if (options.removeEmpty) { - // empty elements - replace(/[^\{\}]+\{\}/g, ''); - - // empty @media declarations - replace(/@media [^\{]+\{\}/g, ''); - } - - // trim spaces at beginning and end - return data.trim(); - } -}; - -module.exports = CleanCSS; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/hsl-to-hex.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/hsl-to-hex.js deleted file mode 100644 index 09a676a..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/hsl-to-hex.js +++ /dev/null @@ -1,50 +0,0 @@ -module.exports = function HSLToHex(data) { - // HSL to RGB converter. Both methods adapted from: - // http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript - var hslToRgb = function(h, s, l) { - var r, g, b; - - h = ~~h / 360; - s = ~~s / 100; - l = ~~l / 100; - - if (s === 0) { - r = g = b = l; // achromatic - } else { - var q = l < 0.5 ? - l * (1 + s) : - l + s - l * s; - var p = 2 * l - q; - r = hueToRgb(p, q, h + 1/3); - g = hueToRgb(p, q, h); - b = hueToRgb(p, q, h - 1/3); - } - - return [~~(r * 255), ~~(g * 255), ~~(b * 255)]; - }; - - var hueToRgb = function(p, q, t) { - if (t < 0) t += 1; - if (t > 1) t -= 1; - if (t < 1/6) return p + (q - p) * 6 * t; - if (t < 1/2) return q; - if (t < 2/3) return p + (q - p) * (2/3 - t) * 6; - return p; - }; - - return { - process: function() { - return data.replace(/hsl\((\d+),(\d+)%?,(\d+)%?\)/g, function(match, hue, saturation, lightness) { - var asRgb = hslToRgb(hue, saturation, lightness); - var redAsHex = asRgb[0].toString(16); - var greenAsHex = asRgb[1].toString(16); - var blueAsHex = asRgb[2].toString(16); - - return '#' + - ((redAsHex.length == 1 ? '0' : '') + redAsHex) + - ((greenAsHex.length == 1 ? '0' : '') + greenAsHex) + - ((blueAsHex.length == 1 ? '0' : '') + blueAsHex); - }); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/long-to-short-hex.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/long-to-short-hex.js deleted file mode 100644 index 87fa31b..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/long-to-short-hex.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = function LongToShortHex(data) { - return { - process: function() { - return data.replace(/([,: \(])#([0-9a-f]{6})/gi, function(match, prefix, color) { - if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5]) - return prefix + '#' + color[0] + color[2] + color[4]; - else - return prefix + '#' + color; - }); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/rgb-to-hex.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/rgb-to-hex.js deleted file mode 100644 index d235289..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/rgb-to-hex.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = function RGBToHex(data) { - return { - process: function() { - return data.replace(/rgb\((\d+),(\d+),(\d+)\)/g, function(match, red, green, blue) { - var redAsHex = parseInt(red, 10).toString(16); - var greenAsHex = parseInt(green, 10).toString(16); - var blueAsHex = parseInt(blue, 10).toString(16); - - return '#' + - ((redAsHex.length == 1 ? '0' : '') + redAsHex) + - ((greenAsHex.length == 1 ? '0' : '') + greenAsHex) + - ((blueAsHex.length == 1 ? '0' : '') + blueAsHex); - }); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/shortener.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/shortener.js deleted file mode 100644 index 7476f09..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/colors/shortener.js +++ /dev/null @@ -1,174 +0,0 @@ -module.exports = function Shortener(data) { - var COLORS = { - aliceblue: '#f0f8ff', - antiquewhite: '#faebd7', - aqua: '#0ff', - aquamarine: '#7fffd4', - azure: '#f0ffff', - beige: '#f5f5dc', - bisque: '#ffe4c4', - black: '#000', - blanchedalmond: '#ffebcd', - blue: '#00f', - blueviolet: '#8a2be2', - brown: '#a52a2a', - burlywood: '#deb887', - cadetblue: '#5f9ea0', - chartreuse: '#7fff00', - chocolate: '#d2691e', - coral: '#ff7f50', - cornflowerblue: '#6495ed', - cornsilk: '#fff8dc', - crimson: '#dc143c', - cyan: '#0ff', - darkblue: '#00008b', - darkcyan: '#008b8b', - darkgoldenrod: '#b8860b', - darkgray: '#a9a9a9', - darkgreen: '#006400', - darkkhaki: '#bdb76b', - darkmagenta: '#8b008b', - darkolivegreen: '#556b2f', - darkorange: '#ff8c00', - darkorchid: '#9932cc', - darkred: '#8b0000', - darksalmon: '#e9967a', - darkseagreen: '#8fbc8f', - darkslateblue: '#483d8b', - darkslategray: '#2f4f4f', - darkturquoise: '#00ced1', - darkviolet: '#9400d3', - deeppink: '#ff1493', - deepskyblue: '#00bfff', - dimgray: '#696969', - dodgerblue: '#1e90ff', - firebrick: '#b22222', - floralwhite: '#fffaf0', - forestgreen: '#228b22', - fuchsia: '#f0f', - gainsboro: '#dcdcdc', - ghostwhite: '#f8f8ff', - gold: '#ffd700', - goldenrod: '#daa520', - gray: '#808080', - green: '#008000', - greenyellow: '#adff2f', - honeydew: '#f0fff0', - hotpink: '#ff69b4', - indianred: '#cd5c5c', - indigo: '#4b0082', - ivory: '#fffff0', - khaki: '#f0e68c', - lavender: '#e6e6fa', - lavenderblush: '#fff0f5', - lawngreen: '#7cfc00', - lemonchiffon: '#fffacd', - lightblue: '#add8e6', - lightcoral: '#f08080', - lightcyan: '#e0ffff', - lightgoldenrodyellow: '#fafad2', - lightgray: '#d3d3d3', - lightgreen: '#90ee90', - lightpink: '#ffb6c1', - lightsalmon: '#ffa07a', - lightseagreen: '#20b2aa', - lightskyblue: '#87cefa', - lightslategray: '#778899', - lightsteelblue: '#b0c4de', - lightyellow: '#ffffe0', - lime: '#0f0', - limegreen: '#32cd32', - linen: '#faf0e6', - magenta: '#ff00ff', - maroon: '#800000', - mediumaquamarine: '#66cdaa', - mediumblue: '#0000cd', - mediumorchid: '#ba55d3', - mediumpurple: '#9370db', - mediumseagreen: '#3cb371', - mediumslateblue: '#7b68ee', - mediumspringgreen: '#00fa9a', - mediumturquoise: '#48d1cc', - mediumvioletred: '#c71585', - midnightblue: '#191970', - mintcream: '#f5fffa', - mistyrose: '#ffe4e1', - moccasin: '#ffe4b5', - navajowhite: '#ffdead', - navy: '#000080', - oldlace: '#fdf5e6', - olive: '#808000', - olivedrab: '#6b8e23', - orange: '#ffa500', - orangered: '#ff4500', - orchid: '#da70d6', - palegoldenrod: '#eee8aa', - palegreen: '#98fb98', - paleturquoise: '#afeeee', - palevioletred: '#db7093', - papayawhip: '#ffefd5', - peachpuff: '#ffdab9', - peru: '#cd853f', - pink: '#ffc0cb', - plum: '#dda0dd', - powderblue: '#b0e0e6', - purple: '#800080', - red: '#f00', - rosybrown: '#bc8f8f', - royalblue: '#4169e1', - saddlebrown: '#8b4513', - salmon: '#fa8072', - sandybrown: '#f4a460', - seagreen: '#2e8b57', - seashell: '#fff5ee', - sienna: '#a0522d', - silver: '#c0c0c0', - skyblue: '#87ceeb', - slateblue: '#6a5acd', - slategray: '#708090', - snow: '#fffafa', - springgreen: '#00ff7f', - steelblue: '#4682b4', - tan: '#d2b48c', - teal: '#008080', - thistle: '#d8bfd8', - tomato: '#ff6347', - turquoise: '#40e0d0', - violet: '#ee82ee', - wheat: '#f5deb3', - white: '#fff', - whitesmoke: '#f5f5f5', - yellow: '#ff0', - yellowgreen: '#9acd32' - }; - - var toHex = {}; - var toName = {}; - - for (var name in COLORS) { - var color = COLORS[name]; - if (name.length < color.length) - toName[color] = name; - else - toHex[name] = color; - } - - return { - toHex: toHex, - toName: toName, - - // replace color name with hex values if shorter (or the other way around) - process: function() { - [toHex, toName].forEach(function(conversion) { - var pattern = '(' + Object.keys(conversion).join('|') + ')'; - var colorSwitcher = function(match, prefix, colorValue, suffix) { - return prefix + conversion[colorValue.toLowerCase()] + suffix; - }; - data = data.replace(new RegExp('([ :,\\(])' + pattern + '([;\\}!\\) ])', 'ig'), colorSwitcher); - data = data.replace(new RegExp('(,)' + pattern + '(,)', 'ig'), colorSwitcher); - }); - - return data; - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/images/url-rebase.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/images/url-rebase.js deleted file mode 100644 index 78792dc..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/images/url-rebase.js +++ /dev/null @@ -1,27 +0,0 @@ -var path = require('path'); - -var UrlRewriter = require('./url-rewriter'); - -module.exports = { - process: function(data, options) { - var rebaseOpts = { - absolute: !!options.root, - relative: !options.root && !!options.target, - fromBase: options.relativeTo - }; - - if (!rebaseOpts.absolute && !rebaseOpts.relative) - return data; - - if (rebaseOpts.absolute) - rebaseOpts.toBase = path.resolve(options.root); - - if (rebaseOpts.relative) - rebaseOpts.toBase = path.resolve(path.dirname(options.target)); - - if (!rebaseOpts.fromBase || !rebaseOpts.toBase) - return data; - - return UrlRewriter.process(data, rebaseOpts); - } -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/images/url-rewriter.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/images/url-rewriter.js deleted file mode 100644 index b41056f..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/images/url-rewriter.js +++ /dev/null @@ -1,53 +0,0 @@ -var path = require('path'); - -module.exports = { - process: function(data, options) { - var tempData = []; - var nextStart = 0; - var nextEnd = 0; - var cursor = 0; - - for (; nextEnd < data.length; ) { - nextStart = data.indexOf('url(', nextEnd); - if (nextStart == -1) - break; - - nextEnd = data.indexOf(')', nextStart + 4); - if (nextEnd == -1) - break; - - tempData.push(data.substring(cursor, nextStart)); - var url = data.substring(nextStart + 4, nextEnd).replace(/['"]/g, ''); - tempData.push('url(' + this._rebased(url, options) + ')'); - cursor = nextEnd + 1; - } - - return tempData.length > 0 ? - tempData.join('') + data.substring(cursor, data.length) : - data; - }, - - _rebased: function(url, options) { - var specialUrl = url[0] == '/' || - url.substring(url.length - 4) == '.css' || - url.indexOf('data:') === 0 || - /^https?:\/\//.exec(url) !== null || - /__\w+__/.exec(url) !== null; - var rebased; - - if (specialUrl) - return url; - - if (options.absolute) { - rebased = path - .resolve(path.join(options.fromBase, url)) - .replace(options.toBase, ''); - } else { - rebased = path.relative(options.toBase, path.join(options.fromBase, url)); - } - - return process.platform == 'win32' ? - rebased.replace(/\\/g, '/') : - rebased; - } -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/imports/inliner.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/imports/inliner.js deleted file mode 100644 index 2a1ecd1..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/imports/inliner.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('fs'); -var path = require('path'); - -var UrlRewriter = require('../images/url-rewriter'); - -module.exports = function Inliner() { - var process = function(data, options) { - var tempData = []; - var nextStart = 0; - var nextEnd = 0; - var cursor = 0; - - options.relativeTo = options.relativeTo || options.root; - options._baseRelativeTo = options._baseRelativeTo || options.relativeTo; - options.visited = options.visited || []; - - for (; nextEnd < data.length; ) { - nextStart = data.indexOf('@import', cursor); - if (nextStart == -1) - break; - - nextEnd = data.indexOf(';', nextStart); - if (nextEnd == -1) - break; - - tempData.push(data.substring(cursor, nextStart)); - tempData.push(inlinedFile(data, nextStart, nextEnd, options)); - cursor = nextEnd + 1; - } - - return tempData.length > 0 ? - tempData.join('') + data.substring(cursor, data.length) : - data; - }; - - var inlinedFile = function(data, nextStart, nextEnd, options) { - var strippedImport = data - .substring(data.indexOf(' ', nextStart) + 1, nextEnd) - .replace(/^url\(/, '') - .replace(/['"]/g, ''); - - var separatorIndex = strippedImport.indexOf(' '); - var importedFile = strippedImport - .substring(0, separatorIndex > 0 ? separatorIndex : strippedImport.length) - .replace(')', ''); - var mediaQuery = strippedImport - .substring(importedFile.length + 1) - .trim(); - - if (/^(http|https):\/\//.test(importedFile) || /^\/\//.test(importedFile)) - return '@import url(' + importedFile + ')' + (mediaQuery.length > 0 ? ' ' + mediaQuery : '') + ';'; - - var relativeTo = importedFile[0] == '/' ? - options.root : - options.relativeTo; - - var fullPath = path.resolve(path.join(relativeTo, importedFile)); - - if (!fs.existsSync(fullPath) || !fs.statSync(fullPath).isFile()) - throw new Error('Broken @import declaration of "' + importedFile + '"'); - - if (options.visited.indexOf(fullPath) != -1) - return ''; - - options.visited.push(fullPath); - - var importedData = fs.readFileSync(fullPath, 'utf8'); - var importRelativeTo = path.dirname(fullPath); - importedData = UrlRewriter.process(importedData, { - relative: true, - fromBase: importRelativeTo, - toBase: options._baseRelativeTo - }); - - var inlinedData = process(importedData, { - root: options.root, - relativeTo: importRelativeTo, - _baseRelativeTo: options.baseRelativeTo, - visited: options.visited - }); - return mediaQuery.length > 0 ? - '@media ' + mediaQuery + '{' + inlinedData + '}' : - inlinedData; - }; - - return { - // Inlines all imports taking care of repetitions, unknown files, and circular dependencies - process: process - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/properties/shorthand-notations.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/properties/shorthand-notations.js deleted file mode 100644 index f29b2d3..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/properties/shorthand-notations.js +++ /dev/null @@ -1,50 +0,0 @@ -module.exports = function ShorthandNotations(data) { - // shorthand notations - var shorthandRegex = function(repeats, hasSuffix) { - var pattern = '(padding|margin|border\\-width|border\\-color|border\\-style|border\\-radius):'; - for (var i = 0; i < repeats; i++) - pattern += '([\\d\\w\\.%#\\(\\),]+)' + (i < repeats - 1 ? ' ' : ''); - return new RegExp(pattern + (hasSuffix ? '([;}])' : ''), 'g'); - }; - - var from4Values = function() { - return data.replace(shorthandRegex(4), function(match, property, size1, size2, size3, size4) { - if (size1 === size2 && size1 === size3 && size1 === size4) - return property + ':' + size1; - else if (size1 === size3 && size2 === size4) - return property + ':' + size1 + ' ' + size2; - else if (size2 === size4) - return property + ':' + size1 + ' ' + size2 + ' ' + size3; - else - return match; - }); - }; - - var from3Values = function() { - return data.replace(shorthandRegex(3, true), function(match, property, size1, size2, size3, suffix) { - if (size1 === size2 && size1 === size3) - return property + ':' + size1 + suffix; - else if (size1 === size3) - return property + ':' + size1 + ' ' + size2 + suffix; - else - return match; - }); - }; - - var from2Values = function() { - return data.replace(shorthandRegex(2, true), function(match, property, size1, size2, suffix) { - if (size1 === size2) - return property + ':' + size1 + suffix; - else - return match; - }); - }; - - return { - process: function() { - data = from4Values(); - data = from3Values(); - return from2Values(); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/comments.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/comments.js deleted file mode 100644 index d5543e1..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/comments.js +++ /dev/null @@ -1,52 +0,0 @@ -module.exports = function Comments(keepSpecialComments, keepBreaks, lineBreak) { - var comments = []; - - return { - // Strip special comments (/*! ... */) by replacing them by __CSSCOMMENT__ marker - // for further restoring. Plain comments are removed. It's done by scanning data using - // String#indexOf scanning instead of regexps to speed up the process. - escape: function(data) { - var tempData = []; - var nextStart = 0; - var nextEnd = 0; - var cursor = 0; - - for (; nextEnd < data.length; ) { - nextStart = data.indexOf('/*', nextEnd); - nextEnd = data.indexOf('*/', nextStart + 2); - if (nextStart == -1 || nextEnd == -1) - break; - - tempData.push(data.substring(cursor, nextStart)); - if (data[nextStart + 2] == '!') { - // in case of special comments, replace them with a placeholder - comments.push(data.substring(nextStart, nextEnd + 2)); - tempData.push('__CSSCOMMENT__'); - } - cursor = nextEnd + 2; - } - - return tempData.length > 0 ? - tempData.join('') + data.substring(cursor, data.length) : - data; - }, - - restore: function(data) { - var commentsCount = comments.length; - var breakSuffix = keepBreaks ? lineBreak : ''; - - return data.replace(new RegExp('__CSSCOMMENT__(' + lineBreak + '| )?', 'g'), function() { - switch (keepSpecialComments) { - case '*': - return comments.shift() + breakSuffix; - case 1: - return comments.length == commentsCount ? - comments.shift() + breakSuffix : - ''; - case 0: - return ''; - } - }); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/expressions.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/expressions.js deleted file mode 100644 index 92575d0..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/expressions.js +++ /dev/null @@ -1,64 +0,0 @@ -module.exports = function Expressions() { - var expressions = []; - - var findEnd = function(data, start) { - var end = start + 'expression'.length; - var level = 0; - var quoted = false; - - while(true) { - var next = data[end++]; - - if (quoted) { - quoted = next != '\'' && next != '"'; - } else { - quoted = next == '\'' || next == '"'; - - if (next == '(') - level++; - if (next == ')') - level--; - } - - if (level === 0 || !next) - break; - } - - return end; - }; - - return { - // Escapes expressions by replacing them by the __EXPRESSION__ - // marker for further restoring. It's done via string scanning - // instead of regexps to speed up the process. - escape: function(data) { - var nextStart = 0; - var nextEnd = 0; - var cursor = 0; - var tempData = []; - - for (; nextEnd < data.length; ) { - nextStart = data.indexOf('expression(', nextEnd); - if (nextStart == -1) - break; - - nextEnd = findEnd(data, nextStart); - - tempData.push(data.substring(cursor, nextStart)); - tempData.push('__EXPRESSION__'); - expressions.push(data.substring(nextStart, nextEnd)); - cursor = nextEnd; - } - - return tempData.length > 0 ? - tempData.join('') + data.substring(cursor, data.length) : - data; - }, - - restore: function(data) { - return data.replace(/__EXPRESSION__/g, function() { - return expressions.shift(); - }); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/free.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/free.js deleted file mode 100644 index 973e326..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/free.js +++ /dev/null @@ -1,59 +0,0 @@ -module.exports = function Free() { - var texts = []; - - return { - // Strip content tags by replacing them by the __CSSFREETEXT__ - // marker for further restoring. It's done via string scanning - // instead of regexps to speed up the process. - escape: function(data) { - var tempData = []; - var nextStart = 0; - var nextEnd = 0; - var cursor = 0; - var matchedParenthesis = null; - var singleParenthesis = "'"; - var doubleParenthesis = '"'; - var dataLength = data.length; - - for (; nextEnd < data.length; ) { - var nextStartSingle = data.indexOf(singleParenthesis, nextEnd + 1); - var nextStartDouble = data.indexOf(doubleParenthesis, nextEnd + 1); - - if (nextStartSingle == -1) - nextStartSingle = dataLength; - if (nextStartDouble == -1) - nextStartDouble = dataLength; - - if (nextStartSingle < nextStartDouble) { - nextStart = nextStartSingle; - matchedParenthesis = singleParenthesis; - } else { - nextStart = nextStartDouble; - matchedParenthesis = doubleParenthesis; - } - - if (nextStart == -1) - break; - - nextEnd = data.indexOf(matchedParenthesis, nextStart + 1); - if (nextStart == -1 || nextEnd == -1) - break; - - tempData.push(data.substring(cursor, nextStart)); - tempData.push('__CSSFREETEXT__'); - texts.push(data.substring(nextStart, nextEnd + 1)); - cursor = nextEnd + 1; - } - - return tempData.length > 0 ? - tempData.join('') + data.substring(cursor, data.length) : - data; - }, - - restore: function(data) { - return data.replace(/__CSSFREETEXT__/g, function() { - return texts.shift(); - }); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/urls.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/urls.js deleted file mode 100644 index 7e83ee6..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/text/urls.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = function Urls() { - var urls = []; - - return { - // Strip urls by replacing them by the __URL__ - // marker for further restoring. It's done via string scanning - // instead of regexps to speed up the process. - escape: function(data) { - var nextStart = 0; - var nextEnd = 0; - var cursor = 0; - var tempData = []; - - for (; nextEnd < data.length; ) { - nextStart = data.indexOf('url(', nextEnd); - if (nextStart == -1) - break; - - nextEnd = data.indexOf(')', nextStart); - - tempData.push(data.substring(cursor, nextStart)); - tempData.push('__URL__'); - urls.push(data.substring(nextStart, nextEnd + 1)); - cursor = nextEnd + 1; - } - - return tempData.length > 0 ? - tempData.join('') + data.substring(cursor, data.length) : - data; - }, - - restore: function(data) { - return data.replace(/__URL__/g, function() { - return urls.shift(); - }); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/History.md b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/History.md deleted file mode 100644 index 2e66582..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/History.md +++ /dev/null @@ -1,179 +0,0 @@ - -2.0.0 / 2013-07-18 -================== - - * remove input methods (.prompt, .confirm, etc) - -1.3.2 / 2013-07-18 -================== - - * add support for sub-commands to co-exist with the original command - -1.3.1 / 2013-07-18 -================== - - * add quick .runningCommand hack so you can opt-out of other logic when running a sub command - -1.3.0 / 2013-07-09 -================== - - * add EACCES error handling - * fix sub-command --help - -1.2.0 / 2013-06-13 -================== - - * allow "-" hyphen as an option argument - * support for RegExp coercion - -1.1.1 / 2012-11-20 -================== - - * add more sub-command padding - * fix .usage() when args are present. Closes #106 - -1.1.0 / 2012-11-16 -================== - - * add git-style executable subcommand support. Closes #94 - -1.0.5 / 2012-10-09 -================== - - * fix `--name` clobbering. Closes #92 - * fix examples/help. Closes #89 - -1.0.4 / 2012-09-03 -================== - - * add `outputHelp()` method. - -1.0.3 / 2012-08-30 -================== - - * remove invalid .version() defaulting - -1.0.2 / 2012-08-24 -================== - - * add `--foo=bar` support [arv] - * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus] - -1.0.1 / 2012-08-03 -================== - - * fix issue #56 - * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) - -1.0.0 / 2012-07-05 -================== - - * add support for optional option descriptions - * add defaulting of `.version()` to package.json's version - -0.6.1 / 2012-06-01 -================== - - * Added: append (yes or no) on confirmation - * Added: allow node.js v0.7.x - -0.6.0 / 2012-04-10 -================== - - * Added `.prompt(obj, callback)` support. Closes #49 - * Added default support to .choose(). Closes #41 - * Fixed the choice example - -0.5.1 / 2011-12-20 -================== - - * Fixed `password()` for recent nodes. Closes #36 - -0.5.0 / 2011-12-04 -================== - - * Added sub-command option support [itay] - -0.4.3 / 2011-12-04 -================== - - * Fixed custom help ordering. Closes #32 - -0.4.2 / 2011-11-24 -================== - - * Added travis support - * Fixed: line-buffered input automatically trimmed. Closes #31 - -0.4.1 / 2011-11-18 -================== - - * Removed listening for "close" on --help - -0.4.0 / 2011-11-15 -================== - - * Added support for `--`. Closes #24 - -0.3.3 / 2011-11-14 -================== - - * Fixed: wait for close event when writing help info [Jerry Hamlet] - -0.3.2 / 2011-11-01 -================== - - * Fixed long flag definitions with values [felixge] - -0.3.1 / 2011-10-31 -================== - - * Changed `--version` short flag to `-V` from `-v` - * Changed `.version()` so it's configurable [felixge] - -0.3.0 / 2011-10-31 -================== - - * Added support for long flags only. Closes #18 - -0.2.1 / 2011-10-24 -================== - - * "node": ">= 0.4.x < 0.7.0". Closes #20 - -0.2.0 / 2011-09-26 -================== - - * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] - -0.1.0 / 2011-08-24 -================== - - * Added support for custom `--help` output - -0.0.5 / 2011-08-18 -================== - - * Changed: when the user enters nothing prompt for password again - * Fixed issue with passwords beginning with numbers [NuckChorris] - -0.0.4 / 2011-08-15 -================== - - * Fixed `Commander#args` - -0.0.3 / 2011-08-15 -================== - - * Added default option value support - -0.0.2 / 2011-08-15 -================== - - * Added mask support to `Command#password(str[, mask], fn)` - * Added `Command#password(str, fn)` - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/Readme.md b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/Readme.md deleted file mode 100644 index d164401..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/Readme.md +++ /dev/null @@ -1,195 +0,0 @@ -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineapple'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -V, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineapple - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -V, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .outputHelp() - - Output help information without exiting. - -## .help() - - Output help information and exit immediately. - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 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. diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/index.js b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/index.js deleted file mode 100644 index d5778a7..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/index.js +++ /dev/null @@ -1,847 +0,0 @@ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter; -var spawn = require('child_process').spawn; -var fs = require('fs'); -var exists = fs.existsSync; -var path = require('path'); -var dirname = path.dirname; -var basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description || ''; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this._execs = []; - this._args = []; - this._name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @param {String} [desc] - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name, desc){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - if (desc) cmd.description(desc); - if (desc) this.executables = true; - if (desc) this._execs[cmd._name] = true; - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - if (desc) return this; - return cmd; -}; - -/** - * Add an implicit `help [cmd]` subcommand - * which invokes `--help` for the given command. - * - * @api private - */ - -Command.prototype.addImplicitHelpCommand = function() { - this.command('help [cmd]', 'display help for [cmd]'); -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self._args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self._args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this._name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - // Leftover arguments need to be pushed back. Fixes issue #56 - if (parsed.args.length) args = parsed.args.concat(args); - - self._args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self._args.length) { - args[self._args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // implicit help - if (this.executables) this.addImplicitHelpCommand(); - - // store raw args - this.rawArgs = argv; - - // guess name - this._name = this._name || basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - var args = this.args = parsed.args; - - var result = this.parseArgs(this.args, parsed.unknown); - - // executable sub-commands - var name = result.args[0]; - if (this._execs[name]) return this.executeSubCommand(argv, args, parsed.unknown); - - return result; -}; - -/** - * Execute a sub-command executable. - * - * @param {Array} argv - * @param {Array} args - * @param {Array} unknown - * @api private - */ - -Command.prototype.executeSubCommand = function(argv, args, unknown) { - args = args.concat(unknown); - - if (!args.length) this.help(); - if ('help' == args[0] && 1 == args.length) this.help(); - - // --help - if ('help' == args[0]) { - args[0] = args[1]; - args[1] = '--help'; - } - - // executable - var dir = dirname(argv[1]); - var bin = basename(argv[1]) + '-' + args[0]; - - // check for ./ first - var local = path.join(dir, bin); - - // run it - args = args.slice(1); - var proc = spawn(local, args, { stdio: 'inherit', customFds: [0, 1, 2] }); - proc.on('error', function(err){ - if (err.code == "ENOENT") { - console.error('\n %s(1) does not exist, try --help\n', bin); - } else if (err.code == "EACCES") { - console.error('\n %s(1) not executable. try chmod or run with root\n', bin); - } - }); - - this.runningCommand = proc; -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * This also normalizes equal sign and splits "--abc=def" into "--abc def". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg - , index; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { - ret.push(arg.slice(0, index), arg.slice(index + 1)); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - if ('-' == arg[0] && '-' != arg) return this.optionMissingArgument(option, arg); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || ('-' == arg[0] && '-' != arg)) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this._args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this._args.length ? ' ' + args : ''); - - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd._args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return pad(cmd._name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args, 22) - + (cmd.description() - ? ' ' + cmd.description() - : ''); - }).join('\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this._name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Output help information for this command - * - * @api public - */ - -Command.prototype.outputHelp = function(){ - process.stdout.write(this.helpInformation()); - this.emit('--help'); -}; - -/** - * Output help information and exit. - * - * @api public - */ - -Command.prototype.help = function(){ - this.outputHelp(); - process.exit(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - cmd.outputHelp(); - process.exit(0); - } - } -} diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/package.json b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/package.json deleted file mode 100644 index 4bdf37d..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/node_modules/commander/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "commander", - "version": "2.0.0", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt", - "stdin" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/commander.js.git" - }, - "devDependencies": { - "should": ">= 0.0.1" - }, - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.6.x" - }, - "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineapple');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineapple\n -b, --bbq Add bbq sauce\n -c, --cheese Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] ')\n .option('-i, --integer ', 'An integer argument', parseInt)\n .option('-f, --float ', 'A float argument', parseFloat)\n .option('-r, --range ..', 'A range', range)\n .option('-l, --list ', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .outputHelp()\n\n Output help information without exiting.\n\n## .help()\n\n Output help information and exit immediately.\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 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.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/commander.js/issues" - }, - "_id": "commander@2.0.0", - "_from": "commander@2.0.x" -} diff --git a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/package.json b/node_modules/grunt-contrib-cssmin/node_modules/clean-css/package.json deleted file mode 100644 index 4a67f7b..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/clean-css/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "clean-css", - "version": "1.1.3", - "author": { - "name": "Jakub Pawlowicz", - "email": "jakub@goalsmashers.com", - "url": "http://twitter.com/GoalSmashers" - }, - "description": "A well-tested CSS minifier", - "keywords": [ - "css", - "minifier" - ], - "homepage": "https://github.com/GoalSmashers/clean-css", - "repository": { - "type": "git", - "url": "https://github.com/GoalSmashers/clean-css.git" - }, - "bugs": { - "url": "https://github.com/GoalSmashers/clean-css/issues" - }, - "bin": { - "cleancss": "./bin/cleancss" - }, - "main": "index.js", - "files": [ - "bin", - "lib", - "History.md", - "index.js", - "LICENSE" - ], - "scripts": { - "bench": "node ./test/bench.js", - "check": "jshint .", - "prepublish": "jshint .", - "test": "vows" - }, - "dependencies": { - "commander": "2.0.x" - }, - "devDependencies": { - "vows": "0.7.x", - "jshint": "~2.1.9" - }, - "jshintConfig": { - "browser": false, - "maxerr": 100, - "node": true, - "camelcase": true, - "curly": false, - "eqeqeq": false, - "eqnull": false, - "immed": true, - "latedef": true, - "multistr": true, - "noarg": true, - "plusplus": false, - "quotmark": "true", - "regexp": false, - "strict": false, - "trailing": true, - "undef": true, - "unused": true - }, - "engines": { - "node": ">=0.8.0" - }, - "license": "MIT", - "readme": "[![NPM version](https://badge.fury.io/js/clean-css.png)](https://badge.fury.io/js/clean-css)\n[![Build Status](https://secure.travis-ci.org/GoalSmashers/clean-css.png)](https://travis-ci.org/GoalSmashers/clean-css)\n[![Dependency Status](https://gemnasium.com/GoalSmashers/clean-css.png)](https://gemnasium.com/GoalSmashers/clean-css)\n\n## What is clean-css?\n\nClean-css is a [node.js](http://nodejs.org/) library for minifying CSS files.\nIt does the same job as YUI Compressor's CSS minifier, but much faster thanks\nto many speed optimizations and node.js' V8 engine.\n\n\n## Usage\n\n### What are the requirements?\n\n```\nnode.js 0.8.0+ (tested on CentOS, Ubuntu, OS X 10.6+, and Windows 7+)\n```\n\n### How to install clean-css?\n\n```\nnpm install clean-css\n```\n\n### How to use clean-css CLI?\n\nClean-css accepts the following command line arguments (please make sure\nyou use `` as the very last argument to avoid potential issues):\n\n```\ncleancss [options] \n\n-h, --help Output usage information\n-v, --version Output the version number\n-e, --remove-empty Remove empty declarations, e.g. a{}\n-b, --keep-line-breaks Keep line breaks\n--s0 Remove all special comments, i.e. /*! comment */\n--s1 Remove all special comments but the first one\n-r, --root [root-path] A root path to which resolve absolute @import rules and rebase relative URLs\n-o, --output [output-file] Use [output-file] as output instead of STDOUT\n-s, --skip-import Disable the @import processing\n-d, --debug Shows debug information (minification time & compression efficiency)\n```\n\n#### Examples:\n\nTo minify a **public.css** file into **public-min.css** do:\n\n```\ncleancss -o public-min.css public.css\n```\n\nTo minify the same **public.css** into the standard output skip the `-o` parameter:\n\n```\ncleancss public.css\n```\n\nMore likely you would like to concatenate a couple of files.\nIf you are on a Unix-like system:\n\n```bash\ncat one.css two.css three.css | cleancss -o merged-and-minified.css\n```\n\nOn Windows:\n\n```bat\ntype one.css two.css three.css | cleancss -o merged-and-minified.css\n```\n\nOr even gzip the result at once:\n\n```bash\ncat one.css two.css three.css | cleancss | gzip -9 -c > merged-minified-and-gzipped.css.gz\n```\n\n### How to use clean-css programmatically?\n\n```js\nvar cleanCSS = require('clean-css');\nvar source = 'a{font-weight:bold;}';\nvar minimized = cleanCSS.process(source);\n```\n\nProcess method accepts a hash as a second parameter, i.e.,\n`cleanCSS.process(source, options)` with the following options available:\n\n* `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one, `0` for removing all\n* `keepBreaks` - whether to keep line breaks (default is false)\n* `removeEmpty` - whether to remove empty elements (default is false)\n* `benchmark` - turns on benchmarking mode measuring time spent on cleaning up\n (run `npm run bench` to see example)\n* `root` - path to resolve absolute `@import` rules and rebase relative URLs\n* `relativeTo` - path with which to resolve relative `@import` rules and URLs\n* `processImport` - whether to process `@import` rules\n\n### What are the clean-css' dev commands?\n\nFirst clone the source, then run:\n\n* `npm run bench` for clean-css benchmarks (see [test/bench.js](https://github.com/GoalSmashers/clean-css/blob/master/test/bench.js) for details)\n* `npm run check` to check JS sources with [JSHint](https://github.com/jshint/jshint/)\n* `npm test` for the test suite\n\n## Tips & Tricks\n\n### How to preserve a comment block?\n\nUse the `/*!` notation instead of the standard one `/*`:\n\n```css\n/*!\n Important comments included in minified output.\n*/\n```\n\n### How to rebase relative image URLs\n\nClean-css will handle it automatically for you (since version 1.1) in the following cases:\n\n* When using the CLI:\n 1. Use an output path via `-o/--output` to rebase URLs as relative to the output file.\n 2. Use a root path via `-r/--root` to rebase URLs as absolute from the given root path.\n 3. If you specify both then `-r/--root` takes precendence.\n* When using clean-css as a library:\n 1. Use a combination of `relativeTo` and `target` options for relative rebase (same as 1 in CLI).\n 2. Use a combination of `relativeTo` and `root` options for absolute rebase (same as 2 in CLI).\n 3. `root` takes precendence over `target` as in CLI.\n\n## Acknowledgments\n\n* Vincent Voyer ([@vvo](https://github.com/vvo)) for a patch with better\n empty element regex and for inspiring us to do many performance improvements\n in 0.4 release.\n* Isaac ([@facelessuser](https://github.com/facelessuser)) for pointing out\n a flaw in clean-css' stateless mode.\n* Jan Michael Alonzo ([@jmalonzo](https://github.com/jmalonzo)) for a patch\n removing node.js' old `sys` package.\n* [@XhmikosR](https://github.com/XhmikosR) for suggesting new features\n (option to remove special comments and strip out URLs quotation) and\n pointing out numerous improvements (JSHint, media queries).\n* Anthony Barre ([@abarre](https://github.com/abarre)) for improvements to\n `@import` processing, namely introducing the `--skip-import` /\n `processImport` options.\n\n## License\n\nClean-css is released under the [MIT License](https://github.com/GoalSmashers/clean-css/blob/master/LICENSE).\n", - "readmeFilename": "README.md", - "_id": "clean-css@1.1.3", - "_from": "clean-css@~1.1.1" -} diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.gitattributes b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.gitattributes deleted file mode 100644 index 176a458..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.jshintrc b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.jshintrc deleted file mode 100644 index e0cc7bb..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.npmignore b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.npmignore deleted file mode 100644 index 5cb6bfd..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.travis.yml b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.travis.yml deleted file mode 100644 index f2c257a..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_install: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/AUTHORS b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/AUTHORS deleted file mode 100644 index 5de1a92..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -Tyler Kellen (http://goingslowly.com/) -Chris Talkington (http://christalkington.com/) -Larry Davis (http://lazd.net/) -Sindre Sorhus (http://sindresorhus.com) diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/CHANGELOG b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/CHANGELOG deleted file mode 100644 index f1e4c30..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/CHANGELOG +++ /dev/null @@ -1,47 +0,0 @@ -v0.6.1: - date: 2013-03-24 - changes: - - Add formatForType option -v0.6.0: - date: 2013-03-14 - changes: - - Change API/reportying style for minMaxInfo -v0.5.3: - date: 2013-02-23 - changes: - - use MIT licensed zlib-browserify instead of unlicensed gzip-js -v0.5.2: - date: 2013-01-24 - changes: - - add minMaxGzip & minMaxInfo. -v0.5.0: - date: 2012-12-05 - changes: - - remove findBasePath, buildIndividualDest and isIndividualDest. - - remove options and normalizeMultiTaskFiles. - - remove node v0.6 and grunt v0.3 support. -v0.4.0: - date: 2012-11-20 - changes: - - findBasePath returns '' if passed false. - - Added stripPath. -v0.3.1: - date: 2012-10-29 - changes: - - Tweaked findBasePath to handle single dot differently. - - Start testing with Travis. - - Docs cleanup. -v0.3.0: - date: 2012-09-24 - changes: - - Added findBasePath, buildIndividualDest, isIndividualDest, optsToArgs. - - Refactored tests. - - Automatically parse templates in options. -v0.2.1: - date: 2012-09-14 - changes: - - Added non-destuctive namespace declarations. -v0.2.0: - date: 2012-09-10 - changes: - - Refactored from grunt-contrib into individual repo. diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/Gruntfile.js b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/Gruntfile.js deleted file mode 100644 index 6e602bb..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/Gruntfile.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * grunt-lib-contrib - * http://gruntjs.com/ - * - * Copyright (c) 2012 Tyler Kellen, contributors - * Licensed under the MIT license. - */ - -module.exports = function(grunt) { - 'use strict'; - - // Project configuration. - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'lib/*.js', - '<%= nodeunit.tests %>' - ], - options: { - jshintrc: '.jshintrc' - } - }, - - test_vars: { - source: 'source/' - }, - - test_task: { - options: { - param: 'task', - param2: 'task', - template: '<%= test_vars.source %>', - data: { - template: ['<%= test_vars.source %>'] - } - }, - target: { - options: { - param: 'target' - } - } - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'] - } - }); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - - // Whenever the "test" task is run, then test the result. - grunt.registerTask('test', ['nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['jshint', 'test']); -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/LICENSE-MIT b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/LICENSE-MIT deleted file mode 100644 index 358b067..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -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. \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/README.md b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/README.md deleted file mode 100644 index 88116eb..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# grunt-lib-contrib [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-lib-contrib.png?branch=master)](http://travis-ci.org/gruntjs/grunt-lib-contrib) - -> Common functionality shared across grunt-contrib tasks. - -The purpose of grunt-lib-contrib is to explore solutions to common problems task writers encounter, and to ease the upgrade path for contrib tasks. - -**These APIs should be considered highly unstable. Depend on them at your own risk!** - -_Over time, some of the functionality provided here may be incorporated directly into grunt for mainstream use. Until then, you may require `grunt-lib-contrib` as a dependency in your projects, but be very careful to specify an exact version number instead of a range, as backwards-incompatible changes are likely to be introduced._ - -### Helper Functions - -#### getNamespaceDeclaration(ns) - -This helper is used to build JS namespace declarations. - -#### optsToArgs(options) - -Convert an object to an array of CLI arguments, which can be used with `child_process.spawn()`. - -```js -// Example -{ - fooBar: 'a', // ['--foo-bar', 'a'] - fooBar: 1, // ['--foo-bar', '1'] - fooBar: true, // ['--foo-bar'] - fooBar: false, // - fooBar: ['a', 'b'] // ['--foo-bar', 'a', '--foo-bar', 'b'] -} -``` - -#### stripPath(pth, strip) - -Strip a path from a path. normalize both paths for best results. - -#### minMaxInfo(min, max, report) - -Helper for logging compressed, uncompressed and gzipped sizes of strings. - -#### report -Choices: `false`, `'min'`, `'gzip'` -Default: `false` - -Either do not report anything, report only minification result, or report minification and gzip results. - -**Important** Including `'gzip'` results can make this task 5-10x slower depending on the size of the file. - - -```js -var max = grunt.file.read('max.js'); -var min = minify(max); -minMaxInfo(min, max, 'gzip'); -``` - -Would print: - -``` -Original: 495 bytes. -Minified: 396 bytes. -Gzipped: 36 bytes. -``` - --- - -*Lib submitted by [Tyler Kellen](https://goingslowly.com/).* \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/lib/contrib.js b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/lib/contrib.js deleted file mode 100644 index 9dcf945..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/lib/contrib.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * grunt-lib-contrib - * http://gruntjs.com/ - * - * Copyright (c) 2012 Tyler Kellen, contributors - * Licensed under the MIT license. - */ - -exports.init = function(grunt) { - 'use strict'; - - var exports = {}; - - var path = require('path'); - - exports.getNamespaceDeclaration = function(ns) { - var output = []; - var curPath = 'this'; - if (ns !== 'this') { - var nsParts = ns.split('.'); - nsParts.forEach(function(curPart, index) { - if (curPart !== 'this') { - curPath += '[' + JSON.stringify(curPart) + ']'; - output.push(curPath + ' = ' + curPath + ' || {};'); - } - }); - } - - return { - namespace: curPath, - declaration: output.join('\n') - }; - }; - - // Convert an object to an array of CLI arguments - exports.optsToArgs = function(options) { - var args = []; - - Object.keys(options).forEach(function(flag) { - var val = options[flag]; - - flag = flag.replace(/[A-Z]/g, function(match) { - return '-' + match.toLowerCase(); - }); - - if (val === true) { - args.push('--' + flag); - } - - if (grunt.util._.isString(val)) { - args.push('--' + flag, val); - } - - if (grunt.util._.isNumber(val)) { - args.push('--' + flag, '' + val); - } - - if (grunt.util._.isArray(val)) { - val.forEach(function(arrVal) { - args.push('--' + flag, arrVal); - }); - } - }); - - return args; - }; - - // Strip a path from a path. normalize both paths for best results. - exports.stripPath = function(pth, strip) { - if (strip && strip.length >= 1) { - strip = path.normalize(strip); - pth = path.normalize(pth); - pth = grunt.util._(pth).strRight(strip); - pth = grunt.util._(pth).ltrim(path.sep); - } - - return pth; - }; - - // Log min and max info - function gzipSize(src) { - return src ? require('zlib-browserify').gzipSync(src).length : 0; - } - exports.minMaxInfo = function(min, max, report) { - if (report === 'min' || report === 'gzip') { - grunt.log.writeln('Original: ' + String(max.length).green + ' bytes.'); - grunt.log.writeln('Minified: ' + String(min.length).green + ' bytes.'); - } - if (report === 'gzip') { - // Note this option is pretty slow so it is not enabled by default - grunt.log.write('Gzipped: '); - grunt.log.writeln(String(gzipSize(min)).green + ' bytes.'); - } - }; - - exports.formatForType = function(string, type, namespace, filename) { - namespace = namespace || false; - - if (type === 'amd' && namespace === false) { - string = 'return ' + string; - } else if (type === 'commonjs' && namespace === false) { - string = 'module.exports = ' + string; - } else if (type === 'amd' && namespace !== false || type === 'commonjs' && namespace !== false || type === 'js' && namespace !== false) { - string = namespace+'['+JSON.stringify(filename)+'] = '+string+';'; - } - - return string; - }; - - return exports; -}; diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/.npmignore b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/.npmignore deleted file mode 100644 index b512c09..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/index.js b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/index.js deleted file mode 100644 index 6674043..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/index.js +++ /dev/null @@ -1,43 +0,0 @@ -const Zlib = module.exports = require('./zlib'); - -// the least I can do is make error messages for the rest of the node.js/zlib api. -// (thanks, dominictarr) -function error () { - var m = [].slice.call(arguments).join(' ') - throw new Error([ - m, - 'we accept pull requests', - 'http://github.com/brianloveswords/zlib-browserify' - ].join('\n')) -} - -;['createGzip' -, 'createGunzip' -, 'createDeflate' -, 'createDeflateRaw' -, 'createInflate' -, 'createInflateRaw' -, 'createUnzip' -, 'Gzip' -, 'Gunzip' -, 'Inflate' -, 'InflateRaw' -, 'Deflate' -, 'DeflateRaw' -, 'Unzip' -, 'inflateRaw' -, 'deflateRaw'].forEach(function (name) { - Zlib[name] = function () { - error('sorry,', name, 'is not implemented yet') - } -}); - -const _deflate = Zlib.deflate; -const _gzip = Zlib.gzip; - -Zlib.deflate = function deflate(stringOrBuffer, callback) { - return _deflate(Buffer(stringOrBuffer), callback); -}; -Zlib.gzip = function gzip(stringOrBuffer, callback) { - return _gzip(Buffer(stringOrBuffer), callback); -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/package.json b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/package.json deleted file mode 100644 index 633cb6e..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "zlib-browserify", - "version": "0.0.1", - "description": "Wrapper for zlib.js to allow for browserifyication", - "main": "index.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.3" - }, - "scripts": { - "test": "./node_modules/tap test/*.test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/brianloveswords/zlib-browserify.git" - }, - "keywords": [ - "zlib", - "browserify" - ], - "author": { - "name": "Brian J. Brennan" - }, - "license": "MIT", - "gitHead": "4be9419f0e8e9dec9629c8a538b33a4efd7df17b", - "readmeFilename": "readme.md", - "readme": "Zlib in yo' browser.\n", - "bugs": { - "url": "https://github.com/brianloveswords/zlib-browserify/issues" - }, - "_id": "zlib-browserify@0.0.1", - "_from": "zlib-browserify@0.0.1" -} diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/readme.md b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/readme.md deleted file mode 100644 index ca4a5ee..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/readme.md +++ /dev/null @@ -1 +0,0 @@ -Zlib in yo' browser. diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/test/zlib.test.js b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/test/zlib.test.js deleted file mode 100644 index 5b7a3ce..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/test/zlib.test.js +++ /dev/null @@ -1,65 +0,0 @@ -const test = require('tap').test; -const zlibA = require('zlib'); -const zlibB = require('..'); -const crypto = require('crypto'); - -test('zlibA.deflate -> zlibB.inflate', function (t) { - const expect = crypto.randomBytes(1024); - zlibA.deflate(expect, function (err, cmpA) { - zlibB.inflate(cmpA, function (err, result) { - t.same(result, expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibB.deflate -> zlibA.inflate', function (t) { - const expect = crypto.randomBytes(1024); - zlibB.deflate(expect, function (err, cmpA) { - zlibA.inflate(cmpA, function (err, result) { - t.same(result, expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibB.deflate -> zlibA.inflate (string)', function (t) { - const expect = 'ohaihihihihihihihihihihihihihihihi'; - zlibB.deflate(expect, function (err, cmpA) { - zlibA.inflate(cmpA, function (err, result) { - t.same(result.toString(), expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibA.gzip -> zlibB.gunzip', function (t) { - const expect = crypto.randomBytes(1024); - zlibA.gzip(expect, function (err, cmpA) { - zlibB.gunzip(cmpA, function (err, result) { - t.same(result, expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibB.gzip -> zlibA.gunzip', function (t) { - const expect = crypto.randomBytes(1024); - zlibB.gzip(expect, function (err, cmpA) { - zlibA.gunzip(cmpA, function (err, result) { - t.same(result, expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibB.gzip -> zlibA.gunzip', function (t) { - const expect = 'lololololoollolololoololololololololololololololololololololol'; - zlibB.gzip(expect, function (err, cmpA) { - zlibA.gunzip(cmpA, function (err, result) { - t.same(result.toString(), expect, 'should match'); - t.end(); - }); - }); -}); - diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/zlib.js b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/zlib.js deleted file mode 100644 index a9ea566..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/zlib.js +++ /dev/null @@ -1,55 +0,0 @@ -/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */ -(function() {'use strict';function m(c){throw c;}var r=void 0,u=!0;var B="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array;function aa(c){if("string"===typeof c){var a=c.split(""),b,e;b=0;for(e=a.length;b>>0;c=a}for(var f=1,d=0,g=c.length,h,j=0;0>>0};function I(c,a){this.index="number"===typeof a?a:0;this.n=0;this.buffer=c instanceof(B?Uint8Array:Array)?c:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&m(Error("invalid index"));this.buffer.length<=this.index&&this.f()}I.prototype.f=function(){var c=this.buffer,a,b=c.length,e=new (B?Uint8Array:Array)(b<<1);if(B)e.set(c);else for(a=0;a>>8&255]<<16|K[c>>>16&255]<<8|K[c>>>24&255])>>32-a:K[c]>>8-a);if(8>a+d)g=g<>a-h-1&1,8===++d&&(d=0,e[f++]=K[g],g=0,f===e.length&&(e=this.f()));e[f]=g;this.buffer=e;this.n=d;this.index=f};I.prototype.finish=function(){var c=this.buffer,a=this.index,b;0Q;++Q){for(var R=Q,ga=R,ha=7,R=R>>>1;R;R>>>=1)ga<<=1,ga|=R&1,--ha;ba[Q]=(ga<>>0}var K=ba;var S={k:function(c,a,b){return S.update(c,0,a,b)},update:function(c,a,b,e){for(var f=S.L,d="number"===typeof b?b:b=0,g="number"===typeof e?e:c.length,a=a^4294967295,d=g&7;d--;++b)a=a>>>8^f[(a^c[b])&255];for(d=g>>3;d--;b+=8)a=a>>>8^f[(a^c[b])&255],a=a>>>8^f[(a^c[b+1])&255],a=a>>>8^f[(a^c[b+2])&255],a=a>>>8^f[(a^c[b+3])&255],a=a>>>8^f[(a^c[b+4])&255],a=a>>>8^f[(a^c[b+5])&255],a=a>>>8^f[(a^c[b+6])&255],a=a>>>8^f[(a^c[b+7])&255];return(a^4294967295)>>>0}},ia=S,ja,ka=[0,1996959894,3993919788,2567524794, -124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304, -3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486, -2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580, -2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221, -2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863, -817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];ja=B?new Uint32Array(ka):ka;ia.L=ja;function na(){};function oa(c){this.buffer=new (B?Uint16Array:Array)(2*c);this.length=0}oa.prototype.getParent=function(c){return 2*((c-2)/4|0)};oa.prototype.push=function(c,a){var b,e,f=this.buffer,d;b=this.length;f[this.length++]=a;for(f[this.length++]=c;0f[e])d=f[b],f[b]=f[e],f[e]=d,d=f[b+1],f[b+1]=f[e+1],f[e+1]=d,b=e;else break;return this.length}; -oa.prototype.pop=function(){var c,a,b=this.buffer,e,f,d;a=b[0];c=b[1];this.length-=2;b[0]=b[this.length];b[1]=b[this.length+1];for(d=0;;){f=2*d+2;if(f>=this.length)break;f+2b[f]&&(f+=2);if(b[f]>b[d])e=b[d],b[d]=b[f],b[f]=e,e=b[d+1],b[d+1]=b[f+1],b[f+1]=e;else break;d=f}return{index:c,value:a,length:this.length}};function T(c){var a=c.length,b=0,e=Number.POSITIVE_INFINITY,f,d,g,h,j,i,q,l,k;for(l=0;lb&&(b=c[l]),c[l]>=1;for(k=i;kU;U++)switch(u){case 143>=U:sa.push([U+48,8]);break;case 255>=U:sa.push([U-144+400,9]);break;case 279>=U:sa.push([U-256+0,7]);break;case 287>=U:sa.push([U-280+192,8]);break;default:m("invalid literal: "+U)} -pa.prototype.h=function(){var c,a,b,e,f=this.input;switch(this.l){case 0:b=0;for(e=f.length;b>>8&255;k[p++]=i&255;k[p++]=i>>>8&255;if(B)k.set(d,p),p+=d.length,k=k.subarray(0,p);else{q=0;for(l=d.length;qz)for(;0z?z:138,H>z-3&&H=H?(L[J++]=17,L[J++]=H-3,O[17]++):(L[J++]=18,L[J++]=H-11,O[18]++),z-=H;else if(L[J++]=M[y],O[M[y]]++,z--,3>z)for(;0z?z:6,H>z-3&&HG;G++)va[G]=la[ca[G]];for(D=19;4=c:return[265,c-11,1];case 14>=c:return[266,c-13,1];case 16>=c:return[267,c-15,1];case 18>=c:return[268,c-17,1];case 22>=c:return[269,c-19,2];case 26>=c:return[270,c-23,2];case 30>=c:return[271,c-27,2];case 34>=c:return[272,c- -31,2];case 42>=c:return[273,c-35,3];case 50>=c:return[274,c-43,3];case 58>=c:return[275,c-51,3];case 66>=c:return[276,c-59,3];case 82>=c:return[277,c-67,4];case 98>=c:return[278,c-83,4];case 114>=c:return[279,c-99,4];case 130>=c:return[280,c-115,4];case 162>=c:return[281,c-131,5];case 194>=c:return[282,c-163,5];case 226>=c:return[283,c-195,5];case 257>=c:return[284,c-227,5];case 258===c:return[285,c-258,0];default:m("invalid length: "+c)}}var Ba=[],Aa,Ca; -for(Aa=3;258>=Aa;Aa++)Ca=za(),Ba[Aa]=Ca[2]<<24|Ca[1]<<16|Ca[0];var Da=B?new Uint32Array(Ba):Ba; -function ta(c,a){function b(a,c){var b=a.N,d=[],e=0,f;f=Da[a.length];d[e++]=f&65535;d[e++]=f>>16&255;d[e++]=f>>24;var g;switch(u){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b- -65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>= -b:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:m("invalid distance")}f=g;d[e++]=f[0];d[e++]=f[1];d[e++]=f[2];var h,i;h=0;for(i=d.length;h=d;)v[d++]=0;for(d=0;29>=d;)x[d++]=0}v[256]=1;e=0;for(f=a.length;e=f){l&&b(l,-1);d=0;for(g=f-e;ds&&e+sn&&(C=A,n=s);if(258===s)break}q=new xa(n,e-C);l?l.length2*k[n-1]+p[n]&&(k[n]=2*k[n-1]+p[n]),v[n]=Array(k[n]),x[n]=Array(k[n]);for(C=0;Ch[C]?(v[n][s]=E,x[n][s]=l,D+=2): -(v[n][s]=h[C],x[n][s]=C,++C);F[n]=0;1===p[n]&&b(n)}j=t;i=0;for(q=g.length;i>>=1}return a};function Ea(c,a){this.input=c;this.a=new (B?Uint8Array:Array)(32768);this.l=Fa.u;var b={},e;if((a||!(a={}))&&"number"===typeof a.compressionType)this.l=a.compressionType;for(e in a)b[e]=a[e];b.outputBuffer=this.a;this.H=new pa(this.input,b)}var Fa=ra; -Ea.prototype.h=function(){var c,a,b,e,f,d,g,h=0;g=this.a;c=Ga;switch(c){case Ga:a=Math.LOG2E*Math.log(32768)-8;break;default:m(Error("invalid compression method"))}b=a<<4|c;g[h++]=b;switch(c){case Ga:switch(this.l){case Fa.NONE:f=0;break;case Fa.K:f=1;break;case Fa.u:f=2;break;default:m(Error("unsupported compression type"))}break;default:m(Error("invalid compression method"))}e=f<<6|0;g[h++]=e|31-(256*b+e)%31;d=aa(this.input);this.H.b=h;g=this.H.h();h=g.length;B&&(g=new Uint8Array(g.buffer),g.length<= -h+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,h+4));g[h++]=d>>24&255;g[h++]=d>>16&255;g[h++]=d>>8&255;g[h++]=d&255;return g};function Ha(c,a){this.input=c;this.b=this.c=0;this.g={};a&&(a.flags&&(this.g=a.flags),"string"===typeof a.filename&&(this.filename=a.filename),"string"===typeof a.comment&&(this.comment=a.comment),a.deflateOptions&&(this.m=a.deflateOptions));this.m||(this.m={})} -Ha.prototype.h=function(){var c,a,b,e,f,d,g,h,j=new (B?Uint8Array:Array)(32768),i=0,q=this.input,l=this.c,k=this.filename,p=this.comment;j[i++]=31;j[i++]=139;j[i++]=8;c=0;this.g.fname&&(c|=Ia);this.g.fcomment&&(c|=Ja);this.g.fhcrc&&(c|=Ka);j[i++]=c;a=(Date.now?Date.now():+new Date)/1E3|0;j[i++]=a&255;j[i++]=a>>>8&255;j[i++]=a>>>16&255;j[i++]=a>>>24&255;j[i++]=0;j[i++]=Ya;if(this.g.fname!==r){g=0;for(h=k.length;g>>8&255),j[i++]=d&255;j[i++]=0}if(this.g.comment){g= -0;for(h=p.length;g>>8&255),j[i++]=d&255;j[i++]=0}this.g.fhcrc&&(b=S.k(j,0,i)&65535,j[i++]=b&255,j[i++]=b>>>8&255);this.m.outputBuffer=j;this.m.outputIndex=i;f=new pa(q,this.m);j=f.h();i=f.b;B&&(i+8>j.buffer.byteLength?(this.a=new Uint8Array(i+8),this.a.set(new Uint8Array(j.buffer)),j=this.a):j=new Uint8Array(j.buffer));e=S.k(q);j[i++]=e&255;j[i++]=e>>>8&255;j[i++]=e>>>16&255;j[i++]=e>>>24&255;h=q.length;j[i++]=h&255;j[i++]=h>>>8&255;j[i++]=h>>>16&255;j[i++]= -h>>>24&255;this.c=l;B&&i>>=1;switch(c){case 0:var a=this.input,b=this.c,e=this.a,f=this.b,d=r,g=r,h=r,j=e.length,i=r;this.e=this.j=0;d=a[b++];d===r&&m(Error("invalid uncompressed block header: LEN (first byte)"));g=d;d=a[b++];d===r&&m(Error("invalid uncompressed block header: LEN (second byte)"));g|=d<<8;d=a[b++];d===r&&m(Error("invalid uncompressed block header: NLEN (first byte)"));h=d;d=a[b++];d===r&&m(Error("invalid uncompressed block header: NLEN (second byte)"));h|= -d<<8;g===~h&&m(Error("invalid uncompressed block header: length verify"));b+g>a.length&&m(Error("input buffer is broken"));switch(this.r){case $a:for(;f+g>e.length;){i=j-f;g-=i;if(B)e.set(a.subarray(b,b+i),f),f+=i,b+=i;else for(;i--;)e[f++]=a[b++];this.b=f;e=this.f();f=this.b}break;case Za:for(;f+g>e.length;)e=this.f({B:2});break;default:m(Error("invalid inflate mode"))}if(B)e.set(a.subarray(b,b+g),f),f+=g,b+=g;else for(;g--;)e[f++]=a[b++];this.c=b;this.b=f;this.a=e;break;case 1:this.s(ab,bb);break; -case 2:cb(this);break;default:m(Error("unknown BTYPE: "+c))}}return this.z()}; -var db=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],eb=B?new Uint16Array(db):db,fb=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],gb=B?new Uint16Array(fb):fb,hb=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],ib=B?new Uint8Array(hb):hb,jb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],kb=B?new Uint16Array(jb):jb,lb=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10, -10,11,11,12,12,13,13],mb=B?new Uint8Array(lb):lb,nb=new (B?Uint8Array:Array)(288),Y,ob;Y=0;for(ob=nb.length;Y=Y?8:255>=Y?9:279>=Y?7:8;var ab=T(nb),pb=new (B?Uint8Array:Array)(30),qb,rb;qb=0;for(rb=pb.length;qb>>a;c.e=e-a;c.c=d;return g} -function sb(c,a){for(var b=c.j,e=c.e,f=c.input,d=c.c,g=a[0],h=a[1],j,i,q;e>>16;c.j=b>>q;c.e=e-q;c.c=d;return i&65535} -function cb(c){function a(a,b,c){var d,f,e,g;for(g=0;gd)e>=f&&(this.b=e,b=this.f(),e=this.b),b[e++]=d;else{g=d-257;j=gb[g];0=f&&(this.b=e,b=this.f(),e=this.b);for(;j--;)b[e]=b[e++-h]}for(;8<=this.e;)this.e-=8,this.c--;this.b=e}; -W.prototype.Q=function(c,a){var b=this.a,e=this.b;this.A=c;for(var f=b.length,d,g,h,j;256!==(d=sb(this,c));)if(256>d)e>=f&&(b=this.f(),f=b.length),b[e++]=d;else{g=d-257;j=gb[g];0f&&(b=this.f(),f=b.length);for(;j--;)b[e]=b[e++-h]}for(;8<=this.e;)this.e-=8,this.c--;this.b=e}; -W.prototype.f=function(){var c=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,b,e,f=this.a;if(B)c.set(f.subarray(32768,c.length));else{b=0;for(e=c.length;bb;++b)f[b]=f[a+b];this.b=32768;return f}; -W.prototype.R=function(c){var a,b=this.input.length/this.c+1|0,e,f,d,g=this.input,h=this.a;c&&("number"===typeof c.B&&(b=c.B),"number"===typeof c.M&&(b+=c.M));2>b?(e=(g.length-this.c)/this.A[2],d=258*(e/2)|0,f=da&&(this.a.length=a),c=this.a);return this.buffer=c};function tb(c){this.input=c;this.c=0;this.member=[]} -tb.prototype.i=function(){for(var c=this.input.length;this.c>>0;S.k(f)!==q&&m(Error("invalid CRC-32 checksum: 0x"+S.k(f).toString(16)+" / 0x"+q.toString(16))); -a.Y=b=(l[k++]|l[k++]<<8|l[k++]<<16|l[k++]<<24)>>>0;(f.length&4294967295)!==b&&m(Error("invalid input size: "+(f.length&4294967295)+" / "+b));this.member.push(a);this.c=k}var p=this.member,t,v,x=0,F=0,w;t=0;for(v=p.length;t>>0,b!==aa(a)&&m(Error("invalid adler-32 checksum")));return a};exports.deflate=vb;exports.deflateSync=wb;exports.inflate=xb;exports.inflateSync=yb;exports.gzip=zb;exports.gzipSync=Ab;exports.gunzip=Bb;exports.gunzipSync=Cb;function vb(c,a,b){process.nextTick(function(){var e,f;try{f=wb(c,b)}catch(d){e=d}a(e,f)})}function wb(c,a){var b;b=(new Ea(c)).h();a||(a={});return a.G?b:Db(b)}function xb(c,a,b){process.nextTick(function(){var e,f;try{f=yb(c,b)}catch(d){e=d}a(e,f)})} -function yb(c,a){var b;c.subarray=c.slice;b=(new ub(c)).i();a||(a={});return a.noBuffer?b:Db(b)}function zb(c,a,b){process.nextTick(function(){var e,f;try{f=Ab(c,b)}catch(d){e=d}a(e,f)})}function Ab(c,a){var b;c.subarray=c.slice;b=(new Ha(c)).h();a||(a={});return a.G?b:Db(b)}function Bb(c,a,b){process.nextTick(function(){var e,f;try{f=Cb(c,b)}catch(d){e=d}a(e,f)})}function Cb(c,a){var b;c.subarray=c.slice;b=(new tb(c)).i();a||(a={});return a.G?b:Db(b)} -function Db(c){var a=new Buffer(c.length),b,e;b=0;for(e=c.length;b=$?8:255>=$?9:279>=$?7:8;T(Jb);var Lb=new (B?Uint8Array:Array)(30),Mb,Nb;Mb=0;for(Nb=Lb.length;Mb= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt": "~0.4.0" - }, - "main": "lib/contrib", - "dependencies": { - "zlib-browserify": "0.0.1" - }, - "contributors": [ - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com/" - }, - { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - { - "name": "Larry Davis", - "url": "http://lazd.net/" - }, - { - "name": "Sindre Sorhus", - "url": "http://sindresorhus.com" - } - ], - "readme": "# grunt-lib-contrib [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-lib-contrib.png?branch=master)](http://travis-ci.org/gruntjs/grunt-lib-contrib)\n\n> Common functionality shared across grunt-contrib tasks.\n\nThe purpose of grunt-lib-contrib is to explore solutions to common problems task writers encounter, and to ease the upgrade path for contrib tasks.\n\n**These APIs should be considered highly unstable. Depend on them at your own risk!**\n\n_Over time, some of the functionality provided here may be incorporated directly into grunt for mainstream use. Until then, you may require `grunt-lib-contrib` as a dependency in your projects, but be very careful to specify an exact version number instead of a range, as backwards-incompatible changes are likely to be introduced._\n\n### Helper Functions\n\n#### getNamespaceDeclaration(ns)\n\nThis helper is used to build JS namespace declarations.\n\n#### optsToArgs(options)\n\nConvert an object to an array of CLI arguments, which can be used with `child_process.spawn()`.\n\n```js\n// Example\n{\n fooBar: 'a', // ['--foo-bar', 'a']\n fooBar: 1, // ['--foo-bar', '1']\n fooBar: true, // ['--foo-bar']\n fooBar: false, //\n fooBar: ['a', 'b'] // ['--foo-bar', 'a', '--foo-bar', 'b']\n}\n```\n\n#### stripPath(pth, strip)\n\nStrip a path from a path. normalize both paths for best results.\n\n#### minMaxInfo(min, max, report)\n\nHelper for logging compressed, uncompressed and gzipped sizes of strings.\n\n#### report\nChoices: `false`, `'min'`, `'gzip'`\nDefault: `false`\n\nEither do not report anything, report only minification result, or report minification and gzip results.\n\n**Important** Including `'gzip'` results can make this task 5-10x slower depending on the size of the file.\n\n\n```js\nvar max = grunt.file.read('max.js');\nvar min = minify(max);\nminMaxInfo(min, max, 'gzip');\n```\n\nWould print:\n\n```\nOriginal: 495 bytes.\nMinified: 396 bytes.\nGzipped: 36 bytes.\n```\n\n--\n\n*Lib submitted by [Tyler Kellen](https://goingslowly.com/).*", - "readmeFilename": "README.md", - "_id": "grunt-lib-contrib@0.6.1", - "_from": "grunt-lib-contrib@~0.6.0" -} diff --git a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/test/lib_test.js b/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/test/lib_test.js deleted file mode 100644 index 446864a..0000000 --- a/node_modules/grunt-contrib-cssmin/node_modules/grunt-lib-contrib/test/lib_test.js +++ /dev/null @@ -1,233 +0,0 @@ -var grunt = require('grunt'); -var helper = require('../lib/contrib.js').init(grunt); - -exports.lib = { - getNamespaceDeclaration: function(test) { - 'use strict'; - - test.expect(10); - - // Both test should result in this[JST] - var expected = { - namespace: 'this["JST"]', - declaration: 'this["JST"] = this["JST"] || {};' - }; - - var actual = helper.getNamespaceDeclaration("this.JST"); - test.equal(expected.namespace, actual.namespace, 'namespace with square brackets incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration with square brackets incorrect'); - - actual = helper.getNamespaceDeclaration("JST"); - test.equal(expected.namespace, actual.namespace, 'namespace with square brackets incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration with square brackets incorrect'); - - // Templates should be declared globally if this provided - expected = { - namespace: "this", - declaration: "" - }; - - actual = helper.getNamespaceDeclaration("this"); - test.equal(expected.namespace, actual.namespace, 'namespace with square brackets incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration with square brackets incorrect'); - - // Nested namespace declaration - expected = { - namespace: 'this["GUI"]["Templates"]["Main"]', - declaration: 'this["GUI"] = this["GUI"] || {};\n' + - 'this["GUI"]["Templates"] = this["GUI"]["Templates"] || {};\n' + - 'this["GUI"]["Templates"]["Main"] = this["GUI"]["Templates"]["Main"] || {};' - }; - - actual = helper.getNamespaceDeclaration("GUI.Templates.Main"); - test.equal(expected.namespace, actual.namespace, 'namespace incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration incorrect'); - - // Namespace that contains square brackets - expected = { - namespace: 'this["main"]["[test]"]["[test2]"]', - declaration: 'this["main"] = this["main"] || {};\n' + - 'this["main"]["[test]"] = this["main"]["[test]"] || {};\n' + - 'this["main"]["[test]"]["[test2]"] = this["main"]["[test]"]["[test2]"] || {};' - }; - - actual = helper.getNamespaceDeclaration("main.[test].[test2]"); - test.equal(expected.namespace, actual.namespace, 'namespace with square brackets incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration with square brackets incorrect'); - - test.done(); - }, - optsToArgs: function(test) { - 'use strict'; - - test.expect(1); - - var fixture = { - key: 'a', - key2: 1, - key3: true, - key4: false, - key5: ['a', 'b'] - }; - var expected = ['--key', 'a', '--key2', '1', '--key3', '--key5', 'a', '--key5', 'b' ].toString(); - var actual = helper.optsToArgs(fixture).toString(); - test.equal(expected, actual, 'should convert object to array of CLI arguments'); - - test.done(); - }, - stripPath: function(test) { - 'use strict'; - var path = require('path'); - - test.expect(4); - - var actual = helper.stripPath('path1/path2', 'path1'); - var expected = 'path2'; - test.equal(expected, actual, 'should strip path from a directory path and trim it.'); - - actual = helper.stripPath('path1/path2/path3/path4', 'path1/path2'); - expected = path.normalize('path3/path4'); - test.equal(expected, actual, 'should strip path from a directory path and trim it. (deep)'); - - actual = helper.stripPath('path1/file.ext', 'path1'); - expected = 'file.ext'; - test.equal(expected, actual, 'should strip path from a file path and trim it.'); - - actual = helper.stripPath('path1/path2/path3/path4/file.ext', 'path1/path2'); - expected = path.normalize('path3/path4/file.ext'); - test.equal(expected, actual, 'should strip path from a file path and trim it. (deep)'); - - test.done(); - }, - minMaxInfo: function(test) { - 'use strict'; - test.expect(3); - - var max = new Array(100).join('blah '); - var min = max.replace(/\s+/g, ''); - - var actual; - var expected; - - grunt.util.hooker.hook(grunt.log, 'writeln', { - pre: function(result) { - actual += grunt.log.uncolor(result) + grunt.util.linefeed; - return grunt.util.hooker.preempt(); - } - }); - - grunt.util.hooker.hook(grunt.log, 'write', { - pre: function(result) { - actual += grunt.log.uncolor(result); - return grunt.util.hooker.preempt(); - } - }); - - - // No reporting option - actual = ''; - expected = ''; - - helper.minMaxInfo(min, max); - test.equal(expected, actual, 'should not have reported min and max info.'); - - // Report minification results - actual = ''; - expected = [ - 'Original: 495 bytes.', - 'Minified: 396 bytes.' - ].join(grunt.util.linefeed) + grunt.util.linefeed; - - helper.minMaxInfo(min, max, 'min'); - test.equal(expected, actual, 'should have logged min and max info.'); - - // Report minification and gzip results - actual = ''; - expected = [ - 'Original: 495 bytes.', - 'Minified: 396 bytes.', - 'Gzipped: 36 bytes.' - ].join(grunt.util.linefeed) + grunt.util.linefeed; - - helper.minMaxInfo(min, max, 'gzip'); - test.equal(expected, actual, 'should have logged min, max, gzip info.'); - - grunt.util.hooker.unhook(grunt.log, 'writeln'); - grunt.util.hooker.unhook(grunt.log, 'write'); - test.done(); - }, - formatToType: { - amd: function(test) { - - 'use strict'; - - test.expect(2); - - var string = function () { }; - - var actual = helper.formatForType(string, 'amd', 'JST', 'test'); - var expected = 'JST["test"] = function () { };'; - test.equal(expected, actual, 'should format string to amd with namespace'); - - actual = helper.formatForType(string, 'amd'); - expected = "return function () { }"; - test.equal(expected, actual, 'should format string to amd'); - - test.done(); - }, - commonjs: function(test) { - - 'use strict'; - - test.expect(2); - - var string = function () { }; - - var actual = helper.formatForType(string, 'commonjs', 'JST', 'test'); - var expected = 'JST["test"] = function () { };'; - test.equal(expected, actual, 'should format string to commonjs with namespace'); - - actual = helper.formatForType(string, 'commonjs'); - expected = "module.exports = function () { }"; - test.equal(expected, actual, 'should format string to commonjs'); - - test.done(); - }, - js: function(test) { - - 'use strict'; - - test.expect(2); - - var string = function () { }; - - var actual = helper.formatForType(string, 'js', 'JST', 'test'); - var expected = 'JST["test"] = function () { };'; - test.equal(expected, actual, 'should format string to js with namespace'); - - actual = helper.formatForType(string, 'js'); - expected = 'function () { }'; - test.equal(expected, actual, 'should format string to js'); - - test.done(); - }, - html: function(test) { - - 'use strict'; - - test.expect(2); - - var string = function () { }; - - var actual = helper.formatForType(string, 'html', 'JST', 'test'); - var expected = 'function () { }'; - test.equal(expected, actual, 'should format string to html with namespace'); - - actual = helper.formatForType(string, 'html'); - expected = 'function () { }'; - test.equal(expected, actual, 'should format string to html'); - - test.done(); - } - } -}; diff --git a/node_modules/grunt-contrib-cssmin/package.json b/node_modules/grunt-contrib-cssmin/package.json deleted file mode 100644 index 2b36177..0000000 --- a/node_modules/grunt-contrib-cssmin/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "grunt-contrib-cssmin", - "description": "Compress CSS files.", - "version": "0.6.2", - "homepage": "https://github.com/gruntjs/grunt-contrib-cssmin", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-cssmin.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-cssmin/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-cssmin/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "dependencies": { - "clean-css": "~1.1.1", - "grunt-lib-contrib": "~0.6.0" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.2.0", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-clean": "~0.4.0", - "grunt-contrib-internal": "~0.4.2", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin" - ], - "contributors": [ - { - "name": "Tim Branyen", - "url": "http://goingslowly.com/" - }, - { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - { - "name": "Thomas Boyt", - "url": "http://www.thomasboyt.com/" - }, - { - "name": "Liam Kaufman", - "url": "http://liamkaufman.com/" - }, - { - "name": "Jörn Zaefferer", - "url": "http://bassistance.de" - }, - { - "name": "Braden Anderson", - "url": "http://google.com/profiles/bluej100" - } - ], - "readme": "# grunt-contrib-cssmin [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-cssmin.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-cssmin)\n\n> Compress CSS files.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-cssmin --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-contrib-cssmin');\n```\n\n*This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that [you upgrade](http://gruntjs.com/upgrading-from-0.3-to-0.4), but in case you can't please use [v0.3.2](https://github.com/gruntjs/grunt-contrib-cssmin/tree/grunt-0.3-stable).*\n\n\n\n## Cssmin task\n_Run this task with the `grunt cssmin` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n\nFiles are compressed with [clean-css](https://github.com/GoalSmashers/clean-css).\n### Options\n\n#### banner\n\nType: `String`\nDefault: `null`\n\nPrefix the compressed source with the given banner, with a linebreak inbetween.\n\n#### keepSpecialComments\n\nType: `String` `Number`\nDefault: `'*'`\n\nTo keep or remove special comments, exposing the underlying option from [clean-css](https://github.com/GoalSmashers/clean-css).. `'*'` for keeping all (default), `1` for keeping first one, `0` for removing all.\n\n#### report\nChoices: `false`, `'min'`, `'gzip'`\nDefault: `false`\n\nEither do not report anything, report only minification result, or report minification and gzip results.\nThis is useful to see exactly how well clean-css is performing but using `'gzip'` will make the task take 5-10x longer to complete.\n\nExample ouput using `'gzip'`:\n\n```\nOriginal: 198444 bytes.\nMinified: 101615 bytes.\nGzipped: 20084 bytes.\n```\n### Usage Examples\n\n#### Combine two files into one output file\n\n```js\ncssmin: {\n combine: {\n files: {\n 'path/to/output.css': ['path/to/input_one.css', 'path/to/input_two.css']\n }\n }\n}\n```\n\n#### Add a banner\n```js\ncssmin: {\n add_banner: {\n options: {\n banner: '/* My minified css file */'\n },\n files: {\n 'path/to/output.css': ['path/to/**/*.css']\n }\n }\n}\n```\n\n#### Minify all contents of a release directory and add a `.min.css` extension\n```js\ncssmin: {\n minify: {\n expand: true,\n cwd: 'release/css/',\n src: ['*.css', '!*.min.css'],\n dest: 'release/css/',\n ext: '.min.css'\n }\n}\n```\n\n\n## Release History\n\n * 2013-05-25   v0.6.1   Support import in-lining vis clean-css ~1.0.4.\n * 2013-04-05   v0.6.0   Update clean-css dependency to ~1.0.0\n * 2013-03-14   v0.5.0   Support for 'report' option (false by default)\n * 2013-03-10   v0.4.2   Add banner option Support clean-css keepSpecialComments\n * 2013-02-17   v0.4.1   Update clean-css dependency to ~0.10.0\n * 2013-02-15   v0.4.0   First official release for Grunt 0.4.0.\n * 2013-01-23   v0.4.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-09   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Switching to this.files api.\n * 2012-11-01   v0.3.2   Update clean-css dep.\n * 2012-10-12   v0.3.1   Rename grunt-contrib-lib dep to grunt-lib-contrib.\n * 2012-09-23   v0.3.0   Options no longer accepted from global config key.\n * 2012-09-10   v0.2.0   Refactored from grunt-contrib into individual repo.\n\n---\n\nTask submitted by [Tim Branyen](http://goingslowly.com/)\n\n*This file was generated on Sat May 25 2013 18:52:13.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-cssmin@0.6.2", - "_from": "grunt-contrib-cssmin@~0.6.0" -} diff --git a/node_modules/grunt-contrib-cssmin/tasks/cssmin.js b/node_modules/grunt-contrib-cssmin/tasks/cssmin.js deleted file mode 100644 index cbca4a5..0000000 --- a/node_modules/grunt-contrib-cssmin/tasks/cssmin.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * grunt-contrib-cssmin - * http://gruntjs.com/ - * - * Copyright (c) 2012 Tim Branyen, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - var helper = require('grunt-lib-contrib').init(grunt); - var path = require('path'); - - grunt.registerMultiTask('cssmin', 'Minify CSS files', function() { - var options = this.options({ - report: false - }); - this.files.forEach(function(f) { - var valid = f.src.filter(function(filepath) { - // Warn on and remove invalid source files (if nonull was set). - if (!grunt.file.exists(filepath)) { - grunt.log.warn('Source file "' + filepath + '" not found.'); - return false; - } else { - return true; - } - }); - var max = valid - .map(grunt.file.read) - .join(grunt.util.normalizelf(grunt.util.linefeed)); - var min = valid.map(function(f) { - options.relativeTo = path.dirname(f); - return minifyCSS(grunt.file.read(f), options); - }) - .join(''); - - if (min.length < 1) { - grunt.log.warn('Destination not written because minified CSS was empty.'); - } else { - if ( options.banner ) { - min = options.banner + grunt.util.linefeed + min; - } - grunt.file.write(f.dest, min); - grunt.log.writeln('File ' + f.dest + ' created.'); - if(options.report) { - helper.minMaxInfo(min, max, options.report); - } - } - }); - }); - - var minifyCSS = function(source, options) { - try { - return require('clean-css').process(source, options); - } catch (e) { - grunt.log.error(e); - grunt.fail.warn('css minification failed.'); - } - }; -}; diff --git a/node_modules/grunt-contrib-cssmin/test/cssmin_test.js b/node_modules/grunt-contrib-cssmin/test/cssmin_test.js deleted file mode 100644 index dbdc47a..0000000 --- a/node_modules/grunt-contrib-cssmin/test/cssmin_test.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -var grunt = require('grunt'); - -exports.cssmin = { - main: function(test) { - test.expect(1); - - var expect = grunt.file.read('test/expected/style.css'); - var result = grunt.file.read('tmp/style.css'); - test.equal(expect, result, 'should concat and minify an array of css files in order using clean-css'); - - test.done(); - }, - with_banner: function(test) { - test.expect(1); - - var expect = grunt.file.read('test/expected/with-banner.css'); - var result = grunt.file.read('tmp/with-banner.css'); - test.equal(expect, result, 'should concat, minify and prefix banner'); - - test.done(); - }, - empty: function(test) { - test.expect(1); - - test.ok(!grunt.file.exists('tmp/idontexist.css'), 'Empty minified file should not exist'); - - test.done(); - }, - remove_first_comment: function(test) { - test.expect(1); - - var expect = grunt.file.read('test/expected/input_bannered.css'); - var result = grunt.file.read('tmp/remove_first_comment.css'); - test.equal(expect, result, 'should minify and replace banner'); - - test.done(); - }, - imports: function(test) { - test.expect(1); - - var expect = grunt.file.read('test/expected/inline_import.css'); - var result = grunt.file.read('tmp/inline_import.css'); - test.equal(expect, result, 'should inline @import'); - - test.done(); - } -}; diff --git a/node_modules/grunt-contrib-cssmin/test/expected/inline_import.css b/node_modules/grunt-contrib-cssmin/test/expected/inline_import.css deleted file mode 100755 index a35f7ad..0000000 --- a/node_modules/grunt-contrib-cssmin/test/expected/inline_import.css +++ /dev/null @@ -1 +0,0 @@ -body{color:#00f}body{background-color:red}p{color:#0f0}p{background-color:#f0f} \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/test/expected/input_bannered.css b/node_modules/grunt-contrib-cssmin/test/expected/input_bannered.css deleted file mode 100644 index 7b61084..0000000 --- a/node_modules/grunt-contrib-cssmin/test/expected/input_bannered.css +++ /dev/null @@ -1,2 +0,0 @@ -/* custom banner */ -body{border:1px solid gold} \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/test/expected/style.css b/node_modules/grunt-contrib-cssmin/test/expected/style.css deleted file mode 100644 index 4eca6bd..0000000 --- a/node_modules/grunt-contrib-cssmin/test/expected/style.css +++ /dev/null @@ -1 +0,0 @@ -body{margin:0;font-size:18px}a{color:#00f}h1{font-size:48px;font-weight:700} \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/test/expected/with-banner.css b/node_modules/grunt-contrib-cssmin/test/expected/with-banner.css deleted file mode 100644 index b1ef5f0..0000000 --- a/node_modules/grunt-contrib-cssmin/test/expected/with-banner.css +++ /dev/null @@ -1,2 +0,0 @@ -/* module name - my awesome css banner */ -body{margin:0;font-size:18px}a{color:#00f}h1{font-size:48px;font-weight:700} \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/test/fixtures/inner/input_inline_import.css b/node_modules/grunt-contrib-cssmin/test/fixtures/inner/input_inline_import.css deleted file mode 100644 index ae82488..0000000 --- a/node_modules/grunt-contrib-cssmin/test/fixtures/inner/input_inline_import.css +++ /dev/null @@ -1,4 +0,0 @@ -@import url(input_inline_import2.css); -p { - background-color: #f0f; -} diff --git a/node_modules/grunt-contrib-cssmin/test/fixtures/inner/input_inline_import2.css b/node_modules/grunt-contrib-cssmin/test/fixtures/inner/input_inline_import2.css deleted file mode 100644 index d7f0163..0000000 --- a/node_modules/grunt-contrib-cssmin/test/fixtures/inner/input_inline_import2.css +++ /dev/null @@ -1,3 +0,0 @@ -p { - color: #0f0; -} diff --git a/node_modules/grunt-contrib-cssmin/test/fixtures/input_bannered.css b/node_modules/grunt-contrib-cssmin/test/fixtures/input_bannered.css deleted file mode 100644 index dc17477..0000000 --- a/node_modules/grunt-contrib-cssmin/test/fixtures/input_bannered.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! special banner comment */ -body { - border: 1px solid gold; -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-cssmin/test/fixtures/input_inline_import.css b/node_modules/grunt-contrib-cssmin/test/fixtures/input_inline_import.css deleted file mode 100644 index cb201fc..0000000 --- a/node_modules/grunt-contrib-cssmin/test/fixtures/input_inline_import.css +++ /dev/null @@ -1,4 +0,0 @@ -@import url(input_inline_import2.css); -body { - background-color: #f00; -} diff --git a/node_modules/grunt-contrib-cssmin/test/fixtures/input_inline_import2.css b/node_modules/grunt-contrib-cssmin/test/fixtures/input_inline_import2.css deleted file mode 100644 index 3e1c0d7..0000000 --- a/node_modules/grunt-contrib-cssmin/test/fixtures/input_inline_import2.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - color: #00f; -} diff --git a/node_modules/grunt-contrib-cssmin/test/fixtures/input_one.css b/node_modules/grunt-contrib-cssmin/test/fixtures/input_one.css deleted file mode 100644 index 0d7b9f3..0000000 --- a/node_modules/grunt-contrib-cssmin/test/fixtures/input_one.css +++ /dev/null @@ -1,5 +0,0 @@ -body { - margin: 0; - font-size: 18px; -} -a { color: #00f; } diff --git a/node_modules/grunt-contrib-cssmin/test/fixtures/input_two.css b/node_modules/grunt-contrib-cssmin/test/fixtures/input_two.css deleted file mode 100644 index 431226e..0000000 --- a/node_modules/grunt-contrib-cssmin/test/fixtures/input_two.css +++ /dev/null @@ -1,4 +0,0 @@ -h1 { - font-size: 48px; - font-weight: bold; -} diff --git a/node_modules/grunt-contrib-htmlmin/.jshintrc b/node_modules/grunt-contrib-htmlmin/.jshintrc deleted file mode 100644 index e0cc7bb..0000000 --- a/node_modules/grunt-contrib-htmlmin/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/node_modules/grunt-contrib-htmlmin/AUTHORS b/node_modules/grunt-contrib-htmlmin/AUTHORS deleted file mode 100644 index 859d240..0000000 --- a/node_modules/grunt-contrib-htmlmin/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Sindre Sorhus (http://github.com/sindresorhus) diff --git a/node_modules/grunt-contrib-htmlmin/CHANGELOG b/node_modules/grunt-contrib-htmlmin/CHANGELOG deleted file mode 100644 index 6b6e6c2..0000000 --- a/node_modules/grunt-contrib-htmlmin/CHANGELOG +++ /dev/null @@ -1,26 +0,0 @@ -v0.1.3: - date: 2013-04-06 - changes: - - Fail target when minify encounters an error. -v0.1.2: - date: 2013-04-05 - changes: - - Update html-minifier which fixes IE conditional comments and prefixed HTML elements `` ``. -v0.1.1: - date: 2013-02-18 - changes: - - First official release for Grunt 0.4.0. -v0.1.1rc7: - date: 2013-01-30 - changes: - - Updating grunt/gruntplugin dependencies to rc7. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.1.1rc5: - date: 2013-01-09 - changes: - - Updating to work with grunt v0.4.0rc5. - - Switching to this.filesSrc api. -v0.1.0: - date: 2012-11-01 - changes: - - Initial release. diff --git a/node_modules/grunt-contrib-htmlmin/CONTRIBUTING.md b/node_modules/grunt-contrib-htmlmin/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-htmlmin/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-htmlmin/Gruntfile.js b/node_modules/grunt-contrib-htmlmin/Gruntfile.js deleted file mode 100644 index d499382..0000000 --- a/node_modules/grunt-contrib-htmlmin/Gruntfile.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * grunt-contrib-sass - * http://gruntjs.com/ - * - * Copyright (c) 2012 Sindre Sorhus, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function (grunt) { - grunt.initConfig({ - jshint: { - options: { - jshintrc: '.jshintrc' - }, - all: [ - 'Gruntfile.js', - 'tasks/*.js', - '<%= nodeunit.tests %>' - ] - }, - clean: { - test: ['tmp'] - }, - htmlmin: { - options: { - removeComments: true, - collapseWhitespace: true - }, - compile: { - files: { - 'tmp/test.html': ['test/fixtures/test.html'] - } - }, - multiple: { - files: { - 'tmp/multiple.html': ['test/fixtures/multiple*.html'] - } - }, - empty: { - files: { - 'tmp/idontexist.html': ['test/fixtures/idontexist.html'] - } - } - }, - nodeunit: { - tests: ['test/*_test.js'] - } - }); - - grunt.loadTasks('tasks'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - grunt.registerTask('test', ['clean', 'htmlmin', 'nodeunit']); - grunt.registerTask('default', ['jshint', 'test', 'build-contrib']); -}; diff --git a/node_modules/grunt-contrib-htmlmin/LICENSE-MIT b/node_modules/grunt-contrib-htmlmin/LICENSE-MIT deleted file mode 100644 index 7de6e6f..0000000 --- a/node_modules/grunt-contrib-htmlmin/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Sindre Sorhus, 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/node_modules/grunt-contrib-htmlmin/docs/htmlmin-examples.md b/node_modules/grunt-contrib-htmlmin/docs/htmlmin-examples.md deleted file mode 100644 index 0b042ab..0000000 --- a/node_modules/grunt-contrib-htmlmin/docs/htmlmin-examples.md +++ /dev/null @@ -1,26 +0,0 @@ -## Example config - -```javascript -grunt.initConfig({ - htmlmin: { // Task - dist: { // Target - options: { // Target options - removeComments: true, - collapseWhitespace: true - }, - files: { // Dictionary of files - 'dist/index.html': 'src/index.html', // 'destination': 'source' - 'dist/contact.html': 'src/contact.html' - } - }, - dev: { // Another target - files: { - 'dist/index.html': 'src/index.html', - 'dist/contact.html': 'src/contact.html' - } - } - } -}); - -grunt.registerTask('default', ['htmlmin']); -``` diff --git a/node_modules/grunt-contrib-htmlmin/docs/htmlmin-options.md b/node_modules/grunt-contrib-htmlmin/docs/htmlmin-options.md deleted file mode 100644 index 7d1f137..0000000 --- a/node_modules/grunt-contrib-htmlmin/docs/htmlmin-options.md +++ /dev/null @@ -1,90 +0,0 @@ -# Options - -See the [html-minifier docs](http://perfectionkills.com/experimenting-with-html-minifier/#options) for more in-depth explanation of the options and caveats. - -## removeComments - -Type: `Boolean` -Default: `false` - -Strip HTML comments. - -## removeCommentsFromCDATA - -Type: `Boolean` -Default: `false` - -Remove HTML comments from inside ` - -``` - -In the browser, you can attach the forEach method to any object. - -```html - - - -``` - -## The General Idea (Why I thought this was worth sharing) - -The idea is to allow the callback to decide _at runtime_ whether the loop will be synchronous or asynchronous. By using `this` in a creative way (in situations where that value isn't already spoken for), an entire control API can be offered without over-complicating function signatures. - -```javascript -forEach(arr, function(item, index) { - // Synchronous. -}); - -forEach(arr, function(item, index) { - // Only when `this.async` is called does iteration becomes asynchronous. The - // loop won't be continued until the `done` function is executed. - var done = this.async(); - // Continue in one second. - setTimeout(done, 1000); -}); - -forEach(arr, function(item, index) { - // Break out of synchronous iteration early by returning false. - return index !== 1; -}); - -forEach(arr, function(item, index) { - // Break out of asynchronous iteration early... - var done = this.async(); - // ...by passing false to the done function. - setTimeout(function() { - done(index !== 1); - }); -}); -``` - -## Examples -See the unit tests for more examples. - -```javascript -// Generic "done" callback. -function allDone(notAborted, arr) { - console.log("done", notAborted, arr); -} - -// Synchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Synchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - if (item === "b") { return false; } -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] - -// Asynchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(); - }, 500); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Asynchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(item !== "b"); - }, 500); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] - -// Not actually asynchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async() - done(); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Not actually asynchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - done(item !== "b"); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] -``` - -## 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](https://github.com/cowboy/grunt). - -_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_ - -## Release History - -04/29/2013 -v0.1.3 -Removed hard Node.js version dependency. - -11/17/2011 -v0.1.2 -Adding sparse array support. -Invalid length properties are now sanitized. -This closes issue #1 (like a boss). - -11/11/2011 -v0.1.1 -Refactored code to be much simpler. Yay for unit tests! - -11/11/2011 -v0.1.0 -Initial Release. - -## License -Copyright (c) 2012 "Cowboy" Ben Alman -Licensed under the MIT license. - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js deleted file mode 100644 index 64c6eb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js +++ /dev/null @@ -1,58 +0,0 @@ -/* JavaScript Sync/Async forEach - v0.1.2 - 1/10/2012 - * http://github.com/cowboy/javascript-sync-async-foreach - * Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ - -(function(exports) { - - // Iterate synchronously or asynchronously. - exports.forEach = function(arr, eachFn, doneFn) { - var i = -1; - // Resolve array length to a valid (ToUint32) number. - var len = arr.length >>> 0; - - // This IIFE is called once now, and then again, by name, for each loop - // iteration. - (function next(result) { - // This flag will be set to true if `this.async` is called inside the - // eachFn` callback. - var async; - // Was false returned from the `eachFn` callback or passed to the - // `this.async` done function? - var abort = result === false; - - // Increment counter variable and skip any indices that don't exist. This - // allows sparse arrays to be iterated. - do { ++i; } while (!(i in arr) && i !== len); - - // Exit if result passed to `this.async` done function or returned from - // the `eachFn` callback was false, or when done iterating. - if (abort || i === len) { - // If a `doneFn` callback was specified, invoke that now. Pass in a - // boolean value representing "not aborted" state along with the array. - if (doneFn) { - doneFn(!abort, arr); - } - return; - } - - // Invoke the `eachFn` callback, setting `this` inside the callback to a - // custom object that contains one method, and passing in the array item, - // index, and the array. - result = eachFn.call({ - // If `this.async` is called inside the `eachFn` callback, set the async - // flag and return a function that can be used to continue iterating. - async: function() { - async = true; - return next; - } - }, arr[i], i, arr); - - // If the async flag wasn't set, continue by calling `next` synchronously, - // passing in the result of the `eachFn` callback. - if (!async) { - next(result); - } - }()); - }; - -}(typeof exports === "object" && exports || this)); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js deleted file mode 100644 index c218a91..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/* JavaScript Sync/Async forEach - v0.1.2 - 1/10/2012 - * http://github.com/cowboy/javascript-sync-async-foreach - * Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ -(function(a){a.forEach=function(a,b,c){var d=-1,e=a.length>>>0;(function f(g){var h,j=g===!1;do++d;while(!(d in a)&&d!==e);if(j||d===e){c&&c(!j,a);return}g=b.call({async:function(){return h=!0,f}},a[d],d,a),h||f(g)})()}})(typeof exports=="object"&&exports||this) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js deleted file mode 100644 index 079a23a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js +++ /dev/null @@ -1,48 +0,0 @@ -/*global config:true, task:true*/ -config.init({ - pkg: '', - meta: { - title: 'JavaScript Sync/Async forEach', - license: ['MIT'], - copyright: 'Copyright (c) 2012 "Cowboy" Ben Alman', - banner: '/* {{meta.title}} - v{{pkg.version}} - {{today "m/d/yyyy"}}\n' + - ' * {{pkg.homepage}}\n' + - ' * {{{meta.copyright}}}; Licensed {{join meta.license}} */' - }, - concat: { - 'dist/ba-foreach.js': ['', ''] - }, - min: { - 'dist/ba-foreach.min.js': ['', 'dist/ba-foreach.js'] - }, - test: { - files: ['test/**/*.js'] - }, - lint: { - files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] - }, - watch: { - files: '', - tasks: 'lint:files test:files' - }, - jshint: { - options: { - curly: true, - eqeqeq: true, - immed: true, - latedef: true, - newcap: true, - noarg: true, - sub: true, - undef: true, - eqnull: true - }, - globals: { - exports: true - } - }, - uglify: {} -}); - -// Default task. -task.registerTask('default', 'lint:files test:files concat min'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js deleted file mode 100644 index 9ee98b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * Sync/Async forEach - * https://github.com/cowboy/javascript-sync-async-foreach - * - * Copyright (c) 2012 "Cowboy" Ben Alman - * Licensed under the MIT license. - * http://benalman.com/about/license/ - */ - -(function(exports) { - - // Iterate synchronously or asynchronously. - exports.forEach = function(arr, eachFn, doneFn) { - var i = -1; - // Resolve array length to a valid (ToUint32) number. - var len = arr.length >>> 0; - - // This IIFE is called once now, and then again, by name, for each loop - // iteration. - (function next(result) { - // This flag will be set to true if `this.async` is called inside the - // eachFn` callback. - var async; - // Was false returned from the `eachFn` callback or passed to the - // `this.async` done function? - var abort = result === false; - - // Increment counter variable and skip any indices that don't exist. This - // allows sparse arrays to be iterated. - do { ++i; } while (!(i in arr) && i !== len); - - // Exit if result passed to `this.async` done function or returned from - // the `eachFn` callback was false, or when done iterating. - if (abort || i === len) { - // If a `doneFn` callback was specified, invoke that now. Pass in a - // boolean value representing "not aborted" state along with the array. - if (doneFn) { - doneFn(!abort, arr); - } - return; - } - - // Invoke the `eachFn` callback, setting `this` inside the callback to a - // custom object that contains one method, and passing in the array item, - // index, and the array. - result = eachFn.call({ - // If `this.async` is called inside the `eachFn` callback, set the async - // flag and return a function that can be used to continue iterating. - async: function() { - async = true; - return next; - } - }, arr[i], i, arr); - - // If the async flag wasn't set, continue by calling `next` synchronously, - // passing in the result of the `eachFn` callback. - if (!async) { - next(result); - } - }()); - }; - -}(typeof exports === "object" && exports || this)); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json deleted file mode 100644 index a55647b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "name": "async-foreach", - "description": "An optionally-asynchronous forEach with an interesting interface.", - "version": "0.1.3", - "homepage": "http://github.com/cowboy/javascript-sync-async-foreach", - "bugs": { - "url": "https://github.com/cowboy/javascript-sync-async-foreach/issues" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/javascript-sync-async-foreach.git" - }, - "main": "lib/foreach", - "engines": { - "node": "*" - }, - "keywords": [ - "array", - "loop", - "sync", - "async", - "foreach" - ], - "dependencies": {}, - "devDependencies": {}, - "readme": "# JavaScript Sync/Async forEach\n\nAn optionally-asynchronous forEach with an interesting interface.\n\n## Getting Started\n\nThis code should work just fine in Node.js:\n\nFirst, install the module with: `npm install async-foreach`\n\n```javascript\nvar forEach = require('async-foreach').forEach;\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n});\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n```\n\nOr in the browser:\n\n```html\n\n\n```\n\nIn the browser, you can attach the forEach method to any object.\n\n```html\n\n\n\n```\n\n## The General Idea (Why I thought this was worth sharing)\n\nThe idea is to allow the callback to decide _at runtime_ whether the loop will be synchronous or asynchronous. By using `this` in a creative way (in situations where that value isn't already spoken for), an entire control API can be offered without over-complicating function signatures.\n\n```javascript\nforEach(arr, function(item, index) {\n // Synchronous.\n});\n\nforEach(arr, function(item, index) {\n // Only when `this.async` is called does iteration becomes asynchronous. The\n // loop won't be continued until the `done` function is executed.\n var done = this.async();\n // Continue in one second.\n setTimeout(done, 1000);\n});\n\nforEach(arr, function(item, index) {\n // Break out of synchronous iteration early by returning false.\n return index !== 1;\n});\n\nforEach(arr, function(item, index) {\n // Break out of asynchronous iteration early...\n var done = this.async();\n // ...by passing false to the done function.\n setTimeout(function() {\n done(index !== 1);\n });\n});\n```\n\n## Examples\nSee the unit tests for more examples.\n\n```javascript\n// Generic \"done\" callback.\nfunction allDone(notAborted, arr) {\n console.log(\"done\", notAborted, arr);\n}\n\n// Synchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Synchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n if (item === \"b\") { return false; }\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n\n// Asynchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n setTimeout(function() {\n done();\n }, 500);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Asynchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n setTimeout(function() {\n done(item !== \"b\");\n }, 500);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n\n// Not actually asynchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async()\n done();\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Not actually asynchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n done(item !== \"b\");\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n```\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](https://github.com/cowboy/grunt).\n\n_Also, please don't edit files in the \"dist\" subdirectory as they are generated via grunt. You'll find source code in the \"lib\" subdirectory!_\n\n## Release History\n\n04/29/2013\nv0.1.3\nRemoved hard Node.js version dependency.\n\n11/17/2011\nv0.1.2\nAdding sparse array support.\nInvalid length properties are now sanitized.\nThis closes issue #1 (like a boss).\n\n11/11/2011\nv0.1.1\nRefactored code to be much simpler. Yay for unit tests!\n\n11/11/2011\nv0.1.0\nInitial Release.\n\n## License\nCopyright (c) 2012 \"Cowboy\" Ben Alman \nLicensed under the MIT license. \n\n", - "readmeFilename": "README.md", - "_id": "async-foreach@0.1.3", - "dist": { - "shasum": "fcc0e658c316931d1c56909a12c8370eafc16cfa" - }, - "_from": "async-foreach@~0.1.3", - "_resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js deleted file mode 100644 index be18c43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js +++ /dev/null @@ -1,200 +0,0 @@ -/*global require:true, setTimeout:true */ -var forEach = require('../lib/foreach').forEach; - -exports['foreach'] = { - setUp: function(done) { - this.order = []; - this.track = function() { - [].push.apply(this.order, arguments); - }; - done(); - }, - 'Synchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr - ], "should call eachFn for each array item, in order."); - test.done(); - }, - 'Synchronous, done': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }, - 'Synchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - if (item === "b") { return false; } - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }, - 'Asynchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(done, 10); - }); - - setTimeout(function() { - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr - ], "should call eachFn for each array item, in order."); - test.done(); - }, 100); - }, - 'Asynchronous, done': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(done, 10); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Asynchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(item !== "b"); - }, 10); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Not actually asynchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - done(); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Not actually asynchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - done(item !== "b"); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Sparse array support': function(test) { - test.expect(1); - var that = this; - - var arr = []; - arr[0] = "a"; - arr[9] = "z"; - - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "z", 9, arr - ], "should skip nonexistent array items."); - test.done(); - }, - 'Invalid length sanitization': function(test) { - test.expect(1); - var that = this; - - var obj = {length: 4294967299, 0: "a", 2: "b", 3: "c" }; - - forEach(obj, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, obj, - "each", "b", 2, obj - ], "should sanitize length property (ToUint32)."); - test.done(); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md deleted file mode 100644 index dea4f3d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# decompress [![Build Status](https://secure.travis-ci.org/kevva/decompress.png?branch=master)](http://travis-ci.org/kevva/decompress) - -Easily extract `.zip`, `.tar` and `.tar.gz` archives. Based on the extract -utility in [Bower](https://github.com/bower/bower). - -## Getting started - -Install with [npm](https://npmjs.org/package/decompress): `npm install decompress` - -## Examples - -You'll only need to pass a type into `ext` and it'll figure the rest out for -you. - -```js -var decompress = require('decompress'); -var fs = require('fs'); - -var src = fs.createReadStream('foo.tar.gz'); -var dest = decompress.extract({ ext: '.tar.gz' }); - -src.pipe(dest); -``` - -## API - -### .extract(opts) - -Extract an archive using the `ext` option to determine which extractor to use. -If no `path` is specified it'll extract it to your current location. - -### .canExtract(src, mime) - -Determine if a file can be extracted or not by checking the file extension -and/or the MIME type. - -```js -decompress.canExtract('foo.zip'); -// => true - -decompress.canExtract('application/zip'); -// => true -``` - -## Options - -* `ext` — String that can be a file name, URL, MIME type etc. -* `path` — Path to extract the archive to. If no `path` is defined it'll -extract it to your current location. -* `strip` — Equivalent to `--strip-components` for tar. - -## License - -[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js deleted file mode 100644 index 5c65d4c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js +++ /dev/null @@ -1,167 +0,0 @@ -'use strict'; - -var AdmZip = require('adm-zip'); -var fs = require('fs'); -var mkdir = require('mkdirp'); -var mout = require('mout'); -var path = require('path'); -var pipeline = require('stream-combiner'); -var rm = require('rimraf'); -var tar = require('tar'); -var temp = require('temp'); -var zlib = require('zlib'); - -/** - * Initialize Decompress with options - * - * Options: - * - * - `ext` String with file name, MIME type, etc - * - `path` Path to extract to - * - * @param {Object} opts - * @api private - */ - -function Decompress(opts) { - opts = opts || {}; - opts.strip = opts.strip || 0; - this.opts = opts; - this.path = opts.path || process.cwd(); - this.ext = opts.ext || ''; - this.strip = opts.strip >= 0 ? opts.strip : 0; - this.extractors = { - '.zip': this._extractZip, - '.tar': this._extractTar, - '.tar.gz': this._extractTarGz, - '.tgz': this._extractTarGz, - 'application/zip': this._extractZip, - 'application/x-tar': this._extractTar, - 'application/x-tgz': this._extractTarGz - }; - this.extractorTypes = Object.keys(this.extractors); - this.extractor = this._getExtractor(this.ext); -} - -/** - * Extract an archive - * - * @api public - */ - -Decompress.prototype.extract = function () { - var self = this; - var stream = this.extractor(); - - if (!fs.existsSync(this.path)) { - mkdir.sync(self.path); - } - - return stream; -}; - -/** - * Check if a file can be extracted - * - * @param {String} src - * @param {String} mime - * @api public - */ - -Decompress.prototype.canExtract = function (src, mime) { - if (this._getExtractor(src)) { - return true; - } - - if (mime && this._getExtractor(mime)) { - return true; - } - - return false; -}; - -/** - * Get the extractor for a desired file - * - * @param {String} src - * @api private - */ - -Decompress.prototype._getExtractor = function (src) { - src = src.toLowerCase(); - - var ext = mout.array.find(this.extractorTypes, function (ext) { - return mout.string.endsWith(src, ext); - }); - - return ext ? this.extractors[ext] : null; -}; - -/** - * Extract a zip file - * - * @api private - */ - -Decompress.prototype._extractZip = function () { - var self = this; - var tmp = temp.path({ suffix: '.zip' }); - - var stream = fs.createWriteStream(tmp).on('close', function () { - var zip = new AdmZip(tmp); - var zipEntries = zip.getEntries(); - - zipEntries.forEach(function (entry) { - var e = entry.entryName.toString().split('/').slice(self.strip).join('/'); - var d = path.join(self.path, e); - var c = entry.getData().toString(); - - if (!entry.isDirectory) { - mkdir.sync(path.dirname(d)); - fs.writeFileSync(d, c); - } - }); - }); - - return stream.on('close', function () { - rm.sync(tmp); - }); -}; - -/** - * Extract a tar file - * - * @api private - */ - -Decompress.prototype._extractTar = function () { - var stream = tar.Extract(this.opts); - return stream; -}; - -/** - * Extract a tar.gz file - * - * @api private - */ - -Decompress.prototype._extractTarGz = function () { - var stream = zlib.Unzip(); - var dest = tar.Extract(this.opts); - - return pipeline(stream, dest); -}; - -/** - * Module exports - */ - -module.exports.extract = function (opts) { - var decompress = new Decompress(opts); - return decompress.extract(); -}; - -module.exports.canExtract = function (src, mime) { - var decompress = new Decompress(); - return decompress.canExtract(src, mime); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt deleted file mode 100644 index 14c3ee5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2012 Another-D-Mention Software and other contributors, -http://www.another-d-mention.ro/ - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md deleted file mode 100644 index 84296fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# ADM-ZIP for NodeJS - -ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/). - -# Installation - -With [npm](http://npmjs.org) do: - - $ npm install adm-zip - -## What is it good for? -The library allows you to: - -* decompress zip files directly to disk or in memory buffers -* compress files and store them to disk in .zip format or in compressed buffers -* update content of/add new/delete files from an existing .zip - -# Dependencies -There are no other nodeJS libraries that ADM-ZIP is dependent of - -# Examples - -## Basic usage -```javascript - - var AdmZip = require('adm-zip'); - - // reading archives - var zip = new AdmZip("./my_file.zip"); - var zipEntries = zip.getEntries(); // an array of ZipEntry records - - zipEntries.forEach(function(zipEntry) { - console.log(zipEntry.toString()); // outputs zip entries information - if (zipEntry.entryName == "my_file.txt") { - console.log(zipEntry.data.toString('utf8')); - } - }); - // outputs the content of some_folder/my_file.txt - console.log(zip.readAsText("some_folder/my_file.txt")); - // extracts the specified file to the specified location - zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*overwrite*/true) - // extracts everything - zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); - - - // creating archives - var zip = new AdmZip(); - - // add file directly - zip.addFile("test.txt", new Buffer("inner content of the file"), "entry comment goes here"); - // add local file - zip.addLocalFile("/home/me/some_picture.png"); - // get everything as a buffer - var willSendthis = zip.toBuffer(); - // or write everything to disk - zip.writeZip(/*target file name*/"/home/me/files.zip"); - - - // ... more examples in the wiki -``` - -For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki). - -[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js deleted file mode 100644 index fcfa00b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js +++ /dev/null @@ -1,387 +0,0 @@ -var fs = require("fs"), - pth = require("path"); - -fs.existsSync = fs.existsSync || pth.existsSync; - -var ZipEntry = require("./zipEntry"), - ZipFile = require("./zipFile"), - Utils = require("./util"); - -module.exports = function(/*String*/input) { - var _zip = undefined, - _filename = ""; - - if (input && typeof input === "string") { // load zip file - if (fs.existsSync(input)) { - _filename = input; - _zip = new ZipFile(input, Utils.Constants.FILE); - } else { - throw Utils.Errors.INVALID_FILENAME; - } - } else if(input && Buffer.isBuffer(input)) { // load buffer - _zip = new ZipFile(input, Utils.Constants.BUFFER); - } else { // create new zip file - _zip = new ZipFile(null, Utils.Constants.NONE); - } - - function getEntry(/*Object*/entry) { - if (entry && _zip) { - var item; - // If entry was given as a file name - if (typeof entry === "string") - item = _zip.getEntry(entry); - // if entry was given as a ZipEntry object - if (typeof entry === "object" && entry.entryName != undefined && entry.header != undefined) - item = _zip.getEntry(entry.entryName); - - if (item) { - return item; - } - } - return null; - } - - return { - /** - * Extracts the given entry from the archive and returns the content as a Buffer object - * @param entry ZipEntry object or String with the full path of the entry - * - * @return Buffer or Null in case of error - */ - readFile : function(/*Object*/entry) { - var item = getEntry(entry); - return item && item.getData() || null; - }, - - /** - * Asynchronous readFile - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * - * @return Buffer or Null in case of error - */ - readFileAsync : function(/*Object*/entry, /*Function*/callback) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(callback); - } else { - callback(null,"getEntry failed for:" + entry) - } - }, - - /** - * Extracts the given entry from the archive and returns the content as plain text in the given encoding - * @param entry ZipEntry object or String with the full path of the entry - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsText : function(/*Object*/entry, /*String - Optional*/encoding) { - var item = getEntry(entry); - if (item) { - var data = item.getData(); - if (data && data.length) { - return data.toString(encoding || "utf8"); - } - } - return ""; - }, - - /** - * Asynchronous readAsText - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsTextAsync : function(/*Object*/entry, /*Function*/callback, /*String - Optional*/encoding) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(function(data) { - if (data && data.length) { - callback(data.toString(encoding || "utf8")); - } else { - callback(""); - } - }) - } else { - callback(""); - } - }, - - /** - * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory - * - * @param entry - */ - deleteFile : function(/*Object*/entry) { // @TODO: test deleteFile - var item = getEntry(entry); - if (item) { - _zip.deleteEntry(item.entryName); - } - }, - - /** - * Adds a comment to the zip. The zip must be rewritten after adding the comment. - * - * @param comment - */ - addZipComment : function(/*String*/comment) { // @TODO: test addZipComment - _zip.comment = comment; - }, - - /** - * Returns the zip comment - * - * @return String - */ - getZipComment : function() { - return _zip.comment || ''; - }, - - /** - * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment - * The comment cannot exceed 65535 characters in length - * - * @param entry - * @param comment - */ - addZipEntryComment : function(/*Object*/entry,/*String*/comment) { - var item = getEntry(entry); - if (item) { - item.comment = comment; - } - }, - - /** - * Returns the comment of the specified entry - * - * @param entry - * @return String - */ - getZipEntryComment : function(/*Object*/entry) { - var item = getEntry(entry); - if (item) { - return item.comment || ''; - } - return '' - }, - - /** - * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content - * - * @param entry - * @param content - */ - updateFile : function(/*Object*/entry, /*Buffer*/content) { - var item = getEntry(entry); - if (item) { - item.setData(content); - } - }, - - /** - * Adds a file from the disk to the archive - * - * @param localPath - */ - addLocalFile : function(/*String*/localPath) { - if (fs.existsSync(localPath)) { - var p = localPath.split("\\").join("/").split("/").pop(); - this.addFile(p, fs.readFileSync(localPath), "", 0) - } else { - throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath); - } - }, - - /** - * Adds a local directory and all its nested files and directories to the archive - * - * @param localPath - */ - addLocalFolder : function(/*String*/localPath) { - localPath = localPath.split("\\").join("/"); //windows fix - if (localPath.charAt(localPath.length - 1) != "/") - localPath += "/"; - - if (fs.existsSync(localPath)) { - - var items = Utils.findFiles(localPath), - self = this; - - if (items.length) { - items.forEach(function(path) { - var p = path.split("\\").join("/").replace(localPath, ""); //windows fix - if (p.charAt(p.length - 1) !== "/") { - self.addFile(p, fs.readFileSync(path), "", 0) - } else { - self.addFile(p, new Buffer(0), "", 0) - } - }); - } - } else { - throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath); - } - }, - - /** - * Allows you to create a entry (file or directory) in the zip file. - * If you want to create a directory the entryName must end in / and a null buffer should be provided. - * Comment and attributes are optional - * - * @param entryName - * @param content - * @param comment - * @param attr - */ - addFile : function(/*String*/entryName, /*Buffer*/content, /*String*/comment, /*Number*/attr) { - var entry = new ZipEntry(); - entry.entryName = entryName; - entry.comment = comment || ""; - entry.attr = attr || 0666; - if (entry.isDirectory && content.length) { - // throw Utils.Errors.DIRECTORY_CONTENT_ERROR; - } - entry.setData(content); - _zip.setEntry(entry); - }, - - /** - * Returns an array of ZipEntry objects representing the files and folders inside the archive - * - * @return Array - */ - getEntries : function() { - if (_zip) { - return _zip.entries; - } else { - return []; - } - }, - - /** - * Returns a ZipEntry object representing the file or folder specified by ``name``. - * - * @param name - * @return ZipEntry - */ - getEntry : function(/*String*/name) { - return getEntry(name); - }, - - /** - * Extracts the given entry to the given targetPath - * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted - * - * @param entry ZipEntry object or String with the full path of the entry - * @param targetPath Target folder where to write the file - * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder - * will be created in targetPath as well. Default is TRUE - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - * - * @return Boolean - */ - extractEntryTo : function(/*Object*/entry, /*String*/targetPath, /*Boolean*/maintainEntryPath, /*Boolean*/overwrite) { - overwrite = overwrite || false; - maintainEntryPath = typeof maintainEntryPath == "undefined" ? true : maintainEntryPath; - - var item = getEntry(entry); - if (!item) { - throw Utils.Errors.NO_ENTRY; - } - - var target = pth.resolve(targetPath, maintainEntryPath ? item.entryName : pth.basename(item.entryName)); - - if (item.isDirectory) { - target = pth.resolve(target, ".."); - var children = _zip.getEntryChildren(item); - children.forEach(function(child) { - if (child.isDirectory) return; - var content = child.getData(); - if (!content) { - throw Utils.Errors.CANT_EXTRACT_FILE; - } - Utils.writeFileTo(pth.resolve(targetPath, maintainEntryPath ? child.entryName : child.entryName.substr(item.entryName.length)), content, overwrite); - }); - return true; - } - - var content = item.getData(); - if (!content) throw Utils.Errors.CANT_EXTRACT_FILE; - - if (fs.existsSync(targetPath) && !overwrite) { - throw Utils.Errors.CANT_OVERRIDE; - } - Utils.writeFileTo(target, content, overwrite); - - return true; - }, - - /** - * Extracts the entire archive to the given location - * - * @param targetPath Target location - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - */ - extractAllTo : function(/*String*/targetPath, /*Boolean*/overwrite) { - overwrite = overwrite || false; - if (!_zip) { - throw Utils.Errors.NO_ZIP; - } - - _zip.entries.forEach(function(entry) { - if (entry.isDirectory) { - Utils.makeDir(pth.resolve(targetPath, entry.entryName.toString())); - return; - } - var content = entry.getData(); - if (!content) { - throw Utils.Errors.CANT_EXTRACT_FILE + "2"; - } - Utils.writeFileTo(pth.resolve(targetPath, entry.entryName.toString()), content, overwrite); - }) - }, - - /** - * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip - * - * @param targetFileName - * @param callback - */ - writeZip : function(/*String*/targetFileName, /*Function*/callback) { - if (arguments.length == 1) { - if (typeof targetFileName == "function") { - callback = targetFileName; - targetFileName = ""; - } - } - - if (!targetFileName && _filename) { - targetFileName = _filename; - } - if (!targetFileName) return; - - var zipData = _zip.compressToBuffer(); - if (zipData) { - Utils.writeFileTo(targetFileName, zipData, true); - } - }, - - /** - * Returns the content of the entire zip file as a Buffer object - * - * @return Buffer - */ - toBuffer : function(/*Function*/callback) { - this.valueOf = 2; - if (typeof callback == "function") { - _zip.toAsyncBuffer(callback); - return null; - } - return _zip.compressToBuffer() - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js deleted file mode 100644 index a29c70f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js +++ /dev/null @@ -1,261 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The central directory file header */ -module.exports = function () { - var _verMade = 0x0A, - _version = 0x0A, - _flags = 0, - _method = 0, - _time = 0, - _crc = 0, - _compressedSize = 0, - _size = 0, - _fnameLen = 0, - _extraLen = 0, - - _comLen = 0, - _diskStart = 0, - _inattr = 0, - _attr = 0, - _offset = 0; - - var _dataHeader = {}; - - function setTime(val) { - var val = new Date(val); - _time = (val.getFullYear() - 1980 & 0x7f) << 25 // b09-16 years from 1980 - | (val.getMonth() + 1) << 21 // b05-08 month - | val.getDay() << 16 // b00-04 hour - - // 2 bytes time - | val.getHours() << 11 // b11-15 hour - | val.getMinutes() << 5 // b05-10 minute - | val.getSeconds() >> 1; // b00-04 seconds divided by 2 - } - - setTime(+new Date()); - - return { - get made () { return _verMade; }, - set made (val) { _verMade = val; }, - - get version () { return _version; }, - set version (val) { _version = val }, - - get flags () { return _flags }, - set flags (val) { _flags = val; }, - - get method () { return _method; }, - set method (val) { _method = val; }, - - get time () { return new Date( - ((_time >> 25) & 0x7f) + 1980, - ((_time >> 21) & 0x0f) - 1, - (_time >> 16) & 0x1f, - (_time >> 11) & 0x1f, - (_time >> 5) & 0x3f, - (_time & 0x1f) << 1 - ); - }, - set time (val) { - setTime(val); - }, - - get crc () { return _crc; }, - set crc (val) { _crc = val; }, - - get compressedSize () { return _compressedSize; }, - set compressedSize (val) { _compressedSize = val; }, - - get size () { return _size; }, - set size (val) { _size = val; }, - - get fileNameLength () { return _fnameLen; }, - set fileNameLength (val) { _fnameLen = val; }, - - get extraLength () { return _extraLen }, - set extraLength (val) { _extraLen = val; }, - - get commentLength () { return _comLen }, - set commentLength (val) { _comLen = val }, - - get diskNumStart () { return _diskStart }, - set diskNumStart (val) { _diskStart = val }, - - get inAttr () { return _inattr }, - set inAttr (val) { _inattr = val }, - - get attr () { return _attr }, - set attr (val) { _attr = val }, - - get offset () { return _offset }, - set offset (val) { _offset = val }, - - get encripted () { return (_flags & 1) == 1 }, - - get entryHeaderSize () { - return Constants.CENHDR + _fnameLen + _extraLen + _comLen; - }, - - get realDataOffset () { - return _offset + Constants.LOCHDR + _dataHeader.fnameLen + _dataHeader.extraLen; - }, - - get dataHeader () { - return _dataHeader; - }, - - loadDataHeaderFromBinary : function(/*Buffer*/input) { - var data = input.slice(_offset, _offset + Constants.LOCHDR); - // 30 bytes and should start with "PK\003\004" - if (data.readUInt32LE(0) != Constants.LOCSIG) { - throw Utils.Errors.INVALID_LOC; - } - _dataHeader = { - // version needed to extract - version : data.readUInt16LE(Constants.LOCVER), - // general purpose bit flag - flags : data.readUInt16LE(Constants.LOCFLG), - // compression method - method : data.readUInt16LE(Constants.LOCHOW), - // modification time (2 bytes time, 2 bytes date) - time : data.readUInt32LE(Constants.LOCTIM), - // uncompressed file crc-32 value - crc : data.readUInt32LE(Constants.LOCCRC), - // compressed size - compressedSize : data.readUInt32LE(Constants.LOCSIZ), - // uncompressed size - size : data.readUInt32LE(Constants.LOCLEN), - // filename length - fnameLen : data.readUInt16LE(Constants.LOCNAM), - // extra field length - extraLen : data.readUInt16LE(Constants.LOCEXT) - } - }, - - loadFromBinary : function(/*Buffer*/data) { - // data should be 46 bytes and start with "PK 01 02" - if (data.length != Constants.CENHDR || data.readUInt32LE(0) != Constants.CENSIG) { - throw Utils.Errors.INVALID_CEN; - } - // version made by - _verMade = data.readUInt16LE(Constants.CENVEM); - // version needed to extract - _version = data.readUInt16LE(Constants.CENVER); - // encrypt, decrypt flags - _flags = data.readUInt16LE(Constants.CENFLG); - // compression method - _method = data.readUInt16LE(Constants.CENHOW); - // modification time (2 bytes time, 2 bytes date) - _time = data.readUInt32LE(Constants.CENTIM); - // uncompressed file crc-32 value - _crc = data.readUInt32LE(Constants.CENCRC); - // compressed size - _compressedSize = data.readUInt32LE(Constants.CENSIZ); - // uncompressed size - _size = data.readUInt32LE(Constants.CENLEN); - // filename length - _fnameLen = data.readUInt16LE(Constants.CENNAM); - // extra field length - _extraLen = data.readUInt16LE(Constants.CENEXT); - // file comment length - _comLen = data.readUInt16LE(Constants.CENCOM); - // volume number start - _diskStart = data.readUInt16LE(Constants.CENDSK); - // internal file attributes - _inattr = data.readUInt16LE(Constants.CENATT); - // external file attributes - _attr = data.readUInt32LE(Constants.CENATX); - // LOC header offset - _offset = data.readUInt32LE(Constants.CENOFF); - }, - - dataHeaderToBinary : function() { - // LOC header size (30 bytes) - var data = new Buffer(Constants.LOCHDR); - // "PK\003\004" - data.writeUInt32LE(Constants.LOCSIG, 0); - // version needed to extract - data.writeUInt16LE(_version, Constants.LOCVER); - // general purpose bit flag - data.writeUInt16LE(_flags, Constants.LOCFLG); - // compression method - data.writeUInt16LE(_method, Constants.LOCHOW); - // modification time (2 bytes time, 2 bytes date) - data.writeUInt32LE(_time, Constants.LOCTIM); - // uncompressed file crc-32 value - data.writeUInt32LE(_crc, Constants.LOCCRC); - // compressed size - data.writeUInt32LE(_compressedSize, Constants.LOCSIZ); - // uncompressed size - data.writeUInt32LE(_size, Constants.LOCLEN); - // filename length - data.writeUInt16LE(_fnameLen, Constants.LOCNAM); - // extra field length - data.writeUInt16LE(_extraLen, Constants.LOCEXT); - return data; - }, - - entryHeaderToBinary : function() { - // CEN header size (46 bytes) - var data = new Buffer(Constants.CENHDR + _fnameLen + _extraLen + _comLen); - // "PK\001\002" - data.writeUInt32LE(Constants.CENSIG, 0); - // version made by - data.writeUInt16LE(_verMade, Constants.CENVEM); - // version needed to extract - data.writeUInt16LE(_version, Constants.CENVER); - // encrypt, decrypt flags - data.writeUInt16LE(_flags, Constants.CENFLG); - // compression method - data.writeUInt16LE(_method, Constants.CENHOW); - // modification time (2 bytes time, 2 bytes date) - data.writeUInt32LE(_time, Constants.CENTIM); - // uncompressed file crc-32 value - data.writeInt32LE(_crc, Constants.CENCRC, true); - // compressed size - data.writeUInt32LE(_compressedSize, Constants.CENSIZ); - // uncompressed size - data.writeUInt32LE(_size, Constants.CENLEN); - // filename length - data.writeUInt16LE(_fnameLen, Constants.CENNAM); - // extra field length - data.writeUInt16LE(_extraLen, Constants.CENEXT); - // file comment length - data.writeUInt16LE(_comLen, Constants.CENCOM); - // volume number start - data.writeUInt16LE(_diskStart, Constants.CENDSK); - // internal file attributes - data.writeUInt16LE(_inattr, Constants.CENATT); - // external file attributes - data.writeUInt32LE(_attr, Constants.CENATX); - // LOC header offset - data.writeUInt32LE(_offset, Constants.CENOFF); - // fill all with - data.fill(0x00, Constants.CENHDR); - return data; - }, - - toString : function() { - return '{\n' + - '\t"made" : ' + _verMade + ",\n" + - '\t"version" : ' + _version + ",\n" + - '\t"flags" : ' + _flags + ",\n" + - '\t"method" : ' + Utils.methodToString(_method) + ",\n" + - '\t"time" : ' + _time + ",\n" + - '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" + - '\t"compressedSize" : ' + _compressedSize + " bytes,\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"fileNameLength" : ' + _fnameLen + ",\n" + - '\t"extraLength" : ' + _extraLen + " bytes,\n" + - '\t"commentLength" : ' + _comLen + " bytes,\n" + - '\t"diskNumStart" : ' + _diskStart + ",\n" + - '\t"inAttr" : ' + _inattr + ",\n" + - '\t"attr" : ' + _attr + ",\n" + - '\t"offset" : ' + _offset + ",\n" + - '\t"entryHeaderSize" : ' + (Constants.CENHDR + _fnameLen + _extraLen + _comLen) + " bytes\n" + - '}'; - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js deleted file mode 100644 index b8c67b9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.EntryHeader = require("./entryHeader"); -exports.MainHeader = require("./mainHeader"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js deleted file mode 100644 index 002bc8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js +++ /dev/null @@ -1,80 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The entries in the end of central directory */ -module.exports = function () { - var _volumeEntries = 0, - _totalEntries = 0, - _size = 0, - _offset = 0, - _commentLength = 0; - - return { - get diskEntries () { return _volumeEntries }, - set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; }, - - get totalEntries () { return _totalEntries }, - set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; }, - - get size () { return _size }, - set size (/*Number*/val) { _size = val; }, - - get offset () { return _offset }, - set offset (/*Number*/val) { _offset = val; }, - - get commentLength () { return _commentLength }, - set commentLength (/*Number*/val) { _commentLength = val; }, - - get mainHeaderSize () { - return Constants.ENDHDR + _commentLength; - }, - - loadFromBinary : function(/*Buffer*/data) { - // data should be 22 bytes and start with "PK 05 06" - if (data.length != Constants.ENDHDR || data.readUInt32LE(0) != Constants.ENDSIG) - throw Utils.Errors.INVALID_END; - - // number of entries on this volume - _volumeEntries = data.readUInt16LE(Constants.ENDSUB); - // total number of entries - _totalEntries = data.readUInt16LE(Constants.ENDTOT); - // central directory size in bytes - _size = data.readUInt32LE(Constants.ENDSIZ); - // offset of first CEN header - _offset = data.readUInt32LE(Constants.ENDOFF); - // zip file comment length - _commentLength = data.readUInt16LE(Constants.ENDCOM); - }, - - toBinary : function() { - var b = new Buffer(Constants.ENDHDR + _commentLength); - // "PK 05 06" signature - b.writeUInt32LE(Constants.ENDSIG, 0); - b.writeUInt32LE(0, 4); - // number of entries on this volume - b.writeUInt16LE(_volumeEntries, Constants.ENDSUB); - // total number of entries - b.writeUInt16LE(_totalEntries, Constants.ENDTOT); - // central directory size in bytes - b.writeUInt32LE(_size, Constants.ENDSIZ); - // offset of first CEN header - b.writeUInt32LE(_offset, Constants.ENDOFF); - // zip file comment length - b.writeUInt16LE(_commentLength, Constants.ENDCOM); - // fill comment memory with spaces so no garbage is left there - b.fill(" ", Constants.ENDHDR); - - return b; - }, - - toString : function() { - return '{\n' + - '\t"diskEntries" : ' + _volumeEntries + ",\n" + - '\t"totalEntries" : ' + _totalEntries + ",\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" + - '\t"commentLength" : 0x' + _commentLength + "\n" + - '}'; - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js deleted file mode 100644 index 70137b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * $Id: rawdeflate.js,v 0.5 2013/04/09 14:25:38 dankogai Exp dankogai $ - * - * GNU General Public License, version 2 (GPL-2.0) - * http://opensource.org/licenses/GPL-2.0 - * Original: - * http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt - */ -function JSDeflater(/*inbuff*/inbuf) { - - /* Copyright (C) 1999 Masanao Izumo - * Version: 1.0.1 - * LastModified: Dec 25 1999 - */ - - var WSIZE = 32768, // Sliding Window size - zip_STORED_BLOCK = 0, - zip_STATIC_TREES = 1, - zip_DYN_TREES = 2, - zip_DEFAULT_LEVEL = 6, - zip_FULL_SEARCH = true, - zip_INBUFSIZ = 32768, // Input buffer size - zip_INBUF_EXTRA = 64, // Extra buffer - zip_OUTBUFSIZ = 1024 * 8, - zip_window_size = 2 * WSIZE, - MIN_MATCH = 3, - MAX_MATCH = 258, - zip_BITS = 16, - LIT_BUFSIZE = 0x2000, - zip_HASH_BITS = 13, - zip_DIST_BUFSIZE = LIT_BUFSIZE, - zip_HASH_SIZE = 1 << zip_HASH_BITS, - zip_HASH_MASK = zip_HASH_SIZE - 1, - zip_WMASK = WSIZE - 1, - zip_NIL = 0, // Tail of hash chains - zip_TOO_FAR = 4096, - zip_MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, - zip_MAX_DIST = WSIZE - zip_MIN_LOOKAHEAD, - zip_SMALLEST = 1, - zip_MAX_BITS = 15, - zip_MAX_BL_BITS = 7, - zip_LENGTH_CODES = 29, - zip_LITERALS = 256, - zip_END_BLOCK = 256, - zip_L_CODES = zip_LITERALS + 1 + zip_LENGTH_CODES, - zip_D_CODES = 30, - zip_BL_CODES = 19, - zip_REP_3_6 = 16, - zip_REPZ_3_10 = 17, - zip_REPZ_11_138 = 18, - zip_HEAP_SIZE = 2 * zip_L_CODES + 1, - zip_H_SHIFT = parseInt((zip_HASH_BITS + MIN_MATCH - 1) / MIN_MATCH); - - var zip_free_queue, zip_qhead, zip_qtail, zip_initflag, zip_outbuf = null, zip_outcnt, zip_outoff, zip_complete, - zip_window, zip_d_buf, zip_l_buf, zip_prev, zip_bi_buf, zip_bi_valid, zip_block_start, zip_ins_h, zip_hash_head, - zip_prev_match, zip_match_available, zip_match_length, zip_prev_length, zip_strstart, zip_match_start, zip_eofile, - zip_lookahead, zip_max_chain_length, zip_max_lazy_match, zip_compr_level, zip_good_match, zip_nice_match, - zip_dyn_ltree, zip_dyn_dtree, zip_static_ltree, zip_static_dtree, zip_bl_tree, zip_l_desc, zip_d_desc, zip_bl_desc, - zip_bl_count, zip_heap, zip_heap_len, zip_heap_max, zip_depth, zip_length_code, zip_dist_code, zip_base_length, - zip_base_dist, zip_flag_buf, zip_last_lit, zip_last_dist, zip_last_flags, zip_flags, zip_flag_bit, zip_opt_len, - zip_static_len, zip_deflate_data, zip_deflate_pos; - - var zip_DeflateCT = function () { - this.fc = 0; // frequency count or bit string - this.dl = 0; // father node in Huffman tree or length of bit string - }; - - var zip_DeflateTreeDesc = function () { - this.dyn_tree = null; // the dynamic tree - this.static_tree = null; // corresponding static tree or NULL - this.extra_bits = null; // extra bits for each code or NULL - this.extra_base = 0; // base index for extra_bits - this.elems = 0; // max number of elements in the tree - this.max_length = 0; // max bit length for the codes - this.max_code = 0; // largest code with non zero frequency - }; - - /* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ - var zip_DeflateConfiguration = function (a, b, c, d) { - this.good_length = a; // reduce lazy search above this match length - this.max_lazy = b; // do not perform lazy search above this match length - this.nice_length = c; // quit search above this match length - this.max_chain = d; - }; - - var zip_DeflateBuffer = function () { - this.next = null; - this.len = 0; - this.ptr = new Array(zip_OUTBUFSIZ); - this.off = 0; - }; - - /* constant tables */ - var zip_extra_lbits = new Array( - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0); - var zip_extra_dbits = new Array( - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13); - var zip_extra_blbits = new Array( - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7); - var zip_bl_order = new Array( - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15); - var zip_configuration_table = new Array( - new zip_DeflateConfiguration(0, 0, 0, 0), - new zip_DeflateConfiguration(4, 4, 8, 4), - new zip_DeflateConfiguration(4, 5, 16, 8), - new zip_DeflateConfiguration(4, 6, 32, 32), - new zip_DeflateConfiguration(4, 4, 16, 16), - new zip_DeflateConfiguration(8, 16, 32, 32), - new zip_DeflateConfiguration(8, 16, 128, 128), - new zip_DeflateConfiguration(8, 32, 128, 256), - new zip_DeflateConfiguration(32, 128, 258, 1024), - new zip_DeflateConfiguration(32, 258, 258, 4096)); - - - /* routines (deflate) */ - - var zip_deflate_start = function (level) { - var i; - - if (!level) - level = zip_DEFAULT_LEVEL; - else if (level < 1) - level = 1; - else if (level > 9) - level = 9; - - zip_compr_level = level; - zip_initflag = false; - zip_eofile = false; - if (zip_outbuf != null) - return; - - zip_free_queue = zip_qhead = zip_qtail = null; - zip_outbuf = new Array(zip_OUTBUFSIZ); - zip_window = new Array(zip_window_size); - zip_d_buf = new Array(zip_DIST_BUFSIZE); - zip_l_buf = new Array(zip_INBUFSIZ + zip_INBUF_EXTRA); - zip_prev = new Array(1 << zip_BITS); - zip_dyn_ltree = new Array(zip_HEAP_SIZE); - for (i = 0; i < zip_HEAP_SIZE; i++) zip_dyn_ltree[i] = new zip_DeflateCT(); - zip_dyn_dtree = new Array(2 * zip_D_CODES + 1); - for (i = 0; i < 2 * zip_D_CODES + 1; i++) zip_dyn_dtree[i] = new zip_DeflateCT(); - zip_static_ltree = new Array(zip_L_CODES + 2); - for (i = 0; i < zip_L_CODES + 2; i++) zip_static_ltree[i] = new zip_DeflateCT(); - zip_static_dtree = new Array(zip_D_CODES); - for (i = 0; i < zip_D_CODES; i++) zip_static_dtree[i] = new zip_DeflateCT(); - zip_bl_tree = new Array(2 * zip_BL_CODES + 1); - for (i = 0; i < 2 * zip_BL_CODES + 1; i++) zip_bl_tree[i] = new zip_DeflateCT(); - zip_l_desc = new zip_DeflateTreeDesc(); - zip_d_desc = new zip_DeflateTreeDesc(); - zip_bl_desc = new zip_DeflateTreeDesc(); - zip_bl_count = new Array(zip_MAX_BITS + 1); - zip_heap = new Array(2 * zip_L_CODES + 1); - zip_depth = new Array(2 * zip_L_CODES + 1); - zip_length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zip_dist_code = new Array(512); - zip_base_length = new Array(zip_LENGTH_CODES); - zip_base_dist = new Array(zip_D_CODES); - zip_flag_buf = new Array(parseInt(LIT_BUFSIZE / 8)); - }; - - var zip_deflate_end = function () { - zip_free_queue = zip_qhead = zip_qtail = null; - zip_outbuf = null; - zip_window = null; - zip_d_buf = null; - zip_l_buf = null; - zip_prev = null; - zip_dyn_ltree = null; - zip_dyn_dtree = null; - zip_static_ltree = null; - zip_static_dtree = null; - zip_bl_tree = null; - zip_l_desc = null; - zip_d_desc = null; - zip_bl_desc = null; - zip_bl_count = null; - zip_heap = null; - zip_depth = null; - zip_length_code = null; - zip_dist_code = null; - zip_base_length = null; - zip_base_dist = null; - zip_flag_buf = null; - }; - - var zip_reuse_queue = function (p) { - p.next = zip_free_queue; - zip_free_queue = p; - }; - - var zip_new_queue = function () { - var p; - - if (zip_free_queue != null) { - p = zip_free_queue; - zip_free_queue = zip_free_queue.next; - } - else - p = new zip_DeflateBuffer(); - p.next = null; - p.len = p.off = 0; - - return p; - }; - - var zip_head1 = function (i) { - return zip_prev[WSIZE + i]; - }; - - var zip_head2 = function (i, val) { - return zip_prev[WSIZE + i] = val; - }; - - /* put_byte is used for the compressed output, put_ubyte for the - * uncompressed output. However unlzw() uses window for its - * suffix table instead of its output buffer, so it does not use put_ubyte - * (to be cleaned up). - */ - var zip_put_byte = function (c) { - zip_outbuf[zip_outoff + zip_outcnt++] = c; - if (zip_outoff + zip_outcnt == zip_OUTBUFSIZ) - zip_qoutbuf(); - }; - - /* Output a 16 bit value, lsb first */ - var zip_put_short = function (w) { - w &= 0xffff; - if (zip_outoff + zip_outcnt < zip_OUTBUFSIZ - 2) { - zip_outbuf[zip_outoff + zip_outcnt++] = (w & 0xff); - zip_outbuf[zip_outoff + zip_outcnt++] = (w >>> 8); - } else { - zip_put_byte(w & 0xff); - zip_put_byte(w >>> 8); - } - }; - - /* ========================================================================== - * Insert string s in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of s are valid - * (except for the last MIN_MATCH-1 bytes of the input file). - */ - var zip_INSERT_STRING = function () { - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) - ^ (zip_window[zip_strstart + MIN_MATCH - 1] & 0xff)) - & zip_HASH_MASK; - zip_hash_head = zip_head1(zip_ins_h); - zip_prev[zip_strstart & zip_WMASK] = zip_hash_head; - zip_head2(zip_ins_h, zip_strstart); - }; - - /* Send a code of the given tree. c and tree must not have side effects */ - var zip_SEND_CODE = function (c, tree) { - zip_send_bits(tree[c].fc, tree[c].dl); - }; - - /* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. dist_code[256] and dist_code[257] are never - * used. - */ - var zip_D_CODE = function (dist) { - return (dist < 256 ? zip_dist_code[dist] - : zip_dist_code[256 + (dist >> 7)]) & 0xff; - }; - - /* ========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ - var zip_SMALLER = function (tree, n, m) { - return tree[n].fc < tree[m].fc || - (tree[n].fc == tree[m].fc && zip_depth[n] <= zip_depth[m]); - }; - - /* ========================================================================== - * read string data - */ - var zip_read_buff = function (buff, offset, n) { - var i; - for (i = 0; i < n && zip_deflate_pos < zip_deflate_data.length; i++) - buff[offset + i] = - zip_deflate_data[zip_deflate_pos++] & 0xff; - return i; - }; - - /* ========================================================================== - * Initialize the "longest match" routines for a new file - */ - var zip_lm_init = function () { - var j; - - /* Initialize the hash table. */ - for (j = 0; j < zip_HASH_SIZE; j++) - zip_prev[WSIZE + j] = 0; - zip_max_lazy_match = zip_configuration_table[zip_compr_level].max_lazy; - zip_good_match = zip_configuration_table[zip_compr_level].good_length; - if (!zip_FULL_SEARCH) - zip_nice_match = zip_configuration_table[zip_compr_level].nice_length; - zip_max_chain_length = zip_configuration_table[zip_compr_level].max_chain; - - zip_strstart = 0; - zip_block_start = 0; - - zip_lookahead = zip_read_buff(zip_window, 0, 2 * WSIZE); - if (zip_lookahead <= 0) { - zip_eofile = true; - zip_lookahead = 0; - return; - } - zip_eofile = false; - /* Make sure that we always have enough lookahead. This is important - * if input comes from a device such as a tty. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - - /* If lookahead < MIN_MATCH, ins_h is garbage, but this is - * not important since only literal bytes will be emitted. - */ - zip_ins_h = 0; - for (j = 0; j < MIN_MATCH - 1; j++) { - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[j] & 0xff)) & zip_HASH_MASK; - } - }; - - /* ========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - */ - var zip_longest_match = function (cur_match) { - var chain_length = zip_max_chain_length; // max hash chain length - var scanp = zip_strstart; // current string - var matchp; // matched string - var len; // length of current match - var best_len = zip_prev_length; // best match length so far - - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - var limit = (zip_strstart > zip_MAX_DIST ? zip_strstart - zip_MAX_DIST : zip_NIL); - - var strendp = zip_strstart + MAX_MATCH; - var scan_end1 = zip_window[scanp + best_len - 1]; - var scan_end = zip_window[scanp + best_len]; - - /* Do not waste too much time if we already have a good match: */ - if (zip_prev_length >= zip_good_match) - chain_length >>= 2; - - do { - matchp = cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2: - */ - if (zip_window[matchp + best_len] != scan_end || - zip_window[matchp + best_len - 1] != scan_end1 || - zip_window[matchp] != zip_window[scanp] || - zip_window[++matchp] != zip_window[scanp + 1]) { - continue; - } - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scanp += 2; - matchp++; - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - scanp < strendp); - - len = MAX_MATCH - (strendp - scanp); - scanp = strendp - MAX_MATCH; - - if (len > best_len) { - zip_match_start = cur_match; - best_len = len; - if (zip_FULL_SEARCH) { - if (len >= MAX_MATCH) break; - } else { - if (len >= zip_nice_match) break; - } - - scan_end1 = zip_window[scanp + best_len - 1]; - scan_end = zip_window[scanp + best_len]; - } - } while ((cur_match = zip_prev[cur_match & zip_WMASK]) > limit - && --chain_length != 0); - - return best_len; - }; - - /* ========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead, and sets eofile if end of input file. - * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0 - * OUT assertions: at least one byte has been read, or eofile is set; - * file reads are performed for at least two bytes (required for the - * translate_eol option). - */ - var zip_fill_window = function () { - var n, m; - - // Amount of free space at the end of the window. - var more = zip_window_size - zip_lookahead - zip_strstart; - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (more == -1) { - /* Very unlikely, but possible on 16 bit machine if strstart == 0 - * and lookahead == 1 (input done one byte at time) - */ - more--; - } else if (zip_strstart >= WSIZE + zip_MAX_DIST) { - /* By the IN assertion, the window is not empty so we can't confuse - * more == 0 with more == 64K on a 16 bit machine. - */ - for (n = 0; n < WSIZE; n++) - zip_window[n] = zip_window[n + WSIZE]; - - zip_match_start -= WSIZE; - zip_strstart -= WSIZE; - /* we now have strstart >= MAX_DIST: */ - zip_block_start -= WSIZE; - - for (n = 0; n < zip_HASH_SIZE; n++) { - m = zip_head1(n); - zip_head2(n, m >= WSIZE ? m - WSIZE : zip_NIL); - } - for (n = 0; n < WSIZE; n++) { - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - m = zip_prev[n]; - zip_prev[n] = (m >= WSIZE ? m - WSIZE : zip_NIL); - } - more += WSIZE; - } - // At this point, more >= 2 - if (!zip_eofile) { - n = zip_read_buff(zip_window, zip_strstart + zip_lookahead, more); - if (n <= 0) - zip_eofile = true; - else - zip_lookahead += n; - } - }; - - /* ========================================================================== - * Processes a new input file and return its compressed length. This - * function does not perform lazy evaluationof matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ - var zip_deflate_fast = function () { - while (zip_lookahead != 0 && zip_qhead == null) { - var flush; // set if current block must be flushed - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - zip_INSERT_STRING(); - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (zip_hash_head != zip_NIL && - zip_strstart - zip_hash_head <= zip_MAX_DIST) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - zip_match_length = zip_longest_match(zip_hash_head); - /* longest_match() sets match_start */ - if (zip_match_length > zip_lookahead) - zip_match_length = zip_lookahead; - } - if (zip_match_length >= MIN_MATCH) { - flush = zip_ct_tally(zip_strstart - zip_match_start, - zip_match_length - MIN_MATCH); - zip_lookahead -= zip_match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ - if (zip_match_length <= zip_max_lazy_match) { - zip_match_length--; // string at strstart already in hash table - do { - zip_strstart++; - zip_INSERT_STRING(); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH - * these bytes are garbage, but it does not matter since - * the next lookahead bytes will be emitted as literals. - */ - } while (--zip_match_length != 0); - zip_strstart++; - } else { - zip_strstart += zip_match_length; - zip_match_length = 0; - zip_ins_h = zip_window[zip_strstart] & 0xff; - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[zip_strstart + 1] & 0xff)) & zip_HASH_MASK; - } - } else { - /* No match, output a literal byte */ - flush = zip_ct_tally(0, zip_window[zip_strstart] & 0xff); - zip_lookahead--; - zip_strstart++; - } - if (flush) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - } - }; - - var zip_deflate_better = function () { - /* Process the input block. */ - while (zip_lookahead != 0 && zip_qhead == null) { - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - zip_INSERT_STRING(); - - /* Find the longest match, discarding those <= prev_length. - */ - zip_prev_length = zip_match_length; - zip_prev_match = zip_match_start; - zip_match_length = MIN_MATCH - 1; - - if (zip_hash_head != zip_NIL && - zip_prev_length < zip_max_lazy_match && - zip_strstart - zip_hash_head <= zip_MAX_DIST) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - zip_match_length = zip_longest_match(zip_hash_head); - /* longest_match() sets match_start */ - if (zip_match_length > zip_lookahead) - zip_match_length = zip_lookahead; - - /* Ignore a length 3 match if it is too distant: */ - if (zip_match_length == MIN_MATCH && - zip_strstart - zip_match_start > zip_TOO_FAR) { - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - zip_match_length--; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (zip_prev_length >= MIN_MATCH && - zip_match_length <= zip_prev_length) { - var flush; // set if current block must be flushed - flush = zip_ct_tally(zip_strstart - 1 - zip_prev_match, - zip_prev_length - MIN_MATCH); - - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. - */ - zip_lookahead -= zip_prev_length - 1; - zip_prev_length -= 2; - do { - zip_strstart++; - zip_INSERT_STRING(); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH - * these bytes are garbage, but it does not matter since the - * next lookahead bytes will always be emitted as literals. - */ - } while (--zip_prev_length != 0); - zip_match_available = 0; - zip_match_length = MIN_MATCH - 1; - zip_strstart++; - if (flush) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - } else if (zip_match_available != 0) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - if (zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff)) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - zip_strstart++; - zip_lookahead--; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - zip_match_available = 1; - zip_strstart++; - zip_lookahead--; - } - - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - } - }; - - var zip_init_deflate = function () { - if (zip_eofile) - return; - zip_bi_buf = 0; - zip_bi_valid = 0; - zip_ct_init(); - zip_lm_init(); - - zip_qhead = null; - zip_outcnt = 0; - zip_outoff = 0; - zip_match_available = 0; - - if (zip_compr_level <= 3) { - zip_prev_length = MIN_MATCH - 1; - zip_match_length = 0; - } - else { - zip_match_length = MIN_MATCH - 1; - zip_match_available = 0; - zip_match_available = 0; - } - - zip_complete = false; - }; - - /* ========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ - var zip_deflate_internal = function (buff, off, buff_size) { - var n; - - if (!zip_initflag) { - zip_init_deflate(); - zip_initflag = true; - if (zip_lookahead == 0) { // empty - zip_complete = true; - return 0; - } - } - - if ((n = zip_qcopy(buff, off, buff_size)) == buff_size) - return buff_size; - - if (zip_complete) - return n; - - if (zip_compr_level <= 3) // optimized for speed - zip_deflate_fast(); - else - zip_deflate_better(); - if (zip_lookahead == 0) { - if (zip_match_available != 0) - zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff); - zip_flush_block(1); - zip_complete = true; - } - return n + zip_qcopy(buff, n + off, buff_size - n); - }; - - var zip_qcopy = function (buff, off, buff_size) { - var n, i, j; - - n = 0; - while (zip_qhead != null && n < buff_size) { - i = buff_size - n; - if (i > zip_qhead.len) - i = zip_qhead.len; - for (j = 0; j < i; j++) - buff[off + n + j] = zip_qhead.ptr[zip_qhead.off + j]; - - zip_qhead.off += i; - zip_qhead.len -= i; - n += i; - if (zip_qhead.len == 0) { - var p; - p = zip_qhead; - zip_qhead = zip_qhead.next; - zip_reuse_queue(p); - } - } - - if (n == buff_size) - return n; - - if (zip_outoff < zip_outcnt) { - i = buff_size - n; - if (i > zip_outcnt - zip_outoff) - i = zip_outcnt - zip_outoff; - // System.arraycopy(outbuf, outoff, buff, off + n, i); - for (j = 0; j < i; j++) - buff[off + n + j] = zip_outbuf[zip_outoff + j]; - zip_outoff += i; - n += i; - if (zip_outcnt == zip_outoff) - zip_outcnt = zip_outoff = 0; - } - return n; - }; - - /* ========================================================================== - * Allocate the match buffer, initialize the various tables and save the - * location of the internal file attribute (ascii/binary) and method - * (DEFLATE/STORE). - */ - var zip_ct_init = function () { - var n; // iterates over tree elements - var bits; // bit counter - var length; // length value - var code; // code value - var dist; // distance index - - if (zip_static_dtree[0].dl != 0) return; // ct_init already called - - zip_l_desc.dyn_tree = zip_dyn_ltree; - zip_l_desc.static_tree = zip_static_ltree; - zip_l_desc.extra_bits = zip_extra_lbits; - zip_l_desc.extra_base = zip_LITERALS + 1; - zip_l_desc.elems = zip_L_CODES; - zip_l_desc.max_length = zip_MAX_BITS; - zip_l_desc.max_code = 0; - - zip_d_desc.dyn_tree = zip_dyn_dtree; - zip_d_desc.static_tree = zip_static_dtree; - zip_d_desc.extra_bits = zip_extra_dbits; - zip_d_desc.extra_base = 0; - zip_d_desc.elems = zip_D_CODES; - zip_d_desc.max_length = zip_MAX_BITS; - zip_d_desc.max_code = 0; - - zip_bl_desc.dyn_tree = zip_bl_tree; - zip_bl_desc.static_tree = null; - zip_bl_desc.extra_bits = zip_extra_blbits; - zip_bl_desc.extra_base = 0; - zip_bl_desc.elems = zip_BL_CODES; - zip_bl_desc.max_length = zip_MAX_BL_BITS; - zip_bl_desc.max_code = 0; - - // Initialize the mapping length (0..255) -> length code (0..28) - length = 0; - for (code = 0; code < zip_LENGTH_CODES - 1; code++) { - zip_base_length[code] = length; - for (n = 0; n < (1 << zip_extra_lbits[code]); n++) - zip_length_code[length++] = code; - } - /* Note that the length 255 (match length 258) can be represented - * in two different ways: code 284 + 5 bits or code 285, so we - * overwrite length_code[255] to use the best encoding: - */ - zip_length_code[length - 1] = code; - - /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ - dist = 0; - for (code = 0; code < 16; code++) { - zip_base_dist[code] = dist; - for (n = 0; n < (1 << zip_extra_dbits[code]); n++) { - zip_dist_code[dist++] = code; - } - } - dist >>= 7; // from now on, all distances are divided by 128 - for (; code < zip_D_CODES; code++) { - zip_base_dist[code] = dist << 7; - for (n = 0; n < (1 << (zip_extra_dbits[code] - 7)); n++) - zip_dist_code[256 + dist++] = code; - } - // Construct the codes of the static literal tree - for (bits = 0; bits <= zip_MAX_BITS; bits++) - zip_bl_count[bits] = 0; - n = 0; - while (n <= 143) { - zip_static_ltree[n++].dl = 8; - zip_bl_count[8]++; - } - while (n <= 255) { - zip_static_ltree[n++].dl = 9; - zip_bl_count[9]++; - } - while (n <= 279) { - zip_static_ltree[n++].dl = 7; - zip_bl_count[7]++; - } - while (n <= 287) { - zip_static_ltree[n++].dl = 8; - zip_bl_count[8]++; - } - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - zip_gen_codes(zip_static_ltree, zip_L_CODES + 1); - - /* The static distance tree is trivial: */ - for (n = 0; n < zip_D_CODES; n++) { - zip_static_dtree[n].dl = 5; - zip_static_dtree[n].fc = zip_bi_reverse(n, 5); - } - - // Initialize the first block of the first file: - zip_init_block(); - }; - - /* ========================================================================== - * Initialize a new block. - */ - var zip_init_block = function () { - var n; // iterates over tree elements - - // Initialize the trees. - for (n = 0; n < zip_L_CODES; n++) zip_dyn_ltree[n].fc = 0; - for (n = 0; n < zip_D_CODES; n++) zip_dyn_dtree[n].fc = 0; - for (n = 0; n < zip_BL_CODES; n++) zip_bl_tree[n].fc = 0; - - zip_dyn_ltree[zip_END_BLOCK].fc = 1; - zip_opt_len = zip_static_len = 0; - zip_last_lit = zip_last_dist = zip_last_flags = 0; - zip_flags = 0; - zip_flag_bit = 1; - }; - - /* ========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ - var zip_pqdownheap = function (tree, // the tree to restore - k) { // node to move down - var v = zip_heap[k]; - var j = k << 1; // left son of k - - while (j <= zip_heap_len) { - // Set j to the smallest of the two sons: - if (j < zip_heap_len && - zip_SMALLER(tree, zip_heap[j + 1], zip_heap[j])) - j++; - - // Exit if v is smaller than both sons - if (zip_SMALLER(tree, v, zip_heap[j])) - break; - - // Exchange v with the smallest son - zip_heap[k] = zip_heap[j]; - k = j; - - // And continue down the tree, setting j to the left son of k - j <<= 1; - } - zip_heap[k] = v; - }; - - /* ========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ - var zip_gen_bitlen = function (desc) { // the tree descriptor - var tree = desc.dyn_tree; - var extra = desc.extra_bits; - var base = desc.extra_base; - var max_code = desc.max_code; - var max_length = desc.max_length; - var stree = desc.static_tree; - var h; // heap index - var n, m; // iterate over the tree elements - var bits; // bit length - var xbits; // extra bits - var f; // frequency - var overflow = 0; // number of elements with bit length too large - - for (bits = 0; bits <= zip_MAX_BITS; bits++) - zip_bl_count[bits] = 0; - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[zip_heap[zip_heap_max]].dl = 0; // root of the heap - - for (h = zip_heap_max + 1; h < zip_HEAP_SIZE; h++) { - n = zip_heap[h]; - bits = tree[tree[n].dl].dl + 1; - if (bits > max_length) { - bits = max_length; - overflow++; - } - tree[n].dl = bits; - // We overwrite tree[n].dl which is no longer needed - - if (n > max_code) - continue; // not a leaf node - - zip_bl_count[bits]++; - xbits = 0; - if (n >= base) - xbits = extra[n - base]; - f = tree[n].fc; - zip_opt_len += f * (bits + xbits); - if (stree != null) - zip_static_len += f * (stree[n].dl + xbits); - } - if (overflow == 0) - return; - - // This happens for example on obj2 and pic of the Calgary corpus - - // Find the first bit length which could increase: - do { - bits = max_length - 1; - while (zip_bl_count[bits] == 0) - bits--; - zip_bl_count[bits]--; // move one leaf down the tree - zip_bl_count[bits + 1] += 2; // move one overflow item as its brother - zip_bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits != 0; bits--) { - n = zip_bl_count[bits]; - while (n != 0) { - m = zip_heap[--h]; - if (m > max_code) - continue; - if (tree[m].dl != bits) { - zip_opt_len += (bits - tree[m].dl) * tree[m].fc; - tree[m].fc = bits; - } - n--; - } - } - }; - - /* ========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ - var zip_gen_codes = function (tree, // the tree to decorate - max_code) { // largest code with non zero frequency - var next_code = new Array(zip_MAX_BITS + 1); // next code value for each bit length - var code = 0; // running code value - var bits; // bit index - var n; // code index - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= zip_MAX_BITS; bits++) { - code = ((code + zip_bl_count[bits - 1]) << 1); - next_code[bits] = code; - } - - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - for (n = 0; n <= max_code; n++) { - var len = tree[n].dl; - if (len == 0) - continue; - // Now reverse the bits - tree[n].fc = zip_bi_reverse(next_code[len]++, len); - } - }; - - /* ========================================================================== - * Construct one Huffman tree and assigns the code bit strings and lengths. - * Update the total bit length for the current block. - * IN assertion: the field freq is set for all tree elements. - * OUT assertions: the fields len and code are set to the optimal bit length - * and corresponding code. The length opt_len is updated; static_len is - * also updated if stree is not null. The field max_code is set. - */ - var zip_build_tree = function (desc) { // the tree descriptor - var tree = desc.dyn_tree; - var stree = desc.static_tree; - var elems = desc.elems; - var n, m; // iterate over heap elements - var max_code = -1; // largest code with non zero frequency - var node = elems; // next internal node of the tree - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - zip_heap_len = 0; - zip_heap_max = zip_HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n].fc != 0) { - zip_heap[++zip_heap_len] = max_code = n; - zip_depth[n] = 0; - } else - tree[n].dl = 0; - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (zip_heap_len < 2) { - var xnew = zip_heap[++zip_heap_len] = (max_code < 2 ? ++max_code : 0); - tree[xnew].fc = 1; - zip_depth[xnew] = 0; - zip_opt_len--; - if (stree != null) - zip_static_len -= stree[xnew].dl; - // new is 0 or 1 so it does not have extra bits - } - desc.max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = zip_heap_len >> 1; n >= 1; n--) - zip_pqdownheap(tree, n); - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - do { - n = zip_heap[zip_SMALLEST]; - zip_heap[zip_SMALLEST] = zip_heap[zip_heap_len--]; - zip_pqdownheap(tree, zip_SMALLEST); - - m = zip_heap[zip_SMALLEST]; // m = node of next least frequency - - // keep the nodes sorted by frequency - zip_heap[--zip_heap_max] = n; - zip_heap[--zip_heap_max] = m; - - // Create a new node father of n and m - tree[node].fc = tree[n].fc + tree[m].fc; - if (zip_depth[n] > zip_depth[m] + 1) - zip_depth[node] = zip_depth[n]; - else - zip_depth[node] = zip_depth[m] + 1; - tree[n].dl = tree[m].dl = node; - - // and insert the new node in the heap - zip_heap[zip_SMALLEST] = node++; - zip_pqdownheap(tree, zip_SMALLEST); - - } while (zip_heap_len >= 2); - - zip_heap[--zip_heap_max] = zip_heap[zip_SMALLEST]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - zip_gen_bitlen(desc); - - // The field len is now set, we can generate the bit codes - zip_gen_codes(tree, max_code); - }; - - /* ========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. Updates opt_len to take into account the repeat - * counts. (The contribution of the bit length codes will be added later - * during the construction of bl_tree.) - */ - var zip_scan_tree = function (tree,// the tree to be scanned - max_code) { // and its largest code of non zero frequency - var n; // iterates over all tree elements - var prevlen = -1; // last emitted length - var curlen; // length of current code - var nextlen = tree[0].dl; // length of next code - var count = 0; // repeat count of the current code - var max_count = 7; // max repeat count - var min_count = 4; // min repeat count - - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } - tree[max_code + 1].dl = 0xffff; // guard - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - if (++count < max_count && curlen == nextlen) - continue; - else if (count < min_count) - zip_bl_tree[curlen].fc += count; - else if (curlen != 0) { - if (curlen != prevlen) - zip_bl_tree[curlen].fc++; - zip_bl_tree[zip_REP_3_6].fc++; - } else if (count <= 10) - zip_bl_tree[zip_REPZ_3_10].fc++; - else - zip_bl_tree[zip_REPZ_11_138].fc++; - count = 0; - prevlen = curlen; - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } else if (curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - }; - - /* ========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ - var zip_send_tree = function (tree, // the tree to be scanned - max_code) { // and its largest code of non zero frequency - var n; // iterates over all tree elements - var prevlen = -1; // last emitted length - var curlen; // length of current code - var nextlen = tree[0].dl; // length of next code - var count = 0; // repeat count of the current code - var max_count = 7; // max repeat count - var min_count = 4; // min repeat count - - /* tree[max_code+1].dl = -1; */ - /* guard already set */ - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { - zip_SEND_CODE(curlen, zip_bl_tree); - } while (--count != 0); - } else if (curlen != 0) { - if (curlen != prevlen) { - zip_SEND_CODE(curlen, zip_bl_tree); - count--; - } - // Assert(count >= 3 && count <= 6, " 3_6?"); - zip_SEND_CODE(zip_REP_3_6, zip_bl_tree); - zip_send_bits(count - 3, 2); - } else if (count <= 10) { - zip_SEND_CODE(zip_REPZ_3_10, zip_bl_tree); - zip_send_bits(count - 3, 3); - } else { - zip_SEND_CODE(zip_REPZ_11_138, zip_bl_tree); - zip_send_bits(count - 11, 7); - } - count = 0; - prevlen = curlen; - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } else if (curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - }; - - /* ========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ - var zip_build_bl_tree = function () { - var max_blindex; // index of last bit length code of non zero freq - - // Determine the bit length frequencies for literal and distance trees - zip_scan_tree(zip_dyn_ltree, zip_l_desc.max_code); - zip_scan_tree(zip_dyn_dtree, zip_d_desc.max_code); - - // Build the bit length tree: - zip_build_tree(zip_bl_desc); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = zip_BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (zip_bl_tree[zip_bl_order[max_blindex]].dl != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - zip_opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - return max_blindex; - }; - - /* ========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ - var zip_send_all_trees = function (lcodes, dcodes, blcodes) { // number of codes for each tree - var rank; // index in bl_order - zip_send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt - zip_send_bits(dcodes - 1, 5); - zip_send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt - for (rank = 0; rank < blcodes; rank++) { - zip_send_bits(zip_bl_tree[zip_bl_order[rank]].dl, 3); - } - - // send the literal tree - zip_send_tree(zip_dyn_ltree, lcodes - 1); - - // send the distance tree - zip_send_tree(zip_dyn_dtree, dcodes - 1); - }; - - /* ========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ - var zip_flush_block = function (eof) { // true if this is the last block for a file - var opt_lenb, static_lenb; // opt_len and static_len in bytes - var max_blindex; // index of last bit length code of non zero freq - var stored_len; // length of input block - - stored_len = zip_strstart - zip_block_start; - zip_flag_buf[zip_last_flags] = zip_flags; // Save the flags for the last 8 items - - // Construct the literal and distance trees - zip_build_tree(zip_l_desc); - zip_build_tree(zip_d_desc); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = zip_build_bl_tree(); - - // Determine the best encoding. Compute first the block length in bytes - opt_lenb = (zip_opt_len + 3 + 7) >> 3; - static_lenb = (zip_static_len + 3 + 7) >> 3; - if (static_lenb <= opt_lenb) - opt_lenb = static_lenb; - if (stored_len + 4 <= opt_lenb // 4: two words for the lengths - && zip_block_start >= 0) { - var i; - - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - zip_send_bits((zip_STORED_BLOCK << 1) + eof, 3); - /* send block type */ - zip_bi_windup(); - /* align on byte boundary */ - zip_put_short(stored_len); - zip_put_short(~stored_len); - - // copy block - for (i = 0; i < stored_len; i++) - zip_put_byte(zip_window[zip_block_start + i]); - - } else if (static_lenb == opt_lenb) { - zip_send_bits((zip_STATIC_TREES << 1) + eof, 3); - zip_compress_block(zip_static_ltree, zip_static_dtree); - } else { - zip_send_bits((zip_DYN_TREES << 1) + eof, 3); - zip_send_all_trees(zip_l_desc.max_code + 1, - zip_d_desc.max_code + 1, - max_blindex + 1); - zip_compress_block(zip_dyn_ltree, zip_dyn_dtree); - } - - zip_init_block(); - - if (eof != 0) - zip_bi_windup(); - }; - - /* ========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ - var zip_ct_tally = function (dist, // distance of matched string - lc) { // match length-MIN_MATCH or unmatched char (if dist==0) - zip_l_buf[zip_last_lit++] = lc; - if (dist == 0) { - // lc is the unmatched char - zip_dyn_ltree[lc].fc++; - } else { - // Here, lc is the match length - MIN_MATCH - dist--; // dist = match distance - 1 - zip_dyn_ltree[zip_length_code[lc] + zip_LITERALS + 1].fc++; - zip_dyn_dtree[zip_D_CODE(dist)].fc++; - - zip_d_buf[zip_last_dist++] = dist; - zip_flags |= zip_flag_bit; - } - zip_flag_bit <<= 1; - - // Output the flags if they fill a byte - if ((zip_last_lit & 7) == 0) { - zip_flag_buf[zip_last_flags++] = zip_flags; - zip_flags = 0; - zip_flag_bit = 1; - } - // Try to guess if it is profitable to stop the current block here - if (zip_compr_level > 2 && (zip_last_lit & 0xfff) == 0) { - // Compute an upper bound for the compressed length - var out_length = zip_last_lit * 8; - var in_length = zip_strstart - zip_block_start; - var dcode; - - for (dcode = 0; dcode < zip_D_CODES; dcode++) { - out_length += zip_dyn_dtree[dcode].fc * (5 + zip_extra_dbits[dcode]); - } - out_length >>= 3; - if (zip_last_dist < parseInt(zip_last_lit / 2) && - out_length < parseInt(in_length / 2)) - return true; - } - return (zip_last_lit == LIT_BUFSIZE - 1 || - zip_last_dist == zip_DIST_BUFSIZE); - /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ - }; - - /* ========================================================================== - * Send the block data compressed using the given Huffman trees - */ - var zip_compress_block = function (ltree, // literal tree - dtree) { // distance tree - var dist; // distance of matched string - var lc; // match length or unmatched char (if dist == 0) - var lx = 0; // running index in l_buf - var dx = 0; // running index in d_buf - var fx = 0; // running index in flag_buf - var flag = 0; // current flags - var code; // the code to send - var extra; // number of extra bits to send - - if (zip_last_lit != 0) do { - if ((lx & 7) == 0) - flag = zip_flag_buf[fx++]; - lc = zip_l_buf[lx++] & 0xff; - if ((flag & 1) == 0) { - zip_SEND_CODE(lc, ltree); - /* send a literal byte */ - } else { - // Here, lc is the match length - MIN_MATCH - code = zip_length_code[lc]; - zip_SEND_CODE(code + zip_LITERALS + 1, ltree); // send the length code - extra = zip_extra_lbits[code]; - if (extra != 0) { - lc -= zip_base_length[code]; - zip_send_bits(lc, extra); // send the extra length bits - } - dist = zip_d_buf[dx++]; - // Here, dist is the match distance - 1 - code = zip_D_CODE(dist); - zip_SEND_CODE(code, dtree); // send the distance code - extra = zip_extra_dbits[code]; - if (extra != 0) { - dist -= zip_base_dist[code]; - zip_send_bits(dist, extra); // send the extra distance bits - } - } // literal or match pair ? - flag >>= 1; - } while (lx < zip_last_lit); - - zip_SEND_CODE(zip_END_BLOCK, ltree); - }; - - /* ========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ - var zip_Buf_size = 16; // bit size of bi_buf - var zip_send_bits = function (value, // value to send - length) { // number of bits - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) - * unused bits in value. - */ - if (zip_bi_valid > zip_Buf_size - length) { - zip_bi_buf |= (value << zip_bi_valid); - zip_put_short(zip_bi_buf); - zip_bi_buf = (value >> (zip_Buf_size - zip_bi_valid)); - zip_bi_valid += length - zip_Buf_size; - } else { - zip_bi_buf |= value << zip_bi_valid; - zip_bi_valid += length; - } - }; - - /* ========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ - var zip_bi_reverse = function (code, // the value to invert - len) { // its bit length - var res = 0; - do { - res |= code & 1; - code >>= 1; - res <<= 1; - } while (--len > 0); - return res >> 1; - }; - - /* ========================================================================== - * Write out any remaining bits in an incomplete byte. - */ - var zip_bi_windup = function () { - if (zip_bi_valid > 8) { - zip_put_short(zip_bi_buf); - } else if (zip_bi_valid > 0) { - zip_put_byte(zip_bi_buf); - } - zip_bi_buf = 0; - zip_bi_valid = 0; - }; - - var zip_qoutbuf = function () { - if (zip_outcnt != 0) { - var q, i; - q = zip_new_queue(); - if (zip_qhead == null) - zip_qhead = zip_qtail = q; - else - zip_qtail = zip_qtail.next = q; - q.len = zip_outcnt - zip_outoff; - for (i = 0; i < q.len; i++) - q.ptr[i] = zip_outbuf[zip_outoff + i]; - zip_outcnt = zip_outoff = 0; - } - }; - - function deflate(buffData, level) { - zip_deflate_data = buffData; - zip_deflate_pos = 0; - zip_deflate_start(level); - - var buff = new Array(1024), - pages = [], - totalSize = 0, - i; - - for (i = 0; i < 1024; i++) buff[i] = 0; - while ((i = zip_deflate_internal(buff, 0, buff.length)) > 0) { - var buf = new Buffer(buff.slice(0, i)); - pages.push(buf); - totalSize += buf.length; - } - - if (pages.length == 1) { - return pages[0]; - } - - var result = new Buffer(totalSize), - index = 0; - - for (i = 0; i < pages.length; i++) { - pages[i].copy(result, index); - index = index + pages[i].length - } - - return result; - } - - return { - deflate: function () { - return deflate(inbuf, 8); - } - } -} - -module.exports = function (/*Buffer*/inbuf) { - - var zlib = require("zlib"); - - return { - deflate: function () { - return new JSDeflater(inbuf).deflate(); - }, - - deflateAsync: function (/*Function*/callback) { - var tmp = zlib.createDeflateRaw(); - tmp.on('data', function (data) { - callback(data); - }); - tmp.end(inbuf) - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js deleted file mode 100644 index ddcbba6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.Deflater = require("./deflater"); -exports.Inflater = require("./inflater"); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js deleted file mode 100644 index ba95063..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js +++ /dev/null @@ -1,446 +0,0 @@ -var Buffer = require("buffer").Buffer; - -function JSInflater(/*Buffer*/input) { - - var WSIZE = 0x8000, - slide = new Buffer(0x10000), - windowPos = 0, - fixedTableList = null, - fixedTableDist, - fixedLookup, - bitBuf = 0, - bitLen = 0, - method = -1, - eof = false, - copyLen = 0, - copyDist = 0, - tblList, tblDist, bitList, bitdist, - - inputPosition = 0, - - MASK_BITS = [0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff], - LENS = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], - LEXT = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99], - DISTS = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577], - DEXT = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], - BITORDER = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - - function HuffTable(clen, cnum, cval, blist, elist, lookupm) { - - this.status = 0; - this.root = null; - this.maxbit = 0; - - var el, f, tail, - offsets = [], - countTbl = [], - sTbl = [], - values = [], - tentry = {extra: 0, bitcnt: 0, lbase: 0, next: null}; - - tail = this.root = null; - for(var i = 0; i < 0x11; i++) { countTbl[i] = 0; sTbl[i] = 0; offsets[i] = 0; } - for(i = 0; i < 0x120; i++) values[i] = 0; - - el = cnum > 256 ? clen[256] : 16; - - var pidx = -1; - while (++pidx < cnum) countTbl[clen[pidx]]++; - - if(countTbl[0] == cnum) return; - - for(var j = 1; j <= 16; j++) if(countTbl[j] != 0) break; - var bitLen = j; - for(i = 16; i != 0; i--) if(countTbl[i] != 0) break; - var maxLen = i; - - lookupm < j && (lookupm = j); - - var dCodes = 1 << j; - for(; j < i; j++, dCodes <<= 1) - if((dCodes -= countTbl[j]) < 0) { - this.status = 2; - this.maxbit = lookupm; - return; - } - - if((dCodes -= countTbl[i]) < 0) { - this.status = 2; - this.maxbit = lookupm; - return; - } - - countTbl[i] += dCodes; - offsets[1] = j = 0; - pidx = 1; - var xp = 2; - while(--i > 0) offsets[xp++] = (j += countTbl[pidx++]); - pidx = 0; - i = 0; - do { - (j = clen[pidx++]) && (values[offsets[j]++] = i); - } while(++i < cnum); - cnum = offsets[maxLen]; - offsets[0] = i = 0; - pidx = 0; - - var level = -1, - w = sTbl[0] = 0, - cnode = null, - tblCnt = 0, - tblStack = []; - - for(; bitLen <= maxLen; bitLen++) { - var kccnt = countTbl[bitLen]; - while(kccnt-- > 0) { - while(bitLen > w + sTbl[1 + level]) { - w += sTbl[1 + level]; - level++; - tblCnt = (tblCnt = maxLen - w) > lookupm ? lookupm : tblCnt; - if((f = 1 << (j = bitLen - w)) > kccnt + 1) { - f -= kccnt + 1; - xp = bitLen; - while(++j < tblCnt) { - if((f <<= 1) <= countTbl[++xp]) break; - f -= countTbl[xp]; - } - } - if(w + j > el && w < el) j = el - w; - tblCnt = 1 << j; - sTbl[1 + level] = j; - cnode = []; - while (cnode.length < tblCnt) cnode.push({extra: 0, bitcnt: 0, lbase: 0, next: null}); - if (tail == null) { - tail = this.root = {next:null, list:null}; - } else { - tail = tail.next = {next:null, list:null} - } - tail.next = null; - tail.list = cnode; - - tblStack[level] = cnode; - - if(level > 0) { - offsets[level] = i; - tentry.bitcnt = sTbl[level]; - tentry.extra = 16 + j; - tentry.next = cnode; - j = (i & ((1 << w) - 1)) >> (w - sTbl[level]); - - tblStack[level-1][j].extra = tentry.extra; - tblStack[level-1][j].bitcnt = tentry.bitcnt; - tblStack[level-1][j].lbase = tentry.lbase; - tblStack[level-1][j].next = tentry.next; - } - } - tentry.bitcnt = bitLen - w; - if(pidx >= cnum) - tentry.extra = 99; - else if(values[pidx] < cval) { - tentry.extra = (values[pidx] < 256 ? 16 : 15); - tentry.lbase = values[pidx++]; - } else { - tentry.extra = elist[values[pidx] - cval]; - tentry.lbase = blist[values[pidx++] - cval]; - } - - f = 1 << (bitLen - w); - for(j = i >> w; j < tblCnt; j += f) { - cnode[j].extra = tentry.extra; - cnode[j].bitcnt = tentry.bitcnt; - cnode[j].lbase = tentry.lbase; - cnode[j].next = tentry.next; - } - for(j = 1 << (bitLen - 1); (i & j) != 0; j >>= 1) - i ^= j; - i ^= j; - while((i & ((1 << w) - 1)) != offsets[level]) { - w -= sTbl[level]; - level--; - } - } - } - - this.maxbit = sTbl[1]; - this.status = ((dCodes != 0 && maxLen != 1) ? 1 : 0); - } - - function addBits(n) { - while(bitLen < n) { - bitBuf |= input[inputPosition++] << bitLen; - bitLen += 8; - } - return bitBuf; - } - - function cutBits(n) { - bitLen -= n; - return bitBuf >>= n; - } - - function maskBits(n) { - while(bitLen < n) { - bitBuf |= input[inputPosition++] << bitLen; - bitLen += 8; - } - var res = bitBuf & MASK_BITS[n]; - bitBuf >>= n; - bitLen -= n; - return res; - } - - function codes(buff, off, size) { - var e, t; - if(size == 0) return 0; - - var n = 0; - for(;;) { - t = tblList.list[addBits(bitList) & MASK_BITS[bitList]]; - e = t.extra; - while(e > 16) { - if(e == 99) return -1; - cutBits(t.bitcnt); - e -= 16; - t = t.next[addBits(e) & MASK_BITS[e]]; - e = t.extra; - } - cutBits(t.bitcnt); - if(e == 16) { - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = t.lbase; - if(n == size) return size; - continue; - } - if(e == 15) break; - - copyLen = t.lbase + maskBits(e); - t = tblDist.list[addBits(bitdist) & MASK_BITS[bitdist]]; - e = t.extra; - - while(e > 16) { - if(e == 99) return -1; - cutBits(t.bitcnt); - e -= 16; - t = t.next[addBits(e) & MASK_BITS[e]]; - e = t.extra - } - cutBits(t.bitcnt); - copyDist = windowPos - t.lbase - maskBits(e); - - while(copyLen > 0 && n < size) { - copyLen--; - copyDist &= WSIZE - 1; - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = slide[copyDist++]; - } - - if(n == size) return size; - } - - method = -1; // done - return n; - } - - function stored(buff, off, size) { - cutBits(bitLen & 7); - var n = maskBits(0x10); - if(n != ((~maskBits(0x10)) & 0xffff)) return -1; - copyLen = n; - - n = 0; - while(copyLen > 0 && n < size) { - copyLen--; - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = maskBits(8); - } - - if(copyLen == 0) method = -1; - return n; - } - - function fixed(buff, off, size) { - var fixed_bd = 0; - if(fixedTableList == null) { - var lengths = []; - - for(var symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; - for(; symbol < 256; symbol++) lengths[symbol] = 9; - for(; symbol < 280; symbol++) lengths[symbol] = 7; - for(; symbol < 288; symbol++) lengths[symbol] = 8; - - fixedLookup = 7; - - var htbl = new HuffTable(lengths, 288, 257, LENS, LEXT, fixedLookup); - - if(htbl.status != 0) return -1; - - fixedTableList = htbl.root; - fixedLookup = htbl.maxbit; - - for(symbol = 0; symbol < 30; symbol++) lengths[symbol] = 5; - fixed_bd = 5; - - htbl = new HuffTable(lengths, 30, 0, DISTS, DEXT, fixed_bd); - if(htbl.status > 1) { - fixedTableList = null; - return -1; - } - fixedTableDist = htbl.root; - fixed_bd = htbl.maxbit; - } - - tblList = fixedTableList; - tblDist = fixedTableDist; - bitList = fixedLookup; - bitdist = fixed_bd; - return codes(buff, off, size); - } - - function dynamic(buff, off, size) { - var ll = new Array(0x023C); - - for (var m = 0; m < 0x023C; m++) ll[m] = 0; - - var llencnt = 257 + maskBits(5), - dcodescnt = 1 + maskBits(5), - bitlencnt = 4 + maskBits(4); - - if(llencnt > 286 || dcodescnt > 30) return -1; - - for(var j = 0; j < bitlencnt; j++) ll[BITORDER[j]] = maskBits(3); - for(; j < 19; j++) ll[BITORDER[j]] = 0; - - // build decoding table for trees--single level, 7 bit lookup - bitList = 7; - var hufTable = new HuffTable(ll, 19, 19, null, null, bitList); - if(hufTable.status != 0) - return -1; // incomplete code set - - tblList = hufTable.root; - bitList = hufTable.maxbit; - var lencnt = llencnt + dcodescnt, - i = 0, - lastLen = 0; - while(i < lencnt) { - var hufLcode = tblList.list[addBits(bitList) & MASK_BITS[bitList]]; - j = hufLcode.bitcnt; - cutBits(j); - j = hufLcode.lbase; - if(j < 16) - ll[i++] = lastLen = j; - else if(j == 16) { - j = 3 + maskBits(2); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = lastLen; - } else if(j == 17) { - j = 3 + maskBits(3); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = 0; - lastLen = 0; - } else { - j = 11 + maskBits(7); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = 0; - lastLen = 0; - } - } - bitList = 9; - hufTable = new HuffTable(ll, llencnt, 257, LENS, LEXT, bitList); - bitList == 0 && (hufTable.status = 1); - - if (hufTable.status != 0) return -1; - - tblList = hufTable.root; - bitList = hufTable.maxbit; - - for(i = 0; i < dcodescnt; i++) ll[i] = ll[i + llencnt]; - bitdist = 6; - hufTable = new HuffTable(ll, dcodescnt, 0, DISTS, DEXT, bitdist); - tblDist = hufTable.root; - bitdist = hufTable.maxbit; - - if((bitdist == 0 && llencnt > 257) || hufTable.status != 0) return -1; - - return codes(buff, off, size); - } - - return { - inflate : function(/*Buffer*/outputBuffer) { - tblList = null; - - var size = outputBuffer.length, - offset = 0, i; - - while(offset < size) { - if(eof && method == -1) return; - if(copyLen > 0) { - if(method != 0) { - while(copyLen > 0 && offset < size) { - copyLen--; - copyDist &= WSIZE - 1; - windowPos &= WSIZE - 1; - outputBuffer[offset++] = (slide[windowPos++] = slide[copyDist++]); - } - } else { - while(copyLen > 0 && offset < size) { - copyLen--; - windowPos &= WSIZE - 1; - outputBuffer[offset++] = (slide[windowPos++] = maskBits(8)); - } - copyLen == 0 && (method = -1); // done - } - if (offset == size) return; - } - - if(method == -1) { - if(eof) break; - eof = maskBits(1) != 0; - method = maskBits(2); - tblList = null; - copyLen = 0; - } - switch(method) { - case 0: i = stored(outputBuffer, offset, size - offset); break; - case 1: i = tblList != null ? codes(outputBuffer, offset, size - offset) : fixed(outputBuffer, offset, size - offset); break; - case 2: i = tblList != null ? codes(outputBuffer, offset, size - offset) : dynamic(outputBuffer, offset, size - offset); break; - default: i = -1; break; - } - - if(i == -1) return; - offset += i; - } - } - }; -} - -module.exports = function(/*Buffer*/inbuf) { - var zlib = require("zlib"); - return { - inflateAsync : function(/*Function*/callback) { - var tmp = zlib.createInflateRaw(), - parts = [], total = 0; - tmp.on('data', function(data) { - parts.push(data); - total += data.length; - }); - tmp.on('end', function() { - var buf = new Buffer(total), written = 0; - buf.fill(0); - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - part.copy(buf, written); - written += part.length; - } - callback && callback(buf); - }); - tmp.end(inbuf) - }, - - inflate : function(/*Buffer*/outputBuffer) { - var x = new JSInflater(inbuf); - x.inflate(outputBuffer); - delete(x); - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json deleted file mode 100644 index af35d53..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "adm-zip", - "version": "0.4.3", - "description": "A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk", - "keywords": [ - "zip", - "methods", - "archive", - "unzip" - ], - "homepage": "http://github.com/cthackers/adm-zip", - "author": { - "name": "Nasca Iacob", - "email": "sy@another-d-mention.ro", - "url": "https://github.com/cthackers" - }, - "bugs": { - "url": "https://github.com/cthackers/adm-zip/issues", - "email": "sy@another-d-mention.ro" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/kriskowal/zip/raw/master/LICENSE" - } - ], - "main": "adm-zip.js", - "repository": { - "type": "git", - "url": "https://github.com/cthackers/adm-zip.git" - }, - "engines": { - "node": ">=0.3.0" - }, - "readme": "# ADM-ZIP for NodeJS\r\n\r\nADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/). \r\n\r\n# Installation\r\n\r\nWith [npm](http://npmjs.org) do:\r\n\r\n $ npm install adm-zip\r\n\t\r\n## What is it good for?\r\nThe library allows you to:\r\n\r\n* decompress zip files directly to disk or in memory buffers\r\n* compress files and store them to disk in .zip format or in compressed buffers\r\n* update content of/add new/delete files from an existing .zip\r\n\r\n# Dependencies\r\nThere are no other nodeJS libraries that ADM-ZIP is dependent of\r\n\r\n# Examples\r\n\r\n## Basic usage\r\n```javascript\r\n\r\n\tvar AdmZip = require('adm-zip');\r\n\r\n\t// reading archives\r\n\tvar zip = new AdmZip(\"./my_file.zip\");\r\n\tvar zipEntries = zip.getEntries(); // an array of ZipEntry records\r\n\r\n\tzipEntries.forEach(function(zipEntry) {\r\n\t console.log(zipEntry.toString()); // outputs zip entries information\r\n\t\tif (zipEntry.entryName == \"my_file.txt\") {\r\n\t\t console.log(zipEntry.data.toString('utf8')); \r\n\t\t}\r\n\t});\r\n\t// outputs the content of some_folder/my_file.txt\r\n\tconsole.log(zip.readAsText(\"some_folder/my_file.txt\")); \r\n\t// extracts the specified file to the specified location\r\n\tzip.extractEntryTo(/*entry name*/\"some_folder/my_file.txt\", /*target path*/\"/home/me/tempfolder\", /*overwrite*/true)\r\n\t// extracts everything\r\n\tzip.extractAllTo(/*target path*/\"/home/me/zipcontent/\", /*overwrite*/true);\r\n\t\r\n\t\r\n\t// creating archives\r\n\tvar zip = new AdmZip();\r\n\t\r\n\t// add file directly\r\n\tzip.addFile(\"test.txt\", new Buffer(\"inner content of the file\"), \"entry comment goes here\");\r\n\t// add local file\r\n\tzip.addLocalFile(\"/home/me/some_picture.png\");\r\n\t// get everything as a buffer\r\n\tvar willSendthis = zip.toBuffer();\r\n\t// or write everything to disk\r\n\tzip.writeZip(/*target file name*/\"/home/me/files.zip\");\r\n\t\r\n\t\r\n\t// ... more examples in the wiki\r\n```\r\n\r\nFor more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).\n\n[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip)", - "readmeFilename": "README.md", - "_id": "adm-zip@0.4.3", - "dist": { - "shasum": "0714e822e1c21ce989b832150faad1316ad50f3f" - }, - "_from": "adm-zip@~0.4.3", - "_resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.3.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip deleted file mode 100644 index d57bfc0..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/asd/New Text Document.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/asd/New Text Document.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/blank file.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/blank file.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip deleted file mode 100644 index f4ed17b..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip deleted file mode 100644 index f4ed17b..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip deleted file mode 100644 index 188eccb..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip deleted file mode 100644 index 86a8ec7..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip deleted file mode 100644 index b4602c9..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip deleted file mode 100644 index e2add30..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip deleted file mode 100644 index 86a8ec7..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js deleted file mode 100644 index abf3bd8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js +++ /dev/null @@ -1,15 +0,0 @@ -var Attr = require("../util").FileAttr, - Zip = require("../adm-zip"), - fs = require("fs"); - -/* -var zip = new Zip(); -zip.addLocalFolder("c:/asd/"); -zip.writeZip("c:/asd.zip"); -*/ - -var zip = new Zip("c:/asd.zip"); -zip.getEntries().forEach(function(entry) { - // console.log(entry.toString()); -}); -zip.extractAllTo("C:/test"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js deleted file mode 100644 index 0548054..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js +++ /dev/null @@ -1,84 +0,0 @@ -module.exports = { - /* The local file header */ - LOCHDR : 30, // LOC header size - LOCSIG : 0x04034b50, // "PK\003\004" - LOCVER : 4, // version needed to extract - LOCFLG : 6, // general purpose bit flag - LOCHOW : 8, // compression method - LOCTIM : 10, // modification time (2 bytes time, 2 bytes date) - LOCCRC : 14, // uncompressed file crc-32 value - LOCSIZ : 18, // compressed size - LOCLEN : 22, // uncompressed size - LOCNAM : 26, // filename length - LOCEXT : 28, // extra field length - - /* The Data descriptor */ - EXTSIG : 0x08074b50, // "PK\007\008" - EXTHDR : 16, // EXT header size - EXTCRC : 4, // uncompressed file crc-32 value - EXTSIZ : 8, // compressed size - EXTLEN : 12, // uncompressed size - - /* The central directory file header */ - CENHDR : 46, // CEN header size - CENSIG : 0x02014b50, // "PK\001\002" - CENVEM : 4, // version made by - CENVER : 6, // version needed to extract - CENFLG : 8, // encrypt, decrypt flags - CENHOW : 10, // compression method - CENTIM : 12, // modification time (2 bytes time, 2 bytes date) - CENCRC : 16, // uncompressed file crc-32 value - CENSIZ : 20, // compressed size - CENLEN : 24, // uncompressed size - CENNAM : 28, // filename length - CENEXT : 30, // extra field length - CENCOM : 32, // file comment length - CENDSK : 34, // volume number start - CENATT : 36, // internal file attributes - CENATX : 38, // external file attributes (host system dependent) - CENOFF : 42, // LOC header offset - - /* The entries in the end of central directory */ - ENDHDR : 22, // END header size - ENDSIG : 0x06054b50, // "PK\005\006" - ENDSUB : 8, // number of entries on this disk - ENDTOT : 10, // total number of entries - ENDSIZ : 12, // central directory size in bytes - ENDOFF : 16, // offset of first CEN header - ENDCOM : 20, // zip file comment length - - /* Compression methods */ - STORED : 0, // no compression - SHRUNK : 1, // shrunk - REDUCED1 : 2, // reduced with compression factor 1 - REDUCED2 : 3, // reduced with compression factor 2 - REDUCED3 : 4, // reduced with compression factor 3 - REDUCED4 : 5, // reduced with compression factor 4 - IMPLODED : 6, // imploded - // 7 reserved - DEFLATED : 8, // deflated - ENHANCED_DEFLATED: 9, // enhanced deflated - PKWARE : 10,// PKWare DCL imploded - // 11 reserved - BZIP2 : 12, // compressed using BZIP2 - // 13 reserved - LZMA : 14, // LZMA - // 15-17 reserved - IBM_TERSE : 18, // compressed using IBM TERSE - IBM_LZ77 : 19, //IBM LZ77 z - - /* General purpose bit flag */ - FLG_ENC : 0, // encripted file - FLG_COMP1 : 1, // compression option - FLG_COMP2 : 2, // compression option - FLG_DESC : 4, // data descriptor - FLG_ENH : 8, // enhanced deflation - FLG_STR : 16, // strong encryption - FLG_LNG : 1024, // language encoding - FLG_MSK : 4096, // mask header values - - /* Load type */ - FILE : 0, - BUFFER : 1, - NONE : 2 -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js deleted file mode 100644 index db5d69e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - /* Header error messages */ - "INVALID_LOC" : "Invalid LOC header (bad signature)", - "INVALID_CEN" : "Invalid CEN header (bad signature)", - "INVALID_END" : "Invalid END header (bad signature)", - - /* ZipEntry error messages*/ - "NO_DATA" : "Nothing to decompress", - "BAD_CRC" : "CRC32 checksum failed", - "FILE_IN_THE_WAY" : "There is a file in the way: %s", - "UNKNOWN_METHOD" : "Invalid/unsupported compression method", - - /* Inflater error messages */ - "AVAIL_DATA" : "inflate::Available inflate data did not terminate", - "INVALID_DISTANCE" : "inflate::Invalid literal/length or distance code in fixed or dynamic block", - "TO_MANY_CODES" : "inflate::Dynamic block code description: too many length or distance codes", - "INVALID_REPEAT_LEN" : "inflate::Dynamic block code description: repeat more than specified lengths", - "INVALID_REPEAT_FIRST" : "inflate::Dynamic block code description: repeat lengths with no first length", - "INCOMPLETE_CODES" : "inflate::Dynamic block code description: code lengths codes incomplete", - "INVALID_DYN_DISTANCE": "inflate::Dynamic block code description: invalid distance code lengths", - "INVALID_CODES_LEN": "inflate::Dynamic block code description: invalid literal/length code lengths", - "INVALID_STORE_BLOCK" : "inflate::Stored block length did not match one's complement", - "INVALID_BLOCK_TYPE" : "inflate::Invalid block type (type == 3)", - - /* ADM-ZIP error messages */ - "CANT_EXTRACT_FILE" : "Could not extract the file", - "CANT_OVERRIDE" : "Target file already exists", - "NO_ZIP" : "No zip file was loaded", - "NO_ENTRY" : "Entry doesn't exist", - "DIRECTORY_CONTENT_ERROR" : "A directory cannot have content", - "FILE_NOT_FOUND" : "File not found: %s", - "NOT_IMPLEMENTED" : "Not implemented", - "INVALID_FILENAME" : "Invalid filename", - "INVALID_FORMAT" : "Invalid or unsupported zip format. No END header found" -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js deleted file mode 100644 index 2191ec1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js +++ /dev/null @@ -1,84 +0,0 @@ -var fs = require("fs"), - pth = require("path"); - -fs.existsSync = fs.existsSync || pth.existsSync; - -module.exports = function(/*String*/path) { - - var _path = path || "", - _permissions = 0, - _obj = newAttr(), - _stat = null; - - function newAttr() { - return { - directory : false, - readonly : false, - hidden : false, - executable : false, - mtime : 0, - atime : 0 - } - } - - if (_path && fs.existsSync(_path)) { - _stat = fs.statSync(_path); - _obj.directory = _stat.isDirectory(); - _obj.mtime = _stat.mtime; - _obj.atime = _stat.atime; - _obj.executable = !!(1 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.readonly = !!(2 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.hidden = pth.basename(_path)[0] === "."; - } else { - console.warn("Invalid path: " + _path) - } - - return { - - get directory () { - return _obj.directory; - }, - - get readOnly () { - return _obj.readonly; - }, - - get hidden () { - return _obj.hidden; - }, - - get mtime () { - return _obj.mtime; - }, - - get atime () { - return _obj.atime; - }, - - - get executable () { - return _obj.executable; - }, - - decodeAttributes : function(val) { - - }, - - encodeAttributes : function (val) { - - }, - - toString : function() { - return '{\n' + - '\t"path" : "' + _path + ",\n" + - '\t"isDirectory" : ' + _obj.directory + ",\n" + - '\t"isReadOnly" : ' + _obj.readonly + ",\n" + - '\t"isHidden" : ' + _obj.hidden + ",\n" + - '\t"isExecutable" : ' + _obj.executable + ",\n" + - '\t"mTime" : ' + _obj.mtime + "\n" + - '\t"aTime" : ' + _obj.atime + "\n" + - '}'; - } - } - -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js deleted file mode 100644 index 935fc1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = require("./utils"); -module.exports.Constants = require("./constants"); -module.exports.Errors = require("./errors"); -module.exports.FileAttr = require("./fattr"); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js deleted file mode 100644 index bbd5366..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js +++ /dev/null @@ -1,145 +0,0 @@ -var fs = require("fs"), - pth = require('path'); - -fs.existsSync = fs.existsSync || pth.existsSync; - -module.exports = (function() { - - var crcTable = [], - Constants = require('./constants'), - Errors = require('./errors'), - - PATH_SEPARATOR = pth.normalize("/"); - - - function mkdirSync(/*String*/path) { - var resolvedPath = path.split(PATH_SEPARATOR)[0]; - path.split(PATH_SEPARATOR).forEach(function(name) { - if (!name || name.substr(-1,1) == ":") return; - resolvedPath += PATH_SEPARATOR + name; - var stat; - try { - stat = fs.statSync(resolvedPath); - } catch (e) { - fs.mkdirSync(resolvedPath); - } - if (stat && stat.isFile()) - throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath); - }); - } - - function findSync(/*String*/root, /*RegExp*/pattern, /*Boolean*/recoursive) { - if (typeof pattern === 'boolean') { - recoursive = pattern; - pattern = undefined; - } - var files = []; - fs.readdirSync(root).forEach(function(file) { - var path = pth.join(root, file); - - if (fs.statSync(path).isDirectory() && recoursive) - files = files.concat(findSync(path, pattern, recoursive)); - - if (!pattern || pattern.test(path)) { - files.push(pth.normalize(path) + (fs.statSync(path).isDirectory() ? PATH_SEPARATOR : "")); - } - - }); - return files; - } - - return { - makeDir : function(/*String*/path) { - mkdirSync(path); - }, - - crc32 : function(buf) { - var b = new Buffer(4); - if (!crcTable.length) { - for (var n = 0; n < 256; n++) { - var c = n; - for (var k = 8; --k >= 0;) // - if ((c & 1) != 0) { c = 0xedb88320 ^ (c >>> 1); } else { c = c >>> 1; } - if (c < 0) { - b.writeInt32LE(c, 0); - c = b.readUInt32LE(0); - } - crcTable[n] = c; - } - } - var crc = 0, off = 0, len = buf.length, c1 = ~crc; - while(--len >= 0) c1 = crcTable[(c1 ^ buf[off++]) & 0xff] ^ (c1 >>> 8); - crc = ~c1; - b.writeInt32LE(crc & 0xffffffff, 0); - return b.readUInt32LE(0); - }, - - methodToString : function(/*Number*/method) { - switch (method) { - case Constants.STORED: - return 'STORED (' + method + ')'; - case Constants.DEFLATED: - return 'DEFLATED (' + method + ')'; - default: - return 'UNSUPPORTED (' + method + ')' - } - - }, - - writeFileTo : function(/*String*/path, /*Buffer*/content, /*Boolean*/overwrite, /*Number*/attr) { - if (fs.existsSync(path)) { - if (!overwrite) - return false; // cannot overwite - - var stat = fs.statSync(path); - if (stat.isDirectory()) { - return false; - } - } - var folder = pth.dirname(path); - if (!fs.existsSync(folder)) { - mkdirSync(folder); - } - - var fd; - try { - fd = fs.openSync(path, 'w', 0666); - } catch(e) { - fs.chmodSync(path, 0666); - fd = fs.openSync(path, 'w', 0666); - } - if (fd) { - fs.writeSync(fd, content, 0, content.length, 0); - fs.closeSync(fd); - } - fs.chmodSync(path, attr || 0666); - return true; - }, - - findFiles : function(/*String*/path) { - return findSync(path, true); - }, - - getAttributes : function(/*String*/path) { - - }, - - setAttributes : function(/*String*/path) { - - }, - - toBuffer : function(input) { - if (Buffer.isBuffer(input)) { - return input; - } else { - if (input.length == 0) { - return new Buffer(0) - } - return new Buffer(input, 'utf8'); - } - }, - - Constants : Constants, - Errors : Errors - } -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js deleted file mode 100644 index fd0fa81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js +++ /dev/null @@ -1,224 +0,0 @@ -var Utils = require("./util"), - Headers = require("./headers"), - Constants = Utils.Constants, - Methods = require("./methods"); - -module.exports = function (/*Buffer*/input) { - - var _entryHeader = new Headers.EntryHeader(), - _entryName = new Buffer(0), - _comment = new Buffer(0), - _isDirectory = false, - uncompressedData = null, - _extra = new Buffer(0); - - function getCompressedDataFromZip() { - if (!input || !Buffer.isBuffer(input)) { - return new Buffer(0); - } - _entryHeader.loadDataHeaderFromBinary(input); - return input.slice(_entryHeader.realDataOffset, _entryHeader.realDataOffset + _entryHeader.compressedSize) - } - - function crc32OK(data) { - // if bit 3 (0x08) of the general-purpose flags field is set, then the CRC-32 and file sizes are not known when the header is written - if (_entryHeader.flags & 0x8 != 0x8) { - if (Utils.crc32(data) != _entryHeader.crc) { - return false; - } - } else { - // @TODO: load and check data descriptor header - // The fields in the local header are filled with zero, and the CRC-32 and size are appended in a 12-byte structure - // (optionally preceded by a 4-byte signature) immediately after the compressed data: - } - return true; - } - - function decompress(/*Boolean*/async, /*Function*/callback) { - if (_isDirectory) { - if (async && callback) { - callback(new Buffer(0), Utils.Errors.DIRECTORY_CONTENT_ERROR); //si added error. - } - return new Buffer(0); - } - - var compressedData = getCompressedDataFromZip(); - if (compressedData.length == 0) { - if (async && callback) callback(compressedData, Utils.Errors.NO_DATA);//si added error. - return compressedData; - } - - var data = new Buffer(_entryHeader.size); - data.fill(0); - - switch (_entryHeader.method) { - case Utils.Constants.STORED: - compressedData.copy(data); - if (!crc32OK(data)) { - if (async && callback) callback(data, Utils.Errors.BAD_CRC);//si added error - return Utils.Errors.BAD_CRC; - } else {//si added otherwise did not seem to return data. - if (async && callback) callback(data); - return data; - } - break; - case Utils.Constants.DEFLATED: - var inflater = new Methods.Inflater(compressedData); - if (!async) { - inflater.inflate(data); - if (!crc32OK(data)) { - console.warn(Utils.Errors.BAD_CRC + " " + _entryName.toString()) - } - return data; - } else { - inflater.inflateAsync(function(result) { - result.copy(data, 0); - if (crc32OK(data)) { - if (callback) callback(data, Utils.Errors.BAD_CRC); //si added error - } else { //si added otherwise did not seem to return data. - if (callback) callback(data); - } - }) - } - break; - default: - if (async && callback) callback(new Buffer(0), Utils.Errors.UNKNOWN_METHOD); - return Utils.Errors.UNKNOWN_METHOD; - } - } - - function compress(/*Boolean*/async, /*Function*/callback) { - if ((!uncompressedData || !uncompressedData.length) && Buffer.isBuffer(input)) { - // no data set or the data wasn't changed to require recompression - if (async && callback) callback(getCompressedDataFromZip()); - return getCompressedDataFromZip(); - } - - if (uncompressedData.length && !_isDirectory) { - var compressedData; - // Local file header - switch (_entryHeader.method) { - case Utils.Constants.STORED: - _entryHeader.compressedSize = _entryHeader.size; - - compressedData = new Buffer(uncompressedData.length); - uncompressedData.copy(compressedData); - - if (async && callback) callback(compressedData); - return compressedData; - - break; - default: - case Utils.Constants.DEFLATED: - var deflater = new Methods.Deflater(uncompressedData); - if (!async) { - console.log(_entryName.toString()); - var deflated = deflater.deflate(); - _entryHeader.compressedSize = deflated.length; - return deflated; - } else { - deflater.deflateAsync(function(data) { - compressedData = new Buffer(data.length); - _entryHeader.compressedSize = data.length; - data.copy(compressedData); - callback && callback(compressedData); - }) - } - deflater = null; - break; - } - } else { - if (async && callback) { - callback(new Buffer(0)); - } else { - return new Buffer(0); - } - } - } - - return { - get entryName () { return _entryName.toString(); }, - get rawEntryName() { return _entryName; }, - set entryName (val) { - _entryName = Utils.toBuffer(val); - var lastChar = _entryName[_entryName.length - 1]; - _isDirectory = (lastChar == 47) || (lastChar == 92); - _entryHeader.fileNameLength = _entryName.length; - }, - - get extra () { return _extra; }, - set extra (val) { - _extra = val; - _entryHeader.extraLength = val.length; - }, - - get comment () { return _comment.toString(); }, - set comment (val) { - _comment = Utils.toBuffer(val); - _entryHeader.commentLength = _comment.length; - }, - - get name () { var n = _entryName.toString(); return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop(); }, - get isDirectory () { return _isDirectory }, - - getCompressedData : function() { - return compress(false, null) - }, - - getCompressedDataAsync : function(/*Function*/callback) { - compress(true, callback) - }, - - setData : function(value) { - uncompressedData = Utils.toBuffer(value); - if (!_isDirectory && uncompressedData.length) { - _entryHeader.size = uncompressedData.length; - _entryHeader.method = Utils.Constants.DEFLATED; - _entryHeader.crc = Utils.crc32(value); - } else { // folders and blank files should be stored - _entryHeader.method = Utils.Constants.STORED; - } - }, - - getData : function() { - return decompress(false, null); - }, - - getDataAsync : function(/*Function*/callback) { - decompress(true, callback) - }, - - set header(/*Buffer*/data) { - _entryHeader.loadFromBinary(data); - }, - - get header() { - return _entryHeader; - }, - - packHeader : function() { - var header = _entryHeader.entryHeaderToBinary(); - // add - _entryName.copy(header, Utils.Constants.CENHDR); - if (_entryHeader.extraLength) { - _extra.copy(header, Utils.Constants.CENHDR + _entryName.length) - } - if (_entryHeader.commentLength) { - _comment.copy(header, Utils.Constants.CENHDR + _entryName.length + _entryHeader.extraLength, _comment.length); - } - return header; - }, - - toString : function() { - return '{\n' + - '\t"entryName" : "' + _entryName.toString() + "\",\n" + - '\t"name" : "' + _entryName.toString().split("/").pop() + "\",\n" + - '\t"comment" : "' + _comment.toString() + "\",\n" + - '\t"isDirectory" : ' + _isDirectory + ",\n" + - '\t"header" : ' + _entryHeader.toString().replace(/\t/mg, "\t\t") + ",\n" + - '\t"compressedData" : <' + (input && input.length + " bytes buffer" || "null") + ">\n" + - '\t"data" : <' + (uncompressedData && uncompressedData.length + " bytes buffer" || "null") + ">\n" + - '}'; - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js deleted file mode 100644 index b0f78cf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js +++ /dev/null @@ -1,233 +0,0 @@ -var ZipEntry = require("./zipEntry"), - Headers = require("./headers"); - Utils = require("./util"); - -module.exports = function(/*String|Buffer*/input, /*Number*/inputType) { - var entryList = [], - entryTable = {}, - _comment = new Buffer(0), - filename = "", - fs = require("fs"), - inBuffer = null, - mainHeader = new Headers.MainHeader(); - - if (inputType == Utils.Constants.FILE) { - // is a filename - filename = input; - inBuffer = fs.readFileSync(filename); - readMainHeader(); - } else if (inputType == Utils.Constants.BUFFER) { - // is a memory buffer - inBuffer = input; - readMainHeader(); - } else { - // none. is a new file - } - - function readEntries() { - entryTable = {}; - entryList = new Array(mainHeader.diskEntries); // total number of entries - var index = mainHeader.offset; // offset of first CEN header - for(var i = 0; i < entryList.length; i++) { - - var tmp = index, - entry = new ZipEntry(inBuffer); - entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); - - entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); - - if (entry.header.extraLength) { - entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength); - } - - if (entry.header.commentLength) - entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength); - - index += entry.header.entryHeaderSize; - - entryList[i] = entry; - entryTable[entry.entryName] = entry; - } - } - - function readMainHeader() { - var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size - n = Math.max(0, i - 0xFFFF), // 0xFFFF is the max zip file comment length - endOffset = 0; // Start offset of the END header - - for (i; i >= n; i--) { - if (inBuffer[i] != 0x50) continue; // quick check that the byte is 'P' - if (inBuffer.readUInt32LE(i) == Utils.Constants.ENDSIG) { // "PK\005\006" - endOffset = i; - break; - } - } - if (!endOffset) - throw Utils.Errors.INVALID_FORMAT; - - mainHeader.loadFromBinary(inBuffer.slice(endOffset, endOffset + Utils.Constants.ENDHDR)); - if (mainHeader.commentLength) { - _comment = inBuffer.slice(endOffset + Utils.Constants.ENDHDR); - } - readEntries(); - } - - return { - /** - * Returns an array of ZipEntry objects existent in the current opened archive - * @return Array - */ - get entries () { - return entryList; - }, - - /** - * Archive comment - * @return {String} - */ - get comment () { return _comment.toString(); }, - set comment(val) { - mainHeader.commentLength = val.length; - _comment = val; - }, - - /** - * Returns a reference to the entry with the given name or null if entry is inexistent - * - * @param entryName - * @return ZipEntry - */ - getEntry : function(/*String*/entryName) { - return entryTable[entryName] || null; - }, - - /** - * Adds the given entry to the entry list - * - * @param entry - */ - setEntry : function(/*ZipEntry*/entry) { - entryList.push(entry); - entryTable[entry.entryName] = entry; - mainHeader.totalEntries = entryList.length; - }, - - /** - * Removes the entry with the given name from the entry list. - * - * If the entry is a directory, then all nested files and directories will be removed - * @param entryName - */ - deleteEntry : function(/*String*/entryName) { - var entry = entryTable[entryName]; - if (entry && entry.isDirectory) { - var _self = this; - this.getEntryChildren(entry).forEach(function(child) { - if (child.entryName != entryName) { - _self.deleteEntry(child.entryName) - } - }) - } - entryList.slice(entryList.indexOf(entry), 1); - delete(entryTable[entryName]); - mainHeader.totalEntries = entryList.length; - }, - - /** - * Iterates and returns all nested files and directories of the given entry - * - * @param entry - * @return Array - */ - getEntryChildren : function(/*ZipEntry*/entry) { - if (entry.isDirectory) { - var list = [], - name = entry.entryName, - len = name.length; - - entryList.forEach(function(zipEntry) { - if (zipEntry.entryName.substr(0, len) == name) { - list.push(zipEntry); - } - }); - return list; - } - return [] - }, - - /** - * Returns the zip file - * - * @return Buffer - */ - compressToBuffer : function() { - if (entryList.length > 1) { - entryList.sort(function(a, b) { - var nameA = a.entryName.toLowerCase(); - var nameB = b.entryName.toLowerCase(); - if (nameA < nameB) {return -1} - if (nameA > nameB) {return 1} - return 0; - }); - } - - var totalSize = 0, - dataBlock = [], - entryHeaders = [], - dindex = 0; - - mainHeader.size = 0; - mainHeader.offset = 0; - - entryList.forEach(function(entry) { - entry.header.offset = dindex; - - // compress data and set local and entry header accordingly. Reason why is called first - var compressedData = entry.getCompressedData(); - // data header - var dataHeader = entry.header.dataHeaderToBinary(); - var postHeader = new Buffer(entry.entryName + entry.extra.toString()); - var dataLength = dataHeader.length + postHeader.length + compressedData.length; - - dindex += dataLength; - - dataBlock.push(dataHeader); - dataBlock.push(postHeader); - dataBlock.push(compressedData); - - var entryHeader = entry.packHeader(); - entryHeaders.push(entryHeader); - mainHeader.size += entryHeader.length; - totalSize += (dataLength + entryHeader.length); - }); - - totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length - // point to end of data and begining of central directory first record - mainHeader.offset = dindex; - - dindex = 0; - var outBuffer = new Buffer(totalSize); - dataBlock.forEach(function(content) { - content.copy(outBuffer, dindex); // write data blocks - dindex += content.length; - }); - entryHeaders.forEach(function(content) { - content.copy(outBuffer, dindex); // write central directory entries - dindex += content.length; - }); - - var mh = mainHeader.toBinary(); - if (_comment) { - _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment - } - - mh.copy(outBuffer, dindex); // write main header - - return outBuffer - }, - - toAsyncBuffer : function(/*Function*/callback) { - - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md deleted file mode 100644 index 8fc6779..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md +++ /dev/null @@ -1,26 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js deleted file mode 100755 index 29bfa8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index 5c1147c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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": "2.0.1", - "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* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index afc83b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,228 +0,0 @@ -var fs = require('fs') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - 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') - - 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.end() - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json deleted file mode 100644 index 08516f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "rimraf", - "version": "2.2.2", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~2" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~2" - }, - "_id": "rimraf@2.2.2", - "_from": "rimraf@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js deleted file mode 100644 index 55f8d9a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,184 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - 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 (er.code === "EBUSY" && 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() - 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")) - 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") - rmkidsSync(p) - } -} - -function rmkidsSync (p) { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore deleted file mode 100644 index 13abef4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -node_modules/* -npm_debug.log diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml deleted file mode 100644 index 895dbd3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE deleted file mode 100644 index 6d03581..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 'Dominic Tarr' - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md deleted file mode 100644 index 565e0e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# stream-combiner - - - -## Combine (stream1,...,streamN) - -Turn a pipeline into a single stream. `pipeline` returns a stream that writes to the first stream -and reads from the last stream. - -Listening for 'error' will recieve errors from all streams inside the pipe. - -``` js - var Combine = require('stream-combiner') - var es = require('event-stream') - - Combine( //connect streams together with `pipe` - process.openStdin(), //open stdin - es.split(), //split stream to break on newlines - es.map(function (data, callback) {//turn this async function into a stream - callback(null - , inspect(JSON.parse(data))) //render it nicely - }), - process.stdout // pipe it to stdout ! - ) -``` - -## License - -MIT diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js deleted file mode 100644 index 99cf5b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js +++ /dev/null @@ -1,39 +0,0 @@ -var duplexer = require('duplexer') - -module.exports = function () { - - var streams = [].slice.call(arguments) - , first = streams[0] - , last = streams[streams.length - 1] - , thepipe = duplexer(first, last) - - if(streams.length == 1) - return streams[0] - else if (!streams.length) - throw new Error('connect called with empty args') - - //pipe all the streams together - - function recurse (streams) { - if(streams.length < 2) - return - streams[0].pipe(streams[1]) - recurse(streams.slice(1)) - } - - recurse(streams) - - function onerror () { - var args = [].slice.call(arguments) - args.unshift('error') - thepipe.emit.apply(thepipe, args) - } - - //es.duplex already reemits the error from the first and last stream. - //add a listener for the inner streams in the pipeline. - for(var i = 1; i < streams.length - 1; i ++) - streams[i].on('error', onerror) - - return thepipe -} - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore deleted file mode 100644 index 062c11e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.log -*.err \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml deleted file mode 100644 index c2ba3f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile deleted file mode 100644 index 1f8985d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -test: - node test.js - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md deleted file mode 100644 index a24cecb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# duplexer [![build status][1]][2] - -Creates a duplex stream - -Taken from [event-stream][3] - -## duplex (writeStream, readStream) - -Takes a writable stream and a readable stream and makes them appear as a readable writable stream. - -It is assumed that the two streams are connected to each other in some way. - -## Example - - var grep = cp.exec('grep Stream') - - duplex(grep.stdin, grep.stdout) - -## Installation - -`npm install duplexer` - -## Tests - -`make test` - -## Contributors - - - Dominictarr - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Raynos/duplexer.png - [2]: http://travis-ci.org/Raynos/duplexer - [3]: https://github.com/dominictarr/event-stream#duplex-writestream-readstream \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js deleted file mode 100644 index 22e0d51..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js +++ /dev/null @@ -1,77 +0,0 @@ -var Stream = require("stream") - , writeMethods = ["write", "end", "destroy"] - , readMethods = ["resume", "pause"] - , readEvents = ["data", "close"] - , slice = Array.prototype.slice - -module.exports = duplex - -function duplex(writer, reader) { - var stream = new Stream() - , ended = false - - writeMethods.forEach(proxyWriter) - - readMethods.forEach(proxyReader) - - readEvents.forEach(proxyStream) - - reader.on("end", handleEnd) - - writer.on("drain", function() { - stream.emit("drain") - }) - - writer.on("error", reemit) - reader.on("error", reemit) - - stream.writable = writer.writable - stream.readable = reader.readable - - return stream - - function proxyWriter(methodName) { - stream[methodName] = method - - function method() { - return writer[methodName].apply(writer, arguments) - } - } - - function proxyReader(methodName) { - stream[methodName] = method - - function method() { - stream.emit(methodName) - var func = reader[methodName] - if (func) { - return func.apply(reader, arguments) - } - reader.emit(methodName) - } - } - - function proxyStream(methodName) { - reader.on(methodName, reemit) - - function reemit() { - var args = slice.call(arguments) - args.unshift(methodName) - stream.emit.apply(stream, args) - } - } - - function handleEnd() { - if (ended) { - return - } - ended = true - var args = slice.call(arguments) - args.unshift("end") - stream.emit.apply(stream, args) - } - - function reemit(err) { - stream.emit("error", err) - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json deleted file mode 100644 index cc6d314..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "duplexer", - "version": "0.0.4", - "description": "Creates a duplex stream", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/duplexer.git" - }, - "main": "index", - "homepage": "https://github.com/Raynos/duplexer", - "contributors": [ - { - "name": "Jake Verbaten" - } - ], - "bugs": { - "url": "https://github.com/Raynos/duplexer/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "through": "~0.1.4" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Raynos/duplexer/raw/master/LICENSE" - } - ], - "scripts": { - "test": "make test" - }, - "readme": "# duplexer [![build status][1]][2]\n\nCreates a duplex stream\n\nTaken from [event-stream][3]\n\n## duplex (writeStream, readStream)\n\nTakes a writable stream and a readable stream and makes them appear as a readable writable stream.\n\nIt is assumed that the two streams are connected to each other in some way.\n\n## Example\n\n var grep = cp.exec('grep Stream')\n\n duplex(grep.stdin, grep.stdout)\n\n## Installation\n\n`npm install duplexer`\n\n## Tests\n\n`make test`\n\n## Contributors\n\n - Dominictarr\n - Raynos\n\n## MIT Licenced\n\n [1]: https://secure.travis-ci.org/Raynos/duplexer.png\n [2]: http://travis-ci.org/Raynos/duplexer\n [3]: https://github.com/dominictarr/event-stream#duplex-writestream-readstream", - "readmeFilename": "README.md", - "_id": "duplexer@0.0.4", - "dist": { - "shasum": "3d8e199c895711c70cdf7c16cfc99d09c2760540" - }, - "_from": "duplexer@~0.0.3", - "_resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.0.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js deleted file mode 100644 index e06a864..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js +++ /dev/null @@ -1,27 +0,0 @@ -var duplex = require("./index") - , assert = require("assert") - , through = require("through") - -var readable = through() - , writable = through(write) - , written = 0 - , data = 0 - -var stream = duplex(writable, readable) - -function write() { - written++ -} - -stream.on("data", ondata) - -function ondata() { - data++ -} - -stream.write() -readable.emit("data") - -assert.equal(written, 1) -assert.equal(data, 1) -console.log("DONE") \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json deleted file mode 100644 index 3c10d93..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "stream-combiner", - "version": "0.0.2", - "homepage": "https://github.com/dominictarr/stream-combiner", - "repository": { - "type": "git", - "url": "git://github.com/dominictarr/stream-combiner.git" - }, - "dependencies": { - "duplexer": "~0.0.3" - }, - "devDependencies": { - "tape": "0.0.4", - "event-stream": "~3.0.7" - }, - "scripts": { - "test": "set -e; for t in test/*.js; do node $t; done" - }, - "author": { - "name": "'Dominic Tarr'", - "email": "dominic.tarr@gmail.com", - "url": "http://dominictarr.com" - }, - "license": "MIT", - "readme": "# stream-combiner\n\n\n\n## Combine (stream1,...,streamN)\n\nTurn a pipeline into a single stream. `pipeline` returns a stream that writes to the first stream\nand reads from the last stream. \n\nListening for 'error' will recieve errors from all streams inside the pipe.\n\n``` js\n var Combine = require('stream-combiner')\n var es = require('event-stream')\n\n Combine( //connect streams together with `pipe`\n process.openStdin(), //open stdin\n es.split(), //split stream to break on newlines\n es.map(function (data, callback) {//turn this async function into a stream\n callback(null\n , inspect(JSON.parse(data))) //render it nicely\n }),\n process.stdout // pipe it to stdout !\n )\n```\n\n## License\n\nMIT\n", - "readmeFilename": "README.md", - "description": "", - "bugs": { - "url": "https://github.com/dominictarr/stream-combiner/issues" - }, - "_id": "stream-combiner@0.0.2", - "dist": { - "shasum": "dfe0e74675742565e76c6056788ea5c23bd97db4" - }, - "_from": "stream-combiner@~0.0.2", - "_resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js deleted file mode 100644 index d17ddad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js +++ /dev/null @@ -1,52 +0,0 @@ -var es = require('event-stream') -var combine = require('..') -var test = require('tape') - -test('do not duplicate errors', function (test) { - - var errors = 0; - var pipe = combine( - es.through(function(data) { - return this.emit('data', data); - }), - es.through(function(data) { - return this.emit('error', new Error(data)); - }) - ) - - pipe.on('error', function(err) { - errors++ - test.ok(errors, 'expected error count') - process.nextTick(function () { - return test.end(); - }) - }) - - return pipe.write('meh'); -}) - -test('3 pipe do not duplicate errors', function (test) { - - var errors = 0; - var pipe = combine( - es.through(function(data) { - return this.emit('data', data); - }), - es.through(function(data) { - return this.emit('error', new Error(data)); - }), - es.through() - ) - - pipe.on('error', function(err) { - errors++ - test.ok(errors, 'expected error count') - process.nextTick(function () { - return test.end(); - }) - }) - - return pipe.write('meh'); - -}) - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore deleted file mode 100644 index c167ad5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules -examples/extract/ -test/tmp/ -test/fixtures/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml deleted file mode 100644 index 2d26206..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md deleted file mode 100644 index c6b0f82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js deleted file mode 100644 index e150abf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js deleted file mode 100644 index 39f3f08..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js deleted file mode 100644 index 4af5c41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js +++ /dev/null @@ -1,213 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js deleted file mode 100644 index 1728c45..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js +++ /dev/null @@ -1,191 +0,0 @@ - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js deleted file mode 100644 index 74f432c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js +++ /dev/null @@ -1,140 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js deleted file mode 100644 index c34a81e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js deleted file mode 100644 index 0bfc7b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js deleted file mode 100644 index 05b237c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js +++ /dev/null @@ -1,385 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js deleted file mode 100644 index 3ff14dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js +++ /dev/null @@ -1,231 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js deleted file mode 100644 index 884e73d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js +++ /dev/null @@ -1,270 +0,0 @@ - -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md deleted file mode 100644 index c16e9c4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js deleted file mode 100644 index 9328844..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js deleted file mode 100644 index 1141f3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js deleted file mode 100644 index 93e4068..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js deleted file mode 100644 index 55fa133..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js deleted file mode 100644 index 008de03..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js +++ /dev/null @@ -1,209 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json deleted file mode 100644 index 21bdee0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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" - }, - "_id": "block-stream@0.0.7", - "_from": "block-stream@*" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js deleted file mode 100644 index b4b9305..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js deleted file mode 100644 index 7a8de88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js deleted file mode 100644 index 6d38429..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js +++ /dev/null @@ -1,57 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js deleted file mode 100644 index 64d0d09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js deleted file mode 100644 index 1cc9ea0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js deleted file mode 100644 index c6db79a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js +++ /dev/null @@ -1,59 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore deleted file mode 100644 index 494272a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules/ -examples/deep-copy/ -examples/path/ -examples/filter-copy/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml deleted file mode 100644 index 2d26206..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md deleted file mode 100644 index 9d8cb77..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js deleted file mode 100644 index c6b55b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js +++ /dev/null @@ -1,131 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - !this.basename.match(/^filter-copy$/) - } - }) - -// this writer will only write directories -var w = fstream.Writer({ path: path.resolve(__dirname, "filter-copy") - , type: "Directory" - , filter: function () { - return this.type === "Directory" - } - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 1000) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -var i = 1 -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok " + (i ++) + " A WINNAR IS YOU") - ended = true - // now go through and verify that everything in there is a dir. - var p = path.resolve(__dirname, "filter-copy") - var checker = fstream.Reader({ path: p }) - checker.checker = true - checker.on("child", function (e) { - var ok = e.type === "Directory" - console.log((ok ? "" : "not ") + "ok " + (i ++) + - " should be a dir: " + - e.path.substr(checker.path.length + 1)) - }) -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok " + (i ++) + " ended") -}) - -r.pipe(w) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js deleted file mode 100644 index 648ec84..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js +++ /dev/null @@ -1,115 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - } - }) - -var w = fstream.Writer({ path: path.resolve(__dirname, "deep-copy") - , type: "Directory" - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename, entry) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 10) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok 1 A WINNAR IS YOU") - ended = true -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok 2 ended") -}) - -r.pipe(w) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js deleted file mode 100644 index 9aa1a95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js +++ /dev/null @@ -1,54 +0,0 @@ -var fstream = require("../fstream.js") -var tap = require("tap") -var fs = require("fs") -var path = require("path") -var children = -1 -var dir = path.dirname(__dirname) - -var gotReady = false -var ended = false - -tap.test("reader test", function (t) { - - var r = fstream.Reader({ path: dir - , filter: function () { - // return this.parent === r - return this.parent === r || this === r - } - }) - - r.on("ready", function () { - gotReady = true - children = fs.readdirSync(dir).length - console.error("Setting expected children to "+children) - t.equal(r.type, "Directory", "should be a directory") - }) - - r.on("entry", function (entry) { - children -- - if (!gotReady) { - t.fail("children before ready!") - } - t.equal(entry.dirname, r.path, "basename is parent dir") - }) - - r.on("error", function (er) { - t.fail(er) - t.end() - process.exit(1) - }) - - r.on("end", function () { - t.equal(children, 0, "should have seen all children") - ended = true - }) - - var closed = false - r.on("close", function () { - t.ok(ended, "saw end before close") - t.notOk(closed, "close should only happen once") - closed = true - t.end() - }) - -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js deleted file mode 100644 index d7816d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js +++ /dev/null @@ -1,24 +0,0 @@ -var fstream = require("../fstream.js") - , closed = false - -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , isSymbolicLink: true - , mode: "0755" // octal strings supported - }) - .on("close", function () { - closed = true - var fs = require("fs") - var s = fs.lstatSync("path/to/symlink") - var isSym = s.isSymbolicLink() - console.log((isSym?"":"not ") +"ok 1 should be symlink") - var t = fs.readlinkSync("path/to/symlink") - var isTarget = t === "./file" - console.log((isTarget?"":"not ") +"ok 2 should link to ./file") - }) - .end() - -process.on("exit", function () { - console.log((closed?"":"not ")+"ok 3 should be closed") -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js deleted file mode 100644 index c66d26f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.Abstract = require("./lib/abstract.js") -exports.Reader = require("./lib/reader.js") -exports.Writer = require("./lib/writer.js") - -exports.File = - { Reader: require("./lib/file-reader.js") - , Writer: require("./lib/file-writer.js") } - -exports.Dir = - { Reader : require("./lib/dir-reader.js") - , Writer : require("./lib/dir-writer.js") } - -exports.Link = - { Reader : require("./lib/link-reader.js") - , Writer : require("./lib/link-writer.js") } - -exports.Proxy = - { Reader : require("./lib/proxy-reader.js") - , Writer : require("./lib/proxy-writer.js") } - -exports.Reader.Dir = exports.DirReader = exports.Dir.Reader -exports.Reader.File = exports.FileReader = exports.File.Reader -exports.Reader.Link = exports.LinkReader = exports.Link.Reader -exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader - -exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer -exports.Writer.File = exports.FileWriter = exports.File.Writer -exports.Writer.Link = exports.LinkWriter = exports.Link.Writer -exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer - -exports.collect = require("./lib/collect.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js deleted file mode 100644 index 11ef0e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js +++ /dev/null @@ -1,85 +0,0 @@ -// the parent class for all fstreams. - -module.exports = Abstract - -var Stream = require("stream").Stream - , inherits = require("inherits") - -function Abstract () { - Stream.call(this) -} - -inherits(Abstract, Stream) - -Abstract.prototype.on = function (ev, fn) { - if (ev === "ready" && this.ready) { - process.nextTick(fn.bind(this)) - } else { - Stream.prototype.on.call(this, ev, fn) - } - return this -} - -Abstract.prototype.abort = function () { - this._aborted = true - this.emit("abort") -} - -Abstract.prototype.destroy = function () {} - -Abstract.prototype.warn = function (msg, code) { - var me = this - , er = decorate(msg, code, me) - if (!me.listeners("warn")) { - console.error("%s %s\n" + - "path = %s\n" + - "syscall = %s\n" + - "fstream_type = %s\n" + - "fstream_path = %s\n" + - "fstream_unc_path = %s\n" + - "fstream_class = %s\n" + - "fstream_stack =\n%s\n", - code || "UNKNOWN", - er.stack, - er.path, - er.syscall, - er.fstream_type, - er.fstream_path, - er.fstream_unc_path, - er.fstream_class, - er.fstream_stack.join("\n")) - } else { - me.emit("warn", er) - } -} - -Abstract.prototype.info = function (msg, code) { - this.emit("info", msg, code) -} - -Abstract.prototype.error = function (msg, code, th) { - var er = decorate(msg, code, this) - if (th) throw er - else this.emit("error", er) -} - -function decorate (er, code, me) { - if (!(er instanceof Error)) er = new Error(er) - er.code = er.code || code - er.path = er.path || me.path - er.fstream_type = er.fstream_type || me.type - er.fstream_path = er.fstream_path || me.path - if (me._path !== me.path) { - er.fstream_unc_path = er.fstream_unc_path || me._path - } - if (me.linkpath) { - er.fstream_linkpath = er.fstream_linkpath || me.linkpath - } - er.fstream_class = er.fstream_class || me.constructor.name - er.fstream_stack = er.fstream_stack || - new Error().stack.split(/\n/).slice(3).map(function (s) { - return s.replace(/^ at /, "") - }) - - return er -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js deleted file mode 100644 index a36f780..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = collect - -function collect (stream) { - if (stream._collected) return - - stream._collected = true - stream.pause() - - stream.on("data", save) - stream.on("end", save) - var buf = [] - function save (b) { - if (typeof b === "string") b = new Buffer(b) - if (Buffer.isBuffer(b) && !b.length) return - buf.push(b) - } - - stream.on("entry", saveEntry) - var entryBuffer = [] - function saveEntry (e) { - collect(e) - entryBuffer.push(e) - } - - stream.on("proxy", proxyPause) - function proxyPause (p) { - p.pause() - } - - - // replace the pipe method with a new version that will - // unlock the buffered stuff. if you just call .pipe() - // without a destination, then it'll re-play the events. - stream.pipe = (function (orig) { return function (dest) { - // console.error(" === open the pipes", dest && dest.path) - - // let the entries flow through one at a time. - // Once they're all done, then we can resume completely. - var e = 0 - ;(function unblockEntry () { - var entry = entryBuffer[e++] - // console.error(" ==== unblock entry", entry && entry.path) - if (!entry) return resume() - entry.on("end", unblockEntry) - if (dest) dest.add(entry) - else stream.emit("entry", entry) - })() - - function resume () { - stream.removeListener("entry", saveEntry) - stream.removeListener("data", save) - stream.removeListener("end", save) - - stream.pipe = orig - if (dest) stream.pipe(dest) - - buf.forEach(function (b) { - if (b) stream.emit("data", b) - else stream.emit("end") - }) - - stream.resume() - } - - return dest - }})(stream.pipe) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js deleted file mode 100644 index dd9883b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js +++ /dev/null @@ -1,250 +0,0 @@ -// A thing that emits "entry" events with Reader objects -// Pausing it causes it to stop emitting entry events, and also -// pauses the current entry if there is one. - -module.exports = DirReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , Reader = require("./reader.js") - , assert = require("assert").ok - -inherits(DirReader, Reader) - -function DirReader (props) { - var me = this - if (!(me instanceof DirReader)) throw new Error( - "DirReader must be called as constructor.") - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - throw new Error("Non-directory type "+ props.type) - } - - me.entries = null - me._index = -1 - me._paused = false - me._length = -1 - - if (props.sort) { - this.sort = props.sort - } - - Reader.call(this, props) -} - -DirReader.prototype._getEntries = function () { - var me = this - - // race condition. might pause() before calling _getEntries, - // and then resume, and try to get them a second time. - if (me._gotEntries) return - me._gotEntries = true - - fs.readdir(me._path, function (er, entries) { - if (er) return me.error(er) - - me.entries = entries - - me.emit("entries", entries) - if (me._paused) me.once("resume", processEntries) - else processEntries() - - function processEntries () { - me._length = me.entries.length - if (typeof me.sort === "function") { - me.entries = me.entries.sort(me.sort.bind(me)) - } - me._read() - } - }) -} - -// start walking the dir, and emit an "entry" event for each one. -DirReader.prototype._read = function () { - var me = this - - if (!me.entries) return me._getEntries() - - if (me._paused || me._currentEntry || me._aborted) { - // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted) - return - } - - me._index ++ - if (me._index >= me.entries.length) { - if (!me._ended) { - me._ended = true - me.emit("end") - me.emit("close") - } - return - } - - // ok, handle this one, then. - - // save creating a proxy, by stat'ing the thing now. - var p = path.resolve(me._path, me.entries[me._index]) - assert(p !== me._path) - assert(me.entries[me._index]) - - // set this to prevent trying to _read() again in the stat time. - me._currentEntry = p - fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) { - if (er) return me.error(er) - - var who = me._proxy || me - - stat.path = p - stat.basename = path.basename(p) - stat.dirname = path.dirname(p) - var childProps = me.getChildProps.call(who, stat) - childProps.path = p - childProps.basename = path.basename(p) - childProps.dirname = path.dirname(p) - - var entry = Reader(childProps, stat) - - // console.error("DR Entry", p, stat.size) - - me._currentEntry = entry - - // "entry" events are for direct entries in a specific dir. - // "child" events are for any and all children at all levels. - // This nomenclature is not completely final. - - entry.on("pause", function (who) { - if (!me._paused && !entry._disowned) { - me.pause(who) - } - }) - - entry.on("resume", function (who) { - if (me._paused && !entry._disowned) { - me.resume(who) - } - }) - - entry.on("stat", function (props) { - me.emit("_entryStat", entry, props) - if (entry._aborted) return - if (entry._paused) entry.once("resume", function () { - me.emit("entryStat", entry, props) - }) - else me.emit("entryStat", entry, props) - }) - - entry.on("ready", function EMITCHILD () { - // console.error("DR emit child", entry._path) - if (me._paused) { - // console.error(" DR emit child - try again later") - // pause the child, and emit the "entry" event once we drain. - // console.error("DR pausing child entry") - entry.pause(me) - return me.once("resume", EMITCHILD) - } - - // skip over sockets. they can't be piped around properly, - // so there's really no sense even acknowledging them. - // if someone really wants to see them, they can listen to - // the "socket" events. - if (entry.type === "Socket") { - me.emit("socket", entry) - } else { - me.emitEntry(entry) - } - }) - - var ended = false - entry.on("close", onend) - entry.on("disown", onend) - function onend () { - if (ended) return - ended = true - me.emit("childEnd", entry) - me.emit("entryEnd", entry) - me._currentEntry = null - if (!me._paused) { - me._read() - } - } - - // XXX Remove this. Works in node as of 0.6.2 or so. - // Long filenames should not break stuff. - entry.on("error", function (er) { - if (entry._swallowErrors) { - me.warn(er) - entry.emit("end") - entry.emit("close") - } else { - me.emit("error", er) - } - }) - - // proxy up some events. - ; [ "child" - , "childEnd" - , "warn" - ].forEach(function (ev) { - entry.on(ev, me.emit.bind(me, ev)) - }) - }) -} - -DirReader.prototype.disown = function (entry) { - entry.emit("beforeDisown") - entry._disowned = true - entry.parent = entry.root = null - if (entry === this._currentEntry) { - this._currentEntry = null - } - entry.emit("disown") -} - -DirReader.prototype.getChildProps = function (stat) { - return { depth: this.depth + 1 - , root: this.root || this - , parent: this - , follow: this.follow - , filter: this.filter - , sort: this.props.sort - } -} - -DirReader.prototype.pause = function (who) { - var me = this - if (me._paused) return - who = who || me - me._paused = true - if (me._currentEntry && me._currentEntry.pause) { - me._currentEntry.pause(who) - } - me.emit("pause", who) -} - -DirReader.prototype.resume = function (who) { - var me = this - if (!me._paused) return - who = who || me - - me._paused = false - // console.error("DR Emit Resume", me._path) - me.emit("resume", who) - if (me._paused) { - // console.error("DR Re-paused", me._path) - return - } - - if (me._currentEntry) { - if (me._currentEntry.resume) me._currentEntry.resume(who) - } else me._read() -} - -DirReader.prototype.emitEntry = function (entry) { - this.emit("entry", entry) - this.emit("child", entry) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js deleted file mode 100644 index 7073b88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js +++ /dev/null @@ -1,171 +0,0 @@ -// It is expected that, when .add() returns false, the consumer -// of the DirWriter will pause until a "drain" event occurs. Note -// that this is *almost always going to be the case*, unless the -// thing being written is some sort of unsupported type, and thus -// skipped over. - -module.exports = DirWriter - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Writer = require("./writer.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , collect = require("./collect.js") - -inherits(DirWriter, Writer) - -function DirWriter (props) { - var me = this - if (!(me instanceof DirWriter)) me.error( - "DirWriter must be called as constructor.", null, true) - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - me.error("Non-directory type "+ props.type + " " + - JSON.stringify(props), null, true) - } - - Writer.call(this, props) -} - -DirWriter.prototype._create = function () { - var me = this - mkdir(me._path, Writer.dirmode, function (er) { - if (er) return me.error(er) - // ready to start getting entries! - me.ready = true - me.emit("ready") - me._process() - }) -} - -// a DirWriter has an add(entry) method, but its .write() doesn't -// do anything. Why a no-op rather than a throw? Because this -// leaves open the door for writing directory metadata for -// gnu/solaris style dumpdirs. -DirWriter.prototype.write = function () { - return true -} - -DirWriter.prototype.end = function () { - this._ended = true - this._process() -} - -DirWriter.prototype.add = function (entry) { - var me = this - - // console.error("\tadd", entry._path, "->", me._path) - collect(entry) - if (!me.ready || me._currentEntry) { - me._buffer.push(entry) - return false - } - - // create a new writer, and pipe the incoming entry into it. - if (me._ended) { - return me.error("add after end") - } - - me._buffer.push(entry) - me._process() - - return 0 === this._buffer.length -} - -DirWriter.prototype._process = function () { - var me = this - - // console.error("DW Process p=%j", me._processing, me.basename) - - if (me._processing) return - - var entry = me._buffer.shift() - if (!entry) { - // console.error("DW Drain") - me.emit("drain") - if (me._ended) me._finish() - return - } - - me._processing = true - // console.error("DW Entry", entry._path) - - me.emit("entry", entry) - - // ok, add this entry - // - // don't allow recursive copying - var p = entry - do { - var pp = p._path || p.path - if (pp === me.root._path || pp === me._path || - (pp && pp.indexOf(me._path) === 0)) { - // console.error("DW Exit (recursive)", entry.basename, me._path) - me._processing = false - if (entry._collected) entry.pipe() - return me._process() - } - } while (p = p.parent) - - // console.error("DW not recursive") - - // chop off the entry's root dir, replace with ours - var props = { parent: me - , root: me.root || me - , type: entry.type - , depth: me.depth + 1 } - - var p = entry._path || entry.path || entry.props.path - if (entry.parent) { - p = p.substr(entry.parent._path.length + 1) - } - // get rid of any ../../ shenanigans - props.path = path.join(me.path, path.join("/", p)) - - // if i have a filter, the child should inherit it. - props.filter = me.filter - - // all the rest of the stuff, copy over from the source. - Object.keys(entry.props).forEach(function (k) { - if (!props.hasOwnProperty(k)) { - props[k] = entry.props[k] - } - }) - - // not sure at this point what kind of writer this is. - var child = me._currentChild = new Writer(props) - child.on("ready", function () { - // console.error("DW Child Ready", child.type, child._path) - // console.error(" resuming", entry._path) - entry.pipe(child) - entry.resume() - }) - - // XXX Make this work in node. - // Long filenames should not break stuff. - child.on("error", function (er) { - if (child._swallowErrors) { - me.warn(er) - child.emit("end") - child.emit("close") - } else { - me.emit("error", er) - } - }) - - // we fire _end internally *after* end, so that we don't move on - // until any "end" listeners have had their chance to do stuff. - child.on("close", onend) - var ended = false - function onend () { - if (ended) return - ended = true - // console.error("* DW Child end", child.basename) - me._currentChild = null - me._processing = false - me._process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js deleted file mode 100644 index b1f9861..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js +++ /dev/null @@ -1,147 +0,0 @@ -// Basically just a wrapper around an fs.ReadStream - -module.exports = FileReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - , EOF = {EOF: true} - , CLOSE = {CLOSE: true} - -inherits(FileReader, Reader) - -function FileReader (props) { - // console.error(" FR create", props.path, props.size, new Error().stack) - var me = this - if (!(me instanceof FileReader)) throw new Error( - "FileReader must be called as constructor.") - - // should already be established as a File type - // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, - // with a HardLinkReader class. - if (!((props.type === "Link" && props.Link) || - (props.type === "File" && props.File))) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesEmitted = 0 - Reader.call(me, props) -} - -FileReader.prototype._getStream = function () { - var me = this - , stream = me._stream = fs.createReadStream(me._path, me.props) - - if (me.props.blksize) { - stream.bufferSize = me.props.blksize - } - - stream.on("open", me.emit.bind(me, "open")) - - stream.on("data", function (c) { - // console.error("\t\t%d %s", c.length, me.basename) - me._bytesEmitted += c.length - // no point saving empty chunks - if (!c.length) return - else if (me._paused || me._buffer.length) { - me._buffer.push(c) - me._read() - } else me.emit("data", c) - }) - - stream.on("end", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering End", me._path) - me._buffer.push(EOF) - me._read() - } else { - me.emit("end") - } - - if (me._bytesEmitted !== me.props.size) { - me.error("Didn't get expected byte count\n"+ - "expect: "+me.props.size + "\n" + - "actual: "+me._bytesEmitted) - } - }) - - stream.on("close", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering Close", me._path) - me._buffer.push(CLOSE) - me._read() - } else { - // console.error("FR close 1", me._path) - me.emit("close") - } - }) - - me._read() -} - -FileReader.prototype._read = function () { - var me = this - // console.error("FR _read", me._path) - if (me._paused) { - // console.error("FR _read paused", me._path) - return - } - - if (!me._stream) { - // console.error("FR _getStream calling", me._path) - return me._getStream() - } - - // clear out the buffer, if there is one. - if (me._buffer.length) { - // console.error("FR _read has buffer", me._buffer.length, me._path) - var buf = me._buffer - for (var i = 0, l = buf.length; i < l; i ++) { - var c = buf[i] - if (c === EOF) { - // console.error("FR Read emitting buffered end", me._path) - me.emit("end") - } else if (c === CLOSE) { - // console.error("FR Read emitting buffered close", me._path) - me.emit("close") - } else { - // console.error("FR Read emitting buffered data", me._path) - me.emit("data", c) - } - - if (me._paused) { - // console.error("FR Read Re-pausing at "+i, me._path) - me._buffer = buf.slice(i) - return - } - } - me._buffer.length = 0 - } - // console.error("FR _read done") - // that's about all there is to it. -} - -FileReader.prototype.pause = function (who) { - var me = this - // console.error("FR Pause", me._path) - if (me._paused) return - who = who || me - me._paused = true - if (me._stream) me._stream.pause() - me.emit("pause", who) -} - -FileReader.prototype.resume = function (who) { - var me = this - // console.error("FR Resume", me._path) - if (!me._paused) return - who = who || me - me.emit("resume", who) - me._paused = false - if (me._stream) me._stream.resume() - me._read() -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js deleted file mode 100644 index 6811462..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = FileWriter - -var fs = require("graceful-fs") - , mkdir = require("mkdirp") - , Writer = require("./writer.js") - , inherits = require("inherits") - , EOF = {} - -inherits(FileWriter, Writer) - -function FileWriter (props) { - var me = this - if (!(me instanceof FileWriter)) throw new Error( - "FileWriter must be called as constructor.") - - // should already be established as a File type - if (props.type !== "File" || !props.File) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesWritten = 0 - - Writer.call(this, props) -} - -FileWriter.prototype._create = function () { - var me = this - if (me._stream) return - - var so = {} - if (me.props.flags) so.flags = me.props.flags - so.mode = Writer.filemode - if (me._old && me._old.blksize) so.bufferSize = me._old.blksize - - me._stream = fs.createWriteStream(me._path, so) - - me._stream.on("open", function (fd) { - // console.error("FW open", me._buffer, me._path) - me.ready = true - me._buffer.forEach(function (c) { - if (c === EOF) me._stream.end() - else me._stream.write(c) - }) - me.emit("ready") - // give this a kick just in case it needs it. - me.emit("drain") - }) - - me._stream.on("drain", function () { me.emit("drain") }) - - me._stream.on("close", function () { - // console.error("\n\nFW Stream Close", me._path, me.size) - me._finish() - }) -} - -FileWriter.prototype.write = function (c) { - var me = this - - me._bytesWritten += c.length - - if (!me.ready) { - if (!Buffer.isBuffer(c) && typeof c !== 'string') - throw new Error('invalid write data') - me._buffer.push(c) - return false - } - - var ret = me._stream.write(c) - // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length) - - // allow 2 buffered writes, because otherwise there's just too - // much stop and go bs. - return ret || (me._stream._queue && me._stream._queue.length <= 2) -} - -FileWriter.prototype.end = function (c) { - var me = this - - if (c) me.write(c) - - if (!me.ready) { - me._buffer.push(EOF) - return false - } - - return me._stream.end() -} - -FileWriter.prototype._finish = function () { - var me = this - if (typeof me.size === "number" && me._bytesWritten != me.size) { - me.error( - "Did not get expected byte count.\n" + - "expect: " + me.size + "\n" + - "actual: " + me._bytesWritten) - } - Writer.prototype._finish.call(me) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js deleted file mode 100644 index cd65c41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = getType - -function getType (st) { - var types = - [ "Directory" - , "File" - , "SymbolicLink" - , "Link" // special for hardlinks from tarballs - , "BlockDevice" - , "CharacterDevice" - , "FIFO" - , "Socket" ] - , type - - if (st.type && -1 !== types.indexOf(st.type)) { - st[st.type] = true - return st.type - } - - for (var i = 0, l = types.length; i < l; i ++) { - type = types[i] - var is = st[type] || st["is" + type] - if (typeof is === "function") is = is.call(st) - if (is) { - st[type] = true - st.type = type - return type - } - } - - return null -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js deleted file mode 100644 index 7e7ab6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js +++ /dev/null @@ -1,54 +0,0 @@ -// Basically just a wrapper around an fs.readlink -// -// XXX: Enhance this to support the Link type, by keeping -// a lookup table of {:}, so that hardlinks -// can be preserved in tarballs. - -module.exports = LinkReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(LinkReader, Reader) - -function LinkReader (props) { - var me = this - if (!(me instanceof LinkReader)) throw new Error( - "LinkReader must be called as constructor.") - - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - Reader.call(me, props) -} - -// When piping a LinkReader into a LinkWriter, we have to -// already have the linkpath property set, so that has to -// happen *before* the "ready" event, which means we need to -// override the _stat method. -LinkReader.prototype._stat = function (currentStat) { - var me = this - fs.readlink(me._path, function (er, linkpath) { - if (er) return me.error(er) - me.linkpath = me.props.linkpath = linkpath - me.emit("linkpath", linkpath) - Reader.prototype._stat.call(me, currentStat) - }) -} - -LinkReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we need - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js deleted file mode 100644 index 5c8f1e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js +++ /dev/null @@ -1,95 +0,0 @@ - -module.exports = LinkWriter - -var fs = require("graceful-fs") - , Writer = require("./writer.js") - , inherits = require("inherits") - , path = require("path") - , rimraf = require("rimraf") - -inherits(LinkWriter, Writer) - -function LinkWriter (props) { - var me = this - if (!(me instanceof LinkWriter)) throw new Error( - "LinkWriter must be called as constructor.") - - // should already be established as a Link type - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - if (props.linkpath === "") props.linkpath = "." - if (!props.linkpath) { - me.error("Need linkpath property to create " + props.type) - } - - Writer.call(this, props) -} - -LinkWriter.prototype._create = function () { - // console.error(" LW _create") - var me = this - , hard = me.type === "Link" || process.platform === "win32" - , link = hard ? "link" : "symlink" - , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath - - // can only change the link path by clobbering - // For hard links, let's just assume that's always the case, since - // there's no good way to read them if we don't already know. - if (hard) return clobber(me, lp, link) - - fs.readlink(me._path, function (er, p) { - // only skip creation if it's exactly the same link - if (p && p === lp) return finish(me) - clobber(me, lp, link) - }) -} - -function clobber (me, lp, link) { - rimraf(me._path, function (er) { - if (er) return me.error(er) - create(me, lp, link) - }) -} - -function create (me, lp, link) { - fs[link](lp, me._path, function (er) { - // if this is a hard link, and we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier in. - // Additionally, an EPERM or EACCES can happen on win32 if it's trying - // to make a link to a directory. Again, just skip it. - // A better solution would be to have fs.symlink be supported on - // windows in some nice fashion. - if (er) { - if ((er.code === "ENOENT" || - er.code === "EACCES" || - er.code === "EPERM" ) && process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - } else return me.error(er) - } - finish(me) - }) -} - -function finish (me) { - me.ready = true - me.emit("ready") - if (me._ended && !me._finished) me._finish() -} - -LinkWriter.prototype.end = function () { - // console.error("LW finish in end") - this._ended = true - if (this.ready) { - this._finished = true - this._finish() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js deleted file mode 100644 index a0ece34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js +++ /dev/null @@ -1,93 +0,0 @@ -// A reader for when we don't yet know what kind of thing -// the thing is. - -module.exports = ProxyReader - -var Reader = require("./reader.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , fs = require("graceful-fs") - -inherits(ProxyReader, Reader) - -function ProxyReader (props) { - var me = this - if (!(me instanceof ProxyReader)) throw new Error( - "ProxyReader must be called as constructor.") - - me.props = props - me._buffer = [] - me.ready = false - - Reader.call(me, props) -} - -ProxyReader.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Reader(props, current)) - }) -} - -ProxyReader.prototype._addProxy = function (proxy) { - var me = this - if (me._proxyTarget) { - return me.error("proxy already set") - } - - me._proxyTarget = proxy - proxy._proxy = me - - ; [ "error" - , "data" - , "end" - , "close" - , "linkpath" - , "entry" - , "entryEnd" - , "child" - , "childEnd" - , "warn" - , "stat" - ].forEach(function (ev) { - // console.error("~~ proxy event", ev, me.path) - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - proxy.on("ready", function () { - // console.error("~~ proxy is ready!", me.path) - me.ready = true - me.emit("ready") - }) - - var calls = me._buffer - me._buffer.length = 0 - calls.forEach(function (c) { - proxy[c[0]].apply(proxy, c[1]) - }) -} - -ProxyReader.prototype.pause = function () { - return this._proxyTarget ? this._proxyTarget.pause() : false -} - -ProxyReader.prototype.resume = function () { - return this._proxyTarget ? this._proxyTarget.resume() : false -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js deleted file mode 100644 index b047663..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js +++ /dev/null @@ -1,109 +0,0 @@ -// A writer for when we don't know what kind of thing -// the thing is. That is, it's not explicitly set, -// so we're going to make it whatever the thing already -// is, or "File" -// -// Until then, collect all events. - -module.exports = ProxyWriter - -var Writer = require("./writer.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , collect = require("./collect.js") - , fs = require("fs") - -inherits(ProxyWriter, Writer) - -function ProxyWriter (props) { - var me = this - if (!(me instanceof ProxyWriter)) throw new Error( - "ProxyWriter must be called as constructor.") - - me.props = props - me._needDrain = false - - Writer.call(me, props) -} - -ProxyWriter.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Writer(props, current)) - }) -} - -ProxyWriter.prototype._addProxy = function (proxy) { - // console.error("~~ set proxy", this.path) - var me = this - if (me._proxy) { - return me.error("proxy already set") - } - - me._proxy = proxy - ; [ "ready" - , "error" - , "close" - , "pipe" - , "drain" - , "warn" - ].forEach(function (ev) { - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - var calls = me._buffer - calls.forEach(function (c) { - // console.error("~~ ~~ proxy buffered call", c[0], c[1]) - proxy[c[0]].apply(proxy, c[1]) - }) - me._buffer.length = 0 - if (me._needsDrain) me.emit("drain") -} - -ProxyWriter.prototype.add = function (entry) { - // console.error("~~ proxy add") - collect(entry) - - if (!this._proxy) { - this._buffer.push(["add", [entry]]) - this._needDrain = true - return false - } - return this._proxy.add(entry) -} - -ProxyWriter.prototype.write = function (c) { - // console.error("~~ proxy write") - if (!this._proxy) { - this._buffer.push(["write", [c]]) - this._needDrain = true - return false - } - return this._proxy.write(c) -} - -ProxyWriter.prototype.end = function (c) { - // console.error("~~ proxy end") - if (!this._proxy) { - this._buffer.push(["end", [c]]) - return false - } - return this._proxy.end(c) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js deleted file mode 100644 index e4e1b48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js +++ /dev/null @@ -1,259 +0,0 @@ - -module.exports = Reader - -var fs = require("graceful-fs") - , Stream = require("stream").Stream - , inherits = require("inherits") - , path = require("path") - , getType = require("./get-type.js") - , hardLinks = Reader.hardLinks = {} - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Reader, Abstract) - -var DirReader = require("./dir-reader.js") - , FileReader = require("./file-reader.js") - , LinkReader = require("./link-reader.js") - , SocketReader = require("./socket-reader.js") - , ProxyReader = require("./proxy-reader.js") - -function Reader (props, currentStat) { - var me = this - if (!(me instanceof Reader)) return new Reader(props, currentStat) - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) { - me.error("Must provide a path", null, true) - } - - // polymorphism. - // call fstream.Reader(dir) to get a DirReader object, etc. - // Note that, unlike in the Writer case, ProxyReader is going - // to be the *normal* state of affairs, since we rarely know - // the type of a file prior to reading it. - - - var type - , ClassType - - if (props.type && typeof props.type === "function") { - type = props.type - ClassType = type - } else { - type = getType(props) - ClassType = Reader - } - - if (currentStat && !type) { - type = getType(currentStat) - props[type] = true - props.type = type - } - - switch (type) { - case "Directory": - ClassType = DirReader - break - - case "Link": - // XXX hard links are just files. - // However, it would be good to keep track of files' dev+inode - // and nlink values, and create a HardLinkReader that emits - // a linkpath value of the original copy, so that the tar - // writer can preserve them. - // ClassType = HardLinkReader - // break - - case "File": - ClassType = FileReader - break - - case "SymbolicLink": - ClassType = LinkReader - break - - case "Socket": - ClassType = SocketReader - break - - case null: - ClassType = ProxyReader - break - } - - if (!(me instanceof ClassType)) { - return new ClassType(props) - } - - Abstract.call(me) - - me.readable = true - me.writable = false - - me.type = type - me.props = props - me.depth = props.depth = props.depth || 0 - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - // how DOES one create files on the moon? - // if the path has spaces in it, then UNC will fail. - me._swallowErrors = true - //if (me._path.indexOf(" ") === -1) { - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - //} - } - } - me.basename = props.basename = path.basename(me.path) - me.dirname = props.dirname = path.dirname(me.path) - - // these have served their purpose, and are now just noisy clutter - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - me.filter = typeof props.filter === "function" ? props.filter : null - if (props.sort === "alpha") props.sort = alphasort - - // start the ball rolling. - // this will stat the thing, and then call me._read() - // to start reading whatever it is. - // console.error("calling stat", props.path, currentStat) - me._stat(currentStat) -} - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - -Reader.prototype._stat = function (currentStat) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - - // console.error("Reader._stat", me._path, currentStat) - if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) - else fs[stat](me._path, statCb) - - - function statCb (er, props_) { - // console.error("Reader._stat, statCb", me._path, props_, props_.nlink) - if (er) return me.error(er) - - Object.keys(props_).forEach(function (k) { - props[k] = props_[k] - }) - - // if it's not the expected size, then abort here. - if (undefined !== me.size && props.size !== me.size) { - return me.error("incorrect size") - } - me.size = props.size - - var type = getType(props) - // special little thing for handling hardlinks. - if (type !== "Directory" && props.nlink && props.nlink > 1) { - var k = props.dev + ":" + props.ino - // console.error("Reader has nlink", me._path, k) - if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path - else { - // switch into hardlink mode. - type = me.type = me.props.type = "Link" - me.Link = me.props.Link = true - me.linkpath = me.props.linkpath = hardLinks[k] - // console.error("Hardlink detected, switching mode", me._path, me.linkpath) - // Setting __proto__ would arguably be the "correct" - // approach here, but that just seems too wrong. - me._stat = me._read = LinkReader.prototype._read - } - } - - if (me.type && me.type !== type) { - me.error("Unexpected type: " + type) - } - - // if the filter doesn't pass, then just skip over this one. - // still have to emit end so that dir-walking can move on. - if (me.filter) { - var who = me._proxy || me - // special handling for ProxyReaders - if (!me.filter.call(who, who, props)) { - if (!me._disowned) { - me.abort() - me.emit("end") - me.emit("close") - } - return - } - } - - // last chance to abort or disown before the flow starts! - var events = ["_stat", "stat", "ready"] - var e = 0 - ;(function go () { - if (me._aborted) { - me.emit("end") - me.emit("close") - return - } - - if (me._paused) { - me.once("resume", go) - return - } - - var ev = events[e ++] - if (!ev) return me._read() - me.emit(ev, props) - go() - })() - } -} - -Reader.prototype.pipe = function (dest, opts) { - var me = this - if (typeof dest.add === "function") { - // piping to a multi-compatible, and we've got directory entries. - me.on("entry", function (entry) { - var ret = dest.add(entry) - if (false === ret) { - me.pause() - } - }) - } - - // console.error("R Pipe apply Stream Pipe") - return Stream.prototype.pipe.apply(this, arguments) -} - -Reader.prototype.pause = function (who) { - this._paused = true - who = who || this - this.emit("pause", who) - if (this._stream) this._stream.pause(who) -} - -Reader.prototype.resume = function (who) { - this._paused = false - who = who || this - this.emit("resume", who) - if (this._stream) this._stream.resume(who) - this._read() -} - -Reader.prototype._read = function () { - this.error("Cannot read unknown type: "+this.type) -} - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js deleted file mode 100644 index e89c173..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js +++ /dev/null @@ -1,38 +0,0 @@ -// Just get the stats, and then don't do anything. -// You can't really "read" from a socket. You "connect" to it. -// Mostly, this is here so that reading a dir with a socket in it -// doesn't blow up. - -module.exports = SocketReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(SocketReader, Reader) - -function SocketReader (props) { - var me = this - if (!(me instanceof SocketReader)) throw new Error( - "SocketReader must be called as constructor.") - - if (!(props.type === "Socket" && props.Socket)) { - throw new Error("Non-socket type "+ props.type) - } - - Reader.call(me, props) -} - -SocketReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we have - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js deleted file mode 100644 index 5599fb2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js +++ /dev/null @@ -1,389 +0,0 @@ - -module.exports = Writer - -var fs = require("graceful-fs") - , inherits = require("inherits") - , rimraf = require("rimraf") - , mkdir = require("mkdirp") - , path = require("path") - , umask = process.platform === "win32" ? 0 : process.umask() - , getType = require("./get-type.js") - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Writer, Abstract) - -Writer.dirmode = 0777 & (~umask) -Writer.filemode = 0666 & (~umask) - -var DirWriter = require("./dir-writer.js") - , LinkWriter = require("./link-writer.js") - , FileWriter = require("./file-writer.js") - , ProxyWriter = require("./proxy-writer.js") - -// props is the desired state. current is optionally the current stat, -// provided here so that subclasses can avoid statting the target -// more than necessary. -function Writer (props, current) { - var me = this - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) me.error("Must provide a path", null, true) - - // polymorphism. - // call fstream.Writer(dir) to get a DirWriter object, etc. - var type = getType(props) - , ClassType = Writer - - switch (type) { - case "Directory": - ClassType = DirWriter - break - case "File": - ClassType = FileWriter - break - case "Link": - case "SymbolicLink": - ClassType = LinkWriter - break - case null: - // Don't know yet what type to create, so we wrap in a proxy. - ClassType = ProxyWriter - break - } - - if (!(me instanceof ClassType)) return new ClassType(props) - - // now get down to business. - - Abstract.call(me) - - // props is what we want to set. - // set some convenience properties as well. - me.type = props.type - me.props = props - me.depth = props.depth || 0 - me.clobber = false === props.clobber ? props.clobber : true - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - me._swallowErrors = true - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - } - } - me.basename = path.basename(props.path) - me.dirname = path.dirname(props.path) - me.linkpath = props.linkpath || null - - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - - if (typeof props.mode === "string") { - props.mode = parseInt(props.mode, 8) - } - - me.readable = false - me.writable = true - - // buffer until ready, or while handling another entry - me._buffer = [] - me.ready = false - - me.filter = typeof props.filter === "function" ? props.filter: null - - // start the ball rolling. - // this checks what's there already, and then calls - // me._create() to call the impl-specific creation stuff. - me._stat(current) -} - -// Calling this means that it's something we can't create. -// Just assert that it's already there, otherwise raise a warning. -Writer.prototype._create = function () { - var me = this - fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) { - if (er) { - return me.warn("Cannot create " + me._path + "\n" + - "Unsupported type: "+me.type, "ENOTSUP") - } - me._finish() - }) -} - -Writer.prototype._stat = function (current) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - , who = me._proxy || me - - if (current) statCb(null, current) - else fs[stat](me._path, statCb) - - function statCb (er, current) { - if (me.filter && !me.filter.call(who, who, current)) { - me._aborted = true - me.emit("end") - me.emit("close") - return - } - - // if it's not there, great. We'll just create it. - // if it is there, then we'll need to change whatever differs - if (er || !current) { - return create(me) - } - - me._old = current - var currentType = getType(current) - - // if it's a type change, then we need to clobber or error. - // if it's not a type change, then let the impl take care of it. - if (currentType !== me.type) { - return rimraf(me._path, function (er) { - if (er) return me.error(er) - me._old = null - create(me) - }) - } - - // otherwise, just handle in the app-specific way - // this creates a fs.WriteStream, or mkdir's, or whatever - create(me) - } -} - -function create (me) { - // console.error("W create", me._path, Writer.dirmode) - - // XXX Need to clobber non-dirs that are in the way, - // unless { clobber: false } in the props. - mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) { - // console.error("W created", path.dirname(me._path), er) - if (er) return me.error(er) - - // later on, we have to set the mode and owner for these - me._madeDir = made - return me._create() - }) -} - -function endChmod (me, want, current, path, cb) { - var wantMode = want.mode - , chmod = want.follow || me.type !== "SymbolicLink" - ? "chmod" : "lchmod" - - if (!fs[chmod]) return cb() - if (typeof wantMode !== "number") return cb() - - var curMode = current.mode & 0777 - wantMode = wantMode & 0777 - if (wantMode === curMode) return cb() - - fs[chmod](path, wantMode, cb) -} - - -function endChown (me, want, current, path, cb) { - // Don't even try it unless root. Too easy to EPERM. - if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() - if (typeof want.uid !== "number" && - typeof want.gid !== "number" ) return cb() - - if (current.uid === want.uid && - current.gid === want.gid) return cb() - - var chown = (me.props.follow || me.type !== "SymbolicLink") - ? "chown" : "lchown" - if (!fs[chown]) return cb() - - if (typeof want.uid !== "number") want.uid = current.uid - if (typeof want.gid !== "number") want.gid = current.gid - - fs[chown](path, want.uid, want.gid, cb) -} - -function endUtimes (me, want, current, path, cb) { - if (!fs.utimes || process.platform === "win32") return cb() - - var utimes = (want.follow || me.type !== "SymbolicLink") - ? "utimes" : "lutimes" - - if (utimes === "lutimes" && !fs[utimes]) { - utimes = "utimes" - } - - if (!fs[utimes]) return cb() - - var curA = current.atime - , curM = current.mtime - , meA = want.atime - , meM = want.mtime - - if (meA === undefined) meA = curA - if (meM === undefined) meM = curM - - if (!isDate(meA)) meA = new Date(meA) - if (!isDate(meM)) meA = new Date(meM) - - if (meA.getTime() === curA.getTime() && - meM.getTime() === curM.getTime()) return cb() - - fs[utimes](path, meA, meM, cb) -} - - -// XXX This function is beastly. Break it up! -Writer.prototype._finish = function () { - var me = this - - // console.error(" W Finish", me._path, me.size) - - // set up all the things. - // At this point, we're already done writing whatever we've gotta write, - // adding files to the dir, etc. - var todo = 0 - var errState = null - var done = false - - if (me._old) { - // the times will almost *certainly* have changed. - // adds the utimes syscall, but remove another stat. - me._old.atime = new Date(0) - me._old.mtime = new Date(0) - // console.error(" W Finish Stale Stat", me._path, me.size) - setProps(me._old) - } else { - var stat = me.props.follow ? "stat" : "lstat" - // console.error(" W Finish Stating", me._path, me.size) - fs[stat](me._path, function (er, current) { - // console.error(" W Finish Stated", me._path, me.size, current) - if (er) { - // if we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier on. - if (er.code === "ENOENT" && - (me.type === "Link" || me.type === "SymbolicLink") && - process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - return - } else return me.error(er) - } - setProps(me._old = current) - }) - } - - return - - function setProps (current) { - todo += 3 - endChmod(me, me.props, current, me._path, next("chmod")) - endChown(me, me.props, current, me._path, next("chown")) - endUtimes(me, me.props, current, me._path, next("utimes")) - } - - function next (what) { - return function (er) { - // console.error(" W Finish", what, todo) - if (errState) return - if (er) { - er.fstream_finish_call = what - return me.error(errState = er) - } - if (--todo > 0) return - if (done) return - done = true - - // we may still need to set the mode/etc. on some parent dirs - // that were created previously. delay end/close until then. - if (!me._madeDir) return end() - else endMadeDir(me, me._path, end) - - function end (er) { - if (er) { - er.fstream_finish_call = "setupMadeDir" - return me.error(er) - } - // all the props have been set, so we're completely done. - me.emit("end") - me.emit("close") - } - } - } -} - -function endMadeDir (me, p, cb) { - var made = me._madeDir - // everything *between* made and path.dirname(me._path) - // needs to be set up. Note that this may just be one dir. - var d = path.dirname(p) - - endMadeDir_(me, d, function (er) { - if (er) return cb(er) - if (d === made) { - return cb() - } - endMadeDir(me, d, cb) - }) -} - -function endMadeDir_ (me, p, cb) { - var dirProps = {} - Object.keys(me.props).forEach(function (k) { - dirProps[k] = me.props[k] - - // only make non-readable dirs if explicitly requested. - if (k === "mode" && me.type !== "Directory") { - dirProps[k] = dirProps[k] | 0111 - } - }) - - var todo = 3 - , errState = null - fs.stat(p, function (er, current) { - if (er) return cb(errState = er) - endChmod(me, dirProps, current, p, next) - endChown(me, dirProps, current, p, next) - endUtimes(me, dirProps, current, p, next) - }) - - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- todo === 0) return cb() - } -} - -Writer.prototype.pipe = function () { - this.error("Can't pipe from writable stream") -} - -Writer.prototype.add = function () { - this.error("Cannot add to non-Directory type") -} - -Writer.prototype.write = function () { - return true -} - -function objectToString (d) { - return Object.prototype.toString.call(d) -} - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json deleted file mode 100644 index 1b4a21c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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": "2.0.1", - "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* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2.0.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index afc83b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,228 +0,0 @@ -var fs = require('fs') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - 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') - - 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.end() - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json deleted file mode 100644 index 3bad3de..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "fstream", - "description": "Advanced file system stream things", - "version": "0.1.24", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/fstream.git" - }, - "main": "fstream.js", - "engines": { - "node": ">=0.6" - }, - "dependencies": { - "rimraf": "2", - "mkdirp": "0.3", - "graceful-fs": "~2.0.0", - "inherits": "~2.0.0" - }, - "devDependencies": { - "tap": "" - }, - "scripts": { - "test": "tap examples/*.js" - }, - "license": "BSD", - "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/fstream/issues" - }, - "_id": "fstream@0.1.24", - "_from": "fstream@~0.1.8" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md deleted file mode 100644 index b1c5665..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json deleted file mode 100644 index cee4a9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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" - }, - "_id": "inherits@2.0.1", - "_from": "inherits@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js deleted file mode 100644 index fc53012..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json deleted file mode 100644 index 4c9e2cd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "tar", - "description": "tar for node", - "version": "0.1.18", - "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## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-tar/issues" - }, - "_id": "tar@0.1.18", - "_from": "tar@~0.1.18" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js deleted file mode 100644 index a81298b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js +++ /dev/null @@ -1,173 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js deleted file mode 100644 index 1524ff7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js +++ /dev/null @@ -1,53 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js deleted file mode 100644 index fff4818..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js +++ /dev/null @@ -1,358 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz deleted file mode 100644 index 4501bcf..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js deleted file mode 100644 index 8ea6f79..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js +++ /dev/null @@ -1,183 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js deleted file mode 100644 index 5bf0e54..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js +++ /dev/null @@ -1,854 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js deleted file mode 100644 index 0f50994..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js +++ /dev/null @@ -1,897 +0,0 @@ - -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js deleted file mode 100644 index f765a50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js +++ /dev/null @@ -1,359 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js deleted file mode 100644 index a00ff7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js +++ /dev/null @@ -1,20 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore deleted file mode 100644 index 0593600..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.\#* -/node_modules -\#* -npm-debug.log -node_modules -*.tgz diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml deleted file mode 100644 index ec43125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.11" - - "0.10" - - "0.8" - - "0.6" \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE deleted file mode 100644 index 0146c4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 Bruce Williams - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md deleted file mode 100644 index d7fb9c3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md +++ /dev/null @@ -1,277 +0,0 @@ -node-temp -========= - -Temporary files, directories, and streams for Node.js. - -Handles generating a unique file/directory name under the appropriate -system temporary directory, changing the file to an appropriate mode, -and supports automatic removal (if asked) - -`temp` has a similar API to the `fs` module. - -Node.js Compatibility ---------------------- - -Supports v0.6.0+. - -[![Build Status](https://travis-ci.org/bruce/node-temp.png)](https://travis-ci.org/bruce/node-temp) - -Please let me know if you have problems running it on a later version of Node.js or -have platform-specific problems. - -Installation ------------- - -Install it using [npm](http://github.com/isaacs/npm): - - $ npm install temp - -Or get it directly from: -http://github.com/bruce/node-temp - -Synopsis --------- - -You can create temporary files with `open` and `openSync`, temporary -directories with `mkdir` and `mkdirSync`, or you can get a unique name -in the system temporary directory with `path`. - -Working copies of the following examples can be found under the -`examples` directory. - -### Temporary Files - -To create a temporary file use `open` or `openSync`, passing -them an optional prefix, suffix, or both (see below for details on -affixes). The object passed to the callback (or returned) has -`path` and `fd` keys: - -```javascript -{ path: "/path/to/file", -, fd: theFileDescriptor -} -``` - -In this example we write to a temporary file and call out to `grep` and -`wc -l` to determine the number of time `foo` occurs in the text. The -temporary file is chmod'd `0600` and cleaned up automatically when the -process at exit (because `temp.track()` is called): - -```javascript -var temp = require('temp'), - fs = require('fs'), - util = require('util'), - exec = require('child_process').exec; - -// Automatically track and cleanup files at exit -temp.track(); - -// Fake data -var myData = "foo\nbar\nfoo\nbaz"; - -// Process the data (note: error handling omitted) -temp.open('myprefix', function(err, info) { - fs.write(info.fd, myData); - fs.close(info.fd, function(err) { - exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) { - util.puts(stdout.trim()); - }); - }); -}); -``` - -### Want Cleanup? Make sure you ask for it. - -As noted in the example above, if you want temp to track the files and directories -it creates and handle removing those files and directories on exit, you must call `track()`. -It's recommended that you do this immediately after requiring the module. - -```javascript -var temp = require("temp"); -temp.track(); -``` - -Why is this necessary? In pre-0.6 versions of temp, tracking was automatic. While this works -great for scripts and [Grunt tasks](http://gruntjs.com/), it's not so great for long-running -server processes. Since that's arguably what Node.js is _for_, you have to opt-in to tracking. - -But it's easy. - -#### Cleanup anytime - -When tracking, you can `cleanup()` anytime. An object will be returned with cleanup statistics -and the file/directory lists will be reset. - -```javascript -> temp.cleanup(); -{ files: { removed: 1, missing: 0 }, - dirs: { removed: 0, missing: 0 } } -``` - -Note: If you're not tracking, `false` will be returned. - -### Temporary Directories - -To create a temporary directory, use `mkdir` or `mkdirSync`, passing -it an optional prefix, suffix, or both (see below for details on affixes). - -In this example we create a temporary directory, write to a file -within it, call out to an external program to create a PDF, and read -the result. While the external process creates a lot of additional -files, the temporary directory is removed automatically at exit (because -`temp.track()` is called): - -```javascript -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - path = require('path'), - exec = require('child_process').exec; - -// Automatically track and cleanup files at exit -temp.track(); - -// For use with ConTeXt, http://wiki.contextgarden.net -var myData = "\\starttext\nHello World\n\\stoptext"; - -temp.mkdir('pdfcreator', function(err, dirPath) { - var inputPath = path.join(dirPath, 'input.tex') - fs.writeFile(inputPath, myData, function(err) { - if (err) throw err; - process.chdir(dirPath); - exec("texexec '" + inputPath + "'", function(err) { - if (err) throw err; - fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) { - if (err) throw err; - sys.print(data); - }); - }); - }); -}); -``` - -### Temporary Streams - -To create a temporary WriteStream, use 'createWriteStream', which sits -on top of `fs.createWriteStream`. The return value is a -`fs.WriteStream` whose `path` is registered for removal when -`temp.cleanup` is called (because `temp.track()` is called). - -```javascript -var temp = require('temp'); - -// Automatically track and cleanup files at exit -temp.track(); - -var stream = temp.createWriteStream(); -stream.write("Some data"); -// Maybe do some other things -stream.end(); -``` - -### Affixes - -You can provide custom prefixes and suffixes when creating temporary -files and directories. If you provide a string, it is used as the prefix -for the temporary name. If you provide an object with `prefix`, -`suffix` and `dir` keys, they are used for the temporary name. - -Here are some examples: - -* `"aprefix"`: A simple prefix, prepended to the filename; this is - shorthand for: -* `{prefix: "aprefix"}`: A simple prefix, prepended to the filename -* `{suffix: ".asuffix"}`: A suffix, appended to the filename - (especially useful when the file needs to be named with specific - extension for use with an external program). -* `{prefix: "myprefix", suffix: "mysuffix"}`: Customize both affixes -* `{dir: path.join(os.tmpDir()), "myapp"}`: default prefix and suffix - within a new temporary directory. -* `null`: Use the defaults for files and directories (prefixes `"f-"` - and `"d-"`, respectively, no suffixes). - -In this simple example we read a `pdf`, write it to a temporary file with -a `.pdf` extension, and close it. - -```javascript -var fs = require('fs'), - temp = require('temp'); - -fs.readFile('/path/to/source.pdf', function(err, data) { - temp.open({suffix: '.pdf'}, function(err, info) { - if (err) throw err; - fs.write(info.fd, contents); - fs.close(info.fd, function(err) { - if (err) throw err; - // Do something with the file - }); - }); -}); -``` - -### Just a path, please - -If you just want a unique name in your temporary directory, use -`path`: - -```javascript -var fs = require('fs'); -var tempName = temp.path({suffix: '.pdf'}); -// Do something with tempName -``` - -Note: The file isn't created for you, and the mode is not changed -- and it -will not be removed automatically at exit. If you use `path`, it's -all up to you. - -Using it with Grunt -------------------- - -If you want to use the module with [Grunt](http://gruntjs.com/), make sure you -use `async()` in your Gruntfile: - -```javascript -module.exports = function (grunt) { - var temp = require("temp"); - temp.track(); // Cleanup files, please - grunt.registerTast("temptest", "Testing temp", function() { - - var done = this.async(); // Don't forget this! - - grunt.log.writeln("About to write a file..."); - temp.open('tempfile', function(err, info) { - // File writing shenanigans here - grunt.log.writeln("Wrote a file!") - - done(); // REALLY don't forget this! - - }); - }); -}; -``` - -For more information, see the [Grunt FAQ](http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete). - -Testing -------- - -For now, run `test/temp-test.js`: - - $ node test/temp-test.js - -Contributing ------------- - -You can find the repository at: -http://github.com/bruce/node-temp - -Issues/Feature Requests can be submitted at: -http://github.com/bruce/node-temp/issues - -I'd really like to hear your feedback, and I'd love to receive your -pull-requests! - -Copyright ---------- - -Copyright (c) 2010-2012 Bruce Williams. See LICENSE for details. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js deleted file mode 100644 index 420d864..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js +++ /dev/null @@ -1,18 +0,0 @@ -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - exec = require('child_process').exec; - -var myData = "foo\nbar\nfoo\nbaz"; - -temp.open('myprefix', function(err, info) { - if (err) throw err; - fs.write(info.fd, myData); - fs.close(info.fd, function(err) { - if (err) throw err; - exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) { - if (err) throw err; - util.puts(stdout.trim()); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js deleted file mode 100644 index 63fd277..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js +++ /dev/null @@ -1,22 +0,0 @@ -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - path = require('path'), - exec = require('child_process').exec; - -var myData = "\\starttext\nHello World\n\\stoptext"; - -temp.mkdir('pdfcreator', function(err, dirPath) { - var inputPath = path.join(dirPath, 'input.tex') - fs.writeFile(inputPath, myData, function(err) { - if (err) throw err; - process.chdir(dirPath); - exec("texexec '" + inputPath + "'", function(err) { - if (err) throw err; - fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) { - if (err) throw err; - util.print(data); - }); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js deleted file mode 100644 index 41edf98..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js +++ /dev/null @@ -1,182 +0,0 @@ -var fs = require('fs'), - os = require('osenv'), - path = require('path'), - cnst = require('constants'); - -/* HELPERS */ - -var RDWR_EXCL = cnst.O_CREAT | cnst.O_TRUNC | cnst.O_RDWR | cnst.O_EXCL; - -var environmentVariables = ['TMPDIR', 'TMP', 'TEMP']; - -var generateName = function(rawAffixes, defaultPrefix) { - var affixes = parseAffixes(rawAffixes, defaultPrefix); - var now = new Date(); - var name = [affixes.prefix, - now.getYear(), now.getMonth(), now.getDate(), - '-', - process.pid, - '-', - (Math.random() * 0x100000000 + 1).toString(36), - affixes.suffix].join(''); - return path.join(affixes.dir || exports.dir, name); -} - -var parseAffixes = function(rawAffixes, defaultPrefix) { - var affixes = {prefix: null, suffix: null}; - if(rawAffixes) { - switch (typeof(rawAffixes)) { - case 'string': - affixes.prefix = rawAffixes; - break; - case 'object': - affixes = rawAffixes; - break - default: - throw("Unknown affix declaration: " + affixes); - } - } else { - affixes.prefix = defaultPrefix; - } - return affixes; -} - -/* ------------------------------------------------------------------------- - * Don't forget to call track() if you want file tracking and exit handlers! - * ------------------------------------------------------------------------- - * When any temp file or directory is created, it is added to filesToDelete - * or dirsToDelete. The first time any temp file is created, a listener is - * added to remove all temp files and directories at exit. - */ -var tracking = false; -var track = function(value) { - tracking = (value != false) -}; -var exitListenerAttached = false; -var filesToDelete = []; -var dirsToDelete = []; - -var deleteFileOnExit = function(filePath) { - if (!tracking) return false; - attachExitListener(); - filesToDelete.push(filePath); -}; - -var deleteDirOnExit = function(dirPath) { - if (!tracking) return false; - attachExitListener(); - dirsToDelete.push(dirPath); -}; - -var attachExitListener = function() { - if (!tracking) return false; - if (!exitListenerAttached) { - process.addListener('exit', cleanup); - exitListenerAttached = true; - } -}; - -var cleanupFiles = function() { - if (!tracking) return false; - var counts = {removed: 0, missing: 0} - var toDelete; - while (toDelete = filesToDelete.shift()) { - try { - fs.unlinkSync(toDelete); - counts.removed++; - } catch (rmErr) { - /* removed normally */ - counts.missing++; - } - } - return counts; -}; - -var cleanupDirs = function() { - if (!tracking) return false; - var rimrafSync = require('rimraf').sync; - var counts = {removed: 0, missing: 0} - var toDelete; - while (toDelete = dirsToDelete.shift()) { - try { - rimrafSync(toDelete, function (er) { - if (er) { - throw er; - } else { - counts.removed++; - } - }); - } catch (rmErr) { - /* removed normally */ - counts.missing++; - } - } - return counts; -}; - -var cleanup = function() { - if (!tracking) return false; - fileCount = cleanupFiles(); - dirCount = cleanupDirs(); - return {files: fileCount, dirs: dirCount}; -} - -/* DIRECTORIES */ - -var mkdir = function(affixes, callback) { - var dirPath = generateName(affixes, 'd-'); - fs.mkdir(dirPath, 0700, function(err) { - if (!err) { - deleteDirOnExit(dirPath); - } - if (callback) - callback(err, dirPath); - }); -} -var mkdirSync = function(affixes) { - var dirPath = generateName(affixes, 'd-'); - fs.mkdirSync(dirPath, 0700); - deleteDirOnExit(dirPath); - return dirPath; -} - -/* FILES */ - -var open = function(affixes, callback) { - var filePath = generateName(affixes, 'f-') - fs.open(filePath, RDWR_EXCL, 0600, function(err, fd) { - if (!err) - deleteFileOnExit(filePath); - if (callback) - callback(err, {path: filePath, fd: fd}); - }); -} - -var openSync = function(affixes) { - var filePath = generateName(affixes, 'f-') - var fd = fs.openSync(filePath, RDWR_EXCL, 0600); - deleteFileOnExit(filePath); - return {path: filePath, fd: fd}; -} - -var createWriteStream = function(affixes) { - var filePath = generateName(affixes, 's-') - var stream = fs.createWriteStream(filePath, {flags: RDWR_EXCL, mode: 0600}); - deleteFileOnExit(filePath); - return stream; -} - -/* EXPORTS */ -// Settings -exports.dir = path.resolve(os.tmpdir()); -exports.track = track; -// Functions -exports.mkdir = mkdir; -exports.mkdirSync = mkdirSync; -exports.open = open; -exports.openSync = openSync; -exports.path = generateName; -exports.cleanup = cleanup; -exports.createWriteStream = createWriteStream; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md deleted file mode 100644 index 08fd900..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# osenv - -Look up environment settings specific to different operating systems. - -## Usage - -```javascript -var osenv = require('osenv') -var path = osenv.path() -var user = osenv.user() -// etc. - -// Some things are not reliably in the env, and have a fallback command: -var h = osenv.hostname(function (er, hostname) { - h = hostname -}) -// This will still cause it to be memoized, so calling osenv.hostname() -// is now an immediate operation. - -// You can always send a cb, which will get called in the nextTick -// if it's been memoized, or wait for the fallback data if it wasn't -// found in the environment. -osenv.hostname(function (er, hostname) { - if (er) console.error('error looking up hostname') - else console.log('this machine calls itself %s', hostname) -}) -``` - -## osenv.hostname() - -The machine name. Calls `hostname` if not found. - -## osenv.user() - -The currently logged-in user. Calls `whoami` if not found. - -## osenv.prompt() - -Either PS1 on unix, or PROMPT on Windows. - -## osenv.tmpdir() - -The place where temporary files should be created. - -## osenv.home() - -No place like it. - -## osenv.path() - -An array of the places that the operating system will search for -executables. - -## osenv.editor() - -Return the executable name of the editor program. This uses the EDITOR -and VISUAL environment variables, and falls back to `vi` on Unix, or -`notepad.exe` on Windows. - -## osenv.shell() - -The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash' -or 'cmd'. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js deleted file mode 100644 index e3367a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js +++ /dev/null @@ -1,80 +0,0 @@ -var isWindows = process.platform === 'win32' -var windir = isWindows ? process.env.windir || 'C:\\Windows' : null -var path = require('path') -var exec = require('child_process').exec - -// looking up envs is a bit costly. -// Also, sometimes we want to have a fallback -// Pass in a callback to wait for the fallback on failures -// After the first lookup, always returns the same thing. -function memo (key, lookup, fallback) { - var fell = false - var falling = false - exports[key] = function (cb) { - var val = lookup() - if (!val && !fell && !falling && fallback) { - fell = true - falling = true - exec(fallback, function (er, output, stderr) { - falling = false - if (er) return // oh well, we tried - val = output.trim() - }) - } - exports[key] = function (cb) { - if (cb) process.nextTick(cb.bind(null, null, val)) - return val - } - if (cb && !falling) process.nextTick(cb.bind(null, null, val)) - return val - } -} - -memo('user', function () { - return ( isWindows - ? process.env.USERDOMAIN + '\\' + process.env.USERNAME - : process.env.USER - ) -}, 'whoami') - -memo('prompt', function () { - return isWindows ? process.env.PROMPT : process.env.PS1 -}) - -memo('hostname', function () { - return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME -}, 'hostname') - -memo('tmpdir', function () { - var t = isWindows ? 'temp' : 'tmp' - return process.env.TMPDIR || - process.env.TMP || - process.env.TEMP || - ( exports.home() ? path.resolve(exports.home(), t) - : isWindows ? path.resolve(windir, t) - : '/tmp' - ) -}) - -memo('home', function () { - return ( isWindows ? process.env.USERPROFILE - : process.env.HOME - ) -}) - -memo('path', function () { - return (process.env.PATH || - process.env.Path || - process.env.path).split(isWindows ? ';' : ':') -}) - -memo('editor', function () { - return process.env.EDITOR || - process.env.VISUAL || - (isWindows ? 'notepad.exe' : 'vi') -}) - -memo('shell', function () { - return isWindows ? process.env.ComSpec || 'cmd' - : process.env.SHELL || 'bash' -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json deleted file mode 100644 index 721c45f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "osenv", - "version": "0.0.3", - "main": "osenv.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.2.5" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/osenv" - }, - "keywords": [ - "environment", - "variable", - "home", - "tmpdir", - "path", - "prompt", - "ps1" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "description": "Look up environment settings specific to different operating systems", - "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/osenv/issues" - }, - "_id": "osenv@0.0.3", - "_from": "osenv@0.0.3" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js deleted file mode 100644 index b72eb0b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js +++ /dev/null @@ -1,76 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform === 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip unix tests, this is not unix\n') - return -} -var tap = require('tap') - -// like unix, but funny -process.env.USER = 'sirUser' -process.env.HOME = '/home/sirUser' -process.env.HOSTNAME = 'my-machine' -process.env.TMPDIR = '/tmpdir' -process.env.TMP = '/tmp' -process.env.TEMP = '/temp' -process.env.PATH = '/opt/local/bin:/usr/local/bin:/usr/bin/:bin' -process.env.PS1 = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.SHELL = 'zsh' - - -tap.test('basic unix sanity test', function (t) { - var osenv = require('../osenv.js') - - t.equal(osenv.user(), process.env.USER) - t.equal(osenv.home(), process.env.HOME) - t.equal(osenv.hostname(), process.env.HOSTNAME) - t.same(osenv.path(), process.env.PATH.split(':')) - t.equal(osenv.prompt(), process.env.PS1) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), '/home/sirUser/tmp') - - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), '/tmp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'vi') - - t.equal(osenv.shell(), 'zsh') - process.env.SHELL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'bash') - - t.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js deleted file mode 100644 index dd3fe80..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js +++ /dev/null @@ -1,82 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform !== 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip windows tests, this is not windows\n') - return -} - -// load this before clubbing the platform name. -var tap = require('tap') - -process.env.windir = 'C:\\windows' -process.env.USERDOMAIN = 'some-domain' -process.env.USERNAME = 'sirUser' -process.env.USERPROFILE = 'C:\\Users\\sirUser' -process.env.COMPUTERNAME = 'my-machine' -process.env.TMPDIR = 'C:\\tmpdir' -process.env.TMP = 'C:\\tmp' -process.env.TEMP = 'C:\\temp' -process.env.Path = 'C:\\Program Files\\;C:\\Binary Stuff\\bin' -process.env.PROMPT = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.ComSpec = 'some-com' - -tap.test('basic windows sanity test', function (t) { - var osenv = require('../osenv.js') - - var osenv = require('../osenv.js') - - t.equal(osenv.user(), - process.env.USERDOMAIN + '\\' + process.env.USERNAME) - t.equal(osenv.home(), process.env.USERPROFILE) - t.equal(osenv.hostname(), process.env.COMPUTERNAME) - t.same(osenv.path(), process.env.Path.split(';')) - t.equal(osenv.prompt(), process.env.PROMPT) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), 'C:\\Users\\sirUser\\temp') - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), 'C:\\windows\\temp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'notepad.exe') - - t.equal(osenv.shell(), 'some-com') - process.env.ComSpec = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'cmd') - - t.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index ca91152..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,442 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index bfc503c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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" - }, - "_id": "graceful-fs@1.2.3", - "_from": "graceful-fs@~1" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d532..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js deleted file mode 100644 index 8d0882d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js +++ /dev/null @@ -1,158 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json deleted file mode 100644 index f5072d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "rimraf", - "version": "2.1.4", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~1" - }, - "_id": "rimraf@2.1.4", - "_from": "rimraf@~2.1.4" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js deleted file mode 100644 index ed915f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,132 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -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 (er.code === "EBUSY" && 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 && er.code === "ENOENT") - return cb() - if (er && (er.code === "EPERM" || er.code === "EISDIR")) - return rmdir(p, er, cb) - return cb(er) - }) -} - -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")) - 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" && er.code !== "EISDIR") - throw er - try { - fs.rmdirSync(p) - } catch (er2) { - if (er2.code === "ENOENT") - return - if (er2.code === "ENOTDIR") - throw er - if (er2.code === "ENOTEMPTY") { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) - } - } - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json deleted file mode 100644 index 7c98f7e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "temp", - "description": "Temporary files and directories", - "tags": [ - "temporary", - "temp", - "tempfile", - "tempdir", - "tmpfile", - "tmpdir", - "security" - ], - "version": "0.6.0", - "author": { - "name": "Bruce Williams", - "email": "bruce@codefluency.com" - }, - "directories": { - "lib": "lib" - }, - "engines": [ - "node >=0.6.0" - ], - "main": "./lib/temp", - "dependencies": { - "rimraf": "~2.1.4", - "osenv": "0.0.3" - }, - "devDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/bruce/node-temp.git" - }, - "scripts": { - "test": "node test/temp-test.js" - }, - "readme": "node-temp\n=========\n\nTemporary files, directories, and streams for Node.js.\n\nHandles generating a unique file/directory name under the appropriate\nsystem temporary directory, changing the file to an appropriate mode,\nand supports automatic removal (if asked)\n\n`temp` has a similar API to the `fs` module.\n\nNode.js Compatibility\n---------------------\n\nSupports v0.6.0+.\n\n[![Build Status](https://travis-ci.org/bruce/node-temp.png)](https://travis-ci.org/bruce/node-temp)\n\nPlease let me know if you have problems running it on a later version of Node.js or\nhave platform-specific problems.\n\nInstallation\n------------\n\nInstall it using [npm](http://github.com/isaacs/npm):\n\n $ npm install temp\n\nOr get it directly from:\nhttp://github.com/bruce/node-temp\n\nSynopsis\n--------\n\nYou can create temporary files with `open` and `openSync`, temporary\ndirectories with `mkdir` and `mkdirSync`, or you can get a unique name\nin the system temporary directory with `path`.\n\nWorking copies of the following examples can be found under the\n`examples` directory.\n\n### Temporary Files\n\nTo create a temporary file use `open` or `openSync`, passing\nthem an optional prefix, suffix, or both (see below for details on\naffixes). The object passed to the callback (or returned) has\n`path` and `fd` keys:\n\n```javascript\n{ path: \"/path/to/file\",\n, fd: theFileDescriptor\n}\n```\n\nIn this example we write to a temporary file and call out to `grep` and\n`wc -l` to determine the number of time `foo` occurs in the text. The\ntemporary file is chmod'd `0600` and cleaned up automatically when the\nprocess at exit (because `temp.track()` is called):\n\n```javascript\nvar temp = require('temp'),\n fs = require('fs'),\n util = require('util'),\n exec = require('child_process').exec;\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\n// Fake data\nvar myData = \"foo\\nbar\\nfoo\\nbaz\";\n\n// Process the data (note: error handling omitted)\ntemp.open('myprefix', function(err, info) {\n fs.write(info.fd, myData);\n fs.close(info.fd, function(err) {\n exec(\"grep foo '\" + info.path + \"' | wc -l\", function(err, stdout) {\n util.puts(stdout.trim());\n });\n });\n});\n```\n\n### Want Cleanup? Make sure you ask for it.\n\nAs noted in the example above, if you want temp to track the files and directories\nit creates and handle removing those files and directories on exit, you must call `track()`.\nIt's recommended that you do this immediately after requiring the module.\n\n```javascript\nvar temp = require(\"temp\");\ntemp.track();\n```\n\nWhy is this necessary? In pre-0.6 versions of temp, tracking was automatic. While this works\ngreat for scripts and [Grunt tasks](http://gruntjs.com/), it's not so great for long-running\nserver processes. Since that's arguably what Node.js is _for_, you have to opt-in to tracking.\n\nBut it's easy.\n\n#### Cleanup anytime\n\nWhen tracking, you can `cleanup()` anytime. An object will be returned with cleanup statistics\nand the file/directory lists will be reset.\n\n```javascript\n> temp.cleanup();\n{ files: { removed: 1, missing: 0 },\n dirs: { removed: 0, missing: 0 } }\n```\n\nNote: If you're not tracking, `false` will be returned.\n\n### Temporary Directories\n\nTo create a temporary directory, use `mkdir` or `mkdirSync`, passing\nit an optional prefix, suffix, or both (see below for details on affixes).\n\nIn this example we create a temporary directory, write to a file\nwithin it, call out to an external program to create a PDF, and read\nthe result. While the external process creates a lot of additional\nfiles, the temporary directory is removed automatically at exit (because\n`temp.track()` is called):\n\n```javascript\nvar temp = require('../lib/temp'),\n fs = require('fs'),\n util = require('util'),\n path = require('path'),\n exec = require('child_process').exec;\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\n// For use with ConTeXt, http://wiki.contextgarden.net\nvar myData = \"\\\\starttext\\nHello World\\n\\\\stoptext\";\n\ntemp.mkdir('pdfcreator', function(err, dirPath) {\n var inputPath = path.join(dirPath, 'input.tex')\n fs.writeFile(inputPath, myData, function(err) {\n if (err) throw err;\n process.chdir(dirPath);\n exec(\"texexec '\" + inputPath + \"'\", function(err) {\n if (err) throw err;\n fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) {\n if (err) throw err;\n sys.print(data);\n });\n });\n });\n});\n```\n\n### Temporary Streams\n\nTo create a temporary WriteStream, use 'createWriteStream', which sits\non top of `fs.createWriteStream`. The return value is a\n`fs.WriteStream` whose `path` is registered for removal when\n`temp.cleanup` is called (because `temp.track()` is called).\n\n```javascript\nvar temp = require('temp');\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\nvar stream = temp.createWriteStream();\nstream.write(\"Some data\");\n// Maybe do some other things\nstream.end();\n```\n\n### Affixes\n\nYou can provide custom prefixes and suffixes when creating temporary\nfiles and directories. If you provide a string, it is used as the prefix\nfor the temporary name. If you provide an object with `prefix`,\n`suffix` and `dir` keys, they are used for the temporary name.\n\nHere are some examples:\n\n* `\"aprefix\"`: A simple prefix, prepended to the filename; this is\n shorthand for:\n* `{prefix: \"aprefix\"}`: A simple prefix, prepended to the filename\n* `{suffix: \".asuffix\"}`: A suffix, appended to the filename\n (especially useful when the file needs to be named with specific\n extension for use with an external program).\n* `{prefix: \"myprefix\", suffix: \"mysuffix\"}`: Customize both affixes\n* `{dir: path.join(os.tmpDir()), \"myapp\"}`: default prefix and suffix\n within a new temporary directory.\n* `null`: Use the defaults for files and directories (prefixes `\"f-\"`\n and `\"d-\"`, respectively, no suffixes).\n\nIn this simple example we read a `pdf`, write it to a temporary file with\na `.pdf` extension, and close it.\n\n```javascript\nvar fs = require('fs'),\n temp = require('temp');\n\nfs.readFile('/path/to/source.pdf', function(err, data) {\n temp.open({suffix: '.pdf'}, function(err, info) {\n if (err) throw err;\n fs.write(info.fd, contents);\n fs.close(info.fd, function(err) {\n if (err) throw err;\n // Do something with the file\n });\n });\n});\n```\n\n### Just a path, please\n\nIf you just want a unique name in your temporary directory, use\n`path`:\n\n```javascript\nvar fs = require('fs');\nvar tempName = temp.path({suffix: '.pdf'});\n// Do something with tempName\n```\n\nNote: The file isn't created for you, and the mode is not changed -- and it\nwill not be removed automatically at exit. If you use `path`, it's\nall up to you.\n\nUsing it with Grunt\n-------------------\n\nIf you want to use the module with [Grunt](http://gruntjs.com/), make sure you\nuse `async()` in your Gruntfile:\n\n```javascript\nmodule.exports = function (grunt) {\n var temp = require(\"temp\");\n temp.track(); // Cleanup files, please\n grunt.registerTast(\"temptest\", \"Testing temp\", function() {\n\n var done = this.async(); // Don't forget this!\n\n grunt.log.writeln(\"About to write a file...\");\n temp.open('tempfile', function(err, info) {\n // File writing shenanigans here\n grunt.log.writeln(\"Wrote a file!\")\n\n done(); // REALLY don't forget this!\n\n });\n });\n};\n```\n\nFor more information, see the [Grunt FAQ](http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete).\n\nTesting\n-------\n\nFor now, run `test/temp-test.js`:\n\n $ node test/temp-test.js\n\nContributing\n------------\n\nYou can find the repository at:\nhttp://github.com/bruce/node-temp\n\nIssues/Feature Requests can be submitted at:\nhttp://github.com/bruce/node-temp/issues\n\nI'd really like to hear your feedback, and I'd love to receive your\npull-requests!\n\nCopyright\n---------\n\nCopyright (c) 2010-2012 Bruce Williams. See LICENSE for details.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/bruce/node-temp/issues" - }, - "_id": "temp@0.6.0", - "dist": { - "shasum": "29d2d63697c79fb5108af11e1cba8edf097877bd" - }, - "_from": "temp@~0.6.0", - "_resolved": "https://registry.npmjs.org/temp/-/temp-0.6.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js deleted file mode 100644 index 34071fa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js +++ /dev/null @@ -1,77 +0,0 @@ -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); -var util = require('util'); - -var temp = require('../lib/temp'); -temp.track(); - -var existsSync = function(path){ - try { - fs.statSync(path); - return true; - } catch (e){ - return false; - } -}; - -// Use path.exists for 0.6 if necessary -var safeExists = fs.exists || path.exists; - -var mkdirFired = false; -var mkdirPath = null; -temp.mkdir('foo', function(err, tpath) { - mkdirFired = true; - assert.ok(!err, "temp.mkdir did not execute without errors"); - assert.ok(path.basename(tpath).slice(0, 3) == 'foo', 'temp.mkdir did not use the prefix'); - assert.ok(existsSync(tpath), 'temp.mkdir did not create the directory'); - - fs.writeFileSync(path.join(tpath, 'a file'), 'a content'); - temp.cleanup(); - assert.ok(!existsSync(tpath), 'temp.cleanup did not remove the directory'); - - mkdirPath = tpath; -}); - -var openFired = false; -var openPath = null; -temp.open('bar', function(err, info) { - openFired = true; - assert.equal('object', typeof(info), "temp.open did not invoke the callback with the err and info object"); - assert.equal('number', typeof(info.fd), 'temp.open did not invoke the callback with an fd'); - fs.writeSync(info.fd, 'foo'); - fs.closeSync(info.fd); - assert.equal('string', typeof(info.path), 'temp.open did not invoke the callback with a path'); - assert.ok(existsSync(info.path), 'temp.open did not create a file'); - - temp.cleanup(); - assert.ok(!existsSync(info.path), 'temp.cleanup did not remove the file'); - - openPath = info.path; -}); - - -var stream = temp.createWriteStream('baz'); -assert.ok(stream instanceof fs.WriteStream, "temp.createWriteStream did not invoke the callback with the err and stream object"); -stream.write('foo'); -stream.end("More text here\nand more..."); -assert.ok(existsSync(stream.path), 'temp.createWriteStream did not create a file'); - -console.log(temp.cleanup()); -assert.ok(!existsSync(stream.path), 'temp.cleanup did not remove the createWriteStream file'); - -var tempPath = temp.path(); -assert.ok(path.dirname(tempPath) === temp.dir, "temp.path does not work in default os temporary directory"); - -tempPath = temp.path({dir: process.cwd()}); -assert.ok(path.dirname(tempPath) === process.cwd(), "temp.path does not work in user-provided temporary directory"); - -for (var i=0; i <= 10; i++) { - temp.openSync(); -}; -assert.equal(process.listeners('exit').length, 1, 'temp created more than one listener for exit'); - -process.addListener('exit', function() { - assert.ok(mkdirFired, "temp.mkdir callback did not fire"); - assert.ok(openFired, "temp.open callback did not fire"); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json deleted file mode 100644 index 111c20f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "decompress", - "version": "0.1.4", - "description": "Easily extract zip, tar and tar.gz archives", - "keywords": [ - "extract", - "zip", - "tar", - "tar.gz" - ], - "homepage": "https://github.com/kevva/decompress", - "bugs": { - "url": "https://github.com/kevva/decompress/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/decompress.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "decompress.js", - "files": [ - "decompress.js" - ], - "dependencies": { - "adm-zip": "~0.4.3", - "mkdirp": "~0.3.5", - "mout": "~0.6.0", - "rimraf": "~2.2.2", - "stream-combiner": "~0.0.2", - "tar": "~0.1.18", - "temp": "~0.6.0" - }, - "devDependencies": { - "mocha": "~1.12.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# decompress [![Build Status](https://secure.travis-ci.org/kevva/decompress.png?branch=master)](http://travis-ci.org/kevva/decompress)\n\nEasily extract `.zip`, `.tar` and `.tar.gz` archives. Based on the extract \nutility in [Bower](https://github.com/bower/bower).\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/decompress): `npm install decompress`\n\n## Examples\n\nYou'll only need to pass a type into `ext` and it'll figure the rest out for \nyou.\n\n```js\nvar decompress = require('decompress');\nvar fs = require('fs');\n\nvar src = fs.createReadStream('foo.tar.gz');\nvar dest = decompress.extract({ ext: '.tar.gz' });\n\nsrc.pipe(dest);\n```\n\n## API\n\n### .extract(opts)\n\nExtract an archive using the `ext` option to determine which extractor to use. \nIf no `path` is specified it'll extract it to your current location.\n\n### .canExtract(src, mime)\n\nDetermine if a file can be extracted or not by checking the file extension \nand/or the MIME type.\n\n```js\ndecompress.canExtract('foo.zip');\n// => true\n\ndecompress.canExtract('application/zip');\n// => true\n```\n\n## Options\n\n* `ext` — String that can be a file name, URL, MIME type etc.\n* `path` — Path to extract the archive to. If no `path` is defined it'll \nextract it to your current location.\n* `strip` — Equivalent to `--strip-components` for tar.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "decompress@0.1.4", - "dist": { - "shasum": "b5608768911f794017bfb8017344be6a7cfaf919" - }, - "_from": "decompress@~0.1.0", - "_resolved": "https://registry.npmjs.org/decompress/-/decompress-0.1.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 84fd7ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json deleted file mode 100644 index 169f15a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.5", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.4.0" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "_id": "mkdirp@0.3.5", - "_from": "mkdirp@~0.3.5" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 83b0216..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 35bd5cb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md deleted file mode 100644 index 1d2f79b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md +++ /dev/null @@ -1,344 +0,0 @@ -# Request -- Simplified HTTP request method - -## Install - -
    -  npm install request
    -
    - -Or from source: - -
    -  git clone git://github.com/mikeal/request.git 
    -  cd request
    -  npm link
    -
    - -## Super simple to use - -Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. - -```javascript -var request = require('request'); -request('http://www.google.com', function (error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body) // Print the google web page. - } -}) -``` - -## Streaming - -You can stream any response to a file stream. - -```javascript -request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png')) -``` - -You 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. - -```javascript -fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json')) -``` - -Request can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers. - -```javascript -request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) -``` - -Now let's get fancy. - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - if (req.method === 'PUT') { - req.pipe(request.put('http://mysite.com/doodle.png')) - } else if (req.method === 'GET' || req.method === 'HEAD') { - request.get('http://mysite.com/doodle.png').pipe(resp) - } - } -}) -``` - -You 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: - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - var x = request('http://mysite.com/doodle.png') - req.pipe(x) - x.pipe(resp) - } -}) -``` - -And since pipe() returns the destination stream in node 0.5.x you can do one line proxying :) - -```javascript -req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) -``` - -Also, none of this new functionality conflicts with requests previous features, it just expands them. - -```javascript -var r = request.defaults({'proxy':'http://localproxy.com'}) - -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - r.get('http://google.com/doodle.png').pipe(resp) - } -}) -``` -You can still use intermediate proxies, the requests will still follow HTTP forwards, etc. - -## Forms - -`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API. - -Url encoded forms are simple - -```javascript -request.post('http://service.com/upload', {form:{key:'value'}}) -// or -request.post('http://service.com/upload').form({key:'value'}) -``` - -For `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. - -```javascript -var r = request.post('http://service.com/upload') -var form = r.form() -form.append('my_field', 'my_value') -form.append('my_buffer', new Buffer([1, 2, 3])) -form.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png')) -form.append('remote_file', request('http://google.com/doodle.png')) -``` - -## HTTP Authentication - -```javascript -request.get('http://some.server.com/').auth('username', 'password', false); -// or -request.get('http://some.server.com/', { - 'auth': { - 'user': 'username', - 'pass': 'password', - 'sendImmediately': false - } -}); -``` - -If 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)`. - -`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). - -Digest 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). - -## OAuth Signing - -```javascript -// Twitter OAuth -var qs = require('querystring') - , oauth = - { callback: 'http://mysite.com/callback/' - , consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - } - , url = 'https://api.twitter.com/oauth/request_token' - ; -request.post({url:url, oauth:oauth}, function (e, r, body) { - // Ideally, you would take the body in the response - // and construct a URL that a user clicks on (like a sign in button). - // The verifier is only available in the response after a user has - // verified with twitter that they are authorizing your app. - var access_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: access_token.oauth_token - , verifier: access_token.oauth_verifier - } - , url = 'https://api.twitter.com/oauth/access_token' - ; - request.post({url:url, oauth:oauth}, function (e, r, body) { - var perm_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: perm_token.oauth_token - , token_secret: perm_token.oauth_token_secret - } - , url = 'https://api.twitter.com/1/users/show.json?' - , params = - { screen_name: perm_token.screen_name - , user_id: perm_token.user_id - } - ; - url += qs.stringify(params) - request.get({url:url, oauth:oauth, json:true}, function (e, r, user) { - console.log(user) - }) - }) -}) -``` - - - -### request(options, callback) - -The first argument can be either a url or an options object. The only required option is uri, all others are optional. - -* `uri` || `url` - fully qualified uri or a parsed url object from url.parse() -* `qs` - object containing querystring values to be appended to the uri -* `method` - http method, defaults to GET -* `headers` - http headers, defaults to {} -* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string. -* `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. -* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above. -* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json. -* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below. -* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true. -* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false. -* `maxRedirects` - the maximum number of redirects to follow, defaults to 10. -* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer. -* `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. -* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool. -* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request -* `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. -* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above. -* `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). -* `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. -* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section) -* `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) -* `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. -* `localAddress` - Local interface to bind for network connections. - - -The 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. - -## Convenience methods - -There are also shorthand methods for different HTTP METHODs and some other conveniences. - -### request.defaults(options) - -This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it. - -### request.put - -Same as request() but defaults to `method: "PUT"`. - -```javascript -request.put(url) -``` - -### request.patch - -Same as request() but defaults to `method: "PATCH"`. - -```javascript -request.patch(url) -``` - -### request.post - -Same as request() but defaults to `method: "POST"`. - -```javascript -request.post(url) -``` - -### request.head - -Same as request() but defaults to `method: "HEAD"`. - -```javascript -request.head(url) -``` - -### request.del - -Same as request() but defaults to `method: "DELETE"`. - -```javascript -request.del(url) -``` - -### request.get - -Alias to normal request method for uniformity. - -```javascript -request.get(url) -``` -### request.cookie - -Function that creates a new cookie. - -```javascript -request.cookie('cookie_string_here') -``` -### request.jar - -Function that creates a new cookie jar. - -```javascript -request.jar() -``` - - -## Examples: - -```javascript - var request = require('request') - , rand = Math.floor(Math.random()*100000000).toString() - ; - request( - { method: 'PUT' - , uri: 'http://mikeal.iriscouch.com/testjs/' + rand - , multipart: - [ { 'content-type': 'application/json' - , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) - } - , { body: 'I am an attachment' } - ] - } - , function (error, response, body) { - if(response.statusCode == 201){ - console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand) - } else { - console.log('error: '+ response.statusCode) - console.log(body) - } - } - ) -``` -Cookies 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). - -```javascript -var request = request.defaults({jar: true}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` - -If 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: - -```javascript -var j = request.jar() -var request = request.defaults({jar:j}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` -OR - -```javascript -var j = request.jar() -var cookie = request.cookie('your_cookie_here') -j.add(cookie) -request({url: 'http://www.google.com', jar: j}, function () { - request('http://images.google.com') -}) -``` diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js deleted file mode 100755 index d56f9ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js +++ /dev/null @@ -1,1392 +0,0 @@ -// Copyright 2010-2012 Mikeal Rogers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -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 - ; - -try { - https = require('https') -} catch (e) {} - -try { - tls = require('tls') -} catch (e) {} - -var debug -if (/\brequest\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - console.error('REQUEST %s', util.format.apply(util, arguments)) - } -} else { - debug = function() {} -} - -function toBase64 (str) { - return (new Buffer(str || "", "ascii")).toString("base64") -} - -function md5 (str) { - return crypto.createHash('md5').update(str).digest('hex') -} - -// 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 copy (obj) { - var o = {} - Object.keys(obj).forEach(function (i) { - o[i] = obj[i] - }) - return o -} - -var isUrl = /^https?:/ - -var globalPool = {} - -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.host || !self.uri.pathname) { - // 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.headers.host || self.headers.Host)) { - self.headers.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.headers.host += (':'+self.uri.port) - } - self.setHost = true - } - - self.jar(self._jar || options.jar) - - if (!self.uri.pathname) {self.uri.pathname = '/'} - 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.headers.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.headers['proxy-authorization'] && !self.tunnel) { - self.headers['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.headers['content-length'] && !self.headers['Content-Length']) - self.headers['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.headers['content-type'] && !self.headers['Content-Type']) - self.headers['content-type'] = mime.lookup(src.path) - } else { - if (src.headers) { - for (var i in src.headers) { - if (!self.headers[i]) { - self.headers[i] = src.headers[i] - } - } - } - if (self._json && !self.headers['content-type'] && !self.headers['Content-Type']) - self.headers['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.headers['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.headers['content-length'] && !self.headers['Content-Length']) { - self.headers['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) delete self.headers.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 (response.headers['set-cookie'] && (!self._disableCookies)) { - if (Array.isArray(response.headers['set-cookie'])) response.headers['set-cookie'].forEach(addCookie) - else addCookie(response.headers['set-cookie']) - } - - var redirectTo = null - if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) { - debug('redirect', response.headers.location) - - if (self.followAllRedirects) { - redirectTo = response.headers.location - } else if (self.followRedirect) { - switch (self.method) { - case 'PATCH': - case 'PUT': - case 'POST': - case 'DELETE': - // Do not follow redirects - break - default: - redirectTo = response.headers.location - break - } - } - } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) { - var authHeader = response.headers['www-authenticate'] - 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) { - delete self.headers.host - delete self.headers['content-type'] - delete self.headers['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.headers['content-type'] = response.headers['content-type'] - if (response.headers['content-length']) { - dest.headers['content-length'] = response.headers['content-length'] - } - } - 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.headers.hasOwnProperty(name)) this.headers[name] = value - else this.headers[name] += ',' + value - return this -} -Request.prototype.setHeaders = function (headers) { - for (var i in headers) {this.setHeader(i, headers[i])} - return this -} -Request.prototype.qs = function (q, clobber) { - var base - if (!clobber && this.uri.query) base = qs.parse(this.uri.query) - else base = {} - - for (var i in q) { - base[i] = q[i] - } - - if (qs.stringify(base) === ''){ - return this - } - - this.uri = url.parse(this.uri.href.split('?')[0] + '?' + qs.stringify(base)) - this.url = this.uri - this.path = this.uri.path - - return this -} -Request.prototype.form = function (form) { - if (form) { - this.headers['content-type'] = 'application/x-www-form-urlencoded; charset=utf-8' - this.body = qs.stringify(form).toString('utf8') - return this - } - // create form-data object - this._form = new FormData() - return this._form -} -Request.prototype.multipart = function (multipart) { - var self = this - self.body = [] - - if (!self.headers['content-type']) { - self.headers['content-type'] = 'multipart/related; boundary=' + self.boundary - } else { - self.headers['content-type'] = self.headers['content-type'].split(';')[0] + '; boundary=' + self.boundary - } - - if (!multipart.forEach) throw new Error('Argument error, options.multipart.') - - if (self.preambleCRLF) { - self.body.push(new Buffer('\r\n')) - } - - multipart.forEach(function (part) { - var body = part.body - if(body == null) throw Error('Body attribute missing in multipart.') - delete part.body - var preamble = '--' + self.boundary + '\r\n' - Object.keys(part).forEach(function (key) { - preamble += key + ': ' + part[key] + '\r\n' - }) - preamble += '\r\n' - self.body.push(new Buffer(preamble)) - self.body.push(new Buffer(body)) - self.body.push(new Buffer('\r\n')) - }) - self.body.push(new Buffer('--' + self.boundary + '--')) - return self -} -Request.prototype.json = function (val) { - var self = this; - var setAcceptHeader = function() { - if (!self.headers['accept'] && !self.headers['Accept']) { - self.setHeader('accept', 'application/json') - } - } - setAcceptHeader(); - this._json = true - if (typeof val === 'boolean') { - if (typeof this.body === 'object') { - setAcceptHeader(); - this.body = safeStringify(this.body) - self.setHeader('content-type', 'application/json') - } - } else { - setAcceptHeader(); - this.body = safeStringify(val) - self.setHeader('content-type', 'application/json') - } - return this -} -function getHeader(name, headers) { - var result, re, match - Object.keys(headers).forEach(function (key) { - re = new RegExp(name, 'i') - match = key.match(re) - if (match) result = headers[key] - }) - return result -} -Request.prototype.auth = function (user, pass, sendImmediately) { - if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { - throw new Error('auth() received invalid user or password') - } - this._user = user - this._pass = pass - this._hasAuth = true - if (sendImmediately || typeof sendImmediately == 'undefined') { - this.setHeader('authorization', 'Basic ' + toBase64(user + ':' + pass)) - this._sentAuth = true - } - return this -} -Request.prototype.aws = function (opts, now) { - if (!now) { - this._aws = opts - return this - } - var date = new Date() - this.setHeader('date', date.toUTCString()) - var auth = - { key: opts.key - , secret: opts.secret - , verb: this.method.toUpperCase() - , date: date - , contentType: getHeader('content-type', this.headers) || '' - , md5: getHeader('content-md5', this.headers) || '' - , amazonHeaders: aws.canonicalizeHeaders(this.headers) - } - if (opts.bucket && this.path) { - auth.resource = '/' + opts.bucket + this.path - } else if (opts.bucket && !this.path) { - auth.resource = '/' + opts.bucket - } else if (!opts.bucket && this.path) { - auth.resource = this.path - } else if (!opts.bucket && !this.path) { - auth.resource = '/' - } - auth.resource = aws.canonicalizeResource(auth.resource) - this.setHeader('authorization', aws.authorization(auth)) - - return this -} -Request.prototype.httpSignature = function (opts) { - var req = this - httpSignature.signRequest({ - getHeader: function(header) { - return getHeader(header, req.headers) - }, - setHeader: function(header, value) { - req.setHeader(header, value) - }, - method: this.method, - path: this.path - }, opts) - debug('httpSignature authorization', getHeader('authorization', this.headers)) - - return this -} - -Request.prototype.hawk = function (opts) { - this.headers.Authorization = hawk.client.header(this.uri, this.method, opts).field -} - -Request.prototype.oauth = function (_oauth) { - var form - if (this.headers['content-type'] && - this.headers['content-type'].slice(0, 'application/x-www-form-urlencoded'.length) === - 'application/x-www-form-urlencoded' - ) { - form = qs.parse(this.body) - } - if (this.uri.query) { - form = qs.parse(this.uri.query) - } - if (!form) form = {} - var oa = {} - for (var i in form) oa[i] = form[i] - for (var i in _oauth) oa['oauth_'+i] = _oauth[i] - if (!oa.oauth_version) oa.oauth_version = '1.0' - if (!oa.oauth_timestamp) oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString() - if (!oa.oauth_nonce) oa.oauth_nonce = uuid().replace(/-/g, '') - - oa.oauth_signature_method = 'HMAC-SHA1' - - var consumer_secret = oa.oauth_consumer_secret - delete oa.oauth_consumer_secret - var token_secret = oa.oauth_token_secret - delete oa.oauth_token_secret - var timestamp = oa.oauth_timestamp - - var baseurl = this.uri.protocol + '//' + this.uri.host + this.uri.pathname - var signature = oauth.hmacsign(this.method, baseurl, oa, consumer_secret, token_secret) - - // oa.oauth_signature = signature - for (var i in form) { - if ( i.slice(0, 'oauth_') in _oauth) { - // skip - } else { - delete oa['oauth_'+i] - if (i !== 'x_auth_mode') delete oa[i] - } - } - oa.oauth_timestamp = timestamp - this.headers.Authorization = - 'OAuth '+Object.keys(oa).sort().map(function (i) {return i+'="'+oauth.rfc3986(oa[i])+'"'}).join(',') - this.headers.Authorization += ',oauth_signature="' + oauth.rfc3986(signature) + '"' - return this -} -Request.prototype.jar = function (jar) { - var cookies - - if (this._redirectsFollowed === 0) { - this.originalCookieHeader = this.headers.cookie - } - - if (!jar) { - // disable cookies - cookies = false - this._disableCookies = true - } else if (jar && jar.get) { - // fetch cookie from the user defined cookie jar - cookies = jar.get({ url: this.uri.href }) - } else { - // fetch cookie from the global cookie jar - cookies = cookieJar.get({ url: this.uri.href }) - } - - if (cookies && cookies.length) { - var cookieString = cookies.map(function (c) { - return c.name + "=" + c.value - }).join("; ") - - if (this.originalCookieHeader) { - // Don't overwrite existing Cookie header - this.headers.cookie = this.originalCookieHeader + '; ' + cookieString - } else { - this.headers.cookie = cookieString - } - } - this._jar = jar - return this -} - - -// Stream API -Request.prototype.pipe = function (dest, opts) { - if (this.response) { - if (this._destdata) { - throw new Error("You cannot pipe after data has been emitted from the response.") - } else if (this._ended) { - throw new Error("You cannot pipe after the response has been ended.") - } else { - stream.Stream.prototype.pipe.call(this, dest, opts) - this.pipeDest(dest) - return dest - } - } else { - this.dests.push(dest) - stream.Stream.prototype.pipe.call(this, dest, opts) - return dest - } -} -Request.prototype.write = function () { - if (!this._started) this.start() - return this.req.write.apply(this.req, arguments) -} -Request.prototype.end = function (chunk) { - if (chunk) this.write(chunk) - if (!this._started) this.start() - this.req.end() -} -Request.prototype.pause = function () { - if (!this.response) this._paused = true - else this.response.pause.apply(this.response, arguments) -} -Request.prototype.resume = function () { - if (!this.response) this._paused = false - else this.response.resume.apply(this.response, arguments) -} -Request.prototype.destroy = function () { - if (!this._ended) this.end() - else if (this.response) this.response.destroy() -} - -// organize params for patch, post, put, head, del -function initParams(uri, options, callback) { - if ((typeof options === 'function') && !callback) callback = options - if (options && typeof options === 'object') { - options.uri = uri - } else if (typeof uri === 'string') { - options = {uri:uri} - } else { - options = uri - uri = options.uri - } - return { uri: uri, options: options, callback: callback } -} - -function request (uri, options, callback) { - if (typeof uri === 'undefined') throw new Error('undefined is not a valid uri or options object.') - if ((typeof options === 'function') && !callback) callback = options - if (options && typeof options === 'object') { - options.uri = uri - } else if (typeof uri === 'string') { - options = {uri:uri} - } else { - options = uri - } - - options = copy(options) - - if (callback) options.callback = callback - var r = new Request(options) - return r -} - -module.exports = request - -request.Request = Request; - -request.debug = process.env.NODE_DEBUG && /request/.test(process.env.NODE_DEBUG) - -request.initParams = initParams - -request.defaults = function (options, requester) { - var def = function (method) { - var d = function (uri, opts, callback) { - var params = initParams(uri, opts, callback) - for (var i in options) { - if (params.options[i] === undefined) params.options[i] = options[i] - } - if(typeof requester === 'function') { - if(method === request) { - method = requester - } else { - params.options._requester = requester - } - } - return method(params.options, params.callback) - } - return d - } - var de = def(request) - de.get = def(request.get) - de.patch = def(request.patch) - de.post = def(request.post) - de.put = def(request.put) - de.head = def(request.head) - de.del = def(request.del) - de.cookie = def(request.cookie) - de.jar = request.jar - return de -} - -request.forever = function (agentOptions, optionsArg) { - var options = {} - if (optionsArg) { - for (option in optionsArg) { - options[option] = optionsArg[option] - } - } - if (agentOptions) options.agentOptions = agentOptions - options.forever = true - return request.defaults(options) -} - -request.get = request -request.post = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'POST' - return request(params.uri || null, params.options, params.callback) -} -request.put = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'PUT' - return request(params.uri || null, params.options, params.callback) -} -request.patch = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'PATCH' - return request(params.uri || null, params.options, params.callback) -} -request.head = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'HEAD' - if (params.options.body || - params.options.requestBodyStream || - (params.options.json && typeof params.options.json !== 'boolean') || - params.options.multipart) { - throw new Error("HTTP HEAD requests MUST NOT include a request body.") - } - return request(params.uri || null, params.options, params.callback) -} -request.del = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'DELETE' - if(typeof params.options._requester === 'function') { - request = params.options._requester - } - return request(params.uri || null, params.options, params.callback) -} -request.jar = function () { - return new CookieJar -} -request.cookie = function (str) { - if (str && str.uri) str = str.uri - if (typeof str !== 'string') throw new Error("The cookie function only accepts STRING as param") - return new Cookie(str) -} - -// Safe toJSON - -function getSafe (self, uuid) { - if (typeof self === 'object' || typeof self === 'function') var safe = {} - if (Array.isArray(self)) var safe = [] - - var recurse = [] - - Object.defineProperty(self, uuid, {}) - - var attrs = Object.keys(self).filter(function (i) { - if (i === uuid) return false - if ( (typeof self[i] !== 'object' && typeof self[i] !== 'function') || self[i] === null) return true - return !(Object.getOwnPropertyDescriptor(self[i], uuid)) - }) - - - for (var i=0;i - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var crypto = require('crypto') - , parse = require('url').parse - ; - -/** - * Valid keys. - */ - -var keys = - [ 'acl' - , 'location' - , 'logging' - , 'notification' - , 'partNumber' - , 'policy' - , 'requestPayment' - , 'torrent' - , 'uploadId' - , 'uploads' - , 'versionId' - , 'versioning' - , 'versions' - , 'website' - ] - -/** - * Return an "Authorization" header value with the given `options` - * in the form of "AWS :" - * - * @param {Object} options - * @return {String} - * @api private - */ - -function authorization (options) { - return 'AWS ' + options.key + ':' + sign(options) -} - -module.exports = authorization -module.exports.authorization = authorization - -/** - * Simple HMAC-SHA1 Wrapper - * - * @param {Object} options - * @return {String} - * @api private - */ - -function hmacSha1 (options) { - return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') -} - -module.exports.hmacSha1 = hmacSha1 - -/** - * Create a base64 sha1 HMAC for `options`. - * - * @param {Object} options - * @return {String} - * @api private - */ - -function sign (options) { - options.message = stringToSign(options) - return hmacSha1(options) -} -module.exports.sign = sign - -/** - * Create a base64 sha1 HMAC for `options`. - * - * Specifically to be used with S3 presigned URLs - * - * @param {Object} options - * @return {String} - * @api private - */ - -function signQuery (options) { - options.message = queryStringToSign(options) - return hmacSha1(options) -} -module.exports.signQuery= signQuery - -/** - * Return a string for sign() with the given `options`. - * - * Spec: - * - * \n - * \n - * \n - * \n - * [headers\n] - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function stringToSign (options) { - var headers = options.amazonHeaders || '' - if (headers) headers += '\n' - var r = - [ options.verb - , options.md5 - , options.contentType - , options.date.toUTCString() - , headers + options.resource - ] - return r.join('\n') -} -module.exports.queryStringToSign = stringToSign - -/** - * Return a string for sign() with the given `options`, but is meant exclusively - * for S3 presigned URLs - * - * Spec: - * - * \n - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function queryStringToSign (options){ - return 'GET\n\n\n' + options.date + '\n' + options.resource -} -module.exports.queryStringToSign = queryStringToSign - -/** - * Perform the following: - * - * - ignore non-amazon headers - * - lowercase fields - * - sort lexicographically - * - trim whitespace between ":" - * - join with newline - * - * @param {Object} headers - * @return {String} - * @api private - */ - -function canonicalizeHeaders (headers) { - var buf = [] - , fields = Object.keys(headers) - ; - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i] - , val = headers[field] - , field = field.toLowerCase() - ; - if (0 !== field.indexOf('x-amz')) continue - buf.push(field + ':' + val) - } - return buf.sort().join('\n') -} -module.exports.canonicalizeHeaders = canonicalizeHeaders - -/** - * Perform the following: - * - * - ignore non sub-resources - * - sort lexicographically - * - * @param {String} resource - * @return {String} - * @api private - */ - -function canonicalizeResource (resource) { - var url = parse(resource, true) - , path = url.pathname - , buf = [] - ; - - Object.keys(url.query).forEach(function(key){ - if (!~keys.indexOf(key)) return - var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) - buf.push(key + val) - }) - - return path + (buf.length ? '?' + buf.sort().join('&') : '') -} -module.exports.canonicalizeResource = canonicalizeResource diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json deleted file mode 100644 index e2c48ab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "aws-sign", - "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/aws-sign" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/aws-sign/issues" - }, - "_id": "aws-sign@0.3.0", - "_from": "aws-sign@~0.3.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md deleted file mode 100644 index bcd8f8d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md +++ /dev/null @@ -1,4 +0,0 @@ -cookie-jar -========== - -Cookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js deleted file mode 100644 index 7d54d94..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js +++ /dev/null @@ -1,67 +0,0 @@ -/*! - * Tobi - Cookie - * Copyright(c) 2010 LearnBoost - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var url = require('url'); - -/** - * Initialize a new `Cookie` with the given cookie `str` and `req`. - * - * @param {String} str - * @param {IncomingRequest} req - * @api private - */ - -var Cookie = exports = module.exports = function Cookie(str, req) { - this.str = str; - - // Map the key/val pairs - str.split(/ *; */).reduce(function(obj, pair){ - var p = pair.indexOf('='); - var key = p > 0 ? pair.substring(0, p).trim() : pair.trim(); - var lowerCasedKey = key.toLowerCase(); - var value = p > 0 ? pair.substring(p + 1).trim() : true; - - if (!obj.name) { - // First key is the name - obj.name = key; - obj.value = value; - } - else if (lowerCasedKey === 'httponly') { - obj.httpOnly = value; - } - else { - obj[lowerCasedKey] = value; - } - return obj; - }, this); - - // Expires - this.expires = this.expires - ? new Date(this.expires) - : Infinity; - - // Default or trim path - this.path = this.path - ? this.path.trim(): req - ? url.parse(req.url).pathname: '/'; -}; - -/** - * Return the original cookie string. - * - * @return {String} - * @api public - */ - -Cookie.prototype.toString = function(){ - return this.str; -}; - -module.exports.Jar = require('./jar') \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js deleted file mode 100644 index 34920e0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! -* Tobi - CookieJar -* Copyright(c) 2010 LearnBoost -* MIT Licensed -*/ - -/** -* Module dependencies. -*/ - -var url = require('url'); - -/** -* Initialize a new `CookieJar`. -* -* @api private -*/ - -var CookieJar = exports = module.exports = function CookieJar() { - this.cookies = []; -}; - -/** -* Add the given `cookie` to the jar. -* -* @param {Cookie} cookie -* @api private -*/ - -CookieJar.prototype.add = function(cookie){ - this.cookies = this.cookies.filter(function(c){ - // Avoid duplication (same path, same name) - return !(c.name == cookie.name && c.path == cookie.path); - }); - this.cookies.push(cookie); -}; - -/** -* Get cookies for the given `req`. -* -* @param {IncomingRequest} req -* @return {Array} -* @api private -*/ - -CookieJar.prototype.get = function(req){ - var path = url.parse(req.url).pathname - , now = new Date - , specificity = {}; - return this.cookies.filter(function(cookie){ - if (0 == path.indexOf(cookie.path) && now < cookie.expires - && cookie.path.length > (specificity[cookie.name] || 0)) - return specificity[cookie.name] = cookie.path.length; - }); -}; - -/** -* Return Cookie string for the given `req`. -* -* @param {IncomingRequest} req -* @return {String} -* @api private -*/ - -CookieJar.prototype.cookieString = function(req){ - var cookies = this.get(req); - if (cookies.length) { - return cookies.map(function(cookie){ - return cookie.name + '=' + cookie.value; - }).join('; '); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json deleted file mode 100644 index b42df9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "cookie-jar", - "description": "Cookie Jar. Originally pulled form tobi, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/cookie-jar" - }, - "main": "index.js", - "scripts": { - "test": "node tests/run.js" - }, - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "cookie-jar\n==========\n\nCookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/cookie-jar/issues" - }, - "_id": "cookie-jar@0.3.0", - "_from": "cookie-jar@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js deleted file mode 100644 index 2cdc835..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js +++ /dev/null @@ -1,29 +0,0 @@ -var Cookie = require('../index') - , assert = require('assert'); - -var str = 'Sid="s543qactge.wKE61E01Bs%2BKhzmxrwrnug="; Path=/; httpOnly; Expires=Sat, 04 Dec 2010 23:27:28 GMT'; -var cookie = new Cookie(str); - -// test .toString() -assert.equal(cookie.toString(), str); - -// test .path -assert.equal(cookie.path, '/'); - -// test .httpOnly -assert.equal(cookie.httpOnly, true); - -// test .name -assert.equal(cookie.name, 'Sid'); - -// test .value -assert.equal(cookie.value, '"s543qactge.wKE61E01Bs%2BKhzmxrwrnug="'); - -// test .expires -assert.equal(cookie.expires instanceof Date, true); - -// test .path default -var cookie = new Cookie('foo=bar', { url: 'http://foo.com/bar' }); -assert.equal(cookie.path, '/bar'); - -console.log('All tests passed'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js deleted file mode 100644 index a33cfb2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js +++ /dev/null @@ -1,90 +0,0 @@ -var Cookie = require('../index') - , Jar = Cookie.Jar - , assert = require('assert'); - -function expires(ms) { - return new Date(Date.now() + ms).toUTCString(); -} - -// test .get() expiration -(function() { - var jar = new Jar; - var cookie = new Cookie('sid=1234; path=/; expires=' + expires(1000)); - jar.add(cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 0); - }, 1000); - }, 5); -})(); - -// test .get() path support -(function() { - var jar = new Jar; - var a = new Cookie('sid=1234; path=/'); - var b = new Cookie('sid=1111; path=/foo/bar'); - var c = new Cookie('sid=2222; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - - // should remove the duplicates - assert.equal(jar.cookies.length, 2); - - // same name, same path, latter prevails - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], c); - - // same name, diff path, path specifity prevails, latter prevails - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], a); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=3333; path=/foo/bar'); - var c = new Cookie('pid=3333; path=/foo/bar'); - var d = new Cookie('sid=2222; path=/foo/'); - var e = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - jar.add(d); - jar.add(e); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 2); - assert.equal(cookies[0], b); - assert.equal(cookies[1], c); - - var cookies = jar.get({ url: 'http://foo.com/foo/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], d); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], e); -})(); - -setTimeout(function() { - console.log('All tests passed'); -}, 1200); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md deleted file mode 100644 index 9d5b663..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -forever-agent -============= - -HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js deleted file mode 100644 index 5c07928..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js +++ /dev/null @@ -1,119 +0,0 @@ -module.exports = ForeverAgent -ForeverAgent.SSL = ForeverAgentSSL - -var util = require('util') - , Agent = require('http').Agent - , net = require('net') - , tls = require('tls') - , AgentSSL = require('https').Agent - -function ForeverAgent(options) { - var self = this - self.options = options || {} - self.requests = {} - self.sockets = {} - self.freeSockets = {} - self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets - self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets - self.on('free', function(socket, host, port) { - var name = host + ':' + port - if (self.requests[name] && self.requests[name].length) { - self.requests[name].shift().onSocket(socket) - } else if (self.sockets[name].length < self.minSockets) { - if (!self.freeSockets[name]) self.freeSockets[name] = [] - self.freeSockets[name].push(socket) - - // if an error happens while we don't use the socket anyway, meh, throw the socket away - function onIdleError() { - socket.destroy() - } - socket._onIdleError = onIdleError - socket.on('error', onIdleError) - } else { - // If there are no pending requests just destroy the - // socket and it will get removed from the pool. This - // gets us out of timeout issues and allows us to - // default to Connection:keep-alive. - socket.destroy() - } - }) - -} -util.inherits(ForeverAgent, Agent) - -ForeverAgent.defaultMinSockets = 5 - - -ForeverAgent.prototype.createConnection = net.createConnection -ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest -ForeverAgent.prototype.addRequest = function(req, host, port) { - var name = host + ':' + port - if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { - var idleSocket = this.freeSockets[name].pop() - idleSocket.removeListener('error', idleSocket._onIdleError) - delete idleSocket._onIdleError - req._reusedSocket = true - req.onSocket(idleSocket) - } else { - this.addRequestNoreuse(req, host, port) - } -} - -ForeverAgent.prototype.removeSocket = function(s, name, host, port) { - if (this.sockets[name]) { - var index = this.sockets[name].indexOf(s) - if (index !== -1) { - this.sockets[name].splice(index, 1) - } - } else if (this.sockets[name] && this.sockets[name].length === 0) { - // don't leak - delete this.sockets[name] - delete this.requests[name] - } - - if (this.freeSockets[name]) { - var index = this.freeSockets[name].indexOf(s) - if (index !== -1) { - this.freeSockets[name].splice(index, 1) - if (this.freeSockets[name].length === 0) { - delete this.freeSockets[name] - } - } - } - - if (this.requests[name] && this.requests[name].length) { - // 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(name, host, port).emit('free') - } -} - -function ForeverAgentSSL (options) { - ForeverAgent.call(this, options) -} -util.inherits(ForeverAgentSSL, ForeverAgent) - -ForeverAgentSSL.prototype.createConnection = createConnectionSSL -ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest - -function createConnectionSSL (port, host, options) { - if (typeof port === 'object') { - options = port; - } else if (typeof host === 'object') { - options = host; - } else if (typeof options === 'object') { - options = options; - } else { - options = {}; - } - - if (typeof port === 'number') { - options.port = port; - } - - if (typeof host === 'string') { - options.host = host; - } - - return tls.connect(options); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json deleted file mode 100644 index 42d35ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "forever-agent", - "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", - "version": "0.5.0", - "repository": { - "url": "https://github.com/mikeal/forever-agent" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/forever-agent/issues" - }, - "_id": "forever-agent@0.5.0", - "_from": "forever-agent@~0.5.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License deleted file mode 100644 index c7ff12a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md deleted file mode 100644 index dc73c46..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md +++ /dev/null @@ -1,163 +0,0 @@ -# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data) - -A module to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. - -The API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. - -[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface -[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions - -## Install - -``` -npm install form-data -``` - -## Usage - -In this example we are constructing a form with 3 fields that contain a string, -a buffer and a file stream. - -``` javascript -var FormData = require('form-data'); -var fs = require('fs'); - -var form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); -``` - -Also you can use http-response stream: - -``` javascript -var FormData = require('form-data'); -var http = require('http'); - -var form = new FormData(); - -http.request('http://nodejs.org/images/logo.png', function(response) { - form.append('my_field', 'my value'); - form.append('my_buffer', new Buffer(10)); - form.append('my_logo', response); -}); -``` - -Or @mikeal's request stream: - -``` javascript -var FormData = require('form-data'); -var request = require('request'); - -var form = new FormData(); - -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_logo', request('http://nodejs.org/images/logo.png')); -``` - -In order to submit this form to a web application, call ```submit(url, [callback])``` method: - -``` javascript -form.submit('http://example.org/', function(err, res) { - // res – response object (http.IncomingMessage) // - res.resume(); // for node-0.10.x -}); - -``` - -For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. - -### Alternative submission methods - -You can use node's http client interface: - -``` javascript -var http = require('http'); - -var request = http.request({ - method: 'post', - host: 'example.org', - path: '/upload', - headers: form.getHeaders() -}); - -form.pipe(request); - -request.on('response', function(res) { - console.log(res.statusCode); -}); -``` - -Or if you would prefer the `'Content-Length'` header to be set for you: - -``` javascript -form.submit('example.org/upload', function(err, res) { - console.log(res.statusCode); -}); -``` - -To use custom headers and pre-known length in parts: - -``` javascript -var CRLF = '\r\n'; -var form = new FormData(); - -var options = { - header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, - knownLength: 1 -}; - -form.append('my_buffer', buffer, options); - -form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); -}); -``` - -Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: - -``` javascript -someModule.stream(function(err, stdout, stderr) { - if (err) throw err; - - var form = new FormData(); - - form.append('file', stdout, { - filename: 'unicycle.jpg', - contentType: 'image/jpg', - knownLength: 19806 - }); - - form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); - }); -}); -``` - -For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: - -``` javascript -form.submit({ - host: 'example.com', - path: '/probably.php?extra=params', - auth: 'username:password' -}, function(err, res) { - console.log(res.statusCode); -}); -``` - -## Notes - -- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. -- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing] - -## TODO - -- Add new streams (0.10) support and try really hard not to break it for 0.8.x. - -## License - -Form-Data is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js deleted file mode 100644 index d106474..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js +++ /dev/null @@ -1,325 +0,0 @@ -var CombinedStream = require('combined-stream'); -var util = require('util'); -var path = require('path'); -var http = require('http'); -var https = require('https'); -var parseUrl = require('url').parse; -var fs = require('fs'); -var mime = require('mime'); -var async = require('async'); - -module.exports = FormData; -function FormData() { - this._overheadLength = 0; - this._valueLength = 0; - this._lengthRetrievers = []; - - CombinedStream.call(this); -} -util.inherits(FormData, CombinedStream); - -FormData.LINE_BREAK = '\r\n'; - -FormData.prototype.append = function(field, value, options) { - options = options || {}; - - var append = CombinedStream.prototype.append.bind(this); - - // all that streamy business can't handle numbers - if (typeof value == 'number') value = ''+value; - - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; - } - - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(field, value, options); - - append(header); - append(value); - append(footer); - - // pass along options.knownLength - this._trackLength(header, value, options); -}; - -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } - - this._valueLength += valueLength; - - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - + FormData.LINE_BREAK.length; - - // empty or either doesn't have path or not an http response - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { - return; - } - - // no need to bother with the length - if (!options.knownLength) - this._lengthRetrievers.push(function(next) { - - if (value.hasOwnProperty('fd')) { - fs.stat(value.path, function(err, stat) { - if (err) { - next(err); - return; - } - - next(null, stat.size); - }); - - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - next(null, +value.headers['content-length']); - - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - next(null, +response.headers['content-length']); - }); - value.resume(); - - // something else - } else { - next('Unknown stream'); - } - }); -}; - -FormData.prototype._multiPartHeader = function(field, value, options) { - var boundary = this.getBoundary(); - var header = ''; - - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (options.header != null) { - header = options.header; - } else { - header += '--' + boundary + FormData.LINE_BREAK + - 'Content-Disposition: form-data; name="' + field + '"'; - - // fs- and request- streams have path property - // or use custom filename and/or contentType - // TODO: Use request's response mime-type - if (options.filename || value.path) { - header += - '; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path)); - - // http response has not - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - header += - '; filename="' + path.basename(value.client._httpMessage.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + value.headers['content-type']; - } - - header += FormData.LINE_BREAK + FormData.LINE_BREAK; - } - - return header; -}; - -FormData.prototype._multiPartFooter = function(field, value, options) { - return function(next) { - var footer = FormData.LINE_BREAK; - - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--'; -}; - -FormData.prototype.getHeaders = function(userHeaders) { - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; - - for (var header in userHeaders) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - - return formHeaders; -} - -FormData.prototype.getCustomHeaders = function(contentType) { - contentType = contentType ? contentType : 'multipart/form-data'; - - var formHeaders = { - 'content-type': contentType + '; boundary=' + this.getBoundary(), - 'content-length': this.getLengthSync() - }; - - return formHeaders; -} - -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - - return this._boundary; -}; - -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } - - this._boundary = boundary; -}; - -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function(debug) { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - // https://github.com/felixge/node-form-data/issues/40 - if (this._lengthRetrievers.length) { - // Some async length retrivers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } - - return knownLength; -}; - -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - if (!this._lengthRetrievers.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - - async.parallel(this._lengthRetrievers, function(err, values) { - if (err) { - cb(err); - return; - } - - values.forEach(function(length) { - knownLength += length; - }); - - cb(null, knownLength); - }); -}; - -FormData.prototype.submit = function(params, cb) { - - var request - , options - , defaults = { - method : 'post', - headers: this.getHeaders() - }; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - params = parseUrl(params); - - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname - }, defaults); - } - else // use custom params - { - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; - } - } - - // https if specified, fallback to http in any other case - if (params.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } - - // get content length and fire away - this.getLength(function(err, length) { - - // TODO: Add chunked encoding when no length (if err) - - // add content length - request.setHeader('Content-Length', length); - - this.pipe(request); - if (cb) { - request.on('error', cb); - request.on('response', cb.bind(this, null)); - } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (this.error) return; - - this.error = err; - this.pause(); - this.emit('error', err); -}; - -/* - * Santa's little helpers - */ - -// populates missing values -function populate(dst, src) { - for (var prop in src) { - if (!dst[prop]) dst[prop] = src[prop]; - } - return dst; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md deleted file mode 100644 index 9ff1acf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md +++ /dev/null @@ -1,1414 +0,0 @@ -# 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) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [doWhilst](#doWhilst) -* [until](#until) -* [doUntil](#doUntil) -* [forever](#forever) -* [waterfall](#waterfall) -* [compose](#compose) -* [applyEach](#applyEach) -* [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.map(['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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json deleted file mode 100644 index bbb0115..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js deleted file mode 100755 index cb6320d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +++ /dev/null @@ -1,955 +0,0 @@ -/*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 = setImmediate; - } - 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* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\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* [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.map(['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", - "_id": "async@0.2.9", - "_from": "async@~0.2.9" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore deleted file mode 100644 index aba34f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -*.un~ -/node_modules -/test/tmp diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile deleted file mode 100644 index b4ff85a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md deleted file mode 100644 index 1a9999e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +++ /dev/null @@ -1,132 +0,0 @@ -# combined-stream - -A stream that emits multiple other streams one after another. - -## Installation - -``` bash -npm install combined-stream -``` - -## Usage - -Here is a simple example that shows how you can use combined-stream to combine -two files into one: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -While the example above works great, it will pause all source streams until -they are needed. If you don't want that to happen, you can set `pauseStreams` -to `false`: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create({pauseStreams: false}); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -However, what if you don't have all the source streams yet, or you don't want -to allocate the resources (file descriptors, memory, etc.) for them right away? -Well, in that case you can simply provide a callback that supplies the stream -by calling a `next()` function: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(function(next) { - next(fs.createReadStream('file1.txt')); -}); -combinedStream.append(function(next) { - next(fs.createReadStream('file2.txt')); -}); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -## API - -### CombinedStream.create([options]) - -Returns a new combined stream object. Available options are: - -* `maxDataSize` -* `pauseStreams` - -The effect of those options is described below. - -### combinedStream.pauseStreams = true - -Whether to apply back pressure to the underlaying streams. If set to `false`, -the underlaying streams will never be paused. If set to `true`, the -underlaying streams will be paused right after being appended, as well as when -`delayedStream.pipe()` wants to throttle. - -### combinedStream.maxDataSize = 2 * 1024 * 1024 - -The maximum amount of bytes (or characters) to buffer for all source streams. -If this value is exceeded, `combinedStream` emits an `'error'` event. - -### combinedStream.dataSize = 0 - -The amount of bytes (or characters) currently buffered by `combinedStream`. - -### combinedStream.append(stream) - -Appends the given `stream` to the combinedStream object. If `pauseStreams` is -set to `true, this stream will also be paused right away. - -`streams` can also be a function that takes one parameter called `next`. `next` -is a function that must be invoked in order to provide the `next` stream, see -example above. - -Regardless of how the `stream` is appended, combined-stream always attaches an -`'error'` listener to it, so you don't have to do that manually. - -Special case: `stream` can also be a String or Buffer. - -### combinedStream.write(data) - -You should not call this, `combinedStream` takes care of piping the appended -streams into itself for you. - -### combinedStream.resume() - -Causes `combinedStream` to start drain the streams it manages. The function is -idempotent, and also emits a `'resume'` event each time which usually goes to -the stream that is currently being drained. - -### combinedStream.pause(); - -If `combinedStream.pauseStreams` is set to `false`, this does nothing. -Otherwise a `'pause'` event is emitted, this goes to the stream that is -currently being drained, so you can use it to apply back pressure. - -### combinedStream.end(); - -Sets `combinedStream.writable` to false, emits an `'end'` event, and removes -all streams from the queue. - -### combinedStream.destroy(); - -Same as `combinedStream.end()`, except it emits a `'close'` event instead of -`'end'`. - -## License - -combined-stream is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js deleted file mode 100644 index 32849fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +++ /dev/null @@ -1,185 +0,0 @@ -var util = require('util'); -var Stream = require('stream').Stream; -var DelayedStream = require('delayed-stream'); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - stream.on('data', this._checkDataSize.bind(this)); - - stream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)) - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore deleted file mode 100644 index 2fedb26..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -*.un~ -/node_modules/* diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile deleted file mode 100644 index b4ff85a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md deleted file mode 100644 index 5cb5b35..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +++ /dev/null @@ -1,154 +0,0 @@ -# delayed-stream - -Buffers events from a stream until you are ready to handle them. - -## Installation - -``` bash -npm install delayed-stream -``` - -## Usage - -The following example shows how to write a http echo server that delays its -response by 1000 ms. - -``` javascript -var DelayedStream = require('delayed-stream'); -var http = require('http'); - -http.createServer(function(req, res) { - var delayed = DelayedStream.create(req); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 1000); -}); -``` - -If you are not using `Stream#pipe`, you can also manually release the buffered -events by calling `delayedStream.resume()`: - -``` javascript -var delayed = DelayedStream.create(req); - -setTimeout(function() { - // Emit all buffered events and resume underlaying source - delayed.resume(); -}, 1000); -``` - -## Implementation - -In order to use this meta stream properly, here are a few things you should -know about the implementation. - -### Event Buffering / Proxying - -All events of the `source` stream are hijacked by overwriting the `source.emit` -method. Until node implements a catch-all event listener, this is the only way. - -However, delayed-stream still continues to emit all events it captures on the -`source`, regardless of whether you have released the delayed stream yet or -not. - -Upon creation, delayed-stream captures all `source` events and stores them in -an internal event buffer. Once `delayedStream.release()` is called, all -buffered events are emitted on the `delayedStream`, and the event buffer is -cleared. After that, delayed-stream merely acts as a proxy for the underlaying -source. - -### Error handling - -Error events on `source` are buffered / proxied just like any other events. -However, `delayedStream.create` attaches a no-op `'error'` listener to the -`source`. This way you only have to handle errors on the `delayedStream` -object, rather than in two places. - -### Buffer limits - -delayed-stream provides a `maxDataSize` property that can be used to limit -the amount of data being buffered. In order to protect you from bad `source` -streams that don't react to `source.pause()`, this feature is enabled by -default. - -## API - -### DelayedStream.create(source, [options]) - -Returns a new `delayedStream`. Available options are: - -* `pauseStream` -* `maxDataSize` - -The description for those properties can be found below. - -### delayedStream.source - -The `source` stream managed by this object. This is useful if you are -passing your `delayedStream` around, and you still want to access properties -on the `source` object. - -### delayedStream.pauseStream = true - -Whether to pause the underlaying `source` when calling -`DelayedStream.create()`. Modifying this property afterwards has no effect. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. You can also modify this property during runtime. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. - -### delayedStream.dataSize = 0 - -The amount of data buffered so far. - -### delayedStream.readable - -An ECMA5 getter that returns the value of `source.readable`. - -### delayedStream.resume() - -If the `delayedStream` has not been released so far, `delayedStream.release()` -is called. - -In either case, `source.resume()` is called. - -### delayedStream.pause() - -Calls `source.pause()`. - -### delayedStream.pipe(dest) - -Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. - -### delayedStream.release() - -Emits and clears all events that have been buffered up so far. This does not -resume the underlaying source, use `delayedStream.resume()` instead. - -## License - -delayed-stream is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js deleted file mode 100644 index 7c10d48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +++ /dev/null @@ -1,99 +0,0 @@ -var Stream = require('stream').Stream; -var util = require('util'); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -DelayedStream.prototype.__defineGetter__('readable', function() { - return this.source.readable; -}); - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json deleted file mode 100644 index 1628b4b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "version": "0.0.5", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n var delayed = DelayedStream.create(req);\n\n setTimeout(function() {\n res.writeHead(200);\n delayed.pipe(res);\n }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n // Emit all buffered events and resume underlaying source\n delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-delayed-stream/issues" - }, - "_id": "delayed-stream@0.0.5", - "_from": "delayed-stream@0.0.5", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js deleted file mode 100644 index 4d71b8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +++ /dev/null @@ -1,6 +0,0 @@ -var common = module.exports; - -common.DelayedStream = require('..'); -common.assert = require('assert'); -common.fake = require('fake'); -common.PORT = 49252; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js deleted file mode 100644 index 9ecad5b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var DelayedStream = common.DelayedStream; -var http = require('http'); - -var UPLOAD = new Buffer(10 * 1024 * 1024); - -var server = http.createServer(function(req, res) { - var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length}); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 10); -}); -server.listen(common.PORT, function() { - var request = http.request({ - method: 'POST', - port: common.PORT, - }); - - request.write(UPLOAD); - request.end(); - - request.on('response', function(res) { - var received = 0; - res - .on('data', function(chunk) { - received += chunk.length; - }) - .on('end', function() { - assert.equal(received, UPLOAD.length); - server.close(); - }); - }); -}); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js deleted file mode 100644 index 6f417f3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +++ /dev/null @@ -1,21 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testAutoPause() { - var source = new Stream(); - - fake.expect(source, 'pause', 1); - var delayedStream = DelayedStream.create(source); - fake.verify(); -})(); - -(function testDisableAutoPause() { - var source = new Stream(); - fake.expect(source, 'pause', 0); - - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js deleted file mode 100644 index b50c397..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +++ /dev/null @@ -1,14 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(source, 'pause'); - delayedStream.pause(); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js deleted file mode 100644 index fc4047e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +++ /dev/null @@ -1,48 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // delayedStream must not emit until we resume - fake.expect(delayedStream, 'emit', 0); - - // but our original source must emit - var params = []; - source.on('foo', function(param) { - params.push(param); - }); - - source.emit('foo', 1); - source.emit('foo', 2); - - // Make sure delayedStream did not emit, and source did - assert.deepEqual(params, [1, 2]); - fake.verify(); - - // After resume, delayedStream must playback all events - fake - .stub(delayedStream, 'emit') - .times(Infinity) - .withArg(1, 'newListener'); - fake.expect(delayedStream, 'emit', ['foo', 1]); - fake.expect(delayedStream, 'emit', ['foo', 2]); - fake.expect(source, 'resume'); - - delayedStream.resume(); - fake.verify(); - - // Calling resume again will delegate to source - fake.expect(source, 'resume'); - delayedStream.resume(); - fake.verify(); - - // Emitting more events directly leads to them being emitted - fake.expect(delayedStream, 'emit', ['foo', 3]); - source.emit('foo', 3); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js deleted file mode 100644 index a9d35e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +++ /dev/null @@ -1,15 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testHandleSourceErrors() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // We deal with this by attaching a no-op listener to 'error' on the source - // when creating a new DelayedStream. This way error events on the source - // won't throw. - source.emit('error', new Error('something went wrong')); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 7638a2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,18 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testMaxDataSize() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false}); - - source.emit('data', new Buffer(1024)); - - fake - .expect(delayedStream, 'emit') - .withArg(1, 'error'); - source.emit('data', new Buffer(1)); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js deleted file mode 100644 index 7d312ab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testPipeReleases() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(delayedStream, 'resume'); - delayedStream.pipe(new Stream()); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js deleted file mode 100644 index d436163..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testProxyReadableProperty() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - source.readable = fake.value('source.readable'); - assert.strictEqual(delayedStream.readable, source.readable); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js deleted file mode 100755 index 0bb8e82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json deleted file mode 100644 index 192a544..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "combined-stream", - "description": "A stream that emits multiple other streams one after another.", - "version": "0.0.4", - "homepage": "https://github.com/felixge/node-combined-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-combined-stream.git" - }, - "main": "./lib/combined_stream", - "engines": { - "node": "*" - }, - "dependencies": { - "delayed-stream": "0.0.5" - }, - "devDependencies": { - "far": "0.0.1" - }, - "readme": "# combined-stream\n\nA stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = true\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = 2 * 1024 * 1024\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = 0\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-combined-stream/issues" - }, - "_id": "combined-stream@0.0.4", - "_from": "combined-stream@~0.0.4", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js deleted file mode 100644 index 8154348..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js +++ /dev/null @@ -1,23 +0,0 @@ -var common = module.exports; - -var path = require('path'); -var fs = require('fs'); -var root = path.join(__dirname, '..'); - -common.dir = { - fixture: root + '/test/fixture', - tmp: root + '/test/tmp', -}; - -// Create tmp directory if it does not exist -// Not using fs.exists so as to be node 0.6.x compatible -try { - fs.statSync(common.dir.tmp); -} -catch (e) { - // Dir does not exist - fs.mkdirSync(common.dir.tmp); -} - -common.CombinedStream = require(root); -common.assert = require('assert'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt deleted file mode 100644 index 50e0218..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt +++ /dev/null @@ -1,256 +0,0 @@ -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt deleted file mode 100644 index da1d821..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt +++ /dev/null @@ -1,256 +0,0 @@ -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js deleted file mode 100644 index 44ecaba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js +++ /dev/null @@ -1,27 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE1)); - }); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE2)); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js deleted file mode 100644 index e3fbd18..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js +++ /dev/null @@ -1,34 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; - -(function testDataSizeGetter() { - var combinedStream = CombinedStream.create(); - - assert.strictEqual(combinedStream.dataSize, 0); - - // Test one stream - combinedStream._streams.push({dataSize: 10}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 10); - - // Test two streams - combinedStream._streams.push({dataSize: 23}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test currentStream - combinedStream._currentStream = {dataSize: 20}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 53); - - // Test currentStream without dataSize - combinedStream._currentStream = {}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test stream function - combinedStream._streams.push(function() {}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js deleted file mode 100644 index c678575..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var BUFFER = new Buffer('Bacon is delicious'); -var FILE2 = common.dir.fixture + '/file2.txt'; -var STRING = 'The € kicks the $\'s ass!'; - -var EXPECTED = - fs.readFileSync(FILE1) - + BUFFER - + fs.readFileSync(FILE2) - + STRING; -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(BUFFER); - combinedStream.append(fs.createReadStream(FILE2)); - combinedStream.append(function(next) { - next(STRING); - }); - - var tmpFile = common.dir.tmp + '/combined-file1-buffer-file2-string.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js deleted file mode 100644 index 263cfdf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js +++ /dev/null @@ -1,35 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.equal(stream2.dataSize, 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - console.error(GOT.length, EXPECTED.length); - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js deleted file mode 100644 index c3d288d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js +++ /dev/null @@ -1,39 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var util = require('util'); -var Stream = require('stream').Stream; - -var s = CombinedStream.create(); - - -function StringStream(){ - this.writable=true; - this.str="" -} -util.inherits(StringStream,Stream); - -StringStream.prototype.write=function(chunk,encoding){ - this.str+=chunk.toString(); - this.emit('data',chunk); -} - -StringStream.prototype.end=function(chunk,encoding){ - this.emit('end'); -} - -StringStream.prototype.toString=function(){ - return this.str; -} - - -s.append("foo."); -s.append(""); -s.append("bar"); - -var ss = new StringStream(); - -s.pipe(ss); -s.resume(); - -assert.equal(ss.toString(),"foo.bar"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js deleted file mode 100644 index aefa36e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var FILE1 = common.dir.fixture + '/file1.txt'; -var fileStream = fs.createReadStream(FILE1); - -var foo = function(){}; - -(function testIsStreamLike() { - assert(! CombinedStream.isStreamLike(true)); - assert(! CombinedStream.isStreamLike("I am a string")); - assert(! CombinedStream.isStreamLike(7)); - assert(! CombinedStream.isStreamLike(foo)); - - assert(CombinedStream.isStreamLike(fileStream)); -})(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 25f47a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false, maxDataSize: 20736}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var gotErr = null; - combinedStream.on('error', function(err) { - gotErr = err; - }); - - process.on('exit', function() { - assert.ok(gotErr); - assert.ok(gotErr.message.match(/bytes/)); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js deleted file mode 100644 index 30a3a6f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js +++ /dev/null @@ -1,30 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.ok(stream2.dataSize > 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js deleted file mode 100755 index 0bb8e82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json deleted file mode 100644 index 146491b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "form-data", - "description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "0.1.2", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-form-data.git" - }, - "main": "./lib/form_data", - "scripts": { - "test": "node test/run.js" - }, - "engines": { - "node": ">= 0.6" - }, - "dependencies": { - "combined-stream": "~0.0.4", - "mime": "~1.2.11", - "async": "~0.2.9" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/felixge/node-form-data/master/License" - } - ], - "devDependencies": { - "fake": "~0.2.2", - "far": "~0.0.7", - "formidable": "~1.0.14", - "request": "~2.27.0" - }, - "readme": "# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)\n\nA module to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n form.append('my_field', 'my value');\n form.append('my_buffer', new Buffer(10));\n form.append('my_logo', response);\n});\n```\n\nOr @mikeal's request stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n // res – response object (http.IncomingMessage) //\n res.resume(); // for node-0.10.x\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n method: 'post',\n host: 'example.org',\n path: '/upload',\n headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n if (err) throw err;\n\n var form = new FormData();\n\n form.append('file', stdout, {\n filename: 'unicycle.jpg',\n contentType: 'image/jpg',\n knownLength: 19806\n });\n\n form.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n host: 'example.com',\n path: '/probably.php?extra=params',\n auth: 'username:password'\n}, function(err, res) {\n console.log(res.statusCode);\n});\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]\n\n## TODO\n\n- Add new streams (0.10) support and try really hard not to break it for 0.8.x.\n\n## License\n\nForm-Data is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-form-data/issues" - }, - "_id": "form-data@0.1.2", - "_from": "form-data@~0.1.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore deleted file mode 100644 index 77ba16c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml deleted file mode 100755 index 047f7e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js - -node_js: - - 0.10 - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE deleted file mode 100755 index e699a7b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2012-2013, Eran Hammer. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Eran Hammer nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile deleted file mode 100755 index 5f339bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -test: - @node node_modules/lab/bin/lab -test-cov: - @node node_modules/lab/bin/lab -r threshold -t 100 -test-cov-html: - @node node_modules/lab/bin/lab -r html -o coverage.html -complexity: - @node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib - -.PHONY: test test-cov test-cov-html complexity diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md deleted file mode 100755 index 010bac6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md +++ /dev/null @@ -1,627 +0,0 @@ -![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png) - - **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial -HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz). - -Current version: **1.0** - -[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk) - -# Table of Content - -- [**Introduction**](#introduction) - - [Replay Protection](#replay-protection) - - [Usage Example](#usage-example) - - [Protocol Example](#protocol-example) - - [Payload Validation](#payload-validation) - - [Response Payload Validation](#response-payload-validation) - - [Browser Support and Considerations](#browser-support-and-considerations) -

    -- [**Single URI Authorization**](#single-uri-authorization) - - [Usage Example](#bewit-usage-example) -

    -- [**Security Considerations**](#security-considerations) - - [MAC Keys Transmission](#mac-keys-transmission) - - [Confidentiality of Requests](#confidentiality-of-requests) - - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers) - - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials) - - [Entropy of Keys](#entropy-of-keys) - - [Coverage Limitations](#coverage-limitations) - - [Future Time Manipulation](#future-time-manipulation) - - [Client Clock Poisoning](#client-clock-poisoning) - - [Bewit Limitations](#bewit-limitations) - - [Host Header Forgery](#host-header-forgery) -

    -- [**Frequently Asked Questions**](#frequently-asked-questions) -

    -- [**Acknowledgements**](#acknowledgements) - -# Introduction - -**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with -partial cryptographic verification of the request and response, covering the HTTP method, request URI, host, -and optionally the request payload. - -Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of -client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme, -the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is -included in its place. - -However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of -replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less -"chattiness" (interaction with the server). - -Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because -the client and server must both have access to the key material in the clear. - -The primary design goals of this scheme are to: -* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources, -* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where - to send an authenticated request), and -* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client - failure to validate the server's identity as part of its TLS handshake. - -In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using -a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk). - -The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server, -which is beyond the scope of this module. Typically, the shared credentials are established via an initial -TLS-protected phase or derived from some other shared confidential information available to both the client -and the server. - - -## Replay Protection - -Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more -than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when -making requests. This gives the server enough information to prevent replay attacks. - -The nonce is generated by the client, and is a string unique across all requests with the same timestamp and -key identifier combination. - -The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards -are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks. -By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in -practice translates to a maximum of 2 minutes as the skew can be positive or negative). - -Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client -clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types -(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response -to a bad timestamp. - -There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a -potential attack vector). Instead, the client only uses the server's time to calculate an offset used only -for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing -the number of round trips required to authenticate the first request. - - -## Usage Example - -Server code: - -```javascript -var Http = require('http'); -var Hawk = require('hawk'); - - -// Credentials lookup function - -var credentialsFunc = function (id, callback) { - - var credentials = { - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256', - user: 'Steve' - }; - - return callback(null, credentials); -}; - -// Create HTTP server - -var handler = function (req, res) { - - // Authenticate incoming request - - Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) { - - // Prepare response - - var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!'); - var headers = { 'Content-Type': 'text/plain' }; - - // Generate Server-Authorization response header - - var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] }); - headers['Server-Authorization'] = header; - - // Send the response back - - res.writeHead(!err ? 200 : 401, headers); - res.end(payload); - }); -}; - -// Start server - -Http.createServer(handler).listen(8000, 'example.com'); -``` - -Client code: - -```javascript -var Request = require('request'); -var Hawk = require('hawk'); - - -// Client credentials - -var credentials = { - id: 'dh37fgj492je', - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256' -} - -// Request options - -var requestOptions = { - uri: 'http://example.com:8000/resource/1?b=1&a=2', - method: 'GET', - headers: {} -}; - -// Generate Authorization request header - -var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' }); -requestOptions.headers.Authorization = header.field; - -// Send authenticated request - -Request(requestOptions, function (error, response, body) { - - // Authenticate the server's response - - var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body }); - - // Output results - - console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)')); -}); -``` - -**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local -machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method. - -```javascript -Hawk.sntp.start(); -``` - - -## Protocol Example - -The client attempts to access a protected resource without authentication, sending the following HTTP request to -the resource server: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -``` - -The resource server returns an authentication challenge. - -``` -HTTP/1.1 401 Unauthorized -WWW-Authenticate: Hawk -``` - -The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/" -server. The **Hawk** credentials issued to the client include the following attributes: - -* Key identifier: dh37fgj492je -* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn -* Algorithm: sha256 - -The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1, -1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline -character): - -``` -hawk.1.header -1353832234 -j4h3g2 -GET -/resource/1?b=1&a=2 -example.com -8000 - -some-app-ext-data - -``` - -The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string. -The result is base64-encoded to produce the request MAC: - -``` -6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE= -``` - -The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using -the HTTP `Authorization` request header field: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=" -``` - -The server validates the request by calculating the request MAC again based on the request received and verifies the validity -and scope of the **Hawk** credentials. If valid, the server responds with the requested resource. - - -### Payload Validation - -**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash -using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character): -* `hawk.1.payload` -* the content-type in lowercase, without any parameters (e.g. `application/json`) -* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability) - -For example: - -* Payload: `Thank you for flying Hawk` -* Content Type: `text/plain` -* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=` - -Results in the following input to the payload hash function (newline terminated values): - -``` -hawk.1.payload -text/plain -Thank you for flying Hawk - -``` - -Which produces the following hash value: - -``` -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -``` - -The client constructs the normalized request string (newline terminated values): - -``` -hawk.1.header -1353832234 -j4h3g2 -POST -/resource/1?a=1&b=2 -example.com -8000 -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -some-app-ext-data - -``` - -Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data, -and request MAC, with the request using the HTTP `Authorization` request header field: - -``` -POST /resource/1?a=1&b=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=" -``` - -It is up to the server if and when it validates the payload for any given request, based solely on it's security policy -and the nature of the data included. - -If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct -the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value -with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash. - -However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed -at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value -provided by the client after validating the MAC. - -It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value -included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided -by the client, the payload may be modified by an attacker. - - -## Response Payload Validation - -**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the -client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header -as a response header using the exact same syntax as the `Authorization` request header field. - -The header is contructed using the same process as the client's request header. The server uses the same credentials and other -artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with -new values based on the server response. The rest as identical to those used by the client. - -The result MAC digest is included with the optional `hash` and `ext` values: - -``` -Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific" -``` - - -## Browser Support and Considerations - -A browser script is provided for including using a `')); - expect(boom.response.payload.message).to.not.contain(''); - expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e'); - done(); - }); - - it('encodes \' characters', function (done) { - - var encoded = Hoek.escapeJavaScript('something(\'param\')'); - expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29'); - done(); - }); - - it('encodes large unicode characters with the correct padding', function (done) { - - var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000)); - expect(encoded).to.equal('\\u0500\\u1000'); - done(); - }); - - it('doesn\'t throw an exception when passed null', function (done) { - - var encoded = Hoek.escapeJavaScript(null); - expect(encoded).to.equal(''); - done(); - }); - }); - - describe('#escapeHtml', function () { - - it('encodes / characters', function (done) { - - var encoded = Hoek.escapeHtml(''); - expect(encoded).to.equal('<script>alert(1)</script>'); - done(); - }); - - it('encodes < and > as named characters', function (done) { - - var encoded = Hoek.escapeHtml(' -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -### 1.4.0 - -* Improved module context detection -* Removed public RNG functions - -### 1.3.2 - -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -### 1.3.0 - -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md deleted file mode 100644 index aaeb2ea..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# node-uuid Benchmarks - -### Results - -To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark - -### Run them yourself - -node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`. - -To prepare and run the benchmark issue; - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -You'll see an output like this one: - -``` -# v4 -nodeuuid.v4(): 854700 uuids/second -nodeuuid.v4('binary'): 788643 uuids/second -nodeuuid.v4('binary', buffer): 1336898 uuids/second -uuid(): 479386 uuids/second -uuid('binary'): 582072 uuids/second -uuidjs.create(4): 312304 uuids/second - -# v1 -nodeuuid.v1(): 938086 uuids/second -nodeuuid.v1('binary'): 683060 uuids/second -nodeuuid.v1('binary', buffer): 1644736 uuids/second -uuidjs.create(1): 190621 uuids/second -``` - -* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library. -* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK. - -If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file: - -``` -for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done; -``` - -If you're interested in how performance varies between different node versions, you can issue the above command multiple times. - -You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot: - -``` -(cd benchmark/ && ./bench.sh) -``` - -This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu deleted file mode 100644 index a342fbb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ /dev/null @@ -1,174 +0,0 @@ -#!/opt/local/bin/gnuplot -persist -# -# -# G N U P L O T -# Version 4.4 patchlevel 3 -# last modified March 2011 -# System: Darwin 10.8.0 -# -# Copyright (C) 1986-1993, 1998, 2004, 2007-2010 -# Thomas Williams, Colin Kelley and many others -# -# gnuplot home: http://www.gnuplot.info -# faq, bugs, etc: type "help seeking-assistance" -# immediate help: type "help" -# plot window: hit 'h' -set terminal postscript eps noenhanced defaultplex \ - leveldefault color colortext \ - solid linewidth 1.2 butt noclip \ - palfuncparam 2000,0.003 \ - "Helvetica" 14 -set output 'bench.eps' -unset clip points -set clip one -unset clip two -set bar 1.000000 front -set border 31 front linetype -1 linewidth 1.000 -set xdata -set ydata -set zdata -set x2data -set y2data -set timefmt x "%d/%m/%y,%H:%M" -set timefmt y "%d/%m/%y,%H:%M" -set timefmt z "%d/%m/%y,%H:%M" -set timefmt x2 "%d/%m/%y,%H:%M" -set timefmt y2 "%d/%m/%y,%H:%M" -set timefmt cb "%d/%m/%y,%H:%M" -set boxwidth -set style fill empty border -set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 -set dummy x,y -set format x "% g" -set format y "% g" -set format x2 "% g" -set format y2 "% g" -set format z "% g" -set format cb "% g" -set angles radians -unset grid -set key title "" -set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 -set key maxcolumns 2 maxrows 0 -unset label -unset arrow -set style increment default -unset style line -set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0 -unset style arrow -set style histogram clustered gap 2 title offset character 0, 0, 0 -unset logscale -set offsets graph 0.05, 0.15, 0, 0 -set pointsize 1.5 -set pointintervalbox 1 -set encoding default -unset polar -unset parametric -unset decimalsign -set view 60, 30, 1, 1 -set samples 100, 100 -set isosamples 10, 10 -set surface -unset contour -set clabel '%8.3g' -set mapping cartesian -set datafile separator whitespace -unset hidden3d -set cntrparam order 4 -set cntrparam linear -set cntrparam levels auto 5 -set cntrparam points 5 -set size ratio 0 1,1 -set origin 0,0 -set style data points -set style function lines -set xzeroaxis linetype -2 linewidth 1.000 -set yzeroaxis linetype -2 linewidth 1.000 -set zzeroaxis linetype -2 linewidth 1.000 -set x2zeroaxis linetype -2 linewidth 1.000 -set y2zeroaxis linetype -2 linewidth 1.000 -set ticslevel 0.5 -set mxtics default -set mytics default -set mztics default -set mx2tics default -set my2tics default -set mcbtics default -set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set xtics norangelimit -set xtics () -set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set ytics autofreq norangelimit -set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0 -set ztics autofreq norangelimit -set nox2tics -set noy2tics -set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set cbtics autofreq norangelimit -set title "" -set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" -set timestamp offset character 0, 0, 0 font "" norotate -set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale rfixmin -set autoscale rfixmax -set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) -set autoscale tfixmin -set autoscale tfixmax -set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale ufixmin -set autoscale ufixmax -set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale vfixmin -set autoscale vfixmax -set xlabel "" -set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" -set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate -set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) -set autoscale xfixmin -set autoscale xfixmax -set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) -set autoscale x2fixmin -set autoscale x2fixmax -set ylabel "" -set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" -set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) -set autoscale yfixmin -set autoscale yfixmax -set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) -set autoscale y2fixmin -set autoscale y2fixmax -set zlabel "" -set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale zfixmin -set autoscale zfixmax -set cblabel "" -set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale cbfixmin -set autoscale cbfixmax -set zero 1e-08 -set lmargin -1 -set bmargin -1 -set rmargin -1 -set tmargin -1 -set pm3d explicit at s -set pm3d scansautomatic -set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB -set palette rgbformulae 7, 5, 15 -set colorbox default -set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath -set fit noerrorvariables -GNUTERM = "aqua" -plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 -# EOF diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh deleted file mode 100755 index d870a0c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# for a given node version run: -# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done; - -PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte') -FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es) -INDICES=(2 3 2 3 2 2 2 2 2) -VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " ) -TMPJOIN="tmp_join" -OUTPUT="bench_results.txt" - -for I in ${!FILES[*]}; do - F=${FILES[$I]} - P=${PATTERNS[$I]} - INDEX=${INDICES[$I]} - echo "version $F" > $F - for V in $VERSIONS; do - (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F - done - if [ $I == 0 ]; then - cat $F > $TMPJOIN - else - join $TMPJOIN $F > $OUTPUT - cp $OUTPUT $TMPJOIN - fi - rm $F -done - -rm $TMPJOIN - -gnuplot bench.gnu -convert -density 200 -resize 800x560 -flatten bench.eps bench.png -rm bench.eps diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c deleted file mode 100644 index dbfc75f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Test performance of native C UUID generation - -To Compile: cc -luuid benchmark-native.c -o benchmark-native -*/ - -#include -#include -#include -#include - -int main() { - uuid_t myid; - char buf[36+1]; - int i; - struct timeval t; - double start, finish; - - gettimeofday(&t, NULL); - start = t.tv_sec + t.tv_usec/1e6; - - int n = 2e5; - for (i = 0; i < n; i++) { - uuid_generate(myid); - uuid_unparse(myid, buf); - } - - gettimeofday(&t, NULL); - finish = t.tv_sec + t.tv_usec/1e6; - double dur = finish - start; - - printf("%d uuids/sec", (int)(n/dur)); - return 0; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js deleted file mode 100644 index 40e6efb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +++ /dev/null @@ -1,84 +0,0 @@ -try { - var nodeuuid = require('../uuid'); -} catch (e) { - console.error('node-uuid require failed - skipping tests'); -} - -try { - var uuid = require('uuid'); -} catch (e) { - console.error('uuid require failed - skipping tests'); -} - -try { - var uuidjs = require('uuid-js'); -} catch (e) { - console.error('uuid-js require failed - skipping tests'); -} - -var N = 5e5; - -function rate(msg, t) { - console.log(msg + ': ' + - (N / (Date.now() - t) * 1e3 | 0) + - ' uuids/second'); -} - -console.log('# v4'); - -// node-uuid - string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4(); - rate('nodeuuid.v4() - using node.js crypto RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG}); - rate('nodeuuid.v4() - using Math.random() RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary'); - rate('nodeuuid.v4(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer); - rate('nodeuuid.v4(\'binary\', buffer)', t); -} - -// libuuid - string form -if (uuid) { - for (var i = 0, t = Date.now(); i < N; i++) uuid(); - rate('uuid()', t); - - for (var i = 0, t = Date.now(); i < N; i++) uuid('binary'); - rate('uuid(\'binary\')', t); -} - -// uuid-js - string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4); - rate('uuidjs.create(4)', t); -} - -// 140byte.es -for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)}); -rate('140byte.es_v4', t); - -console.log(''); -console.log('# v1'); - -// node-uuid - v1 string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1(); - rate('nodeuuid.v1()', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary'); - rate('nodeuuid.v1(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer); - rate('nodeuuid.v1(\'binary\', buffer)', t); -} - -// uuid-js - v1 string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1); - rate('uuidjs.create(1)', t); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json deleted file mode 100644 index ace2134..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "node-uuid", - "repo": "broofa/node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.0", - "author": "Robert Kieffer ", - "contributors": [ - {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} - ], - "keywords": ["uuid", "guid", "rfc4122"], - "dependencies": {}, - "development": {}, - "main": "uuid.js", - "scripts": [ - "uuid.js" - ], - "license": "MIT" -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json deleted file mode 100644 index 627b475..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "lib": ".", - "main": "./uuid.js", - "repository": { - "type": "git", - "url": "https://github.com/broofa/node-uuid.git" - }, - "version": "1.4.1", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "_id": "node-uuid@1.4.1", - "_from": "node-uuid@~1.4.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js deleted file mode 100644 index 05af822..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js +++ /dev/null @@ -1,63 +0,0 @@ -var assert = require('assert'), - nodeuuid = require('../uuid'), - uuidjs = require('uuid-js'), - libuuid = require('uuid').generate, - util = require('util'), - exec = require('child_process').exec, - os = require('os'); - -// On Mac Os X / macports there's only the ossp-uuid package that provides uuid -// On Linux there's uuid-runtime which provides uuidgen -var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; - -function compare(ids) { - console.log(ids); - for (var i = 0; i < ids.length; i++) { - var id = ids[i].split('-'); - id = [id[2], id[1], id[0]].join(''); - ids[i] = id; - } - var sorted = ([].concat(ids)).sort(); - - if (sorted.toString() !== ids.toString()) { - console.log('Warning: sorted !== ids'); - } else { - console.log('everything in order!'); - } -} - -// Test time order of v1 uuids -var ids = []; -while (ids.length < 10e3) ids.push(nodeuuid.v1()); - -var max = 10; -console.log('node-uuid:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); -compare(ids); - -console.log(''); -console.log('uuidjs:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); -compare(ids); - -console.log(''); -console.log('libuuid:'); -ids = []; -var count = 0; -var last = function() { - compare(ids); -} -var cb = function(err, stdout, stderr) { - ids.push(stdout.substring(0, stdout.length-1)); - count++; - if (count < max) { - return next(); - } - last(); -}; -var next = function() { - exec(uuidCmd, cb); -}; -next(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html deleted file mode 100644 index d80326e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js deleted file mode 100644 index 2469225..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js +++ /dev/null @@ -1,228 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js deleted file mode 100644 index 2fac6dc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js +++ /dev/null @@ -1,245 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md deleted file mode 100644 index 34c4a85..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md +++ /dev/null @@ -1,4 +0,0 @@ -oauth-sign -========== - -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js deleted file mode 100644 index e35bfa6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json deleted file mode 100644 index f211ed3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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" - }, - "_id": "oauth-sign@0.3.0", - "_from": "oauth-sign@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js deleted file mode 100644 index 46955ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore deleted file mode 100644 index e85ce2a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -test -.travis.yml -benchmark.js -component.json -examples.js -History.md -Makefile diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md deleted file mode 100644 index 27e54a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js deleted file mode 100644 index 590491e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js +++ /dev/null @@ -1,387 +0,0 @@ -/** - * 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) 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; -}; - -/** - * Create a nullary object if possible - */ - -function createObject() { - return Object.create - ? Object.create(null) - : {}; -} - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = createObject(); - var t = createObject(); - 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(); - // 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 = createObject(); - 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; -} - -/** - * Restore Object.prototype. - * see pull-request #58 - */ - -function restoreProto(obj) { - if (!Object.create) return obj; - if (isArray(obj)) return obj; - if (obj && 'object' != typeof obj) return obj; - - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - obj[key] = restoreProto(obj[key]); - } - } - - obj.__proto__ = Object.prototype; - 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: createObject() }).base; - - return restoreProto(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 (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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json deleted file mode 100644 index d1475f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.6.5", - "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" - }, - "_id": "qs@0.6.5", - "_from": "qs@~0.6.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md deleted file mode 100644 index bb533d5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -tunnel-agent -============ - -HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js deleted file mode 100644 index 3f7bbb9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js +++ /dev/null @@ -1,227 +0,0 @@ -'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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json deleted file mode 100644 index 3351a28..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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" - }, - "_id": "tunnel-agent@0.3.0", - "_from": "tunnel-agent@~0.3.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json deleted file mode 100755 index 4ff48b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "request", - "description": "Simplified HTTP request client.", - "tags": [ - "http", - "simple", - "util", - "utility" - ], - "version": "2.25.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 request method\n\n## Install\n\n
    \n  npm install request\n
    \n\nOr from source:\n\n
    \n  git clone git://github.com/mikeal/request.git \n  cd request\n  npm link\n
    \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\t\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", - "_id": "request@2.25.0", - "_from": "request@~2.25.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg deleted file mode 100644 index f80c9c5..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js deleted file mode 100644 index b6eacba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('fs') - , http = require('http') - , path = require('path') - , https = require('https') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - ; - -exports.createServer = function (port) { - port = port || 6767 - var s = http.createServer(function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'http://localhost:'+port - return s; -} - -exports.createSSLServer = function(port, opts) { - port = port || 16767 - - var options = { 'key' : path.join(__dirname, 'ssl', 'test.key') - , 'cert': path.join(__dirname, 'ssl', 'test.crt') - } - if (opts) { - for (var i in opts) options[i] = opts[i] - } - - for (var i in options) { - options[i] = fs.readFileSync(options[i]) - } - - var s = https.createServer(options, function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'https://localhost:'+port - return s; -} - -exports.createPostStream = function (text) { - var postStream = new stream.Stream(); - postStream.writeable = true; - postStream.readable = true; - setTimeout(function () {postStream.emit('data', new Buffer(text)); postStream.emit('end')}, 0); - return postStream; -} -exports.createPostValidator = function (text, reqContentType) { - var l = function (req, resp) { - var r = ''; - req.on('data', function (chunk) {r += chunk}) - req.on('end', function () { - if (req.headers['content-type'] && req.headers['content-type'].indexOf('boundary=') >= 0) { - var boundary = req.headers['content-type'].split('boundary=')[1]; - text = text.replace(/__BOUNDARY__/g, boundary); - } - if (r !== text) console.log(r, text); - assert.equal(r, text) - if (reqContentType) { - assert.ok(req.headers['content-type']) - assert.ok(~req.headers['content-type'].indexOf(reqContentType)) - } - resp.writeHead(200, {'content-type':'text/plain'}) - resp.write('OK') - resp.end() - }) - } - return l; -} -exports.createGetResponse = function (text, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - resp.write(text) - resp.end() - } - return l; -} -exports.createChunkResponse = function (chunks, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - chunks.forEach(function (chunk) { - resp.write(chunk) - }) - resp.end() - } - return l; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf deleted file mode 100644 index 0d4a3b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf +++ /dev/null @@ -1,77 +0,0 @@ -# -# Recommended minimum configuration: -# -acl manager proto cache_object -acl localhost src 127.0.0.1/32 ::1 -acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 - -# Example rule allowing access from your local networks. -# Adapt to list your (internal) IP networks from where browsing -# should be allowed -acl localnet src 10.0.0.0/8 # RFC1918 possible internal network -acl localnet src 172.16.0.0/12 # RFC1918 possible internal network -acl localnet src 192.168.0.0/16 # RFC1918 possible internal network -acl localnet src fc00::/7 # RFC 4193 local private network range -acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines - -acl SSL_ports port 443 -acl Safe_ports port 80 # http -acl Safe_ports port 21 # ftp -acl Safe_ports port 443 # https -acl Safe_ports port 70 # gopher -acl Safe_ports port 210 # wais -acl Safe_ports port 1025-65535 # unregistered ports -acl Safe_ports port 280 # http-mgmt -acl Safe_ports port 488 # gss-http -acl Safe_ports port 591 # filemaker -acl Safe_ports port 777 # multiling http -acl CONNECT method CONNECT - -# -# Recommended minimum Access Permission configuration: -# -# Only allow cachemgr access from localhost -http_access allow manager localhost -http_access deny manager - -# Deny requests to certain unsafe ports -http_access deny !Safe_ports - -# Deny CONNECT to other than secure SSL ports -#http_access deny CONNECT !SSL_ports - -# We strongly recommend the following be uncommented to protect innocent -# web applications running on the proxy server who think the only -# one who can access services on "localhost" is a local user -#http_access deny to_localhost - -# -# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS -# - -# Example rule allowing access from your local networks. -# Adapt localnet in the ACL section to list your (internal) IP networks -# from where browsing should be allowed -http_access allow localnet -http_access allow localhost - -# And finally deny all other access to this proxy -http_access deny all - -# Squid normally listens to port 3128 -http_port 3128 - -# We recommend you to use at least the following line. -hierarchy_stoplist cgi-bin ? - -# Uncomment and adjust the following to add a disk cache directory. -#cache_dir ufs /usr/local/var/cache 100 16 256 - -# Leave coredumps in the first cache dir -coredump_dir /usr/local/var/cache - -# Add any of your own refresh_pattern entries above these. -refresh_pattern ^ftp: 1440 20% 10080 -refresh_pattern ^gopher: 1440 0% 1440 -refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 -refresh_pattern . 0 20% 4320 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf deleted file mode 100644 index 425a889..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf +++ /dev/null @@ -1,20 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no -output_password = password - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = request Certificate Authority -CN = requestCA -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crl b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crl deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt deleted file mode 100644 index b4524e4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICvTCCAiYCCQDn+P/MSbDsWjANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGiMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxJjAkBgNVBAsTHXJlcXVlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 -MRIwEAYDVQQDEwlyZXF1ZXN0Q0ExJjAkBgkqhkiG9w0BCQEWF21pa2VhbEBtaWtl -YWxyb2dlcnMuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7t9pQUAK4 -5XJYTI6NrF0n3G2HZsfN+rPYSVzzL8SuVyb1tHXos+vbPm3NKI4E8X1yVAXU8CjJ -5SqXnp4DAypAhaseho81cbhk7LXUhFz78OvAa+OD+xTAEAnNQ8tGUr4VGyplEjfD -xsBVuqV2j8GPNTftr+drOCFlqfAgMrBn4wIDAQABMA0GCSqGSIb3DQEBBQUAA4GB -ADVdTlVAL45R+PACNS7Gs4o81CwSclukBu4FJbxrkd4xGQmurgfRrYYKjtqiopQm -D7ysRamS3HMN9/VKq2T7r3z1PMHPAy7zM4uoXbbaTKwlnX4j/8pGPn8Ca3qHXYlo -88L/OOPc6Di7i7qckS3HFbXQCTiULtxWmy97oEuTwrAj ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr deleted file mode 100644 index e48c56e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICBjCCAW8CAQAwgaIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEmMCQGA1UECxMdcmVxdWVzdCBD -ZXJ0aWZpY2F0ZSBBdXRob3JpdHkxEjAQBgNVBAMTCXJlcXVlc3RDQTEmMCQGCSqG -SIb3DQEJARYXbWlrZWFsQG1pa2VhbHJvZ2Vycy5jb20wgZ8wDQYJKoZIhvcNAQEB -BQADgY0AMIGJAoGBALu32lBQArjlclhMjo2sXSfcbYdmx836s9hJXPMvxK5XJvW0 -deiz69s+bc0ojgTxfXJUBdTwKMnlKpeengMDKkCFqx6GjzVxuGTstdSEXPvw68Br -44P7FMAQCc1Dy0ZSvhUbKmUSN8PGwFW6pXaPwY81N+2v52s4IWWp8CAysGfjAgMB -AAGgIzAhBgkqhkiG9w0BCQcxFBMScGFzc3dvcmQgY2hhbGxlbmdlMA0GCSqGSIb3 -DQEBBQUAA4GBAGJO7grHeVHXetjHEK8urIxdnvfB2qeZeObz4GPKIkqUurjr0rfj -bA3EK1kDMR5aeQWR8RunixdM16Q6Ry0lEdLVWkdSwRN9dmirIHT9cypqnD/FYOia -SdezZ0lUzXgmJIwRYRwB1KSMMocIf52ll/xC2bEGg7/ZAEuAyAgcZV3X ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key deleted file mode 100644 index a53e7f7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,C8B5887048377F02 - -nyD5ZH0Wup2uWsDvurq5mKDaDrf8lvNn9w0SH/ZkVnfR1/bkwqrFriqJWvZNUG+q -nS0iBYczsWLJnbub9a1zLOTENWUKVD5uqbC3aGHhnoUTNSa27DONgP8gHOn6JgR+ -GAKo01HCSTiVT4LjkwN337QKHnMP2fTzg+IoC/CigvMcq09hRLwU1/guq0GJKGwH -gTxYNuYmQC4Tjh8vdS4liF+Ve/P3qPR2CehZrIOkDT8PHJBGQJRo4xGUIB7Tpk38 -VCk+UZ0JCS2coY8VkY/9tqFJp/ZnnQQVmaNbdRqg7ECKL+bXnNo7yjzmazPZmPe3 -/ShbE0+CTt7LrjCaQAxWbeDzqfo1lQfgN1LulTm8MCXpQaJpv7v1VhIhQ7afjMYb -4thW/ypHPiYS2YJCAkAVlua9Oxzzh1qJoh8Df19iHtpd79Q77X/qf+1JvITlMu0U -gi7yEatmQcmYNws1mtTC1q2DXrO90c+NZ0LK/Alse6NRL/xiUdjug2iHeTf/idOR -Gg/5dSZbnnlj1E5zjSMDkzg6EHAFmHV4jYGSAFLEQgp4V3ZhMVoWZrvvSHgKV/Qh -FqrAK4INr1G2+/QTd09AIRzfy3/j6yD4A9iNaOsEf9Ua7Qh6RcALRCAZTWR5QtEf -dX+iSNJ4E85qXs0PqwkMDkoaxIJ+tmIRJY7y8oeylV8cfGAi8Soubt/i3SlR8IHC -uDMas/2OnwafK3N7ODeE1i7r7wkzQkSHaEz0TrF8XRnP25jAICCSLiMdAAjKfxVb -EvzsFSuAy3Jt6bU3hSLY9o4YVYKE+68ITMv9yNjvTsEiW+T+IbN34w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl deleted file mode 100644 index 17128db..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl +++ /dev/null @@ -1 +0,0 @@ -ADF62016AA40C9C3 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf deleted file mode 100644 index cd1fd1e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf +++ /dev/null @@ -1,19 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = testing -CN = testing.request.mikealrogers.com -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt deleted file mode 100644 index efe96ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICejCCAeMCCQCt9iAWqkDJwzANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGjMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxEDAOBgNVBAsTB3Rlc3RpbmcxKTAnBgNVBAMTIHRlc3RpbmcucmVx -dWVzdC5taWtlYWxyb2dlcnMuY29tMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlr -ZWFscm9nZXJzLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDgVl0jMumvOpmM -20W5v9yhGgZj8hPhEQF/N7yCBVBn/rWGYm70IHC8T/pR5c0LkWc5gdnCJEvKWQjh -DBKxZD8FAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEABShRkNgFbgs4vUWW9R9deNJj -7HJoiTmvkmoOC7QzcYkjdgHbOxsSq3rBnwxsVjY9PAtPwBn0GRspOeG7KzKRgySB -kb22LyrCFKbEOfKO/+CJc80ioK9zEPVjGsFMyAB+ftYRqM+s/4cQlTg/m89l01wC -yapjN3RxZbInGhWR+jA= ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr deleted file mode 100644 index a8e7595..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBgjCCASwCAQAwgaMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEQMA4GA1UECxMHdGVzdGluZzEp -MCcGA1UEAxMgdGVzdGluZy5yZXF1ZXN0Lm1pa2VhbHJvZ2Vycy5jb20xJjAkBgkq -hkiG9w0BCQEWF21pa2VhbEBtaWtlYWxyb2dlcnMuY29tMFwwDQYJKoZIhvcNAQEB -BQADSwAwSAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAaAjMCEGCSqGSIb3DQEJBzEU -ExJwYXNzd29yZCBjaGFsbGVuZ2UwDQYJKoZIhvcNAQEFBQADQQBD3E5WekQzCEJw -7yOcqvtPYIxGaX8gRKkYfLPoj3pm3GF5SGqtJKhylKfi89szHXgktnQgzff9FN+A -HidVJ/3u ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js deleted file mode 100644 index 05e21c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js +++ /dev/null @@ -1,28 +0,0 @@ -var fs = require("fs") -var https = require("https") -var options = { key: fs.readFileSync("./server.key") - , cert: fs.readFileSync("./server.crt") } - -var server = https.createServer(options, function (req, res) { - res.writeHead(200) - res.end() - server.close() -}) -server.listen(1337) - -var ca = fs.readFileSync("./ca.crt") -var agent = new https.Agent({ host: "localhost", port: 1337, ca: ca }) - -https.request({ host: "localhost" - , method: "HEAD" - , port: 1337 - , headers: { host: "testing.request.mikealrogers.com" } - , agent: agent - , ca: [ ca ] - , path: "/" }, function (res) { - if (res.client.authorized) { - console.log("node test: OK") - } else { - throw new Error(res.client.authorizationError) - } -}).end() diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key deleted file mode 100644 index 72d8698..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAQJAK+r8ZM2sze8s7FRo/ApB -iRBtO9fCaIdJwbwJnXKo4RKwZDt1l2mm+fzZ+/QaQNjY1oTROkIIXmnwRvZWfYlW -gQIhAPKYsG+YSBN9o8Sdp1DMyZ/rUifKX3OE6q9tINkgajDVAiEA7Ltqh01+cnt0 -JEnud/8HHcuehUBLMofeg0G+gCnSbXECIQCqDvkXsWNNLnS/3lgsnvH0Baz4sbeJ -rjIpuVEeg8eM5QIgbu0+9JmOV6ybdmmiMV4yAncoF35R/iKGVHDZCAsQzDECIQDZ -0jGz22tlo5YMcYSqrdD3U4sds1pwiAaWFRbCunoUJw== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt deleted file mode 100644 index fde2fe9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x -IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w -bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y -MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV -BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj -YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA -aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE -OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz -Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl -y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC -l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv -yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl -ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt deleted file mode 100644 index b357f86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICQzCCAawCCQCO/XWtRFck1jANBgkqhkiG9w0BAQUFADBmMQswCQYDVQQGEwJU -SDEQMA4GA1UECBMHQmFuZ2tvazEOMAwGA1UEBxMFU2lsb20xGzAZBgNVBAoTElRo -ZSBSZXF1ZXN0IE1vZHVsZTEYMBYGA1UEAxMPcmVxdWVzdC5leGFtcGxlMB4XDTEx -MTIwMzAyMjkyM1oXDTIxMTEzMDAyMjkyM1owZjELMAkGA1UEBhMCVEgxEDAOBgNV -BAgTB0Jhbmdrb2sxDjAMBgNVBAcTBVNpbG9tMRswGQYDVQQKExJUaGUgUmVxdWVz -dCBNb2R1bGUxGDAWBgNVBAMTD3JlcXVlc3QuZXhhbXBsZTCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAwmctddZqlA48+NXs0yOy92DijcQV1jf87zMiYAIlNUto -wghVbTWgJU5r0pdKrD16AptnWJTzKanhItEX8XCCPgsNkq1afgTtJP7rNkwu3xcj -eIMkhJg/ay4ZnkbnhYdsii5VTU5prix6AqWRAhbkBgoA+iVyHyof8wvZyKBoFTMC -AwEAATANBgkqhkiG9w0BAQUFAAOBgQB6BybMJbpeiABgihDfEVBcAjDoQ8gUMgwV -l4NulugfKTDmArqnR9aPd4ET5jX5dkMP4bwCHYsvrcYDeWEQy7x5WWuylOdKhua4 -L4cEi2uDCjqEErIG3cc1MCOk6Cl6Ld6tkIzQSf953qfdEACRytOeUqLNQcrXrqeE -c7U8F6MWLQ== ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key deleted file mode 100644 index b85810d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDCZy111mqUDjz41ezTI7L3YOKNxBXWN/zvMyJgAiU1S2jCCFVt -NaAlTmvSl0qsPXoCm2dYlPMpqeEi0RfxcII+Cw2SrVp+BO0k/us2TC7fFyN4gySE -mD9rLhmeRueFh2yKLlVNTmmuLHoCpZECFuQGCgD6JXIfKh/zC9nIoGgVMwIDAQAB -AoGBALXFwfUf8vHTSmGlrdZS2AGFPvEtuvldyoxi9K5u8xmdFCvxnOcLsF2RsTHt -Mu5QYWhUpNJoG+IGLTPf7RJdj/kNtEs7xXqWy4jR36kt5z5MJzqiK+QIgiO9UFWZ -fjUb6oeDnTIJA9YFBdYi97MDuL89iU/UK3LkJN3hd4rciSbpAkEA+MCkowF5kSFb -rkOTBYBXZfiAG78itDXN6DXmqb9XYY+YBh3BiQM28oxCeQYyFy6pk/nstnd4TXk6 -V/ryA2g5NwJBAMgRKTY9KvxJWbESeMEFe2iBIV0c26/72Amgi7ZKUCLukLfD4tLF -+WSZdmTbbqI1079YtwaiOVfiLm45Q/3B0eUCQAaQ/0eWSGE+Yi8tdXoVszjr4GXb -G81qBi91DMu6U1It+jNfIba+MPsiHLcZJMVb4/oWBNukN7bD1nhwFWdlnu0CQQCf -Is9WHkdvz2RxbZDxb8verz/7kXXJQJhx5+rZf7jIYFxqX3yvTNv3wf2jcctJaWlZ -fVZwB193YSivcgt778xlAkEAprYUz3jczjF5r2hrgbizPzPDR94tM5BTO3ki2v3w -kbf+j2g7FNAx6kZiVN8XwfLc8xEeUGiPKwtq3ddPDFh17w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js deleted file mode 100644 index 47fe3aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js +++ /dev/null @@ -1,23 +0,0 @@ -var request = require('../index') - , http = require('http') - , server = require('./server') - , assert = require('assert') - ; - -var s = http.createServer(function (req, resp) { - resp.statusCode = 200 - resp.end('') -}).listen(6767, function () { - // requests without agentOptions should use global agent - var r = request('http://localhost:6767', function (e, resp, body) { - assert.deepEqual(r.agent, http.globalAgent); - assert.equal(Object.keys(r.pool).length, 0); - - // requests with agentOptions should apply agentOptions to new agent in pool - var r2 = request('http://localhost:6767', { agentOptions: { foo: 'bar' } }, function (e, resp, body) { - assert.deepEqual(r2.agent.options, { foo: 'bar' }); - assert.equal(Object.keys(r2.pool).length, 1); - s.close() - }); - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js deleted file mode 100644 index 3f48048..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js +++ /dev/null @@ -1,143 +0,0 @@ -var assert = require('assert') - , http = require('http') - , request = require('../index') - ; - -var numBasicRequests = 0; - -var basicServer = http.createServer(function (req, res) { - console.error('Basic auth server: ', req.method, req.url); - numBasicRequests++; - - var ok; - - if (req.headers.authorization) { - if (req.headers.authorization == 'Basic ' + new Buffer('test:testing2').toString('base64')) { - ok = true; - } else if ( req.headers.authorization == 'Basic ' + new Buffer(':apassword').toString('base64')) { - 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', 'Basic realm="Private"'); - } - - if (req.url == '/post/') { - var expectedContent = 'data_key=data_value'; - req.on('data', function(data) { - assert.equal(data, expectedContent); - console.log('received request data: ' + data); - }); - assert.equal(req.method, 'POST'); - assert.equal(req.headers['content-length'], '' + expectedContent.length); - assert.equal(req.headers['content-type'], 'application/x-www-form-urlencoded; charset=utf-8'); - } - - if (ok) { - console.log('request ok'); - res.end('ok'); - } else { - console.log('status=401'); - res.statusCode = 401; - res.end('401'); - } -}); - -basicServer.listen(6767); - -var tests = [ - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 2); - next(); - }); - }, - - function(next) { - // If we don't set sendImmediately = false, request will send basic auth - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test2/', - 'auth': { - 'user': 'test', - 'pass': 'testing2' - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 3); - next(); - }); - }, - - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://test:testing2@localhost:6767/test2/' - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 4); - next(); - }); - }, - - function(next) { - request({ - 'method': 'POST', - 'form': { 'data_key': 'data_value' }, - 'uri': 'http://localhost:6767/post/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 6); - next(); - }); - }, - - function(next) { - assert.doesNotThrow( function() { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/allow_empty_user/', - 'auth': { - 'user': '', - 'pass': 'apassword', - 'sendImmediately': false - } - }, function(error, res, body ) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 8); - next(); - }); - }) - } -]; - -function runTest(i) { - if (i < tests.length) { - tests[i](function() { - runTest(i + 1); - }); - } else { - console.log('All tests passed'); - basicServer.close(); - } -} - -runTest(0); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js deleted file mode 100644 index 186de12..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js +++ /dev/null @@ -1,122 +0,0 @@ -var server = require('./server') - , events = require('events') - , stream = require('stream') - , 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!") - } - , testGetEncoding : - { resp : server.createGetResponse(new Buffer('efa3bfcea9e29883', 'hex')) - , encoding: 'hex' - , expectBody: "efa3bfcea9e29883" - } - , testGetUTF8: - { resp: server.createGetResponse(new Buffer([0xEF, 0xBB, 0xBF, 226, 152, 131])) - , encoding: "utf8" - , 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.'} - ] - } - , 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js deleted file mode 100644 index f6c4024..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js +++ /dev/null @@ -1,129 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js deleted file mode 100644 index 5f2d6eb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js +++ /dev/null @@ -1,69 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js deleted file mode 100644 index 338c92e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js deleted file mode 100644 index 4df1302..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js +++ /dev/null @@ -1,37 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js deleted file mode 100644 index 956e386..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js deleted file mode 100644 index f2e51ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js deleted file mode 100644 index 91b9230..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js +++ /dev/null @@ -1,79 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js deleted file mode 100755 index 8454625..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js deleted file mode 100644 index 3982b9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js deleted file mode 100755 index 9300473..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js +++ /dev/null @@ -1,106 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js deleted file mode 100644 index 2c19615..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js +++ /dev/null @@ -1,94 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js deleted file mode 100644 index d49a9af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js +++ /dev/null @@ -1,97 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js deleted file mode 100644 index b6858d4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js +++ /dev/null @@ -1,87 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js deleted file mode 100644 index 11a1bd1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js deleted file mode 100644 index 3269483..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js +++ /dev/null @@ -1,117 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js deleted file mode 100644 index c239f89..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js deleted file mode 100644 index a5831a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js +++ /dev/null @@ -1,93 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js deleted file mode 100644 index e295ec7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js deleted file mode 100644 index 52a15cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js +++ /dev/null @@ -1,216 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js deleted file mode 100644 index 791ee8b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js deleted file mode 100644 index 7e83a41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js deleted file mode 100644 index e183d68..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js deleted file mode 100644 index 65958e6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js deleted file mode 100644 index cdd4606..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js +++ /dev/null @@ -1,155 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js deleted file mode 100644 index 0f6a832..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js deleted file mode 100644 index 7036367..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js +++ /dev/null @@ -1,87 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js deleted file mode 100644 index 6d5f92a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js deleted file mode 100644 index 2ee3f39..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg deleted file mode 100644 index 7cea4dd..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc deleted file mode 100644 index c8ef3ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc +++ /dev/null @@ -1,59 +0,0 @@ -{ - "predef": [ ] - , "bitwise": false - , "camelcase": false - , "curly": false - , "eqeqeq": false - , "forin": false - , "immed": false - , "latedef": false - , "noarg": true - , "noempty": true - , "nonew": true - , "plusplus": false - , "quotmark": true - , "regexp": false - , "undef": true - , "unused": true - , "strict": false - , "trailing": true - , "maxlen": 120 - , "asi": true - , "boss": true - , "debug": true - , "eqnull": true - , "esnext": true - , "evil": true - , "expr": true - , "funcscope": false - , "globalstrict": false - , "iterator": false - , "lastsemic": true - , "laxbreak": true - , "laxcomma": true - , "loopfunc": true - , "multistr": false - , "onecase": false - , "proto": false - , "regexdash": false - , "scripturl": true - , "smarttabs": false - , "shadow": false - , "sub": true - , "supernew": false - , "validthis": true - , "browser": true - , "couch": false - , "devel": false - , "dojo": false - , "mootools": false - , "node": true - , "nonstandard": true - , "prototypejs": false - , "rhino": false - , "worker": true - , "wsh": false - , "nomen": false - , "onevar": false - , "passfail": false -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore deleted file mode 100644 index b512c09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml deleted file mode 100644 index cece8c6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" -branches: - only: - - master -notifications: - email: - - rod@vagg.org -script: npm test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE deleted file mode 100644 index f6a0029..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -Copyright 2013, Rod Vagg (the "Original Author") -All rights reserved. - -MIT +no-false-attribs 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. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -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. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software. \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md deleted file mode 100644 index 1f7e6bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# through2 - -[![Build Status](https://secure.travis-ci.org/rvagg/through2.png)](http://travis-ci.org/rvagg/through2) - -[![NPM](https://nodei.co/npm/through2.png?compact=true)](https://nodei.co/npm/through2/) - -**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise** - -Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`. - -```js -fs.createReadStream('ex.txt') - .pipe(through2(function (chunk, enc, callback) { - for (var i = 0; i < chunk.length; i++) - if (chunk[i] == 97) - chunk[i] = 122 // swap 'a' for 'z' - this.push(chunk) - callback() - })) - .pipe(fs.createWriteStream('out.txt')) -``` - -Or object streams: - -```js -var all = [] -fs.createReadStream('data.csv') - .pipe(csv2()) - .pipe(through2({ objectMode: true }, function (chunk, enc, callback) { - var data = { - name : chunk[0] - , address : chunk[3] - , phone : chunk[10] - } - this.push(data) - callback() - })) - .on('data', function (data) { - all.push(data) - }) - .on('end', function () { - doSomethingSpecial(all) - }) -``` - -## API - -through2([ options, ] transformFunction[, flushFunction ]) - -Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`). - -### options - -The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams. - -The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call: - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2({ objectMode: true, allowHalfOpen: false }, function (chunk, enc, cb) { - this.push(new Buffer('wut?')) - cb() - }) - .pipe(fs.createWriteStream('/tmp/wut.txt')) -``` - -### transformFunction - -The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk. - -To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on. - -### flushFunction - -The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress. - -through2.ctor([ options, ] transformFunction[, flushFunction ]) - -Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances. - -```js -var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) { - if (record.temp != null && record.unit = "F") { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = "C" - } - this.push(record) - callback() -}) - -// Create instances of FToC like so: -var converter = new FToC() -// Or: -var converter = FToC() -// Or specify/override options when you instantiate, if you prefer: -var converter = FToC({objectMode: true}) - -``` - -## License - -**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md deleted file mode 100644 index be97668..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md +++ /dev/null @@ -1,768 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS deleted file mode 100644 index 205a425..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS +++ /dev/null @@ -1,32 +0,0 @@ -var Transform = require('../transform'); -var inherits = require('util').inherits; - -// subclass -function MyStream () { - Transform.call(this, { - lowWaterMark: 0, - encoding: 'utf8' - }); -} -inherits(MyStream, Transform); - -MyStream.prototype._transform = function (chunk, outputFn, callback) { - outputFn(new Buffer(String(chunk).toUpperCase())); - callback(); -}; - -// use it! -var s = new MyStream(); -process.stdin.resume(); -process.stdin.pipe(s).pipe(process.stdout); -if (process.stdin.setRawMode) - process.stdin.setRawMode(true); -process.stdin.on('data', function (c) { - c = c.toString(); - if (c === '\u0003' || c === '\u0004') { - process.stdin.pause(); - s.end(); - } - if (c === '\r') - process.stdout.write('\n'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js deleted file mode 100644 index 7e71584..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js +++ /dev/null @@ -1,15 +0,0 @@ -var fs = require('fs'); -var FSReadable = require('../fs.js'); -var rst = new FSReadable(__filename); - -rst.on('end', function() { - process.stdin.pause(); -}); - -process.stdin.setRawMode(true); -process.stdin.on('data', function() { - var c = rst.read(3); - if (!c) return; - process.stdout.write(c); -}); -process.stdin.resume(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js deleted file mode 100644 index c16eb6f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var fst = fs.createReadStream(__filename); -var Readable = require('../readable.js'); -var rst = new Readable(); -rst.wrap(fst); - -rst.on('end', function() { - process.stdin.pause(); -}); - -process.stdin.setRawMode(true); -process.stdin.on('data', function() { - var c = rst.read(3); - if (!c) return setTimeout(process.exit, 500) - process.stdout.write(c); -}); -process.stdin.resume(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch deleted file mode 100644 index 0ad71a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js deleted file mode 100644 index a663af8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js +++ /dev/null @@ -1,1705 +0,0 @@ -// 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. - -// Maintainers, keep in mind that octal literals are not allowed -// in strict mode. Use the decimal value and add a comment with -// the octal value. Example: -// -// var mode = 438; /* mode=0666 */ - -var util = require('util'); -var pathModule = require('path'); - -var binding = process.binding('fs'); -var constants = process.binding('constants'); -var fs = exports; -var Stream = require('stream').Stream; -var EventEmitter = require('events').EventEmitter; - -var Readable = require('./lib/_stream_readable.js'); -var Writable = require('./lib/_stream_writable.js'); - -var kMinPoolSpace = 128; -var kPoolSize = 40 * 1024; - -var O_APPEND = constants.O_APPEND || 0; -var O_CREAT = constants.O_CREAT || 0; -var O_DIRECTORY = constants.O_DIRECTORY || 0; -var O_EXCL = constants.O_EXCL || 0; -var O_NOCTTY = constants.O_NOCTTY || 0; -var O_NOFOLLOW = constants.O_NOFOLLOW || 0; -var O_RDONLY = constants.O_RDONLY || 0; -var O_RDWR = constants.O_RDWR || 0; -var O_SYMLINK = constants.O_SYMLINK || 0; -var O_SYNC = constants.O_SYNC || 0; -var O_TRUNC = constants.O_TRUNC || 0; -var O_WRONLY = constants.O_WRONLY || 0; - -var isWindows = process.platform === 'win32'; - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - if (DEBUG) { - var backtrace = new Error; - return function(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - throw err; - } - }; - } - - return function(err) { - if (err) { - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - } - }; -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -// Ensure that callbacks run in the global context. Only use this function -// for callbacks that are passed to the binding layer, callbacks that are -// invoked from JS already run in the proper scope. -function makeCallback(cb) { - if (typeof cb !== 'function') { - return rethrow(); - } - - return function() { - return cb.apply(null, arguments); - }; -} - -function assertEncoding(encoding) { - if (encoding && !Buffer.isEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -function nullCheck(path, callback) { - if (('' + path).indexOf('\u0000') !== -1) { - var er = new Error('Path must be a string without null bytes.'); - if (!callback) - throw er; - process.nextTick(function() { - callback(er); - }); - return false; - } - return true; -} - -fs.Stats = binding.Stats; - -fs.Stats.prototype._checkModeProperty = function(property) { - return ((this.mode & constants.S_IFMT) === property); -}; - -fs.Stats.prototype.isDirectory = function() { - return this._checkModeProperty(constants.S_IFDIR); -}; - -fs.Stats.prototype.isFile = function() { - return this._checkModeProperty(constants.S_IFREG); -}; - -fs.Stats.prototype.isBlockDevice = function() { - return this._checkModeProperty(constants.S_IFBLK); -}; - -fs.Stats.prototype.isCharacterDevice = function() { - return this._checkModeProperty(constants.S_IFCHR); -}; - -fs.Stats.prototype.isSymbolicLink = function() { - return this._checkModeProperty(constants.S_IFLNK); -}; - -fs.Stats.prototype.isFIFO = function() { - return this._checkModeProperty(constants.S_IFIFO); -}; - -fs.Stats.prototype.isSocket = function() { - return this._checkModeProperty(constants.S_IFSOCK); -}; - -fs.exists = function(path, callback) { - if (!nullCheck(path, cb)) return; - binding.stat(pathModule._makeLong(path), cb); - function cb(err, stats) { - if (callback) callback(err ? false : true); - } -}; - -fs.existsSync = function(path) { - try { - nullCheck(path); - binding.stat(pathModule._makeLong(path)); - return true; - } catch (e) { - return false; - } -}; - -fs.readFile = function(path, encoding_) { - var encoding = typeof(encoding_) === 'string' ? encoding_ : null; - var callback = maybeCallback(arguments[arguments.length - 1]); - - assertEncoding(encoding); - - // first, stat the file, so we know the size. - var size; - var buffer; // single buffer with file data - var buffers; // list for when size is unknown - var pos = 0; - var fd; - - fs.open(path, constants.O_RDONLY, 438 /*=0666*/, function(er, fd_) { - if (er) return callback(er); - fd = fd_; - - fs.fstat(fd, function(er, st) { - if (er) return callback(er); - size = st.size; - if (size === 0) { - // the kernel lies about many files. - // Go ahead and try to read some bytes. - buffers = []; - return read(); - } - - buffer = new Buffer(size); - read(); - }); - }); - - function read() { - if (size === 0) { - buffer = new Buffer(8192); - fs.read(fd, buffer, 0, 8192, -1, afterRead); - } else { - fs.read(fd, buffer, pos, size - pos, -1, afterRead); - } - } - - function afterRead(er, bytesRead) { - if (er) { - return fs.close(fd, function(er2) { - return callback(er); - }); - } - - if (bytesRead === 0) { - return close(); - } - - pos += bytesRead; - if (size !== 0) { - if (pos === size) close(); - else read(); - } else { - // unknown size, just read until we don't get bytes. - buffers.push(buffer.slice(0, bytesRead)); - read(); - } - } - - function close() { - fs.close(fd, function(er) { - if (size === 0) { - // collected the data into the buffers list. - buffer = Buffer.concat(buffers, pos); - } else if (pos < size) { - buffer = buffer.slice(0, pos); - } - - if (encoding) buffer = buffer.toString(encoding); - return callback(er, buffer); - }); - } -}; - -fs.readFileSync = function(path, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, constants.O_RDONLY, 438 /*=0666*/); - - var size; - var threw = true; - try { - size = fs.fstatSync(fd).size; - threw = false; - } finally { - if (threw) fs.closeSync(fd); - } - - var pos = 0; - var buffer; // single buffer with file data - var buffers; // list for when size is unknown - - if (size === 0) { - buffers = []; - } else { - buffer = new Buffer(size); - } - - var done = false; - while (!done) { - var threw = true; - try { - if (size !== 0) { - var bytesRead = fs.readSync(fd, buffer, pos, size - pos); - } else { - // the kernel lies about many files. - // Go ahead and try to read some bytes. - buffer = new Buffer(8192); - var bytesRead = fs.readSync(fd, buffer, 0, 8192); - if (bytesRead) { - buffers.push(buffer.slice(0, bytesRead)); - } - } - threw = false; - } finally { - if (threw) fs.closeSync(fd); - } - - pos += bytesRead; - done = (bytesRead === 0) || (size !== 0 && pos >= size); - } - - fs.closeSync(fd); - - if (size === 0) { - // data was collected into the buffers list. - buffer = Buffer.concat(buffers, pos); - } else if (pos < size) { - buffer = buffer.slice(0, pos); - } - - if (encoding) buffer = buffer.toString(encoding); - return buffer; -}; - - -// Used by binding.open and friends -function stringToFlags(flag) { - // Only mess with strings - if (typeof flag !== 'string') { - return flag; - } - - // O_EXCL is mandated by POSIX, Windows supports it too. - // Let's add a check anyway, just in case. - if (!O_EXCL && ~flag.indexOf('x')) { - throw errnoException('ENOSYS', 'fs.open(O_EXCL)'); - } - - switch (flag) { - case 'r' : return O_RDONLY; - case 'rs' : return O_RDONLY | O_SYNC; - case 'r+' : return O_RDWR; - case 'rs+' : return O_RDWR | O_SYNC; - - case 'w' : return O_TRUNC | O_CREAT | O_WRONLY; - case 'wx' : // fall through - case 'xw' : return O_TRUNC | O_CREAT | O_WRONLY | O_EXCL; - - case 'w+' : return O_TRUNC | O_CREAT | O_RDWR; - case 'wx+': // fall through - case 'xw+': return O_TRUNC | O_CREAT | O_RDWR | O_EXCL; - - case 'a' : return O_APPEND | O_CREAT | O_WRONLY; - case 'ax' : // fall through - case 'xa' : return O_APPEND | O_CREAT | O_WRONLY | O_EXCL; - - case 'a+' : return O_APPEND | O_CREAT | O_RDWR; - case 'ax+': // fall through - case 'xa+': return O_APPEND | O_CREAT | O_RDWR | O_EXCL; - } - - throw new Error('Unknown file open flag: ' + flag); -} - -// exported but hidden, only used by test/simple/test-fs-open-flags.js -Object.defineProperty(exports, '_stringToFlags', { - enumerable: false, - value: stringToFlags -}); - - -// Yes, the follow could be easily DRYed up but I provide the explicit -// list to make the arguments clear. - -fs.close = function(fd, callback) { - binding.close(fd, makeCallback(callback)); -}; - -fs.closeSync = function(fd) { - return binding.close(fd); -}; - -function modeNum(m, def) { - switch (typeof m) { - case 'number': return m; - case 'string': return parseInt(m, 8); - default: - if (def) { - return modeNum(def); - } else { - return undefined; - } - } -} - -fs.open = function(path, flags, mode, callback) { - callback = makeCallback(arguments[arguments.length - 1]); - mode = modeNum(mode, 438 /*=0666*/); - - if (!nullCheck(path, callback)) return; - binding.open(pathModule._makeLong(path), - stringToFlags(flags), - mode, - callback); -}; - -fs.openSync = function(path, flags, mode) { - mode = modeNum(mode, 438 /*=0666*/); - nullCheck(path); - return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); -}; - -fs.read = function(fd, buffer, offset, length, position, callback) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, length, position, encoding, callback) - var cb = arguments[4], - encoding = arguments[3]; - - assertEncoding(encoding); - - position = arguments[2]; - length = arguments[1]; - buffer = new Buffer(length); - offset = 0; - - callback = function(err, bytesRead) { - if (!cb) return; - - var str = (bytesRead > 0) ? buffer.toString(encoding, 0, bytesRead) : ''; - - (cb)(err, str, bytesRead); - }; - } - - function wrapper(err, bytesRead) { - // Retain a reference to buffer so that it can't be GC'ed too soon. - callback && callback(err, bytesRead || 0, buffer); - } - - binding.read(fd, buffer, offset, length, position, wrapper); -}; - -fs.readSync = function(fd, buffer, offset, length, position) { - var legacy = false; - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, length, position, encoding, callback) - legacy = true; - var encoding = arguments[3]; - - assertEncoding(encoding); - - position = arguments[2]; - length = arguments[1]; - buffer = new Buffer(length); - - offset = 0; - } - - var r = binding.read(fd, buffer, offset, length, position); - if (!legacy) { - return r; - } - - var str = (r > 0) ? buffer.toString(encoding, 0, r) : ''; - return [str, r]; -}; - -fs.write = function(fd, buffer, offset, length, position, callback) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, data, position, encoding, callback) - callback = arguments[4]; - position = arguments[2]; - assertEncoding(arguments[3]); - - buffer = new Buffer('' + arguments[1], arguments[3]); - offset = 0; - length = buffer.length; - } - - if (!length) { - if (typeof callback == 'function') { - process.nextTick(function() { - callback(undefined, 0); - }); - } - return; - } - - callback = maybeCallback(callback); - - function wrapper(err, written) { - // Retain a reference to buffer so that it can't be GC'ed too soon. - callback(err, written || 0, buffer); - } - - binding.write(fd, buffer, offset, length, position, wrapper); -}; - -fs.writeSync = function(fd, buffer, offset, length, position) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, data, position, encoding) - position = arguments[2]; - assertEncoding(arguments[3]); - - buffer = new Buffer('' + arguments[1], arguments[3]); - offset = 0; - length = buffer.length; - } - if (!length) return 0; - - return binding.write(fd, buffer, offset, length, position); -}; - -fs.rename = function(oldPath, newPath, callback) { - callback = makeCallback(callback); - if (!nullCheck(oldPath, callback)) return; - if (!nullCheck(newPath, callback)) return; - binding.rename(pathModule._makeLong(oldPath), - pathModule._makeLong(newPath), - callback); -}; - -fs.renameSync = function(oldPath, newPath) { - nullCheck(oldPath); - nullCheck(newPath); - return binding.rename(pathModule._makeLong(oldPath), - pathModule._makeLong(newPath)); -}; - -fs.truncate = function(path, len, callback) { - if (typeof path === 'number') { - // legacy - return fs.ftruncate(path, len, callback); - } - if (typeof len === 'function') { - callback = len; - len = 0; - } else if (typeof len === 'undefined') { - len = 0; - } - callback = maybeCallback(callback); - fs.open(path, 'w', function(er, fd) { - if (er) return callback(er); - binding.ftruncate(fd, len, function(er) { - fs.close(fd, function(er2) { - callback(er || er2); - }); - }); - }); -}; - -fs.truncateSync = function(path, len) { - if (typeof path === 'number') { - // legacy - return fs.ftruncateSync(path, len); - } - if (typeof len === 'undefined') { - len = 0; - } - // allow error to be thrown, but still close fd. - var fd = fs.openSync(path, 'w'); - try { - var ret = fs.ftruncateSync(fd, len); - } finally { - fs.closeSync(fd); - } - return ret; -}; - -fs.ftruncate = function(fd, len, callback) { - if (typeof len === 'function') { - callback = len; - len = 0; - } else if (typeof len === 'undefined') { - len = 0; - } - binding.ftruncate(fd, len, makeCallback(callback)); -}; - -fs.ftruncateSync = function(fd, len) { - if (typeof len === 'undefined') { - len = 0; - } - return binding.ftruncate(fd, len); -}; - -fs.rmdir = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.rmdir(pathModule._makeLong(path), callback); -}; - -fs.rmdirSync = function(path) { - nullCheck(path); - return binding.rmdir(pathModule._makeLong(path)); -}; - -fs.fdatasync = function(fd, callback) { - binding.fdatasync(fd, makeCallback(callback)); -}; - -fs.fdatasyncSync = function(fd) { - return binding.fdatasync(fd); -}; - -fs.fsync = function(fd, callback) { - binding.fsync(fd, makeCallback(callback)); -}; - -fs.fsyncSync = function(fd) { - return binding.fsync(fd); -}; - -fs.mkdir = function(path, mode, callback) { - if (typeof mode === 'function') callback = mode; - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.mkdir(pathModule._makeLong(path), - modeNum(mode, 511 /*=0777*/), - callback); -}; - -fs.mkdirSync = function(path, mode) { - nullCheck(path); - return binding.mkdir(pathModule._makeLong(path), - modeNum(mode, 511 /*=0777*/)); -}; - -fs.sendfile = function(outFd, inFd, inOffset, length, callback) { - binding.sendfile(outFd, inFd, inOffset, length, makeCallback(callback)); -}; - -fs.sendfileSync = function(outFd, inFd, inOffset, length) { - return binding.sendfile(outFd, inFd, inOffset, length); -}; - -fs.readdir = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.readdir(pathModule._makeLong(path), callback); -}; - -fs.readdirSync = function(path) { - nullCheck(path); - return binding.readdir(pathModule._makeLong(path)); -}; - -fs.fstat = function(fd, callback) { - binding.fstat(fd, makeCallback(callback)); -}; - -fs.lstat = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.lstat(pathModule._makeLong(path), callback); -}; - -fs.stat = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.stat(pathModule._makeLong(path), callback); -}; - -fs.fstatSync = function(fd) { - return binding.fstat(fd); -}; - -fs.lstatSync = function(path) { - nullCheck(path); - return binding.lstat(pathModule._makeLong(path)); -}; - -fs.statSync = function(path) { - nullCheck(path); - return binding.stat(pathModule._makeLong(path)); -}; - -fs.readlink = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.readlink(pathModule._makeLong(path), callback); -}; - -fs.readlinkSync = function(path) { - nullCheck(path); - return binding.readlink(pathModule._makeLong(path)); -}; - -function preprocessSymlinkDestination(path, type) { - if (!isWindows) { - // No preprocessing is needed on Unix. - return path; - } else if (type === 'junction') { - // Junctions paths need to be absolute and \\?\-prefixed. - return pathModule._makeLong(path); - } else { - // Windows symlinks don't tolerate forward slashes. - return ('' + path).replace(/\//g, '\\'); - } -} - -fs.symlink = function(destination, path, type_, callback) { - var type = (typeof type_ === 'string' ? type_ : null); - var callback = makeCallback(arguments[arguments.length - 1]); - - if (!nullCheck(destination, callback)) return; - if (!nullCheck(path, callback)) return; - - binding.symlink(preprocessSymlinkDestination(destination, type), - pathModule._makeLong(path), - type, - callback); -}; - -fs.symlinkSync = function(destination, path, type) { - type = (typeof type === 'string' ? type : null); - - nullCheck(destination); - nullCheck(path); - - return binding.symlink(preprocessSymlinkDestination(destination, type), - pathModule._makeLong(path), - type); -}; - -fs.link = function(srcpath, dstpath, callback) { - callback = makeCallback(callback); - if (!nullCheck(srcpath, callback)) return; - if (!nullCheck(dstpath, callback)) return; - - binding.link(pathModule._makeLong(srcpath), - pathModule._makeLong(dstpath), - callback); -}; - -fs.linkSync = function(srcpath, dstpath) { - nullCheck(srcpath); - nullCheck(dstpath); - return binding.link(pathModule._makeLong(srcpath), - pathModule._makeLong(dstpath)); -}; - -fs.unlink = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.unlink(pathModule._makeLong(path), callback); -}; - -fs.unlinkSync = function(path) { - nullCheck(path); - return binding.unlink(pathModule._makeLong(path)); -}; - -fs.fchmod = function(fd, mode, callback) { - binding.fchmod(fd, modeNum(mode), makeCallback(callback)); -}; - -fs.fchmodSync = function(fd, mode) { - return binding.fchmod(fd, modeNum(mode)); -}; - -if (constants.hasOwnProperty('O_SYMLINK')) { - fs.lchmod = function(path, mode, callback) { - callback = maybeCallback(callback); - fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, 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); - - // 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; - }; -} - - -fs.chmod = function(path, mode, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.chmod(pathModule._makeLong(path), - modeNum(mode), - callback); -}; - -fs.chmodSync = function(path, mode) { - nullCheck(path); - return binding.chmod(pathModule._makeLong(path), modeNum(mode)); -}; - -if (constants.hasOwnProperty('O_SYMLINK')) { - fs.lchown = function(path, uid, gid, callback) { - callback = maybeCallback(callback); - fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, function(err, fd) { - if (err) { - callback(err); - return; - } - fs.fchown(fd, uid, gid, callback); - }); - }; - - fs.lchownSync = function(path, uid, gid) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK); - return fs.fchownSync(fd, uid, gid); - }; -} - -fs.fchown = function(fd, uid, gid, callback) { - binding.fchown(fd, uid, gid, makeCallback(callback)); -}; - -fs.fchownSync = function(fd, uid, gid) { - return binding.fchown(fd, uid, gid); -}; - -fs.chown = function(path, uid, gid, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.chown(pathModule._makeLong(path), uid, gid, callback); -}; - -fs.chownSync = function(path, uid, gid) { - nullCheck(path); - return binding.chown(pathModule._makeLong(path), uid, gid); -}; - -// converts Date or number to a fractional UNIX timestamp -function toUnixTimestamp(time) { - if (typeof time == 'number') { - return time; - } - if (time instanceof Date) { - // convert to 123.456 UNIX timestamp - return time.getTime() / 1000; - } - throw new Error('Cannot parse time: ' + time); -} - -// exported for unit tests, not for public consumption -fs._toUnixTimestamp = toUnixTimestamp; - -fs.utimes = function(path, atime, mtime, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.utimes(pathModule._makeLong(path), - toUnixTimestamp(atime), - toUnixTimestamp(mtime), - callback); -}; - -fs.utimesSync = function(path, atime, mtime) { - nullCheck(path); - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.utimes(pathModule._makeLong(path), atime, mtime); -}; - -fs.futimes = function(fd, atime, mtime, callback) { - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.futimes(fd, atime, mtime, makeCallback(callback)); -}; - -fs.futimesSync = function(fd, atime, mtime) { - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.futimes(fd, atime, mtime); -}; - -function writeAll(fd, buffer, offset, length, position, callback) { - callback = maybeCallback(arguments[arguments.length - 1]); - - // write(fd, buffer, offset, length, position, callback) - fs.write(fd, buffer, offset, length, position, function(writeErr, written) { - if (writeErr) { - fs.close(fd, function() { - if (callback) callback(writeErr); - }); - } else { - if (written === length) { - fs.close(fd, callback); - } else { - offset += written; - length -= written; - position += written; - writeAll(fd, buffer, offset, length, position, callback); - } - } - }); -} - -fs.writeFile = function(path, data, encoding_, callback) { - var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8'); - assertEncoding(encoding); - - callback = maybeCallback(arguments[arguments.length - 1]); - fs.open(path, 'w', 438 /*=0666*/, function(openErr, fd) { - if (openErr) { - if (callback) callback(openErr); - } else { - var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data, - encoding); - writeAll(fd, buffer, 0, buffer.length, 0, callback); - } - }); -}; - -fs.writeFileSync = function(path, data, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, 'w'); - if (!Buffer.isBuffer(data)) { - data = new Buffer('' + data, encoding || 'utf8'); - } - var written = 0; - var length = data.length; - try { - while (written < length) { - written += fs.writeSync(fd, data, written, length - written, written); - } - } finally { - fs.closeSync(fd); - } -}; - -fs.appendFile = function(path, data, encoding_, callback) { - var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8'); - assertEncoding(encoding); - - callback = maybeCallback(arguments[arguments.length - 1]); - - fs.open(path, 'a', 438 /*=0666*/, function(err, fd) { - if (err) return callback(err); - var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data, encoding); - writeAll(fd, buffer, 0, buffer.length, null, callback); - }); -}; - -fs.appendFileSync = function(path, data, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, 'a'); - if (!Buffer.isBuffer(data)) { - data = new Buffer('' + data, encoding || 'utf8'); - } - var written = 0; - var position = null; - var length = data.length; - - try { - while (written < length) { - written += fs.writeSync(fd, data, written, length - written, position); - position += written; // XXX not safe with multiple concurrent writers? - } - } finally { - fs.closeSync(fd); - } -}; - -function errnoException(errorno, syscall) { - // TODO make this more compatible with ErrnoException from src/node.cc - // Once all of Node is using this function the ErrnoException from - // src/node.cc should be removed. - var e = new Error(syscall + ' ' + errorno); - e.errno = e.code = errorno; - e.syscall = syscall; - return e; -} - - -function FSWatcher() { - EventEmitter.call(this); - - var self = this; - var FSEvent = process.binding('fs_event_wrap').FSEvent; - this._handle = new FSEvent(); - this._handle.owner = this; - - this._handle.onchange = function(status, event, filename) { - if (status) { - self._handle.close(); - self.emit('error', errnoException(errno, 'watch')); - } else { - self.emit('change', event, filename); - } - }; -} -util.inherits(FSWatcher, EventEmitter); - -FSWatcher.prototype.start = function(filename, persistent) { - nullCheck(filename); - var r = this._handle.start(pathModule._makeLong(filename), persistent); - - if (r) { - this._handle.close(); - throw errnoException(errno, 'watch'); - } -}; - -FSWatcher.prototype.close = function() { - this._handle.close(); -}; - -fs.watch = function(filename) { - nullCheck(filename); - var watcher; - var options; - var listener; - - if ('object' == typeof arguments[1]) { - options = arguments[1]; - listener = arguments[2]; - } else { - options = {}; - listener = arguments[1]; - } - - if (options.persistent === undefined) options.persistent = true; - - watcher = new FSWatcher(); - watcher.start(filename, options.persistent); - - if (listener) { - watcher.addListener('change', listener); - } - - return watcher; -}; - - -// Stat Change Watchers - -function StatWatcher() { - EventEmitter.call(this); - - var self = this; - this._handle = new binding.StatWatcher(); - - // uv_fs_poll is a little more powerful than ev_stat but we curb it for - // the sake of backwards compatibility - var oldStatus = -1; - - this._handle.onchange = function(current, previous, newStatus) { - if (oldStatus === -1 && - newStatus === -1 && - current.nlink === previous.nlink) return; - - oldStatus = newStatus; - self.emit('change', current, previous); - }; - - this._handle.onstop = function() { - self.emit('stop'); - }; -} -util.inherits(StatWatcher, EventEmitter); - - -StatWatcher.prototype.start = function(filename, persistent, interval) { - nullCheck(filename); - this._handle.start(pathModule._makeLong(filename), persistent, interval); -}; - - -StatWatcher.prototype.stop = function() { - this._handle.stop(); -}; - - -var statWatchers = {}; -function inStatWatchers(filename) { - return Object.prototype.hasOwnProperty.call(statWatchers, filename) && - statWatchers[filename]; -} - - -fs.watchFile = function(filename) { - nullCheck(filename); - var stat; - var listener; - - var options = { - // Poll interval in milliseconds. 5007 is what libev used to use. It's - // a little on the slow side but let's stick with it for now to keep - // behavioral changes to a minimum. - interval: 5007, - persistent: true - }; - - if ('object' == typeof arguments[1]) { - options = util._extend(options, arguments[1]); - listener = arguments[2]; - } else { - listener = arguments[1]; - } - - if (!listener) { - throw new Error('watchFile requires a listener function'); - } - - if (inStatWatchers(filename)) { - stat = statWatchers[filename]; - } else { - stat = statWatchers[filename] = new StatWatcher(); - stat.start(filename, options.persistent, options.interval); - } - stat.addListener('change', listener); - return stat; -}; - -fs.unwatchFile = function(filename, listener) { - nullCheck(filename); - if (!inStatWatchers(filename)) return; - - var stat = statWatchers[filename]; - - if (typeof listener === 'function') { - stat.removeListener('change', listener); - } else { - stat.removeAllListeners('change'); - } - - if (stat.listeners('change').length === 0) { - stat.stop(); - statWatchers[filename] = undefined; - } -}; - -// Realpath -// Not using realpath(2) because it's bad. -// See: http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -fs.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -fs.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; - - - -var pool; - -function allocNewPool() { - pool = new Buffer(kPoolSize); - pool.used = 0; -} - - - -fs.createReadStream = function(path, options) { - return new ReadStream(path, options); -}; - -util.inherits(ReadStream, Readable); -fs.ReadStream = ReadStream; - -function ReadStream(path, options) { - if (!(this instanceof ReadStream)) - return new ReadStream(path, options); - - // a little bit bigger buffer and water marks by default - options = util._extend({ - bufferSize: 64 * 1024, - lowWaterMark: 16 * 1024, - highWaterMark: 64 * 1024 - }, options || {}); - - Readable.call(this, options); - - this.path = path; - this.fd = options.hasOwnProperty('fd') ? options.fd : null; - this.flags = options.hasOwnProperty('flags') ? options.flags : 'r'; - this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ - - this.start = options.hasOwnProperty('start') ? options.start : undefined; - this.end = options.hasOwnProperty('start') ? options.end : undefined; - this.pos = undefined; - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (typeof this.fd !== 'number') - this.open(); - - this.on('end', function() { - this.destroy(); - }); -} - -fs.FileReadStream = fs.ReadStream; // support the legacy name - -ReadStream.prototype.open = function() { - var self = this; - fs.open(this.path, this.flags, this.mode, function(er, fd) { - if (er) { - self.destroy(); - self.emit('error', er); - return; - } - - self.fd = fd; - self.emit('open', fd); - // start the flow of data. - self.read(); - }); -}; - -ReadStream.prototype._read = function(n, cb) { - if (typeof this.fd !== 'number') - return this.once('open', function() { - this._read(n, cb); - }); - - if (this.destroyed) - return; - - if (!pool || pool.length - pool.used < kMinPoolSpace) { - // discard the old pool. Can't add to the free list because - // users might have refernces to slices on it. - pool = null; - allocNewPool(); - } - - // Grab another reference to the pool in the case that while we're - // in the thread pool another read() finishes up the pool, and - // allocates a new one. - var thisPool = pool; - var toRead = Math.min(pool.length - pool.used, n); - var start = pool.used; - - if (this.pos !== undefined) - toRead = Math.min(this.end - this.pos + 1, toRead); - - // already read everything we were supposed to read! - // treat as EOF. - if (toRead <= 0) - return cb(); - - // the actual read. - var self = this; - fs.read(this.fd, pool, pool.used, toRead, this.pos, onread); - - // move the pool positions, and internal position for reading. - if (this.pos !== undefined) - this.pos += toRead; - pool.used += toRead; - - function onread(er, bytesRead) { - if (er) { - self.destroy(); - return cb(er); - } - - var b = null; - if (bytesRead > 0) - b = thisPool.slice(start, start + bytesRead); - - cb(null, b); - } -}; - - -ReadStream.prototype.destroy = function() { - if (this.destroyed) - return; - this.destroyed = true; - if ('number' === typeof this.fd) - this.close(); -}; - - -ReadStream.prototype.close = function(cb) { - if (cb) - this.once('close', cb); - if (this.closed || 'number' !== typeof this.fd) { - if ('number' !== typeof this.fd) - this.once('open', close); - return process.nextTick(this.emit.bind(this, 'close')); - } - this.closed = true; - var self = this; - close(); - - function close() { - fs.close(self.fd, function(er) { - if (er) - self.emit('error', er); - else - self.emit('close'); - }); - } -}; - - - - -fs.createWriteStream = function(path, options) { - return new WriteStream(path, options); -}; - -util.inherits(WriteStream, Writable); -fs.WriteStream = WriteStream; -function WriteStream(path, options) { - if (!(this instanceof WriteStream)) - return new WriteStream(path, options); - - // a little bit bigger buffer and water marks by default - options = util._extend({ - bufferSize: 64 * 1024, - lowWaterMark: 16 * 1024, - highWaterMark: 64 * 1024 - }, options || {}); - - Writable.call(this, options); - - this.path = path; - this.fd = null; - - this.fd = options.hasOwnProperty('fd') ? options.fd : null; - this.flags = options.hasOwnProperty('flags') ? options.flags : 'w'; - this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ - - this.start = options.hasOwnProperty('start') ? options.start : undefined; - this.pos = undefined; - this.bytesWritten = 0; - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - if ('number' !== typeof this.fd) - this.open(); - - // dispose on finish. - this.once('finish', this.close); -} - -fs.FileWriteStream = fs.WriteStream; // support the legacy name - - -WriteStream.prototype.open = function() { - fs.open(this.path, this.flags, this.mode, function(er, fd) { - if (er) { - this.destroy(); - this.emit('error', er); - return; - } - - this.fd = fd; - this.emit('open', fd); - }.bind(this)); -}; - - -WriteStream.prototype._write = function(data, cb) { - if (!Buffer.isBuffer(data)) - return this.emit('error', new Error('Invalid data')); - - if (typeof this.fd !== 'number') - return this.once('open', this._write.bind(this, data, cb)); - - fs.write(this.fd, data, 0, data.length, this.pos, function(er, bytes) { - if (er) { - this.destroy(); - return cb(er); - } - this.bytesWritten += bytes; - cb(); - }.bind(this)); - - if (this.pos !== undefined) - this.pos += data.length; -}; - - -WriteStream.prototype.destroy = ReadStream.prototype.destroy; -WriteStream.prototype.close = ReadStream.prototype.close; - -// There is no shutdown() for files. -WriteStream.prototype.destroySoon = WriteStream.prototype.end; - - -// SyncWriteStream is internal. DO NOT USE. -// Temporary hack for process.stdout and process.stderr when piped to files. -function SyncWriteStream(fd) { - Stream.call(this); - - this.fd = fd; - this.writable = true; - this.readable = false; -} - -util.inherits(SyncWriteStream, Stream); - - -// Export -fs.SyncWriteStream = SyncWriteStream; - - -SyncWriteStream.prototype.write = function(data, arg1, arg2) { - var encoding, cb; - - // parse arguments - if (arg1) { - if (typeof arg1 === 'string') { - encoding = arg1; - cb = arg2; - } else if (typeof arg1 === 'function') { - cb = arg1; - } else { - throw new Error('bad arg'); - } - } - assertEncoding(encoding); - - // Change strings to buffers. SLOW - if (typeof data == 'string') { - data = new Buffer(data, encoding); - } - - fs.writeSync(this.fd, data, 0, data.length); - - if (cb) { - process.nextTick(cb); - } - - return true; -}; - - -SyncWriteStream.prototype.end = function(data, arg1, arg2) { - if (data) { - this.write(data, arg1, arg2); - } - this.destroy(); -}; - - -SyncWriteStream.prototype.destroy = function() { - fs.closeSync(this.fd); - this.fd = null; - this.emit('close'); - return true; -}; - -SyncWriteStream.prototype.destroySoon = SyncWriteStream.prototype.destroy; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a2e0d8e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,69 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 330c247..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 3c9da08..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,927 +0,0 @@ -// 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.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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index f08b05e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,205 +0,0 @@ -// 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 && 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 56ca47d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,367 +0,0 @@ -// 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); - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - state.needDrain = !ret; - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json deleted file mode 100644 index 76f822e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "readable-stream", - "version": "1.0.17", - "description": "An exploration of a new kind of readable streams for Node.js", - "main": "readable.js", - "dependencies": {}, - "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" - }, - "_id": "readable-stream@1.0.17", - "_from": "readable-stream@~1.0.2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js deleted file mode 100644 index 4d1ddfc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,6 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js deleted file mode 100644 index 1dec2e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js +++ /dev/null @@ -1,191 +0,0 @@ -// 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 path = require('path'); -var assert = require('assert'); - -exports.testDir = path.dirname(__filename); -exports.fixturesDir = path.join(exports.testDir, 'fixtures'); -exports.libDir = path.join(exports.testDir, '../lib'); -exports.tmpDir = path.join(exports.testDir, 'tmp'); -exports.PORT = 12346; - -if (process.platform === 'win32') { - exports.PIPE = '\\\\.\\pipe\\libuv-test'; -} else { - exports.PIPE = exports.tmpDir + '/test.sock'; -} - -var util = require('util'); -for (var i in util) exports[i] = util[i]; -//for (var i in exports) global[i] = exports[i]; - -function protoCtrChain(o) { - var result = []; - for (; o; o = o.__proto__) { result.push(o.constructor); } - return result.join(); -} - -exports.indirectInstanceOf = function(obj, cls) { - if (obj instanceof cls) { return true; } - var clsChain = protoCtrChain(cls.prototype); - var objChain = protoCtrChain(obj); - return objChain.slice(-clsChain.length) === clsChain; -}; - - -exports.ddCommand = function(filename, kilobytes) { - if (process.platform === 'win32') { - var p = path.resolve(exports.fixturesDir, 'create-file.js'); - return '"' + process.argv[0] + '" "' + p + '" "' + - filename + '" ' + (kilobytes * 1024); - } else { - return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes; - } -}; - - -exports.spawnPwd = function(options) { - var spawn = require('child_process').spawn; - - if (process.platform === 'win32') { - return spawn('cmd.exe', ['/c', 'cd'], options); - } else { - return spawn('pwd', [], options); - } -}; - - -// Turn this off if the test should not check for global leaks. -exports.globalCheck = true; - -process.on('exit', function() { - if (!exports.globalCheck) return; - var knownGlobals = [setTimeout, - setInterval, - global.setImmediate, - clearTimeout, - clearInterval, - global.clearImmediate, - console, - Buffer, - process, - global]; - - if (global.errno) { - knownGlobals.push(errno); - } - - if (global.gc) { - knownGlobals.push(gc); - } - - if (global.DTRACE_HTTP_SERVER_RESPONSE) { - knownGlobals.push(DTRACE_HTTP_SERVER_RESPONSE); - knownGlobals.push(DTRACE_HTTP_SERVER_REQUEST); - knownGlobals.push(DTRACE_HTTP_CLIENT_RESPONSE); - knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST); - knownGlobals.push(DTRACE_NET_STREAM_END); - knownGlobals.push(DTRACE_NET_SERVER_CONNECTION); - knownGlobals.push(DTRACE_NET_SOCKET_READ); - knownGlobals.push(DTRACE_NET_SOCKET_WRITE); - } - if (global.COUNTER_NET_SERVER_CONNECTION) { - knownGlobals.push(COUNTER_NET_SERVER_CONNECTION); - knownGlobals.push(COUNTER_NET_SERVER_CONNECTION_CLOSE); - knownGlobals.push(COUNTER_HTTP_SERVER_REQUEST); - knownGlobals.push(COUNTER_HTTP_SERVER_RESPONSE); - knownGlobals.push(COUNTER_HTTP_CLIENT_REQUEST); - knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE); - } - - if (global.ArrayBuffer) { - knownGlobals.push(ArrayBuffer); - knownGlobals.push(Int8Array); - knownGlobals.push(Uint8Array); - knownGlobals.push(Uint8ClampedArray); - knownGlobals.push(Int16Array); - knownGlobals.push(Uint16Array); - knownGlobals.push(Int32Array); - knownGlobals.push(Uint32Array); - knownGlobals.push(Float32Array); - knownGlobals.push(Float64Array); - knownGlobals.push(DataView); - } - - for (var x in global) { - var found = false; - - for (var y in knownGlobals) { - if (global[x] === knownGlobals[y]) { - found = true; - break; - } - } - - if (!found) { - console.error('Unknown global: %s', x); - assert.ok(false, 'Unknown global found'); - } - } -}); - - -var mustCallChecks = []; - - -function runCallChecks() { - var failed = mustCallChecks.filter(function(context) { - return context.actual !== context.expected; - }); - - failed.forEach(function(context) { - console.log('Mismatched %s function calls. Expected %d, actual %d.', - context.name, - context.expected, - context.actual); - console.log(context.stack.split('\n').slice(2).join('\n')); - }); - - if (failed.length) process.exit(1); -} - - -exports.mustCall = function(fn, expected) { - if (typeof expected !== 'number') expected = 1; - - var context = { - expected: expected, - actual: 0, - stack: (new Error).stack, - name: fn.name || '' - }; - - // add the exit listener only once to avoid listener leak warnings - if (mustCallChecks.length === 0) process.on('exit', runCallChecks); - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt deleted file mode 100644 index c6a9d2f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt +++ /dev/null @@ -1 +0,0 @@ -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js deleted file mode 100644 index edc3811..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js +++ /dev/null @@ -1,475 +0,0 @@ -// 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 common = require('../common.js'); -var R = require('../../lib/_stream_readable'); -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - -function TestReader(n) { - R.apply(this); - this._buffer = new Buffer(n || 100); - this._buffer.fill('x'); - this._pos = 0; - this._bufs = 10; -} - -util.inherits(TestReader, R); - -TestReader.prototype.read = function(n) { - if (n === 0) return null; - var max = this._buffer.length - this._pos; - n = n || max; - n = Math.max(n, 0); - var toRead = Math.min(n, max); - if (toRead === 0) { - // simulate the read buffer filling up with some more bytes some time - // in the future. - setTimeout(function() { - this._pos = 0; - this._bufs -= 1; - if (this._bufs <= 0) { - // read them all! - if (!this.ended) { - this.emit('end'); - this.ended = true; - } - } else { - this.emit('readable'); - } - }.bind(this), 10); - return null; - } - - var ret = this._buffer.slice(this._pos, this._pos + toRead); - this._pos += toRead; - return ret; -}; - -///// - -function TestWriter() { - EE.apply(this); - this.received = []; - this.flush = false; -} - -util.inherits(TestWriter, EE); - -TestWriter.prototype.write = function(c) { - this.received.push(c.toString()); - this.emit('write', c); - return true; -}; - -TestWriter.prototype.end = function(c) { - if (c) this.write(c); - this.emit('end', this.received); -}; - -//////// - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - ok: assert, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - - -test('a most basic test', function(t) { - var r = new TestReader(20); - - var reads = []; - var expect = [ 'x', - 'xx', - 'xxx', - 'xxxx', - 'xxxxx', - 'xxxxx', - 'xxxxxxxx', - 'xxxxxxxxx', - 'xxx', - 'xxxxxxxxxxxx', - 'xxxxxxxx', - 'xxxxxxxxxxxxxxx', - 'xxxxx', - 'xxxxxxxxxxxxxxxxxx', - 'xx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx' ]; - - r.on('end', function() { - t.same(reads, expect); - t.end(); - }); - - var readSize = 1; - function flow() { - var res; - while (null !== (res = r.read(readSize++))) { - reads.push(res.toString()); - } - r.once('readable', flow); - } - - flow(); -}); - -test('pipe', function(t) { - var r = new TestReader(5); - - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ] - - var w = new TestWriter; - var flush = true; - - w.on('end', function(received) { - t.same(received, expect); - t.end(); - }); - - r.pipe(w); -}); - - - -[1,2,3,4,5,6,7,8,9].forEach(function(SPLIT) { - test('unpipe', function(t) { - var r = new TestReader(5); - - // unpipe after 3 writes, then write to another stream instead. - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - expect = [ expect.slice(0, SPLIT), expect.slice(SPLIT) ]; - - var w = [ new TestWriter(), new TestWriter() ]; - - var writes = SPLIT; - w[0].on('write', function() { - if (--writes === 0) { - r.unpipe(); - t.equal(r._readableState.pipes, null); - w[0].end(); - r.pipe(w[1]); - t.equal(r._readableState.pipes, w[1]); - } - }); - - var ended = 0; - - var ended0 = false; - var ended1 = false; - w[0].on('end', function(results) { - t.equal(ended0, false); - ended0 = true; - ended++; - t.same(results, expect[0]); - }); - - w[1].on('end', function(results) { - t.equal(ended1, false); - ended1 = true; - ended++; - t.equal(ended, 2); - t.same(results, expect[1]); - t.end(); - }); - - r.pipe(w[0]); - }); -}); - - -// both writers should get the same exact data. -test('multipipe', function(t) { - var r = new TestReader(5); - var w = [ new TestWriter, new TestWriter ]; - - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - - var c = 2; - w[0].on('end', function(received) { - t.same(received, expect, 'first'); - if (--c === 0) t.end(); - }); - w[1].on('end', function(received) { - t.same(received, expect, 'second'); - if (--c === 0) t.end(); - }); - - r.pipe(w[0]); - r.pipe(w[1]); -}); - - -[1,2,3,4,5,6,7,8,9].forEach(function(SPLIT) { - test('multi-unpipe', function(t) { - var r = new TestReader(5); - - // unpipe after 3 writes, then write to another stream instead. - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - expect = [ expect.slice(0, SPLIT), expect.slice(SPLIT) ]; - - var w = [ new TestWriter(), new TestWriter(), new TestWriter() ]; - - var writes = SPLIT; - w[0].on('write', function() { - if (--writes === 0) { - r.unpipe(); - w[0].end(); - r.pipe(w[1]); - } - }); - - var ended = 0; - - w[0].on('end', function(results) { - ended++; - t.same(results, expect[0]); - }); - - w[1].on('end', function(results) { - ended++; - t.equal(ended, 2); - t.same(results, expect[1]); - t.end(); - }); - - r.pipe(w[0]); - r.pipe(w[2]); - }); -}); - -test('back pressure respected', function (t) { - function noop() {} - - var r = new R({ objectMode: true }); - r._read = noop; - var counter = 0; - r.push(["one"]); - r.push(["two"]); - r.push(["three"]); - r.push(["four"]); - r.push(null); - - var w1 = new R(); - w1.write = function (chunk) { - assert.equal(chunk[0], "one"); - w1.emit("close"); - process.nextTick(function () { - r.pipe(w2); - r.pipe(w3); - }) - }; - w1.end = noop; - - r.pipe(w1); - - var expected = ["two", "two", "three", "three", "four", "four"]; - - var w2 = new R(); - w2.write = function (chunk) { - assert.equal(chunk[0], expected.shift()); - assert.equal(counter, 0); - - counter++; - - if (chunk[0] === "four") { - return true; - } - - setTimeout(function () { - counter--; - w2.emit("drain"); - }, 10); - - return false; - } - w2.end = noop; - - var w3 = new R(); - w3.write = function (chunk) { - assert.equal(chunk[0], expected.shift()); - assert.equal(counter, 1); - - counter++; - - if (chunk[0] === "four") { - return true; - } - - setTimeout(function () { - counter--; - w3.emit("drain"); - }, 50); - - return false; - }; - w3.end = function () { - assert.equal(counter, 2); - assert.equal(expected.length, 0); - t.end(); - }; -}); - -test('read(0) for ended streams', function (t) { - var r = new R(); - var written = false; - var ended = false; - r._read = function (n) {}; - - r.push(new Buffer("foo")); - r.push(null); - - var v = r.read(0); - - assert.equal(v, null); - - var w = new R(); - - w.write = function (buffer) { - written = true; - assert.equal(ended, false); - assert.equal(buffer.toString(), "foo") - }; - - w.end = function () { - ended = true; - assert.equal(written, true); - t.end(); - }; - - r.pipe(w); -}) - -test('sync _read ending', function (t) { - var r = new R(); - var called = false; - r._read = function (n) { - r.push(null); - }; - - r.once('end', function () { - called = true; - }) - - r.read(); - - process.nextTick(function () { - assert.equal(called, true); - t.end(); - }) -}); - -test('adding readable triggers data flow', function(t) { - var r = new R({ highWaterMark: 5 }); - var onReadable = false; - var readCalled = 0; - - r._read = function(n) { - if (readCalled++ === 2) - r.push(null); - else - r.push(new Buffer('asdf')); - }; - - var called = false; - r.on('readable', function() { - onReadable = true; - r.read(); - }); - - r.on('end', function() { - t.equal(readCalled, 3); - t.ok(onReadable); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js deleted file mode 100644 index 4de76b5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js +++ /dev/null @@ -1,50 +0,0 @@ -// 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 common = require('../common.js'); -var R = require('../../lib/_stream_readable'); -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - -var ondataCalled = 0; - -function TestReader() { - R.apply(this); - this._buffer = new Buffer(100); - this._buffer.fill('x'); - - this.on('data', function() { - ondataCalled++; - }); -} - -util.inherits(TestReader, R); - -TestReader.prototype._read = function(n) { - this.push(this._buffer); - this._buffer = new Buffer(0); -}; - -var reader = new TestReader(); -assert.equal(ondataCalled, 1); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js deleted file mode 100644 index 6a7e41e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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 common = require('../common.js'); -var stream = require('../../readable'); -var Buffer = require('buffer').Buffer; - -var r = new stream.Readable(); -r._read = function(size) { - r.push(new Buffer(size)); -}; - -var w = new stream.Writable(); -w._write = function(data, encoding, cb) { - cb(null); -}; - -r.pipe(w); - -// This might sound unrealistic, but it happens in net.js. When -// `socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which -// ends the writable side of net.Socket. -w.end(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js deleted file mode 100644 index 6da70e8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js +++ /dev/null @@ -1,82 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); - -// If everything aligns so that you do a read(n) of exactly the -// remaining buffer, then make sure that 'end' still emits. - -var READSIZE = 100; -var PUSHSIZE = 20; -var PUSHCOUNT = 1000; -var HWM = 50; - -var Readable = require('../../readable').Readable; -var r = new Readable({ - highWaterMark: HWM -}); -var rs = r._readableState; - -r._read = push; - -r.on('readable', function() { - console.error('>> readable'); - do { - console.error(' > read(%d)', READSIZE); - var ret = r.read(READSIZE); - console.error(' < %j (%d remain)', ret && ret.length, rs.length); - } while (ret && ret.length === READSIZE); - - console.error('<< after read()', - ret && ret.length, - rs.needReadable, - rs.length); -}); - -var endEmitted = false; -r.on('end', function() { - endEmitted = true; - console.error('end'); -}); - -var pushes = 0; -function push() { - if (pushes > PUSHCOUNT) - return; - - if (pushes++ === PUSHCOUNT) { - console.error(' push(EOF)'); - return r.push(null); - } - - console.error(' push #%d', pushes); - if (r.push(new Buffer(PUSHSIZE))) - setTimeout(push); -} - -// start the flow -var ret = r.read(0); - -process.on('exit', function() { - assert.equal(pushes, PUSHCOUNT + 1); - assert(endEmitted); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js deleted file mode 100644 index cd23539..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js +++ /dev/null @@ -1,348 +0,0 @@ -// 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 common = require('../common.js'); -var Readable = require('../../lib/_stream_readable'); -var Writable = require('../../lib/_stream_writable'); -var assert = require('assert'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function() { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on('exit', function() { - assert.equal(count, 0); -}); - -process.nextTick(run); - -function toArray(callback) { - var stream = new Writable({ objectMode: true }); - var list = []; - stream.write = function(chunk) { - list.push(chunk); - }; - - stream.end = function() { - callback(list); - }; - - return stream; -} - -function fromArray(list) { - var r = new Readable({ objectMode: true }); - r._read = noop; - list.forEach(function(chunk) { - r.push(chunk); - }); - r.push(null); - - return r; -} - -function noop() {} - -test('can read objects from stream', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - var v1 = r.read(); - var v2 = r.read(); - var v3 = r.read(); - - assert.deepEqual(v1, { one: '1' }); - assert.deepEqual(v2, { two: '2' }); - assert.deepEqual(v3, null); - - t.end(); -}); - -test('can pipe objects into stream', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('read(n) is ignored', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - var value = r.read(2); - - assert.deepEqual(value, { one: '1' }); - - t.end(); -}); - -test('can read objects from _read (sync)', function(t) { - var r = new Readable({ objectMode: true }); - var list = [{ one: '1'}, { two: '2' }]; - r._read = function(n) { - var item = list.shift(); - r.push(item || null); - }; - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('can read objects from _read (async)', function(t) { - var r = new Readable({ objectMode: true }); - var list = [{ one: '1'}, { two: '2' }]; - r._read = function(n) { - var item = list.shift(); - process.nextTick(function() { - r.push(item || null); - }); - }; - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('can read strings as objects', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - var list = ['one', 'two', 'three']; - list.forEach(function(str) { - r.push(str); - }); - r.push(null); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, list); - - t.end(); - })); -}); - -test('read(0) for object streams', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - - r.push('foobar'); - r.push(null); - - var v = r.read(0); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, ['foobar']); - - t.end(); - })); -}); - -test('falsey values', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - - r.push(false); - r.push(0); - r.push(''); - r.push(null); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, [false, 0, '']); - - t.end(); - })); -}); - -test('high watermark _read', function(t) { - var r = new Readable({ - highWaterMark: 6, - objectMode: true - }); - var calls = 0; - var list = ['1', '2', '3', '4', '5', '6', '7', '8']; - - r._read = function(n) { - calls++; - }; - - list.forEach(function(c) { - r.push(c); - }); - - var v = r.read(); - - assert.equal(calls, 0); - assert.equal(v, '1'); - - var v2 = r.read(); - - assert.equal(calls, 1); - assert.equal(v2, '2'); - - t.end(); -}); - -test('high watermark push', function(t) { - var r = new Readable({ - highWaterMark: 6, - objectMode: true - }); - r._read = function(n) {}; - for (var i = 0; i < 6; i++) { - var bool = r.push(i); - assert.equal(bool, i === 5 ? false : true); - } - - t.end(); -}); - -test('can write objects to stream', function(t) { - var w = new Writable({ objectMode: true }); - - w._write = function(chunk, encoding, cb) { - assert.deepEqual(chunk, { foo: 'bar' }); - cb(); - }; - - w.on('finish', function() { - t.end(); - }); - - w.write({ foo: 'bar' }); - w.end(); -}); - -test('can write multiple objects to stream', function(t) { - var w = new Writable({ objectMode: true }); - var list = []; - - w._write = function(chunk, encoding, cb) { - list.push(chunk); - cb(); - }; - - w.on('finish', function() { - assert.deepEqual(list, [0, 1, 2, 3, 4]); - - t.end(); - }); - - w.write(0); - w.write(1); - w.write(2); - w.write(3); - w.write(4); - w.end(); -}); - -test('can write strings as objects', function(t) { - var w = new Writable({ - objectMode: true - }); - var list = []; - - w._write = function(chunk, encoding, cb) { - list.push(chunk); - process.nextTick(cb); - }; - - w.on('finish', function() { - assert.deepEqual(list, ['0', '1', '2', '3', '4']); - - t.end(); - }); - - w.write('0'); - w.write('1'); - w.write('2'); - w.write('3'); - w.write('4'); - w.end(); -}); - -test('buffers finish until cb is called', function(t) { - var w = new Writable({ - objectMode: true - }); - var called = false; - - w._write = function(chunk, encoding, cb) { - assert.equal(chunk, 'foo'); - - process.nextTick(function() { - called = true; - cb(); - }); - }; - - w.on('finish', function() { - assert.equal(called, true); - - t.end(); - }); - - w.write('foo'); - w.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js deleted file mode 100644 index 823dae2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js +++ /dev/null @@ -1,105 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); -var stream = require('../../readable'); - -(function testErrorListenerCatches() { - var count = 1000; - - var source = new stream.Readable(); - source._read = function(n) { - n = Math.min(count, n); - count -= n; - source.push(new Buffer(n)); - }; - - var unpipedDest; - source.unpipe = function(dest) { - unpipedDest = dest; - stream.Readable.prototype.unpipe.call(this, dest); - }; - - var dest = new stream.Writable(); - dest._write = function(chunk, encoding, cb) { - cb(); - }; - - source.pipe(dest); - - var gotErr = null; - dest.on('error', function(err) { - gotErr = err; - }); - - var unpipedSource; - dest.on('unpipe', function(src) { - unpipedSource = src; - }); - - var err = new Error('This stream turned into bacon.'); - dest.emit('error', err); - assert.strictEqual(gotErr, err); - assert.strictEqual(unpipedSource, source); - assert.strictEqual(unpipedDest, dest); -})(); - -(function testErrorWithoutListenerThrows() { - var count = 1000; - - var source = new stream.Readable(); - source._read = function(n) { - n = Math.min(count, n); - count -= n; - source.push(new Buffer(n)); - }; - - var unpipedDest; - source.unpipe = function(dest) { - unpipedDest = dest; - stream.Readable.prototype.unpipe.call(this, dest); - }; - - var dest = new stream.Writable(); - dest._write = function(chunk, encoding, cb) { - cb(); - }; - - source.pipe(dest); - - var unpipedSource; - dest.on('unpipe', function(src) { - unpipedSource = src; - }); - - var err = new Error('This stream turned into bacon.'); - - var gotErr = null; - try { - dest.emit('error', err); - } catch (e) { - gotErr = e; - } - assert.strictEqual(gotErr, err); - assert.strictEqual(unpipedSource, source); - assert.strictEqual(unpipedDest, dest); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js deleted file mode 100644 index e85f785..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js +++ /dev/null @@ -1,138 +0,0 @@ -// 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 common = require('../common.js'); -var stream = require('../../readable'); -var Readable = stream.Readable; -var Writable = stream.Writable; -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - - -// a mock thing a bit like the net.Socket/tcp_wrap.handle interaction - -var stream = new Readable({ - highWaterMark: 16, - encoding: 'utf8' -}); - -var source = new EE; - -stream._read = function() { - console.error('stream._read'); - readStart(); -}; - -var ended = false; -stream.on('end', function() { - ended = true; -}); - -source.on('data', function(chunk) { - var ret = stream.push(chunk); - console.error('data', stream._readableState.length); - if (!ret) - readStop(); -}); - -source.on('end', function() { - stream.push(null); -}); - -var reading = false; - -function readStart() { - console.error('readStart'); - reading = true; -} - -function readStop() { - console.error('readStop'); - reading = false; - process.nextTick(function() { - var r = stream.read(); - if (r !== null) - writer.write(r); - }); -} - -var writer = new Writable({ - decodeStrings: false -}); - -var written = []; - -var expectWritten = - [ 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg' ]; - -writer._write = function(chunk, encoding, cb) { - console.error('WRITE %s', chunk); - written.push(chunk); - process.nextTick(cb); -}; - -writer.on('finish', finish); - - -// now emit some chunks. - -var chunk = "asdfg"; - -var set = 0; -readStart(); -data(); -function data() { - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(!reading); - if (set++ < 5) - setTimeout(data, 10); - else - end(); -} - -function finish() { - console.error('finish'); - assert.deepEqual(written, expectWritten); - console.log('ok'); -} - -function end() { - source.emit('end'); - assert(!reading); - writer.end(stream.read()); - setTimeout(function() { - assert(ended); - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js deleted file mode 100644 index 7e86eec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js +++ /dev/null @@ -1,54 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); -var Readable = require('../../readable').Readable; -var r = new Readable(); -var N = 256 * 1024; - -// Go ahead and allow the pathological case for this test. -// Yes, it's an infinite loop, that's the point. -process.maxTickDepth = N + 2; - -var reads = 0; -r._read = function(n) { - var chunk = reads++ === N ? null : new Buffer(1); - r.push(chunk); -}; - -r.on('readable', function onReadable() { - if (!(r._readableState.length % 256)) - console.error('readable', r._readableState.length); - r.read(N * 2); -}); - -var ended = false; -r.on('end', function onEnd() { - ended = true; -}); - -r.read(0); - -process.on('exit', function() { - assert(ended); - console.log('ok'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js deleted file mode 100644 index 1b067f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js +++ /dev/null @@ -1,119 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); - -var Readable = require('../../readable').Readable; - -test1(); -if (!/^v0\.[0-8]\./.test(process.version)) - test2(); - -function test1() { - var r = new Readable(); - - // should not end when we get a Buffer(0) or '' as the _read result - // that just means that there is *temporarily* no data, but to go - // ahead and try again later. - // - // note that this is very unusual. it only works for crypto streams - // because the other side of the stream will call read(0) to cycle - // data through openssl. that's why we set the timeouts to call - // r.read(0) again later, otherwise there is no more work being done - // and the process just exits. - - var buf = new Buffer(5); - buf.fill('x'); - var reads = 5; - r._read = function(n) { - switch (reads--) { - case 0: - return r.push(null); // EOF - case 1: - return r.push(buf); - case 2: - setTimeout(r.read.bind(r, 0), 10); - return r.push(new Buffer(0)); // Not-EOF! - case 3: - setTimeout(r.read.bind(r, 0), 10); - return process.nextTick(function() { - return r.push(new Buffer(0)); - }); - case 4: - setTimeout(r.read.bind(r, 0), 10); - return setTimeout(function() { - return r.push(new Buffer(0)); - }); - case 5: - return setTimeout(function() { - return r.push(buf); - }); - default: - throw new Error('unreachable'); - } - }; - - var results = []; - function flow() { - var chunk; - while (null !== (chunk = r.read())) - results.push(chunk + ''); - } - r.on('readable', flow); - r.on('end', function() { - results.push('EOF'); - }); - flow(); - - process.on('exit', function() { - assert.deepEqual(results, [ 'xxxxx', 'xxxxx', 'EOF' ]); - console.log('ok'); - }); -} - -function test2() { - var r = new Readable({ encoding: 'base64' }); - var reads = 5; - r._read = function(n) { - if (!reads--) - return r.push(null); // EOF - else - return r.push(new Buffer('x')); - }; - - var results = []; - function flow() { - var chunk; - while (null !== (chunk = r.read())) - results.push(chunk + ''); - } - r.on('readable', flow); - r.on('end', function() { - results.push('EOF'); - }); - flow(); - - process.on('exit', function() { - assert.deepEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]); - console.log('ok'); - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js deleted file mode 100644 index 04a96f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js +++ /dev/null @@ -1,120 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var fromList = require('../../lib/_stream_readable')._fromList; - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - - - -test('buffers', function(t) { - // have a length - var len = 16; - var list = [ new Buffer('foog'), - new Buffer('bark'), - new Buffer('bazy'), - new Buffer('kuel') ]; - - // read more than the first element. - var ret = fromList(6, { buffer: list, length: 16 }); - t.equal(ret.toString(), 'foogba'); - - // read exactly the first element. - ret = fromList(2, { buffer: list, length: 10 }); - t.equal(ret.toString(), 'rk'); - - // read less than the first element. - ret = fromList(2, { buffer: list, length: 8 }); - t.equal(ret.toString(), 'ba'); - - // read more than we have. - ret = fromList(100, { buffer: list, length: 6 }); - t.equal(ret.toString(), 'zykuel'); - - // all consumed. - t.same(list, []); - - t.end(); -}); - -test('strings', function(t) { - // have a length - var len = 16; - var list = [ 'foog', - 'bark', - 'bazy', - 'kuel' ]; - - // read more than the first element. - var ret = fromList(6, { buffer: list, length: 16, decoder: true }); - t.equal(ret, 'foogba'); - - // read exactly the first element. - ret = fromList(2, { buffer: list, length: 10, decoder: true }); - t.equal(ret, 'rk'); - - // read less than the first element. - ret = fromList(2, { buffer: list, length: 8, decoder: true }); - t.equal(ret, 'ba'); - - // read more than we have. - ret = fromList(100, { buffer: list, length: 6, decoder: true }); - t.equal(ret, 'zykuel'); - - // all consumed. - t.same(list, []); - - t.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js deleted file mode 100644 index c6cbc7d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); - -var Stream = require('../../readable'); -var Readable = Stream.Readable; - -var r = new Readable(); -var N = 256; -var reads = 0; -r._read = function(n) { - return r.push(++reads === N ? null : new Buffer(1)); -}; - -var rended = false; -r.on('end', function() { - rended = true; -}); - -var w = new Stream(); -w.writable = true; -var writes = 0; -var buffered = 0; -w.write = function(c) { - writes += c.length; - buffered += c.length; - process.nextTick(drain); - return false; -}; - -function drain() { - assert(buffered <= 2); - buffered = 0; - w.emit('drain'); -} - - -var wended = false; -w.end = function() { - wended = true; -}; - -// Just for kicks, let's mess with the drain count. -// This verifies that even if it gets negative in the -// pipe() cleanup function, we'll still function properly. -r.on('readable', function() { - w.emit('drain'); -}); - -r.pipe(w); -process.on('exit', function() { - assert(rended); - assert(wended); - console.error('ok'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js deleted file mode 100644 index c971898..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var Readable = require('../../lib/_stream_readable'); - -var len = 0; -var chunks = new Array(10); -for (var i = 1; i <= 10; i++) { - chunks[i-1] = new Buffer(i); - len += i; -} - -var test = new Readable(); -var n = 0; -test._read = function(size) { - var chunk = chunks[n++]; - setTimeout(function() { - test.push(chunk); - }); -}; - -test.on('end', thrower); -function thrower() { - throw new Error('this should not happen!'); -} - -var bytesread = 0; -test.on('readable', function() { - var b = len - bytesread - 1; - var res = test.read(b); - if (res) { - bytesread += res.length; - console.error('br=%d len=%d', bytesread, len); - setTimeout(next); - } - test.read(0); -}); -test.read(0); - -function next() { - // now let's make 'end' happen - test.removeListener('end', thrower); - - var endEmitted = false; - process.on('exit', function() { - assert(endEmitted, 'end should be emitted by now'); - }); - test.on('end', function() { - endEmitted = true; - }); - - // one to get the last byte - var r = test.read(); - assert(r); - assert.equal(r.length, 1); - r = test.read(); - assert.equal(r, null); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js deleted file mode 100644 index 602acd6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js +++ /dev/null @@ -1,312 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var R = require('../../lib/_stream_readable'); -var util = require('util'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -///// - -util.inherits(TestReader, R); - -function TestReader(n, opts) { - R.call(this, opts); - - this.pos = 0; - this.len = n || 100; -} - -TestReader.prototype._read = function(n) { - setTimeout(function() { - - if (this.pos >= this.len) { - return this.push(null); - } - - n = Math.min(n, this.len - this.pos); - if (n <= 0) { - return this.push(null); - } - - this.pos += n; - var ret = new Buffer(n); - ret.fill('a'); - - console.log("this.push(ret)", ret) - - return this.push(ret); - }.bind(this), 1); -}; - -test('setEncoding utf8', function(t) { - var tr = new TestReader(100); - tr.setEncoding('utf8'); - var out = []; - var expect = - [ 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - - -test('setEncoding hex', function(t) { - var tr = new TestReader(100); - tr.setEncoding('hex'); - var out = []; - var expect = - [ '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('setEncoding hex with read(13)', function(t) { - var tr = new TestReader(100); - tr.setEncoding('hex'); - var out = []; - var expect = - [ "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "16161" ]; - - tr.on('readable', function flow() { - console.log("readable once") - var chunk; - while (null !== (chunk = tr.read(13))) - out.push(chunk); - }); - - tr.on('end', function() { - console.log("END") - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('encoding: utf8', function(t) { - var tr = new TestReader(100, { encoding: 'utf8' }); - var out = []; - var expect = - [ 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - - -test('encoding: hex', function(t) { - var tr = new TestReader(100, { encoding: 'hex' }); - var out = []; - var expect = - [ '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('encoding: hex with read(13)', function(t) { - var tr = new TestReader(100, { encoding: 'hex' }); - var out = []; - var expect = - [ "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "16161" ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(13))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js deleted file mode 100644 index 5804c39..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js +++ /dev/null @@ -1,435 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var PassThrough = require('../../lib/_stream_passthrough'); -var Transform = require('../../lib/_stream_transform'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - ok: assert, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -///// - -test('writable side consumption', function(t) { - var tx = new Transform({ - highWaterMark: 10 - }); - - var transformed = 0; - tx._transform = function(chunk, encoding, cb) { - transformed += chunk.length; - tx.push(chunk); - cb(); - }; - - for (var i = 1; i <= 10; i++) { - tx.write(new Buffer(i)); - } - tx.end(); - - t.equal(tx._readableState.length, 10); - t.equal(transformed, 10); - t.equal(tx._transformState.writechunk.length, 5); - t.same(tx._writableState.buffer.map(function(c) { - return c.chunk.length; - }), [6, 7, 8, 9, 10]); - - t.end(); -}); - -test('passthrough', function(t) { - var pt = new PassThrough(); - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5).toString(), 'l'); - t.end(); -}); - -test('simple transform', function(t) { - var pt = new Transform; - pt._transform = function(c, e, cb) { - var ret = new Buffer(c.length); - ret.fill('x'); - pt.push(ret); - cb(); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'x'); - t.end(); -}); - -test('async passthrough', function(t) { - var pt = new Transform; - pt._transform = function(chunk, encoding, cb) { - setTimeout(function() { - pt.push(chunk); - cb(); - }, 10); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5).toString(), 'l'); - t.end(); - }); -}); - -test('assymetric transform (expand)', function(t) { - var pt = new Transform; - - // emit each chunk 2 times. - pt._transform = function(chunk, encoding, cb) { - setTimeout(function() { - pt.push(chunk); - setTimeout(function() { - pt.push(chunk); - cb(); - }, 10) - }, 10); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'foogf'); - t.equal(pt.read(5).toString(), 'oogba'); - t.equal(pt.read(5).toString(), 'rkbar'); - t.equal(pt.read(5).toString(), 'kbazy'); - t.equal(pt.read(5).toString(), 'bazyk'); - t.equal(pt.read(5).toString(), 'uelku'); - t.equal(pt.read(5).toString(), 'el'); - t.end(); - }); -}); - -test('assymetric transform (compress)', function(t) { - var pt = new Transform; - - // each output is the first char of 3 consecutive chunks, - // or whatever's left. - pt.state = ''; - - pt._transform = function(chunk, encoding, cb) { - if (!chunk) - chunk = ''; - var s = chunk.toString(); - setTimeout(function() { - this.state += s.charAt(0); - if (this.state.length === 3) { - pt.push(new Buffer(this.state)); - this.state = ''; - } - cb(); - }.bind(this), 10); - }; - - pt._flush = function(cb) { - // just output whatever we have. - pt.push(new Buffer(this.state)); - this.state = ''; - cb(); - }; - - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.write(new Buffer('eeee')); - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.write(new Buffer('eeee')); - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.end(); - - // 'abcdeabcdeabcd' - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'abcde'); - t.equal(pt.read(5).toString(), 'abcde'); - t.equal(pt.read(5).toString(), 'abcd'); - t.end(); - }); -}); - - -test('passthrough event emission', function(t) { - var pt = new PassThrough(); - var emits = 0; - pt.on('readable', function() { - var state = pt._readableState; - console.error('>>> emit readable %d', emits); - emits++; - }); - - var i = 0; - - pt.write(new Buffer('foog')); - - console.error('need emit 0'); - pt.write(new Buffer('bark')); - - console.error('should have emitted readable now 1 === %d', emits); - t.equal(emits, 1); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5) + '', 'null'); - - console.error('need emit 1'); - - pt.write(new Buffer('bazy')); - console.error('should have emitted, but not again'); - pt.write(new Buffer('kuel')); - - console.error('should have emitted readable now 2 === %d', emits); - t.equal(emits, 2); - - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5), null); - - console.error('need emit 2'); - - pt.end(); - - t.equal(emits, 3); - - t.equal(pt.read(5).toString(), 'l'); - t.equal(pt.read(5), null); - - console.error('should not have emitted again'); - t.equal(emits, 3); - t.end(); -}); - -test('passthrough event emission reordered', function(t) { - var pt = new PassThrough; - var emits = 0; - pt.on('readable', function() { - console.error('emit readable', emits) - emits++; - }); - - pt.write(new Buffer('foog')); - console.error('need emit 0'); - pt.write(new Buffer('bark')); - console.error('should have emitted readable now 1 === %d', emits); - t.equal(emits, 1); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5), null); - - console.error('need emit 1'); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'arkba'); - - t.equal(pt.read(5), null); - - console.error('need emit 2'); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5), null); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'l'); - t.equal(pt.read(5), null); - t.equal(emits, 4); - t.end(); - }); - pt.end(); - }); - pt.write(new Buffer('kuel')); - }); - - pt.write(new Buffer('bazy')); -}); - -test('passthrough facaded', function(t) { - console.error('passthrough facaded'); - var pt = new PassThrough; - var datas = []; - pt.on('data', function(chunk) { - datas.push(chunk.toString()); - }); - - pt.on('end', function() { - t.same(datas, ['foog', 'bark', 'bazy', 'kuel']); - t.end(); - }); - - pt.write(new Buffer('foog')); - setTimeout(function() { - pt.write(new Buffer('bark')); - setTimeout(function() { - pt.write(new Buffer('bazy')); - setTimeout(function() { - pt.write(new Buffer('kuel')); - setTimeout(function() { - pt.end(); - }, 10); - }, 10); - }, 10); - }, 10); -}); - -test('object transform (json parse)', function(t) { - console.error('json parse stream'); - var jp = new Transform({ objectMode: true }); - jp._transform = function(data, encoding, cb) { - try { - jp.push(JSON.parse(data)); - cb(); - } catch (er) { - cb(er); - } - }; - - // anything except null/undefined is fine. - // those are "magic" in the stream API, because they signal EOF. - var objects = [ - { foo: 'bar' }, - 100, - "string", - { nested: { things: [ { foo: 'bar' }, 100, "string" ] } } - ]; - - var ended = false; - jp.on('end', function() { - ended = true; - }); - - objects.forEach(function(obj) { - jp.write(JSON.stringify(obj)); - var res = jp.read(); - t.same(res, obj); - }); - - jp.end(); - - process.nextTick(function() { - t.ok(ended); - t.end(); - }) -}); - -test('object transform (json stringify)', function(t) { - console.error('json parse stream'); - var js = new Transform({ objectMode: true }); - js._transform = function(data, encoding, cb) { - try { - js.push(JSON.stringify(data)); - cb(); - } catch (er) { - cb(er); - } - }; - - // anything except null/undefined is fine. - // those are "magic" in the stream API, because they signal EOF. - var objects = [ - { foo: 'bar' }, - 100, - "string", - { nested: { things: [ { foo: 'bar' }, 100, "string" ] } } - ]; - - var ended = false; - js.on('end', function() { - ended = true; - }); - - objects.forEach(function(obj) { - js.write(obj); - var res = js.read(); - t.equal(res, JSON.stringify(obj)); - }); - - js.end(); - - process.nextTick(function() { - t.ok(ended); - t.end(); - }) -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js deleted file mode 100644 index a3b5394..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js +++ /dev/null @@ -1,76 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var stream = require('../../readable'); -var crypto = require('crypto'); - -var util = require('util'); - -function TestWriter() { - stream.Writable.call(this); -} -util.inherits(TestWriter, stream.Writable); - -TestWriter.prototype._write = function (buffer, encoding, callback) { - console.log('write called'); - // super slow write stream (callback never called) -}; - -var dest = new TestWriter(); - -function TestReader(id) { - stream.Readable.call(this); - this.reads = 0; -} -util.inherits(TestReader, stream.Readable); - -TestReader.prototype._read = function (size) { - this.reads += 1; - this.push(crypto.randomBytes(size)); -}; - -var src1 = new TestReader(); -var src2 = new TestReader(); - -src1.pipe(dest); - -src1.once('readable', function () { - process.nextTick(function () { - - src2.pipe(dest); - - src2.once('readable', function () { - process.nextTick(function () { - - src1.unpipe(dest); - }); - }); - }); -}); - - -process.on('exit', function () { - assert.equal(src1.reads, 2); - assert.equal(src2.reads, 2); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js deleted file mode 100644 index 6882f20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js +++ /dev/null @@ -1,74 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var stream = require('../../readable'); - -var chunk = new Buffer('hallo'); - -var util = require('util'); - -function TestWriter() { - stream.Writable.call(this); -} -util.inherits(TestWriter, stream.Writable); - -TestWriter.prototype._write = function(buffer, encoding, callback) { - callback(null); -}; - -var dest = new TestWriter(); - -// Set this high so that we'd trigger a nextTick warning -// and/or RangeError if we do maybeReadMore wrong. -function TestReader() { - stream.Readable.call(this, { highWaterMark: 0x10000 }); -} -util.inherits(TestReader, stream.Readable); - -TestReader.prototype._read = function(size) { - this.push(chunk); -}; - -var src = new TestReader(); - -for (var i = 0; i < 10; i++) { - src.pipe(dest); - src.unpipe(dest); -} - -assert.equal(src.listeners('end').length, 0); -assert.equal(src.listeners('readable').length, 0); - -assert.equal(dest.listeners('unpipe').length, 0); -assert.equal(dest.listeners('drain').length, 0); -assert.equal(dest.listeners('error').length, 0); -assert.equal(dest.listeners('close').length, 0); -assert.equal(dest.listeners('finish').length, 0); - -console.error(src._readableState); -process.on('exit', function() { - assert(src._readableState.length >= src._readableState.highWaterMark); - src._readableState.buffer.length = 0; - console.error(src._readableState); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js deleted file mode 100644 index a60e65c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js +++ /dev/null @@ -1,328 +0,0 @@ -// 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 common = require('../common.js'); -var W = require('../../lib/_stream_writable'); -var D = require('../../lib/_stream_duplex'); -var assert = require('assert'); - -var util = require('util'); -util.inherits(TestWriter, W); - -function TestWriter() { - W.apply(this, arguments); - this.buffer = []; - this.written = 0; -} - -TestWriter.prototype._write = function(chunk, encoding, cb) { - // simulate a small unpredictable latency - setTimeout(function() { - this.buffer.push(chunk.toString()); - this.written += chunk.length; - cb(); - }.bind(this), Math.floor(Math.random() * 10)); -}; - -var chunks = new Array(50); -for (var i = 0; i < chunks.length; i++) { - chunks[i] = new Array(i + 1).join('x'); -} - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -test('write fast', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.end(); - }); - - chunks.forEach(function(chunk) { - // screw backpressure. Just buffer it all up. - tw.write(chunk); - }); - tw.end(); -}); - -test('write slow', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.end(); - }); - - var i = 0; - (function W() { - tw.write(chunks[i++]); - if (i < chunks.length) - setTimeout(W, 10); - else - tw.end(); - })(); -}); - -test('write backpressure', function(t) { - var tw = new TestWriter({ - highWaterMark: 50 - }); - - var drains = 0; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.equal(drains, 17); - t.end(); - }); - - tw.on('drain', function() { - drains++; - }); - - var i = 0; - (function W() { - do { - var ret = tw.write(chunks[i++]); - } while (ret !== false && i < chunks.length); - - if (i < chunks.length) { - assert(tw._writableState.length >= 50); - tw.once('drain', W); - } else { - tw.end(); - } - })(); -}); - -test('write bufferize', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - var encodings = - [ 'hex', - 'utf8', - 'utf-8', - 'ascii', - 'binary', - 'base64', - 'ucs2', - 'ucs-2', - 'utf16le', - 'utf-16le', - undefined ]; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got the expected chunks'); - }); - - chunks.forEach(function(chunk, i) { - var enc = encodings[ i % encodings.length ]; - chunk = new Buffer(chunk); - tw.write(chunk.toString(enc), enc); - }); - t.end(); -}); - -test('write no bufferize', function(t) { - var tw = new TestWriter({ - highWaterMark: 100, - decodeStrings: false - }); - - tw._write = function(chunk, encoding, cb) { - assert(typeof chunk === 'string'); - chunk = new Buffer(chunk, encoding); - return TestWriter.prototype._write.call(this, chunk, encoding, cb); - }; - - var encodings = - [ 'hex', - 'utf8', - 'utf-8', - 'ascii', - 'binary', - 'base64', - 'ucs2', - 'ucs-2', - 'utf16le', - 'utf-16le', - undefined ]; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got the expected chunks'); - }); - - chunks.forEach(function(chunk, i) { - var enc = encodings[ i % encodings.length ]; - chunk = new Buffer(chunk); - tw.write(chunk.toString(enc), enc); - }); - t.end(); -}); - -test('write callbacks', function (t) { - var callbacks = chunks.map(function(chunk, i) { - return [i, function(er) { - callbacks._called[i] = chunk; - }]; - }).reduce(function(set, x) { - set['callback-' + x[0]] = x[1]; - return set; - }, {}); - callbacks._called = []; - - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - process.nextTick(function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.same(callbacks._called, chunks, 'called all callbacks'); - t.end(); - }); - }); - - chunks.forEach(function(chunk, i) { - tw.write(chunk, callbacks['callback-' + i]); - }); - tw.end(); -}); - -test('end callback', function (t) { - var tw = new TestWriter(); - tw.end(function () { - t.end(); - }); -}); - -test('end callback with chunk', function (t) { - var tw = new TestWriter(); - tw.end(new Buffer('hello world'), function () { - t.end(); - }); -}); - -test('end callback with chunk and encoding', function (t) { - var tw = new TestWriter(); - tw.end('hello world', 'ascii', function () { - t.end(); - }); -}); - -test('end callback after .write() call', function (t) { - var tw = new TestWriter(); - tw.write(new Buffer('hello world')); - tw.end(function () { - t.end(); - }); -}); - -test('encoding should be ignored for buffers', function(t) { - var tw = new W(); - var hex = '018b5e9a8f6236ffe30e31baf80d2cf6eb'; - tw._write = function(chunk, encoding, cb) { - t.equal(chunk.toString('hex'), hex); - t.end(); - }; - var buf = new Buffer(hex, 'hex'); - tw.write(buf, 'binary'); -}); - -test('writables are not pipable', function(t) { - var w = new W(); - w._write = function() {}; - var gotError = false; - w.on('error', function(er) { - gotError = true; - }); - w.pipe(process.stdout); - assert(gotError); - t.end(); -}); - -test('duplexes are pipable', function(t) { - var d = new D(); - d._read = function() {}; - d._write = function() {}; - var gotError = false; - d.on('error', function(er) { - gotError = true; - }); - d.pipe(process.stdout); - assert(!gotError); - t.end(); -}); - -test('end(chunk) two times is an error', function(t) { - var w = new W(); - w._write = function() {}; - var gotError = false; - w.on('error', function(er) { - gotError = true; - t.equal(er.message, 'write after end'); - }); - w.end('this is the end'); - w.end('and so is this'); - process.nextTick(function() { - assert(gotError); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js deleted file mode 100644 index a30ca20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js +++ /dev/null @@ -1,452 +0,0 @@ -// 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 Transform = require('./lib/_stream_transform.js'); - -var binding = process.binding('zlib'); -var util = require('util'); -var assert = require('assert').ok; - -// zlib doesn't provide these, so kludge them in following the same -// const naming scheme zlib uses. -binding.Z_MIN_WINDOWBITS = 8; -binding.Z_MAX_WINDOWBITS = 15; -binding.Z_DEFAULT_WINDOWBITS = 15; - -// fewer than 64 bytes per chunk is stupid. -// technically it could work with as few as 8, but even 64 bytes -// is absurdly low. Usually a MB or more is best. -binding.Z_MIN_CHUNK = 64; -binding.Z_MAX_CHUNK = Infinity; -binding.Z_DEFAULT_CHUNK = (16 * 1024); - -binding.Z_MIN_MEMLEVEL = 1; -binding.Z_MAX_MEMLEVEL = 9; -binding.Z_DEFAULT_MEMLEVEL = 8; - -binding.Z_MIN_LEVEL = -1; -binding.Z_MAX_LEVEL = 9; -binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION; - -// expose all the zlib constants -Object.keys(binding).forEach(function(k) { - if (k.match(/^Z/)) exports[k] = binding[k]; -}); - -// translation table for return codes. -exports.codes = { - Z_OK: binding.Z_OK, - Z_STREAM_END: binding.Z_STREAM_END, - Z_NEED_DICT: binding.Z_NEED_DICT, - Z_ERRNO: binding.Z_ERRNO, - Z_STREAM_ERROR: binding.Z_STREAM_ERROR, - Z_DATA_ERROR: binding.Z_DATA_ERROR, - Z_MEM_ERROR: binding.Z_MEM_ERROR, - Z_BUF_ERROR: binding.Z_BUF_ERROR, - Z_VERSION_ERROR: binding.Z_VERSION_ERROR -}; - -Object.keys(exports.codes).forEach(function(k) { - exports.codes[exports.codes[k]] = k; -}); - -exports.Deflate = Deflate; -exports.Inflate = Inflate; -exports.Gzip = Gzip; -exports.Gunzip = Gunzip; -exports.DeflateRaw = DeflateRaw; -exports.InflateRaw = InflateRaw; -exports.Unzip = Unzip; - -exports.createDeflate = function(o) { - return new Deflate(o); -}; - -exports.createInflate = function(o) { - return new Inflate(o); -}; - -exports.createDeflateRaw = function(o) { - return new DeflateRaw(o); -}; - -exports.createInflateRaw = function(o) { - return new InflateRaw(o); -}; - -exports.createGzip = function(o) { - return new Gzip(o); -}; - -exports.createGunzip = function(o) { - return new Gunzip(o); -}; - -exports.createUnzip = function(o) { - return new Unzip(o); -}; - - -// Convenience methods. -// compress/decompress a string or buffer in one step. -exports.deflate = function(buffer, callback) { - zlibBuffer(new Deflate(), buffer, callback); -}; - -exports.gzip = function(buffer, callback) { - zlibBuffer(new Gzip(), buffer, callback); -}; - -exports.deflateRaw = function(buffer, callback) { - zlibBuffer(new DeflateRaw(), buffer, callback); -}; - -exports.unzip = function(buffer, callback) { - zlibBuffer(new Unzip(), buffer, callback); -}; - -exports.inflate = function(buffer, callback) { - zlibBuffer(new Inflate(), buffer, callback); -}; - -exports.gunzip = function(buffer, callback) { - zlibBuffer(new Gunzip(), buffer, callback); -}; - -exports.inflateRaw = function(buffer, callback) { - zlibBuffer(new InflateRaw(), buffer, callback); -}; - -function zlibBuffer(engine, buffer, callback) { - var buffers = []; - var nread = 0; - - engine.on('error', onError); - engine.on('end', onEnd); - - engine.end(buffer); - flow(); - - function flow() { - var chunk; - while (null !== (chunk = engine.read())) { - buffers.push(chunk); - nread += chunk.length; - } - engine.once('readable', flow); - } - - function onError(err) { - engine.removeListener('end', onEnd); - engine.removeListener('readable', flow); - callback(err); - } - - function onEnd() { - var buf = Buffer.concat(buffers, nread); - buffers = []; - callback(null, buf); - } -} - - -// generic zlib -// minimal 2-byte header -function Deflate(opts) { - if (!(this instanceof Deflate)) return new Deflate(opts); - Zlib.call(this, opts, binding.DEFLATE); -} - -function Inflate(opts) { - if (!(this instanceof Inflate)) return new Inflate(opts); - Zlib.call(this, opts, binding.INFLATE); -} - - - -// gzip - bigger header, same deflate compression -function Gzip(opts) { - if (!(this instanceof Gzip)) return new Gzip(opts); - Zlib.call(this, opts, binding.GZIP); -} - -function Gunzip(opts) { - if (!(this instanceof Gunzip)) return new Gunzip(opts); - Zlib.call(this, opts, binding.GUNZIP); -} - - - -// raw - no header -function DeflateRaw(opts) { - if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts); - Zlib.call(this, opts, binding.DEFLATERAW); -} - -function InflateRaw(opts) { - if (!(this instanceof InflateRaw)) return new InflateRaw(opts); - Zlib.call(this, opts, binding.INFLATERAW); -} - - -// auto-detect header. -function Unzip(opts) { - if (!(this instanceof Unzip)) return new Unzip(opts); - Zlib.call(this, opts, binding.UNZIP); -} - - -// the Zlib class they all inherit from -// This thing manages the queue of requests, and returns -// true or false if there is anything in the queue when -// you call the .write() method. - -function Zlib(opts, mode) { - this._opts = opts = opts || {}; - this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK; - - Transform.call(this, opts); - - // means a different thing there. - this._readableState.chunkSize = null; - - if (opts.chunkSize) { - if (opts.chunkSize < exports.Z_MIN_CHUNK || - opts.chunkSize > exports.Z_MAX_CHUNK) { - throw new Error('Invalid chunk size: ' + opts.chunkSize); - } - } - - if (opts.windowBits) { - if (opts.windowBits < exports.Z_MIN_WINDOWBITS || - opts.windowBits > exports.Z_MAX_WINDOWBITS) { - throw new Error('Invalid windowBits: ' + opts.windowBits); - } - } - - if (opts.level) { - if (opts.level < exports.Z_MIN_LEVEL || - opts.level > exports.Z_MAX_LEVEL) { - throw new Error('Invalid compression level: ' + opts.level); - } - } - - if (opts.memLevel) { - if (opts.memLevel < exports.Z_MIN_MEMLEVEL || - opts.memLevel > exports.Z_MAX_MEMLEVEL) { - throw new Error('Invalid memLevel: ' + opts.memLevel); - } - } - - if (opts.strategy) { - if (opts.strategy != exports.Z_FILTERED && - opts.strategy != exports.Z_HUFFMAN_ONLY && - opts.strategy != exports.Z_RLE && - opts.strategy != exports.Z_FIXED && - opts.strategy != exports.Z_DEFAULT_STRATEGY) { - throw new Error('Invalid strategy: ' + opts.strategy); - } - } - - if (opts.dictionary) { - if (!Buffer.isBuffer(opts.dictionary)) { - throw new Error('Invalid dictionary: it should be a Buffer instance'); - } - } - - this._binding = new binding.Zlib(mode); - - var self = this; - this._hadError = false; - this._binding.onerror = function(message, errno) { - // there is no way to cleanly recover. - // continuing only obscures problems. - self._binding = null; - self._hadError = true; - - var error = new Error(message); - error.errno = errno; - error.code = exports.codes[errno]; - self.emit('error', error); - }; - - this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, - opts.level || exports.Z_DEFAULT_COMPRESSION, - opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, - opts.strategy || exports.Z_DEFAULT_STRATEGY, - opts.dictionary); - - this._buffer = new Buffer(this._chunkSize); - this._offset = 0; - this._closed = false; - - this.once('end', this.close); -} - -util.inherits(Zlib, Transform); - -Zlib.prototype.reset = function reset() { - return this._binding.reset(); -}; - -Zlib.prototype._flush = function(output, callback) { - var rs = this._readableState; - var self = this; - this._transform(null, output, function(er) { - if (er) - return callback(er); - - // now a weird thing happens... it could be that you called flush - // but everything had already actually been consumed, but it wasn't - // enough to get over the Readable class's lowWaterMark. - // In that case, we emit 'readable' now to make sure it's consumed. - if (rs.length && - rs.length < rs.lowWaterMark && - !rs.ended && - rs.needReadable) - self.emit('readable'); - - callback(); - }); -}; - -Zlib.prototype.flush = function(callback) { - var ws = this._writableState; - var ts = this._transformState; - - if (ws.writing) { - ws.needDrain = true; - var self = this; - this.once('drain', function() { - self._flush(ts.output, callback); - }); - return; - } - - this._flush(ts.output, callback || function() {}); -}; - -Zlib.prototype.close = function(callback) { - if (callback) - process.nextTick(callback); - - if (this._closed) - return; - - this._closed = true; - - this._binding.close(); - - var self = this; - process.nextTick(function() { - self.emit('close'); - }); -}; - -Zlib.prototype._transform = function(chunk, output, cb) { - var flushFlag; - var ws = this._writableState; - var ending = ws.ending || ws.ended; - var last = ending && (!chunk || ws.length === chunk.length); - - if (chunk !== null && !Buffer.isBuffer(chunk)) - return cb(new Error('invalid input')); - - // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag. - // If it's explicitly flushing at some other time, then we use - // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression - // goodness. - if (last) - flushFlag = binding.Z_FINISH; - else if (chunk === null) - flushFlag = binding.Z_FULL_FLUSH; - else - flushFlag = binding.Z_NO_FLUSH; - - var availInBefore = chunk && chunk.length; - var availOutBefore = this._chunkSize - this._offset; - var inOff = 0; - - var req = this._binding.write(flushFlag, - chunk, // in - inOff, // in_off - availInBefore, // in_len - this._buffer, // out - this._offset, //out_off - availOutBefore); // out_len - - req.buffer = chunk; - req.callback = callback; - - var self = this; - function callback(availInAfter, availOutAfter, buffer) { - if (self._hadError) - return; - - var have = availOutBefore - availOutAfter; - assert(have >= 0, 'have should not go down'); - - if (have > 0) { - var out = self._buffer.slice(self._offset, self._offset + have); - self._offset += have; - // serve some output to the consumer. - output(out); - } - - // exhausted the output buffer, or used all the input create a new one. - if (availOutAfter === 0 || self._offset >= self._chunkSize) { - availOutBefore = self._chunkSize; - self._offset = 0; - self._buffer = new Buffer(self._chunkSize); - } - - if (availOutAfter === 0) { - // Not actually done. Need to reprocess. - // Also, update the availInBefore to the availInAfter value, - // so that if we have to hit it a third (fourth, etc.) time, - // it'll have the correct byte counts. - inOff += (availInBefore - availInAfter); - availInBefore = availInAfter; - - var newReq = self._binding.write(flushFlag, - chunk, - inOff, - availInBefore, - self._buffer, - self._offset, - self._chunkSize); - newReq.callback = callback; // this same function - newReq.buffer = chunk; - return; - } - - // finished with the chunk. - cb(); - } -}; - -util.inherits(Deflate, Zlib); -util.inherits(Inflate, Zlib); -util.inherits(Gzip, Zlib); -util.inherits(Gunzip, Zlib); -util.inherits(DeflateRaw, Zlib); -util.inherits(InflateRaw, Zlib); -util.inherits(Unzip, Zlib); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md deleted file mode 100644 index 389adae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# xtend - -[![browser support][3]][4] - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes presedence. - -## Examples - -```js -var extend = require("xtend") - -var combination = extend({ - a: "a" -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js deleted file mode 100644 index 62391e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = hasKeys - -function hasKeys(source) { - return source !== null && - (typeof source === "object" || - typeof source === "function") -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js deleted file mode 100644 index 20937d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js +++ /dev/null @@ -1,25 +0,0 @@ -var Keys = require("object-keys") -var hasKeys = require("./has-keys") - -module.exports = extend - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - if (!hasKeys(source)) { - continue - } - - var keys = Keys(source) - - for (var j = 0; j < keys.length; j++) { - var name = keys[j] - target[name] = source[name] - } - } - - return target -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js deleted file mode 100644 index 29e3b22..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js +++ /dev/null @@ -1,19 +0,0 @@ -var hasKeys = require("./has-keys") - -module.exports = extend - -function extend(target) { - var sources = [].slice.call(arguments, 1) - - sources.forEach(function (source) { - if (!hasKeys(source)) { - return - } - - Object.keys(source).forEach(function (name) { - target[name] = source[name] - }) - }) - - return target -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore deleted file mode 100644 index fd31f5e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json deleted file mode 100644 index 287edfe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "launchers": { - "node": { - "command": "node ./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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml deleted file mode 100644 index ed178f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE deleted file mode 100644 index 72d356c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Colingo. - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md deleted file mode 100644 index 607a7d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# is-object - -[![build status][1]][2] [![dependency status][3]][4] - -[![browser support][5]][6] - -Checks whether a value is an object - -Because `typeof null` is a troll. - -## Example - -```js -var isObject = require("is-object") - -console.log(isObject(null)) // false -console.log(isObject(require("util"))) // true -``` - -## Installation - -`npm install is-object` - -## Contributors - - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Colingo/is-object.png - [2]: http://travis-ci.org/Colingo/is-object - [3]: http://david-dm.org/Colingo/is-object/status.png - [4]: http://david-dm.org/Colingo/is-object - [5]: http://ci.testling.com/Colingo/is-object.png - [6]: http://ci.testling.com/Colingo/is-object diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/examples/simple.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/examples/simple.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js deleted file mode 100644 index 38348b1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = isObject - -function isObject(x) { - return typeof x === "object" && x !== null -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json deleted file mode 100644 index 92cd3b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "is-object", - "version": "0.1.2", - "description": "Checks whether a value is an object", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Colingo/is-object.git" - }, - "main": "index", - "homepage": "https://github.com/Colingo/is-object", - "contributors": [ - { - "name": "Raynos" - } - ], - "bugs": { - "url": "https://github.com/Colingo/is-object/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~0.2.2", - "browserify-server": "~2.1.18", - "browservefy": "~0.0.7", - "testem": "https://github.com/raynos/testem/tarball/master" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Colingo/is-object/raw/master/LICENSE" - } - ], - "scripts": { - "test": "testem ci", - "build": "browserify-server --bundle=test/index.js -o test/static/bundle.js --debug", - "testem": "testem", - "example": "browservefy ./examples/simple.js --browserify='browserify-server' --live -- --debug --bundle" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "readme": "# is-object\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n[![browser support][5]][6]\n\nChecks whether a value is an object\n\nBecause `typeof null` is a troll.\n\n## Example\n\n```js\nvar isObject = require(\"is-object\")\n\nconsole.log(isObject(null)) // false\nconsole.log(isObject(require(\"util\"))) // true\n```\n\n## Installation\n\n`npm install is-object`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n [1]: https://secure.travis-ci.org/Colingo/is-object.png\n [2]: http://travis-ci.org/Colingo/is-object\n [3]: http://david-dm.org/Colingo/is-object/status.png\n [4]: http://david-dm.org/Colingo/is-object\n [5]: http://ci.testling.com/Colingo/is-object.png\n [6]: http://ci.testling.com/Colingo/is-object\n", - "readmeFilename": "README.md", - "_id": "is-object@0.1.2", - "dist": { - "shasum": "d4ef6cf2e33bfa0407ba25176b1266f44999f8c9" - }, - "_from": "is-object@~0.1.2", - "_resolved": "https://registry.npmjs.org/is-object/-/is-object-0.1.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js deleted file mode 100644 index b4c7abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require("tape") - -var isObject = require("../index") - -test("returns true for objects", function (assert) { - assert.equal(isObject({}), true) - assert.equal(isObject([]), true) - - assert.end() -}) - -test("returns false for null", function (assert) { - assert.equal(isObject(null), false) - - assert.end() -}) - -test("returns false for primitives", function (assert) { - assert.equal(isObject(42), false) - assert.equal(isObject("foo"), false) - - assert.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html deleted file mode 100644 index 60f6ef8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - TAPE Example - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js deleted file mode 100644 index c512792..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js +++ /dev/null @@ -1,49 +0,0 @@ -(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 { - results.failed++ - } - - results.total++ - - socket.emit('test-result', test) - results.tests.push(test) - } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml deleted file mode 100644 index 8170a81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.6" diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md deleted file mode 100644 index c49e3a8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md +++ /dev/null @@ -1,38 +0,0 @@ -#object-keys [![Version Badge][2]][1] - -[![Build Status][3]][4] [![dependency status][5]][6] - -[![browser support][7]][8] - -An Object.keys shim. Uses Object.keys if available. - -## Example - -```js -var keys = require('object-keys'); -var assert = require('assert'); -var obj = { - a: true, - b: true, - c: true -}; - -assert.equal(keys(obj), ['a', 'b', 'c']); -``` - -## Source -Implementation taken directly from [9] - -## Tests -Tests currently use tape - which doesn't work in node 0.10, but works in browserify. Rest assured, they pass. - -[1]: https://npmjs.org/package/object-keys -[2]: http://vb.teelaun.ch/ljharb/object-keys.svg -[3]: https://travis-ci.org/ljharb/object-keys.png -[4]: https://travis-ci.org/ljharb/object-keys -[5]: https://david-dm.org/ljharb/object-keys.png -[6]: https://david-dm.org/ljharb/object-keys -[7]: https://ci.testling.com/ljharb/object-keys.png -[8]: https://ci.testling.com/ljharb/object-keys -[9]: https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js#L542-589 - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js deleted file mode 100644 index f5b24b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = Object.keys || require('./shim'); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name deleted file mode 100644 index 373ccea..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -manuelstofer-foreach \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml deleted file mode 100644 index 6b8184f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml deleted file mode 100644 index 1162f43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml deleted file mode 100644 index 63665ee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml deleted file mode 100644 index c80f219..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml deleted file mode 100644 index 269a33c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml +++ /dev/null @@ -1,467 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1365371005647 - 1365371005647 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore deleted file mode 100644 index d135df6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -components -build \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile deleted file mode 100644 index eae4117..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -build: components - @component build - -components: component.json - @component install --dev - -clean: - rm -fr build components template.js - -.PHONY: clean diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md deleted file mode 100644 index 2752b57..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md +++ /dev/null @@ -1,30 +0,0 @@ - -# foreach - -Iterate over the key value pairs of either an array-like object or a dictionary like object. - -[![browser support][1]][2] - -## API - -### foreach(object, function, [context]) - -```js -var each = require('foreach'); - -each([1,2,3], function (value, key, array) { - // value === 1, 2, 3 - // key === 0, 1, 2 - // array === [1, 2, 3] -}); - -each({0:1,1:2,2:3}, function (value, key, object) { - // value === 1, 2, 3 - // key === 0, 1, 2 - // object === {0:1,1:2,2:3} -}); -``` - -[1]: https://ci.testling.com/manuelstofer/foreach.png -[2]: https://ci.testling.com/manuelstofer/foreach - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json deleted file mode 100644 index 9495f56..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "foreach", - "description": "foreach component + npm package", - "version": "2.0.3", - "keywords": [], - "dependencies": {}, - "scripts": [ - "index.js" - ], - "repo": "manuelstofer/foreach" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js deleted file mode 100644 index a961e4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js +++ /dev/null @@ -1,22 +0,0 @@ - -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; - -module.exports = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } -}; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json deleted file mode 100644 index 72a947c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "foreach", - "description": "foreach component + npm package", - "version": "2.0.4", - "author": { - "name": "Manuel Stofer", - "email": "manuel@takimata.ch" - }, - "contributors": [ - { - "name": "Manuel Stofer" - }, - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/manuelstofer/foreach" - }, - "keywords": [ - "shim", - "Array.prototype.forEach", - "forEach", - "Array#forEach", - "each" - ], - "dependencies": {}, - "devDependencies": { - "tape": "*" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0", - "chrome/22.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/5.0.5..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "readme": "\n# foreach\n\nIterate over the key value pairs of either an array-like object or a dictionary like object.\n\n[![browser support][1]][2]\n\n## API\n\n### foreach(object, function, [context])\n\n```js\nvar each = require('foreach');\n\neach([1,2,3], function (value, key, array) {\n // value === 1, 2, 3\n // key === 0, 1, 2\n // array === [1, 2, 3]\n});\n\neach({0:1,1:2,2:3}, function (value, key, object) {\n // value === 1, 2, 3\n // key === 0, 1, 2\n // object === {0:1,1:2,2:3}\n});\n```\n\n[1]: https://ci.testling.com/manuelstofer/foreach.png\n[2]: https://ci.testling.com/manuelstofer/foreach\n\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/manuelstofer/foreach/issues" - }, - "_id": "foreach@2.0.4", - "dist": { - "shasum": "cc5d0d8ae1d46cc9a555c2682f910977859935df" - }, - "_from": "foreach@~2.0.1", - "_resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js deleted file mode 100644 index e66aebc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js +++ /dev/null @@ -1,155 +0,0 @@ -var test = require('tape'); -var forEach = require('./index.js'); - - -test('second argument: iterator', function (t) { - var arr = []; - t.throws(function () { forEach(arr); }, TypeError, 'undefined is not a function'); - t.throws(function () { forEach(arr, null); }, TypeError, 'null is not a function'); - t.throws(function () { forEach(arr, ''); }, TypeError, 'string is not a function'); - t.throws(function () { forEach(arr, /a/); }, TypeError, 'regex is not a function'); - t.throws(function () { forEach(arr, true); }, TypeError, 'true is not a function'); - t.throws(function () { forEach(arr, false); }, TypeError, 'false is not a function'); - t.throws(function () { forEach(arr, NaN); }, TypeError, 'NaN is not a function'); - t.throws(function () { forEach(arr, 42); }, TypeError, '42 is not a function'); - t.doesNotThrow(function () { forEach(arr, function () {}); }, 'function is a function'); - t.doesNotThrow(function () { forEach(arr, setTimeout); }, 'setTimeout is a function'); - if (typeof window !== 'undefined') { - t.doesNotThrow(function () { forEach(arr, window.alert); }, 'alert is a function'); - } - t.end(); -}); - -test('array', function (t) { - var arr = [1, 2, 3]; - - t.test('iterates over every item', function (st) { - var index = 0; - forEach(arr, function () { index += 1; }); - st.equal(index, arr.length, 'iterates ' + arr.length + ' times'); - st.end(); - }); - - t.test('first iterator argument', function (st) { - var index = 0; - st.plan(arr.length); - forEach(arr, function (item) { - st.equal(arr[index], item, 'item ' + index + ' is passed as first argument'); - index += 1; - }); - st.end(); - }); - - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(arr.length); - forEach(arr, function (item, index) { - st.equal(counter, index, 'index ' + index + ' is passed as second argument'); - counter += 1; - }); - st.end(); - }); - - t.test('third iterator argument', function (st) { - st.plan(arr.length); - forEach(arr, function (item, index, array) { - st.deepEqual(arr, array, 'array is passed as third argument'); - }); - st.end(); - }); - - t.test('context argument', function (st) { - var context = {}; - forEach([], function () { - st.equal(this, context, '"this" is the passed context'); - }, context); - st.end(); - }); - - t.end(); -}); - -test('object', function (t) { - var obj = { - a: 1, - b: 2, - c: 3 - }; - var keys = ['a', 'b', 'c']; - - var F = function () { - this.a = 1; - this.b = 2; - }; - F.prototype.c = 3; - var fKeys = ['a', 'b']; - - t.test('iterates over every object literal key', function (st) { - var counter = 0; - forEach(obj, function () { counter += 1; }); - st.equal(counter, keys.length, 'iterated ' + counter + ' times'); - st.end(); - }); - - t.test('iterates only over own keys', function (st) { - var counter = 0; - forEach(new F(), function () { counter += 1; }); - st.equal(counter, fKeys.length, 'iterated ' + fKeys.length + ' times'); - st.end(); - }); - - t.test('first iterator argument', function (st) { - var index = 0; - st.plan(keys.length); - forEach(obj, function (item) { - st.equal(obj[keys[index]], item, 'item at key ' + keys[index] + ' is passed as first argument'); - index += 1; - }); - st.end(); - }); - - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(keys.length); - forEach(obj, function (item, key) { - st.equal(keys[counter], key, 'key ' + key + ' is passed as second argument'); - counter += 1; - }); - st.end(); - }); - - t.test('third iterator argument', function (st) { - st.plan(keys.length); - forEach(obj, function (item, key, object) { - st.deepEqual(obj, object, 'object is passed as third argument'); - }); - st.end(); - }); - - t.test('context argument', function (st) { - var context = {}; - forEach({}, function () { - st.equal(this, context, '"this" is the passed context'); - }, context); - st.end(); - }); - - t.end(); -}); - - -test('string', function (t) { - var str = 'str'; - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(str.length * 2 + 1); - forEach(str, function (item, index) { - st.equal(counter, index, 'index ' + index + ' is passed as second argument'); - st.equal(str.charAt(index), item); - counter += 1; - }); - st.equal(counter, str.length, 'iterates ' + str.length + ' times'); - }); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore deleted file mode 100644 index 48a2e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -components -build diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile deleted file mode 100644 index 3f6119d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -build: components index.js - @component build - -components: - @Component install - -clean: - rm -fr build components template.js - -.PHONY: clean diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md deleted file mode 100644 index 99c8dfc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ - -# indexOf - - Lame indexOf thing, thanks microsoft - -## Example - -```js -var index = require('indexof'); -index(arr, obj); -``` - -## License - - MIT \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json deleted file mode 100644 index e3430d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "indexof", - "description": "Microsoft sucks", - "version": "0.0.1", - "keywords": ["index", "array", "indexOf"], - "dependencies": {}, - "scripts": [ - "index.js" - ] -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js deleted file mode 100644 index 9d9667b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js +++ /dev/null @@ -1,10 +0,0 @@ - -var indexOf = [].indexOf; - -module.exports = function(arr, obj){ - if (indexOf) return arr.indexOf(obj); - for (var i = 0; i < arr.length; ++i) { - if (arr[i] === obj) return i; - } - return -1; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json deleted file mode 100644 index 72018b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "indexof", - "description": "Microsoft sucks", - "version": "0.0.1", - "keywords": [ - "index", - "array", - "indexOf" - ], - "dependencies": {}, - "component": { - "scripts": { - "indexof/index.js": "index.js" - } - }, - "readme": "\n# indexOf\n\n Lame indexOf thing, thanks microsoft\n\n## Example\n\n```js\nvar index = require('indexof');\nindex(arr, obj);\n```\n\n## License\n\n MIT", - "readmeFilename": "Readme.md", - "_id": "indexof@0.0.1", - "dist": { - "shasum": "505290cfca5bc41bb05cfe36a3a8b43bf5c6cb95" - }, - "_from": "indexof@~0.0.1", - "_resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md deleted file mode 100644 index b0b7e1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Enrico Marino - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md deleted file mode 100644 index 412a962..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# is - -The definitive JavaScript type testing library - -To be or not to be? This is the library! - -[![browser support][1]][2] - -## Installation - -As a node.js module - - $ npm install is - -As a component - - $ component install enricomarino/is - -## API - -### general - - - is.a (value, type) or is.type (value, type) - - is.defined (value) - - is.empty (value) - - is.equal (value, other) - - is.hosted (value, host) - - is.instance (value, constructor) - - is.instanceof (value, constructor) - deprecated, because in ES3 browsers, "instanceof" is a reserved word - - is.null (value) - deprecated, because in ES3 browsers, "null" is a reserved word - - is.undefined (value) - -### arguments - - - is.arguments (value) - - is.arguments.empty (value) - -### array - - - is.array (value) - - is.array.empty (value) - - is.arraylike (value) - -### boolean - - - is.boolean (value) - - is.false (value) - deprecated, because in ES3 browsers, "false" is a reserved word - - is.true (value) - deprecated, because in ES3 browsers, "true" is a reserved word - -### date - - - is.date (value) - -### element - - - is.element (value) - -### error - - - is.error (value) - -### function - - - is.fn(value) - - is.function(value) - deprecated, because in ES3 browsers, "function" is a reserved word - -### number - - - is.number (value) - - is.infinite (value) - - is.decimal (value) - - is.divisibleBy (value, n) - - is.int (value) - - is.maximum (value, others) - - is.minimum (value, others) - - is.nan (value) - - is.even (value) - - is.odd (value) - - is.ge (value, other) - - is.gt (value, other) - - is.le (value, other) - - is.lt (value, other) - - is.within (value, start, finish) - -### object - - - is.object (value) - -### regexp - - - is.regexp (value) - -### string - - - is.string (value) - - -## Contributors - -- [Jordan Harband](https://github.com/ljharb) - -## License - -(The MIT License) - -Copyright (c) 2013 Enrico Marino - -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. - -[1]: https://ci.testling.com/enricomarino/is.png -[2]: https://ci.testling.com/enricomarino/is - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json deleted file mode 100644 index 50f6cd9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "is", - "repo": "enricomarino/is", - "description": "The definitive type testing library", - "version": "0.2.0", - "dependencies": {}, - "scripts": ["index.js"] -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js deleted file mode 100644 index b14b0f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js +++ /dev/null @@ -1,702 +0,0 @@ - -/**! - * is - * the definitive JavaScript type testing library - * - * @copyright 2013 Enrico Marino - * @license MIT - */ - -var objProto = Object.prototype; -var owns = objProto.hasOwnProperty; -var toString = objProto.toString; -var isActualNaN = function (value) { - return value !== value; -}; -var NON_HOST_TYPES = { - "boolean": 1, - "number": 1, - "string": 1, - "undefined": 1 -}; - -/** - * Expose `is` - */ - -var is = module.exports = {}; - -/** - * Test general. - */ - -/** - * is.type - * Test if `value` is a type of `type`. - * - * @param {Mixed} value value to test - * @param {String} type type - * @return {Boolean} true if `value` is a type of `type`, false otherwise - * @api public - */ - -is.a = -is.type = function (value, type) { - return typeof value === type; -}; - -/** - * is.defined - * Test if `value` is defined. - * - * @param {Mixed} value value to test - * @return {Boolean} true if 'value' is defined, false otherwise - * @api public - */ - -is.defined = function (value) { - return value !== undefined; -}; - -/** - * is.empty - * Test if `value` is empty. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is empty, false otherwise - * @api public - */ - -is.empty = function (value) { - var type = toString.call(value); - var key; - - if ('[object Array]' === type || '[object Arguments]' === type) { - return value.length === 0; - } - - if ('[object Object]' === type) { - for (key in value) if (owns.call(value, key)) return false; - return true; - } - - if ('[object String]' === type) { - return '' === value; - } - - return false; -}; - -/** - * is.equal - * Test if `value` is equal to `other`. - * - * @param {Mixed} value value to test - * @param {Mixed} other value to compare with - * @return {Boolean} true if `value` is equal to `other`, false otherwise - */ - -is.equal = function (value, other) { - var type = toString.call(value) - var key; - - if (type !== toString.call(other)) { - return false; - } - - if ('[object Object]' === type) { - for (key in value) { - if (!is.equal(value[key], other[key])) { - return false; - } - } - return true; - } - - if ('[object Array]' === type) { - key = value.length; - if (key !== other.length) { - return false; - } - while (--key) { - if (!is.equal(value[key], other[key])) { - return false; - } - } - return true; - } - - if ('[object Function]' === type) { - return value.prototype === other.prototype; - } - - if ('[object Date]' === type) { - return value.getTime() === other.getTime(); - } - - return value === other; -}; - -/** - * is.hosted - * Test if `value` is hosted by `host`. - * - * @param {Mixed} value to test - * @param {Mixed} host host to test with - * @return {Boolean} true if `value` is hosted by `host`, false otherwise - * @api public - */ - -is.hosted = function (value, host) { - var type = typeof host[value]; - return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type]; -}; - -/** - * is.instance - * Test if `value` is an instance of `constructor`. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an instance of `constructor` - * @api public - */ - -is.instance = is['instanceof'] = function (value, constructor) { - return value instanceof constructor; -}; - -/** - * is.null - * Test if `value` is null. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is null, false otherwise - * @api public - */ - -is['null'] = function (value) { - return value === null; -}; - -/** - * is.undefined - * Test if `value` is undefined. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is undefined, false otherwise - * @api public - */ - -is.undefined = function (value) { - return value === undefined; -}; - -/** - * Test arguments. - */ - -/** - * is.arguments - * Test if `value` is an arguments object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an arguments object, false otherwise - * @api public - */ - -is.arguments = function (value) { - var isStandardArguments = '[object Arguments]' === toString.call(value); - var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee); - return isStandardArguments || isOldArguments; -}; - -/** - * Test array. - */ - -/** - * is.array - * Test if 'value' is an array. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an array, false otherwise - * @api public - */ - -is.array = function (value) { - return '[object Array]' === toString.call(value); -}; - -/** - * is.arguments.empty - * Test if `value` is an empty arguments object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an empty arguments object, false otherwise - * @api public - */ -is.arguments.empty = function (value) { - return is.arguments(value) && value.length === 0; -}; - -/** - * is.array.empty - * Test if `value` is an empty array. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an empty array, false otherwise - * @api public - */ -is.array.empty = function (value) { - return is.array(value) && value.length === 0; -}; - -/** - * is.arraylike - * Test if `value` is an arraylike object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an arguments object, false otherwise - * @api public - */ - -is.arraylike = function (value) { - return !!value && !is.boolean(value) - && owns.call(value, 'length') - && isFinite(value.length) - && is.number(value.length) - && value.length >= 0; -}; - -/** - * Test boolean. - */ - -/** - * is.boolean - * Test if `value` is a boolean. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a boolean, false otherwise - * @api public - */ - -is.boolean = function (value) { - return '[object Boolean]' === toString.call(value); -}; - -/** - * is.false - * Test if `value` is false. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is false, false otherwise - * @api public - */ - -is['false'] = function (value) { - return is.boolean(value) && (value === false || value.valueOf() === false); -}; - -/** - * is.true - * Test if `value` is true. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is true, false otherwise - * @api public - */ - -is['true'] = function (value) { - return is.boolean(value) && (value === true || value.valueOf() === true); -}; - -/** - * Test date. - */ - -/** - * is.date - * Test if `value` is a date. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a date, false otherwise - * @api public - */ - -is.date = function (value) { - return '[object Date]' === toString.call(value); -}; - -/** - * Test element. - */ - -/** - * is.element - * Test if `value` is an html element. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an HTML Element, false otherwise - * @api public - */ - -is.element = function (value) { - return value !== undefined - && typeof HTMLElement !== 'undefined' - && value instanceof HTMLElement - && value.nodeType === 1; -}; - -/** - * Test error. - */ - -/** - * is.error - * Test if `value` is an error object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an error object, false otherwise - * @api public - */ - -is.error = function (value) { - return '[object Error]' === toString.call(value); -}; - -/** - * Test function. - */ - -/** - * is.fn / is.function (deprecated) - * Test if `value` is a function. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a function, false otherwise - * @api public - */ - -is.fn = is['function'] = function (value) { - var isAlert = typeof window !== 'undefined' && value === window.alert; - return isAlert || '[object Function]' === toString.call(value); -}; - -/** - * Test number. - */ - -/** - * is.number - * Test if `value` is a number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a number, false otherwise - * @api public - */ - -is.number = function (value) { - return '[object Number]' === toString.call(value); -}; - -/** - * is.infinite - * Test if `value` is positive or negative infinity. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is positive or negative Infinity, false otherwise - * @api public - */ -is.infinite = function (value) { - return value === Infinity || value === -Infinity; -}; - -/** - * is.decimal - * Test if `value` is a decimal number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a decimal number, false otherwise - * @api public - */ - -is.decimal = function (value) { - return is.number(value) && !isActualNaN(value) && value % 1 !== 0; -}; - -/** - * is.divisibleBy - * Test if `value` is divisible by `n`. - * - * @param {Number} value value to test - * @param {Number} n dividend - * @return {Boolean} true if `value` is divisible by `n`, false otherwise - * @api public - */ - -is.divisibleBy = function (value, n) { - var isDividendInfinite = is.infinite(value); - var isDivisorInfinite = is.infinite(n); - var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0; - return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0); -}; - -/** - * is.int - * Test if `value` is an integer. - * - * @param value to test - * @return {Boolean} true if `value` is an integer, false otherwise - * @api public - */ - -is.int = function (value) { - return is.number(value) && !isActualNaN(value) && value % 1 === 0; -}; - -/** - * is.maximum - * Test if `value` is greater than 'others' values. - * - * @param {Number} value value to test - * @param {Array} others values to compare with - * @return {Boolean} true if `value` is greater than `others` values - * @api public - */ - -is.maximum = function (value, others) { - if (isActualNaN(value)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.arraylike(others)) { - throw new TypeError('second argument must be array-like'); - } - var len = others.length; - - while (--len >= 0) { - if (value < others[len]) { - return false; - } - } - - return true; -}; - -/** - * is.minimum - * Test if `value` is less than `others` values. - * - * @param {Number} value value to test - * @param {Array} others values to compare with - * @return {Boolean} true if `value` is less than `others` values - * @api public - */ - -is.minimum = function (value, others) { - if (isActualNaN(value)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.arraylike(others)) { - throw new TypeError('second argument must be array-like'); - } - var len = others.length; - - while (--len >= 0) { - if (value > others[len]) { - return false; - } - } - - return true; -}; - -/** - * is.nan - * Test if `value` is not a number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is not a number, false otherwise - * @api public - */ - -is.nan = function (value) { - return !is.number(value) || value !== value; -}; - -/** - * is.even - * Test if `value` is an even number. - * - * @param {Number} value value to test - * @return {Boolean} true if `value` is an even number, false otherwise - * @api public - */ - -is.even = function (value) { - return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0); -}; - -/** - * is.odd - * Test if `value` is an odd number. - * - * @param {Number} value value to test - * @return {Boolean} true if `value` is an odd number, false otherwise - * @api public - */ - -is.odd = function (value) { - return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0); -}; - -/** - * is.ge - * Test if `value` is greater than or equal to `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} - * @api public - */ - -is.ge = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value >= other; -}; - -/** - * is.gt - * Test if `value` is greater than `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} - * @api public - */ - -is.gt = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value > other; -}; - -/** - * is.le - * Test if `value` is less than or equal to `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} if 'value' is less than or equal to 'other' - * @api public - */ - -is.le = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value <= other; -}; - -/** - * is.lt - * Test if `value` is less than `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} if `value` is less than `other` - * @api public - */ - -is.lt = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value < other; -}; - -/** - * is.within - * Test if `value` is within `start` and `finish`. - * - * @param {Number} value value to test - * @param {Number} start lower bound - * @param {Number} finish upper bound - * @return {Boolean} true if 'value' is is within 'start' and 'finish' - * @api public - */ -is.within = function (value, start, finish) { - if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.number(value) || !is.number(start) || !is.number(finish)) { - throw new TypeError('all arguments must be numbers'); - } - var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish); - return isAnyInfinite || (value >= start && value <= finish); -}; - -/** - * Test object. - */ - -/** - * is.object - * Test if `value` is an object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an object, false otherwise - * @api public - */ - -is.object = function (value) { - return value && '[object Object]' === toString.call(value); -}; - -/** - * is.hash - * Test if `value` is a hash - a plain object literal. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a hash, false otherwise - * @api public - */ - -is.hash = function (value) { - return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval; -}; - -/** - * Test regexp. - */ - -/** - * is.regexp - * Test if `value` is a regular expression. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a regexp, false otherwise - * @api public - */ - -is.regexp = function (value) { - return '[object RegExp]' === toString.call(value); -}; - -/** - * Test string. - */ - -/** - * is.string - * Test if `value` is a string. - * - * @param {Mixed} value value to test - * @return {Boolean} true if 'value' is a string, false otherwise - * @api public - */ - -is.string = function (value) { - return '[object String]' === toString.call(value); -}; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json deleted file mode 100644 index 975d47a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "is", - "author": { - "name": "Enrico Marino", - "url": "http://onirame.com" - }, - "description": "the definitive JavaScript type testing library", - "homepage": "https://github.com/enricomarino/is", - "keywords": [ - "util", - "type", - "test" - ], - "contributors": [ - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "dependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/enricomarino/is.git" - }, - "main": "index.js", - "version": "0.2.6", - "scripts": { - "test": "node test/index.js" - }, - "devDependencies": { - "tape": "~1.0.1", - "foreach": "~2.0.3" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0", - "chrome/22.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/5.0.5..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "engines": { - "node": "*" - }, - "readme": "# is\n\nThe definitive JavaScript type testing library\n\nTo be or not to be? This is the library!\n\n[![browser support][1]][2]\n\n## Installation\n\nAs a node.js module\n\n $ npm install is\n\nAs a component\n\n $ component install enricomarino/is\n\n## API\n\n### general\n\n - is.a (value, type) or is.type (value, type)\n - is.defined (value)\n - is.empty (value)\n - is.equal (value, other)\n - is.hosted (value, host)\n - is.instance (value, constructor)\n - is.instanceof (value, constructor) - deprecated, because in ES3 browsers, \"instanceof\" is a reserved word\n - is.null (value) - deprecated, because in ES3 browsers, \"null\" is a reserved word\n - is.undefined (value)\n\n### arguments\n\n - is.arguments (value)\n - is.arguments.empty (value)\n\n### array\n\n - is.array (value)\n - is.array.empty (value)\n - is.arraylike (value)\n\n### boolean\n\n - is.boolean (value)\n - is.false (value) - deprecated, because in ES3 browsers, \"false\" is a reserved word\n - is.true (value) - deprecated, because in ES3 browsers, \"true\" is a reserved word\n\n### date\n\n - is.date (value)\n\n### element\n\n - is.element (value)\n\n### error\n\n - is.error (value)\n\n### function\n\n - is.fn(value)\n - is.function(value) - deprecated, because in ES3 browsers, \"function\" is a reserved word\n\n### number\n\n - is.number (value)\n - is.infinite (value)\n - is.decimal (value)\n - is.divisibleBy (value, n)\n - is.int (value)\n - is.maximum (value, others)\n - is.minimum (value, others)\n - is.nan (value)\n - is.even (value)\n - is.odd (value)\n - is.ge (value, other)\n - is.gt (value, other)\n - is.le (value, other)\n - is.lt (value, other)\n - is.within (value, start, finish)\n\n### object\n\n - is.object (value)\n\n### regexp\n\n - is.regexp (value)\n\n### string\n\n - is.string (value)\n\n\n## Contributors\n\n- [Jordan Harband](https://github.com/ljharb)\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2013 Enrico Marino\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.\n\n[1]: https://ci.testling.com/enricomarino/is.png\n[2]: https://ci.testling.com/enricomarino/is\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/enricomarino/is/issues" - }, - "_id": "is@0.2.6", - "dist": { - "shasum": "36681b7c4328a75a6dd4b6d8f7131e4f81de55c0" - }, - "_from": "is@~0.2.6", - "_resolved": "https://registry.npmjs.org/is/-/is-0.2.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js deleted file mode 100644 index 32e1430..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js +++ /dev/null @@ -1,481 +0,0 @@ -var test = require('tape'); -var is = require('../index.js'); - -var forEach = require('foreach'); -var now = Date.now || function () { return +new Date(); }; - -test('is.type', function (t) { - var booleans = [true, false]; - forEach(booleans, function (boolean) { - t.ok(is.type(boolean, 'boolean'), '"' + boolean + '" is a boolean'); - }); - - var numbers = [1, 0 / 1, 0 / -1, NaN, Infinity, -Infinity]; - forEach(numbers, function (number) { - t.ok(is.type(number, 'number'), '"' + number + '" is a number'); - }); - - var objects = [{}, null, new Date()]; - forEach(objects, function (object) { - t.ok(is.type(object, 'object'), '"' + object + '" is an object'); - }); - - var strings = ['', 'abc']; - forEach(strings, function (string) { - t.ok(is.type(string, 'string'), '"' + string + '" is a string'); - }); - - t.ok(is.type(undefined, 'undefined'), 'undefined is undefined'); - - t.end(); -}); - -test('is.undefined', function (t) { - t.ok(is.undefined(), 'undefined is undefined'); - t.notOk(is.undefined(null), 'null is not undefined'); - t.notOk(is.undefined({}), 'object is not undefined'); - t.end(); -}); - -test('is.defined', function (t) { - t.notOk(is.defined(), 'undefined is not defined'); - t.ok(is.defined(null), 'null is defined'); - t.ok(is.defined({}), 'object is undefined'); - t.end(); -}); - -test('is.empty', function (t) { - t.ok(is.empty(''), 'empty string is empty'); - t.ok(is.empty([]), 'empty array is empty'); - t.ok(is.empty({}), 'empty object is empty'); - (function () { t.ok(is.empty(arguments), 'empty arguments is empty'); }()); - t.end(); -}); - -test('is.equal', function (t) { - t.ok(is.equal([1, 2, 3], [1, 2, 3]), 'arrays are shallowly equal'); - t.ok(is.equal([1, 2, [3, 4]], [1, 2, [3, 4]]), 'arrays are deep equal'); - t.ok(is.equal({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 }), 'objects are shallowly equal'); - t.ok(is.equal({ a: { b: 1 } }, { a: { b: 1 } }), 'objects are deep equal'); - var nowTS = now(); - t.ok(is.equal(new Date(nowTS), new Date(nowTS)), 'two equal date objects are equal'); - - var F = function () {}; - F.prototype = {}; - t.ok(is.equal(new F(), new F()), 'two object instances are equal when the prototype is the same'); - t.end(); -}); - -test('is.hosted', function (t) { - t.ok(is.hosted('a', { a: {} }), 'object is hosted'); - t.ok(is.hosted('a', { a: [] }), 'array is hosted'); - t.ok(is.hosted('a', { a: function () {} }), 'function is hosted'); - t.notOk(is.hosted('a', { a: true }), 'boolean value is not hosted'); - t.notOk(is.hosted('a', { a: false }), 'boolean value is not hosted'); - t.notOk(is.hosted('a', { a: 3 }), 'number value is not hosted'); - t.notOk(is.hosted('a', { a: undefined }), 'undefined value is not hosted'); - t.notOk(is.hosted('a', { a: 'abc' }), 'string value is not hosted'); - t.notOk(is.hosted('a', { a: null }), 'null value is not hosted'); - t.end(); -}); - -test('is.instance', function (t) { - t.ok(is.instance(new Date(), Date), 'new Date is instanceof Date'); - var F = function () {}; - t.ok(is.instance(new F(), F), 'new constructor is instanceof constructor'); - t.end(); -}); - -test('is.null', function (t) { - var isNull = is['null']; - t.ok(isNull(null), 'null is null'); - t.notOk(isNull(undefined), 'undefined is not null'); - t.notOk(isNull({}), 'object is not null'); - t.end(); -}); - -test('is.arguments', function (t) { - t.notOk(is.arguments([]), 'array is not arguments'); - (function () { t.ok(is.arguments(arguments), 'arguments is arguments'); }()); - (function () { t.notOk(is.arguments(Array.prototype.slice.call(arguments)), 'sliced arguments is not arguments'); }()); - t.end(); -}); - -test('is.array', function (t) { - t.ok(is.array([]), 'array is array'); - (function () { t.ok(is.array(Array.prototype.slice.call(arguments)), 'sliced arguments is array'); }()); - t.end(); -}); - -test('is.array.empty', function (t) { - t.ok(is.array.empty([]), 'empty array is empty array'); - (function () { t.notOk(is.array.empty(arguments), 'empty arguments is not empty array'); }()); - (function () { t.ok(is.array.empty(Array.prototype.slice.call(arguments)), 'empty sliced arguments is empty array'); }()); - t.end(); -}); - -test('is.arguments.empty', function (t) { - t.notOk(is.arguments.empty([]), 'empty array is not empty arguments'); - (function () { t.ok(is.arguments.empty(arguments), 'empty arguments is empty arguments'); }()); - (function () { t.notOk(is.arguments.empty(Array.prototype.slice.call(arguments)), 'empty sliced arguments is not empty arguments'); }()); - t.end(); -}); - -test('is.isarraylike', function (t) { - t.notOk(is.arraylike(), 'undefined is not array-like'); - t.notOk(is.arraylike(null), 'null is not array-like'); - t.notOk(is.arraylike(false), 'false is not array-like'); - t.notOk(is.arraylike(true), 'true is not array-like'); - t.ok(is.arraylike({ length: 0 }), 'object with zero length is array-like'); - t.ok(is.arraylike({ length: 1 }), 'object with positive length is array-like'); - t.notOk(is.arraylike({ length: -1 }), 'object with negative length is not array-like'); - t.notOk(is.arraylike({ length: NaN }), 'object with NaN length is not array-like'); - t.notOk(is.arraylike({ length: 'foo' }), 'object with string length is not array-like'); - t.notOk(is.arraylike({ length: '' }), 'object with empty string length is not array-like'); - t.ok(is.arraylike([]), 'array is array-like'); - (function () { t.ok(is.arraylike(arguments), 'empty arguments is array-like'); }()); - (function () { t.ok(is.arraylike(arguments), 'nonempty arguments is array-like'); }(1, 2, 3)); - t.end(); -}); - -test('is.boolean', function (t) { - t.ok(is.boolean(true), 'literal true is a boolean'); - t.ok(is.boolean(false), 'literal false is a boolean'); - t.ok(is.boolean(new Boolean(true)), 'object true is a boolean'); - t.ok(is.boolean(new Boolean(false)), 'object false is a boolean'); - t.notOk(is.boolean(), 'undefined is not a boolean'); - t.notOk(is.boolean(null), 'null is not a boolean'); - t.end(); -}); - -test('is.false', function (t) { - var isFalse = is['false']; - t.ok(isFalse(false), 'false is false'); - t.ok(isFalse(new Boolean(false)), 'object false is false'); - t.notOk(isFalse(true), 'true is not false'); - t.notOk(isFalse(), 'undefined is not false'); - t.notOk(isFalse(null), 'null is not false'); - t.notOk(isFalse(''), 'empty string is not false'); - t.end(); -}); - -test('is.true', function (t) { - var isTrue = is['true']; - t.ok(isTrue(true), 'true is true'); - t.ok(isTrue(new Boolean(true)), 'object true is true'); - t.notOk(isTrue(false), 'false is not true'); - t.notOk(isTrue(), 'undefined is not true'); - t.notOk(isTrue(null), 'null is not true'); - t.notOk(isTrue(''), 'empty string is not true'); - t.end(); -}); - -test('is.date', function (t) { - t.ok(is.date(new Date()), 'new Date is date'); - t.notOk(is.date(), 'undefined is not date'); - t.notOk(is.date(null), 'null is not date'); - t.notOk(is.date(''), 'empty string is not date'); - t.notOk(is.date(now()), 'timestamp is not date'); - var F = function () {}; - F.prototype = new Date(); - t.notOk(is.date(new F()), 'Date subtype is not date'); - t.end(); -}); - -test('is.element', function (t) { - if (typeof HTMLElement !== 'undefined') { - var element = document.createElement('div'); - t.ok(is.element(element), 'HTMLElement is element'); - t.notOk(is.element({ nodeType: 1 }), 'object with nodeType is not element'); - } else { - t.ok(true, 'Skipping is.element test in a non-browser environment'); - } - t.end(); -}); - -test('is.error', function (t) { - var err = new Error('foo'); - t.ok(is.error(err), 'Error is error'); - t.notOk(is.error({}), 'object is not error'); - t.notOk(is.error({ toString: function () { return '[object Error]'; } }), 'object with error\'s toString is not error'); - t.end(); -}); - -test('is.fn', function (t) { - t.equal(is['function'], is.fn, 'alias works'); - t.ok(is.fn(function () {}), 'function is function'); - t.ok(is.fn(console.log), 'console.log is function'); - if (typeof window !== 'undefined') { - // in IE7/8, typeof alert === 'object' - t.ok(is.fn(window.alert), 'window.alert is function'); - } - t.notOk(is.fn({}), 'object is not function'); - t.notOk(is.fn(null), 'null is not function'); - t.end(); -}); - -test('is.number', function (t) { - t.ok(is.number(0), 'positive zero is number'); - t.ok(is.number(0 / -1), 'negative zero is number'); - t.ok(is.number(3), 'three is number'); - t.ok(is.number(NaN), 'NaN is number'); - t.ok(is.number(Infinity), 'infinity is number'); - t.ok(is.number(-Infinity), 'negative infinity is number'); - t.ok(is.number(new Number(42)), 'object number is number'); - t.notOk(is.number(), 'undefined is not number'); - t.notOk(is.number(null), 'null is not number'); - t.notOk(is.number(true), 'true is not number'); - t.end(); -}); - -test('is.infinite', function (t) { - t.ok(is.infinite(Infinity), 'positive infinity is infinite'); - t.ok(is.infinite(-Infinity), 'negative infinity is infinite'); - t.notOk(is.infinite(NaN), 'NaN is not infinite'); - t.notOk(is.infinite(0), 'a number is not infinite'); - t.end(); -}); - -test('is.decimal', function (t) { - t.ok(is.decimal(1.1), 'decimal is decimal'); - t.notOk(is.decimal(0), 'zero is not decimal'); - t.notOk(is.decimal(1), 'integer is not decimal'); - t.notOk(is.decimal(NaN), 'NaN is not decimal'); - t.end(); -}); - -test('is.divisibleBy', function (t) { - t.ok(is.divisibleBy(4, 2), '4 is divisible by 2'); - t.ok(is.divisibleBy(4, 2), '4 is divisible by 2'); - t.ok(is.divisibleBy(0, 1), '0 is divisible by 1'); - t.ok(is.divisibleBy(Infinity, 1), 'infinity is divisible by anything'); - t.ok(is.divisibleBy(1, Infinity), 'anything is divisible by infinity'); - t.ok(is.divisibleBy(Infinity, Infinity), 'infinity is divisible by infinity'); - t.notOk(is.divisibleBy(1, 0), '1 is not divisible by 0'); - t.notOk(is.divisibleBy(NaN, 1), 'NaN is not divisible by 1'); - t.notOk(is.divisibleBy(1, NaN), '1 is not divisible by NaN'); - t.notOk(is.divisibleBy(NaN, NaN), 'NaN is not divisible by NaN'); - t.notOk(is.divisibleBy(1, 3), '1 is not divisible by 3'); - t.end(); -}); - -test('is.int', function (t) { - t.ok(is.int(0), '0 is integer'); - t.ok(is.int(3), '3 is integer'); - t.notOk(is.int(1.1), '1.1 is not integer'); - t.notOk(is.int(NaN), 'NaN is not integer'); - t.notOk(is.int(Infinity), 'infinity is not integer'); - t.notOk(is.int(null), 'null is not integer'); - t.notOk(is.int(), 'undefined is not integer'); - t.end(); -}); - -test('is.maximum', function (t) { - t.ok(is.maximum(3, [3, 2, 1]), '3 is maximum of [3,2,1]'); - t.ok(is.maximum(3, [1, 2, 3]), '3 is maximum of [1,2,3]'); - t.ok(is.maximum(4, [1, 2, 3]), '4 is maximum of [1,2,3]'); - t.ok(is.maximum('c', ['a', 'b', 'c']), 'c is maximum of [a,b,c]'); - t.notOk(is.maximum(2, [1, 2, 3]), '2 is not maximum of [1,2,3]'); - var error = new TypeError('second argument must be array-like'); - t.throws(function () { return is.maximum(2, null); }, error, 'throws when second value is not array-like'); - t.throws(function () { return is.maximum(2, {}); }, error, 'throws when second value is not array-like'); - t.end(); -}); - -test('is.minimum', function (t) { - t.ok(is.minimum(1, [1, 2, 3]), '1 is minimum of [1,2,3]'); - t.ok(is.minimum(0, [1, 2, 3]), '0 is minimum of [1,2,3]'); - t.ok(is.minimum('a', ['a', 'b', 'c']), 'a is minimum of [a,b,c]'); - t.notOk(is.minimum(2, [1, 2, 3]), '2 is not minimum of [1,2,3]'); - var error = new TypeError('second argument must be array-like'); - t.throws(function () { return is.minimum(2, null); }, error, 'throws when second value is not array-like'); - t.throws(function () { return is.minimum(2, {}); }, error, 'throws when second value is not array-like'); - t.end(); -}); - -test('is.nan', function (t) { - t.ok(is.nan(NaN), 'NaN is not a number'); - t.ok(is.nan('abc'), 'string is not a number'); - t.ok(is.nan(true), 'boolean is not a number'); - t.ok(is.nan({}), 'object is not a number'); - t.ok(is.nan([]), 'array is not a number'); - t.ok(is.nan(function () {}), 'function is not a number'); - t.notOk(is.nan(0), 'zero is a number'); - t.notOk(is.nan(3), 'three is a number'); - t.notOk(is.nan(1.1), '1.1 is a number'); - t.notOk(is.nan(Infinity), 'infinity is a number'); - t.end(); -}); - -test('is.even', function (t) { - t.ok(is.even(0), 'zero is even'); - t.ok(is.even(2), 'two is even'); - t.ok(is.even(Infinity), 'infinity is even'); - t.notOk(is.even(1), '1 is not even'); - t.notOk(is.even(), 'undefined is not even'); - t.notOk(is.even(null), 'null is not even'); - t.notOk(is.even(NaN), 'NaN is not even'); - t.end(); -}); - -test('is.odd', function (t) { - t.ok(is.odd(1), 'zero is odd'); - t.ok(is.odd(3), 'two is odd'); - t.ok(is.odd(Infinity), 'infinity is odd'); - t.notOk(is.odd(0), '0 is not odd'); - t.notOk(is.odd(2), '2 is not odd'); - t.notOk(is.odd(), 'undefined is not odd'); - t.notOk(is.odd(null), 'null is not odd'); - t.notOk(is.odd(NaN), 'NaN is not odd'); - t.end(); -}); - -test('is.ge', function (t) { - t.ok(is.ge(3, 2), '3 is greater than 2'); - t.notOk(is.ge(2, 3), '2 is not greater than 3'); - t.ok(is.ge(3, 3), '3 is greater than or equal to 3'); - t.ok(is.ge('abc', 'a'), 'abc is greater than a'); - t.ok(is.ge('abc', 'abc'), 'abc is greater than or equal to abc'); - t.notOk(is.ge('a', 'abc'), 'a is not greater than abc'); - t.notOk(is.ge(Infinity, 0), 'infinity is not greater than anything'); - t.notOk(is.ge(0, Infinity), 'anything is not greater than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.ge(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.ge(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.gt', function (t) { - t.ok(is.gt(3, 2), '3 is greater than 2'); - t.notOk(is.gt(2, 3), '2 is not greater than 3'); - t.notOk(is.gt(3, 3), '3 is not greater than 3'); - t.ok(is.gt('abc', 'a'), 'abc is greater than a'); - t.notOk(is.gt('abc', 'abc'), 'abc is not greater than abc'); - t.notOk(is.gt('a', 'abc'), 'a is not greater than abc'); - t.notOk(is.gt(Infinity, 0), 'infinity is not greater than anything'); - t.notOk(is.gt(0, Infinity), 'anything is not greater than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.gt(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.gt(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.le', function (t) { - t.ok(is.le(2, 3), '2 is lesser than or equal to 3'); - t.notOk(is.le(3, 2), '3 is not lesser than or equal to 2'); - t.ok(is.le(3, 3), '3 is lesser than or equal to 3'); - t.ok(is.le('a', 'abc'), 'a is lesser than or equal to abc'); - t.ok(is.le('abc', 'abc'), 'abc is lesser than or equal to abc'); - t.notOk(is.le('abc', 'a'), 'abc is not lesser than or equal to a'); - t.notOk(is.le(Infinity, 0), 'infinity is not lesser than or equal to anything'); - t.notOk(is.le(0, Infinity), 'anything is not lesser than or equal to infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.le(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.le(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.lt', function (t) { - t.ok(is.lt(2, 3), '2 is lesser than 3'); - t.notOk(is.lt(3, 2), '3 is not lesser than 2'); - t.notOk(is.lt(3, 3), '3 is not lesser than 3'); - t.ok(is.lt('a', 'abc'), 'a is lesser than abc'); - t.notOk(is.lt('abc', 'abc'), 'abc is not lesser than abc'); - t.notOk(is.lt('abc', 'a'), 'abc is not lesser than a'); - t.notOk(is.lt(Infinity, 0), 'infinity is not lesser than anything'); - t.notOk(is.lt(0, Infinity), 'anything is not lesser than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.lt(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.lt(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.within', function (t) { - var nanError = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.within(NaN, 0, 0); }, nanError, 'throws when first value is NaN'); - t.throws(function () { return is.within(0, NaN, 0); }, nanError, 'throws when second value is NaN'); - t.throws(function () { return is.within(0, 0, NaN); }, nanError, 'throws when third value is NaN'); - - var error = new TypeError('all arguments must be numbers'); - t.throws(function () { return is.within('', 0, 0); }, error, 'throws when first value is string'); - t.throws(function () { return is.within(0, '', 0); }, error, 'throws when second value is string'); - t.throws(function () { return is.within(0, 0, ''); }, error, 'throws when third value is string'); - t.throws(function () { return is.within({}, 0, 0); }, error, 'throws when first value is object'); - t.throws(function () { return is.within(0, {}, 0); }, error, 'throws when second value is object'); - t.throws(function () { return is.within(0, 0, {}); }, error, 'throws when third value is object'); - t.throws(function () { return is.within(null, 0, 0); }, error, 'throws when first value is null'); - t.throws(function () { return is.within(0, null, 0); }, error, 'throws when second value is null'); - t.throws(function () { return is.within(0, 0, null); }, error, 'throws when third value is null'); - t.throws(function () { return is.within(undefined, 0, 0); }, error, 'throws when first value is undefined'); - t.throws(function () { return is.within(0, undefined, 0); }, error, 'throws when second value is undefined'); - t.throws(function () { return is.within(0, 0, undefined); }, error, 'throws when third value is undefined'); - - t.ok(is.within(2, 1, 3), '2 is between 1 and 3'); - t.ok(is.within(0, -1, 1), '0 is between -1 and 1'); - t.ok(is.within(2, 0, Infinity), 'infinity always returns true'); - t.ok(is.within(2, Infinity, 2), 'infinity always returns true'); - t.ok(is.within(Infinity, 0, 1), 'infinity always returns true'); - t.notOk(is.within(2, -1, -1), '2 is not between -1 and 1'); - t.end(); -}); - -test('is.object', function (t) { - t.ok(is.object({}), 'object literal is object'); - t.notOk(is.object(), 'undefined is not an object'); - t.notOk(is.object(null), 'null is not an object'); - t.notOk(is.object(true), 'true is not an object'); - t.notOk(is.object(''), 'string is not an object'); - t.notOk(is.object(NaN), 'NaN is not an object'); - t.notOk(is.object(Object), 'object constructor is not an object'); - t.notOk(is.object(function () {}), 'function is not an object'); - t.end(); -}); - -test('is.hash', function (t) { - t.ok(is.hash({}), 'empty object literal is hash'); - t.ok(is.hash({ 1: 2, a: "b" }), 'object literal is hash'); - t.notOk(is.hash(), 'undefined is not a hash'); - t.notOk(is.hash(null), 'null is not a hash'); - t.notOk(is.hash(new Date()), 'date is not a hash'); - t.notOk(is.hash(new String()), 'string object is not a hash'); - t.notOk(is.hash(''), 'string literal is not a hash'); - t.notOk(is.hash(new Number()), 'number object is not a hash'); - t.notOk(is.hash(1), 'number literal is not a hash'); - t.notOk(is.hash(true), 'true is not a hash'); - t.notOk(is.hash(false), 'false is not a hash'); - t.notOk(is.hash(new Boolean()), 'boolean obj is not hash'); - t.notOk(is.hash(false), 'literal false is not hash'); - t.notOk(is.hash(true), 'literal true is not hash'); - if (typeof module !== 'undefined') { - t.ok(is.hash(module.exports), 'module.exports is a hash'); - } - if (typeof window !== 'undefined') { - t.notOk(is.hash(window), 'window is not a hash'); - t.notOk(is.hash(document.createElement('div')), 'element is not a hash'); - } else if (typeof process !== 'undefined') { - t.notOk(is.hash(global), 'global is not a hash'); - t.notOk(is.hash(process), 'process is not a hash'); - } - t.end(); -}); - -test('is.regexp', function (t) { - t.ok(is.regexp(/a/g), 'regex literal is regex'); - t.ok(is.regexp(new RegExp('a', 'g')), 'regex object is regex'); - t.notOk(is.regexp(), 'undefined is not regex'); - t.notOk(is.regexp(function () {}), 'function is not regex'); - t.notOk(is.regexp('/a/g'), 'string regex is not regex'); - t.end(); -}); - -test('is.string', function (t) { - t.ok(is.string('foo'), 'string literal is string'); - t.ok(is.string(new String('foo')), 'string literal is string'); - t.notOk(is.string(), 'undefined is not string'); - t.notOk(is.string(String), 'string constructor is not string'); - var F = function () {}; - F.prototype = new String(); - t.notOk(is.string(F), 'string subtype is not string'); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json deleted file mode 100644 index 4cb38a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "object-keys", - "version": "0.2.0", - "author": { - "name": "Jordan Harband" - }, - "description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/kriskowal/es5-shim", - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/object-keys.git" - }, - "keywords": [ - "Object.keys", - "keys", - "ES5", - "shim" - ], - "dependencies": { - "foreach": "~2.0.1", - "indexof": "~0.0.1", - "is": "~0.2.6" - }, - "devDependencies": { - "tape": "~1.0.2" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "readme": "#object-keys [![Version Badge][2]][1]\n\n[![Build Status][3]][4] [![dependency status][5]][6]\n\n[![browser support][7]][8]\n\nAn Object.keys shim. Uses Object.keys if available.\n\n## Example\n\n```js\nvar keys = require('object-keys');\nvar assert = require('assert');\nvar obj = {\n\ta: true,\n\tb: true,\n\tc: true\n};\n\nassert.equal(keys(obj), ['a', 'b', 'c']);\n```\n\n## Source\nImplementation taken directly from [9]\n\n## Tests\nTests currently use tape - which doesn't work in node 0.10, but works in browserify. Rest assured, they pass.\n\n[1]: https://npmjs.org/package/object-keys\n[2]: http://vb.teelaun.ch/ljharb/object-keys.svg\n[3]: https://travis-ci.org/ljharb/object-keys.png\n[4]: https://travis-ci.org/ljharb/object-keys\n[5]: https://david-dm.org/ljharb/object-keys.png\n[6]: https://david-dm.org/ljharb/object-keys\n[7]: https://ci.testling.com/ljharb/object-keys.png\n[8]: https://ci.testling.com/ljharb/object-keys\n[9]: https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js#L542-589\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/ljharb/object-keys/issues" - }, - "_id": "object-keys@0.2.0", - "dist": { - "shasum": "cddec02998b091be42bf1035ae32e49f1cb6ea67" - }, - "deprecated": "Please update to the latest object-keys", - "_from": "object-keys@~0.2.0", - "_resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.2.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js deleted file mode 100644 index 0d13f4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js +++ /dev/null @@ -1,44 +0,0 @@ -(function () { - "use strict"; - - // modified from https://github.com/kriskowal/es5-shim - var has = Object.prototype.hasOwnProperty, - is = require('is'), - forEach = require('foreach'), - hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString'), - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ], - keysShim; - - keysShim = function keys(object) { - if (!is.object(object) && !is.array(object)) { - throw new TypeError("Object.keys called on a non-object"); - } - - var name, theKeys = []; - for (name in object) { - if (has.call(object, name)) { - theKeys.push(name); - } - } - - if (hasDontEnumBug) { - forEach(dontEnums, function (dontEnum) { - if (has.call(object, dontEnum)) { - theKeys.push(dontEnum); - } - }); - } - return theKeys; - }; - - module.exports = keysShim; -}()); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js deleted file mode 100644 index 6673701..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js +++ /dev/null @@ -1,88 +0,0 @@ -var test = require('tape'); -var shimmedKeys = require('./index.js'); -var is = require('is'); -var keys = require('./shim.js'); -var forEach = require('foreach'); -var indexOf = require('indexof'); - -test('works', function (t) { - var obj = { - "str": "boz", - "obj": {}, - "arr": [], - "bool": true, - "num": 42, - "aNull": null, - "undef": undefined - }; - var objKeys = ['str', 'obj', 'arr', 'bool', 'num', 'aNull', 'undef']; - - t.test('exports a function', function (st) { - if (Object.keys) { - st.equal(Object.keys, shimmedKeys, 'Object.keys is supported and exported'); - } else { - st.equal(keys, shimmedKeys, 'Object.keys is not supported; shim is exported'); - } - st.end(); - }); - - t.test('working with actual shim', function (st) { - st.notEqual(Object.keys, keys, 'keys shim is not native Object.keys'); - st.end(); - }); - - t.test('works with an object literal', function (st) { - var theKeys = keys(obj); - st.equal(is.array(theKeys), true, 'returns an array'); - st.deepEqual(theKeys, objKeys, 'Object has expected keys'); - st.end(); - }); - - t.test('works with an array', function (st) { - var arr = [1, 2, 3]; - var theKeys = keys(arr); - st.equal(is.array(theKeys), true, 'returns an array'); - st.deepEqual(theKeys, ['0', '1', '2'], 'Array has expected keys'); - st.end(); - }); - - t.test('returns names which are own properties', function (st) { - forEach(keys(obj), function (name) { - st.equal(obj.hasOwnProperty(name), true, name + ' should be returned'); - }); - st.end(); - }); - - t.test('returns names which are enumerable', function (st) { - var k, loopedValues = []; - for (k in obj) { - loopedValues.push(k); - } - forEach(keys(obj), function (name) { - st.notEqual(indexOf(loopedValues, name), -1, name + ' is not enumerable'); - }); - st.end(); - }); - - t.test('throws an error for a non-object', function (st) { - st.throws( - function () { return keys(42); }, - new TypeError('Object.keys called on a non-object'), - 'throws on a non-object' - ); - st.end(); - }); - t.end(); -}); - -test('works with an object instance', function (t) { - var Prototype = function () {}; - Prototype.prototype.foo = true; - var obj = new Prototype(); - obj.bar = true; - var theKeys = keys(obj); - t.equal(is.array(theKeys), true, 'returns an array'); - t.deepEqual(theKeys, ['bar'], 'Instance has expected keys'); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json deleted file mode 100644 index 6552b71..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "xtend", - "version": "2.0.6", - "description": "extend like a boss", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "main": "index", - "scripts": { - "test": "node test" - }, - "dependencies": { - "is-object": "~0.1.2", - "object-keys": "~0.2.0" - }, - "devDependencies": { - "tape": "~1.0.2" - }, - "homepage": "https://github.com/Raynos/xtend", - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/raynos/xtend/raw/master/LICENSE" - } - ], - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "engines": { - "node": ">=0.4" - }, - "readme": "# xtend\n\n[![browser support][3]][4]\n\nExtend like a boss\n\nxtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes presedence.\n\n## Examples\n\n```js\nvar extend = require(\"xtend\")\n\nvar combination = extend({\n a: \"a\"\n}, {\n b: \"b\"\n})\n// { a: \"a\", b: \"b\" }\n```\n\n\n## MIT Licenced\n\n\n [3]: http://ci.testling.com/Raynos/xtend.png\n [4]: http://ci.testling.com/Raynos/xtend\n", - "readmeFilename": "README.md", - "_id": "xtend@2.0.6", - "dist": { - "shasum": "0b24228c06a6e7adf36447626c37ae73f8ae7f23" - }, - "_from": "xtend@~2.0.6", - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-2.0.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js deleted file mode 100644 index 3369d79..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js +++ /dev/null @@ -1,63 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json deleted file mode 100644 index 1277837..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "through2", - "version": "0.1.0", - "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", - "main": "through2.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/rvagg/through2.git" - }, - "keywords": [ - "stream", - "streams2", - "through", - "transform" - ], - "author": { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.2", - "xtend": "~2.0.6" - }, - "devDependencies": { - "tape": "~1.0.4", - "bl": "~0.2.0", - "stream-spigot": "~2.0.0" - }, - "readme": "# through2\n\n[![Build Status](https://secure.travis-ci.org/rvagg/through2.png)](http://travis-ci.org/rvagg/through2)\n\n[![NPM](https://nodei.co/npm/through2.png?compact=true)](https://nodei.co/npm/through2/) \n\n**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise**\n\nInspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.\n\n```js\nfs.createReadStream('ex.txt')\n .pipe(through2(function (chunk, enc, callback) {\n for (var i = 0; i < chunk.length; i++)\n if (chunk[i] == 97)\n chunk[i] = 122 // swap 'a' for 'z'\n this.push(chunk)\n callback()\n }))\n .pipe(fs.createWriteStream('out.txt'))\n```\n\nOr object streams:\n\n```js\nvar all = []\nfs.createReadStream('data.csv')\n .pipe(csv2())\n .pipe(through2({ objectMode: true }, function (chunk, enc, callback) {\n \tvar data = {\n name : chunk[0]\n , address : chunk[3]\n , phone : chunk[10]\n }\n this.push(data)\n callback()\n }))\n .on('data', function (data) {\n all.push(data)\n })\n .on('end', function () {\n doSomethingSpecial(all)\n })\n```\n\n## API\n\nthrough2([ options, ] transformFunction[, flushFunction ])\n\nConsult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).\n\n### options\n\nThe options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams.\n\nThe `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:\n\n```js\nfs.createReadStream('/tmp/important.dat')\n\t.pipe(through2({ objectMode: true, allowHalfOpen: false }, function (chunk, enc, cb) {\n\t\tthis.push(new Buffer('wut?'))\n \tcb()\n\t})\n .pipe(fs.createWriteStream('/tmp/wut.txt'))\n```\n\n### transformFunction\n\nThe `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.\n\nTo queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on.\n\n### flushFunction\n\nThe optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.\n\nthrough2.ctor([ options, ] transformFunction[, flushFunction ])\n\nInstead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.\n\n```js\nvar FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {\n if (record.temp != null && record.unit = \"F\") {\n record.temp = ( ( record.temp - 32 ) * 5 ) / 9\n record.unit = \"C\"\n }\n this.push(record)\n callback()\n})\n\n// Create instances of FToC like so:\nvar converter = new FToC()\n// Or:\nvar converter = FToC()\n// Or specify/override options when you instantiate, if you prefer:\nvar converter = FToC({objectMode: true})\n\n```\n\n## License\n\n**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/rvagg/through2/issues" - }, - "_id": "through2@0.1.0", - "dist": { - "shasum": "18d0402eec882cf582ca4945ffbe7f205e7a9bc5" - }, - "_from": "through2@~0.1.0", - "_resolved": "https://registry.npmjs.org/through2/-/through2-0.1.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js deleted file mode 100644 index 13a328f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js +++ /dev/null @@ -1,314 +0,0 @@ -const test = require('tape') - , through2 = require('./') - , crypto = require('crypto') - , bl = require('bl') - , spigot = require('stream-spigot') - -test('plain through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('pipeable through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - // bl() acts like a proper streams2 stream and passes as much as it's - // asked for, so we really only get one write with such a small amount - // of data - t.equal(s, 'aaaaaaaaaaaaaaaaaaaaaaaaa', 'got transformed string') - t.end() - })) - - var bufs = bl() - bufs.append(crypto.randomBytes(10)) - bufs.append(crypto.randomBytes(5)) - bufs.append(crypto.randomBytes(10)) - bufs.pipe(th2) -}) - -test('object through', function (t) { - t.plan(3) - - var th2 = through2({ objectMode: true}, function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('flushing through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }, function (callback) { - this.push(new Buffer([ 101, 110, 100 ])) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal(s, 'aaaaaaaaaabbbbbccccccccccend', 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('plain through ctor', function (t) { - var Th2 = through2.ctor(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - var th2 = new Th2() - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('reuse through ctor', function (t) { - t.plan(4) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - if (!this._i) { - t.ok(1, 'did not contain previous instance data (this._i)') - this._i = 97 // 'a' - } else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - var th2 = Th2() - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - - var newInstance = Th2() - newInstance.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaabbbbccccccc', s, 'got transformed string') - })) - - newInstance.write(crypto.randomBytes(7)) - newInstance.write(crypto.randomBytes(4)) - newInstance.write(crypto.randomBytes(7)) - newInstance.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('object through ctor', function (t) { - t.plan(3) - - var Th2 = through2.ctor({ objectMode: true}, function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = new Th2() - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('pipeable object through ctor', function (t) { - t.plan(4) - - var Th2 = through2.ctor({ objectMode: true}, function (record, enc, callback) { - if (record.temp != null && record.unit == 'F') { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = 'C' - } - this.push(record) - callback() - }) - - var th2 = Th2() - - var expect = [-19, -40, 100, 22] - th2.on('data', function (o) { - t.deepEqual(o, { temp: expect.shift(), unit: 'C' }, 'got transformed object') - }) - - spigot([ - {temp: -2.2, unit: 'F'}, - {temp: -40, unit: 'F'}, - {temp: 212, unit: 'F'}, - {temp: 22, unit: 'C'} - ], {objectMode: true}).pipe(th2) -}) - -test('object through ctor override', function (t) { - t.plan(3) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({objectMode: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object settings available in transform', function (t) { - t.plan(6) - - var Th2 = through2.ctor({objectMode: true, peek: true}, function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2() - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object settings available in transform override', function (t) { - t.plan(6) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({objectMode: true, peek: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object override extends options', function (t) { - t.plan(6) - - var Th2 = through2.ctor({objectMode: true}, function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({peek: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js deleted file mode 100644 index c1d1329..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js +++ /dev/null @@ -1,35 +0,0 @@ -const Transform = require('stream').Transform || require('readable-stream/transform') - , inherits = require('util').inherits - , xtend = require('xtend') - -function ctor (options, transform, flush) { - if (typeof options == 'function') { - flush = transform - transform = options - options = {} - } - - function Through2 (override) { - if (!(this instanceof Through2)) - return new Through2(override) - - this.options = xtend(options, override) - Transform.call(this, this.options) - } - - inherits(Through2, Transform) - - Through2.prototype._transform = transform - - if (typeof flush == 'function') - Through2.prototype._flush = flush - - return Through2 -} - -function make (options, transform, flush) { - return ctor(options, transform, flush)() -} - -module.exports = make -module.exports.ctor = ctor \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/package.json deleted file mode 100644 index c86ddfb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "download", - "version": "0.1.7", - "description": "Download and extract files effortlessly", - "keywords": [ - "url", - "http", - "download", - "extract" - ], - "homepage": "https://github.com/kevva/download", - "bugs": { - "url": "https://github.com/kevva/download/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/download.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "download.js", - "files": [ - "download.js" - ], - "dependencies": { - "decompress": "~0.1.0", - "mkdirp": "~0.3.5", - "request": "~2.25.0", - "through2": "~0.1.0", - "async-foreach": "~0.1.3" - }, - "devDependencies": { - "mocha": "~1.12.0", - "rimraf": "~2.2.2" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# download [![Build Status](https://secure.travis-ci.org/kevva/download.png?branch=master)](http://travis-ci.org/kevva/download)\n\nDownload and extract files effortlessly in Node.js.\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/download): `npm install download`\n\n## Examples\n\nIf you're fetching an archive you can set `extract: true` in options and \nit'll extract it for you.\n\n```js\nvar download = require('download');\n\n// download and extract `foo.tar.gz` into `bar/`\ndownload('foo.tar.gz', 'bar', { extract: true });\n\n// download and save `foo.exe` into `bar/foo.exe` with mode `0755`\ndownload('foo.exe', 'bar', { mode: '0755' });\n\n// download and save an array of files in `bar/`\nvar files = ['foo.jpg', 'bar.jpg', 'cat.jpg'];\ndownload(files, 'bar');\n```\n\n## API\n\n### download(url, dest, opts)\n\nDownload a file or an array of files to a given destination.\n\n## Options\n\n* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/)\n* `mode` — Set mode on the downloaded files\n* `strip` — Equivalent to `--strip-components` for tar\n\nYou can also define options accepted by the [request](https://github.com/mikeal/request/) module.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "download@0.1.7", - "dist": { - "shasum": "78be2278a5600e515eff6b01cbf41d694baee855" - }, - "_from": "download@~0.1.2", - "_resolved": "https://registry.npmjs.org/download/-/download-0.1.7.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/.npmignore deleted file mode 100644 index 2ccbe46..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/.travis.yml deleted file mode 100644 index c1ffcb3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/History.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/History.md deleted file mode 100644 index d1fa533..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/History.md +++ /dev/null @@ -1,20 +0,0 @@ - -0.0.2 / 2013-05-29 -================== - - * Updated github url - * Fix bug calling isbin with list of paths - * Add tests for sync version - * Added travis CI passing image to readme - * Added node engines and keywords - * Added travis CI config - * Added basic readme - * Added basic test suite and Makefile - * Add async version - * Some refactorings using 'some' function - * Fixed issue with wrong paths if called multiple times - -0.0.1 / 2012-12-06 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/Makefile deleted file mode 100644 index 1a2444a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -REPORTER ?= dot - -test: - @NODE_ENV=test ./node_modules/mocha/bin/mocha -R $(REPORTER) - -.PHONY: test diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/README.md deleted file mode 100644 index 5224d61..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/README.md +++ /dev/null @@ -1,59 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/mbehrendt/isbin.png?branch=master)](https://travis-ci.org/mbehrendt/isbin) - -# Isbin - -Tiny little helper library to determine if a certain binary is available within $PATH or any additional folder. - -# Installation - -```bash -$ npm install isbin -``` - -# Usage - -```js -var isbin = require('isbin'); - -// Test against $PATH -isbin('mysql', function(exists) { - console.log(exists); // ==> Boolean -}); - -// With additional path to test -isbin('mysql', '/usr/local/bin', function(exists) { - console.log(exists); // ==> Boolean -}); - -// Or multiple ones -isbin('mysql', ['/usr/local/bin', '/home/me/bins'], function(exists) { - console.log(exists); // ==> Boolean -}); -``` - -There are also synchronous versions available - -```js -var exists = isbin('mysql'); -var exists = isbin('mysql', '/usr/local/bin'); -var exists = isbin('mysql', ['/usr/local/bin', '/home/me/bins']); -``` - -# Running the tests - -```bash -$ npm install -$ make test -``` - -# License - -(The MIT License) - -Copyright (c) 2012 Mario Behrendt info@mario-behrendt.de, Stephan Hoyer - -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/index.js deleted file mode 100644 index bb0a047..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/lib/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/lib/index.js deleted file mode 100644 index 1b8a5ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/lib/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Require dependencies - */ - -var fs = require('fs') - , async = require('async'); - -/** - * Check if given binary exists - * - * @param {String} bin Binary to test - * @param {String|Array} additional Additional paths to check - * @param {Function(result)} isbinChecked Callback when check is done async, optional - * @return {Boolean} True if binary was found - */ - -function isbin(bin, additional, isbinChecked) { - // isbin(bin, cb) - if (!isbinChecked) isbinChecked = additional; - - // Read $PATH to get set up bin folders - var paths = process.env.PATH.split(':') || []; - - // isbin(bin, 'path', cb) - if ('string' === typeof additional) { - paths.push(additional); - } - - // isbin(bin, ['path1', 'path2'], cb) - if ('object' === typeof additional && additional.length !== null) { - paths.concat(additional); - } - - // async check - if ('function' === typeof isbinChecked) { - return async.some(paths, function(path, pathChecked) { - fs.exists(path + '/' + bin, pathChecked); - }, isbinChecked); - } - - // sync check - return paths.reverse().some(function(path) { - return fs.existsSync(path + '/' + bin); - }); -}; - -/** - * Expose module - */ - -module.exports = isbin; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules deleted file mode 100644 index a9aae98..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "deps/nodeunit"] - path = deps/nodeunit - url = git://github.com/caolan/nodeunit.git -[submodule "deps/UglifyJS"] - path = deps/UglifyJS - url = https://github.com/mishoo/UglifyJS.git -[submodule "deps/nodelint"] - path = deps/nodelint - url = https://github.com/tav/nodelint.git diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -deps -dist -test -nodelint.cfg \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile deleted file mode 100644 index bad647c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -PACKAGE = asyncjs -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) -CWD := $(shell pwd) -NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit -UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs -NODELINT = $(CWD)/node_modules/nodelint/nodelint - -BUILDDIR = dist - -all: clean test build - -build: $(wildcard lib/*.js) - mkdir -p $(BUILDDIR) - $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js - -test: - $(NODEUNIT) test - -clean: - rm -rf $(BUILDDIR) - -lint: - $(NODELINT) --config nodelint.cfg lib/async.js - -.PHONY: test build all diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md deleted file mode 100644 index 1bbbc47..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md +++ /dev/null @@ -1,1021 +0,0 @@ -# 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. - -Async provides around 20 functions that include the usual 'functional' -suspects (map, reduce, filter, forEach…) 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 - - 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'], path.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. - - -## Download - -Releases are available for download from -[GitHub](http://github.com/caolan/async/downloads). -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) - 17.5kb Uncompressed - -__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped - - -## In the Browser - -So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: - - - - - -## Documentation - -### Collections - -* [forEach](#forEach) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [until](#until) -* [waterfall](#waterfall) -* [queue](#queue) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - -
    -### forEach(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 forEach 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 which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // assuming openFiles is an array of file names and saveFile is a function - // to save the modified contents of that file: - - async.forEach(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error - }); - ---------------------------------------- - - -### forEachSeries(arr, iterator, callback) - -The same as forEach 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. - - ---------------------------------------- - - -### forEachLimit(arr, limit, iterator, callback) - -The same as forEach only the iterator is applied to batches of items in the -array, in series. The next batch of iterators is only called once the current -one has completed processing. - -__Arguments__ - -* arr - An array to iterate over. -* limit - How many items should be in each batch. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // Assume documents is an array of JSON objects and requestApi is a - // function that interacts with a rate-limited REST api. - - async.forEachLimit(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 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__ - - 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. - - ---------------------------------------- - - -### 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 path.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 which must be called once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - - async.filter(['file1','file2','file3'], path.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 filter, 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 its 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 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__ - - 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 which must be called 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__ - - async.detect(['file1','file2','file3'], path.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 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__ - - 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 path.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 which must be called 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__ - - async.some(['file1','file2','file3'], path.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 path.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 which must be called 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__ - - async.every(['file1','file2','file3'], path.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 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__ - - 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 it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - 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 it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - 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} - }); - - ---------------------------------------- - - -### 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 which must be called once it has completed with an optional - error as the first argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - - var count = 0; - - async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } - ); - - ---------------------------------------- - - -### 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. - - ---------------------------------------- - - -### 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 it - must call on completion. -* 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__ - - 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' - }); - - ---------------------------------------- - - -### 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. -* 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. -* 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__ - - // 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'); - }); - - ---------------------------------------- - - -### 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. - -__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 - syntax is easier to understand by looking at the example. -* 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. If all tasks complete - successfully, it will receive an object containing their results. - -__Example__ - - 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: - - 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(results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - email_link: 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. Its 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, each function is passed a callback it - must call on completion. - -__Example__ - - 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__ - - // 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: - - 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 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__ - - var call_order = []; - async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two] - }); - call_order.push('one') - - -## 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. - -__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__ - - 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__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); - }; - - 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__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); - }; - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js deleted file mode 100644 index 8e23845..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// This file is just added for convenience so this repository can be -// directly checked out into a project's deps folder -module.exports = require('./lib/async'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js deleted file mode 100644 index 7cc4f5e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js +++ /dev/null @@ -1,692 +0,0 @@ -/*global setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root = this, - previous_async = root.async; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - else { - root.async = async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - //// cross-browser compatiblity functions //// - - var _forEach = 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 = []; - _forEach(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); - } - _forEach(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)) { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - } - else { - async.nextTick = process.nextTick; - } - - async.forEach = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _forEach(arr, function (x) { - iterator(x, function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - } - }); - }); - }; - - async.forEachSeries = 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.forEachLimit = function (arr, limit, 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.forEach].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEachSeries].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); - - - // 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.forEachSeries(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.forEach(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.forEach(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 () { - _forEach(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _forEach(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - if (err) { - callback(err); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - 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.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback(err); - 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.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - async.parallel = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.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 = {}; - async.forEach(_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.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.forEachSeries(_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.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.queue = function (worker, concurrency) { - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _forEach(data, function(task) { - q.tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (q.saturated && q.tasks.length == concurrency) { - q.saturated(); - } - async.nextTick(q.process); - }); - }, - 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; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if(q.drain && q.tasks.length + workers == 0) q.drain(); - q.process(); - }); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - 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]) { - _forEach(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.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - -}()); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json deleted file mode 100644 index 5e515b9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./index", - "author": { - "name": "Caolan McMahon" - }, - "version": "0.1.22", - "repository": { - "type": "git", - "url": "http://github.com/caolan/async.git" - }, - "bugs": { - "url": "http://github.com/caolan/async/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\n ]);\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n \n \n\n\n## Documentation\n\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\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### forEach(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 forEach 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 which must be called once it has completed.\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 // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach 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### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\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 // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\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 which must be called once it has completed\n 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 async.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### 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### 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 path.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 which must be called 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 async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\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 filter, 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 its 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 which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n 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 async.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### 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 which must be called 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 async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\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 which must be called once it has completed\n with an error (which can be null) and a value to use as the sort 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 async.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 path.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 which must be called 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 async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\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 path.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 which must be called 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 async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\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 which must be called once it has completed\n 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 async.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### 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 it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.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\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.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 },\n function(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 a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.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\n function(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\n async.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 },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\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 which must be called once it has completed with an optional\n error as the first 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 var count = 0;\n\n async.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### 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\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 callback it\n must call on completion.\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 async.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\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.\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* 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 // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n\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\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 syntax is easier to understand by looking at the example.\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. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.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\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n async.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 ],\n function(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 email_link: function(callback){\n // once the file is written let's email a link to it...\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. Its 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, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> 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 // using apply\n\n async.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\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\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 setTimeout(callback, 0),\nwhich means other higher priority events 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 var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\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\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 var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\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 var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> 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 var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> 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", - "_id": "async@0.1.22", - "_from": "async@0.1.22", - "scripts": {}, - "dist": { - "shasum": "3b270eedc0419d6f92a664444ce98e0f59a8fef7" - }, - "_resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/package.json deleted file mode 100644 index d5ca65e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "isbin", - "version": "0.0.2", - "description": "Checks for available binaries on unix machines", - "main": "index.js", - "engines": { - "node": ">= 0.8.0" - }, - "keywords": [ - "fs", - "bin", - "binary", - "exists", - "check", - "path" - ], - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/behrendtio/isbin.git" - }, - "author": "", - "license": "MIT", - "dependencies": { - "async": "0.1.22" - }, - "devDependencies": { - "mocha": "1.7.3", - "should": "1.2.1" - }, - "readme": "[![Build Status](https://secure.travis-ci.org/mbehrendt/isbin.png?branch=master)](https://travis-ci.org/mbehrendt/isbin)\n\n# Isbin\n\nTiny little helper library to determine if a certain binary is available within $PATH or any additional folder.\n\n# Installation\n\n```bash\n$ npm install isbin\n```\n\n# Usage\n\n```js\nvar isbin = require('isbin');\n\n// Test against $PATH\nisbin('mysql', function(exists) {\n console.log(exists); // ==> Boolean\n});\n\n// With additional path to test\nisbin('mysql', '/usr/local/bin', function(exists) {\n console.log(exists); // ==> Boolean\n});\n\n// Or multiple ones\nisbin('mysql', ['/usr/local/bin', '/home/me/bins'], function(exists) {\n console.log(exists); // ==> Boolean\n});\n```\n\nThere are also synchronous versions available\n\n```js\nvar exists = isbin('mysql');\nvar exists = isbin('mysql', '/usr/local/bin');\nvar exists = isbin('mysql', ['/usr/local/bin', '/home/me/bins']);\n```\n\n# Running the tests\n\n```bash\n$ npm install\n$ make test\n```\n\n# License\n\n(The MIT License)\n\nCopyright (c) 2012 Mario Behrendt info@mario-behrendt.de, Stephan Hoyer \n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/behrendtio/isbin/issues" - }, - "_id": "isbin@0.0.2", - "dist": { - "shasum": "2a35fb234ad5ee30f78da61b57e8f42ac43ec5a4" - }, - "_from": "isbin@0.0.2", - "_resolved": "https://registry.npmjs.org/isbin/-/isbin-0.0.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js deleted file mode 100644 index 068a38a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js +++ /dev/null @@ -1,39 +0,0 @@ -var isbin = require('../'); - -describe('isbin', function() { - it('accepts binary, additional path and callback', function(done) { - isbin('ls', '/etc', function(exists) { - exists.should.be.a('boolean'); - done(); - }) - }); - - it('accepts array of paths', function(done) { - isbin('ls', ['/etc', '/home'], function(exists) { - exists.should.be.a('boolean'); - done(); - }); - }); - - it('accepts just binary and callback', function(done) { - isbin('ls', function(exists) { - exists.should.be.a('boolean'); - done(); - }); - }); - - it('accepts binary, additional path and callback', function() { - var exists = isbin('ls', '/etc'); - exists.should.be.a('boolean'); - }); - - it('accepts array of paths', function() { - var exists = isbin('ls', ['/etc', '/home']); - exists.should.be.a('boolean'); - }); - - it('accepts just binary', function() { - var exists = isbin('ls'); - exists.should.be.a('boolean'); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts deleted file mode 100644 index e5eb9f8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---require should ---bail ---ui bdd ---slow 100 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.editorconfig b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.editorconfig deleted file mode 100644 index e036e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -; 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.jshintrc b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.jshintrc deleted file mode 100644 index bbdb29c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.jshintrc +++ /dev/null @@ -1,69 +0,0 @@ -{ - // 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.npmignore deleted file mode 100644 index 1341acd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.npmignore +++ /dev/null @@ -1,30 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.travis.yml deleted file mode 100644 index 36de153..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md deleted file mode 100644 index 0f5eac1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md +++ /dev/null @@ -1,93 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md deleted file mode 100644 index 65d9add..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md +++ /dev/null @@ -1,61 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/LICENSE.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/LICENSE.md deleted file mode 100644 index e9ccc2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/README.md deleted file mode 100644 index 872943b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/README.md +++ /dev/null @@ -1,63 +0,0 @@ -![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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array.js deleted file mode 100644 index 89d388b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array.js +++ /dev/null @@ -1,46 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/append.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/append.js deleted file mode 100644 index bf74037..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/append.js +++ /dev/null @@ -1,21 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/collect.js deleted file mode 100644 index 5863749..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/collect.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/combine.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/combine.js deleted file mode 100644 index d66e621..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/combine.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/compact.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/compact.js deleted file mode 100644 index 74c176e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/compact.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/contains.js deleted file mode 100644 index 92bb6ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/contains.js +++ /dev/null @@ -1,10 +0,0 @@ -var indexOf = require('./indexOf'); - - /** - * If array contains values. - */ - function contains(arr, val) { - return indexOf(arr, val) !== -1; - } - module.exports = contains; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/difference.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/difference.js deleted file mode 100644 index d057051..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/difference.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/every.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/every.js deleted file mode 100644 index ac59883..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/every.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/filter.js deleted file mode 100644 index ebeb58d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/filter.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/find.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/find.js deleted file mode 100644 index b4a7313..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/find.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js deleted file mode 100644 index 53f22a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/flatten.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/flatten.js deleted file mode 100644 index aa9757a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/flatten.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/forEach.js deleted file mode 100644 index 268e506..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/forEach.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js deleted file mode 100644 index 6a9ac83..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/insert.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/insert.js deleted file mode 100644 index f1f95b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/insert.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/intersection.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/intersection.js deleted file mode 100644 index e617006..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/intersection.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/invoke.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/invoke.js deleted file mode 100644 index c01aab1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/invoke.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/join.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/join.js deleted file mode 100644 index 71d8bd2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/join.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js deleted file mode 100644 index ee44a25..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/map.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/map.js deleted file mode 100644 index 54064f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/map.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/max.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/max.js deleted file mode 100644 index 183b10e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/max.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/min.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/min.js deleted file mode 100644 index dd00b6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/min.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/pick.js deleted file mode 100644 index 6a54846..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/pick.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/pluck.js deleted file mode 100644 index fef4043..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -var map = require('./map'); - - /** - * Extract a list of property values. - */ - function pluck(arr, propName){ - return map(arr, propName); - } - - module.exports = pluck; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/range.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/range.js deleted file mode 100644 index 31d3c77..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/range.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reduce.js deleted file mode 100644 index 1a350c6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reduce.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js deleted file mode 100644 index e36fd4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js +++ /dev/null @@ -1,34 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reject.js deleted file mode 100644 index 685f291..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/reject.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/remove.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/remove.js deleted file mode 100644 index aa6517d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/remove.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js deleted file mode 100644 index d5f7f3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js deleted file mode 100644 index 97805ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/some.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/some.js deleted file mode 100644 index 8d17772..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/some.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/sort.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/sort.js deleted file mode 100644 index 7807339..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/sort.js +++ /dev/null @@ -1,55 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/split.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/split.js deleted file mode 100644 index 4f3ba50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/split.js +++ /dev/null @@ -1,35 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js deleted file mode 100644 index ce4c55d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/union.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/union.js deleted file mode 100644 index f1334a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/union.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/unique.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/unique.js deleted file mode 100644 index 0192b2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/unique.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/xor.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/xor.js deleted file mode 100644 index c125a99..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/xor.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/zip.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/zip.js deleted file mode 100644 index 931eb81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/array/zip.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection.js deleted file mode 100644 index d5cf6ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection.js +++ /dev/null @@ -1,22 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/contains.js deleted file mode 100644 index a73f994..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/contains.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrContains = require('../array/contains'); -var objContains = require('../object/contains'); - - /** - */ - module.exports = make(arrContains, objContains); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/every.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/every.js deleted file mode 100644 index 300e03c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/every.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrEvery = require('../array/every'); -var objEvery = require('../object/every'); - - /** - */ - module.exports = make(arrEvery, objEvery); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/filter.js deleted file mode 100644 index 3875700..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/filter.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/find.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/find.js deleted file mode 100644 index 14317e6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/find.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js deleted file mode 100644 index 6e28dcb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrForEach = require('../array/forEach'); -var objForEach = require('../object/forOwn'); - - /** - */ - module.exports = make(arrForEach, objForEach); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/make_.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/make_.js deleted file mode 100644 index 029d27b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/make_.js +++ /dev/null @@ -1,19 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/map.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/map.js deleted file mode 100644 index fc157f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/map.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/max.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/max.js deleted file mode 100644 index a8490e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/max.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/min.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/min.js deleted file mode 100644 index 51d9f14..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/min.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js deleted file mode 100644 index 9b28377..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js deleted file mode 100644 index 4c07573..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrReduce = require('../array/reduce'); -var objReduce = require('../object/reduce'); - - /** - */ - module.exports = make(arrReduce, objReduce); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/reject.js deleted file mode 100644 index 2a92e3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/reject.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/size.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/size.js deleted file mode 100644 index 244e33e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/size.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/some.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/some.js deleted file mode 100644 index 48fd252..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/collection/some.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrSome = require('../array/some'); -var objSome = require('../object/some'); - - /** - */ - module.exports = make(arrSome, objSome); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date.js deleted file mode 100644 index 1cde1a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date.js +++ /dev/null @@ -1,21 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js deleted file mode 100644 index 85905c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/diff.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/diff.js deleted file mode 100644 index 1131cdc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/diff.js +++ /dev/null @@ -1,130 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js deleted file mode 100644 index f9526ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js +++ /dev/null @@ -1,61 +0,0 @@ - - // 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js deleted file mode 100644 index 71ebadb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js +++ /dev/null @@ -1,61 +0,0 @@ - - // 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js deleted file mode 100644 index 723fc10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js deleted file mode 100644 index 4212870..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/isSame.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/isSame.js deleted file mode 100644 index 4097d29..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/isSame.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js deleted file mode 100644 index 8ea2b17..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js +++ /dev/null @@ -1,146 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/startOf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/startOf.js deleted file mode 100644 index 072bc0e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/startOf.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/strftime.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/strftime.js deleted file mode 100644 index f033d10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/strftime.js +++ /dev/null @@ -1,118 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js deleted file mode 100644 index b100687..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js deleted file mode 100644 index 9492dce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js deleted file mode 100644 index 8aafeb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js deleted file mode 100644 index b4b7e9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js deleted file mode 100644 index dd51b7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/array.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/array.md deleted file mode 100644 index 1f390fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/array.md +++ /dev/null @@ -1,773 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/collection.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/collection.md deleted file mode 100644 index 2ffcab1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/collection.md +++ /dev/null @@ -1,233 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/date.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/date.md deleted file mode 100644 index b3f7f40..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/date.md +++ /dev/null @@ -1,295 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/function.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/function.md deleted file mode 100644 index 2695a02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/function.md +++ /dev/null @@ -1,174 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/lang.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/lang.md deleted file mode 100644 index 56d7879..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/lang.md +++ /dev/null @@ -1,385 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/math.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/math.md deleted file mode 100644 index f45be3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/math.md +++ /dev/null @@ -1,298 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/number.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/number.md deleted file mode 100644 index 8d93865..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/number.md +++ /dev/null @@ -1,225 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/object.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/object.md deleted file mode 100644 index b4d5e48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/object.md +++ /dev/null @@ -1,780 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md deleted file mode 100644 index 1be3c10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md +++ /dev/null @@ -1,115 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/random.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/random.md deleted file mode 100644 index b058b4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/random.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/string.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/string.md deleted file mode 100644 index 2b28231..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/string.md +++ /dev/null @@ -1,594 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/time.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/time.md deleted file mode 100644 index 628c2a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/doc/time.md +++ /dev/null @@ -1,64 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function.js deleted file mode 100644 index 43a16ef..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function.js +++ /dev/null @@ -1,18 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/bind.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/bind.js deleted file mode 100644 index 71bc125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/bind.js +++ /dev/null @@ -1,23 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/compose.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/compose.js deleted file mode 100644 index 8cd5c5f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/compose.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/debounce.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/debounce.js deleted file mode 100644 index a0ed07f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/debounce.js +++ /dev/null @@ -1,29 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/func.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/func.js deleted file mode 100644 index b81bf0a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/func.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js deleted file mode 100644 index 767610a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/partial.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/partial.js deleted file mode 100644 index d63ff1b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/partial.js +++ /dev/null @@ -1,19 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/prop.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/prop.js deleted file mode 100644 index 734acb7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/prop.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/series.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/series.js deleted file mode 100644 index 25159c2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/series.js +++ /dev/null @@ -1,22 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/throttle.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/throttle.js deleted file mode 100644 index 619dc54..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/throttle.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/timeout.js deleted file mode 100644 index e0d21a6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/function/timeout.js +++ /dev/null @@ -1,21 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/index.js deleted file mode 100644 index 32a1c63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/**@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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang.js deleted file mode 100644 index b981621..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang.js +++ /dev/null @@ -1,36 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/clone.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/clone.js deleted file mode 100644 index 33c4e94..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/clone.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js deleted file mode 100644 index bbc14c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js deleted file mode 100644 index d68dc50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js +++ /dev/null @@ -1,17 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js deleted file mode 100644 index 25fd95f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js +++ /dev/null @@ -1,48 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js deleted file mode 100644 index 1111b2e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js deleted file mode 100644 index cd8a379..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/is.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/is.js deleted file mode 100644 index 4a83573..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/is.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js deleted file mode 100644 index f7b08ba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js deleted file mode 100644 index 262ee40..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - var isArray = Array.isArray || function (val) { - return isKind(val, 'Array'); - }; - module.exports = isArray; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js deleted file mode 100644 index 86557cb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isBoolean(val) { - return isKind(val, 'Boolean'); - } - module.exports = isBoolean; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js deleted file mode 100644 index 4a5130f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isDate(val) { - return isKind(val, 'Date'); - } - module.exports = isDate; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js deleted file mode 100644 index 0e9f77d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js deleted file mode 100644 index 6d4006f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js deleted file mode 100644 index 216879f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isFunction(val) { - return isKind(val, 'Function'); - } - module.exports = isFunction; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js deleted file mode 100644 index 29f95d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js deleted file mode 100644 index 02301e0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js deleted file mode 100644 index f6efeb1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js deleted file mode 100644 index 6252f9e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - */ - function isNull(val){ - return val === null; - } - module.exports = isNull; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js deleted file mode 100644 index 126c1cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isNumber(val) { - return isKind(val, 'Number'); - } - module.exports = isNumber; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js deleted file mode 100644 index 7350c89..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isObject(val) { - return isKind(val, 'Object'); - } - module.exports = isObject; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js deleted file mode 100644 index 0d2d7b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js deleted file mode 100644 index fc5459a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isRegExp(val) { - return isKind(val, 'RegExp'); - } - module.exports = isRegExp; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isString.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isString.js deleted file mode 100644 index f890658..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isString.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isString(val) { - return isKind(val, 'String'); - } - module.exports = isString; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js deleted file mode 100644 index fb2261d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js +++ /dev/null @@ -1,10 +0,0 @@ - - var UNDEF; - - /** - */ - function isUndef(val){ - return val === UNDEF; - } - module.exports = isUndef; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js deleted file mode 100644 index 9dad58c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js deleted file mode 100644 index 663464d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js +++ /dev/null @@ -1,20 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js deleted file mode 100644 index e39b873..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/toString.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/toString.js deleted file mode 100644 index ae5c2b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/lang/toString.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math.js deleted file mode 100644 index c6ee889..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math.js +++ /dev/null @@ -1,19 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/ceil.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/ceil.js deleted file mode 100644 index a279e15..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/ceil.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/clamp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/clamp.js deleted file mode 100644 index e929a9a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/clamp.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Clamps value inside range. - */ - function clamp(val, min, max){ - return val < min? min : (val > max? max : val); - } - module.exports = clamp; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js deleted file mode 100644 index 60ac90c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js +++ /dev/null @@ -1,16 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/floor.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/floor.js deleted file mode 100644 index 9de5053..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/floor.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/inRange.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/inRange.js deleted file mode 100644 index 763218f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/inRange.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/isNear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/isNear.js deleted file mode 100644 index 45486b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/isNear.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Check if value is close to target. - */ - function isNear(val, target, threshold){ - return (Math.abs(val - target) <= threshold); - } - module.exports = isNear; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/lerp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/lerp.js deleted file mode 100644 index 111e271..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/lerp.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/loop.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/loop.js deleted file mode 100644 index 35207c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/loop.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * Loops value inside range. - */ - function loop(val, min, max){ - return val < min? max : (val > max? min : val); - } - - module.exports = loop; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/map.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/map.js deleted file mode 100644 index 96c4b78..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/map.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/norm.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/norm.js deleted file mode 100644 index 54caf78..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/norm.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Gets normalized ratio of value inside range. - */ - function norm(val, min, max){ - return (val - min) / (max - min); - } - module.exports = norm; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/round.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/round.js deleted file mode 100644 index d108e6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/math/round.js +++ /dev/null @@ -1,12 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number.js deleted file mode 100644 index 0b6186c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number.js +++ /dev/null @@ -1,21 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js deleted file mode 100644 index 1d6f0e4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit signed integer value. (2^31 - 1) - */ - - module.exports = 2147483647; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js deleted file mode 100644 index 700da0f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit unsigned integet value (2^32 - 1) - */ - - module.exports = 4294967295; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js deleted file mode 100644 index b34ab2c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Minimum 32-bit signed integer value (-2^31). - */ - - module.exports = -2147483648; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js deleted file mode 100644 index dd6716b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js deleted file mode 100644 index 1cf0249..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js +++ /dev/null @@ -1,26 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js deleted file mode 100644 index f73a92d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js +++ /dev/null @@ -1,13 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/pad.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/pad.js deleted file mode 100644 index da75270..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/pad.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/rol.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/rol.js deleted file mode 100644 index ecd58da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/rol.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/ror.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/ror.js deleted file mode 100644 index 2eda81d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/ror.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/sign.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/sign.js deleted file mode 100644 index b854a4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/sign.js +++ /dev/null @@ -1,15 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toInt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toInt.js deleted file mode 100644 index bcefae0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toInt.js +++ /dev/null @@ -1,15 +0,0 @@ - - - /** - * "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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js deleted file mode 100644 index 5290b62..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * "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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js deleted file mode 100644 index fcc5a97..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object.js deleted file mode 100644 index 76c0642..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object.js +++ /dev/null @@ -1,42 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js deleted file mode 100644 index b2f27d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/contains.js deleted file mode 100644 index 8076e2c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/contains.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js deleted file mode 100644 index fcde944..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js deleted file mode 100644 index d27db44..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js deleted file mode 100644 index 3366c52..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js deleted file mode 100644 index a97e98d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/equals.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/equals.js deleted file mode 100644 index f50cbe4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/equals.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/every.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/every.js deleted file mode 100644 index 01106e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/every.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js deleted file mode 100644 index 80dcdf0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/filter.js deleted file mode 100644 index 3a83a92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/filter.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/find.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/find.js deleted file mode 100644 index d39c070..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/find.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/forIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/forIn.js deleted file mode 100644 index 367f08c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/forIn.js +++ /dev/null @@ -1,62 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js deleted file mode 100644 index 5f2dfbf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/functions.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/functions.js deleted file mode 100644 index f571797..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/functions.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/get.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/get.js deleted file mode 100644 index 6673561..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/get.js +++ /dev/null @@ -1,20 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/has.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/has.js deleted file mode 100644 index ca9f228..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/has.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js deleted file mode 100644 index 7e3c82a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js +++ /dev/null @@ -1,12 +0,0 @@ - - - /** - * Safer Object.hasOwnProperty - */ - function hasOwn(obj, prop){ - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - module.exports = hasOwn; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/keys.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/keys.js deleted file mode 100644 index dd2f4f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/keys.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/map.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/map.js deleted file mode 100644 index dd449a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/map.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/matches.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/matches.js deleted file mode 100644 index 6074faa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/matches.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/max.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/max.js deleted file mode 100644 index 3e8e92c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/max.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/merge.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/merge.js deleted file mode 100644 index 6961f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/merge.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/min.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/min.js deleted file mode 100644 index e1e6697..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/min.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js deleted file mode 100644 index 55ec8fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/namespace.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/namespace.js deleted file mode 100644 index c6e79f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/namespace.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/pick.js deleted file mode 100644 index 74e56f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/pick.js +++ /dev/null @@ -1,18 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/pluck.js deleted file mode 100644 index e844df4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/pluck.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/reduce.js deleted file mode 100644 index 6f19a3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/reduce.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/reject.js deleted file mode 100644 index 7464379..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/reject.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/set.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/set.js deleted file mode 100644 index 9b3cdc4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/set.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/size.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/size.js deleted file mode 100644 index 9788595..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/size.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/some.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/some.js deleted file mode 100644 index 384c6f3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/some.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/unset.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/unset.js deleted file mode 100644 index 343bca0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/unset.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/values.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/values.js deleted file mode 100644 index 265a693..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/object/values.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/package.json deleted file mode 100644 index a3c1682..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString.js deleted file mode 100644 index 22685a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString.js +++ /dev/null @@ -1,15 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js deleted file mode 100644 index da678cf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js deleted file mode 100644 index 7e68999..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js deleted file mode 100644 index 6d2b12f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js deleted file mode 100644 index f149c3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js deleted file mode 100644 index 5194af2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js deleted file mode 100644 index 532906c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js deleted file mode 100644 index 052a9ba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random.js deleted file mode 100644 index d9267f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random.js +++ /dev/null @@ -1,16 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/choice.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/choice.js deleted file mode 100644 index 51aa82a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/choice.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/guid.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/guid.js deleted file mode 100644 index 41f6edd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/guid.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/rand.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/rand.js deleted file mode 100644 index 782dec8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/rand.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randBit.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randBit.js deleted file mode 100644 index bd20b4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randBit.js +++ /dev/null @@ -1,11 +0,0 @@ -var random = require('./random'); - - /** - * Returns random bit (0 or 1) - */ - function randomBit() { - return random() > 0.5? 1 : 0; - } - - module.exports = randomBit; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randHex.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randHex.js deleted file mode 100644 index d8d711c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randHex.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randInt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randInt.js deleted file mode 100644 index e237d96..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randInt.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randSign.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randSign.js deleted file mode 100644 index 5a9fed7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/randSign.js +++ /dev/null @@ -1,11 +0,0 @@ -var random = require('./random'); - - /** - * Returns random sign (-1 or 1) - */ - function randomSign() { - return random() > 0.5? 1 : -1; - } - - module.exports = randomSign; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/random.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/random.js deleted file mode 100644 index 670a3cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/random/random.js +++ /dev/null @@ -1,18 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array.js deleted file mode 100644 index 7bcc961..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/append.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/append.js deleted file mode 100644 index 549d875..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/append.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js deleted file mode 100644 index 8f60cda..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js deleted file mode 100644 index 22efb86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js deleted file mode 100644 index 02a8109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js deleted file mode 100644 index fca4f7c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./indexOf'], function (indexOf) { - - /** - * If array contains values. - */ - function contains(arr, val) { - return indexOf(arr, val) !== -1; - } - return contains; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js deleted file mode 100644 index 819bda3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/every.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/every.js deleted file mode 100644 index 78ba46d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/every.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js deleted file mode 100644 index 52cf685..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/find.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/find.js deleted file mode 100644 index 3957dcd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/find.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js deleted file mode 100644 index 59dfeeb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js deleted file mode 100644 index 42e87f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js deleted file mode 100644 index 0e04586..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js deleted file mode 100644 index 0e75f99..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js deleted file mode 100644 index d8d831f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js deleted file mode 100644 index 64e6ee9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js deleted file mode 100644 index a2e78b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/join.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/join.js deleted file mode 100644 index 2c618d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/join.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js deleted file mode 100644 index 931235f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/map.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/map.js deleted file mode 100644 index 1580b48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/map.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/max.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/max.js deleted file mode 100644 index a7326c8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/max.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/min.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/min.js deleted file mode 100644 index 4164448..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/min.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js deleted file mode 100644 index 97d7f59..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js deleted file mode 100644 index c908856..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./map'], function (map) { - - /** - * Extract a list of property values. - */ - function pluck(arr, propName){ - return map(arr, propName); - } - - return pluck; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/range.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/range.js deleted file mode 100644 index 148ebf9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/range.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js deleted file mode 100644 index 88aacfd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js deleted file mode 100644 index ddae0e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js deleted file mode 100644 index db105dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js deleted file mode 100644 index dec9134..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js deleted file mode 100644 index e81022b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js deleted file mode 100644 index f5a6097..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/some.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/some.js deleted file mode 100644 index e46a978..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/some.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js deleted file mode 100644 index 4c19404..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/split.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/split.js deleted file mode 100644 index a17275e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/split.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js deleted file mode 100644 index aac8fd1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/union.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/union.js deleted file mode 100644 index 5f9922e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/union.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js deleted file mode 100644 index c4bd23b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js deleted file mode 100644 index 7df89d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js deleted file mode 100644 index 374cd28..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection.js deleted file mode 100644 index 386e6da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js deleted file mode 100644 index 192167e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/contains', '../object/contains'], function (make, arrContains, objContains) { - - /** - */ - return make(arrContains, objContains); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js deleted file mode 100644 index 6317f50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/every', '../object/every'], function (make, arrEvery, objEvery) { - - /** - */ - return make(arrEvery, objEvery); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js deleted file mode 100644 index 4e7fadc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js deleted file mode 100644 index 681f941..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js deleted file mode 100644 index 3b39d3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/forEach', '../object/forOwn'], function (make, arrForEach, objForEach) { - - /** - */ - return make(arrForEach, objForEach); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js deleted file mode 100644 index 312e056..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js deleted file mode 100644 index 96e2498..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js deleted file mode 100644 index de9a6da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./make_', '../array/max', '../object/max'], function (make, arrMax, objMax) { - - /** - * Get maximum value inside collection - */ - return make(arrMax, objMax); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js deleted file mode 100644 index f0c239a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./make_', '../array/min', '../object/min'], function (make, arrMin, objMin) { - - /** - * Get minimum value inside collection. - */ - return make(arrMin, objMin); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js deleted file mode 100644 index ef784a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js deleted file mode 100644 index bd05d43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/reduce', '../object/reduce'], function (make, arrReduce, objReduce) { - - /** - */ - return make(arrReduce, objReduce); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js deleted file mode 100644 index 581adfd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js deleted file mode 100644 index 4e5ab41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js deleted file mode 100644 index c0aebee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/some', '../object/some'], function (make, arrSome, objSome) { - - /** - */ - return make(arrSome, objSome); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date.js deleted file mode 100644 index 4d44915..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js deleted file mode 100644 index dc77ae1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js deleted file mode 100644 index 667165f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js +++ /dev/null @@ -1,128 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js deleted file mode 100644 index 5e640c2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js deleted file mode 100644 index 47256dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js deleted file mode 100644 index c04ce88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js deleted file mode 100644 index e400b43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js deleted file mode 100644 index f30531f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js deleted file mode 100644 index 9a2aacb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js +++ /dev/null @@ -1,146 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js deleted file mode 100644 index 747f114..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js deleted file mode 100644 index dd78250..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js +++ /dev/null @@ -1,113 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js deleted file mode 100644 index 225a685..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js deleted file mode 100644 index ca06705..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js deleted file mode 100644 index 98f7e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js deleted file mode 100644 index e9036b4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js deleted file mode 100644 index 8dabc45..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function.js deleted file mode 100644 index 23f4fd7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js deleted file mode 100644 index 09e5e20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js deleted file mode 100644 index d8b228f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js deleted file mode 100644 index 21644ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/func.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/func.js deleted file mode 100644 index b920e00..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/func.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js deleted file mode 100644 index deb6e13..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js deleted file mode 100644 index ad73074..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js deleted file mode 100644 index c9df78c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/series.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/series.js deleted file mode 100644 index c8856a2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/series.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js deleted file mode 100644 index 8ce3929..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js deleted file mode 100644 index 15388bd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/index.js deleted file mode 100644 index 744bb11..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/**@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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang.js deleted file mode 100644 index de16b59..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js deleted file mode 100644 index 468489a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js deleted file mode 100644 index f766150..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js deleted file mode 100644 index a9ac1c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js deleted file mode 100644 index d45c10a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js deleted file mode 100644 index 5156b1b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js deleted file mode 100644 index c1fda3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js deleted file mode 100644 index 261a207..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js deleted file mode 100644 index f889ee8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js deleted file mode 100644 index 886e2aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - var isArray = Array.isArray || function (val) { - return isKind(val, 'Array'); - }; - return isArray; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js deleted file mode 100644 index 1ca27a6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isBoolean(val) { - return isKind(val, 'Boolean'); - } - return isBoolean; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js deleted file mode 100644 index 2708d67..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isDate(val) { - return isKind(val, 'Date'); - } - return isDate; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js deleted file mode 100644 index 4cc3d2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js deleted file mode 100644 index 5a982f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js deleted file mode 100644 index ff5df7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isFunction(val) { - return isKind(val, 'Function'); - } - return isFunction; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js deleted file mode 100644 index 1931f51..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./isNumber'], function (isNumber) { - - /** - * Check if value is an integer - */ - function isInteger(val){ - return isNumber(val) && (val % 1 === 0); - } - - return isInteger; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js deleted file mode 100644 index 6937a12..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js deleted file mode 100644 index 9467a3c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js deleted file mode 100644 index 506e05e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function () { - /** - */ - function isNull(val){ - return val === null; - } - return isNull; -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js deleted file mode 100644 index 9a832c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isNumber(val) { - return isKind(val, 'Number'); - } - return isNumber; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js deleted file mode 100644 index 0befb06..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isObject(val) { - return isKind(val, 'Object'); - } - return isObject; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js deleted file mode 100644 index 6c5854f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js deleted file mode 100644 index d78a03d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isRegExp(val) { - return isKind(val, 'RegExp'); - } - return isRegExp; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js deleted file mode 100644 index 8a42fe0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isString(val) { - return isKind(val, 'String'); - } - return isString; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js deleted file mode 100644 index c57b28e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function () { - var UNDEF; - - /** - */ - function isUndef(val){ - return val === UNDEF; - } - return isUndef; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js deleted file mode 100644 index d433622..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js deleted file mode 100644 index 97d21d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js deleted file mode 100644 index 552916f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js deleted file mode 100644 index c28b89a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math.js deleted file mode 100644 index e2ba870..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js deleted file mode 100644 index d73b058..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js deleted file mode 100644 index fb5a148..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function(){ - /** - * Clamps value inside range. - */ - function clamp(val, min, max){ - return val < min? min : (val > max? max : val); - } - return clamp; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js deleted file mode 100644 index 0ecb32f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js deleted file mode 100644 index 8a4456b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js deleted file mode 100644 index 0c89053..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js deleted file mode 100644 index b308a0b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js deleted file mode 100644 index 26b99d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js deleted file mode 100644 index c735ecf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function(){ - /** - * Loops value inside range. - */ - function loop(val, min, max){ - return val < min? max : (val > max? min : val); - } - - return loop; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/map.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/map.js deleted file mode 100644 index bf7dc5d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/map.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js deleted file mode 100644 index fccae20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function(){ - /** - * Gets normalized ratio of value inside range. - */ - function norm(val, min, max){ - return (val - min) / (max - min); - } - return norm; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/round.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/round.js deleted file mode 100644 index b43e4ac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/math/round.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number.js deleted file mode 100644 index cb52fc7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js deleted file mode 100644 index 23a6e1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit signed integer value. (2^31 - 1) - */ -define(function(){ - return 2147483647; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js deleted file mode 100644 index a035096..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit unsigned integet value (2^32 - 1) - */ -define(function(){ - return 4294967295; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js deleted file mode 100644 index 9b3e978..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Minimum 32-bit signed integer value (-2^31). - */ -define(function(){ - return -2147483648; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js deleted file mode 100644 index 7e7405a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js deleted file mode 100644 index dcde8fc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js deleted file mode 100644 index 84554d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js deleted file mode 100644 index 3b2c062..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js deleted file mode 100644 index a148f44..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js deleted file mode 100644 index b5c66f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js deleted file mode 100644 index dfc131d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js deleted file mode 100644 index 1e9b4c0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js deleted file mode 100644 index d5b25b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js deleted file mode 100644 index 9785a05..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object.js deleted file mode 100644 index 343e782..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js deleted file mode 100644 index b131ed1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js deleted file mode 100644 index 297e898..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js deleted file mode 100644 index 8b7d5d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js deleted file mode 100644 index 84ba154..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js deleted file mode 100644 index 2eae629..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js deleted file mode 100644 index 1b4178e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js deleted file mode 100644 index 596cb95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/every.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/every.js deleted file mode 100644 index 52983a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/every.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js deleted file mode 100644 index 0845d3c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js deleted file mode 100644 index f213b91..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/find.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/find.js deleted file mode 100644 index 47e6b09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/find.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js deleted file mode 100644 index 2058e9c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js +++ /dev/null @@ -1,62 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js deleted file mode 100644 index b40cbaf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js deleted file mode 100644 index 60fee3d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/get.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/get.js deleted file mode 100644 index ca80b05..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/get.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/has.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/has.js deleted file mode 100644 index cc29817..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/has.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js deleted file mode 100644 index 5c53bcf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - /** - * Safer Object.hasOwnProperty - */ - function hasOwn(obj, prop){ - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - return hasOwn; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js deleted file mode 100644 index ed7c4f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/map.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/map.js deleted file mode 100644 index 2958f6b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/map.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js deleted file mode 100644 index 73ff427..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/max.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/max.js deleted file mode 100644 index ef311dc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/max.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js deleted file mode 100644 index d7cfede..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js +++ /dev/null @@ -1,38 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/min.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/min.js deleted file mode 100644 index 9fb4c1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/min.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js deleted file mode 100644 index 6210b7e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js deleted file mode 100644 index 7ed65db..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js deleted file mode 100644 index 76e22bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js deleted file mode 100644 index d47744b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js deleted file mode 100644 index d3a5778..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js deleted file mode 100644 index 8429642..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/set.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/set.js deleted file mode 100644 index b8fa25a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/set.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/size.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/size.js deleted file mode 100644 index c6e377c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/size.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['./forOwn'], function (forOwn) { - - /** - * Get object size - */ - function size(obj) { - var count = 0; - forOwn(obj, function(){ - count++; - }); - return count; - } - - return size; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/some.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/some.js deleted file mode 100644 index 1bd6fda..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/some.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js deleted file mode 100644 index 787fc19..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/values.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/values.js deleted file mode 100644 index b311fd0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/object/values.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString.js deleted file mode 100644 index 4434612..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js deleted file mode 100644 index a6d11cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js deleted file mode 100644 index 02bc160..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js deleted file mode 100644 index bd72a5b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js deleted file mode 100644 index d981372..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js deleted file mode 100644 index aa3d99f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js deleted file mode 100644 index ac153e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js deleted file mode 100644 index 97081aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random.js deleted file mode 100644 index b2641ee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js deleted file mode 100644 index 0d0c38d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js deleted file mode 100644 index 82f3a2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js deleted file mode 100644 index b8c231d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js deleted file mode 100644 index b3422d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./random'], function (random) { - - /** - * Returns random bit (0 or 1) - */ - function randomBit() { - return random() > 0.5? 1 : 0; - } - - return randomBit; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js deleted file mode 100644 index 6e9bf1c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js deleted file mode 100644 index 1750e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js deleted file mode 100644 index 4141cdf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./random'], function (random) { - - /** - * Returns random sign (-1 or 1) - */ - function randomSign() { - return random() > 0.5? 1 : -1; - } - - return randomSign; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/random.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/random.js deleted file mode 100644 index 4270822..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/random/random.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string.js deleted file mode 100644 index 3f5fd80..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js deleted file mode 100644 index e830d86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js deleted file mode 100644 index 02e6c04..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js deleted file mode 100644 index 825b5a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js deleted file mode 100644 index 3c073f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js deleted file mode 100644 index 31a73f2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js deleted file mode 100644 index de34b61..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js deleted file mode 100644 index 32facac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js deleted file mode 100644 index bd5e8c4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js deleted file mode 100644 index 679c405..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js deleted file mode 100644 index ecb8ba8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js deleted file mode 100644 index b045d69..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['../lang/toString'], function(toString){ - /** - * "Safer" String.toLowerCase() - */ - function lowerCase(str){ - str = toString(str); - return str.toLowerCase(); - } - - return lowerCase; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js deleted file mode 100644 index ea4f5fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js deleted file mode 100644 index 477df95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js deleted file mode 100644 index 7aa7bab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js deleted file mode 100644 index 44e4194..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js deleted file mode 100644 index ead9ead..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js deleted file mode 100644 index 2987b50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js deleted file mode 100644 index 4905869..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js deleted file mode 100644 index 2b1a204..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js deleted file mode 100644 index 02f5659..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js deleted file mode 100644 index 8b762fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js deleted file mode 100644 index 3a63f55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js deleted file mode 100644 index 2efd9c8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js deleted file mode 100644 index a4cc282..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js deleted file mode 100644 index cfe45af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js deleted file mode 100644 index c6d68c7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js deleted file mode 100644 index 88ae545..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js deleted file mode 100644 index e8da956..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js deleted file mode 100644 index 5552604..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js deleted file mode 100644 index 34000d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js deleted file mode 100644 index a7c8315..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js deleted file mode 100644 index eeef39b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js deleted file mode 100644 index 75dd464..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js deleted file mode 100644 index 173c69c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js deleted file mode 100644 index d4a7ba1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js deleted file mode 100644 index 6ac2fa4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js deleted file mode 100644 index 8b2073e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['../lang/toString'], function(toString){ - /** - * "Safer" String.toUpperCase() - */ - function upperCase(str){ - str = toString(str); - return str.toUpperCase(); - } - return upperCase; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time.js deleted file mode 100644 index 67c9068..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js deleted file mode 100644 index 2de0cf2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/now.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/now.js deleted file mode 100644 index a3a38bc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/now.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - /** - * Get current time in miliseconds - */ - var now = (typeof Date.now === 'function')? Date.now : function(){ - return +(new Date()); - }; - - return now; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js deleted file mode 100644 index 964929a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js deleted file mode 100644 index edf1821..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string.js deleted file mode 100644 index 7f0ca3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string.js +++ /dev/null @@ -1,45 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js deleted file mode 100644 index 03e0125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js +++ /dev/null @@ -1,12 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js deleted file mode 100644 index aadb69a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/contains.js deleted file mode 100644 index cb22cae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/contains.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/crop.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/crop.js deleted file mode 100644 index 53b93b4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/crop.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js deleted file mode 100644 index d504e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js deleted file mode 100644 index e67c4b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js deleted file mode 100644 index 70cb84f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js deleted file mode 100644 index ec649ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js deleted file mode 100644 index 95e3243..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js deleted file mode 100644 index ac88fac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js deleted file mode 100644 index 30bb7ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js +++ /dev/null @@ -1,11 +0,0 @@ -var toString = require('../lang/toString'); - /** - * "Safer" String.toLowerCase() - */ - function lowerCase(str){ - str = toString(str); - return str.toLowerCase(); - } - - module.exports = lowerCase; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/lpad.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/lpad.js deleted file mode 100644 index 694d711..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/lpad.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js deleted file mode 100644 index 23d7b33..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/makePath.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/makePath.js deleted file mode 100644 index 69aef31..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/makePath.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js deleted file mode 100644 index 8a8dccf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js deleted file mode 100644 index fd19035..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/properCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/properCase.js deleted file mode 100644 index 61636be..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/properCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js deleted file mode 100644 index fb46381..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js deleted file mode 100644 index bdd153b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/repeat.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/repeat.js deleted file mode 100644 index 0f9b475..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/repeat.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/replace.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/replace.js deleted file mode 100644 index 14433fc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/replace.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js deleted file mode 100644 index bb22126..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/rpad.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/rpad.js deleted file mode 100644 index 99f6378..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/rpad.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js deleted file mode 100644 index 66ba80e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js deleted file mode 100644 index 354104c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/slugify.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/slugify.js deleted file mode 100644 index 142f0d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/slugify.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js deleted file mode 100644 index bce2bd2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js deleted file mode 100644 index 01d17b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/trim.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/trim.js deleted file mode 100644 index 9652b0c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/trim.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/truncate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/truncate.js deleted file mode 100644 index a98d6c7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/truncate.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/typecast.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/typecast.js deleted file mode 100644 index c1386a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/typecast.js +++ /dev/null @@ -1,29 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js deleted file mode 100644 index 4968f37..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/underscore.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/underscore.js deleted file mode 100644 index ebd6e2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/underscore.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js deleted file mode 100644 index 52cf3f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js deleted file mode 100644 index 0b7fb73..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js deleted file mode 100644 index 311dfa1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js deleted file mode 100644 index 6c92552..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js +++ /dev/null @@ -1,10 +0,0 @@ -var toString = require('../lang/toString'); - /** - * "Safer" String.toUpperCase() - */ - function upperCase(str){ - str = toString(str); - return str.toUpperCase(); - } - module.exports = upperCase; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time.js deleted file mode 100644 index 9f53329..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time.js +++ /dev/null @@ -1,12 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/convert.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/convert.js deleted file mode 100644 index 852a0f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/convert.js +++ /dev/null @@ -1,41 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/now.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/now.js deleted file mode 100644 index effcfbe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/now.js +++ /dev/null @@ -1,12 +0,0 @@ - - - /** - * Get current time in miliseconds - */ - var now = (typeof Date.now === 'function')? Date.now : function(){ - return +(new Date()); - }; - - module.exports = now; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js deleted file mode 100644 index 6d99797..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js deleted file mode 100644 index 101d69f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/History.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/History.md deleted file mode 100644 index 8811948..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/History.md +++ /dev/null @@ -1,42 +0,0 @@ - -1.0.0 / 2013-06-18 -================== - - * remove .version - * >=. Closes #19 - * Merge pull request #15 from davglass/readline-osx - * On OSX revert back to terminal hack to avoid a readline bug - -0.1.0 / 2012-09-19 -================== - - * Fixed logic bug that caused bar to jump one extra space at the end [davglass] - * Working with readline impl, even on Windows [davglass] - * Using readline instead of the \r hack [davglass] - -0.0.5 / 2012-08-07 -================== - - * add ability to tick by zero chunks - tick(0) - * fix ETA. Closes #4 [lwille] - -0.0.4 / 2011-11-14 -================== - - * Allow more recent versions of node - -0.0.3 / 2011-04-20 -================== - - * Changed; erase the line when complete - -0.0.2 / 2011-04-20 -================== - - * Added custom tokens support - * Fixed; clear line before writing - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/Makefile deleted file mode 100644 index 36a3ed7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @echo "populate me" - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/Readme.md deleted file mode 100644 index 4e08a49..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/Readme.md +++ /dev/null @@ -1,117 +0,0 @@ -# node-progress - - Flexible ascii progress bar - -## Installation - - npm install progress - -## Usage - - First we create a `ProgressBar`, giving it a format string - as well as the `total`, telling the progress bar when it will - be considered complete. After that all we need to do is `tick()` appropriately. - -```javascript -var ProgressBar = require('progress'); - -var bar = new ProgressBar(':bar', { total: 10 }); -var timer = setInterval(function(){ - bar.tick(); - if (bar.complete) { - console.log('\ncomplete\n'); - clearInterval(timer); - } -}, 100); -``` - -## Options: - - - `total` total number of ticks to complete - - `width` the displayed width of the progress bar defaulting to total - - `stream` the output stream defaulting to stdout - - `complete` completion character defaulting to "=" - - `incomplete` incomplete character defaulting to "-" - - `clear` option to clear the bar on completion defaulting to false - - `callback` optional function to call when the progress bar completes - -## Tokens: - - - `:bar` the progress bar itself - - `:current` current tick number - - `:total` total ticks - - `:elapsed` time elapsed in seconds - - `:percent` completion percentage - - `:eta` estimated completion time in seconds - -## Examples - -### Download - - In our download example each tick has a variable influence, so we pass the chunk length which adjusts the progress bar appropriately relative to the total length. - -```javascript -var ProgressBar = require('../') - , https = require('https'); - -var req = https.request({ - host: 'download.github.com' - , port: 443 - , path: '/visionmedia-node-jscoverage-0d4608a.zip' -}); - -req.on('response', function(res){ - var len = parseInt(res.headers['content-length'], 10); - - console.log(); - var bar = new ProgressBar(' downloading [:bar] :percent :etas', { - complete: '=' - , incomplete: ' ' - , width: 20 - , total: len - }); - - res.on('data', function(chunk){ - bar.tick(chunk.length); - }); - - res.on('end', function(){ - console.log('\n'); - }); -}); - -req.end(); -``` - - The code above will generate a progress bar that looks like this: - -``` -downloading [===== ] 29% 3.7s -``` - -You can see more examples in the `examples` folder. - -## License - -(The MIT License) - -Copyright (c) 2011 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/index.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/index.js deleted file mode 100644 index 07ef91f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/node-progress'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js deleted file mode 100644 index 638d919..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js +++ /dev/null @@ -1,172 +0,0 @@ -/*! - * node-progress - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Expose `ProgressBar`. - */ - -exports = module.exports = ProgressBar; - -/** - * Initialize a `ProgressBar` with the given - * `fmt` string and `options`. - * - * Options: - * - * - `total` total number of ticks to complete - * - `width` the displayed width of the progress bar defaulting to total - * - `stream` the output stream defaulting to stdout - * - `complete` completion character defaulting to "=" - * - `incomplete` incomplete character defaulting to "-" - * - `callback` optional function to call when the progress bar completes - * - * Tokens: - * - * - `:bar` the progress bar itself - * - `:current` current tick number - * - `:total` total ticks - * - `:elapsed` time elapsed in seconds - * - `:percent` completion percentage - * - `:eta` eta in seconds - * - * @param {String} fmt - * @param {Object} options - * @api public - */ - -function ProgressBar(fmt, options) { - this.rl = require('readline').createInterface({ - input: process.stdin, - output: options.stream || process.stdout - }); - this.rl.setPrompt('', 0); - this.rl.clearLine = function() { - this.write(null, {ctrl: true, name: 'u'}); - }; - - options = options || {}; - if ('string' != typeof fmt) throw new Error('format required'); - if ('number' != typeof options.total) throw new Error('total required'); - this.fmt = fmt; - this.curr = 0; - this.total = options.total; - this.width = options.width || this.total; - this.clear = options.clear - this.chars = { - complete: options.complete || '=' - , incomplete: options.incomplete || '-' - }; - this.callback = options.callback || function () {}; -} - -/** - * "tick" the progress bar with optional `len` and - * optional `tokens`. - * - * @param {Number|Object} len or tokens - * @param {Object} tokens - * @api public - */ - -ProgressBar.prototype.tick = function(len, tokens){ - if (len !== 0) - len = len || 1; - - // swap tokens - if ('object' == typeof len) tokens = len, len = 1; - - // start time for eta - if (0 == this.curr) this.start = new Date; - - this.curr += len - this.render(tokens); - - // progress complete - if (this.curr >= this.total) { - this.complete = true; - this.terminate(); - this.callback(this); - return; - } -}; - -/** - * Method to render the progress bar with optional `tokens` to - * place in the progress bar's `fmt` field. - * - * @param {Object} tokens - * @api public - */ - -ProgressBar.prototype.render = function(tokens){ - if(!process.stdout.isTTY) { - return; - } - - var percent = (this.curr >= this.total) ? 100 : this.curr / this.total * 100 - , complete = Math.round(this.width * (this.curr / this.total)) - , incomplete - , elapsed = new Date - this.start - , eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1) - complete = Array(complete).join(this.chars.complete); - incomplete = Array(this.width - complete.length).join(this.chars.incomplete); - - var str = this.fmt - .replace(':bar', complete + incomplete) - .replace(':current', this.curr) - .replace(':total', this.total) - .replace(':elapsed', isNaN(elapsed) ? "0.0" : (elapsed / 1000).toFixed(1)) - .replace(':eta', isNaN(eta) ? "0.0" : (eta / 1000).toFixed(1)) - .replace(':percent', percent.toFixed(0) + '%'); - - if (tokens) { - for (var key in tokens) { - str = str.replace(':' + key, tokens[key]); - } - } - - this.rl.clearLine(); - this.rl.write(str); -}; - -/** - * "update" the progress bar to represent an exact percentage. - * The ratio (between 0 and 1) specified will be multiplied by `total` and - * floored, representing the closest available "tick." For example, if a - * progress bar has a length of 3 and `update(0.5)` is called, the progress - * will be set to 1. - * - * A ratio of 0.5 will attempt to set the progress to halfway. - * - * @param {Number} ratio The ratio (between 0 and 1 inclusive) to set the - * overall completion to. - * @api public - */ - -ProgressBar.prototype.update = function(ratio) { - var goal = Math.floor(ratio * this.total); - var delta = goal - this.curr; - - this.tick(delta); -}; - -/** - * Terminates a progress bar. - * - * @api public - */ - -ProgressBar.prototype.terminate = function() { - this.rl.resume(); - - if (this.clear) { - this.rl.clearLine(); - this.rl.close(); - } else { - this.rl.close(); - console.log(); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/package.json deleted file mode 100644 index a4facb9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/progress/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "progress", - "version": "1.1.2", - "description": "Flexible ascii progress bar", - "keywords": [ - "cli", - "progress" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "main": "index", - "engines": { - "node": ">=0.4.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-progress" - }, - "readme": "# node-progress\n\n Flexible ascii progress bar\n\n## Installation\n\n npm install progress\n\n## Usage\n\n First we create a `ProgressBar`, giving it a format string\n as well as the `total`, telling the progress bar when it will\n be considered complete. After that all we need to do is `tick()` appropriately.\n\n```javascript\nvar ProgressBar = require('progress');\n\nvar bar = new ProgressBar(':bar', { total: 10 });\nvar timer = setInterval(function(){\n bar.tick();\n if (bar.complete) {\n console.log('\\ncomplete\\n');\n clearInterval(timer);\n }\n}, 100);\n```\n\n## Options:\n\n - `total` total number of ticks to complete\n - `width` the displayed width of the progress bar defaulting to total\n - `stream` the output stream defaulting to stdout\n - `complete` completion character defaulting to \"=\"\n - `incomplete` incomplete character defaulting to \"-\"\n - `clear` option to clear the bar on completion defaulting to false\n - `callback` optional function to call when the progress bar completes\n\n## Tokens:\n\n - `:bar` the progress bar itself\n - `:current` current tick number\n - `:total` total ticks\n - `:elapsed` time elapsed in seconds\n - `:percent` completion percentage\n - `:eta` estimated completion time in seconds\n\n## Examples\n\n### Download\n\n In our download example each tick has a variable influence, so we pass the chunk length which adjusts the progress bar appropriately relative to the total length.\n\n```javascript\nvar ProgressBar = require('../')\n , https = require('https');\n\nvar req = https.request({\n host: 'download.github.com'\n , port: 443\n , path: '/visionmedia-node-jscoverage-0d4608a.zip'\n});\n\nreq.on('response', function(res){\n var len = parseInt(res.headers['content-length'], 10);\n\n console.log();\n var bar = new ProgressBar(' downloading [:bar] :percent :etas', {\n complete: '='\n , incomplete: ' '\n , width: 20\n , total: len\n });\n\n res.on('data', function(chunk){\n bar.tick(chunk.length);\n });\n\n res.on('end', function(){\n console.log('\\n');\n });\n});\n\nreq.end();\n```\n\n The code above will generate a progress bar that looks like this:\n\n```\ndownloading [===== ] 29% 3.7s\n```\n\nYou can see more examples in the `examples` folder.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 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.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/node-progress/issues" - }, - "_id": "progress@1.1.2", - "dist": { - "shasum": "87fdbc7c76a784020897b5e9665554b05fc58cd1" - }, - "_from": "progress@~1.1.0", - "_resolved": "https://registry.npmjs.org/progress/-/progress-1.1.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/README.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/README.md deleted file mode 100644 index ff1eb53..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/README.md +++ /dev/null @@ -1,5 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/bin/which b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/bin/which deleted file mode 100755 index 8432ce2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/bin/which +++ /dev/null @@ -1,14 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/package.json deleted file mode 100644 index 9458b87..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "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" - }, - "_id": "which@1.0.5", - "_from": "which@~1.0.5", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/which.js b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/which.js deleted file mode 100644 index db7e8f7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/which/which.js +++ /dev/null @@ -1,104 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/package.json deleted file mode 100644 index 37239f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "bin-wrapper", - "version": "0.1.6", - "description": "Binary wrapper for Node.js that makes your programs seamlessly available as local dependencies", - "keywords": [ - "bin", - "build", - "make", - "wrapper" - ], - "homepage": "https://github.com/kevva/bin-wrapper", - "bugs": { - "url": "https://github.com/kevva/bin-wrapper/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/bin-wrapper.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "bin-wrapper.js", - "files": [ - "bin-wrapper.js" - ], - "dependencies": { - "download": "~0.1.2", - "isbin": "0.0.2", - "mout": "~0.6.0", - "progress": "~1.1.0", - "which": "~1.0.5" - }, - "devDependencies": { - "mocha": "~1.12.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# bin-wrapper [![Build Status](https://secure.travis-ci.org/kevva/bin-wrapper.png?branch=master)](http://travis-ci.org/kevva/bin-wrapper)\n\nBinary wrapper for Node.js that makes your programs seamlessly available as local dependencies\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/bin-wrapper): `npm install bin-wrapper`\n\n## Examples\n\nAll `platform` and `arch` specific options takes precedence over the base \noptions. See [test.js](test.js) for a full fleshed example.\n\n```js\nvar Bin = require('bin-wrapper');\n\nvar opts = {\n name: 'Gifsicle',\n bin: 'gifsicle',\n path: 'vendor',\n url: 'http://url/to/gifsicle',\n src: 'http://www.lcdf.org/gifsicle/gifsicle-1.71.tar.gz',\n buildScript: './configure --bindir=\"vendor\" && make install',\n platform: {\n win32: {\n bin: 'gifsicle.exe',\n url: [\n 'http://url/to/gifsicle.exe'\n 'http://url/to/gifsicle.dll'\n ]\n }\n }\n}\nvar bin = new Bin(opts);\n\nbin.check('--version', function (works) {\n if (!works) {\n console.log('Pre-build test failed, compiling from source');\n return bin.build();\n }\n\n console.log('Binary passed the test');\n});\n```\n\nGet the path to your binary with `bin.path`.\n\n```js\nconsole.log(bin.path);\n// => path/to/vendor/gifsicle\n```\n\n## API\n\n### .check(cmd, cb)\n\nCheck if a binary is present and working. If it isn't, download and test it by \nrunning the binary with `cmd` and see if it exits correctly.\n\n### .build(cb)\n\nDownload the source archive defined in the `src` property and build it using the \nbuild script defined in the `buildScript` property.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "bin-wrapper@0.1.6", - "dist": { - "shasum": "2f010154f7155220f9b705e469e01fb20655626d" - }, - "_from": "bin-wrapper@~0.1.3", - "_resolved": "https://registry.npmjs.org/bin-wrapper/-/bin-wrapper-0.1.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/package.json b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/package.json deleted file mode 100644 index c5ceffa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "gifsicle", - "version": "0.1.4", - "description": "gifsicle wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows", - "keywords": [ - "gif", - "img", - "image", - "compress", - "minify", - "optimize" - ], - "homepage": "https://github.com/yeoman/node-gifsicle", - "bugs": { - "url": "https://github.com/yeoman/node-gifsicle/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "BSD", - "repository": { - "type": "git", - "url": "git://github.com/yeoman/node-gifsicle.git" - }, - "main": "lib/gifsicle", - "bin": { - "gifsicle": "bin/gifsicle.js" - }, - "scripts": { - "test": "mocha", - "postinstall": "node lib/check.js" - }, - "dependencies": { - "bin-wrapper": "~0.1.3", - "chalk": "~0.2.0" - }, - "devDependencies": { - "mocha": "~1.13.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "files": [ - "bin", - "lib" - ], - "readme": "# node-gifsicle [![Build Status](https://secure.travis-ci.org/yeoman/node-gifsicle.png?branch=master)](http://travis-ci.org/yeoman/node-gifsicle)\n\n[gifsicle](http://www.lcdf.org/gifsicle/) 1.71 Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows.\n\n> gifsicle manipulates GIF image files in many different ways. Depending on command line options, it can merge several GIFs into a GIF animation; explode an animation into its component frames; change individual frames in an animation; turn interlacing on and off; add transparency and much more.\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/gifsicle): `npm install --save gifsicle`\n\n\n## Example usage\n\n```js\nvar execFile = require('child_process').execFile;\nvar gifsiclePath = require('gifsicle').path;\n\nexecFile(gifsiclePath, ['-o', 'output.gif', 'input.gif'], function() {\n\tconsole.log('Image minified');\n});\n```\n\nCan also be run directly from `./node_modules/.bin/gifsicle`.\n\n\n## Dev\n\nNote to self on how to update the binaries.\n\n### OS X\n\nRun `npm install` on a OS X 10.7 machine to build the binary.\n\n### Linux\n\nRun `npm install` to build the binary.\n\n### Windows\n\n- Download the [Windows files 32/64-bit](http://www.lcdf.org/gifsicle/) on a Windows machine.\n- Run the downloaded file to extract.\n- Go to the `bin` folder at the destination and copy `gifsicle.exe`.\n\n\n## License\n\nEverything excluding the binaries licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google.\n\ngifsicle licensed under the GNU General Public License, Version 2.\n", - "readmeFilename": "readme.md", - "_id": "gifsicle@0.1.4", - "dist": { - "shasum": "c592c8625fc0ae05f88ceaa8e67ce20351236d3c" - }, - "_from": "gifsicle@~0.1.0", - "_resolved": "https://registry.npmjs.org/gifsicle/-/gifsicle-0.1.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/readme.md b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/readme.md deleted file mode 100644 index 4d0c760..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# node-gifsicle [![Build Status](https://secure.travis-ci.org/yeoman/node-gifsicle.png?branch=master)](http://travis-ci.org/yeoman/node-gifsicle) - -[gifsicle](http://www.lcdf.org/gifsicle/) 1.71 Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows. - -> gifsicle manipulates GIF image files in many different ways. Depending on command line options, it can merge several GIFs into a GIF animation; explode an animation into its component frames; change individual frames in an animation; turn interlacing on and off; add transparency and much more. - - -## Install - -Install with [npm](https://npmjs.org/package/gifsicle): `npm install --save gifsicle` - - -## Example usage - -```js -var execFile = require('child_process').execFile; -var gifsiclePath = require('gifsicle').path; - -execFile(gifsiclePath, ['-o', 'output.gif', 'input.gif'], function() { - console.log('Image minified'); -}); -``` - -Can also be run directly from `./node_modules/.bin/gifsicle`. - - -## Dev - -Note to self on how to update the binaries. - -### OS X - -Run `npm install` on a OS X 10.7 machine to build the binary. - -### Linux - -Run `npm install` to build the binary. - -### Windows - -- Download the [Windows files 32/64-bit](http://www.lcdf.org/gifsicle/) on a Windows machine. -- Run the downloaded file to extract. -- Go to the `bin` folder at the destination and copy `gifsicle.exe`. - - -## License - -Everything excluding the binaries licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google. - -gifsicle licensed under the GNU General Public License, Version 2. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/vendor/gifsicle b/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/vendor/gifsicle deleted file mode 100755 index 675d775..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/vendor/gifsicle and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/bin/jpegtran.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/bin/jpegtran.js deleted file mode 100755 index 75c03d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/bin/jpegtran.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -'use strict'; -var spawn = require('child_process').spawn; -var binPath = require('../lib/jpegtran').path; - -spawn(binPath, process.argv.slice(2), { stdio: 'inherit' }) - .on('exit', process.exit); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/build.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/build.js deleted file mode 100644 index 00b7dce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/build.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; -var exec = require('child_process').exec; -var path = require('path'); -var os = require('os'); -var which = require('which'); -var chalk = require('chalk'); -var tar = require('tar'); -var request = require('request'); -var zlib = require('zlib'); -var tmpdir = os.tmpdir ? os.tmpdir() : os.tmpDir(); -var binPath = require('./lib/jpegtran').path; -var version = '1.3.0'; -var tmpPath = path.join(tmpdir, 'libjpeg-turbo-' + version); -var urlPath = 'http://downloads.sourceforge.net/project/libjpeg-turbo/' + version + '/libjpeg-turbo-' + version + '.tar.gz'; - -module.exports = function () { - if (!(process.platform === 'darwin' || process.platform === 'linux')) { - return; - } - - var opts = { - type: 'Directory', - path: tmpPath, - strip: 1 - }; - - var proxy = process.env.http_proxy || process.env.HTTP_PROXY || - process.env.https_proxy || process.env.HTTPS_PROXY || ''; - - console.log(chalk.yellow('Fetching %s...'), urlPath); - - var req = request.defaults({ proxy: proxy }).get(urlPath, function (err, resp) { - if (resp.statusCode !== 200) { - throw err; - } - }); - - req - .pipe(zlib.Gunzip()) - .pipe(tar.Extract(opts)) - .on('close', function () { - console.log(chalk.green('Done in %s'), tmpPath); - - which('make', function (err) { - if (err) { - throw err; - } - - console.log(chalk.yellow('\nBuilding libjpeg-turbo...')); - - var binDir = path.dirname(binPath); - var configureFlags = '--disable-shared '; - - if (process.platform === 'darwin') { - configureFlags += '--host i686-apple-darwin '; - } - - if (process.platform === 'linux' && process.arch === 'x64') { - configureFlags += 'CFLAGS=\'-O3 -m64\' LDFLAGS=-m64'; - } else { - configureFlags += 'CFLAGS=\'-O3 -m32\' LDFLAGS=-m32'; - } - - var buildScript = './configure ' + configureFlags + ' &&' + - 'make install prefix=' + tmpPath + - ' bindir=' + binDir + ' bin_PROGRAMS=jpegtran'; - - exec(buildScript, { cwd: tmpPath }, function (err) { - if (err) { - throw err; - } - - console.log(chalk.green('libjpeg-turbo rebuilt successfully')); - }); - }); - }); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/lib/jpegtran.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/lib/jpegtran.js deleted file mode 100644 index 223961e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/lib/jpegtran.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; -var path = require('path'); -var url = require('url'); - -var target = { - name: 'jpegtran', - url: 'https://raw.github.com/yeoman/node-jpegtran-bin/master/', - pathPrefix: '../vendor', - urlPrefix: 'vendor', - platforms: { - darwin: { - path: 'osx' - }, - linux: { - path: 'linux', - arch: true - }, - win32: { - path: 'win', - arch: true, - suffix: 'exe', - dll: 'libjpeg-62.dll' - }, - freebsd: { - path: 'freebsd', - arch: true - }, - sunos: { - path: 'sunos', - arch: true - } - } -}; - -function getPathToPackagedBinary(target, options) { - var platform = target.platforms[process.platform]; - - if (platform === undefined) { - return console.error('Unsupported platform:', process.platform, process.arch); - } - - options = options || {}; - options.dll = options.dll || false; - - var targetPath = []; - var exec = target.name; - - if (options.dll) { - exec = platform.dll; - } - - targetPath.push(target.pathPrefix); - targetPath.unshift(__dirname); - - if (!options.dll && platform.suffix !== undefined) { - exec += '.' + platform.suffix; - } - - targetPath.push(exec); - - return path.join.apply(__dirname, targetPath); -} - -function getUrlToPackagedBinary(target, options) { - var platform = target.platforms[process.platform]; - - if (platform === undefined) { - return console.error('Unsupported platform:', process.platform, process.arch); - } - - options = options || {}; - options.dll = options.dll || false; - - var targetPath = []; - var arch = process.arch === 'x64' ? 'x64' : 'x86'; - var exec = target.name; - - if (options.dll) { - exec = platform.dll; - } - - targetPath.push(target.urlPrefix); - targetPath.push(platform.path); - - if (platform.arch === true) { - targetPath.push(arch); - } - - if (!options.dll && platform.suffix !== undefined) { - exec += '.' + platform.suffix; - } - - targetPath.push(exec); - - return url.resolve(target.url, targetPath.join('/')); -} - -exports.path = getPathToPackagedBinary(target); -exports.url = getUrlToPackagedBinary(target); - -if (process.platform === 'win32') { - exports.pathDll = getPathToPackagedBinary(target, { dll: true }); - exports.urlDll = getUrlToPackagedBinary(target, { dll: true }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/_mocha b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/_mocha deleted file mode 120000 index f2a54ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/_mocha +++ /dev/null @@ -1 +0,0 @@ -../mocha/bin/_mocha \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/mocha b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/mocha deleted file mode 120000 index 43c668d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/mocha +++ /dev/null @@ -1 +0,0 @@ -../mocha/bin/mocha \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/which b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/which deleted file mode 120000 index f62471c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 84fd7ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/examples/pow.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/package.json deleted file mode 100644 index 169f15a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.5", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.4.0" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "_id": "mkdirp@0.3.5", - "_from": "mkdirp@~0.3.5" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/readme.markdown b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 83b0216..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/chmod.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/clobber.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/mkdirp.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/perm.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/perm_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/race.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/rel.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/return.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/return_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/root.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/sync.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/umask.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/umask_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 35bd5cb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/Readme.md deleted file mode 100644 index ae0e8cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/Readme.md +++ /dev/null @@ -1,124 +0,0 @@ - [![Build Status](https://secure.travis-ci.org/visionmedia/mocha.png)](http://travis-ci.org/visionmedia/mocha) - - [![Mocha test framework](http://f.cl.ly/items/3l1k0n2A1U3M1I1L210p/Screen%20Shot%202012-02-24%20at%202.21.43%20PM.png)](http://visionmedia.github.io/mocha) - - Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://visionmedia.github.io/mocha). - -## Contributors - -``` - - project : mocha - repo age : 1 year, 7 months - active : 272 days - commits : 1116 - files : 123 - authors : - 504 TJ Holowaychuk 45.2% - 389 Tj Holowaychuk 34.9% - 31 Guillermo Rauch 2.8% - 13 Attila Domokos 1.2% - 9 John Firebaugh 0.8% - 8 Jo Liss 0.7% - 7 Nathan Rajlich 0.6% - 6 James Carr 0.5% - 6 Brendan Nee 0.5% - 5 Aaron Heckmann 0.4% - 4 hokaccha 0.4% - 4 Xavier Antoviaque 0.4% - 4 Joshua Krall 0.4% - 3 Wil Moore III 0.3% - 3 Jesse Dailey 0.3% - 3 Nathan Bowser 0.3% - 3 Tyson Tate 0.3% - 3 Cory Thomas 0.3% - 3 Ryunosuke SATO 0.3% - 3 Paul Miller 0.3% - 3 Ben Lindsey 0.3% - 2 Forbes Lindesay 0.2% - 2 Konstantin Käfer 0.2% - 2 Brian Beck 0.2% - 2 Merrick Christensen 0.2% - 2 Michael Riley 0.2% - 2 David Henderson 0.2% - 2 Nathan Alderson 0.2% - 2 Paul Armstrong 0.2% - 2 Pete Hawkins 0.2% - 2 Quang Van 0.2% - 2 Raynos 0.2% - 2 Jonas Westerlund 0.2% - 2 Domenic Denicola 0.2% - 2 Shawn Krisman 0.2% - 2 Simon Gaeremynck 0.2% - 2 FARKAS Máté 0.2% - 2 Timo Tijhof 0.2% - 2 Justin DuJardin 0.2% - 2 Juzer Ali 0.2% - 2 Ian Storm Taylor 0.2% - 2 Arian Stolwijk 0.2% - 2 domenic 0.2% - 1 Richard Dingwall 0.1% - 1 Russ Bradberry 0.1% - 1 Sasha Koss 0.1% - 1 Seiya Konno 0.1% - 1 Standa Opichal 0.1% - 1 Steve Mason 0.1% - 1 Will Langstroth 0.1% - 1 Yanis Wang 0.1% - 1 Yuest Wang 0.1% - 1 abrkn 0.1% - 1 airportyh 0.1% - 1 fengmk2 0.1% - 1 tgautier@yahoo.com 0.1% - 1 traleig1 0.1% - 1 vlad 0.1% - 1 yuitest 0.1% - 1 Adam Crabtree 0.1% - 1 Andreas Brekken 0.1% - 1 Atsuya Takagi 0.1% - 1 Austin Birch 0.1% - 1 Bjørge Næss 0.1% - 1 Brian Moore 0.1% - 1 Bryan Donovan 0.1% - 1 Casey Foster 0.1% - 1 Corey Butler 0.1% - 1 Dave McKenna 0.1% - 1 Fedor Indutny 0.1% - 1 Florian Margaine 0.1% - 1 Frederico Silva 0.1% - 1 Fredrik Lindin 0.1% - 1 Gareth Murphy 0.1% - 1 Gavin Mogan 0.1% - 1 Greg Perkins 0.1% - 1 Harry Brundage 0.1% - 1 Herman Junge 0.1% - 1 Ian Young 0.1% - 1 Ivan 0.1% - 1 Jaakko Salonen 0.1% - 1 Jakub Nešetřil 0.1% - 1 James Bowes 0.1% - 1 James Lal 0.1% - 1 Jason Barry 0.1% - 1 Javier Aranda 0.1% - 1 Jeff Kunkle 0.1% - 1 Jonathan Creamer 0.1% - 1 Jussi Virtanen 0.1% - 1 Katie Gengler 0.1% - 1 Kazuhito Hokamura 0.1% - 1 Koen Punt 0.1% - 1 Laszlo Bacsi 0.1% - 1 László Bácsi 0.1% - 1 Maciej Małecki 0.1% - 1 Matt Robenolt 0.1% - 1 Matt Smith 0.1% - 1 Matthew Shanley 0.1% - 1 Michael Schoonmaker 0.1% - 1 Phil Sung 0.1% - 1 R56 0.1% -``` - -## Links - - - [Google Group](http://groups.google.com/group/mochajs) - - [Wiki](https://github.com/visionmedia/mocha/wiki) - - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/bin/_mocha b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/bin/_mocha deleted file mode 100755 index ba1f80b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/bin/_mocha +++ /dev/null @@ -1,443 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander') - , sprintf = require('util').format - , path = require('path') - , fs = require('fs') - , glob = require('glob') - , resolve = path.resolve - , exists = fs.existsSync || path.existsSync - , Mocha = require('../') - , utils = Mocha.utils - , reporters = Mocha.reporters - , interfaces = Mocha.interfaces - , Base = reporters.Base - , join = path.join - , basename = path.basename - , cwd = process.cwd() - , mocha = new Mocha; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Files. - */ - -var files = []; - -/** - * Globals. - */ - -var globals = []; - -/** - * Requires. - */ - -var requires = []; - -/** - * Images. - */ - -var images = { - fail: __dirname + '/../images/error.png' - , pass: __dirname + '/../images/ok.png' -}; - -// options - -program - .version(JSON.parse(fs.readFileSync(__dirname + '/../package.json', 'utf8')).version) - .usage('[debug] [options] [files]') - .option('-r, --require ', 'require the given module') - .option('-R, --reporter ', 'specify the reporter to use', 'dot') - .option('-u, --ui ', 'specify user-interface (bdd|tdd|exports)', 'bdd') - .option('-g, --grep ', 'only run tests matching ') - .option('-i, --invert', 'inverts --grep matches') - .option('-t, --timeout ', 'set test-case timeout in milliseconds [2000]') - .option('-s, --slow ', '"slow" test threshold in milliseconds [75]') - .option('-w, --watch', 'watch files for changes') - .option('-c, --colors', 'force enabling of colors') - .option('-C, --no-colors', 'force disabling of colors') - .option('-G, --growl', 'enable growl notification support') - .option('-d, --debug', "enable node's debugger, synonym for node --debug") - .option('-b, --bail', "bail after first test failure") - .option('-A, --async-only', "force all tests to take a callback (async)") - .option('--recursive', 'include sub directories') - .option('--debug-brk', "enable node's debugger breaking on the first line") - .option('--globals ', 'allow the given comma-delimited global [names]', list, []) - .option('--check-leaks', 'check for global variable leaks') - .option('--interfaces', 'display available interfaces') - .option('--reporters', 'display available reporters') - .option('--compilers :,...', 'use the given module(s) to compile files', list, []) - -program.name = 'mocha'; - -// init command - -program - .command('init ') - .description('initialize a client-side mocha setup at ') - .action(function(path){ - var mkdir = require('mkdirp'); - mkdir.sync(path); - var css = fs.readFileSync(join(__dirname, '..', 'mocha.css')); - var js = fs.readFileSync(join(__dirname, '..', 'mocha.js')); - var tmpl = fs.readFileSync(join(__dirname, '..', 'lib/template.html')); - fs.writeFileSync(join(path, 'mocha.css'), css); - fs.writeFileSync(join(path, 'mocha.js'), js); - fs.writeFileSync(join(path, 'tests.js'), ''); - fs.writeFileSync(join(path, 'index.html'), tmpl); - process.exit(0); - }); - -// --globals - -program.on('globals', function(val){ - globals = globals.concat(list(val)); -}); - -// --reporters - -program.on('reporters', function(){ - console.log(); - console.log(' dot - dot matrix'); - console.log(' doc - html documentation'); - console.log(' spec - hierarchical spec list'); - console.log(' json - single json object'); - console.log(' progress - progress bar'); - console.log(' list - spec-style listing'); - console.log(' tap - test-anything-protocol'); - console.log(' landing - unicode landing strip'); - console.log(' xunit - xunit reporter'); - console.log(' teamcity - teamcity ci support'); - console.log(' html-cov - HTML test coverage'); - console.log(' json-cov - JSON test coverage'); - console.log(' min - minimal reporter (great with --watch)'); - console.log(' json-stream - newline delimited json events'); - console.log(' markdown - markdown documentation (github flavour)'); - console.log(' nyan - nyan cat!'); - console.log(); - process.exit(); -}); - -// --interfaces - -program.on('interfaces', function(){ - console.log(''); - console.log(' bdd'); - console.log(' tdd'); - console.log(' qunit'); - console.log(' exports'); - console.log(''); - process.exit(); -}); - -// -r, --require - -module.paths.push(cwd, join(cwd, 'node_modules')); - -program.on('require', function(mod){ - var abs = exists(mod) || exists(mod + '.js'); - if (abs) mod = resolve(mod); - requires.push(mod); -}); - -// mocha.opts support - -try { - var opts = fs.readFileSync('test/mocha.opts', 'utf8') - .trim() - .split(/\s+/); - - process.argv = process.argv - .slice(0, 2) - .concat(opts.concat(process.argv.slice(2))); -} catch (err) { - // ignore -} - -// parse args - -program.parse(process.argv); - -// infinite stack traces - -Error.stackTraceLimit = Infinity; // TODO: config - -// reporter - -mocha.reporter(program.reporter); - -// interface - -mocha.ui(program.ui); - -// load reporter - -try { - Reporter = require('../lib/reporters/' + program.reporter); -} catch (err) { - try { - Reporter = require(program.reporter); - } catch (err) { - throw new Error('reporter "' + program.reporter + '" does not exist'); - } -} - -// --no-colors - -if (!program.colors) Base.useColors = false; - -// --colors - -if (~process.argv.indexOf('--colors') || - ~process.argv.indexOf('-c')) { - Base.useColors = true; -} - -// --slow - -if (program.slow) mocha.suite.slow(program.slow); - -// --timeout - -if (program.timeout) mocha.suite.timeout(program.timeout); - -// --bail - -mocha.suite.bail(program.bail); - -// --grep - -if (program.grep) mocha.grep(new RegExp(program.grep)); - -// --invert - -if (program.invert) mocha.invert(); - -// --check-leaks - -if (program.checkLeaks) mocha.checkLeaks(); - -// --growl - -if (program.growl) mocha.growl(); - -// --async-only - -if (program.asyncOnly) mocha.asyncOnly(); - -// --globals - -mocha.globals(globals); - -// custom compiler support - -var extensions = ['js']; -program.compilers.forEach(function(c) { - var compiler = c.split(':') - , ext = compiler[0] - , mod = compiler[1]; - - if (mod[0] == '.') mod = join(process.cwd(), mod); - require(mod); - extensions.push(ext); -}); - -var re = new RegExp('\\.(' + extensions.join('|') + ')$'); - -// requires - -requires.forEach(function(mod) { - require(mod); -}); - -// files - -var files = [] - , args = program.args; - -// default files to test/*.{js,coffee} - -if (!args.length) args.push('test'); - -args.forEach(function(arg){ - files = files.concat(lookupFiles(arg, program.recursive)); -}); - -// resolve - -files = files.map(function(path){ - return resolve(path); -}); - -// --watch - -if (program.watch) { - console.log(); - hideCursor(); - process.on('SIGINT', function(){ - showCursor(); - console.log('\n'); - process.exit(); - }); - - var spinner = 'win32' == process.platform - ? ['|','/','-','\\'] - : ['◜','◠','◝','◞','◡','◟']; - - var frames = spinner.map(function(c) { - return sprintf(' \u001b[96m%s \u001b[90mwatching\u001b[0m', c); - }); - - var watchFiles = utils.files(cwd); - - function loadAndRun() { - try { - mocha.files = files; - mocha.run(function(){ - play(frames); - }); - } catch(e) { - console.log(e.stack); - } - } - - function purge() { - watchFiles.forEach(function(file){ - delete require.cache[file]; - }); - } - - loadAndRun(); - - utils.watch(watchFiles, function(){ - purge(); - stop() - mocha.suite = mocha.suite.clone(); - mocha.ui(program.ui); - loadAndRun(); - }); - - return; -} - -// load - -mocha.files = files; -mocha.run(process.exit); - -// enable growl notifications - -function growl(runner, reporter) { - var notify = require('growl'); - - runner.on('end', function(){ - var stats = reporter.stats; - if (stats.failures) { - var msg = stats.failures + ' of ' + runner.total + ' tests failed'; - notify(msg, { name: 'mocha', title: 'Failed', image: images.fail }); - } else { - notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', { - name: 'mocha' - , title: 'Passed' - , image: images.pass - }); - } - }); -} - -/** - * Parse list. - */ - -function list(str) { - return str.split(/ *, */); -} - -/** - * Hide the cursor. - */ - -function hideCursor(){ - process.stdout.write('\u001b[?25l'); -}; - -/** - * Show the cursor. - */ - -function showCursor(){ - process.stdout.write('\u001b[?25h'); -}; - -/** - * Stop play()ing. - */ - -function stop() { - process.stdout.write('\u001b[2K'); - clearInterval(play.timer); -} - -/** - * Lookup file names at the given `path`. - */ - -function lookupFiles(path, recursive) { - var files = []; - - if (!exists(path)) { - if (exists(path + '.js')) { - path += '.js' - } else { - return glob.sync(path); - } - } - - var stat = fs.statSync(path); - if (stat.isFile()) return path; - - fs.readdirSync(path).forEach(function(file){ - file = join(path, file); - var stat = fs.statSync(file); - if (stat.isDirectory()) { - if (recursive) files = files.concat(lookupFiles(file, recursive)); - return - } - if (!stat.isFile() || !re.test(file) || basename(file)[0] == '.') return; - files.push(file); - }); - - return files; -} - -/** - * Play the given array of strings. - */ - -function play(arr, interval) { - var len = arr.length - , interval = interval || 100 - , i = 0; - - play.timer = setInterval(function(){ - var str = arr[i++ % len]; - process.stdout.write('\u001b[0G' + str); - }, interval); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/bin/mocha b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/bin/mocha deleted file mode 100755 index 742d607..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/bin/mocha +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node - -/** - * This tiny wrapper file checks for known node flags and appends them - * when found, before invoking the "real" _mocha(1) executable. - */ - -var spawn = require('child_process').spawn - , args = [ __dirname + '/_mocha' ]; - -process.argv.slice(2).forEach(function(arg){ - var flag = arg.split('=')[0]; - - switch (flag) { - case '-d': - args.unshift('--debug'); - break; - case 'debug': - case '--debug': - case '--debug-brk': - args.unshift(arg); - break; - case '-gc': - case '--expose-gc': - args.unshift('--expose-gc'); - break; - case '--gc-global': - case '--harmony': - case '--harmony-proxies': - case '--harmony-collections': - case '--harmony-generators': - case '--prof': - args.unshift(arg); - break; - default: - if (0 == arg.indexOf('--trace')) args.unshift(arg); - else args.push(arg); - break; - } -}); - -var proc = spawn(process.argv[0], args, { customFds: [0,1,2] }); -proc.on('exit', function (code, signal) { - process.on('exit', function(){ - if (signal) { - process.kill(process.pid, signal); - } else { - process.exit(code); - } - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/images/error.png b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/images/error.png deleted file mode 100644 index a07a1ba..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/images/error.png and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/images/ok.png b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/images/ok.png deleted file mode 100644 index b3623a5..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/images/ok.png and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/index.js deleted file mode 100644 index 507566f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = process.env.COV - ? require('./lib-cov/mocha') - : require('./lib/mocha'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/debug.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/debug.js deleted file mode 100644 index 03cf592..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/debug.js +++ /dev/null @@ -1,5 +0,0 @@ - -module.exports = function(type){ - return function(){ - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/diff.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/diff.js deleted file mode 100644 index 6b7ce24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/diff.js +++ /dev/null @@ -1,287 +0,0 @@ -/* See license.txt for terms of usage */ - -/* - * Text diff implementation. - * - * This library supports the following APIS: - * JsDiff.diffChars: Character by character diff - * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace - * JsDiff.diffLines: Line based diff - * - * JsDiff.diffCss: Diff targeted at CSS content - * - * These methods are based on the implementation proposed in - * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 - */ -var JsDiff = (function() { - function clonePath(path) { - return { newPos: path.newPos, components: path.components.slice(0) }; - } - function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - } - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, "&"); - n = n.replace(//g, ">"); - n = n.replace(/"/g, """); - - return n; - } - - - var fbDiff = function(ignoreWhitespace) { - this.ignoreWhitespace = ignoreWhitespace; - }; - fbDiff.prototype = { - diff: function(oldString, newString) { - // Handle the identity case (this is due to unrolling editLength == 0 - if (newString == oldString) { - return [{ value: newString }]; - } - if (!newString) { - return [{ value: oldString, removed: true }]; - } - if (!oldString) { - return [{ value: newString, added: true }]; - } - - newString = this.tokenize(newString); - oldString = this.tokenize(oldString); - - var newLen = newString.length, oldLen = oldString.length; - var maxEditLength = newLen + oldLen; - var bestPath = [{ newPos: -1, components: [] }]; - - // Seed editLength = 0 - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) { - return bestPath[0].components; - } - - for (var editLength = 1; editLength <= maxEditLength; editLength++) { - for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) { - var basePath; - var addPath = bestPath[diagonalPath-1], - removePath = bestPath[diagonalPath+1]; - oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath-1] = undefined; - } - - var canAdd = addPath && addPath.newPos+1 < newLen; - var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = undefined; - continue; - } - - // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { - basePath = clonePath(removePath); - this.pushComponent(basePath.components, oldString[oldPos], undefined, true); - } else { - basePath = clonePath(addPath); - basePath.newPos++; - this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined); - } - - var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath); - - if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) { - return basePath.components; - } else { - bestPath[diagonalPath] = basePath; - } - } - } - }, - - pushComponent: function(components, value, added, removed) { - var last = components[components.length-1]; - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length-1] = - {value: this.join(last.value, value), added: added, removed: removed }; - } else { - components.push({value: value, added: added, removed: removed }); - } - }, - extractCommon: function(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath; - while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) { - newPos++; - oldPos++; - - this.pushComponent(basePath.components, newString[newPos], undefined, undefined); - } - basePath.newPos = newPos; - return oldPos; - }, - - equals: function(left, right) { - var reWhitespace = /\S/; - if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) { - return true; - } else { - return left == right; - } - }, - join: function(left, right) { - return left + right; - }, - tokenize: function(value) { - return value; - } - }; - - var CharDiff = new fbDiff(); - - var WordDiff = new fbDiff(true); - WordDiff.tokenize = function(value) { - return removeEmpty(value.split(/(\s+|\b)/)); - }; - - var CssDiff = new fbDiff(true); - CssDiff.tokenize = function(value) { - return removeEmpty(value.split(/([{}:;,]|\s+)/)); - }; - - var LineDiff = new fbDiff(); - LineDiff.tokenize = function(value) { - return value.split(/^/m); - }; - - return { - diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); }, - diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); }, - diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); }, - - diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); }, - - createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) { - var ret = []; - - ret.push("Index: " + fileName); - ret.push("==================================================================="); - ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader)); - ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader)); - - var diff = LineDiff.diff(oldStr, newStr); - if (!diff[diff.length-1].value) { - diff.pop(); // Remove trailing newline add - } - diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function(entry) { return ' ' + entry; }); - } - function eofNL(curRange, i, current) { - var last = diff[diff.length-2], - isLast = i === diff.length-2, - isLastOfType = i === diff.length-3 && (current.added === !last.added || current.removed === !last.removed); - - // Figure out if this is the last line for the given file and missing NL - if (!/\n$/.test(current.value) && (isLast || isLastOfType)) { - curRange.push('\\ No newline at end of file'); - } - } - - var oldRangeStart = 0, newRangeStart = 0, curRange = [], - oldLine = 1, newLine = 1; - for (var i = 0; i < diff.length; i++) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - - if (current.added || current.removed) { - if (!oldRangeStart) { - var prev = diff[i-1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = contextLines(prev.lines.slice(-4)); - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?"+":"-") + entry; })); - eofNL(curRange, i, current); - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= 8 && i < diff.length-2) { - // Overlapping - curRange.push.apply(curRange, contextLines(lines)); - } else { - // end the range and output - var contextSize = Math.min(lines.length, 4); - ret.push( - "@@ -" + oldRangeStart + "," + (oldLine-oldRangeStart+contextSize) - + " +" + newRangeStart + "," + (newLine-newRangeStart+contextSize) - + " @@"); - ret.push.apply(ret, curRange); - ret.push.apply(ret, contextLines(lines.slice(0, contextSize))); - if (lines.length <= 4) { - eofNL(ret, i, current); - } - - oldRangeStart = 0; newRangeStart = 0; curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - } - - return ret.join('\n') + '\n'; - }, - - convertChangesToXML: function(changes){ - var ret = []; - for ( var i = 0; i < changes.length; i++) { - var change = changes[i]; - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - } - return ret.join(""); - } - }; -})(); - -if (typeof module !== "undefined") { - module.exports = JsDiff; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/events.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/events.js deleted file mode 100644 index cfbd072..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/events.js +++ /dev/null @@ -1,178 +0,0 @@ - -/** - * Module exports. - */ - -exports.EventEmitter = EventEmitter; - -/** - * Check if `obj` is an array. - */ - -function isArray(obj) { - return '[object Array]' == {}.toString.call(obj); -} - -/** - * Event emitter constructor. - * - * @api public - */ - -function EventEmitter(){}; - -/** - * Adds a listener. - * - * @api public - */ - -EventEmitter.prototype.on = function (name, fn) { - if (!this.$events) { - this.$events = {}; - } - - if (!this.$events[name]) { - this.$events[name] = fn; - } else if (isArray(this.$events[name])) { - this.$events[name].push(fn); - } else { - this.$events[name] = [this.$events[name], fn]; - } - - return this; -}; - -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -/** - * Adds a volatile listener. - * - * @api public - */ - -EventEmitter.prototype.once = function (name, fn) { - var self = this; - - function on () { - self.removeListener(name, on); - fn.apply(this, arguments); - }; - - on.listener = fn; - this.on(name, on); - - return this; -}; - -/** - * Removes a listener. - * - * @api public - */ - -EventEmitter.prototype.removeListener = function (name, fn) { - if (this.$events && this.$events[name]) { - var list = this.$events[name]; - - if (isArray(list)) { - var pos = -1; - - for (var i = 0, l = list.length; i < l; i++) { - if (list[i] === fn || (list[i].listener && list[i].listener === fn)) { - pos = i; - break; - } - } - - if (pos < 0) { - return this; - } - - list.splice(pos, 1); - - if (!list.length) { - delete this.$events[name]; - } - } else if (list === fn || (list.listener && list.listener === fn)) { - delete this.$events[name]; - } - } - - return this; -}; - -/** - * Removes all listeners for an event. - * - * @api public - */ - -EventEmitter.prototype.removeAllListeners = function (name) { - if (name === undefined) { - this.$events = {}; - return this; - } - - if (this.$events && this.$events[name]) { - this.$events[name] = null; - } - - return this; -}; - -/** - * Gets all listeners for a certain event. - * - * @api public - */ - -EventEmitter.prototype.listeners = function (name) { - if (!this.$events) { - this.$events = {}; - } - - if (!this.$events[name]) { - this.$events[name] = []; - } - - if (!isArray(this.$events[name])) { - this.$events[name] = [this.$events[name]]; - } - - return this.$events[name]; -}; - -/** - * Emits an event. - * - * @api public - */ - -EventEmitter.prototype.emit = function (name) { - if (!this.$events) { - return false; - } - - var handler = this.$events[name]; - - if (!handler) { - return false; - } - - var args = [].slice.call(arguments, 1); - - if ('function' == typeof handler) { - handler.apply(this, args); - } else if (isArray(handler)) { - var listeners = handler.slice(); - - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - } else { - return false; - } - - return true; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/fs.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/fs.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/path.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/path.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/progress.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/progress.js deleted file mode 100644 index 1d60cde..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/progress.js +++ /dev/null @@ -1,125 +0,0 @@ - -/** - * Expose `Progress`. - */ - -module.exports = Progress; - -/** - * Initialize a new `Progress` indicator. - */ - -function Progress() { - this.percent = 0; - this.size(0); - this.fontSize(11); - this.font('helvetica, arial, sans-serif'); -} - -/** - * Set progress size to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.size = function(n){ - this._size = n; - return this; -}; - -/** - * Set text to `str`. - * - * @param {String} str - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.text = function(str){ - this._text = str; - return this; -}; - -/** - * Set font size to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.fontSize = function(n){ - this._fontSize = n; - return this; -}; - -/** - * Set font `family`. - * - * @param {String} family - * @return {Progress} for chaining - */ - -Progress.prototype.font = function(family){ - this._font = family; - return this; -}; - -/** - * Update percentage to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - */ - -Progress.prototype.update = function(n){ - this.percent = n; - return this; -}; - -/** - * Draw on `ctx`. - * - * @param {CanvasRenderingContext2d} ctx - * @return {Progress} for chaining - */ - -Progress.prototype.draw = function(ctx){ - var percent = Math.min(this.percent, 100) - , size = this._size - , half = size / 2 - , x = half - , y = half - , rad = half - 1 - , fontSize = this._fontSize; - - ctx.font = fontSize + 'px ' + this._font; - - var angle = Math.PI * 2 * (percent / 100); - ctx.clearRect(0, 0, size, size); - - // outer circle - ctx.strokeStyle = '#9f9f9f'; - ctx.beginPath(); - ctx.arc(x, y, rad, 0, angle, false); - ctx.stroke(); - - // inner circle - ctx.strokeStyle = '#eee'; - ctx.beginPath(); - ctx.arc(x, y, rad - 1, 0, angle, true); - ctx.stroke(); - - // text - var text = this._text || (percent | 0) + '%' - , w = ctx.measureText(text).width; - - ctx.fillText( - text - , x - w / 2 + 1 - , y + fontSize / 2 - 1); - - return this; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/tty.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/tty.js deleted file mode 100644 index 6f5f079..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/browser/tty.js +++ /dev/null @@ -1,13 +0,0 @@ - -exports.isatty = function(){ - return true; -}; - -exports.getWindowSize = function(){ - if ('innerHeight' in global) { - return [global.innerHeight, global.innerWidth]; - } else { - // In a Web Worker, the DOM Window is not available. - return [640, 480]; - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/context.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/context.js deleted file mode 100644 index 6d6422a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/context.js +++ /dev/null @@ -1,69 +0,0 @@ - -/** - * Expose `Context`. - */ - -module.exports = Context; - -/** - * Initialize a new `Context`. - * - * @api private - */ - -function Context(){} - -/** - * Set or get the context `Runnable` to `runnable`. - * - * @param {Runnable} runnable - * @return {Context} - * @api private - */ - -Context.prototype.runnable = function(runnable){ - if (0 == arguments.length) return this._runnable; - this.test = this._runnable = runnable; - return this; -}; - -/** - * Set test timeout `ms`. - * - * @param {Number} ms - * @return {Context} self - * @api private - */ - -Context.prototype.timeout = function(ms){ - this.runnable().timeout(ms); - return this; -}; - -/** - * Set test slowness threshold `ms`. - * - * @param {Number} ms - * @return {Context} self - * @api private - */ - -Context.prototype.slow = function(ms){ - this.runnable().slow(ms); - return this; -}; - -/** - * Inspect the context void of `._runnable`. - * - * @return {String} - * @api private - */ - -Context.prototype.inspect = function(){ - return JSON.stringify(this, function(key, val){ - if ('_runnable' == key) return; - if ('test' == key) return; - return val; - }, 2); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/hook.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/hook.js deleted file mode 100644 index 814e7b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/hook.js +++ /dev/null @@ -1,49 +0,0 @@ - -/** - * Module dependencies. - */ - -var Runnable = require('./runnable'); - -/** - * Expose `Hook`. - */ - -module.exports = Hook; - -/** - * Initialize a new `Hook` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Hook(title, fn) { - Runnable.call(this, title, fn); - this.type = 'hook'; -} - -/** - * Inherit from `Runnable.prototype`. - */ - -Hook.prototype.__proto__ = Runnable.prototype; - -/** - * Get or set the test `err`. - * - * @param {Error} err - * @return {Error} - * @api public - */ - -Hook.prototype.error = function(err){ - if (0 == arguments.length) { - var err = this._error; - this._error = null; - return err; - } - - this._error = err; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/bdd.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/bdd.js deleted file mode 100644 index e838109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/bdd.js +++ /dev/null @@ -1,135 +0,0 @@ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils'); - -/** - * BDD-style interface: - * - * describe('Array', function(){ - * describe('#indexOf()', function(){ - * it('should return -1 when not present', function(){ - * - * }); - * - * it('should return the index when present', function(){ - * - * }); - * }); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before running tests. - */ - - context.before = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after running tests. - */ - - context.after = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Execute before each test case. - */ - - context.beforeEach = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.afterEach = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Describe a "suite" with the given `title` - * and callback `fn` containing nested suites - * and/or tests. - */ - - context.describe = context.context = function(title, fn){ - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - fn.call(suite); - suites.shift(); - return suite; - }; - - /** - * Pending describe. - */ - - context.xdescribe = - context.xcontext = - context.describe.skip = function(title, fn){ - var suite = Suite.create(suites[0], title); - suite.pending = true; - suites.unshift(suite); - fn.call(suite); - suites.shift(); - }; - - /** - * Exclusive suite. - */ - - context.describe.only = function(title, fn){ - var suite = context.describe(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.it = context.specify = function(title, fn){ - var suite = suites[0]; - if (suite.pending) var fn = null; - var test = new Test(title, fn); - suite.addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.it.only = function(title, fn){ - var test = context.it(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.xit = - context.xspecify = - context.it.skip = function(title){ - context.it(title); - }; - }); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/exports.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/exports.js deleted file mode 100644 index 6b229c0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/exports.js +++ /dev/null @@ -1,60 +0,0 @@ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test'); - -/** - * TDD-style interface: - * - * exports.Array = { - * '#indexOf()': { - * 'should return -1 when the value is not present': function(){ - * - * }, - * - * 'should return the correct index when the value is present': function(){ - * - * } - * } - * }; - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('require', visit); - - function visit(obj) { - var suite; - for (var key in obj) { - if ('function' == typeof obj[key]) { - var fn = obj[key]; - switch (key) { - case 'before': - suites[0].beforeAll(fn); - break; - case 'after': - suites[0].afterAll(fn); - break; - case 'beforeEach': - suites[0].beforeEach(fn); - break; - case 'afterEach': - suites[0].afterEach(fn); - break; - default: - suites[0].addTest(new Test(key, fn)); - } - } else { - var suite = Suite.create(suites[0], key); - suites.unshift(suite); - visit(obj[key]); - suites.shift(); - } - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/index.js deleted file mode 100644 index f7b2655..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/index.js +++ /dev/null @@ -1,5 +0,0 @@ - -exports.bdd = require('./bdd'); -exports.tdd = require('./tdd'); -exports.qunit = require('./qunit'); -exports.exports = require('./exports'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/qunit.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/qunit.js deleted file mode 100644 index 30f6748..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/qunit.js +++ /dev/null @@ -1,122 +0,0 @@ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils'); - -/** - * QUnit-style interface: - * - * suite('Array'); - * - * test('#length', function(){ - * var arr = [1,2,3]; - * ok(arr.length == 3); - * }); - * - * test('#indexOf()', function(){ - * var arr = [1,2,3]; - * ok(arr.indexOf(1) == 0); - * ok(arr.indexOf(2) == 1); - * ok(arr.indexOf(3) == 2); - * }); - * - * suite('String'); - * - * test('#length', function(){ - * ok('foo'.length == 3); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before running tests. - */ - - context.before = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after running tests. - */ - - context.after = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Execute before each test case. - */ - - context.beforeEach = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.afterEach = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Describe a "suite" with the given `title`. - */ - - context.suite = function(title){ - if (suites.length > 1) suites.shift(); - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - return suite; - }; - - /** - * Exclusive test-case. - */ - - context.suite.only = function(title, fn){ - var suite = context.suite(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.test = function(title, fn){ - var test = new Test(title, fn); - suites[0].addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.test.only = function(title, fn){ - var test = context.test(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.test.skip = function(title){ - context.test(title); - }; - }); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/tdd.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/tdd.js deleted file mode 100644 index da5ca2c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/interfaces/tdd.js +++ /dev/null @@ -1,138 +0,0 @@ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils');; - -/** - * TDD-style interface: - * - * suite('Array', function(){ - * suite('#indexOf()', function(){ - * suiteSetup(function(){ - * - * }); - * - * test('should return -1 when not present', function(){ - * - * }); - * - * test('should return the index when present', function(){ - * - * }); - * - * suiteTeardown(function(){ - * - * }); - * }); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before each test case. - */ - - context.setup = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.teardown = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Execute before the suite. - */ - - context.suiteSetup = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after the suite. - */ - - context.suiteTeardown = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Describe a "suite" with the given `title` - * and callback `fn` containing nested suites - * and/or tests. - */ - - context.suite = function(title, fn){ - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - fn.call(suite); - suites.shift(); - return suite; - }; - - /** - * Pending suite. - */ - context.suite.skip = function(title, fn) { - var suite = Suite.create(suites[0], title); - suite.pending = true; - suites.unshift(suite); - fn.call(suite); - suites.shift(); - }; - - /** - * Exclusive test-case. - */ - - context.suite.only = function(title, fn){ - var suite = context.suite(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.test = function(title, fn){ - var suite = suites[0]; - if (suite.pending) var fn = null; - var test = new Test(title, fn); - suite.addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.test.only = function(title, fn){ - var test = context.test(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.test.skip = function(title){ - context.test(title); - }; - }); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/mocha.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/mocha.js deleted file mode 100644 index 184b886..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/mocha.js +++ /dev/null @@ -1,317 +0,0 @@ -/*! - * mocha - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var path = require('path') - , utils = require('./utils'); - -/** - * Expose `Mocha`. - */ - -exports = module.exports = Mocha; - -/** - * Expose internals. - */ - -exports.utils = utils; -exports.interfaces = require('./interfaces'); -exports.reporters = require('./reporters'); -exports.Runnable = require('./runnable'); -exports.Context = require('./context'); -exports.Runner = require('./runner'); -exports.Suite = require('./suite'); -exports.Hook = require('./hook'); -exports.Test = require('./test'); - -/** - * Return image `name` path. - * - * @param {String} name - * @return {String} - * @api private - */ - -function image(name) { - return __dirname + '/../images/' + name + '.png'; -} - -/** - * Setup mocha with `options`. - * - * Options: - * - * - `ui` name "bdd", "tdd", "exports" etc - * - `reporter` reporter instance, defaults to `mocha.reporters.Dot` - * - `globals` array of accepted globals - * - `timeout` timeout in milliseconds - * - `bail` bail on the first test failure - * - `slow` milliseconds to wait before considering a test slow - * - `ignoreLeaks` ignore global leaks - * - `grep` string or regexp to filter tests with - * - * @param {Object} options - * @api public - */ - -function Mocha(options) { - options = options || {}; - this.files = []; - this.options = options; - this.grep(options.grep); - this.suite = new exports.Suite('', new exports.Context); - this.ui(options.ui); - this.bail(options.bail); - this.reporter(options.reporter); - if (typeof options.timeout === 'number') this.timeout(options.timeout); - if (options.slow) this.slow(options.slow); -} - -/** - * Enable or disable bailing on the first failure. - * - * @param {Boolean} [bail] - * @api public - */ - -Mocha.prototype.bail = function(bail){ - if (0 == arguments.length) bail = true; - this.suite.bail(bail); - return this; -}; - -/** - * Add test `file`. - * - * @param {String} file - * @api public - */ - -Mocha.prototype.addFile = function(file){ - this.files.push(file); - return this; -}; - -/** - * Set reporter to `reporter`, defaults to "dot". - * - * @param {String|Function} reporter name or constructor - * @api public - */ - -Mocha.prototype.reporter = function(reporter){ - if ('function' == typeof reporter) { - this._reporter = reporter; - } else { - reporter = reporter || 'dot'; - try { - this._reporter = require('./reporters/' + reporter); - } catch (err) { - this._reporter = require(reporter); - } - if (!this._reporter) throw new Error('invalid reporter "' + reporter + '"'); - } - return this; -}; - -/** - * Set test UI `name`, defaults to "bdd". - * - * @param {String} bdd - * @api public - */ - -Mocha.prototype.ui = function(name){ - name = name || 'bdd'; - this._ui = exports.interfaces[name]; - if (!this._ui) throw new Error('invalid interface "' + name + '"'); - this._ui = this._ui(this.suite); - return this; -}; - -/** - * Load registered files. - * - * @api private - */ - -Mocha.prototype.loadFiles = function(fn){ - var self = this; - var suite = this.suite; - var pending = this.files.length; - this.files.forEach(function(file){ - file = path.resolve(file); - suite.emit('pre-require', global, file, self); - suite.emit('require', require(file), file, self); - suite.emit('post-require', global, file, self); - --pending || (fn && fn()); - }); -}; - -/** - * Enable growl support. - * - * @api private - */ - -Mocha.prototype._growl = function(runner, reporter) { - var notify = require('growl'); - - runner.on('end', function(){ - var stats = reporter.stats; - if (stats.failures) { - var msg = stats.failures + ' of ' + runner.total + ' tests failed'; - notify(msg, { name: 'mocha', title: 'Failed', image: image('error') }); - } else { - notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', { - name: 'mocha' - , title: 'Passed' - , image: image('ok') - }); - } - }); -}; - -/** - * Add regexp to grep, if `re` is a string it is escaped. - * - * @param {RegExp|String} re - * @return {Mocha} - * @api public - */ - -Mocha.prototype.grep = function(re){ - this.options.grep = 'string' == typeof re - ? new RegExp(utils.escapeRegexp(re)) - : re; - return this; -}; - -/** - * Invert `.grep()` matches. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.invert = function(){ - this.options.invert = true; - return this; -}; - -/** - * Ignore global leaks. - * - * @param {Boolean} ignore - * @return {Mocha} - * @api public - */ - -Mocha.prototype.ignoreLeaks = function(ignore){ - this.options.ignoreLeaks = !!ignore; - return this; -}; - -/** - * Enable global leak checking. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.checkLeaks = function(){ - this.options.ignoreLeaks = false; - return this; -}; - -/** - * Enable growl support. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.growl = function(){ - this.options.growl = true; - return this; -}; - -/** - * Ignore `globals` array or string. - * - * @param {Array|String} globals - * @return {Mocha} - * @api public - */ - -Mocha.prototype.globals = function(globals){ - this.options.globals = (this.options.globals || []).concat(globals); - return this; -}; - -/** - * Set the timeout in milliseconds. - * - * @param {Number} timeout - * @return {Mocha} - * @api public - */ - -Mocha.prototype.timeout = function(timeout){ - this.suite.timeout(timeout); - return this; -}; - -/** - * Set slowness threshold in milliseconds. - * - * @param {Number} slow - * @return {Mocha} - * @api public - */ - -Mocha.prototype.slow = function(slow){ - this.suite.slow(slow); - return this; -}; - -/** - * Makes all tests async (accepting a callback) - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.asyncOnly = function(){ - this.options.asyncOnly = true; - return this; -}; - -/** - * Run tests and invoke `fn()` when complete. - * - * @param {Function} fn - * @return {Runner} - * @api public - */ - -Mocha.prototype.run = function(fn){ - if (this.files.length) this.loadFiles(); - var suite = this.suite; - var options = this.options; - var runner = new exports.Runner(suite); - var reporter = new this._reporter(runner); - runner.ignoreLeaks = false !== options.ignoreLeaks; - runner.asyncOnly = options.asyncOnly; - if (options.grep) runner.grep(options.grep, options.invert); - if (options.globals) runner.globals(options.globals); - if (options.growl) this._growl(runner, reporter); - return runner.run(fn); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/ms.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/ms.js deleted file mode 100644 index c5847f8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/ms.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 's': - return n * s; - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/base.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/base.js deleted file mode 100644 index 35c9091..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/base.js +++ /dev/null @@ -1,401 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty') - , diff = require('diff') - , ms = require('../ms'); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Check if both stdio streams are associated with a tty. - */ - -var isatty = tty.isatty(1) && tty.isatty(2); - -/** - * Expose `Base`. - */ - -exports = module.exports = Base; - -/** - * Enable coloring by default. - */ - -exports.useColors = isatty; - -/** - * Default color map. - */ - -exports.colors = { - 'pass': 90 - , 'fail': 31 - , 'bright pass': 92 - , 'bright fail': 91 - , 'bright yellow': 93 - , 'pending': 36 - , 'suite': 0 - , 'error title': 0 - , 'error message': 31 - , 'error stack': 90 - , 'checkmark': 32 - , 'fast': 90 - , 'medium': 33 - , 'slow': 31 - , 'green': 32 - , 'light': 90 - , 'diff gutter': 90 - , 'diff added': 42 - , 'diff removed': 41 -}; - -/** - * Default symbol map. - */ - -exports.symbols = { - ok: '✓', - err: '✖', - dot: '․' -}; - -// With node.js on Windows: use symbols available in terminal default fonts -if ('win32' == process.platform) { - exports.symbols.ok = '\u221A'; - exports.symbols.err = '\u00D7'; - exports.symbols.dot = '.'; -} - -/** - * Color `str` with the given `type`, - * allowing colors to be disabled, - * as well as user-defined color - * schemes. - * - * @param {String} type - * @param {String} str - * @return {String} - * @api private - */ - -var color = exports.color = function(type, str) { - if (!exports.useColors) return str; - return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m'; -}; - -/** - * Expose term window size, with some - * defaults for when stderr is not a tty. - */ - -exports.window = { - width: isatty - ? process.stdout.getWindowSize - ? process.stdout.getWindowSize(1)[0] - : tty.getWindowSize()[1] - : 75 -}; - -/** - * Expose some basic cursor interactions - * that are common among reporters. - */ - -exports.cursor = { - hide: function(){ - process.stdout.write('\u001b[?25l'); - }, - - show: function(){ - process.stdout.write('\u001b[?25h'); - }, - - deleteLine: function(){ - process.stdout.write('\u001b[2K'); - }, - - beginningOfLine: function(){ - process.stdout.write('\u001b[0G'); - }, - - CR: function(){ - exports.cursor.deleteLine(); - exports.cursor.beginningOfLine(); - } -}; - -/** - * Outut the given `failures` as a list. - * - * @param {Array} failures - * @api public - */ - -exports.list = function(failures){ - console.error(); - failures.forEach(function(test, i){ - // format - var fmt = color('error title', ' %s) %s:\n') - + color('error message', ' %s') - + color('error stack', '\n%s\n'); - - // msg - var err = test.err - , message = err.message || '' - , stack = err.stack || message - , index = stack.indexOf(message) + message.length - , msg = stack.slice(0, index) - , actual = err.actual - , expected = err.expected - , escape = true; - - // uncaught - if (err.uncaught) { - msg = 'Uncaught ' + msg; - } - - // explicitly show diff - if (err.showDiff && sameType(actual, expected)) { - escape = false; - err.actual = actual = stringify(actual); - err.expected = expected = stringify(expected); - } - - // actual / expected diff - if ('string' == typeof actual && 'string' == typeof expected) { - msg = errorDiff(err, 'Words', escape); - - // linenos - var lines = msg.split('\n'); - if (lines.length > 4) { - var width = String(lines.length).length; - msg = lines.map(function(str, i){ - return pad(++i, width) + ' |' + ' ' + str; - }).join('\n'); - } - - // legend - msg = '\n' - + color('diff removed', 'actual') - + ' ' - + color('diff added', 'expected') - + '\n\n' - + msg - + '\n'; - - // indent - msg = msg.replace(/^/gm, ' '); - - fmt = color('error title', ' %s) %s:\n%s') - + color('error stack', '\n%s\n'); - } - - // indent stack trace without msg - stack = stack.slice(index ? index + 1 : index) - .replace(/^/gm, ' '); - - console.error(fmt, (i + 1), test.fullTitle(), msg, stack); - }); -}; - -/** - * Initialize a new `Base` reporter. - * - * All other reporters generally - * inherit from this reporter, providing - * stats such as test duration, number - * of tests passed / failed etc. - * - * @param {Runner} runner - * @api public - */ - -function Base(runner) { - var self = this - , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 } - , failures = this.failures = []; - - if (!runner) return; - this.runner = runner; - - runner.stats = stats; - - runner.on('start', function(){ - stats.start = new Date; - }); - - runner.on('suite', function(suite){ - stats.suites = stats.suites || 0; - suite.root || stats.suites++; - }); - - runner.on('test end', function(test){ - stats.tests = stats.tests || 0; - stats.tests++; - }); - - runner.on('pass', function(test){ - stats.passes = stats.passes || 0; - - var medium = test.slow() / 2; - test.speed = test.duration > test.slow() - ? 'slow' - : test.duration > medium - ? 'medium' - : 'fast'; - - stats.passes++; - }); - - runner.on('fail', function(test, err){ - stats.failures = stats.failures || 0; - stats.failures++; - test.err = err; - failures.push(test); - }); - - runner.on('end', function(){ - stats.end = new Date; - stats.duration = new Date - stats.start; - }); - - runner.on('pending', function(){ - stats.pending++; - }); -} - -/** - * Output common epilogue used by many of - * the bundled reporters. - * - * @api public - */ - -Base.prototype.epilogue = function(){ - var stats = this.stats; - var tests; - var fmt; - - console.log(); - - // passes - fmt = color('bright pass', ' ') - + color('green', ' %d passing') - + color('light', ' (%s)'); - - console.log(fmt, - stats.passes || 0, - ms(stats.duration)); - - // pending - if (stats.pending) { - fmt = color('pending', ' ') - + color('pending', ' %d pending'); - - console.log(fmt, stats.pending); - } - - // failures - if (stats.failures) { - fmt = color('fail', ' %d failing'); - - console.error(fmt, - stats.failures); - - Base.list(this.failures); - console.error(); - } - - console.log(); -}; - -/** - * Pad the given `str` to `len`. - * - * @param {String} str - * @param {String} len - * @return {String} - * @api private - */ - -function pad(str, len) { - str = String(str); - return Array(len - str.length + 1).join(' ') + str; -} - -/** - * Return a character diff for `err`. - * - * @param {Error} err - * @return {String} - * @api private - */ - -function errorDiff(err, type, escape) { - return diff['diff' + type](err.actual, err.expected).map(function(str){ - if (escape) { - str.value = str.value - .replace(/\t/g, '') - .replace(/\r/g, '') - .replace(/\n/g, '\n'); - } - if (str.added) return colorLines('diff added', str.value); - if (str.removed) return colorLines('diff removed', str.value); - return str.value; - }).join(''); -} - -/** - * Color lines for `str`, using the color `name`. - * - * @param {String} name - * @param {String} str - * @return {String} - * @api private - */ - -function colorLines(name, str) { - return str.split('\n').map(function(str){ - return color(name, str); - }).join('\n'); -} - -/** - * Stringify `obj`. - * - * @param {Mixed} obj - * @return {String} - * @api private - */ - -function stringify(obj) { - if (obj instanceof RegExp) return obj.toString(); - return JSON.stringify(obj, null, 2); -} - -/** - * Check that a / b have the same type. - * - * @param {Object} a - * @param {Object} b - * @return {Boolean} - * @api private - */ - -function sameType(a, b) { - a = Object.prototype.toString.call(a); - b = Object.prototype.toString.call(b); - return a == b; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/doc.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/doc.js deleted file mode 100644 index 2e5bf57..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/doc.js +++ /dev/null @@ -1,56 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils'); - -/** - * Expose `Doc`. - */ - -exports = module.exports = Doc; - -/** - * Initialize a new `Doc` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Doc(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total - , indents = 2; - - function indent() { - return Array(indents).join(' '); - } - - runner.on('suite', function(suite){ - if (suite.root) return; - ++indents; - console.log('%s
    ', indent()); - ++indents; - console.log('%s

    %s

    ', indent(), utils.escape(suite.title)); - console.log('%s
    ', indent()); - }); - - runner.on('suite end', function(suite){ - if (suite.root) return; - console.log('%s
    ', indent()); - --indents; - console.log('%s
    ', indent()); - --indents; - }); - - runner.on('pass', function(test){ - console.log('%s
    %s
    ', indent(), utils.escape(test.title)); - var code = utils.escape(utils.clean(test.fn.toString())); - console.log('%s
    %s
    ', indent(), code); - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/dot.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/dot.js deleted file mode 100644 index 0c298ba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/dot.js +++ /dev/null @@ -1,62 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `Dot`. - */ - -exports = module.exports = Dot; - -/** - * Initialize a new `Dot` matrix test reporter. - * - * @param {Runner} runner - * @api public - */ - -function Dot(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , n = 0; - - runner.on('start', function(){ - process.stdout.write('\n '); - }); - - runner.on('pending', function(test){ - process.stdout.write(color('pending', Base.symbols.dot)); - }); - - runner.on('pass', function(test){ - if (++n % width == 0) process.stdout.write('\n '); - if ('slow' == test.speed) { - process.stdout.write(color('bright yellow', Base.symbols.dot)); - } else { - process.stdout.write(color(test.speed, Base.symbols.dot)); - } - }); - - runner.on('fail', function(test, err){ - if (++n % width == 0) process.stdout.write('\n '); - process.stdout.write(color('fail', Base.symbols.dot)); - }); - - runner.on('end', function(){ - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -Dot.prototype.__proto__ = Base.prototype; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/html-cov.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/html-cov.js deleted file mode 100644 index bfb27ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/html-cov.js +++ /dev/null @@ -1,51 +0,0 @@ - -/** - * Module dependencies. - */ - -var JSONCov = require('./json-cov') - , fs = require('fs'); - -/** - * Expose `HTMLCov`. - */ - -exports = module.exports = HTMLCov; - -/** - * Initialize a new `JsCoverage` reporter. - * - * @param {Runner} runner - * @api public - */ - -function HTMLCov(runner) { - var jade = require('jade') - , file = __dirname + '/templates/coverage.jade' - , str = fs.readFileSync(file, 'utf8') - , fn = jade.compile(str, { filename: file }) - , self = this; - - JSONCov.call(this, runner, false); - - runner.on('end', function(){ - process.stdout.write(fn({ - cov: self.cov - , coverageClass: coverageClass - })); - }); -} - -/** - * Return coverage class for `n`. - * - * @return {String} - * @api private - */ - -function coverageClass(n) { - if (n >= 75) return 'high'; - if (n >= 50) return 'medium'; - if (n >= 25) return 'low'; - return 'terrible'; -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/html.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/html.js deleted file mode 100644 index f09279b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/html.js +++ /dev/null @@ -1,253 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils') - , Progress = require('../browser/progress') - , escape = utils.escape; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Expose `Doc`. - */ - -exports = module.exports = HTML; - -/** - * Stats template. - */ - -var statsTemplate = '
    '; - -/** - * Initialize a new `Doc` reporter. - * - * @param {Runner} runner - * @api public - */ - -function HTML(runner, root) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total - , stat = fragment(statsTemplate) - , items = stat.getElementsByTagName('li') - , passes = items[1].getElementsByTagName('em')[0] - , passesLink = items[1].getElementsByTagName('a')[0] - , failures = items[2].getElementsByTagName('em')[0] - , failuresLink = items[2].getElementsByTagName('a')[0] - , duration = items[3].getElementsByTagName('em')[0] - , canvas = stat.getElementsByTagName('canvas')[0] - , report = fragment('
      ') - , stack = [report] - , progress - , ctx - - root = root || document.getElementById('mocha'); - - if (canvas.getContext) { - var ratio = window.devicePixelRatio || 1; - canvas.style.width = canvas.width; - canvas.style.height = canvas.height; - canvas.width *= ratio; - canvas.height *= ratio; - ctx = canvas.getContext('2d'); - ctx.scale(ratio, ratio); - progress = new Progress; - } - - if (!root) return error('#mocha div missing, add it to your document'); - - // pass toggle - on(passesLink, 'click', function(){ - unhide(); - var name = /pass/.test(report.className) ? '' : ' pass'; - report.className = report.className.replace(/fail|pass/g, '') + name; - if (report.className.trim()) hideSuitesWithout('test pass'); - }); - - // failure toggle - on(failuresLink, 'click', function(){ - unhide(); - var name = /fail/.test(report.className) ? '' : ' fail'; - report.className = report.className.replace(/fail|pass/g, '') + name; - if (report.className.trim()) hideSuitesWithout('test fail'); - }); - - root.appendChild(stat); - root.appendChild(report); - - if (progress) progress.size(40); - - runner.on('suite', function(suite){ - if (suite.root) return; - - // suite - var url = '?grep=' + encodeURIComponent(suite.fullTitle()); - var el = fragment('
    • %s

    • ', url, escape(suite.title)); - - // container - stack[0].appendChild(el); - stack.unshift(document.createElement('ul')); - el.appendChild(stack[0]); - }); - - runner.on('suite end', function(suite){ - if (suite.root) return; - stack.shift(); - }); - - runner.on('fail', function(test, err){ - if ('hook' == test.type) runner.emit('test end', test); - }); - - runner.on('test end', function(test){ - // TODO: add to stats - var percent = stats.tests / this.total * 100 | 0; - if (progress) progress.update(percent).draw(ctx); - - // update stats - var ms = new Date - stats.start; - text(passes, stats.passes); - text(failures, stats.failures); - text(duration, (ms / 1000).toFixed(2)); - - // test - if ('passed' == test.state) { - var el = fragment('
    • %e%ems

    • ', test.speed, test.title, test.duration, encodeURIComponent(test.fullTitle())); - } else if (test.pending) { - var el = fragment('
    • %e

    • ', test.title); - } else { - var el = fragment('
    • %e

    • ', test.title, encodeURIComponent(test.fullTitle())); - var str = test.err.stack || test.err.toString(); - - // FF / Opera do not add the message - if (!~str.indexOf(test.err.message)) { - str = test.err.message + '\n' + str; - } - - // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we - // check for the result of the stringifying. - if ('[object Error]' == str) str = test.err.message; - - // Safari doesn't give you a stack. Let's at least provide a source line. - if (!test.err.stack && test.err.sourceURL && test.err.line !== undefined) { - str += "\n(" + test.err.sourceURL + ":" + test.err.line + ")"; - } - - el.appendChild(fragment('
      %e
      ', str)); - } - - // toggle code - // TODO: defer - if (!test.pending) { - var h2 = el.getElementsByTagName('h2')[0]; - - on(h2, 'click', function(){ - pre.style.display = 'none' == pre.style.display - ? 'block' - : 'none'; - }); - - var pre = fragment('
      %e
      ', utils.clean(test.fn.toString())); - el.appendChild(pre); - pre.style.display = 'none'; - } - - // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack. - if (stack[0]) stack[0].appendChild(el); - }); -} - -/** - * Display error `msg`. - */ - -function error(msg) { - document.body.appendChild(fragment('
      %s
      ', msg)); -} - -/** - * Return a DOM fragment from `html`. - */ - -function fragment(html) { - var args = arguments - , div = document.createElement('div') - , i = 1; - - div.innerHTML = html.replace(/%([se])/g, function(_, type){ - switch (type) { - case 's': return String(args[i++]); - case 'e': return escape(args[i++]); - } - }); - - return div.firstChild; -} - -/** - * Check for suites that do not have elements - * with `classname`, and hide them. - */ - -function hideSuitesWithout(classname) { - var suites = document.getElementsByClassName('suite'); - for (var i = 0; i < suites.length; i++) { - var els = suites[i].getElementsByClassName(classname); - if (0 == els.length) suites[i].className += ' hidden'; - } -} - -/** - * Unhide .hidden suites. - */ - -function unhide() { - var els = document.getElementsByClassName('suite hidden'); - for (var i = 0; i < els.length; ++i) { - els[i].className = els[i].className.replace('suite hidden', 'suite'); - } -} - -/** - * Set `el` text to `str`. - */ - -function text(el, str) { - if (el.textContent) { - el.textContent = str; - } else { - el.innerText = str; - } -} - -/** - * Listen on `event` with callback `fn`. - */ - -function on(el, event, fn) { - if (el.addEventListener) { - el.addEventListener(event, fn, false); - } else { - el.attachEvent('on' + event, fn); - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/index.js deleted file mode 100644 index 4750f26..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/index.js +++ /dev/null @@ -1,19 +0,0 @@ - -exports.Base = require('./base'); -exports.Dot = require('./dot'); -exports.Doc = require('./doc'); -exports.TAP = require('./tap'); -exports.JSON = require('./json'); -exports.HTML = require('./html'); -exports.List = require('./list'); -exports.Min = require('./min'); -exports.Spec = require('./spec'); -exports.Nyan = require('./nyan'); -exports.XUnit = require('./xunit'); -exports.Markdown = require('./markdown'); -exports.Progress = require('./progress'); -exports.Landing = require('./landing'); -exports.JSONCov = require('./json-cov'); -exports.HTMLCov = require('./html-cov'); -exports.JSONStream = require('./json-stream'); -exports.Teamcity = require('./teamcity'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json-cov.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json-cov.js deleted file mode 100644 index 73d0009..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json-cov.js +++ /dev/null @@ -1,153 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `JSONCov`. - */ - -exports = module.exports = JSONCov; - -/** - * Initialize a new `JsCoverage` reporter. - * - * @param {Runner} runner - * @param {Boolean} output - * @api public - */ - -function JSONCov(runner, output) { - var self = this - , output = 1 == arguments.length ? true : output; - - Base.call(this, runner); - - var tests = [] - , failures = [] - , passes = []; - - runner.on('test end', function(test){ - tests.push(test); - }); - - runner.on('pass', function(test){ - passes.push(test); - }); - - runner.on('fail', function(test){ - failures.push(test); - }); - - runner.on('end', function(){ - var cov = global._$jscoverage || {}; - var result = self.cov = map(cov); - result.stats = self.stats; - result.tests = tests.map(clean); - result.failures = failures.map(clean); - result.passes = passes.map(clean); - if (!output) return; - process.stdout.write(JSON.stringify(result, null, 2 )); - }); -} - -/** - * Map jscoverage data to a JSON structure - * suitable for reporting. - * - * @param {Object} cov - * @return {Object} - * @api private - */ - -function map(cov) { - var ret = { - instrumentation: 'node-jscoverage' - , sloc: 0 - , hits: 0 - , misses: 0 - , coverage: 0 - , files: [] - }; - - for (var filename in cov) { - var data = coverage(filename, cov[filename]); - ret.files.push(data); - ret.hits += data.hits; - ret.misses += data.misses; - ret.sloc += data.sloc; - } - - ret.files.sort(function(a, b) { - return a.filename.localeCompare(b.filename); - }); - - if (ret.sloc > 0) { - ret.coverage = (ret.hits / ret.sloc) * 100; - } - - return ret; -}; - -/** - * Map jscoverage data for a single source file - * to a JSON structure suitable for reporting. - * - * @param {String} filename name of the source file - * @param {Object} data jscoverage coverage data - * @return {Object} - * @api private - */ - -function coverage(filename, data) { - var ret = { - filename: filename, - coverage: 0, - hits: 0, - misses: 0, - sloc: 0, - source: {} - }; - - data.source.forEach(function(line, num){ - num++; - - if (data[num] === 0) { - ret.misses++; - ret.sloc++; - } else if (data[num] !== undefined) { - ret.hits++; - ret.sloc++; - } - - ret.source[num] = { - source: line - , coverage: data[num] === undefined - ? '' - : data[num] - }; - }); - - ret.coverage = ret.hits / ret.sloc * 100; - - return ret; -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json-stream.js deleted file mode 100644 index 7cb8fbe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json-stream.js +++ /dev/null @@ -1,61 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `List`. - */ - -exports = module.exports = List; - -/** - * Initialize a new `List` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function List(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total; - - runner.on('start', function(){ - console.log(JSON.stringify(['start', { total: total }])); - }); - - runner.on('pass', function(test){ - console.log(JSON.stringify(['pass', clean(test)])); - }); - - runner.on('fail', function(test, err){ - console.log(JSON.stringify(['fail', clean(test)])); - }); - - runner.on('end', function(){ - process.stdout.write(JSON.stringify(['end', self.stats])); - }); -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json.js deleted file mode 100644 index a699f50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/json.js +++ /dev/null @@ -1,70 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `JSON`. - */ - -exports = module.exports = JSONReporter; - -/** - * Initialize a new `JSON` reporter. - * - * @param {Runner} runner - * @api public - */ - -function JSONReporter(runner) { - var self = this; - Base.call(this, runner); - - var tests = [] - , failures = [] - , passes = []; - - runner.on('test end', function(test){ - tests.push(test); - }); - - runner.on('pass', function(test){ - passes.push(test); - }); - - runner.on('fail', function(test){ - failures.push(test); - }); - - runner.on('end', function(){ - var obj = { - stats: self.stats - , tests: tests.map(clean) - , failures: failures.map(clean) - , passes: passes.map(clean) - }; - - process.stdout.write(JSON.stringify(obj, null, 2)); - }); -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/landing.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/landing.js deleted file mode 100644 index bf064f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/landing.js +++ /dev/null @@ -1,97 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Landing`. - */ - -exports = module.exports = Landing; - -/** - * Airplane color. - */ - -Base.colors.plane = 0; - -/** - * Airplane crash color. - */ - -Base.colors['plane crash'] = 31; - -/** - * Runway color. - */ - -Base.colors.runway = 90; - -/** - * Initialize a new `Landing` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Landing(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , total = runner.total - , stream = process.stdout - , plane = color('plane', '✈') - , crashed = -1 - , n = 0; - - function runway() { - var buf = Array(width).join('-'); - return ' ' + color('runway', buf); - } - - runner.on('start', function(){ - stream.write('\n '); - cursor.hide(); - }); - - runner.on('test end', function(test){ - // check if the plane crashed - var col = -1 == crashed - ? width * ++n / total | 0 - : crashed; - - // show the crash - if ('failed' == test.state) { - plane = color('plane crash', '✈'); - crashed = col; - } - - // render landing strip - stream.write('\u001b[4F\n\n'); - stream.write(runway()); - stream.write('\n '); - stream.write(color('runway', Array(col).join('⋅'))); - stream.write(plane) - stream.write(color('runway', Array(width - col).join('⋅') + '\n')); - stream.write(runway()); - stream.write('\u001b[0m'); - }); - - runner.on('end', function(){ - cursor.show(); - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -Landing.prototype.__proto__ = Base.prototype; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/list.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/list.js deleted file mode 100644 index 3328e15..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/list.js +++ /dev/null @@ -1,64 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `List`. - */ - -exports = module.exports = List; - -/** - * Initialize a new `List` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function List(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , n = 0; - - runner.on('start', function(){ - console.log(); - }); - - runner.on('test', function(test){ - process.stdout.write(color('pass', ' ' + test.fullTitle() + ': ')); - }); - - runner.on('pending', function(test){ - var fmt = color('checkmark', ' -') - + color('pending', ' %s'); - console.log(fmt, test.fullTitle()); - }); - - runner.on('pass', function(test){ - var fmt = color('checkmark', ' '+Base.symbols.dot) - + color('pass', ' %s: ') - + color(test.speed, '%dms'); - cursor.CR(); - console.log(fmt, test.fullTitle(), test.duration); - }); - - runner.on('fail', function(test, err){ - cursor.CR(); - console.log(color('fail', ' %d) %s'), ++n, test.fullTitle()); - }); - - runner.on('end', self.epilogue.bind(self)); -} - -/** - * Inherit from `Base.prototype`. - */ - -List.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/markdown.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/markdown.js deleted file mode 100644 index 6383a64..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/markdown.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils'); - -/** - * Expose `Markdown`. - */ - -exports = module.exports = Markdown; - -/** - * Initialize a new `Markdown` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Markdown(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , level = 0 - , buf = ''; - - function title(str) { - return Array(level).join('#') + ' ' + str; - } - - function indent() { - return Array(level).join(' '); - } - - function mapTOC(suite, obj) { - var ret = obj; - obj = obj[suite.title] = obj[suite.title] || { suite: suite }; - suite.suites.forEach(function(suite){ - mapTOC(suite, obj); - }); - return ret; - } - - function stringifyTOC(obj, level) { - ++level; - var buf = ''; - var link; - for (var key in obj) { - if ('suite' == key) continue; - if (key) link = ' - [' + key + '](#' + utils.slug(obj[key].suite.fullTitle()) + ')\n'; - if (key) buf += Array(level).join(' ') + link; - buf += stringifyTOC(obj[key], level); - } - --level; - return buf; - } - - function generateTOC(suite) { - var obj = mapTOC(suite, {}); - return stringifyTOC(obj, 0); - } - - generateTOC(runner.suite); - - runner.on('suite', function(suite){ - ++level; - var slug = utils.slug(suite.fullTitle()); - buf += '' + '\n'; - buf += title(suite.title) + '\n'; - }); - - runner.on('suite end', function(suite){ - --level; - }); - - runner.on('pass', function(test){ - var code = utils.clean(test.fn.toString()); - buf += test.title + '.\n'; - buf += '\n```js\n'; - buf += code + '\n'; - buf += '```\n\n'; - }); - - runner.on('end', function(){ - process.stdout.write('# TOC\n'); - process.stdout.write(generateTOC(runner.suite)); - process.stdout.write(buf); - }); -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/min.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/min.js deleted file mode 100644 index 1b6117d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/min.js +++ /dev/null @@ -1,38 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `Min`. - */ - -exports = module.exports = Min; - -/** - * Initialize a new `Min` minimal test reporter (best used with --watch). - * - * @param {Runner} runner - * @api public - */ - -function Min(runner) { - Base.call(this, runner); - - runner.on('start', function(){ - // clear screen - process.stdout.write('\u001b[2J'); - // set cursor position - process.stdout.write('\u001b[1;3H'); - }); - - runner.on('end', this.epilogue.bind(this)); -} - -/** - * Inherit from `Base.prototype`. - */ - -Min.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/nyan.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/nyan.js deleted file mode 100644 index 4501f6b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/nyan.js +++ /dev/null @@ -1,260 +0,0 @@ -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `Dot`. - */ - -exports = module.exports = NyanCat; - -/** - * Initialize a new `Dot` matrix test reporter. - * - * @param {Runner} runner - * @api public - */ - -function NyanCat(runner) { - Base.call(this, runner); - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , rainbowColors = this.rainbowColors = self.generateColors() - , colorIndex = this.colorIndex = 0 - , numerOfLines = this.numberOfLines = 4 - , trajectories = this.trajectories = [[], [], [], []] - , nyanCatWidth = this.nyanCatWidth = 11 - , trajectoryWidthMax = this.trajectoryWidthMax = (width - nyanCatWidth) - , scoreboardWidth = this.scoreboardWidth = 5 - , tick = this.tick = 0 - , n = 0; - - runner.on('start', function(){ - Base.cursor.hide(); - self.draw(); - }); - - runner.on('pending', function(test){ - self.draw(); - }); - - runner.on('pass', function(test){ - self.draw(); - }); - - runner.on('fail', function(test, err){ - self.draw(); - }); - - runner.on('end', function(){ - Base.cursor.show(); - for (var i = 0; i < self.numberOfLines; i++) write('\n'); - self.epilogue(); - }); -} - -/** - * Draw the nyan cat - * - * @api private - */ - -NyanCat.prototype.draw = function(){ - this.appendRainbow(); - this.drawScoreboard(); - this.drawRainbow(); - this.drawNyanCat(); - this.tick = !this.tick; -}; - -/** - * Draw the "scoreboard" showing the number - * of passes, failures and pending tests. - * - * @api private - */ - -NyanCat.prototype.drawScoreboard = function(){ - var stats = this.stats; - var colors = Base.colors; - - function draw(color, n) { - write(' '); - write('\u001b[' + color + 'm' + n + '\u001b[0m'); - write('\n'); - } - - draw(colors.green, stats.passes); - draw(colors.fail, stats.failures); - draw(colors.pending, stats.pending); - write('\n'); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Append the rainbow. - * - * @api private - */ - -NyanCat.prototype.appendRainbow = function(){ - var segment = this.tick ? '_' : '-'; - var rainbowified = this.rainbowify(segment); - - for (var index = 0; index < this.numberOfLines; index++) { - var trajectory = this.trajectories[index]; - if (trajectory.length >= this.trajectoryWidthMax) trajectory.shift(); - trajectory.push(rainbowified); - } -}; - -/** - * Draw the rainbow. - * - * @api private - */ - -NyanCat.prototype.drawRainbow = function(){ - var self = this; - - this.trajectories.forEach(function(line, index) { - write('\u001b[' + self.scoreboardWidth + 'C'); - write(line.join('')); - write('\n'); - }); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Draw the nyan cat - * - * @api private - */ - -NyanCat.prototype.drawNyanCat = function() { - var self = this; - var startWidth = this.scoreboardWidth + this.trajectories[0].length; - var color = '\u001b[' + startWidth + 'C'; - var padding = ''; - - write(color); - write('_,------,'); - write('\n'); - - write(color); - padding = self.tick ? ' ' : ' '; - write('_|' + padding + '/\\_/\\ '); - write('\n'); - - write(color); - padding = self.tick ? '_' : '__'; - var tail = self.tick ? '~' : '^'; - var face; - write(tail + '|' + padding + this.face() + ' '); - write('\n'); - - write(color); - padding = self.tick ? ' ' : ' '; - write(padding + '"" "" '); - write('\n'); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Draw nyan cat face. - * - * @return {String} - * @api private - */ - -NyanCat.prototype.face = function() { - var stats = this.stats; - if (stats.failures) { - return '( x .x)'; - } else if (stats.pending) { - return '( o .o)'; - } else if(stats.passes) { - return '( ^ .^)'; - } else { - return '( - .-)'; - } -} - -/** - * Move cursor up `n`. - * - * @param {Number} n - * @api private - */ - -NyanCat.prototype.cursorUp = function(n) { - write('\u001b[' + n + 'A'); -}; - -/** - * Move cursor down `n`. - * - * @param {Number} n - * @api private - */ - -NyanCat.prototype.cursorDown = function(n) { - write('\u001b[' + n + 'B'); -}; - -/** - * Generate rainbow colors. - * - * @return {Array} - * @api private - */ - -NyanCat.prototype.generateColors = function(){ - var colors = []; - - for (var i = 0; i < (6 * 7); i++) { - var pi3 = Math.floor(Math.PI / 3); - var n = (i * (1.0 / 6)); - var r = Math.floor(3 * Math.sin(n) + 3); - var g = Math.floor(3 * Math.sin(n + 2 * pi3) + 3); - var b = Math.floor(3 * Math.sin(n + 4 * pi3) + 3); - colors.push(36 * r + 6 * g + b + 16); - } - - return colors; -}; - -/** - * Apply rainbow to the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -NyanCat.prototype.rainbowify = function(str){ - var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length]; - this.colorIndex += 1; - return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m'; -}; - -/** - * Stdout helper. - */ - -function write(string) { - process.stdout.write(string); -} - -/** - * Inherit from `Base.prototype`. - */ - -NyanCat.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/progress.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/progress.js deleted file mode 100644 index 5953638..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/progress.js +++ /dev/null @@ -1,86 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Progress`. - */ - -exports = module.exports = Progress; - -/** - * General progress bar color. - */ - -Base.colors.progress = 90; - -/** - * Initialize a new `Progress` bar test reporter. - * - * @param {Runner} runner - * @param {Object} options - * @api public - */ - -function Progress(runner, options) { - Base.call(this, runner); - - var self = this - , options = options || {} - , stats = this.stats - , width = Base.window.width * .50 | 0 - , total = runner.total - , complete = 0 - , max = Math.max; - - // default chars - options.open = options.open || '['; - options.complete = options.complete || '▬'; - options.incomplete = options.incomplete || Base.symbols.dot; - options.close = options.close || ']'; - options.verbose = false; - - // tests started - runner.on('start', function(){ - console.log(); - cursor.hide(); - }); - - // tests complete - runner.on('test end', function(){ - complete++; - var incomplete = total - complete - , percent = complete / total - , n = width * percent | 0 - , i = width - n; - - cursor.CR(); - process.stdout.write('\u001b[J'); - process.stdout.write(color('progress', ' ' + options.open)); - process.stdout.write(Array(n).join(options.complete)); - process.stdout.write(Array(i).join(options.incomplete)); - process.stdout.write(color('progress', options.close)); - if (options.verbose) { - process.stdout.write(color('progress', ' ' + complete + ' of ' + total)); - } - }); - - // tests are complete, output some stats - // and the failures if any - runner.on('end', function(){ - cursor.show(); - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -Progress.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/spec.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/spec.js deleted file mode 100644 index cd97261..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/spec.js +++ /dev/null @@ -1,87 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Spec`. - */ - -exports = module.exports = Spec; - -/** - * Initialize a new `Spec` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function Spec(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , indents = 0 - , n = 0; - - function indent() { - return Array(indents).join(' ') - } - - runner.on('start', function(){ - console.log(); - }); - - runner.on('suite', function(suite){ - ++indents; - console.log(color('suite', '%s%s'), indent(), suite.title); - }); - - runner.on('suite end', function(suite){ - --indents; - if (1 == indents) console.log(); - }); - - runner.on('test', function(test){ - process.stdout.write(indent() + color('pass', ' ◦ ' + test.title + ': ')); - }); - - runner.on('pending', function(test){ - var fmt = indent() + color('pending', ' - %s'); - console.log(fmt, test.title); - }); - - runner.on('pass', function(test){ - if ('fast' == test.speed) { - var fmt = indent() - + color('checkmark', ' ' + Base.symbols.ok) - + color('pass', ' %s '); - cursor.CR(); - console.log(fmt, test.title); - } else { - var fmt = indent() - + color('checkmark', ' ' + Base.symbols.ok) - + color('pass', ' %s ') - + color(test.speed, '(%dms)'); - cursor.CR(); - console.log(fmt, test.title, test.duration); - } - }); - - runner.on('fail', function(test, err){ - cursor.CR(); - console.log(indent() + color('fail', ' %d) %s'), ++n, test.title); - }); - - runner.on('end', self.epilogue.bind(self)); -} - -/** - * Inherit from `Base.prototype`. - */ - -Spec.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/tap.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/tap.js deleted file mode 100644 index 2bcd995..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/tap.js +++ /dev/null @@ -1,73 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `TAP`. - */ - -exports = module.exports = TAP; - -/** - * Initialize a new `TAP` reporter. - * - * @param {Runner} runner - * @api public - */ - -function TAP(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , n = 1 - , passes = 0 - , failures = 0; - - runner.on('start', function(){ - var total = runner.grepTotal(runner.suite); - console.log('%d..%d', 1, total); - }); - - runner.on('test end', function(){ - ++n; - }); - - runner.on('pending', function(test){ - console.log('ok %d %s # SKIP -', n, title(test)); - }); - - runner.on('pass', function(test){ - passes++; - console.log('ok %d %s', n, title(test)); - }); - - runner.on('fail', function(test, err){ - failures++; - console.log('not ok %d %s', n, title(test)); - if (err.stack) console.log(err.stack.replace(/^/gm, ' ')); - }); - - runner.on('end', function(){ - console.log('# tests ' + (passes + failures)); - console.log('# pass ' + passes); - console.log('# fail ' + failures); - }); -} - -/** - * Return a TAP-safe title of `test` - * - * @param {Object} test - * @return {String} - * @api private - */ - -function title(test) { - return test.fullTitle().replace(/#/g, ''); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/teamcity.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/teamcity.js deleted file mode 100644 index 032eea7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/teamcity.js +++ /dev/null @@ -1,65 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `Teamcity`. - */ - -exports = module.exports = Teamcity; - -/** - * Initialize a new `Teamcity` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Teamcity(runner) { - Base.call(this, runner); - var stats = this.stats; - - runner.on('start', function() { - console.log("##teamcity[testSuiteStarted name='mocha.suite']"); - }); - - runner.on('test', function(test) { - console.log("##teamcity[testStarted name='" + escape(test.fullTitle()) + "']"); - }); - - runner.on('fail', function(test, err) { - console.log("##teamcity[testFailed name='" + escape(test.fullTitle()) + "' message='" + escape(err.message) + "']"); - }); - - runner.on('pending', function(test) { - console.log("##teamcity[testIgnored name='" + escape(test.fullTitle()) + "' message='pending']"); - }); - - runner.on('test end', function(test) { - console.log("##teamcity[testFinished name='" + escape(test.fullTitle()) + "' duration='" + test.duration + "']"); - }); - - runner.on('end', function() { - console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='" + stats.duration + "']"); - }); -} - -/** - * Escape the given `str`. - */ - -function escape(str) { - return str - .replace(/\|/g, "||") - .replace(/\n/g, "|n") - .replace(/\r/g, "|r") - .replace(/\[/g, "|[") - .replace(/\]/g, "|]") - .replace(/\u0085/g, "|x") - .replace(/\u2028/g, "|l") - .replace(/\u2029/g, "|p") - .replace(/'/g, "|'"); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/coverage.jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/coverage.jade deleted file mode 100644 index b78119f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/coverage.jade +++ /dev/null @@ -1,50 +0,0 @@ -!!! 5 -html - head - title Coverage - include script.html - include style.html - body - #coverage - h1#overview Coverage - include menu - - #stats(class=coverageClass(cov.coverage)) - .percentage #{cov.coverage | 0}% - .sloc= cov.sloc - .hits= cov.hits - .misses= cov.misses - - #files - for file in cov.files - .file - h2(id=file.filename)= file.filename - #stats(class=coverageClass(file.coverage)) - .percentage #{file.coverage | 0}% - .sloc= file.sloc - .hits= file.hits - .misses= file.misses - - table#source - thead - tr - th Line - th Hits - th Source - tbody - for line, number in file.source - if line.coverage > 0 - tr.hit - td.line= number - td.hits= line.coverage - td.source= line.source - else if 0 === line.coverage - tr.miss - td.line= number - td.hits 0 - td.source= line.source - else - tr - td.line= number - td.hits - td.source= line.source || ' ' diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/menu.jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/menu.jade deleted file mode 100644 index e9ba464..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/menu.jade +++ /dev/null @@ -1,13 +0,0 @@ -#menu - li - a(href='#overview') overview - for file in cov.files - li - span.cov(class=coverageClass(file.coverage)) #{file.coverage | 0} - a(href='##{file.filename}') - segments = file.filename.split('/') - basename = segments.pop() - if segments.length - span.dirname= segments.join('/') + '/' - span.basename= basename - a#logo(href='http://visionmedia.github.io/mocha/') m diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/script.html b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/script.html deleted file mode 100644 index 073cf79..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/script.html +++ /dev/null @@ -1,34 +0,0 @@ - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/style.html b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/style.html deleted file mode 100644 index f374fbc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/templates/style.html +++ /dev/null @@ -1,307 +0,0 @@ - \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/xunit.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/xunit.js deleted file mode 100644 index 1ed5ee9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/reporters/xunit.js +++ /dev/null @@ -1,115 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils') - , escape = utils.escape; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Expose `XUnit`. - */ - -exports = module.exports = XUnit; - -/** - * Initialize a new `XUnit` reporter. - * - * @param {Runner} runner - * @api public - */ - -function XUnit(runner) { - Base.call(this, runner); - var stats = this.stats - , tests = [] - , self = this; - - runner.on('pass', function(test){ - tests.push(test); - }); - - runner.on('fail', function(test){ - tests.push(test); - }); - - runner.on('end', function(){ - console.log(tag('testsuite', { - name: 'Mocha Tests' - , tests: stats.tests - , failures: stats.failures - , errors: stats.failures - , skipped: stats.tests - stats.failures - stats.passes - , timestamp: (new Date).toUTCString() - , time: (stats.duration / 1000) || 0 - }, false)); - - tests.forEach(test); - console.log(''); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -XUnit.prototype.__proto__ = Base.prototype; - -/** - * Output tag for the given `test.` - */ - -function test(test) { - var attrs = { - classname: test.parent.fullTitle() - , name: test.title - , time: test.duration / 1000 - }; - - if ('failed' == test.state) { - var err = test.err; - attrs.message = escape(err.message); - console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack)))); - } else if (test.pending) { - console.log(tag('testcase', attrs, false, tag('skipped', {}, true))); - } else { - console.log(tag('testcase', attrs, true) ); - } -} - -/** - * HTML tag helper. - */ - -function tag(name, attrs, close, content) { - var end = close ? '/>' : '>' - , pairs = [] - , tag; - - for (var key in attrs) { - pairs.push(key + '="' + escape(attrs[key]) + '"'); - } - - tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end; - if (content) tag += content + ''; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runnable.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runnable.js deleted file mode 100644 index b34bf1e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runnable.js +++ /dev/null @@ -1,217 +0,0 @@ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , debug = require('debug')('mocha:runnable') - , milliseconds = require('./ms'); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Object#toString(). - */ - -var toString = Object.prototype.toString; - -/** - * Expose `Runnable`. - */ - -module.exports = Runnable; - -/** - * Initialize a new `Runnable` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Runnable(title, fn) { - this.title = title; - this.fn = fn; - this.async = fn && fn.length; - this.sync = ! this.async; - this._timeout = 2000; - this._slow = 75; - this.timedOut = false; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Runnable.prototype.__proto__ = EventEmitter.prototype; - -/** - * Set & get timeout `ms`. - * - * @param {Number|String} ms - * @return {Runnable|Number} ms or self - * @api private - */ - -Runnable.prototype.timeout = function(ms){ - if (0 == arguments.length) return this._timeout; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._timeout = ms; - if (this.timer) this.resetTimeout(); - return this; -}; - -/** - * Set & get slow `ms`. - * - * @param {Number|String} ms - * @return {Runnable|Number} ms or self - * @api private - */ - -Runnable.prototype.slow = function(ms){ - if (0 === arguments.length) return this._slow; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._slow = ms; - return this; -}; - -/** - * Return the full title generated by recursively - * concatenating the parent's full title. - * - * @return {String} - * @api public - */ - -Runnable.prototype.fullTitle = function(){ - return this.parent.fullTitle() + ' ' + this.title; -}; - -/** - * Clear the timeout. - * - * @api private - */ - -Runnable.prototype.clearTimeout = function(){ - clearTimeout(this.timer); -}; - -/** - * Inspect the runnable void of private properties. - * - * @return {String} - * @api private - */ - -Runnable.prototype.inspect = function(){ - return JSON.stringify(this, function(key, val){ - if ('_' == key[0]) return; - if ('parent' == key) return '#'; - if ('ctx' == key) return '#'; - return val; - }, 2); -}; - -/** - * Reset the timeout. - * - * @api private - */ - -Runnable.prototype.resetTimeout = function(){ - var self = this; - var ms = this.timeout() || 1e9; - - this.clearTimeout(); - this.timer = setTimeout(function(){ - self.callback(new Error('timeout of ' + ms + 'ms exceeded')); - self.timedOut = true; - }, ms); -}; - -/** - * Run the test and invoke `fn(err)`. - * - * @param {Function} fn - * @api private - */ - -Runnable.prototype.run = function(fn){ - var self = this - , ms = this.timeout() - , start = new Date - , ctx = this.ctx - , finished - , emitted; - - if (ctx) ctx.runnable(this); - - // timeout - if (this.async) { - if (ms) { - this.timer = setTimeout(function(){ - done(new Error('timeout of ' + ms + 'ms exceeded')); - self.timedOut = true; - }, ms); - } - } - - // called multiple times - function multiple(err) { - if (emitted) return; - emitted = true; - self.emit('error', err || new Error('done() called multiple times')); - } - - // finished - function done(err) { - if (self.timedOut) return; - if (finished) return multiple(err); - self.clearTimeout(); - self.duration = new Date - start; - finished = true; - fn(err); - } - - // for .resetTimeout() - this.callback = done; - - // async - if (this.async) { - try { - this.fn.call(ctx, function(err){ - if (err instanceof Error || toString.call(err) === "[object Error]") return done(err); - if (null != err) return done(new Error('done() invoked with non-Error: ' + err)); - done(); - }); - } catch (err) { - done(err); - } - return; - } - - if (this.asyncOnly) { - return done(new Error('--async-only option in use without declaring `done()`')); - } - - // sync - try { - if (!this.pending) this.fn.call(ctx); - this.duration = new Date - start; - fn(); - } catch (err) { - fn(err); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runner.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runner.js deleted file mode 100644 index c42e449..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/runner.js +++ /dev/null @@ -1,547 +0,0 @@ -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , debug = require('debug')('mocha:runner') - , Test = require('./test') - , utils = require('./utils') - , filter = utils.filter - , keys = utils.keys; - -/** - * Non-enumerable globals. - */ - -var globals = [ - 'setTimeout', - 'clearTimeout', - 'setInterval', - 'clearInterval', - 'XMLHttpRequest', - 'Date' -]; - -/** - * Expose `Runner`. - */ - -module.exports = Runner; - -/** - * Initialize a `Runner` for the given `suite`. - * - * Events: - * - * - `start` execution started - * - `end` execution complete - * - `suite` (suite) test suite execution started - * - `suite end` (suite) all tests (and sub-suites) have finished - * - `test` (test) test execution started - * - `test end` (test) test completed - * - `hook` (hook) hook execution started - * - `hook end` (hook) hook complete - * - `pass` (test) test passed - * - `fail` (test, err) test failed - * - `pending` (test) test pending - * - * @api public - */ - -function Runner(suite) { - var self = this; - this._globals = []; - this.suite = suite; - this.total = suite.total(); - this.failures = 0; - this.on('test end', function(test){ self.checkGlobals(test); }); - this.on('hook end', function(hook){ self.checkGlobals(hook); }); - this.grep(/.*/); - this.globals(this.globalProps().concat(['errno'])); -} - -/** - * Wrapper for setImmediate, process.nextTick, or browser polyfill. - * - * @param {Function} fn - * @api private - */ - -Runner.immediately = global.setImmediate || process.nextTick; - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Runner.prototype.__proto__ = EventEmitter.prototype; - -/** - * Run tests with full titles matching `re`. Updates runner.total - * with number of tests matched. - * - * @param {RegExp} re - * @param {Boolean} invert - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.grep = function(re, invert){ - debug('grep %s', re); - this._grep = re; - this._invert = invert; - this.total = this.grepTotal(this.suite); - return this; -}; - -/** - * Returns the number of tests matching the grep search for the - * given suite. - * - * @param {Suite} suite - * @return {Number} - * @api public - */ - -Runner.prototype.grepTotal = function(suite) { - var self = this; - var total = 0; - - suite.eachTest(function(test){ - var match = self._grep.test(test.fullTitle()); - if (self._invert) match = !match; - if (match) total++; - }); - - return total; -}; - -/** - * Return a list of global properties. - * - * @return {Array} - * @api private - */ - -Runner.prototype.globalProps = function() { - var props = utils.keys(global); - - // non-enumerables - for (var i = 0; i < globals.length; ++i) { - if (~utils.indexOf(props, globals[i])) continue; - props.push(globals[i]); - } - - return props; -}; - -/** - * Allow the given `arr` of globals. - * - * @param {Array} arr - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.globals = function(arr){ - if (0 == arguments.length) return this._globals; - debug('globals %j', arr); - utils.forEach(arr, function(arr){ - this._globals.push(arr); - }, this); - return this; -}; - -/** - * Check for global variable leaks. - * - * @api private - */ - -Runner.prototype.checkGlobals = function(test){ - if (this.ignoreLeaks) return; - var ok = this._globals; - var globals = this.globalProps(); - var isNode = process.kill; - var leaks; - - // check length - 2 ('errno' and 'location' globals) - if (isNode && 1 == ok.length - globals.length) return - else if (2 == ok.length - globals.length) return; - - leaks = filterLeaks(ok, globals); - this._globals = this._globals.concat(leaks); - - if (leaks.length > 1) { - this.fail(test, new Error('global leaks detected: ' + leaks.join(', ') + '')); - } else if (leaks.length) { - this.fail(test, new Error('global leak detected: ' + leaks[0])); - } -}; - -/** - * Fail the given `test`. - * - * @param {Test} test - * @param {Error} err - * @api private - */ - -Runner.prototype.fail = function(test, err){ - ++this.failures; - test.state = 'failed'; - - if ('string' == typeof err) { - err = new Error('the string "' + err + '" was thrown, throw an Error :)'); - } - - this.emit('fail', test, err); -}; - -/** - * Fail the given `hook` with `err`. - * - * Hook failures (currently) hard-end due - * to that fact that a failing hook will - * surely cause subsequent tests to fail, - * causing jumbled reporting. - * - * @param {Hook} hook - * @param {Error} err - * @api private - */ - -Runner.prototype.failHook = function(hook, err){ - this.fail(hook, err); - this.emit('end'); -}; - -/** - * Run hook `name` callbacks and then invoke `fn()`. - * - * @param {String} name - * @param {Function} function - * @api private - */ - -Runner.prototype.hook = function(name, fn){ - var suite = this.suite - , hooks = suite['_' + name] - , self = this - , timer; - - function next(i) { - var hook = hooks[i]; - if (!hook) return fn(); - if (self.failures && suite.bail()) return fn(); - self.currentRunnable = hook; - - hook.ctx.currentTest = self.test; - - self.emit('hook', hook); - - hook.on('error', function(err){ - self.failHook(hook, err); - }); - - hook.run(function(err){ - hook.removeAllListeners('error'); - var testError = hook.error(); - if (testError) self.fail(self.test, testError); - if (err) return self.failHook(hook, err); - self.emit('hook end', hook); - delete hook.ctx.currentTest; - next(++i); - }); - } - - Runner.immediately(function(){ - next(0); - }); -}; - -/** - * Run hook `name` for the given array of `suites` - * in order, and callback `fn(err)`. - * - * @param {String} name - * @param {Array} suites - * @param {Function} fn - * @api private - */ - -Runner.prototype.hooks = function(name, suites, fn){ - var self = this - , orig = this.suite; - - function next(suite) { - self.suite = suite; - - if (!suite) { - self.suite = orig; - return fn(); - } - - self.hook(name, function(err){ - if (err) { - self.suite = orig; - return fn(err); - } - - next(suites.pop()); - }); - } - - next(suites.pop()); -}; - -/** - * Run hooks from the top level down. - * - * @param {String} name - * @param {Function} fn - * @api private - */ - -Runner.prototype.hookUp = function(name, fn){ - var suites = [this.suite].concat(this.parents()).reverse(); - this.hooks(name, suites, fn); -}; - -/** - * Run hooks from the bottom up. - * - * @param {String} name - * @param {Function} fn - * @api private - */ - -Runner.prototype.hookDown = function(name, fn){ - var suites = [this.suite].concat(this.parents()); - this.hooks(name, suites, fn); -}; - -/** - * Return an array of parent Suites from - * closest to furthest. - * - * @return {Array} - * @api private - */ - -Runner.prototype.parents = function(){ - var suite = this.suite - , suites = []; - while (suite = suite.parent) suites.push(suite); - return suites; -}; - -/** - * Run the current test and callback `fn(err)`. - * - * @param {Function} fn - * @api private - */ - -Runner.prototype.runTest = function(fn){ - var test = this.test - , self = this; - - if (this.asyncOnly) test.asyncOnly = true; - - try { - test.on('error', function(err){ - self.fail(test, err); - }); - test.run(fn); - } catch (err) { - fn(err); - } -}; - -/** - * Run tests in the given `suite` and invoke - * the callback `fn()` when complete. - * - * @param {Suite} suite - * @param {Function} fn - * @api private - */ - -Runner.prototype.runTests = function(suite, fn){ - var self = this - , tests = suite.tests.slice() - , test; - - function next(err) { - // if we bail after first err - if (self.failures && suite._bail) return fn(); - - // next test - test = tests.shift(); - - // all done - if (!test) return fn(); - - // grep - var match = self._grep.test(test.fullTitle()); - if (self._invert) match = !match; - if (!match) return next(); - - // pending - if (test.pending) { - self.emit('pending', test); - self.emit('test end', test); - return next(); - } - - // execute test and hook(s) - self.emit('test', self.test = test); - self.hookDown('beforeEach', function(){ - self.currentRunnable = self.test; - self.runTest(function(err){ - test = self.test; - - if (err) { - self.fail(test, err); - self.emit('test end', test); - return self.hookUp('afterEach', next); - } - - test.state = 'passed'; - self.emit('pass', test); - self.emit('test end', test); - self.hookUp('afterEach', next); - }); - }); - } - - this.next = next; - next(); -}; - -/** - * Run the given `suite` and invoke the - * callback `fn()` when complete. - * - * @param {Suite} suite - * @param {Function} fn - * @api private - */ - -Runner.prototype.runSuite = function(suite, fn){ - var total = this.grepTotal(suite) - , self = this - , i = 0; - - debug('run suite %s', suite.fullTitle()); - - if (!total) return fn(); - - this.emit('suite', this.suite = suite); - - function next() { - var curr = suite.suites[i++]; - if (!curr) return done(); - self.runSuite(curr, next); - } - - function done() { - self.suite = suite; - self.hook('afterAll', function(){ - self.emit('suite end', suite); - fn(); - }); - } - - this.hook('beforeAll', function(){ - self.runTests(suite, next); - }); -}; - -/** - * Handle uncaught exceptions. - * - * @param {Error} err - * @api private - */ - -Runner.prototype.uncaught = function(err){ - debug('uncaught exception %s', err.message); - var runnable = this.currentRunnable; - if (!runnable || 'failed' == runnable.state) return; - runnable.clearTimeout(); - err.uncaught = true; - this.fail(runnable, err); - - // recover from test - if ('test' == runnable.type) { - this.emit('test end', runnable); - this.hookUp('afterEach', this.next); - return; - } - - // bail on hooks - this.emit('end'); -}; - -/** - * Run the root suite and invoke `fn(failures)` - * on completion. - * - * @param {Function} fn - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.run = function(fn){ - var self = this - , fn = fn || function(){}; - - function uncaught(err){ - self.uncaught(err); - } - - debug('start'); - - // callback - this.on('end', function(){ - debug('end'); - process.removeListener('uncaughtException', uncaught); - fn(self.failures); - }); - - // run suites - this.emit('start'); - this.runSuite(this.suite, function(){ - debug('finished running'); - self.emit('end'); - }); - - // uncaught exception - process.on('uncaughtException', uncaught); - - return this; -}; - -/** - * Filter leaks with the given globals flagged as `ok`. - * - * @param {Array} ok - * @param {Array} globals - * @return {Array} - * @api private - */ - -function filterLeaks(ok, globals) { - return filter(globals, function(key){ - // Firefox and Chrome exposes iframes as index inside the window object - if (/^d+/.test(key)) return false; - var matched = filter(ok, function(ok){ - if (~ok.indexOf('*')) return 0 == key.indexOf(ok.split('*')[0]); - // Opera and IE expose global variables for HTML element IDs (issue #243) - if (/^mocha-/.test(key)) return true; - return key == ok; - }); - return matched.length == 0 && (!global.navigator || 'onerror' !== key); - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/suite.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/suite.js deleted file mode 100644 index 869bb88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/suite.js +++ /dev/null @@ -1,296 +0,0 @@ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , debug = require('debug')('mocha:suite') - , milliseconds = require('./ms') - , utils = require('./utils') - , Hook = require('./hook'); - -/** - * Expose `Suite`. - */ - -exports = module.exports = Suite; - -/** - * Create a new `Suite` with the given `title` - * and parent `Suite`. When a suite with the - * same title is already present, that suite - * is returned to provide nicer reporter - * and more flexible meta-testing. - * - * @param {Suite} parent - * @param {String} title - * @return {Suite} - * @api public - */ - -exports.create = function(parent, title){ - var suite = new Suite(title, parent.ctx); - suite.parent = parent; - if (parent.pending) suite.pending = true; - title = suite.fullTitle(); - parent.addSuite(suite); - return suite; -}; - -/** - * Initialize a new `Suite` with the given - * `title` and `ctx`. - * - * @param {String} title - * @param {Context} ctx - * @api private - */ - -function Suite(title, ctx) { - this.title = title; - this.ctx = ctx; - this.suites = []; - this.tests = []; - this.pending = false; - this._beforeEach = []; - this._beforeAll = []; - this._afterEach = []; - this._afterAll = []; - this.root = !title; - this._timeout = 2000; - this._slow = 75; - this._bail = false; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Suite.prototype.__proto__ = EventEmitter.prototype; - -/** - * Return a clone of this `Suite`. - * - * @return {Suite} - * @api private - */ - -Suite.prototype.clone = function(){ - var suite = new Suite(this.title); - debug('clone'); - suite.ctx = this.ctx; - suite.timeout(this.timeout()); - suite.slow(this.slow()); - suite.bail(this.bail()); - return suite; -}; - -/** - * Set timeout `ms` or short-hand such as "2s". - * - * @param {Number|String} ms - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.timeout = function(ms){ - if (0 == arguments.length) return this._timeout; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._timeout = parseInt(ms, 10); - return this; -}; - -/** - * Set slow `ms` or short-hand such as "2s". - * - * @param {Number|String} ms - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.slow = function(ms){ - if (0 === arguments.length) return this._slow; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('slow %d', ms); - this._slow = ms; - return this; -}; - -/** - * Sets whether to bail after first error. - * - * @parma {Boolean} bail - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.bail = function(bail){ - if (0 == arguments.length) return this._bail; - debug('bail %s', bail); - this._bail = bail; - return this; -}; - -/** - * Run `fn(test[, done])` before running tests. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.beforeAll = function(fn){ - if (this.pending) return this; - var hook = new Hook('"before all" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._beforeAll.push(hook); - this.emit('beforeAll', hook); - return this; -}; - -/** - * Run `fn(test[, done])` after running tests. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.afterAll = function(fn){ - if (this.pending) return this; - var hook = new Hook('"after all" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._afterAll.push(hook); - this.emit('afterAll', hook); - return this; -}; - -/** - * Run `fn(test[, done])` before each test case. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.beforeEach = function(fn){ - if (this.pending) return this; - var hook = new Hook('"before each" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._beforeEach.push(hook); - this.emit('beforeEach', hook); - return this; -}; - -/** - * Run `fn(test[, done])` after each test case. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.afterEach = function(fn){ - if (this.pending) return this; - var hook = new Hook('"after each" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._afterEach.push(hook); - this.emit('afterEach', hook); - return this; -}; - -/** - * Add a test `suite`. - * - * @param {Suite} suite - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.addSuite = function(suite){ - suite.parent = this; - suite.timeout(this.timeout()); - suite.slow(this.slow()); - suite.bail(this.bail()); - this.suites.push(suite); - this.emit('suite', suite); - return this; -}; - -/** - * Add a `test` to this suite. - * - * @param {Test} test - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.addTest = function(test){ - test.parent = this; - test.timeout(this.timeout()); - test.slow(this.slow()); - test.ctx = this.ctx; - this.tests.push(test); - this.emit('test', test); - return this; -}; - -/** - * Return the full title generated by recursively - * concatenating the parent's full title. - * - * @return {String} - * @api public - */ - -Suite.prototype.fullTitle = function(){ - if (this.parent) { - var full = this.parent.fullTitle(); - if (full) return full + ' ' + this.title; - } - return this.title; -}; - -/** - * Return the total number of tests. - * - * @return {Number} - * @api public - */ - -Suite.prototype.total = function(){ - return utils.reduce(this.suites, function(sum, suite){ - return sum + suite.total(); - }, 0) + this.tests.length; -}; - -/** - * Iterates through each suite recursively to find - * all tests. Applies a function in the format - * `fn(test)`. - * - * @param {Function} fn - * @return {Suite} - * @api private - */ - -Suite.prototype.eachTest = function(fn){ - utils.forEach(this.tests, fn); - utils.forEach(this.suites, function(suite){ - suite.eachTest(fn); - }); - return this; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/template.html b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/template.html deleted file mode 100644 index 0590d4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/template.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Mocha - - - - - -
      - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/test.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/test.js deleted file mode 100644 index 11773e0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/test.js +++ /dev/null @@ -1,32 +0,0 @@ - -/** - * Module dependencies. - */ - -var Runnable = require('./runnable'); - -/** - * Expose `Test`. - */ - -module.exports = Test; - -/** - * Initialize a new `Test` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Test(title, fn) { - Runnable.call(this, title, fn); - this.pending = !fn; - this.type = 'test'; -} - -/** - * Inherit from `Runnable.prototype`. - */ - -Test.prototype.__proto__ = Runnable.prototype; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/utils.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/utils.js deleted file mode 100644 index 939a8aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/lib/utils.js +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Module dependencies. - */ - -var fs = require('fs') - , path = require('path') - , join = path.join - , debug = require('debug')('mocha:watch'); - -/** - * Ignored directories. - */ - -var ignore = ['node_modules', '.git']; - -/** - * Escape special characters in the given string of html. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html){ - return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>'); -}; - -/** - * Array#forEach (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @param {Object} scope - * @api private - */ - -exports.forEach = function(arr, fn, scope){ - for (var i = 0, l = arr.length; i < l; i++) - fn.call(scope, arr[i], i); -}; - -/** - * Array#indexOf (<=IE8) - * - * @parma {Array} arr - * @param {Object} obj to find index of - * @param {Number} start - * @api private - */ - -exports.indexOf = function(arr, obj, start){ - for (var i = start || 0, l = arr.length; i < l; i++) { - if (arr[i] === obj) - return i; - } - return -1; -}; - -/** - * Array#reduce (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @param {Object} initial value - * @api private - */ - -exports.reduce = function(arr, fn, val){ - var rval = val; - - for (var i = 0, l = arr.length; i < l; i++) { - rval = fn(rval, arr[i], i, arr); - } - - return rval; -}; - -/** - * Array#filter (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @api private - */ - -exports.filter = function(arr, fn){ - var ret = []; - - for (var i = 0, l = arr.length; i < l; i++) { - var val = arr[i]; - if (fn(val, i, arr)) ret.push(val); - } - - return ret; -}; - -/** - * Object.keys (<=IE8) - * - * @param {Object} obj - * @return {Array} keys - * @api private - */ - -exports.keys = Object.keys || function(obj) { - var keys = [] - , has = Object.prototype.hasOwnProperty // for `window` on <=IE8 - - for (var key in obj) { - if (has.call(obj, key)) { - keys.push(key); - } - } - - return keys; -}; - -/** - * Watch the given `files` for changes - * and invoke `fn(file)` on modification. - * - * @param {Array} files - * @param {Function} fn - * @api private - */ - -exports.watch = function(files, fn){ - var options = { interval: 100 }; - files.forEach(function(file){ - debug('file %s', file); - fs.watchFile(file, options, function(curr, prev){ - if (prev.mtime < curr.mtime) fn(file); - }); - }); -}; - -/** - * Ignored files. - */ - -function ignored(path){ - return !~ignore.indexOf(path); -} - -/** - * Lookup files in the given `dir`. - * - * @return {Array} - * @api private - */ - -exports.files = function(dir, ret){ - ret = ret || []; - - fs.readdirSync(dir) - .filter(ignored) - .forEach(function(path){ - path = join(dir, path); - if (fs.statSync(path).isDirectory()) { - exports.files(path, ret); - } else if (path.match(/\.(js|coffee|litcoffee|coffee.md)$/)) { - ret.push(path); - } - }); - - return ret; -}; - -/** - * Compute a slug from the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.slug = function(str){ - return str - .toLowerCase() - .replace(/ +/g, '-') - .replace(/[^-\w]/g, ''); -}; - -/** - * Strip the function definition from `str`, - * and re-indent for pre whitespace. - */ - -exports.clean = function(str) { - str = str - .replace(/^function *\(.*\) *{/, '') - .replace(/\s+\}$/, ''); - - var whitespace = str.match(/^\n?(\s*)/)[1] - , re = new RegExp('^' + whitespace, 'gm'); - - str = str.replace(re, ''); - - return exports.trim(str); -}; - -/** - * Escape regular expression characters in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.escapeRegexp = function(str){ - return str.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); -}; - -/** - * Trim the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.trim = function(str){ - return str.replace(/^\s+|\s+$/g, ''); -}; - -/** - * Parse the given `qs`. - * - * @param {String} qs - * @return {Object} - * @api private - */ - -exports.parseQuery = function(qs){ - return exports.reduce(qs.replace('?', '').split('&'), function(obj, pair){ - var i = pair.indexOf('=') - , key = pair.slice(0, i) - , val = pair.slice(++i); - - obj[key] = decodeURIComponent(val); - return obj; - }, {}); -}; - -/** - * Highlight the given string of `js`. - * - * @param {String} js - * @return {String} - * @api private - */ - -function highlight(js) { - return js - .replace(//g, '>') - .replace(/\/\/(.*)/gm, '//$1') - .replace(/('.*?')/gm, '$1') - .replace(/(\d+\.\d+)/gm, '$1') - .replace(/(\d+)/gm, '$1') - .replace(/\bnew *(\w+)/gm, 'new $1') - .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '$1') -} - -/** - * Highlight the contents of tag `name`. - * - * @param {String} name - * @api private - */ - -exports.highlightTags = function(name) { - var code = document.getElementsByTagName(name); - for (var i = 0, len = code.length; i < len; ++i) { - code[i].innerHTML = highlight(code[i].innerHTML); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/mocha.css b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/mocha.css deleted file mode 100644 index 24ce522..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/mocha.css +++ /dev/null @@ -1,259 +0,0 @@ -@charset "utf-8"; - -body { - margin:0; -} - -#mocha { - font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; - margin: 60px 50px; -} - -#mocha ul, #mocha li { - margin: 0; - padding: 0; -} - -#mocha ul { - list-style: none; -} - -#mocha h1, #mocha h2 { - margin: 0; -} - -#mocha h1 { - margin-top: 15px; - font-size: 1em; - font-weight: 200; -} - -#mocha h1 a { - text-decoration: none; - color: inherit; -} - -#mocha h1 a:hover { - text-decoration: underline; -} - -#mocha .suite .suite h1 { - margin-top: 0; - font-size: .8em; -} - -#mocha .hidden { - display: none; -} - -#mocha h2 { - font-size: 12px; - font-weight: normal; - cursor: pointer; -} - -#mocha .suite { - margin-left: 15px; -} - -#mocha .test { - margin-left: 15px; - overflow: hidden; -} - -#mocha .test.pending:hover h2::after { - content: '(pending)'; - font-family: arial, sans-serif; -} - -#mocha .test.pass.medium .duration { - background: #C09853; -} - -#mocha .test.pass.slow .duration { - background: #B94A48; -} - -#mocha .test.pass::before { - content: '✓'; - font-size: 12px; - display: block; - float: left; - margin-right: 5px; - color: #00d6b2; -} - -#mocha .test.pass .duration { - font-size: 9px; - margin-left: 5px; - padding: 2px 5px; - color: white; - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2); - -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2); - box-shadow: inset 0 1px 1px rgba(0,0,0,.2); - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - -ms-border-radius: 5px; - -o-border-radius: 5px; - border-radius: 5px; -} - -#mocha .test.pass.fast .duration { - display: none; -} - -#mocha .test.pending { - color: #0b97c4; -} - -#mocha .test.pending::before { - content: '◦'; - color: #0b97c4; -} - -#mocha .test.fail { - color: #c00; -} - -#mocha .test.fail pre { - color: black; -} - -#mocha .test.fail::before { - content: '✖'; - font-size: 12px; - display: block; - float: left; - margin-right: 5px; - color: #c00; -} - -#mocha .test pre.error { - color: #c00; - max-height: 300px; - overflow: auto; -} - -#mocha .test pre { - display: block; - float: left; - clear: left; - font: 12px/1.5 monaco, monospace; - margin: 5px; - padding: 15px; - border: 1px solid #eee; - border-bottom-color: #ddd; - -webkit-border-radius: 3px; - -webkit-box-shadow: 0 1px 3px #eee; - -moz-border-radius: 3px; - -moz-box-shadow: 0 1px 3px #eee; -} - -#mocha .test h2 { - position: relative; -} - -#mocha .test a.replay { - position: absolute; - top: 3px; - right: 0; - text-decoration: none; - vertical-align: middle; - display: block; - width: 15px; - height: 15px; - line-height: 15px; - text-align: center; - background: #eee; - font-size: 15px; - -moz-border-radius: 15px; - border-radius: 15px; - -webkit-transition: opacity 200ms; - -moz-transition: opacity 200ms; - transition: opacity 200ms; - opacity: 0.3; - color: #888; -} - -#mocha .test:hover a.replay { - opacity: 1; -} - -#mocha-report.pass .test.fail { - display: none; -} - -#mocha-report.fail .test.pass { - display: none; -} - -#mocha-report.pending .test.pass -#mocha-report.pending .test.fail, { - display: none; -} -#mocha-report.pending .test.pass.pending { - display: block; -} - -#mocha-error { - color: #c00; - font-size: 1.5em; - font-weight: 100; - letter-spacing: 1px; -} - -#mocha-stats { - position: fixed; - top: 15px; - right: 10px; - font-size: 12px; - margin: 0; - color: #888; - z-index: 1; -} - -#mocha-stats .progress { - float: right; - padding-top: 0; -} - -#mocha-stats em { - color: black; -} - -#mocha-stats a { - text-decoration: none; - color: inherit; -} - -#mocha-stats a:hover { - border-bottom: 1px solid #eee; -} - -#mocha-stats li { - display: inline-block; - margin: 0 5px; - list-style: none; - padding-top: 11px; -} - -#mocha-stats canvas { - width: 40px; - height: 40px; -} - -#mocha code .comment { color: #ddd } -#mocha code .init { color: #2F6FAD } -#mocha code .string { color: #5890AD } -#mocha code .keyword { color: #8A6343 } -#mocha code .number { color: #2F6FAD } - -@media screen and (max-device-width: 480px) { - #mocha { - margin: 60px 0px; - } - - #mocha #stats { - position: absolute; - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/mocha.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/mocha.js deleted file mode 100644 index 1ca585d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/mocha.js +++ /dev/null @@ -1,5471 +0,0 @@ -;(function(){ - -// CommonJS require() - -function require(p){ - var path = require.resolve(p) - , mod = require.modules[path]; - if (!mod) throw new Error('failed to require "' + p + '"'); - if (!mod.exports) { - mod.exports = {}; - mod.call(mod.exports, mod, mod.exports, require.relative(path)); - } - return mod.exports; - } - -require.modules = {}; - -require.resolve = function (path){ - var orig = path - , reg = path + '.js' - , index = path + '/index.js'; - return require.modules[reg] && reg - || require.modules[index] && index - || orig; - }; - -require.register = function (path, fn){ - require.modules[path] = fn; - }; - -require.relative = function (parent) { - return function(p){ - if ('.' != p.charAt(0)) return require(p); - - var path = parent.split('/') - , segs = p.split('/'); - path.pop(); - - for (var i = 0; i < segs.length; i++) { - var seg = segs[i]; - if ('..' == seg) path.pop(); - else if ('.' != seg) path.push(seg); - } - - return require(path.join('/')); - }; - }; - - -require.register("browser/debug.js", function(module, exports, require){ - -module.exports = function(type){ - return function(){ - } -}; - -}); // module: browser/debug.js - -require.register("browser/diff.js", function(module, exports, require){ -/* See license.txt for terms of usage */ - -/* - * Text diff implementation. - * - * This library supports the following APIS: - * JsDiff.diffChars: Character by character diff - * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace - * JsDiff.diffLines: Line based diff - * - * JsDiff.diffCss: Diff targeted at CSS content - * - * These methods are based on the implementation proposed in - * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 - */ -var JsDiff = (function() { - function clonePath(path) { - return { newPos: path.newPos, components: path.components.slice(0) }; - } - function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - } - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, "&"); - n = n.replace(//g, ">"); - n = n.replace(/"/g, """); - - return n; - } - - - var fbDiff = function(ignoreWhitespace) { - this.ignoreWhitespace = ignoreWhitespace; - }; - fbDiff.prototype = { - diff: function(oldString, newString) { - // Handle the identity case (this is due to unrolling editLength == 0 - if (newString == oldString) { - return [{ value: newString }]; - } - if (!newString) { - return [{ value: oldString, removed: true }]; - } - if (!oldString) { - return [{ value: newString, added: true }]; - } - - newString = this.tokenize(newString); - oldString = this.tokenize(oldString); - - var newLen = newString.length, oldLen = oldString.length; - var maxEditLength = newLen + oldLen; - var bestPath = [{ newPos: -1, components: [] }]; - - // Seed editLength = 0 - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) { - return bestPath[0].components; - } - - for (var editLength = 1; editLength <= maxEditLength; editLength++) { - for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) { - var basePath; - var addPath = bestPath[diagonalPath-1], - removePath = bestPath[diagonalPath+1]; - oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath-1] = undefined; - } - - var canAdd = addPath && addPath.newPos+1 < newLen; - var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = undefined; - continue; - } - - // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { - basePath = clonePath(removePath); - this.pushComponent(basePath.components, oldString[oldPos], undefined, true); - } else { - basePath = clonePath(addPath); - basePath.newPos++; - this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined); - } - - var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath); - - if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) { - return basePath.components; - } else { - bestPath[diagonalPath] = basePath; - } - } - } - }, - - pushComponent: function(components, value, added, removed) { - var last = components[components.length-1]; - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length-1] = - {value: this.join(last.value, value), added: added, removed: removed }; - } else { - components.push({value: value, added: added, removed: removed }); - } - }, - extractCommon: function(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath; - while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) { - newPos++; - oldPos++; - - this.pushComponent(basePath.components, newString[newPos], undefined, undefined); - } - basePath.newPos = newPos; - return oldPos; - }, - - equals: function(left, right) { - var reWhitespace = /\S/; - if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) { - return true; - } else { - return left == right; - } - }, - join: function(left, right) { - return left + right; - }, - tokenize: function(value) { - return value; - } - }; - - var CharDiff = new fbDiff(); - - var WordDiff = new fbDiff(true); - WordDiff.tokenize = function(value) { - return removeEmpty(value.split(/(\s+|\b)/)); - }; - - var CssDiff = new fbDiff(true); - CssDiff.tokenize = function(value) { - return removeEmpty(value.split(/([{}:;,]|\s+)/)); - }; - - var LineDiff = new fbDiff(); - LineDiff.tokenize = function(value) { - return value.split(/^/m); - }; - - return { - diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); }, - diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); }, - diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); }, - - diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); }, - - createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) { - var ret = []; - - ret.push("Index: " + fileName); - ret.push("==================================================================="); - ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader)); - ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader)); - - var diff = LineDiff.diff(oldStr, newStr); - if (!diff[diff.length-1].value) { - diff.pop(); // Remove trailing newline add - } - diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function(entry) { return ' ' + entry; }); - } - function eofNL(curRange, i, current) { - var last = diff[diff.length-2], - isLast = i === diff.length-2, - isLastOfType = i === diff.length-3 && (current.added === !last.added || current.removed === !last.removed); - - // Figure out if this is the last line for the given file and missing NL - if (!/\n$/.test(current.value) && (isLast || isLastOfType)) { - curRange.push('\\ No newline at end of file'); - } - } - - var oldRangeStart = 0, newRangeStart = 0, curRange = [], - oldLine = 1, newLine = 1; - for (var i = 0; i < diff.length; i++) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - - if (current.added || current.removed) { - if (!oldRangeStart) { - var prev = diff[i-1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = contextLines(prev.lines.slice(-4)); - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?"+":"-") + entry; })); - eofNL(curRange, i, current); - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= 8 && i < diff.length-2) { - // Overlapping - curRange.push.apply(curRange, contextLines(lines)); - } else { - // end the range and output - var contextSize = Math.min(lines.length, 4); - ret.push( - "@@ -" + oldRangeStart + "," + (oldLine-oldRangeStart+contextSize) - + " +" + newRangeStart + "," + (newLine-newRangeStart+contextSize) - + " @@"); - ret.push.apply(ret, curRange); - ret.push.apply(ret, contextLines(lines.slice(0, contextSize))); - if (lines.length <= 4) { - eofNL(ret, i, current); - } - - oldRangeStart = 0; newRangeStart = 0; curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - } - - return ret.join('\n') + '\n'; - }, - - convertChangesToXML: function(changes){ - var ret = []; - for ( var i = 0; i < changes.length; i++) { - var change = changes[i]; - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - } - return ret.join(""); - } - }; -})(); - -if (typeof module !== "undefined") { - module.exports = JsDiff; -} - -}); // module: browser/diff.js - -require.register("browser/events.js", function(module, exports, require){ - -/** - * Module exports. - */ - -exports.EventEmitter = EventEmitter; - -/** - * Check if `obj` is an array. - */ - -function isArray(obj) { - return '[object Array]' == {}.toString.call(obj); -} - -/** - * Event emitter constructor. - * - * @api public - */ - -function EventEmitter(){}; - -/** - * Adds a listener. - * - * @api public - */ - -EventEmitter.prototype.on = function (name, fn) { - if (!this.$events) { - this.$events = {}; - } - - if (!this.$events[name]) { - this.$events[name] = fn; - } else if (isArray(this.$events[name])) { - this.$events[name].push(fn); - } else { - this.$events[name] = [this.$events[name], fn]; - } - - return this; -}; - -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -/** - * Adds a volatile listener. - * - * @api public - */ - -EventEmitter.prototype.once = function (name, fn) { - var self = this; - - function on () { - self.removeListener(name, on); - fn.apply(this, arguments); - }; - - on.listener = fn; - this.on(name, on); - - return this; -}; - -/** - * Removes a listener. - * - * @api public - */ - -EventEmitter.prototype.removeListener = function (name, fn) { - if (this.$events && this.$events[name]) { - var list = this.$events[name]; - - if (isArray(list)) { - var pos = -1; - - for (var i = 0, l = list.length; i < l; i++) { - if (list[i] === fn || (list[i].listener && list[i].listener === fn)) { - pos = i; - break; - } - } - - if (pos < 0) { - return this; - } - - list.splice(pos, 1); - - if (!list.length) { - delete this.$events[name]; - } - } else if (list === fn || (list.listener && list.listener === fn)) { - delete this.$events[name]; - } - } - - return this; -}; - -/** - * Removes all listeners for an event. - * - * @api public - */ - -EventEmitter.prototype.removeAllListeners = function (name) { - if (name === undefined) { - this.$events = {}; - return this; - } - - if (this.$events && this.$events[name]) { - this.$events[name] = null; - } - - return this; -}; - -/** - * Gets all listeners for a certain event. - * - * @api public - */ - -EventEmitter.prototype.listeners = function (name) { - if (!this.$events) { - this.$events = {}; - } - - if (!this.$events[name]) { - this.$events[name] = []; - } - - if (!isArray(this.$events[name])) { - this.$events[name] = [this.$events[name]]; - } - - return this.$events[name]; -}; - -/** - * Emits an event. - * - * @api public - */ - -EventEmitter.prototype.emit = function (name) { - if (!this.$events) { - return false; - } - - var handler = this.$events[name]; - - if (!handler) { - return false; - } - - var args = [].slice.call(arguments, 1); - - if ('function' == typeof handler) { - handler.apply(this, args); - } else if (isArray(handler)) { - var listeners = handler.slice(); - - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - } else { - return false; - } - - return true; -}; -}); // module: browser/events.js - -require.register("browser/fs.js", function(module, exports, require){ - -}); // module: browser/fs.js - -require.register("browser/path.js", function(module, exports, require){ - -}); // module: browser/path.js - -require.register("browser/progress.js", function(module, exports, require){ - -/** - * Expose `Progress`. - */ - -module.exports = Progress; - -/** - * Initialize a new `Progress` indicator. - */ - -function Progress() { - this.percent = 0; - this.size(0); - this.fontSize(11); - this.font('helvetica, arial, sans-serif'); -} - -/** - * Set progress size to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.size = function(n){ - this._size = n; - return this; -}; - -/** - * Set text to `str`. - * - * @param {String} str - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.text = function(str){ - this._text = str; - return this; -}; - -/** - * Set font size to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.fontSize = function(n){ - this._fontSize = n; - return this; -}; - -/** - * Set font `family`. - * - * @param {String} family - * @return {Progress} for chaining - */ - -Progress.prototype.font = function(family){ - this._font = family; - return this; -}; - -/** - * Update percentage to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - */ - -Progress.prototype.update = function(n){ - this.percent = n; - return this; -}; - -/** - * Draw on `ctx`. - * - * @param {CanvasRenderingContext2d} ctx - * @return {Progress} for chaining - */ - -Progress.prototype.draw = function(ctx){ - var percent = Math.min(this.percent, 100) - , size = this._size - , half = size / 2 - , x = half - , y = half - , rad = half - 1 - , fontSize = this._fontSize; - - ctx.font = fontSize + 'px ' + this._font; - - var angle = Math.PI * 2 * (percent / 100); - ctx.clearRect(0, 0, size, size); - - // outer circle - ctx.strokeStyle = '#9f9f9f'; - ctx.beginPath(); - ctx.arc(x, y, rad, 0, angle, false); - ctx.stroke(); - - // inner circle - ctx.strokeStyle = '#eee'; - ctx.beginPath(); - ctx.arc(x, y, rad - 1, 0, angle, true); - ctx.stroke(); - - // text - var text = this._text || (percent | 0) + '%' - , w = ctx.measureText(text).width; - - ctx.fillText( - text - , x - w / 2 + 1 - , y + fontSize / 2 - 1); - - return this; -}; - -}); // module: browser/progress.js - -require.register("browser/tty.js", function(module, exports, require){ - -exports.isatty = function(){ - return true; -}; - -exports.getWindowSize = function(){ - if ('innerHeight' in global) { - return [global.innerHeight, global.innerWidth]; - } else { - // In a Web Worker, the DOM Window is not available. - return [640, 480]; - } -}; - -}); // module: browser/tty.js - -require.register("context.js", function(module, exports, require){ - -/** - * Expose `Context`. - */ - -module.exports = Context; - -/** - * Initialize a new `Context`. - * - * @api private - */ - -function Context(){} - -/** - * Set or get the context `Runnable` to `runnable`. - * - * @param {Runnable} runnable - * @return {Context} - * @api private - */ - -Context.prototype.runnable = function(runnable){ - if (0 == arguments.length) return this._runnable; - this.test = this._runnable = runnable; - return this; -}; - -/** - * Set test timeout `ms`. - * - * @param {Number} ms - * @return {Context} self - * @api private - */ - -Context.prototype.timeout = function(ms){ - this.runnable().timeout(ms); - return this; -}; - -/** - * Set test slowness threshold `ms`. - * - * @param {Number} ms - * @return {Context} self - * @api private - */ - -Context.prototype.slow = function(ms){ - this.runnable().slow(ms); - return this; -}; - -/** - * Inspect the context void of `._runnable`. - * - * @return {String} - * @api private - */ - -Context.prototype.inspect = function(){ - return JSON.stringify(this, function(key, val){ - if ('_runnable' == key) return; - if ('test' == key) return; - return val; - }, 2); -}; - -}); // module: context.js - -require.register("hook.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Runnable = require('./runnable'); - -/** - * Expose `Hook`. - */ - -module.exports = Hook; - -/** - * Initialize a new `Hook` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Hook(title, fn) { - Runnable.call(this, title, fn); - this.type = 'hook'; -} - -/** - * Inherit from `Runnable.prototype`. - */ - -function F(){}; -F.prototype = Runnable.prototype; -Hook.prototype = new F; -Hook.prototype.constructor = Hook; - - -/** - * Get or set the test `err`. - * - * @param {Error} err - * @return {Error} - * @api public - */ - -Hook.prototype.error = function(err){ - if (0 == arguments.length) { - var err = this._error; - this._error = null; - return err; - } - - this._error = err; -}; - -}); // module: hook.js - -require.register("interfaces/bdd.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils'); - -/** - * BDD-style interface: - * - * describe('Array', function(){ - * describe('#indexOf()', function(){ - * it('should return -1 when not present', function(){ - * - * }); - * - * it('should return the index when present', function(){ - * - * }); - * }); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before running tests. - */ - - context.before = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after running tests. - */ - - context.after = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Execute before each test case. - */ - - context.beforeEach = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.afterEach = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Describe a "suite" with the given `title` - * and callback `fn` containing nested suites - * and/or tests. - */ - - context.describe = context.context = function(title, fn){ - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - fn.call(suite); - suites.shift(); - return suite; - }; - - /** - * Pending describe. - */ - - context.xdescribe = - context.xcontext = - context.describe.skip = function(title, fn){ - var suite = Suite.create(suites[0], title); - suite.pending = true; - suites.unshift(suite); - fn.call(suite); - suites.shift(); - }; - - /** - * Exclusive suite. - */ - - context.describe.only = function(title, fn){ - var suite = context.describe(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.it = context.specify = function(title, fn){ - var suite = suites[0]; - if (suite.pending) var fn = null; - var test = new Test(title, fn); - suite.addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.it.only = function(title, fn){ - var test = context.it(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.xit = - context.xspecify = - context.it.skip = function(title){ - context.it(title); - }; - }); -}; - -}); // module: interfaces/bdd.js - -require.register("interfaces/exports.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test'); - -/** - * TDD-style interface: - * - * exports.Array = { - * '#indexOf()': { - * 'should return -1 when the value is not present': function(){ - * - * }, - * - * 'should return the correct index when the value is present': function(){ - * - * } - * } - * }; - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('require', visit); - - function visit(obj) { - var suite; - for (var key in obj) { - if ('function' == typeof obj[key]) { - var fn = obj[key]; - switch (key) { - case 'before': - suites[0].beforeAll(fn); - break; - case 'after': - suites[0].afterAll(fn); - break; - case 'beforeEach': - suites[0].beforeEach(fn); - break; - case 'afterEach': - suites[0].afterEach(fn); - break; - default: - suites[0].addTest(new Test(key, fn)); - } - } else { - var suite = Suite.create(suites[0], key); - suites.unshift(suite); - visit(obj[key]); - suites.shift(); - } - } - } -}; - -}); // module: interfaces/exports.js - -require.register("interfaces/index.js", function(module, exports, require){ - -exports.bdd = require('./bdd'); -exports.tdd = require('./tdd'); -exports.qunit = require('./qunit'); -exports.exports = require('./exports'); - -}); // module: interfaces/index.js - -require.register("interfaces/qunit.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils'); - -/** - * QUnit-style interface: - * - * suite('Array'); - * - * test('#length', function(){ - * var arr = [1,2,3]; - * ok(arr.length == 3); - * }); - * - * test('#indexOf()', function(){ - * var arr = [1,2,3]; - * ok(arr.indexOf(1) == 0); - * ok(arr.indexOf(2) == 1); - * ok(arr.indexOf(3) == 2); - * }); - * - * suite('String'); - * - * test('#length', function(){ - * ok('foo'.length == 3); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before running tests. - */ - - context.before = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after running tests. - */ - - context.after = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Execute before each test case. - */ - - context.beforeEach = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.afterEach = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Describe a "suite" with the given `title`. - */ - - context.suite = function(title){ - if (suites.length > 1) suites.shift(); - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - return suite; - }; - - /** - * Exclusive test-case. - */ - - context.suite.only = function(title, fn){ - var suite = context.suite(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.test = function(title, fn){ - var test = new Test(title, fn); - suites[0].addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.test.only = function(title, fn){ - var test = context.test(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.test.skip = function(title){ - context.test(title); - }; - }); -}; - -}); // module: interfaces/qunit.js - -require.register("interfaces/tdd.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils');; - -/** - * TDD-style interface: - * - * suite('Array', function(){ - * suite('#indexOf()', function(){ - * suiteSetup(function(){ - * - * }); - * - * test('should return -1 when not present', function(){ - * - * }); - * - * test('should return the index when present', function(){ - * - * }); - * - * suiteTeardown(function(){ - * - * }); - * }); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before each test case. - */ - - context.setup = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.teardown = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Execute before the suite. - */ - - context.suiteSetup = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after the suite. - */ - - context.suiteTeardown = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Describe a "suite" with the given `title` - * and callback `fn` containing nested suites - * and/or tests. - */ - - context.suite = function(title, fn){ - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - fn.call(suite); - suites.shift(); - return suite; - }; - - /** - * Pending suite. - */ - context.suite.skip = function(title, fn) { - var suite = Suite.create(suites[0], title); - suite.pending = true; - suites.unshift(suite); - fn.call(suite); - suites.shift(); - }; - - /** - * Exclusive test-case. - */ - - context.suite.only = function(title, fn){ - var suite = context.suite(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.test = function(title, fn){ - var suite = suites[0]; - if (suite.pending) var fn = null; - var test = new Test(title, fn); - suite.addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.test.only = function(title, fn){ - var test = context.test(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.test.skip = function(title){ - context.test(title); - }; - }); -}; - -}); // module: interfaces/tdd.js - -require.register("mocha.js", function(module, exports, require){ -/*! - * mocha - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var path = require('browser/path') - , utils = require('./utils'); - -/** - * Expose `Mocha`. - */ - -exports = module.exports = Mocha; - -/** - * Expose internals. - */ - -exports.utils = utils; -exports.interfaces = require('./interfaces'); -exports.reporters = require('./reporters'); -exports.Runnable = require('./runnable'); -exports.Context = require('./context'); -exports.Runner = require('./runner'); -exports.Suite = require('./suite'); -exports.Hook = require('./hook'); -exports.Test = require('./test'); - -/** - * Return image `name` path. - * - * @param {String} name - * @return {String} - * @api private - */ - -function image(name) { - return __dirname + '/../images/' + name + '.png'; -} - -/** - * Setup mocha with `options`. - * - * Options: - * - * - `ui` name "bdd", "tdd", "exports" etc - * - `reporter` reporter instance, defaults to `mocha.reporters.Dot` - * - `globals` array of accepted globals - * - `timeout` timeout in milliseconds - * - `bail` bail on the first test failure - * - `slow` milliseconds to wait before considering a test slow - * - `ignoreLeaks` ignore global leaks - * - `grep` string or regexp to filter tests with - * - * @param {Object} options - * @api public - */ - -function Mocha(options) { - options = options || {}; - this.files = []; - this.options = options; - this.grep(options.grep); - this.suite = new exports.Suite('', new exports.Context); - this.ui(options.ui); - this.bail(options.bail); - this.reporter(options.reporter); - if (typeof options.timeout === 'number') this.timeout(options.timeout); - if (options.slow) this.slow(options.slow); -} - -/** - * Enable or disable bailing on the first failure. - * - * @param {Boolean} [bail] - * @api public - */ - -Mocha.prototype.bail = function(bail){ - if (0 == arguments.length) bail = true; - this.suite.bail(bail); - return this; -}; - -/** - * Add test `file`. - * - * @param {String} file - * @api public - */ - -Mocha.prototype.addFile = function(file){ - this.files.push(file); - return this; -}; - -/** - * Set reporter to `reporter`, defaults to "dot". - * - * @param {String|Function} reporter name or constructor - * @api public - */ - -Mocha.prototype.reporter = function(reporter){ - if ('function' == typeof reporter) { - this._reporter = reporter; - } else { - reporter = reporter || 'dot'; - try { - this._reporter = require('./reporters/' + reporter); - } catch (err) { - this._reporter = require(reporter); - } - if (!this._reporter) throw new Error('invalid reporter "' + reporter + '"'); - } - return this; -}; - -/** - * Set test UI `name`, defaults to "bdd". - * - * @param {String} bdd - * @api public - */ - -Mocha.prototype.ui = function(name){ - name = name || 'bdd'; - this._ui = exports.interfaces[name]; - if (!this._ui) throw new Error('invalid interface "' + name + '"'); - this._ui = this._ui(this.suite); - return this; -}; - -/** - * Load registered files. - * - * @api private - */ - -Mocha.prototype.loadFiles = function(fn){ - var self = this; - var suite = this.suite; - var pending = this.files.length; - this.files.forEach(function(file){ - file = path.resolve(file); - suite.emit('pre-require', global, file, self); - suite.emit('require', require(file), file, self); - suite.emit('post-require', global, file, self); - --pending || (fn && fn()); - }); -}; - -/** - * Enable growl support. - * - * @api private - */ - -Mocha.prototype._growl = function(runner, reporter) { - var notify = require('growl'); - - runner.on('end', function(){ - var stats = reporter.stats; - if (stats.failures) { - var msg = stats.failures + ' of ' + runner.total + ' tests failed'; - notify(msg, { name: 'mocha', title: 'Failed', image: image('error') }); - } else { - notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', { - name: 'mocha' - , title: 'Passed' - , image: image('ok') - }); - } - }); -}; - -/** - * Add regexp to grep, if `re` is a string it is escaped. - * - * @param {RegExp|String} re - * @return {Mocha} - * @api public - */ - -Mocha.prototype.grep = function(re){ - this.options.grep = 'string' == typeof re - ? new RegExp(utils.escapeRegexp(re)) - : re; - return this; -}; - -/** - * Invert `.grep()` matches. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.invert = function(){ - this.options.invert = true; - return this; -}; - -/** - * Ignore global leaks. - * - * @param {Boolean} ignore - * @return {Mocha} - * @api public - */ - -Mocha.prototype.ignoreLeaks = function(ignore){ - this.options.ignoreLeaks = !!ignore; - return this; -}; - -/** - * Enable global leak checking. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.checkLeaks = function(){ - this.options.ignoreLeaks = false; - return this; -}; - -/** - * Enable growl support. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.growl = function(){ - this.options.growl = true; - return this; -}; - -/** - * Ignore `globals` array or string. - * - * @param {Array|String} globals - * @return {Mocha} - * @api public - */ - -Mocha.prototype.globals = function(globals){ - this.options.globals = (this.options.globals || []).concat(globals); - return this; -}; - -/** - * Set the timeout in milliseconds. - * - * @param {Number} timeout - * @return {Mocha} - * @api public - */ - -Mocha.prototype.timeout = function(timeout){ - this.suite.timeout(timeout); - return this; -}; - -/** - * Set slowness threshold in milliseconds. - * - * @param {Number} slow - * @return {Mocha} - * @api public - */ - -Mocha.prototype.slow = function(slow){ - this.suite.slow(slow); - return this; -}; - -/** - * Makes all tests async (accepting a callback) - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.asyncOnly = function(){ - this.options.asyncOnly = true; - return this; -}; - -/** - * Run tests and invoke `fn()` when complete. - * - * @param {Function} fn - * @return {Runner} - * @api public - */ - -Mocha.prototype.run = function(fn){ - if (this.files.length) this.loadFiles(); - var suite = this.suite; - var options = this.options; - var runner = new exports.Runner(suite); - var reporter = new this._reporter(runner); - runner.ignoreLeaks = false !== options.ignoreLeaks; - runner.asyncOnly = options.asyncOnly; - if (options.grep) runner.grep(options.grep, options.invert); - if (options.globals) runner.globals(options.globals); - if (options.growl) this._growl(runner, reporter); - return runner.run(fn); -}; - -}); // module: mocha.js - -require.register("ms.js", function(module, exports, require){ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 's': - return n * s; - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} - -}); // module: ms.js - -require.register("reporters/base.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var tty = require('browser/tty') - , diff = require('browser/diff') - , ms = require('../ms'); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Check if both stdio streams are associated with a tty. - */ - -var isatty = tty.isatty(1) && tty.isatty(2); - -/** - * Expose `Base`. - */ - -exports = module.exports = Base; - -/** - * Enable coloring by default. - */ - -exports.useColors = isatty; - -/** - * Default color map. - */ - -exports.colors = { - 'pass': 90 - , 'fail': 31 - , 'bright pass': 92 - , 'bright fail': 91 - , 'bright yellow': 93 - , 'pending': 36 - , 'suite': 0 - , 'error title': 0 - , 'error message': 31 - , 'error stack': 90 - , 'checkmark': 32 - , 'fast': 90 - , 'medium': 33 - , 'slow': 31 - , 'green': 32 - , 'light': 90 - , 'diff gutter': 90 - , 'diff added': 42 - , 'diff removed': 41 -}; - -/** - * Default symbol map. - */ - -exports.symbols = { - ok: '✓', - err: '✖', - dot: '․' -}; - -// With node.js on Windows: use symbols available in terminal default fonts -if ('win32' == process.platform) { - exports.symbols.ok = '\u221A'; - exports.symbols.err = '\u00D7'; - exports.symbols.dot = '.'; -} - -/** - * Color `str` with the given `type`, - * allowing colors to be disabled, - * as well as user-defined color - * schemes. - * - * @param {String} type - * @param {String} str - * @return {String} - * @api private - */ - -var color = exports.color = function(type, str) { - if (!exports.useColors) return str; - return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m'; -}; - -/** - * Expose term window size, with some - * defaults for when stderr is not a tty. - */ - -exports.window = { - width: isatty - ? process.stdout.getWindowSize - ? process.stdout.getWindowSize(1)[0] - : tty.getWindowSize()[1] - : 75 -}; - -/** - * Expose some basic cursor interactions - * that are common among reporters. - */ - -exports.cursor = { - hide: function(){ - process.stdout.write('\u001b[?25l'); - }, - - show: function(){ - process.stdout.write('\u001b[?25h'); - }, - - deleteLine: function(){ - process.stdout.write('\u001b[2K'); - }, - - beginningOfLine: function(){ - process.stdout.write('\u001b[0G'); - }, - - CR: function(){ - exports.cursor.deleteLine(); - exports.cursor.beginningOfLine(); - } -}; - -/** - * Outut the given `failures` as a list. - * - * @param {Array} failures - * @api public - */ - -exports.list = function(failures){ - console.error(); - failures.forEach(function(test, i){ - // format - var fmt = color('error title', ' %s) %s:\n') - + color('error message', ' %s') - + color('error stack', '\n%s\n'); - - // msg - var err = test.err - , message = err.message || '' - , stack = err.stack || message - , index = stack.indexOf(message) + message.length - , msg = stack.slice(0, index) - , actual = err.actual - , expected = err.expected - , escape = true; - - // uncaught - if (err.uncaught) { - msg = 'Uncaught ' + msg; - } - - // explicitly show diff - if (err.showDiff && sameType(actual, expected)) { - escape = false; - err.actual = actual = stringify(actual); - err.expected = expected = stringify(expected); - } - - // actual / expected diff - if ('string' == typeof actual && 'string' == typeof expected) { - msg = errorDiff(err, 'Words', escape); - - // linenos - var lines = msg.split('\n'); - if (lines.length > 4) { - var width = String(lines.length).length; - msg = lines.map(function(str, i){ - return pad(++i, width) + ' |' + ' ' + str; - }).join('\n'); - } - - // legend - msg = '\n' - + color('diff removed', 'actual') - + ' ' - + color('diff added', 'expected') - + '\n\n' - + msg - + '\n'; - - // indent - msg = msg.replace(/^/gm, ' '); - - fmt = color('error title', ' %s) %s:\n%s') - + color('error stack', '\n%s\n'); - } - - // indent stack trace without msg - stack = stack.slice(index ? index + 1 : index) - .replace(/^/gm, ' '); - - console.error(fmt, (i + 1), test.fullTitle(), msg, stack); - }); -}; - -/** - * Initialize a new `Base` reporter. - * - * All other reporters generally - * inherit from this reporter, providing - * stats such as test duration, number - * of tests passed / failed etc. - * - * @param {Runner} runner - * @api public - */ - -function Base(runner) { - var self = this - , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 } - , failures = this.failures = []; - - if (!runner) return; - this.runner = runner; - - runner.stats = stats; - - runner.on('start', function(){ - stats.start = new Date; - }); - - runner.on('suite', function(suite){ - stats.suites = stats.suites || 0; - suite.root || stats.suites++; - }); - - runner.on('test end', function(test){ - stats.tests = stats.tests || 0; - stats.tests++; - }); - - runner.on('pass', function(test){ - stats.passes = stats.passes || 0; - - var medium = test.slow() / 2; - test.speed = test.duration > test.slow() - ? 'slow' - : test.duration > medium - ? 'medium' - : 'fast'; - - stats.passes++; - }); - - runner.on('fail', function(test, err){ - stats.failures = stats.failures || 0; - stats.failures++; - test.err = err; - failures.push(test); - }); - - runner.on('end', function(){ - stats.end = new Date; - stats.duration = new Date - stats.start; - }); - - runner.on('pending', function(){ - stats.pending++; - }); -} - -/** - * Output common epilogue used by many of - * the bundled reporters. - * - * @api public - */ - -Base.prototype.epilogue = function(){ - var stats = this.stats; - var tests; - var fmt; - - console.log(); - - // passes - fmt = color('bright pass', ' ') - + color('green', ' %d passing') - + color('light', ' (%s)'); - - console.log(fmt, - stats.passes || 0, - ms(stats.duration)); - - // pending - if (stats.pending) { - fmt = color('pending', ' ') - + color('pending', ' %d pending'); - - console.log(fmt, stats.pending); - } - - // failures - if (stats.failures) { - fmt = color('fail', ' %d failing'); - - console.error(fmt, - stats.failures); - - Base.list(this.failures); - console.error(); - } - - console.log(); -}; - -/** - * Pad the given `str` to `len`. - * - * @param {String} str - * @param {String} len - * @return {String} - * @api private - */ - -function pad(str, len) { - str = String(str); - return Array(len - str.length + 1).join(' ') + str; -} - -/** - * Return a character diff for `err`. - * - * @param {Error} err - * @return {String} - * @api private - */ - -function errorDiff(err, type, escape) { - return diff['diff' + type](err.actual, err.expected).map(function(str){ - if (escape) { - str.value = str.value - .replace(/\t/g, '') - .replace(/\r/g, '') - .replace(/\n/g, '\n'); - } - if (str.added) return colorLines('diff added', str.value); - if (str.removed) return colorLines('diff removed', str.value); - return str.value; - }).join(''); -} - -/** - * Color lines for `str`, using the color `name`. - * - * @param {String} name - * @param {String} str - * @return {String} - * @api private - */ - -function colorLines(name, str) { - return str.split('\n').map(function(str){ - return color(name, str); - }).join('\n'); -} - -/** - * Stringify `obj`. - * - * @param {Mixed} obj - * @return {String} - * @api private - */ - -function stringify(obj) { - if (obj instanceof RegExp) return obj.toString(); - return JSON.stringify(obj, null, 2); -} - -/** - * Check that a / b have the same type. - * - * @param {Object} a - * @param {Object} b - * @return {Boolean} - * @api private - */ - -function sameType(a, b) { - a = Object.prototype.toString.call(a); - b = Object.prototype.toString.call(b); - return a == b; -} - -}); // module: reporters/base.js - -require.register("reporters/doc.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils'); - -/** - * Expose `Doc`. - */ - -exports = module.exports = Doc; - -/** - * Initialize a new `Doc` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Doc(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total - , indents = 2; - - function indent() { - return Array(indents).join(' '); - } - - runner.on('suite', function(suite){ - if (suite.root) return; - ++indents; - console.log('%s
      ', indent()); - ++indents; - console.log('%s

      %s

      ', indent(), utils.escape(suite.title)); - console.log('%s
      ', indent()); - }); - - runner.on('suite end', function(suite){ - if (suite.root) return; - console.log('%s
      ', indent()); - --indents; - console.log('%s
      ', indent()); - --indents; - }); - - runner.on('pass', function(test){ - console.log('%s
      %s
      ', indent(), utils.escape(test.title)); - var code = utils.escape(utils.clean(test.fn.toString())); - console.log('%s
      %s
      ', indent(), code); - }); -} - -}); // module: reporters/doc.js - -require.register("reporters/dot.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `Dot`. - */ - -exports = module.exports = Dot; - -/** - * Initialize a new `Dot` matrix test reporter. - * - * @param {Runner} runner - * @api public - */ - -function Dot(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , n = 0; - - runner.on('start', function(){ - process.stdout.write('\n '); - }); - - runner.on('pending', function(test){ - process.stdout.write(color('pending', Base.symbols.dot)); - }); - - runner.on('pass', function(test){ - if (++n % width == 0) process.stdout.write('\n '); - if ('slow' == test.speed) { - process.stdout.write(color('bright yellow', Base.symbols.dot)); - } else { - process.stdout.write(color(test.speed, Base.symbols.dot)); - } - }); - - runner.on('fail', function(test, err){ - if (++n % width == 0) process.stdout.write('\n '); - process.stdout.write(color('fail', Base.symbols.dot)); - }); - - runner.on('end', function(){ - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Dot.prototype = new F; -Dot.prototype.constructor = Dot; - -}); // module: reporters/dot.js - -require.register("reporters/html-cov.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var JSONCov = require('./json-cov') - , fs = require('browser/fs'); - -/** - * Expose `HTMLCov`. - */ - -exports = module.exports = HTMLCov; - -/** - * Initialize a new `JsCoverage` reporter. - * - * @param {Runner} runner - * @api public - */ - -function HTMLCov(runner) { - var jade = require('jade') - , file = __dirname + '/templates/coverage.jade' - , str = fs.readFileSync(file, 'utf8') - , fn = jade.compile(str, { filename: file }) - , self = this; - - JSONCov.call(this, runner, false); - - runner.on('end', function(){ - process.stdout.write(fn({ - cov: self.cov - , coverageClass: coverageClass - })); - }); -} - -/** - * Return coverage class for `n`. - * - * @return {String} - * @api private - */ - -function coverageClass(n) { - if (n >= 75) return 'high'; - if (n >= 50) return 'medium'; - if (n >= 25) return 'low'; - return 'terrible'; -} -}); // module: reporters/html-cov.js - -require.register("reporters/html.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils') - , Progress = require('../browser/progress') - , escape = utils.escape; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Expose `Doc`. - */ - -exports = module.exports = HTML; - -/** - * Stats template. - */ - -var statsTemplate = ''; - -/** - * Initialize a new `Doc` reporter. - * - * @param {Runner} runner - * @api public - */ - -function HTML(runner, root) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total - , stat = fragment(statsTemplate) - , items = stat.getElementsByTagName('li') - , passes = items[1].getElementsByTagName('em')[0] - , passesLink = items[1].getElementsByTagName('a')[0] - , failures = items[2].getElementsByTagName('em')[0] - , failuresLink = items[2].getElementsByTagName('a')[0] - , duration = items[3].getElementsByTagName('em')[0] - , canvas = stat.getElementsByTagName('canvas')[0] - , report = fragment('
        ') - , stack = [report] - , progress - , ctx - - root = root || document.getElementById('mocha'); - - if (canvas.getContext) { - var ratio = window.devicePixelRatio || 1; - canvas.style.width = canvas.width; - canvas.style.height = canvas.height; - canvas.width *= ratio; - canvas.height *= ratio; - ctx = canvas.getContext('2d'); - ctx.scale(ratio, ratio); - progress = new Progress; - } - - if (!root) return error('#mocha div missing, add it to your document'); - - // pass toggle - on(passesLink, 'click', function(){ - unhide(); - var name = /pass/.test(report.className) ? '' : ' pass'; - report.className = report.className.replace(/fail|pass/g, '') + name; - if (report.className.trim()) hideSuitesWithout('test pass'); - }); - - // failure toggle - on(failuresLink, 'click', function(){ - unhide(); - var name = /fail/.test(report.className) ? '' : ' fail'; - report.className = report.className.replace(/fail|pass/g, '') + name; - if (report.className.trim()) hideSuitesWithout('test fail'); - }); - - root.appendChild(stat); - root.appendChild(report); - - if (progress) progress.size(40); - - runner.on('suite', function(suite){ - if (suite.root) return; - - // suite - var url = '?grep=' + encodeURIComponent(suite.fullTitle()); - var el = fragment('
      • %s

      • ', url, escape(suite.title)); - - // container - stack[0].appendChild(el); - stack.unshift(document.createElement('ul')); - el.appendChild(stack[0]); - }); - - runner.on('suite end', function(suite){ - if (suite.root) return; - stack.shift(); - }); - - runner.on('fail', function(test, err){ - if ('hook' == test.type) runner.emit('test end', test); - }); - - runner.on('test end', function(test){ - // TODO: add to stats - var percent = stats.tests / this.total * 100 | 0; - if (progress) progress.update(percent).draw(ctx); - - // update stats - var ms = new Date - stats.start; - text(passes, stats.passes); - text(failures, stats.failures); - text(duration, (ms / 1000).toFixed(2)); - - // test - if ('passed' == test.state) { - var el = fragment('
      • %e%ems

      • ', test.speed, test.title, test.duration, encodeURIComponent(test.fullTitle())); - } else if (test.pending) { - var el = fragment('
      • %e

      • ', test.title); - } else { - var el = fragment('
      • %e

      • ', test.title, encodeURIComponent(test.fullTitle())); - var str = test.err.stack || test.err.toString(); - - // FF / Opera do not add the message - if (!~str.indexOf(test.err.message)) { - str = test.err.message + '\n' + str; - } - - // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we - // check for the result of the stringifying. - if ('[object Error]' == str) str = test.err.message; - - // Safari doesn't give you a stack. Let's at least provide a source line. - if (!test.err.stack && test.err.sourceURL && test.err.line !== undefined) { - str += "\n(" + test.err.sourceURL + ":" + test.err.line + ")"; - } - - el.appendChild(fragment('
        %e
        ', str)); - } - - // toggle code - // TODO: defer - if (!test.pending) { - var h2 = el.getElementsByTagName('h2')[0]; - - on(h2, 'click', function(){ - pre.style.display = 'none' == pre.style.display - ? 'block' - : 'none'; - }); - - var pre = fragment('
        %e
        ', utils.clean(test.fn.toString())); - el.appendChild(pre); - pre.style.display = 'none'; - } - - // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack. - if (stack[0]) stack[0].appendChild(el); - }); -} - -/** - * Display error `msg`. - */ - -function error(msg) { - document.body.appendChild(fragment('
        %s
        ', msg)); -} - -/** - * Return a DOM fragment from `html`. - */ - -function fragment(html) { - var args = arguments - , div = document.createElement('div') - , i = 1; - - div.innerHTML = html.replace(/%([se])/g, function(_, type){ - switch (type) { - case 's': return String(args[i++]); - case 'e': return escape(args[i++]); - } - }); - - return div.firstChild; -} - -/** - * Check for suites that do not have elements - * with `classname`, and hide them. - */ - -function hideSuitesWithout(classname) { - var suites = document.getElementsByClassName('suite'); - for (var i = 0; i < suites.length; i++) { - var els = suites[i].getElementsByClassName(classname); - if (0 == els.length) suites[i].className += ' hidden'; - } -} - -/** - * Unhide .hidden suites. - */ - -function unhide() { - var els = document.getElementsByClassName('suite hidden'); - for (var i = 0; i < els.length; ++i) { - els[i].className = els[i].className.replace('suite hidden', 'suite'); - } -} - -/** - * Set `el` text to `str`. - */ - -function text(el, str) { - if (el.textContent) { - el.textContent = str; - } else { - el.innerText = str; - } -} - -/** - * Listen on `event` with callback `fn`. - */ - -function on(el, event, fn) { - if (el.addEventListener) { - el.addEventListener(event, fn, false); - } else { - el.attachEvent('on' + event, fn); - } -} - -}); // module: reporters/html.js - -require.register("reporters/index.js", function(module, exports, require){ - -exports.Base = require('./base'); -exports.Dot = require('./dot'); -exports.Doc = require('./doc'); -exports.TAP = require('./tap'); -exports.JSON = require('./json'); -exports.HTML = require('./html'); -exports.List = require('./list'); -exports.Min = require('./min'); -exports.Spec = require('./spec'); -exports.Nyan = require('./nyan'); -exports.XUnit = require('./xunit'); -exports.Markdown = require('./markdown'); -exports.Progress = require('./progress'); -exports.Landing = require('./landing'); -exports.JSONCov = require('./json-cov'); -exports.HTMLCov = require('./html-cov'); -exports.JSONStream = require('./json-stream'); -exports.Teamcity = require('./teamcity'); - -}); // module: reporters/index.js - -require.register("reporters/json-cov.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `JSONCov`. - */ - -exports = module.exports = JSONCov; - -/** - * Initialize a new `JsCoverage` reporter. - * - * @param {Runner} runner - * @param {Boolean} output - * @api public - */ - -function JSONCov(runner, output) { - var self = this - , output = 1 == arguments.length ? true : output; - - Base.call(this, runner); - - var tests = [] - , failures = [] - , passes = []; - - runner.on('test end', function(test){ - tests.push(test); - }); - - runner.on('pass', function(test){ - passes.push(test); - }); - - runner.on('fail', function(test){ - failures.push(test); - }); - - runner.on('end', function(){ - var cov = global._$jscoverage || {}; - var result = self.cov = map(cov); - result.stats = self.stats; - result.tests = tests.map(clean); - result.failures = failures.map(clean); - result.passes = passes.map(clean); - if (!output) return; - process.stdout.write(JSON.stringify(result, null, 2 )); - }); -} - -/** - * Map jscoverage data to a JSON structure - * suitable for reporting. - * - * @param {Object} cov - * @return {Object} - * @api private - */ - -function map(cov) { - var ret = { - instrumentation: 'node-jscoverage' - , sloc: 0 - , hits: 0 - , misses: 0 - , coverage: 0 - , files: [] - }; - - for (var filename in cov) { - var data = coverage(filename, cov[filename]); - ret.files.push(data); - ret.hits += data.hits; - ret.misses += data.misses; - ret.sloc += data.sloc; - } - - ret.files.sort(function(a, b) { - return a.filename.localeCompare(b.filename); - }); - - if (ret.sloc > 0) { - ret.coverage = (ret.hits / ret.sloc) * 100; - } - - return ret; -}; - -/** - * Map jscoverage data for a single source file - * to a JSON structure suitable for reporting. - * - * @param {String} filename name of the source file - * @param {Object} data jscoverage coverage data - * @return {Object} - * @api private - */ - -function coverage(filename, data) { - var ret = { - filename: filename, - coverage: 0, - hits: 0, - misses: 0, - sloc: 0, - source: {} - }; - - data.source.forEach(function(line, num){ - num++; - - if (data[num] === 0) { - ret.misses++; - ret.sloc++; - } else if (data[num] !== undefined) { - ret.hits++; - ret.sloc++; - } - - ret.source[num] = { - source: line - , coverage: data[num] === undefined - ? '' - : data[num] - }; - }); - - ret.coverage = ret.hits / ret.sloc * 100; - - return ret; -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} - -}); // module: reporters/json-cov.js - -require.register("reporters/json-stream.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `List`. - */ - -exports = module.exports = List; - -/** - * Initialize a new `List` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function List(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total; - - runner.on('start', function(){ - console.log(JSON.stringify(['start', { total: total }])); - }); - - runner.on('pass', function(test){ - console.log(JSON.stringify(['pass', clean(test)])); - }); - - runner.on('fail', function(test, err){ - console.log(JSON.stringify(['fail', clean(test)])); - }); - - runner.on('end', function(){ - process.stdout.write(JSON.stringify(['end', self.stats])); - }); -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} -}); // module: reporters/json-stream.js - -require.register("reporters/json.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `JSON`. - */ - -exports = module.exports = JSONReporter; - -/** - * Initialize a new `JSON` reporter. - * - * @param {Runner} runner - * @api public - */ - -function JSONReporter(runner) { - var self = this; - Base.call(this, runner); - - var tests = [] - , failures = [] - , passes = []; - - runner.on('test end', function(test){ - tests.push(test); - }); - - runner.on('pass', function(test){ - passes.push(test); - }); - - runner.on('fail', function(test){ - failures.push(test); - }); - - runner.on('end', function(){ - var obj = { - stats: self.stats - , tests: tests.map(clean) - , failures: failures.map(clean) - , passes: passes.map(clean) - }; - - process.stdout.write(JSON.stringify(obj, null, 2)); - }); -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} -}); // module: reporters/json.js - -require.register("reporters/landing.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Landing`. - */ - -exports = module.exports = Landing; - -/** - * Airplane color. - */ - -Base.colors.plane = 0; - -/** - * Airplane crash color. - */ - -Base.colors['plane crash'] = 31; - -/** - * Runway color. - */ - -Base.colors.runway = 90; - -/** - * Initialize a new `Landing` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Landing(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , total = runner.total - , stream = process.stdout - , plane = color('plane', '✈') - , crashed = -1 - , n = 0; - - function runway() { - var buf = Array(width).join('-'); - return ' ' + color('runway', buf); - } - - runner.on('start', function(){ - stream.write('\n '); - cursor.hide(); - }); - - runner.on('test end', function(test){ - // check if the plane crashed - var col = -1 == crashed - ? width * ++n / total | 0 - : crashed; - - // show the crash - if ('failed' == test.state) { - plane = color('plane crash', '✈'); - crashed = col; - } - - // render landing strip - stream.write('\u001b[4F\n\n'); - stream.write(runway()); - stream.write('\n '); - stream.write(color('runway', Array(col).join('⋅'))); - stream.write(plane) - stream.write(color('runway', Array(width - col).join('⋅') + '\n')); - stream.write(runway()); - stream.write('\u001b[0m'); - }); - - runner.on('end', function(){ - cursor.show(); - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Landing.prototype = new F; -Landing.prototype.constructor = Landing; - -}); // module: reporters/landing.js - -require.register("reporters/list.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `List`. - */ - -exports = module.exports = List; - -/** - * Initialize a new `List` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function List(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , n = 0; - - runner.on('start', function(){ - console.log(); - }); - - runner.on('test', function(test){ - process.stdout.write(color('pass', ' ' + test.fullTitle() + ': ')); - }); - - runner.on('pending', function(test){ - var fmt = color('checkmark', ' -') - + color('pending', ' %s'); - console.log(fmt, test.fullTitle()); - }); - - runner.on('pass', function(test){ - var fmt = color('checkmark', ' '+Base.symbols.dot) - + color('pass', ' %s: ') - + color(test.speed, '%dms'); - cursor.CR(); - console.log(fmt, test.fullTitle(), test.duration); - }); - - runner.on('fail', function(test, err){ - cursor.CR(); - console.log(color('fail', ' %d) %s'), ++n, test.fullTitle()); - }); - - runner.on('end', self.epilogue.bind(self)); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -List.prototype = new F; -List.prototype.constructor = List; - - -}); // module: reporters/list.js - -require.register("reporters/markdown.js", function(module, exports, require){ -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils'); - -/** - * Expose `Markdown`. - */ - -exports = module.exports = Markdown; - -/** - * Initialize a new `Markdown` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Markdown(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , level = 0 - , buf = ''; - - function title(str) { - return Array(level).join('#') + ' ' + str; - } - - function indent() { - return Array(level).join(' '); - } - - function mapTOC(suite, obj) { - var ret = obj; - obj = obj[suite.title] = obj[suite.title] || { suite: suite }; - suite.suites.forEach(function(suite){ - mapTOC(suite, obj); - }); - return ret; - } - - function stringifyTOC(obj, level) { - ++level; - var buf = ''; - var link; - for (var key in obj) { - if ('suite' == key) continue; - if (key) link = ' - [' + key + '](#' + utils.slug(obj[key].suite.fullTitle()) + ')\n'; - if (key) buf += Array(level).join(' ') + link; - buf += stringifyTOC(obj[key], level); - } - --level; - return buf; - } - - function generateTOC(suite) { - var obj = mapTOC(suite, {}); - return stringifyTOC(obj, 0); - } - - generateTOC(runner.suite); - - runner.on('suite', function(suite){ - ++level; - var slug = utils.slug(suite.fullTitle()); - buf += '' + '\n'; - buf += title(suite.title) + '\n'; - }); - - runner.on('suite end', function(suite){ - --level; - }); - - runner.on('pass', function(test){ - var code = utils.clean(test.fn.toString()); - buf += test.title + '.\n'; - buf += '\n```js\n'; - buf += code + '\n'; - buf += '```\n\n'; - }); - - runner.on('end', function(){ - process.stdout.write('# TOC\n'); - process.stdout.write(generateTOC(runner.suite)); - process.stdout.write(buf); - }); -} -}); // module: reporters/markdown.js - -require.register("reporters/min.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `Min`. - */ - -exports = module.exports = Min; - -/** - * Initialize a new `Min` minimal test reporter (best used with --watch). - * - * @param {Runner} runner - * @api public - */ - -function Min(runner) { - Base.call(this, runner); - - runner.on('start', function(){ - // clear screen - process.stdout.write('\u001b[2J'); - // set cursor position - process.stdout.write('\u001b[1;3H'); - }); - - runner.on('end', this.epilogue.bind(this)); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Min.prototype = new F; -Min.prototype.constructor = Min; - - -}); // module: reporters/min.js - -require.register("reporters/nyan.js", function(module, exports, require){ -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `Dot`. - */ - -exports = module.exports = NyanCat; - -/** - * Initialize a new `Dot` matrix test reporter. - * - * @param {Runner} runner - * @api public - */ - -function NyanCat(runner) { - Base.call(this, runner); - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , rainbowColors = this.rainbowColors = self.generateColors() - , colorIndex = this.colorIndex = 0 - , numerOfLines = this.numberOfLines = 4 - , trajectories = this.trajectories = [[], [], [], []] - , nyanCatWidth = this.nyanCatWidth = 11 - , trajectoryWidthMax = this.trajectoryWidthMax = (width - nyanCatWidth) - , scoreboardWidth = this.scoreboardWidth = 5 - , tick = this.tick = 0 - , n = 0; - - runner.on('start', function(){ - Base.cursor.hide(); - self.draw(); - }); - - runner.on('pending', function(test){ - self.draw(); - }); - - runner.on('pass', function(test){ - self.draw(); - }); - - runner.on('fail', function(test, err){ - self.draw(); - }); - - runner.on('end', function(){ - Base.cursor.show(); - for (var i = 0; i < self.numberOfLines; i++) write('\n'); - self.epilogue(); - }); -} - -/** - * Draw the nyan cat - * - * @api private - */ - -NyanCat.prototype.draw = function(){ - this.appendRainbow(); - this.drawScoreboard(); - this.drawRainbow(); - this.drawNyanCat(); - this.tick = !this.tick; -}; - -/** - * Draw the "scoreboard" showing the number - * of passes, failures and pending tests. - * - * @api private - */ - -NyanCat.prototype.drawScoreboard = function(){ - var stats = this.stats; - var colors = Base.colors; - - function draw(color, n) { - write(' '); - write('\u001b[' + color + 'm' + n + '\u001b[0m'); - write('\n'); - } - - draw(colors.green, stats.passes); - draw(colors.fail, stats.failures); - draw(colors.pending, stats.pending); - write('\n'); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Append the rainbow. - * - * @api private - */ - -NyanCat.prototype.appendRainbow = function(){ - var segment = this.tick ? '_' : '-'; - var rainbowified = this.rainbowify(segment); - - for (var index = 0; index < this.numberOfLines; index++) { - var trajectory = this.trajectories[index]; - if (trajectory.length >= this.trajectoryWidthMax) trajectory.shift(); - trajectory.push(rainbowified); - } -}; - -/** - * Draw the rainbow. - * - * @api private - */ - -NyanCat.prototype.drawRainbow = function(){ - var self = this; - - this.trajectories.forEach(function(line, index) { - write('\u001b[' + self.scoreboardWidth + 'C'); - write(line.join('')); - write('\n'); - }); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Draw the nyan cat - * - * @api private - */ - -NyanCat.prototype.drawNyanCat = function() { - var self = this; - var startWidth = this.scoreboardWidth + this.trajectories[0].length; - var color = '\u001b[' + startWidth + 'C'; - var padding = ''; - - write(color); - write('_,------,'); - write('\n'); - - write(color); - padding = self.tick ? ' ' : ' '; - write('_|' + padding + '/\\_/\\ '); - write('\n'); - - write(color); - padding = self.tick ? '_' : '__'; - var tail = self.tick ? '~' : '^'; - var face; - write(tail + '|' + padding + this.face() + ' '); - write('\n'); - - write(color); - padding = self.tick ? ' ' : ' '; - write(padding + '"" "" '); - write('\n'); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Draw nyan cat face. - * - * @return {String} - * @api private - */ - -NyanCat.prototype.face = function() { - var stats = this.stats; - if (stats.failures) { - return '( x .x)'; - } else if (stats.pending) { - return '( o .o)'; - } else if(stats.passes) { - return '( ^ .^)'; - } else { - return '( - .-)'; - } -} - -/** - * Move cursor up `n`. - * - * @param {Number} n - * @api private - */ - -NyanCat.prototype.cursorUp = function(n) { - write('\u001b[' + n + 'A'); -}; - -/** - * Move cursor down `n`. - * - * @param {Number} n - * @api private - */ - -NyanCat.prototype.cursorDown = function(n) { - write('\u001b[' + n + 'B'); -}; - -/** - * Generate rainbow colors. - * - * @return {Array} - * @api private - */ - -NyanCat.prototype.generateColors = function(){ - var colors = []; - - for (var i = 0; i < (6 * 7); i++) { - var pi3 = Math.floor(Math.PI / 3); - var n = (i * (1.0 / 6)); - var r = Math.floor(3 * Math.sin(n) + 3); - var g = Math.floor(3 * Math.sin(n + 2 * pi3) + 3); - var b = Math.floor(3 * Math.sin(n + 4 * pi3) + 3); - colors.push(36 * r + 6 * g + b + 16); - } - - return colors; -}; - -/** - * Apply rainbow to the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -NyanCat.prototype.rainbowify = function(str){ - var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length]; - this.colorIndex += 1; - return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m'; -}; - -/** - * Stdout helper. - */ - -function write(string) { - process.stdout.write(string); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -NyanCat.prototype = new F; -NyanCat.prototype.constructor = NyanCat; - - -}); // module: reporters/nyan.js - -require.register("reporters/progress.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Progress`. - */ - -exports = module.exports = Progress; - -/** - * General progress bar color. - */ - -Base.colors.progress = 90; - -/** - * Initialize a new `Progress` bar test reporter. - * - * @param {Runner} runner - * @param {Object} options - * @api public - */ - -function Progress(runner, options) { - Base.call(this, runner); - - var self = this - , options = options || {} - , stats = this.stats - , width = Base.window.width * .50 | 0 - , total = runner.total - , complete = 0 - , max = Math.max; - - // default chars - options.open = options.open || '['; - options.complete = options.complete || '▬'; - options.incomplete = options.incomplete || Base.symbols.dot; - options.close = options.close || ']'; - options.verbose = false; - - // tests started - runner.on('start', function(){ - console.log(); - cursor.hide(); - }); - - // tests complete - runner.on('test end', function(){ - complete++; - var incomplete = total - complete - , percent = complete / total - , n = width * percent | 0 - , i = width - n; - - cursor.CR(); - process.stdout.write('\u001b[J'); - process.stdout.write(color('progress', ' ' + options.open)); - process.stdout.write(Array(n).join(options.complete)); - process.stdout.write(Array(i).join(options.incomplete)); - process.stdout.write(color('progress', options.close)); - if (options.verbose) { - process.stdout.write(color('progress', ' ' + complete + ' of ' + total)); - } - }); - - // tests are complete, output some stats - // and the failures if any - runner.on('end', function(){ - cursor.show(); - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Progress.prototype = new F; -Progress.prototype.constructor = Progress; - - -}); // module: reporters/progress.js - -require.register("reporters/spec.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Spec`. - */ - -exports = module.exports = Spec; - -/** - * Initialize a new `Spec` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function Spec(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , indents = 0 - , n = 0; - - function indent() { - return Array(indents).join(' ') - } - - runner.on('start', function(){ - console.log(); - }); - - runner.on('suite', function(suite){ - ++indents; - console.log(color('suite', '%s%s'), indent(), suite.title); - }); - - runner.on('suite end', function(suite){ - --indents; - if (1 == indents) console.log(); - }); - - runner.on('test', function(test){ - process.stdout.write(indent() + color('pass', ' ◦ ' + test.title + ': ')); - }); - - runner.on('pending', function(test){ - var fmt = indent() + color('pending', ' - %s'); - console.log(fmt, test.title); - }); - - runner.on('pass', function(test){ - if ('fast' == test.speed) { - var fmt = indent() - + color('checkmark', ' ' + Base.symbols.ok) - + color('pass', ' %s '); - cursor.CR(); - console.log(fmt, test.title); - } else { - var fmt = indent() - + color('checkmark', ' ' + Base.symbols.ok) - + color('pass', ' %s ') - + color(test.speed, '(%dms)'); - cursor.CR(); - console.log(fmt, test.title, test.duration); - } - }); - - runner.on('fail', function(test, err){ - cursor.CR(); - console.log(indent() + color('fail', ' %d) %s'), ++n, test.title); - }); - - runner.on('end', self.epilogue.bind(self)); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Spec.prototype = new F; -Spec.prototype.constructor = Spec; - - -}); // module: reporters/spec.js - -require.register("reporters/tap.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `TAP`. - */ - -exports = module.exports = TAP; - -/** - * Initialize a new `TAP` reporter. - * - * @param {Runner} runner - * @api public - */ - -function TAP(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , n = 1 - , passes = 0 - , failures = 0; - - runner.on('start', function(){ - var total = runner.grepTotal(runner.suite); - console.log('%d..%d', 1, total); - }); - - runner.on('test end', function(){ - ++n; - }); - - runner.on('pending', function(test){ - console.log('ok %d %s # SKIP -', n, title(test)); - }); - - runner.on('pass', function(test){ - passes++; - console.log('ok %d %s', n, title(test)); - }); - - runner.on('fail', function(test, err){ - failures++; - console.log('not ok %d %s', n, title(test)); - if (err.stack) console.log(err.stack.replace(/^/gm, ' ')); - }); - - runner.on('end', function(){ - console.log('# tests ' + (passes + failures)); - console.log('# pass ' + passes); - console.log('# fail ' + failures); - }); -} - -/** - * Return a TAP-safe title of `test` - * - * @param {Object} test - * @return {String} - * @api private - */ - -function title(test) { - return test.fullTitle().replace(/#/g, ''); -} - -}); // module: reporters/tap.js - -require.register("reporters/teamcity.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `Teamcity`. - */ - -exports = module.exports = Teamcity; - -/** - * Initialize a new `Teamcity` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Teamcity(runner) { - Base.call(this, runner); - var stats = this.stats; - - runner.on('start', function() { - console.log("##teamcity[testSuiteStarted name='mocha.suite']"); - }); - - runner.on('test', function(test) { - console.log("##teamcity[testStarted name='" + escape(test.fullTitle()) + "']"); - }); - - runner.on('fail', function(test, err) { - console.log("##teamcity[testFailed name='" + escape(test.fullTitle()) + "' message='" + escape(err.message) + "']"); - }); - - runner.on('pending', function(test) { - console.log("##teamcity[testIgnored name='" + escape(test.fullTitle()) + "' message='pending']"); - }); - - runner.on('test end', function(test) { - console.log("##teamcity[testFinished name='" + escape(test.fullTitle()) + "' duration='" + test.duration + "']"); - }); - - runner.on('end', function() { - console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='" + stats.duration + "']"); - }); -} - -/** - * Escape the given `str`. - */ - -function escape(str) { - return str - .replace(/\|/g, "||") - .replace(/\n/g, "|n") - .replace(/\r/g, "|r") - .replace(/\[/g, "|[") - .replace(/\]/g, "|]") - .replace(/\u0085/g, "|x") - .replace(/\u2028/g, "|l") - .replace(/\u2029/g, "|p") - .replace(/'/g, "|'"); -} - -}); // module: reporters/teamcity.js - -require.register("reporters/xunit.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils') - , escape = utils.escape; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Expose `XUnit`. - */ - -exports = module.exports = XUnit; - -/** - * Initialize a new `XUnit` reporter. - * - * @param {Runner} runner - * @api public - */ - -function XUnit(runner) { - Base.call(this, runner); - var stats = this.stats - , tests = [] - , self = this; - - runner.on('pass', function(test){ - tests.push(test); - }); - - runner.on('fail', function(test){ - tests.push(test); - }); - - runner.on('end', function(){ - console.log(tag('testsuite', { - name: 'Mocha Tests' - , tests: stats.tests - , failures: stats.failures - , errors: stats.failures - , skipped: stats.tests - stats.failures - stats.passes - , timestamp: (new Date).toUTCString() - , time: (stats.duration / 1000) || 0 - }, false)); - - tests.forEach(test); - console.log(''); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -XUnit.prototype = new F; -XUnit.prototype.constructor = XUnit; - - -/** - * Output tag for the given `test.` - */ - -function test(test) { - var attrs = { - classname: test.parent.fullTitle() - , name: test.title - , time: test.duration / 1000 - }; - - if ('failed' == test.state) { - var err = test.err; - attrs.message = escape(err.message); - console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack)))); - } else if (test.pending) { - console.log(tag('testcase', attrs, false, tag('skipped', {}, true))); - } else { - console.log(tag('testcase', attrs, true) ); - } -} - -/** - * HTML tag helper. - */ - -function tag(name, attrs, close, content) { - var end = close ? '/>' : '>' - , pairs = [] - , tag; - - for (var key in attrs) { - pairs.push(key + '="' + escape(attrs[key]) + '"'); - } - - tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end; - if (content) tag += content + ''; -} - -}); // module: reporters/xunit.js - -require.register("runnable.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var EventEmitter = require('browser/events').EventEmitter - , debug = require('browser/debug')('mocha:runnable') - , milliseconds = require('./ms'); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Object#toString(). - */ - -var toString = Object.prototype.toString; - -/** - * Expose `Runnable`. - */ - -module.exports = Runnable; - -/** - * Initialize a new `Runnable` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Runnable(title, fn) { - this.title = title; - this.fn = fn; - this.async = fn && fn.length; - this.sync = ! this.async; - this._timeout = 2000; - this._slow = 75; - this.timedOut = false; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -function F(){}; -F.prototype = EventEmitter.prototype; -Runnable.prototype = new F; -Runnable.prototype.constructor = Runnable; - - -/** - * Set & get timeout `ms`. - * - * @param {Number|String} ms - * @return {Runnable|Number} ms or self - * @api private - */ - -Runnable.prototype.timeout = function(ms){ - if (0 == arguments.length) return this._timeout; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._timeout = ms; - if (this.timer) this.resetTimeout(); - return this; -}; - -/** - * Set & get slow `ms`. - * - * @param {Number|String} ms - * @return {Runnable|Number} ms or self - * @api private - */ - -Runnable.prototype.slow = function(ms){ - if (0 === arguments.length) return this._slow; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._slow = ms; - return this; -}; - -/** - * Return the full title generated by recursively - * concatenating the parent's full title. - * - * @return {String} - * @api public - */ - -Runnable.prototype.fullTitle = function(){ - return this.parent.fullTitle() + ' ' + this.title; -}; - -/** - * Clear the timeout. - * - * @api private - */ - -Runnable.prototype.clearTimeout = function(){ - clearTimeout(this.timer); -}; - -/** - * Inspect the runnable void of private properties. - * - * @return {String} - * @api private - */ - -Runnable.prototype.inspect = function(){ - return JSON.stringify(this, function(key, val){ - if ('_' == key[0]) return; - if ('parent' == key) return '#'; - if ('ctx' == key) return '#'; - return val; - }, 2); -}; - -/** - * Reset the timeout. - * - * @api private - */ - -Runnable.prototype.resetTimeout = function(){ - var self = this; - var ms = this.timeout() || 1e9; - - this.clearTimeout(); - this.timer = setTimeout(function(){ - self.callback(new Error('timeout of ' + ms + 'ms exceeded')); - self.timedOut = true; - }, ms); -}; - -/** - * Run the test and invoke `fn(err)`. - * - * @param {Function} fn - * @api private - */ - -Runnable.prototype.run = function(fn){ - var self = this - , ms = this.timeout() - , start = new Date - , ctx = this.ctx - , finished - , emitted; - - if (ctx) ctx.runnable(this); - - // timeout - if (this.async) { - if (ms) { - this.timer = setTimeout(function(){ - done(new Error('timeout of ' + ms + 'ms exceeded')); - self.timedOut = true; - }, ms); - } - } - - // called multiple times - function multiple(err) { - if (emitted) return; - emitted = true; - self.emit('error', err || new Error('done() called multiple times')); - } - - // finished - function done(err) { - if (self.timedOut) return; - if (finished) return multiple(err); - self.clearTimeout(); - self.duration = new Date - start; - finished = true; - fn(err); - } - - // for .resetTimeout() - this.callback = done; - - // async - if (this.async) { - try { - this.fn.call(ctx, function(err){ - if (err instanceof Error || toString.call(err) === "[object Error]") return done(err); - if (null != err) return done(new Error('done() invoked with non-Error: ' + err)); - done(); - }); - } catch (err) { - done(err); - } - return; - } - - if (this.asyncOnly) { - return done(new Error('--async-only option in use without declaring `done()`')); - } - - // sync - try { - if (!this.pending) this.fn.call(ctx); - this.duration = new Date - start; - fn(); - } catch (err) { - fn(err); - } -}; - -}); // module: runnable.js - -require.register("runner.js", function(module, exports, require){ -/** - * Module dependencies. - */ - -var EventEmitter = require('browser/events').EventEmitter - , debug = require('browser/debug')('mocha:runner') - , Test = require('./test') - , utils = require('./utils') - , filter = utils.filter - , keys = utils.keys; - -/** - * Non-enumerable globals. - */ - -var globals = [ - 'setTimeout', - 'clearTimeout', - 'setInterval', - 'clearInterval', - 'XMLHttpRequest', - 'Date' -]; - -/** - * Expose `Runner`. - */ - -module.exports = Runner; - -/** - * Initialize a `Runner` for the given `suite`. - * - * Events: - * - * - `start` execution started - * - `end` execution complete - * - `suite` (suite) test suite execution started - * - `suite end` (suite) all tests (and sub-suites) have finished - * - `test` (test) test execution started - * - `test end` (test) test completed - * - `hook` (hook) hook execution started - * - `hook end` (hook) hook complete - * - `pass` (test) test passed - * - `fail` (test, err) test failed - * - `pending` (test) test pending - * - * @api public - */ - -function Runner(suite) { - var self = this; - this._globals = []; - this.suite = suite; - this.total = suite.total(); - this.failures = 0; - this.on('test end', function(test){ self.checkGlobals(test); }); - this.on('hook end', function(hook){ self.checkGlobals(hook); }); - this.grep(/.*/); - this.globals(this.globalProps().concat(['errno'])); -} - -/** - * Wrapper for setImmediate, process.nextTick, or browser polyfill. - * - * @param {Function} fn - * @api private - */ - -Runner.immediately = global.setImmediate || process.nextTick; - -/** - * Inherit from `EventEmitter.prototype`. - */ - -function F(){}; -F.prototype = EventEmitter.prototype; -Runner.prototype = new F; -Runner.prototype.constructor = Runner; - - -/** - * Run tests with full titles matching `re`. Updates runner.total - * with number of tests matched. - * - * @param {RegExp} re - * @param {Boolean} invert - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.grep = function(re, invert){ - debug('grep %s', re); - this._grep = re; - this._invert = invert; - this.total = this.grepTotal(this.suite); - return this; -}; - -/** - * Returns the number of tests matching the grep search for the - * given suite. - * - * @param {Suite} suite - * @return {Number} - * @api public - */ - -Runner.prototype.grepTotal = function(suite) { - var self = this; - var total = 0; - - suite.eachTest(function(test){ - var match = self._grep.test(test.fullTitle()); - if (self._invert) match = !match; - if (match) total++; - }); - - return total; -}; - -/** - * Return a list of global properties. - * - * @return {Array} - * @api private - */ - -Runner.prototype.globalProps = function() { - var props = utils.keys(global); - - // non-enumerables - for (var i = 0; i < globals.length; ++i) { - if (~utils.indexOf(props, globals[i])) continue; - props.push(globals[i]); - } - - return props; -}; - -/** - * Allow the given `arr` of globals. - * - * @param {Array} arr - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.globals = function(arr){ - if (0 == arguments.length) return this._globals; - debug('globals %j', arr); - utils.forEach(arr, function(arr){ - this._globals.push(arr); - }, this); - return this; -}; - -/** - * Check for global variable leaks. - * - * @api private - */ - -Runner.prototype.checkGlobals = function(test){ - if (this.ignoreLeaks) return; - var ok = this._globals; - var globals = this.globalProps(); - var isNode = process.kill; - var leaks; - - // check length - 2 ('errno' and 'location' globals) - if (isNode && 1 == ok.length - globals.length) return - else if (2 == ok.length - globals.length) return; - - leaks = filterLeaks(ok, globals); - this._globals = this._globals.concat(leaks); - - if (leaks.length > 1) { - this.fail(test, new Error('global leaks detected: ' + leaks.join(', ') + '')); - } else if (leaks.length) { - this.fail(test, new Error('global leak detected: ' + leaks[0])); - } -}; - -/** - * Fail the given `test`. - * - * @param {Test} test - * @param {Error} err - * @api private - */ - -Runner.prototype.fail = function(test, err){ - ++this.failures; - test.state = 'failed'; - - if ('string' == typeof err) { - err = new Error('the string "' + err + '" was thrown, throw an Error :)'); - } - - this.emit('fail', test, err); -}; - -/** - * Fail the given `hook` with `err`. - * - * Hook failures (currently) hard-end due - * to that fact that a failing hook will - * surely cause subsequent tests to fail, - * causing jumbled reporting. - * - * @param {Hook} hook - * @param {Error} err - * @api private - */ - -Runner.prototype.failHook = function(hook, err){ - this.fail(hook, err); - this.emit('end'); -}; - -/** - * Run hook `name` callbacks and then invoke `fn()`. - * - * @param {String} name - * @param {Function} function - * @api private - */ - -Runner.prototype.hook = function(name, fn){ - var suite = this.suite - , hooks = suite['_' + name] - , self = this - , timer; - - function next(i) { - var hook = hooks[i]; - if (!hook) return fn(); - if (self.failures && suite.bail()) return fn(); - self.currentRunnable = hook; - - hook.ctx.currentTest = self.test; - - self.emit('hook', hook); - - hook.on('error', function(err){ - self.failHook(hook, err); - }); - - hook.run(function(err){ - hook.removeAllListeners('error'); - var testError = hook.error(); - if (testError) self.fail(self.test, testError); - if (err) return self.failHook(hook, err); - self.emit('hook end', hook); - delete hook.ctx.currentTest; - next(++i); - }); - } - - Runner.immediately(function(){ - next(0); - }); -}; - -/** - * Run hook `name` for the given array of `suites` - * in order, and callback `fn(err)`. - * - * @param {String} name - * @param {Array} suites - * @param {Function} fn - * @api private - */ - -Runner.prototype.hooks = function(name, suites, fn){ - var self = this - , orig = this.suite; - - function next(suite) { - self.suite = suite; - - if (!suite) { - self.suite = orig; - return fn(); - } - - self.hook(name, function(err){ - if (err) { - self.suite = orig; - return fn(err); - } - - next(suites.pop()); - }); - } - - next(suites.pop()); -}; - -/** - * Run hooks from the top level down. - * - * @param {String} name - * @param {Function} fn - * @api private - */ - -Runner.prototype.hookUp = function(name, fn){ - var suites = [this.suite].concat(this.parents()).reverse(); - this.hooks(name, suites, fn); -}; - -/** - * Run hooks from the bottom up. - * - * @param {String} name - * @param {Function} fn - * @api private - */ - -Runner.prototype.hookDown = function(name, fn){ - var suites = [this.suite].concat(this.parents()); - this.hooks(name, suites, fn); -}; - -/** - * Return an array of parent Suites from - * closest to furthest. - * - * @return {Array} - * @api private - */ - -Runner.prototype.parents = function(){ - var suite = this.suite - , suites = []; - while (suite = suite.parent) suites.push(suite); - return suites; -}; - -/** - * Run the current test and callback `fn(err)`. - * - * @param {Function} fn - * @api private - */ - -Runner.prototype.runTest = function(fn){ - var test = this.test - , self = this; - - if (this.asyncOnly) test.asyncOnly = true; - - try { - test.on('error', function(err){ - self.fail(test, err); - }); - test.run(fn); - } catch (err) { - fn(err); - } -}; - -/** - * Run tests in the given `suite` and invoke - * the callback `fn()` when complete. - * - * @param {Suite} suite - * @param {Function} fn - * @api private - */ - -Runner.prototype.runTests = function(suite, fn){ - var self = this - , tests = suite.tests.slice() - , test; - - function next(err) { - // if we bail after first err - if (self.failures && suite._bail) return fn(); - - // next test - test = tests.shift(); - - // all done - if (!test) return fn(); - - // grep - var match = self._grep.test(test.fullTitle()); - if (self._invert) match = !match; - if (!match) return next(); - - // pending - if (test.pending) { - self.emit('pending', test); - self.emit('test end', test); - return next(); - } - - // execute test and hook(s) - self.emit('test', self.test = test); - self.hookDown('beforeEach', function(){ - self.currentRunnable = self.test; - self.runTest(function(err){ - test = self.test; - - if (err) { - self.fail(test, err); - self.emit('test end', test); - return self.hookUp('afterEach', next); - } - - test.state = 'passed'; - self.emit('pass', test); - self.emit('test end', test); - self.hookUp('afterEach', next); - }); - }); - } - - this.next = next; - next(); -}; - -/** - * Run the given `suite` and invoke the - * callback `fn()` when complete. - * - * @param {Suite} suite - * @param {Function} fn - * @api private - */ - -Runner.prototype.runSuite = function(suite, fn){ - var total = this.grepTotal(suite) - , self = this - , i = 0; - - debug('run suite %s', suite.fullTitle()); - - if (!total) return fn(); - - this.emit('suite', this.suite = suite); - - function next() { - var curr = suite.suites[i++]; - if (!curr) return done(); - self.runSuite(curr, next); - } - - function done() { - self.suite = suite; - self.hook('afterAll', function(){ - self.emit('suite end', suite); - fn(); - }); - } - - this.hook('beforeAll', function(){ - self.runTests(suite, next); - }); -}; - -/** - * Handle uncaught exceptions. - * - * @param {Error} err - * @api private - */ - -Runner.prototype.uncaught = function(err){ - debug('uncaught exception %s', err.message); - var runnable = this.currentRunnable; - if (!runnable || 'failed' == runnable.state) return; - runnable.clearTimeout(); - err.uncaught = true; - this.fail(runnable, err); - - // recover from test - if ('test' == runnable.type) { - this.emit('test end', runnable); - this.hookUp('afterEach', this.next); - return; - } - - // bail on hooks - this.emit('end'); -}; - -/** - * Run the root suite and invoke `fn(failures)` - * on completion. - * - * @param {Function} fn - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.run = function(fn){ - var self = this - , fn = fn || function(){}; - - function uncaught(err){ - self.uncaught(err); - } - - debug('start'); - - // callback - this.on('end', function(){ - debug('end'); - process.removeListener('uncaughtException', uncaught); - fn(self.failures); - }); - - // run suites - this.emit('start'); - this.runSuite(this.suite, function(){ - debug('finished running'); - self.emit('end'); - }); - - // uncaught exception - process.on('uncaughtException', uncaught); - - return this; -}; - -/** - * Filter leaks with the given globals flagged as `ok`. - * - * @param {Array} ok - * @param {Array} globals - * @return {Array} - * @api private - */ - -function filterLeaks(ok, globals) { - return filter(globals, function(key){ - // Firefox and Chrome exposes iframes as index inside the window object - if (/^d+/.test(key)) return false; - var matched = filter(ok, function(ok){ - if (~ok.indexOf('*')) return 0 == key.indexOf(ok.split('*')[0]); - // Opera and IE expose global variables for HTML element IDs (issue #243) - if (/^mocha-/.test(key)) return true; - return key == ok; - }); - return matched.length == 0 && (!global.navigator || 'onerror' !== key); - }); -} - -}); // module: runner.js - -require.register("suite.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var EventEmitter = require('browser/events').EventEmitter - , debug = require('browser/debug')('mocha:suite') - , milliseconds = require('./ms') - , utils = require('./utils') - , Hook = require('./hook'); - -/** - * Expose `Suite`. - */ - -exports = module.exports = Suite; - -/** - * Create a new `Suite` with the given `title` - * and parent `Suite`. When a suite with the - * same title is already present, that suite - * is returned to provide nicer reporter - * and more flexible meta-testing. - * - * @param {Suite} parent - * @param {String} title - * @return {Suite} - * @api public - */ - -exports.create = function(parent, title){ - var suite = new Suite(title, parent.ctx); - suite.parent = parent; - if (parent.pending) suite.pending = true; - title = suite.fullTitle(); - parent.addSuite(suite); - return suite; -}; - -/** - * Initialize a new `Suite` with the given - * `title` and `ctx`. - * - * @param {String} title - * @param {Context} ctx - * @api private - */ - -function Suite(title, ctx) { - this.title = title; - this.ctx = ctx; - this.suites = []; - this.tests = []; - this.pending = false; - this._beforeEach = []; - this._beforeAll = []; - this._afterEach = []; - this._afterAll = []; - this.root = !title; - this._timeout = 2000; - this._slow = 75; - this._bail = false; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -function F(){}; -F.prototype = EventEmitter.prototype; -Suite.prototype = new F; -Suite.prototype.constructor = Suite; - - -/** - * Return a clone of this `Suite`. - * - * @return {Suite} - * @api private - */ - -Suite.prototype.clone = function(){ - var suite = new Suite(this.title); - debug('clone'); - suite.ctx = this.ctx; - suite.timeout(this.timeout()); - suite.slow(this.slow()); - suite.bail(this.bail()); - return suite; -}; - -/** - * Set timeout `ms` or short-hand such as "2s". - * - * @param {Number|String} ms - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.timeout = function(ms){ - if (0 == arguments.length) return this._timeout; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._timeout = parseInt(ms, 10); - return this; -}; - -/** - * Set slow `ms` or short-hand such as "2s". - * - * @param {Number|String} ms - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.slow = function(ms){ - if (0 === arguments.length) return this._slow; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('slow %d', ms); - this._slow = ms; - return this; -}; - -/** - * Sets whether to bail after first error. - * - * @parma {Boolean} bail - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.bail = function(bail){ - if (0 == arguments.length) return this._bail; - debug('bail %s', bail); - this._bail = bail; - return this; -}; - -/** - * Run `fn(test[, done])` before running tests. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.beforeAll = function(fn){ - if (this.pending) return this; - var hook = new Hook('"before all" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._beforeAll.push(hook); - this.emit('beforeAll', hook); - return this; -}; - -/** - * Run `fn(test[, done])` after running tests. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.afterAll = function(fn){ - if (this.pending) return this; - var hook = new Hook('"after all" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._afterAll.push(hook); - this.emit('afterAll', hook); - return this; -}; - -/** - * Run `fn(test[, done])` before each test case. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.beforeEach = function(fn){ - if (this.pending) return this; - var hook = new Hook('"before each" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._beforeEach.push(hook); - this.emit('beforeEach', hook); - return this; -}; - -/** - * Run `fn(test[, done])` after each test case. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.afterEach = function(fn){ - if (this.pending) return this; - var hook = new Hook('"after each" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._afterEach.push(hook); - this.emit('afterEach', hook); - return this; -}; - -/** - * Add a test `suite`. - * - * @param {Suite} suite - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.addSuite = function(suite){ - suite.parent = this; - suite.timeout(this.timeout()); - suite.slow(this.slow()); - suite.bail(this.bail()); - this.suites.push(suite); - this.emit('suite', suite); - return this; -}; - -/** - * Add a `test` to this suite. - * - * @param {Test} test - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.addTest = function(test){ - test.parent = this; - test.timeout(this.timeout()); - test.slow(this.slow()); - test.ctx = this.ctx; - this.tests.push(test); - this.emit('test', test); - return this; -}; - -/** - * Return the full title generated by recursively - * concatenating the parent's full title. - * - * @return {String} - * @api public - */ - -Suite.prototype.fullTitle = function(){ - if (this.parent) { - var full = this.parent.fullTitle(); - if (full) return full + ' ' + this.title; - } - return this.title; -}; - -/** - * Return the total number of tests. - * - * @return {Number} - * @api public - */ - -Suite.prototype.total = function(){ - return utils.reduce(this.suites, function(sum, suite){ - return sum + suite.total(); - }, 0) + this.tests.length; -}; - -/** - * Iterates through each suite recursively to find - * all tests. Applies a function in the format - * `fn(test)`. - * - * @param {Function} fn - * @return {Suite} - * @api private - */ - -Suite.prototype.eachTest = function(fn){ - utils.forEach(this.tests, fn); - utils.forEach(this.suites, function(suite){ - suite.eachTest(fn); - }); - return this; -}; - -}); // module: suite.js - -require.register("test.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Runnable = require('./runnable'); - -/** - * Expose `Test`. - */ - -module.exports = Test; - -/** - * Initialize a new `Test` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Test(title, fn) { - Runnable.call(this, title, fn); - this.pending = !fn; - this.type = 'test'; -} - -/** - * Inherit from `Runnable.prototype`. - */ - -function F(){}; -F.prototype = Runnable.prototype; -Test.prototype = new F; -Test.prototype.constructor = Test; - - -}); // module: test.js - -require.register("utils.js", function(module, exports, require){ -/** - * Module dependencies. - */ - -var fs = require('browser/fs') - , path = require('browser/path') - , join = path.join - , debug = require('browser/debug')('mocha:watch'); - -/** - * Ignored directories. - */ - -var ignore = ['node_modules', '.git']; - -/** - * Escape special characters in the given string of html. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html){ - return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>'); -}; - -/** - * Array#forEach (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @param {Object} scope - * @api private - */ - -exports.forEach = function(arr, fn, scope){ - for (var i = 0, l = arr.length; i < l; i++) - fn.call(scope, arr[i], i); -}; - -/** - * Array#indexOf (<=IE8) - * - * @parma {Array} arr - * @param {Object} obj to find index of - * @param {Number} start - * @api private - */ - -exports.indexOf = function(arr, obj, start){ - for (var i = start || 0, l = arr.length; i < l; i++) { - if (arr[i] === obj) - return i; - } - return -1; -}; - -/** - * Array#reduce (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @param {Object} initial value - * @api private - */ - -exports.reduce = function(arr, fn, val){ - var rval = val; - - for (var i = 0, l = arr.length; i < l; i++) { - rval = fn(rval, arr[i], i, arr); - } - - return rval; -}; - -/** - * Array#filter (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @api private - */ - -exports.filter = function(arr, fn){ - var ret = []; - - for (var i = 0, l = arr.length; i < l; i++) { - var val = arr[i]; - if (fn(val, i, arr)) ret.push(val); - } - - return ret; -}; - -/** - * Object.keys (<=IE8) - * - * @param {Object} obj - * @return {Array} keys - * @api private - */ - -exports.keys = Object.keys || function(obj) { - var keys = [] - , has = Object.prototype.hasOwnProperty // for `window` on <=IE8 - - for (var key in obj) { - if (has.call(obj, key)) { - keys.push(key); - } - } - - return keys; -}; - -/** - * Watch the given `files` for changes - * and invoke `fn(file)` on modification. - * - * @param {Array} files - * @param {Function} fn - * @api private - */ - -exports.watch = function(files, fn){ - var options = { interval: 100 }; - files.forEach(function(file){ - debug('file %s', file); - fs.watchFile(file, options, function(curr, prev){ - if (prev.mtime < curr.mtime) fn(file); - }); - }); -}; - -/** - * Ignored files. - */ - -function ignored(path){ - return !~ignore.indexOf(path); -} - -/** - * Lookup files in the given `dir`. - * - * @return {Array} - * @api private - */ - -exports.files = function(dir, ret){ - ret = ret || []; - - fs.readdirSync(dir) - .filter(ignored) - .forEach(function(path){ - path = join(dir, path); - if (fs.statSync(path).isDirectory()) { - exports.files(path, ret); - } else if (path.match(/\.(js|coffee|litcoffee|coffee.md)$/)) { - ret.push(path); - } - }); - - return ret; -}; - -/** - * Compute a slug from the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.slug = function(str){ - return str - .toLowerCase() - .replace(/ +/g, '-') - .replace(/[^-\w]/g, ''); -}; - -/** - * Strip the function definition from `str`, - * and re-indent for pre whitespace. - */ - -exports.clean = function(str) { - str = str - .replace(/^function *\(.*\) *{/, '') - .replace(/\s+\}$/, ''); - - var whitespace = str.match(/^\n?(\s*)/)[1] - , re = new RegExp('^' + whitespace, 'gm'); - - str = str.replace(re, ''); - - return exports.trim(str); -}; - -/** - * Escape regular expression characters in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.escapeRegexp = function(str){ - return str.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); -}; - -/** - * Trim the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.trim = function(str){ - return str.replace(/^\s+|\s+$/g, ''); -}; - -/** - * Parse the given `qs`. - * - * @param {String} qs - * @return {Object} - * @api private - */ - -exports.parseQuery = function(qs){ - return exports.reduce(qs.replace('?', '').split('&'), function(obj, pair){ - var i = pair.indexOf('=') - , key = pair.slice(0, i) - , val = pair.slice(++i); - - obj[key] = decodeURIComponent(val); - return obj; - }, {}); -}; - -/** - * Highlight the given string of `js`. - * - * @param {String} js - * @return {String} - * @api private - */ - -function highlight(js) { - return js - .replace(//g, '>') - .replace(/\/\/(.*)/gm, '//$1') - .replace(/('.*?')/gm, '$1') - .replace(/(\d+\.\d+)/gm, '$1') - .replace(/(\d+)/gm, '$1') - .replace(/\bnew *(\w+)/gm, 'new $1') - .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '$1') -} - -/** - * Highlight the contents of tag `name`. - * - * @param {String} name - * @api private - */ - -exports.highlightTags = function(name) { - var code = document.getElementsByTagName(name); - for (var i = 0, len = code.length; i < len; ++i) { - code[i].innerHTML = highlight(code[i].innerHTML); - } -}; - -}); // module: utils.js -// The global object is "self" in Web Workers. -global = (function() { return this; })(); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date; -var setTimeout = global.setTimeout; -var setInterval = global.setInterval; -var clearTimeout = global.clearTimeout; -var clearInterval = global.clearInterval; - -/** - * Node shims. - * - * These are meant only to allow - * mocha.js to run untouched, not - * to allow running node code in - * the browser. - */ - -var process = {}; -process.exit = function(status){}; -process.stdout = {}; - -/** - * Remove uncaughtException listener. - */ - -process.removeListener = function(e){ - if ('uncaughtException' == e) { - global.onerror = function() {}; - } -}; - -/** - * Implements uncaughtException listener. - */ - -process.on = function(e, fn){ - if ('uncaughtException' == e) { - global.onerror = function(err, url, line){ - fn(new Error(err + ' (' + url + ':' + line + ')')); - }; - } -}; - -/** - * Expose mocha. - */ - -var Mocha = global.Mocha = require('mocha'), - mocha = global.mocha = new Mocha({ reporter: 'html' }); - -var immediateQueue = [] - , immediateTimeout; - -function timeslice() { - var immediateStart = new Date().getTime(); - while (immediateQueue.length && (new Date().getTime() - immediateStart) < 100) { - immediateQueue.shift()(); - } - if (immediateQueue.length) { - immediateTimeout = setTimeout(timeslice, 0); - } else { - immediateTimeout = null; - } -} - -/** - * High-performance override of Runner.immediately. - */ - -Mocha.Runner.immediately = function(callback) { - immediateQueue.push(callback); - if (!immediateTimeout) { - immediateTimeout = setTimeout(timeslice, 0); - } -}; - -/** - * Override ui to ensure that the ui functions are initialized. - * Normally this would happen in Mocha.prototype.loadFiles. - */ - -mocha.ui = function(ui){ - Mocha.prototype.ui.call(this, ui); - this.suite.emit('pre-require', global, null, this); - return this; -}; - -/** - * Setup mocha with the given setting options. - */ - -mocha.setup = function(opts){ - if ('string' == typeof opts) opts = { ui: opts }; - for (var opt in opts) this[opt](opts[opt]); - return this; -}; - -/** - * Run mocha, returning the Runner. - */ - -mocha.run = function(fn){ - var options = mocha.options; - mocha.globals('location'); - - var query = Mocha.utils.parseQuery(global.location.search || ''); - if (query.grep) mocha.grep(query.grep); - if (query.invert) mocha.invert(); - - return Mocha.prototype.run.call(mocha, function(){ - // The DOM Document is not available in Web Workers. - if (global.document) { - Mocha.utils.highlightTags('code'); - } - if (fn) fn(); - }); -}; - -/** - * Expose the process shim. - */ - -Mocha.process = process; -})(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/.bin/jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/.bin/jade deleted file mode 120000 index 571fae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/.bin/jade +++ /dev/null @@ -1 +0,0 @@ -../jade/bin/jade \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/History.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/History.md deleted file mode 100644 index 4961d2e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/History.md +++ /dev/null @@ -1,107 +0,0 @@ - -0.6.1 / 2012-06-01 -================== - - * Added: append (yes or no) on confirmation - * Added: allow node.js v0.7.x - -0.6.0 / 2012-04-10 -================== - - * Added `.prompt(obj, callback)` support. Closes #49 - * Added default support to .choose(). Closes #41 - * Fixed the choice example - -0.5.1 / 2011-12-20 -================== - - * Fixed `password()` for recent nodes. Closes #36 - -0.5.0 / 2011-12-04 -================== - - * Added sub-command option support [itay] - -0.4.3 / 2011-12-04 -================== - - * Fixed custom help ordering. Closes #32 - -0.4.2 / 2011-11-24 -================== - - * Added travis support - * Fixed: line-buffered input automatically trimmed. Closes #31 - -0.4.1 / 2011-11-18 -================== - - * Removed listening for "close" on --help - -0.4.0 / 2011-11-15 -================== - - * Added support for `--`. Closes #24 - -0.3.3 / 2011-11-14 -================== - - * Fixed: wait for close event when writing help info [Jerry Hamlet] - -0.3.2 / 2011-11-01 -================== - - * Fixed long flag definitions with values [felixge] - -0.3.1 / 2011-10-31 -================== - - * Changed `--version` short flag to `-V` from `-v` - * Changed `.version()` so it's configurable [felixge] - -0.3.0 / 2011-10-31 -================== - - * Added support for long flags only. Closes #18 - -0.2.1 / 2011-10-24 -================== - - * "node": ">= 0.4.x < 0.7.0". Closes #20 - -0.2.0 / 2011-09-26 -================== - - * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] - -0.1.0 / 2011-08-24 -================== - - * Added support for custom `--help` output - -0.0.5 / 2011-08-18 -================== - - * Changed: when the user enters nothing prompt for password again - * Fixed issue with passwords beginning with numbers [NuckChorris] - -0.0.4 / 2011-08-15 -================== - - * Fixed `Commander#args` - -0.0.3 / 2011-08-15 -================== - - * Added default option value support - -0.0.2 / 2011-08-15 -================== - - * Added mask support to `Command#password(str[, mask], fn)` - * Added `Command#password(str, fn)` - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/Makefile deleted file mode 100644 index 0074625..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -TESTS = $(shell find test/test.*.js) - -test: - @./test/run $(TESTS) - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/Readme.md deleted file mode 100644 index b8328c3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/Readme.md +++ /dev/null @@ -1,262 +0,0 @@ -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineappe'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -V, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineappe - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -V, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .prompt(msg, fn) - - Single-line prompt: - -```js -program.prompt('name: ', function(name){ - console.log('hi %s', name); -}); -``` - - Multi-line prompt: - -```js -program.prompt('description:', function(name){ - console.log('hi %s', name); -}); -``` - - Coercion: - -```js -program.prompt('Age: ', Number, function(age){ - console.log('age: %j', age); -}); -``` - -```js -program.prompt('Birthdate: ', Date, function(date){ - console.log('date: %s', date); -}); -``` - -## .password(msg[, mask], fn) - -Prompt for password without echoing: - -```js -program.password('Password: ', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -Prompt for password with mask char "*": - -```js -program.password('Password: ', '*', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -## .confirm(msg, fn) - - Confirm with the given `msg`: - -```js -program.confirm('continue? ', function(ok){ - console.log(' got %j', ok); -}); -``` - -## .choose(list, fn) - - Let the user choose from a `list`: - -```js -var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - -console.log('Choose the coolest pet:'); -program.choose(list, function(i){ - console.log('you chose %d "%s"', i, list[i]); -}); -``` - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/index.js deleted file mode 100644 index 06ec1e4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/commander'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/lib/commander.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/lib/commander.js deleted file mode 100644 index 5ba87eb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/lib/commander.js +++ /dev/null @@ -1,1026 +0,0 @@ - -/*! - * commander - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , path = require('path') - , tty = require('tty') - , basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this.args = []; - this.name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - return cmd; -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self.args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self.args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this.name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - self.args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self.args.length) { - args[self.args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // store raw args - this.rawArgs = argv; - - // guess name - if (!this.name) this.name = basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - this.args = parsed.args; - return this.parseArgs(this.args, parsed.unknown); -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - if ('-' == arg[0]) return this.optionMissingArgument(option, arg); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || '-' == arg[0]) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this.args.length ? ' ' + args : ''); - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return cmd.name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args - + (cmd.description() - ? '\n' + cmd.description() - : ''); - }).join('\n\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this.name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Prompt for a `Number`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForNumber = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseNumber(val){ - val = Number(val); - if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber); - fn(val); - }); -}; - -/** - * Prompt for a `Date`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForDate = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseDate(val){ - val = new Date(val); - if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate); - fn(val); - }); -}; - -/** - * Single-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptSingleLine = function(str, fn){ - if ('function' == typeof arguments[2]) { - return this['promptFor' + (fn.name || fn)](str, arguments[2]); - } - - process.stdout.write(str); - process.stdin.setEncoding('utf8'); - process.stdin.once('data', function(val){ - fn(val.trim()); - }).resume(); -}; - -/** - * Multi-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptMultiLine = function(str, fn){ - var buf = []; - console.log(str); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(val){ - if ('\n' == val || '\r\n' == val) { - process.stdin.removeAllListeners('data'); - fn(buf.join('\n')); - } else { - buf.push(val.trimRight()); - } - }).resume(); -}; - -/** - * Prompt `str` and callback `fn(val)` - * - * Commander supports single-line and multi-line prompts. - * To issue a single-line prompt simply add white-space - * to the end of `str`, something like "name: ", whereas - * for a multi-line prompt omit this "description:". - * - * - * Examples: - * - * program.prompt('Username: ', function(name){ - * console.log('hi %s', name); - * }); - * - * program.prompt('Description:', function(desc){ - * console.log('description was "%s"', desc.trim()); - * }); - * - * @param {String|Object} str - * @param {Function} fn - * @api public - */ - -Command.prototype.prompt = function(str, fn){ - var self = this; - - if ('string' == typeof str) { - if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments); - this.promptMultiLine(str, fn); - } else { - var keys = Object.keys(str) - , obj = {}; - - function next() { - var key = keys.shift() - , label = str[key]; - - if (!key) return fn(obj); - self.prompt(label, function(val){ - obj[key] = val; - next(); - }); - } - - next(); - } -}; - -/** - * Prompt for password with `str`, `mask` char and callback `fn(val)`. - * - * The mask string defaults to '', aka no output is - * written while typing, you may want to use "*" etc. - * - * Examples: - * - * program.password('Password: ', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * program.password('Password: ', '*', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {String} mask - * @param {Function} fn - * @api public - */ - -Command.prototype.password = function(str, mask, fn){ - var self = this - , buf = ''; - - // default mask - if ('function' == typeof mask) { - fn = mask; - mask = ''; - } - - process.stdin.resume(); - tty.setRawMode(true); - process.stdout.write(str); - - // keypress - process.stdin.on('keypress', function(c, key){ - if (key && 'enter' == key.name) { - console.log(); - process.stdin.removeAllListeners('keypress'); - tty.setRawMode(false); - if (!buf.trim().length) return self.password(str, mask, fn); - fn(buf); - return; - } - - if (key && key.ctrl && 'c' == key.name) { - console.log('%s', buf); - process.exit(); - } - - process.stdout.write(mask); - buf += c; - }).resume(); -}; - -/** - * Confirmation prompt with `str` and callback `fn(bool)` - * - * Examples: - * - * program.confirm('continue? ', function(ok){ - * console.log(' got %j', ok); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - - -Command.prototype.confirm = function(str, fn, verbose){ - var self = this; - this.prompt(str, function(ok){ - if (!ok.trim()) { - if (!verbose) str += '(yes or no) '; - return self.confirm(str, fn, true); - } - fn(parseBool(ok)); - }); -}; - -/** - * Choice prompt with `list` of items and callback `fn(index, item)` - * - * Examples: - * - * var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - * - * console.log('Choose the coolest pet:'); - * program.choose(list, function(i){ - * console.log('you chose %d "%s"', i, list[i]); - * process.stdin.destroy(); - * }); - * - * @param {Array} list - * @param {Number|Function} index or fn - * @param {Function} fn - * @api public - */ - -Command.prototype.choose = function(list, index, fn){ - var self = this - , hasDefault = 'number' == typeof index; - - if (!hasDefault) { - fn = index; - index = null; - } - - list.forEach(function(item, i){ - if (hasDefault && i == index) { - console.log('* %d) %s', i + 1, item); - } else { - console.log(' %d) %s', i + 1, item); - } - }); - - function again() { - self.prompt(' : ', function(val){ - val = parseInt(val, 10) - 1; - if (hasDefault && isNaN(val)) val = index; - - if (null == list[val]) { - again(); - } else { - fn(val, list[val]); - } - }); - } - - again(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Parse a boolean `str`. - * - * @param {String} str - * @return {Boolean} - * @api private - */ - -function parseBool(str) { - return /^y|yes|ok|true$/i.test(str); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - process.stdout.write(cmd.helpInformation()); - cmd.emit('--help'); - process.exit(0); - } - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/package.json deleted file mode 100644 index 6f9d567..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/commander/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "commander", - "version": "0.6.1", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt", - "stdin" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/commander.js.git" - }, - "dependencies": {}, - "devDependencies": { - "should": ">= 0.0.1" - }, - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.4.x" - }, - "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineappe');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineappe\n -b, --bbq Add bbq sauce\n -c, --cheese Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] ')\n .option('-i, --integer ', 'An integer argument', parseInt)\n .option('-f, --float ', 'A float argument', parseFloat)\n .option('-r, --range ..', 'A range', range)\n .option('-l, --list ', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .prompt(msg, fn)\n\n Single-line prompt:\n\n```js\nprogram.prompt('name: ', function(name){\n console.log('hi %s', name);\n});\n```\n\n Multi-line prompt:\n\n```js\nprogram.prompt('description:', function(name){\n console.log('hi %s', name);\n});\n```\n\n Coercion:\n\n```js\nprogram.prompt('Age: ', Number, function(age){\n console.log('age: %j', age);\n});\n```\n\n```js\nprogram.prompt('Birthdate: ', Date, function(date){\n console.log('date: %s', date);\n});\n```\n\n## .password(msg[, mask], fn)\n\nPrompt for password without echoing:\n\n```js\nprogram.password('Password: ', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\nPrompt for password with mask char \"*\":\n\n```js\nprogram.password('Password: ', '*', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\n## .confirm(msg, fn)\n\n Confirm with the given `msg`:\n\n```js\nprogram.confirm('continue? ', function(ok){\n console.log(' got %j', ok);\n});\n```\n\n## .choose(list, fn)\n\n Let the user choose from a `list`:\n\n```js\nvar list = ['tobi', 'loki', 'jane', 'manny', 'luna'];\n\nconsole.log('Choose the coolest pet:');\nprogram.choose(list, function(i){\n console.log('you chose %d \"%s\"', i, list[i]);\n});\n```\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 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/commander.js/issues" - }, - "_id": "commander@0.6.1", - "_from": "commander@0.6.1" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/History.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/History.md deleted file mode 100644 index f023269..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/History.md +++ /dev/null @@ -1,62 +0,0 @@ - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/Readme.md deleted file mode 100644 index 15ee501..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/Readme.md +++ /dev/null @@ -1,115 +0,0 @@ - -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -``` -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - a('doing some work'); -}, 1200); -``` - -## License - -(The MIT License) - -Copyright (c) 2011 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/component.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/component.json deleted file mode 100644 index 4ad0971..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/component.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "0.7.2", - "keywords": ["debug", "log", "debugger"], - "scripts": ["index.js", "debug.js"], - "dependencies": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/debug.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/debug.js deleted file mode 100644 index e47ba5b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/debug.js +++ /dev/null @@ -1,124 +0,0 @@ - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - if (!debug.enabled(name)) return function(){}; - - return function(fmt){ - var curr = new Date; - var ms = curr - (debug[name] || curr); - debug[name] = curr; - - fmt = name - + ' ' - + fmt - + ' +' + debug.humanize(ms); - - // This hackery is required for IE8 - // where `console.log` doesn't have 'apply' - window.console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); - } -} - -/** - * The currently active debug mode names. - */ - -debug.names = []; -debug.skips = []; - -/** - * Enables a debug mode by name. This can include modes - * separated by a colon and wildcards. - * - * @param {String} name - * @api public - */ - -debug.enable = function(name) { - try { - localStorage.debug = name; - } catch(e){} - - var split = (name || '').split(/[\s,]+/) - , len = split.length; - - for (var i = 0; i < len; i++) { - name = split[i].replace('*', '.*?'); - if (name[0] === '-') { - debug.skips.push(new RegExp('^' + name.substr(1) + '$')); - } - else { - debug.names.push(new RegExp('^' + name + '$')); - } - } -}; - -/** - * Disable debug output. - * - * @api public - */ - -debug.disable = function(){ - debug.enable(''); -}; - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -debug.humanize = function(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -}; - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -debug.enabled = function(name) { - for (var i = 0, len = debug.skips.length; i < len; i++) { - if (debug.skips[i].test(name)) { - return false; - } - } - for (var i = 0, len = debug.names.length; i < len; i++) { - if (debug.names[i].test(name)) { - return true; - } - } - return false; -}; - -// persist - -if (window.localStorage) debug.enable(localStorage.debug); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/app.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/app.js deleted file mode 100644 index 05374d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/app.js +++ /dev/null @@ -1,19 +0,0 @@ - -var debug = require('../')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/browser.html b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/browser.html deleted file mode 100644 index 7510eee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/browser.html +++ /dev/null @@ -1,24 +0,0 @@ - - - debug() - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/wildcards.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/wildcards.js deleted file mode 100644 index 1fdac20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/wildcards.js +++ /dev/null @@ -1,10 +0,0 @@ - -var debug = { - foo: require('../')('test:foo'), - bar: require('../')('test:bar'), - baz: require('../')('test:baz') -}; - -debug.foo('foo') -debug.bar('bar') -debug.baz('baz') \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/worker.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/worker.js deleted file mode 100644 index 7f6d288..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/example/worker.js +++ /dev/null @@ -1,22 +0,0 @@ - -// DEBUG=* node example/worker -// DEBUG=worker:* node example/worker -// DEBUG=worker:a node example/worker -// DEBUG=worker:b node example/worker - -var a = require('../')('worker:a') - , b = require('../')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/index.js deleted file mode 100644 index e02c13b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/index.js +++ /dev/null @@ -1,5 +0,0 @@ -if ('undefined' == typeof window) { - module.exports = require('./lib/debug'); -} else { - module.exports = require('./debug'); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/lib/debug.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/lib/debug.js deleted file mode 100644 index 0b07aa1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/lib/debug.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Module dependencies. - */ - -var tty = require('tty'); - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Enabled debuggers. - */ - -var names = [] - , skips = []; - -(process.env.DEBUG || '') - .split(/[\s,]+/) - .forEach(function(name){ - name = name.replace('*', '.*?'); - if (name[0] === '-') { - skips.push(new RegExp('^' + name.substr(1) + '$')); - } else { - names.push(new RegExp('^' + name + '$')); - } - }); - -/** - * Colors. - */ - -var colors = [6, 2, 3, 4, 5, 1]; - -/** - * Previous debug() call. - */ - -var prev = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Is stdout a TTY? Colored output is disabled when `true`. - */ - -var isatty = tty.isatty(2); - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function color() { - return colors[prevColor++ % colors.length]; -} - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -function humanize(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -} - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - function disabled(){} - disabled.enabled = false; - - var match = skips.some(function(re){ - return re.test(name); - }); - - if (match) return disabled; - - match = names.some(function(re){ - return re.test(name); - }); - - if (!match) return disabled; - var c = color(); - - function colored(fmt) { - var curr = new Date; - var ms = curr - (prev[name] || curr); - prev[name] = curr; - - fmt = ' \u001b[9' + c + 'm' + name + ' ' - + '\u001b[3' + c + 'm\u001b[90m' - + fmt + '\u001b[3' + c + 'm' - + ' +' + humanize(ms) + '\u001b[0m'; - - console.error.apply(this, arguments); - } - - function plain(fmt) { - fmt = new Date().toUTCString() - + ' ' + name + ' ' + fmt; - console.error.apply(this, arguments); - } - - colored.enabled = plain.enabled = true; - - return isatty || process.env.DEBUG_COLORS - ? colored - : plain; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/package.json deleted file mode 100644 index 82a663f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/debug/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "debug", - "version": "0.7.2", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*" - }, - "main": "lib/debug.js", - "browserify": "debug.js", - "engines": { - "node": "*" - }, - "component": { - "scripts": { - "debug/index.js": "index.js", - "debug/debug.js": "debug.js" - } - }, - "readme": "\n# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n \nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n \n ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\". \n\n## Wildcards\n\n The \"*\" character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. \n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n a('doing some work');\n}, 1200);\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 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/debug/issues" - }, - "_id": "debug@0.7.2", - "_from": "debug@*", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/LICENSE deleted file mode 100644 index c135dcf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Software License Agreement (BSD License) - -Copyright (c) 2009-2011, Kevin Decker - -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of Kevin Decker nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/README.md deleted file mode 100644 index 2ed7ee1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# jsdiff - -A javascript text differencing implementation. - -Based on the algorithm proposed in -["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927). - -## Installation - - npm install diff - -or - - git clone git://github.com/kpdecker/jsdiff.git - -## API - -* JsDiff.diffChars(oldStr, newStr) - Diffs two blocks of text, comparing character by character. - - Returns a list of change objects (See below). - -* JsDiff.diffWords(oldStr, newStr) - Diffs two blocks of text, comparing word by word. - - Returns a list of change objects (See below). - -* JsDiff.diffLines(oldStr, newStr) - Diffs two blocks of text, comparing line by line. - - Returns a list of change objects (See below). - -* JsDiff.diffCss(oldStr, newStr) - Diffs two blocks of text, comparing CSS tokens. - - Returns a list of change objects (See below). - -* JsDiff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader) - Creates a unified diff patch. - - Parameters: - * fileName : String to be output in the filename sections of the patch - * oldStr : Original string value - * newStr : New string value - * oldHeader : Additional information to include in the old file header - * newHeader : Additional information to include in thew new file header - -* convertChangesToXML(changes) - Converts a list of changes to a serialized XML format - -### Change Objects -Many of the methods above return change objects. These objects are consist of the following fields: - -* value: Text content -* added: True if the value was inserted into the new string -* removed: True of the value was removed from the old string - -Note that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner. - -## [Example](http://kpdecker.github.com/jsdiff) - -## License - -Software License Agreement (BSD License) - -Copyright (c) 2009-2011, Kevin Decker kpdecker@gmail.com - -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of Kevin Decker nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/diff.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/diff.js deleted file mode 100644 index 6b7ce24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/diff.js +++ /dev/null @@ -1,287 +0,0 @@ -/* See license.txt for terms of usage */ - -/* - * Text diff implementation. - * - * This library supports the following APIS: - * JsDiff.diffChars: Character by character diff - * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace - * JsDiff.diffLines: Line based diff - * - * JsDiff.diffCss: Diff targeted at CSS content - * - * These methods are based on the implementation proposed in - * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 - */ -var JsDiff = (function() { - function clonePath(path) { - return { newPos: path.newPos, components: path.components.slice(0) }; - } - function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - } - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, "&"); - n = n.replace(//g, ">"); - n = n.replace(/"/g, """); - - return n; - } - - - var fbDiff = function(ignoreWhitespace) { - this.ignoreWhitespace = ignoreWhitespace; - }; - fbDiff.prototype = { - diff: function(oldString, newString) { - // Handle the identity case (this is due to unrolling editLength == 0 - if (newString == oldString) { - return [{ value: newString }]; - } - if (!newString) { - return [{ value: oldString, removed: true }]; - } - if (!oldString) { - return [{ value: newString, added: true }]; - } - - newString = this.tokenize(newString); - oldString = this.tokenize(oldString); - - var newLen = newString.length, oldLen = oldString.length; - var maxEditLength = newLen + oldLen; - var bestPath = [{ newPos: -1, components: [] }]; - - // Seed editLength = 0 - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) { - return bestPath[0].components; - } - - for (var editLength = 1; editLength <= maxEditLength; editLength++) { - for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) { - var basePath; - var addPath = bestPath[diagonalPath-1], - removePath = bestPath[diagonalPath+1]; - oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath-1] = undefined; - } - - var canAdd = addPath && addPath.newPos+1 < newLen; - var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = undefined; - continue; - } - - // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { - basePath = clonePath(removePath); - this.pushComponent(basePath.components, oldString[oldPos], undefined, true); - } else { - basePath = clonePath(addPath); - basePath.newPos++; - this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined); - } - - var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath); - - if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) { - return basePath.components; - } else { - bestPath[diagonalPath] = basePath; - } - } - } - }, - - pushComponent: function(components, value, added, removed) { - var last = components[components.length-1]; - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length-1] = - {value: this.join(last.value, value), added: added, removed: removed }; - } else { - components.push({value: value, added: added, removed: removed }); - } - }, - extractCommon: function(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath; - while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) { - newPos++; - oldPos++; - - this.pushComponent(basePath.components, newString[newPos], undefined, undefined); - } - basePath.newPos = newPos; - return oldPos; - }, - - equals: function(left, right) { - var reWhitespace = /\S/; - if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) { - return true; - } else { - return left == right; - } - }, - join: function(left, right) { - return left + right; - }, - tokenize: function(value) { - return value; - } - }; - - var CharDiff = new fbDiff(); - - var WordDiff = new fbDiff(true); - WordDiff.tokenize = function(value) { - return removeEmpty(value.split(/(\s+|\b)/)); - }; - - var CssDiff = new fbDiff(true); - CssDiff.tokenize = function(value) { - return removeEmpty(value.split(/([{}:;,]|\s+)/)); - }; - - var LineDiff = new fbDiff(); - LineDiff.tokenize = function(value) { - return value.split(/^/m); - }; - - return { - diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); }, - diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); }, - diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); }, - - diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); }, - - createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) { - var ret = []; - - ret.push("Index: " + fileName); - ret.push("==================================================================="); - ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader)); - ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader)); - - var diff = LineDiff.diff(oldStr, newStr); - if (!diff[diff.length-1].value) { - diff.pop(); // Remove trailing newline add - } - diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function(entry) { return ' ' + entry; }); - } - function eofNL(curRange, i, current) { - var last = diff[diff.length-2], - isLast = i === diff.length-2, - isLastOfType = i === diff.length-3 && (current.added === !last.added || current.removed === !last.removed); - - // Figure out if this is the last line for the given file and missing NL - if (!/\n$/.test(current.value) && (isLast || isLastOfType)) { - curRange.push('\\ No newline at end of file'); - } - } - - var oldRangeStart = 0, newRangeStart = 0, curRange = [], - oldLine = 1, newLine = 1; - for (var i = 0; i < diff.length; i++) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - - if (current.added || current.removed) { - if (!oldRangeStart) { - var prev = diff[i-1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = contextLines(prev.lines.slice(-4)); - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?"+":"-") + entry; })); - eofNL(curRange, i, current); - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= 8 && i < diff.length-2) { - // Overlapping - curRange.push.apply(curRange, contextLines(lines)); - } else { - // end the range and output - var contextSize = Math.min(lines.length, 4); - ret.push( - "@@ -" + oldRangeStart + "," + (oldLine-oldRangeStart+contextSize) - + " +" + newRangeStart + "," + (newLine-newRangeStart+contextSize) - + " @@"); - ret.push.apply(ret, curRange); - ret.push.apply(ret, contextLines(lines.slice(0, contextSize))); - if (lines.length <= 4) { - eofNL(ret, i, current); - } - - oldRangeStart = 0; newRangeStart = 0; curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - } - - return ret.join('\n') + '\n'; - }, - - convertChangesToXML: function(changes){ - var ret = []; - for ( var i = 0; i < changes.length; i++) { - var change = changes[i]; - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - } - return ret.join(""); - } - }; -})(); - -if (typeof module !== "undefined") { - module.exports = JsDiff; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/index.html b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/index.html deleted file mode 100644 index ecb22fa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Diff - - - - -
        -

        Diff

        - - - -
        - -
        github.com/kpdecker/jsdiff - - - - - - - -
        restaurantaura
        - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/package.json deleted file mode 100644 index dd9fc33..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "diff", - "version": "1.0.2", - "description": "A javascript text diff implementation.", - "keywords": [ - "diff", - "javascript" - ], - "maintainers": [ - { - "name": "Kevin Decker", - "email": "kpdecker@gmail.com", - "url": "http://incaseofstairs.com" - } - ], - "bugs": { - "url": "http://github.com/kpdecker/jsdiff/issues", - "email": "kpdecker@gmail.com" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/kpdecker/jsdiff/blob/master/LICENSE" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/kpdecker/jsdiff.git" - }, - "engines": { - "node": ">=0.3.1" - }, - "main": "./diff", - "scripts": { - "test": "expresso test/*" - }, - "dependencies": {}, - "devDependencies": {}, - "readme": "# jsdiff\n\nA javascript text differencing implementation.\n\nBased on the algorithm proposed in\n[\"An O(ND) Difference Algorithm and its Variations\" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927).\n\n## Installation\n\n npm install diff\n\nor\n\n git clone git://github.com/kpdecker/jsdiff.git\n\n## API\n\n* JsDiff.diffChars(oldStr, newStr)\n Diffs two blocks of text, comparing character by character.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffWords(oldStr, newStr)\n Diffs two blocks of text, comparing word by word.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffLines(oldStr, newStr)\n Diffs two blocks of text, comparing line by line.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffCss(oldStr, newStr)\n Diffs two blocks of text, comparing CSS tokens.\n\n Returns a list of change objects (See below).\n\n* JsDiff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)\n Creates a unified diff patch.\n\n Parameters:\n * fileName : String to be output in the filename sections of the patch\n * oldStr : Original string value\n * newStr : New string value\n * oldHeader : Additional information to include in the old file header\n * newHeader : Additional information to include in thew new file header\n\n* convertChangesToXML(changes)\n Converts a list of changes to a serialized XML format\n\n### Change Objects\nMany of the methods above return change objects. These objects are consist of the following fields:\n\n* value: Text content\n* added: True if the value was inserted into the new string\n* removed: True of the value was removed from the old string\n\nNote that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner.\n\n## [Example](http://kpdecker.github.com/jsdiff)\n\n## License\n\nSoftware License Agreement (BSD License)\n\nCopyright (c) 2009-2011, Kevin Decker kpdecker@gmail.com\n\nAll rights reserved.\n\nRedistribution and use of this software in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above\n copyright notice, this list of conditions and the\n following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the\n following disclaimer in the documentation and/or other\n materials provided with the distribution.\n\n* Neither the name of Kevin Decker nor the names of its\n contributors may be used to endorse or promote products\n derived from this software without specific prior\n written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\nIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\nOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n", - "readmeFilename": "README.md", - "_id": "diff@1.0.2", - "dist": { - "shasum": "a83d26247f6b41ddfb6cda3f77332af2ae8e4fba" - }, - "_from": "diff@1.0.2", - "_resolved": "https://registry.npmjs.org/diff/-/diff-1.0.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/style.css b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/style.css deleted file mode 100644 index 2047e2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/style.css +++ /dev/null @@ -1,81 +0,0 @@ -* { - margin: 0; - padding: 0; -} -html, body { - background: #EEE; - font: 12px sans-serif; -} -body { - padding-top: 1.8em; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -html, body, table, tbody, tr, td { - height: 100% -} -table { - table-layout: fixed; - width: 100%; -} -td { - width: 33%; - padding: 3px 4px; - border: 1px solid transparent; - vertical-align: top; - font: 1em monospace; - text-align: left; - white-space: pre-wrap; -} -h1 { - display: inline; - font-size: 100%; -} -del { - text-decoration: none; - color: #b30000; - background: #fadad7; -} -ins { - background: #eaf2c2; - color: #406619; - text-decoration: none; -} - -#settings { - position: absolute; - top: 0; - left: 5px; - right: 5px; - height: 2em; - line-height: 2em; -} -#settings label { - margin-left: 1em; -} - -.source { - position: absolute; - right: 1%; - top: .2em; -} - -[contentEditable] { - background: #F9F9F9; - border-color: #BBB #D9D9D9 #DDD; - border-radius: 4px; - -webkit-user-modify: read-write-plaintext-only; - outline: none; -} -[contentEditable]:focus { - background: #FFF; - border-color: #6699cc; - box-shadow: 0 0 4px #2175c9; -} - -@-moz-document url-prefix() { - body { - height: 99%; /* Hide scroll bar in Firefox */ - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/test/diffTest.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/test/diffTest.js deleted file mode 100644 index 311b48b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/diff/test/diffTest.js +++ /dev/null @@ -1,616 +0,0 @@ -const VERBOSE = false; - -var assert = require('assert'), - diff = require('../diff'); - -function log() { - VERBOSE && console.log.apply(console, arguments); -} - -exports['Whitespace diff'] = function() { - diffResult = diff.diffWords("New Value", "New ValueMoreData"); - assert.equal( - "New ValueMoreDataValue", - diff.convertChangesToXML(diffResult), - "Single whitespace diffResult Value"); - - diffResult = diff.diffWords("New Value ", "New ValueMoreData "); - assert.equal( - "New ValueMoreDataValue ", - diff.convertChangesToXML(diffResult), - "Multiple whitespace diffResult Value"); -}; - -// Diff on word boundary -exports['Word Diff'] = function() { - diffResult = diff.diffWords("New :Value:Test", "New ValueMoreData "); - assert.equal( - "New ValueMoreData :Value:Test", - diff.convertChangesToXML(diffResult), - "Nonmatching word boundary diffResult Value"); - diffResult = diff.diffWords("New Value:Test", "New Value:MoreData "); - assert.equal( - "New Value:MoreData Test", - diff.convertChangesToXML(diffResult), - "Word boundary diffResult Value"); - diffResult = diff.diffWords("New Value-Test", "New Value:MoreData "); - assert.equal( - "New Value:MoreData -Test", - diff.convertChangesToXML(diffResult), - "Uninque boundary diffResult Value"); - diffResult = diff.diffWords("New Value", "New Value:MoreData "); - assert.equal( - "New Value:MoreData ", - diff.convertChangesToXML(diffResult), - "Word boundary diffResult Value"); -}; - -// Diff without changes -exports['Diff without changes'] = function() { - diffResult = diff.diffWords("New Value", "New Value"); - assert.equal( - "New Value", - diff.convertChangesToXML(diffResult), - "No changes diffResult Value"); - diffResult = diff.diffWords("New Value", "New Value"); - assert.equal( - "New Value", - diff.convertChangesToXML(diffResult), - "No changes whitespace diffResult Value"); - diffResult = diff.diffWords("", ""); - assert.equal( - "", - diff.convertChangesToXML(diffResult), - "Empty no changes diffResult Value"); -}; - -// Empty diffs -exports['Empty diffs'] = function() { - diffResult = diff.diffWords("New Value", ""); - assert.equal(1, diffResult.length, "Empty diff result length"); - assert.equal( - "New Value", - diff.convertChangesToXML(diffResult), - "Empty diffResult Value"); - diffResult = diff.diffWords("", "New Value"); - assert.equal( - "New Value", - diff.convertChangesToXML(diffResult), - "Empty diffResult Value"); -}; - -// With without anchor (the Heckel algorithm error case) -exports['No anchor'] = function() { - diffResult = diff.diffWords("New Value New Value", "Value Value New New"); - assert.eql( - "ValueNew Value New NewValue", - diff.convertChangesToXML(diffResult), - "No anchor diffResult Value"); -}; - -// CSS Diff -exports['CSS diffs'] = function() { - diffResult = diff.diffCss( - ".test,#value .test{margin-left:50px;margin-right:-40px}", - ".test2, #value2 .test {\nmargin-top:50px;\nmargin-right:-400px;\n}"); - assert.equal( - ".test2.test,#value #value2 .test {\n" - + "margin-topmargin-left:50px;\n" - + "margin-right:-400px;\n-40px}", - diff.convertChangesToXML(diffResult), - "CSS diffResult Value"); -}; - -// Line Diff -exports['Line diffs'] = function() { - diffResult = diff.diffLines( - "line\nold value\nline", - "line\nnew value\nline"); - assert.equal( - "line\nnew value\nold value\nline", - diff.convertChangesToXML(diffResult), - "Line diffResult Value"); - diffResult = diff.diffLines( - "line\nvalue\nline", - "line\nvalue\nline"); - assert.equal( - "line\nvalue\nline", - diff.convertChangesToXML(diffResult), - "Line same diffResult Value"); - diffResult = diff.diffLines( - "line\nvalue \nline", - "line\nvalue\nline"); - log("diffResult", diffResult); - log("diffResult", diff.convertChangesToXML(diffResult)); - assert.equal( - "line\nvalue\nvalue \nline", - diff.convertChangesToXML(diffResult), - "Line whitespace diffResult Value"); -}; - -// Patch creation with diff at EOF -exports['lastLineChanged'] = function() { - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,3 +1,4 @@\n' - + ' line2\n' - + ' line3\n' - + '+line4\n' - + ' line5\n', - diff.createPatch('test', 'line2\nline3\nline5\n', 'line2\nline3\nline4\nline5\n', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,3 +1,4 @@\n' - + ' line2\n' - + ' line3\n' - + ' line4\n' - + '+line5\n', - diff.createPatch('test', 'line2\nline3\nline4\n', 'line2\nline3\nline4\nline5\n', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,4 @@\n' - + ' line1\n' - + ' line2\n' - + ' line3\n' - + '+line44\n' - + '-line4\n', - diff.createPatch('test', 'line1\nline2\nline3\nline4\n', 'line1\nline2\nline3\nline44\n', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,5 @@\n' - + ' line1\n' - + ' line2\n' - + ' line3\n' - + '+line44\n' - + '+line5\n' - + '-line4\n', - diff.createPatch('test', 'line1\nline2\nline3\nline4\n', 'line1\nline2\nline3\nline44\nline5\n', 'header1', 'header2')); -}; - -exports['EOFNL'] = function() { - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,4 @@\n' - + ' line1\n' - + ' line2\n' - + ' line3\n' - + '+line4\n' - + '\\ No newline at end of file\n' - + '-line4\n', - diff.createPatch('test', 'line1\nline2\nline3\nline4\n', 'line1\nline2\nline3\nline4', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,4 @@\n' - + ' line1\n' - + ' line2\n' - + ' line3\n' - + '+line4\n' - + '-line4\n' - + '\\ No newline at end of file\n', - diff.createPatch('test', 'line1\nline2\nline3\nline4', 'line1\nline2\nline3\nline4\n', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,4 @@\n' - + '+line1\n' - + '-line11\n' - + ' line2\n' - + ' line3\n' - + ' line4\n' - + '\\ No newline at end of file\n', - diff.createPatch('test', 'line11\nline2\nline3\nline4', 'line1\nline2\nline3\nline4', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,5 +1,5 @@\n' - + '+line1\n' - + '-line11\n' - + ' line2\n' - + ' line3\n' - + ' line4\n' - + ' line4\n', - diff.createPatch('test', 'line11\nline2\nline3\nline4\nline4\nline4\nline4', 'line1\nline2\nline3\nline4\nline4\nline4\nline4', 'header1', 'header2')); -}; - -exports['Large Test'] = function() { - var random = 42; - var mult = 134775813, range = Math.pow(2, 32); - function nextRandom() { - random = ((random * mult) + 1) % range; - return random; - } - var largeTest = ".hbh9asgiidc {ehaahc9:ses;bhg9hc:ses;idgaag-hi9aa:cdca;ihgd9gdgca-gdadg:ighchehgaci;ggghdg:edhciag;daagsada:ahhhiaa;ahai7:hgid;}.hbh9asgiidc.hchgihaa {ggghdg:hgid;}.igiidchbh9ah {ihgd9gdgca-hbh9a:gga(" - + "hbh9ah/igiidcfhbh9ah.9hs);ihgd9gdgca-gaeahi:cd-gaeahi;7ah97i:7des;bhg9hc-gh97i:ses;ahai7:7des;ihgd9gdgca-edhhihdc:ses ses;}.igiidcfgde9 {ihgd9gdgca-edhhihdc:ses ses;}.bdghadaag .igiidcfgde9 {ihgd9gdgc" - + "a-edhhihdc:-7des ses;}.hchgihaa .igiidcfgde9 {ihgd9gdgca-edhhihdc:-dses ses;}.igiidcfaaaaia {ihgd9gdgca-edhhihdc:-bdes ses;}.bdghadaag .igiidcfaaaaia {ihgd9gdgca-edhhihdc:-9sses ses;}.hchgihaa .igiidc" - + "faaaaia {ihgd9gdgca-edhhihdc:-97des ses;}.igiidcfadacadha {ihgd9gdgca-edhhihdc:-9dses ses;}.bdghadaag .igiidcfadacadha {ihgd9gdgca-edhhihdc:-9bdes ses;}.hchgihaa .igiidcfadacadha {ihgd9gdgca-edhhihdc:" - + "-7sses ses;}.igiidcfabhha {ihgd9gdgca-edhhihdc:-77des ses;}.bdghadaag .igiidcfabhha {ihgd9gdgca-edhhihdc:-7dses ses;}.hchgihaa .igiidcfabhha {ihgd9gdgca-edhhihdc:-7bdes ses;}.igiidcfbdaa {ihgd9gdgca-e" - + "dhhihdc:-d7des ses;}.bdghadaag .igiidcfbdaa {ihgd9gdgca-edhhihdc:-ddses ses;}.hchgihaa .igiidcfbdaa {ihgd9gdgca-edhhihdc:-dbdes ses;}.igiidcfcaasdaaag {ihgd9gdgca-edhhihdc:-abdes ses;}.bdghadaag .igii" - + "dcfcaasdaaag {ihgd9gdgca-edhhihdc:-bsses ses;}.hchgihaa .igiidcfcaasdaaag {ihgd9gdgca-edhhihdc:-b7des ses;}.igiidcfgachba {ihgd9gdgca-edhhihdc:-dbdes ses;}.bdghadaag .igiidcfgachba {ihgd9gdgca-edhhihd" - + "c:-9ssses ses;}.hchgihaa .igiidcfgachba {ihgd9gdgca-edhhihdc:-9s7des ses;}.igiidcfghh {ihgd9gdgca-edhhihdc:-9sdses ses;}.bdghadaag .igiidcfghh {ihgd9gdgca-edhhihdc:-9sbdes ses;}.hchgihaa .igiidcfghh {" - + "ihgd9gdgca-edhhihdc:-99sses ses;}.igiidcfh7hga {ihgd9gdgca-edhhihdc:-97bdes ses;}.bdghadaag .igiidcfh7hga {ihgd9gdgca-edhhihdc:-9hsses ses;}.hchgihaa .igiidcfh7hga {ihgd9gdgca-edhhihdc:-9h7des ses;}.i" - + "giidcfgeadha {ihgd9gdgca-edhhihdc:-9hdses ses;}.bdghadaag .igiidcfgeadha {ihgd9gdgca-edhhihdc:-9hbdes ses;}.hchgihaa .igiidcfgeadha {ihgd9gdgca-edhhihdc:-9gsses ses;}.igiidcfaaisdaaag {ihgd9gdgca-edhh" - + "ihdc:-9dsses ses;}.bdghadaag .igiidcfaaisdaaag {ihgd9gdgca-edhhihdc:-9d7des ses;}.hchgihaa .igiidcfaaisdaaag {ihgd9gdgca-edhhihdc:-9ddses ses;}.igiidcfabei9ighh7 {ihgd9gdgca-edhhihdc:-hsses ses;}.bdgh" - + "adaag .igiidcfabei9ighh7 {ihgd9gdgca-edhhihdc:-h7des ses;}.hchgihaa .igiidcfabei9ighh7 {ihgd9gdgca-edhhihdc:-hdses ses;}.igiidcfadgd {ihgd9gdgca-edhhihdc:-hbdes ses;}.bdghadaag .igiidcfadgd {ihgd9gdgc" - + "a-edhhihdc:-gsses ses;}.hchgihaa .igiidcfadgd {ihgd9gdgca-edhhihdc:-g7des ses;}.igiidcfbhch9a {ihgd9gdgca-edhhihdc:-gdses ses;}.bdghadaag .igiidcfbhch9a {ihgd9gdgca-edhhihdc:-gbdes ses;}.hchgihaa .igi" - + "idcfbhch9a {ihgd9gdgca-edhhihdc:-dsses ses;}.igiidcfcaaahdh {ihgd9gdgca-edhhihdc:-bdses ses;}.bdghadaag .igiidcfcaaahdh {ihgd9gdgca-edhhihdc:-bbdes ses;}.hchgihaa .igiidcfcaaahdh {ihgd9gdgca-edhhihdc:" - + "-csses ses;}.igiidcfhhaahahgg7gahgaih {ihgd9gdgca-edhhihdc:-97sses ses;}.bdghadaag .igiidcfhhaahahgg7gahgaih {ihgd9gdgca-edhhihdc:-977des ses;}.hchgihaa .igiidcfhhaahahgg7gahgaih {ihgd9gdgca-edhhihdc:" - + "-97dses ses;}.igiidcfhhaahahgg7 {ihgd9gdgca-edhhihdc:-997des ses;}.bdghadaag .igiidcfhhaahahgg7 {ihgd9gdgca-edhhihdc:-99dses ses;}.hchgihaa .igiidcfhhaahahgg7 {ihgd9gdgca-edhhihdc:-99bdes ses;}.igiidc" - + "fcaaidddbhgd {ihgd9gdgca-edhhihdc:-asses ses;}.bdghadaag .igiidcfcaaidddbhgd {ihgd9gdgca-edhhihdc:-a7des ses;}.hchgihaa .igiidcfcaaidddbhgd {ihgd9gdgca-edhhihdc:-adses ses;}.igiidcfdeac {ihgd9gdgca-ed" - + "hhihdc:-c7des ses;}.bdghadaag .igiidcfdeac {ihgd9gdgca-edhhihdc:-cdses ses;}.hchgihaa .igiidcfdeac {ihgd9gdgca-edhhihdc:-cbdes ses;}.igiidcfdaagaghia {ihgd9gdgca-edhhihdc:-9hdses ses;}.bdghadaag .igii" - + "dcfdaagaghia {ihgd9gdgca-edhhihdc:-9hbdes ses;}.hchgihaa .igiidcfdaagaghia {ihgd9gdgca-edhhihdc:-9gsses ses;}.igiidcfahaa {ihgd9gdgca-edhhihdc:-9g7des ses;}.bdghadaag .igiidcfahaa {ihgd9gdgca-edhhihdc" - + ":-9gdses ses;}.hchgihaa .igiidcfahaa {ihgd9gdgca-edhhihdc:-9gbdes ses;}.igiidcfih9 {ihgd9gdgca-edhhihdc:-9dbdes ses;}.bdghadaag .igiidcfih9 {ihgd9gdgca-edhhihdc:-9asses ses;}.hchgihaa .igiidcfih9 {ihg" - + "d9gdgca-edhhihdc:-9a7des ses;}.igiidcfhgihgghia {ihgd9gdgca-edhhihdc:-9b7des ses;}.bdghadaag .igiidcfhgihgghia {ihgd9gdgca-edhhihdc:-9bdses ses;}.hchgihaa .igiidcfhgihgghia {ihgd9gdgca-edhhihdc:-9bbde" - + "s ses;}.igiidcfhgeaggaaa {ihgd9gdgca-edhhihdc:-9csses ses;}.bdghadaag .igiidcfhgeaggaaa {ihgd9gdgca-edhhihdc:-9c7des ses;}.hchgihaa .igiidcfhgeaggaaa {ihgd9gdgca-edhhihdc:-9cdses ses;}.igiidcfggahiaha" - + "ghah {ihgd9gdgca-edhhihdc:-9csses ses;}.bdghadaag .igiidcfggahiahaghah {ihgd9gdgca-edhhihdc:-9c7des ses;}.hchgihaa .igiidcfggahiahaghah {ihgd9gdgca-edhhihdc:-9cdses ses;}.igiidcfggahiagagdgaghia9dg9 {" - + "ihgd9gdgca-edhhihdc:-9cbdes ses;}.bdghadaag .igiidcfggahiagagdgaghia9dg9 {ihgd9gdgca-edhhihdc:-9dsses ses;}.hchgihaa .igiidcfggahiagagdgaghia9dg9 {ihgd9gdgca-edhhihdc:-9d7des ses;}.igiidcfggahiagagdga" - + "sdaaag {ihgd9gdgca-edhhihdc:-9ddses ses;}.bdghadaag .igiidcfggahiagagdgasdaaag {ihgd9gdgca-edhhihdc:-9dbdes ses;}.hchgihaa .igiidcfggahiagagdgasdaaag {ihgd9gdgca-edhhihdc:-7ssses ses;}.igiidcfggahiaga" - + "gdga {ihgd9gdgca-edhhihdc:-7s7des ses;}.bdghadaag .igiidcfggahiagagdga {ihgd9gdgca-edhhihdc:-7sdses ses;}.hchgihaa .igiidcfggahiagagdga {ihgd9gdgca-edhhihdc:-7sbdes ses;}.igiidcfggahiae79hhghagagdga {" - + "ihgd9gdgca-edhhihdc:-79bdes ses;}.bdghadaag .igiidcfggahiae79hhghagagdga {ihgd9gdgca-edhhihdc:-77sses ses;}.hchgihaa .igiidcfggahiae79hhghagagdga {ihgd9gdgca-edhhihdc:-777des ses;}.igiidcfbhdagagdga {" - + "ihgd9gdgca-edhhihdc:-77dses ses;}.bdghadaag .igiidcfbhdagagdga {ihgd9gdgca-edhhihdc:-77bdes ses;}.hchgihaa .igiidcfbhdagagdga {ihgd9gdgca-edhhihdc:-7hsses ses;}.igiidcfggahiagagdgaaaghhdc {ihgd9gdgca-" - + "edhhihdc:-79sses ses;}.bdghadaag .igiidcfggahiagagdgaaaghhdc {ihgd9gdgca-edhhihdc:-797des ses;}.hchgihaa .igiidcfggahiagagdgaaaghhdc {ihgd9gdgca-edhhihdc:-79dses ses;}.igiidcfgaea9abhha {ihgd9gdgca-ed" - + "hhihdc:-7h7des ses;}.bdghadaag .igiidcfgaea9abhha {ihgd9gdgca-edhhihdc:-7hdses ses;}.hchgihaa .igiidcfgaea9abhha {ihgd9gdgca-edhhihdc:-7hbdes ses;}.igiidcfsdgahgaabhha {ihgd9gdgca-edhhihdc:-9b7des ses" - + ";}.bdghadaag .igiidcfsdgahgaabhha {ihgd9gdgca-edhhihdc:-9bdses ses;}.hchgihaa .igiidcfsdgahgaabhha {ihgd9gdgca-edhhihdc:-9bbdes ses;}.igiidcfegiihgdabhha {ihgd9gdgca-edhhihdc:-7d7des ses;}.bdghadaag ." - + "igiidcfegiihgdabhha {ihgd9gdgca-edhhihdc:-7ddses ses;}.hchgihaa .igiidcfegiihgdabhha {ihgd9gdgca-edhhihdc:-7dbdes ses;}.igiidcfhhaa {ihgd9gdgca-edhhihdc:-7a7des ses;}.bdghadaag .igiidcfhhaa {ihgd9gdgc" - + "a-edhhihdc:-7adses ses;}.hchgihaa .igiidcfhhaa {ihgd9gdgca-edhhihdc:-7abdes ses;}.igiidcfhhaa {ihgd9gdgca-edhhihdc:-7a7des ses;}.bdghadaag .igiidcfhhaa {ihgd9gdgca-edhhihdc:-7adses ses;}.hchgihaa .igi" - + "idcfhhaa {ihgd9gdgca-edhhihdc:-7abdes ses;}.igiidcfaahi {ihgd9gdgca-edhhihdc:-h9shes ses;}.bdghadaag .igiidcfaahi {ihgd9gdgca-edhhihdc:-h97ces ses;}.hchgihaa .igiidcfaahi {ihgd9gdgca-edhhihdc:-h9dhes " - + "ses;}.igiidcfhaagdaa {ihgd9gdgca-edhhihdc:-h9bces ses;}.bdghadaag .igiidcfhaagdaa {ihgd9gdgca-edhhihdc:-h7shes ses;}.hchgihaa .igiidcfhaagdaa {ihgd9gdgca-edhhihdc:-h77ces ses;}.igiidcfcaagdcihgi {ihgd" - + "9gdgca-edhhihdc:-h7dhes ses;}.bdghadaag .igiidcfcaagdcihgi {ihgd9gdgca-edhhihdc:-h7bces ses;}.hchgihaa .igiidcfcaagdcihgi {ihgd9gdgca-edhhihdc:-hhshes ses;}.igiidcfcaa9gdge {ihgd9gdgca-edhhihdc:-hh7ce" - + "s ses;}.bdghadaag .igiidcfcaa9gdge {ihgd9gdgca-edhhihdc:-hhdhes ses;}.hchgihaa .igiidcfcaa9gdge {ihgd9gdgca-edhhihdc:-hhbces ses;}.igiidcf7aae {ihgd9gdgca-edhhihdc:-hgshes ses;}.bdghadaag .igiidcf7aae" - + " {ihgd9gdgca-edhhihdc:-hg7ces ses;}.igiidcfagdebacg {ihgd9gdgca-edhhihdc:-hscces ses;ahai7:9ges;}.bdghadaag .igiidcfagdebacg {ihgd9gdgca-edhhihdc:-hsbges ses;}.hchgihaa .igiidcfagdebacg {ihgd9gdgca-ed" - + "hhihdc:-hscces ses;}.igiidcfighchsaghc {ihgd9gdgca-edhhihdc:-7bbdes ses;}.bdghadaag .igiidcfighchsaghc {ihgd9gdgca-edhhihdc:-7csses ses;}.hchgihaa .igiidcfighchsaghc {ihgd9gdgca-edhhihdc:-7c7des ses;}" - + ".igiidcfhihgiadgdsada {ihgd9gdgca-edhhihdc:-hgdhes ses;}.bdghadaag .igiidcfhihgiadgdsada {ihgd9gdgca-edhhihdc:-hgbces ses;}.hchgihaa .igiidcfhihgiadgdsada {ihgd9gdgca-edhhihdc:-hdshes ses;}.igiidcfgas" - + "gah7 {ihgd9gdgca-edhhihdc:-hd7ces ses;}.bdghadaag .igiidcfgasgah7 {ihgd9gdgca-edhhihdc:-hddhes ses;}.hchgihaa .igiidcfgasgah7 {ihgd9gdgca-edhhihdc:-hdbces ses;}.igiidcfgadhaagdeids {ihgd9gdgca-edhhihd" - + "c:-hashes ses;}.bdghadaag .igiidcfgadhaagdeids {ihgd9gdgca-edhhihdc:-ha7ces ses;}.hchgihaa .igiidcfgadhaagdeids {ihgd9gdgca-edhhihdc:-hadhes ses;}.igiidcfdeacagdeids {ihgd9gdgca-edhhihdc:-habces ses;}" - + ".bdghadaag .igiidcfdeacagdeids {ihgd9gdgca-edhhihdc:-hbshes ses;}.hchgihaa .igiidcfdeacagdeids {ihgd9gdgca-edhhihdc:-hb7ces ses;}.igiidcfcaaagdeids {ihgd9gdgca-edhhihdc:-hbdges ses;}.bdghadaag .igiidc" - + "fcaaagdeids {ihgd9gdgca-edhhihdc:-hbbdes ses;}.hchgihaa .igiidcfcaaagdeids {ihgd9gdgca-edhhihdc:-hcsges ses;}.igiidcfighh7gahidga {ihgd9gdgca-edhhihdc:-hc7des ses;}.bdghadaag .igiidcfighh7gahidga {ihg" - + "d9gdgca-edhhihdc:-hcdges ses;}.hchgihaa .igiidcfighh7gahidga {ihgd9gdgca-edhhihdc:-hcbdes ses;}.hgdchbh9ah {ihgd9gdgca-hbh9a:gga(hbh9ah/hgdcfhbh9ah.9hs);ihgd9gdgca-gaeahi:cd-gaeahi;7ah97i:77es;ahca-7a" - + "h97i:77es;bhg9hc-gh97i:ses;ahai7:7des;ihgd9gdgca-edhhihdc:ses ses;}.hgdcfidddbhgdggggaci {ihgd9gdgca-edhhihdc:-ses ses;}.hgdcfidddbhgdggggacif7daag {ihgd9gdgca-edhhihdc:-7des ses;}.hgdcfidddbhgdggggac" - + "ifhchgihaa {ihgd9gdgca-edhhihdc:-dses ses;}.hgdcfasehca {ihgd9gdgca-edhhihdc:-bdes ses;}.hgdcfasehcaf7daag {ihgd9gdgca-edhhihdc:-9sses ses;}.hgdcfbhch9aggggaci {ihgd9gdgca-edhhihdc:-97des ses;}.hgdcfb" - + "hch9aggggacif7daag {ihgd9gdgca-edhhihdc:-9dses ses;}.hgdcfbhch9aggggacifhchgihaa {ihgd9gdgca-edhhihdc:-9bges ses;}.hgdcfgasgah7ggggaci {ihgd9gdgca-edhhihdc:-7sses ses;}.hgdcfgasgah7ggggacifhchgihaa {i" - + "hgd9gdgca-edhhihdc:-ah9es ses;}.hgdcfgasgah7ggggacif7daag {ihgd9gdgca-edhhihdc:-77des ses;}.hgdcfidddbhgdh {ahai7:7ses;ihgd9gdgca-edhhihdc:-7dses ses;}.hgdcfidddbhgdhf7daag {ahai7:7ses;ihgd9gdgca-edhh" - + "ihdc:-7bses ses;}.hgdcfge {ahai7:7ses;ihgd9gdgca-edhhihdc:-7cdes ses;}.hgdcfgef7daag {ahai7:7ses;ihgd9gdgca-edhhihdc:-hsdes ses;}.hgdcfgefhchgihaa {ahai7:7ses;ihgd9gdgca-edhhihdc:-h7des ses;}.hgdcfhah" - + "gg7 {ihgd9gdgca-edhhihdc:-hgdes ses;}.hgdcfhahgg7fhchgihaa {ihgd9gdgca-edhhihdc:-asaes ses;}.hgdcfhahgg7f7daag {ihgd9gdgca-edhhihdc:-hbges ses;}.hgdcfgdaaheha {ihgd9gdgca-edhhihdc:-gaaes ses;}.hgdcfgd" - + "aahehaf7daag {ihgd9gdgca-edhhihdc:-gd9es ses;}.hgdcfaggdg {ihgd9gdgca-edhhihdc:-g9hes ses;7ah97i:9ges;}.hgdcf7aae {ihgd9gdgca-edhhihdc:-gh9es ses;7ah97i:9ces;}.hgdcfhcsd {ihgd9gdgca-edhhihdc:-ggdes se" - + "s;7ah97i:9ges;}.hgdcfgddisdaaag {ihgd9gdgca-edhhihdc:-gades ses;7ah97i:7ses;}.hgdcfihgd {ihgd9gdgca-edhhihdc:-d9aes ses;ahai7 :7ses;}.hgdcfihgdf7daag {ihgd9gdgca-edhhihdc:-dhaes ses;ahai7 :7ses;}.hgdc" - + "fgadhafhahgg7 {ihgd9gdgca-edhhihdc:-ddaes ses;ahai7 :7des;}.hgdcfgadhafhahgg7f7daag {ihgd9gdgca-edhhihdc:-dc9es ses;ahai7:7des;}.gbhgdc {ihgd9gdgca-hbh9a:gga(hbh9ah/hgdchfaf.9hs);ihgd9gdgca-gaeahi:cd-" - + "gaeahi;7ah97i:7ses;bhg9hc-gh97i:ses;aagihgha-hah9c:bhaaaa;ahai7:7ses;ihgd9gdgca-edhhihdc:ses ses;}.haghah {ihgd9gdgca-edhhihdc:-ses ses;}.gagfghia9dg9 {ihgd9gdgca-edhhihdc:-7ses ses;}.gagfsdaaag {ihgd" - + "9gdgca-edhhihdc:-gses ses;}.gagfsdaaagfhahhifsa {ihgd9gdgca-edhhihdc:-9gses ses;}.gagfsdaaagfahhedhaa {ihgd9gdgca-edhhihdc:-9ases ses;}.gagfsdaaagfsgd7ac {ihgd9gdgca-edhhihdc:-97ses ses;}.gagdgafe79hh" - + "gha {ihgd9gdgca-edhhihdc:-9sses ses;}.gagdgafabhha {ihgd9gdgca-edhhihdc:-cses ses;}.gagdga {ihgd9gdgca-edhhihdc:-ases ses;}.gagdgafhahhifsa {ihgd9gdgca-edhhihdc:-7sses ses;}.gagdgafahhedhaa {ihgd9gdgc" - + "a-edhhihdc:-77ses ses;}.gagdgafsgd7ac {ihgd9gdgca-edhhihdc:-9cses ses;}.gbhgdc {ihgd9gdgca-hbh9a:gga(hbh9ah/hgdchfaf.9hs);ihgd9gdgca-gaeahi:cd-gaeahi;7ah97i:7ses;bhg9hc-gh97i:ses;aagihgha-hah9c:bhaaaa" - + ";ahai7:7ses;ihgd9gdgca-edhhihdc:ses ses;}.haghah {ihgd9gdgca-edhhihdc:-ses ses;}.gagfghia9dg9 {ihgd9gdgca-edhhihdc:-7ses ses;}.gagfsdaaag {ihgd9gdgca-edhhihdc:-gses ses;}.gagfsdaaagfhahhifsa {ihgd9gdg" - + "ca-edhhihdc:-9gses ses;}.gagfsdaaagfahhedhaa {ihgd9gdgca-edhhihdc:-9ases ses;}.gagfsdaaagfsgd7ac {ihgd9gdgca-edhhihdc:-97ses ses;}.gagdgafe79hhgha {ihgd9gdgca-edhhihdc:-9sses ses;}.gagdgafabhha {ihgd9" - + "gdgca-edhhihdc:-cses ses;}.gagdga {ihgd9gdgca-edhhihdc:-ases ses;}.gagdgafhahhifsa {ihgd9gdgca-edhhihdc:-7sses ses;}.gagdgafahhedhaa {ihgd9gdgca-edhhihdc:-77ses ses;}.gagdgafsgd7ac {ihgd9gdgca-edhhihd" - + "c:-9cses ses;}.shaahgdc {ihgd9gdgca-hbh9a:gga(hbh9ah/gdcghiachihdc.9hs);ihgd9gdgca-gaeahi:cd-gaeahi;7ah97i:7ses;bhg9hc-gh97i:ses;aagihgha-hah9c:bhaaaa;ahai7:7ses;ihgd9gdgca-edhhihdc:ses ses;}.shaa{ihg" - + "d9gdgca-edhhihdc:ses ses;}.shaafhggdihi{ihgd9gdgca-edhhihdc:-7ses ses;}.shaafheeaa{ihgd9gdgca-edhhihdc:-gses ses;}.shaafheeahghihdc{ihgd9gdgca-edhhihdc:-ases ses;}.shaafhgahd{ihgd9gdgca-edhhihdc:-cses" - + " ses;}.shaafasgaa{ihgd9gdgca-edhhihdc:-9sses ses;}.shaaf7iba{ihgd9gdgca-edhhihdc:-97ses ses;}.shaafhbh9a{ihgd9gdgca-edhhihdc:-9gses ses;}.shaafghah{ihgd9gdgca-edhhihdc:-9ases ses;}.shaafghahhgghei{ihg" - + "d9gdgca-edhhihdc:-9cses ses;}.shaafbhadga{ihgd9gdgca-edhhihdc:-7sses ses;}.shaafeei{ihgd9gdgca-edhhihdc:-77ses ses;}.shaafegdgagi{ihgd9gdgca-edhhihdc:-7gses ses;}.shaaffghgdihba{ihgd9gdgca-edhhihdc:-7" - + "ases ses;}.shaafiasi{ihgd9gdgca-edhhihdc:-7cses ses;}.shaafahaad{ihgd9gdgca-edhhihdc:-hsses ses;}.ahdh{ihgd9gdgca-edhhihdc:-hcses ses;}.shaafsba{ihgd9gdgca-edhhihdc:-h7ses ses;}.shaaf7he{ihgd9gdgca-ed" - + "hhihdc:-hgses ses;}.sdaaag{ihgd9gdgca-edhhihdc:-hases ses;}.shaafagdeids {ihgd9gdgca-edhhihdc:-gsses ses;}.aaaaiafhbhaa{ihgd9gdgca-edhhihdc:-ggses ses;ggghdg:edhciag;}.egiahgfh7hga{ihgd9gdgca-edhhihdc" - + ":-gases ses;}.h7hga{ihgd9gdgca-edhhihdc:-gcses ses;}.eghahia{ihgd9gdgca-edhhihdc:-dsses ses;}.gddisdaaag{ihgd9gdgca-edhhihdc:-dcses ses;}.adacfhggda{ihgd9gdgca-edhhihdc:-a77es ses;ahai7:9ces;}.7aae{ih" - + "gd9gdgca-edhhihdc:-agses ses;}.ighh7 {ihgd9gdgca-edhhihdc:-acses ses;}.hggdafgh97i {ihgd9gdgca-edhhihdc:-bs7es ses;ahai7:9ces;}.igahagggbih {a7hia-hehga:cdaghe;}.igahagggbih .igahagggbihfgddi {aagihgh" - + "a-hah9c:bhaaaa;ehaahc9:s;}.igahagggbih .igahagggbihfhggda {aagihgha-hah9c:bhaaaa;ehaahc9-aasi:7es;}.igahagggbih .igahagggbihfahgchba {aagihgha-hah9c:bhaaaa;ehaahc9-aasi:7es;sdci-shbha9:aghha,aaaaaihgh" - + ",hhch-haghs;sdci-hh7a:9ab;}.igahagggbih .igahagggbihfahgchba hcegi {ihgd9gdgca:ighchehgaci;idgaag:cdca;ehaahc9:ses;bhg9hc:ses;ahai7:9ss%;}a {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;}a:ahcd {iasi" - + "-aagdghihdc:cdca;gdadg:#ssssss;}a:ahhhiaa {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:hgihaa {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:ahcd.iddaihgfigiidcfahcd {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:ahhhiaa.i" - + "ddaihgfigiidcfahcd {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:hgihaa.iddaihgfigiidcfahcd {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:7daag.iddaihgfigiidcfahcd {iasi-aagdghihdc:cdca;gdadg:#ggbggg;ggghdg:edhc" - + "iag;}a:ahcd.aaaaa9fiasi {iasi-aagdghihdc:cdca;gdadg:#gggggg;sdci-hh7a:dd%;}a:ahhhiaa.aaaaa9fiasi {iasi-aagdghihdc:cdca;gdadg:#gggggg;sdci-hh7a:dd%;}a:hgihaa.aaaaa9fiasi {iasi-aagdghihdc:gcaagahca;gdad" - + "g:#ssssss;sdci-hh7a:dd%;}a:7daag.aaaaa9fiasi {iasi-aagdghihdc:cdca;gdadg:#ggbggg;sdci-hh7a:dd%;ggghdg:edhciag;}a:ahcd.aaaaa9fhgihaafhagihdc {iasi-aagdghihdc:cdca;gdadg:#gggggg;sdci-aah97i:idaa;sdci-hh" - + "7a:dd%;}a:ahhhiaa.aaaaa9fhgihaafhagihdc {iasi-aagdghihdc:cdca;gdadg:#gggggg;sdci-aah97i:idaa;sdci-hh7a:dd%;}a:hgihaa.aaaaa9fhgihaafhagihdc {iasi-aagdghihdc:gcaagahca;gdadg:#ssssss;sdci-aah97i:idaa;sdc" - + "i-hh7a:dd%;}a:7daag.aaaaa9fhgihaafhagihdc {iasi-aagdghihdc:cdca;gdadg:#ggbggg;sdci-hh7a:dd%;sdci-aah97i:idaa;ggghdg:edhciag;}a:ahcd.aaaaa7fiasi {iasi-aagdghihdc:cdca;gdadg:#cdcdcd;}a:ahhhiaa.aaaaa7fia" - + "si {iasi-aagdghihdc:cdca;gdadg:#cdcdcd;}a:hgihaa.aaaaa7fiasi {iasi-aagdghihdc:gcaagahca;gdadg:#cdcdcd;}a:7daag.aaaaa7fiasi {iasi-aagdghihdc:gcaagahca;gdadg:#ggbggg;ggghdg:edhciag;}a:ahcd.aaaaahfiasi {" - + "iasi-aagdghihdc:cdca;gdadg:#cdcdcd;ahca-7ah97i:7ses;}a:ahhhiaa.aaaaahfiasi {iasi-aagdghihdc:cdca;gdadg:#cdcdcd;ahca-7ah97i:7ses;}a:hgihaa.aaaaahfiasi {iasi-aagdghihdc:gcaagahca;gdadg:#cdcdcd;ahca-7ah9" - + "7i:7ses;}a:7daag.aaaaahfiasi {iasi-aagdghihdc:cdca;gdadg:#ggbggg;ggghdg:edhciag;ahca-7ah97i:7ses;}a:ahcd.gcaagahca {gdadg:#ssssss;iasi-aagdghihdc:gcaagahca;ggghdg:edhciag;}a:ahhhiaa.gcaagahca {gdadg:#" - + "ssssss;iasi-aagdghihdc:gcaagahca;}a:hgihaa.gcaagahca {iasi-aagdghihdc:gcaagahca;gdadg:#ssssss;}a:7daag.gcaagahca {iasi-aagdghihdc:gcaagahca;gdadg:#ggbggg;}.igahagggbih hcegi {ggghdg:edhciag;}.igahaggg" - + "bih hcegi:7daag.hchgihaa {ggghdg:aashgai;gdadg:#adadad;}a:7daag,a.sdggh,a:ahcd.sdggh,a:ahhhiaa.sdggh,a:7daag.sdggh,a:hgihaa.sdggh,.ihiehhi igiidc:7daag,.igahagggbih hcegi:7daag {iasi-aagdghihdc:cdca;g" - + "dadg:#ggbggg;ggghdg:edhciag;}h hb9 {idgaag:cdca;}ida9 {ehaahc9-gh97i:ses;ehaahc9-aasi:ses;ehaahc9-idiidb:ses;ehaahc9-ide:ses;bhg9hc-gh97i:ses;bhg9hc-aasi:ses;bhg9hc-ide:ses;bhg9hc-idiidb:ses;ihgd9gdgc" - + "a-gdadg:#gggggg;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:bg%;}ihiaa {sdci-hh7a:9ab;}ihiaa ihiaa {sdci-hh7a:9ss%;}.aasigadhi {sadhi:aasi;}i {sdci-aah97i:idaa;}.igiidc {sdci-shbha9:sh7d" - + "bh,aghha,aaaaaihgh,hhch-haghs;ehaahc9:des;iasi-hah9c:gaciag;sadhi:aasi;}.ihhhgsgiidc {ehaahc9:ses;bhg9hc:ses;idgaag-hi9aa:cdca;ihgd9gdgca-gdadg:ighchehgaci;ggghdg:edhciag;}.ihhhgsgiidc .igiidcfiasi {a" - + "hca-7ah97i:7ses;sdci-hh7a:9ab;}.ihhhgsgiidc.bdghadaag .igiidcfiasi {gdadg:#ggbggg;}.ihhhgsgiidc.hchgihaa .igiidcfiasi {gdadg:#sgsgsg;ggghdg:aashgai;}.aasifigiidc {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hh" - + "ch-haghs;sdci-hh7a:s.dab;ehaahc9-ide:des;ehaahc9-aasi:des;ehaahc9-gh97i:des;iasi-hah9c:gaciag;sadhi:aasi;bhc-ahai7:dses;}.gh97ifigiidc {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:s.dab;eh" - + "aahc9:des;iasi-hah9c:gaciag;sadhi:gh97i;}.gdagbcf7ahaag {sdci-aah97i:idaa;sdci-hh7a:dd%;ahca-7ah97i:9des;gdadg:#ssssss;ehaahc9-ide:7es;ehaahc9-aasi:7es;ehaahc9-gh97i:7es;a7hia-hehga:cdaghe;iasi-hah9c:" - + "aasi;}.hgdcfgdagbcf7ahaag {ehaahc9-aasi:7des;}.ahihfgda i7 {iasi-hah9c:aasi;sdci-aah97i:cdgbha;}.ahihfgda .cd7hih {iasi-hah9c:gaciag;}#idddbhgdfihiaa i7 h {ehaahc9-aasi:9ses;}.ahihfgda {7ah97i:7des;ih" - + "gd9gdgca-gdadg:#gggggg;}.ahihfahhi9dagbc {ehaahc9-aasi:des;ehaahc9-gh97i:des;ahca-7ah97i:7des;}.agdeadac {idgaag-idiidb:9es iahgd;idgaag-gh97i:9es iahgd;idgaag-aasi:9es #9s9s9s;idgaag-ide:9es #9s9s" - + "9s;ahhhihahi9:7haaac;edhhihdc:hihdagia;ahai7:7sses;7-hcaas:9;ehaahc9:ses;ggghdg:edhciag;}.haaagi {ihgd9gdgca-gdadg:#g9gdga;sadhi:aasi;}haaagi.gghiaghh {sdci-hh7a:s.dab;ahai7:9cses;}.hbhaa {sdci-hh7a:d" - + "d%;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;}.ihiaaaehgag {ahai7:7ses;}.iasihcegi {ehaahc9:des;bhg9hc:ses;aagihgha-hah9c:ide;}i7 {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-aah97i:idaa;" - + "sdci-hh7a:dd%;}.ihiaa {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;sdci-aah97i:idaa;}.ahaga {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;}.aaaaafiddaihg {gaahg:idi7;a" - + "hai7:hgid;7ah97i:gces;ihgd9gdgca-gdadg:#d77ahc;}.iddaihgfaasi {sadhi:aasi;ahai7:hgid;iasi-hah9c:gaciag;}.iddaihgfgh97i {sadhi:gh97i;ahai7:hgid;iasi-hah9c:gaciag;}aha.iddaihg {sadhi:aasi;}.iddaihgfid9f" - + "aasi {sadhi:aasi;}.iddaihgfid9 {gdadg:#ssssss;sadhi:aasi;}.iddaihgfid9fgh97i {sadhi:aasi;}.iddaihgfigiidc {sadhi:aasi;iasi-hah9c:gaciag;ggghdg:edhciag;ehaahc9:ces ses ces ses;bhg9hc:ses;idgaag:ses cdc" - + "a;ihgd9gdgca-gdadg:ighchehgaci;}.iddaihgfigiidc.hchgihaa {ggghdg:hgid;}.iddaihgfigiidcfhgdc {gaahg:gh97i;sadhi:cdca;bhg9hc-aasi:hgid;bhg9hc-gh97i:hgid;idgaag:ses;}.iddaihgfigiidc .igiidcfiasi,.iddaihg" - + "figiidc hehc {ahheah9:iadgd;sdci-hh7a:s.cab;ehaahc9-aasi:des;ehaahc9-gh97i:des;sdci-shbha9:aghha,aaaaaihgh,hhch-haghs;ahca-7ah97i:s.cab;iasi-aagdghihdc:cdca;}.iddaihgfigiidc.bdghadaag .igiidcfiasi {gd" - + "adg:#ggbggg;}.iddaihgfigiidc.hchgihaa .igiidcfiasi {gdadg:9gh9;}.iicfahih9dcigdafaasi {sadhi:aasi;ehaahc9-aasi:des;}.cdaghe,.cdaghe ia,.iaehiaa {a7hia-hehga:cdaghe;}ihiaa.cdaghe,ihiaa.cdaghe ig,ia.ag" - + "he {a7hia-hehga:cdgbha;}.ihifhbhaafaasi {sadhi:aasi;}.ihifhbhaafgh97i {sadhi:aasi;}.ihifhbhaafid9 {sadhi:aasi;sdci-hh7a:dd%;}.ihifhbhaafid9 h {ahca-7ah97i:7ses;ehaahc9-ide:7es;}.ihifhbhaafdssfaasi {" - + "sadhi:aasi;ahai7:7ses;ehaahc9-ide:7es;}.ihifhbhaafdssfgh97i {sadhi:aasi;ehaahc9-ide:7es;}.ihifhbhaafdssfid9 {sadhi:aasi;sdci-hh7a:dd%;ehaahc9-ide:7es;}aha.ihifhbhaa {idgaag-aasi:9es hdaha #7a77hh;id" - + "gaag-gh97i:9es hdaha #7a77hh;idgaag-idiidb:9es hdaha #7a77hh;}aha.aaaaa9 {ahai7:hgid;gaahg:idi7;}aha.aaaaa9faasi {sadhi:aasi;ehaahc9-aasi:des;ehaahc9-ide:7es;ehaahc9-idiidb:7es;7ah97i:9ges;}aha.aaaaa" - + "9fgh97i {sadhi:gh97i;ehaahc9-aasi:des;ehaahc9-ide:7es;ehaahc9-idiidb:7es;7ah97i:9ges;}.aaaaa9fiasi {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;gdadg:#gggggg;sdci-hh7a:dd%;ehaahc9-aasi:7es;ehaahc9-g" - + "h97i:7es;}.aaaaa9fad9hc {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;gdadg:#gggggg;sdci-hh7a:dd%;sdci-aah97i:idaa;ehaahc9-aasi:des;ehaahc9-gh97i:des;}.aaaaa9fad9dgi {bhg9hc-gh97i:7es;}aha.ad9d {sad" - + "hi:aasi;}.aaaaa7fiasi {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;gdadg:#i7i7i7;sdci-aah97i:idaa;ehaahc9-aasi:des;ehaahc9-gh97i:des;ahca-7ah97i:hhes;}.aaaaafadghihdc {gaahg:idi7;ahai7:hgid;7ah97i:7" - + "ces;ihgd9gdgca-gdadg:#d77ahc;edhhihdc:gaahihaa;}.adghihdcfaasi {bhg9hc-aasi:hes;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;}.aaaaafigahagggbi {gaahg:idi7;ahai7:hgid;7ah97i:7ces;ihgd9g" - + "dgca-gdadg:#d77ahc;}.igahagggbifaasi {ahai7:hgid;bhg9hc-gh97i:7dses;}.igahagggbifgh97i {sadhi:gh97i;ahai7:hgid;ahai7:7gces;}.igahagggbifigiidc {sadhi:aasi;bhg9hc-aasi:ses;bhg9hc-gh97i:ses;bhg9hc-ide:9" - + "es;ggghdg:edhciag;7ah97i:7ces;ihgd9gdgca-gdadg:ighchehgaci;idgaag:cdca;ehaahc9:ses;}.igahagggbifhbh9a {bhg9hc-aasi:hes;bhg9hc-gh97i:hes;bhg9hc-ide:9es;ggghdg:edhciag;7ah97i:7ces;idgaag:cdca;}.igahaggg" - + "bifehi7fgdcihhcag {ihgd9gdgca-gdadg:a7hia;ahai7:hgid;ehaahc9-ide:ses;ehaahc9-idiidb:ses;}.igahagggbihcah {ahai7:bes;7ah97i:7ces;ihgd9gdgca-gdadg:#d77ahc;}.igahagggbifehi7figiidc {sadhi:aasi;bhg9hc-gh9" - + "7i:9es;bhg9hc-ide:9es;bhg9hc-aasi:ses;}.cdsdgaag {idgaag:cdca;}.igahagggbifehi7fahcd {idgaag:cdca;}.igahagggbifehi7 {sadhi:aasi;}.igahagggbifehi7faasi,.igahagggbifehi7fgh97i {sdci-shbha9:sh7dbh,aghha," - + "aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;}.igahagggbifehi7fiasi {iasi-aagdghihdc:cdca;gdadg:#ssssss;sdci-hh7a:s.dab;ahca-7ah97i:7ges;bhg9hc-aasi:hes;}.hahgg7fehi7fgdcihhcag7 {sadhi:gh97i;ihgd9gdgca-gdadg:a7" - + "hia;gdadg:9gh9;ehaahc9-ide:ses;ehaahc9-idiidb:ses;7ah97i:7ges;idgaag:7es hdaha #d77ahc;}.hahgg7fhcegi7 {sadhi:aasi;ahai7:9gces;aagihgha-hah9c:bhaaaa;bhg9hc-aasi:9es;idgaag:7es hdaha a7hia;ihgd9gdgca-g" - + "dadg:a7hia;}#hahgg7iasi {sdci-shbha9:sh7dbh,dacaah,hhch-haghs;sdci-hh7a:9ab;}#hahgg7sddaihg {sdci-hh7a:9ab;}.hahgg7fehi7figiidc {sadhi:aasi;bhg9hc-aasi:ses;bhg9hc-ide:9es;bhg9hc-gh97i:9es;ggghdg:edhci" - + "ag;idgaag:cdca;}.ahgagidg9fehi7 {sadhi:aasi;}aha.ehi7faasi,aha.ehi7fgh97i {sadhi:aasi;sdci-aah97i:cdgbha;bhg9hc:ses;ahca-7ah97i:7des;ihgd9gdgca-gdadg:#d77ahc;}aha.ggggacifehi7figiidch {ihgd9gdgca-gd" - + "adg:#d77ahc;sadhi:aasi;}aha.idddbhgdh {sadhi:aasi;ihgd9gdgca-gdadg:#d77ahc;7ah97i:7des;ahca-7ah97i:7des;}ga.idddbhgd {ihgd9gdgca-gdadg:#gsg9g9;}ah.idddbhgd {ahhi-hi9aa:cdca;ehaahc9-aasi:des;ehaahc9-id" - + "e:7es;ehaahc9-idiidb:ses;ehaahc9-gh97i:des;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:s.dab;}ah.bhch9afidddbhgdh {ahhi-hi9aa:cdca;ehaahc9-aasi:des;ehaahc9-ide:7es;ehaahc9-idiidb:ses;ehaah" - + "c9-gh97i:des;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;idgaag-ide:9es hdaha #7d7d7d;sdci-hh7a:s.dab;}aha.hahgg7 {sadhi:aasi;ahai7:hgid;ihgd9gdgca-gdadg:#d77ahc;}aha.9dd9aafhahgg7 {sadhi:gh97i;ihg" - + "d9gdgca-gdadg:#d77ahc;}aha.hahgg7fids {sdci-aah97i:cdgbha;bhg9hc:ses;ahca-7ah97i:7des;sadhi:aasi;ihgd9gdgca-gdadg:#d77ahc;}.bacg {idgaag-idiidb:9es hdaha #cscscs;idgaag-gh97i:9es hdaha #cscscs;idgaag" - + "-ide:9es hdaha #gggggg;idgaag-aasi:9es hdaha #gggggg;ihgd9gdgca-gdadg:#gggggg;sdci-shbha9:aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:s.dab;ehaahc9:ses;}aha.shaafbhch9ag {ehaahc9:ses;ihgd9gdgca-gdadg:#s7sca" - + "7;idgaag:9es hdaha #sgsgsg;ahai7:9ss%;sadhi:aasi;}aha.sddiag {ahai7:hgid;sadhi:gh97i;ehaahc9-ide:7es;ehaahc9-idiidb:ses;}aha.bahhh9a {sadhi:aasi;sdci-aah97i:cdgbha;sdci-hh7a:dd%;gdadg:iahgd;bhg9hc:se" - + "s;ahca-7ah97i:77es;ahai7:hgid;ehaahc9:7es;}.gh97ifgahgd {idgaag:9es hdaha #9s9s9s;ihgd9gdgca-gdadg:#gsgggg;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:s.dab;ahhhihahi9:7haaac;edhhihdc:hihd" - + "agia;ahai7:97ses;7-hcaas:9;ehaahc9:9ses;ggghdg:edhciag;}aha.ehgdehhi {ihgd9gdgca-gdadg:#gggggg;idgaag:9es hdaha #b99h7h;ehaahc9:des;}aha.ehgdehhiagah {gaahg:idi7;ehaahc9:9ses;}.bhch9afeh9a {ihgd9gdgca" - + "-gdadg:#ghghgh;}.gdbbaci {edhhihdc:gaahihaa;bhg9hc-ide:7es;ehaahc9:9ses;gaahg:gh97i;}.aaac9dbbaci {ihgd9gdgca:#gggggg;}.daa9dbbaci {ihgd9gdgca-gdadg:#ghghgh;idgaag-ide:#sgsgsg;idgaag-idiidb:#sgsgsg;}." - + "haa9dbbaciagah {bhg9hc-idiidb:des;}.gdbbaciagi7dg {sdci-hh7a:9ab;sdci-aah97i:idaa;ehaahc9-idiidb:des;}.gdbbacisasi {sdci-hh7a:dd%;ehaahc9-idiidb:9es;}.gdbbacishbahihbe {sdci-hh7a:s.cab;}.gdbbaci7aaaia" - + "97agdids {edhhihdc:hihdagia;gh97i:9ses;ide:9ses;ggghdg:edhciag;}aha.eh9afihiaa {gaahg:idi7;ahai7:hgid;}aha.hhaafchah9hihdc {bhg9hc-ide:ses;}ia.hhaafchah9hihdc {ihgd9gdgca-hbh9a:gga(hi9aah/hhaafchafid" - + "9.ge9);ihgd9gdgca-gaeahi:gaeahi-s;ahai7:9bdes;idgaag-gh97i:9es hdaha #sgsgsg;}.ihiehhi {bhg9hc-aasi:7ses;bhg9hc-ide:7ses;bhg9hc-idiidb:7ses;ehaahc9-aasi:9bes;}.ihiehhi igiidc {ihgd9gdgca-gdadg:ighcheh" - + "gaci;idgaag:ses cdca;bhg9hc:ses;ehaahc9:ses;ggghdg:edhciag;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;iasi-hah9c:aasi;}.ihiehhi ah {ehaahc9-aasi:ses;ehaahc9-ide:ses;ehaahc9-gh97i:ses;" - + "ehaahc9-idiidb:ges;ahhi-hi9aa-i9ea:cdca;sdci-hh7a:s.dab;}.aaihfhiabfhgihaa {ahhi-hi9aa-hbh9a:gga(hbh9ah/haaagiaafhgihdc.9hs);}.aaihfhiabfhgihaa igiidc {sdci-aah97i:idaa;}aha.gh97ifeh9afgdciaci {ahai7" - + ":hgid;ihgd9gdgca-gdadg:a7hia;}aha.hbhaafhgifiddaihg {ihgd9gdgca-gdadg:#9s9s9s;7ah97i:7des;ehaahc9-idiidb:des;}aha.hgifigiidc {sdci-hh7a:s.dab;ehaahc9-aasi:7es;ehaahc9-gh97i:7es;sadhi:aasi;iasi-hah9c:" - + "gaciag;}aha.eh9afihiaa {bhg9hc:ses;}.eh9afihiaa hcegi,.eh9afihiaa hgibhi,.eh9afihiaa haaagi,.eh9afihiaa iasihgah,.sdgbfgdciaci iasihgah {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;}a" - + "ha.eh9afahih {bhg9hc:9ses;sadhi:aasi;}aha.bdahafsdgb {idgaag:9es hdaha #a9a9a9;bhc-ahai7:gases;}aha.sdgbfgdciaci {bhg9hc:7as;gaahg:idi7;ahai7:hgid;}.sdgbfgdciaci h {sdci-hh7a:9ab;}aha.sdgbfihiaafihg" - + " {idgaag-aasi:9es hdaha #b99h7h;idgaag-gh97i:9es hdaha #b99h7h;gaahg:idi7;}.sdgbfihiaafiasi {ahca-7ah97i:7aes;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;sdci-aah97i:idaa;gdadg:#hhhh" - + "hh;sdci-aah97i:idaa;aagihgha-hah9c:ihhaahca;bhg9hc:ses;ehaahc9-aasi:des;}.iicfeh9a9dcigdafaasi {ehaahc9-ide:ges;sadhi:aasi;}.iicfeh9a9dcigdafgh97i {ehaahc9-ide:ges;sadhi:gh97i;}aha.sdgbfgdcigdah {gaa" - + "hg:idi7;}aha.ghahdfigiidch {ehaahc9:des;}.aaig9sdgaag {idgaag:9es hdaha gaa;}.aaig9 {idgaag:9es hdaha #iii;}.haahcgaafhahgg7 {ahai7:hgid;gaahg:idi7;bhg9hc:9ses;ihgd9gdgca-gdadg:#ac7ahs;edhhihdc:gaah" - + "ihaa;}aha.hahgg7fid9 {edhhihdc:gaahihaa;ihgd9gdgca-gdadg:#h9h9h9;idgaag-idiidb:7es hdaha #d9a9sb;}.hahgg7fgdcihhcag {ahai7:hgid;bhg9hc-aasi:7ses;ehaahc9-ide:9ses;}aha.hahgg7fgefaasifgdgcag {sadhi:aa" - + "si;}aha.hahgg7fgefgh97ifgdgcag {sadhi:gh97i;}.hahgg7fihiaa {sdci-hh7a:dd%;sdci-aah97i:idaa;ehaahc9-aasi:des;ehaahc9-ide:des;}.hahgg7fgghiaghh {ehaahc9-aasi:9ses;ehaahc9-gh97i:ses;ehaahc9-ide:des;sdci-" - + "hh7a:dd%;ihgd9gdgca-gdadg:#gggggg;idgaag:9es hdaha #sgsgsg;}aha.hahgg7figiidcfgda {ehaahc9-ide:des;idgaag-ide:9es hdaha #sgsgsg;sadhi:aasi;ahai7:9ss%;}aha.hahgg7figiidcfgdcihhcag {sadhi:gh97i;}aha.hah" - + "gg7fhaa9ghiaghhfgda {idgaag-idiidb:9es hdaha #sgsgsg;sadhi:aasi;ahai7:9ss%;7ah97i:7des;}aha.hahgg7fgghiaghhfgdcihhcag {idgaag:7es hdaha #d9a9sb;ehaahc9:des;}.hgdcehiaafiasi {sadhi:aasi;bhg9hc:ses;7ah9" - + "7i:7des;ahca-7ah97i:7des;ehaahc9-gh97i:des;sdci-hh7a:dd%;sdci-aah97i:idaa;}aha.hgdc {ahai7:7des;7ah97i:7des;sadhi:aasi;}a:ahcd.hahgg79ghiaghhfiasi {iasi-aagdghihdc:gcaagahca;gdadg:#ssssss;sdci-hh7a" - + "{sadhi:aasi;ahhi-hi9aa:cdca;bhg9hc-ide:hes;}.7aae9dcihhcag {edhhihdc:hihdagia;ide:7es;gh97i:7es;bhg9hc:ses;ehaahc9:ses;idgaag:ses cdca;7-hcaas:g;ggghdg:edhciag;ahhhihahi9:hc7aghi;ihgd9gdgca-gdadg:ighc" - + "hehgaci;}.7aae9dcihhcagaihihg {bhg9hc:ses;ehaahc9:ses;ggghdg:edhciag;ahhhihahi9:hc7aghi;}.9gh-bdagaa .7aae9dcihhcag {gh97i:ges;}.9gh-ahhad9 .9gh-ehcaa .7aae9dcihhcag {gh97i:7ses;}.sdgb7hih {sdci-hh7a" - + ":9ab;}ihiaa.cdihs9shiaa {idgaag:ses;}ihiaa.cdihs9shiaa .aasi9dagbc {iasi-hah9c:gh97i;aagihgha-hah9c:ide;sdci-aah97i:idaa;}ihiaa.cdihs9shiaa .gh97i9dagbc {iasi-hah9c:aasi;}ihiaa.hgeagihiaa {bhg9hc:s s " - + "s 7es;}ihiaa.hgeagihiaa iida9 ig ia.geadhaf7ahaag {idgaag-ide:9es hdaha g9i(9g7,9g7,9g7);idgaag-gh97i:9es hdaha g9i(9g7,9g7,9g7);idgaag-idiidb:cdca;idgaag-aasi:9es hdaha g9i(9g7,9g7,9g7);ihgd9gdgca:g9" - + "i(77d,77d,77d);ehaahc9:s;sdci-hh7a:s;7ah97i:hses;}ihiaa.hgeagihiaa iida9 ig ia.geadhaf7ahaag ihiaa {sdci-aah97i:ass;sdci-hh7a:9ab;ihgd9gdgca:ighchehgaci;gdadg:iahgd;ahai7:9ss%;bhg9hc:s;}ihiaa.hgeagihi" - + "aa iida9 ig ia.gdcihhchfgeadha {bhg9hc:s;ehaahc9-aasi:s;}aha.geadha {bhg9hc:s;ehaahc9:s;daagsada:hgid;7ah97i:7hses;ahai7:asses;idgaag:9es hdaha g9i(9g7,9g7,9g7);ihgd9gdgca:a7hia;}aha.geadha ihiaa {7ah" - + "97i:9ss%;idgaag:cdca;}.geadha-daagaghia {}aha.geadha ihiaa iida9 ig {7ah97i:7des;}aha.geadha ihiaa iida9 ig#geadhafiahcdgda {7ah97i:hgid;}.geadhafsddiag {idgaag-ide:cdca;idgaag-gh97i:9es hdaha g9i(9g7" - + ",9g7,9g7);idgaag-idiidb:9es hdaha g9i(9g7,9g7,9g7);idgaag-aasi:9es hdaha g9i(9g7,9g7,9g7);7ah97i:hses;ihgd9gdgca:g9i(77d,77d,77d);}.iaehiaa {sdci-aah97i:idaa;}.ihiaaf7ahaag {sdci-aah97i:idaa;sdci-hh7a" - + ":9ab;gdadg:#ssssss;ahca-7ah97i:7hes;ahai7:9ss%;}.gh97ifihiaaf7ahaag {ahca-7ah97i:7hes;ahai7:hes;sdci-aah97i:idaa;gdadg:#ssssss;sdci-hh7a:9ab;}.aasifihiaaf7ahaag {ahca-7ah97i:7hes;ahai7:ges;sdci-aah97i" - + "{ihgd9gdgca-gdadg:#gggggg;ia77bgd-abdas:ses;ia77bgd-ehgs:ses;ia77bgd-shsshf:ses;ia77bgd-shi:hces;faadbg-abdas:des;faadbg-ehgs:des;faadbg-shi:hces;faadbg-shsshf:ses;ghgs-abah:9ss%;}.aabhcfhaiahiaa {" - + "sdci-hh7a:9ab;}#shaahgdgb {edhhihdc:hihdagia;ide:ses;aasi:ses;ahai7:ses;7ah97i:ses;}.aaaaafhgiihih {ihgd9gdgca-gdadg:#gggggg;7ah97i:7ses;}.gdagbcf7ahaagfadc9 {sdci-hh7a:dd%;7ah97i:hses;gdadg:#sssss" - + "s;}aha.ihifhaafeagbhhhhdch,aha.ihifihhhgfeagbhhhhdch {sadhi:aasi;ahai7:hgid;iasi-hah9c:gaciag;}aha.eagbhhhhdchbhhaehhi {bhg9hc:ses;ehaahc9-aasi:7ses;ehaahc9-ide:des;ehaahc9-idiidb:des;}aha.eagbhhhhdch" - + "bhhaehhi ga {bhg9hc:ses;ehaahc9:ses ses ses 9ses;}aha.hgdcehiaafiasi {sadhi:aasi;bhg9hc:ses;7ah97i:7des;ahca-7ah97i:7des;ehaahc9-gh97i:des;sdci-aah97i:idaa;}aha.hgdc {ahai7:7des;7ah97i:7des;sadhi:a" - + "asi;}a.ahia {gdadg:#ggssss;sdci-aah97i:cdgbha;}a:ahhhiaa.ahia {gdadg:#ggssss;sdci-aah97i:cdgbha;}a:7daag.ahia {gdadg:#ggssss;sdci-aah97i:cdgbha;}a:hgihaa.ahia {gdadg:#ggssss;sdci-aah97i:cdgbha;}.ahia" - + "{9heha:#ggssss;ghgs-hhbdas:idaa;}.gh97ifiddaihg {sadhi:gh97i;ehaahc9-gh97i:des;}aha.asfhahgg7fid9 {bhg9hc-aasi:hes;bhg9hc-gh97i:hes;bhg9hc-idiidb:9ses;idgaag-idiidb:7es hdaha #d9a9sb;}.asfhahgg7 {ah" - + "ai7:hgid;gaahg:idi7;7ah97i:9hses;ehaahc9-ide:ses;bhg9hc:ses;ihgd9gdgca-gdadg:#d77ahc;}aha.asfhahgg7faasiaca {sadhi:aasi;}aha.asfhahgg7fgh97iaca {sadhi:gh97i;}.ahih h {sdci-hh7a:9ab;}.asfhahgg7fgdcihh" - + "cag {sadhi:aasi;bhg9hc-ide:des;}ia.asfhahgg7fiasi {sdci-hh7a:s.dab;}.asfhahgg7fiasi hcegi {sdci-hh7a:s.dab;}.asfhahgg7fiasi haaagi {sdci-hh7a:s.dab;}ia.asfihiaaaehgag {ahai7:9ses;}.asfihiaa9aaa {ehaah" - + "c9-aasi:9ses;ehaahc9-gh97i:des;}aha.hgihdcfhiae {ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:des;ehaahc9-gh97i:9ses;bhg9hc-gh97i:9des;ihgd9gdgca-gdadg:a7hia;idgaag-idiidb:7es dgihai;idgaag-gh97i:7" - + "es dgihai;ahai7:dd%;}aha.aaghhhdcfhiae {ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:des;ehaahc9-gh97i:des;ihgd9gdgca-gdadg:a7hia;idgaag-idiidb:7es dgihai;idgaag-gh97i:7es dgihai;ahai7:dd%;}aha.i7" - + "ac {ihgd9gdgca:#hhgggh;ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:7es;ehaahc9-gh97i:des;idgaag-idiidb:7es dgihai;idgaag-gh97i:7es dgihai;ahai7:dd%;}aha.i7acfida9 {ehaahc9-ide:des;ehaahc9-idiidb:" - + "des;ehaahc9-aasi:9ses;ehaahc9-gh97i:des;ahai7:dd%;}aha.aaha {ihgd9gdgca:#hhgggh;ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:7es;ehaahc9-gh97i:des;idgaag-idiidb:7es dgihai;idgaag-gh97i:7es dgihai;a" - + "hai7:dd%;}aha.aahafida9 {ehaahc9-ide:des;ehaahc9-idiidb:des;ehaahc9-aasi:9ses;ehaahc9-gh97i:des;ahai7:dd%;}aha.haafhiae {ehaahc9-ide:9ses;ehaahc9-idiidb:9ses;iasi-hah9c:gaciag;}aha.casifhiae {ihgd9gd" - + "gca:#hhgggh;ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:7es;ehaahc9-gh97i:des;idgaag-idiidb:7es dgihai;idgaag-gh97i:7es dgihai;ahai7:dd%;}aha.hsfida9 {ehaahc9-ide:des;ehaahc9-idiidb:des;ehaahc9-aa" - + "si:9ses;ehaahc9-gh97i:des;ahai7:dd%;}aha.ehghbaiagh {ehaahc9-ide:des;ehaahc9-idiidb:des;ehaahc9-aasi:9ses;ehaahc9-gh97i:des;ahai7:dd%;}aha.eh9afida9 {ehaahc9-ide:9ses;ehaahc9-aasi:9ses;}aha.h7dgifhgi" - + "hdcfchba {sdci-hh7a:9ss%;}aha.h7dgifaaghhhdcfchba {sdci-hh7a:9ss%;}.gahaagfcdihshghihdc {ahheah9:cdca;}.gahaaghaabaci {edhhihdc:hihdagia;ide:-9es;aasi:-9ses;7ah97i:9es;ahca-7ah97i:9es;idgaag:cdca;eh" - + "aahc9:ses;bhg9hc:ses;ahai7:9es;daagsada:7haaac;}ihiaa.dig i7 aha {edhhihdc:gaahihaa;ide:-9ses;7ah97i:9es;daagsada:7haaac;}.idaaehiaah ahiaa,.ahiaa {sdci-aah97i:idaa;sdci-hh7a:9ab;}shaaahai.ghahddgdge " - + "{ehaahc9:ses;idgaag:cdca;iasi-hah9c:aasi;}shaaahai.ghahddgdge aa9aca {ehaahc9:ses;}shaaahai.ghahddgdge aha {ehaahc9-aasi:7ses;ehaahc9-idiidb:des;}shaaahai.ghahddgdge ahiaa {ahheah9:iadgd;bhg9hc-aasi:9" - + "79.ihiaa,77.ihiaa {bhg9hc:ses;}.9gh-bdagaa,.ahdhfihi7haa9dciaci,.hahgg7fid9,.haahcgaafhahgg7 {7ddb:9;}.eghcghehaehhi {ahhi-hi9aa-i9ea:cdca;}.ihiehhi igiidc,.aaaaa7fbacg igiidc,.aaaaahfbacg igiidc,.ihh" - + "hgsgiidc,.iddaihgfigiidc,.igahagggbihfahgchba hcegi,.shaaa9hiabsgdahagsgaa hcegi {ahai7:hgid;daagsada:ahhhiaa;}.gbaiaeaahahc9h {ehaahc9-aasi:7ses;sdci-aah97i:idaa;sdci-hh7a:9ss%;}.9ghaids {ahai7:9ss%;" - + "sdci-shbha9:sh7dbh,dacaah,hhch-haghs;sdci-hh7a:9ss%;ehaahc9:ses;bhg9hc:ses;idgaag-idiidb:ses;idgaag-aasi:ses;idgaag-gh97i:ses;ihgd9gdgca-gdadg:#gshghg;daagsada:7haaac;}.digids hcegi {ggghdg:aashgai;}." - + "bgaihehhi {sadhi:aasi;ahheah9:hcahca;ehaahc9:s 7ses;bhg9hc:s;}.bgaihehhi .cd7hagah {ahhi-hi9aa:cdca;}.s9fgaciagidhhihdc {bhg9hc:ses hgid;}.ahdhfeh9a9dciaci {ihgd9gdgca-hbh9a:gga(hi9aah/ahdhfid9.ge9);i" - + "hgd9gdgca-gaeahi:gaeahi-9;}shca9haghaaaaagihdc,.asfhahgg7fid9,#aaaaa7,.aaaaa7fihifshaafaasi,.iddaihg,.iddaihgfid9,.aaaaa7fihih,.aaaaa7fbacg .ihifbha,.aaaaa7fihifshaafgh97i,aha.aaaaa7fhgihaa .ihifbha,." - + "ahdhfaaaaa9,.gdagbcf7ahaagfadc9,.ahdhfeh9ashiaa,.ahdhfeh9agddiag,.igahagggbifehi7fgdcihhcag,.ggggacifehi7figiidch,.hahgg7fids,#aaaaah,.aaaaahfchah9hihdc,.aaaaahfhgihaa .ihifbha,.ahdhfihi .ihisd9,.ahdh" - + "fihi .haaagiaa .ihisd9,.ahdhfihighaa,#aaaaa9,.aaaaa9,aha.9ghaids .s7ag,aha.9ghaids .sig,aha.9ghaids .sig ia,.gdagbcf7ahaag,.ihifhbhaafid9,.ihifhbhaafdssfid9,.eagbfihifhaaagiaa .ihifhbhaafid9,.ahdhfaaa" - + "aah {ihgd9gdgca-hbh9a:gga(heghiahfgfd.ec9);ihgd9gdgca-gaeahi:gaeahi-s;}shca9haghaaaaagihdc {ihgd9gdgca-edhhihdc:-ses -ses;7ah97i:9gces;}.asfhahgg7fid9 {ihgd9gdgca-edhhihdc:-ses -9gces;7ah97i:97ses;}#a" - + "aaaa7,.aaaaa7fihifshaafaasi {ihgd9gdgca-edhhihdc:-ses -7aces;7ah97i:gces;}.iddaihg,.iddaihgfid9 {ihgd9gdgca-edhhihdc:-ses -h9aes;7ah97i:gces;}a.aaaaa7fihih,.aaaaa7fbacg .ihifbha,.aaaaa7fihifshaafgh97i" - + " {ihgd9gdgca-edhhihdc:-ses -hages;7ah97i:hhes;}aha.aaaaa7fhgihaa .ihifbha {ihgd9gdgca-edhhihdc:-ses -hdbes;7ah97i:hhes;}.ahdhfaaaaa9 {ihgd9gdgca-edhhihdc:-ses -ghses;7ah97i:h7es;}.gdagbcf7ahaagfadc9 {" - + "ihgd9gdgca-edhhihdc:-ses -ga7es;7ah97i:hses;}.ahdhfeh9ashiaa {ihgd9gdgca-edhhihdc:-ses -gd7es;7ah97i:7des;}.hahgg7fgefgh97ifgdgcag {ihgd9gdgca-edhhihdc:-h9es -99ges;ahai7:9ses;7ah97i:ces;}.hahgg7fid9 " - + "{ihgd9gdgca-hbh9a:gga(hi9aah/haahcgaafehcaafid9.ge9);ihgd9gdgca-gaeahi:gaeahi-s;}.eh9afihiaa,aha.eh9afgdcigdah,aha.sdgbfgdcigdah,aha.9gh-ahhad9 aha.9gh-bdagaa aha.si,aha.gh97ifeh9afgdciaci aha.9gh-bda" - + "gaa aha.7a,aha.ggahiahh7hga9dciaciagah aha.9gh-bdagaa aha.si,aha.cdihs99dciaciagah aha.9gh-bdagaa aha.si,aha.agdesdshh7hga9dciaciagah aha.9gh-bdagaa aha.si,.sdgbfihiaafihg,aha.9gh-ahhad9 aha.9gh-bdaga" - + "a aha.7a,.hcaggaacfihiaashg,.ihiaaf7ahaag,.gh97ifihiaaf7ahaag,.aasifihiaaf7ahaag,.igiidcfid9,.hchgihaa .igiidcfid9 {ihgd9gdgca-hbh9a:gga(ihhaaeghiahfgfd.ec9);ihgd9gdgca-gaeahi:gaeahi-s;}.eh9afihiaa,ah" - + "a.eh9afgdcigdah,aha.sdgbfgdcigdah,aha.9gh-ahhad9 aha.9gh-bdagaa aha.si,aha.gh97ifeh9afgdciaci aha.9gh-bdagaa aha.7a,aha.ggahiahh7hga9dciaciagah aha.9gh-bdagaa aha.si,aha.cdihs99dciaciagah aha.9gh-bdag" - + "aa aha.si,aha.agdesdshh7hga9dciaciagah aha.9gh-bdagaa aha.si {ihgd9gdgca-edhhihdc:-ses -ses;7ah97i:7des;}.sdgbfihiaafihg,aha.9gh-ahhad9 aha.9gh-bdagaa aha.7a,.hcaggaacfihiaashg,.ihiaaf7ahaag,.gh97ifih" - + "iaaf7ahaag,.aasifihiaaf7ahaag {ihgd9gdgca-edhhihdc:-ses -7des;7ah97i:7aes;}.igiidcfid9 {edhhihdc:gaahihaa;bhg9hc-gh97i:7es;ehaahc9-gh97i:9hes;ehaahc9-aasi:9hes;bhg9hc-aasi:7es;a7hia-hehga:cdaghe;ihgd9" - + "gdgca-edhhihdc:-ses -ddes;7ah97i:77es;}.hchgihaa .igiidcfid9 {ihgd9gdgca-edhhihdc:-ses -bbes;7ah97i:77es;}.aashgaifad9d,.hchgihaa .igiidcfaasi,.igiidcfaasi,.igiidcfgh97i,.hchgihaa .igiidcfgh97i,.hgdcf" - + "hcsd,.hgdcfaggdg {ihgd9gdgca-hbh9a:gga(ihhaaeghiahfghgh.ec9);ihgd9gdgca-gaeahi:cd-gaeahi;}.aashgaifad9d {ihgd9gdgca-edhhihdc:-ses -ses;ahai7:c7es;7ah97i:hdes;}.hchgihaa .igiidcfaasi {ihgd9gdgca-edhhih" - + "dc:-c7es -ses;ahai7:9ges;7ah97i:77es;}.igiidcfaasi {edhhihdc:hihdagia;ide:ses;aasi:-7es;ihgd9gdgca-edhhihdc:-daes -ses;ahai7:9hes;7ah97i:77es;}.igiidcfgh97i {edhhihdc:hihdagia;ide:ses;gh97i:-7es;ihgd9" - + "gdgca-edhhihdc:-9sdes -ses;ahai7:9hes;7ah97i:77es;}.hchgihaa .igiidcfgh97i {ihgd9gdgca-edhhihdc:-977es -ses;ahai7:9hes;7ah97i:77es;}.hgdcfhcsd {ihgd9gdgca-edhhihdc:-c7es -77es;ahai7:9ges;7ah97i:9des;}" - + ".hgdcfaggdg {ihgd9gdgca-edhhihdc:-daes -77es;ahai7:9ges;7ah97i:9ges;}"; - - var largeNewValue = largeTest, - len = largeTest.length, - count = nextRandom() % 20, - removeBound = len-(count*100), - logData = []; - for (; count > 0; count--) { - var removePos = nextRandom() % removeBound; - var removeLength = 1+nextRandom()%100; - logData.push("(" + removePos + ", " + removeLength + ")"); - largeNewValue = largeNewValue.substring(0, removePos) - + largeNewValue.substring(removePos + removeLength); - } - log("len: " + len + " count: " + count + " removed ( " + logData.join(", ") + " )"); - - diffResult = diff.diffWords(largeTest, largeNewValue); - log("diffResult length: " + diffResult.length); - var removeCount = 0; - var removeChanges = [], addChanges = [], testChanges = []; - for (var i = 0; i < diffResult.length; i++) { - if (diffResult[i].removed) { - log("remove Change " + i, diffResult[i]); - removeChanges.push(diffResult[i].value); - } else if (diffResult[i].added) { - log("add Change " + i, diffResult[i]); - addChanges.push(diffResult[i].value); - } else { - log("no Change " + i, diffResult[i]); - removeChanges.push(diffResult[i].value); - addChanges.push(diffResult[i].value); - } - } - - log("diffResult remove length: " + removeCount); - assert.equal(largeTest.replace(/s+/g, ""), removeChanges.join("").replace(/s+/g, ""), "New Diff results match"); - assert.equal(largeNewValue.replace(/s+/g, ""), addChanges.join("").replace(/s+/g, ""), "Old Diff results match"); -}; - -exports['Patch'] = function() { - // Create patch - var oldFile = - "value\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "remove value\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "remove value\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "value\n" - + "context\n" - + "context"; - var newFile = - "new value\n" - + "new value 2\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "add value\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "new value\n" - + "new value 2\n" - + "context\n" - + "context"; - var expectedResult = - "Index: testFileName\n" - + "===================================================================\n" - + "--- testFileName\tOld Header\n" - + "+++ testFileName\tNew Header\n" - + "@@ -1,5 +1,6 @@\n" - + "+new value\n" - + "+new value 2\n" - + "-value\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "@@ -7,9 +8,8 @@\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "-remove value\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "@@ -17,20 +17,21 @@\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "-remove value\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "+add value\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "+new value\n" - + "+new value 2\n" - + "-value\n" - + " context\n" - + " context\n" - + "\\ No newline at end of file\n"; - - diffResult = diff.createPatch("testFileName", oldFile, newFile, "Old Header", "New Header"); - assert.equal( - expectedResult, - diffResult); - - expectedResult = - "Index: testFileName\n" - + "===================================================================\n" - + "--- testFileName\tOld Header\n" - + "+++ testFileName\tNew Header\n"; - diffResult = diff.createPatch("testFileName", oldFile, oldFile, "Old Header", "New Header"); - assert.equal( - expectedResult, - diffResult, - "Patch same diffResult Value"); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/.npmignore deleted file mode 100644 index 2af4b71..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.*.swp -test/a/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/.travis.yml deleted file mode 100644 index baa0031..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/README.md deleted file mode 100644 index cc69164..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/README.md +++ /dev/null @@ -1,250 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/examples/g.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/examples/g.js deleted file mode 100644 index be122df..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/examples/g.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/examples/usr-local.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/examples/usr-local.js deleted file mode 100644 index 327a425..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/examples/usr-local.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/glob.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/glob.js deleted file mode 100644 index f0118a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/glob.js +++ /dev/null @@ -1,675 +0,0 @@ -// 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.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) - } - - if (this.mark) { - // at *some* point we statted all of these - all = all.map(function (m) { - var sc = this.cache[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) { - if (!this.stat || this.statCache[m] || m === this.EOF) { - this._emitQueue.push(m) - this._processEmitQueue() - } else { - this._stat(m, function(exists, isDir) { - if (exists) { - 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) - - 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.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) - }) - -} - -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index ca91152..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,442 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/package.json deleted file mode 100644 index e044da3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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" - }, - "_id": "graceful-fs@1.2.3", - "_from": "graceful-fs@~1.2.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d532..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/ulimit.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/ulimit.js deleted file mode 100644 index 8d0882d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/ulimit.js +++ /dev/null @@ -1,158 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/README.md deleted file mode 100644 index b2beaed..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/inherits.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/inherits.js deleted file mode 100644 index 061b396..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/package.json deleted file mode 100644 index aae88db..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/inherits/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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" - }, - "_id": "inherits@1.0.0", - "_from": "inherits@1", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/README.md deleted file mode 100644 index 6fd07d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -### 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. **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 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. - - -## 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.) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/minimatch.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index 405746b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1079 +0,0 @@ -;(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.monkeyPatch = monkeyPatch -function monkeyPatch () { - var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") - var orig = desc.value - desc.value = function (p) { - if (p instanceof Minimatch) return p.match(this) - return orig.call(this, p) - } - Object.defineProperty(String.prototype, desc) -} - -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.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) console.error(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) - }) - - if (options.debug) console.error(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - if (options.debug) console.error(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - if (options.debug) console.error(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) !== "{") { - // console.error(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error(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) { - // console.error("no sets") - return [pattern] - } - - var tail = braceExpand(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) { - // console.error("numset", numset[1], numset[2]) - var suf = braceExpand(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 = "" - } - - // console.error("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error("", 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) { - // console.error("didn't close", pattern) - return braceExpand("\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - // console.error("set", set) - // console.error("suffix", pattern.substr(i)) - var suf = braceExpand(pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - // console.error("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand(p, options) - }) - // console.error("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}(?:$|\\\/))" - : "(?!\\.)" - - 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 - } - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - if (options.debug) { - console.error("%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 "!": - if (options.debug) { - console.error("%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) { - 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. - 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 === "!" ? "(?:(?!" : "(?:" - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - 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 - } - - 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 + "|" - }) - - // console.error("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) { - // console.error("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) - if (options.debug) { - console.error(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 - // console.error(this.pattern, "set", set) - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i] - var hit = this.matchOne(f, 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 - - if (options.debug) { - console.error("matchOne", - { "this": this - , file: file - , pattern: pattern }) - } - - if (options.matchBase && pattern.length === 1) { - file = path.basename(file.join("/")).split("/") - } - - if (options.debug) { - console.error("matchOne", file.length, pattern.length) - } - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - if (options.debug) { - console.error("matchOne loop") - } - var p = pattern[pi] - , f = file[fi] - - if (options.debug) { - console.error(pattern, p, f) - } - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - if (options.debug) - console.error('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) { - if (options.debug) - console.error('** 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] - - if (options.debug) { - console.error('\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)) { - if (options.debug) - console.error('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) === ".")) { - if (options.debug) - console.error("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - if (options.debug) - console.error('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 - // console.error("\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 - } - if (options.debug) { - console.error("string match", p, f, hit) - } - } else { - hit = f.match(p) - if (options.debug) { - console.error("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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/AUTHORS deleted file mode 100644 index 016d7fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Carlos Brito Lage -Marko Mikulicic -Trent Mick -Kevin O'Hara -Marco Rogers -Jesse Dailey diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js deleted file mode 100644 index 9111540..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js +++ /dev/null @@ -1,25 +0,0 @@ -var LRU = require('lru-cache'); - -var max = +process.argv[2] || 10240; -var more = 102400; - -var cache = LRU({ - max: max, maxAge: 86400e3 -}); - -// fill cache -for (var i = 0; i < max; ++i) { - cache.set(i, {}); -} - -var start = process.hrtime(); - -// adding more items -for ( ; i < max+more; ++i) { - cache.set(i, {}); -} - -var end = process.hrtime(start); -var msecs = end[0] * 1E3 + end[1] / 1E6; - -console.log('adding %d items took %d ms', more, msecs.toPrecision(5)); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 49c1dc6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,263 +0,0 @@ -;(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) - } - - var max - if (typeof options === 'number') { - max = options - options = { max: max } - } - - if (!options) options = {} - - max = options.max - - var lengthCalculator = options.length || naiveLength - - if (typeof lengthCalculator !== "function") { - lengthCalculator = naiveLength - } - - if (!max || !(typeof max === "number") || max <= 0 ) { - // a little bit silly. maybe this should throw? - max = Infinity - } - - var allowStale = options.stale || false - - var maxAge = options.maxAge || null - - var dispose = options.dispose - - var cache = Object.create(null) // hash of items by key - , lruList = Object.create(null) // list of items in order of use recency - , mru = 0 // most recently used - , lru = 0 // least recently used - , length = 0 // number of items in the list - , itemCount = 0 - - - // resize the cache when the max changes. - Object.defineProperty(this, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - max = mL - // if it gets above double max, trim right away. - // otherwise, do it whenever it's convenient. - if (length > max) trim() - } - , get : function () { return max } - , enumerable : true - }) - - // resize the cache when the lengthCalculator changes. - Object.defineProperty(this, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - lengthCalculator = naiveLength - length = itemCount - for (var key in cache) { - cache[key].length = 1 - } - } else { - lengthCalculator = lC - length = 0 - for (var key in cache) { - cache[key].length = lengthCalculator(cache[key].value) - length += cache[key].length - } - } - - if (length > max) trim() - } - , get : function () { return lengthCalculator } - , enumerable : true - }) - - Object.defineProperty(this, "length", - { get : function () { return length } - , enumerable : true - }) - - - Object.defineProperty(this, "itemCount", - { get : function () { return itemCount } - , enumerable : true - }) - - this.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - i++ - var hit = lruList[k] - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } - } - - this.keys = function () { - var keys = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - keys[i++] = hit.key - } - return keys - } - - this.values = function () { - var values = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - values[i++] = hit.value - } - return values - } - - this.reset = function () { - if (dispose) { - for (var k in cache) { - dispose(k, cache[k].value) - } - } - cache = {} - lruList = {} - lru = 0 - mru = 0 - length = 0 - itemCount = 0 - } - - // Provided for debugging/dev purposes only. No promises whatsoever that - // this API stays stable. - this.dump = function () { - return cache - } - - this.dumpLru = function () { - return lruList - } - - this.set = function (key, value) { - if (hOP(cache, key)) { - // dispose of the old one before overwriting - if (dispose) dispose(key, cache[key].value) - if (maxAge) cache[key].now = Date.now() - cache[key].value = value - this.get(key) - return true - } - - var len = lengthCalculator(value) - var age = maxAge ? Date.now() : 0 - var hit = new Entry(key, value, mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > max) { - if (dispose) dispose(key, value) - return false - } - - length += hit.length - lruList[hit.lu] = cache[key] = hit - itemCount ++ - - if (length > max) trim() - return true - } - - this.has = function (key) { - if (!hOP(cache, key)) return false - var hit = cache[key] - if (maxAge && (Date.now() - hit.now > maxAge)) { - return false - } - return true - } - - this.get = function (key) { - return get(key, true) - } - - this.peek = function (key) { - return get(key, false) - } - - function get (key, doUse) { - var hit = cache[key] - if (hit) { - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } else { - if (doUse) use(hit) - } - if (hit) hit = hit.value - } - return hit - } - - function use (hit) { - shiftLU(hit) - hit.lu = mru ++ - lruList[hit.lu] = hit - } - - this.del = function (key) { - del(cache[key]) - } - - function trim () { - while (lru < mru && length > max) - del(lruList[lru]) - } - - function shiftLU(hit) { - delete lruList[ hit.lu ] - while (lru < mru && !lruList[lru]) lru ++ - } - - function del(hit) { - if (hit) { - if (dispose) dispose(hit.key, hit.value) - length -= hit.length - itemCount -- - delete cache[ hit.key ] - shiftLU(hit) - } - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, mru, len, age) { - this.key = key - this.value = value - this.lu = mru - this.length = len - this.now = age -} - -})() diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 411acad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.3.1", - "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" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Carlos Brito Lage", - "email": "carlos@carloslage.net" - }, - { - "name": "Marko Mikulicic", - "email": "marko.mikulicic@isti.cnr.it" - }, - { - "name": "Trent Mick", - "email": "trentm@gmail.com" - }, - { - "name": "Kevin O'Hara", - "email": "kevinohara80@gmail.com" - }, - { - "name": "Marco Rogers", - "email": "marco.rogers@gmail.com" - }, - { - "name": "Jesse Dailey", - "email": "jesse.dailey@gmail.com" - } - ], - "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" - }, - "_id": "lru-cache@2.3.1", - "_from": "lru-cache@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index 70f3f8b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,329 +0,0 @@ -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() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index ec8e2eb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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" - }, - "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index a347405..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "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.12", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "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!\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### 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. **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 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\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "_id": "minimatch@0.2.12", - "_from": "minimatch@~0.2.11" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/basic.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/brace-expand.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index 7ee278a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/caching.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 25f1f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/package.json deleted file mode 100644 index 4654f76..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "3.2.1", - "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\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" - }, - "_id": "glob@3.2.1", - "dist": { - "shasum": "e3c79e8967e845154f6bca69752a40fb9a447e15" - }, - "_from": "glob@3.2.1", - "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.1.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/00-setup.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/00-setup.js deleted file mode 100644 index 245afaf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/00-setup.js +++ /dev/null @@ -1,176 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/bash-comparison.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/bash-comparison.js deleted file mode 100644 index 239ed1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/bash-comparison.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/bash-results.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/bash-results.json deleted file mode 100644 index a9bc347..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,350 +0,0 @@ -{ - "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/globstar-match.js", - "./test/mark.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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/cwd-test.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/cwd-test.js deleted file mode 100644 index 352c27e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/cwd-test.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/globstar-match.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/globstar-match.js deleted file mode 100644 index 9b234fa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/globstar-match.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/mark.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/mark.js deleted file mode 100644 index ed68a33..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/mark.js +++ /dev/null @@ -1,74 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/nocase-nomagic.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/nocase-nomagic.js deleted file mode 100644 index d862970..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/nocase-nomagic.js +++ /dev/null @@ -1,113 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/pause-resume.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/pause-resume.js deleted file mode 100644 index e1ffbab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/root-nomount.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/root-nomount.js deleted file mode 100644 index 3ac5979..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/root-nomount.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/root.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/root.js deleted file mode 100644 index 95c23f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/root.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/stat.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/stat.js deleted file mode 100644 index 6291711..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/stat.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/zz-cleanup.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/zz-cleanup.js deleted file mode 100644 index e085f0f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/glob/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/History.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/History.md deleted file mode 100644 index a4b7b49..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/History.md +++ /dev/null @@ -1,63 +0,0 @@ - -1.7.0 / 2012-12-30 -================== - - * support transient notifications in Gnome - -1.6.1 / 2012-09-25 -================== - - * restore compatibility with node < 0.8 [fgnass] - -1.6.0 / 2012-09-06 -================== - - * add notification center support [drudge] - -1.5.1 / 2012-04-08 -================== - - * Merge pull request #16 from KyleAMathews/patch-1 - * Fixes #15 - -1.5.0 / 2012-02-08 -================== - - * Added windows support [perfusorius] - -1.4.1 / 2011-12-28 -================== - - * Fixed: dont exit(). Closes #9 - -1.4.0 / 2011-12-17 -================== - - * Changed API: `growl.notify()` -> `growl()` - -1.3.0 / 2011-12-17 -================== - - * Added support for Ubuntu/Debian/Linux users [niftylettuce] - * Fixed: send notifications even if title not specified [alessioalex] - -1.2.0 / 2011-10-06 -================== - - * Add support for priority. - -1.1.0 / 2011-03-15 -================== - - * Added optional callbacks - * Added parsing of version - -1.0.1 / 2010-03-26 -================== - - * Fixed; sys.exec -> child_process.exec to support latest node - -1.0.0 / 2010-03-19 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/Readme.md deleted file mode 100644 index 48d717c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/Readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# Growl for nodejs - -Growl support for Nodejs. This is essentially a port of my [Ruby Growl Library](http://github.com/visionmedia/growl). Ubuntu/Linux support added thanks to [@niftylettuce](http://github.com/niftylettuce). - -## Installation - -### Install - -### Mac OS X (Darwin): - - Install [growlnotify(1)](http://growl.info/extras.php#growlnotify). On OS X 10.8, Notification Center is supported using [terminal-notifier](https://github.com/alloy/terminal-notifier). To install: - - $ sudo gem install terminal-notifier - - Install [npm](http://npmjs.org/) and run: - - $ npm install growl - -### Ubuntu (Linux): - - Install `notify-send` through the [libnotify-bin](http://packages.ubuntu.com/libnotify-bin) package: - - $ sudo apt-get install libnotify-bin - - Install [npm](http://npmjs.org/) and run: - - $ npm install growl - -### Windows: - - Download and install [Growl for Windows](http://www.growlforwindows.com/gfw/default.aspx) - - Download [growlnotify](http://www.growlforwindows.com/gfw/help/growlnotify.aspx) - **IMPORTANT :** Unpack growlnotify to a folder that is present in your path! - - Install [npm](http://npmjs.org/) and run: - - $ npm install growl - -## Examples - -Callback functions are optional - - var growl = require('growl') - growl('You have mail!') - growl('5 new messages', { sticky: true }) - growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true }) - growl('Message with title', { title: 'Title'}) - growl('Set priority', { priority: 2 }) - growl('Show Safari icon', { image: 'Safari' }) - growl('Show icon', { image: 'path/to/icon.icns' }) - growl('Show image', { image: 'path/to/my.image.png' }) - growl('Show png filesystem icon', { image: 'png' }) - growl('Show pdf filesystem icon', { image: 'article.pdf' }) - growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(err){ - // ... notified - }) - -## Options - - - title - - notification title - - name - - application name - - priority - - priority for the notification (default is 0) - - sticky - - weither or not the notification should remainin until closed - - image - - Auto-detects the context: - - path to an icon sets --iconpath - - path to an image sets --image - - capitalized word sets --appIcon - - filename uses extname as --icon - - otherwise treated as --icon - -## License - -(The MIT License) - -Copyright (c) 2009 TJ Holowaychuk - -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/lib/growl.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/lib/growl.js deleted file mode 100644 index 04f4f9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/lib/growl.js +++ /dev/null @@ -1,234 +0,0 @@ -// Growl - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Module dependencies. - */ - -var exec = require('child_process').exec - , fs = require('fs') - , path = require('path') - , exists = fs.existsSync || path.existsSync - , os = require('os') - , quote = JSON.stringify - , cmd; - -function which(name) { - var paths = process.env.PATH.split(':'); - var loc; - - for (var i = 0, len = paths.length; i < len; ++i) { - loc = path.join(paths[i], name); - if (exists(loc)) return loc; - } -} - -switch(os.type()) { - case 'Darwin': - if (which('terminal-notifier')) { - cmd = { - type: "Darwin-NotificationCenter" - , pkg: "terminal-notifier" - , msg: '-message' - , title: '-title' - , subtitle: '-subtitle' - , priority: { - cmd: '-execute' - , range: [] - } - }; - } else { - cmd = { - type: "Darwin-Growl" - , pkg: "growlnotify" - , msg: '-m' - , sticky: '--sticky' - , priority: { - cmd: '--priority' - , range: [ - -2 - , -1 - , 0 - , 1 - , 2 - , "Very Low" - , "Moderate" - , "Normal" - , "High" - , "Emergency" - ] - } - }; - } - break; - case 'Linux': - cmd = { - type: "Linux" - , pkg: "notify-send" - , msg: '' - , sticky: '-t 0' - , icon: '-i' - , priority: { - cmd: '-u' - , range: [ - "low" - , "normal" - , "critical" - ] - } - }; - break; - case 'Windows_NT': - cmd = { - type: "Windows" - , pkg: "growlnotify" - , msg: '' - , sticky: '/s:true' - , title: '/t:' - , icon: '/i:' - , priority: { - cmd: '/p:' - , range: [ - -2 - , -1 - , 0 - , 1 - , 2 - ] - } - }; - break; -} - -/** - * Expose `growl`. - */ - -exports = module.exports = growl; - -/** - * Node-growl version. - */ - -exports.version = '1.4.1' - -/** - * Send growl notification _msg_ with _options_. - * - * Options: - * - * - title Notification title - * - sticky Make the notification stick (defaults to false) - * - priority Specify an int or named key (default is 0) - * - name Application name (defaults to growlnotify) - * - image - * - path to an icon sets --iconpath - * - path to an image sets --image - * - capitalized word sets --appIcon - * - filename uses extname as --icon - * - otherwise treated as --icon - * - * Examples: - * - * growl('New email') - * growl('5 new emails', { title: 'Thunderbird' }) - * growl('Email sent', function(){ - * // ... notification sent - * }) - * - * @param {string} msg - * @param {object} options - * @param {function} fn - * @api public - */ - -function growl(msg, options, fn) { - var image - , args - , options = options || {} - , fn = fn || function(){}; - - // noop - if (!cmd) return fn(new Error('growl not supported on this platform')); - args = [cmd.pkg]; - - // image - if (image = options.image) { - switch(cmd.type) { - case 'Darwin-Growl': - var flag, ext = path.extname(image).substr(1) - flag = flag || ext == 'icns' && 'iconpath' - flag = flag || /^[A-Z]/.test(image) && 'appIcon' - flag = flag || /^png|gif|jpe?g$/.test(ext) && 'image' - flag = flag || ext && (image = ext) && 'icon' - flag = flag || 'icon' - args.push('--' + flag, image) - break; - case 'Linux': - args.push(cmd.icon + " " + image); - // libnotify defaults to sticky, set a hint for transient notifications - if (!options.sticky) args.push('--hint=int:transient:1'); - break; - case 'Windows': - args.push(cmd.icon + quote(image)); - break; - } - } - - // sticky - if (options.sticky) args.push(cmd.sticky); - - // priority - if (options.priority) { - var priority = options.priority + ''; - var checkindexOf = cmd.priority.range.indexOf(priority); - if (~cmd.priority.range.indexOf(priority)) { - args.push(cmd.priority, options.priority); - } - } - - // name - if (options.name && cmd.type === "Darwin-Growl") { - args.push('--name', options.name); - } - - switch(cmd.type) { - case 'Darwin-Growl': - args.push(cmd.msg); - args.push(quote(msg)); - if (options.title) args.push(quote(options.title)); - break; - case 'Darwin-NotificationCenter': - args.push(cmd.msg); - args.push(quote(msg)); - if (options.title) { - args.push(cmd.title); - args.push(quote(options.title)); - } - if (options.subtitle) { - args.push(cmd.subtitle); - args.push(quote(options.title)); - } - break; - case 'Darwin-Growl': - args.push(cmd.msg); - args.push(quote(msg)); - if (options.title) args.push(quote(options.title)); - break; - case 'Linux': - if (options.title) { - args.push(quote(options.title)); - args.push(cmd.msg); - args.push(quote(msg)); - } else { - args.push(quote(msg)); - } - break; - case 'Windows': - args.push(quote(msg)); - if (options.title) args.push(cmd.title + quote(options.title)); - break; - } - - // execute - exec(args.join(' '), fn); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/package.json deleted file mode 100644 index 6565e46..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "growl", - "version": "1.7.0", - "description": "Growl unobtrusive notifications", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "main": "./lib/growl.js", - "readme": "# Growl for nodejs\n\nGrowl support for Nodejs. This is essentially a port of my [Ruby Growl Library](http://github.com/visionmedia/growl). Ubuntu/Linux support added thanks to [@niftylettuce](http://github.com/niftylettuce). \n\n## Installation\n\n### Install \n\n### Mac OS X (Darwin):\n\n Install [growlnotify(1)](http://growl.info/extras.php#growlnotify). On OS X 10.8, Notification Center is supported using [terminal-notifier](https://github.com/alloy/terminal-notifier). To install:\n \n $ sudo gem install terminal-notifier\n \n Install [npm](http://npmjs.org/) and run:\n \n $ npm install growl\n\n### Ubuntu (Linux):\n\n Install `notify-send` through the [libnotify-bin](http://packages.ubuntu.com/libnotify-bin) package:\n\n $ sudo apt-get install libnotify-bin\n\n Install [npm](http://npmjs.org/) and run:\n \n $ npm install growl\n\n### Windows:\n\n Download and install [Growl for Windows](http://www.growlforwindows.com/gfw/default.aspx)\n\n Download [growlnotify](http://www.growlforwindows.com/gfw/help/growlnotify.aspx) - **IMPORTANT :** Unpack growlnotify to a folder that is present in your path!\n\n Install [npm](http://npmjs.org/) and run:\n \n $ npm install growl\n\n## Examples\n\nCallback functions are optional\n\n var growl = require('growl')\n growl('You have mail!')\n growl('5 new messages', { sticky: true })\n growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })\n growl('Message with title', { title: 'Title'})\n growl('Set priority', { priority: 2 })\n growl('Show Safari icon', { image: 'Safari' })\n growl('Show icon', { image: 'path/to/icon.icns' })\n growl('Show image', { image: 'path/to/my.image.png' })\n growl('Show png filesystem icon', { image: 'png' })\n growl('Show pdf filesystem icon', { image: 'article.pdf' })\n growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(err){\n // ... notified\n })\n\n## Options\n\n - title\n - notification title\n - name\n - application name\n - priority\n - priority for the notification (default is 0)\n - sticky\n - weither or not the notification should remainin until closed\n - image\n - Auto-detects the context:\n - path to an icon sets --iconpath\n - path to an image sets --image\n - capitalized word sets --appIcon\n - filename uses extname as --icon\n - otherwise treated as --icon\n \n## License \n\n(The MIT License)\n\nCopyright (c) 2009 TJ Holowaychuk \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.\n", - "readmeFilename": "Readme.md", - "_id": "growl@1.7.0", - "_from": "growl@1.7.x" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/test.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/test.js deleted file mode 100644 index cf22d90..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/growl/test.js +++ /dev/null @@ -1,20 +0,0 @@ - -var growl = require('./lib/growl') - -growl('You have mail!') -growl('5 new messages', { sticky: true }) -growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true }) -growl('Message with title', { title: 'Title'}) -growl('Set priority', { priority: 2 }) -growl('Show Safari icon', { image: 'Safari' }) -growl('Show icon', { image: 'path/to/icon.icns' }) -growl('Show image', { image: 'path/to/my.image.png' }) -growl('Show png filesystem icon', { image: 'png' }) -growl('Show pdf filesystem icon', { image: 'article.pdf' }) -growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(){ - console.log('callback'); -}) -growl('Show pdf filesystem icon', { title: 'Use show()', image: 'article.pdf' }) -growl('here \' are \n some \\ characters that " need escaping', {}, function(error, stdout, stderr) { - if (error !== null) throw new Error('escaping failed:\n' + stdout + stderr); -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/.npmignore deleted file mode 100644 index b9af3d4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -test -support -benchmarks -examples -lib-cov -coverage.html -.gitmodules -.travis.yml -History.md -Readme.md -Makefile -test/ -support/ -benchmarks/ -examples/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/LICENSE deleted file mode 100644 index 8ad0e0d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2009-2010 TJ Holowaychuk - -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/bin/jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/bin/jade deleted file mode 100755 index 7e6002f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/bin/jade +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var fs = require('fs') - , program = require('commander') - , path = require('path') - , basename = path.basename - , dirname = path.dirname - , resolve = path.resolve - , join = path.join - , mkdirp = require('mkdirp') - , jade = require('../'); - -// jade options - -var options = {}; - -// options - -program - .version(jade.version) - .usage('[options] [dir|file ...]') - .option('-o, --obj ', 'javascript options object') - .option('-O, --out ', 'output the compiled html to ') - .option('-p, --path ', 'filename used to resolve includes') - .option('-P, --pretty', 'compile pretty html output') - .option('-c, --client', 'compile for client-side runtime.js') - .option('-D, --no-debug', 'compile without debugging (smaller functions)') - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' # translate jade the templates dir'); - console.log(' $ jade templates'); - console.log(''); - console.log(' # create {foo,bar}.html'); - console.log(' $ jade {foo,bar}.jade'); - console.log(''); - console.log(' # jade over stdio'); - console.log(' $ jade < my.jade > my.html'); - console.log(''); - console.log(' # jade over stdio'); - console.log(' $ echo "h1 Jade!" | jade'); - console.log(''); - console.log(' # foo, bar dirs rendering to /tmp'); - console.log(' $ jade foo bar --out /tmp '); - console.log(''); -}); - -program.parse(process.argv); - -// options given, parse them - -if (program.obj) options = eval('(' + program.obj + ')'); - -// --filename - -if (program.path) options.filename = program.path; - -// --no-debug - -options.compileDebug = program.debug; - -// --client - -options.client = program.client; - -// --pretty - -options.pretty = program.pretty; - -// left-over args are file paths - -var files = program.args; - -// compile files - -if (files.length) { - console.log(); - files.forEach(renderFile); - process.on('exit', console.log); -// stdio -} else { - stdin(); -} - -/** - * Compile from stdin. - */ - -function stdin() { - var buf = ''; - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(chunk){ buf += chunk; }); - process.stdin.on('end', function(){ - var fn = jade.compile(buf, options); - var output = options.client - ? fn.toString() - : fn(options); - process.stdout.write(output); - }).resume(); -} - -/** - * Process the given path, compiling the jade files found. - * Always walk the subdirectories. - */ - -function renderFile(path) { - var re = /\.jade$/; - fs.lstat(path, function(err, stat) { - if (err) throw err; - // Found jade file - if (stat.isFile() && re.test(path)) { - fs.readFile(path, 'utf8', function(err, str){ - if (err) throw err; - options.filename = path; - var fn = jade.compile(str, options); - var extname = options.client ? '.js' : '.html'; - path = path.replace(re, extname); - if (program.out) path = join(program.out, basename(path)); - var dir = resolve(dirname(path)); - mkdirp(dir, 0755, function(err){ - if (err) throw err; - var output = options.client - ? fn.toString() - : fn(options); - fs.writeFile(path, output, function(err){ - if (err) throw err; - console.log(' \033[90mrendered \033[36m%s\033[0m', path); - }); - }); - }); - // Found directory - } else if (stat.isDirectory()) { - fs.readdir(path, function(err, files) { - if (err) throw err; - files.map(function(filename) { - return path + '/' + filename; - }).forEach(renderFile); - }); - } - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/index.js deleted file mode 100644 index 8ad059f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = process.env.JADE_COV - ? require('./lib-cov/jade') - : require('./lib/jade'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.js deleted file mode 100644 index 1983a20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.js +++ /dev/null @@ -1,3586 +0,0 @@ -(function() { - -// CommonJS require() - -function require(p){ - var path = require.resolve(p) - , mod = require.modules[path]; - if (!mod) throw new Error('failed to require "' + p + '"'); - if (!mod.exports) { - mod.exports = {}; - mod.call(mod.exports, mod, mod.exports, require.relative(path)); - } - return mod.exports; - } - -require.modules = {}; - -require.resolve = function (path){ - var orig = path - , reg = path + '.js' - , index = path + '/index.js'; - return require.modules[reg] && reg - || require.modules[index] && index - || orig; - }; - -require.register = function (path, fn){ - require.modules[path] = fn; - }; - -require.relative = function (parent) { - return function(p){ - if ('.' != p.charAt(0)) return require(p); - - var path = parent.split('/') - , segs = p.split('/'); - path.pop(); - - for (var i = 0; i < segs.length; i++) { - var seg = segs[i]; - if ('..' == seg) path.pop(); - else if ('.' != seg) path.push(seg); - } - - return require(path.join('/')); - }; - }; - - -require.register("compiler.js", function(module, exports, require){ - -/*! - * Jade - Compiler - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var nodes = require('./nodes') - , filters = require('./filters') - , doctypes = require('./doctypes') - , selfClosing = require('./self-closing') - , runtime = require('./runtime') - , utils = require('./utils'); - - - if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } - } - - if (!String.prototype.trimLeft) { - String.prototype.trimLeft = function(){ - return this.replace(/^\s+/, ''); - } - } - - - -/** - * Initialize `Compiler` with the given `node`. - * - * @param {Node} node - * @param {Object} options - * @api public - */ - -var Compiler = module.exports = function Compiler(node, options) { - this.options = options = options || {}; - this.node = node; - this.hasCompiledDoctype = false; - this.hasCompiledTag = false; - this.pp = options.pretty || false; - this.debug = false !== options.compileDebug; - this.indents = 0; - this.parentIndents = 0; - if (options.doctype) this.setDoctype(options.doctype); -}; - -/** - * Compiler prototype. - */ - -Compiler.prototype = { - - /** - * Compile parse tree to JavaScript. - * - * @api public - */ - - compile: function(){ - this.buf = ['var interp;']; - if (this.pp) this.buf.push("var __indent = [];"); - this.lastBufferedIdx = -1; - this.visit(this.node); - return this.buf.join('\n'); - }, - - /** - * Sets the default doctype `name`. Sets terse mode to `true` when - * html 5 is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {string} name - * @api public - */ - - setDoctype: function(name){ - var doctype = doctypes[(name || 'default').toLowerCase()]; - doctype = doctype || ''; - this.doctype = doctype; - this.terse = '5' == name || 'html' == name; - this.xml = 0 == this.doctype.indexOf(' 1 && !escape && block.nodes[0].isText && block.nodes[1].isText) - this.prettyIndent(1, true); - - for (var i = 0; i < len; ++i) { - // Pretty print text - if (pp && i > 0 && !escape && block.nodes[i].isText && block.nodes[i-1].isText) - this.prettyIndent(1, false); - - this.visit(block.nodes[i]); - // Multiple text nodes are separated by newlines - if (block.nodes[i+1] && block.nodes[i].isText && block.nodes[i+1].isText) - this.buffer('\\n'); - } - }, - - /** - * Visit `doctype`. Sets terse mode to `true` when html 5 - * is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {Doctype} doctype - * @api public - */ - - visitDoctype: function(doctype){ - if (doctype && (doctype.val || !this.doctype)) { - this.setDoctype(doctype.val || 'default'); - } - - if (this.doctype) this.buffer(this.doctype); - this.hasCompiledDoctype = true; - }, - - /** - * Visit `mixin`, generating a function that - * may be called within the template. - * - * @param {Mixin} mixin - * @api public - */ - - visitMixin: function(mixin){ - var name = mixin.name.replace(/-/g, '_') + '_mixin' - , args = mixin.args || '' - , block = mixin.block - , attrs = mixin.attrs - , pp = this.pp; - - if (mixin.call) { - if (pp) this.buf.push("__indent.push('" + Array(this.indents + 1).join(' ') + "');") - if (block || attrs.length) { - - this.buf.push(name + '.call({'); - - if (block) { - this.buf.push('block: function(){'); - - // Render block with no indents, dynamically added when rendered - this.parentIndents++; - var _indents = this.indents; - this.indents = 0; - this.visit(mixin.block); - this.indents = _indents; - this.parentIndents--; - - if (attrs.length) { - this.buf.push('},'); - } else { - this.buf.push('}'); - } - } - - if (attrs.length) { - var val = this.attrs(attrs); - if (val.inherits) { - this.buf.push('attributes: merge({' + val.buf - + '}, attributes), escaped: merge(' + val.escaped + ', escaped, true)'); - } else { - this.buf.push('attributes: {' + val.buf + '}, escaped: ' + val.escaped); - } - } - - if (args) { - this.buf.push('}, ' + args + ');'); - } else { - this.buf.push('});'); - } - - } else { - this.buf.push(name + '(' + args + ');'); - } - if (pp) this.buf.push("__indent.pop();") - } else { - this.buf.push('var ' + name + ' = function(' + args + '){'); - this.buf.push('var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};'); - this.parentIndents++; - this.visit(block); - this.parentIndents--; - this.buf.push('};'); - } - }, - - /** - * Visit `tag` buffering tag markup, generating - * attributes, visiting the `tag`'s code and block. - * - * @param {Tag} tag - * @api public - */ - - visitTag: function(tag){ - this.indents++; - var name = tag.name - , pp = this.pp; - - if (tag.buffer) name = "' + (" + name + ") + '"; - - if (!this.hasCompiledTag) { - if (!this.hasCompiledDoctype && 'html' == name) { - this.visitDoctype(); - } - this.hasCompiledTag = true; - } - - // pretty print - if (pp && !tag.isInline()) - this.prettyIndent(0, true); - - if ((~selfClosing.indexOf(name) || tag.selfClosing) && !this.xml) { - this.buffer('<' + name); - this.visitAttributes(tag.attrs); - this.terse - ? this.buffer('>') - : this.buffer('/>'); - } else { - // Optimize attributes buffering - if (tag.attrs.length) { - this.buffer('<' + name); - if (tag.attrs.length) this.visitAttributes(tag.attrs); - this.buffer('>'); - } else { - this.buffer('<' + name + '>'); - } - if (tag.code) this.visitCode(tag.code); - this.escape = 'pre' == tag.name; - this.visit(tag.block); - - // pretty print - if (pp && !tag.isInline() && 'pre' != tag.name && !tag.canInline()) - this.prettyIndent(0, true); - - this.buffer(''); - } - this.indents--; - }, - - /** - * Visit `filter`, throwing when the filter does not exist. - * - * @param {Filter} filter - * @api public - */ - - visitFilter: function(filter){ - var fn = filters[filter.name]; - - // unknown filter - if (!fn) { - if (filter.isASTFilter) { - throw new Error('unknown ast filter "' + filter.name + ':"'); - } else { - throw new Error('unknown filter ":' + filter.name + '"'); - } - } - - if (filter.isASTFilter) { - this.buf.push(fn(filter.block, this, filter.attrs)); - } else { - var text = filter.block.nodes.map(function(node){ return node.val }).join('\n'); - filter.attrs = filter.attrs || {}; - filter.attrs.filename = this.options.filename; - this.buffer(utils.text(fn(text, filter.attrs))); - } - }, - - /** - * Visit `text` node. - * - * @param {Text} text - * @api public - */ - - visitText: function(text){ - text = utils.text(text.val.replace(/\\/g, '\\\\')); - if (this.escape) text = escape(text); - this.buffer(text); - }, - - /** - * Visit a `comment`, only buffering when the buffer flag is set. - * - * @param {Comment} comment - * @api public - */ - - visitComment: function(comment){ - if (!comment.buffer) return; - if (this.pp) this.prettyIndent(1, true); - this.buffer(''); - }, - - /** - * Visit a `BlockComment`. - * - * @param {Comment} comment - * @api public - */ - - visitBlockComment: function(comment){ - if (!comment.buffer) return; - if (0 == comment.val.trim().indexOf('if')) { - this.buffer(''); - } else { - this.buffer(''); - } - }, - - /** - * Visit `code`, respecting buffer / escape flags. - * If the code is followed by a block, wrap it in - * a self-calling function. - * - * @param {Code} code - * @api public - */ - - visitCode: function(code){ - // Wrap code blocks with {}. - // we only wrap unbuffered code blocks ATM - // since they are usually flow control - - // Buffer code - if (code.buffer) { - var val = code.val.trimLeft(); - this.buf.push('var __val__ = ' + val); - val = 'null == __val__ ? "" : __val__'; - if (code.escape) val = 'escape(' + val + ')'; - this.buf.push("buf.push(" + val + ");"); - } else { - this.buf.push(code.val); - } - - // Block support - if (code.block) { - if (!code.buffer) this.buf.push('{'); - this.visit(code.block); - if (!code.buffer) this.buf.push('}'); - } - }, - - /** - * Visit `each` block. - * - * @param {Each} each - * @api public - */ - - visitEach: function(each){ - this.buf.push('' - + '// iterate ' + each.obj + '\n' - + ';(function(){\n' - + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' - + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push('' - + ' }\n' - + ' } else {\n' - + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' - + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push(' }\n'); - - this.buf.push(' }\n }\n}).call(this);\n'); - }, - - /** - * Visit `attrs`. - * - * @param {Array} attrs - * @api public - */ - - visitAttributes: function(attrs){ - var val = this.attrs(attrs); - if (val.inherits) { - this.buf.push("buf.push(attrs(merge({ " + val.buf + - " }, attributes), merge(" + val.escaped + ", escaped, true)));"); - } else if (val.constant) { - eval('var buf={' + val.buf + '};'); - this.buffer(runtime.attrs(buf, JSON.parse(val.escaped)), true); - } else { - this.buf.push("buf.push(attrs({ " + val.buf + " }, " + val.escaped + "));"); - } - }, - - /** - * Compile attributes. - */ - - attrs: function(attrs){ - var buf = [] - , classes = [] - , escaped = {} - , constant = attrs.every(function(attr){ return isConstant(attr.val) }) - , inherits = false; - - if (this.terse) buf.push('terse: true'); - - attrs.forEach(function(attr){ - if (attr.name == 'attributes') return inherits = true; - escaped[attr.name] = attr.escaped; - if (attr.name == 'class') { - classes.push('(' + attr.val + ')'); - } else { - var pair = "'" + attr.name + "':(" + attr.val + ')'; - buf.push(pair); - } - }); - - if (classes.length) { - classes = classes.join(" + ' ' + "); - buf.push("class: " + classes); - } - - return { - buf: buf.join(', ').replace('class:', '"class":'), - escaped: JSON.stringify(escaped), - inherits: inherits, - constant: constant - }; - } -}; - -/** - * Check if expression can be evaluated to a constant - * - * @param {String} expression - * @return {Boolean} - * @api private - */ - -function isConstant(val){ - // Check strings/literals - if (/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val)) - return true; - - // Check numbers - if (!isNaN(Number(val))) - return true; - - // Check arrays - var matches; - if (matches = /^ *\[(.*)\] *$/.exec(val)) - return matches[1].split(',').every(isConstant); - - return false; -} - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} -}); // module: compiler.js - -require.register("doctypes.js", function(module, exports, require){ - -/*! - * Jade - doctypes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - '5': '' - , 'default': '' - , 'xml': '' - , 'transitional': '' - , 'strict': '' - , 'frameset': '' - , '1.1': '' - , 'basic': '' - , 'mobile': '' -}; -}); // module: doctypes.js - -require.register("filters.js", function(module, exports, require){ - -/*! - * Jade - filters - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - - /** - * Wrap text with CDATA block. - */ - - cdata: function(str){ - return ''; - }, - - /** - * Transform sass to css, wrapped in style tags. - */ - - sass: function(str){ - str = str.replace(/\\n/g, '\n'); - var sass = require('sass').render(str).replace(/\n/g, '\\n'); - return ''; - }, - - /** - * Transform stylus to css, wrapped in style tags. - */ - - stylus: function(str, options){ - var ret; - str = str.replace(/\\n/g, '\n'); - var stylus = require('stylus'); - stylus(str, options).render(function(err, css){ - if (err) throw err; - ret = css.replace(/\n/g, '\\n'); - }); - return ''; - }, - - /** - * Transform less to css, wrapped in style tags. - */ - - less: function(str){ - var ret; - str = str.replace(/\\n/g, '\n'); - require('less').render(str, function(err, css){ - if (err) throw err; - ret = ''; - }); - return ret; - }, - - /** - * Transform markdown to html. - */ - - markdown: function(str){ - var md; - - // support markdown / discount - try { - md = require('markdown'); - } catch (err){ - try { - md = require('discount'); - } catch (err) { - try { - md = require('markdown-js'); - } catch (err) { - try { - md = require('marked'); - } catch (err) { - throw new - Error('Cannot find markdown library, install markdown, discount, or marked.'); - } - } - } - } - - str = str.replace(/\\n/g, '\n'); - return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); - }, - - /** - * Transform coffeescript to javascript. - */ - - coffeescript: function(str){ - str = str.replace(/\\n/g, '\n'); - var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n'); - return ''; - } -}; - -}); // module: filters.js - -require.register("inline-tags.js", function(module, exports, require){ - -/*! - * Jade - inline tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'a' - , 'abbr' - , 'acronym' - , 'b' - , 'br' - , 'code' - , 'em' - , 'font' - , 'i' - , 'img' - , 'ins' - , 'kbd' - , 'map' - , 'samp' - , 'small' - , 'span' - , 'strong' - , 'sub' - , 'sup' -]; -}); // module: inline-tags.js - -require.register("jade.js", function(module, exports, require){ -/*! - * Jade - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Parser = require('./parser') - , Lexer = require('./lexer') - , Compiler = require('./compiler') - , runtime = require('./runtime') - -/** - * Library version. - */ - -exports.version = '0.26.1'; - -/** - * Expose self closing tags. - */ - -exports.selfClosing = require('./self-closing'); - -/** - * Default supported doctypes. - */ - -exports.doctypes = require('./doctypes'); - -/** - * Text filters. - */ - -exports.filters = require('./filters'); - -/** - * Utilities. - */ - -exports.utils = require('./utils'); - -/** - * Expose `Compiler`. - */ - -exports.Compiler = Compiler; - -/** - * Expose `Parser`. - */ - -exports.Parser = Parser; - -/** - * Expose `Lexer`. - */ - -exports.Lexer = Lexer; - -/** - * Nodes. - */ - -exports.nodes = require('./nodes'); - -/** - * Jade runtime helpers. - */ - -exports.runtime = runtime; - -/** - * Template function cache. - */ - -exports.cache = {}; - -/** - * Parse the given `str` of jade and return a function body. - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api private - */ - -function parse(str, options){ - try { - // Parse - var parser = new Parser(str, options.filename, options); - - // Compile - var compiler = new (options.compiler || Compiler)(parser.parse(), options) - , js = compiler.compile(); - - // Debug compiler - if (options.debug) { - console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); - } - - return '' - + 'var buf = [];\n' - + (options.self - ? 'var self = locals || {};\n' + js - : 'with (locals || {}) {\n' + js + '\n}\n') - + 'return buf.join("");'; - } catch (err) { - parser = parser.context(); - runtime.rethrow(err, parser.filename, parser.lexer.lineno); - } -} - -/** - * Compile a `Function` representation of the given jade `str`. - * - * Options: - * - * - `compileDebug` when `false` debugging code is stripped from the compiled template - * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` - * for use with the Jade client-side runtime.js - * - * @param {String} str - * @param {Options} options - * @return {Function} - * @api public - */ - -exports.compile = function(str, options){ - var options = options || {} - , client = options.client - , filename = options.filename - ? JSON.stringify(options.filename) - : 'undefined' - , fn; - - if (options.compileDebug !== false) { - fn = [ - 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' - , 'try {' - , parse(String(str), options) - , '} catch (err) {' - , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' - , '}' - ].join('\n'); - } else { - fn = parse(String(str), options); - } - - if (client) { - fn = 'attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n' + fn; - } - - fn = new Function('locals, attrs, escape, rethrow, merge', fn); - - if (client) return fn; - - return function(locals){ - return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow, runtime.merge); - }; -}; - -/** - * Render the given `str` of jade and invoke - * the callback `fn(err, str)`. - * - * Options: - * - * - `cache` enable template caching - * - `filename` filename required for `include` / `extends` and caching - * - * @param {String} str - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -exports.render = function(str, options, fn){ - // swap args - if ('function' == typeof options) { - fn = options, options = {}; - } - - // cache requires .filename - if (options.cache && !options.filename) { - return fn(new Error('the "filename" option is required for caching')); - } - - try { - var path = options.filename; - var tmpl = options.cache - ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) - : exports.compile(str, options); - fn(null, tmpl(options)); - } catch (err) { - fn(err); - } -}; - -/** - * Render a Jade file at the given `path` and callback `fn(err, str)`. - * - * @param {String} path - * @param {Object|Function} options or callback - * @param {Function} fn - * @api public - */ - -exports.renderFile = function(path, options, fn){ - var key = path + ':string'; - - if ('function' == typeof options) { - fn = options, options = {}; - } - - try { - options.filename = path; - var str = options.cache - ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) - : fs.readFileSync(path, 'utf8'); - exports.render(str, options, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Express support. - */ - -exports.__express = exports.renderFile; - -}); // module: jade.js - -require.register("lexer.js", function(module, exports, require){ - -/*! - * Jade - Lexer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize `Lexer` with the given `str`. - * - * Options: - * - * - `colons` allow colons for attr delimiters - * - * @param {String} str - * @param {Object} options - * @api private - */ - -var Lexer = module.exports = function Lexer(str, options) { - options = options || {}; - this.input = str.replace(/\r\n|\r/g, '\n'); - this.colons = options.colons; - this.deferredTokens = []; - this.lastIndents = 0; - this.lineno = 1; - this.stash = []; - this.indentStack = []; - this.indentRe = null; - this.pipeless = false; -}; - -/** - * Lexer prototype. - */ - -Lexer.prototype = { - - /** - * Construct a token with the given `type` and `val`. - * - * @param {String} type - * @param {String} val - * @return {Object} - * @api private - */ - - tok: function(type, val){ - return { - type: type - , line: this.lineno - , val: val - } - }, - - /** - * Consume the given `len` of input. - * - * @param {Number} len - * @api private - */ - - consume: function(len){ - this.input = this.input.substr(len); - }, - - /** - * Scan for `type` with the given `regexp`. - * - * @param {String} type - * @param {RegExp} regexp - * @return {Object} - * @api private - */ - - scan: function(regexp, type){ - var captures; - if (captures = regexp.exec(this.input)) { - this.consume(captures[0].length); - return this.tok(type, captures[1]); - } - }, - - /** - * Defer the given `tok`. - * - * @param {Object} tok - * @api private - */ - - defer: function(tok){ - this.deferredTokens.push(tok); - }, - - /** - * Lookahead `n` tokens. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - var fetch = n - this.stash.length; - while (fetch-- > 0) this.stash.push(this.next()); - return this.stash[--n]; - }, - - /** - * Return the indexOf `start` / `end` delimiters. - * - * @param {String} start - * @param {String} end - * @return {Number} - * @api private - */ - - indexOfDelimiters: function(start, end){ - var str = this.input - , nstart = 0 - , nend = 0 - , pos = 0; - for (var i = 0, len = str.length; i < len; ++i) { - if (start == str.charAt(i)) { - ++nstart; - } else if (end == str.charAt(i)) { - if (++nend == nstart) { - pos = i; - break; - } - } - } - return pos; - }, - - /** - * Stashed token. - */ - - stashed: function() { - return this.stash.length - && this.stash.shift(); - }, - - /** - * Deferred token. - */ - - deferred: function() { - return this.deferredTokens.length - && this.deferredTokens.shift(); - }, - - /** - * end-of-source. - */ - - eos: function() { - if (this.input.length) return; - if (this.indentStack.length) { - this.indentStack.shift(); - return this.tok('outdent'); - } else { - return this.tok('eos'); - } - }, - - /** - * Blank line. - */ - - blank: function() { - var captures; - if (captures = /^\n *\n/.exec(this.input)) { - this.consume(captures[0].length - 1); - if (this.pipeless) return this.tok('text', ''); - return this.next(); - } - }, - - /** - * Comment. - */ - - comment: function() { - var captures; - if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('comment', captures[2]); - tok.buffer = '-' != captures[1]; - return tok; - } - }, - - /** - * Interpolated tag. - */ - - interpolation: function() { - var captures; - if (captures = /^#\{(.*?)\}/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('interpolation', captures[1]); - } - }, - - /** - * Tag. - */ - - tag: function() { - var captures; - if (captures = /^(\w[-:\w]*)(\/?)/.exec(this.input)) { - this.consume(captures[0].length); - var tok, name = captures[1]; - if (':' == name[name.length - 1]) { - name = name.slice(0, -1); - tok = this.tok('tag', name); - this.defer(this.tok(':')); - while (' ' == this.input[0]) this.input = this.input.substr(1); - } else { - tok = this.tok('tag', name); - } - tok.selfClosing = !! captures[2]; - return tok; - } - }, - - /** - * Filter. - */ - - filter: function() { - return this.scan(/^:(\w+)/, 'filter'); - }, - - /** - * Doctype. - */ - - doctype: function() { - return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); - }, - - /** - * Id. - */ - - id: function() { - return this.scan(/^#([\w-]+)/, 'id'); - }, - - /** - * Class. - */ - - className: function() { - return this.scan(/^\.([\w-]+)/, 'class'); - }, - - /** - * Text. - */ - - text: function() { - return this.scan(/^(?:\| ?| ?)?([^\n]+)/, 'text'); - }, - - /** - * Extends. - */ - - "extends": function() { - return this.scan(/^extends? +([^\n]+)/, 'extends'); - }, - - /** - * Block prepend. - */ - - prepend: function() { - var captures; - if (captures = /^prepend +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'prepend' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block append. - */ - - append: function() { - var captures; - if (captures = /^append +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'append' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block. - */ - - block: function() { - var captures; - if (captures = /^block\b *(?:(prepend|append) +)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = captures[1] || 'replace' - , name = captures[2] - , tok = this.tok('block', name); - - tok.mode = mode; - return tok; - } - }, - - /** - * Yield. - */ - - yield: function() { - return this.scan(/^yield */, 'yield'); - }, - - /** - * Include. - */ - - include: function() { - return this.scan(/^include +([^\n]+)/, 'include'); - }, - - /** - * Case. - */ - - "case": function() { - return this.scan(/^case +([^\n]+)/, 'case'); - }, - - /** - * When. - */ - - when: function() { - return this.scan(/^when +([^:\n]+)/, 'when'); - }, - - /** - * Default. - */ - - "default": function() { - return this.scan(/^default */, 'default'); - }, - - /** - * Assignment. - */ - - assignment: function() { - var captures; - if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { - this.consume(captures[0].length); - var name = captures[1] - , val = captures[2]; - return this.tok('code', 'var ' + name + ' = (' + val + ');'); - } - }, - - /** - * Call mixin. - */ - - call: function(){ - var captures; - if (captures = /^\+([-\w]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('call', captures[1]); - - // Check for args (not attributes) - if (captures = /^ *\((.*?)\)/.exec(this.input)) { - if (!/^ *[-\w]+ *=/.test(captures[1])) { - this.consume(captures[0].length); - tok.args = captures[1]; - } - } - - return tok; - } - }, - - /** - * Mixin. - */ - - mixin: function(){ - var captures; - if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('mixin', captures[1]); - tok.args = captures[2]; - return tok; - } - }, - - /** - * Conditional. - */ - - conditional: function() { - var captures; - if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var type = captures[1] - , js = captures[2]; - - switch (type) { - case 'if': js = 'if (' + js + ')'; break; - case 'unless': js = 'if (!(' + js + '))'; break; - case 'else if': js = 'else if (' + js + ')'; break; - case 'else': js = 'else'; break; - } - - return this.tok('code', js); - } - }, - - /** - * While. - */ - - "while": function() { - var captures; - if (captures = /^while +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('code', 'while (' + captures[1] + ')'); - } - }, - - /** - * Each. - */ - - each: function() { - var captures; - if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('each', captures[1]); - tok.key = captures[2] || '$index'; - tok.code = captures[3]; - return tok; - } - }, - - /** - * Code. - */ - - code: function() { - var captures; - if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var flags = captures[1]; - captures[1] = captures[2]; - var tok = this.tok('code', captures[1]); - tok.escape = flags[0] === '='; - tok.buffer = flags[0] === '=' || flags[1] === '='; - return tok; - } - }, - - /** - * Attributes. - */ - - attrs: function() { - if ('(' == this.input.charAt(0)) { - var index = this.indexOfDelimiters('(', ')') - , str = this.input.substr(1, index-1) - , tok = this.tok('attrs') - , len = str.length - , colons = this.colons - , states = ['key'] - , escapedAttr - , key = '' - , val = '' - , quote - , c - , p; - - function state(){ - return states[states.length - 1]; - } - - function interpolate(attr) { - return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ - return quote + " + (" + expr + ") + " + quote; - }); - } - - this.consume(index + 1); - tok.attrs = {}; - tok.escaped = {}; - - function parse(c) { - var real = c; - // TODO: remove when people fix ":" - if (colons && ':' == c) c = '='; - switch (c) { - case ',': - case '\n': - switch (state()) { - case 'expr': - case 'array': - case 'string': - case 'object': - val += c; - break; - default: - states.push('key'); - val = val.trim(); - key = key.trim(); - if ('' == key) return; - key = key.replace(/^['"]|['"]$/g, '').replace('!', ''); - tok.escaped[key] = escapedAttr; - tok.attrs[key] = '' == val - ? true - : interpolate(val); - key = val = ''; - } - break; - case '=': - switch (state()) { - case 'key char': - key += real; - break; - case 'val': - case 'expr': - case 'array': - case 'string': - case 'object': - val += real; - break; - default: - escapedAttr = '!' != p; - states.push('val'); - } - break; - case '(': - if ('val' == state() - || 'expr' == state()) states.push('expr'); - val += c; - break; - case ')': - if ('expr' == state() - || 'val' == state()) states.pop(); - val += c; - break; - case '{': - if ('val' == state()) states.push('object'); - val += c; - break; - case '}': - if ('object' == state()) states.pop(); - val += c; - break; - case '[': - if ('val' == state()) states.push('array'); - val += c; - break; - case ']': - if ('array' == state()) states.pop(); - val += c; - break; - case '"': - case "'": - switch (state()) { - case 'key': - states.push('key char'); - break; - case 'key char': - states.pop(); - break; - case 'string': - if (c == quote) states.pop(); - val += c; - break; - default: - states.push('string'); - val += c; - quote = c; - } - break; - case '': - break; - default: - switch (state()) { - case 'key': - case 'key char': - key += c; - break; - default: - val += c; - } - } - p = c; - } - - for (var i = 0; i < len; ++i) { - parse(str.charAt(i)); - } - - parse(','); - - if ('/' == this.input.charAt(0)) { - this.consume(1); - tok.selfClosing = true; - } - - return tok; - } - }, - - /** - * Indent | Outdent | Newline. - */ - - indent: function() { - var captures, re; - - // established regexp - if (this.indentRe) { - captures = this.indentRe.exec(this.input); - // determine regexp - } else { - // tabs - re = /^\n(\t*) */; - captures = re.exec(this.input); - - // spaces - if (captures && !captures[1].length) { - re = /^\n( *)/; - captures = re.exec(this.input); - } - - // established - if (captures && captures[1].length) this.indentRe = re; - } - - if (captures) { - var tok - , indents = captures[1].length; - - ++this.lineno; - this.consume(indents + 1); - - if (' ' == this.input[0] || '\t' == this.input[0]) { - throw new Error('Invalid indentation, you can use tabs or spaces but not both'); - } - - // blank line - if ('\n' == this.input[0]) return this.tok('newline'); - - // outdent - if (this.indentStack.length && indents < this.indentStack[0]) { - while (this.indentStack.length && this.indentStack[0] > indents) { - this.stash.push(this.tok('outdent')); - this.indentStack.shift(); - } - tok = this.stash.pop(); - // indent - } else if (indents && indents != this.indentStack[0]) { - this.indentStack.unshift(indents); - tok = this.tok('indent', indents); - // newline - } else { - tok = this.tok('newline'); - } - - return tok; - } - }, - - /** - * Pipe-less text consumed only when - * pipeless is true; - */ - - pipelessText: function() { - if (this.pipeless) { - if ('\n' == this.input[0]) return; - var i = this.input.indexOf('\n'); - if (-1 == i) i = this.input.length; - var str = this.input.substr(0, i); - this.consume(str.length); - return this.tok('text', str); - } - }, - - /** - * ':' - */ - - colon: function() { - return this.scan(/^: */, ':'); - }, - - /** - * Return the next token object, or those - * previously stashed by lookahead. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.stashed() - || this.next(); - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - next: function() { - return this.deferred() - || this.blank() - || this.eos() - || this.pipelessText() - || this.yield() - || this.doctype() - || this.interpolation() - || this["case"]() - || this.when() - || this["default"]() - || this["extends"]() - || this.append() - || this.prepend() - || this.block() - || this.include() - || this.mixin() - || this.call() - || this.conditional() - || this.each() - || this["while"]() - || this.assignment() - || this.tag() - || this.filter() - || this.code() - || this.id() - || this.className() - || this.attrs() - || this.indent() - || this.comment() - || this.colon() - || this.text(); - } -}; - -}); // module: lexer.js - -require.register("nodes/attrs.js", function(module, exports, require){ - -/*! - * Jade - nodes - Attrs - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'), - Block = require('./block'); - -/** - * Initialize a `Attrs` node. - * - * @api public - */ - -var Attrs = module.exports = function Attrs() { - this.attrs = []; -}; - -/** - * Inherit from `Node`. - */ - -Attrs.prototype = new Node; -Attrs.prototype.constructor = Attrs; - - -/** - * Set attribute `name` to `val`, keep in mind these become - * part of a raw js object literal, so to quote a value you must - * '"quote me"', otherwise or example 'user.name' is literal JavaScript. - * - * @param {String} name - * @param {String} val - * @param {Boolean} escaped - * @return {Tag} for chaining - * @api public - */ - -Attrs.prototype.setAttribute = function(name, val, escaped){ - this.attrs.push({ name: name, val: val, escaped: escaped }); - return this; -}; - -/** - * Remove attribute `name` when present. - * - * @param {String} name - * @api public - */ - -Attrs.prototype.removeAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - delete this.attrs[i]; - } - } -}; - -/** - * Get attribute value by `name`. - * - * @param {String} name - * @return {String} - * @api public - */ - -Attrs.prototype.getAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - return this.attrs[i].val; - } - } -}; - -}); // module: nodes/attrs.js - -require.register("nodes/block-comment.js", function(module, exports, require){ - -/*! - * Jade - nodes - BlockComment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `BlockComment` with the given `block`. - * - * @param {String} val - * @param {Block} block - * @param {Boolean} buffer - * @api public - */ - -var BlockComment = module.exports = function BlockComment(val, block, buffer) { - this.block = block; - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -BlockComment.prototype = new Node; -BlockComment.prototype.constructor = BlockComment; - -}); // module: nodes/block-comment.js - -require.register("nodes/block.js", function(module, exports, require){ - -/*! - * Jade - nodes - Block - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Block` with an optional `node`. - * - * @param {Node} node - * @api public - */ - -var Block = module.exports = function Block(node){ - this.nodes = []; - if (node) this.push(node); -}; - -/** - * Inherit from `Node`. - */ - -Block.prototype = new Node; -Block.prototype.constructor = Block; - - -/** - * Block flag. - */ - -Block.prototype.isBlock = true; - -/** - * Replace the nodes in `other` with the nodes - * in `this` block. - * - * @param {Block} other - * @api private - */ - -Block.prototype.replace = function(other){ - other.nodes = this.nodes; -}; - -/** - * Pust the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.push = function(node){ - return this.nodes.push(node); -}; - -/** - * Check if this block is empty. - * - * @return {Boolean} - * @api public - */ - -Block.prototype.isEmpty = function(){ - return 0 == this.nodes.length; -}; - -/** - * Unshift the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.unshift = function(node){ - return this.nodes.unshift(node); -}; - -/** - * Return the "last" block, or the first `yield` node. - * - * @return {Block} - * @api private - */ - -Block.prototype.includeBlock = function(){ - var ret = this - , node; - - for (var i = 0, len = this.nodes.length; i < len; ++i) { - node = this.nodes[i]; - if (node.yield) return node; - else if (node.textOnly) continue; - else if (node.includeBlock) ret = node.includeBlock(); - else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); - } - - return ret; -}; - -/** - * Return a clone of this block. - * - * @return {Block} - * @api private - */ - -Block.prototype.clone = function(){ - var clone = new Block; - for (var i = 0, len = this.nodes.length; i < len; ++i) { - clone.push(this.nodes[i].clone()); - } - return clone; -}; - - -}); // module: nodes/block.js - -require.register("nodes/case.js", function(module, exports, require){ - -/*! - * Jade - nodes - Case - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Case` with `expr`. - * - * @param {String} expr - * @api public - */ - -var Case = exports = module.exports = function Case(expr, block){ - this.expr = expr; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Case.prototype = new Node; -Case.prototype.constructor = Case; - - -var When = exports.When = function When(expr, block){ - this.expr = expr; - this.block = block; - this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -When.prototype = new Node; -When.prototype.constructor = When; - - - -}); // module: nodes/case.js - -require.register("nodes/code.js", function(module, exports, require){ - -/*! - * Jade - nodes - Code - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Code` node with the given code `val`. - * Code may also be optionally buffered and escaped. - * - * @param {String} val - * @param {Boolean} buffer - * @param {Boolean} escape - * @api public - */ - -var Code = module.exports = function Code(val, buffer, escape) { - this.val = val; - this.buffer = buffer; - this.escape = escape; - if (val.match(/^ *else/)) this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -Code.prototype = new Node; -Code.prototype.constructor = Code; - -}); // module: nodes/code.js - -require.register("nodes/comment.js", function(module, exports, require){ - -/*! - * Jade - nodes - Comment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Comment` with the given `val`, optionally `buffer`, - * otherwise the comment may render in the output. - * - * @param {String} val - * @param {Boolean} buffer - * @api public - */ - -var Comment = module.exports = function Comment(val, buffer) { - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -Comment.prototype = new Node; -Comment.prototype.constructor = Comment; - -}); // module: nodes/comment.js - -require.register("nodes/doctype.js", function(module, exports, require){ - -/*! - * Jade - nodes - Doctype - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Doctype` with the given `val`. - * - * @param {String} val - * @api public - */ - -var Doctype = module.exports = function Doctype(val) { - this.val = val; -}; - -/** - * Inherit from `Node`. - */ - -Doctype.prototype = new Node; -Doctype.prototype.constructor = Doctype; - -}); // module: nodes/doctype.js - -require.register("nodes/each.js", function(module, exports, require){ - -/*! - * Jade - nodes - Each - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize an `Each` node, representing iteration - * - * @param {String} obj - * @param {String} val - * @param {String} key - * @param {Block} block - * @api public - */ - -var Each = module.exports = function Each(obj, val, key, block) { - this.obj = obj; - this.val = val; - this.key = key; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Each.prototype = new Node; -Each.prototype.constructor = Each; - -}); // module: nodes/each.js - -require.register("nodes/filter.js", function(module, exports, require){ - -/*! - * Jade - nodes - Filter - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node') - , Block = require('./block'); - -/** - * Initialize a `Filter` node with the given - * filter `name` and `block`. - * - * @param {String} name - * @param {Block|Node} block - * @api public - */ - -var Filter = module.exports = function Filter(name, block, attrs) { - this.name = name; - this.block = block; - this.attrs = attrs; - this.isASTFilter = !block.nodes.every(function(node){ return node.isText }); -}; - -/** - * Inherit from `Node`. - */ - -Filter.prototype = new Node; -Filter.prototype.constructor = Filter; - -}); // module: nodes/filter.js - -require.register("nodes/index.js", function(module, exports, require){ - -/*! - * Jade - nodes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -exports.Node = require('./node'); -exports.Tag = require('./tag'); -exports.Code = require('./code'); -exports.Each = require('./each'); -exports.Case = require('./case'); -exports.Text = require('./text'); -exports.Block = require('./block'); -exports.Mixin = require('./mixin'); -exports.Filter = require('./filter'); -exports.Comment = require('./comment'); -exports.Literal = require('./literal'); -exports.BlockComment = require('./block-comment'); -exports.Doctype = require('./doctype'); - -}); // module: nodes/index.js - -require.register("nodes/literal.js", function(module, exports, require){ - -/*! - * Jade - nodes - Literal - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Literal` node with the given `str. - * - * @param {String} str - * @api public - */ - -var Literal = module.exports = function Literal(str) { - this.str = str - .replace(/\\/g, "\\\\") - .replace(/\n|\r\n/g, "\\n") - .replace(/'/g, "\\'"); -}; - -/** - * Inherit from `Node`. - */ - -Literal.prototype = new Node; -Literal.prototype.constructor = Literal; - - -}); // module: nodes/literal.js - -require.register("nodes/mixin.js", function(module, exports, require){ - -/*! - * Jade - nodes - Mixin - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Attrs = require('./attrs'); - -/** - * Initialize a new `Mixin` with `name` and `block`. - * - * @param {String} name - * @param {String} args - * @param {Block} block - * @api public - */ - -var Mixin = module.exports = function Mixin(name, args, block, call){ - this.name = name; - this.args = args; - this.block = block; - this.attrs = []; - this.call = call; -}; - -/** - * Inherit from `Attrs`. - */ - -Mixin.prototype = new Attrs; -Mixin.prototype.constructor = Mixin; - - - -}); // module: nodes/mixin.js - -require.register("nodes/node.js", function(module, exports, require){ - -/*! - * Jade - nodes - Node - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize a `Node`. - * - * @api public - */ - -var Node = module.exports = function Node(){}; - -/** - * Clone this node (return itself) - * - * @return {Node} - * @api private - */ - -Node.prototype.clone = function(){ - return this; -}; - -}); // module: nodes/node.js - -require.register("nodes/tag.js", function(module, exports, require){ - -/*! - * Jade - nodes - Tag - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Attrs = require('./attrs'), - Block = require('./block'), - inlineTags = require('../inline-tags'); - -/** - * Initialize a `Tag` node with the given tag `name` and optional `block`. - * - * @param {String} name - * @param {Block} block - * @api public - */ - -var Tag = module.exports = function Tag(name, block) { - this.name = name; - this.attrs = []; - this.block = block || new Block; -}; - -/** - * Inherit from `Attrs`. - */ - -Tag.prototype = new Attrs; -Tag.prototype.constructor = Tag; - - -/** - * Clone this tag. - * - * @return {Tag} - * @api private - */ - -Tag.prototype.clone = function(){ - var clone = new Tag(this.name, this.block.clone()); - clone.line = this.line; - clone.attrs = this.attrs; - clone.textOnly = this.textOnly; - return clone; -}; - -/** - * Check if this tag is an inline tag. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.isInline = function(){ - return ~inlineTags.indexOf(this.name); -}; - -/** - * Check if this tag's contents can be inlined. Used for pretty printing. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.canInline = function(){ - var nodes = this.block.nodes; - - function isInline(node){ - // Recurse if the node is a block - if (node.isBlock) return node.nodes.every(isInline); - return node.isText || (node.isInline && node.isInline()); - } - - // Empty tag - if (!nodes.length) return true; - - // Text-only or inline-only tag - if (1 == nodes.length) return isInline(nodes[0]); - - // Multi-line inline-only tag - if (this.block.nodes.every(isInline)) { - for (var i = 1, len = nodes.length; i < len; ++i) { - if (nodes[i-1].isText && nodes[i].isText) - return false; - } - return true; - } - - // Mixed tag - return false; -}; -}); // module: nodes/tag.js - -require.register("nodes/text.js", function(module, exports, require){ - -/*! - * Jade - nodes - Text - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Text` node with optional `line`. - * - * @param {String} line - * @api public - */ - -var Text = module.exports = function Text(line) { - this.val = ''; - if ('string' == typeof line) this.val = line; -}; - -/** - * Inherit from `Node`. - */ - -Text.prototype = new Node; -Text.prototype.constructor = Text; - - -/** - * Flag as text. - */ - -Text.prototype.isText = true; -}); // module: nodes/text.js - -require.register("parser.js", function(module, exports, require){ - -/*! - * Jade - Parser - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Lexer = require('./lexer') - , nodes = require('./nodes'); - -/** - * Initialize `Parser` with the given input `str` and `filename`. - * - * @param {String} str - * @param {String} filename - * @param {Object} options - * @api public - */ - -var Parser = exports = module.exports = function Parser(str, filename, options){ - this.input = str; - this.lexer = new Lexer(str, options); - this.filename = filename; - this.blocks = {}; - this.mixins = {}; - this.options = options; - this.contexts = [this]; -}; - -/** - * Tags that may not contain tags. - */ - -var textOnly = exports.textOnly = ['script', 'style']; - -/** - * Parser prototype. - */ - -Parser.prototype = { - - /** - * Push `parser` onto the context stack, - * or pop and return a `Parser`. - */ - - context: function(parser){ - if (parser) { - this.contexts.push(parser); - } else { - return this.contexts.pop(); - } - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.lexer.advance(); - }, - - /** - * Skip `n` tokens. - * - * @param {Number} n - * @api private - */ - - skip: function(n){ - while (n--) this.advance(); - }, - - /** - * Single token lookahead. - * - * @return {Object} - * @api private - */ - - peek: function() { - return this.lookahead(1); - }, - - /** - * Return lexer lineno. - * - * @return {Number} - * @api private - */ - - line: function() { - return this.lexer.lineno; - }, - - /** - * `n` token lookahead. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - return this.lexer.lookahead(n); - }, - - /** - * Parse input returning a string of js for evaluation. - * - * @return {String} - * @api public - */ - - parse: function(){ - var block = new nodes.Block, parser; - block.line = this.line(); - - while ('eos' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - - if (parser = this.extending) { - this.context(parser); - var ast = parser.parse(); - this.context(); - // hoist mixins - for (var name in this.mixins) - ast.unshift(this.mixins[name]); - return ast; - } - - return block; - }, - - /** - * Expect the given type, or throw an exception. - * - * @param {String} type - * @api private - */ - - expect: function(type){ - if (this.peek().type === type) { - return this.advance(); - } else { - throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); - } - }, - - /** - * Accept the given `type`. - * - * @param {String} type - * @api private - */ - - accept: function(type){ - if (this.peek().type === type) { - return this.advance(); - } - }, - - /** - * tag - * | doctype - * | mixin - * | include - * | filter - * | comment - * | text - * | each - * | code - * | yield - * | id - * | class - * | interpolation - */ - - parseExpr: function(){ - switch (this.peek().type) { - case 'tag': - return this.parseTag(); - case 'mixin': - return this.parseMixin(); - case 'block': - return this.parseBlock(); - case 'case': - return this.parseCase(); - case 'when': - return this.parseWhen(); - case 'default': - return this.parseDefault(); - case 'extends': - return this.parseExtends(); - case 'include': - return this.parseInclude(); - case 'doctype': - return this.parseDoctype(); - case 'filter': - return this.parseFilter(); - case 'comment': - return this.parseComment(); - case 'text': - return this.parseText(); - case 'each': - return this.parseEach(); - case 'code': - return this.parseCode(); - case 'call': - return this.parseCall(); - case 'interpolation': - return this.parseInterpolation(); - case 'yield': - this.advance(); - var block = new nodes.Block; - block.yield = true; - return block; - case 'id': - case 'class': - var tok = this.advance(); - this.lexer.defer(this.lexer.tok('tag', 'div')); - this.lexer.defer(tok); - return this.parseExpr(); - default: - throw new Error('unexpected token "' + this.peek().type + '"'); - } - }, - - /** - * Text - */ - - parseText: function(){ - var tok = this.expect('text') - , node = new nodes.Text(tok.val); - node.line = this.line(); - return node; - }, - - /** - * ':' expr - * | block - */ - - parseBlockExpansion: function(){ - if (':' == this.peek().type) { - this.advance(); - return new nodes.Block(this.parseExpr()); - } else { - return this.block(); - } - }, - - /** - * case - */ - - parseCase: function(){ - var val = this.expect('case').val - , node = new nodes.Case(val); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * when - */ - - parseWhen: function(){ - var val = this.expect('when').val - return new nodes.Case.When(val, this.parseBlockExpansion()); - }, - - /** - * default - */ - - parseDefault: function(){ - this.expect('default'); - return new nodes.Case.When('default', this.parseBlockExpansion()); - }, - - /** - * code - */ - - parseCode: function(){ - var tok = this.expect('code') - , node = new nodes.Code(tok.val, tok.buffer, tok.escape) - , block - , i = 1; - node.line = this.line(); - while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; - block = 'indent' == this.lookahead(i).type; - if (block) { - this.skip(i-1); - node.block = this.block(); - } - return node; - }, - - /** - * comment - */ - - parseComment: function(){ - var tok = this.expect('comment') - , node; - - if ('indent' == this.peek().type) { - node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); - } else { - node = new nodes.Comment(tok.val, tok.buffer); - } - - node.line = this.line(); - return node; - }, - - /** - * doctype - */ - - parseDoctype: function(){ - var tok = this.expect('doctype') - , node = new nodes.Doctype(tok.val); - node.line = this.line(); - return node; - }, - - /** - * filter attrs? text-block - */ - - parseFilter: function(){ - var block - , tok = this.expect('filter') - , attrs = this.accept('attrs'); - - this.lexer.pipeless = true; - block = this.parseTextBlock(); - this.lexer.pipeless = false; - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * tag ':' attrs? block - */ - - parseASTFilter: function(){ - var block - , tok = this.expect('tag') - , attrs = this.accept('attrs'); - - this.expect(':'); - block = this.block(); - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * each block - */ - - parseEach: function(){ - var tok = this.expect('each') - , node = new nodes.Each(tok.code, tok.val, tok.key); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * 'extends' name - */ - - parseExtends: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - if (!this.filename) - throw new Error('the "filename" option is required to extend templates'); - - var path = this.expect('extends').val.trim() - , dir = dirname(this.filename); - - var path = join(dir, path + '.jade') - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - parser.blocks = this.blocks; - parser.contexts = this.contexts; - this.extending = parser; - - // TODO: null node - return new nodes.Literal(''); - }, - - /** - * 'block' name block - */ - - parseBlock: function(){ - var block = this.expect('block') - , mode = block.mode - , name = block.val.trim(); - - block = 'indent' == this.peek().type - ? this.block() - : new nodes.Block(new nodes.Literal('')); - - var prev = this.blocks[name]; - - if (prev) { - switch (prev.mode) { - case 'append': - block.nodes = block.nodes.concat(prev.nodes); - prev = block; - break; - case 'prepend': - block.nodes = prev.nodes.concat(block.nodes); - prev = block; - break; - } - } - - block.mode = mode; - return this.blocks[name] = prev || block; - }, - - /** - * include block? - */ - - parseInclude: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - var path = this.expect('include').val.trim() - , dir = dirname(this.filename); - - if (!this.filename) - throw new Error('the "filename" option is required to use includes'); - - // no extension - if (!~basename(path).indexOf('.')) { - path += '.jade'; - } - - // non-jade - if ('.jade' != path.substr(-5)) { - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8'); - return new nodes.Literal(str); - } - - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - parser.blocks = this.blocks; - parser.mixins = this.mixins; - - this.context(parser); - var ast = parser.parse(); - this.context(); - ast.filename = path; - - if ('indent' == this.peek().type) { - ast.includeBlock().push(this.block()); - } - - return ast; - }, - - /** - * call ident block - */ - - parseCall: function(){ - var tok = this.expect('call') - , name = tok.val - , args = tok.args - , mixin = new nodes.Mixin(name, args, new nodes.Block, true); - - this.tag(mixin); - if (mixin.block.isEmpty()) mixin.block = null; - return mixin; - }, - - /** - * mixin block - */ - - parseMixin: function(){ - var tok = this.expect('mixin') - , name = tok.val - , args = tok.args - , mixin; - - // definition - if ('indent' == this.peek().type) { - mixin = new nodes.Mixin(name, args, this.block(), false); - this.mixins[name] = mixin; - return mixin; - // call - } else { - return new nodes.Mixin(name, args, null, true); - } - }, - - /** - * indent (text | newline)* outdent - */ - - parseTextBlock: function(){ - var block = new nodes.Block; - block.line = this.line(); - var spaces = this.expect('indent').val; - if (null == this._spaces) this._spaces = spaces; - var indent = Array(spaces - this._spaces + 1).join(' '); - while ('outdent' != this.peek().type) { - switch (this.peek().type) { - case 'newline': - this.advance(); - break; - case 'indent': - this.parseTextBlock().nodes.forEach(function(node){ - block.push(node); - }); - break; - default: - var text = new nodes.Text(indent + this.advance().val); - text.line = this.line(); - block.push(text); - } - } - - if (spaces == this._spaces) this._spaces = null; - this.expect('outdent'); - return block; - }, - - /** - * indent expr* outdent - */ - - block: function(){ - var block = new nodes.Block; - block.line = this.line(); - this.expect('indent'); - while ('outdent' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - this.expect('outdent'); - return block; - }, - - /** - * interpolation (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseInterpolation: function(){ - var tok = this.advance(); - var tag = new nodes.Tag(tok.val); - tag.buffer = true; - return this.tag(tag); - }, - - /** - * tag (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseTag: function(){ - // ast-filter look-ahead - var i = 2; - if ('attrs' == this.lookahead(i).type) ++i; - if (':' == this.lookahead(i).type) { - if ('indent' == this.lookahead(++i).type) { - return this.parseASTFilter(); - } - } - - var tok = this.advance() - , tag = new nodes.Tag(tok.val); - - tag.selfClosing = tok.selfClosing; - - return this.tag(tag); - }, - - /** - * Parse tag. - */ - - tag: function(tag){ - var dot; - - tag.line = this.line(); - - // (attrs | class | id)* - out: - while (true) { - switch (this.peek().type) { - case 'id': - case 'class': - var tok = this.advance(); - tag.setAttribute(tok.type, "'" + tok.val + "'"); - continue; - case 'attrs': - var tok = this.advance() - , obj = tok.attrs - , escaped = tok.escaped - , names = Object.keys(obj); - - if (tok.selfClosing) tag.selfClosing = true; - - for (var i = 0, len = names.length; i < len; ++i) { - var name = names[i] - , val = obj[name]; - tag.setAttribute(name, val, escaped[name]); - } - continue; - default: - break out; - } - } - - // check immediate '.' - if ('.' == this.peek().val) { - dot = tag.textOnly = true; - this.advance(); - } - - // (text | code | ':')? - switch (this.peek().type) { - case 'text': - tag.block.push(this.parseText()); - break; - case 'code': - tag.code = this.parseCode(); - break; - case ':': - this.advance(); - tag.block = new nodes.Block; - tag.block.push(this.parseExpr()); - break; - } - - // newline* - while ('newline' == this.peek().type) this.advance(); - - tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); - - // script special-case - if ('script' == tag.name) { - var type = tag.getAttribute('type'); - if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { - tag.textOnly = false; - } - } - - // block? - if ('indent' == this.peek().type) { - if (tag.textOnly) { - this.lexer.pipeless = true; - tag.block = this.parseTextBlock(); - this.lexer.pipeless = false; - } else { - var block = this.block(); - if (tag.block) { - for (var i = 0, len = block.nodes.length; i < len; ++i) { - tag.block.push(block.nodes[i]); - } - } else { - tag.block = block; - } - } - } - - return tag; - } -}; - -}); // module: parser.js - -require.register("runtime.js", function(module, exports, require){ - -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Merge two attribute objects giving precedence - * to values in object `b`. Classes are special-cased - * allowing for arrays and merging/joining appropriately - * resulting in a string. - * - * @param {Object} a - * @param {Object} b - * @return {Object} a - * @api private - */ - -exports.merge = function merge(a, b) { - var ac = a['class']; - var bc = b['class']; - - if (ac || bc) { - ac = ac || []; - bc = bc || []; - if (!Array.isArray(ac)) ac = [ac]; - if (!Array.isArray(bc)) bc = [bc]; - ac = ac.filter(nulls); - bc = bc.filter(nulls); - a['class'] = ac.concat(bc).join(' '); - } - - for (var key in b) { - if (key != 'class') { - a[key] = b[key]; - } - } - - return a; -}; - -/** - * Filter null `val`s. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function nulls(val) { - return val != null; -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped && escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!(\w+|\#\d+);)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; - -}); // module: runtime.js - -require.register("self-closing.js", function(module, exports, require){ - -/*! - * Jade - self closing tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'meta' - , 'img' - , 'link' - , 'input' - , 'source' - , 'area' - , 'base' - , 'col' - , 'br' - , 'hr' -]; -}); // module: self-closing.js - -require.register("utils.js", function(module, exports, require){ - -/*! - * Jade - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Convert interpolation in the given string to JavaScript. - * - * @param {String} str - * @return {String} - * @api private - */ - -var interpolate = exports.interpolate = function(str){ - return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ - return escape - ? str - : "' + " - + ('!' == flag ? '' : 'escape') - + "((interp = " + code.replace(/\\'/g, "'") - + ") == null ? '' : interp) + '"; - }); -}; - -/** - * Escape single quotes in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -var escape = exports.escape = function(str) { - return str.replace(/'/g, "\\'"); -}; - -/** - * Interpolate, and escape the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.text = function(str){ - return interpolate(escape(str)); -}; -}); // module: utils.js - -window.jade = require("jade"); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.md deleted file mode 100644 index 051dc03..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.md +++ /dev/null @@ -1,510 +0,0 @@ - -# Jade - - The jade template engine for node.js - -## Synopsis - - jade [-h|--help] [-v|--version] [-o|--obj STR] - [-O|--out DIR] [-p|--path PATH] [-P|--pretty] - [-c|--client] [-D|--no-debug] - -## Examples - - translate jade the templates dir - - $ jade templates - - create {foo,bar}.html - - $ jade {foo,bar}.jade - - jade over stdio - - $ jade < my.jade > my.html - - jade over s - - $ echo "h1 Jade!" | jade - - foo, bar dirs rendering to /tmp - - $ jade foo bar --out /tmp - - compile client-side templates without debugging - instrumentation, making the output javascript - very light-weight. This requires runtime.js - in your projects. - - $ jade --client --no-debug < my.jade - -## Tags - - Tags are simply nested via whitespace, closing - tags defined for you. These indents are called "blocks". - - ul - li - a Foo - li - a Bar - - You may have several tags in one "block": - - ul - li - a Foo - a Bar - a Baz - -## Self-closing Tags - - Some tags are flagged as self-closing by default, such - as `meta`, `link`, and so on. To explicitly self-close - a tag simply append the `/` character: - - foo/ - foo(bar='baz')/ - - Would yield: - - - - -## Attributes - - Tag attributes look similar to HTML, however - the values are regular JavaScript, here are - some examples: - - a(href='google.com') Google - a(class='button', href='google.com') Google - - As mentioned the attribute values are just JavaScript, - this means ternary operations and other JavaScript expressions - work just fine: - - body(class=user.authenticated ? 'authenticated' : 'anonymous') - a(href=user.website || 'http://google.com') - - Multiple lines work too: - - input(type='checkbox', - name='agreement', - checked) - - Multiple lines without the comma work fine: - - input(type='checkbox' - name='agreement' - checked) - - Funky whitespace? fine: - - input( - type='checkbox' - name='agreement' - checked) - -## Boolean attributes - - Boolean attributes are mirrored by Jade, and accept - bools, aka _true_ or _false_. When no value is specified - _true_ is assumed. For example: - - input(type="checkbox", checked) - // => "" - - For example if the checkbox was for an agreement, perhaps `user.agreed` - was _true_ the following would also output 'checked="checked"': - - input(type="checkbox", checked=user.agreed) - -## Class attributes - - The _class_ attribute accepts an array of classes, - this can be handy when generated from a javascript - function etc: - - classes = ['foo', 'bar', 'baz'] - a(class=classes) - // => "" - -## Class literal - - Classes may be defined using a ".CLASSNAME" syntax: - - .button - // => "
        " - - Or chained: - - .large.button - // => "
        " - - The previous defaulted to divs, however you - may also specify the tag type: - - h1.title My Title - // => "

        My Title

        " - -## Id literal - - Much like the class literal there's an id literal: - - #user-1 - // => "
        " - - Again we may specify the tag as well: - - ul#menu - li: a(href='/home') Home - li: a(href='/store') Store - li: a(href='/contact') Contact - - Finally all of these may be used in any combination, - the following are all valid tags: - - a.button#contact(style: 'color: red') Contact - a.button(style: 'color: red')#contact Contact - a(style: 'color: red').button#contact Contact - -## Block expansion - - Jade supports the concept of "block expansion", in which - using a trailing ":" after a tag will inject a block: - - ul - li: a Foo - li: a Bar - li: a Baz - -## Text - - Arbitrary text may follow tags: - - p Welcome to my site - - yields: - -

        Welcome to my site

        - -## Pipe text - - Another form of text is "pipe" text. Pipes act - as the text margin for large bodies of text. - - p - | This is a large - | body of text for - | this tag. - | - | Nothing too - | exciting. - - yields: - -

        This is a large - body of text for - this tag. - - Nothing too - exciting. -

        - - Using pipes we can also specify regular Jade tags - within the text: - - p - | Click to visit - a(href='http://google.com') Google - | if you want. - -## Text only tags - - As an alternative to pipe text you may add - a trailing "." to indicate that the block - contains nothing but plain-text, no tags: - - p. - This is a large - body of text for - this tag. - - Nothing too - exciting. - - Some tags are text-only by default, for example - _script_, _textarea_, and _style_ tags do not - contain nested HTML so Jade implies the trailing ".": - - script - if (foo) { - bar(); - } - - style - body { - padding: 50px; - font: 14px Helvetica; - } - -## Template script tags - - Sometimes it's useful to define HTML in script - tags using Jade, typically for client-side templates. - - To do this simply give the _script_ tag an arbitrary - _type_ attribute such as _text/x-template_: - - script(type='text/template') - h1 Look! - p Jade still works in here! - -## Interpolation - - Both plain-text and piped-text support interpolation, - which comes in two forms, escapes and non-escaped. The - following will output the _user.name_ in the paragraph - but HTML within it will be escaped to prevent XSS attacks: - - p Welcome #{user.name} - - The following syntax is identical however it will _not_ escape - HTML, and should only be used with strings that you trust: - - p Welcome !{user.name} - -## Inline HTML - - Sometimes constructing small inline snippets of HTML - in Jade can be annoying, luckily we can add plain - HTML as well: - - p Welcome #{user.name} - -## Code - - To buffer output with Jade simply use _=_ at the beginning - of a line or after a tag. This method escapes any HTML - present in the string. - - p= user.description - - To buffer output unescaped use the _!=_ variant, but again - be careful of XSS. - - p!= user.description - - The final way to mess with JavaScript code in Jade is the unbuffered - _-_, which can be used for conditionals, defining variables etc: - - - var user = { description: 'foo bar baz' } - #user - - if (user.description) { - h2 Description - p.description= user.description - - } - - When compiled blocks are wrapped in anonymous functions, so the - following is also valid, without braces: - - - var user = { description: 'foo bar baz' } - #user - - if (user.description) - h2 Description - p.description= user.description - - If you really want you could even use `.forEach()` and others: - - - users.forEach(function(user){ - .user - h2= user.name - p User #{user.name} is #{user.age} years old - - }) - - Taking this further Jade provides some syntax for conditionals, - iteration, switch statements etc. Let's look at those next! - -## Assignment - - Jade's first-class assignment is simple, simply use the _=_ - operator and Jade will _var_ it for you. The following are equivalent: - - - var user = { name: 'tobi' } - user = { name: 'tobi' } - -## Conditionals - - Jade's first-class conditional syntax allows for optional - parenthesis, and you may now omit the leading _-_ otherwise - it's identical, still just regular javascript: - - user = { description: 'foo bar baz' } - #user - if user.description - h2 Description - p.description= user.description - - Jade provides the negated version, _unless_ as well, the following - are equivalent: - - - if (!(user.isAnonymous)) - p You're logged in as #{user.name} - - unless user.isAnonymous - p You're logged in as #{user.name} - -## Iteration - - JavaScript's _for_ loops don't look very declarative, so Jade - also provides its own _for_ loop construct, aliased as _each_: - - for user in users - .user - h2= user.name - p user #{user.name} is #{user.age} year old - - As mentioned _each_ is identical: - - each user in users - .user - h2= user.name - - If necessary the index is available as well: - - for user, i in users - .user(class='user-#{i}') - h2= user.name - - Remember, it's just JavaScript: - - ul#letters - for letter in ['a', 'b', 'c'] - li= letter - -## Mixins - - Mixins provide a way to define jade "functions" which "mix in" - their contents when called. This is useful for abstracting - out large fragments of Jade. - - The simplest possible mixin which accepts no arguments might - look like this: - - mixin hello - p Hello - - You use a mixin by placing `+` before the name: - - +hello - - For something a little more dynamic, mixins can take - arguments, the mixin itself is converted to a javascript - function internally: - - mixin hello(user) - p Hello #{user} - - +hello('Tobi') - - Yields: - -

        Hello Tobi

        - - Mixins may optionally take blocks, when a block is passed - its contents becomes the implicit `block` argument. For - example here is a mixin passed a block, and also invoked - without passing a block: - - mixin article(title) - .article - .article-wrapper - h1= title - if block - block - else - p No content provided - - +article('Hello world') - - +article('Hello world') - p This is my - p Amazing article - - yields: - -
        -
        -

        Hello world

        -

        No content provided

        -
        -
        - -
        -
        -

        Hello world

        -

        This is my

        -

        Amazing article

        -
        -
        - - Mixins can even take attributes, just like a tag. When - attributes are passed they become the implicit `attributes` - argument. Individual attributes can be accessed just like - normal object properties: - - mixin centered - .centered(class=attributes.class) - block - - +centered.bold Hello world - - +centered.red - p This is my - p Amazing article - - yields: - -
        Hello world
        -
        -

        This is my

        -

        Amazing article

        -
        - - If you use `attributes` directly, *all* passed attributes - get used: - - mixin link - a.menu(attributes) - block - - +link.highlight(href='#top') Top - +link#sec1.plain(href='#section1') Section 1 - +link#sec2.plain(href='#section2') Section 2 - - yields: - - Top - Section 1 - Section 2 - - If you pass arguments, they must directly follow the mixin: - - mixin list(arr) - if block - .title - block - ul(attributes) - each item in arr - li= item - - +list(['foo', 'bar', 'baz'])(id='myList', class='bold') - - yields: - -
          -
        • foo
        • -
        • bar
        • -
        • baz
        • -
        diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.min.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.min.js deleted file mode 100644 index 72e4535..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/jade.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');return mod.exports||(mod.exports={},mod.call(mod.exports,mod,mod.exports,require.relative(path))),mod.exports}require.modules={},require.resolve=function(path){var orig=path,reg=path+".js",index=path+"/index.js";return require.modules[reg]&®||require.modules[index]&&index||orig},require.register=function(path,fn){require.modules[path]=fn},require.relative=function(parent){return function(p){if("."!=p.charAt(0))return require(p);var path=parent.split("/"),segs=p.split("/");path.pop();for(var i=0;i",this.doctype=doctype,this.terse="5"==name||"html"==name,this.xml=0==this.doctype.indexOf("1&&!escape&&block.nodes[0].isText&&block.nodes[1].isText&&this.prettyIndent(1,!0);for(var i=0;i0&&!escape&&block.nodes[i].isText&&block.nodes[i-1].isText&&this.prettyIndent(1,!1),this.visit(block.nodes[i]),block.nodes[i+1]&&block.nodes[i].isText&&block.nodes[i+1].isText&&this.buffer("\\n")},visitDoctype:function(doctype){doctype&&(doctype.val||!this.doctype)&&this.setDoctype(doctype.val||"default"),this.doctype&&this.buffer(this.doctype),this.hasCompiledDoctype=!0},visitMixin:function(mixin){var name=mixin.name.replace(/-/g,"_")+"_mixin",args=mixin.args||"",block=mixin.block,attrs=mixin.attrs,pp=this.pp;if(mixin.call){pp&&this.buf.push("__indent.push('"+Array(this.indents+1).join(" ")+"');");if(block||attrs.length){this.buf.push(name+".call({");if(block){this.buf.push("block: function(){"),this.parentIndents++;var _indents=this.indents;this.indents=0,this.visit(mixin.block),this.indents=_indents,this.parentIndents--,attrs.length?this.buf.push("},"):this.buf.push("}")}if(attrs.length){var val=this.attrs(attrs);val.inherits?this.buf.push("attributes: merge({"+val.buf+"}, attributes), escaped: merge("+val.escaped+", escaped, true)"):this.buf.push("attributes: {"+val.buf+"}, escaped: "+val.escaped)}args?this.buf.push("}, "+args+");"):this.buf.push("});")}else this.buf.push(name+"("+args+");");pp&&this.buf.push("__indent.pop();")}else this.buf.push("var "+name+" = function("+args+"){"),this.buf.push("var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};"),this.parentIndents++,this.visit(block),this.parentIndents--,this.buf.push("};")},visitTag:function(tag){this.indents++;var name=tag.name,pp=this.pp;tag.buffer&&(name="' + ("+name+") + '"),this.hasCompiledTag||(!this.hasCompiledDoctype&&"html"==name&&this.visitDoctype(),this.hasCompiledTag=!0),pp&&!tag.isInline()&&this.prettyIndent(0,!0),(~selfClosing.indexOf(name)||tag.selfClosing)&&!this.xml?(this.buffer("<"+name),this.visitAttributes(tag.attrs),this.terse?this.buffer(">"):this.buffer("/>")):(tag.attrs.length?(this.buffer("<"+name),tag.attrs.length&&this.visitAttributes(tag.attrs),this.buffer(">")):this.buffer("<"+name+">"),tag.code&&this.visitCode(tag.code),this.escape="pre"==tag.name,this.visit(tag.block),pp&&!tag.isInline()&&"pre"!=tag.name&&!tag.canInline()&&this.prettyIndent(0,!0),this.buffer("")),this.indents--},visitFilter:function(filter){var fn=filters[filter.name];if(!fn)throw filter.isASTFilter?new Error('unknown ast filter "'+filter.name+':"'):new Error('unknown filter ":'+filter.name+'"');if(filter.isASTFilter)this.buf.push(fn(filter.block,this,filter.attrs));else{var text=filter.block.nodes.map(function(node){return node.val}).join("\n");filter.attrs=filter.attrs||{},filter.attrs.filename=this.options.filename,this.buffer(utils.text(fn(text,filter.attrs)))}},visitText:function(text){text=utils.text(text.val.replace(/\\/g,"\\\\")),this.escape&&(text=escape(text)),this.buffer(text)},visitComment:function(comment){if(!comment.buffer)return;this.pp&&this.prettyIndent(1,!0),this.buffer("")},visitBlockComment:function(comment){if(!comment.buffer)return;0==comment.val.trim().indexOf("if")?(this.buffer("")):(this.buffer(""))},visitCode:function(code){if(code.buffer){var val=code.val.trimLeft();this.buf.push("var __val__ = "+val),val='null == __val__ ? "" : __val__',code.escape&&(val="escape("+val+")"),this.buf.push("buf.push("+val+");")}else this.buf.push(code.val);code.block&&(code.buffer||this.buf.push("{"),this.visit(code.block),code.buffer||this.buf.push("}"))},visitEach:function(each){this.buf.push("// iterate "+each.obj+"\n"+";(function(){\n"+" if ('number' == typeof "+each.obj+".length) {\n"+" for (var "+each.key+" = 0, $$l = "+each.obj+".length; "+each.key+" < $$l; "+each.key+"++) {\n"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n } else {\n for (var "+each.key+" in "+each.obj+") {\n"+" if ("+each.obj+".hasOwnProperty("+each.key+")){"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n"),this.buf.push(" }\n }\n}).call(this);\n")},visitAttributes:function(attrs){var val=this.attrs(attrs);val.inherits?this.buf.push("buf.push(attrs(merge({ "+val.buf+" }, attributes), merge("+val.escaped+", escaped, true)));"):val.constant?(eval("var buf={"+val.buf+"};"),this.buffer(runtime.attrs(buf,JSON.parse(val.escaped)),!0)):this.buf.push("buf.push(attrs({ "+val.buf+" }, "+val.escaped+"));")},attrs:function(attrs){var buf=[],classes=[],escaped={},constant=attrs.every(function(attr){return isConstant(attr.val)}),inherits=!1;return this.terse&&buf.push("terse: true"),attrs.forEach(function(attr){if(attr.name=="attributes")return inherits=!0;escaped[attr.name]=attr.escaped;if(attr.name=="class")classes.push("("+attr.val+")");else{var pair="'"+attr.name+"':("+attr.val+")";buf.push(pair)}}),classes.length&&(classes=classes.join(" + ' ' + "),buf.push("class: "+classes)),{buf:buf.join(", ").replace("class:",'"class":'),escaped:JSON.stringify(escaped),inherits:inherits,constant:constant}}};function isConstant(val){if(/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val))return!0;if(!isNaN(Number(val)))return!0;var matches;return(matches=/^ *\[(.*)\] *$/.exec(val))?matches[1].split(",").every(isConstant):!1}function escape(html){return String(html).replace(/&(?!\w+;)/g,"&").replace(//g,">").replace(/"/g,""")}}),require.register("doctypes.js",function(module,exports,require){module.exports={5:"","default":"",xml:'',transitional:'',strict:'',frameset:'',1.1:'',basic:'',mobile:''}}),require.register("filters.js",function(module,exports,require){module.exports={cdata:function(str){return""},sass:function(str){str=str.replace(/\\n/g,"\n");var sass=require("sass").render(str).replace(/\n/g,"\\n");return'"},stylus:function(str,options){var ret;str=str.replace(/\\n/g,"\n");var stylus=require("stylus");return stylus(str,options).render(function(err,css){if(err)throw err;ret=css.replace(/\n/g,"\\n")}),'"},less:function(str){var ret;return str=str.replace(/\\n/g,"\n"),require("less").render(str,function(err,css){if(err)throw err;ret='"}),ret},markdown:function(str){var md;try{md=require("markdown")}catch(err){try{md=require("discount")}catch(err){try{md=require("markdown-js")}catch(err){try{md=require("marked")}catch(err){throw new Error("Cannot find markdown library, install markdown, discount, or marked.")}}}}return str=str.replace(/\\n/g,"\n"),md.parse(str).replace(/\n/g,"\\n").replace(/'/g,"'")},coffeescript:function(str){str=str.replace(/\\n/g,"\n");var js=require("coffee-script").compile(str).replace(/\\/g,"\\\\").replace(/\n/g,"\\n");return'"}}}),require.register("inline-tags.js",function(module,exports,require){module.exports=["a","abbr","acronym","b","br","code","em","font","i","img","ins","kbd","map","samp","small","span","strong","sub","sup"]}),require.register("jade.js",function(module,exports,require){var Parser=require("./parser"),Lexer=require("./lexer"),Compiler=require("./compiler"),runtime=require("./runtime");exports.version="0.26.1",exports.selfClosing=require("./self-closing"),exports.doctypes=require("./doctypes"),exports.filters=require("./filters"),exports.utils=require("./utils"),exports.Compiler=Compiler,exports.Parser=Parser,exports.Lexer=Lexer,exports.nodes=require("./nodes"),exports.runtime=runtime,exports.cache={};function parse(str,options){try{var parser=new Parser(str,options.filename,options),compiler=new(options.compiler||Compiler)(parser.parse(),options),js=compiler.compile();return options.debug&&console.error("\nCompiled Function:\n\n%s",js.replace(/^/gm," ")),"var buf = [];\n"+(options.self?"var self = locals || {};\n"+js:"with (locals || {}) {\n"+js+"\n}\n")+'return buf.join("");'}catch(err){parser=parser.context(),runtime.rethrow(err,parser.filename,parser.lexer.lineno)}}exports.compile=function(str,options){var options=options||{},client=options.client,filename=options.filename?JSON.stringify(options.filename):"undefined",fn;return options.compileDebug!==!1?fn=["var __jade = [{ lineno: 1, filename: "+filename+" }];","try {",parse(String(str),options),"} catch (err) {"," rethrow(err, __jade[0].filename, __jade[0].lineno);","}"].join("\n"):fn=parse(String(str),options),client&&(fn="attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n"+fn),fn=new Function("locals, attrs, escape, rethrow, merge",fn),client?fn:function(locals){return fn(locals,runtime.attrs,runtime.escape,runtime.rethrow,runtime.merge)}},exports.render=function(str,options,fn){"function"==typeof options&&(fn=options,options={});if(options.cache&&!options.filename)return fn(new Error('the "filename" option is required for caching'));try{var path=options.filename,tmpl=options.cache?exports.cache[path]||(exports.cache[path]=exports.compile(str,options)):exports.compile(str,options);fn(null,tmpl(options))}catch(err){fn(err)}},exports.renderFile=function(path,options,fn){var key=path+":string";"function"==typeof options&&(fn=options,options={});try{options.filename=path;var str=options.cache?exports.cache[key]||(exports.cache[key]=fs.readFileSync(path,"utf8")):fs.readFileSync(path,"utf8");exports.render(str,options,fn)}catch(err){fn(err)}},exports.__express=exports.renderFile}),require.register("lexer.js",function(module,exports,require){var Lexer=module.exports=function Lexer(str,options){options=options||{},this.input=str.replace(/\r\n|\r/g,"\n"),this.colons=options.colons,this.deferredTokens=[],this.lastIndents=0,this.lineno=1,this.stash=[],this.indentStack=[],this.indentRe=null,this.pipeless=!1};Lexer.prototype={tok:function(type,val){return{type:type,line:this.lineno,val:val}},consume:function(len){this.input=this.input.substr(len)},scan:function(regexp,type){var captures;if(captures=regexp.exec(this.input))return this.consume(captures[0].length),this.tok(type,captures[1])},defer:function(tok){this.deferredTokens.push(tok)},lookahead:function(n){var fetch=n-this.stash.length;while(fetch-->0)this.stash.push(this.next());return this.stash[--n]},indexOfDelimiters:function(start,end){var str=this.input,nstart=0,nend=0,pos=0;for(var i=0,len=str.length;iindents)this.stash.push(this.tok("outdent")),this.indentStack.shift();tok=this.stash.pop()}else indents&&indents!=this.indentStack[0]?(this.indentStack.unshift(indents),tok=this.tok("indent",indents)):tok=this.tok("newline");return tok}},pipelessText:function(){if(this.pipeless){if("\n"==this.input[0])return;var i=this.input.indexOf("\n");-1==i&&(i=this.input.length);var str=this.input.substr(0,i);return this.consume(str.length),this.tok("text",str)}},colon:function(){return this.scan(/^: */,":")},advance:function(){return this.stashed()||this.next()},next:function(){return this.deferred()||this.blank()||this.eos()||this.pipelessText()||this.yield()||this.doctype()||this.interpolation()||this["case"]()||this.when()||this["default"]()||this["extends"]()||this.append()||this.prepend()||this.block()||this.include()||this.mixin()||this.call()||this.conditional()||this.each()||this["while"]()||this.assignment()||this.tag()||this.filter()||this.code()||this.id()||this.className()||this.attrs()||this.indent()||this.comment()||this.colon()||this.text()}}}),require.register("nodes/attrs.js",function(module,exports,require){var Node=require("./node"),Block=require("./block"),Attrs=module.exports=function Attrs(){this.attrs=[]};Attrs.prototype=new Node,Attrs.prototype.constructor=Attrs,Attrs.prototype.setAttribute=function(name,val,escaped){return this.attrs.push({name:name,val:val,escaped:escaped}),this},Attrs.prototype.removeAttribute=function(name){for(var i=0,len=this.attrs.length;i/g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err}}),require.register("self-closing.js",function(module,exports,require){module.exports=["meta","img","link","input","source","area","base","col","br","hr"]}),require.register("utils.js",function(module,exports,require){var interpolate=exports.interpolate=function(str){return str.replace(/(\\)?([#!]){(.*?)}/g,function(str,escape,flag,code){return escape?str:"' + "+("!"==flag?"":"escape")+"((interp = "+code.replace(/\\'/g,"'")+") == null ? '' : interp) + '"})},escape=exports.escape=function(str){return str.replace(/'/g,"\\'")};exports.text=function(str){return interpolate(escape(str))}}),window.jade=require("jade")})(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/compiler.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/compiler.js deleted file mode 100644 index 516ac83..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/compiler.js +++ /dev/null @@ -1,642 +0,0 @@ - -/*! - * Jade - Compiler - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var nodes = require('./nodes') - , filters = require('./filters') - , doctypes = require('./doctypes') - , selfClosing = require('./self-closing') - , runtime = require('./runtime') - , utils = require('./utils'); - -// if browser -// -// if (!Object.keys) { -// Object.keys = function(obj){ -// var arr = []; -// for (var key in obj) { -// if (obj.hasOwnProperty(key)) { -// arr.push(key); -// } -// } -// return arr; -// } -// } -// -// if (!String.prototype.trimLeft) { -// String.prototype.trimLeft = function(){ -// return this.replace(/^\s+/, ''); -// } -// } -// -// end - - -/** - * Initialize `Compiler` with the given `node`. - * - * @param {Node} node - * @param {Object} options - * @api public - */ - -var Compiler = module.exports = function Compiler(node, options) { - this.options = options = options || {}; - this.node = node; - this.hasCompiledDoctype = false; - this.hasCompiledTag = false; - this.pp = options.pretty || false; - this.debug = false !== options.compileDebug; - this.indents = 0; - this.parentIndents = 0; - if (options.doctype) this.setDoctype(options.doctype); -}; - -/** - * Compiler prototype. - */ - -Compiler.prototype = { - - /** - * Compile parse tree to JavaScript. - * - * @api public - */ - - compile: function(){ - this.buf = ['var interp;']; - if (this.pp) this.buf.push("var __indent = [];"); - this.lastBufferedIdx = -1; - this.visit(this.node); - return this.buf.join('\n'); - }, - - /** - * Sets the default doctype `name`. Sets terse mode to `true` when - * html 5 is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {string} name - * @api public - */ - - setDoctype: function(name){ - var doctype = doctypes[(name || 'default').toLowerCase()]; - doctype = doctype || ''; - this.doctype = doctype; - this.terse = '5' == name || 'html' == name; - this.xml = 0 == this.doctype.indexOf(' 1 && !escape && block.nodes[0].isText && block.nodes[1].isText) - this.prettyIndent(1, true); - - for (var i = 0; i < len; ++i) { - // Pretty print text - if (pp && i > 0 && !escape && block.nodes[i].isText && block.nodes[i-1].isText) - this.prettyIndent(1, false); - - this.visit(block.nodes[i]); - // Multiple text nodes are separated by newlines - if (block.nodes[i+1] && block.nodes[i].isText && block.nodes[i+1].isText) - this.buffer('\\n'); - } - }, - - /** - * Visit `doctype`. Sets terse mode to `true` when html 5 - * is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {Doctype} doctype - * @api public - */ - - visitDoctype: function(doctype){ - if (doctype && (doctype.val || !this.doctype)) { - this.setDoctype(doctype.val || 'default'); - } - - if (this.doctype) this.buffer(this.doctype); - this.hasCompiledDoctype = true; - }, - - /** - * Visit `mixin`, generating a function that - * may be called within the template. - * - * @param {Mixin} mixin - * @api public - */ - - visitMixin: function(mixin){ - var name = mixin.name.replace(/-/g, '_') + '_mixin' - , args = mixin.args || '' - , block = mixin.block - , attrs = mixin.attrs - , pp = this.pp; - - if (mixin.call) { - if (pp) this.buf.push("__indent.push('" + Array(this.indents + 1).join(' ') + "');") - if (block || attrs.length) { - - this.buf.push(name + '.call({'); - - if (block) { - this.buf.push('block: function(){'); - - // Render block with no indents, dynamically added when rendered - this.parentIndents++; - var _indents = this.indents; - this.indents = 0; - this.visit(mixin.block); - this.indents = _indents; - this.parentIndents--; - - if (attrs.length) { - this.buf.push('},'); - } else { - this.buf.push('}'); - } - } - - if (attrs.length) { - var val = this.attrs(attrs); - if (val.inherits) { - this.buf.push('attributes: merge({' + val.buf - + '}, attributes), escaped: merge(' + val.escaped + ', escaped, true)'); - } else { - this.buf.push('attributes: {' + val.buf + '}, escaped: ' + val.escaped); - } - } - - if (args) { - this.buf.push('}, ' + args + ');'); - } else { - this.buf.push('});'); - } - - } else { - this.buf.push(name + '(' + args + ');'); - } - if (pp) this.buf.push("__indent.pop();") - } else { - this.buf.push('var ' + name + ' = function(' + args + '){'); - this.buf.push('var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};'); - this.parentIndents++; - this.visit(block); - this.parentIndents--; - this.buf.push('};'); - } - }, - - /** - * Visit `tag` buffering tag markup, generating - * attributes, visiting the `tag`'s code and block. - * - * @param {Tag} tag - * @api public - */ - - visitTag: function(tag){ - this.indents++; - var name = tag.name - , pp = this.pp; - - if (tag.buffer) name = "' + (" + name + ") + '"; - - if (!this.hasCompiledTag) { - if (!this.hasCompiledDoctype && 'html' == name) { - this.visitDoctype(); - } - this.hasCompiledTag = true; - } - - // pretty print - if (pp && !tag.isInline()) - this.prettyIndent(0, true); - - if ((~selfClosing.indexOf(name) || tag.selfClosing) && !this.xml) { - this.buffer('<' + name); - this.visitAttributes(tag.attrs); - this.terse - ? this.buffer('>') - : this.buffer('/>'); - } else { - // Optimize attributes buffering - if (tag.attrs.length) { - this.buffer('<' + name); - if (tag.attrs.length) this.visitAttributes(tag.attrs); - this.buffer('>'); - } else { - this.buffer('<' + name + '>'); - } - if (tag.code) this.visitCode(tag.code); - this.escape = 'pre' == tag.name; - this.visit(tag.block); - - // pretty print - if (pp && !tag.isInline() && 'pre' != tag.name && !tag.canInline()) - this.prettyIndent(0, true); - - this.buffer(''); - } - this.indents--; - }, - - /** - * Visit `filter`, throwing when the filter does not exist. - * - * @param {Filter} filter - * @api public - */ - - visitFilter: function(filter){ - var fn = filters[filter.name]; - - // unknown filter - if (!fn) { - if (filter.isASTFilter) { - throw new Error('unknown ast filter "' + filter.name + ':"'); - } else { - throw new Error('unknown filter ":' + filter.name + '"'); - } - } - - if (filter.isASTFilter) { - this.buf.push(fn(filter.block, this, filter.attrs)); - } else { - var text = filter.block.nodes.map(function(node){ return node.val }).join('\n'); - filter.attrs = filter.attrs || {}; - filter.attrs.filename = this.options.filename; - this.buffer(utils.text(fn(text, filter.attrs))); - } - }, - - /** - * Visit `text` node. - * - * @param {Text} text - * @api public - */ - - visitText: function(text){ - text = utils.text(text.val.replace(/\\/g, '\\\\')); - if (this.escape) text = escape(text); - this.buffer(text); - }, - - /** - * Visit a `comment`, only buffering when the buffer flag is set. - * - * @param {Comment} comment - * @api public - */ - - visitComment: function(comment){ - if (!comment.buffer) return; - if (this.pp) this.prettyIndent(1, true); - this.buffer(''); - }, - - /** - * Visit a `BlockComment`. - * - * @param {Comment} comment - * @api public - */ - - visitBlockComment: function(comment){ - if (!comment.buffer) return; - if (0 == comment.val.trim().indexOf('if')) { - this.buffer(''); - } else { - this.buffer(''); - } - }, - - /** - * Visit `code`, respecting buffer / escape flags. - * If the code is followed by a block, wrap it in - * a self-calling function. - * - * @param {Code} code - * @api public - */ - - visitCode: function(code){ - // Wrap code blocks with {}. - // we only wrap unbuffered code blocks ATM - // since they are usually flow control - - // Buffer code - if (code.buffer) { - var val = code.val.trimLeft(); - this.buf.push('var __val__ = ' + val); - val = 'null == __val__ ? "" : __val__'; - if (code.escape) val = 'escape(' + val + ')'; - this.buf.push("buf.push(" + val + ");"); - } else { - this.buf.push(code.val); - } - - // Block support - if (code.block) { - if (!code.buffer) this.buf.push('{'); - this.visit(code.block); - if (!code.buffer) this.buf.push('}'); - } - }, - - /** - * Visit `each` block. - * - * @param {Each} each - * @api public - */ - - visitEach: function(each){ - this.buf.push('' - + '// iterate ' + each.obj + '\n' - + ';(function(){\n' - + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' - + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push('' - + ' }\n' - + ' } else {\n' - + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' - // if browser - // + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' - // end - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - // if browser - // this.buf.push(' }\n'); - // end - - this.buf.push(' }\n }\n}).call(this);\n'); - }, - - /** - * Visit `attrs`. - * - * @param {Array} attrs - * @api public - */ - - visitAttributes: function(attrs){ - var val = this.attrs(attrs); - if (val.inherits) { - this.buf.push("buf.push(attrs(merge({ " + val.buf + - " }, attributes), merge(" + val.escaped + ", escaped, true)));"); - } else if (val.constant) { - eval('var buf={' + val.buf + '};'); - this.buffer(runtime.attrs(buf, JSON.parse(val.escaped)), true); - } else { - this.buf.push("buf.push(attrs({ " + val.buf + " }, " + val.escaped + "));"); - } - }, - - /** - * Compile attributes. - */ - - attrs: function(attrs){ - var buf = [] - , classes = [] - , escaped = {} - , constant = attrs.every(function(attr){ return isConstant(attr.val) }) - , inherits = false; - - if (this.terse) buf.push('terse: true'); - - attrs.forEach(function(attr){ - if (attr.name == 'attributes') return inherits = true; - escaped[attr.name] = attr.escaped; - if (attr.name == 'class') { - classes.push('(' + attr.val + ')'); - } else { - var pair = "'" + attr.name + "':(" + attr.val + ')'; - buf.push(pair); - } - }); - - if (classes.length) { - classes = classes.join(" + ' ' + "); - buf.push("class: " + classes); - } - - return { - buf: buf.join(', ').replace('class:', '"class":'), - escaped: JSON.stringify(escaped), - inherits: inherits, - constant: constant - }; - } -}; - -/** - * Check if expression can be evaluated to a constant - * - * @param {String} expression - * @return {Boolean} - * @api private - */ - -function isConstant(val){ - // Check strings/literals - if (/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val)) - return true; - - // Check numbers - if (!isNaN(Number(val))) - return true; - - // Check arrays - var matches; - if (matches = /^ *\[(.*)\] *$/.exec(val)) - return matches[1].split(',').every(isConstant); - - return false; -} - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/doctypes.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/doctypes.js deleted file mode 100644 index e87ca1e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/doctypes.js +++ /dev/null @@ -1,18 +0,0 @@ - -/*! - * Jade - doctypes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - '5': '' - , 'default': '' - , 'xml': '' - , 'transitional': '' - , 'strict': '' - , 'frameset': '' - , '1.1': '' - , 'basic': '' - , 'mobile': '' -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/filters.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/filters.js deleted file mode 100644 index fdb634c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/filters.js +++ /dev/null @@ -1,97 +0,0 @@ - -/*! - * Jade - filters - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - - /** - * Wrap text with CDATA block. - */ - - cdata: function(str){ - return ''; - }, - - /** - * Transform sass to css, wrapped in style tags. - */ - - sass: function(str){ - str = str.replace(/\\n/g, '\n'); - var sass = require('sass').render(str).replace(/\n/g, '\\n'); - return ''; - }, - - /** - * Transform stylus to css, wrapped in style tags. - */ - - stylus: function(str, options){ - var ret; - str = str.replace(/\\n/g, '\n'); - var stylus = require('stylus'); - stylus(str, options).render(function(err, css){ - if (err) throw err; - ret = css.replace(/\n/g, '\\n'); - }); - return ''; - }, - - /** - * Transform less to css, wrapped in style tags. - */ - - less: function(str){ - var ret; - str = str.replace(/\\n/g, '\n'); - require('less').render(str, function(err, css){ - if (err) throw err; - ret = ''; - }); - return ret; - }, - - /** - * Transform markdown to html. - */ - - markdown: function(str){ - var md; - - // support markdown / discount - try { - md = require('markdown'); - } catch (err){ - try { - md = require('discount'); - } catch (err) { - try { - md = require('markdown-js'); - } catch (err) { - try { - md = require('marked'); - } catch (err) { - throw new - Error('Cannot find markdown library, install markdown, discount, or marked.'); - } - } - } - } - - str = str.replace(/\\n/g, '\n'); - return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); - }, - - /** - * Transform coffeescript to javascript. - */ - - coffeescript: function(str){ - str = str.replace(/\\n/g, '\n'); - var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n'); - return ''; - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/inline-tags.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/inline-tags.js deleted file mode 100644 index 491de0b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/inline-tags.js +++ /dev/null @@ -1,28 +0,0 @@ - -/*! - * Jade - inline tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'a' - , 'abbr' - , 'acronym' - , 'b' - , 'br' - , 'code' - , 'em' - , 'font' - , 'i' - , 'img' - , 'ins' - , 'kbd' - , 'map' - , 'samp' - , 'small' - , 'span' - , 'strong' - , 'sub' - , 'sup' -]; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/jade.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/jade.js deleted file mode 100644 index 00f0abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/jade.js +++ /dev/null @@ -1,237 +0,0 @@ -/*! - * Jade - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Parser = require('./parser') - , Lexer = require('./lexer') - , Compiler = require('./compiler') - , runtime = require('./runtime') -// if node - , fs = require('fs'); -// end - -/** - * Library version. - */ - -exports.version = '0.26.3'; - -/** - * Expose self closing tags. - */ - -exports.selfClosing = require('./self-closing'); - -/** - * Default supported doctypes. - */ - -exports.doctypes = require('./doctypes'); - -/** - * Text filters. - */ - -exports.filters = require('./filters'); - -/** - * Utilities. - */ - -exports.utils = require('./utils'); - -/** - * Expose `Compiler`. - */ - -exports.Compiler = Compiler; - -/** - * Expose `Parser`. - */ - -exports.Parser = Parser; - -/** - * Expose `Lexer`. - */ - -exports.Lexer = Lexer; - -/** - * Nodes. - */ - -exports.nodes = require('./nodes'); - -/** - * Jade runtime helpers. - */ - -exports.runtime = runtime; - -/** - * Template function cache. - */ - -exports.cache = {}; - -/** - * Parse the given `str` of jade and return a function body. - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api private - */ - -function parse(str, options){ - try { - // Parse - var parser = new Parser(str, options.filename, options); - - // Compile - var compiler = new (options.compiler || Compiler)(parser.parse(), options) - , js = compiler.compile(); - - // Debug compiler - if (options.debug) { - console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); - } - - return '' - + 'var buf = [];\n' - + (options.self - ? 'var self = locals || {};\n' + js - : 'with (locals || {}) {\n' + js + '\n}\n') - + 'return buf.join("");'; - } catch (err) { - parser = parser.context(); - runtime.rethrow(err, parser.filename, parser.lexer.lineno); - } -} - -/** - * Compile a `Function` representation of the given jade `str`. - * - * Options: - * - * - `compileDebug` when `false` debugging code is stripped from the compiled template - * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` - * for use with the Jade client-side runtime.js - * - * @param {String} str - * @param {Options} options - * @return {Function} - * @api public - */ - -exports.compile = function(str, options){ - var options = options || {} - , client = options.client - , filename = options.filename - ? JSON.stringify(options.filename) - : 'undefined' - , fn; - - if (options.compileDebug !== false) { - fn = [ - 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' - , 'try {' - , parse(String(str), options) - , '} catch (err) {' - , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' - , '}' - ].join('\n'); - } else { - fn = parse(String(str), options); - } - - if (client) { - fn = 'attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n' + fn; - } - - fn = new Function('locals, attrs, escape, rethrow, merge', fn); - - if (client) return fn; - - return function(locals){ - return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow, runtime.merge); - }; -}; - -/** - * Render the given `str` of jade and invoke - * the callback `fn(err, str)`. - * - * Options: - * - * - `cache` enable template caching - * - `filename` filename required for `include` / `extends` and caching - * - * @param {String} str - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -exports.render = function(str, options, fn){ - // swap args - if ('function' == typeof options) { - fn = options, options = {}; - } - - // cache requires .filename - if (options.cache && !options.filename) { - return fn(new Error('the "filename" option is required for caching')); - } - - try { - var path = options.filename; - var tmpl = options.cache - ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) - : exports.compile(str, options); - fn(null, tmpl(options)); - } catch (err) { - fn(err); - } -}; - -/** - * Render a Jade file at the given `path` and callback `fn(err, str)`. - * - * @param {String} path - * @param {Object|Function} options or callback - * @param {Function} fn - * @api public - */ - -exports.renderFile = function(path, options, fn){ - var key = path + ':string'; - - if ('function' == typeof options) { - fn = options, options = {}; - } - - try { - options.filename = path; - var str = options.cache - ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) - : fs.readFileSync(path, 'utf8'); - exports.render(str, options, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Express support. - */ - -exports.__express = exports.renderFile; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/lexer.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/lexer.js deleted file mode 100644 index bca314a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/lexer.js +++ /dev/null @@ -1,771 +0,0 @@ - -/*! - * Jade - Lexer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize `Lexer` with the given `str`. - * - * Options: - * - * - `colons` allow colons for attr delimiters - * - * @param {String} str - * @param {Object} options - * @api private - */ - -var Lexer = module.exports = function Lexer(str, options) { - options = options || {}; - this.input = str.replace(/\r\n|\r/g, '\n'); - this.colons = options.colons; - this.deferredTokens = []; - this.lastIndents = 0; - this.lineno = 1; - this.stash = []; - this.indentStack = []; - this.indentRe = null; - this.pipeless = false; -}; - -/** - * Lexer prototype. - */ - -Lexer.prototype = { - - /** - * Construct a token with the given `type` and `val`. - * - * @param {String} type - * @param {String} val - * @return {Object} - * @api private - */ - - tok: function(type, val){ - return { - type: type - , line: this.lineno - , val: val - } - }, - - /** - * Consume the given `len` of input. - * - * @param {Number} len - * @api private - */ - - consume: function(len){ - this.input = this.input.substr(len); - }, - - /** - * Scan for `type` with the given `regexp`. - * - * @param {String} type - * @param {RegExp} regexp - * @return {Object} - * @api private - */ - - scan: function(regexp, type){ - var captures; - if (captures = regexp.exec(this.input)) { - this.consume(captures[0].length); - return this.tok(type, captures[1]); - } - }, - - /** - * Defer the given `tok`. - * - * @param {Object} tok - * @api private - */ - - defer: function(tok){ - this.deferredTokens.push(tok); - }, - - /** - * Lookahead `n` tokens. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - var fetch = n - this.stash.length; - while (fetch-- > 0) this.stash.push(this.next()); - return this.stash[--n]; - }, - - /** - * Return the indexOf `start` / `end` delimiters. - * - * @param {String} start - * @param {String} end - * @return {Number} - * @api private - */ - - indexOfDelimiters: function(start, end){ - var str = this.input - , nstart = 0 - , nend = 0 - , pos = 0; - for (var i = 0, len = str.length; i < len; ++i) { - if (start == str.charAt(i)) { - ++nstart; - } else if (end == str.charAt(i)) { - if (++nend == nstart) { - pos = i; - break; - } - } - } - return pos; - }, - - /** - * Stashed token. - */ - - stashed: function() { - return this.stash.length - && this.stash.shift(); - }, - - /** - * Deferred token. - */ - - deferred: function() { - return this.deferredTokens.length - && this.deferredTokens.shift(); - }, - - /** - * end-of-source. - */ - - eos: function() { - if (this.input.length) return; - if (this.indentStack.length) { - this.indentStack.shift(); - return this.tok('outdent'); - } else { - return this.tok('eos'); - } - }, - - /** - * Blank line. - */ - - blank: function() { - var captures; - if (captures = /^\n *\n/.exec(this.input)) { - this.consume(captures[0].length - 1); - if (this.pipeless) return this.tok('text', ''); - return this.next(); - } - }, - - /** - * Comment. - */ - - comment: function() { - var captures; - if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('comment', captures[2]); - tok.buffer = '-' != captures[1]; - return tok; - } - }, - - /** - * Interpolated tag. - */ - - interpolation: function() { - var captures; - if (captures = /^#\{(.*?)\}/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('interpolation', captures[1]); - } - }, - - /** - * Tag. - */ - - tag: function() { - var captures; - if (captures = /^(\w[-:\w]*)(\/?)/.exec(this.input)) { - this.consume(captures[0].length); - var tok, name = captures[1]; - if (':' == name[name.length - 1]) { - name = name.slice(0, -1); - tok = this.tok('tag', name); - this.defer(this.tok(':')); - while (' ' == this.input[0]) this.input = this.input.substr(1); - } else { - tok = this.tok('tag', name); - } - tok.selfClosing = !! captures[2]; - return tok; - } - }, - - /** - * Filter. - */ - - filter: function() { - return this.scan(/^:(\w+)/, 'filter'); - }, - - /** - * Doctype. - */ - - doctype: function() { - return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); - }, - - /** - * Id. - */ - - id: function() { - return this.scan(/^#([\w-]+)/, 'id'); - }, - - /** - * Class. - */ - - className: function() { - return this.scan(/^\.([\w-]+)/, 'class'); - }, - - /** - * Text. - */ - - text: function() { - return this.scan(/^(?:\| ?| ?)?([^\n]+)/, 'text'); - }, - - /** - * Extends. - */ - - "extends": function() { - return this.scan(/^extends? +([^\n]+)/, 'extends'); - }, - - /** - * Block prepend. - */ - - prepend: function() { - var captures; - if (captures = /^prepend +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'prepend' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block append. - */ - - append: function() { - var captures; - if (captures = /^append +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'append' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block. - */ - - block: function() { - var captures; - if (captures = /^block\b *(?:(prepend|append) +)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = captures[1] || 'replace' - , name = captures[2] - , tok = this.tok('block', name); - - tok.mode = mode; - return tok; - } - }, - - /** - * Yield. - */ - - yield: function() { - return this.scan(/^yield */, 'yield'); - }, - - /** - * Include. - */ - - include: function() { - return this.scan(/^include +([^\n]+)/, 'include'); - }, - - /** - * Case. - */ - - "case": function() { - return this.scan(/^case +([^\n]+)/, 'case'); - }, - - /** - * When. - */ - - when: function() { - return this.scan(/^when +([^:\n]+)/, 'when'); - }, - - /** - * Default. - */ - - "default": function() { - return this.scan(/^default */, 'default'); - }, - - /** - * Assignment. - */ - - assignment: function() { - var captures; - if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { - this.consume(captures[0].length); - var name = captures[1] - , val = captures[2]; - return this.tok('code', 'var ' + name + ' = (' + val + ');'); - } - }, - - /** - * Call mixin. - */ - - call: function(){ - var captures; - if (captures = /^\+([-\w]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('call', captures[1]); - - // Check for args (not attributes) - if (captures = /^ *\((.*?)\)/.exec(this.input)) { - if (!/^ *[-\w]+ *=/.test(captures[1])) { - this.consume(captures[0].length); - tok.args = captures[1]; - } - } - - return tok; - } - }, - - /** - * Mixin. - */ - - mixin: function(){ - var captures; - if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('mixin', captures[1]); - tok.args = captures[2]; - return tok; - } - }, - - /** - * Conditional. - */ - - conditional: function() { - var captures; - if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var type = captures[1] - , js = captures[2]; - - switch (type) { - case 'if': js = 'if (' + js + ')'; break; - case 'unless': js = 'if (!(' + js + '))'; break; - case 'else if': js = 'else if (' + js + ')'; break; - case 'else': js = 'else'; break; - } - - return this.tok('code', js); - } - }, - - /** - * While. - */ - - "while": function() { - var captures; - if (captures = /^while +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('code', 'while (' + captures[1] + ')'); - } - }, - - /** - * Each. - */ - - each: function() { - var captures; - if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('each', captures[1]); - tok.key = captures[2] || '$index'; - tok.code = captures[3]; - return tok; - } - }, - - /** - * Code. - */ - - code: function() { - var captures; - if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var flags = captures[1]; - captures[1] = captures[2]; - var tok = this.tok('code', captures[1]); - tok.escape = flags[0] === '='; - tok.buffer = flags[0] === '=' || flags[1] === '='; - return tok; - } - }, - - /** - * Attributes. - */ - - attrs: function() { - if ('(' == this.input.charAt(0)) { - var index = this.indexOfDelimiters('(', ')') - , str = this.input.substr(1, index-1) - , tok = this.tok('attrs') - , len = str.length - , colons = this.colons - , states = ['key'] - , escapedAttr - , key = '' - , val = '' - , quote - , c - , p; - - function state(){ - return states[states.length - 1]; - } - - function interpolate(attr) { - return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ - return quote + " + (" + expr + ") + " + quote; - }); - } - - this.consume(index + 1); - tok.attrs = {}; - tok.escaped = {}; - - function parse(c) { - var real = c; - // TODO: remove when people fix ":" - if (colons && ':' == c) c = '='; - switch (c) { - case ',': - case '\n': - switch (state()) { - case 'expr': - case 'array': - case 'string': - case 'object': - val += c; - break; - default: - states.push('key'); - val = val.trim(); - key = key.trim(); - if ('' == key) return; - key = key.replace(/^['"]|['"]$/g, '').replace('!', ''); - tok.escaped[key] = escapedAttr; - tok.attrs[key] = '' == val - ? true - : interpolate(val); - key = val = ''; - } - break; - case '=': - switch (state()) { - case 'key char': - key += real; - break; - case 'val': - case 'expr': - case 'array': - case 'string': - case 'object': - val += real; - break; - default: - escapedAttr = '!' != p; - states.push('val'); - } - break; - case '(': - if ('val' == state() - || 'expr' == state()) states.push('expr'); - val += c; - break; - case ')': - if ('expr' == state() - || 'val' == state()) states.pop(); - val += c; - break; - case '{': - if ('val' == state()) states.push('object'); - val += c; - break; - case '}': - if ('object' == state()) states.pop(); - val += c; - break; - case '[': - if ('val' == state()) states.push('array'); - val += c; - break; - case ']': - if ('array' == state()) states.pop(); - val += c; - break; - case '"': - case "'": - switch (state()) { - case 'key': - states.push('key char'); - break; - case 'key char': - states.pop(); - break; - case 'string': - if (c == quote) states.pop(); - val += c; - break; - default: - states.push('string'); - val += c; - quote = c; - } - break; - case '': - break; - default: - switch (state()) { - case 'key': - case 'key char': - key += c; - break; - default: - val += c; - } - } - p = c; - } - - for (var i = 0; i < len; ++i) { - parse(str.charAt(i)); - } - - parse(','); - - if ('/' == this.input.charAt(0)) { - this.consume(1); - tok.selfClosing = true; - } - - return tok; - } - }, - - /** - * Indent | Outdent | Newline. - */ - - indent: function() { - var captures, re; - - // established regexp - if (this.indentRe) { - captures = this.indentRe.exec(this.input); - // determine regexp - } else { - // tabs - re = /^\n(\t*) */; - captures = re.exec(this.input); - - // spaces - if (captures && !captures[1].length) { - re = /^\n( *)/; - captures = re.exec(this.input); - } - - // established - if (captures && captures[1].length) this.indentRe = re; - } - - if (captures) { - var tok - , indents = captures[1].length; - - ++this.lineno; - this.consume(indents + 1); - - if (' ' == this.input[0] || '\t' == this.input[0]) { - throw new Error('Invalid indentation, you can use tabs or spaces but not both'); - } - - // blank line - if ('\n' == this.input[0]) return this.tok('newline'); - - // outdent - if (this.indentStack.length && indents < this.indentStack[0]) { - while (this.indentStack.length && this.indentStack[0] > indents) { - this.stash.push(this.tok('outdent')); - this.indentStack.shift(); - } - tok = this.stash.pop(); - // indent - } else if (indents && indents != this.indentStack[0]) { - this.indentStack.unshift(indents); - tok = this.tok('indent', indents); - // newline - } else { - tok = this.tok('newline'); - } - - return tok; - } - }, - - /** - * Pipe-less text consumed only when - * pipeless is true; - */ - - pipelessText: function() { - if (this.pipeless) { - if ('\n' == this.input[0]) return; - var i = this.input.indexOf('\n'); - if (-1 == i) i = this.input.length; - var str = this.input.substr(0, i); - this.consume(str.length); - return this.tok('text', str); - } - }, - - /** - * ':' - */ - - colon: function() { - return this.scan(/^: */, ':'); - }, - - /** - * Return the next token object, or those - * previously stashed by lookahead. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.stashed() - || this.next(); - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - next: function() { - return this.deferred() - || this.blank() - || this.eos() - || this.pipelessText() - || this.yield() - || this.doctype() - || this.interpolation() - || this["case"]() - || this.when() - || this["default"]() - || this["extends"]() - || this.append() - || this.prepend() - || this.block() - || this.include() - || this.mixin() - || this.call() - || this.conditional() - || this.each() - || this["while"]() - || this.assignment() - || this.tag() - || this.filter() - || this.code() - || this.id() - || this.className() - || this.attrs() - || this.indent() - || this.comment() - || this.colon() - || this.text(); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/attrs.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/attrs.js deleted file mode 100644 index 5de9b59..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/attrs.js +++ /dev/null @@ -1,77 +0,0 @@ - -/*! - * Jade - nodes - Attrs - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'), - Block = require('./block'); - -/** - * Initialize a `Attrs` node. - * - * @api public - */ - -var Attrs = module.exports = function Attrs() { - this.attrs = []; -}; - -/** - * Inherit from `Node`. - */ - -Attrs.prototype.__proto__ = Node.prototype; - -/** - * Set attribute `name` to `val`, keep in mind these become - * part of a raw js object literal, so to quote a value you must - * '"quote me"', otherwise or example 'user.name' is literal JavaScript. - * - * @param {String} name - * @param {String} val - * @param {Boolean} escaped - * @return {Tag} for chaining - * @api public - */ - -Attrs.prototype.setAttribute = function(name, val, escaped){ - this.attrs.push({ name: name, val: val, escaped: escaped }); - return this; -}; - -/** - * Remove attribute `name` when present. - * - * @param {String} name - * @api public - */ - -Attrs.prototype.removeAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - delete this.attrs[i]; - } - } -}; - -/** - * Get attribute value by `name`. - * - * @param {String} name - * @return {String} - * @api public - */ - -Attrs.prototype.getAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - return this.attrs[i].val; - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js deleted file mode 100644 index 4f41e4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js +++ /dev/null @@ -1,33 +0,0 @@ - -/*! - * Jade - nodes - BlockComment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `BlockComment` with the given `block`. - * - * @param {String} val - * @param {Block} block - * @param {Boolean} buffer - * @api public - */ - -var BlockComment = module.exports = function BlockComment(val, block, buffer) { - this.block = block; - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -BlockComment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/block.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/block.js deleted file mode 100644 index bb00a1d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/block.js +++ /dev/null @@ -1,121 +0,0 @@ - -/*! - * Jade - nodes - Block - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Block` with an optional `node`. - * - * @param {Node} node - * @api public - */ - -var Block = module.exports = function Block(node){ - this.nodes = []; - if (node) this.push(node); -}; - -/** - * Inherit from `Node`. - */ - -Block.prototype.__proto__ = Node.prototype; - -/** - * Block flag. - */ - -Block.prototype.isBlock = true; - -/** - * Replace the nodes in `other` with the nodes - * in `this` block. - * - * @param {Block} other - * @api private - */ - -Block.prototype.replace = function(other){ - other.nodes = this.nodes; -}; - -/** - * Pust the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.push = function(node){ - return this.nodes.push(node); -}; - -/** - * Check if this block is empty. - * - * @return {Boolean} - * @api public - */ - -Block.prototype.isEmpty = function(){ - return 0 == this.nodes.length; -}; - -/** - * Unshift the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.unshift = function(node){ - return this.nodes.unshift(node); -}; - -/** - * Return the "last" block, or the first `yield` node. - * - * @return {Block} - * @api private - */ - -Block.prototype.includeBlock = function(){ - var ret = this - , node; - - for (var i = 0, len = this.nodes.length; i < len; ++i) { - node = this.nodes[i]; - if (node.yield) return node; - else if (node.textOnly) continue; - else if (node.includeBlock) ret = node.includeBlock(); - else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); - } - - return ret; -}; - -/** - * Return a clone of this block. - * - * @return {Block} - * @api private - */ - -Block.prototype.clone = function(){ - var clone = new Block; - for (var i = 0, len = this.nodes.length; i < len; ++i) { - clone.push(this.nodes[i].clone()); - } - return clone; -}; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/case.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/case.js deleted file mode 100644 index 08ff033..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/case.js +++ /dev/null @@ -1,43 +0,0 @@ - -/*! - * Jade - nodes - Case - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Case` with `expr`. - * - * @param {String} expr - * @api public - */ - -var Case = exports = module.exports = function Case(expr, block){ - this.expr = expr; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Case.prototype.__proto__ = Node.prototype; - -var When = exports.When = function When(expr, block){ - this.expr = expr; - this.block = block; - this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -When.prototype.__proto__ = Node.prototype; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/code.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/code.js deleted file mode 100644 index babc675..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/code.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Code - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Code` node with the given code `val`. - * Code may also be optionally buffered and escaped. - * - * @param {String} val - * @param {Boolean} buffer - * @param {Boolean} escape - * @api public - */ - -var Code = module.exports = function Code(val, buffer, escape) { - this.val = val; - this.buffer = buffer; - this.escape = escape; - if (val.match(/^ *else/)) this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -Code.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/comment.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/comment.js deleted file mode 100644 index 2e1469e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/comment.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Jade - nodes - Comment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Comment` with the given `val`, optionally `buffer`, - * otherwise the comment may render in the output. - * - * @param {String} val - * @param {Boolean} buffer - * @api public - */ - -var Comment = module.exports = function Comment(val, buffer) { - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -Comment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/doctype.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/doctype.js deleted file mode 100644 index b8f33e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/doctype.js +++ /dev/null @@ -1,29 +0,0 @@ - -/*! - * Jade - nodes - Doctype - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Doctype` with the given `val`. - * - * @param {String} val - * @api public - */ - -var Doctype = module.exports = function Doctype(val) { - this.val = val; -}; - -/** - * Inherit from `Node`. - */ - -Doctype.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/each.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/each.js deleted file mode 100644 index f54101f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/each.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Each - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize an `Each` node, representing iteration - * - * @param {String} obj - * @param {String} val - * @param {String} key - * @param {Block} block - * @api public - */ - -var Each = module.exports = function Each(obj, val, key, block) { - this.obj = obj; - this.val = val; - this.key = key; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Each.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/filter.js deleted file mode 100644 index 851a004..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/filter.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Filter - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node') - , Block = require('./block'); - -/** - * Initialize a `Filter` node with the given - * filter `name` and `block`. - * - * @param {String} name - * @param {Block|Node} block - * @api public - */ - -var Filter = module.exports = function Filter(name, block, attrs) { - this.name = name; - this.block = block; - this.attrs = attrs; - this.isASTFilter = !block.nodes.every(function(node){ return node.isText }); -}; - -/** - * Inherit from `Node`. - */ - -Filter.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/index.js deleted file mode 100644 index 386ad2f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/index.js +++ /dev/null @@ -1,20 +0,0 @@ - -/*! - * Jade - nodes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -exports.Node = require('./node'); -exports.Tag = require('./tag'); -exports.Code = require('./code'); -exports.Each = require('./each'); -exports.Case = require('./case'); -exports.Text = require('./text'); -exports.Block = require('./block'); -exports.Mixin = require('./mixin'); -exports.Filter = require('./filter'); -exports.Comment = require('./comment'); -exports.Literal = require('./literal'); -exports.BlockComment = require('./block-comment'); -exports.Doctype = require('./doctype'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/literal.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/literal.js deleted file mode 100644 index fde586b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/literal.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Jade - nodes - Literal - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Literal` node with the given `str. - * - * @param {String} str - * @api public - */ - -var Literal = module.exports = function Literal(str) { - this.str = str - .replace(/\\/g, "\\\\") - .replace(/\n|\r\n/g, "\\n") - .replace(/'/g, "\\'"); -}; - -/** - * Inherit from `Node`. - */ - -Literal.prototype.__proto__ = Node.prototype; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/mixin.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/mixin.js deleted file mode 100644 index 8407bc7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/mixin.js +++ /dev/null @@ -1,36 +0,0 @@ - -/*! - * Jade - nodes - Mixin - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Attrs = require('./attrs'); - -/** - * Initialize a new `Mixin` with `name` and `block`. - * - * @param {String} name - * @param {String} args - * @param {Block} block - * @api public - */ - -var Mixin = module.exports = function Mixin(name, args, block, call){ - this.name = name; - this.args = args; - this.block = block; - this.attrs = []; - this.call = call; -}; - -/** - * Inherit from `Attrs`. - */ - -Mixin.prototype.__proto__ = Attrs.prototype; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/node.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/node.js deleted file mode 100644 index e98f042..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/node.js +++ /dev/null @@ -1,25 +0,0 @@ - -/*! - * Jade - nodes - Node - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize a `Node`. - * - * @api public - */ - -var Node = module.exports = function Node(){}; - -/** - * Clone this node (return itself) - * - * @return {Node} - * @api private - */ - -Node.prototype.clone = function(){ - return this; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/tag.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/tag.js deleted file mode 100644 index 4b6728a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/tag.js +++ /dev/null @@ -1,95 +0,0 @@ - -/*! - * Jade - nodes - Tag - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Attrs = require('./attrs'), - Block = require('./block'), - inlineTags = require('../inline-tags'); - -/** - * Initialize a `Tag` node with the given tag `name` and optional `block`. - * - * @param {String} name - * @param {Block} block - * @api public - */ - -var Tag = module.exports = function Tag(name, block) { - this.name = name; - this.attrs = []; - this.block = block || new Block; -}; - -/** - * Inherit from `Attrs`. - */ - -Tag.prototype.__proto__ = Attrs.prototype; - -/** - * Clone this tag. - * - * @return {Tag} - * @api private - */ - -Tag.prototype.clone = function(){ - var clone = new Tag(this.name, this.block.clone()); - clone.line = this.line; - clone.attrs = this.attrs; - clone.textOnly = this.textOnly; - return clone; -}; - -/** - * Check if this tag is an inline tag. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.isInline = function(){ - return ~inlineTags.indexOf(this.name); -}; - -/** - * Check if this tag's contents can be inlined. Used for pretty printing. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.canInline = function(){ - var nodes = this.block.nodes; - - function isInline(node){ - // Recurse if the node is a block - if (node.isBlock) return node.nodes.every(isInline); - return node.isText || (node.isInline && node.isInline()); - } - - // Empty tag - if (!nodes.length) return true; - - // Text-only or inline-only tag - if (1 == nodes.length) return isInline(nodes[0]); - - // Multi-line inline-only tag - if (this.block.nodes.every(isInline)) { - for (var i = 1, len = nodes.length; i < len; ++i) { - if (nodes[i-1].isText && nodes[i].isText) - return false; - } - return true; - } - - // Mixed tag - return false; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/text.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/text.js deleted file mode 100644 index 3b5dd55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/nodes/text.js +++ /dev/null @@ -1,36 +0,0 @@ - -/*! - * Jade - nodes - Text - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Text` node with optional `line`. - * - * @param {String} line - * @api public - */ - -var Text = module.exports = function Text(line) { - this.val = ''; - if ('string' == typeof line) this.val = line; -}; - -/** - * Inherit from `Node`. - */ - -Text.prototype.__proto__ = Node.prototype; - -/** - * Flag as text. - */ - -Text.prototype.isText = true; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/parser.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/parser.js deleted file mode 100644 index 92f2af0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/parser.js +++ /dev/null @@ -1,710 +0,0 @@ - -/*! - * Jade - Parser - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Lexer = require('./lexer') - , nodes = require('./nodes'); - -/** - * Initialize `Parser` with the given input `str` and `filename`. - * - * @param {String} str - * @param {String} filename - * @param {Object} options - * @api public - */ - -var Parser = exports = module.exports = function Parser(str, filename, options){ - this.input = str; - this.lexer = new Lexer(str, options); - this.filename = filename; - this.blocks = {}; - this.mixins = {}; - this.options = options; - this.contexts = [this]; -}; - -/** - * Tags that may not contain tags. - */ - -var textOnly = exports.textOnly = ['script', 'style']; - -/** - * Parser prototype. - */ - -Parser.prototype = { - - /** - * Push `parser` onto the context stack, - * or pop and return a `Parser`. - */ - - context: function(parser){ - if (parser) { - this.contexts.push(parser); - } else { - return this.contexts.pop(); - } - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.lexer.advance(); - }, - - /** - * Skip `n` tokens. - * - * @param {Number} n - * @api private - */ - - skip: function(n){ - while (n--) this.advance(); - }, - - /** - * Single token lookahead. - * - * @return {Object} - * @api private - */ - - peek: function() { - return this.lookahead(1); - }, - - /** - * Return lexer lineno. - * - * @return {Number} - * @api private - */ - - line: function() { - return this.lexer.lineno; - }, - - /** - * `n` token lookahead. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - return this.lexer.lookahead(n); - }, - - /** - * Parse input returning a string of js for evaluation. - * - * @return {String} - * @api public - */ - - parse: function(){ - var block = new nodes.Block, parser; - block.line = this.line(); - - while ('eos' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - - if (parser = this.extending) { - this.context(parser); - var ast = parser.parse(); - this.context(); - // hoist mixins - for (var name in this.mixins) - ast.unshift(this.mixins[name]); - return ast; - } - - return block; - }, - - /** - * Expect the given type, or throw an exception. - * - * @param {String} type - * @api private - */ - - expect: function(type){ - if (this.peek().type === type) { - return this.advance(); - } else { - throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); - } - }, - - /** - * Accept the given `type`. - * - * @param {String} type - * @api private - */ - - accept: function(type){ - if (this.peek().type === type) { - return this.advance(); - } - }, - - /** - * tag - * | doctype - * | mixin - * | include - * | filter - * | comment - * | text - * | each - * | code - * | yield - * | id - * | class - * | interpolation - */ - - parseExpr: function(){ - switch (this.peek().type) { - case 'tag': - return this.parseTag(); - case 'mixin': - return this.parseMixin(); - case 'block': - return this.parseBlock(); - case 'case': - return this.parseCase(); - case 'when': - return this.parseWhen(); - case 'default': - return this.parseDefault(); - case 'extends': - return this.parseExtends(); - case 'include': - return this.parseInclude(); - case 'doctype': - return this.parseDoctype(); - case 'filter': - return this.parseFilter(); - case 'comment': - return this.parseComment(); - case 'text': - return this.parseText(); - case 'each': - return this.parseEach(); - case 'code': - return this.parseCode(); - case 'call': - return this.parseCall(); - case 'interpolation': - return this.parseInterpolation(); - case 'yield': - this.advance(); - var block = new nodes.Block; - block.yield = true; - return block; - case 'id': - case 'class': - var tok = this.advance(); - this.lexer.defer(this.lexer.tok('tag', 'div')); - this.lexer.defer(tok); - return this.parseExpr(); - default: - throw new Error('unexpected token "' + this.peek().type + '"'); - } - }, - - /** - * Text - */ - - parseText: function(){ - var tok = this.expect('text') - , node = new nodes.Text(tok.val); - node.line = this.line(); - return node; - }, - - /** - * ':' expr - * | block - */ - - parseBlockExpansion: function(){ - if (':' == this.peek().type) { - this.advance(); - return new nodes.Block(this.parseExpr()); - } else { - return this.block(); - } - }, - - /** - * case - */ - - parseCase: function(){ - var val = this.expect('case').val - , node = new nodes.Case(val); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * when - */ - - parseWhen: function(){ - var val = this.expect('when').val - return new nodes.Case.When(val, this.parseBlockExpansion()); - }, - - /** - * default - */ - - parseDefault: function(){ - this.expect('default'); - return new nodes.Case.When('default', this.parseBlockExpansion()); - }, - - /** - * code - */ - - parseCode: function(){ - var tok = this.expect('code') - , node = new nodes.Code(tok.val, tok.buffer, tok.escape) - , block - , i = 1; - node.line = this.line(); - while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; - block = 'indent' == this.lookahead(i).type; - if (block) { - this.skip(i-1); - node.block = this.block(); - } - return node; - }, - - /** - * comment - */ - - parseComment: function(){ - var tok = this.expect('comment') - , node; - - if ('indent' == this.peek().type) { - node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); - } else { - node = new nodes.Comment(tok.val, tok.buffer); - } - - node.line = this.line(); - return node; - }, - - /** - * doctype - */ - - parseDoctype: function(){ - var tok = this.expect('doctype') - , node = new nodes.Doctype(tok.val); - node.line = this.line(); - return node; - }, - - /** - * filter attrs? text-block - */ - - parseFilter: function(){ - var block - , tok = this.expect('filter') - , attrs = this.accept('attrs'); - - this.lexer.pipeless = true; - block = this.parseTextBlock(); - this.lexer.pipeless = false; - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * tag ':' attrs? block - */ - - parseASTFilter: function(){ - var block - , tok = this.expect('tag') - , attrs = this.accept('attrs'); - - this.expect(':'); - block = this.block(); - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * each block - */ - - parseEach: function(){ - var tok = this.expect('each') - , node = new nodes.Each(tok.code, tok.val, tok.key); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * 'extends' name - */ - - parseExtends: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - if (!this.filename) - throw new Error('the "filename" option is required to extend templates'); - - var path = this.expect('extends').val.trim() - , dir = dirname(this.filename); - - var path = join(dir, path + '.jade') - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - parser.blocks = this.blocks; - parser.contexts = this.contexts; - this.extending = parser; - - // TODO: null node - return new nodes.Literal(''); - }, - - /** - * 'block' name block - */ - - parseBlock: function(){ - var block = this.expect('block') - , mode = block.mode - , name = block.val.trim(); - - block = 'indent' == this.peek().type - ? this.block() - : new nodes.Block(new nodes.Literal('')); - - var prev = this.blocks[name]; - - if (prev) { - switch (prev.mode) { - case 'append': - block.nodes = block.nodes.concat(prev.nodes); - prev = block; - break; - case 'prepend': - block.nodes = prev.nodes.concat(block.nodes); - prev = block; - break; - } - } - - block.mode = mode; - return this.blocks[name] = prev || block; - }, - - /** - * include block? - */ - - parseInclude: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - var path = this.expect('include').val.trim() - , dir = dirname(this.filename); - - if (!this.filename) - throw new Error('the "filename" option is required to use includes'); - - // no extension - if (!~basename(path).indexOf('.')) { - path += '.jade'; - } - - // non-jade - if ('.jade' != path.substr(-5)) { - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8'); - return new nodes.Literal(str); - } - - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - parser.blocks = this.blocks; - parser.mixins = this.mixins; - - this.context(parser); - var ast = parser.parse(); - this.context(); - ast.filename = path; - - if ('indent' == this.peek().type) { - ast.includeBlock().push(this.block()); - } - - return ast; - }, - - /** - * call ident block - */ - - parseCall: function(){ - var tok = this.expect('call') - , name = tok.val - , args = tok.args - , mixin = new nodes.Mixin(name, args, new nodes.Block, true); - - this.tag(mixin); - if (mixin.block.isEmpty()) mixin.block = null; - return mixin; - }, - - /** - * mixin block - */ - - parseMixin: function(){ - var tok = this.expect('mixin') - , name = tok.val - , args = tok.args - , mixin; - - // definition - if ('indent' == this.peek().type) { - mixin = new nodes.Mixin(name, args, this.block(), false); - this.mixins[name] = mixin; - return mixin; - // call - } else { - return new nodes.Mixin(name, args, null, true); - } - }, - - /** - * indent (text | newline)* outdent - */ - - parseTextBlock: function(){ - var block = new nodes.Block; - block.line = this.line(); - var spaces = this.expect('indent').val; - if (null == this._spaces) this._spaces = spaces; - var indent = Array(spaces - this._spaces + 1).join(' '); - while ('outdent' != this.peek().type) { - switch (this.peek().type) { - case 'newline': - this.advance(); - break; - case 'indent': - this.parseTextBlock().nodes.forEach(function(node){ - block.push(node); - }); - break; - default: - var text = new nodes.Text(indent + this.advance().val); - text.line = this.line(); - block.push(text); - } - } - - if (spaces == this._spaces) this._spaces = null; - this.expect('outdent'); - return block; - }, - - /** - * indent expr* outdent - */ - - block: function(){ - var block = new nodes.Block; - block.line = this.line(); - this.expect('indent'); - while ('outdent' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - this.expect('outdent'); - return block; - }, - - /** - * interpolation (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseInterpolation: function(){ - var tok = this.advance(); - var tag = new nodes.Tag(tok.val); - tag.buffer = true; - return this.tag(tag); - }, - - /** - * tag (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseTag: function(){ - // ast-filter look-ahead - var i = 2; - if ('attrs' == this.lookahead(i).type) ++i; - if (':' == this.lookahead(i).type) { - if ('indent' == this.lookahead(++i).type) { - return this.parseASTFilter(); - } - } - - var tok = this.advance() - , tag = new nodes.Tag(tok.val); - - tag.selfClosing = tok.selfClosing; - - return this.tag(tag); - }, - - /** - * Parse tag. - */ - - tag: function(tag){ - var dot; - - tag.line = this.line(); - - // (attrs | class | id)* - out: - while (true) { - switch (this.peek().type) { - case 'id': - case 'class': - var tok = this.advance(); - tag.setAttribute(tok.type, "'" + tok.val + "'"); - continue; - case 'attrs': - var tok = this.advance() - , obj = tok.attrs - , escaped = tok.escaped - , names = Object.keys(obj); - - if (tok.selfClosing) tag.selfClosing = true; - - for (var i = 0, len = names.length; i < len; ++i) { - var name = names[i] - , val = obj[name]; - tag.setAttribute(name, val, escaped[name]); - } - continue; - default: - break out; - } - } - - // check immediate '.' - if ('.' == this.peek().val) { - dot = tag.textOnly = true; - this.advance(); - } - - // (text | code | ':')? - switch (this.peek().type) { - case 'text': - tag.block.push(this.parseText()); - break; - case 'code': - tag.code = this.parseCode(); - break; - case ':': - this.advance(); - tag.block = new nodes.Block; - tag.block.push(this.parseExpr()); - break; - } - - // newline* - while ('newline' == this.peek().type) this.advance(); - - tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); - - // script special-case - if ('script' == tag.name) { - var type = tag.getAttribute('type'); - if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { - tag.textOnly = false; - } - } - - // block? - if ('indent' == this.peek().type) { - if (tag.textOnly) { - this.lexer.pipeless = true; - tag.block = this.parseTextBlock(); - this.lexer.pipeless = false; - } else { - var block = this.block(); - if (tag.block) { - for (var i = 0, len = block.nodes.length; i < len; ++i) { - tag.block.push(block.nodes[i]); - } - } else { - tag.block = block; - } - } - } - - return tag; - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/runtime.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/runtime.js deleted file mode 100644 index fb711f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/runtime.js +++ /dev/null @@ -1,174 +0,0 @@ - -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Merge two attribute objects giving precedence - * to values in object `b`. Classes are special-cased - * allowing for arrays and merging/joining appropriately - * resulting in a string. - * - * @param {Object} a - * @param {Object} b - * @return {Object} a - * @api private - */ - -exports.merge = function merge(a, b) { - var ac = a['class']; - var bc = b['class']; - - if (ac || bc) { - ac = ac || []; - bc = bc || []; - if (!Array.isArray(ac)) ac = [ac]; - if (!Array.isArray(bc)) bc = [bc]; - ac = ac.filter(nulls); - bc = bc.filter(nulls); - a['class'] = ac.concat(bc).join(' '); - } - - for (var key in b) { - if (key != 'class') { - a[key] = b[key]; - } - } - - return a; -}; - -/** - * Filter null `val`s. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function nulls(val) { - return val != null; -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped && escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!(\w+|\#\d+);)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/self-closing.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/self-closing.js deleted file mode 100644 index 0548771..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/self-closing.js +++ /dev/null @@ -1,19 +0,0 @@ - -/*! - * Jade - self closing tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'meta' - , 'img' - , 'link' - , 'input' - , 'source' - , 'area' - , 'base' - , 'col' - , 'br' - , 'hr' -]; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/utils.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/utils.js deleted file mode 100644 index ff46d02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/lib/utils.js +++ /dev/null @@ -1,49 +0,0 @@ - -/*! - * Jade - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Convert interpolation in the given string to JavaScript. - * - * @param {String} str - * @return {String} - * @api private - */ - -var interpolate = exports.interpolate = function(str){ - return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ - return escape - ? str - : "' + " - + ('!' == flag ? '' : 'escape') - + "((interp = " + code.replace(/\\'/g, "'") - + ") == null ? '' : interp) + '"; - }); -}; - -/** - * Escape single quotes in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -var escape = exports.escape = function(str) { - return str.replace(/'/g, "\\'"); -}; - -/** - * Interpolate, and escape the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.text = function(str){ - return interpolate(escape(str)); -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej deleted file mode 100644 index 69244ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej +++ /dev/null @@ -1,5 +0,0 @@ ---- /dev/null -+++ .gitignore -@@ -0,0 +1,2 @@ -+node_modules/ -+npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown deleted file mode 100644 index b4dd75f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown +++ /dev/null @@ -1,54 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig deleted file mode 100644 index 7741462..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej deleted file mode 100644 index 81e7f43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej +++ /dev/null @@ -1,19 +0,0 @@ ---- examples/pow.js -+++ examples/pow.js -@@ -1,6 +1,15 @@ --var mkdirp = require('mkdirp').mkdirp; -+var mkdirp = require('../').mkdirp, -+ mkdirpSync = require('../').mkdirpSync; - - mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') - }); -+ -+try { -+ mkdirpSync('/tmp/bar/foo/baz', 0755); -+ console.log('double pow!'); -+} -+catch (ex) { -+ console.log(ex); -+} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js deleted file mode 100644 index 25f43ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js +++ /dev/null @@ -1,79 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) return cb(); - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er) { - if (er) cb(er); - else mkdirP(p, mode, cb); - }); - break; - - case 'EEXIST': - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original EEXIST be the failure reason. - if (er2 || !stat.isDirectory()) cb(er) - else cb(); - }); - break; - - default: - cb(er); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode) - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - var err1 = sync(path.dirname(p), mode) - if (err1) throw err1; - else return sync(p, mode); - break; - - case 'EEXIST' : - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0; - else return null; - break; - default : - throw err0 - break; - } - } - - return null; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json deleted file mode 100644 index 1cbc0c7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.0", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "0.0.x" - }, - "license": "MIT/X11", - "engines": { - "node": "*" - }, - "readme": "mkdirp\n======\n\nLike `mkdir -p`, but in node.js!\n\nexample\n=======\n\npow.js\n------\n var mkdirp = require('mkdirp');\n \n mkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n });\n\nOutput\n pow!\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\nmethods\n=======\n\nvar mkdirp = require('mkdirp');\n\nmkdirp(dir, mode, cb)\n---------------------\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nmkdirp.sync(dir, mode)\n----------------------\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n npm install mkdirp\n\nlicense\n=======\n\nMIT/X11\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "_id": "mkdirp@0.3.0", - "_from": "mkdirp@0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js deleted file mode 100644 index e0e389d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file, 0755); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 83cba56..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/package.json deleted file mode 100644 index 3b0610d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "jade", - "description": "Jade template engine", - "version": "0.26.3", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/jade" - }, - "main": "./index.js", - "bin": { - "jade": "./bin/jade" - }, - "man": [ - "./jade.1" - ], - "dependencies": { - "commander": "0.6.1", - "mkdirp": "0.3.0" - }, - "devDependencies": { - "mocha": "*", - "markdown": "*", - "stylus": "*", - "uubench": "*", - "should": "*", - "less": "*", - "uglify-js": "*" - }, - "component": { - "scripts": { - "jade": "runtime.js" - } - }, - "scripts": { - "prepublish": "npm prune" - }, - "bugs": { - "url": "https://github.com/visionmedia/jade/issues" - }, - "readme": "ERROR: No README data found!", - "_id": "jade@0.26.3", - "_from": "jade@0.26.3" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/runtime.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/runtime.js deleted file mode 100644 index 0f54907..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/runtime.js +++ /dev/null @@ -1,179 +0,0 @@ - -jade = (function(exports){ -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Merge two attribute objects giving precedence - * to values in object `b`. Classes are special-cased - * allowing for arrays and merging/joining appropriately - * resulting in a string. - * - * @param {Object} a - * @param {Object} b - * @return {Object} a - * @api private - */ - -exports.merge = function merge(a, b) { - var ac = a['class']; - var bc = b['class']; - - if (ac || bc) { - ac = ac || []; - bc = bc || []; - if (!Array.isArray(ac)) ac = [ac]; - if (!Array.isArray(bc)) bc = [bc]; - ac = ac.filter(nulls); - bc = bc.filter(nulls); - a['class'] = ac.concat(bc).join(' '); - } - - for (var key in b) { - if (key != 'class') { - a[key] = b[key]; - } - } - - return a; -}; - -/** - * Filter null `val`s. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function nulls(val) { - return val != null; -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped && escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!(\w+|\#\d+);)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; - - return exports; - -})({}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/runtime.min.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/runtime.min.js deleted file mode 100644 index 1714efb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/runtime.min.js +++ /dev/null @@ -1 +0,0 @@ -jade=function(exports){Array.isArray||(Array.isArray=function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}),Object.keys||(Object.keys=function(obj){var arr=[];for(var key in obj)obj.hasOwnProperty(key)&&arr.push(key);return arr}),exports.merge=function merge(a,b){var ac=a["class"],bc=b["class"];if(ac||bc)ac=ac||[],bc=bc||[],Array.isArray(ac)||(ac=[ac]),Array.isArray(bc)||(bc=[bc]),ac=ac.filter(nulls),bc=bc.filter(nulls),a["class"]=ac.concat(bc).join(" ");for(var key in b)key!="class"&&(a[key]=b[key]);return a};function nulls(val){return val!=null}return exports.attrs=function attrs(obj,escaped){var buf=[],terse=obj.terse;delete obj.terse;var keys=Object.keys(obj),len=keys.length;if(len){buf.push("");for(var i=0;i/g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err},exports}({}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/test.jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/test.jade deleted file mode 100644 index b3a8988..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/test.jade +++ /dev/null @@ -1,7 +0,0 @@ -p. - This is a large - body of text for - this tag. - - Nothing too - exciting. \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/head.jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/head.jade deleted file mode 100644 index 8515406..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/head.jade +++ /dev/null @@ -1,5 +0,0 @@ -head - script(src='/jquery.js') - yield - if false - script(src='/jquery.ui.js') diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/index.jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/index.jade deleted file mode 100644 index 1032c5f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/index.jade +++ /dev/null @@ -1,22 +0,0 @@ - -tag = 'p' -foo = 'bar' - -#{tag} value -#{tag}(foo='bar') value -#{foo ? 'a' : 'li'}(something) here - -mixin item(icon) - li - if attributes.href - a(attributes) - img.icon(src=icon) - block - else - span(attributes) - img.icon(src=icon) - block - -ul - +item('contact') Contact - +item(href='/contact') Contact diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/index.js deleted file mode 100644 index 226e8c0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/index.js +++ /dev/null @@ -1,11 +0,0 @@ - -/** - * Module dependencies. - */ - -var jade = require('../'); - -jade.renderFile('testing/index.jade', { pretty: true, debug: true, compileDebug: false }, function(err, str){ - if (err) throw err; - console.log(str); -}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/layout.jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/layout.jade deleted file mode 100644 index 6923cf1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/layout.jade +++ /dev/null @@ -1,6 +0,0 @@ -html - include head - script(src='/caustic.js') - script(src='/app.js') - body - block content \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/user.jade b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/user.jade deleted file mode 100644 index 3c636b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/user.jade +++ /dev/null @@ -1,7 +0,0 @@ -h1 Tobi -p Is a ferret - -ul - li: a foo - li: a bar - li: a baz \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/user.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/user.js deleted file mode 100644 index 2ecc45e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/node_modules/jade/testing/user.js +++ /dev/null @@ -1,27 +0,0 @@ -function anonymous(locals, attrs, escape, rethrow) { -var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow; -var __jade = [{ lineno: 1, filename: "testing/user.jade" }]; -try { -var buf = []; -with (locals || {}) { -var interp; -__jade.unshift({ lineno: 1, filename: __jade[0].filename }); -__jade.unshift({ lineno: 1, filename: __jade[0].filename }); -buf.push('

        Tobi'); -__jade.unshift({ lineno: undefined, filename: __jade[0].filename }); -__jade.shift(); -buf.push('

        '); -__jade.shift(); -__jade.unshift({ lineno: 2, filename: __jade[0].filename }); -buf.push('

        Is a ferret'); -__jade.unshift({ lineno: undefined, filename: __jade[0].filename }); -__jade.shift(); -buf.push('

        '); -__jade.shift(); -__jade.shift(); -} -return buf.join(""); -} catch (err) { - rethrow(err, __jade[0].filename, __jade[0].lineno); -} -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/package.json deleted file mode 100644 index 15b06c7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/mocha/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "mocha", - "version": "1.12.1", - "description": "simple, flexible, fun test framework", - "keywords": [ - "mocha", - "test", - "bdd", - "tdd", - "tap" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/mocha.git" - }, - "main": "./index", - "bin": { - "mocha": "./bin/mocha", - "_mocha": "./bin/_mocha" - }, - "engines": { - "node": ">= 0.4.x" - }, - "scripts": { - "test": "make test-all" - }, - "dependencies": { - "commander": "0.6.1", - "growl": "1.7.x", - "jade": "0.26.3", - "diff": "1.0.2", - "debug": "*", - "mkdirp": "0.3.5", - "glob": "3.2.1" - }, - "devDependencies": { - "should": "*", - "coffee-script": "1.2" - }, - "files": [ - "bin", - "images", - "lib", - "index.js", - "mocha.css", - "mocha.js" - ], - "readme": " [![Build Status](https://secure.travis-ci.org/visionmedia/mocha.png)](http://travis-ci.org/visionmedia/mocha)\n\n [![Mocha test framework](http://f.cl.ly/items/3l1k0n2A1U3M1I1L210p/Screen%20Shot%202012-02-24%20at%202.21.43%20PM.png)](http://visionmedia.github.io/mocha)\n\n Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://visionmedia.github.io/mocha).\n\n## Contributors\n\n```\n\n project : mocha\n repo age : 1 year, 7 months\n active : 272 days\n commits : 1116\n files : 123\n authors :\n 504 TJ Holowaychuk 45.2%\n 389 Tj Holowaychuk 34.9%\n 31 Guillermo Rauch 2.8%\n 13 Attila Domokos 1.2%\n 9 John Firebaugh 0.8%\n 8 Jo Liss 0.7%\n 7 Nathan Rajlich 0.6%\n 6 James Carr 0.5%\n 6 Brendan Nee 0.5%\n 5 Aaron Heckmann 0.4%\n 4 hokaccha 0.4%\n 4 Xavier Antoviaque 0.4%\n 4 Joshua Krall 0.4%\n 3 Wil Moore III 0.3%\n 3 Jesse Dailey 0.3%\n 3 Nathan Bowser 0.3%\n 3 Tyson Tate 0.3%\n 3 Cory Thomas 0.3%\n 3 Ryunosuke SATO 0.3%\n 3 Paul Miller 0.3%\n 3 Ben Lindsey 0.3%\n 2 Forbes Lindesay 0.2%\n 2 Konstantin Käfer 0.2%\n 2 Brian Beck 0.2%\n 2 Merrick Christensen 0.2%\n 2 Michael Riley 0.2%\n 2 David Henderson 0.2%\n 2 Nathan Alderson 0.2%\n 2 Paul Armstrong 0.2%\n 2 Pete Hawkins 0.2%\n 2 Quang Van 0.2%\n 2 Raynos 0.2%\n 2 Jonas Westerlund 0.2%\n 2 Domenic Denicola 0.2%\n 2 Shawn Krisman 0.2%\n 2 Simon Gaeremynck 0.2%\n 2 FARKAS Máté 0.2%\n 2 Timo Tijhof 0.2%\n 2 Justin DuJardin 0.2%\n 2 Juzer Ali 0.2%\n 2 Ian Storm Taylor 0.2%\n 2 Arian Stolwijk 0.2%\n 2 domenic 0.2%\n 1 Richard Dingwall 0.1%\n 1 Russ Bradberry 0.1%\n 1 Sasha Koss 0.1%\n 1 Seiya Konno 0.1%\n 1 Standa Opichal 0.1%\n 1 Steve Mason 0.1%\n 1 Will Langstroth 0.1%\n 1 Yanis Wang 0.1%\n 1 Yuest Wang 0.1%\n 1 abrkn 0.1%\n 1 airportyh 0.1%\n 1 fengmk2 0.1%\n 1 tgautier@yahoo.com 0.1%\n 1 traleig1 0.1%\n 1 vlad 0.1%\n 1 yuitest 0.1%\n 1 Adam Crabtree 0.1%\n 1 Andreas Brekken 0.1%\n 1 Atsuya Takagi 0.1%\n 1 Austin Birch 0.1%\n 1 Bjørge Næss 0.1%\n 1 Brian Moore 0.1%\n 1 Bryan Donovan 0.1%\n 1 Casey Foster 0.1%\n 1 Corey Butler 0.1%\n 1 Dave McKenna 0.1%\n 1 Fedor Indutny 0.1%\n 1 Florian Margaine 0.1%\n 1 Frederico Silva 0.1%\n 1 Fredrik Lindin 0.1%\n 1 Gareth Murphy 0.1%\n 1 Gavin Mogan 0.1%\n 1 Greg Perkins 0.1%\n 1 Harry Brundage 0.1%\n 1 Herman Junge 0.1%\n 1 Ian Young 0.1%\n 1 Ivan 0.1%\n 1 Jaakko Salonen 0.1%\n 1 Jakub Nešetřil 0.1%\n 1 James Bowes 0.1%\n 1 James Lal 0.1%\n 1 Jason Barry 0.1%\n 1 Javier Aranda 0.1%\n 1 Jeff Kunkle 0.1%\n 1 Jonathan Creamer 0.1%\n 1 Jussi Virtanen 0.1%\n 1 Katie Gengler 0.1%\n 1 Kazuhito Hokamura 0.1%\n 1 Koen Punt 0.1%\n 1 Laszlo Bacsi 0.1%\n 1 László Bácsi 0.1%\n 1 Maciej Małecki 0.1%\n 1 Matt Robenolt 0.1%\n 1 Matt Smith 0.1%\n 1 Matthew Shanley 0.1%\n 1 Michael Schoonmaker 0.1%\n 1 Phil Sung 0.1%\n 1 R56 0.1%\n```\n\n## Links\n\n - [Google Group](http://groups.google.com/group/mochajs)\n - [Wiki](https://github.com/visionmedia/mocha/wiki)\n - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/mocha/issues" - }, - "_id": "mocha@1.12.1", - "dist": { - "shasum": "8240a1ba4f98460e576b235bbff5c353ac105735" - }, - "_from": "mocha@~1.12.0", - "_resolved": "https://registry.npmjs.org/mocha/-/mocha-1.12.1.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/README.md deleted file mode 100644 index 712bbe1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/README.md +++ /dev/null @@ -1,332 +0,0 @@ -# Request -- Simplified HTTP client - -[![NPM](https://nodei.co/npm/request.png)](https://nodei.co/npm/request/) - -## Super simple to use - -Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. - -```javascript -var request = require('request'); -request('http://www.google.com', function (error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body) // Print the google web page. - } -}) -``` - -## Streaming - -You can stream any response to a file stream. - -```javascript -request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png')) -``` - -You 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. - -```javascript -fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json')) -``` - -Request can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers. - -```javascript -request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) -``` - -Now let's get fancy. - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - if (req.method === 'PUT') { - req.pipe(request.put('http://mysite.com/doodle.png')) - } else if (req.method === 'GET' || req.method === 'HEAD') { - request.get('http://mysite.com/doodle.png').pipe(resp) - } - } -}) -``` - -You 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: - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - var x = request('http://mysite.com/doodle.png') - req.pipe(x) - x.pipe(resp) - } -}) -``` - -And since pipe() returns the destination stream in node 0.5.x you can do one line proxying :) - -```javascript -req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) -``` - -Also, none of this new functionality conflicts with requests previous features, it just expands them. - -```javascript -var r = request.defaults({'proxy':'http://localproxy.com'}) - -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - r.get('http://google.com/doodle.png').pipe(resp) - } -}) -``` -You can still use intermediate proxies, the requests will still follow HTTP forwards, etc. - -## Forms - -`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API. - -Url encoded forms are simple - -```javascript -request.post('http://service.com/upload', {form:{key:'value'}}) -// or -request.post('http://service.com/upload').form({key:'value'}) -``` - -For `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. - -```javascript -var r = request.post('http://service.com/upload') -var form = r.form() -form.append('my_field', 'my_value') -form.append('my_buffer', new Buffer([1, 2, 3])) -form.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png')) -form.append('remote_file', request('http://google.com/doodle.png')) -``` - -## HTTP Authentication - -```javascript -request.get('http://some.server.com/').auth('username', 'password', false); -// or -request.get('http://some.server.com/', { - 'auth': { - 'user': 'username', - 'pass': 'password', - 'sendImmediately': false - } -}); -``` - -If 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)`. - -`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). - -Digest 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). - -## OAuth Signing - -```javascript -// Twitter OAuth -var qs = require('querystring') - , oauth = - { callback: 'http://mysite.com/callback/' - , consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - } - , url = 'https://api.twitter.com/oauth/request_token' - ; -request.post({url:url, oauth:oauth}, function (e, r, body) { - // Ideally, you would take the body in the response - // and construct a URL that a user clicks on (like a sign in button). - // The verifier is only available in the response after a user has - // verified with twitter that they are authorizing your app. - var access_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: access_token.oauth_token - , verifier: access_token.oauth_verifier - } - , url = 'https://api.twitter.com/oauth/access_token' - ; - request.post({url:url, oauth:oauth}, function (e, r, body) { - var perm_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: perm_token.oauth_token - , token_secret: perm_token.oauth_token_secret - } - , url = 'https://api.twitter.com/1/users/show.json?' - , params = - { screen_name: perm_token.screen_name - , user_id: perm_token.user_id - } - ; - url += qs.stringify(params) - request.get({url:url, oauth:oauth, json:true}, function (e, r, user) { - console.log(user) - }) - }) -}) -``` - - - -### request(options, callback) - -The first argument can be either a url or an options object. The only required option is uri, all others are optional. - -* `uri` || `url` - fully qualified uri or a parsed url object from url.parse() -* `qs` - object containing querystring values to be appended to the uri -* `method` - http method, defaults to GET -* `headers` - http headers, defaults to {} -* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string. -* `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. -* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above. -* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json. -* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below. -* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true. -* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false. -* `maxRedirects` - the maximum number of redirects to follow, defaults to 10. -* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer. -* `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. -* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool. -* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request -* `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. -* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above. -* `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). -* `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. -* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section) -* `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) -* `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. -* `localAddress` - Local interface to bind for network connections. - - -The 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. - -## Convenience methods - -There are also shorthand methods for different HTTP METHODs and some other conveniences. - -### request.defaults(options) - -This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it. - -### request.put - -Same as request() but defaults to `method: "PUT"`. - -```javascript -request.put(url) -``` - -### request.patch - -Same as request() but defaults to `method: "PATCH"`. - -```javascript -request.patch(url) -``` - -### request.post - -Same as request() but defaults to `method: "POST"`. - -```javascript -request.post(url) -``` - -### request.head - -Same as request() but defaults to `method: "HEAD"`. - -```javascript -request.head(url) -``` - -### request.del - -Same as request() but defaults to `method: "DELETE"`. - -```javascript -request.del(url) -``` - -### request.get - -Alias to normal request method for uniformity. - -```javascript -request.get(url) -``` -### request.cookie - -Function that creates a new cookie. - -```javascript -request.cookie('cookie_string_here') -``` -### request.jar - -Function that creates a new cookie jar. - -```javascript -request.jar() -``` - - -## Examples: - -```javascript - var request = require('request') - , rand = Math.floor(Math.random()*100000000).toString() - ; - request( - { method: 'PUT' - , uri: 'http://mikeal.iriscouch.com/testjs/' + rand - , multipart: - [ { 'content-type': 'application/json' - , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) - } - , { body: 'I am an attachment' } - ] - } - , function (error, response, body) { - if(response.statusCode == 201){ - console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand) - } else { - console.log('error: '+ response.statusCode) - console.log(body) - } - } - ) -``` -Cookies 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). - -```javascript -var request = request.defaults({jar: true}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` - -If 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: - -```javascript -var j = request.jar() -var request = request.defaults({jar:j}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` -OR - -```javascript -var j = request.jar() -var cookie = request.cookie('your_cookie_here') -j.add(cookie) -request({url: 'http://www.google.com', jar: j}, function () { - request('http://images.google.com') -}) -``` diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/index.js deleted file mode 100755 index 680b1fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/index.js +++ /dev/null @@ -1,1412 +0,0 @@ -// Copyright 2010-2012 Mikeal Rogers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -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 - ; - -try { - https = require('https') -} catch (e) {} - -try { - tls = require('tls') -} catch (e) {} - -var debug -if (/\brequest\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - console.error('REQUEST %s', util.format.apply(util, arguments)) - } -} else { - debug = function() {} -} - -function toBase64 (str) { - return (new Buffer(str || "", "ascii")).toString("base64") -} - -function md5 (str) { - return crypto.createHash('md5').update(str).digest('hex') -} - -// 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 copy (obj) { - var o = {} - Object.keys(obj).forEach(function (i) { - o[i] = obj[i] - }) - return o -} - -var isUrl = /^https?:/i - -var globalPool = {} - -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;i - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var crypto = require('crypto') - , parse = require('url').parse - ; - -/** - * Valid keys. - */ - -var keys = - [ 'acl' - , 'location' - , 'logging' - , 'notification' - , 'partNumber' - , 'policy' - , 'requestPayment' - , 'torrent' - , 'uploadId' - , 'uploads' - , 'versionId' - , 'versioning' - , 'versions' - , 'website' - ] - -/** - * Return an "Authorization" header value with the given `options` - * in the form of "AWS :" - * - * @param {Object} options - * @return {String} - * @api private - */ - -function authorization (options) { - return 'AWS ' + options.key + ':' + sign(options) -} - -module.exports = authorization -module.exports.authorization = authorization - -/** - * Simple HMAC-SHA1 Wrapper - * - * @param {Object} options - * @return {String} - * @api private - */ - -function hmacSha1 (options) { - return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') -} - -module.exports.hmacSha1 = hmacSha1 - -/** - * Create a base64 sha1 HMAC for `options`. - * - * @param {Object} options - * @return {String} - * @api private - */ - -function sign (options) { - options.message = stringToSign(options) - return hmacSha1(options) -} -module.exports.sign = sign - -/** - * Create a base64 sha1 HMAC for `options`. - * - * Specifically to be used with S3 presigned URLs - * - * @param {Object} options - * @return {String} - * @api private - */ - -function signQuery (options) { - options.message = queryStringToSign(options) - return hmacSha1(options) -} -module.exports.signQuery= signQuery - -/** - * Return a string for sign() with the given `options`. - * - * Spec: - * - * \n - * \n - * \n - * \n - * [headers\n] - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function stringToSign (options) { - var headers = options.amazonHeaders || '' - if (headers) headers += '\n' - var r = - [ options.verb - , options.md5 - , options.contentType - , options.date.toUTCString() - , headers + options.resource - ] - return r.join('\n') -} -module.exports.queryStringToSign = stringToSign - -/** - * Return a string for sign() with the given `options`, but is meant exclusively - * for S3 presigned URLs - * - * Spec: - * - * \n - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function queryStringToSign (options){ - return 'GET\n\n\n' + options.date + '\n' + options.resource -} -module.exports.queryStringToSign = queryStringToSign - -/** - * Perform the following: - * - * - ignore non-amazon headers - * - lowercase fields - * - sort lexicographically - * - trim whitespace between ":" - * - join with newline - * - * @param {Object} headers - * @return {String} - * @api private - */ - -function canonicalizeHeaders (headers) { - var buf = [] - , fields = Object.keys(headers) - ; - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i] - , val = headers[field] - , field = field.toLowerCase() - ; - if (0 !== field.indexOf('x-amz')) continue - buf.push(field + ':' + val) - } - return buf.sort().join('\n') -} -module.exports.canonicalizeHeaders = canonicalizeHeaders - -/** - * Perform the following: - * - * - ignore non sub-resources - * - sort lexicographically - * - * @param {String} resource - * @return {String} - * @api private - */ - -function canonicalizeResource (resource) { - var url = parse(resource, true) - , path = url.pathname - , buf = [] - ; - - Object.keys(url.query).forEach(function(key){ - if (!~keys.indexOf(key)) return - var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) - buf.push(key + val) - }) - - return path + (buf.length ? '?' + buf.sort().join('&') : '') -} -module.exports.canonicalizeResource = canonicalizeResource diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/aws-sign/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/aws-sign/package.json deleted file mode 100644 index e2c48ab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/aws-sign/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "aws-sign", - "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/aws-sign" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/aws-sign/issues" - }, - "_id": "aws-sign@0.3.0", - "_from": "aws-sign@~0.3.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/README.md deleted file mode 100644 index bcd8f8d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/README.md +++ /dev/null @@ -1,4 +0,0 @@ -cookie-jar -========== - -Cookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/index.js deleted file mode 100644 index 7d54d94..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/index.js +++ /dev/null @@ -1,67 +0,0 @@ -/*! - * Tobi - Cookie - * Copyright(c) 2010 LearnBoost - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var url = require('url'); - -/** - * Initialize a new `Cookie` with the given cookie `str` and `req`. - * - * @param {String} str - * @param {IncomingRequest} req - * @api private - */ - -var Cookie = exports = module.exports = function Cookie(str, req) { - this.str = str; - - // Map the key/val pairs - str.split(/ *; */).reduce(function(obj, pair){ - var p = pair.indexOf('='); - var key = p > 0 ? pair.substring(0, p).trim() : pair.trim(); - var lowerCasedKey = key.toLowerCase(); - var value = p > 0 ? pair.substring(p + 1).trim() : true; - - if (!obj.name) { - // First key is the name - obj.name = key; - obj.value = value; - } - else if (lowerCasedKey === 'httponly') { - obj.httpOnly = value; - } - else { - obj[lowerCasedKey] = value; - } - return obj; - }, this); - - // Expires - this.expires = this.expires - ? new Date(this.expires) - : Infinity; - - // Default or trim path - this.path = this.path - ? this.path.trim(): req - ? url.parse(req.url).pathname: '/'; -}; - -/** - * Return the original cookie string. - * - * @return {String} - * @api public - */ - -Cookie.prototype.toString = function(){ - return this.str; -}; - -module.exports.Jar = require('./jar') \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/jar.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/jar.js deleted file mode 100644 index 34920e0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/jar.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! -* Tobi - CookieJar -* Copyright(c) 2010 LearnBoost -* MIT Licensed -*/ - -/** -* Module dependencies. -*/ - -var url = require('url'); - -/** -* Initialize a new `CookieJar`. -* -* @api private -*/ - -var CookieJar = exports = module.exports = function CookieJar() { - this.cookies = []; -}; - -/** -* Add the given `cookie` to the jar. -* -* @param {Cookie} cookie -* @api private -*/ - -CookieJar.prototype.add = function(cookie){ - this.cookies = this.cookies.filter(function(c){ - // Avoid duplication (same path, same name) - return !(c.name == cookie.name && c.path == cookie.path); - }); - this.cookies.push(cookie); -}; - -/** -* Get cookies for the given `req`. -* -* @param {IncomingRequest} req -* @return {Array} -* @api private -*/ - -CookieJar.prototype.get = function(req){ - var path = url.parse(req.url).pathname - , now = new Date - , specificity = {}; - return this.cookies.filter(function(cookie){ - if (0 == path.indexOf(cookie.path) && now < cookie.expires - && cookie.path.length > (specificity[cookie.name] || 0)) - return specificity[cookie.name] = cookie.path.length; - }); -}; - -/** -* Return Cookie string for the given `req`. -* -* @param {IncomingRequest} req -* @return {String} -* @api private -*/ - -CookieJar.prototype.cookieString = function(req){ - var cookies = this.get(req); - if (cookies.length) { - return cookies.map(function(cookie){ - return cookie.name + '=' + cookie.value; - }).join('; '); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/package.json deleted file mode 100644 index b42df9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "cookie-jar", - "description": "Cookie Jar. Originally pulled form tobi, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/cookie-jar" - }, - "main": "index.js", - "scripts": { - "test": "node tests/run.js" - }, - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "cookie-jar\n==========\n\nCookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/cookie-jar/issues" - }, - "_id": "cookie-jar@0.3.0", - "_from": "cookie-jar@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/run.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js deleted file mode 100644 index 2cdc835..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js +++ /dev/null @@ -1,29 +0,0 @@ -var Cookie = require('../index') - , assert = require('assert'); - -var str = 'Sid="s543qactge.wKE61E01Bs%2BKhzmxrwrnug="; Path=/; httpOnly; Expires=Sat, 04 Dec 2010 23:27:28 GMT'; -var cookie = new Cookie(str); - -// test .toString() -assert.equal(cookie.toString(), str); - -// test .path -assert.equal(cookie.path, '/'); - -// test .httpOnly -assert.equal(cookie.httpOnly, true); - -// test .name -assert.equal(cookie.name, 'Sid'); - -// test .value -assert.equal(cookie.value, '"s543qactge.wKE61E01Bs%2BKhzmxrwrnug="'); - -// test .expires -assert.equal(cookie.expires instanceof Date, true); - -// test .path default -var cookie = new Cookie('foo=bar', { url: 'http://foo.com/bar' }); -assert.equal(cookie.path, '/bar'); - -console.log('All tests passed'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js deleted file mode 100644 index a33cfb2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js +++ /dev/null @@ -1,90 +0,0 @@ -var Cookie = require('../index') - , Jar = Cookie.Jar - , assert = require('assert'); - -function expires(ms) { - return new Date(Date.now() + ms).toUTCString(); -} - -// test .get() expiration -(function() { - var jar = new Jar; - var cookie = new Cookie('sid=1234; path=/; expires=' + expires(1000)); - jar.add(cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 0); - }, 1000); - }, 5); -})(); - -// test .get() path support -(function() { - var jar = new Jar; - var a = new Cookie('sid=1234; path=/'); - var b = new Cookie('sid=1111; path=/foo/bar'); - var c = new Cookie('sid=2222; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - - // should remove the duplicates - assert.equal(jar.cookies.length, 2); - - // same name, same path, latter prevails - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], c); - - // same name, diff path, path specifity prevails, latter prevails - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], a); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=3333; path=/foo/bar'); - var c = new Cookie('pid=3333; path=/foo/bar'); - var d = new Cookie('sid=2222; path=/foo/'); - var e = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - jar.add(d); - jar.add(e); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 2); - assert.equal(cookies[0], b); - assert.equal(cookies[1], c); - - var cookies = jar.get({ url: 'http://foo.com/foo/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], d); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], e); -})(); - -setTimeout(function() { - console.log('All tests passed'); -}, 1200); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/README.md deleted file mode 100644 index 9d5b663..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -forever-agent -============= - -HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/index.js deleted file mode 100644 index 5c07928..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/index.js +++ /dev/null @@ -1,119 +0,0 @@ -module.exports = ForeverAgent -ForeverAgent.SSL = ForeverAgentSSL - -var util = require('util') - , Agent = require('http').Agent - , net = require('net') - , tls = require('tls') - , AgentSSL = require('https').Agent - -function ForeverAgent(options) { - var self = this - self.options = options || {} - self.requests = {} - self.sockets = {} - self.freeSockets = {} - self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets - self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets - self.on('free', function(socket, host, port) { - var name = host + ':' + port - if (self.requests[name] && self.requests[name].length) { - self.requests[name].shift().onSocket(socket) - } else if (self.sockets[name].length < self.minSockets) { - if (!self.freeSockets[name]) self.freeSockets[name] = [] - self.freeSockets[name].push(socket) - - // if an error happens while we don't use the socket anyway, meh, throw the socket away - function onIdleError() { - socket.destroy() - } - socket._onIdleError = onIdleError - socket.on('error', onIdleError) - } else { - // If there are no pending requests just destroy the - // socket and it will get removed from the pool. This - // gets us out of timeout issues and allows us to - // default to Connection:keep-alive. - socket.destroy() - } - }) - -} -util.inherits(ForeverAgent, Agent) - -ForeverAgent.defaultMinSockets = 5 - - -ForeverAgent.prototype.createConnection = net.createConnection -ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest -ForeverAgent.prototype.addRequest = function(req, host, port) { - var name = host + ':' + port - if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { - var idleSocket = this.freeSockets[name].pop() - idleSocket.removeListener('error', idleSocket._onIdleError) - delete idleSocket._onIdleError - req._reusedSocket = true - req.onSocket(idleSocket) - } else { - this.addRequestNoreuse(req, host, port) - } -} - -ForeverAgent.prototype.removeSocket = function(s, name, host, port) { - if (this.sockets[name]) { - var index = this.sockets[name].indexOf(s) - if (index !== -1) { - this.sockets[name].splice(index, 1) - } - } else if (this.sockets[name] && this.sockets[name].length === 0) { - // don't leak - delete this.sockets[name] - delete this.requests[name] - } - - if (this.freeSockets[name]) { - var index = this.freeSockets[name].indexOf(s) - if (index !== -1) { - this.freeSockets[name].splice(index, 1) - if (this.freeSockets[name].length === 0) { - delete this.freeSockets[name] - } - } - } - - if (this.requests[name] && this.requests[name].length) { - // 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(name, host, port).emit('free') - } -} - -function ForeverAgentSSL (options) { - ForeverAgent.call(this, options) -} -util.inherits(ForeverAgentSSL, ForeverAgent) - -ForeverAgentSSL.prototype.createConnection = createConnectionSSL -ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest - -function createConnectionSSL (port, host, options) { - if (typeof port === 'object') { - options = port; - } else if (typeof host === 'object') { - options = host; - } else if (typeof options === 'object') { - options = options; - } else { - options = {}; - } - - if (typeof port === 'number') { - options.port = port; - } - - if (typeof host === 'string') { - options.host = host; - } - - return tls.connect(options); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/package.json deleted file mode 100644 index 42d35ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/forever-agent/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "forever-agent", - "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", - "version": "0.5.0", - "repository": { - "url": "https://github.com/mikeal/forever-agent" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/forever-agent/issues" - }, - "_id": "forever-agent@0.5.0", - "_from": "forever-agent@~0.5.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/License b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/License deleted file mode 100644 index c7ff12a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/Readme.md deleted file mode 100644 index dc73c46..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/Readme.md +++ /dev/null @@ -1,163 +0,0 @@ -# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data) - -A module to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. - -The API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. - -[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface -[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions - -## Install - -``` -npm install form-data -``` - -## Usage - -In this example we are constructing a form with 3 fields that contain a string, -a buffer and a file stream. - -``` javascript -var FormData = require('form-data'); -var fs = require('fs'); - -var form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); -``` - -Also you can use http-response stream: - -``` javascript -var FormData = require('form-data'); -var http = require('http'); - -var form = new FormData(); - -http.request('http://nodejs.org/images/logo.png', function(response) { - form.append('my_field', 'my value'); - form.append('my_buffer', new Buffer(10)); - form.append('my_logo', response); -}); -``` - -Or @mikeal's request stream: - -``` javascript -var FormData = require('form-data'); -var request = require('request'); - -var form = new FormData(); - -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_logo', request('http://nodejs.org/images/logo.png')); -``` - -In order to submit this form to a web application, call ```submit(url, [callback])``` method: - -``` javascript -form.submit('http://example.org/', function(err, res) { - // res – response object (http.IncomingMessage) // - res.resume(); // for node-0.10.x -}); - -``` - -For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. - -### Alternative submission methods - -You can use node's http client interface: - -``` javascript -var http = require('http'); - -var request = http.request({ - method: 'post', - host: 'example.org', - path: '/upload', - headers: form.getHeaders() -}); - -form.pipe(request); - -request.on('response', function(res) { - console.log(res.statusCode); -}); -``` - -Or if you would prefer the `'Content-Length'` header to be set for you: - -``` javascript -form.submit('example.org/upload', function(err, res) { - console.log(res.statusCode); -}); -``` - -To use custom headers and pre-known length in parts: - -``` javascript -var CRLF = '\r\n'; -var form = new FormData(); - -var options = { - header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, - knownLength: 1 -}; - -form.append('my_buffer', buffer, options); - -form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); -}); -``` - -Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: - -``` javascript -someModule.stream(function(err, stdout, stderr) { - if (err) throw err; - - var form = new FormData(); - - form.append('file', stdout, { - filename: 'unicycle.jpg', - contentType: 'image/jpg', - knownLength: 19806 - }); - - form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); - }); -}); -``` - -For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: - -``` javascript -form.submit({ - host: 'example.com', - path: '/probably.php?extra=params', - auth: 'username:password' -}, function(err, res) { - console.log(res.statusCode); -}); -``` - -## Notes - -- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. -- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing] - -## TODO - -- Add new streams (0.10) support and try really hard not to break it for 0.8.x. - -## License - -Form-Data is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/lib/form_data.js deleted file mode 100644 index d106474..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/lib/form_data.js +++ /dev/null @@ -1,325 +0,0 @@ -var CombinedStream = require('combined-stream'); -var util = require('util'); -var path = require('path'); -var http = require('http'); -var https = require('https'); -var parseUrl = require('url').parse; -var fs = require('fs'); -var mime = require('mime'); -var async = require('async'); - -module.exports = FormData; -function FormData() { - this._overheadLength = 0; - this._valueLength = 0; - this._lengthRetrievers = []; - - CombinedStream.call(this); -} -util.inherits(FormData, CombinedStream); - -FormData.LINE_BREAK = '\r\n'; - -FormData.prototype.append = function(field, value, options) { - options = options || {}; - - var append = CombinedStream.prototype.append.bind(this); - - // all that streamy business can't handle numbers - if (typeof value == 'number') value = ''+value; - - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; - } - - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(field, value, options); - - append(header); - append(value); - append(footer); - - // pass along options.knownLength - this._trackLength(header, value, options); -}; - -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } - - this._valueLength += valueLength; - - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - + FormData.LINE_BREAK.length; - - // empty or either doesn't have path or not an http response - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { - return; - } - - // no need to bother with the length - if (!options.knownLength) - this._lengthRetrievers.push(function(next) { - - if (value.hasOwnProperty('fd')) { - fs.stat(value.path, function(err, stat) { - if (err) { - next(err); - return; - } - - next(null, stat.size); - }); - - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - next(null, +value.headers['content-length']); - - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - next(null, +response.headers['content-length']); - }); - value.resume(); - - // something else - } else { - next('Unknown stream'); - } - }); -}; - -FormData.prototype._multiPartHeader = function(field, value, options) { - var boundary = this.getBoundary(); - var header = ''; - - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (options.header != null) { - header = options.header; - } else { - header += '--' + boundary + FormData.LINE_BREAK + - 'Content-Disposition: form-data; name="' + field + '"'; - - // fs- and request- streams have path property - // or use custom filename and/or contentType - // TODO: Use request's response mime-type - if (options.filename || value.path) { - header += - '; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path)); - - // http response has not - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - header += - '; filename="' + path.basename(value.client._httpMessage.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + value.headers['content-type']; - } - - header += FormData.LINE_BREAK + FormData.LINE_BREAK; - } - - return header; -}; - -FormData.prototype._multiPartFooter = function(field, value, options) { - return function(next) { - var footer = FormData.LINE_BREAK; - - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--'; -}; - -FormData.prototype.getHeaders = function(userHeaders) { - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; - - for (var header in userHeaders) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - - return formHeaders; -} - -FormData.prototype.getCustomHeaders = function(contentType) { - contentType = contentType ? contentType : 'multipart/form-data'; - - var formHeaders = { - 'content-type': contentType + '; boundary=' + this.getBoundary(), - 'content-length': this.getLengthSync() - }; - - return formHeaders; -} - -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - - return this._boundary; -}; - -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } - - this._boundary = boundary; -}; - -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function(debug) { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - // https://github.com/felixge/node-form-data/issues/40 - if (this._lengthRetrievers.length) { - // Some async length retrivers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } - - return knownLength; -}; - -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - if (!this._lengthRetrievers.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - - async.parallel(this._lengthRetrievers, function(err, values) { - if (err) { - cb(err); - return; - } - - values.forEach(function(length) { - knownLength += length; - }); - - cb(null, knownLength); - }); -}; - -FormData.prototype.submit = function(params, cb) { - - var request - , options - , defaults = { - method : 'post', - headers: this.getHeaders() - }; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - params = parseUrl(params); - - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname - }, defaults); - } - else // use custom params - { - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; - } - } - - // https if specified, fallback to http in any other case - if (params.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } - - // get content length and fire away - this.getLength(function(err, length) { - - // TODO: Add chunked encoding when no length (if err) - - // add content length - request.setHeader('Content-Length', length); - - this.pipe(request); - if (cb) { - request.on('error', cb); - request.on('response', cb.bind(this, null)); - } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (this.error) return; - - this.error = err; - this.pause(); - this.emit('error', err); -}; - -/* - * Santa's little helpers - */ - -// populates missing values -function populate(dst, src) { - for (var prop in src) { - if (!dst[prop]) dst[prop] = src[prop]; - } - return dst; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/README.md deleted file mode 100644 index 9ff1acf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/README.md +++ /dev/null @@ -1,1414 +0,0 @@ -# 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) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [doWhilst](#doWhilst) -* [until](#until) -* [doUntil](#doUntil) -* [forever](#forever) -* [waterfall](#waterfall) -* [compose](#compose) -* [applyEach](#applyEach) -* [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.map(['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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/component.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/component.json deleted file mode 100644 index bbb0115..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js deleted file mode 100755 index cb6320d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +++ /dev/null @@ -1,955 +0,0 @@ -/*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 = setImmediate; - } - 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* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\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* [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.map(['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", - "_id": "async@0.2.9", - "_from": "async@~0.2.9" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore deleted file mode 100644 index aba34f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -*.un~ -/node_modules -/test/tmp diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/License b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile deleted file mode 100644 index b4ff85a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md deleted file mode 100644 index 1a9999e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +++ /dev/null @@ -1,132 +0,0 @@ -# combined-stream - -A stream that emits multiple other streams one after another. - -## Installation - -``` bash -npm install combined-stream -``` - -## Usage - -Here is a simple example that shows how you can use combined-stream to combine -two files into one: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -While the example above works great, it will pause all source streams until -they are needed. If you don't want that to happen, you can set `pauseStreams` -to `false`: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create({pauseStreams: false}); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -However, what if you don't have all the source streams yet, or you don't want -to allocate the resources (file descriptors, memory, etc.) for them right away? -Well, in that case you can simply provide a callback that supplies the stream -by calling a `next()` function: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(function(next) { - next(fs.createReadStream('file1.txt')); -}); -combinedStream.append(function(next) { - next(fs.createReadStream('file2.txt')); -}); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -## API - -### CombinedStream.create([options]) - -Returns a new combined stream object. Available options are: - -* `maxDataSize` -* `pauseStreams` - -The effect of those options is described below. - -### combinedStream.pauseStreams = true - -Whether to apply back pressure to the underlaying streams. If set to `false`, -the underlaying streams will never be paused. If set to `true`, the -underlaying streams will be paused right after being appended, as well as when -`delayedStream.pipe()` wants to throttle. - -### combinedStream.maxDataSize = 2 * 1024 * 1024 - -The maximum amount of bytes (or characters) to buffer for all source streams. -If this value is exceeded, `combinedStream` emits an `'error'` event. - -### combinedStream.dataSize = 0 - -The amount of bytes (or characters) currently buffered by `combinedStream`. - -### combinedStream.append(stream) - -Appends the given `stream` to the combinedStream object. If `pauseStreams` is -set to `true, this stream will also be paused right away. - -`streams` can also be a function that takes one parameter called `next`. `next` -is a function that must be invoked in order to provide the `next` stream, see -example above. - -Regardless of how the `stream` is appended, combined-stream always attaches an -`'error'` listener to it, so you don't have to do that manually. - -Special case: `stream` can also be a String or Buffer. - -### combinedStream.write(data) - -You should not call this, `combinedStream` takes care of piping the appended -streams into itself for you. - -### combinedStream.resume() - -Causes `combinedStream` to start drain the streams it manages. The function is -idempotent, and also emits a `'resume'` event each time which usually goes to -the stream that is currently being drained. - -### combinedStream.pause(); - -If `combinedStream.pauseStreams` is set to `false`, this does nothing. -Otherwise a `'pause'` event is emitted, this goes to the stream that is -currently being drained, so you can use it to apply back pressure. - -### combinedStream.end(); - -Sets `combinedStream.writable` to false, emits an `'end'` event, and removes -all streams from the queue. - -### combinedStream.destroy(); - -Same as `combinedStream.end()`, except it emits a `'close'` event instead of -`'end'`. - -## License - -combined-stream is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js deleted file mode 100644 index 32849fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +++ /dev/null @@ -1,185 +0,0 @@ -var util = require('util'); -var Stream = require('stream').Stream; -var DelayedStream = require('delayed-stream'); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - stream.on('data', this._checkDataSize.bind(this)); - - stream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)) - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore deleted file mode 100644 index 2fedb26..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -*.un~ -/node_modules/* diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile deleted file mode 100644 index b4ff85a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md deleted file mode 100644 index 5cb5b35..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +++ /dev/null @@ -1,154 +0,0 @@ -# delayed-stream - -Buffers events from a stream until you are ready to handle them. - -## Installation - -``` bash -npm install delayed-stream -``` - -## Usage - -The following example shows how to write a http echo server that delays its -response by 1000 ms. - -``` javascript -var DelayedStream = require('delayed-stream'); -var http = require('http'); - -http.createServer(function(req, res) { - var delayed = DelayedStream.create(req); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 1000); -}); -``` - -If you are not using `Stream#pipe`, you can also manually release the buffered -events by calling `delayedStream.resume()`: - -``` javascript -var delayed = DelayedStream.create(req); - -setTimeout(function() { - // Emit all buffered events and resume underlaying source - delayed.resume(); -}, 1000); -``` - -## Implementation - -In order to use this meta stream properly, here are a few things you should -know about the implementation. - -### Event Buffering / Proxying - -All events of the `source` stream are hijacked by overwriting the `source.emit` -method. Until node implements a catch-all event listener, this is the only way. - -However, delayed-stream still continues to emit all events it captures on the -`source`, regardless of whether you have released the delayed stream yet or -not. - -Upon creation, delayed-stream captures all `source` events and stores them in -an internal event buffer. Once `delayedStream.release()` is called, all -buffered events are emitted on the `delayedStream`, and the event buffer is -cleared. After that, delayed-stream merely acts as a proxy for the underlaying -source. - -### Error handling - -Error events on `source` are buffered / proxied just like any other events. -However, `delayedStream.create` attaches a no-op `'error'` listener to the -`source`. This way you only have to handle errors on the `delayedStream` -object, rather than in two places. - -### Buffer limits - -delayed-stream provides a `maxDataSize` property that can be used to limit -the amount of data being buffered. In order to protect you from bad `source` -streams that don't react to `source.pause()`, this feature is enabled by -default. - -## API - -### DelayedStream.create(source, [options]) - -Returns a new `delayedStream`. Available options are: - -* `pauseStream` -* `maxDataSize` - -The description for those properties can be found below. - -### delayedStream.source - -The `source` stream managed by this object. This is useful if you are -passing your `delayedStream` around, and you still want to access properties -on the `source` object. - -### delayedStream.pauseStream = true - -Whether to pause the underlaying `source` when calling -`DelayedStream.create()`. Modifying this property afterwards has no effect. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. You can also modify this property during runtime. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. - -### delayedStream.dataSize = 0 - -The amount of data buffered so far. - -### delayedStream.readable - -An ECMA5 getter that returns the value of `source.readable`. - -### delayedStream.resume() - -If the `delayedStream` has not been released so far, `delayedStream.release()` -is called. - -In either case, `source.resume()` is called. - -### delayedStream.pause() - -Calls `source.pause()`. - -### delayedStream.pipe(dest) - -Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. - -### delayedStream.release() - -Emits and clears all events that have been buffered up so far. This does not -resume the underlaying source, use `delayedStream.resume()` instead. - -## License - -delayed-stream is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js deleted file mode 100644 index 7c10d48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +++ /dev/null @@ -1,99 +0,0 @@ -var Stream = require('stream').Stream; -var util = require('util'); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -DelayedStream.prototype.__defineGetter__('readable', function() { - return this.source.readable; -}); - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json deleted file mode 100644 index 38341b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "version": "0.0.5", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n var delayed = DelayedStream.create(req);\n\n setTimeout(function() {\n res.writeHead(200);\n delayed.pipe(res);\n }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n // Emit all buffered events and resume underlaying source\n delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-delayed-stream/issues" - }, - "_id": "delayed-stream@0.0.5", - "_from": "delayed-stream@0.0.5" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js deleted file mode 100644 index 4d71b8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +++ /dev/null @@ -1,6 +0,0 @@ -var common = module.exports; - -common.DelayedStream = require('..'); -common.assert = require('assert'); -common.fake = require('fake'); -common.PORT = 49252; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js deleted file mode 100644 index 9ecad5b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var DelayedStream = common.DelayedStream; -var http = require('http'); - -var UPLOAD = new Buffer(10 * 1024 * 1024); - -var server = http.createServer(function(req, res) { - var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length}); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 10); -}); -server.listen(common.PORT, function() { - var request = http.request({ - method: 'POST', - port: common.PORT, - }); - - request.write(UPLOAD); - request.end(); - - request.on('response', function(res) { - var received = 0; - res - .on('data', function(chunk) { - received += chunk.length; - }) - .on('end', function() { - assert.equal(received, UPLOAD.length); - server.close(); - }); - }); -}); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js deleted file mode 100644 index 6f417f3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +++ /dev/null @@ -1,21 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testAutoPause() { - var source = new Stream(); - - fake.expect(source, 'pause', 1); - var delayedStream = DelayedStream.create(source); - fake.verify(); -})(); - -(function testDisableAutoPause() { - var source = new Stream(); - fake.expect(source, 'pause', 0); - - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js deleted file mode 100644 index b50c397..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +++ /dev/null @@ -1,14 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(source, 'pause'); - delayedStream.pause(); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js deleted file mode 100644 index fc4047e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +++ /dev/null @@ -1,48 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // delayedStream must not emit until we resume - fake.expect(delayedStream, 'emit', 0); - - // but our original source must emit - var params = []; - source.on('foo', function(param) { - params.push(param); - }); - - source.emit('foo', 1); - source.emit('foo', 2); - - // Make sure delayedStream did not emit, and source did - assert.deepEqual(params, [1, 2]); - fake.verify(); - - // After resume, delayedStream must playback all events - fake - .stub(delayedStream, 'emit') - .times(Infinity) - .withArg(1, 'newListener'); - fake.expect(delayedStream, 'emit', ['foo', 1]); - fake.expect(delayedStream, 'emit', ['foo', 2]); - fake.expect(source, 'resume'); - - delayedStream.resume(); - fake.verify(); - - // Calling resume again will delegate to source - fake.expect(source, 'resume'); - delayedStream.resume(); - fake.verify(); - - // Emitting more events directly leads to them being emitted - fake.expect(delayedStream, 'emit', ['foo', 3]); - source.emit('foo', 3); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js deleted file mode 100644 index a9d35e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +++ /dev/null @@ -1,15 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testHandleSourceErrors() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // We deal with this by attaching a no-op listener to 'error' on the source - // when creating a new DelayedStream. This way error events on the source - // won't throw. - source.emit('error', new Error('something went wrong')); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 7638a2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,18 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testMaxDataSize() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false}); - - source.emit('data', new Buffer(1024)); - - fake - .expect(delayedStream, 'emit') - .withArg(1, 'error'); - source.emit('data', new Buffer(1)); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js deleted file mode 100644 index 7d312ab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testPipeReleases() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(delayedStream, 'resume'); - delayedStream.pipe(new Stream()); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js deleted file mode 100644 index d436163..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testProxyReadableProperty() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - source.readable = fake.value('source.readable'); - assert.strictEqual(delayedStream.readable, source.readable); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js deleted file mode 100755 index 0bb8e82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json deleted file mode 100644 index 0dd4141..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "combined-stream", - "description": "A stream that emits multiple other streams one after another.", - "version": "0.0.4", - "homepage": "https://github.com/felixge/node-combined-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-combined-stream.git" - }, - "main": "./lib/combined_stream", - "engines": { - "node": "*" - }, - "dependencies": { - "delayed-stream": "0.0.5" - }, - "devDependencies": { - "far": "0.0.1" - }, - "readme": "# combined-stream\n\nA stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = true\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = 2 * 1024 * 1024\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = 0\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-combined-stream/issues" - }, - "_id": "combined-stream@0.0.4", - "_from": "combined-stream@~0.0.4" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js deleted file mode 100644 index 8154348..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js +++ /dev/null @@ -1,23 +0,0 @@ -var common = module.exports; - -var path = require('path'); -var fs = require('fs'); -var root = path.join(__dirname, '..'); - -common.dir = { - fixture: root + '/test/fixture', - tmp: root + '/test/tmp', -}; - -// Create tmp directory if it does not exist -// Not using fs.exists so as to be node 0.6.x compatible -try { - fs.statSync(common.dir.tmp); -} -catch (e) { - // Dir does not exist - fs.mkdirSync(common.dir.tmp); -} - -common.CombinedStream = require(root); -common.assert = require('assert'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt deleted file mode 100644 index 50e0218..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt +++ /dev/null @@ -1,256 +0,0 @@ -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt deleted file mode 100644 index da1d821..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt +++ /dev/null @@ -1,256 +0,0 @@ -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js deleted file mode 100644 index 44ecaba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js +++ /dev/null @@ -1,27 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE1)); - }); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE2)); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js deleted file mode 100644 index e3fbd18..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js +++ /dev/null @@ -1,34 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; - -(function testDataSizeGetter() { - var combinedStream = CombinedStream.create(); - - assert.strictEqual(combinedStream.dataSize, 0); - - // Test one stream - combinedStream._streams.push({dataSize: 10}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 10); - - // Test two streams - combinedStream._streams.push({dataSize: 23}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test currentStream - combinedStream._currentStream = {dataSize: 20}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 53); - - // Test currentStream without dataSize - combinedStream._currentStream = {}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test stream function - combinedStream._streams.push(function() {}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js deleted file mode 100644 index c678575..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var BUFFER = new Buffer('Bacon is delicious'); -var FILE2 = common.dir.fixture + '/file2.txt'; -var STRING = 'The € kicks the $\'s ass!'; - -var EXPECTED = - fs.readFileSync(FILE1) - + BUFFER - + fs.readFileSync(FILE2) - + STRING; -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(BUFFER); - combinedStream.append(fs.createReadStream(FILE2)); - combinedStream.append(function(next) { - next(STRING); - }); - - var tmpFile = common.dir.tmp + '/combined-file1-buffer-file2-string.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js deleted file mode 100644 index 263cfdf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js +++ /dev/null @@ -1,35 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.equal(stream2.dataSize, 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - console.error(GOT.length, EXPECTED.length); - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js deleted file mode 100644 index c3d288d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js +++ /dev/null @@ -1,39 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var util = require('util'); -var Stream = require('stream').Stream; - -var s = CombinedStream.create(); - - -function StringStream(){ - this.writable=true; - this.str="" -} -util.inherits(StringStream,Stream); - -StringStream.prototype.write=function(chunk,encoding){ - this.str+=chunk.toString(); - this.emit('data',chunk); -} - -StringStream.prototype.end=function(chunk,encoding){ - this.emit('end'); -} - -StringStream.prototype.toString=function(){ - return this.str; -} - - -s.append("foo."); -s.append(""); -s.append("bar"); - -var ss = new StringStream(); - -s.pipe(ss); -s.resume(); - -assert.equal(ss.toString(),"foo.bar"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js deleted file mode 100644 index aefa36e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var FILE1 = common.dir.fixture + '/file1.txt'; -var fileStream = fs.createReadStream(FILE1); - -var foo = function(){}; - -(function testIsStreamLike() { - assert(! CombinedStream.isStreamLike(true)); - assert(! CombinedStream.isStreamLike("I am a string")); - assert(! CombinedStream.isStreamLike(7)); - assert(! CombinedStream.isStreamLike(foo)); - - assert(CombinedStream.isStreamLike(fileStream)); -})(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 25f47a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false, maxDataSize: 20736}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var gotErr = null; - combinedStream.on('error', function(err) { - gotErr = err; - }); - - process.on('exit', function() { - assert.ok(gotErr); - assert.ok(gotErr.message.match(/bytes/)); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js deleted file mode 100644 index 30a3a6f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js +++ /dev/null @@ -1,30 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.ok(stream2.dataSize > 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js deleted file mode 100755 index 0bb8e82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/package.json deleted file mode 100644 index 146491b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/form-data/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "form-data", - "description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "0.1.2", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-form-data.git" - }, - "main": "./lib/form_data", - "scripts": { - "test": "node test/run.js" - }, - "engines": { - "node": ">= 0.6" - }, - "dependencies": { - "combined-stream": "~0.0.4", - "mime": "~1.2.11", - "async": "~0.2.9" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/felixge/node-form-data/master/License" - } - ], - "devDependencies": { - "fake": "~0.2.2", - "far": "~0.0.7", - "formidable": "~1.0.14", - "request": "~2.27.0" - }, - "readme": "# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)\n\nA module to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n form.append('my_field', 'my value');\n form.append('my_buffer', new Buffer(10));\n form.append('my_logo', response);\n});\n```\n\nOr @mikeal's request stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n // res – response object (http.IncomingMessage) //\n res.resume(); // for node-0.10.x\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n method: 'post',\n host: 'example.org',\n path: '/upload',\n headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n if (err) throw err;\n\n var form = new FormData();\n\n form.append('file', stdout, {\n filename: 'unicycle.jpg',\n contentType: 'image/jpg',\n knownLength: 19806\n });\n\n form.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n host: 'example.com',\n path: '/probably.php?extra=params',\n auth: 'username:password'\n}, function(err, res) {\n console.log(res.statusCode);\n});\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]\n\n## TODO\n\n- Add new streams (0.10) support and try really hard not to break it for 0.8.x.\n\n## License\n\nForm-Data is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-form-data/issues" - }, - "_id": "form-data@0.1.2", - "_from": "form-data@~0.1.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/.npmignore deleted file mode 100644 index 77ba16c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/.travis.yml deleted file mode 100755 index 047f7e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js - -node_js: - - 0.10 - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/LICENSE deleted file mode 100755 index e699a7b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2012-2013, Eran Hammer. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Eran Hammer nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/Makefile deleted file mode 100755 index 5f339bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -test: - @node node_modules/lab/bin/lab -test-cov: - @node node_modules/lab/bin/lab -r threshold -t 100 -test-cov-html: - @node node_modules/lab/bin/lab -r html -o coverage.html -complexity: - @node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib - -.PHONY: test test-cov test-cov-html complexity diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/README.md deleted file mode 100755 index 010bac6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/hawk/README.md +++ /dev/null @@ -1,627 +0,0 @@ -![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png) - - **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial -HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz). - -Current version: **1.0** - -[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk) - -# Table of Content - -- [**Introduction**](#introduction) - - [Replay Protection](#replay-protection) - - [Usage Example](#usage-example) - - [Protocol Example](#protocol-example) - - [Payload Validation](#payload-validation) - - [Response Payload Validation](#response-payload-validation) - - [Browser Support and Considerations](#browser-support-and-considerations) -

        -- [**Single URI Authorization**](#single-uri-authorization) - - [Usage Example](#bewit-usage-example) -

        -- [**Security Considerations**](#security-considerations) - - [MAC Keys Transmission](#mac-keys-transmission) - - [Confidentiality of Requests](#confidentiality-of-requests) - - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers) - - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials) - - [Entropy of Keys](#entropy-of-keys) - - [Coverage Limitations](#coverage-limitations) - - [Future Time Manipulation](#future-time-manipulation) - - [Client Clock Poisoning](#client-clock-poisoning) - - [Bewit Limitations](#bewit-limitations) - - [Host Header Forgery](#host-header-forgery) -

        -- [**Frequently Asked Questions**](#frequently-asked-questions) -

        -- [**Acknowledgements**](#acknowledgements) - -# Introduction - -**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with -partial cryptographic verification of the request and response, covering the HTTP method, request URI, host, -and optionally the request payload. - -Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of -client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme, -the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is -included in its place. - -However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of -replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less -"chattiness" (interaction with the server). - -Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because -the client and server must both have access to the key material in the clear. - -The primary design goals of this scheme are to: -* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources, -* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where - to send an authenticated request), and -* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client - failure to validate the server's identity as part of its TLS handshake. - -In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using -a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk). - -The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server, -which is beyond the scope of this module. Typically, the shared credentials are established via an initial -TLS-protected phase or derived from some other shared confidential information available to both the client -and the server. - - -## Replay Protection - -Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more -than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when -making requests. This gives the server enough information to prevent replay attacks. - -The nonce is generated by the client, and is a string unique across all requests with the same timestamp and -key identifier combination. - -The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards -are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks. -By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in -practice translates to a maximum of 2 minutes as the skew can be positive or negative). - -Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client -clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types -(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response -to a bad timestamp. - -There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a -potential attack vector). Instead, the client only uses the server's time to calculate an offset used only -for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing -the number of round trips required to authenticate the first request. - - -## Usage Example - -Server code: - -```javascript -var Http = require('http'); -var Hawk = require('hawk'); - - -// Credentials lookup function - -var credentialsFunc = function (id, callback) { - - var credentials = { - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256', - user: 'Steve' - }; - - return callback(null, credentials); -}; - -// Create HTTP server - -var handler = function (req, res) { - - // Authenticate incoming request - - Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) { - - // Prepare response - - var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!'); - var headers = { 'Content-Type': 'text/plain' }; - - // Generate Server-Authorization response header - - var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] }); - headers['Server-Authorization'] = header; - - // Send the response back - - res.writeHead(!err ? 200 : 401, headers); - res.end(payload); - }); -}; - -// Start server - -Http.createServer(handler).listen(8000, 'example.com'); -``` - -Client code: - -```javascript -var Request = require('request'); -var Hawk = require('hawk'); - - -// Client credentials - -var credentials = { - id: 'dh37fgj492je', - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256' -} - -// Request options - -var requestOptions = { - uri: 'http://example.com:8000/resource/1?b=1&a=2', - method: 'GET', - headers: {} -}; - -// Generate Authorization request header - -var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' }); -requestOptions.headers.Authorization = header.field; - -// Send authenticated request - -Request(requestOptions, function (error, response, body) { - - // Authenticate the server's response - - var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body }); - - // Output results - - console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)')); -}); -``` - -**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local -machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method. - -```javascript -Hawk.sntp.start(); -``` - - -## Protocol Example - -The client attempts to access a protected resource without authentication, sending the following HTTP request to -the resource server: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -``` - -The resource server returns an authentication challenge. - -``` -HTTP/1.1 401 Unauthorized -WWW-Authenticate: Hawk -``` - -The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/" -server. The **Hawk** credentials issued to the client include the following attributes: - -* Key identifier: dh37fgj492je -* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn -* Algorithm: sha256 - -The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1, -1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline -character): - -``` -hawk.1.header -1353832234 -j4h3g2 -GET -/resource/1?b=1&a=2 -example.com -8000 - -some-app-ext-data - -``` - -The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string. -The result is base64-encoded to produce the request MAC: - -``` -6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE= -``` - -The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using -the HTTP `Authorization` request header field: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=" -``` - -The server validates the request by calculating the request MAC again based on the request received and verifies the validity -and scope of the **Hawk** credentials. If valid, the server responds with the requested resource. - - -### Payload Validation - -**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash -using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character): -* `hawk.1.payload` -* the content-type in lowercase, without any parameters (e.g. `application/json`) -* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability) - -For example: - -* Payload: `Thank you for flying Hawk` -* Content Type: `text/plain` -* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=` - -Results in the following input to the payload hash function (newline terminated values): - -``` -hawk.1.payload -text/plain -Thank you for flying Hawk - -``` - -Which produces the following hash value: - -``` -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -``` - -The client constructs the normalized request string (newline terminated values): - -``` -hawk.1.header -1353832234 -j4h3g2 -POST -/resource/1?a=1&b=2 -example.com -8000 -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -some-app-ext-data - -``` - -Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data, -and request MAC, with the request using the HTTP `Authorization` request header field: - -``` -POST /resource/1?a=1&b=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=" -``` - -It is up to the server if and when it validates the payload for any given request, based solely on it's security policy -and the nature of the data included. - -If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct -the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value -with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash. - -However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed -at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value -provided by the client after validating the MAC. - -It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value -included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided -by the client, the payload may be modified by an attacker. - - -## Response Payload Validation - -**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the -client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header -as a response header using the exact same syntax as the `Authorization` request header field. - -The header is contructed using the same process as the client's request header. The server uses the same credentials and other -artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with -new values based on the server response. The rest as identical to those used by the client. - -The result MAC digest is included with the optional `hash` and `ext` values: - -``` -Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific" -``` - - -## Browser Support and Considerations - -A browser script is provided for including using a `')); - expect(boom.response.payload.message).to.not.contain(''); - expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e'); - done(); - }); - - it('encodes \' characters', function (done) { - - var encoded = Hoek.escapeJavaScript('something(\'param\')'); - expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29'); - done(); - }); - - it('encodes large unicode characters with the correct padding', function (done) { - - var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000)); - expect(encoded).to.equal('\\u0500\\u1000'); - done(); - }); - - it('doesn\'t throw an exception when passed null', function (done) { - - var encoded = Hoek.escapeJavaScript(null); - expect(encoded).to.equal(''); - done(); - }); - }); - - describe('#escapeHtml', function () { - - it('encodes / characters', function (done) { - - var encoded = Hoek.escapeHtml(''); - expect(encoded).to.equal('<script>alert(1)</script>'); - done(); - }); - - it('encodes < and > as named characters', function (done) { - - var encoded = Hoek.escapeHtml(' -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -### 1.4.0 - -* Improved module context detection -* Removed public RNG functions - -### 1.3.2 - -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -### 1.3.0 - -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/README.md deleted file mode 100644 index aaeb2ea..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# node-uuid Benchmarks - -### Results - -To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark - -### Run them yourself - -node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`. - -To prepare and run the benchmark issue; - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -You'll see an output like this one: - -``` -# v4 -nodeuuid.v4(): 854700 uuids/second -nodeuuid.v4('binary'): 788643 uuids/second -nodeuuid.v4('binary', buffer): 1336898 uuids/second -uuid(): 479386 uuids/second -uuid('binary'): 582072 uuids/second -uuidjs.create(4): 312304 uuids/second - -# v1 -nodeuuid.v1(): 938086 uuids/second -nodeuuid.v1('binary'): 683060 uuids/second -nodeuuid.v1('binary', buffer): 1644736 uuids/second -uuidjs.create(1): 190621 uuids/second -``` - -* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library. -* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK. - -If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file: - -``` -for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done; -``` - -If you're interested in how performance varies between different node versions, you can issue the above command multiple times. - -You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot: - -``` -(cd benchmark/ && ./bench.sh) -``` - -This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu deleted file mode 100644 index a342fbb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ /dev/null @@ -1,174 +0,0 @@ -#!/opt/local/bin/gnuplot -persist -# -# -# G N U P L O T -# Version 4.4 patchlevel 3 -# last modified March 2011 -# System: Darwin 10.8.0 -# -# Copyright (C) 1986-1993, 1998, 2004, 2007-2010 -# Thomas Williams, Colin Kelley and many others -# -# gnuplot home: http://www.gnuplot.info -# faq, bugs, etc: type "help seeking-assistance" -# immediate help: type "help" -# plot window: hit 'h' -set terminal postscript eps noenhanced defaultplex \ - leveldefault color colortext \ - solid linewidth 1.2 butt noclip \ - palfuncparam 2000,0.003 \ - "Helvetica" 14 -set output 'bench.eps' -unset clip points -set clip one -unset clip two -set bar 1.000000 front -set border 31 front linetype -1 linewidth 1.000 -set xdata -set ydata -set zdata -set x2data -set y2data -set timefmt x "%d/%m/%y,%H:%M" -set timefmt y "%d/%m/%y,%H:%M" -set timefmt z "%d/%m/%y,%H:%M" -set timefmt x2 "%d/%m/%y,%H:%M" -set timefmt y2 "%d/%m/%y,%H:%M" -set timefmt cb "%d/%m/%y,%H:%M" -set boxwidth -set style fill empty border -set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 -set dummy x,y -set format x "% g" -set format y "% g" -set format x2 "% g" -set format y2 "% g" -set format z "% g" -set format cb "% g" -set angles radians -unset grid -set key title "" -set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 -set key maxcolumns 2 maxrows 0 -unset label -unset arrow -set style increment default -unset style line -set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0 -unset style arrow -set style histogram clustered gap 2 title offset character 0, 0, 0 -unset logscale -set offsets graph 0.05, 0.15, 0, 0 -set pointsize 1.5 -set pointintervalbox 1 -set encoding default -unset polar -unset parametric -unset decimalsign -set view 60, 30, 1, 1 -set samples 100, 100 -set isosamples 10, 10 -set surface -unset contour -set clabel '%8.3g' -set mapping cartesian -set datafile separator whitespace -unset hidden3d -set cntrparam order 4 -set cntrparam linear -set cntrparam levels auto 5 -set cntrparam points 5 -set size ratio 0 1,1 -set origin 0,0 -set style data points -set style function lines -set xzeroaxis linetype -2 linewidth 1.000 -set yzeroaxis linetype -2 linewidth 1.000 -set zzeroaxis linetype -2 linewidth 1.000 -set x2zeroaxis linetype -2 linewidth 1.000 -set y2zeroaxis linetype -2 linewidth 1.000 -set ticslevel 0.5 -set mxtics default -set mytics default -set mztics default -set mx2tics default -set my2tics default -set mcbtics default -set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set xtics norangelimit -set xtics () -set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set ytics autofreq norangelimit -set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0 -set ztics autofreq norangelimit -set nox2tics -set noy2tics -set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set cbtics autofreq norangelimit -set title "" -set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" -set timestamp offset character 0, 0, 0 font "" norotate -set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale rfixmin -set autoscale rfixmax -set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) -set autoscale tfixmin -set autoscale tfixmax -set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale ufixmin -set autoscale ufixmax -set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale vfixmin -set autoscale vfixmax -set xlabel "" -set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" -set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate -set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) -set autoscale xfixmin -set autoscale xfixmax -set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) -set autoscale x2fixmin -set autoscale x2fixmax -set ylabel "" -set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" -set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) -set autoscale yfixmin -set autoscale yfixmax -set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) -set autoscale y2fixmin -set autoscale y2fixmax -set zlabel "" -set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale zfixmin -set autoscale zfixmax -set cblabel "" -set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale cbfixmin -set autoscale cbfixmax -set zero 1e-08 -set lmargin -1 -set bmargin -1 -set rmargin -1 -set tmargin -1 -set pm3d explicit at s -set pm3d scansautomatic -set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB -set palette rgbformulae 7, 5, 15 -set colorbox default -set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath -set fit noerrorvariables -GNUTERM = "aqua" -plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 -# EOF diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/bench.sh deleted file mode 100755 index d870a0c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# for a given node version run: -# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done; - -PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte') -FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es) -INDICES=(2 3 2 3 2 2 2 2 2) -VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " ) -TMPJOIN="tmp_join" -OUTPUT="bench_results.txt" - -for I in ${!FILES[*]}; do - F=${FILES[$I]} - P=${PATTERNS[$I]} - INDEX=${INDICES[$I]} - echo "version $F" > $F - for V in $VERSIONS; do - (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F - done - if [ $I == 0 ]; then - cat $F > $TMPJOIN - else - join $TMPJOIN $F > $OUTPUT - cp $OUTPUT $TMPJOIN - fi - rm $F -done - -rm $TMPJOIN - -gnuplot bench.gnu -convert -density 200 -resize 800x560 -flatten bench.eps bench.png -rm bench.eps diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c deleted file mode 100644 index dbfc75f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Test performance of native C UUID generation - -To Compile: cc -luuid benchmark-native.c -o benchmark-native -*/ - -#include -#include -#include -#include - -int main() { - uuid_t myid; - char buf[36+1]; - int i; - struct timeval t; - double start, finish; - - gettimeofday(&t, NULL); - start = t.tv_sec + t.tv_usec/1e6; - - int n = 2e5; - for (i = 0; i < n; i++) { - uuid_generate(myid); - uuid_unparse(myid, buf); - } - - gettimeofday(&t, NULL); - finish = t.tv_sec + t.tv_usec/1e6; - double dur = finish - start; - - printf("%d uuids/sec", (int)(n/dur)); - return 0; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js deleted file mode 100644 index 40e6efb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +++ /dev/null @@ -1,84 +0,0 @@ -try { - var nodeuuid = require('../uuid'); -} catch (e) { - console.error('node-uuid require failed - skipping tests'); -} - -try { - var uuid = require('uuid'); -} catch (e) { - console.error('uuid require failed - skipping tests'); -} - -try { - var uuidjs = require('uuid-js'); -} catch (e) { - console.error('uuid-js require failed - skipping tests'); -} - -var N = 5e5; - -function rate(msg, t) { - console.log(msg + ': ' + - (N / (Date.now() - t) * 1e3 | 0) + - ' uuids/second'); -} - -console.log('# v4'); - -// node-uuid - string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4(); - rate('nodeuuid.v4() - using node.js crypto RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG}); - rate('nodeuuid.v4() - using Math.random() RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary'); - rate('nodeuuid.v4(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer); - rate('nodeuuid.v4(\'binary\', buffer)', t); -} - -// libuuid - string form -if (uuid) { - for (var i = 0, t = Date.now(); i < N; i++) uuid(); - rate('uuid()', t); - - for (var i = 0, t = Date.now(); i < N; i++) uuid('binary'); - rate('uuid(\'binary\')', t); -} - -// uuid-js - string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4); - rate('uuidjs.create(4)', t); -} - -// 140byte.es -for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)}); -rate('140byte.es_v4', t); - -console.log(''); -console.log('# v1'); - -// node-uuid - v1 string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1(); - rate('nodeuuid.v1()', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary'); - rate('nodeuuid.v1(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer); - rate('nodeuuid.v1(\'binary\', buffer)', t); -} - -// uuid-js - v1 string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1); - rate('uuidjs.create(1)', t); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/component.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/component.json deleted file mode 100644 index ace2134..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/component.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "node-uuid", - "repo": "broofa/node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.0", - "author": "Robert Kieffer ", - "contributors": [ - {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} - ], - "keywords": ["uuid", "guid", "rfc4122"], - "dependencies": {}, - "development": {}, - "main": "uuid.js", - "scripts": [ - "uuid.js" - ], - "license": "MIT" -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/package.json deleted file mode 100644 index 3fb5825..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "lib": ".", - "main": "./uuid.js", - "repository": { - "type": "git", - "url": "https://github.com/broofa/node-uuid.git" - }, - "version": "1.4.1", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "_id": "node-uuid@1.4.1", - "_from": "node-uuid@~1.4.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/compare_v1.js deleted file mode 100644 index 05af822..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/compare_v1.js +++ /dev/null @@ -1,63 +0,0 @@ -var assert = require('assert'), - nodeuuid = require('../uuid'), - uuidjs = require('uuid-js'), - libuuid = require('uuid').generate, - util = require('util'), - exec = require('child_process').exec, - os = require('os'); - -// On Mac Os X / macports there's only the ossp-uuid package that provides uuid -// On Linux there's uuid-runtime which provides uuidgen -var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; - -function compare(ids) { - console.log(ids); - for (var i = 0; i < ids.length; i++) { - var id = ids[i].split('-'); - id = [id[2], id[1], id[0]].join(''); - ids[i] = id; - } - var sorted = ([].concat(ids)).sort(); - - if (sorted.toString() !== ids.toString()) { - console.log('Warning: sorted !== ids'); - } else { - console.log('everything in order!'); - } -} - -// Test time order of v1 uuids -var ids = []; -while (ids.length < 10e3) ids.push(nodeuuid.v1()); - -var max = 10; -console.log('node-uuid:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); -compare(ids); - -console.log(''); -console.log('uuidjs:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); -compare(ids); - -console.log(''); -console.log('libuuid:'); -ids = []; -var count = 0; -var last = function() { - compare(ids); -} -var cb = function(err, stdout, stderr) { - ids.push(stdout.substring(0, stdout.length-1)); - count++; - if (count < max) { - return next(); - } - last(); -}; -var next = function() { - exec(uuidCmd, cb); -}; -next(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/test.html b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/test.html deleted file mode 100644 index d80326e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/test.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/test.js deleted file mode 100644 index 2469225..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/test/test.js +++ /dev/null @@ -1,228 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/uuid.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/uuid.js deleted file mode 100644 index 2fac6dc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/node-uuid/uuid.js +++ /dev/null @@ -1,245 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/README.md deleted file mode 100644 index 34c4a85..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/README.md +++ /dev/null @@ -1,4 +0,0 @@ -oauth-sign -========== - -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/index.js deleted file mode 100644 index e35bfa6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/index.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/package.json deleted file mode 100644 index f211ed3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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" - }, - "_id": "oauth-sign@0.3.0", - "_from": "oauth-sign@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/test.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/test.js deleted file mode 100644 index 46955ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/oauth-sign/test.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/.gitmodules b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/.npmignore deleted file mode 100644 index e85ce2a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -test -.travis.yml -benchmark.js -component.json -examples.js -History.md -Makefile diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/Readme.md deleted file mode 100644 index 27e54a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/Readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/index.js deleted file mode 100644 index 590491e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/index.js +++ /dev/null @@ -1,387 +0,0 @@ -/** - * 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) 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; -}; - -/** - * Create a nullary object if possible - */ - -function createObject() { - return Object.create - ? Object.create(null) - : {}; -} - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = createObject(); - var t = createObject(); - 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(); - // 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 = createObject(); - 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; -} - -/** - * Restore Object.prototype. - * see pull-request #58 - */ - -function restoreProto(obj) { - if (!Object.create) return obj; - if (isArray(obj)) return obj; - if (obj && 'object' != typeof obj) return obj; - - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - obj[key] = restoreProto(obj[key]); - } - } - - obj.__proto__ = Object.prototype; - 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: createObject() }).base; - - return restoreProto(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 (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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/package.json deleted file mode 100644 index d1475f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/qs/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.6.5", - "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" - }, - "_id": "qs@0.6.5", - "_from": "qs@~0.6.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/README.md deleted file mode 100644 index bb533d5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -tunnel-agent -============ - -HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/index.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/index.js deleted file mode 100644 index 3f7bbb9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/index.js +++ /dev/null @@ -1,227 +0,0 @@ -'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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/package.json deleted file mode 100644 index 3351a28..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/node_modules/tunnel-agent/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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" - }, - "_id": "tunnel-agent@0.3.0", - "_from": "tunnel-agent@~0.3.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/package.json deleted file mode 100755 index dc02051..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "request", - "description": "Simplified HTTP request client.", - "tags": [ - "http", - "simple", - "util", - "utility" - ], - "version": "2.26.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", - "_id": "request@2.26.0", - "dist": { - "shasum": "79b03075cbac2e22ebe41aa7fca884e869c1c212" - }, - "_from": "request@~2.26.0", - "_resolved": "https://registry.npmjs.org/request/-/request-2.26.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/googledoodle.jpg b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/googledoodle.jpg deleted file mode 100644 index f80c9c5..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/googledoodle.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/run.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/server.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/server.js deleted file mode 100644 index b6eacba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/server.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('fs') - , http = require('http') - , path = require('path') - , https = require('https') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - ; - -exports.createServer = function (port) { - port = port || 6767 - var s = http.createServer(function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'http://localhost:'+port - return s; -} - -exports.createSSLServer = function(port, opts) { - port = port || 16767 - - var options = { 'key' : path.join(__dirname, 'ssl', 'test.key') - , 'cert': path.join(__dirname, 'ssl', 'test.crt') - } - if (opts) { - for (var i in opts) options[i] = opts[i] - } - - for (var i in options) { - options[i] = fs.readFileSync(options[i]) - } - - var s = https.createServer(options, function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'https://localhost:'+port - return s; -} - -exports.createPostStream = function (text) { - var postStream = new stream.Stream(); - postStream.writeable = true; - postStream.readable = true; - setTimeout(function () {postStream.emit('data', new Buffer(text)); postStream.emit('end')}, 0); - return postStream; -} -exports.createPostValidator = function (text, reqContentType) { - var l = function (req, resp) { - var r = ''; - req.on('data', function (chunk) {r += chunk}) - req.on('end', function () { - if (req.headers['content-type'] && req.headers['content-type'].indexOf('boundary=') >= 0) { - var boundary = req.headers['content-type'].split('boundary=')[1]; - text = text.replace(/__BOUNDARY__/g, boundary); - } - if (r !== text) console.log(r, text); - assert.equal(r, text) - if (reqContentType) { - assert.ok(req.headers['content-type']) - assert.ok(~req.headers['content-type'].indexOf(reqContentType)) - } - resp.writeHead(200, {'content-type':'text/plain'}) - resp.write('OK') - resp.end() - }) - } - return l; -} -exports.createGetResponse = function (text, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - resp.write(text) - resp.end() - } - return l; -} -exports.createChunkResponse = function (chunks, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - chunks.forEach(function (chunk) { - resp.write(chunk) - }) - resp.end() - } - return l; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/squid.conf b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/squid.conf deleted file mode 100644 index 0d4a3b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/squid.conf +++ /dev/null @@ -1,77 +0,0 @@ -# -# Recommended minimum configuration: -# -acl manager proto cache_object -acl localhost src 127.0.0.1/32 ::1 -acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 - -# Example rule allowing access from your local networks. -# Adapt to list your (internal) IP networks from where browsing -# should be allowed -acl localnet src 10.0.0.0/8 # RFC1918 possible internal network -acl localnet src 172.16.0.0/12 # RFC1918 possible internal network -acl localnet src 192.168.0.0/16 # RFC1918 possible internal network -acl localnet src fc00::/7 # RFC 4193 local private network range -acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines - -acl SSL_ports port 443 -acl Safe_ports port 80 # http -acl Safe_ports port 21 # ftp -acl Safe_ports port 443 # https -acl Safe_ports port 70 # gopher -acl Safe_ports port 210 # wais -acl Safe_ports port 1025-65535 # unregistered ports -acl Safe_ports port 280 # http-mgmt -acl Safe_ports port 488 # gss-http -acl Safe_ports port 591 # filemaker -acl Safe_ports port 777 # multiling http -acl CONNECT method CONNECT - -# -# Recommended minimum Access Permission configuration: -# -# Only allow cachemgr access from localhost -http_access allow manager localhost -http_access deny manager - -# Deny requests to certain unsafe ports -http_access deny !Safe_ports - -# Deny CONNECT to other than secure SSL ports -#http_access deny CONNECT !SSL_ports - -# We strongly recommend the following be uncommented to protect innocent -# web applications running on the proxy server who think the only -# one who can access services on "localhost" is a local user -#http_access deny to_localhost - -# -# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS -# - -# Example rule allowing access from your local networks. -# Adapt localnet in the ACL section to list your (internal) IP networks -# from where browsing should be allowed -http_access allow localnet -http_access allow localhost - -# And finally deny all other access to this proxy -http_access deny all - -# Squid normally listens to port 3128 -http_port 3128 - -# We recommend you to use at least the following line. -hierarchy_stoplist cgi-bin ? - -# Uncomment and adjust the following to add a disk cache directory. -#cache_dir ufs /usr/local/var/cache 100 16 256 - -# Leave coredumps in the first cache dir -coredump_dir /usr/local/var/cache - -# Add any of your own refresh_pattern entries above these. -refresh_pattern ^ftp: 1440 20% 10080 -refresh_pattern ^gopher: 1440 0% 1440 -refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 -refresh_pattern . 0 20% 4320 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.cnf b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.cnf deleted file mode 100644 index 425a889..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.cnf +++ /dev/null @@ -1,20 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no -output_password = password - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = request Certificate Authority -CN = requestCA -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.crl b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.crl deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.crt b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.crt deleted file mode 100644 index b4524e4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.crt +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICvTCCAiYCCQDn+P/MSbDsWjANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGiMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxJjAkBgNVBAsTHXJlcXVlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 -MRIwEAYDVQQDEwlyZXF1ZXN0Q0ExJjAkBgkqhkiG9w0BCQEWF21pa2VhbEBtaWtl -YWxyb2dlcnMuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7t9pQUAK4 -5XJYTI6NrF0n3G2HZsfN+rPYSVzzL8SuVyb1tHXos+vbPm3NKI4E8X1yVAXU8CjJ -5SqXnp4DAypAhaseho81cbhk7LXUhFz78OvAa+OD+xTAEAnNQ8tGUr4VGyplEjfD -xsBVuqV2j8GPNTftr+drOCFlqfAgMrBn4wIDAQABMA0GCSqGSIb3DQEBBQUAA4GB -ADVdTlVAL45R+PACNS7Gs4o81CwSclukBu4FJbxrkd4xGQmurgfRrYYKjtqiopQm -D7ysRamS3HMN9/VKq2T7r3z1PMHPAy7zM4uoXbbaTKwlnX4j/8pGPn8Ca3qHXYlo -88L/OOPc6Di7i7qckS3HFbXQCTiULtxWmy97oEuTwrAj ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.csr b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.csr deleted file mode 100644 index e48c56e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.csr +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICBjCCAW8CAQAwgaIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEmMCQGA1UECxMdcmVxdWVzdCBD -ZXJ0aWZpY2F0ZSBBdXRob3JpdHkxEjAQBgNVBAMTCXJlcXVlc3RDQTEmMCQGCSqG -SIb3DQEJARYXbWlrZWFsQG1pa2VhbHJvZ2Vycy5jb20wgZ8wDQYJKoZIhvcNAQEB -BQADgY0AMIGJAoGBALu32lBQArjlclhMjo2sXSfcbYdmx836s9hJXPMvxK5XJvW0 -deiz69s+bc0ojgTxfXJUBdTwKMnlKpeengMDKkCFqx6GjzVxuGTstdSEXPvw68Br -44P7FMAQCc1Dy0ZSvhUbKmUSN8PGwFW6pXaPwY81N+2v52s4IWWp8CAysGfjAgMB -AAGgIzAhBgkqhkiG9w0BCQcxFBMScGFzc3dvcmQgY2hhbGxlbmdlMA0GCSqGSIb3 -DQEBBQUAA4GBAGJO7grHeVHXetjHEK8urIxdnvfB2qeZeObz4GPKIkqUurjr0rfj -bA3EK1kDMR5aeQWR8RunixdM16Q6Ry0lEdLVWkdSwRN9dmirIHT9cypqnD/FYOia -SdezZ0lUzXgmJIwRYRwB1KSMMocIf52ll/xC2bEGg7/ZAEuAyAgcZV3X ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.key b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.key deleted file mode 100644 index a53e7f7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.key +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,C8B5887048377F02 - -nyD5ZH0Wup2uWsDvurq5mKDaDrf8lvNn9w0SH/ZkVnfR1/bkwqrFriqJWvZNUG+q -nS0iBYczsWLJnbub9a1zLOTENWUKVD5uqbC3aGHhnoUTNSa27DONgP8gHOn6JgR+ -GAKo01HCSTiVT4LjkwN337QKHnMP2fTzg+IoC/CigvMcq09hRLwU1/guq0GJKGwH -gTxYNuYmQC4Tjh8vdS4liF+Ve/P3qPR2CehZrIOkDT8PHJBGQJRo4xGUIB7Tpk38 -VCk+UZ0JCS2coY8VkY/9tqFJp/ZnnQQVmaNbdRqg7ECKL+bXnNo7yjzmazPZmPe3 -/ShbE0+CTt7LrjCaQAxWbeDzqfo1lQfgN1LulTm8MCXpQaJpv7v1VhIhQ7afjMYb -4thW/ypHPiYS2YJCAkAVlua9Oxzzh1qJoh8Df19iHtpd79Q77X/qf+1JvITlMu0U -gi7yEatmQcmYNws1mtTC1q2DXrO90c+NZ0LK/Alse6NRL/xiUdjug2iHeTf/idOR -Gg/5dSZbnnlj1E5zjSMDkzg6EHAFmHV4jYGSAFLEQgp4V3ZhMVoWZrvvSHgKV/Qh -FqrAK4INr1G2+/QTd09AIRzfy3/j6yD4A9iNaOsEf9Ua7Qh6RcALRCAZTWR5QtEf -dX+iSNJ4E85qXs0PqwkMDkoaxIJ+tmIRJY7y8oeylV8cfGAi8Soubt/i3SlR8IHC -uDMas/2OnwafK3N7ODeE1i7r7wkzQkSHaEz0TrF8XRnP25jAICCSLiMdAAjKfxVb -EvzsFSuAy3Jt6bU3hSLY9o4YVYKE+68ITMv9yNjvTsEiW+T+IbN34w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.srl b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.srl deleted file mode 100644 index 17128db..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/ca.srl +++ /dev/null @@ -1 +0,0 @@ -ADF62016AA40C9C3 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.cnf b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.cnf deleted file mode 100644 index cd1fd1e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.cnf +++ /dev/null @@ -1,19 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = testing -CN = testing.request.mikealrogers.com -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.crt b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.crt deleted file mode 100644 index efe96ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICejCCAeMCCQCt9iAWqkDJwzANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGjMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxEDAOBgNVBAsTB3Rlc3RpbmcxKTAnBgNVBAMTIHRlc3RpbmcucmVx -dWVzdC5taWtlYWxyb2dlcnMuY29tMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlr -ZWFscm9nZXJzLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDgVl0jMumvOpmM -20W5v9yhGgZj8hPhEQF/N7yCBVBn/rWGYm70IHC8T/pR5c0LkWc5gdnCJEvKWQjh -DBKxZD8FAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEABShRkNgFbgs4vUWW9R9deNJj -7HJoiTmvkmoOC7QzcYkjdgHbOxsSq3rBnwxsVjY9PAtPwBn0GRspOeG7KzKRgySB -kb22LyrCFKbEOfKO/+CJc80ioK9zEPVjGsFMyAB+ftYRqM+s/4cQlTg/m89l01wC -yapjN3RxZbInGhWR+jA= ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.csr b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.csr deleted file mode 100644 index a8e7595..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBgjCCASwCAQAwgaMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEQMA4GA1UECxMHdGVzdGluZzEp -MCcGA1UEAxMgdGVzdGluZy5yZXF1ZXN0Lm1pa2VhbHJvZ2Vycy5jb20xJjAkBgkq -hkiG9w0BCQEWF21pa2VhbEBtaWtlYWxyb2dlcnMuY29tMFwwDQYJKoZIhvcNAQEB -BQADSwAwSAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAaAjMCEGCSqGSIb3DQEJBzEU -ExJwYXNzd29yZCBjaGFsbGVuZ2UwDQYJKoZIhvcNAQEFBQADQQBD3E5WekQzCEJw -7yOcqvtPYIxGaX8gRKkYfLPoj3pm3GF5SGqtJKhylKfi89szHXgktnQgzff9FN+A -HidVJ/3u ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.js deleted file mode 100644 index 05e21c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.js +++ /dev/null @@ -1,28 +0,0 @@ -var fs = require("fs") -var https = require("https") -var options = { key: fs.readFileSync("./server.key") - , cert: fs.readFileSync("./server.crt") } - -var server = https.createServer(options, function (req, res) { - res.writeHead(200) - res.end() - server.close() -}) -server.listen(1337) - -var ca = fs.readFileSync("./ca.crt") -var agent = new https.Agent({ host: "localhost", port: 1337, ca: ca }) - -https.request({ host: "localhost" - , method: "HEAD" - , port: 1337 - , headers: { host: "testing.request.mikealrogers.com" } - , agent: agent - , ca: [ ca ] - , path: "/" }, function (res) { - if (res.client.authorized) { - console.log("node test: OK") - } else { - throw new Error(res.client.authorizationError) - } -}).end() diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.key b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.key deleted file mode 100644 index 72d8698..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/ca/server.key +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAQJAK+r8ZM2sze8s7FRo/ApB -iRBtO9fCaIdJwbwJnXKo4RKwZDt1l2mm+fzZ+/QaQNjY1oTROkIIXmnwRvZWfYlW -gQIhAPKYsG+YSBN9o8Sdp1DMyZ/rUifKX3OE6q9tINkgajDVAiEA7Ltqh01+cnt0 -JEnud/8HHcuehUBLMofeg0G+gCnSbXECIQCqDvkXsWNNLnS/3lgsnvH0Baz4sbeJ -rjIpuVEeg8eM5QIgbu0+9JmOV6ybdmmiMV4yAncoF35R/iKGVHDZCAsQzDECIQDZ -0jGz22tlo5YMcYSqrdD3U4sds1pwiAaWFRbCunoUJw== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/npm-ca.crt b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/npm-ca.crt deleted file mode 100644 index fde2fe9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/npm-ca.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x -IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w -bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y -MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV -BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj -YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA -aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE -OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz -Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl -y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC -l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv -yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl -ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/test.crt b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/test.crt deleted file mode 100644 index b357f86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/test.crt +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICQzCCAawCCQCO/XWtRFck1jANBgkqhkiG9w0BAQUFADBmMQswCQYDVQQGEwJU -SDEQMA4GA1UECBMHQmFuZ2tvazEOMAwGA1UEBxMFU2lsb20xGzAZBgNVBAoTElRo -ZSBSZXF1ZXN0IE1vZHVsZTEYMBYGA1UEAxMPcmVxdWVzdC5leGFtcGxlMB4XDTEx -MTIwMzAyMjkyM1oXDTIxMTEzMDAyMjkyM1owZjELMAkGA1UEBhMCVEgxEDAOBgNV -BAgTB0Jhbmdrb2sxDjAMBgNVBAcTBVNpbG9tMRswGQYDVQQKExJUaGUgUmVxdWVz -dCBNb2R1bGUxGDAWBgNVBAMTD3JlcXVlc3QuZXhhbXBsZTCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAwmctddZqlA48+NXs0yOy92DijcQV1jf87zMiYAIlNUto -wghVbTWgJU5r0pdKrD16AptnWJTzKanhItEX8XCCPgsNkq1afgTtJP7rNkwu3xcj -eIMkhJg/ay4ZnkbnhYdsii5VTU5prix6AqWRAhbkBgoA+iVyHyof8wvZyKBoFTMC -AwEAATANBgkqhkiG9w0BAQUFAAOBgQB6BybMJbpeiABgihDfEVBcAjDoQ8gUMgwV -l4NulugfKTDmArqnR9aPd4ET5jX5dkMP4bwCHYsvrcYDeWEQy7x5WWuylOdKhua4 -L4cEi2uDCjqEErIG3cc1MCOk6Cl6Ld6tkIzQSf953qfdEACRytOeUqLNQcrXrqeE -c7U8F6MWLQ== ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/test.key b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/test.key deleted file mode 100644 index b85810d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/ssl/test.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDCZy111mqUDjz41ezTI7L3YOKNxBXWN/zvMyJgAiU1S2jCCFVt -NaAlTmvSl0qsPXoCm2dYlPMpqeEi0RfxcII+Cw2SrVp+BO0k/us2TC7fFyN4gySE -mD9rLhmeRueFh2yKLlVNTmmuLHoCpZECFuQGCgD6JXIfKh/zC9nIoGgVMwIDAQAB -AoGBALXFwfUf8vHTSmGlrdZS2AGFPvEtuvldyoxi9K5u8xmdFCvxnOcLsF2RsTHt -Mu5QYWhUpNJoG+IGLTPf7RJdj/kNtEs7xXqWy4jR36kt5z5MJzqiK+QIgiO9UFWZ -fjUb6oeDnTIJA9YFBdYi97MDuL89iU/UK3LkJN3hd4rciSbpAkEA+MCkowF5kSFb -rkOTBYBXZfiAG78itDXN6DXmqb9XYY+YBh3BiQM28oxCeQYyFy6pk/nstnd4TXk6 -V/ryA2g5NwJBAMgRKTY9KvxJWbESeMEFe2iBIV0c26/72Amgi7ZKUCLukLfD4tLF -+WSZdmTbbqI1079YtwaiOVfiLm45Q/3B0eUCQAaQ/0eWSGE+Yi8tdXoVszjr4GXb -G81qBi91DMu6U1It+jNfIba+MPsiHLcZJMVb4/oWBNukN7bD1nhwFWdlnu0CQQCf -Is9WHkdvz2RxbZDxb8verz/7kXXJQJhx5+rZf7jIYFxqX3yvTNv3wf2jcctJaWlZ -fVZwB193YSivcgt778xlAkEAprYUz3jczjF5r2hrgbizPzPDR94tM5BTO3ki2v3w -kbf+j2g7FNAx6kZiVN8XwfLc8xEeUGiPKwtq3ddPDFh17w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-agentOptions.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-agentOptions.js deleted file mode 100644 index 47fe3aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-agentOptions.js +++ /dev/null @@ -1,23 +0,0 @@ -var request = require('../index') - , http = require('http') - , server = require('./server') - , assert = require('assert') - ; - -var s = http.createServer(function (req, resp) { - resp.statusCode = 200 - resp.end('') -}).listen(6767, function () { - // requests without agentOptions should use global agent - var r = request('http://localhost:6767', function (e, resp, body) { - assert.deepEqual(r.agent, http.globalAgent); - assert.equal(Object.keys(r.pool).length, 0); - - // requests with agentOptions should apply agentOptions to new agent in pool - var r2 = request('http://localhost:6767', { agentOptions: { foo: 'bar' } }, function (e, resp, body) { - assert.deepEqual(r2.agent.options, { foo: 'bar' }); - assert.equal(Object.keys(r2.pool).length, 1); - s.close() - }); - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-basic-auth.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-basic-auth.js deleted file mode 100644 index 7cf1d6d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-basic-auth.js +++ /dev/null @@ -1,163 +0,0 @@ -var assert = require('assert') - , http = require('http') - , request = require('../index') - ; - -var numBasicRequests = 0; - -var basicServer = http.createServer(function (req, res) { - console.error('Basic auth server: ', req.method, req.url); - numBasicRequests++; - - var ok; - - if (req.headers.authorization) { - if (req.headers.authorization == 'Basic ' + new Buffer('test:testing2').toString('base64')) { - ok = true; - } else if ( req.headers.authorization == 'Basic ' + new Buffer(':apassword').toString('base64')) { - ok = true; - } else if ( req.headers.authorization == 'Basic ' + new Buffer('justauser').toString('base64')) { - 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', 'Basic realm="Private"'); - } - - if (req.url == '/post/') { - var expectedContent = 'data_key=data_value'; - req.on('data', function(data) { - assert.equal(data, expectedContent); - console.log('received request data: ' + data); - }); - assert.equal(req.method, 'POST'); - assert.equal(req.headers['content-length'], '' + expectedContent.length); - assert.equal(req.headers['content-type'], 'application/x-www-form-urlencoded; charset=utf-8'); - } - - if (ok) { - console.log('request ok'); - res.end('ok'); - } else { - console.log('status=401'); - res.statusCode = 401; - res.end('401'); - } -}); - -basicServer.listen(6767); - -var tests = [ - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 2); - next(); - }); - }, - - function(next) { - // If we don't set sendImmediately = false, request will send basic auth - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test2/', - 'auth': { - 'user': 'test', - 'pass': 'testing2' - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 3); - next(); - }); - }, - - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://test:testing2@localhost:6767/test2/' - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 4); - next(); - }); - }, - - function(next) { - request({ - 'method': 'POST', - 'form': { 'data_key': 'data_value' }, - 'uri': 'http://localhost:6767/post/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 6); - next(); - }); - }, - - function(next) { - assert.doesNotThrow( function() { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/allow_empty_user/', - 'auth': { - 'user': '', - 'pass': 'apassword', - 'sendImmediately': false - } - }, function(error, res, body ) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 8); - next(); - }); - }) - }, - - function(next) { - assert.doesNotThrow( function() { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/allow_undefined_password/', - 'auth': { - 'user': 'justauser', - 'pass': undefined, - 'sendImmediately': false - } - }, function(error, res, body ) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 10); - next(); - }); - }) - } -]; - -function runTest(i) { - if (i < tests.length) { - tests[i](function() { - runTest(i + 1); - }); - } else { - console.log('All tests passed'); - basicServer.close(); - } -} - -runTest(0); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-body.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-body.js deleted file mode 100644 index 186de12..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-body.js +++ /dev/null @@ -1,122 +0,0 @@ -var server = require('./server') - , events = require('events') - , stream = require('stream') - , 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!") - } - , testGetEncoding : - { resp : server.createGetResponse(new Buffer('efa3bfcea9e29883', 'hex')) - , encoding: 'hex' - , expectBody: "efa3bfcea9e29883" - } - , testGetUTF8: - { resp: server.createGetResponse(new Buffer([0xEF, 0xBB, 0xBF, 226, 152, 131])) - , encoding: "utf8" - , 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.'} - ] - } - , 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-defaults.js deleted file mode 100644 index f6c4024..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-defaults.js +++ /dev/null @@ -1,129 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-digest-auth.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-digest-auth.js deleted file mode 100644 index 5f2d6eb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-digest-auth.js +++ /dev/null @@ -1,69 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-emptyBody.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-emptyBody.js deleted file mode 100644 index 338c92e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-emptyBody.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-errors.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-errors.js deleted file mode 100644 index 4df1302..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-errors.js +++ /dev/null @@ -1,37 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-follow-all-303.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-follow-all-303.js deleted file mode 100644 index 956e386..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-follow-all-303.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-follow-all.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-follow-all.js deleted file mode 100644 index f2e51ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-follow-all.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-form.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-form.js deleted file mode 100644 index 91b9230..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-form.js +++ /dev/null @@ -1,79 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-hawk.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-hawk.js deleted file mode 100755 index 8454625..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-hawk.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-headers.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-headers.js deleted file mode 100644 index 3982b9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-headers.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-http-signature.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-http-signature.js deleted file mode 100755 index 9300473..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-http-signature.js +++ /dev/null @@ -1,106 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-httpModule.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-httpModule.js deleted file mode 100644 index 2c19615..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-httpModule.js +++ /dev/null @@ -1,94 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-https-strict.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-https-strict.js deleted file mode 100644 index d49a9af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-https-strict.js +++ /dev/null @@ -1,97 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-https.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-https.js deleted file mode 100644 index b6858d4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-https.js +++ /dev/null @@ -1,87 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-isUrl.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-isUrl.js deleted file mode 100644 index 4a51ad0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-isUrl.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-localAddress.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-localAddress.js deleted file mode 100644 index 11a1bd1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-localAddress.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-oauth.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-oauth.js deleted file mode 100644 index 3269483..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-oauth.js +++ /dev/null @@ -1,117 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-onelineproxy.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-onelineproxy.js deleted file mode 100644 index c239f89..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-onelineproxy.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-params.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-params.js deleted file mode 100644 index a5831a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-params.js +++ /dev/null @@ -1,93 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-piped-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-piped-redirect.js deleted file mode 100644 index e295ec7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-piped-redirect.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-pipes.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-pipes.js deleted file mode 100644 index 52a15cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-pipes.js +++ /dev/null @@ -1,216 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-pool.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-pool.js deleted file mode 100644 index 791ee8b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-pool.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-protocol-changing-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-protocol-changing-redirect.js deleted file mode 100644 index 7e83a41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-protocol-changing-redirect.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-proxy.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-proxy.js deleted file mode 100644 index e183d68..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-proxy.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-qs.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-qs.js deleted file mode 100644 index 65958e6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-qs.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-redirect.js deleted file mode 100644 index cdd4606..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-redirect.js +++ /dev/null @@ -1,155 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-s3.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-s3.js deleted file mode 100644 index 0f6a832..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-s3.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-timeout.js deleted file mode 100644 index 7036367..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-timeout.js +++ /dev/null @@ -1,87 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-toJSON.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-toJSON.js deleted file mode 100644 index 6d5f92a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-toJSON.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-tunnel.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-tunnel.js deleted file mode 100644 index 2ee3f39..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/test-tunnel.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/unicycle.jpg b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/unicycle.jpg deleted file mode 100644 index 7cea4dd..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/request/tests/unicycle.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/.npmignore deleted file mode 100644 index c167ad5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules -examples/extract/ -test/tmp/ -test/fixtures/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/.travis.yml deleted file mode 100644 index 2d26206..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/README.md deleted file mode 100644 index c6b0f82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/examples/extracter.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/examples/extracter.js deleted file mode 100644 index e150abf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/examples/extracter.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/examples/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/examples/reader.js deleted file mode 100644 index 39f3f08..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/examples/reader.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/entry.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/entry.js deleted file mode 100644 index 4af5c41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/entry.js +++ /dev/null @@ -1,213 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extended-header-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extended-header-writer.js deleted file mode 100644 index 1728c45..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extended-header-writer.js +++ /dev/null @@ -1,191 +0,0 @@ - -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extended-header.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extended-header.js deleted file mode 100644 index 74f432c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extended-header.js +++ /dev/null @@ -1,140 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extract.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extract.js deleted file mode 100644 index c34a81e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/extract.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/global-header-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/global-header-writer.js deleted file mode 100644 index 0bfc7b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/global-header-writer.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/header.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/header.js deleted file mode 100644 index 05b237c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/header.js +++ /dev/null @@ -1,385 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/pack.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/pack.js deleted file mode 100644 index 3ff14dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/pack.js +++ /dev/null @@ -1,231 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/parse.js deleted file mode 100644 index 884e73d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/lib/parse.js +++ /dev/null @@ -1,270 +0,0 @@ - -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/README.md deleted file mode 100644 index c16e9c4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js deleted file mode 100644 index 9328844..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/block-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/block-stream.js deleted file mode 100644 index 1141f3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/block-stream.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js deleted file mode 100644 index 93e4068..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/dropper.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/dropper.js deleted file mode 100644 index 55fa133..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/bench/dropper.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/block-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/block-stream.js deleted file mode 100644 index 008de03..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/block-stream.js +++ /dev/null @@ -1,209 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/package.json deleted file mode 100644 index 21bdee0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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" - }, - "_id": "block-stream@0.0.7", - "_from": "block-stream@*" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/basic.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/basic.js deleted file mode 100644 index b4b9305..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/basic.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js deleted file mode 100644 index 7a8de88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/nopad.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/nopad.js deleted file mode 100644 index 6d38429..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/nopad.js +++ /dev/null @@ -1,57 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/pause-resume.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/pause-resume.js deleted file mode 100644 index 64d0d09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/thorough.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/thorough.js deleted file mode 100644 index 1cc9ea0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/thorough.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/two-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/two-stream.js deleted file mode 100644 index c6db79a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/block-stream/test/two-stream.js +++ /dev/null @@ -1,59 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/.npmignore deleted file mode 100644 index 494272a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules/ -examples/deep-copy/ -examples/path/ -examples/filter-copy/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/.travis.yml deleted file mode 100644 index 2d26206..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/README.md deleted file mode 100644 index 9d8cb77..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/filter-pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/filter-pipe.js deleted file mode 100644 index c6b55b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/filter-pipe.js +++ /dev/null @@ -1,131 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - !this.basename.match(/^filter-copy$/) - } - }) - -// this writer will only write directories -var w = fstream.Writer({ path: path.resolve(__dirname, "filter-copy") - , type: "Directory" - , filter: function () { - return this.type === "Directory" - } - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 1000) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -var i = 1 -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok " + (i ++) + " A WINNAR IS YOU") - ended = true - // now go through and verify that everything in there is a dir. - var p = path.resolve(__dirname, "filter-copy") - var checker = fstream.Reader({ path: p }) - checker.checker = true - checker.on("child", function (e) { - var ok = e.type === "Directory" - console.log((ok ? "" : "not ") + "ok " + (i ++) + - " should be a dir: " + - e.path.substr(checker.path.length + 1)) - }) -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok " + (i ++) + " ended") -}) - -r.pipe(w) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/pipe.js deleted file mode 100644 index 648ec84..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/pipe.js +++ /dev/null @@ -1,115 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - } - }) - -var w = fstream.Writer({ path: path.resolve(__dirname, "deep-copy") - , type: "Directory" - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename, entry) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 10) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok 1 A WINNAR IS YOU") - ended = true -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok 2 ended") -}) - -r.pipe(w) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/reader.js deleted file mode 100644 index 9aa1a95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/reader.js +++ /dev/null @@ -1,54 +0,0 @@ -var fstream = require("../fstream.js") -var tap = require("tap") -var fs = require("fs") -var path = require("path") -var children = -1 -var dir = path.dirname(__dirname) - -var gotReady = false -var ended = false - -tap.test("reader test", function (t) { - - var r = fstream.Reader({ path: dir - , filter: function () { - // return this.parent === r - return this.parent === r || this === r - } - }) - - r.on("ready", function () { - gotReady = true - children = fs.readdirSync(dir).length - console.error("Setting expected children to "+children) - t.equal(r.type, "Directory", "should be a directory") - }) - - r.on("entry", function (entry) { - children -- - if (!gotReady) { - t.fail("children before ready!") - } - t.equal(entry.dirname, r.path, "basename is parent dir") - }) - - r.on("error", function (er) { - t.fail(er) - t.end() - process.exit(1) - }) - - r.on("end", function () { - t.equal(children, 0, "should have seen all children") - ended = true - }) - - var closed = false - r.on("close", function () { - t.ok(ended, "saw end before close") - t.notOk(closed, "close should only happen once") - closed = true - t.end() - }) - -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/symlink-write.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/symlink-write.js deleted file mode 100644 index d7816d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/examples/symlink-write.js +++ /dev/null @@ -1,24 +0,0 @@ -var fstream = require("../fstream.js") - , closed = false - -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , isSymbolicLink: true - , mode: "0755" // octal strings supported - }) - .on("close", function () { - closed = true - var fs = require("fs") - var s = fs.lstatSync("path/to/symlink") - var isSym = s.isSymbolicLink() - console.log((isSym?"":"not ") +"ok 1 should be symlink") - var t = fs.readlinkSync("path/to/symlink") - var isTarget = t === "./file" - console.log((isTarget?"":"not ") +"ok 2 should link to ./file") - }) - .end() - -process.on("exit", function () { - console.log((closed?"":"not ")+"ok 3 should be closed") -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/fstream.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/fstream.js deleted file mode 100644 index c66d26f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/fstream.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.Abstract = require("./lib/abstract.js") -exports.Reader = require("./lib/reader.js") -exports.Writer = require("./lib/writer.js") - -exports.File = - { Reader: require("./lib/file-reader.js") - , Writer: require("./lib/file-writer.js") } - -exports.Dir = - { Reader : require("./lib/dir-reader.js") - , Writer : require("./lib/dir-writer.js") } - -exports.Link = - { Reader : require("./lib/link-reader.js") - , Writer : require("./lib/link-writer.js") } - -exports.Proxy = - { Reader : require("./lib/proxy-reader.js") - , Writer : require("./lib/proxy-writer.js") } - -exports.Reader.Dir = exports.DirReader = exports.Dir.Reader -exports.Reader.File = exports.FileReader = exports.File.Reader -exports.Reader.Link = exports.LinkReader = exports.Link.Reader -exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader - -exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer -exports.Writer.File = exports.FileWriter = exports.File.Writer -exports.Writer.Link = exports.LinkWriter = exports.Link.Writer -exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer - -exports.collect = require("./lib/collect.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/abstract.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/abstract.js deleted file mode 100644 index 11ef0e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/abstract.js +++ /dev/null @@ -1,85 +0,0 @@ -// the parent class for all fstreams. - -module.exports = Abstract - -var Stream = require("stream").Stream - , inherits = require("inherits") - -function Abstract () { - Stream.call(this) -} - -inherits(Abstract, Stream) - -Abstract.prototype.on = function (ev, fn) { - if (ev === "ready" && this.ready) { - process.nextTick(fn.bind(this)) - } else { - Stream.prototype.on.call(this, ev, fn) - } - return this -} - -Abstract.prototype.abort = function () { - this._aborted = true - this.emit("abort") -} - -Abstract.prototype.destroy = function () {} - -Abstract.prototype.warn = function (msg, code) { - var me = this - , er = decorate(msg, code, me) - if (!me.listeners("warn")) { - console.error("%s %s\n" + - "path = %s\n" + - "syscall = %s\n" + - "fstream_type = %s\n" + - "fstream_path = %s\n" + - "fstream_unc_path = %s\n" + - "fstream_class = %s\n" + - "fstream_stack =\n%s\n", - code || "UNKNOWN", - er.stack, - er.path, - er.syscall, - er.fstream_type, - er.fstream_path, - er.fstream_unc_path, - er.fstream_class, - er.fstream_stack.join("\n")) - } else { - me.emit("warn", er) - } -} - -Abstract.prototype.info = function (msg, code) { - this.emit("info", msg, code) -} - -Abstract.prototype.error = function (msg, code, th) { - var er = decorate(msg, code, this) - if (th) throw er - else this.emit("error", er) -} - -function decorate (er, code, me) { - if (!(er instanceof Error)) er = new Error(er) - er.code = er.code || code - er.path = er.path || me.path - er.fstream_type = er.fstream_type || me.type - er.fstream_path = er.fstream_path || me.path - if (me._path !== me.path) { - er.fstream_unc_path = er.fstream_unc_path || me._path - } - if (me.linkpath) { - er.fstream_linkpath = er.fstream_linkpath || me.linkpath - } - er.fstream_class = er.fstream_class || me.constructor.name - er.fstream_stack = er.fstream_stack || - new Error().stack.split(/\n/).slice(3).map(function (s) { - return s.replace(/^ at /, "") - }) - - return er -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/collect.js deleted file mode 100644 index a36f780..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/collect.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = collect - -function collect (stream) { - if (stream._collected) return - - stream._collected = true - stream.pause() - - stream.on("data", save) - stream.on("end", save) - var buf = [] - function save (b) { - if (typeof b === "string") b = new Buffer(b) - if (Buffer.isBuffer(b) && !b.length) return - buf.push(b) - } - - stream.on("entry", saveEntry) - var entryBuffer = [] - function saveEntry (e) { - collect(e) - entryBuffer.push(e) - } - - stream.on("proxy", proxyPause) - function proxyPause (p) { - p.pause() - } - - - // replace the pipe method with a new version that will - // unlock the buffered stuff. if you just call .pipe() - // without a destination, then it'll re-play the events. - stream.pipe = (function (orig) { return function (dest) { - // console.error(" === open the pipes", dest && dest.path) - - // let the entries flow through one at a time. - // Once they're all done, then we can resume completely. - var e = 0 - ;(function unblockEntry () { - var entry = entryBuffer[e++] - // console.error(" ==== unblock entry", entry && entry.path) - if (!entry) return resume() - entry.on("end", unblockEntry) - if (dest) dest.add(entry) - else stream.emit("entry", entry) - })() - - function resume () { - stream.removeListener("entry", saveEntry) - stream.removeListener("data", save) - stream.removeListener("end", save) - - stream.pipe = orig - if (dest) stream.pipe(dest) - - buf.forEach(function (b) { - if (b) stream.emit("data", b) - else stream.emit("end") - }) - - stream.resume() - } - - return dest - }})(stream.pipe) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/dir-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/dir-reader.js deleted file mode 100644 index dd9883b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/dir-reader.js +++ /dev/null @@ -1,250 +0,0 @@ -// A thing that emits "entry" events with Reader objects -// Pausing it causes it to stop emitting entry events, and also -// pauses the current entry if there is one. - -module.exports = DirReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , Reader = require("./reader.js") - , assert = require("assert").ok - -inherits(DirReader, Reader) - -function DirReader (props) { - var me = this - if (!(me instanceof DirReader)) throw new Error( - "DirReader must be called as constructor.") - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - throw new Error("Non-directory type "+ props.type) - } - - me.entries = null - me._index = -1 - me._paused = false - me._length = -1 - - if (props.sort) { - this.sort = props.sort - } - - Reader.call(this, props) -} - -DirReader.prototype._getEntries = function () { - var me = this - - // race condition. might pause() before calling _getEntries, - // and then resume, and try to get them a second time. - if (me._gotEntries) return - me._gotEntries = true - - fs.readdir(me._path, function (er, entries) { - if (er) return me.error(er) - - me.entries = entries - - me.emit("entries", entries) - if (me._paused) me.once("resume", processEntries) - else processEntries() - - function processEntries () { - me._length = me.entries.length - if (typeof me.sort === "function") { - me.entries = me.entries.sort(me.sort.bind(me)) - } - me._read() - } - }) -} - -// start walking the dir, and emit an "entry" event for each one. -DirReader.prototype._read = function () { - var me = this - - if (!me.entries) return me._getEntries() - - if (me._paused || me._currentEntry || me._aborted) { - // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted) - return - } - - me._index ++ - if (me._index >= me.entries.length) { - if (!me._ended) { - me._ended = true - me.emit("end") - me.emit("close") - } - return - } - - // ok, handle this one, then. - - // save creating a proxy, by stat'ing the thing now. - var p = path.resolve(me._path, me.entries[me._index]) - assert(p !== me._path) - assert(me.entries[me._index]) - - // set this to prevent trying to _read() again in the stat time. - me._currentEntry = p - fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) { - if (er) return me.error(er) - - var who = me._proxy || me - - stat.path = p - stat.basename = path.basename(p) - stat.dirname = path.dirname(p) - var childProps = me.getChildProps.call(who, stat) - childProps.path = p - childProps.basename = path.basename(p) - childProps.dirname = path.dirname(p) - - var entry = Reader(childProps, stat) - - // console.error("DR Entry", p, stat.size) - - me._currentEntry = entry - - // "entry" events are for direct entries in a specific dir. - // "child" events are for any and all children at all levels. - // This nomenclature is not completely final. - - entry.on("pause", function (who) { - if (!me._paused && !entry._disowned) { - me.pause(who) - } - }) - - entry.on("resume", function (who) { - if (me._paused && !entry._disowned) { - me.resume(who) - } - }) - - entry.on("stat", function (props) { - me.emit("_entryStat", entry, props) - if (entry._aborted) return - if (entry._paused) entry.once("resume", function () { - me.emit("entryStat", entry, props) - }) - else me.emit("entryStat", entry, props) - }) - - entry.on("ready", function EMITCHILD () { - // console.error("DR emit child", entry._path) - if (me._paused) { - // console.error(" DR emit child - try again later") - // pause the child, and emit the "entry" event once we drain. - // console.error("DR pausing child entry") - entry.pause(me) - return me.once("resume", EMITCHILD) - } - - // skip over sockets. they can't be piped around properly, - // so there's really no sense even acknowledging them. - // if someone really wants to see them, they can listen to - // the "socket" events. - if (entry.type === "Socket") { - me.emit("socket", entry) - } else { - me.emitEntry(entry) - } - }) - - var ended = false - entry.on("close", onend) - entry.on("disown", onend) - function onend () { - if (ended) return - ended = true - me.emit("childEnd", entry) - me.emit("entryEnd", entry) - me._currentEntry = null - if (!me._paused) { - me._read() - } - } - - // XXX Remove this. Works in node as of 0.6.2 or so. - // Long filenames should not break stuff. - entry.on("error", function (er) { - if (entry._swallowErrors) { - me.warn(er) - entry.emit("end") - entry.emit("close") - } else { - me.emit("error", er) - } - }) - - // proxy up some events. - ; [ "child" - , "childEnd" - , "warn" - ].forEach(function (ev) { - entry.on(ev, me.emit.bind(me, ev)) - }) - }) -} - -DirReader.prototype.disown = function (entry) { - entry.emit("beforeDisown") - entry._disowned = true - entry.parent = entry.root = null - if (entry === this._currentEntry) { - this._currentEntry = null - } - entry.emit("disown") -} - -DirReader.prototype.getChildProps = function (stat) { - return { depth: this.depth + 1 - , root: this.root || this - , parent: this - , follow: this.follow - , filter: this.filter - , sort: this.props.sort - } -} - -DirReader.prototype.pause = function (who) { - var me = this - if (me._paused) return - who = who || me - me._paused = true - if (me._currentEntry && me._currentEntry.pause) { - me._currentEntry.pause(who) - } - me.emit("pause", who) -} - -DirReader.prototype.resume = function (who) { - var me = this - if (!me._paused) return - who = who || me - - me._paused = false - // console.error("DR Emit Resume", me._path) - me.emit("resume", who) - if (me._paused) { - // console.error("DR Re-paused", me._path) - return - } - - if (me._currentEntry) { - if (me._currentEntry.resume) me._currentEntry.resume(who) - } else me._read() -} - -DirReader.prototype.emitEntry = function (entry) { - this.emit("entry", entry) - this.emit("child", entry) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/dir-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/dir-writer.js deleted file mode 100644 index 7073b88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/dir-writer.js +++ /dev/null @@ -1,171 +0,0 @@ -// It is expected that, when .add() returns false, the consumer -// of the DirWriter will pause until a "drain" event occurs. Note -// that this is *almost always going to be the case*, unless the -// thing being written is some sort of unsupported type, and thus -// skipped over. - -module.exports = DirWriter - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Writer = require("./writer.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , collect = require("./collect.js") - -inherits(DirWriter, Writer) - -function DirWriter (props) { - var me = this - if (!(me instanceof DirWriter)) me.error( - "DirWriter must be called as constructor.", null, true) - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - me.error("Non-directory type "+ props.type + " " + - JSON.stringify(props), null, true) - } - - Writer.call(this, props) -} - -DirWriter.prototype._create = function () { - var me = this - mkdir(me._path, Writer.dirmode, function (er) { - if (er) return me.error(er) - // ready to start getting entries! - me.ready = true - me.emit("ready") - me._process() - }) -} - -// a DirWriter has an add(entry) method, but its .write() doesn't -// do anything. Why a no-op rather than a throw? Because this -// leaves open the door for writing directory metadata for -// gnu/solaris style dumpdirs. -DirWriter.prototype.write = function () { - return true -} - -DirWriter.prototype.end = function () { - this._ended = true - this._process() -} - -DirWriter.prototype.add = function (entry) { - var me = this - - // console.error("\tadd", entry._path, "->", me._path) - collect(entry) - if (!me.ready || me._currentEntry) { - me._buffer.push(entry) - return false - } - - // create a new writer, and pipe the incoming entry into it. - if (me._ended) { - return me.error("add after end") - } - - me._buffer.push(entry) - me._process() - - return 0 === this._buffer.length -} - -DirWriter.prototype._process = function () { - var me = this - - // console.error("DW Process p=%j", me._processing, me.basename) - - if (me._processing) return - - var entry = me._buffer.shift() - if (!entry) { - // console.error("DW Drain") - me.emit("drain") - if (me._ended) me._finish() - return - } - - me._processing = true - // console.error("DW Entry", entry._path) - - me.emit("entry", entry) - - // ok, add this entry - // - // don't allow recursive copying - var p = entry - do { - var pp = p._path || p.path - if (pp === me.root._path || pp === me._path || - (pp && pp.indexOf(me._path) === 0)) { - // console.error("DW Exit (recursive)", entry.basename, me._path) - me._processing = false - if (entry._collected) entry.pipe() - return me._process() - } - } while (p = p.parent) - - // console.error("DW not recursive") - - // chop off the entry's root dir, replace with ours - var props = { parent: me - , root: me.root || me - , type: entry.type - , depth: me.depth + 1 } - - var p = entry._path || entry.path || entry.props.path - if (entry.parent) { - p = p.substr(entry.parent._path.length + 1) - } - // get rid of any ../../ shenanigans - props.path = path.join(me.path, path.join("/", p)) - - // if i have a filter, the child should inherit it. - props.filter = me.filter - - // all the rest of the stuff, copy over from the source. - Object.keys(entry.props).forEach(function (k) { - if (!props.hasOwnProperty(k)) { - props[k] = entry.props[k] - } - }) - - // not sure at this point what kind of writer this is. - var child = me._currentChild = new Writer(props) - child.on("ready", function () { - // console.error("DW Child Ready", child.type, child._path) - // console.error(" resuming", entry._path) - entry.pipe(child) - entry.resume() - }) - - // XXX Make this work in node. - // Long filenames should not break stuff. - child.on("error", function (er) { - if (child._swallowErrors) { - me.warn(er) - child.emit("end") - child.emit("close") - } else { - me.emit("error", er) - } - }) - - // we fire _end internally *after* end, so that we don't move on - // until any "end" listeners have had their chance to do stuff. - child.on("close", onend) - var ended = false - function onend () { - if (ended) return - ended = true - // console.error("* DW Child end", child.basename) - me._currentChild = null - me._processing = false - me._process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/file-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/file-reader.js deleted file mode 100644 index b1f9861..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/file-reader.js +++ /dev/null @@ -1,147 +0,0 @@ -// Basically just a wrapper around an fs.ReadStream - -module.exports = FileReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - , EOF = {EOF: true} - , CLOSE = {CLOSE: true} - -inherits(FileReader, Reader) - -function FileReader (props) { - // console.error(" FR create", props.path, props.size, new Error().stack) - var me = this - if (!(me instanceof FileReader)) throw new Error( - "FileReader must be called as constructor.") - - // should already be established as a File type - // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, - // with a HardLinkReader class. - if (!((props.type === "Link" && props.Link) || - (props.type === "File" && props.File))) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesEmitted = 0 - Reader.call(me, props) -} - -FileReader.prototype._getStream = function () { - var me = this - , stream = me._stream = fs.createReadStream(me._path, me.props) - - if (me.props.blksize) { - stream.bufferSize = me.props.blksize - } - - stream.on("open", me.emit.bind(me, "open")) - - stream.on("data", function (c) { - // console.error("\t\t%d %s", c.length, me.basename) - me._bytesEmitted += c.length - // no point saving empty chunks - if (!c.length) return - else if (me._paused || me._buffer.length) { - me._buffer.push(c) - me._read() - } else me.emit("data", c) - }) - - stream.on("end", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering End", me._path) - me._buffer.push(EOF) - me._read() - } else { - me.emit("end") - } - - if (me._bytesEmitted !== me.props.size) { - me.error("Didn't get expected byte count\n"+ - "expect: "+me.props.size + "\n" + - "actual: "+me._bytesEmitted) - } - }) - - stream.on("close", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering Close", me._path) - me._buffer.push(CLOSE) - me._read() - } else { - // console.error("FR close 1", me._path) - me.emit("close") - } - }) - - me._read() -} - -FileReader.prototype._read = function () { - var me = this - // console.error("FR _read", me._path) - if (me._paused) { - // console.error("FR _read paused", me._path) - return - } - - if (!me._stream) { - // console.error("FR _getStream calling", me._path) - return me._getStream() - } - - // clear out the buffer, if there is one. - if (me._buffer.length) { - // console.error("FR _read has buffer", me._buffer.length, me._path) - var buf = me._buffer - for (var i = 0, l = buf.length; i < l; i ++) { - var c = buf[i] - if (c === EOF) { - // console.error("FR Read emitting buffered end", me._path) - me.emit("end") - } else if (c === CLOSE) { - // console.error("FR Read emitting buffered close", me._path) - me.emit("close") - } else { - // console.error("FR Read emitting buffered data", me._path) - me.emit("data", c) - } - - if (me._paused) { - // console.error("FR Read Re-pausing at "+i, me._path) - me._buffer = buf.slice(i) - return - } - } - me._buffer.length = 0 - } - // console.error("FR _read done") - // that's about all there is to it. -} - -FileReader.prototype.pause = function (who) { - var me = this - // console.error("FR Pause", me._path) - if (me._paused) return - who = who || me - me._paused = true - if (me._stream) me._stream.pause() - me.emit("pause", who) -} - -FileReader.prototype.resume = function (who) { - var me = this - // console.error("FR Resume", me._path) - if (!me._paused) return - who = who || me - me.emit("resume", who) - me._paused = false - if (me._stream) me._stream.resume() - me._read() -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/file-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/file-writer.js deleted file mode 100644 index 6811462..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/file-writer.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = FileWriter - -var fs = require("graceful-fs") - , mkdir = require("mkdirp") - , Writer = require("./writer.js") - , inherits = require("inherits") - , EOF = {} - -inherits(FileWriter, Writer) - -function FileWriter (props) { - var me = this - if (!(me instanceof FileWriter)) throw new Error( - "FileWriter must be called as constructor.") - - // should already be established as a File type - if (props.type !== "File" || !props.File) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesWritten = 0 - - Writer.call(this, props) -} - -FileWriter.prototype._create = function () { - var me = this - if (me._stream) return - - var so = {} - if (me.props.flags) so.flags = me.props.flags - so.mode = Writer.filemode - if (me._old && me._old.blksize) so.bufferSize = me._old.blksize - - me._stream = fs.createWriteStream(me._path, so) - - me._stream.on("open", function (fd) { - // console.error("FW open", me._buffer, me._path) - me.ready = true - me._buffer.forEach(function (c) { - if (c === EOF) me._stream.end() - else me._stream.write(c) - }) - me.emit("ready") - // give this a kick just in case it needs it. - me.emit("drain") - }) - - me._stream.on("drain", function () { me.emit("drain") }) - - me._stream.on("close", function () { - // console.error("\n\nFW Stream Close", me._path, me.size) - me._finish() - }) -} - -FileWriter.prototype.write = function (c) { - var me = this - - me._bytesWritten += c.length - - if (!me.ready) { - if (!Buffer.isBuffer(c) && typeof c !== 'string') - throw new Error('invalid write data') - me._buffer.push(c) - return false - } - - var ret = me._stream.write(c) - // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length) - - // allow 2 buffered writes, because otherwise there's just too - // much stop and go bs. - return ret || (me._stream._queue && me._stream._queue.length <= 2) -} - -FileWriter.prototype.end = function (c) { - var me = this - - if (c) me.write(c) - - if (!me.ready) { - me._buffer.push(EOF) - return false - } - - return me._stream.end() -} - -FileWriter.prototype._finish = function () { - var me = this - if (typeof me.size === "number" && me._bytesWritten != me.size) { - me.error( - "Did not get expected byte count.\n" + - "expect: " + me.size + "\n" + - "actual: " + me._bytesWritten) - } - Writer.prototype._finish.call(me) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/get-type.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/get-type.js deleted file mode 100644 index cd65c41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/get-type.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = getType - -function getType (st) { - var types = - [ "Directory" - , "File" - , "SymbolicLink" - , "Link" // special for hardlinks from tarballs - , "BlockDevice" - , "CharacterDevice" - , "FIFO" - , "Socket" ] - , type - - if (st.type && -1 !== types.indexOf(st.type)) { - st[st.type] = true - return st.type - } - - for (var i = 0, l = types.length; i < l; i ++) { - type = types[i] - var is = st[type] || st["is" + type] - if (typeof is === "function") is = is.call(st) - if (is) { - st[type] = true - st.type = type - return type - } - } - - return null -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/link-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/link-reader.js deleted file mode 100644 index 7e7ab6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/link-reader.js +++ /dev/null @@ -1,54 +0,0 @@ -// Basically just a wrapper around an fs.readlink -// -// XXX: Enhance this to support the Link type, by keeping -// a lookup table of {:}, so that hardlinks -// can be preserved in tarballs. - -module.exports = LinkReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(LinkReader, Reader) - -function LinkReader (props) { - var me = this - if (!(me instanceof LinkReader)) throw new Error( - "LinkReader must be called as constructor.") - - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - Reader.call(me, props) -} - -// When piping a LinkReader into a LinkWriter, we have to -// already have the linkpath property set, so that has to -// happen *before* the "ready" event, which means we need to -// override the _stat method. -LinkReader.prototype._stat = function (currentStat) { - var me = this - fs.readlink(me._path, function (er, linkpath) { - if (er) return me.error(er) - me.linkpath = me.props.linkpath = linkpath - me.emit("linkpath", linkpath) - Reader.prototype._stat.call(me, currentStat) - }) -} - -LinkReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we need - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/link-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/link-writer.js deleted file mode 100644 index 5c8f1e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/link-writer.js +++ /dev/null @@ -1,95 +0,0 @@ - -module.exports = LinkWriter - -var fs = require("graceful-fs") - , Writer = require("./writer.js") - , inherits = require("inherits") - , path = require("path") - , rimraf = require("rimraf") - -inherits(LinkWriter, Writer) - -function LinkWriter (props) { - var me = this - if (!(me instanceof LinkWriter)) throw new Error( - "LinkWriter must be called as constructor.") - - // should already be established as a Link type - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - if (props.linkpath === "") props.linkpath = "." - if (!props.linkpath) { - me.error("Need linkpath property to create " + props.type) - } - - Writer.call(this, props) -} - -LinkWriter.prototype._create = function () { - // console.error(" LW _create") - var me = this - , hard = me.type === "Link" || process.platform === "win32" - , link = hard ? "link" : "symlink" - , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath - - // can only change the link path by clobbering - // For hard links, let's just assume that's always the case, since - // there's no good way to read them if we don't already know. - if (hard) return clobber(me, lp, link) - - fs.readlink(me._path, function (er, p) { - // only skip creation if it's exactly the same link - if (p && p === lp) return finish(me) - clobber(me, lp, link) - }) -} - -function clobber (me, lp, link) { - rimraf(me._path, function (er) { - if (er) return me.error(er) - create(me, lp, link) - }) -} - -function create (me, lp, link) { - fs[link](lp, me._path, function (er) { - // if this is a hard link, and we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier in. - // Additionally, an EPERM or EACCES can happen on win32 if it's trying - // to make a link to a directory. Again, just skip it. - // A better solution would be to have fs.symlink be supported on - // windows in some nice fashion. - if (er) { - if ((er.code === "ENOENT" || - er.code === "EACCES" || - er.code === "EPERM" ) && process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - } else return me.error(er) - } - finish(me) - }) -} - -function finish (me) { - me.ready = true - me.emit("ready") - if (me._ended && !me._finished) me._finish() -} - -LinkWriter.prototype.end = function () { - // console.error("LW finish in end") - this._ended = true - if (this.ready) { - this._finished = true - this._finish() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/proxy-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/proxy-reader.js deleted file mode 100644 index a0ece34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/proxy-reader.js +++ /dev/null @@ -1,93 +0,0 @@ -// A reader for when we don't yet know what kind of thing -// the thing is. - -module.exports = ProxyReader - -var Reader = require("./reader.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , fs = require("graceful-fs") - -inherits(ProxyReader, Reader) - -function ProxyReader (props) { - var me = this - if (!(me instanceof ProxyReader)) throw new Error( - "ProxyReader must be called as constructor.") - - me.props = props - me._buffer = [] - me.ready = false - - Reader.call(me, props) -} - -ProxyReader.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Reader(props, current)) - }) -} - -ProxyReader.prototype._addProxy = function (proxy) { - var me = this - if (me._proxyTarget) { - return me.error("proxy already set") - } - - me._proxyTarget = proxy - proxy._proxy = me - - ; [ "error" - , "data" - , "end" - , "close" - , "linkpath" - , "entry" - , "entryEnd" - , "child" - , "childEnd" - , "warn" - , "stat" - ].forEach(function (ev) { - // console.error("~~ proxy event", ev, me.path) - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - proxy.on("ready", function () { - // console.error("~~ proxy is ready!", me.path) - me.ready = true - me.emit("ready") - }) - - var calls = me._buffer - me._buffer.length = 0 - calls.forEach(function (c) { - proxy[c[0]].apply(proxy, c[1]) - }) -} - -ProxyReader.prototype.pause = function () { - return this._proxyTarget ? this._proxyTarget.pause() : false -} - -ProxyReader.prototype.resume = function () { - return this._proxyTarget ? this._proxyTarget.resume() : false -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/proxy-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/proxy-writer.js deleted file mode 100644 index b047663..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/proxy-writer.js +++ /dev/null @@ -1,109 +0,0 @@ -// A writer for when we don't know what kind of thing -// the thing is. That is, it's not explicitly set, -// so we're going to make it whatever the thing already -// is, or "File" -// -// Until then, collect all events. - -module.exports = ProxyWriter - -var Writer = require("./writer.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , collect = require("./collect.js") - , fs = require("fs") - -inherits(ProxyWriter, Writer) - -function ProxyWriter (props) { - var me = this - if (!(me instanceof ProxyWriter)) throw new Error( - "ProxyWriter must be called as constructor.") - - me.props = props - me._needDrain = false - - Writer.call(me, props) -} - -ProxyWriter.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Writer(props, current)) - }) -} - -ProxyWriter.prototype._addProxy = function (proxy) { - // console.error("~~ set proxy", this.path) - var me = this - if (me._proxy) { - return me.error("proxy already set") - } - - me._proxy = proxy - ; [ "ready" - , "error" - , "close" - , "pipe" - , "drain" - , "warn" - ].forEach(function (ev) { - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - var calls = me._buffer - calls.forEach(function (c) { - // console.error("~~ ~~ proxy buffered call", c[0], c[1]) - proxy[c[0]].apply(proxy, c[1]) - }) - me._buffer.length = 0 - if (me._needsDrain) me.emit("drain") -} - -ProxyWriter.prototype.add = function (entry) { - // console.error("~~ proxy add") - collect(entry) - - if (!this._proxy) { - this._buffer.push(["add", [entry]]) - this._needDrain = true - return false - } - return this._proxy.add(entry) -} - -ProxyWriter.prototype.write = function (c) { - // console.error("~~ proxy write") - if (!this._proxy) { - this._buffer.push(["write", [c]]) - this._needDrain = true - return false - } - return this._proxy.write(c) -} - -ProxyWriter.prototype.end = function (c) { - // console.error("~~ proxy end") - if (!this._proxy) { - this._buffer.push(["end", [c]]) - return false - } - return this._proxy.end(c) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/reader.js deleted file mode 100644 index e4e1b48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/reader.js +++ /dev/null @@ -1,259 +0,0 @@ - -module.exports = Reader - -var fs = require("graceful-fs") - , Stream = require("stream").Stream - , inherits = require("inherits") - , path = require("path") - , getType = require("./get-type.js") - , hardLinks = Reader.hardLinks = {} - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Reader, Abstract) - -var DirReader = require("./dir-reader.js") - , FileReader = require("./file-reader.js") - , LinkReader = require("./link-reader.js") - , SocketReader = require("./socket-reader.js") - , ProxyReader = require("./proxy-reader.js") - -function Reader (props, currentStat) { - var me = this - if (!(me instanceof Reader)) return new Reader(props, currentStat) - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) { - me.error("Must provide a path", null, true) - } - - // polymorphism. - // call fstream.Reader(dir) to get a DirReader object, etc. - // Note that, unlike in the Writer case, ProxyReader is going - // to be the *normal* state of affairs, since we rarely know - // the type of a file prior to reading it. - - - var type - , ClassType - - if (props.type && typeof props.type === "function") { - type = props.type - ClassType = type - } else { - type = getType(props) - ClassType = Reader - } - - if (currentStat && !type) { - type = getType(currentStat) - props[type] = true - props.type = type - } - - switch (type) { - case "Directory": - ClassType = DirReader - break - - case "Link": - // XXX hard links are just files. - // However, it would be good to keep track of files' dev+inode - // and nlink values, and create a HardLinkReader that emits - // a linkpath value of the original copy, so that the tar - // writer can preserve them. - // ClassType = HardLinkReader - // break - - case "File": - ClassType = FileReader - break - - case "SymbolicLink": - ClassType = LinkReader - break - - case "Socket": - ClassType = SocketReader - break - - case null: - ClassType = ProxyReader - break - } - - if (!(me instanceof ClassType)) { - return new ClassType(props) - } - - Abstract.call(me) - - me.readable = true - me.writable = false - - me.type = type - me.props = props - me.depth = props.depth = props.depth || 0 - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - // how DOES one create files on the moon? - // if the path has spaces in it, then UNC will fail. - me._swallowErrors = true - //if (me._path.indexOf(" ") === -1) { - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - //} - } - } - me.basename = props.basename = path.basename(me.path) - me.dirname = props.dirname = path.dirname(me.path) - - // these have served their purpose, and are now just noisy clutter - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - me.filter = typeof props.filter === "function" ? props.filter : null - if (props.sort === "alpha") props.sort = alphasort - - // start the ball rolling. - // this will stat the thing, and then call me._read() - // to start reading whatever it is. - // console.error("calling stat", props.path, currentStat) - me._stat(currentStat) -} - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - -Reader.prototype._stat = function (currentStat) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - - // console.error("Reader._stat", me._path, currentStat) - if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) - else fs[stat](me._path, statCb) - - - function statCb (er, props_) { - // console.error("Reader._stat, statCb", me._path, props_, props_.nlink) - if (er) return me.error(er) - - Object.keys(props_).forEach(function (k) { - props[k] = props_[k] - }) - - // if it's not the expected size, then abort here. - if (undefined !== me.size && props.size !== me.size) { - return me.error("incorrect size") - } - me.size = props.size - - var type = getType(props) - // special little thing for handling hardlinks. - if (type !== "Directory" && props.nlink && props.nlink > 1) { - var k = props.dev + ":" + props.ino - // console.error("Reader has nlink", me._path, k) - if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path - else { - // switch into hardlink mode. - type = me.type = me.props.type = "Link" - me.Link = me.props.Link = true - me.linkpath = me.props.linkpath = hardLinks[k] - // console.error("Hardlink detected, switching mode", me._path, me.linkpath) - // Setting __proto__ would arguably be the "correct" - // approach here, but that just seems too wrong. - me._stat = me._read = LinkReader.prototype._read - } - } - - if (me.type && me.type !== type) { - me.error("Unexpected type: " + type) - } - - // if the filter doesn't pass, then just skip over this one. - // still have to emit end so that dir-walking can move on. - if (me.filter) { - var who = me._proxy || me - // special handling for ProxyReaders - if (!me.filter.call(who, who, props)) { - if (!me._disowned) { - me.abort() - me.emit("end") - me.emit("close") - } - return - } - } - - // last chance to abort or disown before the flow starts! - var events = ["_stat", "stat", "ready"] - var e = 0 - ;(function go () { - if (me._aborted) { - me.emit("end") - me.emit("close") - return - } - - if (me._paused) { - me.once("resume", go) - return - } - - var ev = events[e ++] - if (!ev) return me._read() - me.emit(ev, props) - go() - })() - } -} - -Reader.prototype.pipe = function (dest, opts) { - var me = this - if (typeof dest.add === "function") { - // piping to a multi-compatible, and we've got directory entries. - me.on("entry", function (entry) { - var ret = dest.add(entry) - if (false === ret) { - me.pause() - } - }) - } - - // console.error("R Pipe apply Stream Pipe") - return Stream.prototype.pipe.apply(this, arguments) -} - -Reader.prototype.pause = function (who) { - this._paused = true - who = who || this - this.emit("pause", who) - if (this._stream) this._stream.pause(who) -} - -Reader.prototype.resume = function (who) { - this._paused = false - who = who || this - this.emit("resume", who) - if (this._stream) this._stream.resume(who) - this._read() -} - -Reader.prototype._read = function () { - this.error("Cannot read unknown type: "+this.type) -} - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/socket-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/socket-reader.js deleted file mode 100644 index e89c173..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/socket-reader.js +++ /dev/null @@ -1,38 +0,0 @@ -// Just get the stats, and then don't do anything. -// You can't really "read" from a socket. You "connect" to it. -// Mostly, this is here so that reading a dir with a socket in it -// doesn't blow up. - -module.exports = SocketReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(SocketReader, Reader) - -function SocketReader (props) { - var me = this - if (!(me instanceof SocketReader)) throw new Error( - "SocketReader must be called as constructor.") - - if (!(props.type === "Socket" && props.Socket)) { - throw new Error("Non-socket type "+ props.type) - } - - Reader.call(me, props) -} - -SocketReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we have - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/writer.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/writer.js deleted file mode 100644 index 5599fb2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/lib/writer.js +++ /dev/null @@ -1,389 +0,0 @@ - -module.exports = Writer - -var fs = require("graceful-fs") - , inherits = require("inherits") - , rimraf = require("rimraf") - , mkdir = require("mkdirp") - , path = require("path") - , umask = process.platform === "win32" ? 0 : process.umask() - , getType = require("./get-type.js") - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Writer, Abstract) - -Writer.dirmode = 0777 & (~umask) -Writer.filemode = 0666 & (~umask) - -var DirWriter = require("./dir-writer.js") - , LinkWriter = require("./link-writer.js") - , FileWriter = require("./file-writer.js") - , ProxyWriter = require("./proxy-writer.js") - -// props is the desired state. current is optionally the current stat, -// provided here so that subclasses can avoid statting the target -// more than necessary. -function Writer (props, current) { - var me = this - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) me.error("Must provide a path", null, true) - - // polymorphism. - // call fstream.Writer(dir) to get a DirWriter object, etc. - var type = getType(props) - , ClassType = Writer - - switch (type) { - case "Directory": - ClassType = DirWriter - break - case "File": - ClassType = FileWriter - break - case "Link": - case "SymbolicLink": - ClassType = LinkWriter - break - case null: - // Don't know yet what type to create, so we wrap in a proxy. - ClassType = ProxyWriter - break - } - - if (!(me instanceof ClassType)) return new ClassType(props) - - // now get down to business. - - Abstract.call(me) - - // props is what we want to set. - // set some convenience properties as well. - me.type = props.type - me.props = props - me.depth = props.depth || 0 - me.clobber = false === props.clobber ? props.clobber : true - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - me._swallowErrors = true - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - } - } - me.basename = path.basename(props.path) - me.dirname = path.dirname(props.path) - me.linkpath = props.linkpath || null - - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - - if (typeof props.mode === "string") { - props.mode = parseInt(props.mode, 8) - } - - me.readable = false - me.writable = true - - // buffer until ready, or while handling another entry - me._buffer = [] - me.ready = false - - me.filter = typeof props.filter === "function" ? props.filter: null - - // start the ball rolling. - // this checks what's there already, and then calls - // me._create() to call the impl-specific creation stuff. - me._stat(current) -} - -// Calling this means that it's something we can't create. -// Just assert that it's already there, otherwise raise a warning. -Writer.prototype._create = function () { - var me = this - fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) { - if (er) { - return me.warn("Cannot create " + me._path + "\n" + - "Unsupported type: "+me.type, "ENOTSUP") - } - me._finish() - }) -} - -Writer.prototype._stat = function (current) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - , who = me._proxy || me - - if (current) statCb(null, current) - else fs[stat](me._path, statCb) - - function statCb (er, current) { - if (me.filter && !me.filter.call(who, who, current)) { - me._aborted = true - me.emit("end") - me.emit("close") - return - } - - // if it's not there, great. We'll just create it. - // if it is there, then we'll need to change whatever differs - if (er || !current) { - return create(me) - } - - me._old = current - var currentType = getType(current) - - // if it's a type change, then we need to clobber or error. - // if it's not a type change, then let the impl take care of it. - if (currentType !== me.type) { - return rimraf(me._path, function (er) { - if (er) return me.error(er) - me._old = null - create(me) - }) - } - - // otherwise, just handle in the app-specific way - // this creates a fs.WriteStream, or mkdir's, or whatever - create(me) - } -} - -function create (me) { - // console.error("W create", me._path, Writer.dirmode) - - // XXX Need to clobber non-dirs that are in the way, - // unless { clobber: false } in the props. - mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) { - // console.error("W created", path.dirname(me._path), er) - if (er) return me.error(er) - - // later on, we have to set the mode and owner for these - me._madeDir = made - return me._create() - }) -} - -function endChmod (me, want, current, path, cb) { - var wantMode = want.mode - , chmod = want.follow || me.type !== "SymbolicLink" - ? "chmod" : "lchmod" - - if (!fs[chmod]) return cb() - if (typeof wantMode !== "number") return cb() - - var curMode = current.mode & 0777 - wantMode = wantMode & 0777 - if (wantMode === curMode) return cb() - - fs[chmod](path, wantMode, cb) -} - - -function endChown (me, want, current, path, cb) { - // Don't even try it unless root. Too easy to EPERM. - if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() - if (typeof want.uid !== "number" && - typeof want.gid !== "number" ) return cb() - - if (current.uid === want.uid && - current.gid === want.gid) return cb() - - var chown = (me.props.follow || me.type !== "SymbolicLink") - ? "chown" : "lchown" - if (!fs[chown]) return cb() - - if (typeof want.uid !== "number") want.uid = current.uid - if (typeof want.gid !== "number") want.gid = current.gid - - fs[chown](path, want.uid, want.gid, cb) -} - -function endUtimes (me, want, current, path, cb) { - if (!fs.utimes || process.platform === "win32") return cb() - - var utimes = (want.follow || me.type !== "SymbolicLink") - ? "utimes" : "lutimes" - - if (utimes === "lutimes" && !fs[utimes]) { - utimes = "utimes" - } - - if (!fs[utimes]) return cb() - - var curA = current.atime - , curM = current.mtime - , meA = want.atime - , meM = want.mtime - - if (meA === undefined) meA = curA - if (meM === undefined) meM = curM - - if (!isDate(meA)) meA = new Date(meA) - if (!isDate(meM)) meA = new Date(meM) - - if (meA.getTime() === curA.getTime() && - meM.getTime() === curM.getTime()) return cb() - - fs[utimes](path, meA, meM, cb) -} - - -// XXX This function is beastly. Break it up! -Writer.prototype._finish = function () { - var me = this - - // console.error(" W Finish", me._path, me.size) - - // set up all the things. - // At this point, we're already done writing whatever we've gotta write, - // adding files to the dir, etc. - var todo = 0 - var errState = null - var done = false - - if (me._old) { - // the times will almost *certainly* have changed. - // adds the utimes syscall, but remove another stat. - me._old.atime = new Date(0) - me._old.mtime = new Date(0) - // console.error(" W Finish Stale Stat", me._path, me.size) - setProps(me._old) - } else { - var stat = me.props.follow ? "stat" : "lstat" - // console.error(" W Finish Stating", me._path, me.size) - fs[stat](me._path, function (er, current) { - // console.error(" W Finish Stated", me._path, me.size, current) - if (er) { - // if we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier on. - if (er.code === "ENOENT" && - (me.type === "Link" || me.type === "SymbolicLink") && - process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - return - } else return me.error(er) - } - setProps(me._old = current) - }) - } - - return - - function setProps (current) { - todo += 3 - endChmod(me, me.props, current, me._path, next("chmod")) - endChown(me, me.props, current, me._path, next("chown")) - endUtimes(me, me.props, current, me._path, next("utimes")) - } - - function next (what) { - return function (er) { - // console.error(" W Finish", what, todo) - if (errState) return - if (er) { - er.fstream_finish_call = what - return me.error(errState = er) - } - if (--todo > 0) return - if (done) return - done = true - - // we may still need to set the mode/etc. on some parent dirs - // that were created previously. delay end/close until then. - if (!me._madeDir) return end() - else endMadeDir(me, me._path, end) - - function end (er) { - if (er) { - er.fstream_finish_call = "setupMadeDir" - return me.error(er) - } - // all the props have been set, so we're completely done. - me.emit("end") - me.emit("close") - } - } - } -} - -function endMadeDir (me, p, cb) { - var made = me._madeDir - // everything *between* made and path.dirname(me._path) - // needs to be set up. Note that this may just be one dir. - var d = path.dirname(p) - - endMadeDir_(me, d, function (er) { - if (er) return cb(er) - if (d === made) { - return cb() - } - endMadeDir(me, d, cb) - }) -} - -function endMadeDir_ (me, p, cb) { - var dirProps = {} - Object.keys(me.props).forEach(function (k) { - dirProps[k] = me.props[k] - - // only make non-readable dirs if explicitly requested. - if (k === "mode" && me.type !== "Directory") { - dirProps[k] = dirProps[k] | 0111 - } - }) - - var todo = 3 - , errState = null - fs.stat(p, function (er, current) { - if (er) return cb(errState = er) - endChmod(me, dirProps, current, p, next) - endChown(me, dirProps, current, p, next) - endUtimes(me, dirProps, current, p, next) - }) - - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- todo === 0) return cb() - } -} - -Writer.prototype.pipe = function () { - this.error("Can't pipe from writable stream") -} - -Writer.prototype.add = function () { - this.error("Cannot add to non-Directory type") -} - -Writer.prototype.write = function () { - return true -} - -function objectToString (d) { - return Object.prototype.toString.call(d) -} - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/.bin/rimraf b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json deleted file mode 100644 index 1b4a21c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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": "2.0.1", - "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* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2.0.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index afc83b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,228 +0,0 @@ -var fs = require('fs') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - 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') - - 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.end() - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/AUTHORS b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/README.md deleted file mode 100644 index 8fc6779..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/README.md +++ /dev/null @@ -1,26 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/bin.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/bin.js deleted file mode 100755 index 29bfa8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/bin.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/package.json deleted file mode 100644 index 08516f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "rimraf", - "version": "2.2.2", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~2" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~2" - }, - "_id": "rimraf@2.2.2", - "_from": "rimraf@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/rimraf.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/rimraf.js deleted file mode 100644 index 55f8d9a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,184 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - 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 (er.code === "EBUSY" && 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() - 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")) - 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") - rmkidsSync(p) - } -} - -function rmkidsSync (p) { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/run.sh b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/setup.sh b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/test-async.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/package.json deleted file mode 100644 index 3bad3de..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/fstream/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "fstream", - "description": "Advanced file system stream things", - "version": "0.1.24", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/fstream.git" - }, - "main": "fstream.js", - "engines": { - "node": ">=0.6" - }, - "dependencies": { - "rimraf": "2", - "mkdirp": "0.3", - "graceful-fs": "~2.0.0", - "inherits": "~2.0.0" - }, - "devDependencies": { - "tap": "" - }, - "scripts": { - "test": "tap examples/*.js" - }, - "license": "BSD", - "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/fstream/issues" - }, - "_id": "fstream@0.1.24", - "_from": "fstream@~0.1.8" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/README.md deleted file mode 100644 index b1c5665..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/inherits.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/inherits_browser.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/package.json deleted file mode 100644 index cee4a9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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" - }, - "_id": "inherits@2.0.1", - "_from": "inherits@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/test.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/test.js deleted file mode 100644 index fc53012..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/package.json deleted file mode 100644 index 4c9e2cd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "tar", - "description": "tar for node", - "version": "0.1.18", - "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## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-tar/issues" - }, - "_id": "tar@0.1.18", - "_from": "tar@~0.1.18" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/tar.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/tar.js deleted file mode 100644 index a81298b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/tar.js +++ /dev/null @@ -1,173 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/00-setup-fixtures.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/00-setup-fixtures.js deleted file mode 100644 index 1524ff7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/00-setup-fixtures.js +++ /dev/null @@ -1,53 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/extract.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/extract.js deleted file mode 100644 index fff4818..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/extract.js +++ /dev/null @@ -1,358 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/fixtures.tgz b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/fixtures.tgz deleted file mode 100644 index 4501bcf..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/fixtures.tgz and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/header.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/header.js deleted file mode 100644 index 8ea6f79..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/header.js +++ /dev/null @@ -1,183 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/pack-no-proprietary.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/pack-no-proprietary.js deleted file mode 100644 index 5bf0e54..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/pack-no-proprietary.js +++ /dev/null @@ -1,854 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/pack.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/pack.js deleted file mode 100644 index 0f50994..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/pack.js +++ /dev/null @@ -1,897 +0,0 @@ - -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/parse.js deleted file mode 100644 index f765a50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/parse.js +++ /dev/null @@ -1,359 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/zz-cleanup.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/zz-cleanup.js deleted file mode 100644 index a00ff7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/tar/test/zz-cleanup.js +++ /dev/null @@ -1,20 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/README.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/README.md deleted file mode 100644 index ff1eb53..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/README.md +++ /dev/null @@ -1,5 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/bin/which b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/bin/which deleted file mode 100755 index 8432ce2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/bin/which +++ /dev/null @@ -1,14 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/package.json deleted file mode 100644 index 9458b87..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "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" - }, - "_id": "which@1.0.5", - "_from": "which@~1.0.5", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/which.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/which.js deleted file mode 100644 index db7e8f7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/which/which.js +++ /dev/null @@ -1,104 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/package.json b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/package.json deleted file mode 100644 index 67ff70d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "jpegtran-bin", - "version": "0.2.0", - "description": "jpegtran (part of libjpeg-turbo) wrapper that makes it seamlessly available as a local dependency on OS X, Linux, FreeBSD, Solaris and Windows. Most commonly used to losslessly minify JPEG images.", - "keywords": [ - "jpeg", - "jpg", - "img", - "image", - "compress", - "minify", - "optimize" - ], - "homepage": "https://github.com/yeoman/node-jpegtran-bin", - "bugs": { - "url": "https://github.com/yeoman/node-jpegtran-bin/issues" - }, - "license": "BSD", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "maintainers": [ - { - "name": "Duncan Wong" - } - ], - "main": "lib/jpegtran", - "bin": { - "jpegtran": "bin/jpegtran.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/yeoman/node-jpegtran-bin.git" - }, - "scripts": { - "test": "mocha", - "postinstall": "node pre-build.js" - }, - "engines": { - "node": ">=0.8.0" - }, - "dependencies": { - "which": "~1.0.5", - "mocha": "~1.12.0", - "tar": "~0.1.17", - "request": "~2.26.0", - "chalk": "~0.2.0", - "mkdirp": "~0.3.5" - }, - "files": [ - "bin", - "lib", - "test", - "build.js", - "pre-build.js" - ], - "readme": "# node-jpegtran-bin [![Build Status](https://secure.travis-ci.org/yeoman/node-jpegtran-bin.png?branch=master)](http://travis-ci.org/yeoman/node-jpegtran-bin)\r\n\r\njpegtran 1.3 (part of [libjpeg-turbo](http://libjpeg-turbo.virtualgl.org/)) Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux, FreeBSD, Solaris and Windows. Most commonly used to losslessly minify JPEG images.\r\n\r\n> libjpeg-turbo is a derivative of libjpeg that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as the unmodified version of libjpeg, all else being equal.\r\n\r\n\r\n## Install\r\n\r\nInstall with [npm](https://npmjs.org/package/jpegtran-bin): `npm install --save jpegtran-bin`\r\n\r\n\r\n## Example usage\r\n\r\n```js\r\nvar execFile = require('child_process').execFile;\r\nvar jpegtranPath = require('jpegtran-bin').path;\r\n\r\nexecFile(jpegtranPath, ['-outfile', 'output.jpg', 'input.jpg'], function() {\r\n console.log('Image minified');\r\n});\r\n```\r\n\r\nCan also be run directly from `./node_modules/.bin/jpegtran`.\r\n\r\n\r\n## Dev\r\n\r\nNote to self on how to update the binaries.\r\n\r\n### OS X and Linux\r\n\r\nRun `npm install` to build the binary.\r\n\r\n### Windows\r\n\r\n- Download the [Windows files 32/64-bit](http://sourceforge.net/projects/libjpeg-turbo/files/) (GCC compiled) on a Windows machine\r\n- Run the downloaded file to extract\r\n- Go to the `bin` folder at the destination and copy `jpegtran.exe` and `libjpeg-62.dll`\r\n\r\n\r\n## License\r\n\r\nEverything excluding the binaries licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google.\r\n\r\nlibjpeg-turbo licensed under the BSD license and copyright dcommander.\r\n", - "readmeFilename": "readme.md", - "_id": "jpegtran-bin@0.2.0", - "dist": { - "shasum": "19d46b01e6ea80a661d0d6d78d21e54d2c5b1609" - }, - "_from": "jpegtran-bin@~0.2.0", - "_resolved": "https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-0.2.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/pre-build.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/pre-build.js deleted file mode 100644 index a42a28c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/pre-build.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -var fs = require('fs'); -var path = require('path'); -var mkdir = require('mkdirp'); -var request = require('request'); -var chalk = require('chalk'); -var Mocha = require('mocha'); -var mocha = new Mocha({ui: 'bdd', reporter: 'min'}); -var build = require('./build'); -var jpegtran = require('./lib/jpegtran'); -var binPath = jpegtran.path; - -function runTest() { - mocha.addFile('test/test-path.js'); - mocha.run(function (failures) { - if (failures > 0) { - console.log(chalk.red('pre-build test failed, compiling from source...')); - build(); - } else { - console.log(chalk.green('pre-build test passed successfully, skipping build...')); - } - }); -} - -if (fs.existsSync(binPath)) { - runTest(); -} else { - if (!fs.existsSync(path.dirname(binPath))) { - mkdir.sync(path.dirname(binPath)); - } - - return request.get(jpegtran.url) - .pipe(fs.createWriteStream(binPath)) - .on('close', function () { - fs.chmod(binPath, '0755'); - if (process.platform === 'win32') { - request.get(jpegtran.urlDll) - .pipe(fs.createWriteStream(jpegtran.pathDll)) - .on('close', function () { - runTest(); - }); - } else { - runTest(); - } - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/readme.md b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/readme.md deleted file mode 100644 index f29835a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# node-jpegtran-bin [![Build Status](https://secure.travis-ci.org/yeoman/node-jpegtran-bin.png?branch=master)](http://travis-ci.org/yeoman/node-jpegtran-bin) - -jpegtran 1.3 (part of [libjpeg-turbo](http://libjpeg-turbo.virtualgl.org/)) Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux, FreeBSD, Solaris and Windows. Most commonly used to losslessly minify JPEG images. - -> libjpeg-turbo is a derivative of libjpeg that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as the unmodified version of libjpeg, all else being equal. - - -## Install - -Install with [npm](https://npmjs.org/package/jpegtran-bin): `npm install --save jpegtran-bin` - - -## Example usage - -```js -var execFile = require('child_process').execFile; -var jpegtranPath = require('jpegtran-bin').path; - -execFile(jpegtranPath, ['-outfile', 'output.jpg', 'input.jpg'], function() { - console.log('Image minified'); -}); -``` - -Can also be run directly from `./node_modules/.bin/jpegtran`. - - -## Dev - -Note to self on how to update the binaries. - -### OS X and Linux - -Run `npm install` to build the binary. - -### Windows - -- Download the [Windows files 32/64-bit](http://sourceforge.net/projects/libjpeg-turbo/files/) (GCC compiled) on a Windows machine -- Run the downloaded file to extract -- Go to the `bin` folder at the destination and copy `jpegtran.exe` and `libjpeg-62.dll` - - -## License - -Everything excluding the binaries licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google. - -libjpeg-turbo licensed under the BSD license and copyright dcommander. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/fixtures/test.jpg b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/fixtures/test.jpg deleted file mode 100644 index 831b437..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/fixtures/test.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-build.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-build.js deleted file mode 100644 index 687e4c9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-build.js +++ /dev/null @@ -1,18 +0,0 @@ -/*global describe, it */ -'use strict'; -var fs = require('fs'); -var exec = require('child_process').exec; -var assert = require('assert'); -var binPath = require('../lib/jpegtran.js').path; - -describe('JPEGTran rebuild', function () { - it('it should rebuild the jpegtran binaries', function (cb) { - this.timeout(false); // give this test time to build - var origCTime = fs.statSync(binPath).ctime; - exec('node build.js', {}, function (err) { - var actualCTime = fs.statSync(binPath).ctime; - assert(actualCTime !== origCTime); - cb(err); - }).path; - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-path.js b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-path.js deleted file mode 100644 index 498cee6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/test/test-path.js +++ /dev/null @@ -1,47 +0,0 @@ -/*global describe, it, after */ -'use strict'; -var fs = require('fs'); -var path = require('path'); -var exec = require('child_process').exec; -var assert = require('assert'); - -describe('jpegtran', function () { - after(function () { - fs.unlinkSync('test/minified.jpg'); - }); - - it('should return path to jpegtran binary', function (cb) { - var binPath = require('../lib/jpegtran').path; - - exec('"' + binPath + '" -v -', function (err, stdout, stderr) { - assert(stderr.toString().indexOf('libjpeg-turbo') !== -1); - cb(); - }); - }); - - it('should successfully proxy jpegtran', function (cb) { - var binPath = path.join(__dirname, '../bin/jpegtran.js'); - - exec('node "' + binPath + '" -v -', function (err, stdout, stderr) { - assert(stderr.toString().indexOf('libjpeg-turbo') !== -1); - cb(); - }); - }); - - it('should minify a .jpg', function (cb) { - var binPath = path.join(__dirname, '../bin/jpegtran.js'); - var args = [ - '-copy', 'none', - '-optimize', - '-outfile', '"' + path.join(__dirname, 'minified.jpg') + '"', - '"' + path.join(__dirname, 'fixtures', 'test.jpg') + '"' - ]; - - exec('node "' + binPath + '" ' + args.join(' '), function () { - var actual = fs.statSync('test/minified.jpg').size; - var original = fs.statSync('test/fixtures/test.jpg').size; - assert(actual < original); - cb(); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/vendor/jpegtran b/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/vendor/jpegtran deleted file mode 100755 index 04d0dfe..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/vendor/jpegtran and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/bin/optipng.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/bin/optipng.js deleted file mode 100755 index 311d46f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/bin/optipng.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var binPath = require('../lib/optipng').path; -var spawn = require('child_process').spawn; - -spawn(binPath, process.argv.slice(2), { stdio: 'inherit' }) - .on('exit', process.exit); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/lib/check.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/lib/check.js deleted file mode 100644 index 0ac3db6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/lib/check.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var bin = require('./optipng').bin; -var chalk = require('chalk'); - -bin.check(function (w) { - if (!w) { - console.log(chalk.red('✗ pre-build test failed, compiling from source...')); - - if (process.platform === 'win32') { - throw new Error('building is not supported on ' + process.platform); - } - - return bin.build(function (err) { - if (err) { - return console.log(chalk.red('✗ ' + err.message)); - } - - console.log(chalk.green('✓ optipng rebuilt successfully')); - }); - } - - console.log(chalk.green('✓ pre-build test passed successfully')); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/lib/optipng.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/lib/optipng.js deleted file mode 100644 index 45fa96d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/lib/optipng.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -var Bin = require('bin-wrapper'); -var path = require('path'); - -var options = { - name: 'optipng', - bin: 'optipng', - path: path.join(__dirname, '../vendor'), - src: 'http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.4/optipng-0.7.4.tar.gz', - buildScript: './configure --with-system-zlib --bindir="' + path.join(__dirname, '../vendor') + '" && ' + - 'make install', - platform: { - darwin: { - url: 'https://raw.github.com/yeoman/node-optipng-bin/master/vendor/osx/optipng' - }, - freebsd: { - url: 'https://raw.github.com/yeoman/node-optipng-bin/master/vendor/freebsd/optipng' - }, - linux: { - url: 'https://raw.github.com/yeoman/node-optipng-bin/master/vendor/linux/x86/optipng', - arch: { - x64: { - url: 'https://raw.github.com/yeoman/node-optipng-bin/master/vendor/linux/x64/optipng' - } - } - }, - sunos: { - url: 'https://raw.github.com/yeoman/node-optipng-bin/master/vendor/sunos/x86/optipng', - arch: { - x64: { - url: 'https://raw.github.com/yeoman/node-optipng-bin/master/vendor/sunos/x64/optipng', - } - } - }, - win32: { - bin: 'optipng.exe', - url: 'https://raw.github.com/yeoman/node-optipng-bin/master/vendor/win/optipng.exe' - } - } -}; -var bin = new Bin(options); - -exports.bin = bin; -exports.options = options; -exports.path = bin.path; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/README.md deleted file mode 100644 index 05419cd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# bin-wrapper [![Build Status](https://secure.travis-ci.org/kevva/bin-wrapper.png?branch=master)](http://travis-ci.org/kevva/bin-wrapper) - -Binary wrapper for Node.js that makes your programs seamlessly available as local dependencies - -## Getting started - -Install with [npm](https://npmjs.org/package/bin-wrapper): `npm install bin-wrapper` - -## Examples - -All `platform` and `arch` specific options takes precedence over the base -options. See [test.js](test.js) for a full fleshed example. - -```js -var Bin = require('bin-wrapper'); - -var opts = { - name: 'Gifsicle', - bin: 'gifsicle', - path: 'vendor', - url: 'http://url/to/gifsicle', - src: 'http://www.lcdf.org/gifsicle/gifsicle-1.71.tar.gz', - buildScript: './configure --bindir="vendor" && make install', - platform: { - win32: { - bin: 'gifsicle.exe', - url: [ - 'http://url/to/gifsicle.exe' - 'http://url/to/gifsicle.dll' - ] - } - } -} -var bin = new Bin(opts); - -bin.check('--version', function (works) { - if (!works) { - console.log('Pre-build test failed, compiling from source'); - return bin.build(); - } - - console.log('Binary passed the test'); -}); -``` - -Get the path to your binary with `bin.path`. - -```js -console.log(bin.path); -// => path/to/vendor/gifsicle -``` - -## API - -### .check(cmd, cb) - -Check if a binary is present and working. If it isn't, download and test it by -running the binary with `cmd` and see if it exits correctly. - -### .build(cb) - -Download the source archive defined in the `src` property and build it using the -build script defined in the `buildScript` property. - -## License - -[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/bin-wrapper.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/bin-wrapper.js deleted file mode 100644 index 33227ac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/bin-wrapper.js +++ /dev/null @@ -1,221 +0,0 @@ -'use strict'; - -var download = require('download'); -var exec = require('child_process').exec; -var fs = require('fs'); -var isbin = require('isbin'); -var mout = require('mout'); -var os = require('os'); -var path = require('path'); -var ProgressBar = require('progress'); -var spawn = require('child_process').spawn; -var which = require('which'); - -/** - * Initialize BinWrapper with options - * - * @param {Object} opts - * @api public - */ - -function BinWrapper(opts) { - opts = opts || {}; - this.opts = this._parse(opts); - this.name = this.opts.name; - this.bin = this.opts.bin; - this.dest = this.opts.path; - this.path = this._path() || path.join(this.dest, this.bin); - this.url = this.opts.url; - this.src = this.opts.src; - this.buildScript = this.opts.buildScript; - this.proxy = process.env.http_proxy || - process.env.HTTP_PROXY || - process.env.https_proxy || - process.env.HTTPS_PROXY || - null; -} - -/** - * Check if a binary is present and working - * - * @param {String|Array} cmd - * @param {Function} cb - * @api public - */ - -BinWrapper.prototype.check = function (cmd, cb) { - var self = this; - - if (!cb && mout.lang.isFunction(cmd)) { - cb = cmd; - cmd = ['--help']; - } - - cmd = cmd; - cmd = Array.isArray(cmd) ? cmd : [cmd]; - - if (this._path()) { - return self._test(cmd, cb); - } - - this._download(this.url, this.dest, { mode: '0755', proxy: this.proxy }) - .on('close', function () { - return self._test(cmd, cb); - }); -}; - -/** - * Download source and build a binary - * - * @param {Function} cb - * @api public - */ - -BinWrapper.prototype.build = function (cb) { - var self = this; - var tmpDir = os.tmpdir ? os.tmpdir() : os.tmpDir(); - var tmp = path.join(tmpDir, this.name); - var get = this._download(this.src, tmp, { extract: true, strip: '1', proxy: this.proxy }); - - if (!cb || !mout.lang.isFunction(cb)) { - cb = function () {}; - } - - if (!isbin('make')) { - throw new Error('failed to find make'); - } - - get.on('close', function () { - exec(self.buildScript, { cwd: tmp }, function (err) { - if (err) { - return cb(err); - } - - return cb(); - }); - }); -}; - -/** - * Download a string or an array of files - * - * @param {String|Array} src - * @param {String} dest - * @param {Object} opts - * @api private - */ - -BinWrapper.prototype._download = function (src, dest, opts) { - var get = download(src, dest, opts); - - get.on('response', function (res) { - var len = parseInt(res.headers['content-length'], 10); - var bar = new ProgressBar(' ' + path.basename(src) + ': downloading [:bar] :percent :etas', { - complete: '=', - incomplete: ' ', - width: 20, - total: len - }); - - res.on('data', function (data) { - bar.tick(data.length); - }); - - res.on('end', function () { - console.log('\n'); - }); - }); - - return get; -}; - -/** - * If a binary exists, get its path - * - * @api private - */ - -BinWrapper.prototype._path = function () { - var self = this; - - if (fs.existsSync(path.join(this.dest, this.bin))) { - return path.join(self.dest, self.bin); - } - - if (isbin(this.bin)) { - if (!which.sync(self.bin).indexOf('node_modules/.bin')) { - return which.sync(self.bin); - } - } - - return false; -}; - -/** - * Test if a binary is working by checking its exit code - * - * @param {Array} cmd - * @param {Function} cb - * @api private - */ - -BinWrapper.prototype._test = function (cmd, cb) { - var working; - var bin = spawn(this.path, cmd); - - bin.on('error', function () { - working = false; - return cb(working); - }); - - bin.on('exit', function (code) { - working = code === 0; - return cb(working); - }); -}; - -/** - * Parse options - * - * @param {Object} opts - * @api private - */ - -BinWrapper.prototype._parse = function (opts) { - opts.platform = opts.platform || {}; - opts.arch = opts.arch || {}; - - var platform = process.platform; - var arch = process.arch === 'x64' ? 'x64' : 'x86'; - var required = [ - 'bin', - 'name', - 'path', - 'url' - ]; - - if (mout.object.hasOwn(opts.platform, [platform])) { - opts = mout.object.mixIn(opts, opts.platform[platform]); - } - - if (mout.object.hasOwn(opts.arch, [arch])) { - opts = mout.object.mixIn(opts, opts.arch[arch]); - } - - required.forEach(function (val) { - if (!mout.object.hasOwn(opts, val)) { - throw new Error(val + ' option is required'); - } - }); - - delete opts.platform; - delete opts.arch; - - return opts; -}; - -/** - * Module exports - */ - -module.exports = BinWrapper; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/.bin/which b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/.bin/which deleted file mode 120000 index f62471c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/README.md deleted file mode 100644 index a9cca0a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# download [![Build Status](https://secure.travis-ci.org/kevva/download.png?branch=master)](http://travis-ci.org/kevva/download) - -Download and extract files effortlessly in Node.js. - -## Getting started - -Install with [npm](https://npmjs.org/package/download): `npm install download` - -## Examples - -If you're fetching an archive you can set `extract: true` in options and -it'll extract it for you. - -```js -var download = require('download'); - -// download and extract `foo.tar.gz` into `bar/` -download('foo.tar.gz', 'bar', { extract: true }); - -// download and save `foo.exe` into `bar/foo.exe` with mode `0755` -download('foo.exe', 'bar', { mode: '0755' }); - -// download and save an array of files in `bar/` -var files = ['foo.jpg', 'bar.jpg', 'cat.jpg']; -download(files, 'bar'); -``` - -## API - -### download(url, dest, opts) - -Download a file or an array of files to a given destination. - -## Options - -* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/) -* `mode` — Set mode on the downloaded files -* `strip` — Equivalent to `--strip-components` for tar - -You can also define options accepted by the [request](https://github.com/mikeal/request/) module. - -## License - -[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/download.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/download.js deleted file mode 100644 index 43efa9f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/download.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -var decompress = require('decompress'); -var forEach = require('async-foreach').forEach; -var fs = require('fs'); -var mkdir = require('mkdirp'); -var path = require('path'); -var request = require('request'); -var stream = require('through2')(); - -/** - * Download a file to a given destination - * - * Options: - * - * - `extract` Try extracting the file - * - `mode` Set mode on the downloaded files - * - `strip` Equivalent to --strip-components for tar - * - * @param {String|Array} url - * @param {String} dest - * @param {Object} opts - * @api public - */ - -module.exports = function (url, dest, opts) { - url = Array.isArray(url) ? url : [url]; - - forEach(url, function (url) { - opts = opts || {}; - opts.url = url; - opts.dest = path.join(dest, path.basename(url)); - opts.strip = opts.strip || '0'; - - var req = request.get(opts) - .on('response', function (res) { - stream.emit('response', res); - }) - .on('data', function (data) { - stream.emit('data', data); - }) - .on('error', function (err) { - stream.emit('error', err); - }); - - req.on('response', function (res) { - var mime = res.headers['content-type']; - var status = res.statusCode; - var end; - - if (status < 200 || status >= 300) { - return; - } - - if (opts.extract && decompress.canExtract(url, mime)) { - var ext; - - if (decompress.canExtract(url)) { - ext = url; - } else { - ext = mime; - } - - end = decompress.extract({ ext: ext, path: dest, strip: opts.strip }); - } else { - if (!fs.existsSync(dest)) { - mkdir.sync(dest); - } - - end = fs.createWriteStream(opts.dest); - } - - req.pipe(end); - - end.on('close', function () { - if (!opts.extract && opts.mode) { - fs.chmodSync(opts.dest, opts.mode); - } - - stream.emit('close'); - }); - }); - }); - - return stream; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/LICENSE-MIT b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/LICENSE-MIT deleted file mode 100644 index 7505716..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2011 "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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/README.md deleted file mode 100644 index f574204..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/README.md +++ /dev/null @@ -1,195 +0,0 @@ -# JavaScript Sync/Async forEach - -An optionally-asynchronous forEach with an interesting interface. - -## Getting Started - -This code should work just fine in Node.js: - -First, install the module with: `npm install async-foreach` - -```javascript -var forEach = require('async-foreach').forEach; -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); -}); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -``` - -Or in the browser: - -```html - - -``` - -In the browser, you can attach the forEach method to any object. - -```html - - - -``` - -## The General Idea (Why I thought this was worth sharing) - -The idea is to allow the callback to decide _at runtime_ whether the loop will be synchronous or asynchronous. By using `this` in a creative way (in situations where that value isn't already spoken for), an entire control API can be offered without over-complicating function signatures. - -```javascript -forEach(arr, function(item, index) { - // Synchronous. -}); - -forEach(arr, function(item, index) { - // Only when `this.async` is called does iteration becomes asynchronous. The - // loop won't be continued until the `done` function is executed. - var done = this.async(); - // Continue in one second. - setTimeout(done, 1000); -}); - -forEach(arr, function(item, index) { - // Break out of synchronous iteration early by returning false. - return index !== 1; -}); - -forEach(arr, function(item, index) { - // Break out of asynchronous iteration early... - var done = this.async(); - // ...by passing false to the done function. - setTimeout(function() { - done(index !== 1); - }); -}); -``` - -## Examples -See the unit tests for more examples. - -```javascript -// Generic "done" callback. -function allDone(notAborted, arr) { - console.log("done", notAborted, arr); -} - -// Synchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Synchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - if (item === "b") { return false; } -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] - -// Asynchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(); - }, 500); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Asynchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(item !== "b"); - }, 500); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] - -// Not actually asynchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async() - done(); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Not actually asynchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - done(item !== "b"); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] -``` - -## 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](https://github.com/cowboy/grunt). - -_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_ - -## Release History - -04/29/2013 -v0.1.3 -Removed hard Node.js version dependency. - -11/17/2011 -v0.1.2 -Adding sparse array support. -Invalid length properties are now sanitized. -This closes issue #1 (like a boss). - -11/11/2011 -v0.1.1 -Refactored code to be much simpler. Yay for unit tests! - -11/11/2011 -v0.1.0 -Initial Release. - -## License -Copyright (c) 2012 "Cowboy" Ben Alman -Licensed under the MIT license. - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js deleted file mode 100644 index 64c6eb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js +++ /dev/null @@ -1,58 +0,0 @@ -/* JavaScript Sync/Async forEach - v0.1.2 - 1/10/2012 - * http://github.com/cowboy/javascript-sync-async-foreach - * Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ - -(function(exports) { - - // Iterate synchronously or asynchronously. - exports.forEach = function(arr, eachFn, doneFn) { - var i = -1; - // Resolve array length to a valid (ToUint32) number. - var len = arr.length >>> 0; - - // This IIFE is called once now, and then again, by name, for each loop - // iteration. - (function next(result) { - // This flag will be set to true if `this.async` is called inside the - // eachFn` callback. - var async; - // Was false returned from the `eachFn` callback or passed to the - // `this.async` done function? - var abort = result === false; - - // Increment counter variable and skip any indices that don't exist. This - // allows sparse arrays to be iterated. - do { ++i; } while (!(i in arr) && i !== len); - - // Exit if result passed to `this.async` done function or returned from - // the `eachFn` callback was false, or when done iterating. - if (abort || i === len) { - // If a `doneFn` callback was specified, invoke that now. Pass in a - // boolean value representing "not aborted" state along with the array. - if (doneFn) { - doneFn(!abort, arr); - } - return; - } - - // Invoke the `eachFn` callback, setting `this` inside the callback to a - // custom object that contains one method, and passing in the array item, - // index, and the array. - result = eachFn.call({ - // If `this.async` is called inside the `eachFn` callback, set the async - // flag and return a function that can be used to continue iterating. - async: function() { - async = true; - return next; - } - }, arr[i], i, arr); - - // If the async flag wasn't set, continue by calling `next` synchronously, - // passing in the result of the `eachFn` callback. - if (!async) { - next(result); - } - }()); - }; - -}(typeof exports === "object" && exports || this)); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js deleted file mode 100644 index c218a91..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/* JavaScript Sync/Async forEach - v0.1.2 - 1/10/2012 - * http://github.com/cowboy/javascript-sync-async-foreach - * Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ -(function(a){a.forEach=function(a,b,c){var d=-1,e=a.length>>>0;(function f(g){var h,j=g===!1;do++d;while(!(d in a)&&d!==e);if(j||d===e){c&&c(!j,a);return}g=b.call({async:function(){return h=!0,f}},a[d],d,a),h||f(g)})()}})(typeof exports=="object"&&exports||this) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js deleted file mode 100644 index 079a23a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js +++ /dev/null @@ -1,48 +0,0 @@ -/*global config:true, task:true*/ -config.init({ - pkg: '', - meta: { - title: 'JavaScript Sync/Async forEach', - license: ['MIT'], - copyright: 'Copyright (c) 2012 "Cowboy" Ben Alman', - banner: '/* {{meta.title}} - v{{pkg.version}} - {{today "m/d/yyyy"}}\n' + - ' * {{pkg.homepage}}\n' + - ' * {{{meta.copyright}}}; Licensed {{join meta.license}} */' - }, - concat: { - 'dist/ba-foreach.js': ['', ''] - }, - min: { - 'dist/ba-foreach.min.js': ['', 'dist/ba-foreach.js'] - }, - test: { - files: ['test/**/*.js'] - }, - lint: { - files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] - }, - watch: { - files: '', - tasks: 'lint:files test:files' - }, - jshint: { - options: { - curly: true, - eqeqeq: true, - immed: true, - latedef: true, - newcap: true, - noarg: true, - sub: true, - undef: true, - eqnull: true - }, - globals: { - exports: true - } - }, - uglify: {} -}); - -// Default task. -task.registerTask('default', 'lint:files test:files concat min'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js deleted file mode 100644 index 9ee98b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * Sync/Async forEach - * https://github.com/cowboy/javascript-sync-async-foreach - * - * Copyright (c) 2012 "Cowboy" Ben Alman - * Licensed under the MIT license. - * http://benalman.com/about/license/ - */ - -(function(exports) { - - // Iterate synchronously or asynchronously. - exports.forEach = function(arr, eachFn, doneFn) { - var i = -1; - // Resolve array length to a valid (ToUint32) number. - var len = arr.length >>> 0; - - // This IIFE is called once now, and then again, by name, for each loop - // iteration. - (function next(result) { - // This flag will be set to true if `this.async` is called inside the - // eachFn` callback. - var async; - // Was false returned from the `eachFn` callback or passed to the - // `this.async` done function? - var abort = result === false; - - // Increment counter variable and skip any indices that don't exist. This - // allows sparse arrays to be iterated. - do { ++i; } while (!(i in arr) && i !== len); - - // Exit if result passed to `this.async` done function or returned from - // the `eachFn` callback was false, or when done iterating. - if (abort || i === len) { - // If a `doneFn` callback was specified, invoke that now. Pass in a - // boolean value representing "not aborted" state along with the array. - if (doneFn) { - doneFn(!abort, arr); - } - return; - } - - // Invoke the `eachFn` callback, setting `this` inside the callback to a - // custom object that contains one method, and passing in the array item, - // index, and the array. - result = eachFn.call({ - // If `this.async` is called inside the `eachFn` callback, set the async - // flag and return a function that can be used to continue iterating. - async: function() { - async = true; - return next; - } - }, arr[i], i, arr); - - // If the async flag wasn't set, continue by calling `next` synchronously, - // passing in the result of the `eachFn` callback. - if (!async) { - next(result); - } - }()); - }; - -}(typeof exports === "object" && exports || this)); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json deleted file mode 100644 index a55647b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "name": "async-foreach", - "description": "An optionally-asynchronous forEach with an interesting interface.", - "version": "0.1.3", - "homepage": "http://github.com/cowboy/javascript-sync-async-foreach", - "bugs": { - "url": "https://github.com/cowboy/javascript-sync-async-foreach/issues" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/javascript-sync-async-foreach.git" - }, - "main": "lib/foreach", - "engines": { - "node": "*" - }, - "keywords": [ - "array", - "loop", - "sync", - "async", - "foreach" - ], - "dependencies": {}, - "devDependencies": {}, - "readme": "# JavaScript Sync/Async forEach\n\nAn optionally-asynchronous forEach with an interesting interface.\n\n## Getting Started\n\nThis code should work just fine in Node.js:\n\nFirst, install the module with: `npm install async-foreach`\n\n```javascript\nvar forEach = require('async-foreach').forEach;\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n});\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n```\n\nOr in the browser:\n\n```html\n\n\n```\n\nIn the browser, you can attach the forEach method to any object.\n\n```html\n\n\n\n```\n\n## The General Idea (Why I thought this was worth sharing)\n\nThe idea is to allow the callback to decide _at runtime_ whether the loop will be synchronous or asynchronous. By using `this` in a creative way (in situations where that value isn't already spoken for), an entire control API can be offered without over-complicating function signatures.\n\n```javascript\nforEach(arr, function(item, index) {\n // Synchronous.\n});\n\nforEach(arr, function(item, index) {\n // Only when `this.async` is called does iteration becomes asynchronous. The\n // loop won't be continued until the `done` function is executed.\n var done = this.async();\n // Continue in one second.\n setTimeout(done, 1000);\n});\n\nforEach(arr, function(item, index) {\n // Break out of synchronous iteration early by returning false.\n return index !== 1;\n});\n\nforEach(arr, function(item, index) {\n // Break out of asynchronous iteration early...\n var done = this.async();\n // ...by passing false to the done function.\n setTimeout(function() {\n done(index !== 1);\n });\n});\n```\n\n## Examples\nSee the unit tests for more examples.\n\n```javascript\n// Generic \"done\" callback.\nfunction allDone(notAborted, arr) {\n console.log(\"done\", notAborted, arr);\n}\n\n// Synchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Synchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n if (item === \"b\") { return false; }\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n\n// Asynchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n setTimeout(function() {\n done();\n }, 500);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Asynchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n setTimeout(function() {\n done(item !== \"b\");\n }, 500);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n\n// Not actually asynchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async()\n done();\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Not actually asynchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n done(item !== \"b\");\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n```\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](https://github.com/cowboy/grunt).\n\n_Also, please don't edit files in the \"dist\" subdirectory as they are generated via grunt. You'll find source code in the \"lib\" subdirectory!_\n\n## Release History\n\n04/29/2013\nv0.1.3\nRemoved hard Node.js version dependency.\n\n11/17/2011\nv0.1.2\nAdding sparse array support.\nInvalid length properties are now sanitized.\nThis closes issue #1 (like a boss).\n\n11/11/2011\nv0.1.1\nRefactored code to be much simpler. Yay for unit tests!\n\n11/11/2011\nv0.1.0\nInitial Release.\n\n## License\nCopyright (c) 2012 \"Cowboy\" Ben Alman \nLicensed under the MIT license. \n\n", - "readmeFilename": "README.md", - "_id": "async-foreach@0.1.3", - "dist": { - "shasum": "fcc0e658c316931d1c56909a12c8370eafc16cfa" - }, - "_from": "async-foreach@~0.1.3", - "_resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js deleted file mode 100644 index be18c43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js +++ /dev/null @@ -1,200 +0,0 @@ -/*global require:true, setTimeout:true */ -var forEach = require('../lib/foreach').forEach; - -exports['foreach'] = { - setUp: function(done) { - this.order = []; - this.track = function() { - [].push.apply(this.order, arguments); - }; - done(); - }, - 'Synchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr - ], "should call eachFn for each array item, in order."); - test.done(); - }, - 'Synchronous, done': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }, - 'Synchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - if (item === "b") { return false; } - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }, - 'Asynchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(done, 10); - }); - - setTimeout(function() { - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr - ], "should call eachFn for each array item, in order."); - test.done(); - }, 100); - }, - 'Asynchronous, done': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(done, 10); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Asynchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(item !== "b"); - }, 10); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Not actually asynchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - done(); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Not actually asynchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - done(item !== "b"); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Sparse array support': function(test) { - test.expect(1); - var that = this; - - var arr = []; - arr[0] = "a"; - arr[9] = "z"; - - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "z", 9, arr - ], "should skip nonexistent array items."); - test.done(); - }, - 'Invalid length sanitization': function(test) { - test.expect(1); - var that = this; - - var obj = {length: 4294967299, 0: "a", 2: "b", 3: "c" }; - - forEach(obj, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, obj, - "each", "b", 2, obj - ], "should sanitize length property (ToUint32)."); - test.done(); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md deleted file mode 100644 index dea4f3d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# decompress [![Build Status](https://secure.travis-ci.org/kevva/decompress.png?branch=master)](http://travis-ci.org/kevva/decompress) - -Easily extract `.zip`, `.tar` and `.tar.gz` archives. Based on the extract -utility in [Bower](https://github.com/bower/bower). - -## Getting started - -Install with [npm](https://npmjs.org/package/decompress): `npm install decompress` - -## Examples - -You'll only need to pass a type into `ext` and it'll figure the rest out for -you. - -```js -var decompress = require('decompress'); -var fs = require('fs'); - -var src = fs.createReadStream('foo.tar.gz'); -var dest = decompress.extract({ ext: '.tar.gz' }); - -src.pipe(dest); -``` - -## API - -### .extract(opts) - -Extract an archive using the `ext` option to determine which extractor to use. -If no `path` is specified it'll extract it to your current location. - -### .canExtract(src, mime) - -Determine if a file can be extracted or not by checking the file extension -and/or the MIME type. - -```js -decompress.canExtract('foo.zip'); -// => true - -decompress.canExtract('application/zip'); -// => true -``` - -## Options - -* `ext` — String that can be a file name, URL, MIME type etc. -* `path` — Path to extract the archive to. If no `path` is defined it'll -extract it to your current location. -* `strip` — Equivalent to `--strip-components` for tar. - -## License - -[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js deleted file mode 100644 index 5c65d4c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js +++ /dev/null @@ -1,167 +0,0 @@ -'use strict'; - -var AdmZip = require('adm-zip'); -var fs = require('fs'); -var mkdir = require('mkdirp'); -var mout = require('mout'); -var path = require('path'); -var pipeline = require('stream-combiner'); -var rm = require('rimraf'); -var tar = require('tar'); -var temp = require('temp'); -var zlib = require('zlib'); - -/** - * Initialize Decompress with options - * - * Options: - * - * - `ext` String with file name, MIME type, etc - * - `path` Path to extract to - * - * @param {Object} opts - * @api private - */ - -function Decompress(opts) { - opts = opts || {}; - opts.strip = opts.strip || 0; - this.opts = opts; - this.path = opts.path || process.cwd(); - this.ext = opts.ext || ''; - this.strip = opts.strip >= 0 ? opts.strip : 0; - this.extractors = { - '.zip': this._extractZip, - '.tar': this._extractTar, - '.tar.gz': this._extractTarGz, - '.tgz': this._extractTarGz, - 'application/zip': this._extractZip, - 'application/x-tar': this._extractTar, - 'application/x-tgz': this._extractTarGz - }; - this.extractorTypes = Object.keys(this.extractors); - this.extractor = this._getExtractor(this.ext); -} - -/** - * Extract an archive - * - * @api public - */ - -Decompress.prototype.extract = function () { - var self = this; - var stream = this.extractor(); - - if (!fs.existsSync(this.path)) { - mkdir.sync(self.path); - } - - return stream; -}; - -/** - * Check if a file can be extracted - * - * @param {String} src - * @param {String} mime - * @api public - */ - -Decompress.prototype.canExtract = function (src, mime) { - if (this._getExtractor(src)) { - return true; - } - - if (mime && this._getExtractor(mime)) { - return true; - } - - return false; -}; - -/** - * Get the extractor for a desired file - * - * @param {String} src - * @api private - */ - -Decompress.prototype._getExtractor = function (src) { - src = src.toLowerCase(); - - var ext = mout.array.find(this.extractorTypes, function (ext) { - return mout.string.endsWith(src, ext); - }); - - return ext ? this.extractors[ext] : null; -}; - -/** - * Extract a zip file - * - * @api private - */ - -Decompress.prototype._extractZip = function () { - var self = this; - var tmp = temp.path({ suffix: '.zip' }); - - var stream = fs.createWriteStream(tmp).on('close', function () { - var zip = new AdmZip(tmp); - var zipEntries = zip.getEntries(); - - zipEntries.forEach(function (entry) { - var e = entry.entryName.toString().split('/').slice(self.strip).join('/'); - var d = path.join(self.path, e); - var c = entry.getData().toString(); - - if (!entry.isDirectory) { - mkdir.sync(path.dirname(d)); - fs.writeFileSync(d, c); - } - }); - }); - - return stream.on('close', function () { - rm.sync(tmp); - }); -}; - -/** - * Extract a tar file - * - * @api private - */ - -Decompress.prototype._extractTar = function () { - var stream = tar.Extract(this.opts); - return stream; -}; - -/** - * Extract a tar.gz file - * - * @api private - */ - -Decompress.prototype._extractTarGz = function () { - var stream = zlib.Unzip(); - var dest = tar.Extract(this.opts); - - return pipeline(stream, dest); -}; - -/** - * Module exports - */ - -module.exports.extract = function (opts) { - var decompress = new Decompress(opts); - return decompress.extract(); -}; - -module.exports.canExtract = function (src, mime) { - var decompress = new Decompress(); - return decompress.canExtract(src, mime); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt deleted file mode 100644 index 14c3ee5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2012 Another-D-Mention Software and other contributors, -http://www.another-d-mention.ro/ - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md deleted file mode 100644 index 84296fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# ADM-ZIP for NodeJS - -ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/). - -# Installation - -With [npm](http://npmjs.org) do: - - $ npm install adm-zip - -## What is it good for? -The library allows you to: - -* decompress zip files directly to disk or in memory buffers -* compress files and store them to disk in .zip format or in compressed buffers -* update content of/add new/delete files from an existing .zip - -# Dependencies -There are no other nodeJS libraries that ADM-ZIP is dependent of - -# Examples - -## Basic usage -```javascript - - var AdmZip = require('adm-zip'); - - // reading archives - var zip = new AdmZip("./my_file.zip"); - var zipEntries = zip.getEntries(); // an array of ZipEntry records - - zipEntries.forEach(function(zipEntry) { - console.log(zipEntry.toString()); // outputs zip entries information - if (zipEntry.entryName == "my_file.txt") { - console.log(zipEntry.data.toString('utf8')); - } - }); - // outputs the content of some_folder/my_file.txt - console.log(zip.readAsText("some_folder/my_file.txt")); - // extracts the specified file to the specified location - zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*overwrite*/true) - // extracts everything - zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); - - - // creating archives - var zip = new AdmZip(); - - // add file directly - zip.addFile("test.txt", new Buffer("inner content of the file"), "entry comment goes here"); - // add local file - zip.addLocalFile("/home/me/some_picture.png"); - // get everything as a buffer - var willSendthis = zip.toBuffer(); - // or write everything to disk - zip.writeZip(/*target file name*/"/home/me/files.zip"); - - - // ... more examples in the wiki -``` - -For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki). - -[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js deleted file mode 100644 index fcfa00b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js +++ /dev/null @@ -1,387 +0,0 @@ -var fs = require("fs"), - pth = require("path"); - -fs.existsSync = fs.existsSync || pth.existsSync; - -var ZipEntry = require("./zipEntry"), - ZipFile = require("./zipFile"), - Utils = require("./util"); - -module.exports = function(/*String*/input) { - var _zip = undefined, - _filename = ""; - - if (input && typeof input === "string") { // load zip file - if (fs.existsSync(input)) { - _filename = input; - _zip = new ZipFile(input, Utils.Constants.FILE); - } else { - throw Utils.Errors.INVALID_FILENAME; - } - } else if(input && Buffer.isBuffer(input)) { // load buffer - _zip = new ZipFile(input, Utils.Constants.BUFFER); - } else { // create new zip file - _zip = new ZipFile(null, Utils.Constants.NONE); - } - - function getEntry(/*Object*/entry) { - if (entry && _zip) { - var item; - // If entry was given as a file name - if (typeof entry === "string") - item = _zip.getEntry(entry); - // if entry was given as a ZipEntry object - if (typeof entry === "object" && entry.entryName != undefined && entry.header != undefined) - item = _zip.getEntry(entry.entryName); - - if (item) { - return item; - } - } - return null; - } - - return { - /** - * Extracts the given entry from the archive and returns the content as a Buffer object - * @param entry ZipEntry object or String with the full path of the entry - * - * @return Buffer or Null in case of error - */ - readFile : function(/*Object*/entry) { - var item = getEntry(entry); - return item && item.getData() || null; - }, - - /** - * Asynchronous readFile - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * - * @return Buffer or Null in case of error - */ - readFileAsync : function(/*Object*/entry, /*Function*/callback) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(callback); - } else { - callback(null,"getEntry failed for:" + entry) - } - }, - - /** - * Extracts the given entry from the archive and returns the content as plain text in the given encoding - * @param entry ZipEntry object or String with the full path of the entry - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsText : function(/*Object*/entry, /*String - Optional*/encoding) { - var item = getEntry(entry); - if (item) { - var data = item.getData(); - if (data && data.length) { - return data.toString(encoding || "utf8"); - } - } - return ""; - }, - - /** - * Asynchronous readAsText - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsTextAsync : function(/*Object*/entry, /*Function*/callback, /*String - Optional*/encoding) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(function(data) { - if (data && data.length) { - callback(data.toString(encoding || "utf8")); - } else { - callback(""); - } - }) - } else { - callback(""); - } - }, - - /** - * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory - * - * @param entry - */ - deleteFile : function(/*Object*/entry) { // @TODO: test deleteFile - var item = getEntry(entry); - if (item) { - _zip.deleteEntry(item.entryName); - } - }, - - /** - * Adds a comment to the zip. The zip must be rewritten after adding the comment. - * - * @param comment - */ - addZipComment : function(/*String*/comment) { // @TODO: test addZipComment - _zip.comment = comment; - }, - - /** - * Returns the zip comment - * - * @return String - */ - getZipComment : function() { - return _zip.comment || ''; - }, - - /** - * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment - * The comment cannot exceed 65535 characters in length - * - * @param entry - * @param comment - */ - addZipEntryComment : function(/*Object*/entry,/*String*/comment) { - var item = getEntry(entry); - if (item) { - item.comment = comment; - } - }, - - /** - * Returns the comment of the specified entry - * - * @param entry - * @return String - */ - getZipEntryComment : function(/*Object*/entry) { - var item = getEntry(entry); - if (item) { - return item.comment || ''; - } - return '' - }, - - /** - * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content - * - * @param entry - * @param content - */ - updateFile : function(/*Object*/entry, /*Buffer*/content) { - var item = getEntry(entry); - if (item) { - item.setData(content); - } - }, - - /** - * Adds a file from the disk to the archive - * - * @param localPath - */ - addLocalFile : function(/*String*/localPath) { - if (fs.existsSync(localPath)) { - var p = localPath.split("\\").join("/").split("/").pop(); - this.addFile(p, fs.readFileSync(localPath), "", 0) - } else { - throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath); - } - }, - - /** - * Adds a local directory and all its nested files and directories to the archive - * - * @param localPath - */ - addLocalFolder : function(/*String*/localPath) { - localPath = localPath.split("\\").join("/"); //windows fix - if (localPath.charAt(localPath.length - 1) != "/") - localPath += "/"; - - if (fs.existsSync(localPath)) { - - var items = Utils.findFiles(localPath), - self = this; - - if (items.length) { - items.forEach(function(path) { - var p = path.split("\\").join("/").replace(localPath, ""); //windows fix - if (p.charAt(p.length - 1) !== "/") { - self.addFile(p, fs.readFileSync(path), "", 0) - } else { - self.addFile(p, new Buffer(0), "", 0) - } - }); - } - } else { - throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath); - } - }, - - /** - * Allows you to create a entry (file or directory) in the zip file. - * If you want to create a directory the entryName must end in / and a null buffer should be provided. - * Comment and attributes are optional - * - * @param entryName - * @param content - * @param comment - * @param attr - */ - addFile : function(/*String*/entryName, /*Buffer*/content, /*String*/comment, /*Number*/attr) { - var entry = new ZipEntry(); - entry.entryName = entryName; - entry.comment = comment || ""; - entry.attr = attr || 0666; - if (entry.isDirectory && content.length) { - // throw Utils.Errors.DIRECTORY_CONTENT_ERROR; - } - entry.setData(content); - _zip.setEntry(entry); - }, - - /** - * Returns an array of ZipEntry objects representing the files and folders inside the archive - * - * @return Array - */ - getEntries : function() { - if (_zip) { - return _zip.entries; - } else { - return []; - } - }, - - /** - * Returns a ZipEntry object representing the file or folder specified by ``name``. - * - * @param name - * @return ZipEntry - */ - getEntry : function(/*String*/name) { - return getEntry(name); - }, - - /** - * Extracts the given entry to the given targetPath - * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted - * - * @param entry ZipEntry object or String with the full path of the entry - * @param targetPath Target folder where to write the file - * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder - * will be created in targetPath as well. Default is TRUE - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - * - * @return Boolean - */ - extractEntryTo : function(/*Object*/entry, /*String*/targetPath, /*Boolean*/maintainEntryPath, /*Boolean*/overwrite) { - overwrite = overwrite || false; - maintainEntryPath = typeof maintainEntryPath == "undefined" ? true : maintainEntryPath; - - var item = getEntry(entry); - if (!item) { - throw Utils.Errors.NO_ENTRY; - } - - var target = pth.resolve(targetPath, maintainEntryPath ? item.entryName : pth.basename(item.entryName)); - - if (item.isDirectory) { - target = pth.resolve(target, ".."); - var children = _zip.getEntryChildren(item); - children.forEach(function(child) { - if (child.isDirectory) return; - var content = child.getData(); - if (!content) { - throw Utils.Errors.CANT_EXTRACT_FILE; - } - Utils.writeFileTo(pth.resolve(targetPath, maintainEntryPath ? child.entryName : child.entryName.substr(item.entryName.length)), content, overwrite); - }); - return true; - } - - var content = item.getData(); - if (!content) throw Utils.Errors.CANT_EXTRACT_FILE; - - if (fs.existsSync(targetPath) && !overwrite) { - throw Utils.Errors.CANT_OVERRIDE; - } - Utils.writeFileTo(target, content, overwrite); - - return true; - }, - - /** - * Extracts the entire archive to the given location - * - * @param targetPath Target location - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - */ - extractAllTo : function(/*String*/targetPath, /*Boolean*/overwrite) { - overwrite = overwrite || false; - if (!_zip) { - throw Utils.Errors.NO_ZIP; - } - - _zip.entries.forEach(function(entry) { - if (entry.isDirectory) { - Utils.makeDir(pth.resolve(targetPath, entry.entryName.toString())); - return; - } - var content = entry.getData(); - if (!content) { - throw Utils.Errors.CANT_EXTRACT_FILE + "2"; - } - Utils.writeFileTo(pth.resolve(targetPath, entry.entryName.toString()), content, overwrite); - }) - }, - - /** - * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip - * - * @param targetFileName - * @param callback - */ - writeZip : function(/*String*/targetFileName, /*Function*/callback) { - if (arguments.length == 1) { - if (typeof targetFileName == "function") { - callback = targetFileName; - targetFileName = ""; - } - } - - if (!targetFileName && _filename) { - targetFileName = _filename; - } - if (!targetFileName) return; - - var zipData = _zip.compressToBuffer(); - if (zipData) { - Utils.writeFileTo(targetFileName, zipData, true); - } - }, - - /** - * Returns the content of the entire zip file as a Buffer object - * - * @return Buffer - */ - toBuffer : function(/*Function*/callback) { - this.valueOf = 2; - if (typeof callback == "function") { - _zip.toAsyncBuffer(callback); - return null; - } - return _zip.compressToBuffer() - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js deleted file mode 100644 index a29c70f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js +++ /dev/null @@ -1,261 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The central directory file header */ -module.exports = function () { - var _verMade = 0x0A, - _version = 0x0A, - _flags = 0, - _method = 0, - _time = 0, - _crc = 0, - _compressedSize = 0, - _size = 0, - _fnameLen = 0, - _extraLen = 0, - - _comLen = 0, - _diskStart = 0, - _inattr = 0, - _attr = 0, - _offset = 0; - - var _dataHeader = {}; - - function setTime(val) { - var val = new Date(val); - _time = (val.getFullYear() - 1980 & 0x7f) << 25 // b09-16 years from 1980 - | (val.getMonth() + 1) << 21 // b05-08 month - | val.getDay() << 16 // b00-04 hour - - // 2 bytes time - | val.getHours() << 11 // b11-15 hour - | val.getMinutes() << 5 // b05-10 minute - | val.getSeconds() >> 1; // b00-04 seconds divided by 2 - } - - setTime(+new Date()); - - return { - get made () { return _verMade; }, - set made (val) { _verMade = val; }, - - get version () { return _version; }, - set version (val) { _version = val }, - - get flags () { return _flags }, - set flags (val) { _flags = val; }, - - get method () { return _method; }, - set method (val) { _method = val; }, - - get time () { return new Date( - ((_time >> 25) & 0x7f) + 1980, - ((_time >> 21) & 0x0f) - 1, - (_time >> 16) & 0x1f, - (_time >> 11) & 0x1f, - (_time >> 5) & 0x3f, - (_time & 0x1f) << 1 - ); - }, - set time (val) { - setTime(val); - }, - - get crc () { return _crc; }, - set crc (val) { _crc = val; }, - - get compressedSize () { return _compressedSize; }, - set compressedSize (val) { _compressedSize = val; }, - - get size () { return _size; }, - set size (val) { _size = val; }, - - get fileNameLength () { return _fnameLen; }, - set fileNameLength (val) { _fnameLen = val; }, - - get extraLength () { return _extraLen }, - set extraLength (val) { _extraLen = val; }, - - get commentLength () { return _comLen }, - set commentLength (val) { _comLen = val }, - - get diskNumStart () { return _diskStart }, - set diskNumStart (val) { _diskStart = val }, - - get inAttr () { return _inattr }, - set inAttr (val) { _inattr = val }, - - get attr () { return _attr }, - set attr (val) { _attr = val }, - - get offset () { return _offset }, - set offset (val) { _offset = val }, - - get encripted () { return (_flags & 1) == 1 }, - - get entryHeaderSize () { - return Constants.CENHDR + _fnameLen + _extraLen + _comLen; - }, - - get realDataOffset () { - return _offset + Constants.LOCHDR + _dataHeader.fnameLen + _dataHeader.extraLen; - }, - - get dataHeader () { - return _dataHeader; - }, - - loadDataHeaderFromBinary : function(/*Buffer*/input) { - var data = input.slice(_offset, _offset + Constants.LOCHDR); - // 30 bytes and should start with "PK\003\004" - if (data.readUInt32LE(0) != Constants.LOCSIG) { - throw Utils.Errors.INVALID_LOC; - } - _dataHeader = { - // version needed to extract - version : data.readUInt16LE(Constants.LOCVER), - // general purpose bit flag - flags : data.readUInt16LE(Constants.LOCFLG), - // compression method - method : data.readUInt16LE(Constants.LOCHOW), - // modification time (2 bytes time, 2 bytes date) - time : data.readUInt32LE(Constants.LOCTIM), - // uncompressed file crc-32 value - crc : data.readUInt32LE(Constants.LOCCRC), - // compressed size - compressedSize : data.readUInt32LE(Constants.LOCSIZ), - // uncompressed size - size : data.readUInt32LE(Constants.LOCLEN), - // filename length - fnameLen : data.readUInt16LE(Constants.LOCNAM), - // extra field length - extraLen : data.readUInt16LE(Constants.LOCEXT) - } - }, - - loadFromBinary : function(/*Buffer*/data) { - // data should be 46 bytes and start with "PK 01 02" - if (data.length != Constants.CENHDR || data.readUInt32LE(0) != Constants.CENSIG) { - throw Utils.Errors.INVALID_CEN; - } - // version made by - _verMade = data.readUInt16LE(Constants.CENVEM); - // version needed to extract - _version = data.readUInt16LE(Constants.CENVER); - // encrypt, decrypt flags - _flags = data.readUInt16LE(Constants.CENFLG); - // compression method - _method = data.readUInt16LE(Constants.CENHOW); - // modification time (2 bytes time, 2 bytes date) - _time = data.readUInt32LE(Constants.CENTIM); - // uncompressed file crc-32 value - _crc = data.readUInt32LE(Constants.CENCRC); - // compressed size - _compressedSize = data.readUInt32LE(Constants.CENSIZ); - // uncompressed size - _size = data.readUInt32LE(Constants.CENLEN); - // filename length - _fnameLen = data.readUInt16LE(Constants.CENNAM); - // extra field length - _extraLen = data.readUInt16LE(Constants.CENEXT); - // file comment length - _comLen = data.readUInt16LE(Constants.CENCOM); - // volume number start - _diskStart = data.readUInt16LE(Constants.CENDSK); - // internal file attributes - _inattr = data.readUInt16LE(Constants.CENATT); - // external file attributes - _attr = data.readUInt32LE(Constants.CENATX); - // LOC header offset - _offset = data.readUInt32LE(Constants.CENOFF); - }, - - dataHeaderToBinary : function() { - // LOC header size (30 bytes) - var data = new Buffer(Constants.LOCHDR); - // "PK\003\004" - data.writeUInt32LE(Constants.LOCSIG, 0); - // version needed to extract - data.writeUInt16LE(_version, Constants.LOCVER); - // general purpose bit flag - data.writeUInt16LE(_flags, Constants.LOCFLG); - // compression method - data.writeUInt16LE(_method, Constants.LOCHOW); - // modification time (2 bytes time, 2 bytes date) - data.writeUInt32LE(_time, Constants.LOCTIM); - // uncompressed file crc-32 value - data.writeUInt32LE(_crc, Constants.LOCCRC); - // compressed size - data.writeUInt32LE(_compressedSize, Constants.LOCSIZ); - // uncompressed size - data.writeUInt32LE(_size, Constants.LOCLEN); - // filename length - data.writeUInt16LE(_fnameLen, Constants.LOCNAM); - // extra field length - data.writeUInt16LE(_extraLen, Constants.LOCEXT); - return data; - }, - - entryHeaderToBinary : function() { - // CEN header size (46 bytes) - var data = new Buffer(Constants.CENHDR + _fnameLen + _extraLen + _comLen); - // "PK\001\002" - data.writeUInt32LE(Constants.CENSIG, 0); - // version made by - data.writeUInt16LE(_verMade, Constants.CENVEM); - // version needed to extract - data.writeUInt16LE(_version, Constants.CENVER); - // encrypt, decrypt flags - data.writeUInt16LE(_flags, Constants.CENFLG); - // compression method - data.writeUInt16LE(_method, Constants.CENHOW); - // modification time (2 bytes time, 2 bytes date) - data.writeUInt32LE(_time, Constants.CENTIM); - // uncompressed file crc-32 value - data.writeInt32LE(_crc, Constants.CENCRC, true); - // compressed size - data.writeUInt32LE(_compressedSize, Constants.CENSIZ); - // uncompressed size - data.writeUInt32LE(_size, Constants.CENLEN); - // filename length - data.writeUInt16LE(_fnameLen, Constants.CENNAM); - // extra field length - data.writeUInt16LE(_extraLen, Constants.CENEXT); - // file comment length - data.writeUInt16LE(_comLen, Constants.CENCOM); - // volume number start - data.writeUInt16LE(_diskStart, Constants.CENDSK); - // internal file attributes - data.writeUInt16LE(_inattr, Constants.CENATT); - // external file attributes - data.writeUInt32LE(_attr, Constants.CENATX); - // LOC header offset - data.writeUInt32LE(_offset, Constants.CENOFF); - // fill all with - data.fill(0x00, Constants.CENHDR); - return data; - }, - - toString : function() { - return '{\n' + - '\t"made" : ' + _verMade + ",\n" + - '\t"version" : ' + _version + ",\n" + - '\t"flags" : ' + _flags + ",\n" + - '\t"method" : ' + Utils.methodToString(_method) + ",\n" + - '\t"time" : ' + _time + ",\n" + - '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" + - '\t"compressedSize" : ' + _compressedSize + " bytes,\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"fileNameLength" : ' + _fnameLen + ",\n" + - '\t"extraLength" : ' + _extraLen + " bytes,\n" + - '\t"commentLength" : ' + _comLen + " bytes,\n" + - '\t"diskNumStart" : ' + _diskStart + ",\n" + - '\t"inAttr" : ' + _inattr + ",\n" + - '\t"attr" : ' + _attr + ",\n" + - '\t"offset" : ' + _offset + ",\n" + - '\t"entryHeaderSize" : ' + (Constants.CENHDR + _fnameLen + _extraLen + _comLen) + " bytes\n" + - '}'; - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js deleted file mode 100644 index b8c67b9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.EntryHeader = require("./entryHeader"); -exports.MainHeader = require("./mainHeader"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js deleted file mode 100644 index 002bc8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js +++ /dev/null @@ -1,80 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The entries in the end of central directory */ -module.exports = function () { - var _volumeEntries = 0, - _totalEntries = 0, - _size = 0, - _offset = 0, - _commentLength = 0; - - return { - get diskEntries () { return _volumeEntries }, - set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; }, - - get totalEntries () { return _totalEntries }, - set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; }, - - get size () { return _size }, - set size (/*Number*/val) { _size = val; }, - - get offset () { return _offset }, - set offset (/*Number*/val) { _offset = val; }, - - get commentLength () { return _commentLength }, - set commentLength (/*Number*/val) { _commentLength = val; }, - - get mainHeaderSize () { - return Constants.ENDHDR + _commentLength; - }, - - loadFromBinary : function(/*Buffer*/data) { - // data should be 22 bytes and start with "PK 05 06" - if (data.length != Constants.ENDHDR || data.readUInt32LE(0) != Constants.ENDSIG) - throw Utils.Errors.INVALID_END; - - // number of entries on this volume - _volumeEntries = data.readUInt16LE(Constants.ENDSUB); - // total number of entries - _totalEntries = data.readUInt16LE(Constants.ENDTOT); - // central directory size in bytes - _size = data.readUInt32LE(Constants.ENDSIZ); - // offset of first CEN header - _offset = data.readUInt32LE(Constants.ENDOFF); - // zip file comment length - _commentLength = data.readUInt16LE(Constants.ENDCOM); - }, - - toBinary : function() { - var b = new Buffer(Constants.ENDHDR + _commentLength); - // "PK 05 06" signature - b.writeUInt32LE(Constants.ENDSIG, 0); - b.writeUInt32LE(0, 4); - // number of entries on this volume - b.writeUInt16LE(_volumeEntries, Constants.ENDSUB); - // total number of entries - b.writeUInt16LE(_totalEntries, Constants.ENDTOT); - // central directory size in bytes - b.writeUInt32LE(_size, Constants.ENDSIZ); - // offset of first CEN header - b.writeUInt32LE(_offset, Constants.ENDOFF); - // zip file comment length - b.writeUInt16LE(_commentLength, Constants.ENDCOM); - // fill comment memory with spaces so no garbage is left there - b.fill(" ", Constants.ENDHDR); - - return b; - }, - - toString : function() { - return '{\n' + - '\t"diskEntries" : ' + _volumeEntries + ",\n" + - '\t"totalEntries" : ' + _totalEntries + ",\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" + - '\t"commentLength" : 0x' + _commentLength + "\n" + - '}'; - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js deleted file mode 100644 index 70137b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * $Id: rawdeflate.js,v 0.5 2013/04/09 14:25:38 dankogai Exp dankogai $ - * - * GNU General Public License, version 2 (GPL-2.0) - * http://opensource.org/licenses/GPL-2.0 - * Original: - * http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt - */ -function JSDeflater(/*inbuff*/inbuf) { - - /* Copyright (C) 1999 Masanao Izumo - * Version: 1.0.1 - * LastModified: Dec 25 1999 - */ - - var WSIZE = 32768, // Sliding Window size - zip_STORED_BLOCK = 0, - zip_STATIC_TREES = 1, - zip_DYN_TREES = 2, - zip_DEFAULT_LEVEL = 6, - zip_FULL_SEARCH = true, - zip_INBUFSIZ = 32768, // Input buffer size - zip_INBUF_EXTRA = 64, // Extra buffer - zip_OUTBUFSIZ = 1024 * 8, - zip_window_size = 2 * WSIZE, - MIN_MATCH = 3, - MAX_MATCH = 258, - zip_BITS = 16, - LIT_BUFSIZE = 0x2000, - zip_HASH_BITS = 13, - zip_DIST_BUFSIZE = LIT_BUFSIZE, - zip_HASH_SIZE = 1 << zip_HASH_BITS, - zip_HASH_MASK = zip_HASH_SIZE - 1, - zip_WMASK = WSIZE - 1, - zip_NIL = 0, // Tail of hash chains - zip_TOO_FAR = 4096, - zip_MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, - zip_MAX_DIST = WSIZE - zip_MIN_LOOKAHEAD, - zip_SMALLEST = 1, - zip_MAX_BITS = 15, - zip_MAX_BL_BITS = 7, - zip_LENGTH_CODES = 29, - zip_LITERALS = 256, - zip_END_BLOCK = 256, - zip_L_CODES = zip_LITERALS + 1 + zip_LENGTH_CODES, - zip_D_CODES = 30, - zip_BL_CODES = 19, - zip_REP_3_6 = 16, - zip_REPZ_3_10 = 17, - zip_REPZ_11_138 = 18, - zip_HEAP_SIZE = 2 * zip_L_CODES + 1, - zip_H_SHIFT = parseInt((zip_HASH_BITS + MIN_MATCH - 1) / MIN_MATCH); - - var zip_free_queue, zip_qhead, zip_qtail, zip_initflag, zip_outbuf = null, zip_outcnt, zip_outoff, zip_complete, - zip_window, zip_d_buf, zip_l_buf, zip_prev, zip_bi_buf, zip_bi_valid, zip_block_start, zip_ins_h, zip_hash_head, - zip_prev_match, zip_match_available, zip_match_length, zip_prev_length, zip_strstart, zip_match_start, zip_eofile, - zip_lookahead, zip_max_chain_length, zip_max_lazy_match, zip_compr_level, zip_good_match, zip_nice_match, - zip_dyn_ltree, zip_dyn_dtree, zip_static_ltree, zip_static_dtree, zip_bl_tree, zip_l_desc, zip_d_desc, zip_bl_desc, - zip_bl_count, zip_heap, zip_heap_len, zip_heap_max, zip_depth, zip_length_code, zip_dist_code, zip_base_length, - zip_base_dist, zip_flag_buf, zip_last_lit, zip_last_dist, zip_last_flags, zip_flags, zip_flag_bit, zip_opt_len, - zip_static_len, zip_deflate_data, zip_deflate_pos; - - var zip_DeflateCT = function () { - this.fc = 0; // frequency count or bit string - this.dl = 0; // father node in Huffman tree or length of bit string - }; - - var zip_DeflateTreeDesc = function () { - this.dyn_tree = null; // the dynamic tree - this.static_tree = null; // corresponding static tree or NULL - this.extra_bits = null; // extra bits for each code or NULL - this.extra_base = 0; // base index for extra_bits - this.elems = 0; // max number of elements in the tree - this.max_length = 0; // max bit length for the codes - this.max_code = 0; // largest code with non zero frequency - }; - - /* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ - var zip_DeflateConfiguration = function (a, b, c, d) { - this.good_length = a; // reduce lazy search above this match length - this.max_lazy = b; // do not perform lazy search above this match length - this.nice_length = c; // quit search above this match length - this.max_chain = d; - }; - - var zip_DeflateBuffer = function () { - this.next = null; - this.len = 0; - this.ptr = new Array(zip_OUTBUFSIZ); - this.off = 0; - }; - - /* constant tables */ - var zip_extra_lbits = new Array( - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0); - var zip_extra_dbits = new Array( - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13); - var zip_extra_blbits = new Array( - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7); - var zip_bl_order = new Array( - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15); - var zip_configuration_table = new Array( - new zip_DeflateConfiguration(0, 0, 0, 0), - new zip_DeflateConfiguration(4, 4, 8, 4), - new zip_DeflateConfiguration(4, 5, 16, 8), - new zip_DeflateConfiguration(4, 6, 32, 32), - new zip_DeflateConfiguration(4, 4, 16, 16), - new zip_DeflateConfiguration(8, 16, 32, 32), - new zip_DeflateConfiguration(8, 16, 128, 128), - new zip_DeflateConfiguration(8, 32, 128, 256), - new zip_DeflateConfiguration(32, 128, 258, 1024), - new zip_DeflateConfiguration(32, 258, 258, 4096)); - - - /* routines (deflate) */ - - var zip_deflate_start = function (level) { - var i; - - if (!level) - level = zip_DEFAULT_LEVEL; - else if (level < 1) - level = 1; - else if (level > 9) - level = 9; - - zip_compr_level = level; - zip_initflag = false; - zip_eofile = false; - if (zip_outbuf != null) - return; - - zip_free_queue = zip_qhead = zip_qtail = null; - zip_outbuf = new Array(zip_OUTBUFSIZ); - zip_window = new Array(zip_window_size); - zip_d_buf = new Array(zip_DIST_BUFSIZE); - zip_l_buf = new Array(zip_INBUFSIZ + zip_INBUF_EXTRA); - zip_prev = new Array(1 << zip_BITS); - zip_dyn_ltree = new Array(zip_HEAP_SIZE); - for (i = 0; i < zip_HEAP_SIZE; i++) zip_dyn_ltree[i] = new zip_DeflateCT(); - zip_dyn_dtree = new Array(2 * zip_D_CODES + 1); - for (i = 0; i < 2 * zip_D_CODES + 1; i++) zip_dyn_dtree[i] = new zip_DeflateCT(); - zip_static_ltree = new Array(zip_L_CODES + 2); - for (i = 0; i < zip_L_CODES + 2; i++) zip_static_ltree[i] = new zip_DeflateCT(); - zip_static_dtree = new Array(zip_D_CODES); - for (i = 0; i < zip_D_CODES; i++) zip_static_dtree[i] = new zip_DeflateCT(); - zip_bl_tree = new Array(2 * zip_BL_CODES + 1); - for (i = 0; i < 2 * zip_BL_CODES + 1; i++) zip_bl_tree[i] = new zip_DeflateCT(); - zip_l_desc = new zip_DeflateTreeDesc(); - zip_d_desc = new zip_DeflateTreeDesc(); - zip_bl_desc = new zip_DeflateTreeDesc(); - zip_bl_count = new Array(zip_MAX_BITS + 1); - zip_heap = new Array(2 * zip_L_CODES + 1); - zip_depth = new Array(2 * zip_L_CODES + 1); - zip_length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zip_dist_code = new Array(512); - zip_base_length = new Array(zip_LENGTH_CODES); - zip_base_dist = new Array(zip_D_CODES); - zip_flag_buf = new Array(parseInt(LIT_BUFSIZE / 8)); - }; - - var zip_deflate_end = function () { - zip_free_queue = zip_qhead = zip_qtail = null; - zip_outbuf = null; - zip_window = null; - zip_d_buf = null; - zip_l_buf = null; - zip_prev = null; - zip_dyn_ltree = null; - zip_dyn_dtree = null; - zip_static_ltree = null; - zip_static_dtree = null; - zip_bl_tree = null; - zip_l_desc = null; - zip_d_desc = null; - zip_bl_desc = null; - zip_bl_count = null; - zip_heap = null; - zip_depth = null; - zip_length_code = null; - zip_dist_code = null; - zip_base_length = null; - zip_base_dist = null; - zip_flag_buf = null; - }; - - var zip_reuse_queue = function (p) { - p.next = zip_free_queue; - zip_free_queue = p; - }; - - var zip_new_queue = function () { - var p; - - if (zip_free_queue != null) { - p = zip_free_queue; - zip_free_queue = zip_free_queue.next; - } - else - p = new zip_DeflateBuffer(); - p.next = null; - p.len = p.off = 0; - - return p; - }; - - var zip_head1 = function (i) { - return zip_prev[WSIZE + i]; - }; - - var zip_head2 = function (i, val) { - return zip_prev[WSIZE + i] = val; - }; - - /* put_byte is used for the compressed output, put_ubyte for the - * uncompressed output. However unlzw() uses window for its - * suffix table instead of its output buffer, so it does not use put_ubyte - * (to be cleaned up). - */ - var zip_put_byte = function (c) { - zip_outbuf[zip_outoff + zip_outcnt++] = c; - if (zip_outoff + zip_outcnt == zip_OUTBUFSIZ) - zip_qoutbuf(); - }; - - /* Output a 16 bit value, lsb first */ - var zip_put_short = function (w) { - w &= 0xffff; - if (zip_outoff + zip_outcnt < zip_OUTBUFSIZ - 2) { - zip_outbuf[zip_outoff + zip_outcnt++] = (w & 0xff); - zip_outbuf[zip_outoff + zip_outcnt++] = (w >>> 8); - } else { - zip_put_byte(w & 0xff); - zip_put_byte(w >>> 8); - } - }; - - /* ========================================================================== - * Insert string s in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of s are valid - * (except for the last MIN_MATCH-1 bytes of the input file). - */ - var zip_INSERT_STRING = function () { - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) - ^ (zip_window[zip_strstart + MIN_MATCH - 1] & 0xff)) - & zip_HASH_MASK; - zip_hash_head = zip_head1(zip_ins_h); - zip_prev[zip_strstart & zip_WMASK] = zip_hash_head; - zip_head2(zip_ins_h, zip_strstart); - }; - - /* Send a code of the given tree. c and tree must not have side effects */ - var zip_SEND_CODE = function (c, tree) { - zip_send_bits(tree[c].fc, tree[c].dl); - }; - - /* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. dist_code[256] and dist_code[257] are never - * used. - */ - var zip_D_CODE = function (dist) { - return (dist < 256 ? zip_dist_code[dist] - : zip_dist_code[256 + (dist >> 7)]) & 0xff; - }; - - /* ========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ - var zip_SMALLER = function (tree, n, m) { - return tree[n].fc < tree[m].fc || - (tree[n].fc == tree[m].fc && zip_depth[n] <= zip_depth[m]); - }; - - /* ========================================================================== - * read string data - */ - var zip_read_buff = function (buff, offset, n) { - var i; - for (i = 0; i < n && zip_deflate_pos < zip_deflate_data.length; i++) - buff[offset + i] = - zip_deflate_data[zip_deflate_pos++] & 0xff; - return i; - }; - - /* ========================================================================== - * Initialize the "longest match" routines for a new file - */ - var zip_lm_init = function () { - var j; - - /* Initialize the hash table. */ - for (j = 0; j < zip_HASH_SIZE; j++) - zip_prev[WSIZE + j] = 0; - zip_max_lazy_match = zip_configuration_table[zip_compr_level].max_lazy; - zip_good_match = zip_configuration_table[zip_compr_level].good_length; - if (!zip_FULL_SEARCH) - zip_nice_match = zip_configuration_table[zip_compr_level].nice_length; - zip_max_chain_length = zip_configuration_table[zip_compr_level].max_chain; - - zip_strstart = 0; - zip_block_start = 0; - - zip_lookahead = zip_read_buff(zip_window, 0, 2 * WSIZE); - if (zip_lookahead <= 0) { - zip_eofile = true; - zip_lookahead = 0; - return; - } - zip_eofile = false; - /* Make sure that we always have enough lookahead. This is important - * if input comes from a device such as a tty. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - - /* If lookahead < MIN_MATCH, ins_h is garbage, but this is - * not important since only literal bytes will be emitted. - */ - zip_ins_h = 0; - for (j = 0; j < MIN_MATCH - 1; j++) { - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[j] & 0xff)) & zip_HASH_MASK; - } - }; - - /* ========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - */ - var zip_longest_match = function (cur_match) { - var chain_length = zip_max_chain_length; // max hash chain length - var scanp = zip_strstart; // current string - var matchp; // matched string - var len; // length of current match - var best_len = zip_prev_length; // best match length so far - - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - var limit = (zip_strstart > zip_MAX_DIST ? zip_strstart - zip_MAX_DIST : zip_NIL); - - var strendp = zip_strstart + MAX_MATCH; - var scan_end1 = zip_window[scanp + best_len - 1]; - var scan_end = zip_window[scanp + best_len]; - - /* Do not waste too much time if we already have a good match: */ - if (zip_prev_length >= zip_good_match) - chain_length >>= 2; - - do { - matchp = cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2: - */ - if (zip_window[matchp + best_len] != scan_end || - zip_window[matchp + best_len - 1] != scan_end1 || - zip_window[matchp] != zip_window[scanp] || - zip_window[++matchp] != zip_window[scanp + 1]) { - continue; - } - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scanp += 2; - matchp++; - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - scanp < strendp); - - len = MAX_MATCH - (strendp - scanp); - scanp = strendp - MAX_MATCH; - - if (len > best_len) { - zip_match_start = cur_match; - best_len = len; - if (zip_FULL_SEARCH) { - if (len >= MAX_MATCH) break; - } else { - if (len >= zip_nice_match) break; - } - - scan_end1 = zip_window[scanp + best_len - 1]; - scan_end = zip_window[scanp + best_len]; - } - } while ((cur_match = zip_prev[cur_match & zip_WMASK]) > limit - && --chain_length != 0); - - return best_len; - }; - - /* ========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead, and sets eofile if end of input file. - * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0 - * OUT assertions: at least one byte has been read, or eofile is set; - * file reads are performed for at least two bytes (required for the - * translate_eol option). - */ - var zip_fill_window = function () { - var n, m; - - // Amount of free space at the end of the window. - var more = zip_window_size - zip_lookahead - zip_strstart; - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (more == -1) { - /* Very unlikely, but possible on 16 bit machine if strstart == 0 - * and lookahead == 1 (input done one byte at time) - */ - more--; - } else if (zip_strstart >= WSIZE + zip_MAX_DIST) { - /* By the IN assertion, the window is not empty so we can't confuse - * more == 0 with more == 64K on a 16 bit machine. - */ - for (n = 0; n < WSIZE; n++) - zip_window[n] = zip_window[n + WSIZE]; - - zip_match_start -= WSIZE; - zip_strstart -= WSIZE; - /* we now have strstart >= MAX_DIST: */ - zip_block_start -= WSIZE; - - for (n = 0; n < zip_HASH_SIZE; n++) { - m = zip_head1(n); - zip_head2(n, m >= WSIZE ? m - WSIZE : zip_NIL); - } - for (n = 0; n < WSIZE; n++) { - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - m = zip_prev[n]; - zip_prev[n] = (m >= WSIZE ? m - WSIZE : zip_NIL); - } - more += WSIZE; - } - // At this point, more >= 2 - if (!zip_eofile) { - n = zip_read_buff(zip_window, zip_strstart + zip_lookahead, more); - if (n <= 0) - zip_eofile = true; - else - zip_lookahead += n; - } - }; - - /* ========================================================================== - * Processes a new input file and return its compressed length. This - * function does not perform lazy evaluationof matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ - var zip_deflate_fast = function () { - while (zip_lookahead != 0 && zip_qhead == null) { - var flush; // set if current block must be flushed - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - zip_INSERT_STRING(); - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (zip_hash_head != zip_NIL && - zip_strstart - zip_hash_head <= zip_MAX_DIST) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - zip_match_length = zip_longest_match(zip_hash_head); - /* longest_match() sets match_start */ - if (zip_match_length > zip_lookahead) - zip_match_length = zip_lookahead; - } - if (zip_match_length >= MIN_MATCH) { - flush = zip_ct_tally(zip_strstart - zip_match_start, - zip_match_length - MIN_MATCH); - zip_lookahead -= zip_match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ - if (zip_match_length <= zip_max_lazy_match) { - zip_match_length--; // string at strstart already in hash table - do { - zip_strstart++; - zip_INSERT_STRING(); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH - * these bytes are garbage, but it does not matter since - * the next lookahead bytes will be emitted as literals. - */ - } while (--zip_match_length != 0); - zip_strstart++; - } else { - zip_strstart += zip_match_length; - zip_match_length = 0; - zip_ins_h = zip_window[zip_strstart] & 0xff; - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[zip_strstart + 1] & 0xff)) & zip_HASH_MASK; - } - } else { - /* No match, output a literal byte */ - flush = zip_ct_tally(0, zip_window[zip_strstart] & 0xff); - zip_lookahead--; - zip_strstart++; - } - if (flush) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - } - }; - - var zip_deflate_better = function () { - /* Process the input block. */ - while (zip_lookahead != 0 && zip_qhead == null) { - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - zip_INSERT_STRING(); - - /* Find the longest match, discarding those <= prev_length. - */ - zip_prev_length = zip_match_length; - zip_prev_match = zip_match_start; - zip_match_length = MIN_MATCH - 1; - - if (zip_hash_head != zip_NIL && - zip_prev_length < zip_max_lazy_match && - zip_strstart - zip_hash_head <= zip_MAX_DIST) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - zip_match_length = zip_longest_match(zip_hash_head); - /* longest_match() sets match_start */ - if (zip_match_length > zip_lookahead) - zip_match_length = zip_lookahead; - - /* Ignore a length 3 match if it is too distant: */ - if (zip_match_length == MIN_MATCH && - zip_strstart - zip_match_start > zip_TOO_FAR) { - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - zip_match_length--; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (zip_prev_length >= MIN_MATCH && - zip_match_length <= zip_prev_length) { - var flush; // set if current block must be flushed - flush = zip_ct_tally(zip_strstart - 1 - zip_prev_match, - zip_prev_length - MIN_MATCH); - - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. - */ - zip_lookahead -= zip_prev_length - 1; - zip_prev_length -= 2; - do { - zip_strstart++; - zip_INSERT_STRING(); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH - * these bytes are garbage, but it does not matter since the - * next lookahead bytes will always be emitted as literals. - */ - } while (--zip_prev_length != 0); - zip_match_available = 0; - zip_match_length = MIN_MATCH - 1; - zip_strstart++; - if (flush) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - } else if (zip_match_available != 0) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - if (zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff)) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - zip_strstart++; - zip_lookahead--; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - zip_match_available = 1; - zip_strstart++; - zip_lookahead--; - } - - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - } - }; - - var zip_init_deflate = function () { - if (zip_eofile) - return; - zip_bi_buf = 0; - zip_bi_valid = 0; - zip_ct_init(); - zip_lm_init(); - - zip_qhead = null; - zip_outcnt = 0; - zip_outoff = 0; - zip_match_available = 0; - - if (zip_compr_level <= 3) { - zip_prev_length = MIN_MATCH - 1; - zip_match_length = 0; - } - else { - zip_match_length = MIN_MATCH - 1; - zip_match_available = 0; - zip_match_available = 0; - } - - zip_complete = false; - }; - - /* ========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ - var zip_deflate_internal = function (buff, off, buff_size) { - var n; - - if (!zip_initflag) { - zip_init_deflate(); - zip_initflag = true; - if (zip_lookahead == 0) { // empty - zip_complete = true; - return 0; - } - } - - if ((n = zip_qcopy(buff, off, buff_size)) == buff_size) - return buff_size; - - if (zip_complete) - return n; - - if (zip_compr_level <= 3) // optimized for speed - zip_deflate_fast(); - else - zip_deflate_better(); - if (zip_lookahead == 0) { - if (zip_match_available != 0) - zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff); - zip_flush_block(1); - zip_complete = true; - } - return n + zip_qcopy(buff, n + off, buff_size - n); - }; - - var zip_qcopy = function (buff, off, buff_size) { - var n, i, j; - - n = 0; - while (zip_qhead != null && n < buff_size) { - i = buff_size - n; - if (i > zip_qhead.len) - i = zip_qhead.len; - for (j = 0; j < i; j++) - buff[off + n + j] = zip_qhead.ptr[zip_qhead.off + j]; - - zip_qhead.off += i; - zip_qhead.len -= i; - n += i; - if (zip_qhead.len == 0) { - var p; - p = zip_qhead; - zip_qhead = zip_qhead.next; - zip_reuse_queue(p); - } - } - - if (n == buff_size) - return n; - - if (zip_outoff < zip_outcnt) { - i = buff_size - n; - if (i > zip_outcnt - zip_outoff) - i = zip_outcnt - zip_outoff; - // System.arraycopy(outbuf, outoff, buff, off + n, i); - for (j = 0; j < i; j++) - buff[off + n + j] = zip_outbuf[zip_outoff + j]; - zip_outoff += i; - n += i; - if (zip_outcnt == zip_outoff) - zip_outcnt = zip_outoff = 0; - } - return n; - }; - - /* ========================================================================== - * Allocate the match buffer, initialize the various tables and save the - * location of the internal file attribute (ascii/binary) and method - * (DEFLATE/STORE). - */ - var zip_ct_init = function () { - var n; // iterates over tree elements - var bits; // bit counter - var length; // length value - var code; // code value - var dist; // distance index - - if (zip_static_dtree[0].dl != 0) return; // ct_init already called - - zip_l_desc.dyn_tree = zip_dyn_ltree; - zip_l_desc.static_tree = zip_static_ltree; - zip_l_desc.extra_bits = zip_extra_lbits; - zip_l_desc.extra_base = zip_LITERALS + 1; - zip_l_desc.elems = zip_L_CODES; - zip_l_desc.max_length = zip_MAX_BITS; - zip_l_desc.max_code = 0; - - zip_d_desc.dyn_tree = zip_dyn_dtree; - zip_d_desc.static_tree = zip_static_dtree; - zip_d_desc.extra_bits = zip_extra_dbits; - zip_d_desc.extra_base = 0; - zip_d_desc.elems = zip_D_CODES; - zip_d_desc.max_length = zip_MAX_BITS; - zip_d_desc.max_code = 0; - - zip_bl_desc.dyn_tree = zip_bl_tree; - zip_bl_desc.static_tree = null; - zip_bl_desc.extra_bits = zip_extra_blbits; - zip_bl_desc.extra_base = 0; - zip_bl_desc.elems = zip_BL_CODES; - zip_bl_desc.max_length = zip_MAX_BL_BITS; - zip_bl_desc.max_code = 0; - - // Initialize the mapping length (0..255) -> length code (0..28) - length = 0; - for (code = 0; code < zip_LENGTH_CODES - 1; code++) { - zip_base_length[code] = length; - for (n = 0; n < (1 << zip_extra_lbits[code]); n++) - zip_length_code[length++] = code; - } - /* Note that the length 255 (match length 258) can be represented - * in two different ways: code 284 + 5 bits or code 285, so we - * overwrite length_code[255] to use the best encoding: - */ - zip_length_code[length - 1] = code; - - /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ - dist = 0; - for (code = 0; code < 16; code++) { - zip_base_dist[code] = dist; - for (n = 0; n < (1 << zip_extra_dbits[code]); n++) { - zip_dist_code[dist++] = code; - } - } - dist >>= 7; // from now on, all distances are divided by 128 - for (; code < zip_D_CODES; code++) { - zip_base_dist[code] = dist << 7; - for (n = 0; n < (1 << (zip_extra_dbits[code] - 7)); n++) - zip_dist_code[256 + dist++] = code; - } - // Construct the codes of the static literal tree - for (bits = 0; bits <= zip_MAX_BITS; bits++) - zip_bl_count[bits] = 0; - n = 0; - while (n <= 143) { - zip_static_ltree[n++].dl = 8; - zip_bl_count[8]++; - } - while (n <= 255) { - zip_static_ltree[n++].dl = 9; - zip_bl_count[9]++; - } - while (n <= 279) { - zip_static_ltree[n++].dl = 7; - zip_bl_count[7]++; - } - while (n <= 287) { - zip_static_ltree[n++].dl = 8; - zip_bl_count[8]++; - } - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - zip_gen_codes(zip_static_ltree, zip_L_CODES + 1); - - /* The static distance tree is trivial: */ - for (n = 0; n < zip_D_CODES; n++) { - zip_static_dtree[n].dl = 5; - zip_static_dtree[n].fc = zip_bi_reverse(n, 5); - } - - // Initialize the first block of the first file: - zip_init_block(); - }; - - /* ========================================================================== - * Initialize a new block. - */ - var zip_init_block = function () { - var n; // iterates over tree elements - - // Initialize the trees. - for (n = 0; n < zip_L_CODES; n++) zip_dyn_ltree[n].fc = 0; - for (n = 0; n < zip_D_CODES; n++) zip_dyn_dtree[n].fc = 0; - for (n = 0; n < zip_BL_CODES; n++) zip_bl_tree[n].fc = 0; - - zip_dyn_ltree[zip_END_BLOCK].fc = 1; - zip_opt_len = zip_static_len = 0; - zip_last_lit = zip_last_dist = zip_last_flags = 0; - zip_flags = 0; - zip_flag_bit = 1; - }; - - /* ========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ - var zip_pqdownheap = function (tree, // the tree to restore - k) { // node to move down - var v = zip_heap[k]; - var j = k << 1; // left son of k - - while (j <= zip_heap_len) { - // Set j to the smallest of the two sons: - if (j < zip_heap_len && - zip_SMALLER(tree, zip_heap[j + 1], zip_heap[j])) - j++; - - // Exit if v is smaller than both sons - if (zip_SMALLER(tree, v, zip_heap[j])) - break; - - // Exchange v with the smallest son - zip_heap[k] = zip_heap[j]; - k = j; - - // And continue down the tree, setting j to the left son of k - j <<= 1; - } - zip_heap[k] = v; - }; - - /* ========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ - var zip_gen_bitlen = function (desc) { // the tree descriptor - var tree = desc.dyn_tree; - var extra = desc.extra_bits; - var base = desc.extra_base; - var max_code = desc.max_code; - var max_length = desc.max_length; - var stree = desc.static_tree; - var h; // heap index - var n, m; // iterate over the tree elements - var bits; // bit length - var xbits; // extra bits - var f; // frequency - var overflow = 0; // number of elements with bit length too large - - for (bits = 0; bits <= zip_MAX_BITS; bits++) - zip_bl_count[bits] = 0; - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[zip_heap[zip_heap_max]].dl = 0; // root of the heap - - for (h = zip_heap_max + 1; h < zip_HEAP_SIZE; h++) { - n = zip_heap[h]; - bits = tree[tree[n].dl].dl + 1; - if (bits > max_length) { - bits = max_length; - overflow++; - } - tree[n].dl = bits; - // We overwrite tree[n].dl which is no longer needed - - if (n > max_code) - continue; // not a leaf node - - zip_bl_count[bits]++; - xbits = 0; - if (n >= base) - xbits = extra[n - base]; - f = tree[n].fc; - zip_opt_len += f * (bits + xbits); - if (stree != null) - zip_static_len += f * (stree[n].dl + xbits); - } - if (overflow == 0) - return; - - // This happens for example on obj2 and pic of the Calgary corpus - - // Find the first bit length which could increase: - do { - bits = max_length - 1; - while (zip_bl_count[bits] == 0) - bits--; - zip_bl_count[bits]--; // move one leaf down the tree - zip_bl_count[bits + 1] += 2; // move one overflow item as its brother - zip_bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits != 0; bits--) { - n = zip_bl_count[bits]; - while (n != 0) { - m = zip_heap[--h]; - if (m > max_code) - continue; - if (tree[m].dl != bits) { - zip_opt_len += (bits - tree[m].dl) * tree[m].fc; - tree[m].fc = bits; - } - n--; - } - } - }; - - /* ========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ - var zip_gen_codes = function (tree, // the tree to decorate - max_code) { // largest code with non zero frequency - var next_code = new Array(zip_MAX_BITS + 1); // next code value for each bit length - var code = 0; // running code value - var bits; // bit index - var n; // code index - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= zip_MAX_BITS; bits++) { - code = ((code + zip_bl_count[bits - 1]) << 1); - next_code[bits] = code; - } - - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - for (n = 0; n <= max_code; n++) { - var len = tree[n].dl; - if (len == 0) - continue; - // Now reverse the bits - tree[n].fc = zip_bi_reverse(next_code[len]++, len); - } - }; - - /* ========================================================================== - * Construct one Huffman tree and assigns the code bit strings and lengths. - * Update the total bit length for the current block. - * IN assertion: the field freq is set for all tree elements. - * OUT assertions: the fields len and code are set to the optimal bit length - * and corresponding code. The length opt_len is updated; static_len is - * also updated if stree is not null. The field max_code is set. - */ - var zip_build_tree = function (desc) { // the tree descriptor - var tree = desc.dyn_tree; - var stree = desc.static_tree; - var elems = desc.elems; - var n, m; // iterate over heap elements - var max_code = -1; // largest code with non zero frequency - var node = elems; // next internal node of the tree - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - zip_heap_len = 0; - zip_heap_max = zip_HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n].fc != 0) { - zip_heap[++zip_heap_len] = max_code = n; - zip_depth[n] = 0; - } else - tree[n].dl = 0; - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (zip_heap_len < 2) { - var xnew = zip_heap[++zip_heap_len] = (max_code < 2 ? ++max_code : 0); - tree[xnew].fc = 1; - zip_depth[xnew] = 0; - zip_opt_len--; - if (stree != null) - zip_static_len -= stree[xnew].dl; - // new is 0 or 1 so it does not have extra bits - } - desc.max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = zip_heap_len >> 1; n >= 1; n--) - zip_pqdownheap(tree, n); - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - do { - n = zip_heap[zip_SMALLEST]; - zip_heap[zip_SMALLEST] = zip_heap[zip_heap_len--]; - zip_pqdownheap(tree, zip_SMALLEST); - - m = zip_heap[zip_SMALLEST]; // m = node of next least frequency - - // keep the nodes sorted by frequency - zip_heap[--zip_heap_max] = n; - zip_heap[--zip_heap_max] = m; - - // Create a new node father of n and m - tree[node].fc = tree[n].fc + tree[m].fc; - if (zip_depth[n] > zip_depth[m] + 1) - zip_depth[node] = zip_depth[n]; - else - zip_depth[node] = zip_depth[m] + 1; - tree[n].dl = tree[m].dl = node; - - // and insert the new node in the heap - zip_heap[zip_SMALLEST] = node++; - zip_pqdownheap(tree, zip_SMALLEST); - - } while (zip_heap_len >= 2); - - zip_heap[--zip_heap_max] = zip_heap[zip_SMALLEST]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - zip_gen_bitlen(desc); - - // The field len is now set, we can generate the bit codes - zip_gen_codes(tree, max_code); - }; - - /* ========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. Updates opt_len to take into account the repeat - * counts. (The contribution of the bit length codes will be added later - * during the construction of bl_tree.) - */ - var zip_scan_tree = function (tree,// the tree to be scanned - max_code) { // and its largest code of non zero frequency - var n; // iterates over all tree elements - var prevlen = -1; // last emitted length - var curlen; // length of current code - var nextlen = tree[0].dl; // length of next code - var count = 0; // repeat count of the current code - var max_count = 7; // max repeat count - var min_count = 4; // min repeat count - - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } - tree[max_code + 1].dl = 0xffff; // guard - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - if (++count < max_count && curlen == nextlen) - continue; - else if (count < min_count) - zip_bl_tree[curlen].fc += count; - else if (curlen != 0) { - if (curlen != prevlen) - zip_bl_tree[curlen].fc++; - zip_bl_tree[zip_REP_3_6].fc++; - } else if (count <= 10) - zip_bl_tree[zip_REPZ_3_10].fc++; - else - zip_bl_tree[zip_REPZ_11_138].fc++; - count = 0; - prevlen = curlen; - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } else if (curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - }; - - /* ========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ - var zip_send_tree = function (tree, // the tree to be scanned - max_code) { // and its largest code of non zero frequency - var n; // iterates over all tree elements - var prevlen = -1; // last emitted length - var curlen; // length of current code - var nextlen = tree[0].dl; // length of next code - var count = 0; // repeat count of the current code - var max_count = 7; // max repeat count - var min_count = 4; // min repeat count - - /* tree[max_code+1].dl = -1; */ - /* guard already set */ - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { - zip_SEND_CODE(curlen, zip_bl_tree); - } while (--count != 0); - } else if (curlen != 0) { - if (curlen != prevlen) { - zip_SEND_CODE(curlen, zip_bl_tree); - count--; - } - // Assert(count >= 3 && count <= 6, " 3_6?"); - zip_SEND_CODE(zip_REP_3_6, zip_bl_tree); - zip_send_bits(count - 3, 2); - } else if (count <= 10) { - zip_SEND_CODE(zip_REPZ_3_10, zip_bl_tree); - zip_send_bits(count - 3, 3); - } else { - zip_SEND_CODE(zip_REPZ_11_138, zip_bl_tree); - zip_send_bits(count - 11, 7); - } - count = 0; - prevlen = curlen; - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } else if (curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - }; - - /* ========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ - var zip_build_bl_tree = function () { - var max_blindex; // index of last bit length code of non zero freq - - // Determine the bit length frequencies for literal and distance trees - zip_scan_tree(zip_dyn_ltree, zip_l_desc.max_code); - zip_scan_tree(zip_dyn_dtree, zip_d_desc.max_code); - - // Build the bit length tree: - zip_build_tree(zip_bl_desc); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = zip_BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (zip_bl_tree[zip_bl_order[max_blindex]].dl != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - zip_opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - return max_blindex; - }; - - /* ========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ - var zip_send_all_trees = function (lcodes, dcodes, blcodes) { // number of codes for each tree - var rank; // index in bl_order - zip_send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt - zip_send_bits(dcodes - 1, 5); - zip_send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt - for (rank = 0; rank < blcodes; rank++) { - zip_send_bits(zip_bl_tree[zip_bl_order[rank]].dl, 3); - } - - // send the literal tree - zip_send_tree(zip_dyn_ltree, lcodes - 1); - - // send the distance tree - zip_send_tree(zip_dyn_dtree, dcodes - 1); - }; - - /* ========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ - var zip_flush_block = function (eof) { // true if this is the last block for a file - var opt_lenb, static_lenb; // opt_len and static_len in bytes - var max_blindex; // index of last bit length code of non zero freq - var stored_len; // length of input block - - stored_len = zip_strstart - zip_block_start; - zip_flag_buf[zip_last_flags] = zip_flags; // Save the flags for the last 8 items - - // Construct the literal and distance trees - zip_build_tree(zip_l_desc); - zip_build_tree(zip_d_desc); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = zip_build_bl_tree(); - - // Determine the best encoding. Compute first the block length in bytes - opt_lenb = (zip_opt_len + 3 + 7) >> 3; - static_lenb = (zip_static_len + 3 + 7) >> 3; - if (static_lenb <= opt_lenb) - opt_lenb = static_lenb; - if (stored_len + 4 <= opt_lenb // 4: two words for the lengths - && zip_block_start >= 0) { - var i; - - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - zip_send_bits((zip_STORED_BLOCK << 1) + eof, 3); - /* send block type */ - zip_bi_windup(); - /* align on byte boundary */ - zip_put_short(stored_len); - zip_put_short(~stored_len); - - // copy block - for (i = 0; i < stored_len; i++) - zip_put_byte(zip_window[zip_block_start + i]); - - } else if (static_lenb == opt_lenb) { - zip_send_bits((zip_STATIC_TREES << 1) + eof, 3); - zip_compress_block(zip_static_ltree, zip_static_dtree); - } else { - zip_send_bits((zip_DYN_TREES << 1) + eof, 3); - zip_send_all_trees(zip_l_desc.max_code + 1, - zip_d_desc.max_code + 1, - max_blindex + 1); - zip_compress_block(zip_dyn_ltree, zip_dyn_dtree); - } - - zip_init_block(); - - if (eof != 0) - zip_bi_windup(); - }; - - /* ========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ - var zip_ct_tally = function (dist, // distance of matched string - lc) { // match length-MIN_MATCH or unmatched char (if dist==0) - zip_l_buf[zip_last_lit++] = lc; - if (dist == 0) { - // lc is the unmatched char - zip_dyn_ltree[lc].fc++; - } else { - // Here, lc is the match length - MIN_MATCH - dist--; // dist = match distance - 1 - zip_dyn_ltree[zip_length_code[lc] + zip_LITERALS + 1].fc++; - zip_dyn_dtree[zip_D_CODE(dist)].fc++; - - zip_d_buf[zip_last_dist++] = dist; - zip_flags |= zip_flag_bit; - } - zip_flag_bit <<= 1; - - // Output the flags if they fill a byte - if ((zip_last_lit & 7) == 0) { - zip_flag_buf[zip_last_flags++] = zip_flags; - zip_flags = 0; - zip_flag_bit = 1; - } - // Try to guess if it is profitable to stop the current block here - if (zip_compr_level > 2 && (zip_last_lit & 0xfff) == 0) { - // Compute an upper bound for the compressed length - var out_length = zip_last_lit * 8; - var in_length = zip_strstart - zip_block_start; - var dcode; - - for (dcode = 0; dcode < zip_D_CODES; dcode++) { - out_length += zip_dyn_dtree[dcode].fc * (5 + zip_extra_dbits[dcode]); - } - out_length >>= 3; - if (zip_last_dist < parseInt(zip_last_lit / 2) && - out_length < parseInt(in_length / 2)) - return true; - } - return (zip_last_lit == LIT_BUFSIZE - 1 || - zip_last_dist == zip_DIST_BUFSIZE); - /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ - }; - - /* ========================================================================== - * Send the block data compressed using the given Huffman trees - */ - var zip_compress_block = function (ltree, // literal tree - dtree) { // distance tree - var dist; // distance of matched string - var lc; // match length or unmatched char (if dist == 0) - var lx = 0; // running index in l_buf - var dx = 0; // running index in d_buf - var fx = 0; // running index in flag_buf - var flag = 0; // current flags - var code; // the code to send - var extra; // number of extra bits to send - - if (zip_last_lit != 0) do { - if ((lx & 7) == 0) - flag = zip_flag_buf[fx++]; - lc = zip_l_buf[lx++] & 0xff; - if ((flag & 1) == 0) { - zip_SEND_CODE(lc, ltree); - /* send a literal byte */ - } else { - // Here, lc is the match length - MIN_MATCH - code = zip_length_code[lc]; - zip_SEND_CODE(code + zip_LITERALS + 1, ltree); // send the length code - extra = zip_extra_lbits[code]; - if (extra != 0) { - lc -= zip_base_length[code]; - zip_send_bits(lc, extra); // send the extra length bits - } - dist = zip_d_buf[dx++]; - // Here, dist is the match distance - 1 - code = zip_D_CODE(dist); - zip_SEND_CODE(code, dtree); // send the distance code - extra = zip_extra_dbits[code]; - if (extra != 0) { - dist -= zip_base_dist[code]; - zip_send_bits(dist, extra); // send the extra distance bits - } - } // literal or match pair ? - flag >>= 1; - } while (lx < zip_last_lit); - - zip_SEND_CODE(zip_END_BLOCK, ltree); - }; - - /* ========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ - var zip_Buf_size = 16; // bit size of bi_buf - var zip_send_bits = function (value, // value to send - length) { // number of bits - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) - * unused bits in value. - */ - if (zip_bi_valid > zip_Buf_size - length) { - zip_bi_buf |= (value << zip_bi_valid); - zip_put_short(zip_bi_buf); - zip_bi_buf = (value >> (zip_Buf_size - zip_bi_valid)); - zip_bi_valid += length - zip_Buf_size; - } else { - zip_bi_buf |= value << zip_bi_valid; - zip_bi_valid += length; - } - }; - - /* ========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ - var zip_bi_reverse = function (code, // the value to invert - len) { // its bit length - var res = 0; - do { - res |= code & 1; - code >>= 1; - res <<= 1; - } while (--len > 0); - return res >> 1; - }; - - /* ========================================================================== - * Write out any remaining bits in an incomplete byte. - */ - var zip_bi_windup = function () { - if (zip_bi_valid > 8) { - zip_put_short(zip_bi_buf); - } else if (zip_bi_valid > 0) { - zip_put_byte(zip_bi_buf); - } - zip_bi_buf = 0; - zip_bi_valid = 0; - }; - - var zip_qoutbuf = function () { - if (zip_outcnt != 0) { - var q, i; - q = zip_new_queue(); - if (zip_qhead == null) - zip_qhead = zip_qtail = q; - else - zip_qtail = zip_qtail.next = q; - q.len = zip_outcnt - zip_outoff; - for (i = 0; i < q.len; i++) - q.ptr[i] = zip_outbuf[zip_outoff + i]; - zip_outcnt = zip_outoff = 0; - } - }; - - function deflate(buffData, level) { - zip_deflate_data = buffData; - zip_deflate_pos = 0; - zip_deflate_start(level); - - var buff = new Array(1024), - pages = [], - totalSize = 0, - i; - - for (i = 0; i < 1024; i++) buff[i] = 0; - while ((i = zip_deflate_internal(buff, 0, buff.length)) > 0) { - var buf = new Buffer(buff.slice(0, i)); - pages.push(buf); - totalSize += buf.length; - } - - if (pages.length == 1) { - return pages[0]; - } - - var result = new Buffer(totalSize), - index = 0; - - for (i = 0; i < pages.length; i++) { - pages[i].copy(result, index); - index = index + pages[i].length - } - - return result; - } - - return { - deflate: function () { - return deflate(inbuf, 8); - } - } -} - -module.exports = function (/*Buffer*/inbuf) { - - var zlib = require("zlib"); - - return { - deflate: function () { - return new JSDeflater(inbuf).deflate(); - }, - - deflateAsync: function (/*Function*/callback) { - var tmp = zlib.createDeflateRaw(); - tmp.on('data', function (data) { - callback(data); - }); - tmp.end(inbuf) - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js deleted file mode 100644 index ddcbba6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.Deflater = require("./deflater"); -exports.Inflater = require("./inflater"); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js deleted file mode 100644 index ba95063..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js +++ /dev/null @@ -1,446 +0,0 @@ -var Buffer = require("buffer").Buffer; - -function JSInflater(/*Buffer*/input) { - - var WSIZE = 0x8000, - slide = new Buffer(0x10000), - windowPos = 0, - fixedTableList = null, - fixedTableDist, - fixedLookup, - bitBuf = 0, - bitLen = 0, - method = -1, - eof = false, - copyLen = 0, - copyDist = 0, - tblList, tblDist, bitList, bitdist, - - inputPosition = 0, - - MASK_BITS = [0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff], - LENS = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], - LEXT = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99], - DISTS = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577], - DEXT = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], - BITORDER = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - - function HuffTable(clen, cnum, cval, blist, elist, lookupm) { - - this.status = 0; - this.root = null; - this.maxbit = 0; - - var el, f, tail, - offsets = [], - countTbl = [], - sTbl = [], - values = [], - tentry = {extra: 0, bitcnt: 0, lbase: 0, next: null}; - - tail = this.root = null; - for(var i = 0; i < 0x11; i++) { countTbl[i] = 0; sTbl[i] = 0; offsets[i] = 0; } - for(i = 0; i < 0x120; i++) values[i] = 0; - - el = cnum > 256 ? clen[256] : 16; - - var pidx = -1; - while (++pidx < cnum) countTbl[clen[pidx]]++; - - if(countTbl[0] == cnum) return; - - for(var j = 1; j <= 16; j++) if(countTbl[j] != 0) break; - var bitLen = j; - for(i = 16; i != 0; i--) if(countTbl[i] != 0) break; - var maxLen = i; - - lookupm < j && (lookupm = j); - - var dCodes = 1 << j; - for(; j < i; j++, dCodes <<= 1) - if((dCodes -= countTbl[j]) < 0) { - this.status = 2; - this.maxbit = lookupm; - return; - } - - if((dCodes -= countTbl[i]) < 0) { - this.status = 2; - this.maxbit = lookupm; - return; - } - - countTbl[i] += dCodes; - offsets[1] = j = 0; - pidx = 1; - var xp = 2; - while(--i > 0) offsets[xp++] = (j += countTbl[pidx++]); - pidx = 0; - i = 0; - do { - (j = clen[pidx++]) && (values[offsets[j]++] = i); - } while(++i < cnum); - cnum = offsets[maxLen]; - offsets[0] = i = 0; - pidx = 0; - - var level = -1, - w = sTbl[0] = 0, - cnode = null, - tblCnt = 0, - tblStack = []; - - for(; bitLen <= maxLen; bitLen++) { - var kccnt = countTbl[bitLen]; - while(kccnt-- > 0) { - while(bitLen > w + sTbl[1 + level]) { - w += sTbl[1 + level]; - level++; - tblCnt = (tblCnt = maxLen - w) > lookupm ? lookupm : tblCnt; - if((f = 1 << (j = bitLen - w)) > kccnt + 1) { - f -= kccnt + 1; - xp = bitLen; - while(++j < tblCnt) { - if((f <<= 1) <= countTbl[++xp]) break; - f -= countTbl[xp]; - } - } - if(w + j > el && w < el) j = el - w; - tblCnt = 1 << j; - sTbl[1 + level] = j; - cnode = []; - while (cnode.length < tblCnt) cnode.push({extra: 0, bitcnt: 0, lbase: 0, next: null}); - if (tail == null) { - tail = this.root = {next:null, list:null}; - } else { - tail = tail.next = {next:null, list:null} - } - tail.next = null; - tail.list = cnode; - - tblStack[level] = cnode; - - if(level > 0) { - offsets[level] = i; - tentry.bitcnt = sTbl[level]; - tentry.extra = 16 + j; - tentry.next = cnode; - j = (i & ((1 << w) - 1)) >> (w - sTbl[level]); - - tblStack[level-1][j].extra = tentry.extra; - tblStack[level-1][j].bitcnt = tentry.bitcnt; - tblStack[level-1][j].lbase = tentry.lbase; - tblStack[level-1][j].next = tentry.next; - } - } - tentry.bitcnt = bitLen - w; - if(pidx >= cnum) - tentry.extra = 99; - else if(values[pidx] < cval) { - tentry.extra = (values[pidx] < 256 ? 16 : 15); - tentry.lbase = values[pidx++]; - } else { - tentry.extra = elist[values[pidx] - cval]; - tentry.lbase = blist[values[pidx++] - cval]; - } - - f = 1 << (bitLen - w); - for(j = i >> w; j < tblCnt; j += f) { - cnode[j].extra = tentry.extra; - cnode[j].bitcnt = tentry.bitcnt; - cnode[j].lbase = tentry.lbase; - cnode[j].next = tentry.next; - } - for(j = 1 << (bitLen - 1); (i & j) != 0; j >>= 1) - i ^= j; - i ^= j; - while((i & ((1 << w) - 1)) != offsets[level]) { - w -= sTbl[level]; - level--; - } - } - } - - this.maxbit = sTbl[1]; - this.status = ((dCodes != 0 && maxLen != 1) ? 1 : 0); - } - - function addBits(n) { - while(bitLen < n) { - bitBuf |= input[inputPosition++] << bitLen; - bitLen += 8; - } - return bitBuf; - } - - function cutBits(n) { - bitLen -= n; - return bitBuf >>= n; - } - - function maskBits(n) { - while(bitLen < n) { - bitBuf |= input[inputPosition++] << bitLen; - bitLen += 8; - } - var res = bitBuf & MASK_BITS[n]; - bitBuf >>= n; - bitLen -= n; - return res; - } - - function codes(buff, off, size) { - var e, t; - if(size == 0) return 0; - - var n = 0; - for(;;) { - t = tblList.list[addBits(bitList) & MASK_BITS[bitList]]; - e = t.extra; - while(e > 16) { - if(e == 99) return -1; - cutBits(t.bitcnt); - e -= 16; - t = t.next[addBits(e) & MASK_BITS[e]]; - e = t.extra; - } - cutBits(t.bitcnt); - if(e == 16) { - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = t.lbase; - if(n == size) return size; - continue; - } - if(e == 15) break; - - copyLen = t.lbase + maskBits(e); - t = tblDist.list[addBits(bitdist) & MASK_BITS[bitdist]]; - e = t.extra; - - while(e > 16) { - if(e == 99) return -1; - cutBits(t.bitcnt); - e -= 16; - t = t.next[addBits(e) & MASK_BITS[e]]; - e = t.extra - } - cutBits(t.bitcnt); - copyDist = windowPos - t.lbase - maskBits(e); - - while(copyLen > 0 && n < size) { - copyLen--; - copyDist &= WSIZE - 1; - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = slide[copyDist++]; - } - - if(n == size) return size; - } - - method = -1; // done - return n; - } - - function stored(buff, off, size) { - cutBits(bitLen & 7); - var n = maskBits(0x10); - if(n != ((~maskBits(0x10)) & 0xffff)) return -1; - copyLen = n; - - n = 0; - while(copyLen > 0 && n < size) { - copyLen--; - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = maskBits(8); - } - - if(copyLen == 0) method = -1; - return n; - } - - function fixed(buff, off, size) { - var fixed_bd = 0; - if(fixedTableList == null) { - var lengths = []; - - for(var symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; - for(; symbol < 256; symbol++) lengths[symbol] = 9; - for(; symbol < 280; symbol++) lengths[symbol] = 7; - for(; symbol < 288; symbol++) lengths[symbol] = 8; - - fixedLookup = 7; - - var htbl = new HuffTable(lengths, 288, 257, LENS, LEXT, fixedLookup); - - if(htbl.status != 0) return -1; - - fixedTableList = htbl.root; - fixedLookup = htbl.maxbit; - - for(symbol = 0; symbol < 30; symbol++) lengths[symbol] = 5; - fixed_bd = 5; - - htbl = new HuffTable(lengths, 30, 0, DISTS, DEXT, fixed_bd); - if(htbl.status > 1) { - fixedTableList = null; - return -1; - } - fixedTableDist = htbl.root; - fixed_bd = htbl.maxbit; - } - - tblList = fixedTableList; - tblDist = fixedTableDist; - bitList = fixedLookup; - bitdist = fixed_bd; - return codes(buff, off, size); - } - - function dynamic(buff, off, size) { - var ll = new Array(0x023C); - - for (var m = 0; m < 0x023C; m++) ll[m] = 0; - - var llencnt = 257 + maskBits(5), - dcodescnt = 1 + maskBits(5), - bitlencnt = 4 + maskBits(4); - - if(llencnt > 286 || dcodescnt > 30) return -1; - - for(var j = 0; j < bitlencnt; j++) ll[BITORDER[j]] = maskBits(3); - for(; j < 19; j++) ll[BITORDER[j]] = 0; - - // build decoding table for trees--single level, 7 bit lookup - bitList = 7; - var hufTable = new HuffTable(ll, 19, 19, null, null, bitList); - if(hufTable.status != 0) - return -1; // incomplete code set - - tblList = hufTable.root; - bitList = hufTable.maxbit; - var lencnt = llencnt + dcodescnt, - i = 0, - lastLen = 0; - while(i < lencnt) { - var hufLcode = tblList.list[addBits(bitList) & MASK_BITS[bitList]]; - j = hufLcode.bitcnt; - cutBits(j); - j = hufLcode.lbase; - if(j < 16) - ll[i++] = lastLen = j; - else if(j == 16) { - j = 3 + maskBits(2); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = lastLen; - } else if(j == 17) { - j = 3 + maskBits(3); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = 0; - lastLen = 0; - } else { - j = 11 + maskBits(7); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = 0; - lastLen = 0; - } - } - bitList = 9; - hufTable = new HuffTable(ll, llencnt, 257, LENS, LEXT, bitList); - bitList == 0 && (hufTable.status = 1); - - if (hufTable.status != 0) return -1; - - tblList = hufTable.root; - bitList = hufTable.maxbit; - - for(i = 0; i < dcodescnt; i++) ll[i] = ll[i + llencnt]; - bitdist = 6; - hufTable = new HuffTable(ll, dcodescnt, 0, DISTS, DEXT, bitdist); - tblDist = hufTable.root; - bitdist = hufTable.maxbit; - - if((bitdist == 0 && llencnt > 257) || hufTable.status != 0) return -1; - - return codes(buff, off, size); - } - - return { - inflate : function(/*Buffer*/outputBuffer) { - tblList = null; - - var size = outputBuffer.length, - offset = 0, i; - - while(offset < size) { - if(eof && method == -1) return; - if(copyLen > 0) { - if(method != 0) { - while(copyLen > 0 && offset < size) { - copyLen--; - copyDist &= WSIZE - 1; - windowPos &= WSIZE - 1; - outputBuffer[offset++] = (slide[windowPos++] = slide[copyDist++]); - } - } else { - while(copyLen > 0 && offset < size) { - copyLen--; - windowPos &= WSIZE - 1; - outputBuffer[offset++] = (slide[windowPos++] = maskBits(8)); - } - copyLen == 0 && (method = -1); // done - } - if (offset == size) return; - } - - if(method == -1) { - if(eof) break; - eof = maskBits(1) != 0; - method = maskBits(2); - tblList = null; - copyLen = 0; - } - switch(method) { - case 0: i = stored(outputBuffer, offset, size - offset); break; - case 1: i = tblList != null ? codes(outputBuffer, offset, size - offset) : fixed(outputBuffer, offset, size - offset); break; - case 2: i = tblList != null ? codes(outputBuffer, offset, size - offset) : dynamic(outputBuffer, offset, size - offset); break; - default: i = -1; break; - } - - if(i == -1) return; - offset += i; - } - } - }; -} - -module.exports = function(/*Buffer*/inbuf) { - var zlib = require("zlib"); - return { - inflateAsync : function(/*Function*/callback) { - var tmp = zlib.createInflateRaw(), - parts = [], total = 0; - tmp.on('data', function(data) { - parts.push(data); - total += data.length; - }); - tmp.on('end', function() { - var buf = new Buffer(total), written = 0; - buf.fill(0); - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - part.copy(buf, written); - written += part.length; - } - callback && callback(buf); - }); - tmp.end(inbuf) - }, - - inflate : function(/*Buffer*/outputBuffer) { - var x = new JSInflater(inbuf); - x.inflate(outputBuffer); - delete(x); - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json deleted file mode 100644 index af35d53..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "adm-zip", - "version": "0.4.3", - "description": "A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk", - "keywords": [ - "zip", - "methods", - "archive", - "unzip" - ], - "homepage": "http://github.com/cthackers/adm-zip", - "author": { - "name": "Nasca Iacob", - "email": "sy@another-d-mention.ro", - "url": "https://github.com/cthackers" - }, - "bugs": { - "url": "https://github.com/cthackers/adm-zip/issues", - "email": "sy@another-d-mention.ro" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/kriskowal/zip/raw/master/LICENSE" - } - ], - "main": "adm-zip.js", - "repository": { - "type": "git", - "url": "https://github.com/cthackers/adm-zip.git" - }, - "engines": { - "node": ">=0.3.0" - }, - "readme": "# ADM-ZIP for NodeJS\r\n\r\nADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/). \r\n\r\n# Installation\r\n\r\nWith [npm](http://npmjs.org) do:\r\n\r\n $ npm install adm-zip\r\n\t\r\n## What is it good for?\r\nThe library allows you to:\r\n\r\n* decompress zip files directly to disk or in memory buffers\r\n* compress files and store them to disk in .zip format or in compressed buffers\r\n* update content of/add new/delete files from an existing .zip\r\n\r\n# Dependencies\r\nThere are no other nodeJS libraries that ADM-ZIP is dependent of\r\n\r\n# Examples\r\n\r\n## Basic usage\r\n```javascript\r\n\r\n\tvar AdmZip = require('adm-zip');\r\n\r\n\t// reading archives\r\n\tvar zip = new AdmZip(\"./my_file.zip\");\r\n\tvar zipEntries = zip.getEntries(); // an array of ZipEntry records\r\n\r\n\tzipEntries.forEach(function(zipEntry) {\r\n\t console.log(zipEntry.toString()); // outputs zip entries information\r\n\t\tif (zipEntry.entryName == \"my_file.txt\") {\r\n\t\t console.log(zipEntry.data.toString('utf8')); \r\n\t\t}\r\n\t});\r\n\t// outputs the content of some_folder/my_file.txt\r\n\tconsole.log(zip.readAsText(\"some_folder/my_file.txt\")); \r\n\t// extracts the specified file to the specified location\r\n\tzip.extractEntryTo(/*entry name*/\"some_folder/my_file.txt\", /*target path*/\"/home/me/tempfolder\", /*overwrite*/true)\r\n\t// extracts everything\r\n\tzip.extractAllTo(/*target path*/\"/home/me/zipcontent/\", /*overwrite*/true);\r\n\t\r\n\t\r\n\t// creating archives\r\n\tvar zip = new AdmZip();\r\n\t\r\n\t// add file directly\r\n\tzip.addFile(\"test.txt\", new Buffer(\"inner content of the file\"), \"entry comment goes here\");\r\n\t// add local file\r\n\tzip.addLocalFile(\"/home/me/some_picture.png\");\r\n\t// get everything as a buffer\r\n\tvar willSendthis = zip.toBuffer();\r\n\t// or write everything to disk\r\n\tzip.writeZip(/*target file name*/\"/home/me/files.zip\");\r\n\t\r\n\t\r\n\t// ... more examples in the wiki\r\n```\r\n\r\nFor more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).\n\n[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip)", - "readmeFilename": "README.md", - "_id": "adm-zip@0.4.3", - "dist": { - "shasum": "0714e822e1c21ce989b832150faad1316ad50f3f" - }, - "_from": "adm-zip@~0.4.3", - "_resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.3.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip deleted file mode 100644 index d57bfc0..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/asd/New Text Document.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/asd/New Text Document.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/blank file.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/blank file.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip deleted file mode 100644 index f4ed17b..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip deleted file mode 100644 index f4ed17b..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip deleted file mode 100644 index 188eccb..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip deleted file mode 100644 index 86a8ec7..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip deleted file mode 100644 index b4602c9..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip deleted file mode 100644 index e2add30..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip deleted file mode 100644 index 86a8ec7..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js deleted file mode 100644 index abf3bd8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js +++ /dev/null @@ -1,15 +0,0 @@ -var Attr = require("../util").FileAttr, - Zip = require("../adm-zip"), - fs = require("fs"); - -/* -var zip = new Zip(); -zip.addLocalFolder("c:/asd/"); -zip.writeZip("c:/asd.zip"); -*/ - -var zip = new Zip("c:/asd.zip"); -zip.getEntries().forEach(function(entry) { - // console.log(entry.toString()); -}); -zip.extractAllTo("C:/test"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js deleted file mode 100644 index 0548054..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js +++ /dev/null @@ -1,84 +0,0 @@ -module.exports = { - /* The local file header */ - LOCHDR : 30, // LOC header size - LOCSIG : 0x04034b50, // "PK\003\004" - LOCVER : 4, // version needed to extract - LOCFLG : 6, // general purpose bit flag - LOCHOW : 8, // compression method - LOCTIM : 10, // modification time (2 bytes time, 2 bytes date) - LOCCRC : 14, // uncompressed file crc-32 value - LOCSIZ : 18, // compressed size - LOCLEN : 22, // uncompressed size - LOCNAM : 26, // filename length - LOCEXT : 28, // extra field length - - /* The Data descriptor */ - EXTSIG : 0x08074b50, // "PK\007\008" - EXTHDR : 16, // EXT header size - EXTCRC : 4, // uncompressed file crc-32 value - EXTSIZ : 8, // compressed size - EXTLEN : 12, // uncompressed size - - /* The central directory file header */ - CENHDR : 46, // CEN header size - CENSIG : 0x02014b50, // "PK\001\002" - CENVEM : 4, // version made by - CENVER : 6, // version needed to extract - CENFLG : 8, // encrypt, decrypt flags - CENHOW : 10, // compression method - CENTIM : 12, // modification time (2 bytes time, 2 bytes date) - CENCRC : 16, // uncompressed file crc-32 value - CENSIZ : 20, // compressed size - CENLEN : 24, // uncompressed size - CENNAM : 28, // filename length - CENEXT : 30, // extra field length - CENCOM : 32, // file comment length - CENDSK : 34, // volume number start - CENATT : 36, // internal file attributes - CENATX : 38, // external file attributes (host system dependent) - CENOFF : 42, // LOC header offset - - /* The entries in the end of central directory */ - ENDHDR : 22, // END header size - ENDSIG : 0x06054b50, // "PK\005\006" - ENDSUB : 8, // number of entries on this disk - ENDTOT : 10, // total number of entries - ENDSIZ : 12, // central directory size in bytes - ENDOFF : 16, // offset of first CEN header - ENDCOM : 20, // zip file comment length - - /* Compression methods */ - STORED : 0, // no compression - SHRUNK : 1, // shrunk - REDUCED1 : 2, // reduced with compression factor 1 - REDUCED2 : 3, // reduced with compression factor 2 - REDUCED3 : 4, // reduced with compression factor 3 - REDUCED4 : 5, // reduced with compression factor 4 - IMPLODED : 6, // imploded - // 7 reserved - DEFLATED : 8, // deflated - ENHANCED_DEFLATED: 9, // enhanced deflated - PKWARE : 10,// PKWare DCL imploded - // 11 reserved - BZIP2 : 12, // compressed using BZIP2 - // 13 reserved - LZMA : 14, // LZMA - // 15-17 reserved - IBM_TERSE : 18, // compressed using IBM TERSE - IBM_LZ77 : 19, //IBM LZ77 z - - /* General purpose bit flag */ - FLG_ENC : 0, // encripted file - FLG_COMP1 : 1, // compression option - FLG_COMP2 : 2, // compression option - FLG_DESC : 4, // data descriptor - FLG_ENH : 8, // enhanced deflation - FLG_STR : 16, // strong encryption - FLG_LNG : 1024, // language encoding - FLG_MSK : 4096, // mask header values - - /* Load type */ - FILE : 0, - BUFFER : 1, - NONE : 2 -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js deleted file mode 100644 index db5d69e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - /* Header error messages */ - "INVALID_LOC" : "Invalid LOC header (bad signature)", - "INVALID_CEN" : "Invalid CEN header (bad signature)", - "INVALID_END" : "Invalid END header (bad signature)", - - /* ZipEntry error messages*/ - "NO_DATA" : "Nothing to decompress", - "BAD_CRC" : "CRC32 checksum failed", - "FILE_IN_THE_WAY" : "There is a file in the way: %s", - "UNKNOWN_METHOD" : "Invalid/unsupported compression method", - - /* Inflater error messages */ - "AVAIL_DATA" : "inflate::Available inflate data did not terminate", - "INVALID_DISTANCE" : "inflate::Invalid literal/length or distance code in fixed or dynamic block", - "TO_MANY_CODES" : "inflate::Dynamic block code description: too many length or distance codes", - "INVALID_REPEAT_LEN" : "inflate::Dynamic block code description: repeat more than specified lengths", - "INVALID_REPEAT_FIRST" : "inflate::Dynamic block code description: repeat lengths with no first length", - "INCOMPLETE_CODES" : "inflate::Dynamic block code description: code lengths codes incomplete", - "INVALID_DYN_DISTANCE": "inflate::Dynamic block code description: invalid distance code lengths", - "INVALID_CODES_LEN": "inflate::Dynamic block code description: invalid literal/length code lengths", - "INVALID_STORE_BLOCK" : "inflate::Stored block length did not match one's complement", - "INVALID_BLOCK_TYPE" : "inflate::Invalid block type (type == 3)", - - /* ADM-ZIP error messages */ - "CANT_EXTRACT_FILE" : "Could not extract the file", - "CANT_OVERRIDE" : "Target file already exists", - "NO_ZIP" : "No zip file was loaded", - "NO_ENTRY" : "Entry doesn't exist", - "DIRECTORY_CONTENT_ERROR" : "A directory cannot have content", - "FILE_NOT_FOUND" : "File not found: %s", - "NOT_IMPLEMENTED" : "Not implemented", - "INVALID_FILENAME" : "Invalid filename", - "INVALID_FORMAT" : "Invalid or unsupported zip format. No END header found" -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js deleted file mode 100644 index 2191ec1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js +++ /dev/null @@ -1,84 +0,0 @@ -var fs = require("fs"), - pth = require("path"); - -fs.existsSync = fs.existsSync || pth.existsSync; - -module.exports = function(/*String*/path) { - - var _path = path || "", - _permissions = 0, - _obj = newAttr(), - _stat = null; - - function newAttr() { - return { - directory : false, - readonly : false, - hidden : false, - executable : false, - mtime : 0, - atime : 0 - } - } - - if (_path && fs.existsSync(_path)) { - _stat = fs.statSync(_path); - _obj.directory = _stat.isDirectory(); - _obj.mtime = _stat.mtime; - _obj.atime = _stat.atime; - _obj.executable = !!(1 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.readonly = !!(2 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.hidden = pth.basename(_path)[0] === "."; - } else { - console.warn("Invalid path: " + _path) - } - - return { - - get directory () { - return _obj.directory; - }, - - get readOnly () { - return _obj.readonly; - }, - - get hidden () { - return _obj.hidden; - }, - - get mtime () { - return _obj.mtime; - }, - - get atime () { - return _obj.atime; - }, - - - get executable () { - return _obj.executable; - }, - - decodeAttributes : function(val) { - - }, - - encodeAttributes : function (val) { - - }, - - toString : function() { - return '{\n' + - '\t"path" : "' + _path + ",\n" + - '\t"isDirectory" : ' + _obj.directory + ",\n" + - '\t"isReadOnly" : ' + _obj.readonly + ",\n" + - '\t"isHidden" : ' + _obj.hidden + ",\n" + - '\t"isExecutable" : ' + _obj.executable + ",\n" + - '\t"mTime" : ' + _obj.mtime + "\n" + - '\t"aTime" : ' + _obj.atime + "\n" + - '}'; - } - } - -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js deleted file mode 100644 index 935fc1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = require("./utils"); -module.exports.Constants = require("./constants"); -module.exports.Errors = require("./errors"); -module.exports.FileAttr = require("./fattr"); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js deleted file mode 100644 index bbd5366..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js +++ /dev/null @@ -1,145 +0,0 @@ -var fs = require("fs"), - pth = require('path'); - -fs.existsSync = fs.existsSync || pth.existsSync; - -module.exports = (function() { - - var crcTable = [], - Constants = require('./constants'), - Errors = require('./errors'), - - PATH_SEPARATOR = pth.normalize("/"); - - - function mkdirSync(/*String*/path) { - var resolvedPath = path.split(PATH_SEPARATOR)[0]; - path.split(PATH_SEPARATOR).forEach(function(name) { - if (!name || name.substr(-1,1) == ":") return; - resolvedPath += PATH_SEPARATOR + name; - var stat; - try { - stat = fs.statSync(resolvedPath); - } catch (e) { - fs.mkdirSync(resolvedPath); - } - if (stat && stat.isFile()) - throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath); - }); - } - - function findSync(/*String*/root, /*RegExp*/pattern, /*Boolean*/recoursive) { - if (typeof pattern === 'boolean') { - recoursive = pattern; - pattern = undefined; - } - var files = []; - fs.readdirSync(root).forEach(function(file) { - var path = pth.join(root, file); - - if (fs.statSync(path).isDirectory() && recoursive) - files = files.concat(findSync(path, pattern, recoursive)); - - if (!pattern || pattern.test(path)) { - files.push(pth.normalize(path) + (fs.statSync(path).isDirectory() ? PATH_SEPARATOR : "")); - } - - }); - return files; - } - - return { - makeDir : function(/*String*/path) { - mkdirSync(path); - }, - - crc32 : function(buf) { - var b = new Buffer(4); - if (!crcTable.length) { - for (var n = 0; n < 256; n++) { - var c = n; - for (var k = 8; --k >= 0;) // - if ((c & 1) != 0) { c = 0xedb88320 ^ (c >>> 1); } else { c = c >>> 1; } - if (c < 0) { - b.writeInt32LE(c, 0); - c = b.readUInt32LE(0); - } - crcTable[n] = c; - } - } - var crc = 0, off = 0, len = buf.length, c1 = ~crc; - while(--len >= 0) c1 = crcTable[(c1 ^ buf[off++]) & 0xff] ^ (c1 >>> 8); - crc = ~c1; - b.writeInt32LE(crc & 0xffffffff, 0); - return b.readUInt32LE(0); - }, - - methodToString : function(/*Number*/method) { - switch (method) { - case Constants.STORED: - return 'STORED (' + method + ')'; - case Constants.DEFLATED: - return 'DEFLATED (' + method + ')'; - default: - return 'UNSUPPORTED (' + method + ')' - } - - }, - - writeFileTo : function(/*String*/path, /*Buffer*/content, /*Boolean*/overwrite, /*Number*/attr) { - if (fs.existsSync(path)) { - if (!overwrite) - return false; // cannot overwite - - var stat = fs.statSync(path); - if (stat.isDirectory()) { - return false; - } - } - var folder = pth.dirname(path); - if (!fs.existsSync(folder)) { - mkdirSync(folder); - } - - var fd; - try { - fd = fs.openSync(path, 'w', 0666); - } catch(e) { - fs.chmodSync(path, 0666); - fd = fs.openSync(path, 'w', 0666); - } - if (fd) { - fs.writeSync(fd, content, 0, content.length, 0); - fs.closeSync(fd); - } - fs.chmodSync(path, attr || 0666); - return true; - }, - - findFiles : function(/*String*/path) { - return findSync(path, true); - }, - - getAttributes : function(/*String*/path) { - - }, - - setAttributes : function(/*String*/path) { - - }, - - toBuffer : function(input) { - if (Buffer.isBuffer(input)) { - return input; - } else { - if (input.length == 0) { - return new Buffer(0) - } - return new Buffer(input, 'utf8'); - } - }, - - Constants : Constants, - Errors : Errors - } -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js deleted file mode 100644 index fd0fa81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js +++ /dev/null @@ -1,224 +0,0 @@ -var Utils = require("./util"), - Headers = require("./headers"), - Constants = Utils.Constants, - Methods = require("./methods"); - -module.exports = function (/*Buffer*/input) { - - var _entryHeader = new Headers.EntryHeader(), - _entryName = new Buffer(0), - _comment = new Buffer(0), - _isDirectory = false, - uncompressedData = null, - _extra = new Buffer(0); - - function getCompressedDataFromZip() { - if (!input || !Buffer.isBuffer(input)) { - return new Buffer(0); - } - _entryHeader.loadDataHeaderFromBinary(input); - return input.slice(_entryHeader.realDataOffset, _entryHeader.realDataOffset + _entryHeader.compressedSize) - } - - function crc32OK(data) { - // if bit 3 (0x08) of the general-purpose flags field is set, then the CRC-32 and file sizes are not known when the header is written - if (_entryHeader.flags & 0x8 != 0x8) { - if (Utils.crc32(data) != _entryHeader.crc) { - return false; - } - } else { - // @TODO: load and check data descriptor header - // The fields in the local header are filled with zero, and the CRC-32 and size are appended in a 12-byte structure - // (optionally preceded by a 4-byte signature) immediately after the compressed data: - } - return true; - } - - function decompress(/*Boolean*/async, /*Function*/callback) { - if (_isDirectory) { - if (async && callback) { - callback(new Buffer(0), Utils.Errors.DIRECTORY_CONTENT_ERROR); //si added error. - } - return new Buffer(0); - } - - var compressedData = getCompressedDataFromZip(); - if (compressedData.length == 0) { - if (async && callback) callback(compressedData, Utils.Errors.NO_DATA);//si added error. - return compressedData; - } - - var data = new Buffer(_entryHeader.size); - data.fill(0); - - switch (_entryHeader.method) { - case Utils.Constants.STORED: - compressedData.copy(data); - if (!crc32OK(data)) { - if (async && callback) callback(data, Utils.Errors.BAD_CRC);//si added error - return Utils.Errors.BAD_CRC; - } else {//si added otherwise did not seem to return data. - if (async && callback) callback(data); - return data; - } - break; - case Utils.Constants.DEFLATED: - var inflater = new Methods.Inflater(compressedData); - if (!async) { - inflater.inflate(data); - if (!crc32OK(data)) { - console.warn(Utils.Errors.BAD_CRC + " " + _entryName.toString()) - } - return data; - } else { - inflater.inflateAsync(function(result) { - result.copy(data, 0); - if (crc32OK(data)) { - if (callback) callback(data, Utils.Errors.BAD_CRC); //si added error - } else { //si added otherwise did not seem to return data. - if (callback) callback(data); - } - }) - } - break; - default: - if (async && callback) callback(new Buffer(0), Utils.Errors.UNKNOWN_METHOD); - return Utils.Errors.UNKNOWN_METHOD; - } - } - - function compress(/*Boolean*/async, /*Function*/callback) { - if ((!uncompressedData || !uncompressedData.length) && Buffer.isBuffer(input)) { - // no data set or the data wasn't changed to require recompression - if (async && callback) callback(getCompressedDataFromZip()); - return getCompressedDataFromZip(); - } - - if (uncompressedData.length && !_isDirectory) { - var compressedData; - // Local file header - switch (_entryHeader.method) { - case Utils.Constants.STORED: - _entryHeader.compressedSize = _entryHeader.size; - - compressedData = new Buffer(uncompressedData.length); - uncompressedData.copy(compressedData); - - if (async && callback) callback(compressedData); - return compressedData; - - break; - default: - case Utils.Constants.DEFLATED: - var deflater = new Methods.Deflater(uncompressedData); - if (!async) { - console.log(_entryName.toString()); - var deflated = deflater.deflate(); - _entryHeader.compressedSize = deflated.length; - return deflated; - } else { - deflater.deflateAsync(function(data) { - compressedData = new Buffer(data.length); - _entryHeader.compressedSize = data.length; - data.copy(compressedData); - callback && callback(compressedData); - }) - } - deflater = null; - break; - } - } else { - if (async && callback) { - callback(new Buffer(0)); - } else { - return new Buffer(0); - } - } - } - - return { - get entryName () { return _entryName.toString(); }, - get rawEntryName() { return _entryName; }, - set entryName (val) { - _entryName = Utils.toBuffer(val); - var lastChar = _entryName[_entryName.length - 1]; - _isDirectory = (lastChar == 47) || (lastChar == 92); - _entryHeader.fileNameLength = _entryName.length; - }, - - get extra () { return _extra; }, - set extra (val) { - _extra = val; - _entryHeader.extraLength = val.length; - }, - - get comment () { return _comment.toString(); }, - set comment (val) { - _comment = Utils.toBuffer(val); - _entryHeader.commentLength = _comment.length; - }, - - get name () { var n = _entryName.toString(); return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop(); }, - get isDirectory () { return _isDirectory }, - - getCompressedData : function() { - return compress(false, null) - }, - - getCompressedDataAsync : function(/*Function*/callback) { - compress(true, callback) - }, - - setData : function(value) { - uncompressedData = Utils.toBuffer(value); - if (!_isDirectory && uncompressedData.length) { - _entryHeader.size = uncompressedData.length; - _entryHeader.method = Utils.Constants.DEFLATED; - _entryHeader.crc = Utils.crc32(value); - } else { // folders and blank files should be stored - _entryHeader.method = Utils.Constants.STORED; - } - }, - - getData : function() { - return decompress(false, null); - }, - - getDataAsync : function(/*Function*/callback) { - decompress(true, callback) - }, - - set header(/*Buffer*/data) { - _entryHeader.loadFromBinary(data); - }, - - get header() { - return _entryHeader; - }, - - packHeader : function() { - var header = _entryHeader.entryHeaderToBinary(); - // add - _entryName.copy(header, Utils.Constants.CENHDR); - if (_entryHeader.extraLength) { - _extra.copy(header, Utils.Constants.CENHDR + _entryName.length) - } - if (_entryHeader.commentLength) { - _comment.copy(header, Utils.Constants.CENHDR + _entryName.length + _entryHeader.extraLength, _comment.length); - } - return header; - }, - - toString : function() { - return '{\n' + - '\t"entryName" : "' + _entryName.toString() + "\",\n" + - '\t"name" : "' + _entryName.toString().split("/").pop() + "\",\n" + - '\t"comment" : "' + _comment.toString() + "\",\n" + - '\t"isDirectory" : ' + _isDirectory + ",\n" + - '\t"header" : ' + _entryHeader.toString().replace(/\t/mg, "\t\t") + ",\n" + - '\t"compressedData" : <' + (input && input.length + " bytes buffer" || "null") + ">\n" + - '\t"data" : <' + (uncompressedData && uncompressedData.length + " bytes buffer" || "null") + ">\n" + - '}'; - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js deleted file mode 100644 index b0f78cf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js +++ /dev/null @@ -1,233 +0,0 @@ -var ZipEntry = require("./zipEntry"), - Headers = require("./headers"); - Utils = require("./util"); - -module.exports = function(/*String|Buffer*/input, /*Number*/inputType) { - var entryList = [], - entryTable = {}, - _comment = new Buffer(0), - filename = "", - fs = require("fs"), - inBuffer = null, - mainHeader = new Headers.MainHeader(); - - if (inputType == Utils.Constants.FILE) { - // is a filename - filename = input; - inBuffer = fs.readFileSync(filename); - readMainHeader(); - } else if (inputType == Utils.Constants.BUFFER) { - // is a memory buffer - inBuffer = input; - readMainHeader(); - } else { - // none. is a new file - } - - function readEntries() { - entryTable = {}; - entryList = new Array(mainHeader.diskEntries); // total number of entries - var index = mainHeader.offset; // offset of first CEN header - for(var i = 0; i < entryList.length; i++) { - - var tmp = index, - entry = new ZipEntry(inBuffer); - entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); - - entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); - - if (entry.header.extraLength) { - entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength); - } - - if (entry.header.commentLength) - entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength); - - index += entry.header.entryHeaderSize; - - entryList[i] = entry; - entryTable[entry.entryName] = entry; - } - } - - function readMainHeader() { - var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size - n = Math.max(0, i - 0xFFFF), // 0xFFFF is the max zip file comment length - endOffset = 0; // Start offset of the END header - - for (i; i >= n; i--) { - if (inBuffer[i] != 0x50) continue; // quick check that the byte is 'P' - if (inBuffer.readUInt32LE(i) == Utils.Constants.ENDSIG) { // "PK\005\006" - endOffset = i; - break; - } - } - if (!endOffset) - throw Utils.Errors.INVALID_FORMAT; - - mainHeader.loadFromBinary(inBuffer.slice(endOffset, endOffset + Utils.Constants.ENDHDR)); - if (mainHeader.commentLength) { - _comment = inBuffer.slice(endOffset + Utils.Constants.ENDHDR); - } - readEntries(); - } - - return { - /** - * Returns an array of ZipEntry objects existent in the current opened archive - * @return Array - */ - get entries () { - return entryList; - }, - - /** - * Archive comment - * @return {String} - */ - get comment () { return _comment.toString(); }, - set comment(val) { - mainHeader.commentLength = val.length; - _comment = val; - }, - - /** - * Returns a reference to the entry with the given name or null if entry is inexistent - * - * @param entryName - * @return ZipEntry - */ - getEntry : function(/*String*/entryName) { - return entryTable[entryName] || null; - }, - - /** - * Adds the given entry to the entry list - * - * @param entry - */ - setEntry : function(/*ZipEntry*/entry) { - entryList.push(entry); - entryTable[entry.entryName] = entry; - mainHeader.totalEntries = entryList.length; - }, - - /** - * Removes the entry with the given name from the entry list. - * - * If the entry is a directory, then all nested files and directories will be removed - * @param entryName - */ - deleteEntry : function(/*String*/entryName) { - var entry = entryTable[entryName]; - if (entry && entry.isDirectory) { - var _self = this; - this.getEntryChildren(entry).forEach(function(child) { - if (child.entryName != entryName) { - _self.deleteEntry(child.entryName) - } - }) - } - entryList.slice(entryList.indexOf(entry), 1); - delete(entryTable[entryName]); - mainHeader.totalEntries = entryList.length; - }, - - /** - * Iterates and returns all nested files and directories of the given entry - * - * @param entry - * @return Array - */ - getEntryChildren : function(/*ZipEntry*/entry) { - if (entry.isDirectory) { - var list = [], - name = entry.entryName, - len = name.length; - - entryList.forEach(function(zipEntry) { - if (zipEntry.entryName.substr(0, len) == name) { - list.push(zipEntry); - } - }); - return list; - } - return [] - }, - - /** - * Returns the zip file - * - * @return Buffer - */ - compressToBuffer : function() { - if (entryList.length > 1) { - entryList.sort(function(a, b) { - var nameA = a.entryName.toLowerCase(); - var nameB = b.entryName.toLowerCase(); - if (nameA < nameB) {return -1} - if (nameA > nameB) {return 1} - return 0; - }); - } - - var totalSize = 0, - dataBlock = [], - entryHeaders = [], - dindex = 0; - - mainHeader.size = 0; - mainHeader.offset = 0; - - entryList.forEach(function(entry) { - entry.header.offset = dindex; - - // compress data and set local and entry header accordingly. Reason why is called first - var compressedData = entry.getCompressedData(); - // data header - var dataHeader = entry.header.dataHeaderToBinary(); - var postHeader = new Buffer(entry.entryName + entry.extra.toString()); - var dataLength = dataHeader.length + postHeader.length + compressedData.length; - - dindex += dataLength; - - dataBlock.push(dataHeader); - dataBlock.push(postHeader); - dataBlock.push(compressedData); - - var entryHeader = entry.packHeader(); - entryHeaders.push(entryHeader); - mainHeader.size += entryHeader.length; - totalSize += (dataLength + entryHeader.length); - }); - - totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length - // point to end of data and begining of central directory first record - mainHeader.offset = dindex; - - dindex = 0; - var outBuffer = new Buffer(totalSize); - dataBlock.forEach(function(content) { - content.copy(outBuffer, dindex); // write data blocks - dindex += content.length; - }); - entryHeaders.forEach(function(content) { - content.copy(outBuffer, dindex); // write central directory entries - dindex += content.length; - }); - - var mh = mainHeader.toBinary(); - if (_comment) { - _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment - } - - mh.copy(outBuffer, dindex); // write main header - - return outBuffer - }, - - toAsyncBuffer : function(/*Function*/callback) { - - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md deleted file mode 100644 index 8fc6779..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md +++ /dev/null @@ -1,26 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js deleted file mode 100755 index 29bfa8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index 5c1147c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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": "2.0.1", - "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* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index afc83b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,228 +0,0 @@ -var fs = require('fs') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - 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') - - 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.end() - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json deleted file mode 100644 index 08516f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "rimraf", - "version": "2.2.2", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~2" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~2" - }, - "_id": "rimraf@2.2.2", - "_from": "rimraf@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js deleted file mode 100644 index 55f8d9a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,184 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - 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 (er.code === "EBUSY" && 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() - 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")) - 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") - rmkidsSync(p) - } -} - -function rmkidsSync (p) { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore deleted file mode 100644 index 13abef4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -node_modules/* -npm_debug.log diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml deleted file mode 100644 index 895dbd3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE deleted file mode 100644 index 6d03581..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 'Dominic Tarr' - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md deleted file mode 100644 index 565e0e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# stream-combiner - - - -## Combine (stream1,...,streamN) - -Turn a pipeline into a single stream. `pipeline` returns a stream that writes to the first stream -and reads from the last stream. - -Listening for 'error' will recieve errors from all streams inside the pipe. - -``` js - var Combine = require('stream-combiner') - var es = require('event-stream') - - Combine( //connect streams together with `pipe` - process.openStdin(), //open stdin - es.split(), //split stream to break on newlines - es.map(function (data, callback) {//turn this async function into a stream - callback(null - , inspect(JSON.parse(data))) //render it nicely - }), - process.stdout // pipe it to stdout ! - ) -``` - -## License - -MIT diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js deleted file mode 100644 index 99cf5b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js +++ /dev/null @@ -1,39 +0,0 @@ -var duplexer = require('duplexer') - -module.exports = function () { - - var streams = [].slice.call(arguments) - , first = streams[0] - , last = streams[streams.length - 1] - , thepipe = duplexer(first, last) - - if(streams.length == 1) - return streams[0] - else if (!streams.length) - throw new Error('connect called with empty args') - - //pipe all the streams together - - function recurse (streams) { - if(streams.length < 2) - return - streams[0].pipe(streams[1]) - recurse(streams.slice(1)) - } - - recurse(streams) - - function onerror () { - var args = [].slice.call(arguments) - args.unshift('error') - thepipe.emit.apply(thepipe, args) - } - - //es.duplex already reemits the error from the first and last stream. - //add a listener for the inner streams in the pipeline. - for(var i = 1; i < streams.length - 1; i ++) - streams[i].on('error', onerror) - - return thepipe -} - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore deleted file mode 100644 index 062c11e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.log -*.err \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml deleted file mode 100644 index c2ba3f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile deleted file mode 100644 index 1f8985d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -test: - node test.js - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md deleted file mode 100644 index a24cecb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# duplexer [![build status][1]][2] - -Creates a duplex stream - -Taken from [event-stream][3] - -## duplex (writeStream, readStream) - -Takes a writable stream and a readable stream and makes them appear as a readable writable stream. - -It is assumed that the two streams are connected to each other in some way. - -## Example - - var grep = cp.exec('grep Stream') - - duplex(grep.stdin, grep.stdout) - -## Installation - -`npm install duplexer` - -## Tests - -`make test` - -## Contributors - - - Dominictarr - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Raynos/duplexer.png - [2]: http://travis-ci.org/Raynos/duplexer - [3]: https://github.com/dominictarr/event-stream#duplex-writestream-readstream \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js deleted file mode 100644 index 22e0d51..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js +++ /dev/null @@ -1,77 +0,0 @@ -var Stream = require("stream") - , writeMethods = ["write", "end", "destroy"] - , readMethods = ["resume", "pause"] - , readEvents = ["data", "close"] - , slice = Array.prototype.slice - -module.exports = duplex - -function duplex(writer, reader) { - var stream = new Stream() - , ended = false - - writeMethods.forEach(proxyWriter) - - readMethods.forEach(proxyReader) - - readEvents.forEach(proxyStream) - - reader.on("end", handleEnd) - - writer.on("drain", function() { - stream.emit("drain") - }) - - writer.on("error", reemit) - reader.on("error", reemit) - - stream.writable = writer.writable - stream.readable = reader.readable - - return stream - - function proxyWriter(methodName) { - stream[methodName] = method - - function method() { - return writer[methodName].apply(writer, arguments) - } - } - - function proxyReader(methodName) { - stream[methodName] = method - - function method() { - stream.emit(methodName) - var func = reader[methodName] - if (func) { - return func.apply(reader, arguments) - } - reader.emit(methodName) - } - } - - function proxyStream(methodName) { - reader.on(methodName, reemit) - - function reemit() { - var args = slice.call(arguments) - args.unshift(methodName) - stream.emit.apply(stream, args) - } - } - - function handleEnd() { - if (ended) { - return - } - ended = true - var args = slice.call(arguments) - args.unshift("end") - stream.emit.apply(stream, args) - } - - function reemit(err) { - stream.emit("error", err) - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json deleted file mode 100644 index cc6d314..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "duplexer", - "version": "0.0.4", - "description": "Creates a duplex stream", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/duplexer.git" - }, - "main": "index", - "homepage": "https://github.com/Raynos/duplexer", - "contributors": [ - { - "name": "Jake Verbaten" - } - ], - "bugs": { - "url": "https://github.com/Raynos/duplexer/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "through": "~0.1.4" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Raynos/duplexer/raw/master/LICENSE" - } - ], - "scripts": { - "test": "make test" - }, - "readme": "# duplexer [![build status][1]][2]\n\nCreates a duplex stream\n\nTaken from [event-stream][3]\n\n## duplex (writeStream, readStream)\n\nTakes a writable stream and a readable stream and makes them appear as a readable writable stream.\n\nIt is assumed that the two streams are connected to each other in some way.\n\n## Example\n\n var grep = cp.exec('grep Stream')\n\n duplex(grep.stdin, grep.stdout)\n\n## Installation\n\n`npm install duplexer`\n\n## Tests\n\n`make test`\n\n## Contributors\n\n - Dominictarr\n - Raynos\n\n## MIT Licenced\n\n [1]: https://secure.travis-ci.org/Raynos/duplexer.png\n [2]: http://travis-ci.org/Raynos/duplexer\n [3]: https://github.com/dominictarr/event-stream#duplex-writestream-readstream", - "readmeFilename": "README.md", - "_id": "duplexer@0.0.4", - "dist": { - "shasum": "3d8e199c895711c70cdf7c16cfc99d09c2760540" - }, - "_from": "duplexer@~0.0.3", - "_resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.0.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js deleted file mode 100644 index e06a864..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js +++ /dev/null @@ -1,27 +0,0 @@ -var duplex = require("./index") - , assert = require("assert") - , through = require("through") - -var readable = through() - , writable = through(write) - , written = 0 - , data = 0 - -var stream = duplex(writable, readable) - -function write() { - written++ -} - -stream.on("data", ondata) - -function ondata() { - data++ -} - -stream.write() -readable.emit("data") - -assert.equal(written, 1) -assert.equal(data, 1) -console.log("DONE") \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json deleted file mode 100644 index 3c10d93..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "stream-combiner", - "version": "0.0.2", - "homepage": "https://github.com/dominictarr/stream-combiner", - "repository": { - "type": "git", - "url": "git://github.com/dominictarr/stream-combiner.git" - }, - "dependencies": { - "duplexer": "~0.0.3" - }, - "devDependencies": { - "tape": "0.0.4", - "event-stream": "~3.0.7" - }, - "scripts": { - "test": "set -e; for t in test/*.js; do node $t; done" - }, - "author": { - "name": "'Dominic Tarr'", - "email": "dominic.tarr@gmail.com", - "url": "http://dominictarr.com" - }, - "license": "MIT", - "readme": "# stream-combiner\n\n\n\n## Combine (stream1,...,streamN)\n\nTurn a pipeline into a single stream. `pipeline` returns a stream that writes to the first stream\nand reads from the last stream. \n\nListening for 'error' will recieve errors from all streams inside the pipe.\n\n``` js\n var Combine = require('stream-combiner')\n var es = require('event-stream')\n\n Combine( //connect streams together with `pipe`\n process.openStdin(), //open stdin\n es.split(), //split stream to break on newlines\n es.map(function (data, callback) {//turn this async function into a stream\n callback(null\n , inspect(JSON.parse(data))) //render it nicely\n }),\n process.stdout // pipe it to stdout !\n )\n```\n\n## License\n\nMIT\n", - "readmeFilename": "README.md", - "description": "", - "bugs": { - "url": "https://github.com/dominictarr/stream-combiner/issues" - }, - "_id": "stream-combiner@0.0.2", - "dist": { - "shasum": "dfe0e74675742565e76c6056788ea5c23bd97db4" - }, - "_from": "stream-combiner@~0.0.2", - "_resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js deleted file mode 100644 index d17ddad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js +++ /dev/null @@ -1,52 +0,0 @@ -var es = require('event-stream') -var combine = require('..') -var test = require('tape') - -test('do not duplicate errors', function (test) { - - var errors = 0; - var pipe = combine( - es.through(function(data) { - return this.emit('data', data); - }), - es.through(function(data) { - return this.emit('error', new Error(data)); - }) - ) - - pipe.on('error', function(err) { - errors++ - test.ok(errors, 'expected error count') - process.nextTick(function () { - return test.end(); - }) - }) - - return pipe.write('meh'); -}) - -test('3 pipe do not duplicate errors', function (test) { - - var errors = 0; - var pipe = combine( - es.through(function(data) { - return this.emit('data', data); - }), - es.through(function(data) { - return this.emit('error', new Error(data)); - }), - es.through() - ) - - pipe.on('error', function(err) { - errors++ - test.ok(errors, 'expected error count') - process.nextTick(function () { - return test.end(); - }) - }) - - return pipe.write('meh'); - -}) - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore deleted file mode 100644 index c167ad5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules -examples/extract/ -test/tmp/ -test/fixtures/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml deleted file mode 100644 index 2d26206..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md deleted file mode 100644 index c6b0f82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js deleted file mode 100644 index e150abf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js deleted file mode 100644 index 39f3f08..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js deleted file mode 100644 index 4af5c41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js +++ /dev/null @@ -1,213 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js deleted file mode 100644 index 1728c45..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js +++ /dev/null @@ -1,191 +0,0 @@ - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js deleted file mode 100644 index 74f432c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js +++ /dev/null @@ -1,140 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js deleted file mode 100644 index c34a81e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js deleted file mode 100644 index 0bfc7b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js deleted file mode 100644 index 05b237c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js +++ /dev/null @@ -1,385 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js deleted file mode 100644 index 3ff14dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js +++ /dev/null @@ -1,231 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js deleted file mode 100644 index 884e73d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js +++ /dev/null @@ -1,270 +0,0 @@ - -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md deleted file mode 100644 index c16e9c4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js deleted file mode 100644 index 9328844..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js deleted file mode 100644 index 1141f3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js deleted file mode 100644 index 93e4068..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js deleted file mode 100644 index 55fa133..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js deleted file mode 100644 index 008de03..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js +++ /dev/null @@ -1,209 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json deleted file mode 100644 index 21bdee0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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" - }, - "_id": "block-stream@0.0.7", - "_from": "block-stream@*" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js deleted file mode 100644 index b4b9305..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js deleted file mode 100644 index 7a8de88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js deleted file mode 100644 index 6d38429..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js +++ /dev/null @@ -1,57 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js deleted file mode 100644 index 64d0d09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js deleted file mode 100644 index 1cc9ea0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js deleted file mode 100644 index c6db79a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js +++ /dev/null @@ -1,59 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore deleted file mode 100644 index 494272a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules/ -examples/deep-copy/ -examples/path/ -examples/filter-copy/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml deleted file mode 100644 index 2d26206..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md deleted file mode 100644 index 9d8cb77..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js deleted file mode 100644 index c6b55b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js +++ /dev/null @@ -1,131 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - !this.basename.match(/^filter-copy$/) - } - }) - -// this writer will only write directories -var w = fstream.Writer({ path: path.resolve(__dirname, "filter-copy") - , type: "Directory" - , filter: function () { - return this.type === "Directory" - } - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 1000) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -var i = 1 -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok " + (i ++) + " A WINNAR IS YOU") - ended = true - // now go through and verify that everything in there is a dir. - var p = path.resolve(__dirname, "filter-copy") - var checker = fstream.Reader({ path: p }) - checker.checker = true - checker.on("child", function (e) { - var ok = e.type === "Directory" - console.log((ok ? "" : "not ") + "ok " + (i ++) + - " should be a dir: " + - e.path.substr(checker.path.length + 1)) - }) -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok " + (i ++) + " ended") -}) - -r.pipe(w) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js deleted file mode 100644 index 648ec84..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js +++ /dev/null @@ -1,115 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - } - }) - -var w = fstream.Writer({ path: path.resolve(__dirname, "deep-copy") - , type: "Directory" - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename, entry) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 10) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok 1 A WINNAR IS YOU") - ended = true -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok 2 ended") -}) - -r.pipe(w) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js deleted file mode 100644 index 9aa1a95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js +++ /dev/null @@ -1,54 +0,0 @@ -var fstream = require("../fstream.js") -var tap = require("tap") -var fs = require("fs") -var path = require("path") -var children = -1 -var dir = path.dirname(__dirname) - -var gotReady = false -var ended = false - -tap.test("reader test", function (t) { - - var r = fstream.Reader({ path: dir - , filter: function () { - // return this.parent === r - return this.parent === r || this === r - } - }) - - r.on("ready", function () { - gotReady = true - children = fs.readdirSync(dir).length - console.error("Setting expected children to "+children) - t.equal(r.type, "Directory", "should be a directory") - }) - - r.on("entry", function (entry) { - children -- - if (!gotReady) { - t.fail("children before ready!") - } - t.equal(entry.dirname, r.path, "basename is parent dir") - }) - - r.on("error", function (er) { - t.fail(er) - t.end() - process.exit(1) - }) - - r.on("end", function () { - t.equal(children, 0, "should have seen all children") - ended = true - }) - - var closed = false - r.on("close", function () { - t.ok(ended, "saw end before close") - t.notOk(closed, "close should only happen once") - closed = true - t.end() - }) - -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js deleted file mode 100644 index d7816d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js +++ /dev/null @@ -1,24 +0,0 @@ -var fstream = require("../fstream.js") - , closed = false - -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , isSymbolicLink: true - , mode: "0755" // octal strings supported - }) - .on("close", function () { - closed = true - var fs = require("fs") - var s = fs.lstatSync("path/to/symlink") - var isSym = s.isSymbolicLink() - console.log((isSym?"":"not ") +"ok 1 should be symlink") - var t = fs.readlinkSync("path/to/symlink") - var isTarget = t === "./file" - console.log((isTarget?"":"not ") +"ok 2 should link to ./file") - }) - .end() - -process.on("exit", function () { - console.log((closed?"":"not ")+"ok 3 should be closed") -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js deleted file mode 100644 index c66d26f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.Abstract = require("./lib/abstract.js") -exports.Reader = require("./lib/reader.js") -exports.Writer = require("./lib/writer.js") - -exports.File = - { Reader: require("./lib/file-reader.js") - , Writer: require("./lib/file-writer.js") } - -exports.Dir = - { Reader : require("./lib/dir-reader.js") - , Writer : require("./lib/dir-writer.js") } - -exports.Link = - { Reader : require("./lib/link-reader.js") - , Writer : require("./lib/link-writer.js") } - -exports.Proxy = - { Reader : require("./lib/proxy-reader.js") - , Writer : require("./lib/proxy-writer.js") } - -exports.Reader.Dir = exports.DirReader = exports.Dir.Reader -exports.Reader.File = exports.FileReader = exports.File.Reader -exports.Reader.Link = exports.LinkReader = exports.Link.Reader -exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader - -exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer -exports.Writer.File = exports.FileWriter = exports.File.Writer -exports.Writer.Link = exports.LinkWriter = exports.Link.Writer -exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer - -exports.collect = require("./lib/collect.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js deleted file mode 100644 index 11ef0e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js +++ /dev/null @@ -1,85 +0,0 @@ -// the parent class for all fstreams. - -module.exports = Abstract - -var Stream = require("stream").Stream - , inherits = require("inherits") - -function Abstract () { - Stream.call(this) -} - -inherits(Abstract, Stream) - -Abstract.prototype.on = function (ev, fn) { - if (ev === "ready" && this.ready) { - process.nextTick(fn.bind(this)) - } else { - Stream.prototype.on.call(this, ev, fn) - } - return this -} - -Abstract.prototype.abort = function () { - this._aborted = true - this.emit("abort") -} - -Abstract.prototype.destroy = function () {} - -Abstract.prototype.warn = function (msg, code) { - var me = this - , er = decorate(msg, code, me) - if (!me.listeners("warn")) { - console.error("%s %s\n" + - "path = %s\n" + - "syscall = %s\n" + - "fstream_type = %s\n" + - "fstream_path = %s\n" + - "fstream_unc_path = %s\n" + - "fstream_class = %s\n" + - "fstream_stack =\n%s\n", - code || "UNKNOWN", - er.stack, - er.path, - er.syscall, - er.fstream_type, - er.fstream_path, - er.fstream_unc_path, - er.fstream_class, - er.fstream_stack.join("\n")) - } else { - me.emit("warn", er) - } -} - -Abstract.prototype.info = function (msg, code) { - this.emit("info", msg, code) -} - -Abstract.prototype.error = function (msg, code, th) { - var er = decorate(msg, code, this) - if (th) throw er - else this.emit("error", er) -} - -function decorate (er, code, me) { - if (!(er instanceof Error)) er = new Error(er) - er.code = er.code || code - er.path = er.path || me.path - er.fstream_type = er.fstream_type || me.type - er.fstream_path = er.fstream_path || me.path - if (me._path !== me.path) { - er.fstream_unc_path = er.fstream_unc_path || me._path - } - if (me.linkpath) { - er.fstream_linkpath = er.fstream_linkpath || me.linkpath - } - er.fstream_class = er.fstream_class || me.constructor.name - er.fstream_stack = er.fstream_stack || - new Error().stack.split(/\n/).slice(3).map(function (s) { - return s.replace(/^ at /, "") - }) - - return er -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js deleted file mode 100644 index a36f780..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = collect - -function collect (stream) { - if (stream._collected) return - - stream._collected = true - stream.pause() - - stream.on("data", save) - stream.on("end", save) - var buf = [] - function save (b) { - if (typeof b === "string") b = new Buffer(b) - if (Buffer.isBuffer(b) && !b.length) return - buf.push(b) - } - - stream.on("entry", saveEntry) - var entryBuffer = [] - function saveEntry (e) { - collect(e) - entryBuffer.push(e) - } - - stream.on("proxy", proxyPause) - function proxyPause (p) { - p.pause() - } - - - // replace the pipe method with a new version that will - // unlock the buffered stuff. if you just call .pipe() - // without a destination, then it'll re-play the events. - stream.pipe = (function (orig) { return function (dest) { - // console.error(" === open the pipes", dest && dest.path) - - // let the entries flow through one at a time. - // Once they're all done, then we can resume completely. - var e = 0 - ;(function unblockEntry () { - var entry = entryBuffer[e++] - // console.error(" ==== unblock entry", entry && entry.path) - if (!entry) return resume() - entry.on("end", unblockEntry) - if (dest) dest.add(entry) - else stream.emit("entry", entry) - })() - - function resume () { - stream.removeListener("entry", saveEntry) - stream.removeListener("data", save) - stream.removeListener("end", save) - - stream.pipe = orig - if (dest) stream.pipe(dest) - - buf.forEach(function (b) { - if (b) stream.emit("data", b) - else stream.emit("end") - }) - - stream.resume() - } - - return dest - }})(stream.pipe) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js deleted file mode 100644 index dd9883b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js +++ /dev/null @@ -1,250 +0,0 @@ -// A thing that emits "entry" events with Reader objects -// Pausing it causes it to stop emitting entry events, and also -// pauses the current entry if there is one. - -module.exports = DirReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , Reader = require("./reader.js") - , assert = require("assert").ok - -inherits(DirReader, Reader) - -function DirReader (props) { - var me = this - if (!(me instanceof DirReader)) throw new Error( - "DirReader must be called as constructor.") - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - throw new Error("Non-directory type "+ props.type) - } - - me.entries = null - me._index = -1 - me._paused = false - me._length = -1 - - if (props.sort) { - this.sort = props.sort - } - - Reader.call(this, props) -} - -DirReader.prototype._getEntries = function () { - var me = this - - // race condition. might pause() before calling _getEntries, - // and then resume, and try to get them a second time. - if (me._gotEntries) return - me._gotEntries = true - - fs.readdir(me._path, function (er, entries) { - if (er) return me.error(er) - - me.entries = entries - - me.emit("entries", entries) - if (me._paused) me.once("resume", processEntries) - else processEntries() - - function processEntries () { - me._length = me.entries.length - if (typeof me.sort === "function") { - me.entries = me.entries.sort(me.sort.bind(me)) - } - me._read() - } - }) -} - -// start walking the dir, and emit an "entry" event for each one. -DirReader.prototype._read = function () { - var me = this - - if (!me.entries) return me._getEntries() - - if (me._paused || me._currentEntry || me._aborted) { - // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted) - return - } - - me._index ++ - if (me._index >= me.entries.length) { - if (!me._ended) { - me._ended = true - me.emit("end") - me.emit("close") - } - return - } - - // ok, handle this one, then. - - // save creating a proxy, by stat'ing the thing now. - var p = path.resolve(me._path, me.entries[me._index]) - assert(p !== me._path) - assert(me.entries[me._index]) - - // set this to prevent trying to _read() again in the stat time. - me._currentEntry = p - fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) { - if (er) return me.error(er) - - var who = me._proxy || me - - stat.path = p - stat.basename = path.basename(p) - stat.dirname = path.dirname(p) - var childProps = me.getChildProps.call(who, stat) - childProps.path = p - childProps.basename = path.basename(p) - childProps.dirname = path.dirname(p) - - var entry = Reader(childProps, stat) - - // console.error("DR Entry", p, stat.size) - - me._currentEntry = entry - - // "entry" events are for direct entries in a specific dir. - // "child" events are for any and all children at all levels. - // This nomenclature is not completely final. - - entry.on("pause", function (who) { - if (!me._paused && !entry._disowned) { - me.pause(who) - } - }) - - entry.on("resume", function (who) { - if (me._paused && !entry._disowned) { - me.resume(who) - } - }) - - entry.on("stat", function (props) { - me.emit("_entryStat", entry, props) - if (entry._aborted) return - if (entry._paused) entry.once("resume", function () { - me.emit("entryStat", entry, props) - }) - else me.emit("entryStat", entry, props) - }) - - entry.on("ready", function EMITCHILD () { - // console.error("DR emit child", entry._path) - if (me._paused) { - // console.error(" DR emit child - try again later") - // pause the child, and emit the "entry" event once we drain. - // console.error("DR pausing child entry") - entry.pause(me) - return me.once("resume", EMITCHILD) - } - - // skip over sockets. they can't be piped around properly, - // so there's really no sense even acknowledging them. - // if someone really wants to see them, they can listen to - // the "socket" events. - if (entry.type === "Socket") { - me.emit("socket", entry) - } else { - me.emitEntry(entry) - } - }) - - var ended = false - entry.on("close", onend) - entry.on("disown", onend) - function onend () { - if (ended) return - ended = true - me.emit("childEnd", entry) - me.emit("entryEnd", entry) - me._currentEntry = null - if (!me._paused) { - me._read() - } - } - - // XXX Remove this. Works in node as of 0.6.2 or so. - // Long filenames should not break stuff. - entry.on("error", function (er) { - if (entry._swallowErrors) { - me.warn(er) - entry.emit("end") - entry.emit("close") - } else { - me.emit("error", er) - } - }) - - // proxy up some events. - ; [ "child" - , "childEnd" - , "warn" - ].forEach(function (ev) { - entry.on(ev, me.emit.bind(me, ev)) - }) - }) -} - -DirReader.prototype.disown = function (entry) { - entry.emit("beforeDisown") - entry._disowned = true - entry.parent = entry.root = null - if (entry === this._currentEntry) { - this._currentEntry = null - } - entry.emit("disown") -} - -DirReader.prototype.getChildProps = function (stat) { - return { depth: this.depth + 1 - , root: this.root || this - , parent: this - , follow: this.follow - , filter: this.filter - , sort: this.props.sort - } -} - -DirReader.prototype.pause = function (who) { - var me = this - if (me._paused) return - who = who || me - me._paused = true - if (me._currentEntry && me._currentEntry.pause) { - me._currentEntry.pause(who) - } - me.emit("pause", who) -} - -DirReader.prototype.resume = function (who) { - var me = this - if (!me._paused) return - who = who || me - - me._paused = false - // console.error("DR Emit Resume", me._path) - me.emit("resume", who) - if (me._paused) { - // console.error("DR Re-paused", me._path) - return - } - - if (me._currentEntry) { - if (me._currentEntry.resume) me._currentEntry.resume(who) - } else me._read() -} - -DirReader.prototype.emitEntry = function (entry) { - this.emit("entry", entry) - this.emit("child", entry) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js deleted file mode 100644 index 7073b88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js +++ /dev/null @@ -1,171 +0,0 @@ -// It is expected that, when .add() returns false, the consumer -// of the DirWriter will pause until a "drain" event occurs. Note -// that this is *almost always going to be the case*, unless the -// thing being written is some sort of unsupported type, and thus -// skipped over. - -module.exports = DirWriter - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Writer = require("./writer.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , collect = require("./collect.js") - -inherits(DirWriter, Writer) - -function DirWriter (props) { - var me = this - if (!(me instanceof DirWriter)) me.error( - "DirWriter must be called as constructor.", null, true) - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - me.error("Non-directory type "+ props.type + " " + - JSON.stringify(props), null, true) - } - - Writer.call(this, props) -} - -DirWriter.prototype._create = function () { - var me = this - mkdir(me._path, Writer.dirmode, function (er) { - if (er) return me.error(er) - // ready to start getting entries! - me.ready = true - me.emit("ready") - me._process() - }) -} - -// a DirWriter has an add(entry) method, but its .write() doesn't -// do anything. Why a no-op rather than a throw? Because this -// leaves open the door for writing directory metadata for -// gnu/solaris style dumpdirs. -DirWriter.prototype.write = function () { - return true -} - -DirWriter.prototype.end = function () { - this._ended = true - this._process() -} - -DirWriter.prototype.add = function (entry) { - var me = this - - // console.error("\tadd", entry._path, "->", me._path) - collect(entry) - if (!me.ready || me._currentEntry) { - me._buffer.push(entry) - return false - } - - // create a new writer, and pipe the incoming entry into it. - if (me._ended) { - return me.error("add after end") - } - - me._buffer.push(entry) - me._process() - - return 0 === this._buffer.length -} - -DirWriter.prototype._process = function () { - var me = this - - // console.error("DW Process p=%j", me._processing, me.basename) - - if (me._processing) return - - var entry = me._buffer.shift() - if (!entry) { - // console.error("DW Drain") - me.emit("drain") - if (me._ended) me._finish() - return - } - - me._processing = true - // console.error("DW Entry", entry._path) - - me.emit("entry", entry) - - // ok, add this entry - // - // don't allow recursive copying - var p = entry - do { - var pp = p._path || p.path - if (pp === me.root._path || pp === me._path || - (pp && pp.indexOf(me._path) === 0)) { - // console.error("DW Exit (recursive)", entry.basename, me._path) - me._processing = false - if (entry._collected) entry.pipe() - return me._process() - } - } while (p = p.parent) - - // console.error("DW not recursive") - - // chop off the entry's root dir, replace with ours - var props = { parent: me - , root: me.root || me - , type: entry.type - , depth: me.depth + 1 } - - var p = entry._path || entry.path || entry.props.path - if (entry.parent) { - p = p.substr(entry.parent._path.length + 1) - } - // get rid of any ../../ shenanigans - props.path = path.join(me.path, path.join("/", p)) - - // if i have a filter, the child should inherit it. - props.filter = me.filter - - // all the rest of the stuff, copy over from the source. - Object.keys(entry.props).forEach(function (k) { - if (!props.hasOwnProperty(k)) { - props[k] = entry.props[k] - } - }) - - // not sure at this point what kind of writer this is. - var child = me._currentChild = new Writer(props) - child.on("ready", function () { - // console.error("DW Child Ready", child.type, child._path) - // console.error(" resuming", entry._path) - entry.pipe(child) - entry.resume() - }) - - // XXX Make this work in node. - // Long filenames should not break stuff. - child.on("error", function (er) { - if (child._swallowErrors) { - me.warn(er) - child.emit("end") - child.emit("close") - } else { - me.emit("error", er) - } - }) - - // we fire _end internally *after* end, so that we don't move on - // until any "end" listeners have had their chance to do stuff. - child.on("close", onend) - var ended = false - function onend () { - if (ended) return - ended = true - // console.error("* DW Child end", child.basename) - me._currentChild = null - me._processing = false - me._process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js deleted file mode 100644 index b1f9861..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js +++ /dev/null @@ -1,147 +0,0 @@ -// Basically just a wrapper around an fs.ReadStream - -module.exports = FileReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - , EOF = {EOF: true} - , CLOSE = {CLOSE: true} - -inherits(FileReader, Reader) - -function FileReader (props) { - // console.error(" FR create", props.path, props.size, new Error().stack) - var me = this - if (!(me instanceof FileReader)) throw new Error( - "FileReader must be called as constructor.") - - // should already be established as a File type - // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, - // with a HardLinkReader class. - if (!((props.type === "Link" && props.Link) || - (props.type === "File" && props.File))) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesEmitted = 0 - Reader.call(me, props) -} - -FileReader.prototype._getStream = function () { - var me = this - , stream = me._stream = fs.createReadStream(me._path, me.props) - - if (me.props.blksize) { - stream.bufferSize = me.props.blksize - } - - stream.on("open", me.emit.bind(me, "open")) - - stream.on("data", function (c) { - // console.error("\t\t%d %s", c.length, me.basename) - me._bytesEmitted += c.length - // no point saving empty chunks - if (!c.length) return - else if (me._paused || me._buffer.length) { - me._buffer.push(c) - me._read() - } else me.emit("data", c) - }) - - stream.on("end", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering End", me._path) - me._buffer.push(EOF) - me._read() - } else { - me.emit("end") - } - - if (me._bytesEmitted !== me.props.size) { - me.error("Didn't get expected byte count\n"+ - "expect: "+me.props.size + "\n" + - "actual: "+me._bytesEmitted) - } - }) - - stream.on("close", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering Close", me._path) - me._buffer.push(CLOSE) - me._read() - } else { - // console.error("FR close 1", me._path) - me.emit("close") - } - }) - - me._read() -} - -FileReader.prototype._read = function () { - var me = this - // console.error("FR _read", me._path) - if (me._paused) { - // console.error("FR _read paused", me._path) - return - } - - if (!me._stream) { - // console.error("FR _getStream calling", me._path) - return me._getStream() - } - - // clear out the buffer, if there is one. - if (me._buffer.length) { - // console.error("FR _read has buffer", me._buffer.length, me._path) - var buf = me._buffer - for (var i = 0, l = buf.length; i < l; i ++) { - var c = buf[i] - if (c === EOF) { - // console.error("FR Read emitting buffered end", me._path) - me.emit("end") - } else if (c === CLOSE) { - // console.error("FR Read emitting buffered close", me._path) - me.emit("close") - } else { - // console.error("FR Read emitting buffered data", me._path) - me.emit("data", c) - } - - if (me._paused) { - // console.error("FR Read Re-pausing at "+i, me._path) - me._buffer = buf.slice(i) - return - } - } - me._buffer.length = 0 - } - // console.error("FR _read done") - // that's about all there is to it. -} - -FileReader.prototype.pause = function (who) { - var me = this - // console.error("FR Pause", me._path) - if (me._paused) return - who = who || me - me._paused = true - if (me._stream) me._stream.pause() - me.emit("pause", who) -} - -FileReader.prototype.resume = function (who) { - var me = this - // console.error("FR Resume", me._path) - if (!me._paused) return - who = who || me - me.emit("resume", who) - me._paused = false - if (me._stream) me._stream.resume() - me._read() -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js deleted file mode 100644 index 6811462..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = FileWriter - -var fs = require("graceful-fs") - , mkdir = require("mkdirp") - , Writer = require("./writer.js") - , inherits = require("inherits") - , EOF = {} - -inherits(FileWriter, Writer) - -function FileWriter (props) { - var me = this - if (!(me instanceof FileWriter)) throw new Error( - "FileWriter must be called as constructor.") - - // should already be established as a File type - if (props.type !== "File" || !props.File) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesWritten = 0 - - Writer.call(this, props) -} - -FileWriter.prototype._create = function () { - var me = this - if (me._stream) return - - var so = {} - if (me.props.flags) so.flags = me.props.flags - so.mode = Writer.filemode - if (me._old && me._old.blksize) so.bufferSize = me._old.blksize - - me._stream = fs.createWriteStream(me._path, so) - - me._stream.on("open", function (fd) { - // console.error("FW open", me._buffer, me._path) - me.ready = true - me._buffer.forEach(function (c) { - if (c === EOF) me._stream.end() - else me._stream.write(c) - }) - me.emit("ready") - // give this a kick just in case it needs it. - me.emit("drain") - }) - - me._stream.on("drain", function () { me.emit("drain") }) - - me._stream.on("close", function () { - // console.error("\n\nFW Stream Close", me._path, me.size) - me._finish() - }) -} - -FileWriter.prototype.write = function (c) { - var me = this - - me._bytesWritten += c.length - - if (!me.ready) { - if (!Buffer.isBuffer(c) && typeof c !== 'string') - throw new Error('invalid write data') - me._buffer.push(c) - return false - } - - var ret = me._stream.write(c) - // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length) - - // allow 2 buffered writes, because otherwise there's just too - // much stop and go bs. - return ret || (me._stream._queue && me._stream._queue.length <= 2) -} - -FileWriter.prototype.end = function (c) { - var me = this - - if (c) me.write(c) - - if (!me.ready) { - me._buffer.push(EOF) - return false - } - - return me._stream.end() -} - -FileWriter.prototype._finish = function () { - var me = this - if (typeof me.size === "number" && me._bytesWritten != me.size) { - me.error( - "Did not get expected byte count.\n" + - "expect: " + me.size + "\n" + - "actual: " + me._bytesWritten) - } - Writer.prototype._finish.call(me) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js deleted file mode 100644 index cd65c41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = getType - -function getType (st) { - var types = - [ "Directory" - , "File" - , "SymbolicLink" - , "Link" // special for hardlinks from tarballs - , "BlockDevice" - , "CharacterDevice" - , "FIFO" - , "Socket" ] - , type - - if (st.type && -1 !== types.indexOf(st.type)) { - st[st.type] = true - return st.type - } - - for (var i = 0, l = types.length; i < l; i ++) { - type = types[i] - var is = st[type] || st["is" + type] - if (typeof is === "function") is = is.call(st) - if (is) { - st[type] = true - st.type = type - return type - } - } - - return null -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js deleted file mode 100644 index 7e7ab6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js +++ /dev/null @@ -1,54 +0,0 @@ -// Basically just a wrapper around an fs.readlink -// -// XXX: Enhance this to support the Link type, by keeping -// a lookup table of {:}, so that hardlinks -// can be preserved in tarballs. - -module.exports = LinkReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(LinkReader, Reader) - -function LinkReader (props) { - var me = this - if (!(me instanceof LinkReader)) throw new Error( - "LinkReader must be called as constructor.") - - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - Reader.call(me, props) -} - -// When piping a LinkReader into a LinkWriter, we have to -// already have the linkpath property set, so that has to -// happen *before* the "ready" event, which means we need to -// override the _stat method. -LinkReader.prototype._stat = function (currentStat) { - var me = this - fs.readlink(me._path, function (er, linkpath) { - if (er) return me.error(er) - me.linkpath = me.props.linkpath = linkpath - me.emit("linkpath", linkpath) - Reader.prototype._stat.call(me, currentStat) - }) -} - -LinkReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we need - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js deleted file mode 100644 index 5c8f1e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js +++ /dev/null @@ -1,95 +0,0 @@ - -module.exports = LinkWriter - -var fs = require("graceful-fs") - , Writer = require("./writer.js") - , inherits = require("inherits") - , path = require("path") - , rimraf = require("rimraf") - -inherits(LinkWriter, Writer) - -function LinkWriter (props) { - var me = this - if (!(me instanceof LinkWriter)) throw new Error( - "LinkWriter must be called as constructor.") - - // should already be established as a Link type - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - if (props.linkpath === "") props.linkpath = "." - if (!props.linkpath) { - me.error("Need linkpath property to create " + props.type) - } - - Writer.call(this, props) -} - -LinkWriter.prototype._create = function () { - // console.error(" LW _create") - var me = this - , hard = me.type === "Link" || process.platform === "win32" - , link = hard ? "link" : "symlink" - , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath - - // can only change the link path by clobbering - // For hard links, let's just assume that's always the case, since - // there's no good way to read them if we don't already know. - if (hard) return clobber(me, lp, link) - - fs.readlink(me._path, function (er, p) { - // only skip creation if it's exactly the same link - if (p && p === lp) return finish(me) - clobber(me, lp, link) - }) -} - -function clobber (me, lp, link) { - rimraf(me._path, function (er) { - if (er) return me.error(er) - create(me, lp, link) - }) -} - -function create (me, lp, link) { - fs[link](lp, me._path, function (er) { - // if this is a hard link, and we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier in. - // Additionally, an EPERM or EACCES can happen on win32 if it's trying - // to make a link to a directory. Again, just skip it. - // A better solution would be to have fs.symlink be supported on - // windows in some nice fashion. - if (er) { - if ((er.code === "ENOENT" || - er.code === "EACCES" || - er.code === "EPERM" ) && process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - } else return me.error(er) - } - finish(me) - }) -} - -function finish (me) { - me.ready = true - me.emit("ready") - if (me._ended && !me._finished) me._finish() -} - -LinkWriter.prototype.end = function () { - // console.error("LW finish in end") - this._ended = true - if (this.ready) { - this._finished = true - this._finish() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js deleted file mode 100644 index a0ece34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js +++ /dev/null @@ -1,93 +0,0 @@ -// A reader for when we don't yet know what kind of thing -// the thing is. - -module.exports = ProxyReader - -var Reader = require("./reader.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , fs = require("graceful-fs") - -inherits(ProxyReader, Reader) - -function ProxyReader (props) { - var me = this - if (!(me instanceof ProxyReader)) throw new Error( - "ProxyReader must be called as constructor.") - - me.props = props - me._buffer = [] - me.ready = false - - Reader.call(me, props) -} - -ProxyReader.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Reader(props, current)) - }) -} - -ProxyReader.prototype._addProxy = function (proxy) { - var me = this - if (me._proxyTarget) { - return me.error("proxy already set") - } - - me._proxyTarget = proxy - proxy._proxy = me - - ; [ "error" - , "data" - , "end" - , "close" - , "linkpath" - , "entry" - , "entryEnd" - , "child" - , "childEnd" - , "warn" - , "stat" - ].forEach(function (ev) { - // console.error("~~ proxy event", ev, me.path) - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - proxy.on("ready", function () { - // console.error("~~ proxy is ready!", me.path) - me.ready = true - me.emit("ready") - }) - - var calls = me._buffer - me._buffer.length = 0 - calls.forEach(function (c) { - proxy[c[0]].apply(proxy, c[1]) - }) -} - -ProxyReader.prototype.pause = function () { - return this._proxyTarget ? this._proxyTarget.pause() : false -} - -ProxyReader.prototype.resume = function () { - return this._proxyTarget ? this._proxyTarget.resume() : false -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js deleted file mode 100644 index b047663..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js +++ /dev/null @@ -1,109 +0,0 @@ -// A writer for when we don't know what kind of thing -// the thing is. That is, it's not explicitly set, -// so we're going to make it whatever the thing already -// is, or "File" -// -// Until then, collect all events. - -module.exports = ProxyWriter - -var Writer = require("./writer.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , collect = require("./collect.js") - , fs = require("fs") - -inherits(ProxyWriter, Writer) - -function ProxyWriter (props) { - var me = this - if (!(me instanceof ProxyWriter)) throw new Error( - "ProxyWriter must be called as constructor.") - - me.props = props - me._needDrain = false - - Writer.call(me, props) -} - -ProxyWriter.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Writer(props, current)) - }) -} - -ProxyWriter.prototype._addProxy = function (proxy) { - // console.error("~~ set proxy", this.path) - var me = this - if (me._proxy) { - return me.error("proxy already set") - } - - me._proxy = proxy - ; [ "ready" - , "error" - , "close" - , "pipe" - , "drain" - , "warn" - ].forEach(function (ev) { - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - var calls = me._buffer - calls.forEach(function (c) { - // console.error("~~ ~~ proxy buffered call", c[0], c[1]) - proxy[c[0]].apply(proxy, c[1]) - }) - me._buffer.length = 0 - if (me._needsDrain) me.emit("drain") -} - -ProxyWriter.prototype.add = function (entry) { - // console.error("~~ proxy add") - collect(entry) - - if (!this._proxy) { - this._buffer.push(["add", [entry]]) - this._needDrain = true - return false - } - return this._proxy.add(entry) -} - -ProxyWriter.prototype.write = function (c) { - // console.error("~~ proxy write") - if (!this._proxy) { - this._buffer.push(["write", [c]]) - this._needDrain = true - return false - } - return this._proxy.write(c) -} - -ProxyWriter.prototype.end = function (c) { - // console.error("~~ proxy end") - if (!this._proxy) { - this._buffer.push(["end", [c]]) - return false - } - return this._proxy.end(c) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js deleted file mode 100644 index e4e1b48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js +++ /dev/null @@ -1,259 +0,0 @@ - -module.exports = Reader - -var fs = require("graceful-fs") - , Stream = require("stream").Stream - , inherits = require("inherits") - , path = require("path") - , getType = require("./get-type.js") - , hardLinks = Reader.hardLinks = {} - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Reader, Abstract) - -var DirReader = require("./dir-reader.js") - , FileReader = require("./file-reader.js") - , LinkReader = require("./link-reader.js") - , SocketReader = require("./socket-reader.js") - , ProxyReader = require("./proxy-reader.js") - -function Reader (props, currentStat) { - var me = this - if (!(me instanceof Reader)) return new Reader(props, currentStat) - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) { - me.error("Must provide a path", null, true) - } - - // polymorphism. - // call fstream.Reader(dir) to get a DirReader object, etc. - // Note that, unlike in the Writer case, ProxyReader is going - // to be the *normal* state of affairs, since we rarely know - // the type of a file prior to reading it. - - - var type - , ClassType - - if (props.type && typeof props.type === "function") { - type = props.type - ClassType = type - } else { - type = getType(props) - ClassType = Reader - } - - if (currentStat && !type) { - type = getType(currentStat) - props[type] = true - props.type = type - } - - switch (type) { - case "Directory": - ClassType = DirReader - break - - case "Link": - // XXX hard links are just files. - // However, it would be good to keep track of files' dev+inode - // and nlink values, and create a HardLinkReader that emits - // a linkpath value of the original copy, so that the tar - // writer can preserve them. - // ClassType = HardLinkReader - // break - - case "File": - ClassType = FileReader - break - - case "SymbolicLink": - ClassType = LinkReader - break - - case "Socket": - ClassType = SocketReader - break - - case null: - ClassType = ProxyReader - break - } - - if (!(me instanceof ClassType)) { - return new ClassType(props) - } - - Abstract.call(me) - - me.readable = true - me.writable = false - - me.type = type - me.props = props - me.depth = props.depth = props.depth || 0 - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - // how DOES one create files on the moon? - // if the path has spaces in it, then UNC will fail. - me._swallowErrors = true - //if (me._path.indexOf(" ") === -1) { - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - //} - } - } - me.basename = props.basename = path.basename(me.path) - me.dirname = props.dirname = path.dirname(me.path) - - // these have served their purpose, and are now just noisy clutter - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - me.filter = typeof props.filter === "function" ? props.filter : null - if (props.sort === "alpha") props.sort = alphasort - - // start the ball rolling. - // this will stat the thing, and then call me._read() - // to start reading whatever it is. - // console.error("calling stat", props.path, currentStat) - me._stat(currentStat) -} - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - -Reader.prototype._stat = function (currentStat) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - - // console.error("Reader._stat", me._path, currentStat) - if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) - else fs[stat](me._path, statCb) - - - function statCb (er, props_) { - // console.error("Reader._stat, statCb", me._path, props_, props_.nlink) - if (er) return me.error(er) - - Object.keys(props_).forEach(function (k) { - props[k] = props_[k] - }) - - // if it's not the expected size, then abort here. - if (undefined !== me.size && props.size !== me.size) { - return me.error("incorrect size") - } - me.size = props.size - - var type = getType(props) - // special little thing for handling hardlinks. - if (type !== "Directory" && props.nlink && props.nlink > 1) { - var k = props.dev + ":" + props.ino - // console.error("Reader has nlink", me._path, k) - if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path - else { - // switch into hardlink mode. - type = me.type = me.props.type = "Link" - me.Link = me.props.Link = true - me.linkpath = me.props.linkpath = hardLinks[k] - // console.error("Hardlink detected, switching mode", me._path, me.linkpath) - // Setting __proto__ would arguably be the "correct" - // approach here, but that just seems too wrong. - me._stat = me._read = LinkReader.prototype._read - } - } - - if (me.type && me.type !== type) { - me.error("Unexpected type: " + type) - } - - // if the filter doesn't pass, then just skip over this one. - // still have to emit end so that dir-walking can move on. - if (me.filter) { - var who = me._proxy || me - // special handling for ProxyReaders - if (!me.filter.call(who, who, props)) { - if (!me._disowned) { - me.abort() - me.emit("end") - me.emit("close") - } - return - } - } - - // last chance to abort or disown before the flow starts! - var events = ["_stat", "stat", "ready"] - var e = 0 - ;(function go () { - if (me._aborted) { - me.emit("end") - me.emit("close") - return - } - - if (me._paused) { - me.once("resume", go) - return - } - - var ev = events[e ++] - if (!ev) return me._read() - me.emit(ev, props) - go() - })() - } -} - -Reader.prototype.pipe = function (dest, opts) { - var me = this - if (typeof dest.add === "function") { - // piping to a multi-compatible, and we've got directory entries. - me.on("entry", function (entry) { - var ret = dest.add(entry) - if (false === ret) { - me.pause() - } - }) - } - - // console.error("R Pipe apply Stream Pipe") - return Stream.prototype.pipe.apply(this, arguments) -} - -Reader.prototype.pause = function (who) { - this._paused = true - who = who || this - this.emit("pause", who) - if (this._stream) this._stream.pause(who) -} - -Reader.prototype.resume = function (who) { - this._paused = false - who = who || this - this.emit("resume", who) - if (this._stream) this._stream.resume(who) - this._read() -} - -Reader.prototype._read = function () { - this.error("Cannot read unknown type: "+this.type) -} - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js deleted file mode 100644 index e89c173..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js +++ /dev/null @@ -1,38 +0,0 @@ -// Just get the stats, and then don't do anything. -// You can't really "read" from a socket. You "connect" to it. -// Mostly, this is here so that reading a dir with a socket in it -// doesn't blow up. - -module.exports = SocketReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(SocketReader, Reader) - -function SocketReader (props) { - var me = this - if (!(me instanceof SocketReader)) throw new Error( - "SocketReader must be called as constructor.") - - if (!(props.type === "Socket" && props.Socket)) { - throw new Error("Non-socket type "+ props.type) - } - - Reader.call(me, props) -} - -SocketReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we have - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js deleted file mode 100644 index 5599fb2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js +++ /dev/null @@ -1,389 +0,0 @@ - -module.exports = Writer - -var fs = require("graceful-fs") - , inherits = require("inherits") - , rimraf = require("rimraf") - , mkdir = require("mkdirp") - , path = require("path") - , umask = process.platform === "win32" ? 0 : process.umask() - , getType = require("./get-type.js") - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Writer, Abstract) - -Writer.dirmode = 0777 & (~umask) -Writer.filemode = 0666 & (~umask) - -var DirWriter = require("./dir-writer.js") - , LinkWriter = require("./link-writer.js") - , FileWriter = require("./file-writer.js") - , ProxyWriter = require("./proxy-writer.js") - -// props is the desired state. current is optionally the current stat, -// provided here so that subclasses can avoid statting the target -// more than necessary. -function Writer (props, current) { - var me = this - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) me.error("Must provide a path", null, true) - - // polymorphism. - // call fstream.Writer(dir) to get a DirWriter object, etc. - var type = getType(props) - , ClassType = Writer - - switch (type) { - case "Directory": - ClassType = DirWriter - break - case "File": - ClassType = FileWriter - break - case "Link": - case "SymbolicLink": - ClassType = LinkWriter - break - case null: - // Don't know yet what type to create, so we wrap in a proxy. - ClassType = ProxyWriter - break - } - - if (!(me instanceof ClassType)) return new ClassType(props) - - // now get down to business. - - Abstract.call(me) - - // props is what we want to set. - // set some convenience properties as well. - me.type = props.type - me.props = props - me.depth = props.depth || 0 - me.clobber = false === props.clobber ? props.clobber : true - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - me._swallowErrors = true - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - } - } - me.basename = path.basename(props.path) - me.dirname = path.dirname(props.path) - me.linkpath = props.linkpath || null - - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - - if (typeof props.mode === "string") { - props.mode = parseInt(props.mode, 8) - } - - me.readable = false - me.writable = true - - // buffer until ready, or while handling another entry - me._buffer = [] - me.ready = false - - me.filter = typeof props.filter === "function" ? props.filter: null - - // start the ball rolling. - // this checks what's there already, and then calls - // me._create() to call the impl-specific creation stuff. - me._stat(current) -} - -// Calling this means that it's something we can't create. -// Just assert that it's already there, otherwise raise a warning. -Writer.prototype._create = function () { - var me = this - fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) { - if (er) { - return me.warn("Cannot create " + me._path + "\n" + - "Unsupported type: "+me.type, "ENOTSUP") - } - me._finish() - }) -} - -Writer.prototype._stat = function (current) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - , who = me._proxy || me - - if (current) statCb(null, current) - else fs[stat](me._path, statCb) - - function statCb (er, current) { - if (me.filter && !me.filter.call(who, who, current)) { - me._aborted = true - me.emit("end") - me.emit("close") - return - } - - // if it's not there, great. We'll just create it. - // if it is there, then we'll need to change whatever differs - if (er || !current) { - return create(me) - } - - me._old = current - var currentType = getType(current) - - // if it's a type change, then we need to clobber or error. - // if it's not a type change, then let the impl take care of it. - if (currentType !== me.type) { - return rimraf(me._path, function (er) { - if (er) return me.error(er) - me._old = null - create(me) - }) - } - - // otherwise, just handle in the app-specific way - // this creates a fs.WriteStream, or mkdir's, or whatever - create(me) - } -} - -function create (me) { - // console.error("W create", me._path, Writer.dirmode) - - // XXX Need to clobber non-dirs that are in the way, - // unless { clobber: false } in the props. - mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) { - // console.error("W created", path.dirname(me._path), er) - if (er) return me.error(er) - - // later on, we have to set the mode and owner for these - me._madeDir = made - return me._create() - }) -} - -function endChmod (me, want, current, path, cb) { - var wantMode = want.mode - , chmod = want.follow || me.type !== "SymbolicLink" - ? "chmod" : "lchmod" - - if (!fs[chmod]) return cb() - if (typeof wantMode !== "number") return cb() - - var curMode = current.mode & 0777 - wantMode = wantMode & 0777 - if (wantMode === curMode) return cb() - - fs[chmod](path, wantMode, cb) -} - - -function endChown (me, want, current, path, cb) { - // Don't even try it unless root. Too easy to EPERM. - if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() - if (typeof want.uid !== "number" && - typeof want.gid !== "number" ) return cb() - - if (current.uid === want.uid && - current.gid === want.gid) return cb() - - var chown = (me.props.follow || me.type !== "SymbolicLink") - ? "chown" : "lchown" - if (!fs[chown]) return cb() - - if (typeof want.uid !== "number") want.uid = current.uid - if (typeof want.gid !== "number") want.gid = current.gid - - fs[chown](path, want.uid, want.gid, cb) -} - -function endUtimes (me, want, current, path, cb) { - if (!fs.utimes || process.platform === "win32") return cb() - - var utimes = (want.follow || me.type !== "SymbolicLink") - ? "utimes" : "lutimes" - - if (utimes === "lutimes" && !fs[utimes]) { - utimes = "utimes" - } - - if (!fs[utimes]) return cb() - - var curA = current.atime - , curM = current.mtime - , meA = want.atime - , meM = want.mtime - - if (meA === undefined) meA = curA - if (meM === undefined) meM = curM - - if (!isDate(meA)) meA = new Date(meA) - if (!isDate(meM)) meA = new Date(meM) - - if (meA.getTime() === curA.getTime() && - meM.getTime() === curM.getTime()) return cb() - - fs[utimes](path, meA, meM, cb) -} - - -// XXX This function is beastly. Break it up! -Writer.prototype._finish = function () { - var me = this - - // console.error(" W Finish", me._path, me.size) - - // set up all the things. - // At this point, we're already done writing whatever we've gotta write, - // adding files to the dir, etc. - var todo = 0 - var errState = null - var done = false - - if (me._old) { - // the times will almost *certainly* have changed. - // adds the utimes syscall, but remove another stat. - me._old.atime = new Date(0) - me._old.mtime = new Date(0) - // console.error(" W Finish Stale Stat", me._path, me.size) - setProps(me._old) - } else { - var stat = me.props.follow ? "stat" : "lstat" - // console.error(" W Finish Stating", me._path, me.size) - fs[stat](me._path, function (er, current) { - // console.error(" W Finish Stated", me._path, me.size, current) - if (er) { - // if we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier on. - if (er.code === "ENOENT" && - (me.type === "Link" || me.type === "SymbolicLink") && - process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - return - } else return me.error(er) - } - setProps(me._old = current) - }) - } - - return - - function setProps (current) { - todo += 3 - endChmod(me, me.props, current, me._path, next("chmod")) - endChown(me, me.props, current, me._path, next("chown")) - endUtimes(me, me.props, current, me._path, next("utimes")) - } - - function next (what) { - return function (er) { - // console.error(" W Finish", what, todo) - if (errState) return - if (er) { - er.fstream_finish_call = what - return me.error(errState = er) - } - if (--todo > 0) return - if (done) return - done = true - - // we may still need to set the mode/etc. on some parent dirs - // that were created previously. delay end/close until then. - if (!me._madeDir) return end() - else endMadeDir(me, me._path, end) - - function end (er) { - if (er) { - er.fstream_finish_call = "setupMadeDir" - return me.error(er) - } - // all the props have been set, so we're completely done. - me.emit("end") - me.emit("close") - } - } - } -} - -function endMadeDir (me, p, cb) { - var made = me._madeDir - // everything *between* made and path.dirname(me._path) - // needs to be set up. Note that this may just be one dir. - var d = path.dirname(p) - - endMadeDir_(me, d, function (er) { - if (er) return cb(er) - if (d === made) { - return cb() - } - endMadeDir(me, d, cb) - }) -} - -function endMadeDir_ (me, p, cb) { - var dirProps = {} - Object.keys(me.props).forEach(function (k) { - dirProps[k] = me.props[k] - - // only make non-readable dirs if explicitly requested. - if (k === "mode" && me.type !== "Directory") { - dirProps[k] = dirProps[k] | 0111 - } - }) - - var todo = 3 - , errState = null - fs.stat(p, function (er, current) { - if (er) return cb(errState = er) - endChmod(me, dirProps, current, p, next) - endChown(me, dirProps, current, p, next) - endUtimes(me, dirProps, current, p, next) - }) - - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- todo === 0) return cb() - } -} - -Writer.prototype.pipe = function () { - this.error("Can't pipe from writable stream") -} - -Writer.prototype.add = function () { - this.error("Cannot add to non-Directory type") -} - -Writer.prototype.write = function () { - return true -} - -function objectToString (d) { - return Object.prototype.toString.call(d) -} - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json deleted file mode 100644 index 1b4a21c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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": "2.0.1", - "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* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2.0.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index afc83b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,228 +0,0 @@ -var fs = require('fs') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - 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') - - 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.end() - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json deleted file mode 100644 index 3bad3de..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "fstream", - "description": "Advanced file system stream things", - "version": "0.1.24", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/fstream.git" - }, - "main": "fstream.js", - "engines": { - "node": ">=0.6" - }, - "dependencies": { - "rimraf": "2", - "mkdirp": "0.3", - "graceful-fs": "~2.0.0", - "inherits": "~2.0.0" - }, - "devDependencies": { - "tap": "" - }, - "scripts": { - "test": "tap examples/*.js" - }, - "license": "BSD", - "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/fstream/issues" - }, - "_id": "fstream@0.1.24", - "_from": "fstream@~0.1.8" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md deleted file mode 100644 index b1c5665..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json deleted file mode 100644 index cee4a9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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" - }, - "_id": "inherits@2.0.1", - "_from": "inherits@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js deleted file mode 100644 index fc53012..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json deleted file mode 100644 index 4c9e2cd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "tar", - "description": "tar for node", - "version": "0.1.18", - "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## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-tar/issues" - }, - "_id": "tar@0.1.18", - "_from": "tar@~0.1.18" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js deleted file mode 100644 index a81298b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js +++ /dev/null @@ -1,173 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js deleted file mode 100644 index 1524ff7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js +++ /dev/null @@ -1,53 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js deleted file mode 100644 index fff4818..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js +++ /dev/null @@ -1,358 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz deleted file mode 100644 index 4501bcf..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js deleted file mode 100644 index 8ea6f79..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js +++ /dev/null @@ -1,183 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js deleted file mode 100644 index 5bf0e54..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js +++ /dev/null @@ -1,854 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js deleted file mode 100644 index 0f50994..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js +++ /dev/null @@ -1,897 +0,0 @@ - -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js deleted file mode 100644 index f765a50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js +++ /dev/null @@ -1,359 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js deleted file mode 100644 index a00ff7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js +++ /dev/null @@ -1,20 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore deleted file mode 100644 index 0593600..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.\#* -/node_modules -\#* -npm-debug.log -node_modules -*.tgz diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml deleted file mode 100644 index ec43125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.11" - - "0.10" - - "0.8" - - "0.6" \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE deleted file mode 100644 index 0146c4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 Bruce Williams - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md deleted file mode 100644 index d7fb9c3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md +++ /dev/null @@ -1,277 +0,0 @@ -node-temp -========= - -Temporary files, directories, and streams for Node.js. - -Handles generating a unique file/directory name under the appropriate -system temporary directory, changing the file to an appropriate mode, -and supports automatic removal (if asked) - -`temp` has a similar API to the `fs` module. - -Node.js Compatibility ---------------------- - -Supports v0.6.0+. - -[![Build Status](https://travis-ci.org/bruce/node-temp.png)](https://travis-ci.org/bruce/node-temp) - -Please let me know if you have problems running it on a later version of Node.js or -have platform-specific problems. - -Installation ------------- - -Install it using [npm](http://github.com/isaacs/npm): - - $ npm install temp - -Or get it directly from: -http://github.com/bruce/node-temp - -Synopsis --------- - -You can create temporary files with `open` and `openSync`, temporary -directories with `mkdir` and `mkdirSync`, or you can get a unique name -in the system temporary directory with `path`. - -Working copies of the following examples can be found under the -`examples` directory. - -### Temporary Files - -To create a temporary file use `open` or `openSync`, passing -them an optional prefix, suffix, or both (see below for details on -affixes). The object passed to the callback (or returned) has -`path` and `fd` keys: - -```javascript -{ path: "/path/to/file", -, fd: theFileDescriptor -} -``` - -In this example we write to a temporary file and call out to `grep` and -`wc -l` to determine the number of time `foo` occurs in the text. The -temporary file is chmod'd `0600` and cleaned up automatically when the -process at exit (because `temp.track()` is called): - -```javascript -var temp = require('temp'), - fs = require('fs'), - util = require('util'), - exec = require('child_process').exec; - -// Automatically track and cleanup files at exit -temp.track(); - -// Fake data -var myData = "foo\nbar\nfoo\nbaz"; - -// Process the data (note: error handling omitted) -temp.open('myprefix', function(err, info) { - fs.write(info.fd, myData); - fs.close(info.fd, function(err) { - exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) { - util.puts(stdout.trim()); - }); - }); -}); -``` - -### Want Cleanup? Make sure you ask for it. - -As noted in the example above, if you want temp to track the files and directories -it creates and handle removing those files and directories on exit, you must call `track()`. -It's recommended that you do this immediately after requiring the module. - -```javascript -var temp = require("temp"); -temp.track(); -``` - -Why is this necessary? In pre-0.6 versions of temp, tracking was automatic. While this works -great for scripts and [Grunt tasks](http://gruntjs.com/), it's not so great for long-running -server processes. Since that's arguably what Node.js is _for_, you have to opt-in to tracking. - -But it's easy. - -#### Cleanup anytime - -When tracking, you can `cleanup()` anytime. An object will be returned with cleanup statistics -and the file/directory lists will be reset. - -```javascript -> temp.cleanup(); -{ files: { removed: 1, missing: 0 }, - dirs: { removed: 0, missing: 0 } } -``` - -Note: If you're not tracking, `false` will be returned. - -### Temporary Directories - -To create a temporary directory, use `mkdir` or `mkdirSync`, passing -it an optional prefix, suffix, or both (see below for details on affixes). - -In this example we create a temporary directory, write to a file -within it, call out to an external program to create a PDF, and read -the result. While the external process creates a lot of additional -files, the temporary directory is removed automatically at exit (because -`temp.track()` is called): - -```javascript -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - path = require('path'), - exec = require('child_process').exec; - -// Automatically track and cleanup files at exit -temp.track(); - -// For use with ConTeXt, http://wiki.contextgarden.net -var myData = "\\starttext\nHello World\n\\stoptext"; - -temp.mkdir('pdfcreator', function(err, dirPath) { - var inputPath = path.join(dirPath, 'input.tex') - fs.writeFile(inputPath, myData, function(err) { - if (err) throw err; - process.chdir(dirPath); - exec("texexec '" + inputPath + "'", function(err) { - if (err) throw err; - fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) { - if (err) throw err; - sys.print(data); - }); - }); - }); -}); -``` - -### Temporary Streams - -To create a temporary WriteStream, use 'createWriteStream', which sits -on top of `fs.createWriteStream`. The return value is a -`fs.WriteStream` whose `path` is registered for removal when -`temp.cleanup` is called (because `temp.track()` is called). - -```javascript -var temp = require('temp'); - -// Automatically track and cleanup files at exit -temp.track(); - -var stream = temp.createWriteStream(); -stream.write("Some data"); -// Maybe do some other things -stream.end(); -``` - -### Affixes - -You can provide custom prefixes and suffixes when creating temporary -files and directories. If you provide a string, it is used as the prefix -for the temporary name. If you provide an object with `prefix`, -`suffix` and `dir` keys, they are used for the temporary name. - -Here are some examples: - -* `"aprefix"`: A simple prefix, prepended to the filename; this is - shorthand for: -* `{prefix: "aprefix"}`: A simple prefix, prepended to the filename -* `{suffix: ".asuffix"}`: A suffix, appended to the filename - (especially useful when the file needs to be named with specific - extension for use with an external program). -* `{prefix: "myprefix", suffix: "mysuffix"}`: Customize both affixes -* `{dir: path.join(os.tmpDir()), "myapp"}`: default prefix and suffix - within a new temporary directory. -* `null`: Use the defaults for files and directories (prefixes `"f-"` - and `"d-"`, respectively, no suffixes). - -In this simple example we read a `pdf`, write it to a temporary file with -a `.pdf` extension, and close it. - -```javascript -var fs = require('fs'), - temp = require('temp'); - -fs.readFile('/path/to/source.pdf', function(err, data) { - temp.open({suffix: '.pdf'}, function(err, info) { - if (err) throw err; - fs.write(info.fd, contents); - fs.close(info.fd, function(err) { - if (err) throw err; - // Do something with the file - }); - }); -}); -``` - -### Just a path, please - -If you just want a unique name in your temporary directory, use -`path`: - -```javascript -var fs = require('fs'); -var tempName = temp.path({suffix: '.pdf'}); -// Do something with tempName -``` - -Note: The file isn't created for you, and the mode is not changed -- and it -will not be removed automatically at exit. If you use `path`, it's -all up to you. - -Using it with Grunt -------------------- - -If you want to use the module with [Grunt](http://gruntjs.com/), make sure you -use `async()` in your Gruntfile: - -```javascript -module.exports = function (grunt) { - var temp = require("temp"); - temp.track(); // Cleanup files, please - grunt.registerTast("temptest", "Testing temp", function() { - - var done = this.async(); // Don't forget this! - - grunt.log.writeln("About to write a file..."); - temp.open('tempfile', function(err, info) { - // File writing shenanigans here - grunt.log.writeln("Wrote a file!") - - done(); // REALLY don't forget this! - - }); - }); -}; -``` - -For more information, see the [Grunt FAQ](http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete). - -Testing -------- - -For now, run `test/temp-test.js`: - - $ node test/temp-test.js - -Contributing ------------- - -You can find the repository at: -http://github.com/bruce/node-temp - -Issues/Feature Requests can be submitted at: -http://github.com/bruce/node-temp/issues - -I'd really like to hear your feedback, and I'd love to receive your -pull-requests! - -Copyright ---------- - -Copyright (c) 2010-2012 Bruce Williams. See LICENSE for details. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js deleted file mode 100644 index 420d864..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js +++ /dev/null @@ -1,18 +0,0 @@ -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - exec = require('child_process').exec; - -var myData = "foo\nbar\nfoo\nbaz"; - -temp.open('myprefix', function(err, info) { - if (err) throw err; - fs.write(info.fd, myData); - fs.close(info.fd, function(err) { - if (err) throw err; - exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) { - if (err) throw err; - util.puts(stdout.trim()); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js deleted file mode 100644 index 63fd277..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js +++ /dev/null @@ -1,22 +0,0 @@ -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - path = require('path'), - exec = require('child_process').exec; - -var myData = "\\starttext\nHello World\n\\stoptext"; - -temp.mkdir('pdfcreator', function(err, dirPath) { - var inputPath = path.join(dirPath, 'input.tex') - fs.writeFile(inputPath, myData, function(err) { - if (err) throw err; - process.chdir(dirPath); - exec("texexec '" + inputPath + "'", function(err) { - if (err) throw err; - fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) { - if (err) throw err; - util.print(data); - }); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js deleted file mode 100644 index 41edf98..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js +++ /dev/null @@ -1,182 +0,0 @@ -var fs = require('fs'), - os = require('osenv'), - path = require('path'), - cnst = require('constants'); - -/* HELPERS */ - -var RDWR_EXCL = cnst.O_CREAT | cnst.O_TRUNC | cnst.O_RDWR | cnst.O_EXCL; - -var environmentVariables = ['TMPDIR', 'TMP', 'TEMP']; - -var generateName = function(rawAffixes, defaultPrefix) { - var affixes = parseAffixes(rawAffixes, defaultPrefix); - var now = new Date(); - var name = [affixes.prefix, - now.getYear(), now.getMonth(), now.getDate(), - '-', - process.pid, - '-', - (Math.random() * 0x100000000 + 1).toString(36), - affixes.suffix].join(''); - return path.join(affixes.dir || exports.dir, name); -} - -var parseAffixes = function(rawAffixes, defaultPrefix) { - var affixes = {prefix: null, suffix: null}; - if(rawAffixes) { - switch (typeof(rawAffixes)) { - case 'string': - affixes.prefix = rawAffixes; - break; - case 'object': - affixes = rawAffixes; - break - default: - throw("Unknown affix declaration: " + affixes); - } - } else { - affixes.prefix = defaultPrefix; - } - return affixes; -} - -/* ------------------------------------------------------------------------- - * Don't forget to call track() if you want file tracking and exit handlers! - * ------------------------------------------------------------------------- - * When any temp file or directory is created, it is added to filesToDelete - * or dirsToDelete. The first time any temp file is created, a listener is - * added to remove all temp files and directories at exit. - */ -var tracking = false; -var track = function(value) { - tracking = (value != false) -}; -var exitListenerAttached = false; -var filesToDelete = []; -var dirsToDelete = []; - -var deleteFileOnExit = function(filePath) { - if (!tracking) return false; - attachExitListener(); - filesToDelete.push(filePath); -}; - -var deleteDirOnExit = function(dirPath) { - if (!tracking) return false; - attachExitListener(); - dirsToDelete.push(dirPath); -}; - -var attachExitListener = function() { - if (!tracking) return false; - if (!exitListenerAttached) { - process.addListener('exit', cleanup); - exitListenerAttached = true; - } -}; - -var cleanupFiles = function() { - if (!tracking) return false; - var counts = {removed: 0, missing: 0} - var toDelete; - while (toDelete = filesToDelete.shift()) { - try { - fs.unlinkSync(toDelete); - counts.removed++; - } catch (rmErr) { - /* removed normally */ - counts.missing++; - } - } - return counts; -}; - -var cleanupDirs = function() { - if (!tracking) return false; - var rimrafSync = require('rimraf').sync; - var counts = {removed: 0, missing: 0} - var toDelete; - while (toDelete = dirsToDelete.shift()) { - try { - rimrafSync(toDelete, function (er) { - if (er) { - throw er; - } else { - counts.removed++; - } - }); - } catch (rmErr) { - /* removed normally */ - counts.missing++; - } - } - return counts; -}; - -var cleanup = function() { - if (!tracking) return false; - fileCount = cleanupFiles(); - dirCount = cleanupDirs(); - return {files: fileCount, dirs: dirCount}; -} - -/* DIRECTORIES */ - -var mkdir = function(affixes, callback) { - var dirPath = generateName(affixes, 'd-'); - fs.mkdir(dirPath, 0700, function(err) { - if (!err) { - deleteDirOnExit(dirPath); - } - if (callback) - callback(err, dirPath); - }); -} -var mkdirSync = function(affixes) { - var dirPath = generateName(affixes, 'd-'); - fs.mkdirSync(dirPath, 0700); - deleteDirOnExit(dirPath); - return dirPath; -} - -/* FILES */ - -var open = function(affixes, callback) { - var filePath = generateName(affixes, 'f-') - fs.open(filePath, RDWR_EXCL, 0600, function(err, fd) { - if (!err) - deleteFileOnExit(filePath); - if (callback) - callback(err, {path: filePath, fd: fd}); - }); -} - -var openSync = function(affixes) { - var filePath = generateName(affixes, 'f-') - var fd = fs.openSync(filePath, RDWR_EXCL, 0600); - deleteFileOnExit(filePath); - return {path: filePath, fd: fd}; -} - -var createWriteStream = function(affixes) { - var filePath = generateName(affixes, 's-') - var stream = fs.createWriteStream(filePath, {flags: RDWR_EXCL, mode: 0600}); - deleteFileOnExit(filePath); - return stream; -} - -/* EXPORTS */ -// Settings -exports.dir = path.resolve(os.tmpdir()); -exports.track = track; -// Functions -exports.mkdir = mkdir; -exports.mkdirSync = mkdirSync; -exports.open = open; -exports.openSync = openSync; -exports.path = generateName; -exports.cleanup = cleanup; -exports.createWriteStream = createWriteStream; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md deleted file mode 100644 index 08fd900..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# osenv - -Look up environment settings specific to different operating systems. - -## Usage - -```javascript -var osenv = require('osenv') -var path = osenv.path() -var user = osenv.user() -// etc. - -// Some things are not reliably in the env, and have a fallback command: -var h = osenv.hostname(function (er, hostname) { - h = hostname -}) -// This will still cause it to be memoized, so calling osenv.hostname() -// is now an immediate operation. - -// You can always send a cb, which will get called in the nextTick -// if it's been memoized, or wait for the fallback data if it wasn't -// found in the environment. -osenv.hostname(function (er, hostname) { - if (er) console.error('error looking up hostname') - else console.log('this machine calls itself %s', hostname) -}) -``` - -## osenv.hostname() - -The machine name. Calls `hostname` if not found. - -## osenv.user() - -The currently logged-in user. Calls `whoami` if not found. - -## osenv.prompt() - -Either PS1 on unix, or PROMPT on Windows. - -## osenv.tmpdir() - -The place where temporary files should be created. - -## osenv.home() - -No place like it. - -## osenv.path() - -An array of the places that the operating system will search for -executables. - -## osenv.editor() - -Return the executable name of the editor program. This uses the EDITOR -and VISUAL environment variables, and falls back to `vi` on Unix, or -`notepad.exe` on Windows. - -## osenv.shell() - -The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash' -or 'cmd'. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js deleted file mode 100644 index e3367a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js +++ /dev/null @@ -1,80 +0,0 @@ -var isWindows = process.platform === 'win32' -var windir = isWindows ? process.env.windir || 'C:\\Windows' : null -var path = require('path') -var exec = require('child_process').exec - -// looking up envs is a bit costly. -// Also, sometimes we want to have a fallback -// Pass in a callback to wait for the fallback on failures -// After the first lookup, always returns the same thing. -function memo (key, lookup, fallback) { - var fell = false - var falling = false - exports[key] = function (cb) { - var val = lookup() - if (!val && !fell && !falling && fallback) { - fell = true - falling = true - exec(fallback, function (er, output, stderr) { - falling = false - if (er) return // oh well, we tried - val = output.trim() - }) - } - exports[key] = function (cb) { - if (cb) process.nextTick(cb.bind(null, null, val)) - return val - } - if (cb && !falling) process.nextTick(cb.bind(null, null, val)) - return val - } -} - -memo('user', function () { - return ( isWindows - ? process.env.USERDOMAIN + '\\' + process.env.USERNAME - : process.env.USER - ) -}, 'whoami') - -memo('prompt', function () { - return isWindows ? process.env.PROMPT : process.env.PS1 -}) - -memo('hostname', function () { - return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME -}, 'hostname') - -memo('tmpdir', function () { - var t = isWindows ? 'temp' : 'tmp' - return process.env.TMPDIR || - process.env.TMP || - process.env.TEMP || - ( exports.home() ? path.resolve(exports.home(), t) - : isWindows ? path.resolve(windir, t) - : '/tmp' - ) -}) - -memo('home', function () { - return ( isWindows ? process.env.USERPROFILE - : process.env.HOME - ) -}) - -memo('path', function () { - return (process.env.PATH || - process.env.Path || - process.env.path).split(isWindows ? ';' : ':') -}) - -memo('editor', function () { - return process.env.EDITOR || - process.env.VISUAL || - (isWindows ? 'notepad.exe' : 'vi') -}) - -memo('shell', function () { - return isWindows ? process.env.ComSpec || 'cmd' - : process.env.SHELL || 'bash' -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json deleted file mode 100644 index 721c45f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "osenv", - "version": "0.0.3", - "main": "osenv.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.2.5" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/osenv" - }, - "keywords": [ - "environment", - "variable", - "home", - "tmpdir", - "path", - "prompt", - "ps1" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "description": "Look up environment settings specific to different operating systems", - "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/osenv/issues" - }, - "_id": "osenv@0.0.3", - "_from": "osenv@0.0.3" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js deleted file mode 100644 index b72eb0b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js +++ /dev/null @@ -1,76 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform === 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip unix tests, this is not unix\n') - return -} -var tap = require('tap') - -// like unix, but funny -process.env.USER = 'sirUser' -process.env.HOME = '/home/sirUser' -process.env.HOSTNAME = 'my-machine' -process.env.TMPDIR = '/tmpdir' -process.env.TMP = '/tmp' -process.env.TEMP = '/temp' -process.env.PATH = '/opt/local/bin:/usr/local/bin:/usr/bin/:bin' -process.env.PS1 = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.SHELL = 'zsh' - - -tap.test('basic unix sanity test', function (t) { - var osenv = require('../osenv.js') - - t.equal(osenv.user(), process.env.USER) - t.equal(osenv.home(), process.env.HOME) - t.equal(osenv.hostname(), process.env.HOSTNAME) - t.same(osenv.path(), process.env.PATH.split(':')) - t.equal(osenv.prompt(), process.env.PS1) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), '/home/sirUser/tmp') - - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), '/tmp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'vi') - - t.equal(osenv.shell(), 'zsh') - process.env.SHELL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'bash') - - t.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js deleted file mode 100644 index dd3fe80..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js +++ /dev/null @@ -1,82 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform !== 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip windows tests, this is not windows\n') - return -} - -// load this before clubbing the platform name. -var tap = require('tap') - -process.env.windir = 'C:\\windows' -process.env.USERDOMAIN = 'some-domain' -process.env.USERNAME = 'sirUser' -process.env.USERPROFILE = 'C:\\Users\\sirUser' -process.env.COMPUTERNAME = 'my-machine' -process.env.TMPDIR = 'C:\\tmpdir' -process.env.TMP = 'C:\\tmp' -process.env.TEMP = 'C:\\temp' -process.env.Path = 'C:\\Program Files\\;C:\\Binary Stuff\\bin' -process.env.PROMPT = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.ComSpec = 'some-com' - -tap.test('basic windows sanity test', function (t) { - var osenv = require('../osenv.js') - - var osenv = require('../osenv.js') - - t.equal(osenv.user(), - process.env.USERDOMAIN + '\\' + process.env.USERNAME) - t.equal(osenv.home(), process.env.USERPROFILE) - t.equal(osenv.hostname(), process.env.COMPUTERNAME) - t.same(osenv.path(), process.env.Path.split(';')) - t.equal(osenv.prompt(), process.env.PROMPT) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), 'C:\\Users\\sirUser\\temp') - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), 'C:\\windows\\temp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'notepad.exe') - - t.equal(osenv.shell(), 'some-com') - process.env.ComSpec = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'cmd') - - t.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index ca91152..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,442 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index bfc503c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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" - }, - "_id": "graceful-fs@1.2.3", - "_from": "graceful-fs@~1" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d532..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js deleted file mode 100644 index 8d0882d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js +++ /dev/null @@ -1,158 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json deleted file mode 100644 index f5072d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "rimraf", - "version": "2.1.4", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~1" - }, - "_id": "rimraf@2.1.4", - "_from": "rimraf@~2.1.4" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js deleted file mode 100644 index ed915f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,132 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -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 (er.code === "EBUSY" && 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 && er.code === "ENOENT") - return cb() - if (er && (er.code === "EPERM" || er.code === "EISDIR")) - return rmdir(p, er, cb) - return cb(er) - }) -} - -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")) - 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" && er.code !== "EISDIR") - throw er - try { - fs.rmdirSync(p) - } catch (er2) { - if (er2.code === "ENOENT") - return - if (er2.code === "ENOTDIR") - throw er - if (er2.code === "ENOTEMPTY") { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) - } - } - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json deleted file mode 100644 index 7c98f7e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "temp", - "description": "Temporary files and directories", - "tags": [ - "temporary", - "temp", - "tempfile", - "tempdir", - "tmpfile", - "tmpdir", - "security" - ], - "version": "0.6.0", - "author": { - "name": "Bruce Williams", - "email": "bruce@codefluency.com" - }, - "directories": { - "lib": "lib" - }, - "engines": [ - "node >=0.6.0" - ], - "main": "./lib/temp", - "dependencies": { - "rimraf": "~2.1.4", - "osenv": "0.0.3" - }, - "devDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/bruce/node-temp.git" - }, - "scripts": { - "test": "node test/temp-test.js" - }, - "readme": "node-temp\n=========\n\nTemporary files, directories, and streams for Node.js.\n\nHandles generating a unique file/directory name under the appropriate\nsystem temporary directory, changing the file to an appropriate mode,\nand supports automatic removal (if asked)\n\n`temp` has a similar API to the `fs` module.\n\nNode.js Compatibility\n---------------------\n\nSupports v0.6.0+.\n\n[![Build Status](https://travis-ci.org/bruce/node-temp.png)](https://travis-ci.org/bruce/node-temp)\n\nPlease let me know if you have problems running it on a later version of Node.js or\nhave platform-specific problems.\n\nInstallation\n------------\n\nInstall it using [npm](http://github.com/isaacs/npm):\n\n $ npm install temp\n\nOr get it directly from:\nhttp://github.com/bruce/node-temp\n\nSynopsis\n--------\n\nYou can create temporary files with `open` and `openSync`, temporary\ndirectories with `mkdir` and `mkdirSync`, or you can get a unique name\nin the system temporary directory with `path`.\n\nWorking copies of the following examples can be found under the\n`examples` directory.\n\n### Temporary Files\n\nTo create a temporary file use `open` or `openSync`, passing\nthem an optional prefix, suffix, or both (see below for details on\naffixes). The object passed to the callback (or returned) has\n`path` and `fd` keys:\n\n```javascript\n{ path: \"/path/to/file\",\n, fd: theFileDescriptor\n}\n```\n\nIn this example we write to a temporary file and call out to `grep` and\n`wc -l` to determine the number of time `foo` occurs in the text. The\ntemporary file is chmod'd `0600` and cleaned up automatically when the\nprocess at exit (because `temp.track()` is called):\n\n```javascript\nvar temp = require('temp'),\n fs = require('fs'),\n util = require('util'),\n exec = require('child_process').exec;\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\n// Fake data\nvar myData = \"foo\\nbar\\nfoo\\nbaz\";\n\n// Process the data (note: error handling omitted)\ntemp.open('myprefix', function(err, info) {\n fs.write(info.fd, myData);\n fs.close(info.fd, function(err) {\n exec(\"grep foo '\" + info.path + \"' | wc -l\", function(err, stdout) {\n util.puts(stdout.trim());\n });\n });\n});\n```\n\n### Want Cleanup? Make sure you ask for it.\n\nAs noted in the example above, if you want temp to track the files and directories\nit creates and handle removing those files and directories on exit, you must call `track()`.\nIt's recommended that you do this immediately after requiring the module.\n\n```javascript\nvar temp = require(\"temp\");\ntemp.track();\n```\n\nWhy is this necessary? In pre-0.6 versions of temp, tracking was automatic. While this works\ngreat for scripts and [Grunt tasks](http://gruntjs.com/), it's not so great for long-running\nserver processes. Since that's arguably what Node.js is _for_, you have to opt-in to tracking.\n\nBut it's easy.\n\n#### Cleanup anytime\n\nWhen tracking, you can `cleanup()` anytime. An object will be returned with cleanup statistics\nand the file/directory lists will be reset.\n\n```javascript\n> temp.cleanup();\n{ files: { removed: 1, missing: 0 },\n dirs: { removed: 0, missing: 0 } }\n```\n\nNote: If you're not tracking, `false` will be returned.\n\n### Temporary Directories\n\nTo create a temporary directory, use `mkdir` or `mkdirSync`, passing\nit an optional prefix, suffix, or both (see below for details on affixes).\n\nIn this example we create a temporary directory, write to a file\nwithin it, call out to an external program to create a PDF, and read\nthe result. While the external process creates a lot of additional\nfiles, the temporary directory is removed automatically at exit (because\n`temp.track()` is called):\n\n```javascript\nvar temp = require('../lib/temp'),\n fs = require('fs'),\n util = require('util'),\n path = require('path'),\n exec = require('child_process').exec;\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\n// For use with ConTeXt, http://wiki.contextgarden.net\nvar myData = \"\\\\starttext\\nHello World\\n\\\\stoptext\";\n\ntemp.mkdir('pdfcreator', function(err, dirPath) {\n var inputPath = path.join(dirPath, 'input.tex')\n fs.writeFile(inputPath, myData, function(err) {\n if (err) throw err;\n process.chdir(dirPath);\n exec(\"texexec '\" + inputPath + \"'\", function(err) {\n if (err) throw err;\n fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) {\n if (err) throw err;\n sys.print(data);\n });\n });\n });\n});\n```\n\n### Temporary Streams\n\nTo create a temporary WriteStream, use 'createWriteStream', which sits\non top of `fs.createWriteStream`. The return value is a\n`fs.WriteStream` whose `path` is registered for removal when\n`temp.cleanup` is called (because `temp.track()` is called).\n\n```javascript\nvar temp = require('temp');\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\nvar stream = temp.createWriteStream();\nstream.write(\"Some data\");\n// Maybe do some other things\nstream.end();\n```\n\n### Affixes\n\nYou can provide custom prefixes and suffixes when creating temporary\nfiles and directories. If you provide a string, it is used as the prefix\nfor the temporary name. If you provide an object with `prefix`,\n`suffix` and `dir` keys, they are used for the temporary name.\n\nHere are some examples:\n\n* `\"aprefix\"`: A simple prefix, prepended to the filename; this is\n shorthand for:\n* `{prefix: \"aprefix\"}`: A simple prefix, prepended to the filename\n* `{suffix: \".asuffix\"}`: A suffix, appended to the filename\n (especially useful when the file needs to be named with specific\n extension for use with an external program).\n* `{prefix: \"myprefix\", suffix: \"mysuffix\"}`: Customize both affixes\n* `{dir: path.join(os.tmpDir()), \"myapp\"}`: default prefix and suffix\n within a new temporary directory.\n* `null`: Use the defaults for files and directories (prefixes `\"f-\"`\n and `\"d-\"`, respectively, no suffixes).\n\nIn this simple example we read a `pdf`, write it to a temporary file with\na `.pdf` extension, and close it.\n\n```javascript\nvar fs = require('fs'),\n temp = require('temp');\n\nfs.readFile('/path/to/source.pdf', function(err, data) {\n temp.open({suffix: '.pdf'}, function(err, info) {\n if (err) throw err;\n fs.write(info.fd, contents);\n fs.close(info.fd, function(err) {\n if (err) throw err;\n // Do something with the file\n });\n });\n});\n```\n\n### Just a path, please\n\nIf you just want a unique name in your temporary directory, use\n`path`:\n\n```javascript\nvar fs = require('fs');\nvar tempName = temp.path({suffix: '.pdf'});\n// Do something with tempName\n```\n\nNote: The file isn't created for you, and the mode is not changed -- and it\nwill not be removed automatically at exit. If you use `path`, it's\nall up to you.\n\nUsing it with Grunt\n-------------------\n\nIf you want to use the module with [Grunt](http://gruntjs.com/), make sure you\nuse `async()` in your Gruntfile:\n\n```javascript\nmodule.exports = function (grunt) {\n var temp = require(\"temp\");\n temp.track(); // Cleanup files, please\n grunt.registerTast(\"temptest\", \"Testing temp\", function() {\n\n var done = this.async(); // Don't forget this!\n\n grunt.log.writeln(\"About to write a file...\");\n temp.open('tempfile', function(err, info) {\n // File writing shenanigans here\n grunt.log.writeln(\"Wrote a file!\")\n\n done(); // REALLY don't forget this!\n\n });\n });\n};\n```\n\nFor more information, see the [Grunt FAQ](http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete).\n\nTesting\n-------\n\nFor now, run `test/temp-test.js`:\n\n $ node test/temp-test.js\n\nContributing\n------------\n\nYou can find the repository at:\nhttp://github.com/bruce/node-temp\n\nIssues/Feature Requests can be submitted at:\nhttp://github.com/bruce/node-temp/issues\n\nI'd really like to hear your feedback, and I'd love to receive your\npull-requests!\n\nCopyright\n---------\n\nCopyright (c) 2010-2012 Bruce Williams. See LICENSE for details.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/bruce/node-temp/issues" - }, - "_id": "temp@0.6.0", - "dist": { - "shasum": "29d2d63697c79fb5108af11e1cba8edf097877bd" - }, - "_from": "temp@~0.6.0", - "_resolved": "https://registry.npmjs.org/temp/-/temp-0.6.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js deleted file mode 100644 index 34071fa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js +++ /dev/null @@ -1,77 +0,0 @@ -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); -var util = require('util'); - -var temp = require('../lib/temp'); -temp.track(); - -var existsSync = function(path){ - try { - fs.statSync(path); - return true; - } catch (e){ - return false; - } -}; - -// Use path.exists for 0.6 if necessary -var safeExists = fs.exists || path.exists; - -var mkdirFired = false; -var mkdirPath = null; -temp.mkdir('foo', function(err, tpath) { - mkdirFired = true; - assert.ok(!err, "temp.mkdir did not execute without errors"); - assert.ok(path.basename(tpath).slice(0, 3) == 'foo', 'temp.mkdir did not use the prefix'); - assert.ok(existsSync(tpath), 'temp.mkdir did not create the directory'); - - fs.writeFileSync(path.join(tpath, 'a file'), 'a content'); - temp.cleanup(); - assert.ok(!existsSync(tpath), 'temp.cleanup did not remove the directory'); - - mkdirPath = tpath; -}); - -var openFired = false; -var openPath = null; -temp.open('bar', function(err, info) { - openFired = true; - assert.equal('object', typeof(info), "temp.open did not invoke the callback with the err and info object"); - assert.equal('number', typeof(info.fd), 'temp.open did not invoke the callback with an fd'); - fs.writeSync(info.fd, 'foo'); - fs.closeSync(info.fd); - assert.equal('string', typeof(info.path), 'temp.open did not invoke the callback with a path'); - assert.ok(existsSync(info.path), 'temp.open did not create a file'); - - temp.cleanup(); - assert.ok(!existsSync(info.path), 'temp.cleanup did not remove the file'); - - openPath = info.path; -}); - - -var stream = temp.createWriteStream('baz'); -assert.ok(stream instanceof fs.WriteStream, "temp.createWriteStream did not invoke the callback with the err and stream object"); -stream.write('foo'); -stream.end("More text here\nand more..."); -assert.ok(existsSync(stream.path), 'temp.createWriteStream did not create a file'); - -console.log(temp.cleanup()); -assert.ok(!existsSync(stream.path), 'temp.cleanup did not remove the createWriteStream file'); - -var tempPath = temp.path(); -assert.ok(path.dirname(tempPath) === temp.dir, "temp.path does not work in default os temporary directory"); - -tempPath = temp.path({dir: process.cwd()}); -assert.ok(path.dirname(tempPath) === process.cwd(), "temp.path does not work in user-provided temporary directory"); - -for (var i=0; i <= 10; i++) { - temp.openSync(); -}; -assert.equal(process.listeners('exit').length, 1, 'temp created more than one listener for exit'); - -process.addListener('exit', function() { - assert.ok(mkdirFired, "temp.mkdir callback did not fire"); - assert.ok(openFired, "temp.open callback did not fire"); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json deleted file mode 100644 index 111c20f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "decompress", - "version": "0.1.4", - "description": "Easily extract zip, tar and tar.gz archives", - "keywords": [ - "extract", - "zip", - "tar", - "tar.gz" - ], - "homepage": "https://github.com/kevva/decompress", - "bugs": { - "url": "https://github.com/kevva/decompress/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/decompress.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "decompress.js", - "files": [ - "decompress.js" - ], - "dependencies": { - "adm-zip": "~0.4.3", - "mkdirp": "~0.3.5", - "mout": "~0.6.0", - "rimraf": "~2.2.2", - "stream-combiner": "~0.0.2", - "tar": "~0.1.18", - "temp": "~0.6.0" - }, - "devDependencies": { - "mocha": "~1.12.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# decompress [![Build Status](https://secure.travis-ci.org/kevva/decompress.png?branch=master)](http://travis-ci.org/kevva/decompress)\n\nEasily extract `.zip`, `.tar` and `.tar.gz` archives. Based on the extract \nutility in [Bower](https://github.com/bower/bower).\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/decompress): `npm install decompress`\n\n## Examples\n\nYou'll only need to pass a type into `ext` and it'll figure the rest out for \nyou.\n\n```js\nvar decompress = require('decompress');\nvar fs = require('fs');\n\nvar src = fs.createReadStream('foo.tar.gz');\nvar dest = decompress.extract({ ext: '.tar.gz' });\n\nsrc.pipe(dest);\n```\n\n## API\n\n### .extract(opts)\n\nExtract an archive using the `ext` option to determine which extractor to use. \nIf no `path` is specified it'll extract it to your current location.\n\n### .canExtract(src, mime)\n\nDetermine if a file can be extracted or not by checking the file extension \nand/or the MIME type.\n\n```js\ndecompress.canExtract('foo.zip');\n// => true\n\ndecompress.canExtract('application/zip');\n// => true\n```\n\n## Options\n\n* `ext` — String that can be a file name, URL, MIME type etc.\n* `path` — Path to extract the archive to. If no `path` is defined it'll \nextract it to your current location.\n* `strip` — Equivalent to `--strip-components` for tar.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "decompress@0.1.4", - "dist": { - "shasum": "b5608768911f794017bfb8017344be6a7cfaf919" - }, - "_from": "decompress@~0.1.0", - "_resolved": "https://registry.npmjs.org/decompress/-/decompress-0.1.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 84fd7ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json deleted file mode 100644 index 169f15a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.5", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.4.0" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "_id": "mkdirp@0.3.5", - "_from": "mkdirp@~0.3.5" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 83b0216..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 35bd5cb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md deleted file mode 100644 index 1d2f79b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md +++ /dev/null @@ -1,344 +0,0 @@ -# Request -- Simplified HTTP request method - -## Install - -
        -  npm install request
        -
        - -Or from source: - -
        -  git clone git://github.com/mikeal/request.git 
        -  cd request
        -  npm link
        -
        - -## Super simple to use - -Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. - -```javascript -var request = require('request'); -request('http://www.google.com', function (error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body) // Print the google web page. - } -}) -``` - -## Streaming - -You can stream any response to a file stream. - -```javascript -request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png')) -``` - -You 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. - -```javascript -fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json')) -``` - -Request can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers. - -```javascript -request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) -``` - -Now let's get fancy. - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - if (req.method === 'PUT') { - req.pipe(request.put('http://mysite.com/doodle.png')) - } else if (req.method === 'GET' || req.method === 'HEAD') { - request.get('http://mysite.com/doodle.png').pipe(resp) - } - } -}) -``` - -You 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: - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - var x = request('http://mysite.com/doodle.png') - req.pipe(x) - x.pipe(resp) - } -}) -``` - -And since pipe() returns the destination stream in node 0.5.x you can do one line proxying :) - -```javascript -req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) -``` - -Also, none of this new functionality conflicts with requests previous features, it just expands them. - -```javascript -var r = request.defaults({'proxy':'http://localproxy.com'}) - -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - r.get('http://google.com/doodle.png').pipe(resp) - } -}) -``` -You can still use intermediate proxies, the requests will still follow HTTP forwards, etc. - -## Forms - -`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API. - -Url encoded forms are simple - -```javascript -request.post('http://service.com/upload', {form:{key:'value'}}) -// or -request.post('http://service.com/upload').form({key:'value'}) -``` - -For `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. - -```javascript -var r = request.post('http://service.com/upload') -var form = r.form() -form.append('my_field', 'my_value') -form.append('my_buffer', new Buffer([1, 2, 3])) -form.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png')) -form.append('remote_file', request('http://google.com/doodle.png')) -``` - -## HTTP Authentication - -```javascript -request.get('http://some.server.com/').auth('username', 'password', false); -// or -request.get('http://some.server.com/', { - 'auth': { - 'user': 'username', - 'pass': 'password', - 'sendImmediately': false - } -}); -``` - -If 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)`. - -`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). - -Digest 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). - -## OAuth Signing - -```javascript -// Twitter OAuth -var qs = require('querystring') - , oauth = - { callback: 'http://mysite.com/callback/' - , consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - } - , url = 'https://api.twitter.com/oauth/request_token' - ; -request.post({url:url, oauth:oauth}, function (e, r, body) { - // Ideally, you would take the body in the response - // and construct a URL that a user clicks on (like a sign in button). - // The verifier is only available in the response after a user has - // verified with twitter that they are authorizing your app. - var access_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: access_token.oauth_token - , verifier: access_token.oauth_verifier - } - , url = 'https://api.twitter.com/oauth/access_token' - ; - request.post({url:url, oauth:oauth}, function (e, r, body) { - var perm_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: perm_token.oauth_token - , token_secret: perm_token.oauth_token_secret - } - , url = 'https://api.twitter.com/1/users/show.json?' - , params = - { screen_name: perm_token.screen_name - , user_id: perm_token.user_id - } - ; - url += qs.stringify(params) - request.get({url:url, oauth:oauth, json:true}, function (e, r, user) { - console.log(user) - }) - }) -}) -``` - - - -### request(options, callback) - -The first argument can be either a url or an options object. The only required option is uri, all others are optional. - -* `uri` || `url` - fully qualified uri or a parsed url object from url.parse() -* `qs` - object containing querystring values to be appended to the uri -* `method` - http method, defaults to GET -* `headers` - http headers, defaults to {} -* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string. -* `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. -* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above. -* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json. -* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below. -* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true. -* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false. -* `maxRedirects` - the maximum number of redirects to follow, defaults to 10. -* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer. -* `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. -* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool. -* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request -* `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. -* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above. -* `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). -* `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. -* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section) -* `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) -* `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. -* `localAddress` - Local interface to bind for network connections. - - -The 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. - -## Convenience methods - -There are also shorthand methods for different HTTP METHODs and some other conveniences. - -### request.defaults(options) - -This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it. - -### request.put - -Same as request() but defaults to `method: "PUT"`. - -```javascript -request.put(url) -``` - -### request.patch - -Same as request() but defaults to `method: "PATCH"`. - -```javascript -request.patch(url) -``` - -### request.post - -Same as request() but defaults to `method: "POST"`. - -```javascript -request.post(url) -``` - -### request.head - -Same as request() but defaults to `method: "HEAD"`. - -```javascript -request.head(url) -``` - -### request.del - -Same as request() but defaults to `method: "DELETE"`. - -```javascript -request.del(url) -``` - -### request.get - -Alias to normal request method for uniformity. - -```javascript -request.get(url) -``` -### request.cookie - -Function that creates a new cookie. - -```javascript -request.cookie('cookie_string_here') -``` -### request.jar - -Function that creates a new cookie jar. - -```javascript -request.jar() -``` - - -## Examples: - -```javascript - var request = require('request') - , rand = Math.floor(Math.random()*100000000).toString() - ; - request( - { method: 'PUT' - , uri: 'http://mikeal.iriscouch.com/testjs/' + rand - , multipart: - [ { 'content-type': 'application/json' - , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) - } - , { body: 'I am an attachment' } - ] - } - , function (error, response, body) { - if(response.statusCode == 201){ - console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand) - } else { - console.log('error: '+ response.statusCode) - console.log(body) - } - } - ) -``` -Cookies 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). - -```javascript -var request = request.defaults({jar: true}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` - -If 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: - -```javascript -var j = request.jar() -var request = request.defaults({jar:j}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` -OR - -```javascript -var j = request.jar() -var cookie = request.cookie('your_cookie_here') -j.add(cookie) -request({url: 'http://www.google.com', jar: j}, function () { - request('http://images.google.com') -}) -``` diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js deleted file mode 100755 index d56f9ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js +++ /dev/null @@ -1,1392 +0,0 @@ -// Copyright 2010-2012 Mikeal Rogers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -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 - ; - -try { - https = require('https') -} catch (e) {} - -try { - tls = require('tls') -} catch (e) {} - -var debug -if (/\brequest\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - console.error('REQUEST %s', util.format.apply(util, arguments)) - } -} else { - debug = function() {} -} - -function toBase64 (str) { - return (new Buffer(str || "", "ascii")).toString("base64") -} - -function md5 (str) { - return crypto.createHash('md5').update(str).digest('hex') -} - -// 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 copy (obj) { - var o = {} - Object.keys(obj).forEach(function (i) { - o[i] = obj[i] - }) - return o -} - -var isUrl = /^https?:/ - -var globalPool = {} - -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.host || !self.uri.pathname) { - // 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.headers.host || self.headers.Host)) { - self.headers.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.headers.host += (':'+self.uri.port) - } - self.setHost = true - } - - self.jar(self._jar || options.jar) - - if (!self.uri.pathname) {self.uri.pathname = '/'} - 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.headers.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.headers['proxy-authorization'] && !self.tunnel) { - self.headers['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.headers['content-length'] && !self.headers['Content-Length']) - self.headers['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.headers['content-type'] && !self.headers['Content-Type']) - self.headers['content-type'] = mime.lookup(src.path) - } else { - if (src.headers) { - for (var i in src.headers) { - if (!self.headers[i]) { - self.headers[i] = src.headers[i] - } - } - } - if (self._json && !self.headers['content-type'] && !self.headers['Content-Type']) - self.headers['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.headers['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.headers['content-length'] && !self.headers['Content-Length']) { - self.headers['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) delete self.headers.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 (response.headers['set-cookie'] && (!self._disableCookies)) { - if (Array.isArray(response.headers['set-cookie'])) response.headers['set-cookie'].forEach(addCookie) - else addCookie(response.headers['set-cookie']) - } - - var redirectTo = null - if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) { - debug('redirect', response.headers.location) - - if (self.followAllRedirects) { - redirectTo = response.headers.location - } else if (self.followRedirect) { - switch (self.method) { - case 'PATCH': - case 'PUT': - case 'POST': - case 'DELETE': - // Do not follow redirects - break - default: - redirectTo = response.headers.location - break - } - } - } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) { - var authHeader = response.headers['www-authenticate'] - 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) { - delete self.headers.host - delete self.headers['content-type'] - delete self.headers['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.headers['content-type'] = response.headers['content-type'] - if (response.headers['content-length']) { - dest.headers['content-length'] = response.headers['content-length'] - } - } - 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.headers.hasOwnProperty(name)) this.headers[name] = value - else this.headers[name] += ',' + value - return this -} -Request.prototype.setHeaders = function (headers) { - for (var i in headers) {this.setHeader(i, headers[i])} - return this -} -Request.prototype.qs = function (q, clobber) { - var base - if (!clobber && this.uri.query) base = qs.parse(this.uri.query) - else base = {} - - for (var i in q) { - base[i] = q[i] - } - - if (qs.stringify(base) === ''){ - return this - } - - this.uri = url.parse(this.uri.href.split('?')[0] + '?' + qs.stringify(base)) - this.url = this.uri - this.path = this.uri.path - - return this -} -Request.prototype.form = function (form) { - if (form) { - this.headers['content-type'] = 'application/x-www-form-urlencoded; charset=utf-8' - this.body = qs.stringify(form).toString('utf8') - return this - } - // create form-data object - this._form = new FormData() - return this._form -} -Request.prototype.multipart = function (multipart) { - var self = this - self.body = [] - - if (!self.headers['content-type']) { - self.headers['content-type'] = 'multipart/related; boundary=' + self.boundary - } else { - self.headers['content-type'] = self.headers['content-type'].split(';')[0] + '; boundary=' + self.boundary - } - - if (!multipart.forEach) throw new Error('Argument error, options.multipart.') - - if (self.preambleCRLF) { - self.body.push(new Buffer('\r\n')) - } - - multipart.forEach(function (part) { - var body = part.body - if(body == null) throw Error('Body attribute missing in multipart.') - delete part.body - var preamble = '--' + self.boundary + '\r\n' - Object.keys(part).forEach(function (key) { - preamble += key + ': ' + part[key] + '\r\n' - }) - preamble += '\r\n' - self.body.push(new Buffer(preamble)) - self.body.push(new Buffer(body)) - self.body.push(new Buffer('\r\n')) - }) - self.body.push(new Buffer('--' + self.boundary + '--')) - return self -} -Request.prototype.json = function (val) { - var self = this; - var setAcceptHeader = function() { - if (!self.headers['accept'] && !self.headers['Accept']) { - self.setHeader('accept', 'application/json') - } - } - setAcceptHeader(); - this._json = true - if (typeof val === 'boolean') { - if (typeof this.body === 'object') { - setAcceptHeader(); - this.body = safeStringify(this.body) - self.setHeader('content-type', 'application/json') - } - } else { - setAcceptHeader(); - this.body = safeStringify(val) - self.setHeader('content-type', 'application/json') - } - return this -} -function getHeader(name, headers) { - var result, re, match - Object.keys(headers).forEach(function (key) { - re = new RegExp(name, 'i') - match = key.match(re) - if (match) result = headers[key] - }) - return result -} -Request.prototype.auth = function (user, pass, sendImmediately) { - if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { - throw new Error('auth() received invalid user or password') - } - this._user = user - this._pass = pass - this._hasAuth = true - if (sendImmediately || typeof sendImmediately == 'undefined') { - this.setHeader('authorization', 'Basic ' + toBase64(user + ':' + pass)) - this._sentAuth = true - } - return this -} -Request.prototype.aws = function (opts, now) { - if (!now) { - this._aws = opts - return this - } - var date = new Date() - this.setHeader('date', date.toUTCString()) - var auth = - { key: opts.key - , secret: opts.secret - , verb: this.method.toUpperCase() - , date: date - , contentType: getHeader('content-type', this.headers) || '' - , md5: getHeader('content-md5', this.headers) || '' - , amazonHeaders: aws.canonicalizeHeaders(this.headers) - } - if (opts.bucket && this.path) { - auth.resource = '/' + opts.bucket + this.path - } else if (opts.bucket && !this.path) { - auth.resource = '/' + opts.bucket - } else if (!opts.bucket && this.path) { - auth.resource = this.path - } else if (!opts.bucket && !this.path) { - auth.resource = '/' - } - auth.resource = aws.canonicalizeResource(auth.resource) - this.setHeader('authorization', aws.authorization(auth)) - - return this -} -Request.prototype.httpSignature = function (opts) { - var req = this - httpSignature.signRequest({ - getHeader: function(header) { - return getHeader(header, req.headers) - }, - setHeader: function(header, value) { - req.setHeader(header, value) - }, - method: this.method, - path: this.path - }, opts) - debug('httpSignature authorization', getHeader('authorization', this.headers)) - - return this -} - -Request.prototype.hawk = function (opts) { - this.headers.Authorization = hawk.client.header(this.uri, this.method, opts).field -} - -Request.prototype.oauth = function (_oauth) { - var form - if (this.headers['content-type'] && - this.headers['content-type'].slice(0, 'application/x-www-form-urlencoded'.length) === - 'application/x-www-form-urlencoded' - ) { - form = qs.parse(this.body) - } - if (this.uri.query) { - form = qs.parse(this.uri.query) - } - if (!form) form = {} - var oa = {} - for (var i in form) oa[i] = form[i] - for (var i in _oauth) oa['oauth_'+i] = _oauth[i] - if (!oa.oauth_version) oa.oauth_version = '1.0' - if (!oa.oauth_timestamp) oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString() - if (!oa.oauth_nonce) oa.oauth_nonce = uuid().replace(/-/g, '') - - oa.oauth_signature_method = 'HMAC-SHA1' - - var consumer_secret = oa.oauth_consumer_secret - delete oa.oauth_consumer_secret - var token_secret = oa.oauth_token_secret - delete oa.oauth_token_secret - var timestamp = oa.oauth_timestamp - - var baseurl = this.uri.protocol + '//' + this.uri.host + this.uri.pathname - var signature = oauth.hmacsign(this.method, baseurl, oa, consumer_secret, token_secret) - - // oa.oauth_signature = signature - for (var i in form) { - if ( i.slice(0, 'oauth_') in _oauth) { - // skip - } else { - delete oa['oauth_'+i] - if (i !== 'x_auth_mode') delete oa[i] - } - } - oa.oauth_timestamp = timestamp - this.headers.Authorization = - 'OAuth '+Object.keys(oa).sort().map(function (i) {return i+'="'+oauth.rfc3986(oa[i])+'"'}).join(',') - this.headers.Authorization += ',oauth_signature="' + oauth.rfc3986(signature) + '"' - return this -} -Request.prototype.jar = function (jar) { - var cookies - - if (this._redirectsFollowed === 0) { - this.originalCookieHeader = this.headers.cookie - } - - if (!jar) { - // disable cookies - cookies = false - this._disableCookies = true - } else if (jar && jar.get) { - // fetch cookie from the user defined cookie jar - cookies = jar.get({ url: this.uri.href }) - } else { - // fetch cookie from the global cookie jar - cookies = cookieJar.get({ url: this.uri.href }) - } - - if (cookies && cookies.length) { - var cookieString = cookies.map(function (c) { - return c.name + "=" + c.value - }).join("; ") - - if (this.originalCookieHeader) { - // Don't overwrite existing Cookie header - this.headers.cookie = this.originalCookieHeader + '; ' + cookieString - } else { - this.headers.cookie = cookieString - } - } - this._jar = jar - return this -} - - -// Stream API -Request.prototype.pipe = function (dest, opts) { - if (this.response) { - if (this._destdata) { - throw new Error("You cannot pipe after data has been emitted from the response.") - } else if (this._ended) { - throw new Error("You cannot pipe after the response has been ended.") - } else { - stream.Stream.prototype.pipe.call(this, dest, opts) - this.pipeDest(dest) - return dest - } - } else { - this.dests.push(dest) - stream.Stream.prototype.pipe.call(this, dest, opts) - return dest - } -} -Request.prototype.write = function () { - if (!this._started) this.start() - return this.req.write.apply(this.req, arguments) -} -Request.prototype.end = function (chunk) { - if (chunk) this.write(chunk) - if (!this._started) this.start() - this.req.end() -} -Request.prototype.pause = function () { - if (!this.response) this._paused = true - else this.response.pause.apply(this.response, arguments) -} -Request.prototype.resume = function () { - if (!this.response) this._paused = false - else this.response.resume.apply(this.response, arguments) -} -Request.prototype.destroy = function () { - if (!this._ended) this.end() - else if (this.response) this.response.destroy() -} - -// organize params for patch, post, put, head, del -function initParams(uri, options, callback) { - if ((typeof options === 'function') && !callback) callback = options - if (options && typeof options === 'object') { - options.uri = uri - } else if (typeof uri === 'string') { - options = {uri:uri} - } else { - options = uri - uri = options.uri - } - return { uri: uri, options: options, callback: callback } -} - -function request (uri, options, callback) { - if (typeof uri === 'undefined') throw new Error('undefined is not a valid uri or options object.') - if ((typeof options === 'function') && !callback) callback = options - if (options && typeof options === 'object') { - options.uri = uri - } else if (typeof uri === 'string') { - options = {uri:uri} - } else { - options = uri - } - - options = copy(options) - - if (callback) options.callback = callback - var r = new Request(options) - return r -} - -module.exports = request - -request.Request = Request; - -request.debug = process.env.NODE_DEBUG && /request/.test(process.env.NODE_DEBUG) - -request.initParams = initParams - -request.defaults = function (options, requester) { - var def = function (method) { - var d = function (uri, opts, callback) { - var params = initParams(uri, opts, callback) - for (var i in options) { - if (params.options[i] === undefined) params.options[i] = options[i] - } - if(typeof requester === 'function') { - if(method === request) { - method = requester - } else { - params.options._requester = requester - } - } - return method(params.options, params.callback) - } - return d - } - var de = def(request) - de.get = def(request.get) - de.patch = def(request.patch) - de.post = def(request.post) - de.put = def(request.put) - de.head = def(request.head) - de.del = def(request.del) - de.cookie = def(request.cookie) - de.jar = request.jar - return de -} - -request.forever = function (agentOptions, optionsArg) { - var options = {} - if (optionsArg) { - for (option in optionsArg) { - options[option] = optionsArg[option] - } - } - if (agentOptions) options.agentOptions = agentOptions - options.forever = true - return request.defaults(options) -} - -request.get = request -request.post = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'POST' - return request(params.uri || null, params.options, params.callback) -} -request.put = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'PUT' - return request(params.uri || null, params.options, params.callback) -} -request.patch = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'PATCH' - return request(params.uri || null, params.options, params.callback) -} -request.head = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'HEAD' - if (params.options.body || - params.options.requestBodyStream || - (params.options.json && typeof params.options.json !== 'boolean') || - params.options.multipart) { - throw new Error("HTTP HEAD requests MUST NOT include a request body.") - } - return request(params.uri || null, params.options, params.callback) -} -request.del = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'DELETE' - if(typeof params.options._requester === 'function') { - request = params.options._requester - } - return request(params.uri || null, params.options, params.callback) -} -request.jar = function () { - return new CookieJar -} -request.cookie = function (str) { - if (str && str.uri) str = str.uri - if (typeof str !== 'string') throw new Error("The cookie function only accepts STRING as param") - return new Cookie(str) -} - -// Safe toJSON - -function getSafe (self, uuid) { - if (typeof self === 'object' || typeof self === 'function') var safe = {} - if (Array.isArray(self)) var safe = [] - - var recurse = [] - - Object.defineProperty(self, uuid, {}) - - var attrs = Object.keys(self).filter(function (i) { - if (i === uuid) return false - if ( (typeof self[i] !== 'object' && typeof self[i] !== 'function') || self[i] === null) return true - return !(Object.getOwnPropertyDescriptor(self[i], uuid)) - }) - - - for (var i=0;i - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var crypto = require('crypto') - , parse = require('url').parse - ; - -/** - * Valid keys. - */ - -var keys = - [ 'acl' - , 'location' - , 'logging' - , 'notification' - , 'partNumber' - , 'policy' - , 'requestPayment' - , 'torrent' - , 'uploadId' - , 'uploads' - , 'versionId' - , 'versioning' - , 'versions' - , 'website' - ] - -/** - * Return an "Authorization" header value with the given `options` - * in the form of "AWS :" - * - * @param {Object} options - * @return {String} - * @api private - */ - -function authorization (options) { - return 'AWS ' + options.key + ':' + sign(options) -} - -module.exports = authorization -module.exports.authorization = authorization - -/** - * Simple HMAC-SHA1 Wrapper - * - * @param {Object} options - * @return {String} - * @api private - */ - -function hmacSha1 (options) { - return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') -} - -module.exports.hmacSha1 = hmacSha1 - -/** - * Create a base64 sha1 HMAC for `options`. - * - * @param {Object} options - * @return {String} - * @api private - */ - -function sign (options) { - options.message = stringToSign(options) - return hmacSha1(options) -} -module.exports.sign = sign - -/** - * Create a base64 sha1 HMAC for `options`. - * - * Specifically to be used with S3 presigned URLs - * - * @param {Object} options - * @return {String} - * @api private - */ - -function signQuery (options) { - options.message = queryStringToSign(options) - return hmacSha1(options) -} -module.exports.signQuery= signQuery - -/** - * Return a string for sign() with the given `options`. - * - * Spec: - * - * \n - * \n - * \n - * \n - * [headers\n] - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function stringToSign (options) { - var headers = options.amazonHeaders || '' - if (headers) headers += '\n' - var r = - [ options.verb - , options.md5 - , options.contentType - , options.date.toUTCString() - , headers + options.resource - ] - return r.join('\n') -} -module.exports.queryStringToSign = stringToSign - -/** - * Return a string for sign() with the given `options`, but is meant exclusively - * for S3 presigned URLs - * - * Spec: - * - * \n - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function queryStringToSign (options){ - return 'GET\n\n\n' + options.date + '\n' + options.resource -} -module.exports.queryStringToSign = queryStringToSign - -/** - * Perform the following: - * - * - ignore non-amazon headers - * - lowercase fields - * - sort lexicographically - * - trim whitespace between ":" - * - join with newline - * - * @param {Object} headers - * @return {String} - * @api private - */ - -function canonicalizeHeaders (headers) { - var buf = [] - , fields = Object.keys(headers) - ; - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i] - , val = headers[field] - , field = field.toLowerCase() - ; - if (0 !== field.indexOf('x-amz')) continue - buf.push(field + ':' + val) - } - return buf.sort().join('\n') -} -module.exports.canonicalizeHeaders = canonicalizeHeaders - -/** - * Perform the following: - * - * - ignore non sub-resources - * - sort lexicographically - * - * @param {String} resource - * @return {String} - * @api private - */ - -function canonicalizeResource (resource) { - var url = parse(resource, true) - , path = url.pathname - , buf = [] - ; - - Object.keys(url.query).forEach(function(key){ - if (!~keys.indexOf(key)) return - var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) - buf.push(key + val) - }) - - return path + (buf.length ? '?' + buf.sort().join('&') : '') -} -module.exports.canonicalizeResource = canonicalizeResource diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json deleted file mode 100644 index e2c48ab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "aws-sign", - "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/aws-sign" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/aws-sign/issues" - }, - "_id": "aws-sign@0.3.0", - "_from": "aws-sign@~0.3.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md deleted file mode 100644 index bcd8f8d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md +++ /dev/null @@ -1,4 +0,0 @@ -cookie-jar -========== - -Cookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js deleted file mode 100644 index 7d54d94..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js +++ /dev/null @@ -1,67 +0,0 @@ -/*! - * Tobi - Cookie - * Copyright(c) 2010 LearnBoost - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var url = require('url'); - -/** - * Initialize a new `Cookie` with the given cookie `str` and `req`. - * - * @param {String} str - * @param {IncomingRequest} req - * @api private - */ - -var Cookie = exports = module.exports = function Cookie(str, req) { - this.str = str; - - // Map the key/val pairs - str.split(/ *; */).reduce(function(obj, pair){ - var p = pair.indexOf('='); - var key = p > 0 ? pair.substring(0, p).trim() : pair.trim(); - var lowerCasedKey = key.toLowerCase(); - var value = p > 0 ? pair.substring(p + 1).trim() : true; - - if (!obj.name) { - // First key is the name - obj.name = key; - obj.value = value; - } - else if (lowerCasedKey === 'httponly') { - obj.httpOnly = value; - } - else { - obj[lowerCasedKey] = value; - } - return obj; - }, this); - - // Expires - this.expires = this.expires - ? new Date(this.expires) - : Infinity; - - // Default or trim path - this.path = this.path - ? this.path.trim(): req - ? url.parse(req.url).pathname: '/'; -}; - -/** - * Return the original cookie string. - * - * @return {String} - * @api public - */ - -Cookie.prototype.toString = function(){ - return this.str; -}; - -module.exports.Jar = require('./jar') \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js deleted file mode 100644 index 34920e0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! -* Tobi - CookieJar -* Copyright(c) 2010 LearnBoost -* MIT Licensed -*/ - -/** -* Module dependencies. -*/ - -var url = require('url'); - -/** -* Initialize a new `CookieJar`. -* -* @api private -*/ - -var CookieJar = exports = module.exports = function CookieJar() { - this.cookies = []; -}; - -/** -* Add the given `cookie` to the jar. -* -* @param {Cookie} cookie -* @api private -*/ - -CookieJar.prototype.add = function(cookie){ - this.cookies = this.cookies.filter(function(c){ - // Avoid duplication (same path, same name) - return !(c.name == cookie.name && c.path == cookie.path); - }); - this.cookies.push(cookie); -}; - -/** -* Get cookies for the given `req`. -* -* @param {IncomingRequest} req -* @return {Array} -* @api private -*/ - -CookieJar.prototype.get = function(req){ - var path = url.parse(req.url).pathname - , now = new Date - , specificity = {}; - return this.cookies.filter(function(cookie){ - if (0 == path.indexOf(cookie.path) && now < cookie.expires - && cookie.path.length > (specificity[cookie.name] || 0)) - return specificity[cookie.name] = cookie.path.length; - }); -}; - -/** -* Return Cookie string for the given `req`. -* -* @param {IncomingRequest} req -* @return {String} -* @api private -*/ - -CookieJar.prototype.cookieString = function(req){ - var cookies = this.get(req); - if (cookies.length) { - return cookies.map(function(cookie){ - return cookie.name + '=' + cookie.value; - }).join('; '); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json deleted file mode 100644 index b42df9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "cookie-jar", - "description": "Cookie Jar. Originally pulled form tobi, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/cookie-jar" - }, - "main": "index.js", - "scripts": { - "test": "node tests/run.js" - }, - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "cookie-jar\n==========\n\nCookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/cookie-jar/issues" - }, - "_id": "cookie-jar@0.3.0", - "_from": "cookie-jar@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js deleted file mode 100644 index 2cdc835..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js +++ /dev/null @@ -1,29 +0,0 @@ -var Cookie = require('../index') - , assert = require('assert'); - -var str = 'Sid="s543qactge.wKE61E01Bs%2BKhzmxrwrnug="; Path=/; httpOnly; Expires=Sat, 04 Dec 2010 23:27:28 GMT'; -var cookie = new Cookie(str); - -// test .toString() -assert.equal(cookie.toString(), str); - -// test .path -assert.equal(cookie.path, '/'); - -// test .httpOnly -assert.equal(cookie.httpOnly, true); - -// test .name -assert.equal(cookie.name, 'Sid'); - -// test .value -assert.equal(cookie.value, '"s543qactge.wKE61E01Bs%2BKhzmxrwrnug="'); - -// test .expires -assert.equal(cookie.expires instanceof Date, true); - -// test .path default -var cookie = new Cookie('foo=bar', { url: 'http://foo.com/bar' }); -assert.equal(cookie.path, '/bar'); - -console.log('All tests passed'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js deleted file mode 100644 index a33cfb2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js +++ /dev/null @@ -1,90 +0,0 @@ -var Cookie = require('../index') - , Jar = Cookie.Jar - , assert = require('assert'); - -function expires(ms) { - return new Date(Date.now() + ms).toUTCString(); -} - -// test .get() expiration -(function() { - var jar = new Jar; - var cookie = new Cookie('sid=1234; path=/; expires=' + expires(1000)); - jar.add(cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 0); - }, 1000); - }, 5); -})(); - -// test .get() path support -(function() { - var jar = new Jar; - var a = new Cookie('sid=1234; path=/'); - var b = new Cookie('sid=1111; path=/foo/bar'); - var c = new Cookie('sid=2222; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - - // should remove the duplicates - assert.equal(jar.cookies.length, 2); - - // same name, same path, latter prevails - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], c); - - // same name, diff path, path specifity prevails, latter prevails - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], a); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=3333; path=/foo/bar'); - var c = new Cookie('pid=3333; path=/foo/bar'); - var d = new Cookie('sid=2222; path=/foo/'); - var e = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - jar.add(d); - jar.add(e); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 2); - assert.equal(cookies[0], b); - assert.equal(cookies[1], c); - - var cookies = jar.get({ url: 'http://foo.com/foo/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], d); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], e); -})(); - -setTimeout(function() { - console.log('All tests passed'); -}, 1200); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md deleted file mode 100644 index 9d5b663..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -forever-agent -============= - -HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js deleted file mode 100644 index 5c07928..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js +++ /dev/null @@ -1,119 +0,0 @@ -module.exports = ForeverAgent -ForeverAgent.SSL = ForeverAgentSSL - -var util = require('util') - , Agent = require('http').Agent - , net = require('net') - , tls = require('tls') - , AgentSSL = require('https').Agent - -function ForeverAgent(options) { - var self = this - self.options = options || {} - self.requests = {} - self.sockets = {} - self.freeSockets = {} - self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets - self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets - self.on('free', function(socket, host, port) { - var name = host + ':' + port - if (self.requests[name] && self.requests[name].length) { - self.requests[name].shift().onSocket(socket) - } else if (self.sockets[name].length < self.minSockets) { - if (!self.freeSockets[name]) self.freeSockets[name] = [] - self.freeSockets[name].push(socket) - - // if an error happens while we don't use the socket anyway, meh, throw the socket away - function onIdleError() { - socket.destroy() - } - socket._onIdleError = onIdleError - socket.on('error', onIdleError) - } else { - // If there are no pending requests just destroy the - // socket and it will get removed from the pool. This - // gets us out of timeout issues and allows us to - // default to Connection:keep-alive. - socket.destroy() - } - }) - -} -util.inherits(ForeverAgent, Agent) - -ForeverAgent.defaultMinSockets = 5 - - -ForeverAgent.prototype.createConnection = net.createConnection -ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest -ForeverAgent.prototype.addRequest = function(req, host, port) { - var name = host + ':' + port - if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { - var idleSocket = this.freeSockets[name].pop() - idleSocket.removeListener('error', idleSocket._onIdleError) - delete idleSocket._onIdleError - req._reusedSocket = true - req.onSocket(idleSocket) - } else { - this.addRequestNoreuse(req, host, port) - } -} - -ForeverAgent.prototype.removeSocket = function(s, name, host, port) { - if (this.sockets[name]) { - var index = this.sockets[name].indexOf(s) - if (index !== -1) { - this.sockets[name].splice(index, 1) - } - } else if (this.sockets[name] && this.sockets[name].length === 0) { - // don't leak - delete this.sockets[name] - delete this.requests[name] - } - - if (this.freeSockets[name]) { - var index = this.freeSockets[name].indexOf(s) - if (index !== -1) { - this.freeSockets[name].splice(index, 1) - if (this.freeSockets[name].length === 0) { - delete this.freeSockets[name] - } - } - } - - if (this.requests[name] && this.requests[name].length) { - // 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(name, host, port).emit('free') - } -} - -function ForeverAgentSSL (options) { - ForeverAgent.call(this, options) -} -util.inherits(ForeverAgentSSL, ForeverAgent) - -ForeverAgentSSL.prototype.createConnection = createConnectionSSL -ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest - -function createConnectionSSL (port, host, options) { - if (typeof port === 'object') { - options = port; - } else if (typeof host === 'object') { - options = host; - } else if (typeof options === 'object') { - options = options; - } else { - options = {}; - } - - if (typeof port === 'number') { - options.port = port; - } - - if (typeof host === 'string') { - options.host = host; - } - - return tls.connect(options); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json deleted file mode 100644 index 42d35ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "forever-agent", - "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", - "version": "0.5.0", - "repository": { - "url": "https://github.com/mikeal/forever-agent" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/forever-agent/issues" - }, - "_id": "forever-agent@0.5.0", - "_from": "forever-agent@~0.5.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License deleted file mode 100644 index c7ff12a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md deleted file mode 100644 index dc73c46..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md +++ /dev/null @@ -1,163 +0,0 @@ -# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data) - -A module to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. - -The API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. - -[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface -[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions - -## Install - -``` -npm install form-data -``` - -## Usage - -In this example we are constructing a form with 3 fields that contain a string, -a buffer and a file stream. - -``` javascript -var FormData = require('form-data'); -var fs = require('fs'); - -var form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); -``` - -Also you can use http-response stream: - -``` javascript -var FormData = require('form-data'); -var http = require('http'); - -var form = new FormData(); - -http.request('http://nodejs.org/images/logo.png', function(response) { - form.append('my_field', 'my value'); - form.append('my_buffer', new Buffer(10)); - form.append('my_logo', response); -}); -``` - -Or @mikeal's request stream: - -``` javascript -var FormData = require('form-data'); -var request = require('request'); - -var form = new FormData(); - -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_logo', request('http://nodejs.org/images/logo.png')); -``` - -In order to submit this form to a web application, call ```submit(url, [callback])``` method: - -``` javascript -form.submit('http://example.org/', function(err, res) { - // res – response object (http.IncomingMessage) // - res.resume(); // for node-0.10.x -}); - -``` - -For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. - -### Alternative submission methods - -You can use node's http client interface: - -``` javascript -var http = require('http'); - -var request = http.request({ - method: 'post', - host: 'example.org', - path: '/upload', - headers: form.getHeaders() -}); - -form.pipe(request); - -request.on('response', function(res) { - console.log(res.statusCode); -}); -``` - -Or if you would prefer the `'Content-Length'` header to be set for you: - -``` javascript -form.submit('example.org/upload', function(err, res) { - console.log(res.statusCode); -}); -``` - -To use custom headers and pre-known length in parts: - -``` javascript -var CRLF = '\r\n'; -var form = new FormData(); - -var options = { - header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, - knownLength: 1 -}; - -form.append('my_buffer', buffer, options); - -form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); -}); -``` - -Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: - -``` javascript -someModule.stream(function(err, stdout, stderr) { - if (err) throw err; - - var form = new FormData(); - - form.append('file', stdout, { - filename: 'unicycle.jpg', - contentType: 'image/jpg', - knownLength: 19806 - }); - - form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); - }); -}); -``` - -For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: - -``` javascript -form.submit({ - host: 'example.com', - path: '/probably.php?extra=params', - auth: 'username:password' -}, function(err, res) { - console.log(res.statusCode); -}); -``` - -## Notes - -- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. -- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing] - -## TODO - -- Add new streams (0.10) support and try really hard not to break it for 0.8.x. - -## License - -Form-Data is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js deleted file mode 100644 index d106474..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js +++ /dev/null @@ -1,325 +0,0 @@ -var CombinedStream = require('combined-stream'); -var util = require('util'); -var path = require('path'); -var http = require('http'); -var https = require('https'); -var parseUrl = require('url').parse; -var fs = require('fs'); -var mime = require('mime'); -var async = require('async'); - -module.exports = FormData; -function FormData() { - this._overheadLength = 0; - this._valueLength = 0; - this._lengthRetrievers = []; - - CombinedStream.call(this); -} -util.inherits(FormData, CombinedStream); - -FormData.LINE_BREAK = '\r\n'; - -FormData.prototype.append = function(field, value, options) { - options = options || {}; - - var append = CombinedStream.prototype.append.bind(this); - - // all that streamy business can't handle numbers - if (typeof value == 'number') value = ''+value; - - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; - } - - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(field, value, options); - - append(header); - append(value); - append(footer); - - // pass along options.knownLength - this._trackLength(header, value, options); -}; - -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } - - this._valueLength += valueLength; - - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - + FormData.LINE_BREAK.length; - - // empty or either doesn't have path or not an http response - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { - return; - } - - // no need to bother with the length - if (!options.knownLength) - this._lengthRetrievers.push(function(next) { - - if (value.hasOwnProperty('fd')) { - fs.stat(value.path, function(err, stat) { - if (err) { - next(err); - return; - } - - next(null, stat.size); - }); - - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - next(null, +value.headers['content-length']); - - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - next(null, +response.headers['content-length']); - }); - value.resume(); - - // something else - } else { - next('Unknown stream'); - } - }); -}; - -FormData.prototype._multiPartHeader = function(field, value, options) { - var boundary = this.getBoundary(); - var header = ''; - - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (options.header != null) { - header = options.header; - } else { - header += '--' + boundary + FormData.LINE_BREAK + - 'Content-Disposition: form-data; name="' + field + '"'; - - // fs- and request- streams have path property - // or use custom filename and/or contentType - // TODO: Use request's response mime-type - if (options.filename || value.path) { - header += - '; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path)); - - // http response has not - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - header += - '; filename="' + path.basename(value.client._httpMessage.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + value.headers['content-type']; - } - - header += FormData.LINE_BREAK + FormData.LINE_BREAK; - } - - return header; -}; - -FormData.prototype._multiPartFooter = function(field, value, options) { - return function(next) { - var footer = FormData.LINE_BREAK; - - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--'; -}; - -FormData.prototype.getHeaders = function(userHeaders) { - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; - - for (var header in userHeaders) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - - return formHeaders; -} - -FormData.prototype.getCustomHeaders = function(contentType) { - contentType = contentType ? contentType : 'multipart/form-data'; - - var formHeaders = { - 'content-type': contentType + '; boundary=' + this.getBoundary(), - 'content-length': this.getLengthSync() - }; - - return formHeaders; -} - -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - - return this._boundary; -}; - -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } - - this._boundary = boundary; -}; - -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function(debug) { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - // https://github.com/felixge/node-form-data/issues/40 - if (this._lengthRetrievers.length) { - // Some async length retrivers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } - - return knownLength; -}; - -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - if (!this._lengthRetrievers.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - - async.parallel(this._lengthRetrievers, function(err, values) { - if (err) { - cb(err); - return; - } - - values.forEach(function(length) { - knownLength += length; - }); - - cb(null, knownLength); - }); -}; - -FormData.prototype.submit = function(params, cb) { - - var request - , options - , defaults = { - method : 'post', - headers: this.getHeaders() - }; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - params = parseUrl(params); - - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname - }, defaults); - } - else // use custom params - { - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; - } - } - - // https if specified, fallback to http in any other case - if (params.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } - - // get content length and fire away - this.getLength(function(err, length) { - - // TODO: Add chunked encoding when no length (if err) - - // add content length - request.setHeader('Content-Length', length); - - this.pipe(request); - if (cb) { - request.on('error', cb); - request.on('response', cb.bind(this, null)); - } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (this.error) return; - - this.error = err; - this.pause(); - this.emit('error', err); -}; - -/* - * Santa's little helpers - */ - -// populates missing values -function populate(dst, src) { - for (var prop in src) { - if (!dst[prop]) dst[prop] = src[prop]; - } - return dst; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md deleted file mode 100644 index 9ff1acf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md +++ /dev/null @@ -1,1414 +0,0 @@ -# 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) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [doWhilst](#doWhilst) -* [until](#until) -* [doUntil](#doUntil) -* [forever](#forever) -* [waterfall](#waterfall) -* [compose](#compose) -* [applyEach](#applyEach) -* [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.map(['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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json deleted file mode 100644 index bbb0115..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js deleted file mode 100755 index cb6320d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +++ /dev/null @@ -1,955 +0,0 @@ -/*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 = setImmediate; - } - 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* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\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* [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.map(['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", - "_id": "async@0.2.9", - "_from": "async@~0.2.9" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore deleted file mode 100644 index aba34f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -*.un~ -/node_modules -/test/tmp diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile deleted file mode 100644 index b4ff85a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md deleted file mode 100644 index 1a9999e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +++ /dev/null @@ -1,132 +0,0 @@ -# combined-stream - -A stream that emits multiple other streams one after another. - -## Installation - -``` bash -npm install combined-stream -``` - -## Usage - -Here is a simple example that shows how you can use combined-stream to combine -two files into one: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -While the example above works great, it will pause all source streams until -they are needed. If you don't want that to happen, you can set `pauseStreams` -to `false`: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create({pauseStreams: false}); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -However, what if you don't have all the source streams yet, or you don't want -to allocate the resources (file descriptors, memory, etc.) for them right away? -Well, in that case you can simply provide a callback that supplies the stream -by calling a `next()` function: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(function(next) { - next(fs.createReadStream('file1.txt')); -}); -combinedStream.append(function(next) { - next(fs.createReadStream('file2.txt')); -}); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -## API - -### CombinedStream.create([options]) - -Returns a new combined stream object. Available options are: - -* `maxDataSize` -* `pauseStreams` - -The effect of those options is described below. - -### combinedStream.pauseStreams = true - -Whether to apply back pressure to the underlaying streams. If set to `false`, -the underlaying streams will never be paused. If set to `true`, the -underlaying streams will be paused right after being appended, as well as when -`delayedStream.pipe()` wants to throttle. - -### combinedStream.maxDataSize = 2 * 1024 * 1024 - -The maximum amount of bytes (or characters) to buffer for all source streams. -If this value is exceeded, `combinedStream` emits an `'error'` event. - -### combinedStream.dataSize = 0 - -The amount of bytes (or characters) currently buffered by `combinedStream`. - -### combinedStream.append(stream) - -Appends the given `stream` to the combinedStream object. If `pauseStreams` is -set to `true, this stream will also be paused right away. - -`streams` can also be a function that takes one parameter called `next`. `next` -is a function that must be invoked in order to provide the `next` stream, see -example above. - -Regardless of how the `stream` is appended, combined-stream always attaches an -`'error'` listener to it, so you don't have to do that manually. - -Special case: `stream` can also be a String or Buffer. - -### combinedStream.write(data) - -You should not call this, `combinedStream` takes care of piping the appended -streams into itself for you. - -### combinedStream.resume() - -Causes `combinedStream` to start drain the streams it manages. The function is -idempotent, and also emits a `'resume'` event each time which usually goes to -the stream that is currently being drained. - -### combinedStream.pause(); - -If `combinedStream.pauseStreams` is set to `false`, this does nothing. -Otherwise a `'pause'` event is emitted, this goes to the stream that is -currently being drained, so you can use it to apply back pressure. - -### combinedStream.end(); - -Sets `combinedStream.writable` to false, emits an `'end'` event, and removes -all streams from the queue. - -### combinedStream.destroy(); - -Same as `combinedStream.end()`, except it emits a `'close'` event instead of -`'end'`. - -## License - -combined-stream is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js deleted file mode 100644 index 32849fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +++ /dev/null @@ -1,185 +0,0 @@ -var util = require('util'); -var Stream = require('stream').Stream; -var DelayedStream = require('delayed-stream'); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - stream.on('data', this._checkDataSize.bind(this)); - - stream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)) - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore deleted file mode 100644 index 2fedb26..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -*.un~ -/node_modules/* diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile deleted file mode 100644 index b4ff85a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md deleted file mode 100644 index 5cb5b35..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +++ /dev/null @@ -1,154 +0,0 @@ -# delayed-stream - -Buffers events from a stream until you are ready to handle them. - -## Installation - -``` bash -npm install delayed-stream -``` - -## Usage - -The following example shows how to write a http echo server that delays its -response by 1000 ms. - -``` javascript -var DelayedStream = require('delayed-stream'); -var http = require('http'); - -http.createServer(function(req, res) { - var delayed = DelayedStream.create(req); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 1000); -}); -``` - -If you are not using `Stream#pipe`, you can also manually release the buffered -events by calling `delayedStream.resume()`: - -``` javascript -var delayed = DelayedStream.create(req); - -setTimeout(function() { - // Emit all buffered events and resume underlaying source - delayed.resume(); -}, 1000); -``` - -## Implementation - -In order to use this meta stream properly, here are a few things you should -know about the implementation. - -### Event Buffering / Proxying - -All events of the `source` stream are hijacked by overwriting the `source.emit` -method. Until node implements a catch-all event listener, this is the only way. - -However, delayed-stream still continues to emit all events it captures on the -`source`, regardless of whether you have released the delayed stream yet or -not. - -Upon creation, delayed-stream captures all `source` events and stores them in -an internal event buffer. Once `delayedStream.release()` is called, all -buffered events are emitted on the `delayedStream`, and the event buffer is -cleared. After that, delayed-stream merely acts as a proxy for the underlaying -source. - -### Error handling - -Error events on `source` are buffered / proxied just like any other events. -However, `delayedStream.create` attaches a no-op `'error'` listener to the -`source`. This way you only have to handle errors on the `delayedStream` -object, rather than in two places. - -### Buffer limits - -delayed-stream provides a `maxDataSize` property that can be used to limit -the amount of data being buffered. In order to protect you from bad `source` -streams that don't react to `source.pause()`, this feature is enabled by -default. - -## API - -### DelayedStream.create(source, [options]) - -Returns a new `delayedStream`. Available options are: - -* `pauseStream` -* `maxDataSize` - -The description for those properties can be found below. - -### delayedStream.source - -The `source` stream managed by this object. This is useful if you are -passing your `delayedStream` around, and you still want to access properties -on the `source` object. - -### delayedStream.pauseStream = true - -Whether to pause the underlaying `source` when calling -`DelayedStream.create()`. Modifying this property afterwards has no effect. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. You can also modify this property during runtime. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. - -### delayedStream.dataSize = 0 - -The amount of data buffered so far. - -### delayedStream.readable - -An ECMA5 getter that returns the value of `source.readable`. - -### delayedStream.resume() - -If the `delayedStream` has not been released so far, `delayedStream.release()` -is called. - -In either case, `source.resume()` is called. - -### delayedStream.pause() - -Calls `source.pause()`. - -### delayedStream.pipe(dest) - -Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. - -### delayedStream.release() - -Emits and clears all events that have been buffered up so far. This does not -resume the underlaying source, use `delayedStream.resume()` instead. - -## License - -delayed-stream is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js deleted file mode 100644 index 7c10d48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +++ /dev/null @@ -1,99 +0,0 @@ -var Stream = require('stream').Stream; -var util = require('util'); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -DelayedStream.prototype.__defineGetter__('readable', function() { - return this.source.readable; -}); - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json deleted file mode 100644 index 1628b4b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "version": "0.0.5", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n var delayed = DelayedStream.create(req);\n\n setTimeout(function() {\n res.writeHead(200);\n delayed.pipe(res);\n }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n // Emit all buffered events and resume underlaying source\n delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-delayed-stream/issues" - }, - "_id": "delayed-stream@0.0.5", - "_from": "delayed-stream@0.0.5", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js deleted file mode 100644 index 4d71b8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +++ /dev/null @@ -1,6 +0,0 @@ -var common = module.exports; - -common.DelayedStream = require('..'); -common.assert = require('assert'); -common.fake = require('fake'); -common.PORT = 49252; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js deleted file mode 100644 index 9ecad5b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var DelayedStream = common.DelayedStream; -var http = require('http'); - -var UPLOAD = new Buffer(10 * 1024 * 1024); - -var server = http.createServer(function(req, res) { - var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length}); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 10); -}); -server.listen(common.PORT, function() { - var request = http.request({ - method: 'POST', - port: common.PORT, - }); - - request.write(UPLOAD); - request.end(); - - request.on('response', function(res) { - var received = 0; - res - .on('data', function(chunk) { - received += chunk.length; - }) - .on('end', function() { - assert.equal(received, UPLOAD.length); - server.close(); - }); - }); -}); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js deleted file mode 100644 index 6f417f3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +++ /dev/null @@ -1,21 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testAutoPause() { - var source = new Stream(); - - fake.expect(source, 'pause', 1); - var delayedStream = DelayedStream.create(source); - fake.verify(); -})(); - -(function testDisableAutoPause() { - var source = new Stream(); - fake.expect(source, 'pause', 0); - - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js deleted file mode 100644 index b50c397..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +++ /dev/null @@ -1,14 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(source, 'pause'); - delayedStream.pause(); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js deleted file mode 100644 index fc4047e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +++ /dev/null @@ -1,48 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // delayedStream must not emit until we resume - fake.expect(delayedStream, 'emit', 0); - - // but our original source must emit - var params = []; - source.on('foo', function(param) { - params.push(param); - }); - - source.emit('foo', 1); - source.emit('foo', 2); - - // Make sure delayedStream did not emit, and source did - assert.deepEqual(params, [1, 2]); - fake.verify(); - - // After resume, delayedStream must playback all events - fake - .stub(delayedStream, 'emit') - .times(Infinity) - .withArg(1, 'newListener'); - fake.expect(delayedStream, 'emit', ['foo', 1]); - fake.expect(delayedStream, 'emit', ['foo', 2]); - fake.expect(source, 'resume'); - - delayedStream.resume(); - fake.verify(); - - // Calling resume again will delegate to source - fake.expect(source, 'resume'); - delayedStream.resume(); - fake.verify(); - - // Emitting more events directly leads to them being emitted - fake.expect(delayedStream, 'emit', ['foo', 3]); - source.emit('foo', 3); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js deleted file mode 100644 index a9d35e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +++ /dev/null @@ -1,15 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testHandleSourceErrors() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // We deal with this by attaching a no-op listener to 'error' on the source - // when creating a new DelayedStream. This way error events on the source - // won't throw. - source.emit('error', new Error('something went wrong')); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 7638a2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,18 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testMaxDataSize() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false}); - - source.emit('data', new Buffer(1024)); - - fake - .expect(delayedStream, 'emit') - .withArg(1, 'error'); - source.emit('data', new Buffer(1)); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js deleted file mode 100644 index 7d312ab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testPipeReleases() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(delayedStream, 'resume'); - delayedStream.pipe(new Stream()); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js deleted file mode 100644 index d436163..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testProxyReadableProperty() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - source.readable = fake.value('source.readable'); - assert.strictEqual(delayedStream.readable, source.readable); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js deleted file mode 100755 index 0bb8e82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json deleted file mode 100644 index 192a544..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "combined-stream", - "description": "A stream that emits multiple other streams one after another.", - "version": "0.0.4", - "homepage": "https://github.com/felixge/node-combined-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-combined-stream.git" - }, - "main": "./lib/combined_stream", - "engines": { - "node": "*" - }, - "dependencies": { - "delayed-stream": "0.0.5" - }, - "devDependencies": { - "far": "0.0.1" - }, - "readme": "# combined-stream\n\nA stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = true\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = 2 * 1024 * 1024\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = 0\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-combined-stream/issues" - }, - "_id": "combined-stream@0.0.4", - "_from": "combined-stream@~0.0.4", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js deleted file mode 100644 index 8154348..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js +++ /dev/null @@ -1,23 +0,0 @@ -var common = module.exports; - -var path = require('path'); -var fs = require('fs'); -var root = path.join(__dirname, '..'); - -common.dir = { - fixture: root + '/test/fixture', - tmp: root + '/test/tmp', -}; - -// Create tmp directory if it does not exist -// Not using fs.exists so as to be node 0.6.x compatible -try { - fs.statSync(common.dir.tmp); -} -catch (e) { - // Dir does not exist - fs.mkdirSync(common.dir.tmp); -} - -common.CombinedStream = require(root); -common.assert = require('assert'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt deleted file mode 100644 index 50e0218..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt +++ /dev/null @@ -1,256 +0,0 @@ -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt deleted file mode 100644 index da1d821..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt +++ /dev/null @@ -1,256 +0,0 @@ -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js deleted file mode 100644 index 44ecaba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js +++ /dev/null @@ -1,27 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE1)); - }); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE2)); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js deleted file mode 100644 index e3fbd18..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js +++ /dev/null @@ -1,34 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; - -(function testDataSizeGetter() { - var combinedStream = CombinedStream.create(); - - assert.strictEqual(combinedStream.dataSize, 0); - - // Test one stream - combinedStream._streams.push({dataSize: 10}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 10); - - // Test two streams - combinedStream._streams.push({dataSize: 23}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test currentStream - combinedStream._currentStream = {dataSize: 20}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 53); - - // Test currentStream without dataSize - combinedStream._currentStream = {}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test stream function - combinedStream._streams.push(function() {}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js deleted file mode 100644 index c678575..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var BUFFER = new Buffer('Bacon is delicious'); -var FILE2 = common.dir.fixture + '/file2.txt'; -var STRING = 'The € kicks the $\'s ass!'; - -var EXPECTED = - fs.readFileSync(FILE1) - + BUFFER - + fs.readFileSync(FILE2) - + STRING; -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(BUFFER); - combinedStream.append(fs.createReadStream(FILE2)); - combinedStream.append(function(next) { - next(STRING); - }); - - var tmpFile = common.dir.tmp + '/combined-file1-buffer-file2-string.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js deleted file mode 100644 index 263cfdf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js +++ /dev/null @@ -1,35 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.equal(stream2.dataSize, 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - console.error(GOT.length, EXPECTED.length); - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js deleted file mode 100644 index c3d288d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js +++ /dev/null @@ -1,39 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var util = require('util'); -var Stream = require('stream').Stream; - -var s = CombinedStream.create(); - - -function StringStream(){ - this.writable=true; - this.str="" -} -util.inherits(StringStream,Stream); - -StringStream.prototype.write=function(chunk,encoding){ - this.str+=chunk.toString(); - this.emit('data',chunk); -} - -StringStream.prototype.end=function(chunk,encoding){ - this.emit('end'); -} - -StringStream.prototype.toString=function(){ - return this.str; -} - - -s.append("foo."); -s.append(""); -s.append("bar"); - -var ss = new StringStream(); - -s.pipe(ss); -s.resume(); - -assert.equal(ss.toString(),"foo.bar"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js deleted file mode 100644 index aefa36e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var FILE1 = common.dir.fixture + '/file1.txt'; -var fileStream = fs.createReadStream(FILE1); - -var foo = function(){}; - -(function testIsStreamLike() { - assert(! CombinedStream.isStreamLike(true)); - assert(! CombinedStream.isStreamLike("I am a string")); - assert(! CombinedStream.isStreamLike(7)); - assert(! CombinedStream.isStreamLike(foo)); - - assert(CombinedStream.isStreamLike(fileStream)); -})(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 25f47a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false, maxDataSize: 20736}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var gotErr = null; - combinedStream.on('error', function(err) { - gotErr = err; - }); - - process.on('exit', function() { - assert.ok(gotErr); - assert.ok(gotErr.message.match(/bytes/)); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js deleted file mode 100644 index 30a3a6f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js +++ /dev/null @@ -1,30 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.ok(stream2.dataSize > 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js deleted file mode 100755 index 0bb8e82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json deleted file mode 100644 index 146491b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "form-data", - "description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "0.1.2", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-form-data.git" - }, - "main": "./lib/form_data", - "scripts": { - "test": "node test/run.js" - }, - "engines": { - "node": ">= 0.6" - }, - "dependencies": { - "combined-stream": "~0.0.4", - "mime": "~1.2.11", - "async": "~0.2.9" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/felixge/node-form-data/master/License" - } - ], - "devDependencies": { - "fake": "~0.2.2", - "far": "~0.0.7", - "formidable": "~1.0.14", - "request": "~2.27.0" - }, - "readme": "# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)\n\nA module to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n form.append('my_field', 'my value');\n form.append('my_buffer', new Buffer(10));\n form.append('my_logo', response);\n});\n```\n\nOr @mikeal's request stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n // res – response object (http.IncomingMessage) //\n res.resume(); // for node-0.10.x\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n method: 'post',\n host: 'example.org',\n path: '/upload',\n headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n if (err) throw err;\n\n var form = new FormData();\n\n form.append('file', stdout, {\n filename: 'unicycle.jpg',\n contentType: 'image/jpg',\n knownLength: 19806\n });\n\n form.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n host: 'example.com',\n path: '/probably.php?extra=params',\n auth: 'username:password'\n}, function(err, res) {\n console.log(res.statusCode);\n});\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]\n\n## TODO\n\n- Add new streams (0.10) support and try really hard not to break it for 0.8.x.\n\n## License\n\nForm-Data is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-form-data/issues" - }, - "_id": "form-data@0.1.2", - "_from": "form-data@~0.1.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore deleted file mode 100644 index 77ba16c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml deleted file mode 100755 index 047f7e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js - -node_js: - - 0.10 - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE deleted file mode 100755 index e699a7b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2012-2013, Eran Hammer. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Eran Hammer nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile deleted file mode 100755 index 5f339bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -test: - @node node_modules/lab/bin/lab -test-cov: - @node node_modules/lab/bin/lab -r threshold -t 100 -test-cov-html: - @node node_modules/lab/bin/lab -r html -o coverage.html -complexity: - @node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib - -.PHONY: test test-cov test-cov-html complexity diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md deleted file mode 100755 index 010bac6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md +++ /dev/null @@ -1,627 +0,0 @@ -![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png) - - **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial -HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz). - -Current version: **1.0** - -[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk) - -# Table of Content - -- [**Introduction**](#introduction) - - [Replay Protection](#replay-protection) - - [Usage Example](#usage-example) - - [Protocol Example](#protocol-example) - - [Payload Validation](#payload-validation) - - [Response Payload Validation](#response-payload-validation) - - [Browser Support and Considerations](#browser-support-and-considerations) -

        -- [**Single URI Authorization**](#single-uri-authorization) - - [Usage Example](#bewit-usage-example) -

        -- [**Security Considerations**](#security-considerations) - - [MAC Keys Transmission](#mac-keys-transmission) - - [Confidentiality of Requests](#confidentiality-of-requests) - - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers) - - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials) - - [Entropy of Keys](#entropy-of-keys) - - [Coverage Limitations](#coverage-limitations) - - [Future Time Manipulation](#future-time-manipulation) - - [Client Clock Poisoning](#client-clock-poisoning) - - [Bewit Limitations](#bewit-limitations) - - [Host Header Forgery](#host-header-forgery) -

        -- [**Frequently Asked Questions**](#frequently-asked-questions) -

        -- [**Acknowledgements**](#acknowledgements) - -# Introduction - -**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with -partial cryptographic verification of the request and response, covering the HTTP method, request URI, host, -and optionally the request payload. - -Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of -client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme, -the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is -included in its place. - -However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of -replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less -"chattiness" (interaction with the server). - -Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because -the client and server must both have access to the key material in the clear. - -The primary design goals of this scheme are to: -* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources, -* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where - to send an authenticated request), and -* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client - failure to validate the server's identity as part of its TLS handshake. - -In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using -a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk). - -The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server, -which is beyond the scope of this module. Typically, the shared credentials are established via an initial -TLS-protected phase or derived from some other shared confidential information available to both the client -and the server. - - -## Replay Protection - -Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more -than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when -making requests. This gives the server enough information to prevent replay attacks. - -The nonce is generated by the client, and is a string unique across all requests with the same timestamp and -key identifier combination. - -The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards -are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks. -By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in -practice translates to a maximum of 2 minutes as the skew can be positive or negative). - -Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client -clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types -(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response -to a bad timestamp. - -There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a -potential attack vector). Instead, the client only uses the server's time to calculate an offset used only -for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing -the number of round trips required to authenticate the first request. - - -## Usage Example - -Server code: - -```javascript -var Http = require('http'); -var Hawk = require('hawk'); - - -// Credentials lookup function - -var credentialsFunc = function (id, callback) { - - var credentials = { - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256', - user: 'Steve' - }; - - return callback(null, credentials); -}; - -// Create HTTP server - -var handler = function (req, res) { - - // Authenticate incoming request - - Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) { - - // Prepare response - - var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!'); - var headers = { 'Content-Type': 'text/plain' }; - - // Generate Server-Authorization response header - - var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] }); - headers['Server-Authorization'] = header; - - // Send the response back - - res.writeHead(!err ? 200 : 401, headers); - res.end(payload); - }); -}; - -// Start server - -Http.createServer(handler).listen(8000, 'example.com'); -``` - -Client code: - -```javascript -var Request = require('request'); -var Hawk = require('hawk'); - - -// Client credentials - -var credentials = { - id: 'dh37fgj492je', - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256' -} - -// Request options - -var requestOptions = { - uri: 'http://example.com:8000/resource/1?b=1&a=2', - method: 'GET', - headers: {} -}; - -// Generate Authorization request header - -var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' }); -requestOptions.headers.Authorization = header.field; - -// Send authenticated request - -Request(requestOptions, function (error, response, body) { - - // Authenticate the server's response - - var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body }); - - // Output results - - console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)')); -}); -``` - -**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local -machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method. - -```javascript -Hawk.sntp.start(); -``` - - -## Protocol Example - -The client attempts to access a protected resource without authentication, sending the following HTTP request to -the resource server: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -``` - -The resource server returns an authentication challenge. - -``` -HTTP/1.1 401 Unauthorized -WWW-Authenticate: Hawk -``` - -The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/" -server. The **Hawk** credentials issued to the client include the following attributes: - -* Key identifier: dh37fgj492je -* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn -* Algorithm: sha256 - -The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1, -1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline -character): - -``` -hawk.1.header -1353832234 -j4h3g2 -GET -/resource/1?b=1&a=2 -example.com -8000 - -some-app-ext-data - -``` - -The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string. -The result is base64-encoded to produce the request MAC: - -``` -6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE= -``` - -The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using -the HTTP `Authorization` request header field: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=" -``` - -The server validates the request by calculating the request MAC again based on the request received and verifies the validity -and scope of the **Hawk** credentials. If valid, the server responds with the requested resource. - - -### Payload Validation - -**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash -using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character): -* `hawk.1.payload` -* the content-type in lowercase, without any parameters (e.g. `application/json`) -* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability) - -For example: - -* Payload: `Thank you for flying Hawk` -* Content Type: `text/plain` -* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=` - -Results in the following input to the payload hash function (newline terminated values): - -``` -hawk.1.payload -text/plain -Thank you for flying Hawk - -``` - -Which produces the following hash value: - -``` -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -``` - -The client constructs the normalized request string (newline terminated values): - -``` -hawk.1.header -1353832234 -j4h3g2 -POST -/resource/1?a=1&b=2 -example.com -8000 -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -some-app-ext-data - -``` - -Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data, -and request MAC, with the request using the HTTP `Authorization` request header field: - -``` -POST /resource/1?a=1&b=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=" -``` - -It is up to the server if and when it validates the payload for any given request, based solely on it's security policy -and the nature of the data included. - -If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct -the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value -with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash. - -However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed -at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value -provided by the client after validating the MAC. - -It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value -included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided -by the client, the payload may be modified by an attacker. - - -## Response Payload Validation - -**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the -client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header -as a response header using the exact same syntax as the `Authorization` request header field. - -The header is contructed using the same process as the client's request header. The server uses the same credentials and other -artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with -new values based on the server response. The rest as identical to those used by the client. - -The result MAC digest is included with the optional `hash` and `ext` values: - -``` -Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific" -``` - - -## Browser Support and Considerations - -A browser script is provided for including using a `')); - expect(boom.response.payload.message).to.not.contain(''); - expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e'); - done(); - }); - - it('encodes \' characters', function (done) { - - var encoded = Hoek.escapeJavaScript('something(\'param\')'); - expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29'); - done(); - }); - - it('encodes large unicode characters with the correct padding', function (done) { - - var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000)); - expect(encoded).to.equal('\\u0500\\u1000'); - done(); - }); - - it('doesn\'t throw an exception when passed null', function (done) { - - var encoded = Hoek.escapeJavaScript(null); - expect(encoded).to.equal(''); - done(); - }); - }); - - describe('#escapeHtml', function () { - - it('encodes / characters', function (done) { - - var encoded = Hoek.escapeHtml(''); - expect(encoded).to.equal('<script>alert(1)</script>'); - done(); - }); - - it('encodes < and > as named characters', function (done) { - - var encoded = Hoek.escapeHtml(' -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -### 1.4.0 - -* Improved module context detection -* Removed public RNG functions - -### 1.3.2 - -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -### 1.3.0 - -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md deleted file mode 100644 index aaeb2ea..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# node-uuid Benchmarks - -### Results - -To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark - -### Run them yourself - -node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`. - -To prepare and run the benchmark issue; - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -You'll see an output like this one: - -``` -# v4 -nodeuuid.v4(): 854700 uuids/second -nodeuuid.v4('binary'): 788643 uuids/second -nodeuuid.v4('binary', buffer): 1336898 uuids/second -uuid(): 479386 uuids/second -uuid('binary'): 582072 uuids/second -uuidjs.create(4): 312304 uuids/second - -# v1 -nodeuuid.v1(): 938086 uuids/second -nodeuuid.v1('binary'): 683060 uuids/second -nodeuuid.v1('binary', buffer): 1644736 uuids/second -uuidjs.create(1): 190621 uuids/second -``` - -* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library. -* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK. - -If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file: - -``` -for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done; -``` - -If you're interested in how performance varies between different node versions, you can issue the above command multiple times. - -You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot: - -``` -(cd benchmark/ && ./bench.sh) -``` - -This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu deleted file mode 100644 index a342fbb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ /dev/null @@ -1,174 +0,0 @@ -#!/opt/local/bin/gnuplot -persist -# -# -# G N U P L O T -# Version 4.4 patchlevel 3 -# last modified March 2011 -# System: Darwin 10.8.0 -# -# Copyright (C) 1986-1993, 1998, 2004, 2007-2010 -# Thomas Williams, Colin Kelley and many others -# -# gnuplot home: http://www.gnuplot.info -# faq, bugs, etc: type "help seeking-assistance" -# immediate help: type "help" -# plot window: hit 'h' -set terminal postscript eps noenhanced defaultplex \ - leveldefault color colortext \ - solid linewidth 1.2 butt noclip \ - palfuncparam 2000,0.003 \ - "Helvetica" 14 -set output 'bench.eps' -unset clip points -set clip one -unset clip two -set bar 1.000000 front -set border 31 front linetype -1 linewidth 1.000 -set xdata -set ydata -set zdata -set x2data -set y2data -set timefmt x "%d/%m/%y,%H:%M" -set timefmt y "%d/%m/%y,%H:%M" -set timefmt z "%d/%m/%y,%H:%M" -set timefmt x2 "%d/%m/%y,%H:%M" -set timefmt y2 "%d/%m/%y,%H:%M" -set timefmt cb "%d/%m/%y,%H:%M" -set boxwidth -set style fill empty border -set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 -set dummy x,y -set format x "% g" -set format y "% g" -set format x2 "% g" -set format y2 "% g" -set format z "% g" -set format cb "% g" -set angles radians -unset grid -set key title "" -set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 -set key maxcolumns 2 maxrows 0 -unset label -unset arrow -set style increment default -unset style line -set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0 -unset style arrow -set style histogram clustered gap 2 title offset character 0, 0, 0 -unset logscale -set offsets graph 0.05, 0.15, 0, 0 -set pointsize 1.5 -set pointintervalbox 1 -set encoding default -unset polar -unset parametric -unset decimalsign -set view 60, 30, 1, 1 -set samples 100, 100 -set isosamples 10, 10 -set surface -unset contour -set clabel '%8.3g' -set mapping cartesian -set datafile separator whitespace -unset hidden3d -set cntrparam order 4 -set cntrparam linear -set cntrparam levels auto 5 -set cntrparam points 5 -set size ratio 0 1,1 -set origin 0,0 -set style data points -set style function lines -set xzeroaxis linetype -2 linewidth 1.000 -set yzeroaxis linetype -2 linewidth 1.000 -set zzeroaxis linetype -2 linewidth 1.000 -set x2zeroaxis linetype -2 linewidth 1.000 -set y2zeroaxis linetype -2 linewidth 1.000 -set ticslevel 0.5 -set mxtics default -set mytics default -set mztics default -set mx2tics default -set my2tics default -set mcbtics default -set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set xtics norangelimit -set xtics () -set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set ytics autofreq norangelimit -set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0 -set ztics autofreq norangelimit -set nox2tics -set noy2tics -set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set cbtics autofreq norangelimit -set title "" -set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" -set timestamp offset character 0, 0, 0 font "" norotate -set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale rfixmin -set autoscale rfixmax -set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) -set autoscale tfixmin -set autoscale tfixmax -set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale ufixmin -set autoscale ufixmax -set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale vfixmin -set autoscale vfixmax -set xlabel "" -set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" -set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate -set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) -set autoscale xfixmin -set autoscale xfixmax -set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) -set autoscale x2fixmin -set autoscale x2fixmax -set ylabel "" -set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" -set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) -set autoscale yfixmin -set autoscale yfixmax -set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) -set autoscale y2fixmin -set autoscale y2fixmax -set zlabel "" -set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale zfixmin -set autoscale zfixmax -set cblabel "" -set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale cbfixmin -set autoscale cbfixmax -set zero 1e-08 -set lmargin -1 -set bmargin -1 -set rmargin -1 -set tmargin -1 -set pm3d explicit at s -set pm3d scansautomatic -set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB -set palette rgbformulae 7, 5, 15 -set colorbox default -set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath -set fit noerrorvariables -GNUTERM = "aqua" -plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 -# EOF diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh deleted file mode 100755 index d870a0c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# for a given node version run: -# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done; - -PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte') -FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es) -INDICES=(2 3 2 3 2 2 2 2 2) -VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " ) -TMPJOIN="tmp_join" -OUTPUT="bench_results.txt" - -for I in ${!FILES[*]}; do - F=${FILES[$I]} - P=${PATTERNS[$I]} - INDEX=${INDICES[$I]} - echo "version $F" > $F - for V in $VERSIONS; do - (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F - done - if [ $I == 0 ]; then - cat $F > $TMPJOIN - else - join $TMPJOIN $F > $OUTPUT - cp $OUTPUT $TMPJOIN - fi - rm $F -done - -rm $TMPJOIN - -gnuplot bench.gnu -convert -density 200 -resize 800x560 -flatten bench.eps bench.png -rm bench.eps diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c deleted file mode 100644 index dbfc75f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Test performance of native C UUID generation - -To Compile: cc -luuid benchmark-native.c -o benchmark-native -*/ - -#include -#include -#include -#include - -int main() { - uuid_t myid; - char buf[36+1]; - int i; - struct timeval t; - double start, finish; - - gettimeofday(&t, NULL); - start = t.tv_sec + t.tv_usec/1e6; - - int n = 2e5; - for (i = 0; i < n; i++) { - uuid_generate(myid); - uuid_unparse(myid, buf); - } - - gettimeofday(&t, NULL); - finish = t.tv_sec + t.tv_usec/1e6; - double dur = finish - start; - - printf("%d uuids/sec", (int)(n/dur)); - return 0; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js deleted file mode 100644 index 40e6efb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +++ /dev/null @@ -1,84 +0,0 @@ -try { - var nodeuuid = require('../uuid'); -} catch (e) { - console.error('node-uuid require failed - skipping tests'); -} - -try { - var uuid = require('uuid'); -} catch (e) { - console.error('uuid require failed - skipping tests'); -} - -try { - var uuidjs = require('uuid-js'); -} catch (e) { - console.error('uuid-js require failed - skipping tests'); -} - -var N = 5e5; - -function rate(msg, t) { - console.log(msg + ': ' + - (N / (Date.now() - t) * 1e3 | 0) + - ' uuids/second'); -} - -console.log('# v4'); - -// node-uuid - string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4(); - rate('nodeuuid.v4() - using node.js crypto RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG}); - rate('nodeuuid.v4() - using Math.random() RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary'); - rate('nodeuuid.v4(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer); - rate('nodeuuid.v4(\'binary\', buffer)', t); -} - -// libuuid - string form -if (uuid) { - for (var i = 0, t = Date.now(); i < N; i++) uuid(); - rate('uuid()', t); - - for (var i = 0, t = Date.now(); i < N; i++) uuid('binary'); - rate('uuid(\'binary\')', t); -} - -// uuid-js - string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4); - rate('uuidjs.create(4)', t); -} - -// 140byte.es -for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)}); -rate('140byte.es_v4', t); - -console.log(''); -console.log('# v1'); - -// node-uuid - v1 string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1(); - rate('nodeuuid.v1()', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary'); - rate('nodeuuid.v1(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer); - rate('nodeuuid.v1(\'binary\', buffer)', t); -} - -// uuid-js - v1 string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1); - rate('uuidjs.create(1)', t); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json deleted file mode 100644 index ace2134..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "node-uuid", - "repo": "broofa/node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.0", - "author": "Robert Kieffer ", - "contributors": [ - {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} - ], - "keywords": ["uuid", "guid", "rfc4122"], - "dependencies": {}, - "development": {}, - "main": "uuid.js", - "scripts": [ - "uuid.js" - ], - "license": "MIT" -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json deleted file mode 100644 index 627b475..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "lib": ".", - "main": "./uuid.js", - "repository": { - "type": "git", - "url": "https://github.com/broofa/node-uuid.git" - }, - "version": "1.4.1", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "_id": "node-uuid@1.4.1", - "_from": "node-uuid@~1.4.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js deleted file mode 100644 index 05af822..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js +++ /dev/null @@ -1,63 +0,0 @@ -var assert = require('assert'), - nodeuuid = require('../uuid'), - uuidjs = require('uuid-js'), - libuuid = require('uuid').generate, - util = require('util'), - exec = require('child_process').exec, - os = require('os'); - -// On Mac Os X / macports there's only the ossp-uuid package that provides uuid -// On Linux there's uuid-runtime which provides uuidgen -var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; - -function compare(ids) { - console.log(ids); - for (var i = 0; i < ids.length; i++) { - var id = ids[i].split('-'); - id = [id[2], id[1], id[0]].join(''); - ids[i] = id; - } - var sorted = ([].concat(ids)).sort(); - - if (sorted.toString() !== ids.toString()) { - console.log('Warning: sorted !== ids'); - } else { - console.log('everything in order!'); - } -} - -// Test time order of v1 uuids -var ids = []; -while (ids.length < 10e3) ids.push(nodeuuid.v1()); - -var max = 10; -console.log('node-uuid:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); -compare(ids); - -console.log(''); -console.log('uuidjs:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); -compare(ids); - -console.log(''); -console.log('libuuid:'); -ids = []; -var count = 0; -var last = function() { - compare(ids); -} -var cb = function(err, stdout, stderr) { - ids.push(stdout.substring(0, stdout.length-1)); - count++; - if (count < max) { - return next(); - } - last(); -}; -var next = function() { - exec(uuidCmd, cb); -}; -next(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html deleted file mode 100644 index d80326e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js deleted file mode 100644 index 2469225..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js +++ /dev/null @@ -1,228 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js deleted file mode 100644 index 2fac6dc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js +++ /dev/null @@ -1,245 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md deleted file mode 100644 index 34c4a85..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md +++ /dev/null @@ -1,4 +0,0 @@ -oauth-sign -========== - -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js deleted file mode 100644 index e35bfa6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json deleted file mode 100644 index f211ed3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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" - }, - "_id": "oauth-sign@0.3.0", - "_from": "oauth-sign@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js deleted file mode 100644 index 46955ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore deleted file mode 100644 index e85ce2a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -test -.travis.yml -benchmark.js -component.json -examples.js -History.md -Makefile diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md deleted file mode 100644 index 27e54a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js deleted file mode 100644 index 590491e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js +++ /dev/null @@ -1,387 +0,0 @@ -/** - * 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) 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; -}; - -/** - * Create a nullary object if possible - */ - -function createObject() { - return Object.create - ? Object.create(null) - : {}; -} - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = createObject(); - var t = createObject(); - 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(); - // 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 = createObject(); - 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; -} - -/** - * Restore Object.prototype. - * see pull-request #58 - */ - -function restoreProto(obj) { - if (!Object.create) return obj; - if (isArray(obj)) return obj; - if (obj && 'object' != typeof obj) return obj; - - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - obj[key] = restoreProto(obj[key]); - } - } - - obj.__proto__ = Object.prototype; - 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: createObject() }).base; - - return restoreProto(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 (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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json deleted file mode 100644 index d1475f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.6.5", - "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" - }, - "_id": "qs@0.6.5", - "_from": "qs@~0.6.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md deleted file mode 100644 index bb533d5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -tunnel-agent -============ - -HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js deleted file mode 100644 index 3f7bbb9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js +++ /dev/null @@ -1,227 +0,0 @@ -'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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json deleted file mode 100644 index 3351a28..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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" - }, - "_id": "tunnel-agent@0.3.0", - "_from": "tunnel-agent@~0.3.0", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json deleted file mode 100755 index 4ff48b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "request", - "description": "Simplified HTTP request client.", - "tags": [ - "http", - "simple", - "util", - "utility" - ], - "version": "2.25.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 request method\n\n## Install\n\n
        \n  npm install request\n
        \n\nOr from source:\n\n
        \n  git clone git://github.com/mikeal/request.git \n  cd request\n  npm link\n
        \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\t\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", - "_id": "request@2.25.0", - "_from": "request@~2.25.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg deleted file mode 100644 index f80c9c5..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js deleted file mode 100644 index b6eacba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('fs') - , http = require('http') - , path = require('path') - , https = require('https') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - ; - -exports.createServer = function (port) { - port = port || 6767 - var s = http.createServer(function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'http://localhost:'+port - return s; -} - -exports.createSSLServer = function(port, opts) { - port = port || 16767 - - var options = { 'key' : path.join(__dirname, 'ssl', 'test.key') - , 'cert': path.join(__dirname, 'ssl', 'test.crt') - } - if (opts) { - for (var i in opts) options[i] = opts[i] - } - - for (var i in options) { - options[i] = fs.readFileSync(options[i]) - } - - var s = https.createServer(options, function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'https://localhost:'+port - return s; -} - -exports.createPostStream = function (text) { - var postStream = new stream.Stream(); - postStream.writeable = true; - postStream.readable = true; - setTimeout(function () {postStream.emit('data', new Buffer(text)); postStream.emit('end')}, 0); - return postStream; -} -exports.createPostValidator = function (text, reqContentType) { - var l = function (req, resp) { - var r = ''; - req.on('data', function (chunk) {r += chunk}) - req.on('end', function () { - if (req.headers['content-type'] && req.headers['content-type'].indexOf('boundary=') >= 0) { - var boundary = req.headers['content-type'].split('boundary=')[1]; - text = text.replace(/__BOUNDARY__/g, boundary); - } - if (r !== text) console.log(r, text); - assert.equal(r, text) - if (reqContentType) { - assert.ok(req.headers['content-type']) - assert.ok(~req.headers['content-type'].indexOf(reqContentType)) - } - resp.writeHead(200, {'content-type':'text/plain'}) - resp.write('OK') - resp.end() - }) - } - return l; -} -exports.createGetResponse = function (text, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - resp.write(text) - resp.end() - } - return l; -} -exports.createChunkResponse = function (chunks, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - chunks.forEach(function (chunk) { - resp.write(chunk) - }) - resp.end() - } - return l; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf deleted file mode 100644 index 0d4a3b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf +++ /dev/null @@ -1,77 +0,0 @@ -# -# Recommended minimum configuration: -# -acl manager proto cache_object -acl localhost src 127.0.0.1/32 ::1 -acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 - -# Example rule allowing access from your local networks. -# Adapt to list your (internal) IP networks from where browsing -# should be allowed -acl localnet src 10.0.0.0/8 # RFC1918 possible internal network -acl localnet src 172.16.0.0/12 # RFC1918 possible internal network -acl localnet src 192.168.0.0/16 # RFC1918 possible internal network -acl localnet src fc00::/7 # RFC 4193 local private network range -acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines - -acl SSL_ports port 443 -acl Safe_ports port 80 # http -acl Safe_ports port 21 # ftp -acl Safe_ports port 443 # https -acl Safe_ports port 70 # gopher -acl Safe_ports port 210 # wais -acl Safe_ports port 1025-65535 # unregistered ports -acl Safe_ports port 280 # http-mgmt -acl Safe_ports port 488 # gss-http -acl Safe_ports port 591 # filemaker -acl Safe_ports port 777 # multiling http -acl CONNECT method CONNECT - -# -# Recommended minimum Access Permission configuration: -# -# Only allow cachemgr access from localhost -http_access allow manager localhost -http_access deny manager - -# Deny requests to certain unsafe ports -http_access deny !Safe_ports - -# Deny CONNECT to other than secure SSL ports -#http_access deny CONNECT !SSL_ports - -# We strongly recommend the following be uncommented to protect innocent -# web applications running on the proxy server who think the only -# one who can access services on "localhost" is a local user -#http_access deny to_localhost - -# -# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS -# - -# Example rule allowing access from your local networks. -# Adapt localnet in the ACL section to list your (internal) IP networks -# from where browsing should be allowed -http_access allow localnet -http_access allow localhost - -# And finally deny all other access to this proxy -http_access deny all - -# Squid normally listens to port 3128 -http_port 3128 - -# We recommend you to use at least the following line. -hierarchy_stoplist cgi-bin ? - -# Uncomment and adjust the following to add a disk cache directory. -#cache_dir ufs /usr/local/var/cache 100 16 256 - -# Leave coredumps in the first cache dir -coredump_dir /usr/local/var/cache - -# Add any of your own refresh_pattern entries above these. -refresh_pattern ^ftp: 1440 20% 10080 -refresh_pattern ^gopher: 1440 0% 1440 -refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 -refresh_pattern . 0 20% 4320 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf deleted file mode 100644 index 425a889..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf +++ /dev/null @@ -1,20 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no -output_password = password - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = request Certificate Authority -CN = requestCA -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crl b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crl deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt deleted file mode 100644 index b4524e4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICvTCCAiYCCQDn+P/MSbDsWjANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGiMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxJjAkBgNVBAsTHXJlcXVlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 -MRIwEAYDVQQDEwlyZXF1ZXN0Q0ExJjAkBgkqhkiG9w0BCQEWF21pa2VhbEBtaWtl -YWxyb2dlcnMuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7t9pQUAK4 -5XJYTI6NrF0n3G2HZsfN+rPYSVzzL8SuVyb1tHXos+vbPm3NKI4E8X1yVAXU8CjJ -5SqXnp4DAypAhaseho81cbhk7LXUhFz78OvAa+OD+xTAEAnNQ8tGUr4VGyplEjfD -xsBVuqV2j8GPNTftr+drOCFlqfAgMrBn4wIDAQABMA0GCSqGSIb3DQEBBQUAA4GB -ADVdTlVAL45R+PACNS7Gs4o81CwSclukBu4FJbxrkd4xGQmurgfRrYYKjtqiopQm -D7ysRamS3HMN9/VKq2T7r3z1PMHPAy7zM4uoXbbaTKwlnX4j/8pGPn8Ca3qHXYlo -88L/OOPc6Di7i7qckS3HFbXQCTiULtxWmy97oEuTwrAj ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr deleted file mode 100644 index e48c56e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICBjCCAW8CAQAwgaIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEmMCQGA1UECxMdcmVxdWVzdCBD -ZXJ0aWZpY2F0ZSBBdXRob3JpdHkxEjAQBgNVBAMTCXJlcXVlc3RDQTEmMCQGCSqG -SIb3DQEJARYXbWlrZWFsQG1pa2VhbHJvZ2Vycy5jb20wgZ8wDQYJKoZIhvcNAQEB -BQADgY0AMIGJAoGBALu32lBQArjlclhMjo2sXSfcbYdmx836s9hJXPMvxK5XJvW0 -deiz69s+bc0ojgTxfXJUBdTwKMnlKpeengMDKkCFqx6GjzVxuGTstdSEXPvw68Br -44P7FMAQCc1Dy0ZSvhUbKmUSN8PGwFW6pXaPwY81N+2v52s4IWWp8CAysGfjAgMB -AAGgIzAhBgkqhkiG9w0BCQcxFBMScGFzc3dvcmQgY2hhbGxlbmdlMA0GCSqGSIb3 -DQEBBQUAA4GBAGJO7grHeVHXetjHEK8urIxdnvfB2qeZeObz4GPKIkqUurjr0rfj -bA3EK1kDMR5aeQWR8RunixdM16Q6Ry0lEdLVWkdSwRN9dmirIHT9cypqnD/FYOia -SdezZ0lUzXgmJIwRYRwB1KSMMocIf52ll/xC2bEGg7/ZAEuAyAgcZV3X ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key deleted file mode 100644 index a53e7f7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,C8B5887048377F02 - -nyD5ZH0Wup2uWsDvurq5mKDaDrf8lvNn9w0SH/ZkVnfR1/bkwqrFriqJWvZNUG+q -nS0iBYczsWLJnbub9a1zLOTENWUKVD5uqbC3aGHhnoUTNSa27DONgP8gHOn6JgR+ -GAKo01HCSTiVT4LjkwN337QKHnMP2fTzg+IoC/CigvMcq09hRLwU1/guq0GJKGwH -gTxYNuYmQC4Tjh8vdS4liF+Ve/P3qPR2CehZrIOkDT8PHJBGQJRo4xGUIB7Tpk38 -VCk+UZ0JCS2coY8VkY/9tqFJp/ZnnQQVmaNbdRqg7ECKL+bXnNo7yjzmazPZmPe3 -/ShbE0+CTt7LrjCaQAxWbeDzqfo1lQfgN1LulTm8MCXpQaJpv7v1VhIhQ7afjMYb -4thW/ypHPiYS2YJCAkAVlua9Oxzzh1qJoh8Df19iHtpd79Q77X/qf+1JvITlMu0U -gi7yEatmQcmYNws1mtTC1q2DXrO90c+NZ0LK/Alse6NRL/xiUdjug2iHeTf/idOR -Gg/5dSZbnnlj1E5zjSMDkzg6EHAFmHV4jYGSAFLEQgp4V3ZhMVoWZrvvSHgKV/Qh -FqrAK4INr1G2+/QTd09AIRzfy3/j6yD4A9iNaOsEf9Ua7Qh6RcALRCAZTWR5QtEf -dX+iSNJ4E85qXs0PqwkMDkoaxIJ+tmIRJY7y8oeylV8cfGAi8Soubt/i3SlR8IHC -uDMas/2OnwafK3N7ODeE1i7r7wkzQkSHaEz0TrF8XRnP25jAICCSLiMdAAjKfxVb -EvzsFSuAy3Jt6bU3hSLY9o4YVYKE+68ITMv9yNjvTsEiW+T+IbN34w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl deleted file mode 100644 index 17128db..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl +++ /dev/null @@ -1 +0,0 @@ -ADF62016AA40C9C3 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf deleted file mode 100644 index cd1fd1e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf +++ /dev/null @@ -1,19 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = testing -CN = testing.request.mikealrogers.com -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt deleted file mode 100644 index efe96ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICejCCAeMCCQCt9iAWqkDJwzANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGjMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxEDAOBgNVBAsTB3Rlc3RpbmcxKTAnBgNVBAMTIHRlc3RpbmcucmVx -dWVzdC5taWtlYWxyb2dlcnMuY29tMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlr -ZWFscm9nZXJzLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDgVl0jMumvOpmM -20W5v9yhGgZj8hPhEQF/N7yCBVBn/rWGYm70IHC8T/pR5c0LkWc5gdnCJEvKWQjh -DBKxZD8FAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEABShRkNgFbgs4vUWW9R9deNJj -7HJoiTmvkmoOC7QzcYkjdgHbOxsSq3rBnwxsVjY9PAtPwBn0GRspOeG7KzKRgySB -kb22LyrCFKbEOfKO/+CJc80ioK9zEPVjGsFMyAB+ftYRqM+s/4cQlTg/m89l01wC -yapjN3RxZbInGhWR+jA= ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr deleted file mode 100644 index a8e7595..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBgjCCASwCAQAwgaMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEQMA4GA1UECxMHdGVzdGluZzEp -MCcGA1UEAxMgdGVzdGluZy5yZXF1ZXN0Lm1pa2VhbHJvZ2Vycy5jb20xJjAkBgkq -hkiG9w0BCQEWF21pa2VhbEBtaWtlYWxyb2dlcnMuY29tMFwwDQYJKoZIhvcNAQEB -BQADSwAwSAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAaAjMCEGCSqGSIb3DQEJBzEU -ExJwYXNzd29yZCBjaGFsbGVuZ2UwDQYJKoZIhvcNAQEFBQADQQBD3E5WekQzCEJw -7yOcqvtPYIxGaX8gRKkYfLPoj3pm3GF5SGqtJKhylKfi89szHXgktnQgzff9FN+A -HidVJ/3u ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js deleted file mode 100644 index 05e21c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js +++ /dev/null @@ -1,28 +0,0 @@ -var fs = require("fs") -var https = require("https") -var options = { key: fs.readFileSync("./server.key") - , cert: fs.readFileSync("./server.crt") } - -var server = https.createServer(options, function (req, res) { - res.writeHead(200) - res.end() - server.close() -}) -server.listen(1337) - -var ca = fs.readFileSync("./ca.crt") -var agent = new https.Agent({ host: "localhost", port: 1337, ca: ca }) - -https.request({ host: "localhost" - , method: "HEAD" - , port: 1337 - , headers: { host: "testing.request.mikealrogers.com" } - , agent: agent - , ca: [ ca ] - , path: "/" }, function (res) { - if (res.client.authorized) { - console.log("node test: OK") - } else { - throw new Error(res.client.authorizationError) - } -}).end() diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key deleted file mode 100644 index 72d8698..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAQJAK+r8ZM2sze8s7FRo/ApB -iRBtO9fCaIdJwbwJnXKo4RKwZDt1l2mm+fzZ+/QaQNjY1oTROkIIXmnwRvZWfYlW -gQIhAPKYsG+YSBN9o8Sdp1DMyZ/rUifKX3OE6q9tINkgajDVAiEA7Ltqh01+cnt0 -JEnud/8HHcuehUBLMofeg0G+gCnSbXECIQCqDvkXsWNNLnS/3lgsnvH0Baz4sbeJ -rjIpuVEeg8eM5QIgbu0+9JmOV6ybdmmiMV4yAncoF35R/iKGVHDZCAsQzDECIQDZ -0jGz22tlo5YMcYSqrdD3U4sds1pwiAaWFRbCunoUJw== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt deleted file mode 100644 index fde2fe9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x -IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w -bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y -MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV -BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj -YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA -aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE -OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz -Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl -y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC -l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv -yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl -ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt deleted file mode 100644 index b357f86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICQzCCAawCCQCO/XWtRFck1jANBgkqhkiG9w0BAQUFADBmMQswCQYDVQQGEwJU -SDEQMA4GA1UECBMHQmFuZ2tvazEOMAwGA1UEBxMFU2lsb20xGzAZBgNVBAoTElRo -ZSBSZXF1ZXN0IE1vZHVsZTEYMBYGA1UEAxMPcmVxdWVzdC5leGFtcGxlMB4XDTEx -MTIwMzAyMjkyM1oXDTIxMTEzMDAyMjkyM1owZjELMAkGA1UEBhMCVEgxEDAOBgNV -BAgTB0Jhbmdrb2sxDjAMBgNVBAcTBVNpbG9tMRswGQYDVQQKExJUaGUgUmVxdWVz -dCBNb2R1bGUxGDAWBgNVBAMTD3JlcXVlc3QuZXhhbXBsZTCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAwmctddZqlA48+NXs0yOy92DijcQV1jf87zMiYAIlNUto -wghVbTWgJU5r0pdKrD16AptnWJTzKanhItEX8XCCPgsNkq1afgTtJP7rNkwu3xcj -eIMkhJg/ay4ZnkbnhYdsii5VTU5prix6AqWRAhbkBgoA+iVyHyof8wvZyKBoFTMC -AwEAATANBgkqhkiG9w0BAQUFAAOBgQB6BybMJbpeiABgihDfEVBcAjDoQ8gUMgwV -l4NulugfKTDmArqnR9aPd4ET5jX5dkMP4bwCHYsvrcYDeWEQy7x5WWuylOdKhua4 -L4cEi2uDCjqEErIG3cc1MCOk6Cl6Ld6tkIzQSf953qfdEACRytOeUqLNQcrXrqeE -c7U8F6MWLQ== ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key deleted file mode 100644 index b85810d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDCZy111mqUDjz41ezTI7L3YOKNxBXWN/zvMyJgAiU1S2jCCFVt -NaAlTmvSl0qsPXoCm2dYlPMpqeEi0RfxcII+Cw2SrVp+BO0k/us2TC7fFyN4gySE -mD9rLhmeRueFh2yKLlVNTmmuLHoCpZECFuQGCgD6JXIfKh/zC9nIoGgVMwIDAQAB -AoGBALXFwfUf8vHTSmGlrdZS2AGFPvEtuvldyoxi9K5u8xmdFCvxnOcLsF2RsTHt -Mu5QYWhUpNJoG+IGLTPf7RJdj/kNtEs7xXqWy4jR36kt5z5MJzqiK+QIgiO9UFWZ -fjUb6oeDnTIJA9YFBdYi97MDuL89iU/UK3LkJN3hd4rciSbpAkEA+MCkowF5kSFb -rkOTBYBXZfiAG78itDXN6DXmqb9XYY+YBh3BiQM28oxCeQYyFy6pk/nstnd4TXk6 -V/ryA2g5NwJBAMgRKTY9KvxJWbESeMEFe2iBIV0c26/72Amgi7ZKUCLukLfD4tLF -+WSZdmTbbqI1079YtwaiOVfiLm45Q/3B0eUCQAaQ/0eWSGE+Yi8tdXoVszjr4GXb -G81qBi91DMu6U1It+jNfIba+MPsiHLcZJMVb4/oWBNukN7bD1nhwFWdlnu0CQQCf -Is9WHkdvz2RxbZDxb8verz/7kXXJQJhx5+rZf7jIYFxqX3yvTNv3wf2jcctJaWlZ -fVZwB193YSivcgt778xlAkEAprYUz3jczjF5r2hrgbizPzPDR94tM5BTO3ki2v3w -kbf+j2g7FNAx6kZiVN8XwfLc8xEeUGiPKwtq3ddPDFh17w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js deleted file mode 100644 index 47fe3aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js +++ /dev/null @@ -1,23 +0,0 @@ -var request = require('../index') - , http = require('http') - , server = require('./server') - , assert = require('assert') - ; - -var s = http.createServer(function (req, resp) { - resp.statusCode = 200 - resp.end('') -}).listen(6767, function () { - // requests without agentOptions should use global agent - var r = request('http://localhost:6767', function (e, resp, body) { - assert.deepEqual(r.agent, http.globalAgent); - assert.equal(Object.keys(r.pool).length, 0); - - // requests with agentOptions should apply agentOptions to new agent in pool - var r2 = request('http://localhost:6767', { agentOptions: { foo: 'bar' } }, function (e, resp, body) { - assert.deepEqual(r2.agent.options, { foo: 'bar' }); - assert.equal(Object.keys(r2.pool).length, 1); - s.close() - }); - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js deleted file mode 100644 index 3f48048..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js +++ /dev/null @@ -1,143 +0,0 @@ -var assert = require('assert') - , http = require('http') - , request = require('../index') - ; - -var numBasicRequests = 0; - -var basicServer = http.createServer(function (req, res) { - console.error('Basic auth server: ', req.method, req.url); - numBasicRequests++; - - var ok; - - if (req.headers.authorization) { - if (req.headers.authorization == 'Basic ' + new Buffer('test:testing2').toString('base64')) { - ok = true; - } else if ( req.headers.authorization == 'Basic ' + new Buffer(':apassword').toString('base64')) { - 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', 'Basic realm="Private"'); - } - - if (req.url == '/post/') { - var expectedContent = 'data_key=data_value'; - req.on('data', function(data) { - assert.equal(data, expectedContent); - console.log('received request data: ' + data); - }); - assert.equal(req.method, 'POST'); - assert.equal(req.headers['content-length'], '' + expectedContent.length); - assert.equal(req.headers['content-type'], 'application/x-www-form-urlencoded; charset=utf-8'); - } - - if (ok) { - console.log('request ok'); - res.end('ok'); - } else { - console.log('status=401'); - res.statusCode = 401; - res.end('401'); - } -}); - -basicServer.listen(6767); - -var tests = [ - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 2); - next(); - }); - }, - - function(next) { - // If we don't set sendImmediately = false, request will send basic auth - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test2/', - 'auth': { - 'user': 'test', - 'pass': 'testing2' - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 3); - next(); - }); - }, - - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://test:testing2@localhost:6767/test2/' - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 4); - next(); - }); - }, - - function(next) { - request({ - 'method': 'POST', - 'form': { 'data_key': 'data_value' }, - 'uri': 'http://localhost:6767/post/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 6); - next(); - }); - }, - - function(next) { - assert.doesNotThrow( function() { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/allow_empty_user/', - 'auth': { - 'user': '', - 'pass': 'apassword', - 'sendImmediately': false - } - }, function(error, res, body ) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 8); - next(); - }); - }) - } -]; - -function runTest(i) { - if (i < tests.length) { - tests[i](function() { - runTest(i + 1); - }); - } else { - console.log('All tests passed'); - basicServer.close(); - } -} - -runTest(0); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js deleted file mode 100644 index 186de12..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js +++ /dev/null @@ -1,122 +0,0 @@ -var server = require('./server') - , events = require('events') - , stream = require('stream') - , 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!") - } - , testGetEncoding : - { resp : server.createGetResponse(new Buffer('efa3bfcea9e29883', 'hex')) - , encoding: 'hex' - , expectBody: "efa3bfcea9e29883" - } - , testGetUTF8: - { resp: server.createGetResponse(new Buffer([0xEF, 0xBB, 0xBF, 226, 152, 131])) - , encoding: "utf8" - , 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.'} - ] - } - , 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js deleted file mode 100644 index f6c4024..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js +++ /dev/null @@ -1,129 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js deleted file mode 100644 index 5f2d6eb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js +++ /dev/null @@ -1,69 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js deleted file mode 100644 index 338c92e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js deleted file mode 100644 index 4df1302..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js +++ /dev/null @@ -1,37 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js deleted file mode 100644 index 956e386..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js deleted file mode 100644 index f2e51ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js deleted file mode 100644 index 91b9230..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js +++ /dev/null @@ -1,79 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js deleted file mode 100755 index 8454625..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js deleted file mode 100644 index 3982b9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js deleted file mode 100755 index 9300473..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js +++ /dev/null @@ -1,106 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js deleted file mode 100644 index 2c19615..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js +++ /dev/null @@ -1,94 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js deleted file mode 100644 index d49a9af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js +++ /dev/null @@ -1,97 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js deleted file mode 100644 index b6858d4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js +++ /dev/null @@ -1,87 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js deleted file mode 100644 index 11a1bd1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js deleted file mode 100644 index 3269483..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js +++ /dev/null @@ -1,117 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js deleted file mode 100644 index c239f89..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js deleted file mode 100644 index a5831a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js +++ /dev/null @@ -1,93 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js deleted file mode 100644 index e295ec7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js deleted file mode 100644 index 52a15cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js +++ /dev/null @@ -1,216 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js deleted file mode 100644 index 791ee8b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js deleted file mode 100644 index 7e83a41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js deleted file mode 100644 index e183d68..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js deleted file mode 100644 index 65958e6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js deleted file mode 100644 index cdd4606..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js +++ /dev/null @@ -1,155 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js deleted file mode 100644 index 0f6a832..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js deleted file mode 100644 index 7036367..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js +++ /dev/null @@ -1,87 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js deleted file mode 100644 index 6d5f92a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js deleted file mode 100644 index 2ee3f39..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg deleted file mode 100644 index 7cea4dd..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc deleted file mode 100644 index c8ef3ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc +++ /dev/null @@ -1,59 +0,0 @@ -{ - "predef": [ ] - , "bitwise": false - , "camelcase": false - , "curly": false - , "eqeqeq": false - , "forin": false - , "immed": false - , "latedef": false - , "noarg": true - , "noempty": true - , "nonew": true - , "plusplus": false - , "quotmark": true - , "regexp": false - , "undef": true - , "unused": true - , "strict": false - , "trailing": true - , "maxlen": 120 - , "asi": true - , "boss": true - , "debug": true - , "eqnull": true - , "esnext": true - , "evil": true - , "expr": true - , "funcscope": false - , "globalstrict": false - , "iterator": false - , "lastsemic": true - , "laxbreak": true - , "laxcomma": true - , "loopfunc": true - , "multistr": false - , "onecase": false - , "proto": false - , "regexdash": false - , "scripturl": true - , "smarttabs": false - , "shadow": false - , "sub": true - , "supernew": false - , "validthis": true - , "browser": true - , "couch": false - , "devel": false - , "dojo": false - , "mootools": false - , "node": true - , "nonstandard": true - , "prototypejs": false - , "rhino": false - , "worker": true - , "wsh": false - , "nomen": false - , "onevar": false - , "passfail": false -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore deleted file mode 100644 index b512c09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml deleted file mode 100644 index cece8c6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" -branches: - only: - - master -notifications: - email: - - rod@vagg.org -script: npm test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE deleted file mode 100644 index f6a0029..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -Copyright 2013, Rod Vagg (the "Original Author") -All rights reserved. - -MIT +no-false-attribs 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. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -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. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software. \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md deleted file mode 100644 index 1f7e6bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# through2 - -[![Build Status](https://secure.travis-ci.org/rvagg/through2.png)](http://travis-ci.org/rvagg/through2) - -[![NPM](https://nodei.co/npm/through2.png?compact=true)](https://nodei.co/npm/through2/) - -**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise** - -Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`. - -```js -fs.createReadStream('ex.txt') - .pipe(through2(function (chunk, enc, callback) { - for (var i = 0; i < chunk.length; i++) - if (chunk[i] == 97) - chunk[i] = 122 // swap 'a' for 'z' - this.push(chunk) - callback() - })) - .pipe(fs.createWriteStream('out.txt')) -``` - -Or object streams: - -```js -var all = [] -fs.createReadStream('data.csv') - .pipe(csv2()) - .pipe(through2({ objectMode: true }, function (chunk, enc, callback) { - var data = { - name : chunk[0] - , address : chunk[3] - , phone : chunk[10] - } - this.push(data) - callback() - })) - .on('data', function (data) { - all.push(data) - }) - .on('end', function () { - doSomethingSpecial(all) - }) -``` - -## API - -through2([ options, ] transformFunction[, flushFunction ]) - -Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`). - -### options - -The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams. - -The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call: - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2({ objectMode: true, allowHalfOpen: false }, function (chunk, enc, cb) { - this.push(new Buffer('wut?')) - cb() - }) - .pipe(fs.createWriteStream('/tmp/wut.txt')) -``` - -### transformFunction - -The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk. - -To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on. - -### flushFunction - -The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress. - -through2.ctor([ options, ] transformFunction[, flushFunction ]) - -Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances. - -```js -var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) { - if (record.temp != null && record.unit = "F") { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = "C" - } - this.push(record) - callback() -}) - -// Create instances of FToC like so: -var converter = new FToC() -// Or: -var converter = FToC() -// Or specify/override options when you instantiate, if you prefer: -var converter = FToC({objectMode: true}) - -``` - -## License - -**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md deleted file mode 100644 index be97668..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md +++ /dev/null @@ -1,768 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS deleted file mode 100644 index 205a425..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS +++ /dev/null @@ -1,32 +0,0 @@ -var Transform = require('../transform'); -var inherits = require('util').inherits; - -// subclass -function MyStream () { - Transform.call(this, { - lowWaterMark: 0, - encoding: 'utf8' - }); -} -inherits(MyStream, Transform); - -MyStream.prototype._transform = function (chunk, outputFn, callback) { - outputFn(new Buffer(String(chunk).toUpperCase())); - callback(); -}; - -// use it! -var s = new MyStream(); -process.stdin.resume(); -process.stdin.pipe(s).pipe(process.stdout); -if (process.stdin.setRawMode) - process.stdin.setRawMode(true); -process.stdin.on('data', function (c) { - c = c.toString(); - if (c === '\u0003' || c === '\u0004') { - process.stdin.pause(); - s.end(); - } - if (c === '\r') - process.stdout.write('\n'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js deleted file mode 100644 index 7e71584..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js +++ /dev/null @@ -1,15 +0,0 @@ -var fs = require('fs'); -var FSReadable = require('../fs.js'); -var rst = new FSReadable(__filename); - -rst.on('end', function() { - process.stdin.pause(); -}); - -process.stdin.setRawMode(true); -process.stdin.on('data', function() { - var c = rst.read(3); - if (!c) return; - process.stdout.write(c); -}); -process.stdin.resume(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js deleted file mode 100644 index c16eb6f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var fst = fs.createReadStream(__filename); -var Readable = require('../readable.js'); -var rst = new Readable(); -rst.wrap(fst); - -rst.on('end', function() { - process.stdin.pause(); -}); - -process.stdin.setRawMode(true); -process.stdin.on('data', function() { - var c = rst.read(3); - if (!c) return setTimeout(process.exit, 500) - process.stdout.write(c); -}); -process.stdin.resume(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch deleted file mode 100644 index 0ad71a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js deleted file mode 100644 index a663af8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js +++ /dev/null @@ -1,1705 +0,0 @@ -// 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. - -// Maintainers, keep in mind that octal literals are not allowed -// in strict mode. Use the decimal value and add a comment with -// the octal value. Example: -// -// var mode = 438; /* mode=0666 */ - -var util = require('util'); -var pathModule = require('path'); - -var binding = process.binding('fs'); -var constants = process.binding('constants'); -var fs = exports; -var Stream = require('stream').Stream; -var EventEmitter = require('events').EventEmitter; - -var Readable = require('./lib/_stream_readable.js'); -var Writable = require('./lib/_stream_writable.js'); - -var kMinPoolSpace = 128; -var kPoolSize = 40 * 1024; - -var O_APPEND = constants.O_APPEND || 0; -var O_CREAT = constants.O_CREAT || 0; -var O_DIRECTORY = constants.O_DIRECTORY || 0; -var O_EXCL = constants.O_EXCL || 0; -var O_NOCTTY = constants.O_NOCTTY || 0; -var O_NOFOLLOW = constants.O_NOFOLLOW || 0; -var O_RDONLY = constants.O_RDONLY || 0; -var O_RDWR = constants.O_RDWR || 0; -var O_SYMLINK = constants.O_SYMLINK || 0; -var O_SYNC = constants.O_SYNC || 0; -var O_TRUNC = constants.O_TRUNC || 0; -var O_WRONLY = constants.O_WRONLY || 0; - -var isWindows = process.platform === 'win32'; - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - if (DEBUG) { - var backtrace = new Error; - return function(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - throw err; - } - }; - } - - return function(err) { - if (err) { - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - } - }; -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -// Ensure that callbacks run in the global context. Only use this function -// for callbacks that are passed to the binding layer, callbacks that are -// invoked from JS already run in the proper scope. -function makeCallback(cb) { - if (typeof cb !== 'function') { - return rethrow(); - } - - return function() { - return cb.apply(null, arguments); - }; -} - -function assertEncoding(encoding) { - if (encoding && !Buffer.isEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -function nullCheck(path, callback) { - if (('' + path).indexOf('\u0000') !== -1) { - var er = new Error('Path must be a string without null bytes.'); - if (!callback) - throw er; - process.nextTick(function() { - callback(er); - }); - return false; - } - return true; -} - -fs.Stats = binding.Stats; - -fs.Stats.prototype._checkModeProperty = function(property) { - return ((this.mode & constants.S_IFMT) === property); -}; - -fs.Stats.prototype.isDirectory = function() { - return this._checkModeProperty(constants.S_IFDIR); -}; - -fs.Stats.prototype.isFile = function() { - return this._checkModeProperty(constants.S_IFREG); -}; - -fs.Stats.prototype.isBlockDevice = function() { - return this._checkModeProperty(constants.S_IFBLK); -}; - -fs.Stats.prototype.isCharacterDevice = function() { - return this._checkModeProperty(constants.S_IFCHR); -}; - -fs.Stats.prototype.isSymbolicLink = function() { - return this._checkModeProperty(constants.S_IFLNK); -}; - -fs.Stats.prototype.isFIFO = function() { - return this._checkModeProperty(constants.S_IFIFO); -}; - -fs.Stats.prototype.isSocket = function() { - return this._checkModeProperty(constants.S_IFSOCK); -}; - -fs.exists = function(path, callback) { - if (!nullCheck(path, cb)) return; - binding.stat(pathModule._makeLong(path), cb); - function cb(err, stats) { - if (callback) callback(err ? false : true); - } -}; - -fs.existsSync = function(path) { - try { - nullCheck(path); - binding.stat(pathModule._makeLong(path)); - return true; - } catch (e) { - return false; - } -}; - -fs.readFile = function(path, encoding_) { - var encoding = typeof(encoding_) === 'string' ? encoding_ : null; - var callback = maybeCallback(arguments[arguments.length - 1]); - - assertEncoding(encoding); - - // first, stat the file, so we know the size. - var size; - var buffer; // single buffer with file data - var buffers; // list for when size is unknown - var pos = 0; - var fd; - - fs.open(path, constants.O_RDONLY, 438 /*=0666*/, function(er, fd_) { - if (er) return callback(er); - fd = fd_; - - fs.fstat(fd, function(er, st) { - if (er) return callback(er); - size = st.size; - if (size === 0) { - // the kernel lies about many files. - // Go ahead and try to read some bytes. - buffers = []; - return read(); - } - - buffer = new Buffer(size); - read(); - }); - }); - - function read() { - if (size === 0) { - buffer = new Buffer(8192); - fs.read(fd, buffer, 0, 8192, -1, afterRead); - } else { - fs.read(fd, buffer, pos, size - pos, -1, afterRead); - } - } - - function afterRead(er, bytesRead) { - if (er) { - return fs.close(fd, function(er2) { - return callback(er); - }); - } - - if (bytesRead === 0) { - return close(); - } - - pos += bytesRead; - if (size !== 0) { - if (pos === size) close(); - else read(); - } else { - // unknown size, just read until we don't get bytes. - buffers.push(buffer.slice(0, bytesRead)); - read(); - } - } - - function close() { - fs.close(fd, function(er) { - if (size === 0) { - // collected the data into the buffers list. - buffer = Buffer.concat(buffers, pos); - } else if (pos < size) { - buffer = buffer.slice(0, pos); - } - - if (encoding) buffer = buffer.toString(encoding); - return callback(er, buffer); - }); - } -}; - -fs.readFileSync = function(path, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, constants.O_RDONLY, 438 /*=0666*/); - - var size; - var threw = true; - try { - size = fs.fstatSync(fd).size; - threw = false; - } finally { - if (threw) fs.closeSync(fd); - } - - var pos = 0; - var buffer; // single buffer with file data - var buffers; // list for when size is unknown - - if (size === 0) { - buffers = []; - } else { - buffer = new Buffer(size); - } - - var done = false; - while (!done) { - var threw = true; - try { - if (size !== 0) { - var bytesRead = fs.readSync(fd, buffer, pos, size - pos); - } else { - // the kernel lies about many files. - // Go ahead and try to read some bytes. - buffer = new Buffer(8192); - var bytesRead = fs.readSync(fd, buffer, 0, 8192); - if (bytesRead) { - buffers.push(buffer.slice(0, bytesRead)); - } - } - threw = false; - } finally { - if (threw) fs.closeSync(fd); - } - - pos += bytesRead; - done = (bytesRead === 0) || (size !== 0 && pos >= size); - } - - fs.closeSync(fd); - - if (size === 0) { - // data was collected into the buffers list. - buffer = Buffer.concat(buffers, pos); - } else if (pos < size) { - buffer = buffer.slice(0, pos); - } - - if (encoding) buffer = buffer.toString(encoding); - return buffer; -}; - - -// Used by binding.open and friends -function stringToFlags(flag) { - // Only mess with strings - if (typeof flag !== 'string') { - return flag; - } - - // O_EXCL is mandated by POSIX, Windows supports it too. - // Let's add a check anyway, just in case. - if (!O_EXCL && ~flag.indexOf('x')) { - throw errnoException('ENOSYS', 'fs.open(O_EXCL)'); - } - - switch (flag) { - case 'r' : return O_RDONLY; - case 'rs' : return O_RDONLY | O_SYNC; - case 'r+' : return O_RDWR; - case 'rs+' : return O_RDWR | O_SYNC; - - case 'w' : return O_TRUNC | O_CREAT | O_WRONLY; - case 'wx' : // fall through - case 'xw' : return O_TRUNC | O_CREAT | O_WRONLY | O_EXCL; - - case 'w+' : return O_TRUNC | O_CREAT | O_RDWR; - case 'wx+': // fall through - case 'xw+': return O_TRUNC | O_CREAT | O_RDWR | O_EXCL; - - case 'a' : return O_APPEND | O_CREAT | O_WRONLY; - case 'ax' : // fall through - case 'xa' : return O_APPEND | O_CREAT | O_WRONLY | O_EXCL; - - case 'a+' : return O_APPEND | O_CREAT | O_RDWR; - case 'ax+': // fall through - case 'xa+': return O_APPEND | O_CREAT | O_RDWR | O_EXCL; - } - - throw new Error('Unknown file open flag: ' + flag); -} - -// exported but hidden, only used by test/simple/test-fs-open-flags.js -Object.defineProperty(exports, '_stringToFlags', { - enumerable: false, - value: stringToFlags -}); - - -// Yes, the follow could be easily DRYed up but I provide the explicit -// list to make the arguments clear. - -fs.close = function(fd, callback) { - binding.close(fd, makeCallback(callback)); -}; - -fs.closeSync = function(fd) { - return binding.close(fd); -}; - -function modeNum(m, def) { - switch (typeof m) { - case 'number': return m; - case 'string': return parseInt(m, 8); - default: - if (def) { - return modeNum(def); - } else { - return undefined; - } - } -} - -fs.open = function(path, flags, mode, callback) { - callback = makeCallback(arguments[arguments.length - 1]); - mode = modeNum(mode, 438 /*=0666*/); - - if (!nullCheck(path, callback)) return; - binding.open(pathModule._makeLong(path), - stringToFlags(flags), - mode, - callback); -}; - -fs.openSync = function(path, flags, mode) { - mode = modeNum(mode, 438 /*=0666*/); - nullCheck(path); - return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); -}; - -fs.read = function(fd, buffer, offset, length, position, callback) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, length, position, encoding, callback) - var cb = arguments[4], - encoding = arguments[3]; - - assertEncoding(encoding); - - position = arguments[2]; - length = arguments[1]; - buffer = new Buffer(length); - offset = 0; - - callback = function(err, bytesRead) { - if (!cb) return; - - var str = (bytesRead > 0) ? buffer.toString(encoding, 0, bytesRead) : ''; - - (cb)(err, str, bytesRead); - }; - } - - function wrapper(err, bytesRead) { - // Retain a reference to buffer so that it can't be GC'ed too soon. - callback && callback(err, bytesRead || 0, buffer); - } - - binding.read(fd, buffer, offset, length, position, wrapper); -}; - -fs.readSync = function(fd, buffer, offset, length, position) { - var legacy = false; - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, length, position, encoding, callback) - legacy = true; - var encoding = arguments[3]; - - assertEncoding(encoding); - - position = arguments[2]; - length = arguments[1]; - buffer = new Buffer(length); - - offset = 0; - } - - var r = binding.read(fd, buffer, offset, length, position); - if (!legacy) { - return r; - } - - var str = (r > 0) ? buffer.toString(encoding, 0, r) : ''; - return [str, r]; -}; - -fs.write = function(fd, buffer, offset, length, position, callback) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, data, position, encoding, callback) - callback = arguments[4]; - position = arguments[2]; - assertEncoding(arguments[3]); - - buffer = new Buffer('' + arguments[1], arguments[3]); - offset = 0; - length = buffer.length; - } - - if (!length) { - if (typeof callback == 'function') { - process.nextTick(function() { - callback(undefined, 0); - }); - } - return; - } - - callback = maybeCallback(callback); - - function wrapper(err, written) { - // Retain a reference to buffer so that it can't be GC'ed too soon. - callback(err, written || 0, buffer); - } - - binding.write(fd, buffer, offset, length, position, wrapper); -}; - -fs.writeSync = function(fd, buffer, offset, length, position) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, data, position, encoding) - position = arguments[2]; - assertEncoding(arguments[3]); - - buffer = new Buffer('' + arguments[1], arguments[3]); - offset = 0; - length = buffer.length; - } - if (!length) return 0; - - return binding.write(fd, buffer, offset, length, position); -}; - -fs.rename = function(oldPath, newPath, callback) { - callback = makeCallback(callback); - if (!nullCheck(oldPath, callback)) return; - if (!nullCheck(newPath, callback)) return; - binding.rename(pathModule._makeLong(oldPath), - pathModule._makeLong(newPath), - callback); -}; - -fs.renameSync = function(oldPath, newPath) { - nullCheck(oldPath); - nullCheck(newPath); - return binding.rename(pathModule._makeLong(oldPath), - pathModule._makeLong(newPath)); -}; - -fs.truncate = function(path, len, callback) { - if (typeof path === 'number') { - // legacy - return fs.ftruncate(path, len, callback); - } - if (typeof len === 'function') { - callback = len; - len = 0; - } else if (typeof len === 'undefined') { - len = 0; - } - callback = maybeCallback(callback); - fs.open(path, 'w', function(er, fd) { - if (er) return callback(er); - binding.ftruncate(fd, len, function(er) { - fs.close(fd, function(er2) { - callback(er || er2); - }); - }); - }); -}; - -fs.truncateSync = function(path, len) { - if (typeof path === 'number') { - // legacy - return fs.ftruncateSync(path, len); - } - if (typeof len === 'undefined') { - len = 0; - } - // allow error to be thrown, but still close fd. - var fd = fs.openSync(path, 'w'); - try { - var ret = fs.ftruncateSync(fd, len); - } finally { - fs.closeSync(fd); - } - return ret; -}; - -fs.ftruncate = function(fd, len, callback) { - if (typeof len === 'function') { - callback = len; - len = 0; - } else if (typeof len === 'undefined') { - len = 0; - } - binding.ftruncate(fd, len, makeCallback(callback)); -}; - -fs.ftruncateSync = function(fd, len) { - if (typeof len === 'undefined') { - len = 0; - } - return binding.ftruncate(fd, len); -}; - -fs.rmdir = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.rmdir(pathModule._makeLong(path), callback); -}; - -fs.rmdirSync = function(path) { - nullCheck(path); - return binding.rmdir(pathModule._makeLong(path)); -}; - -fs.fdatasync = function(fd, callback) { - binding.fdatasync(fd, makeCallback(callback)); -}; - -fs.fdatasyncSync = function(fd) { - return binding.fdatasync(fd); -}; - -fs.fsync = function(fd, callback) { - binding.fsync(fd, makeCallback(callback)); -}; - -fs.fsyncSync = function(fd) { - return binding.fsync(fd); -}; - -fs.mkdir = function(path, mode, callback) { - if (typeof mode === 'function') callback = mode; - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.mkdir(pathModule._makeLong(path), - modeNum(mode, 511 /*=0777*/), - callback); -}; - -fs.mkdirSync = function(path, mode) { - nullCheck(path); - return binding.mkdir(pathModule._makeLong(path), - modeNum(mode, 511 /*=0777*/)); -}; - -fs.sendfile = function(outFd, inFd, inOffset, length, callback) { - binding.sendfile(outFd, inFd, inOffset, length, makeCallback(callback)); -}; - -fs.sendfileSync = function(outFd, inFd, inOffset, length) { - return binding.sendfile(outFd, inFd, inOffset, length); -}; - -fs.readdir = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.readdir(pathModule._makeLong(path), callback); -}; - -fs.readdirSync = function(path) { - nullCheck(path); - return binding.readdir(pathModule._makeLong(path)); -}; - -fs.fstat = function(fd, callback) { - binding.fstat(fd, makeCallback(callback)); -}; - -fs.lstat = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.lstat(pathModule._makeLong(path), callback); -}; - -fs.stat = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.stat(pathModule._makeLong(path), callback); -}; - -fs.fstatSync = function(fd) { - return binding.fstat(fd); -}; - -fs.lstatSync = function(path) { - nullCheck(path); - return binding.lstat(pathModule._makeLong(path)); -}; - -fs.statSync = function(path) { - nullCheck(path); - return binding.stat(pathModule._makeLong(path)); -}; - -fs.readlink = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.readlink(pathModule._makeLong(path), callback); -}; - -fs.readlinkSync = function(path) { - nullCheck(path); - return binding.readlink(pathModule._makeLong(path)); -}; - -function preprocessSymlinkDestination(path, type) { - if (!isWindows) { - // No preprocessing is needed on Unix. - return path; - } else if (type === 'junction') { - // Junctions paths need to be absolute and \\?\-prefixed. - return pathModule._makeLong(path); - } else { - // Windows symlinks don't tolerate forward slashes. - return ('' + path).replace(/\//g, '\\'); - } -} - -fs.symlink = function(destination, path, type_, callback) { - var type = (typeof type_ === 'string' ? type_ : null); - var callback = makeCallback(arguments[arguments.length - 1]); - - if (!nullCheck(destination, callback)) return; - if (!nullCheck(path, callback)) return; - - binding.symlink(preprocessSymlinkDestination(destination, type), - pathModule._makeLong(path), - type, - callback); -}; - -fs.symlinkSync = function(destination, path, type) { - type = (typeof type === 'string' ? type : null); - - nullCheck(destination); - nullCheck(path); - - return binding.symlink(preprocessSymlinkDestination(destination, type), - pathModule._makeLong(path), - type); -}; - -fs.link = function(srcpath, dstpath, callback) { - callback = makeCallback(callback); - if (!nullCheck(srcpath, callback)) return; - if (!nullCheck(dstpath, callback)) return; - - binding.link(pathModule._makeLong(srcpath), - pathModule._makeLong(dstpath), - callback); -}; - -fs.linkSync = function(srcpath, dstpath) { - nullCheck(srcpath); - nullCheck(dstpath); - return binding.link(pathModule._makeLong(srcpath), - pathModule._makeLong(dstpath)); -}; - -fs.unlink = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.unlink(pathModule._makeLong(path), callback); -}; - -fs.unlinkSync = function(path) { - nullCheck(path); - return binding.unlink(pathModule._makeLong(path)); -}; - -fs.fchmod = function(fd, mode, callback) { - binding.fchmod(fd, modeNum(mode), makeCallback(callback)); -}; - -fs.fchmodSync = function(fd, mode) { - return binding.fchmod(fd, modeNum(mode)); -}; - -if (constants.hasOwnProperty('O_SYMLINK')) { - fs.lchmod = function(path, mode, callback) { - callback = maybeCallback(callback); - fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, 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); - - // 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; - }; -} - - -fs.chmod = function(path, mode, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.chmod(pathModule._makeLong(path), - modeNum(mode), - callback); -}; - -fs.chmodSync = function(path, mode) { - nullCheck(path); - return binding.chmod(pathModule._makeLong(path), modeNum(mode)); -}; - -if (constants.hasOwnProperty('O_SYMLINK')) { - fs.lchown = function(path, uid, gid, callback) { - callback = maybeCallback(callback); - fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, function(err, fd) { - if (err) { - callback(err); - return; - } - fs.fchown(fd, uid, gid, callback); - }); - }; - - fs.lchownSync = function(path, uid, gid) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK); - return fs.fchownSync(fd, uid, gid); - }; -} - -fs.fchown = function(fd, uid, gid, callback) { - binding.fchown(fd, uid, gid, makeCallback(callback)); -}; - -fs.fchownSync = function(fd, uid, gid) { - return binding.fchown(fd, uid, gid); -}; - -fs.chown = function(path, uid, gid, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.chown(pathModule._makeLong(path), uid, gid, callback); -}; - -fs.chownSync = function(path, uid, gid) { - nullCheck(path); - return binding.chown(pathModule._makeLong(path), uid, gid); -}; - -// converts Date or number to a fractional UNIX timestamp -function toUnixTimestamp(time) { - if (typeof time == 'number') { - return time; - } - if (time instanceof Date) { - // convert to 123.456 UNIX timestamp - return time.getTime() / 1000; - } - throw new Error('Cannot parse time: ' + time); -} - -// exported for unit tests, not for public consumption -fs._toUnixTimestamp = toUnixTimestamp; - -fs.utimes = function(path, atime, mtime, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.utimes(pathModule._makeLong(path), - toUnixTimestamp(atime), - toUnixTimestamp(mtime), - callback); -}; - -fs.utimesSync = function(path, atime, mtime) { - nullCheck(path); - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.utimes(pathModule._makeLong(path), atime, mtime); -}; - -fs.futimes = function(fd, atime, mtime, callback) { - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.futimes(fd, atime, mtime, makeCallback(callback)); -}; - -fs.futimesSync = function(fd, atime, mtime) { - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.futimes(fd, atime, mtime); -}; - -function writeAll(fd, buffer, offset, length, position, callback) { - callback = maybeCallback(arguments[arguments.length - 1]); - - // write(fd, buffer, offset, length, position, callback) - fs.write(fd, buffer, offset, length, position, function(writeErr, written) { - if (writeErr) { - fs.close(fd, function() { - if (callback) callback(writeErr); - }); - } else { - if (written === length) { - fs.close(fd, callback); - } else { - offset += written; - length -= written; - position += written; - writeAll(fd, buffer, offset, length, position, callback); - } - } - }); -} - -fs.writeFile = function(path, data, encoding_, callback) { - var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8'); - assertEncoding(encoding); - - callback = maybeCallback(arguments[arguments.length - 1]); - fs.open(path, 'w', 438 /*=0666*/, function(openErr, fd) { - if (openErr) { - if (callback) callback(openErr); - } else { - var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data, - encoding); - writeAll(fd, buffer, 0, buffer.length, 0, callback); - } - }); -}; - -fs.writeFileSync = function(path, data, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, 'w'); - if (!Buffer.isBuffer(data)) { - data = new Buffer('' + data, encoding || 'utf8'); - } - var written = 0; - var length = data.length; - try { - while (written < length) { - written += fs.writeSync(fd, data, written, length - written, written); - } - } finally { - fs.closeSync(fd); - } -}; - -fs.appendFile = function(path, data, encoding_, callback) { - var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8'); - assertEncoding(encoding); - - callback = maybeCallback(arguments[arguments.length - 1]); - - fs.open(path, 'a', 438 /*=0666*/, function(err, fd) { - if (err) return callback(err); - var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data, encoding); - writeAll(fd, buffer, 0, buffer.length, null, callback); - }); -}; - -fs.appendFileSync = function(path, data, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, 'a'); - if (!Buffer.isBuffer(data)) { - data = new Buffer('' + data, encoding || 'utf8'); - } - var written = 0; - var position = null; - var length = data.length; - - try { - while (written < length) { - written += fs.writeSync(fd, data, written, length - written, position); - position += written; // XXX not safe with multiple concurrent writers? - } - } finally { - fs.closeSync(fd); - } -}; - -function errnoException(errorno, syscall) { - // TODO make this more compatible with ErrnoException from src/node.cc - // Once all of Node is using this function the ErrnoException from - // src/node.cc should be removed. - var e = new Error(syscall + ' ' + errorno); - e.errno = e.code = errorno; - e.syscall = syscall; - return e; -} - - -function FSWatcher() { - EventEmitter.call(this); - - var self = this; - var FSEvent = process.binding('fs_event_wrap').FSEvent; - this._handle = new FSEvent(); - this._handle.owner = this; - - this._handle.onchange = function(status, event, filename) { - if (status) { - self._handle.close(); - self.emit('error', errnoException(errno, 'watch')); - } else { - self.emit('change', event, filename); - } - }; -} -util.inherits(FSWatcher, EventEmitter); - -FSWatcher.prototype.start = function(filename, persistent) { - nullCheck(filename); - var r = this._handle.start(pathModule._makeLong(filename), persistent); - - if (r) { - this._handle.close(); - throw errnoException(errno, 'watch'); - } -}; - -FSWatcher.prototype.close = function() { - this._handle.close(); -}; - -fs.watch = function(filename) { - nullCheck(filename); - var watcher; - var options; - var listener; - - if ('object' == typeof arguments[1]) { - options = arguments[1]; - listener = arguments[2]; - } else { - options = {}; - listener = arguments[1]; - } - - if (options.persistent === undefined) options.persistent = true; - - watcher = new FSWatcher(); - watcher.start(filename, options.persistent); - - if (listener) { - watcher.addListener('change', listener); - } - - return watcher; -}; - - -// Stat Change Watchers - -function StatWatcher() { - EventEmitter.call(this); - - var self = this; - this._handle = new binding.StatWatcher(); - - // uv_fs_poll is a little more powerful than ev_stat but we curb it for - // the sake of backwards compatibility - var oldStatus = -1; - - this._handle.onchange = function(current, previous, newStatus) { - if (oldStatus === -1 && - newStatus === -1 && - current.nlink === previous.nlink) return; - - oldStatus = newStatus; - self.emit('change', current, previous); - }; - - this._handle.onstop = function() { - self.emit('stop'); - }; -} -util.inherits(StatWatcher, EventEmitter); - - -StatWatcher.prototype.start = function(filename, persistent, interval) { - nullCheck(filename); - this._handle.start(pathModule._makeLong(filename), persistent, interval); -}; - - -StatWatcher.prototype.stop = function() { - this._handle.stop(); -}; - - -var statWatchers = {}; -function inStatWatchers(filename) { - return Object.prototype.hasOwnProperty.call(statWatchers, filename) && - statWatchers[filename]; -} - - -fs.watchFile = function(filename) { - nullCheck(filename); - var stat; - var listener; - - var options = { - // Poll interval in milliseconds. 5007 is what libev used to use. It's - // a little on the slow side but let's stick with it for now to keep - // behavioral changes to a minimum. - interval: 5007, - persistent: true - }; - - if ('object' == typeof arguments[1]) { - options = util._extend(options, arguments[1]); - listener = arguments[2]; - } else { - listener = arguments[1]; - } - - if (!listener) { - throw new Error('watchFile requires a listener function'); - } - - if (inStatWatchers(filename)) { - stat = statWatchers[filename]; - } else { - stat = statWatchers[filename] = new StatWatcher(); - stat.start(filename, options.persistent, options.interval); - } - stat.addListener('change', listener); - return stat; -}; - -fs.unwatchFile = function(filename, listener) { - nullCheck(filename); - if (!inStatWatchers(filename)) return; - - var stat = statWatchers[filename]; - - if (typeof listener === 'function') { - stat.removeListener('change', listener); - } else { - stat.removeAllListeners('change'); - } - - if (stat.listeners('change').length === 0) { - stat.stop(); - statWatchers[filename] = undefined; - } -}; - -// Realpath -// Not using realpath(2) because it's bad. -// See: http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -fs.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -fs.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; - - - -var pool; - -function allocNewPool() { - pool = new Buffer(kPoolSize); - pool.used = 0; -} - - - -fs.createReadStream = function(path, options) { - return new ReadStream(path, options); -}; - -util.inherits(ReadStream, Readable); -fs.ReadStream = ReadStream; - -function ReadStream(path, options) { - if (!(this instanceof ReadStream)) - return new ReadStream(path, options); - - // a little bit bigger buffer and water marks by default - options = util._extend({ - bufferSize: 64 * 1024, - lowWaterMark: 16 * 1024, - highWaterMark: 64 * 1024 - }, options || {}); - - Readable.call(this, options); - - this.path = path; - this.fd = options.hasOwnProperty('fd') ? options.fd : null; - this.flags = options.hasOwnProperty('flags') ? options.flags : 'r'; - this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ - - this.start = options.hasOwnProperty('start') ? options.start : undefined; - this.end = options.hasOwnProperty('start') ? options.end : undefined; - this.pos = undefined; - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (typeof this.fd !== 'number') - this.open(); - - this.on('end', function() { - this.destroy(); - }); -} - -fs.FileReadStream = fs.ReadStream; // support the legacy name - -ReadStream.prototype.open = function() { - var self = this; - fs.open(this.path, this.flags, this.mode, function(er, fd) { - if (er) { - self.destroy(); - self.emit('error', er); - return; - } - - self.fd = fd; - self.emit('open', fd); - // start the flow of data. - self.read(); - }); -}; - -ReadStream.prototype._read = function(n, cb) { - if (typeof this.fd !== 'number') - return this.once('open', function() { - this._read(n, cb); - }); - - if (this.destroyed) - return; - - if (!pool || pool.length - pool.used < kMinPoolSpace) { - // discard the old pool. Can't add to the free list because - // users might have refernces to slices on it. - pool = null; - allocNewPool(); - } - - // Grab another reference to the pool in the case that while we're - // in the thread pool another read() finishes up the pool, and - // allocates a new one. - var thisPool = pool; - var toRead = Math.min(pool.length - pool.used, n); - var start = pool.used; - - if (this.pos !== undefined) - toRead = Math.min(this.end - this.pos + 1, toRead); - - // already read everything we were supposed to read! - // treat as EOF. - if (toRead <= 0) - return cb(); - - // the actual read. - var self = this; - fs.read(this.fd, pool, pool.used, toRead, this.pos, onread); - - // move the pool positions, and internal position for reading. - if (this.pos !== undefined) - this.pos += toRead; - pool.used += toRead; - - function onread(er, bytesRead) { - if (er) { - self.destroy(); - return cb(er); - } - - var b = null; - if (bytesRead > 0) - b = thisPool.slice(start, start + bytesRead); - - cb(null, b); - } -}; - - -ReadStream.prototype.destroy = function() { - if (this.destroyed) - return; - this.destroyed = true; - if ('number' === typeof this.fd) - this.close(); -}; - - -ReadStream.prototype.close = function(cb) { - if (cb) - this.once('close', cb); - if (this.closed || 'number' !== typeof this.fd) { - if ('number' !== typeof this.fd) - this.once('open', close); - return process.nextTick(this.emit.bind(this, 'close')); - } - this.closed = true; - var self = this; - close(); - - function close() { - fs.close(self.fd, function(er) { - if (er) - self.emit('error', er); - else - self.emit('close'); - }); - } -}; - - - - -fs.createWriteStream = function(path, options) { - return new WriteStream(path, options); -}; - -util.inherits(WriteStream, Writable); -fs.WriteStream = WriteStream; -function WriteStream(path, options) { - if (!(this instanceof WriteStream)) - return new WriteStream(path, options); - - // a little bit bigger buffer and water marks by default - options = util._extend({ - bufferSize: 64 * 1024, - lowWaterMark: 16 * 1024, - highWaterMark: 64 * 1024 - }, options || {}); - - Writable.call(this, options); - - this.path = path; - this.fd = null; - - this.fd = options.hasOwnProperty('fd') ? options.fd : null; - this.flags = options.hasOwnProperty('flags') ? options.flags : 'w'; - this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ - - this.start = options.hasOwnProperty('start') ? options.start : undefined; - this.pos = undefined; - this.bytesWritten = 0; - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - if ('number' !== typeof this.fd) - this.open(); - - // dispose on finish. - this.once('finish', this.close); -} - -fs.FileWriteStream = fs.WriteStream; // support the legacy name - - -WriteStream.prototype.open = function() { - fs.open(this.path, this.flags, this.mode, function(er, fd) { - if (er) { - this.destroy(); - this.emit('error', er); - return; - } - - this.fd = fd; - this.emit('open', fd); - }.bind(this)); -}; - - -WriteStream.prototype._write = function(data, cb) { - if (!Buffer.isBuffer(data)) - return this.emit('error', new Error('Invalid data')); - - if (typeof this.fd !== 'number') - return this.once('open', this._write.bind(this, data, cb)); - - fs.write(this.fd, data, 0, data.length, this.pos, function(er, bytes) { - if (er) { - this.destroy(); - return cb(er); - } - this.bytesWritten += bytes; - cb(); - }.bind(this)); - - if (this.pos !== undefined) - this.pos += data.length; -}; - - -WriteStream.prototype.destroy = ReadStream.prototype.destroy; -WriteStream.prototype.close = ReadStream.prototype.close; - -// There is no shutdown() for files. -WriteStream.prototype.destroySoon = WriteStream.prototype.end; - - -// SyncWriteStream is internal. DO NOT USE. -// Temporary hack for process.stdout and process.stderr when piped to files. -function SyncWriteStream(fd) { - Stream.call(this); - - this.fd = fd; - this.writable = true; - this.readable = false; -} - -util.inherits(SyncWriteStream, Stream); - - -// Export -fs.SyncWriteStream = SyncWriteStream; - - -SyncWriteStream.prototype.write = function(data, arg1, arg2) { - var encoding, cb; - - // parse arguments - if (arg1) { - if (typeof arg1 === 'string') { - encoding = arg1; - cb = arg2; - } else if (typeof arg1 === 'function') { - cb = arg1; - } else { - throw new Error('bad arg'); - } - } - assertEncoding(encoding); - - // Change strings to buffers. SLOW - if (typeof data == 'string') { - data = new Buffer(data, encoding); - } - - fs.writeSync(this.fd, data, 0, data.length); - - if (cb) { - process.nextTick(cb); - } - - return true; -}; - - -SyncWriteStream.prototype.end = function(data, arg1, arg2) { - if (data) { - this.write(data, arg1, arg2); - } - this.destroy(); -}; - - -SyncWriteStream.prototype.destroy = function() { - fs.closeSync(this.fd); - this.fd = null; - this.emit('close'); - return true; -}; - -SyncWriteStream.prototype.destroySoon = SyncWriteStream.prototype.destroy; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a2e0d8e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,69 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 330c247..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 3c9da08..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,927 +0,0 @@ -// 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.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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index f08b05e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,205 +0,0 @@ -// 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 && 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 56ca47d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,367 +0,0 @@ -// 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); - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - state.needDrain = !ret; - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json deleted file mode 100644 index 76f822e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "readable-stream", - "version": "1.0.17", - "description": "An exploration of a new kind of readable streams for Node.js", - "main": "readable.js", - "dependencies": {}, - "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" - }, - "_id": "readable-stream@1.0.17", - "_from": "readable-stream@~1.0.2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js deleted file mode 100644 index 4d1ddfc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,6 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js deleted file mode 100644 index 1dec2e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js +++ /dev/null @@ -1,191 +0,0 @@ -// 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 path = require('path'); -var assert = require('assert'); - -exports.testDir = path.dirname(__filename); -exports.fixturesDir = path.join(exports.testDir, 'fixtures'); -exports.libDir = path.join(exports.testDir, '../lib'); -exports.tmpDir = path.join(exports.testDir, 'tmp'); -exports.PORT = 12346; - -if (process.platform === 'win32') { - exports.PIPE = '\\\\.\\pipe\\libuv-test'; -} else { - exports.PIPE = exports.tmpDir + '/test.sock'; -} - -var util = require('util'); -for (var i in util) exports[i] = util[i]; -//for (var i in exports) global[i] = exports[i]; - -function protoCtrChain(o) { - var result = []; - for (; o; o = o.__proto__) { result.push(o.constructor); } - return result.join(); -} - -exports.indirectInstanceOf = function(obj, cls) { - if (obj instanceof cls) { return true; } - var clsChain = protoCtrChain(cls.prototype); - var objChain = protoCtrChain(obj); - return objChain.slice(-clsChain.length) === clsChain; -}; - - -exports.ddCommand = function(filename, kilobytes) { - if (process.platform === 'win32') { - var p = path.resolve(exports.fixturesDir, 'create-file.js'); - return '"' + process.argv[0] + '" "' + p + '" "' + - filename + '" ' + (kilobytes * 1024); - } else { - return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes; - } -}; - - -exports.spawnPwd = function(options) { - var spawn = require('child_process').spawn; - - if (process.platform === 'win32') { - return spawn('cmd.exe', ['/c', 'cd'], options); - } else { - return spawn('pwd', [], options); - } -}; - - -// Turn this off if the test should not check for global leaks. -exports.globalCheck = true; - -process.on('exit', function() { - if (!exports.globalCheck) return; - var knownGlobals = [setTimeout, - setInterval, - global.setImmediate, - clearTimeout, - clearInterval, - global.clearImmediate, - console, - Buffer, - process, - global]; - - if (global.errno) { - knownGlobals.push(errno); - } - - if (global.gc) { - knownGlobals.push(gc); - } - - if (global.DTRACE_HTTP_SERVER_RESPONSE) { - knownGlobals.push(DTRACE_HTTP_SERVER_RESPONSE); - knownGlobals.push(DTRACE_HTTP_SERVER_REQUEST); - knownGlobals.push(DTRACE_HTTP_CLIENT_RESPONSE); - knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST); - knownGlobals.push(DTRACE_NET_STREAM_END); - knownGlobals.push(DTRACE_NET_SERVER_CONNECTION); - knownGlobals.push(DTRACE_NET_SOCKET_READ); - knownGlobals.push(DTRACE_NET_SOCKET_WRITE); - } - if (global.COUNTER_NET_SERVER_CONNECTION) { - knownGlobals.push(COUNTER_NET_SERVER_CONNECTION); - knownGlobals.push(COUNTER_NET_SERVER_CONNECTION_CLOSE); - knownGlobals.push(COUNTER_HTTP_SERVER_REQUEST); - knownGlobals.push(COUNTER_HTTP_SERVER_RESPONSE); - knownGlobals.push(COUNTER_HTTP_CLIENT_REQUEST); - knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE); - } - - if (global.ArrayBuffer) { - knownGlobals.push(ArrayBuffer); - knownGlobals.push(Int8Array); - knownGlobals.push(Uint8Array); - knownGlobals.push(Uint8ClampedArray); - knownGlobals.push(Int16Array); - knownGlobals.push(Uint16Array); - knownGlobals.push(Int32Array); - knownGlobals.push(Uint32Array); - knownGlobals.push(Float32Array); - knownGlobals.push(Float64Array); - knownGlobals.push(DataView); - } - - for (var x in global) { - var found = false; - - for (var y in knownGlobals) { - if (global[x] === knownGlobals[y]) { - found = true; - break; - } - } - - if (!found) { - console.error('Unknown global: %s', x); - assert.ok(false, 'Unknown global found'); - } - } -}); - - -var mustCallChecks = []; - - -function runCallChecks() { - var failed = mustCallChecks.filter(function(context) { - return context.actual !== context.expected; - }); - - failed.forEach(function(context) { - console.log('Mismatched %s function calls. Expected %d, actual %d.', - context.name, - context.expected, - context.actual); - console.log(context.stack.split('\n').slice(2).join('\n')); - }); - - if (failed.length) process.exit(1); -} - - -exports.mustCall = function(fn, expected) { - if (typeof expected !== 'number') expected = 1; - - var context = { - expected: expected, - actual: 0, - stack: (new Error).stack, - name: fn.name || '' - }; - - // add the exit listener only once to avoid listener leak warnings - if (mustCallChecks.length === 0) process.on('exit', runCallChecks); - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt deleted file mode 100644 index c6a9d2f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt +++ /dev/null @@ -1 +0,0 @@ -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js deleted file mode 100644 index edc3811..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js +++ /dev/null @@ -1,475 +0,0 @@ -// 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 common = require('../common.js'); -var R = require('../../lib/_stream_readable'); -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - -function TestReader(n) { - R.apply(this); - this._buffer = new Buffer(n || 100); - this._buffer.fill('x'); - this._pos = 0; - this._bufs = 10; -} - -util.inherits(TestReader, R); - -TestReader.prototype.read = function(n) { - if (n === 0) return null; - var max = this._buffer.length - this._pos; - n = n || max; - n = Math.max(n, 0); - var toRead = Math.min(n, max); - if (toRead === 0) { - // simulate the read buffer filling up with some more bytes some time - // in the future. - setTimeout(function() { - this._pos = 0; - this._bufs -= 1; - if (this._bufs <= 0) { - // read them all! - if (!this.ended) { - this.emit('end'); - this.ended = true; - } - } else { - this.emit('readable'); - } - }.bind(this), 10); - return null; - } - - var ret = this._buffer.slice(this._pos, this._pos + toRead); - this._pos += toRead; - return ret; -}; - -///// - -function TestWriter() { - EE.apply(this); - this.received = []; - this.flush = false; -} - -util.inherits(TestWriter, EE); - -TestWriter.prototype.write = function(c) { - this.received.push(c.toString()); - this.emit('write', c); - return true; -}; - -TestWriter.prototype.end = function(c) { - if (c) this.write(c); - this.emit('end', this.received); -}; - -//////// - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - ok: assert, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - - -test('a most basic test', function(t) { - var r = new TestReader(20); - - var reads = []; - var expect = [ 'x', - 'xx', - 'xxx', - 'xxxx', - 'xxxxx', - 'xxxxx', - 'xxxxxxxx', - 'xxxxxxxxx', - 'xxx', - 'xxxxxxxxxxxx', - 'xxxxxxxx', - 'xxxxxxxxxxxxxxx', - 'xxxxx', - 'xxxxxxxxxxxxxxxxxx', - 'xx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx' ]; - - r.on('end', function() { - t.same(reads, expect); - t.end(); - }); - - var readSize = 1; - function flow() { - var res; - while (null !== (res = r.read(readSize++))) { - reads.push(res.toString()); - } - r.once('readable', flow); - } - - flow(); -}); - -test('pipe', function(t) { - var r = new TestReader(5); - - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ] - - var w = new TestWriter; - var flush = true; - - w.on('end', function(received) { - t.same(received, expect); - t.end(); - }); - - r.pipe(w); -}); - - - -[1,2,3,4,5,6,7,8,9].forEach(function(SPLIT) { - test('unpipe', function(t) { - var r = new TestReader(5); - - // unpipe after 3 writes, then write to another stream instead. - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - expect = [ expect.slice(0, SPLIT), expect.slice(SPLIT) ]; - - var w = [ new TestWriter(), new TestWriter() ]; - - var writes = SPLIT; - w[0].on('write', function() { - if (--writes === 0) { - r.unpipe(); - t.equal(r._readableState.pipes, null); - w[0].end(); - r.pipe(w[1]); - t.equal(r._readableState.pipes, w[1]); - } - }); - - var ended = 0; - - var ended0 = false; - var ended1 = false; - w[0].on('end', function(results) { - t.equal(ended0, false); - ended0 = true; - ended++; - t.same(results, expect[0]); - }); - - w[1].on('end', function(results) { - t.equal(ended1, false); - ended1 = true; - ended++; - t.equal(ended, 2); - t.same(results, expect[1]); - t.end(); - }); - - r.pipe(w[0]); - }); -}); - - -// both writers should get the same exact data. -test('multipipe', function(t) { - var r = new TestReader(5); - var w = [ new TestWriter, new TestWriter ]; - - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - - var c = 2; - w[0].on('end', function(received) { - t.same(received, expect, 'first'); - if (--c === 0) t.end(); - }); - w[1].on('end', function(received) { - t.same(received, expect, 'second'); - if (--c === 0) t.end(); - }); - - r.pipe(w[0]); - r.pipe(w[1]); -}); - - -[1,2,3,4,5,6,7,8,9].forEach(function(SPLIT) { - test('multi-unpipe', function(t) { - var r = new TestReader(5); - - // unpipe after 3 writes, then write to another stream instead. - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - expect = [ expect.slice(0, SPLIT), expect.slice(SPLIT) ]; - - var w = [ new TestWriter(), new TestWriter(), new TestWriter() ]; - - var writes = SPLIT; - w[0].on('write', function() { - if (--writes === 0) { - r.unpipe(); - w[0].end(); - r.pipe(w[1]); - } - }); - - var ended = 0; - - w[0].on('end', function(results) { - ended++; - t.same(results, expect[0]); - }); - - w[1].on('end', function(results) { - ended++; - t.equal(ended, 2); - t.same(results, expect[1]); - t.end(); - }); - - r.pipe(w[0]); - r.pipe(w[2]); - }); -}); - -test('back pressure respected', function (t) { - function noop() {} - - var r = new R({ objectMode: true }); - r._read = noop; - var counter = 0; - r.push(["one"]); - r.push(["two"]); - r.push(["three"]); - r.push(["four"]); - r.push(null); - - var w1 = new R(); - w1.write = function (chunk) { - assert.equal(chunk[0], "one"); - w1.emit("close"); - process.nextTick(function () { - r.pipe(w2); - r.pipe(w3); - }) - }; - w1.end = noop; - - r.pipe(w1); - - var expected = ["two", "two", "three", "three", "four", "four"]; - - var w2 = new R(); - w2.write = function (chunk) { - assert.equal(chunk[0], expected.shift()); - assert.equal(counter, 0); - - counter++; - - if (chunk[0] === "four") { - return true; - } - - setTimeout(function () { - counter--; - w2.emit("drain"); - }, 10); - - return false; - } - w2.end = noop; - - var w3 = new R(); - w3.write = function (chunk) { - assert.equal(chunk[0], expected.shift()); - assert.equal(counter, 1); - - counter++; - - if (chunk[0] === "four") { - return true; - } - - setTimeout(function () { - counter--; - w3.emit("drain"); - }, 50); - - return false; - }; - w3.end = function () { - assert.equal(counter, 2); - assert.equal(expected.length, 0); - t.end(); - }; -}); - -test('read(0) for ended streams', function (t) { - var r = new R(); - var written = false; - var ended = false; - r._read = function (n) {}; - - r.push(new Buffer("foo")); - r.push(null); - - var v = r.read(0); - - assert.equal(v, null); - - var w = new R(); - - w.write = function (buffer) { - written = true; - assert.equal(ended, false); - assert.equal(buffer.toString(), "foo") - }; - - w.end = function () { - ended = true; - assert.equal(written, true); - t.end(); - }; - - r.pipe(w); -}) - -test('sync _read ending', function (t) { - var r = new R(); - var called = false; - r._read = function (n) { - r.push(null); - }; - - r.once('end', function () { - called = true; - }) - - r.read(); - - process.nextTick(function () { - assert.equal(called, true); - t.end(); - }) -}); - -test('adding readable triggers data flow', function(t) { - var r = new R({ highWaterMark: 5 }); - var onReadable = false; - var readCalled = 0; - - r._read = function(n) { - if (readCalled++ === 2) - r.push(null); - else - r.push(new Buffer('asdf')); - }; - - var called = false; - r.on('readable', function() { - onReadable = true; - r.read(); - }); - - r.on('end', function() { - t.equal(readCalled, 3); - t.ok(onReadable); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js deleted file mode 100644 index 4de76b5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js +++ /dev/null @@ -1,50 +0,0 @@ -// 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 common = require('../common.js'); -var R = require('../../lib/_stream_readable'); -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - -var ondataCalled = 0; - -function TestReader() { - R.apply(this); - this._buffer = new Buffer(100); - this._buffer.fill('x'); - - this.on('data', function() { - ondataCalled++; - }); -} - -util.inherits(TestReader, R); - -TestReader.prototype._read = function(n) { - this.push(this._buffer); - this._buffer = new Buffer(0); -}; - -var reader = new TestReader(); -assert.equal(ondataCalled, 1); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js deleted file mode 100644 index 6a7e41e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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 common = require('../common.js'); -var stream = require('../../readable'); -var Buffer = require('buffer').Buffer; - -var r = new stream.Readable(); -r._read = function(size) { - r.push(new Buffer(size)); -}; - -var w = new stream.Writable(); -w._write = function(data, encoding, cb) { - cb(null); -}; - -r.pipe(w); - -// This might sound unrealistic, but it happens in net.js. When -// `socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which -// ends the writable side of net.Socket. -w.end(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js deleted file mode 100644 index 6da70e8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js +++ /dev/null @@ -1,82 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); - -// If everything aligns so that you do a read(n) of exactly the -// remaining buffer, then make sure that 'end' still emits. - -var READSIZE = 100; -var PUSHSIZE = 20; -var PUSHCOUNT = 1000; -var HWM = 50; - -var Readable = require('../../readable').Readable; -var r = new Readable({ - highWaterMark: HWM -}); -var rs = r._readableState; - -r._read = push; - -r.on('readable', function() { - console.error('>> readable'); - do { - console.error(' > read(%d)', READSIZE); - var ret = r.read(READSIZE); - console.error(' < %j (%d remain)', ret && ret.length, rs.length); - } while (ret && ret.length === READSIZE); - - console.error('<< after read()', - ret && ret.length, - rs.needReadable, - rs.length); -}); - -var endEmitted = false; -r.on('end', function() { - endEmitted = true; - console.error('end'); -}); - -var pushes = 0; -function push() { - if (pushes > PUSHCOUNT) - return; - - if (pushes++ === PUSHCOUNT) { - console.error(' push(EOF)'); - return r.push(null); - } - - console.error(' push #%d', pushes); - if (r.push(new Buffer(PUSHSIZE))) - setTimeout(push); -} - -// start the flow -var ret = r.read(0); - -process.on('exit', function() { - assert.equal(pushes, PUSHCOUNT + 1); - assert(endEmitted); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js deleted file mode 100644 index cd23539..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js +++ /dev/null @@ -1,348 +0,0 @@ -// 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 common = require('../common.js'); -var Readable = require('../../lib/_stream_readable'); -var Writable = require('../../lib/_stream_writable'); -var assert = require('assert'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function() { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on('exit', function() { - assert.equal(count, 0); -}); - -process.nextTick(run); - -function toArray(callback) { - var stream = new Writable({ objectMode: true }); - var list = []; - stream.write = function(chunk) { - list.push(chunk); - }; - - stream.end = function() { - callback(list); - }; - - return stream; -} - -function fromArray(list) { - var r = new Readable({ objectMode: true }); - r._read = noop; - list.forEach(function(chunk) { - r.push(chunk); - }); - r.push(null); - - return r; -} - -function noop() {} - -test('can read objects from stream', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - var v1 = r.read(); - var v2 = r.read(); - var v3 = r.read(); - - assert.deepEqual(v1, { one: '1' }); - assert.deepEqual(v2, { two: '2' }); - assert.deepEqual(v3, null); - - t.end(); -}); - -test('can pipe objects into stream', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('read(n) is ignored', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - var value = r.read(2); - - assert.deepEqual(value, { one: '1' }); - - t.end(); -}); - -test('can read objects from _read (sync)', function(t) { - var r = new Readable({ objectMode: true }); - var list = [{ one: '1'}, { two: '2' }]; - r._read = function(n) { - var item = list.shift(); - r.push(item || null); - }; - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('can read objects from _read (async)', function(t) { - var r = new Readable({ objectMode: true }); - var list = [{ one: '1'}, { two: '2' }]; - r._read = function(n) { - var item = list.shift(); - process.nextTick(function() { - r.push(item || null); - }); - }; - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('can read strings as objects', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - var list = ['one', 'two', 'three']; - list.forEach(function(str) { - r.push(str); - }); - r.push(null); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, list); - - t.end(); - })); -}); - -test('read(0) for object streams', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - - r.push('foobar'); - r.push(null); - - var v = r.read(0); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, ['foobar']); - - t.end(); - })); -}); - -test('falsey values', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - - r.push(false); - r.push(0); - r.push(''); - r.push(null); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, [false, 0, '']); - - t.end(); - })); -}); - -test('high watermark _read', function(t) { - var r = new Readable({ - highWaterMark: 6, - objectMode: true - }); - var calls = 0; - var list = ['1', '2', '3', '4', '5', '6', '7', '8']; - - r._read = function(n) { - calls++; - }; - - list.forEach(function(c) { - r.push(c); - }); - - var v = r.read(); - - assert.equal(calls, 0); - assert.equal(v, '1'); - - var v2 = r.read(); - - assert.equal(calls, 1); - assert.equal(v2, '2'); - - t.end(); -}); - -test('high watermark push', function(t) { - var r = new Readable({ - highWaterMark: 6, - objectMode: true - }); - r._read = function(n) {}; - for (var i = 0; i < 6; i++) { - var bool = r.push(i); - assert.equal(bool, i === 5 ? false : true); - } - - t.end(); -}); - -test('can write objects to stream', function(t) { - var w = new Writable({ objectMode: true }); - - w._write = function(chunk, encoding, cb) { - assert.deepEqual(chunk, { foo: 'bar' }); - cb(); - }; - - w.on('finish', function() { - t.end(); - }); - - w.write({ foo: 'bar' }); - w.end(); -}); - -test('can write multiple objects to stream', function(t) { - var w = new Writable({ objectMode: true }); - var list = []; - - w._write = function(chunk, encoding, cb) { - list.push(chunk); - cb(); - }; - - w.on('finish', function() { - assert.deepEqual(list, [0, 1, 2, 3, 4]); - - t.end(); - }); - - w.write(0); - w.write(1); - w.write(2); - w.write(3); - w.write(4); - w.end(); -}); - -test('can write strings as objects', function(t) { - var w = new Writable({ - objectMode: true - }); - var list = []; - - w._write = function(chunk, encoding, cb) { - list.push(chunk); - process.nextTick(cb); - }; - - w.on('finish', function() { - assert.deepEqual(list, ['0', '1', '2', '3', '4']); - - t.end(); - }); - - w.write('0'); - w.write('1'); - w.write('2'); - w.write('3'); - w.write('4'); - w.end(); -}); - -test('buffers finish until cb is called', function(t) { - var w = new Writable({ - objectMode: true - }); - var called = false; - - w._write = function(chunk, encoding, cb) { - assert.equal(chunk, 'foo'); - - process.nextTick(function() { - called = true; - cb(); - }); - }; - - w.on('finish', function() { - assert.equal(called, true); - - t.end(); - }); - - w.write('foo'); - w.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js deleted file mode 100644 index 823dae2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js +++ /dev/null @@ -1,105 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); -var stream = require('../../readable'); - -(function testErrorListenerCatches() { - var count = 1000; - - var source = new stream.Readable(); - source._read = function(n) { - n = Math.min(count, n); - count -= n; - source.push(new Buffer(n)); - }; - - var unpipedDest; - source.unpipe = function(dest) { - unpipedDest = dest; - stream.Readable.prototype.unpipe.call(this, dest); - }; - - var dest = new stream.Writable(); - dest._write = function(chunk, encoding, cb) { - cb(); - }; - - source.pipe(dest); - - var gotErr = null; - dest.on('error', function(err) { - gotErr = err; - }); - - var unpipedSource; - dest.on('unpipe', function(src) { - unpipedSource = src; - }); - - var err = new Error('This stream turned into bacon.'); - dest.emit('error', err); - assert.strictEqual(gotErr, err); - assert.strictEqual(unpipedSource, source); - assert.strictEqual(unpipedDest, dest); -})(); - -(function testErrorWithoutListenerThrows() { - var count = 1000; - - var source = new stream.Readable(); - source._read = function(n) { - n = Math.min(count, n); - count -= n; - source.push(new Buffer(n)); - }; - - var unpipedDest; - source.unpipe = function(dest) { - unpipedDest = dest; - stream.Readable.prototype.unpipe.call(this, dest); - }; - - var dest = new stream.Writable(); - dest._write = function(chunk, encoding, cb) { - cb(); - }; - - source.pipe(dest); - - var unpipedSource; - dest.on('unpipe', function(src) { - unpipedSource = src; - }); - - var err = new Error('This stream turned into bacon.'); - - var gotErr = null; - try { - dest.emit('error', err); - } catch (e) { - gotErr = e; - } - assert.strictEqual(gotErr, err); - assert.strictEqual(unpipedSource, source); - assert.strictEqual(unpipedDest, dest); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js deleted file mode 100644 index e85f785..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js +++ /dev/null @@ -1,138 +0,0 @@ -// 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 common = require('../common.js'); -var stream = require('../../readable'); -var Readable = stream.Readable; -var Writable = stream.Writable; -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - - -// a mock thing a bit like the net.Socket/tcp_wrap.handle interaction - -var stream = new Readable({ - highWaterMark: 16, - encoding: 'utf8' -}); - -var source = new EE; - -stream._read = function() { - console.error('stream._read'); - readStart(); -}; - -var ended = false; -stream.on('end', function() { - ended = true; -}); - -source.on('data', function(chunk) { - var ret = stream.push(chunk); - console.error('data', stream._readableState.length); - if (!ret) - readStop(); -}); - -source.on('end', function() { - stream.push(null); -}); - -var reading = false; - -function readStart() { - console.error('readStart'); - reading = true; -} - -function readStop() { - console.error('readStop'); - reading = false; - process.nextTick(function() { - var r = stream.read(); - if (r !== null) - writer.write(r); - }); -} - -var writer = new Writable({ - decodeStrings: false -}); - -var written = []; - -var expectWritten = - [ 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg' ]; - -writer._write = function(chunk, encoding, cb) { - console.error('WRITE %s', chunk); - written.push(chunk); - process.nextTick(cb); -}; - -writer.on('finish', finish); - - -// now emit some chunks. - -var chunk = "asdfg"; - -var set = 0; -readStart(); -data(); -function data() { - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(!reading); - if (set++ < 5) - setTimeout(data, 10); - else - end(); -} - -function finish() { - console.error('finish'); - assert.deepEqual(written, expectWritten); - console.log('ok'); -} - -function end() { - source.emit('end'); - assert(!reading); - writer.end(stream.read()); - setTimeout(function() { - assert(ended); - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js deleted file mode 100644 index 7e86eec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js +++ /dev/null @@ -1,54 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); -var Readable = require('../../readable').Readable; -var r = new Readable(); -var N = 256 * 1024; - -// Go ahead and allow the pathological case for this test. -// Yes, it's an infinite loop, that's the point. -process.maxTickDepth = N + 2; - -var reads = 0; -r._read = function(n) { - var chunk = reads++ === N ? null : new Buffer(1); - r.push(chunk); -}; - -r.on('readable', function onReadable() { - if (!(r._readableState.length % 256)) - console.error('readable', r._readableState.length); - r.read(N * 2); -}); - -var ended = false; -r.on('end', function onEnd() { - ended = true; -}); - -r.read(0); - -process.on('exit', function() { - assert(ended); - console.log('ok'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js deleted file mode 100644 index 1b067f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js +++ /dev/null @@ -1,119 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); - -var Readable = require('../../readable').Readable; - -test1(); -if (!/^v0\.[0-8]\./.test(process.version)) - test2(); - -function test1() { - var r = new Readable(); - - // should not end when we get a Buffer(0) or '' as the _read result - // that just means that there is *temporarily* no data, but to go - // ahead and try again later. - // - // note that this is very unusual. it only works for crypto streams - // because the other side of the stream will call read(0) to cycle - // data through openssl. that's why we set the timeouts to call - // r.read(0) again later, otherwise there is no more work being done - // and the process just exits. - - var buf = new Buffer(5); - buf.fill('x'); - var reads = 5; - r._read = function(n) { - switch (reads--) { - case 0: - return r.push(null); // EOF - case 1: - return r.push(buf); - case 2: - setTimeout(r.read.bind(r, 0), 10); - return r.push(new Buffer(0)); // Not-EOF! - case 3: - setTimeout(r.read.bind(r, 0), 10); - return process.nextTick(function() { - return r.push(new Buffer(0)); - }); - case 4: - setTimeout(r.read.bind(r, 0), 10); - return setTimeout(function() { - return r.push(new Buffer(0)); - }); - case 5: - return setTimeout(function() { - return r.push(buf); - }); - default: - throw new Error('unreachable'); - } - }; - - var results = []; - function flow() { - var chunk; - while (null !== (chunk = r.read())) - results.push(chunk + ''); - } - r.on('readable', flow); - r.on('end', function() { - results.push('EOF'); - }); - flow(); - - process.on('exit', function() { - assert.deepEqual(results, [ 'xxxxx', 'xxxxx', 'EOF' ]); - console.log('ok'); - }); -} - -function test2() { - var r = new Readable({ encoding: 'base64' }); - var reads = 5; - r._read = function(n) { - if (!reads--) - return r.push(null); // EOF - else - return r.push(new Buffer('x')); - }; - - var results = []; - function flow() { - var chunk; - while (null !== (chunk = r.read())) - results.push(chunk + ''); - } - r.on('readable', flow); - r.on('end', function() { - results.push('EOF'); - }); - flow(); - - process.on('exit', function() { - assert.deepEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]); - console.log('ok'); - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js deleted file mode 100644 index 04a96f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js +++ /dev/null @@ -1,120 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var fromList = require('../../lib/_stream_readable')._fromList; - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - - - -test('buffers', function(t) { - // have a length - var len = 16; - var list = [ new Buffer('foog'), - new Buffer('bark'), - new Buffer('bazy'), - new Buffer('kuel') ]; - - // read more than the first element. - var ret = fromList(6, { buffer: list, length: 16 }); - t.equal(ret.toString(), 'foogba'); - - // read exactly the first element. - ret = fromList(2, { buffer: list, length: 10 }); - t.equal(ret.toString(), 'rk'); - - // read less than the first element. - ret = fromList(2, { buffer: list, length: 8 }); - t.equal(ret.toString(), 'ba'); - - // read more than we have. - ret = fromList(100, { buffer: list, length: 6 }); - t.equal(ret.toString(), 'zykuel'); - - // all consumed. - t.same(list, []); - - t.end(); -}); - -test('strings', function(t) { - // have a length - var len = 16; - var list = [ 'foog', - 'bark', - 'bazy', - 'kuel' ]; - - // read more than the first element. - var ret = fromList(6, { buffer: list, length: 16, decoder: true }); - t.equal(ret, 'foogba'); - - // read exactly the first element. - ret = fromList(2, { buffer: list, length: 10, decoder: true }); - t.equal(ret, 'rk'); - - // read less than the first element. - ret = fromList(2, { buffer: list, length: 8, decoder: true }); - t.equal(ret, 'ba'); - - // read more than we have. - ret = fromList(100, { buffer: list, length: 6, decoder: true }); - t.equal(ret, 'zykuel'); - - // all consumed. - t.same(list, []); - - t.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js deleted file mode 100644 index c6cbc7d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); - -var Stream = require('../../readable'); -var Readable = Stream.Readable; - -var r = new Readable(); -var N = 256; -var reads = 0; -r._read = function(n) { - return r.push(++reads === N ? null : new Buffer(1)); -}; - -var rended = false; -r.on('end', function() { - rended = true; -}); - -var w = new Stream(); -w.writable = true; -var writes = 0; -var buffered = 0; -w.write = function(c) { - writes += c.length; - buffered += c.length; - process.nextTick(drain); - return false; -}; - -function drain() { - assert(buffered <= 2); - buffered = 0; - w.emit('drain'); -} - - -var wended = false; -w.end = function() { - wended = true; -}; - -// Just for kicks, let's mess with the drain count. -// This verifies that even if it gets negative in the -// pipe() cleanup function, we'll still function properly. -r.on('readable', function() { - w.emit('drain'); -}); - -r.pipe(w); -process.on('exit', function() { - assert(rended); - assert(wended); - console.error('ok'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js deleted file mode 100644 index c971898..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var Readable = require('../../lib/_stream_readable'); - -var len = 0; -var chunks = new Array(10); -for (var i = 1; i <= 10; i++) { - chunks[i-1] = new Buffer(i); - len += i; -} - -var test = new Readable(); -var n = 0; -test._read = function(size) { - var chunk = chunks[n++]; - setTimeout(function() { - test.push(chunk); - }); -}; - -test.on('end', thrower); -function thrower() { - throw new Error('this should not happen!'); -} - -var bytesread = 0; -test.on('readable', function() { - var b = len - bytesread - 1; - var res = test.read(b); - if (res) { - bytesread += res.length; - console.error('br=%d len=%d', bytesread, len); - setTimeout(next); - } - test.read(0); -}); -test.read(0); - -function next() { - // now let's make 'end' happen - test.removeListener('end', thrower); - - var endEmitted = false; - process.on('exit', function() { - assert(endEmitted, 'end should be emitted by now'); - }); - test.on('end', function() { - endEmitted = true; - }); - - // one to get the last byte - var r = test.read(); - assert(r); - assert.equal(r.length, 1); - r = test.read(); - assert.equal(r, null); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js deleted file mode 100644 index 602acd6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js +++ /dev/null @@ -1,312 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var R = require('../../lib/_stream_readable'); -var util = require('util'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -///// - -util.inherits(TestReader, R); - -function TestReader(n, opts) { - R.call(this, opts); - - this.pos = 0; - this.len = n || 100; -} - -TestReader.prototype._read = function(n) { - setTimeout(function() { - - if (this.pos >= this.len) { - return this.push(null); - } - - n = Math.min(n, this.len - this.pos); - if (n <= 0) { - return this.push(null); - } - - this.pos += n; - var ret = new Buffer(n); - ret.fill('a'); - - console.log("this.push(ret)", ret) - - return this.push(ret); - }.bind(this), 1); -}; - -test('setEncoding utf8', function(t) { - var tr = new TestReader(100); - tr.setEncoding('utf8'); - var out = []; - var expect = - [ 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - - -test('setEncoding hex', function(t) { - var tr = new TestReader(100); - tr.setEncoding('hex'); - var out = []; - var expect = - [ '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('setEncoding hex with read(13)', function(t) { - var tr = new TestReader(100); - tr.setEncoding('hex'); - var out = []; - var expect = - [ "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "16161" ]; - - tr.on('readable', function flow() { - console.log("readable once") - var chunk; - while (null !== (chunk = tr.read(13))) - out.push(chunk); - }); - - tr.on('end', function() { - console.log("END") - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('encoding: utf8', function(t) { - var tr = new TestReader(100, { encoding: 'utf8' }); - var out = []; - var expect = - [ 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - - -test('encoding: hex', function(t) { - var tr = new TestReader(100, { encoding: 'hex' }); - var out = []; - var expect = - [ '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('encoding: hex with read(13)', function(t) { - var tr = new TestReader(100, { encoding: 'hex' }); - var out = []; - var expect = - [ "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "16161" ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(13))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js deleted file mode 100644 index 5804c39..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js +++ /dev/null @@ -1,435 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var PassThrough = require('../../lib/_stream_passthrough'); -var Transform = require('../../lib/_stream_transform'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - ok: assert, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -///// - -test('writable side consumption', function(t) { - var tx = new Transform({ - highWaterMark: 10 - }); - - var transformed = 0; - tx._transform = function(chunk, encoding, cb) { - transformed += chunk.length; - tx.push(chunk); - cb(); - }; - - for (var i = 1; i <= 10; i++) { - tx.write(new Buffer(i)); - } - tx.end(); - - t.equal(tx._readableState.length, 10); - t.equal(transformed, 10); - t.equal(tx._transformState.writechunk.length, 5); - t.same(tx._writableState.buffer.map(function(c) { - return c.chunk.length; - }), [6, 7, 8, 9, 10]); - - t.end(); -}); - -test('passthrough', function(t) { - var pt = new PassThrough(); - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5).toString(), 'l'); - t.end(); -}); - -test('simple transform', function(t) { - var pt = new Transform; - pt._transform = function(c, e, cb) { - var ret = new Buffer(c.length); - ret.fill('x'); - pt.push(ret); - cb(); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'x'); - t.end(); -}); - -test('async passthrough', function(t) { - var pt = new Transform; - pt._transform = function(chunk, encoding, cb) { - setTimeout(function() { - pt.push(chunk); - cb(); - }, 10); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5).toString(), 'l'); - t.end(); - }); -}); - -test('assymetric transform (expand)', function(t) { - var pt = new Transform; - - // emit each chunk 2 times. - pt._transform = function(chunk, encoding, cb) { - setTimeout(function() { - pt.push(chunk); - setTimeout(function() { - pt.push(chunk); - cb(); - }, 10) - }, 10); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'foogf'); - t.equal(pt.read(5).toString(), 'oogba'); - t.equal(pt.read(5).toString(), 'rkbar'); - t.equal(pt.read(5).toString(), 'kbazy'); - t.equal(pt.read(5).toString(), 'bazyk'); - t.equal(pt.read(5).toString(), 'uelku'); - t.equal(pt.read(5).toString(), 'el'); - t.end(); - }); -}); - -test('assymetric transform (compress)', function(t) { - var pt = new Transform; - - // each output is the first char of 3 consecutive chunks, - // or whatever's left. - pt.state = ''; - - pt._transform = function(chunk, encoding, cb) { - if (!chunk) - chunk = ''; - var s = chunk.toString(); - setTimeout(function() { - this.state += s.charAt(0); - if (this.state.length === 3) { - pt.push(new Buffer(this.state)); - this.state = ''; - } - cb(); - }.bind(this), 10); - }; - - pt._flush = function(cb) { - // just output whatever we have. - pt.push(new Buffer(this.state)); - this.state = ''; - cb(); - }; - - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.write(new Buffer('eeee')); - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.write(new Buffer('eeee')); - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.end(); - - // 'abcdeabcdeabcd' - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'abcde'); - t.equal(pt.read(5).toString(), 'abcde'); - t.equal(pt.read(5).toString(), 'abcd'); - t.end(); - }); -}); - - -test('passthrough event emission', function(t) { - var pt = new PassThrough(); - var emits = 0; - pt.on('readable', function() { - var state = pt._readableState; - console.error('>>> emit readable %d', emits); - emits++; - }); - - var i = 0; - - pt.write(new Buffer('foog')); - - console.error('need emit 0'); - pt.write(new Buffer('bark')); - - console.error('should have emitted readable now 1 === %d', emits); - t.equal(emits, 1); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5) + '', 'null'); - - console.error('need emit 1'); - - pt.write(new Buffer('bazy')); - console.error('should have emitted, but not again'); - pt.write(new Buffer('kuel')); - - console.error('should have emitted readable now 2 === %d', emits); - t.equal(emits, 2); - - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5), null); - - console.error('need emit 2'); - - pt.end(); - - t.equal(emits, 3); - - t.equal(pt.read(5).toString(), 'l'); - t.equal(pt.read(5), null); - - console.error('should not have emitted again'); - t.equal(emits, 3); - t.end(); -}); - -test('passthrough event emission reordered', function(t) { - var pt = new PassThrough; - var emits = 0; - pt.on('readable', function() { - console.error('emit readable', emits) - emits++; - }); - - pt.write(new Buffer('foog')); - console.error('need emit 0'); - pt.write(new Buffer('bark')); - console.error('should have emitted readable now 1 === %d', emits); - t.equal(emits, 1); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5), null); - - console.error('need emit 1'); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'arkba'); - - t.equal(pt.read(5), null); - - console.error('need emit 2'); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5), null); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'l'); - t.equal(pt.read(5), null); - t.equal(emits, 4); - t.end(); - }); - pt.end(); - }); - pt.write(new Buffer('kuel')); - }); - - pt.write(new Buffer('bazy')); -}); - -test('passthrough facaded', function(t) { - console.error('passthrough facaded'); - var pt = new PassThrough; - var datas = []; - pt.on('data', function(chunk) { - datas.push(chunk.toString()); - }); - - pt.on('end', function() { - t.same(datas, ['foog', 'bark', 'bazy', 'kuel']); - t.end(); - }); - - pt.write(new Buffer('foog')); - setTimeout(function() { - pt.write(new Buffer('bark')); - setTimeout(function() { - pt.write(new Buffer('bazy')); - setTimeout(function() { - pt.write(new Buffer('kuel')); - setTimeout(function() { - pt.end(); - }, 10); - }, 10); - }, 10); - }, 10); -}); - -test('object transform (json parse)', function(t) { - console.error('json parse stream'); - var jp = new Transform({ objectMode: true }); - jp._transform = function(data, encoding, cb) { - try { - jp.push(JSON.parse(data)); - cb(); - } catch (er) { - cb(er); - } - }; - - // anything except null/undefined is fine. - // those are "magic" in the stream API, because they signal EOF. - var objects = [ - { foo: 'bar' }, - 100, - "string", - { nested: { things: [ { foo: 'bar' }, 100, "string" ] } } - ]; - - var ended = false; - jp.on('end', function() { - ended = true; - }); - - objects.forEach(function(obj) { - jp.write(JSON.stringify(obj)); - var res = jp.read(); - t.same(res, obj); - }); - - jp.end(); - - process.nextTick(function() { - t.ok(ended); - t.end(); - }) -}); - -test('object transform (json stringify)', function(t) { - console.error('json parse stream'); - var js = new Transform({ objectMode: true }); - js._transform = function(data, encoding, cb) { - try { - js.push(JSON.stringify(data)); - cb(); - } catch (er) { - cb(er); - } - }; - - // anything except null/undefined is fine. - // those are "magic" in the stream API, because they signal EOF. - var objects = [ - { foo: 'bar' }, - 100, - "string", - { nested: { things: [ { foo: 'bar' }, 100, "string" ] } } - ]; - - var ended = false; - js.on('end', function() { - ended = true; - }); - - objects.forEach(function(obj) { - js.write(obj); - var res = js.read(); - t.equal(res, JSON.stringify(obj)); - }); - - js.end(); - - process.nextTick(function() { - t.ok(ended); - t.end(); - }) -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js deleted file mode 100644 index a3b5394..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js +++ /dev/null @@ -1,76 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var stream = require('../../readable'); -var crypto = require('crypto'); - -var util = require('util'); - -function TestWriter() { - stream.Writable.call(this); -} -util.inherits(TestWriter, stream.Writable); - -TestWriter.prototype._write = function (buffer, encoding, callback) { - console.log('write called'); - // super slow write stream (callback never called) -}; - -var dest = new TestWriter(); - -function TestReader(id) { - stream.Readable.call(this); - this.reads = 0; -} -util.inherits(TestReader, stream.Readable); - -TestReader.prototype._read = function (size) { - this.reads += 1; - this.push(crypto.randomBytes(size)); -}; - -var src1 = new TestReader(); -var src2 = new TestReader(); - -src1.pipe(dest); - -src1.once('readable', function () { - process.nextTick(function () { - - src2.pipe(dest); - - src2.once('readable', function () { - process.nextTick(function () { - - src1.unpipe(dest); - }); - }); - }); -}); - - -process.on('exit', function () { - assert.equal(src1.reads, 2); - assert.equal(src2.reads, 2); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js deleted file mode 100644 index 6882f20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js +++ /dev/null @@ -1,74 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var stream = require('../../readable'); - -var chunk = new Buffer('hallo'); - -var util = require('util'); - -function TestWriter() { - stream.Writable.call(this); -} -util.inherits(TestWriter, stream.Writable); - -TestWriter.prototype._write = function(buffer, encoding, callback) { - callback(null); -}; - -var dest = new TestWriter(); - -// Set this high so that we'd trigger a nextTick warning -// and/or RangeError if we do maybeReadMore wrong. -function TestReader() { - stream.Readable.call(this, { highWaterMark: 0x10000 }); -} -util.inherits(TestReader, stream.Readable); - -TestReader.prototype._read = function(size) { - this.push(chunk); -}; - -var src = new TestReader(); - -for (var i = 0; i < 10; i++) { - src.pipe(dest); - src.unpipe(dest); -} - -assert.equal(src.listeners('end').length, 0); -assert.equal(src.listeners('readable').length, 0); - -assert.equal(dest.listeners('unpipe').length, 0); -assert.equal(dest.listeners('drain').length, 0); -assert.equal(dest.listeners('error').length, 0); -assert.equal(dest.listeners('close').length, 0); -assert.equal(dest.listeners('finish').length, 0); - -console.error(src._readableState); -process.on('exit', function() { - assert(src._readableState.length >= src._readableState.highWaterMark); - src._readableState.buffer.length = 0; - console.error(src._readableState); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js deleted file mode 100644 index a60e65c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js +++ /dev/null @@ -1,328 +0,0 @@ -// 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 common = require('../common.js'); -var W = require('../../lib/_stream_writable'); -var D = require('../../lib/_stream_duplex'); -var assert = require('assert'); - -var util = require('util'); -util.inherits(TestWriter, W); - -function TestWriter() { - W.apply(this, arguments); - this.buffer = []; - this.written = 0; -} - -TestWriter.prototype._write = function(chunk, encoding, cb) { - // simulate a small unpredictable latency - setTimeout(function() { - this.buffer.push(chunk.toString()); - this.written += chunk.length; - cb(); - }.bind(this), Math.floor(Math.random() * 10)); -}; - -var chunks = new Array(50); -for (var i = 0; i < chunks.length; i++) { - chunks[i] = new Array(i + 1).join('x'); -} - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -test('write fast', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.end(); - }); - - chunks.forEach(function(chunk) { - // screw backpressure. Just buffer it all up. - tw.write(chunk); - }); - tw.end(); -}); - -test('write slow', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.end(); - }); - - var i = 0; - (function W() { - tw.write(chunks[i++]); - if (i < chunks.length) - setTimeout(W, 10); - else - tw.end(); - })(); -}); - -test('write backpressure', function(t) { - var tw = new TestWriter({ - highWaterMark: 50 - }); - - var drains = 0; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.equal(drains, 17); - t.end(); - }); - - tw.on('drain', function() { - drains++; - }); - - var i = 0; - (function W() { - do { - var ret = tw.write(chunks[i++]); - } while (ret !== false && i < chunks.length); - - if (i < chunks.length) { - assert(tw._writableState.length >= 50); - tw.once('drain', W); - } else { - tw.end(); - } - })(); -}); - -test('write bufferize', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - var encodings = - [ 'hex', - 'utf8', - 'utf-8', - 'ascii', - 'binary', - 'base64', - 'ucs2', - 'ucs-2', - 'utf16le', - 'utf-16le', - undefined ]; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got the expected chunks'); - }); - - chunks.forEach(function(chunk, i) { - var enc = encodings[ i % encodings.length ]; - chunk = new Buffer(chunk); - tw.write(chunk.toString(enc), enc); - }); - t.end(); -}); - -test('write no bufferize', function(t) { - var tw = new TestWriter({ - highWaterMark: 100, - decodeStrings: false - }); - - tw._write = function(chunk, encoding, cb) { - assert(typeof chunk === 'string'); - chunk = new Buffer(chunk, encoding); - return TestWriter.prototype._write.call(this, chunk, encoding, cb); - }; - - var encodings = - [ 'hex', - 'utf8', - 'utf-8', - 'ascii', - 'binary', - 'base64', - 'ucs2', - 'ucs-2', - 'utf16le', - 'utf-16le', - undefined ]; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got the expected chunks'); - }); - - chunks.forEach(function(chunk, i) { - var enc = encodings[ i % encodings.length ]; - chunk = new Buffer(chunk); - tw.write(chunk.toString(enc), enc); - }); - t.end(); -}); - -test('write callbacks', function (t) { - var callbacks = chunks.map(function(chunk, i) { - return [i, function(er) { - callbacks._called[i] = chunk; - }]; - }).reduce(function(set, x) { - set['callback-' + x[0]] = x[1]; - return set; - }, {}); - callbacks._called = []; - - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - process.nextTick(function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.same(callbacks._called, chunks, 'called all callbacks'); - t.end(); - }); - }); - - chunks.forEach(function(chunk, i) { - tw.write(chunk, callbacks['callback-' + i]); - }); - tw.end(); -}); - -test('end callback', function (t) { - var tw = new TestWriter(); - tw.end(function () { - t.end(); - }); -}); - -test('end callback with chunk', function (t) { - var tw = new TestWriter(); - tw.end(new Buffer('hello world'), function () { - t.end(); - }); -}); - -test('end callback with chunk and encoding', function (t) { - var tw = new TestWriter(); - tw.end('hello world', 'ascii', function () { - t.end(); - }); -}); - -test('end callback after .write() call', function (t) { - var tw = new TestWriter(); - tw.write(new Buffer('hello world')); - tw.end(function () { - t.end(); - }); -}); - -test('encoding should be ignored for buffers', function(t) { - var tw = new W(); - var hex = '018b5e9a8f6236ffe30e31baf80d2cf6eb'; - tw._write = function(chunk, encoding, cb) { - t.equal(chunk.toString('hex'), hex); - t.end(); - }; - var buf = new Buffer(hex, 'hex'); - tw.write(buf, 'binary'); -}); - -test('writables are not pipable', function(t) { - var w = new W(); - w._write = function() {}; - var gotError = false; - w.on('error', function(er) { - gotError = true; - }); - w.pipe(process.stdout); - assert(gotError); - t.end(); -}); - -test('duplexes are pipable', function(t) { - var d = new D(); - d._read = function() {}; - d._write = function() {}; - var gotError = false; - d.on('error', function(er) { - gotError = true; - }); - d.pipe(process.stdout); - assert(!gotError); - t.end(); -}); - -test('end(chunk) two times is an error', function(t) { - var w = new W(); - w._write = function() {}; - var gotError = false; - w.on('error', function(er) { - gotError = true; - t.equal(er.message, 'write after end'); - }); - w.end('this is the end'); - w.end('and so is this'); - process.nextTick(function() { - assert(gotError); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js deleted file mode 100644 index a30ca20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js +++ /dev/null @@ -1,452 +0,0 @@ -// 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 Transform = require('./lib/_stream_transform.js'); - -var binding = process.binding('zlib'); -var util = require('util'); -var assert = require('assert').ok; - -// zlib doesn't provide these, so kludge them in following the same -// const naming scheme zlib uses. -binding.Z_MIN_WINDOWBITS = 8; -binding.Z_MAX_WINDOWBITS = 15; -binding.Z_DEFAULT_WINDOWBITS = 15; - -// fewer than 64 bytes per chunk is stupid. -// technically it could work with as few as 8, but even 64 bytes -// is absurdly low. Usually a MB or more is best. -binding.Z_MIN_CHUNK = 64; -binding.Z_MAX_CHUNK = Infinity; -binding.Z_DEFAULT_CHUNK = (16 * 1024); - -binding.Z_MIN_MEMLEVEL = 1; -binding.Z_MAX_MEMLEVEL = 9; -binding.Z_DEFAULT_MEMLEVEL = 8; - -binding.Z_MIN_LEVEL = -1; -binding.Z_MAX_LEVEL = 9; -binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION; - -// expose all the zlib constants -Object.keys(binding).forEach(function(k) { - if (k.match(/^Z/)) exports[k] = binding[k]; -}); - -// translation table for return codes. -exports.codes = { - Z_OK: binding.Z_OK, - Z_STREAM_END: binding.Z_STREAM_END, - Z_NEED_DICT: binding.Z_NEED_DICT, - Z_ERRNO: binding.Z_ERRNO, - Z_STREAM_ERROR: binding.Z_STREAM_ERROR, - Z_DATA_ERROR: binding.Z_DATA_ERROR, - Z_MEM_ERROR: binding.Z_MEM_ERROR, - Z_BUF_ERROR: binding.Z_BUF_ERROR, - Z_VERSION_ERROR: binding.Z_VERSION_ERROR -}; - -Object.keys(exports.codes).forEach(function(k) { - exports.codes[exports.codes[k]] = k; -}); - -exports.Deflate = Deflate; -exports.Inflate = Inflate; -exports.Gzip = Gzip; -exports.Gunzip = Gunzip; -exports.DeflateRaw = DeflateRaw; -exports.InflateRaw = InflateRaw; -exports.Unzip = Unzip; - -exports.createDeflate = function(o) { - return new Deflate(o); -}; - -exports.createInflate = function(o) { - return new Inflate(o); -}; - -exports.createDeflateRaw = function(o) { - return new DeflateRaw(o); -}; - -exports.createInflateRaw = function(o) { - return new InflateRaw(o); -}; - -exports.createGzip = function(o) { - return new Gzip(o); -}; - -exports.createGunzip = function(o) { - return new Gunzip(o); -}; - -exports.createUnzip = function(o) { - return new Unzip(o); -}; - - -// Convenience methods. -// compress/decompress a string or buffer in one step. -exports.deflate = function(buffer, callback) { - zlibBuffer(new Deflate(), buffer, callback); -}; - -exports.gzip = function(buffer, callback) { - zlibBuffer(new Gzip(), buffer, callback); -}; - -exports.deflateRaw = function(buffer, callback) { - zlibBuffer(new DeflateRaw(), buffer, callback); -}; - -exports.unzip = function(buffer, callback) { - zlibBuffer(new Unzip(), buffer, callback); -}; - -exports.inflate = function(buffer, callback) { - zlibBuffer(new Inflate(), buffer, callback); -}; - -exports.gunzip = function(buffer, callback) { - zlibBuffer(new Gunzip(), buffer, callback); -}; - -exports.inflateRaw = function(buffer, callback) { - zlibBuffer(new InflateRaw(), buffer, callback); -}; - -function zlibBuffer(engine, buffer, callback) { - var buffers = []; - var nread = 0; - - engine.on('error', onError); - engine.on('end', onEnd); - - engine.end(buffer); - flow(); - - function flow() { - var chunk; - while (null !== (chunk = engine.read())) { - buffers.push(chunk); - nread += chunk.length; - } - engine.once('readable', flow); - } - - function onError(err) { - engine.removeListener('end', onEnd); - engine.removeListener('readable', flow); - callback(err); - } - - function onEnd() { - var buf = Buffer.concat(buffers, nread); - buffers = []; - callback(null, buf); - } -} - - -// generic zlib -// minimal 2-byte header -function Deflate(opts) { - if (!(this instanceof Deflate)) return new Deflate(opts); - Zlib.call(this, opts, binding.DEFLATE); -} - -function Inflate(opts) { - if (!(this instanceof Inflate)) return new Inflate(opts); - Zlib.call(this, opts, binding.INFLATE); -} - - - -// gzip - bigger header, same deflate compression -function Gzip(opts) { - if (!(this instanceof Gzip)) return new Gzip(opts); - Zlib.call(this, opts, binding.GZIP); -} - -function Gunzip(opts) { - if (!(this instanceof Gunzip)) return new Gunzip(opts); - Zlib.call(this, opts, binding.GUNZIP); -} - - - -// raw - no header -function DeflateRaw(opts) { - if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts); - Zlib.call(this, opts, binding.DEFLATERAW); -} - -function InflateRaw(opts) { - if (!(this instanceof InflateRaw)) return new InflateRaw(opts); - Zlib.call(this, opts, binding.INFLATERAW); -} - - -// auto-detect header. -function Unzip(opts) { - if (!(this instanceof Unzip)) return new Unzip(opts); - Zlib.call(this, opts, binding.UNZIP); -} - - -// the Zlib class they all inherit from -// This thing manages the queue of requests, and returns -// true or false if there is anything in the queue when -// you call the .write() method. - -function Zlib(opts, mode) { - this._opts = opts = opts || {}; - this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK; - - Transform.call(this, opts); - - // means a different thing there. - this._readableState.chunkSize = null; - - if (opts.chunkSize) { - if (opts.chunkSize < exports.Z_MIN_CHUNK || - opts.chunkSize > exports.Z_MAX_CHUNK) { - throw new Error('Invalid chunk size: ' + opts.chunkSize); - } - } - - if (opts.windowBits) { - if (opts.windowBits < exports.Z_MIN_WINDOWBITS || - opts.windowBits > exports.Z_MAX_WINDOWBITS) { - throw new Error('Invalid windowBits: ' + opts.windowBits); - } - } - - if (opts.level) { - if (opts.level < exports.Z_MIN_LEVEL || - opts.level > exports.Z_MAX_LEVEL) { - throw new Error('Invalid compression level: ' + opts.level); - } - } - - if (opts.memLevel) { - if (opts.memLevel < exports.Z_MIN_MEMLEVEL || - opts.memLevel > exports.Z_MAX_MEMLEVEL) { - throw new Error('Invalid memLevel: ' + opts.memLevel); - } - } - - if (opts.strategy) { - if (opts.strategy != exports.Z_FILTERED && - opts.strategy != exports.Z_HUFFMAN_ONLY && - opts.strategy != exports.Z_RLE && - opts.strategy != exports.Z_FIXED && - opts.strategy != exports.Z_DEFAULT_STRATEGY) { - throw new Error('Invalid strategy: ' + opts.strategy); - } - } - - if (opts.dictionary) { - if (!Buffer.isBuffer(opts.dictionary)) { - throw new Error('Invalid dictionary: it should be a Buffer instance'); - } - } - - this._binding = new binding.Zlib(mode); - - var self = this; - this._hadError = false; - this._binding.onerror = function(message, errno) { - // there is no way to cleanly recover. - // continuing only obscures problems. - self._binding = null; - self._hadError = true; - - var error = new Error(message); - error.errno = errno; - error.code = exports.codes[errno]; - self.emit('error', error); - }; - - this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, - opts.level || exports.Z_DEFAULT_COMPRESSION, - opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, - opts.strategy || exports.Z_DEFAULT_STRATEGY, - opts.dictionary); - - this._buffer = new Buffer(this._chunkSize); - this._offset = 0; - this._closed = false; - - this.once('end', this.close); -} - -util.inherits(Zlib, Transform); - -Zlib.prototype.reset = function reset() { - return this._binding.reset(); -}; - -Zlib.prototype._flush = function(output, callback) { - var rs = this._readableState; - var self = this; - this._transform(null, output, function(er) { - if (er) - return callback(er); - - // now a weird thing happens... it could be that you called flush - // but everything had already actually been consumed, but it wasn't - // enough to get over the Readable class's lowWaterMark. - // In that case, we emit 'readable' now to make sure it's consumed. - if (rs.length && - rs.length < rs.lowWaterMark && - !rs.ended && - rs.needReadable) - self.emit('readable'); - - callback(); - }); -}; - -Zlib.prototype.flush = function(callback) { - var ws = this._writableState; - var ts = this._transformState; - - if (ws.writing) { - ws.needDrain = true; - var self = this; - this.once('drain', function() { - self._flush(ts.output, callback); - }); - return; - } - - this._flush(ts.output, callback || function() {}); -}; - -Zlib.prototype.close = function(callback) { - if (callback) - process.nextTick(callback); - - if (this._closed) - return; - - this._closed = true; - - this._binding.close(); - - var self = this; - process.nextTick(function() { - self.emit('close'); - }); -}; - -Zlib.prototype._transform = function(chunk, output, cb) { - var flushFlag; - var ws = this._writableState; - var ending = ws.ending || ws.ended; - var last = ending && (!chunk || ws.length === chunk.length); - - if (chunk !== null && !Buffer.isBuffer(chunk)) - return cb(new Error('invalid input')); - - // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag. - // If it's explicitly flushing at some other time, then we use - // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression - // goodness. - if (last) - flushFlag = binding.Z_FINISH; - else if (chunk === null) - flushFlag = binding.Z_FULL_FLUSH; - else - flushFlag = binding.Z_NO_FLUSH; - - var availInBefore = chunk && chunk.length; - var availOutBefore = this._chunkSize - this._offset; - var inOff = 0; - - var req = this._binding.write(flushFlag, - chunk, // in - inOff, // in_off - availInBefore, // in_len - this._buffer, // out - this._offset, //out_off - availOutBefore); // out_len - - req.buffer = chunk; - req.callback = callback; - - var self = this; - function callback(availInAfter, availOutAfter, buffer) { - if (self._hadError) - return; - - var have = availOutBefore - availOutAfter; - assert(have >= 0, 'have should not go down'); - - if (have > 0) { - var out = self._buffer.slice(self._offset, self._offset + have); - self._offset += have; - // serve some output to the consumer. - output(out); - } - - // exhausted the output buffer, or used all the input create a new one. - if (availOutAfter === 0 || self._offset >= self._chunkSize) { - availOutBefore = self._chunkSize; - self._offset = 0; - self._buffer = new Buffer(self._chunkSize); - } - - if (availOutAfter === 0) { - // Not actually done. Need to reprocess. - // Also, update the availInBefore to the availInAfter value, - // so that if we have to hit it a third (fourth, etc.) time, - // it'll have the correct byte counts. - inOff += (availInBefore - availInAfter); - availInBefore = availInAfter; - - var newReq = self._binding.write(flushFlag, - chunk, - inOff, - availInBefore, - self._buffer, - self._offset, - self._chunkSize); - newReq.callback = callback; // this same function - newReq.buffer = chunk; - return; - } - - // finished with the chunk. - cb(); - } -}; - -util.inherits(Deflate, Zlib); -util.inherits(Inflate, Zlib); -util.inherits(Gzip, Zlib); -util.inherits(Gunzip, Zlib); -util.inherits(DeflateRaw, Zlib); -util.inherits(InflateRaw, Zlib); -util.inherits(Unzip, Zlib); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md deleted file mode 100644 index 389adae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# xtend - -[![browser support][3]][4] - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes presedence. - -## Examples - -```js -var extend = require("xtend") - -var combination = extend({ - a: "a" -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js deleted file mode 100644 index 62391e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = hasKeys - -function hasKeys(source) { - return source !== null && - (typeof source === "object" || - typeof source === "function") -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js deleted file mode 100644 index 20937d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js +++ /dev/null @@ -1,25 +0,0 @@ -var Keys = require("object-keys") -var hasKeys = require("./has-keys") - -module.exports = extend - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - if (!hasKeys(source)) { - continue - } - - var keys = Keys(source) - - for (var j = 0; j < keys.length; j++) { - var name = keys[j] - target[name] = source[name] - } - } - - return target -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js deleted file mode 100644 index 29e3b22..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js +++ /dev/null @@ -1,19 +0,0 @@ -var hasKeys = require("./has-keys") - -module.exports = extend - -function extend(target) { - var sources = [].slice.call(arguments, 1) - - sources.forEach(function (source) { - if (!hasKeys(source)) { - return - } - - Object.keys(source).forEach(function (name) { - target[name] = source[name] - }) - }) - - return target -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore deleted file mode 100644 index fd31f5e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json deleted file mode 100644 index 287edfe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "launchers": { - "node": { - "command": "node ./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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml deleted file mode 100644 index ed178f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE deleted file mode 100644 index 72d356c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Colingo. - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md deleted file mode 100644 index 607a7d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# is-object - -[![build status][1]][2] [![dependency status][3]][4] - -[![browser support][5]][6] - -Checks whether a value is an object - -Because `typeof null` is a troll. - -## Example - -```js -var isObject = require("is-object") - -console.log(isObject(null)) // false -console.log(isObject(require("util"))) // true -``` - -## Installation - -`npm install is-object` - -## Contributors - - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Colingo/is-object.png - [2]: http://travis-ci.org/Colingo/is-object - [3]: http://david-dm.org/Colingo/is-object/status.png - [4]: http://david-dm.org/Colingo/is-object - [5]: http://ci.testling.com/Colingo/is-object.png - [6]: http://ci.testling.com/Colingo/is-object diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/examples/simple.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/examples/simple.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js deleted file mode 100644 index 38348b1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = isObject - -function isObject(x) { - return typeof x === "object" && x !== null -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json deleted file mode 100644 index 92cd3b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "is-object", - "version": "0.1.2", - "description": "Checks whether a value is an object", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Colingo/is-object.git" - }, - "main": "index", - "homepage": "https://github.com/Colingo/is-object", - "contributors": [ - { - "name": "Raynos" - } - ], - "bugs": { - "url": "https://github.com/Colingo/is-object/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~0.2.2", - "browserify-server": "~2.1.18", - "browservefy": "~0.0.7", - "testem": "https://github.com/raynos/testem/tarball/master" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Colingo/is-object/raw/master/LICENSE" - } - ], - "scripts": { - "test": "testem ci", - "build": "browserify-server --bundle=test/index.js -o test/static/bundle.js --debug", - "testem": "testem", - "example": "browservefy ./examples/simple.js --browserify='browserify-server' --live -- --debug --bundle" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "readme": "# is-object\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n[![browser support][5]][6]\n\nChecks whether a value is an object\n\nBecause `typeof null` is a troll.\n\n## Example\n\n```js\nvar isObject = require(\"is-object\")\n\nconsole.log(isObject(null)) // false\nconsole.log(isObject(require(\"util\"))) // true\n```\n\n## Installation\n\n`npm install is-object`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n [1]: https://secure.travis-ci.org/Colingo/is-object.png\n [2]: http://travis-ci.org/Colingo/is-object\n [3]: http://david-dm.org/Colingo/is-object/status.png\n [4]: http://david-dm.org/Colingo/is-object\n [5]: http://ci.testling.com/Colingo/is-object.png\n [6]: http://ci.testling.com/Colingo/is-object\n", - "readmeFilename": "README.md", - "_id": "is-object@0.1.2", - "dist": { - "shasum": "d4ef6cf2e33bfa0407ba25176b1266f44999f8c9" - }, - "_from": "is-object@~0.1.2", - "_resolved": "https://registry.npmjs.org/is-object/-/is-object-0.1.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js deleted file mode 100644 index b4c7abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require("tape") - -var isObject = require("../index") - -test("returns true for objects", function (assert) { - assert.equal(isObject({}), true) - assert.equal(isObject([]), true) - - assert.end() -}) - -test("returns false for null", function (assert) { - assert.equal(isObject(null), false) - - assert.end() -}) - -test("returns false for primitives", function (assert) { - assert.equal(isObject(42), false) - assert.equal(isObject("foo"), false) - - assert.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html deleted file mode 100644 index 60f6ef8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - TAPE Example - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js deleted file mode 100644 index c512792..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js +++ /dev/null @@ -1,49 +0,0 @@ -(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 { - results.failed++ - } - - results.total++ - - socket.emit('test-result', test) - results.tests.push(test) - } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml deleted file mode 100644 index 8170a81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.6" diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md deleted file mode 100644 index c49e3a8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md +++ /dev/null @@ -1,38 +0,0 @@ -#object-keys [![Version Badge][2]][1] - -[![Build Status][3]][4] [![dependency status][5]][6] - -[![browser support][7]][8] - -An Object.keys shim. Uses Object.keys if available. - -## Example - -```js -var keys = require('object-keys'); -var assert = require('assert'); -var obj = { - a: true, - b: true, - c: true -}; - -assert.equal(keys(obj), ['a', 'b', 'c']); -``` - -## Source -Implementation taken directly from [9] - -## Tests -Tests currently use tape - which doesn't work in node 0.10, but works in browserify. Rest assured, they pass. - -[1]: https://npmjs.org/package/object-keys -[2]: http://vb.teelaun.ch/ljharb/object-keys.svg -[3]: https://travis-ci.org/ljharb/object-keys.png -[4]: https://travis-ci.org/ljharb/object-keys -[5]: https://david-dm.org/ljharb/object-keys.png -[6]: https://david-dm.org/ljharb/object-keys -[7]: https://ci.testling.com/ljharb/object-keys.png -[8]: https://ci.testling.com/ljharb/object-keys -[9]: https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js#L542-589 - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js deleted file mode 100644 index f5b24b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = Object.keys || require('./shim'); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name deleted file mode 100644 index 373ccea..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -manuelstofer-foreach \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml deleted file mode 100644 index 6b8184f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml deleted file mode 100644 index 1162f43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml deleted file mode 100644 index 63665ee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml deleted file mode 100644 index c80f219..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml deleted file mode 100644 index 269a33c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml +++ /dev/null @@ -1,467 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1365371005647 - 1365371005647 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore deleted file mode 100644 index d135df6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -components -build \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile deleted file mode 100644 index eae4117..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -build: components - @component build - -components: component.json - @component install --dev - -clean: - rm -fr build components template.js - -.PHONY: clean diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md deleted file mode 100644 index 2752b57..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md +++ /dev/null @@ -1,30 +0,0 @@ - -# foreach - -Iterate over the key value pairs of either an array-like object or a dictionary like object. - -[![browser support][1]][2] - -## API - -### foreach(object, function, [context]) - -```js -var each = require('foreach'); - -each([1,2,3], function (value, key, array) { - // value === 1, 2, 3 - // key === 0, 1, 2 - // array === [1, 2, 3] -}); - -each({0:1,1:2,2:3}, function (value, key, object) { - // value === 1, 2, 3 - // key === 0, 1, 2 - // object === {0:1,1:2,2:3} -}); -``` - -[1]: https://ci.testling.com/manuelstofer/foreach.png -[2]: https://ci.testling.com/manuelstofer/foreach - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json deleted file mode 100644 index 9495f56..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "foreach", - "description": "foreach component + npm package", - "version": "2.0.3", - "keywords": [], - "dependencies": {}, - "scripts": [ - "index.js" - ], - "repo": "manuelstofer/foreach" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js deleted file mode 100644 index a961e4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js +++ /dev/null @@ -1,22 +0,0 @@ - -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; - -module.exports = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } -}; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json deleted file mode 100644 index 72a947c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "foreach", - "description": "foreach component + npm package", - "version": "2.0.4", - "author": { - "name": "Manuel Stofer", - "email": "manuel@takimata.ch" - }, - "contributors": [ - { - "name": "Manuel Stofer" - }, - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/manuelstofer/foreach" - }, - "keywords": [ - "shim", - "Array.prototype.forEach", - "forEach", - "Array#forEach", - "each" - ], - "dependencies": {}, - "devDependencies": { - "tape": "*" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0", - "chrome/22.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/5.0.5..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "readme": "\n# foreach\n\nIterate over the key value pairs of either an array-like object or a dictionary like object.\n\n[![browser support][1]][2]\n\n## API\n\n### foreach(object, function, [context])\n\n```js\nvar each = require('foreach');\n\neach([1,2,3], function (value, key, array) {\n // value === 1, 2, 3\n // key === 0, 1, 2\n // array === [1, 2, 3]\n});\n\neach({0:1,1:2,2:3}, function (value, key, object) {\n // value === 1, 2, 3\n // key === 0, 1, 2\n // object === {0:1,1:2,2:3}\n});\n```\n\n[1]: https://ci.testling.com/manuelstofer/foreach.png\n[2]: https://ci.testling.com/manuelstofer/foreach\n\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/manuelstofer/foreach/issues" - }, - "_id": "foreach@2.0.4", - "dist": { - "shasum": "cc5d0d8ae1d46cc9a555c2682f910977859935df" - }, - "_from": "foreach@~2.0.1", - "_resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js deleted file mode 100644 index e66aebc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js +++ /dev/null @@ -1,155 +0,0 @@ -var test = require('tape'); -var forEach = require('./index.js'); - - -test('second argument: iterator', function (t) { - var arr = []; - t.throws(function () { forEach(arr); }, TypeError, 'undefined is not a function'); - t.throws(function () { forEach(arr, null); }, TypeError, 'null is not a function'); - t.throws(function () { forEach(arr, ''); }, TypeError, 'string is not a function'); - t.throws(function () { forEach(arr, /a/); }, TypeError, 'regex is not a function'); - t.throws(function () { forEach(arr, true); }, TypeError, 'true is not a function'); - t.throws(function () { forEach(arr, false); }, TypeError, 'false is not a function'); - t.throws(function () { forEach(arr, NaN); }, TypeError, 'NaN is not a function'); - t.throws(function () { forEach(arr, 42); }, TypeError, '42 is not a function'); - t.doesNotThrow(function () { forEach(arr, function () {}); }, 'function is a function'); - t.doesNotThrow(function () { forEach(arr, setTimeout); }, 'setTimeout is a function'); - if (typeof window !== 'undefined') { - t.doesNotThrow(function () { forEach(arr, window.alert); }, 'alert is a function'); - } - t.end(); -}); - -test('array', function (t) { - var arr = [1, 2, 3]; - - t.test('iterates over every item', function (st) { - var index = 0; - forEach(arr, function () { index += 1; }); - st.equal(index, arr.length, 'iterates ' + arr.length + ' times'); - st.end(); - }); - - t.test('first iterator argument', function (st) { - var index = 0; - st.plan(arr.length); - forEach(arr, function (item) { - st.equal(arr[index], item, 'item ' + index + ' is passed as first argument'); - index += 1; - }); - st.end(); - }); - - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(arr.length); - forEach(arr, function (item, index) { - st.equal(counter, index, 'index ' + index + ' is passed as second argument'); - counter += 1; - }); - st.end(); - }); - - t.test('third iterator argument', function (st) { - st.plan(arr.length); - forEach(arr, function (item, index, array) { - st.deepEqual(arr, array, 'array is passed as third argument'); - }); - st.end(); - }); - - t.test('context argument', function (st) { - var context = {}; - forEach([], function () { - st.equal(this, context, '"this" is the passed context'); - }, context); - st.end(); - }); - - t.end(); -}); - -test('object', function (t) { - var obj = { - a: 1, - b: 2, - c: 3 - }; - var keys = ['a', 'b', 'c']; - - var F = function () { - this.a = 1; - this.b = 2; - }; - F.prototype.c = 3; - var fKeys = ['a', 'b']; - - t.test('iterates over every object literal key', function (st) { - var counter = 0; - forEach(obj, function () { counter += 1; }); - st.equal(counter, keys.length, 'iterated ' + counter + ' times'); - st.end(); - }); - - t.test('iterates only over own keys', function (st) { - var counter = 0; - forEach(new F(), function () { counter += 1; }); - st.equal(counter, fKeys.length, 'iterated ' + fKeys.length + ' times'); - st.end(); - }); - - t.test('first iterator argument', function (st) { - var index = 0; - st.plan(keys.length); - forEach(obj, function (item) { - st.equal(obj[keys[index]], item, 'item at key ' + keys[index] + ' is passed as first argument'); - index += 1; - }); - st.end(); - }); - - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(keys.length); - forEach(obj, function (item, key) { - st.equal(keys[counter], key, 'key ' + key + ' is passed as second argument'); - counter += 1; - }); - st.end(); - }); - - t.test('third iterator argument', function (st) { - st.plan(keys.length); - forEach(obj, function (item, key, object) { - st.deepEqual(obj, object, 'object is passed as third argument'); - }); - st.end(); - }); - - t.test('context argument', function (st) { - var context = {}; - forEach({}, function () { - st.equal(this, context, '"this" is the passed context'); - }, context); - st.end(); - }); - - t.end(); -}); - - -test('string', function (t) { - var str = 'str'; - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(str.length * 2 + 1); - forEach(str, function (item, index) { - st.equal(counter, index, 'index ' + index + ' is passed as second argument'); - st.equal(str.charAt(index), item); - counter += 1; - }); - st.equal(counter, str.length, 'iterates ' + str.length + ' times'); - }); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore deleted file mode 100644 index 48a2e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -components -build diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile deleted file mode 100644 index 3f6119d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -build: components index.js - @component build - -components: - @Component install - -clean: - rm -fr build components template.js - -.PHONY: clean diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md deleted file mode 100644 index 99c8dfc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ - -# indexOf - - Lame indexOf thing, thanks microsoft - -## Example - -```js -var index = require('indexof'); -index(arr, obj); -``` - -## License - - MIT \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json deleted file mode 100644 index e3430d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "indexof", - "description": "Microsoft sucks", - "version": "0.0.1", - "keywords": ["index", "array", "indexOf"], - "dependencies": {}, - "scripts": [ - "index.js" - ] -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js deleted file mode 100644 index 9d9667b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js +++ /dev/null @@ -1,10 +0,0 @@ - -var indexOf = [].indexOf; - -module.exports = function(arr, obj){ - if (indexOf) return arr.indexOf(obj); - for (var i = 0; i < arr.length; ++i) { - if (arr[i] === obj) return i; - } - return -1; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json deleted file mode 100644 index 72018b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "indexof", - "description": "Microsoft sucks", - "version": "0.0.1", - "keywords": [ - "index", - "array", - "indexOf" - ], - "dependencies": {}, - "component": { - "scripts": { - "indexof/index.js": "index.js" - } - }, - "readme": "\n# indexOf\n\n Lame indexOf thing, thanks microsoft\n\n## Example\n\n```js\nvar index = require('indexof');\nindex(arr, obj);\n```\n\n## License\n\n MIT", - "readmeFilename": "Readme.md", - "_id": "indexof@0.0.1", - "dist": { - "shasum": "505290cfca5bc41bb05cfe36a3a8b43bf5c6cb95" - }, - "_from": "indexof@~0.0.1", - "_resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md deleted file mode 100644 index b0b7e1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Enrico Marino - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md deleted file mode 100644 index 412a962..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# is - -The definitive JavaScript type testing library - -To be or not to be? This is the library! - -[![browser support][1]][2] - -## Installation - -As a node.js module - - $ npm install is - -As a component - - $ component install enricomarino/is - -## API - -### general - - - is.a (value, type) or is.type (value, type) - - is.defined (value) - - is.empty (value) - - is.equal (value, other) - - is.hosted (value, host) - - is.instance (value, constructor) - - is.instanceof (value, constructor) - deprecated, because in ES3 browsers, "instanceof" is a reserved word - - is.null (value) - deprecated, because in ES3 browsers, "null" is a reserved word - - is.undefined (value) - -### arguments - - - is.arguments (value) - - is.arguments.empty (value) - -### array - - - is.array (value) - - is.array.empty (value) - - is.arraylike (value) - -### boolean - - - is.boolean (value) - - is.false (value) - deprecated, because in ES3 browsers, "false" is a reserved word - - is.true (value) - deprecated, because in ES3 browsers, "true" is a reserved word - -### date - - - is.date (value) - -### element - - - is.element (value) - -### error - - - is.error (value) - -### function - - - is.fn(value) - - is.function(value) - deprecated, because in ES3 browsers, "function" is a reserved word - -### number - - - is.number (value) - - is.infinite (value) - - is.decimal (value) - - is.divisibleBy (value, n) - - is.int (value) - - is.maximum (value, others) - - is.minimum (value, others) - - is.nan (value) - - is.even (value) - - is.odd (value) - - is.ge (value, other) - - is.gt (value, other) - - is.le (value, other) - - is.lt (value, other) - - is.within (value, start, finish) - -### object - - - is.object (value) - -### regexp - - - is.regexp (value) - -### string - - - is.string (value) - - -## Contributors - -- [Jordan Harband](https://github.com/ljharb) - -## License - -(The MIT License) - -Copyright (c) 2013 Enrico Marino - -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. - -[1]: https://ci.testling.com/enricomarino/is.png -[2]: https://ci.testling.com/enricomarino/is - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json deleted file mode 100644 index 50f6cd9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "is", - "repo": "enricomarino/is", - "description": "The definitive type testing library", - "version": "0.2.0", - "dependencies": {}, - "scripts": ["index.js"] -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js deleted file mode 100644 index b14b0f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js +++ /dev/null @@ -1,702 +0,0 @@ - -/**! - * is - * the definitive JavaScript type testing library - * - * @copyright 2013 Enrico Marino - * @license MIT - */ - -var objProto = Object.prototype; -var owns = objProto.hasOwnProperty; -var toString = objProto.toString; -var isActualNaN = function (value) { - return value !== value; -}; -var NON_HOST_TYPES = { - "boolean": 1, - "number": 1, - "string": 1, - "undefined": 1 -}; - -/** - * Expose `is` - */ - -var is = module.exports = {}; - -/** - * Test general. - */ - -/** - * is.type - * Test if `value` is a type of `type`. - * - * @param {Mixed} value value to test - * @param {String} type type - * @return {Boolean} true if `value` is a type of `type`, false otherwise - * @api public - */ - -is.a = -is.type = function (value, type) { - return typeof value === type; -}; - -/** - * is.defined - * Test if `value` is defined. - * - * @param {Mixed} value value to test - * @return {Boolean} true if 'value' is defined, false otherwise - * @api public - */ - -is.defined = function (value) { - return value !== undefined; -}; - -/** - * is.empty - * Test if `value` is empty. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is empty, false otherwise - * @api public - */ - -is.empty = function (value) { - var type = toString.call(value); - var key; - - if ('[object Array]' === type || '[object Arguments]' === type) { - return value.length === 0; - } - - if ('[object Object]' === type) { - for (key in value) if (owns.call(value, key)) return false; - return true; - } - - if ('[object String]' === type) { - return '' === value; - } - - return false; -}; - -/** - * is.equal - * Test if `value` is equal to `other`. - * - * @param {Mixed} value value to test - * @param {Mixed} other value to compare with - * @return {Boolean} true if `value` is equal to `other`, false otherwise - */ - -is.equal = function (value, other) { - var type = toString.call(value) - var key; - - if (type !== toString.call(other)) { - return false; - } - - if ('[object Object]' === type) { - for (key in value) { - if (!is.equal(value[key], other[key])) { - return false; - } - } - return true; - } - - if ('[object Array]' === type) { - key = value.length; - if (key !== other.length) { - return false; - } - while (--key) { - if (!is.equal(value[key], other[key])) { - return false; - } - } - return true; - } - - if ('[object Function]' === type) { - return value.prototype === other.prototype; - } - - if ('[object Date]' === type) { - return value.getTime() === other.getTime(); - } - - return value === other; -}; - -/** - * is.hosted - * Test if `value` is hosted by `host`. - * - * @param {Mixed} value to test - * @param {Mixed} host host to test with - * @return {Boolean} true if `value` is hosted by `host`, false otherwise - * @api public - */ - -is.hosted = function (value, host) { - var type = typeof host[value]; - return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type]; -}; - -/** - * is.instance - * Test if `value` is an instance of `constructor`. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an instance of `constructor` - * @api public - */ - -is.instance = is['instanceof'] = function (value, constructor) { - return value instanceof constructor; -}; - -/** - * is.null - * Test if `value` is null. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is null, false otherwise - * @api public - */ - -is['null'] = function (value) { - return value === null; -}; - -/** - * is.undefined - * Test if `value` is undefined. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is undefined, false otherwise - * @api public - */ - -is.undefined = function (value) { - return value === undefined; -}; - -/** - * Test arguments. - */ - -/** - * is.arguments - * Test if `value` is an arguments object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an arguments object, false otherwise - * @api public - */ - -is.arguments = function (value) { - var isStandardArguments = '[object Arguments]' === toString.call(value); - var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee); - return isStandardArguments || isOldArguments; -}; - -/** - * Test array. - */ - -/** - * is.array - * Test if 'value' is an array. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an array, false otherwise - * @api public - */ - -is.array = function (value) { - return '[object Array]' === toString.call(value); -}; - -/** - * is.arguments.empty - * Test if `value` is an empty arguments object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an empty arguments object, false otherwise - * @api public - */ -is.arguments.empty = function (value) { - return is.arguments(value) && value.length === 0; -}; - -/** - * is.array.empty - * Test if `value` is an empty array. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an empty array, false otherwise - * @api public - */ -is.array.empty = function (value) { - return is.array(value) && value.length === 0; -}; - -/** - * is.arraylike - * Test if `value` is an arraylike object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an arguments object, false otherwise - * @api public - */ - -is.arraylike = function (value) { - return !!value && !is.boolean(value) - && owns.call(value, 'length') - && isFinite(value.length) - && is.number(value.length) - && value.length >= 0; -}; - -/** - * Test boolean. - */ - -/** - * is.boolean - * Test if `value` is a boolean. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a boolean, false otherwise - * @api public - */ - -is.boolean = function (value) { - return '[object Boolean]' === toString.call(value); -}; - -/** - * is.false - * Test if `value` is false. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is false, false otherwise - * @api public - */ - -is['false'] = function (value) { - return is.boolean(value) && (value === false || value.valueOf() === false); -}; - -/** - * is.true - * Test if `value` is true. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is true, false otherwise - * @api public - */ - -is['true'] = function (value) { - return is.boolean(value) && (value === true || value.valueOf() === true); -}; - -/** - * Test date. - */ - -/** - * is.date - * Test if `value` is a date. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a date, false otherwise - * @api public - */ - -is.date = function (value) { - return '[object Date]' === toString.call(value); -}; - -/** - * Test element. - */ - -/** - * is.element - * Test if `value` is an html element. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an HTML Element, false otherwise - * @api public - */ - -is.element = function (value) { - return value !== undefined - && typeof HTMLElement !== 'undefined' - && value instanceof HTMLElement - && value.nodeType === 1; -}; - -/** - * Test error. - */ - -/** - * is.error - * Test if `value` is an error object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an error object, false otherwise - * @api public - */ - -is.error = function (value) { - return '[object Error]' === toString.call(value); -}; - -/** - * Test function. - */ - -/** - * is.fn / is.function (deprecated) - * Test if `value` is a function. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a function, false otherwise - * @api public - */ - -is.fn = is['function'] = function (value) { - var isAlert = typeof window !== 'undefined' && value === window.alert; - return isAlert || '[object Function]' === toString.call(value); -}; - -/** - * Test number. - */ - -/** - * is.number - * Test if `value` is a number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a number, false otherwise - * @api public - */ - -is.number = function (value) { - return '[object Number]' === toString.call(value); -}; - -/** - * is.infinite - * Test if `value` is positive or negative infinity. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is positive or negative Infinity, false otherwise - * @api public - */ -is.infinite = function (value) { - return value === Infinity || value === -Infinity; -}; - -/** - * is.decimal - * Test if `value` is a decimal number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a decimal number, false otherwise - * @api public - */ - -is.decimal = function (value) { - return is.number(value) && !isActualNaN(value) && value % 1 !== 0; -}; - -/** - * is.divisibleBy - * Test if `value` is divisible by `n`. - * - * @param {Number} value value to test - * @param {Number} n dividend - * @return {Boolean} true if `value` is divisible by `n`, false otherwise - * @api public - */ - -is.divisibleBy = function (value, n) { - var isDividendInfinite = is.infinite(value); - var isDivisorInfinite = is.infinite(n); - var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0; - return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0); -}; - -/** - * is.int - * Test if `value` is an integer. - * - * @param value to test - * @return {Boolean} true if `value` is an integer, false otherwise - * @api public - */ - -is.int = function (value) { - return is.number(value) && !isActualNaN(value) && value % 1 === 0; -}; - -/** - * is.maximum - * Test if `value` is greater than 'others' values. - * - * @param {Number} value value to test - * @param {Array} others values to compare with - * @return {Boolean} true if `value` is greater than `others` values - * @api public - */ - -is.maximum = function (value, others) { - if (isActualNaN(value)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.arraylike(others)) { - throw new TypeError('second argument must be array-like'); - } - var len = others.length; - - while (--len >= 0) { - if (value < others[len]) { - return false; - } - } - - return true; -}; - -/** - * is.minimum - * Test if `value` is less than `others` values. - * - * @param {Number} value value to test - * @param {Array} others values to compare with - * @return {Boolean} true if `value` is less than `others` values - * @api public - */ - -is.minimum = function (value, others) { - if (isActualNaN(value)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.arraylike(others)) { - throw new TypeError('second argument must be array-like'); - } - var len = others.length; - - while (--len >= 0) { - if (value > others[len]) { - return false; - } - } - - return true; -}; - -/** - * is.nan - * Test if `value` is not a number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is not a number, false otherwise - * @api public - */ - -is.nan = function (value) { - return !is.number(value) || value !== value; -}; - -/** - * is.even - * Test if `value` is an even number. - * - * @param {Number} value value to test - * @return {Boolean} true if `value` is an even number, false otherwise - * @api public - */ - -is.even = function (value) { - return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0); -}; - -/** - * is.odd - * Test if `value` is an odd number. - * - * @param {Number} value value to test - * @return {Boolean} true if `value` is an odd number, false otherwise - * @api public - */ - -is.odd = function (value) { - return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0); -}; - -/** - * is.ge - * Test if `value` is greater than or equal to `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} - * @api public - */ - -is.ge = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value >= other; -}; - -/** - * is.gt - * Test if `value` is greater than `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} - * @api public - */ - -is.gt = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value > other; -}; - -/** - * is.le - * Test if `value` is less than or equal to `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} if 'value' is less than or equal to 'other' - * @api public - */ - -is.le = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value <= other; -}; - -/** - * is.lt - * Test if `value` is less than `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} if `value` is less than `other` - * @api public - */ - -is.lt = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value < other; -}; - -/** - * is.within - * Test if `value` is within `start` and `finish`. - * - * @param {Number} value value to test - * @param {Number} start lower bound - * @param {Number} finish upper bound - * @return {Boolean} true if 'value' is is within 'start' and 'finish' - * @api public - */ -is.within = function (value, start, finish) { - if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.number(value) || !is.number(start) || !is.number(finish)) { - throw new TypeError('all arguments must be numbers'); - } - var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish); - return isAnyInfinite || (value >= start && value <= finish); -}; - -/** - * Test object. - */ - -/** - * is.object - * Test if `value` is an object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an object, false otherwise - * @api public - */ - -is.object = function (value) { - return value && '[object Object]' === toString.call(value); -}; - -/** - * is.hash - * Test if `value` is a hash - a plain object literal. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a hash, false otherwise - * @api public - */ - -is.hash = function (value) { - return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval; -}; - -/** - * Test regexp. - */ - -/** - * is.regexp - * Test if `value` is a regular expression. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a regexp, false otherwise - * @api public - */ - -is.regexp = function (value) { - return '[object RegExp]' === toString.call(value); -}; - -/** - * Test string. - */ - -/** - * is.string - * Test if `value` is a string. - * - * @param {Mixed} value value to test - * @return {Boolean} true if 'value' is a string, false otherwise - * @api public - */ - -is.string = function (value) { - return '[object String]' === toString.call(value); -}; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json deleted file mode 100644 index 975d47a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "is", - "author": { - "name": "Enrico Marino", - "url": "http://onirame.com" - }, - "description": "the definitive JavaScript type testing library", - "homepage": "https://github.com/enricomarino/is", - "keywords": [ - "util", - "type", - "test" - ], - "contributors": [ - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "dependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/enricomarino/is.git" - }, - "main": "index.js", - "version": "0.2.6", - "scripts": { - "test": "node test/index.js" - }, - "devDependencies": { - "tape": "~1.0.1", - "foreach": "~2.0.3" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0", - "chrome/22.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/5.0.5..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "engines": { - "node": "*" - }, - "readme": "# is\n\nThe definitive JavaScript type testing library\n\nTo be or not to be? This is the library!\n\n[![browser support][1]][2]\n\n## Installation\n\nAs a node.js module\n\n $ npm install is\n\nAs a component\n\n $ component install enricomarino/is\n\n## API\n\n### general\n\n - is.a (value, type) or is.type (value, type)\n - is.defined (value)\n - is.empty (value)\n - is.equal (value, other)\n - is.hosted (value, host)\n - is.instance (value, constructor)\n - is.instanceof (value, constructor) - deprecated, because in ES3 browsers, \"instanceof\" is a reserved word\n - is.null (value) - deprecated, because in ES3 browsers, \"null\" is a reserved word\n - is.undefined (value)\n\n### arguments\n\n - is.arguments (value)\n - is.arguments.empty (value)\n\n### array\n\n - is.array (value)\n - is.array.empty (value)\n - is.arraylike (value)\n\n### boolean\n\n - is.boolean (value)\n - is.false (value) - deprecated, because in ES3 browsers, \"false\" is a reserved word\n - is.true (value) - deprecated, because in ES3 browsers, \"true\" is a reserved word\n\n### date\n\n - is.date (value)\n\n### element\n\n - is.element (value)\n\n### error\n\n - is.error (value)\n\n### function\n\n - is.fn(value)\n - is.function(value) - deprecated, because in ES3 browsers, \"function\" is a reserved word\n\n### number\n\n - is.number (value)\n - is.infinite (value)\n - is.decimal (value)\n - is.divisibleBy (value, n)\n - is.int (value)\n - is.maximum (value, others)\n - is.minimum (value, others)\n - is.nan (value)\n - is.even (value)\n - is.odd (value)\n - is.ge (value, other)\n - is.gt (value, other)\n - is.le (value, other)\n - is.lt (value, other)\n - is.within (value, start, finish)\n\n### object\n\n - is.object (value)\n\n### regexp\n\n - is.regexp (value)\n\n### string\n\n - is.string (value)\n\n\n## Contributors\n\n- [Jordan Harband](https://github.com/ljharb)\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2013 Enrico Marino\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.\n\n[1]: https://ci.testling.com/enricomarino/is.png\n[2]: https://ci.testling.com/enricomarino/is\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/enricomarino/is/issues" - }, - "_id": "is@0.2.6", - "dist": { - "shasum": "36681b7c4328a75a6dd4b6d8f7131e4f81de55c0" - }, - "_from": "is@~0.2.6", - "_resolved": "https://registry.npmjs.org/is/-/is-0.2.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js deleted file mode 100644 index 32e1430..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js +++ /dev/null @@ -1,481 +0,0 @@ -var test = require('tape'); -var is = require('../index.js'); - -var forEach = require('foreach'); -var now = Date.now || function () { return +new Date(); }; - -test('is.type', function (t) { - var booleans = [true, false]; - forEach(booleans, function (boolean) { - t.ok(is.type(boolean, 'boolean'), '"' + boolean + '" is a boolean'); - }); - - var numbers = [1, 0 / 1, 0 / -1, NaN, Infinity, -Infinity]; - forEach(numbers, function (number) { - t.ok(is.type(number, 'number'), '"' + number + '" is a number'); - }); - - var objects = [{}, null, new Date()]; - forEach(objects, function (object) { - t.ok(is.type(object, 'object'), '"' + object + '" is an object'); - }); - - var strings = ['', 'abc']; - forEach(strings, function (string) { - t.ok(is.type(string, 'string'), '"' + string + '" is a string'); - }); - - t.ok(is.type(undefined, 'undefined'), 'undefined is undefined'); - - t.end(); -}); - -test('is.undefined', function (t) { - t.ok(is.undefined(), 'undefined is undefined'); - t.notOk(is.undefined(null), 'null is not undefined'); - t.notOk(is.undefined({}), 'object is not undefined'); - t.end(); -}); - -test('is.defined', function (t) { - t.notOk(is.defined(), 'undefined is not defined'); - t.ok(is.defined(null), 'null is defined'); - t.ok(is.defined({}), 'object is undefined'); - t.end(); -}); - -test('is.empty', function (t) { - t.ok(is.empty(''), 'empty string is empty'); - t.ok(is.empty([]), 'empty array is empty'); - t.ok(is.empty({}), 'empty object is empty'); - (function () { t.ok(is.empty(arguments), 'empty arguments is empty'); }()); - t.end(); -}); - -test('is.equal', function (t) { - t.ok(is.equal([1, 2, 3], [1, 2, 3]), 'arrays are shallowly equal'); - t.ok(is.equal([1, 2, [3, 4]], [1, 2, [3, 4]]), 'arrays are deep equal'); - t.ok(is.equal({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 }), 'objects are shallowly equal'); - t.ok(is.equal({ a: { b: 1 } }, { a: { b: 1 } }), 'objects are deep equal'); - var nowTS = now(); - t.ok(is.equal(new Date(nowTS), new Date(nowTS)), 'two equal date objects are equal'); - - var F = function () {}; - F.prototype = {}; - t.ok(is.equal(new F(), new F()), 'two object instances are equal when the prototype is the same'); - t.end(); -}); - -test('is.hosted', function (t) { - t.ok(is.hosted('a', { a: {} }), 'object is hosted'); - t.ok(is.hosted('a', { a: [] }), 'array is hosted'); - t.ok(is.hosted('a', { a: function () {} }), 'function is hosted'); - t.notOk(is.hosted('a', { a: true }), 'boolean value is not hosted'); - t.notOk(is.hosted('a', { a: false }), 'boolean value is not hosted'); - t.notOk(is.hosted('a', { a: 3 }), 'number value is not hosted'); - t.notOk(is.hosted('a', { a: undefined }), 'undefined value is not hosted'); - t.notOk(is.hosted('a', { a: 'abc' }), 'string value is not hosted'); - t.notOk(is.hosted('a', { a: null }), 'null value is not hosted'); - t.end(); -}); - -test('is.instance', function (t) { - t.ok(is.instance(new Date(), Date), 'new Date is instanceof Date'); - var F = function () {}; - t.ok(is.instance(new F(), F), 'new constructor is instanceof constructor'); - t.end(); -}); - -test('is.null', function (t) { - var isNull = is['null']; - t.ok(isNull(null), 'null is null'); - t.notOk(isNull(undefined), 'undefined is not null'); - t.notOk(isNull({}), 'object is not null'); - t.end(); -}); - -test('is.arguments', function (t) { - t.notOk(is.arguments([]), 'array is not arguments'); - (function () { t.ok(is.arguments(arguments), 'arguments is arguments'); }()); - (function () { t.notOk(is.arguments(Array.prototype.slice.call(arguments)), 'sliced arguments is not arguments'); }()); - t.end(); -}); - -test('is.array', function (t) { - t.ok(is.array([]), 'array is array'); - (function () { t.ok(is.array(Array.prototype.slice.call(arguments)), 'sliced arguments is array'); }()); - t.end(); -}); - -test('is.array.empty', function (t) { - t.ok(is.array.empty([]), 'empty array is empty array'); - (function () { t.notOk(is.array.empty(arguments), 'empty arguments is not empty array'); }()); - (function () { t.ok(is.array.empty(Array.prototype.slice.call(arguments)), 'empty sliced arguments is empty array'); }()); - t.end(); -}); - -test('is.arguments.empty', function (t) { - t.notOk(is.arguments.empty([]), 'empty array is not empty arguments'); - (function () { t.ok(is.arguments.empty(arguments), 'empty arguments is empty arguments'); }()); - (function () { t.notOk(is.arguments.empty(Array.prototype.slice.call(arguments)), 'empty sliced arguments is not empty arguments'); }()); - t.end(); -}); - -test('is.isarraylike', function (t) { - t.notOk(is.arraylike(), 'undefined is not array-like'); - t.notOk(is.arraylike(null), 'null is not array-like'); - t.notOk(is.arraylike(false), 'false is not array-like'); - t.notOk(is.arraylike(true), 'true is not array-like'); - t.ok(is.arraylike({ length: 0 }), 'object with zero length is array-like'); - t.ok(is.arraylike({ length: 1 }), 'object with positive length is array-like'); - t.notOk(is.arraylike({ length: -1 }), 'object with negative length is not array-like'); - t.notOk(is.arraylike({ length: NaN }), 'object with NaN length is not array-like'); - t.notOk(is.arraylike({ length: 'foo' }), 'object with string length is not array-like'); - t.notOk(is.arraylike({ length: '' }), 'object with empty string length is not array-like'); - t.ok(is.arraylike([]), 'array is array-like'); - (function () { t.ok(is.arraylike(arguments), 'empty arguments is array-like'); }()); - (function () { t.ok(is.arraylike(arguments), 'nonempty arguments is array-like'); }(1, 2, 3)); - t.end(); -}); - -test('is.boolean', function (t) { - t.ok(is.boolean(true), 'literal true is a boolean'); - t.ok(is.boolean(false), 'literal false is a boolean'); - t.ok(is.boolean(new Boolean(true)), 'object true is a boolean'); - t.ok(is.boolean(new Boolean(false)), 'object false is a boolean'); - t.notOk(is.boolean(), 'undefined is not a boolean'); - t.notOk(is.boolean(null), 'null is not a boolean'); - t.end(); -}); - -test('is.false', function (t) { - var isFalse = is['false']; - t.ok(isFalse(false), 'false is false'); - t.ok(isFalse(new Boolean(false)), 'object false is false'); - t.notOk(isFalse(true), 'true is not false'); - t.notOk(isFalse(), 'undefined is not false'); - t.notOk(isFalse(null), 'null is not false'); - t.notOk(isFalse(''), 'empty string is not false'); - t.end(); -}); - -test('is.true', function (t) { - var isTrue = is['true']; - t.ok(isTrue(true), 'true is true'); - t.ok(isTrue(new Boolean(true)), 'object true is true'); - t.notOk(isTrue(false), 'false is not true'); - t.notOk(isTrue(), 'undefined is not true'); - t.notOk(isTrue(null), 'null is not true'); - t.notOk(isTrue(''), 'empty string is not true'); - t.end(); -}); - -test('is.date', function (t) { - t.ok(is.date(new Date()), 'new Date is date'); - t.notOk(is.date(), 'undefined is not date'); - t.notOk(is.date(null), 'null is not date'); - t.notOk(is.date(''), 'empty string is not date'); - t.notOk(is.date(now()), 'timestamp is not date'); - var F = function () {}; - F.prototype = new Date(); - t.notOk(is.date(new F()), 'Date subtype is not date'); - t.end(); -}); - -test('is.element', function (t) { - if (typeof HTMLElement !== 'undefined') { - var element = document.createElement('div'); - t.ok(is.element(element), 'HTMLElement is element'); - t.notOk(is.element({ nodeType: 1 }), 'object with nodeType is not element'); - } else { - t.ok(true, 'Skipping is.element test in a non-browser environment'); - } - t.end(); -}); - -test('is.error', function (t) { - var err = new Error('foo'); - t.ok(is.error(err), 'Error is error'); - t.notOk(is.error({}), 'object is not error'); - t.notOk(is.error({ toString: function () { return '[object Error]'; } }), 'object with error\'s toString is not error'); - t.end(); -}); - -test('is.fn', function (t) { - t.equal(is['function'], is.fn, 'alias works'); - t.ok(is.fn(function () {}), 'function is function'); - t.ok(is.fn(console.log), 'console.log is function'); - if (typeof window !== 'undefined') { - // in IE7/8, typeof alert === 'object' - t.ok(is.fn(window.alert), 'window.alert is function'); - } - t.notOk(is.fn({}), 'object is not function'); - t.notOk(is.fn(null), 'null is not function'); - t.end(); -}); - -test('is.number', function (t) { - t.ok(is.number(0), 'positive zero is number'); - t.ok(is.number(0 / -1), 'negative zero is number'); - t.ok(is.number(3), 'three is number'); - t.ok(is.number(NaN), 'NaN is number'); - t.ok(is.number(Infinity), 'infinity is number'); - t.ok(is.number(-Infinity), 'negative infinity is number'); - t.ok(is.number(new Number(42)), 'object number is number'); - t.notOk(is.number(), 'undefined is not number'); - t.notOk(is.number(null), 'null is not number'); - t.notOk(is.number(true), 'true is not number'); - t.end(); -}); - -test('is.infinite', function (t) { - t.ok(is.infinite(Infinity), 'positive infinity is infinite'); - t.ok(is.infinite(-Infinity), 'negative infinity is infinite'); - t.notOk(is.infinite(NaN), 'NaN is not infinite'); - t.notOk(is.infinite(0), 'a number is not infinite'); - t.end(); -}); - -test('is.decimal', function (t) { - t.ok(is.decimal(1.1), 'decimal is decimal'); - t.notOk(is.decimal(0), 'zero is not decimal'); - t.notOk(is.decimal(1), 'integer is not decimal'); - t.notOk(is.decimal(NaN), 'NaN is not decimal'); - t.end(); -}); - -test('is.divisibleBy', function (t) { - t.ok(is.divisibleBy(4, 2), '4 is divisible by 2'); - t.ok(is.divisibleBy(4, 2), '4 is divisible by 2'); - t.ok(is.divisibleBy(0, 1), '0 is divisible by 1'); - t.ok(is.divisibleBy(Infinity, 1), 'infinity is divisible by anything'); - t.ok(is.divisibleBy(1, Infinity), 'anything is divisible by infinity'); - t.ok(is.divisibleBy(Infinity, Infinity), 'infinity is divisible by infinity'); - t.notOk(is.divisibleBy(1, 0), '1 is not divisible by 0'); - t.notOk(is.divisibleBy(NaN, 1), 'NaN is not divisible by 1'); - t.notOk(is.divisibleBy(1, NaN), '1 is not divisible by NaN'); - t.notOk(is.divisibleBy(NaN, NaN), 'NaN is not divisible by NaN'); - t.notOk(is.divisibleBy(1, 3), '1 is not divisible by 3'); - t.end(); -}); - -test('is.int', function (t) { - t.ok(is.int(0), '0 is integer'); - t.ok(is.int(3), '3 is integer'); - t.notOk(is.int(1.1), '1.1 is not integer'); - t.notOk(is.int(NaN), 'NaN is not integer'); - t.notOk(is.int(Infinity), 'infinity is not integer'); - t.notOk(is.int(null), 'null is not integer'); - t.notOk(is.int(), 'undefined is not integer'); - t.end(); -}); - -test('is.maximum', function (t) { - t.ok(is.maximum(3, [3, 2, 1]), '3 is maximum of [3,2,1]'); - t.ok(is.maximum(3, [1, 2, 3]), '3 is maximum of [1,2,3]'); - t.ok(is.maximum(4, [1, 2, 3]), '4 is maximum of [1,2,3]'); - t.ok(is.maximum('c', ['a', 'b', 'c']), 'c is maximum of [a,b,c]'); - t.notOk(is.maximum(2, [1, 2, 3]), '2 is not maximum of [1,2,3]'); - var error = new TypeError('second argument must be array-like'); - t.throws(function () { return is.maximum(2, null); }, error, 'throws when second value is not array-like'); - t.throws(function () { return is.maximum(2, {}); }, error, 'throws when second value is not array-like'); - t.end(); -}); - -test('is.minimum', function (t) { - t.ok(is.minimum(1, [1, 2, 3]), '1 is minimum of [1,2,3]'); - t.ok(is.minimum(0, [1, 2, 3]), '0 is minimum of [1,2,3]'); - t.ok(is.minimum('a', ['a', 'b', 'c']), 'a is minimum of [a,b,c]'); - t.notOk(is.minimum(2, [1, 2, 3]), '2 is not minimum of [1,2,3]'); - var error = new TypeError('second argument must be array-like'); - t.throws(function () { return is.minimum(2, null); }, error, 'throws when second value is not array-like'); - t.throws(function () { return is.minimum(2, {}); }, error, 'throws when second value is not array-like'); - t.end(); -}); - -test('is.nan', function (t) { - t.ok(is.nan(NaN), 'NaN is not a number'); - t.ok(is.nan('abc'), 'string is not a number'); - t.ok(is.nan(true), 'boolean is not a number'); - t.ok(is.nan({}), 'object is not a number'); - t.ok(is.nan([]), 'array is not a number'); - t.ok(is.nan(function () {}), 'function is not a number'); - t.notOk(is.nan(0), 'zero is a number'); - t.notOk(is.nan(3), 'three is a number'); - t.notOk(is.nan(1.1), '1.1 is a number'); - t.notOk(is.nan(Infinity), 'infinity is a number'); - t.end(); -}); - -test('is.even', function (t) { - t.ok(is.even(0), 'zero is even'); - t.ok(is.even(2), 'two is even'); - t.ok(is.even(Infinity), 'infinity is even'); - t.notOk(is.even(1), '1 is not even'); - t.notOk(is.even(), 'undefined is not even'); - t.notOk(is.even(null), 'null is not even'); - t.notOk(is.even(NaN), 'NaN is not even'); - t.end(); -}); - -test('is.odd', function (t) { - t.ok(is.odd(1), 'zero is odd'); - t.ok(is.odd(3), 'two is odd'); - t.ok(is.odd(Infinity), 'infinity is odd'); - t.notOk(is.odd(0), '0 is not odd'); - t.notOk(is.odd(2), '2 is not odd'); - t.notOk(is.odd(), 'undefined is not odd'); - t.notOk(is.odd(null), 'null is not odd'); - t.notOk(is.odd(NaN), 'NaN is not odd'); - t.end(); -}); - -test('is.ge', function (t) { - t.ok(is.ge(3, 2), '3 is greater than 2'); - t.notOk(is.ge(2, 3), '2 is not greater than 3'); - t.ok(is.ge(3, 3), '3 is greater than or equal to 3'); - t.ok(is.ge('abc', 'a'), 'abc is greater than a'); - t.ok(is.ge('abc', 'abc'), 'abc is greater than or equal to abc'); - t.notOk(is.ge('a', 'abc'), 'a is not greater than abc'); - t.notOk(is.ge(Infinity, 0), 'infinity is not greater than anything'); - t.notOk(is.ge(0, Infinity), 'anything is not greater than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.ge(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.ge(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.gt', function (t) { - t.ok(is.gt(3, 2), '3 is greater than 2'); - t.notOk(is.gt(2, 3), '2 is not greater than 3'); - t.notOk(is.gt(3, 3), '3 is not greater than 3'); - t.ok(is.gt('abc', 'a'), 'abc is greater than a'); - t.notOk(is.gt('abc', 'abc'), 'abc is not greater than abc'); - t.notOk(is.gt('a', 'abc'), 'a is not greater than abc'); - t.notOk(is.gt(Infinity, 0), 'infinity is not greater than anything'); - t.notOk(is.gt(0, Infinity), 'anything is not greater than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.gt(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.gt(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.le', function (t) { - t.ok(is.le(2, 3), '2 is lesser than or equal to 3'); - t.notOk(is.le(3, 2), '3 is not lesser than or equal to 2'); - t.ok(is.le(3, 3), '3 is lesser than or equal to 3'); - t.ok(is.le('a', 'abc'), 'a is lesser than or equal to abc'); - t.ok(is.le('abc', 'abc'), 'abc is lesser than or equal to abc'); - t.notOk(is.le('abc', 'a'), 'abc is not lesser than or equal to a'); - t.notOk(is.le(Infinity, 0), 'infinity is not lesser than or equal to anything'); - t.notOk(is.le(0, Infinity), 'anything is not lesser than or equal to infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.le(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.le(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.lt', function (t) { - t.ok(is.lt(2, 3), '2 is lesser than 3'); - t.notOk(is.lt(3, 2), '3 is not lesser than 2'); - t.notOk(is.lt(3, 3), '3 is not lesser than 3'); - t.ok(is.lt('a', 'abc'), 'a is lesser than abc'); - t.notOk(is.lt('abc', 'abc'), 'abc is not lesser than abc'); - t.notOk(is.lt('abc', 'a'), 'abc is not lesser than a'); - t.notOk(is.lt(Infinity, 0), 'infinity is not lesser than anything'); - t.notOk(is.lt(0, Infinity), 'anything is not lesser than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.lt(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.lt(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.within', function (t) { - var nanError = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.within(NaN, 0, 0); }, nanError, 'throws when first value is NaN'); - t.throws(function () { return is.within(0, NaN, 0); }, nanError, 'throws when second value is NaN'); - t.throws(function () { return is.within(0, 0, NaN); }, nanError, 'throws when third value is NaN'); - - var error = new TypeError('all arguments must be numbers'); - t.throws(function () { return is.within('', 0, 0); }, error, 'throws when first value is string'); - t.throws(function () { return is.within(0, '', 0); }, error, 'throws when second value is string'); - t.throws(function () { return is.within(0, 0, ''); }, error, 'throws when third value is string'); - t.throws(function () { return is.within({}, 0, 0); }, error, 'throws when first value is object'); - t.throws(function () { return is.within(0, {}, 0); }, error, 'throws when second value is object'); - t.throws(function () { return is.within(0, 0, {}); }, error, 'throws when third value is object'); - t.throws(function () { return is.within(null, 0, 0); }, error, 'throws when first value is null'); - t.throws(function () { return is.within(0, null, 0); }, error, 'throws when second value is null'); - t.throws(function () { return is.within(0, 0, null); }, error, 'throws when third value is null'); - t.throws(function () { return is.within(undefined, 0, 0); }, error, 'throws when first value is undefined'); - t.throws(function () { return is.within(0, undefined, 0); }, error, 'throws when second value is undefined'); - t.throws(function () { return is.within(0, 0, undefined); }, error, 'throws when third value is undefined'); - - t.ok(is.within(2, 1, 3), '2 is between 1 and 3'); - t.ok(is.within(0, -1, 1), '0 is between -1 and 1'); - t.ok(is.within(2, 0, Infinity), 'infinity always returns true'); - t.ok(is.within(2, Infinity, 2), 'infinity always returns true'); - t.ok(is.within(Infinity, 0, 1), 'infinity always returns true'); - t.notOk(is.within(2, -1, -1), '2 is not between -1 and 1'); - t.end(); -}); - -test('is.object', function (t) { - t.ok(is.object({}), 'object literal is object'); - t.notOk(is.object(), 'undefined is not an object'); - t.notOk(is.object(null), 'null is not an object'); - t.notOk(is.object(true), 'true is not an object'); - t.notOk(is.object(''), 'string is not an object'); - t.notOk(is.object(NaN), 'NaN is not an object'); - t.notOk(is.object(Object), 'object constructor is not an object'); - t.notOk(is.object(function () {}), 'function is not an object'); - t.end(); -}); - -test('is.hash', function (t) { - t.ok(is.hash({}), 'empty object literal is hash'); - t.ok(is.hash({ 1: 2, a: "b" }), 'object literal is hash'); - t.notOk(is.hash(), 'undefined is not a hash'); - t.notOk(is.hash(null), 'null is not a hash'); - t.notOk(is.hash(new Date()), 'date is not a hash'); - t.notOk(is.hash(new String()), 'string object is not a hash'); - t.notOk(is.hash(''), 'string literal is not a hash'); - t.notOk(is.hash(new Number()), 'number object is not a hash'); - t.notOk(is.hash(1), 'number literal is not a hash'); - t.notOk(is.hash(true), 'true is not a hash'); - t.notOk(is.hash(false), 'false is not a hash'); - t.notOk(is.hash(new Boolean()), 'boolean obj is not hash'); - t.notOk(is.hash(false), 'literal false is not hash'); - t.notOk(is.hash(true), 'literal true is not hash'); - if (typeof module !== 'undefined') { - t.ok(is.hash(module.exports), 'module.exports is a hash'); - } - if (typeof window !== 'undefined') { - t.notOk(is.hash(window), 'window is not a hash'); - t.notOk(is.hash(document.createElement('div')), 'element is not a hash'); - } else if (typeof process !== 'undefined') { - t.notOk(is.hash(global), 'global is not a hash'); - t.notOk(is.hash(process), 'process is not a hash'); - } - t.end(); -}); - -test('is.regexp', function (t) { - t.ok(is.regexp(/a/g), 'regex literal is regex'); - t.ok(is.regexp(new RegExp('a', 'g')), 'regex object is regex'); - t.notOk(is.regexp(), 'undefined is not regex'); - t.notOk(is.regexp(function () {}), 'function is not regex'); - t.notOk(is.regexp('/a/g'), 'string regex is not regex'); - t.end(); -}); - -test('is.string', function (t) { - t.ok(is.string('foo'), 'string literal is string'); - t.ok(is.string(new String('foo')), 'string literal is string'); - t.notOk(is.string(), 'undefined is not string'); - t.notOk(is.string(String), 'string constructor is not string'); - var F = function () {}; - F.prototype = new String(); - t.notOk(is.string(F), 'string subtype is not string'); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json deleted file mode 100644 index 4cb38a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "object-keys", - "version": "0.2.0", - "author": { - "name": "Jordan Harband" - }, - "description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/kriskowal/es5-shim", - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/object-keys.git" - }, - "keywords": [ - "Object.keys", - "keys", - "ES5", - "shim" - ], - "dependencies": { - "foreach": "~2.0.1", - "indexof": "~0.0.1", - "is": "~0.2.6" - }, - "devDependencies": { - "tape": "~1.0.2" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "readme": "#object-keys [![Version Badge][2]][1]\n\n[![Build Status][3]][4] [![dependency status][5]][6]\n\n[![browser support][7]][8]\n\nAn Object.keys shim. Uses Object.keys if available.\n\n## Example\n\n```js\nvar keys = require('object-keys');\nvar assert = require('assert');\nvar obj = {\n\ta: true,\n\tb: true,\n\tc: true\n};\n\nassert.equal(keys(obj), ['a', 'b', 'c']);\n```\n\n## Source\nImplementation taken directly from [9]\n\n## Tests\nTests currently use tape - which doesn't work in node 0.10, but works in browserify. Rest assured, they pass.\n\n[1]: https://npmjs.org/package/object-keys\n[2]: http://vb.teelaun.ch/ljharb/object-keys.svg\n[3]: https://travis-ci.org/ljharb/object-keys.png\n[4]: https://travis-ci.org/ljharb/object-keys\n[5]: https://david-dm.org/ljharb/object-keys.png\n[6]: https://david-dm.org/ljharb/object-keys\n[7]: https://ci.testling.com/ljharb/object-keys.png\n[8]: https://ci.testling.com/ljharb/object-keys\n[9]: https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js#L542-589\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/ljharb/object-keys/issues" - }, - "_id": "object-keys@0.2.0", - "dist": { - "shasum": "cddec02998b091be42bf1035ae32e49f1cb6ea67" - }, - "deprecated": "Please update to the latest object-keys", - "_from": "object-keys@~0.2.0", - "_resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.2.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js deleted file mode 100644 index 0d13f4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js +++ /dev/null @@ -1,44 +0,0 @@ -(function () { - "use strict"; - - // modified from https://github.com/kriskowal/es5-shim - var has = Object.prototype.hasOwnProperty, - is = require('is'), - forEach = require('foreach'), - hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString'), - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ], - keysShim; - - keysShim = function keys(object) { - if (!is.object(object) && !is.array(object)) { - throw new TypeError("Object.keys called on a non-object"); - } - - var name, theKeys = []; - for (name in object) { - if (has.call(object, name)) { - theKeys.push(name); - } - } - - if (hasDontEnumBug) { - forEach(dontEnums, function (dontEnum) { - if (has.call(object, dontEnum)) { - theKeys.push(dontEnum); - } - }); - } - return theKeys; - }; - - module.exports = keysShim; -}()); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js deleted file mode 100644 index 6673701..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js +++ /dev/null @@ -1,88 +0,0 @@ -var test = require('tape'); -var shimmedKeys = require('./index.js'); -var is = require('is'); -var keys = require('./shim.js'); -var forEach = require('foreach'); -var indexOf = require('indexof'); - -test('works', function (t) { - var obj = { - "str": "boz", - "obj": {}, - "arr": [], - "bool": true, - "num": 42, - "aNull": null, - "undef": undefined - }; - var objKeys = ['str', 'obj', 'arr', 'bool', 'num', 'aNull', 'undef']; - - t.test('exports a function', function (st) { - if (Object.keys) { - st.equal(Object.keys, shimmedKeys, 'Object.keys is supported and exported'); - } else { - st.equal(keys, shimmedKeys, 'Object.keys is not supported; shim is exported'); - } - st.end(); - }); - - t.test('working with actual shim', function (st) { - st.notEqual(Object.keys, keys, 'keys shim is not native Object.keys'); - st.end(); - }); - - t.test('works with an object literal', function (st) { - var theKeys = keys(obj); - st.equal(is.array(theKeys), true, 'returns an array'); - st.deepEqual(theKeys, objKeys, 'Object has expected keys'); - st.end(); - }); - - t.test('works with an array', function (st) { - var arr = [1, 2, 3]; - var theKeys = keys(arr); - st.equal(is.array(theKeys), true, 'returns an array'); - st.deepEqual(theKeys, ['0', '1', '2'], 'Array has expected keys'); - st.end(); - }); - - t.test('returns names which are own properties', function (st) { - forEach(keys(obj), function (name) { - st.equal(obj.hasOwnProperty(name), true, name + ' should be returned'); - }); - st.end(); - }); - - t.test('returns names which are enumerable', function (st) { - var k, loopedValues = []; - for (k in obj) { - loopedValues.push(k); - } - forEach(keys(obj), function (name) { - st.notEqual(indexOf(loopedValues, name), -1, name + ' is not enumerable'); - }); - st.end(); - }); - - t.test('throws an error for a non-object', function (st) { - st.throws( - function () { return keys(42); }, - new TypeError('Object.keys called on a non-object'), - 'throws on a non-object' - ); - st.end(); - }); - t.end(); -}); - -test('works with an object instance', function (t) { - var Prototype = function () {}; - Prototype.prototype.foo = true; - var obj = new Prototype(); - obj.bar = true; - var theKeys = keys(obj); - t.equal(is.array(theKeys), true, 'returns an array'); - t.deepEqual(theKeys, ['bar'], 'Instance has expected keys'); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json deleted file mode 100644 index 6552b71..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "xtend", - "version": "2.0.6", - "description": "extend like a boss", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "main": "index", - "scripts": { - "test": "node test" - }, - "dependencies": { - "is-object": "~0.1.2", - "object-keys": "~0.2.0" - }, - "devDependencies": { - "tape": "~1.0.2" - }, - "homepage": "https://github.com/Raynos/xtend", - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/raynos/xtend/raw/master/LICENSE" - } - ], - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "engines": { - "node": ">=0.4" - }, - "readme": "# xtend\n\n[![browser support][3]][4]\n\nExtend like a boss\n\nxtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes presedence.\n\n## Examples\n\n```js\nvar extend = require(\"xtend\")\n\nvar combination = extend({\n a: \"a\"\n}, {\n b: \"b\"\n})\n// { a: \"a\", b: \"b\" }\n```\n\n\n## MIT Licenced\n\n\n [3]: http://ci.testling.com/Raynos/xtend.png\n [4]: http://ci.testling.com/Raynos/xtend\n", - "readmeFilename": "README.md", - "_id": "xtend@2.0.6", - "dist": { - "shasum": "0b24228c06a6e7adf36447626c37ae73f8ae7f23" - }, - "_from": "xtend@~2.0.6", - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-2.0.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js deleted file mode 100644 index 3369d79..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js +++ /dev/null @@ -1,63 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json deleted file mode 100644 index 1277837..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "through2", - "version": "0.1.0", - "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", - "main": "through2.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/rvagg/through2.git" - }, - "keywords": [ - "stream", - "streams2", - "through", - "transform" - ], - "author": { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.2", - "xtend": "~2.0.6" - }, - "devDependencies": { - "tape": "~1.0.4", - "bl": "~0.2.0", - "stream-spigot": "~2.0.0" - }, - "readme": "# through2\n\n[![Build Status](https://secure.travis-ci.org/rvagg/through2.png)](http://travis-ci.org/rvagg/through2)\n\n[![NPM](https://nodei.co/npm/through2.png?compact=true)](https://nodei.co/npm/through2/) \n\n**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise**\n\nInspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.\n\n```js\nfs.createReadStream('ex.txt')\n .pipe(through2(function (chunk, enc, callback) {\n for (var i = 0; i < chunk.length; i++)\n if (chunk[i] == 97)\n chunk[i] = 122 // swap 'a' for 'z'\n this.push(chunk)\n callback()\n }))\n .pipe(fs.createWriteStream('out.txt'))\n```\n\nOr object streams:\n\n```js\nvar all = []\nfs.createReadStream('data.csv')\n .pipe(csv2())\n .pipe(through2({ objectMode: true }, function (chunk, enc, callback) {\n \tvar data = {\n name : chunk[0]\n , address : chunk[3]\n , phone : chunk[10]\n }\n this.push(data)\n callback()\n }))\n .on('data', function (data) {\n all.push(data)\n })\n .on('end', function () {\n doSomethingSpecial(all)\n })\n```\n\n## API\n\nthrough2([ options, ] transformFunction[, flushFunction ])\n\nConsult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).\n\n### options\n\nThe options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams.\n\nThe `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:\n\n```js\nfs.createReadStream('/tmp/important.dat')\n\t.pipe(through2({ objectMode: true, allowHalfOpen: false }, function (chunk, enc, cb) {\n\t\tthis.push(new Buffer('wut?'))\n \tcb()\n\t})\n .pipe(fs.createWriteStream('/tmp/wut.txt'))\n```\n\n### transformFunction\n\nThe `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.\n\nTo queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on.\n\n### flushFunction\n\nThe optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.\n\nthrough2.ctor([ options, ] transformFunction[, flushFunction ])\n\nInstead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.\n\n```js\nvar FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {\n if (record.temp != null && record.unit = \"F\") {\n record.temp = ( ( record.temp - 32 ) * 5 ) / 9\n record.unit = \"C\"\n }\n this.push(record)\n callback()\n})\n\n// Create instances of FToC like so:\nvar converter = new FToC()\n// Or:\nvar converter = FToC()\n// Or specify/override options when you instantiate, if you prefer:\nvar converter = FToC({objectMode: true})\n\n```\n\n## License\n\n**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/rvagg/through2/issues" - }, - "_id": "through2@0.1.0", - "dist": { - "shasum": "18d0402eec882cf582ca4945ffbe7f205e7a9bc5" - }, - "_from": "through2@~0.1.0", - "_resolved": "https://registry.npmjs.org/through2/-/through2-0.1.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js deleted file mode 100644 index 13a328f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js +++ /dev/null @@ -1,314 +0,0 @@ -const test = require('tape') - , through2 = require('./') - , crypto = require('crypto') - , bl = require('bl') - , spigot = require('stream-spigot') - -test('plain through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('pipeable through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - // bl() acts like a proper streams2 stream and passes as much as it's - // asked for, so we really only get one write with such a small amount - // of data - t.equal(s, 'aaaaaaaaaaaaaaaaaaaaaaaaa', 'got transformed string') - t.end() - })) - - var bufs = bl() - bufs.append(crypto.randomBytes(10)) - bufs.append(crypto.randomBytes(5)) - bufs.append(crypto.randomBytes(10)) - bufs.pipe(th2) -}) - -test('object through', function (t) { - t.plan(3) - - var th2 = through2({ objectMode: true}, function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('flushing through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }, function (callback) { - this.push(new Buffer([ 101, 110, 100 ])) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal(s, 'aaaaaaaaaabbbbbccccccccccend', 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('plain through ctor', function (t) { - var Th2 = through2.ctor(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - var th2 = new Th2() - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('reuse through ctor', function (t) { - t.plan(4) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - if (!this._i) { - t.ok(1, 'did not contain previous instance data (this._i)') - this._i = 97 // 'a' - } else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - var th2 = Th2() - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - - var newInstance = Th2() - newInstance.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaabbbbccccccc', s, 'got transformed string') - })) - - newInstance.write(crypto.randomBytes(7)) - newInstance.write(crypto.randomBytes(4)) - newInstance.write(crypto.randomBytes(7)) - newInstance.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('object through ctor', function (t) { - t.plan(3) - - var Th2 = through2.ctor({ objectMode: true}, function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = new Th2() - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('pipeable object through ctor', function (t) { - t.plan(4) - - var Th2 = through2.ctor({ objectMode: true}, function (record, enc, callback) { - if (record.temp != null && record.unit == 'F') { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = 'C' - } - this.push(record) - callback() - }) - - var th2 = Th2() - - var expect = [-19, -40, 100, 22] - th2.on('data', function (o) { - t.deepEqual(o, { temp: expect.shift(), unit: 'C' }, 'got transformed object') - }) - - spigot([ - {temp: -2.2, unit: 'F'}, - {temp: -40, unit: 'F'}, - {temp: 212, unit: 'F'}, - {temp: 22, unit: 'C'} - ], {objectMode: true}).pipe(th2) -}) - -test('object through ctor override', function (t) { - t.plan(3) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({objectMode: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object settings available in transform', function (t) { - t.plan(6) - - var Th2 = through2.ctor({objectMode: true, peek: true}, function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2() - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object settings available in transform override', function (t) { - t.plan(6) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({objectMode: true, peek: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object override extends options', function (t) { - t.plan(6) - - var Th2 = through2.ctor({objectMode: true}, function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({peek: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js deleted file mode 100644 index c1d1329..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js +++ /dev/null @@ -1,35 +0,0 @@ -const Transform = require('stream').Transform || require('readable-stream/transform') - , inherits = require('util').inherits - , xtend = require('xtend') - -function ctor (options, transform, flush) { - if (typeof options == 'function') { - flush = transform - transform = options - options = {} - } - - function Through2 (override) { - if (!(this instanceof Through2)) - return new Through2(override) - - this.options = xtend(options, override) - Transform.call(this, this.options) - } - - inherits(Through2, Transform) - - Through2.prototype._transform = transform - - if (typeof flush == 'function') - Through2.prototype._flush = flush - - return Through2 -} - -function make (options, transform, flush) { - return ctor(options, transform, flush)() -} - -module.exports = make -module.exports.ctor = ctor \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/package.json deleted file mode 100644 index c86ddfb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "download", - "version": "0.1.7", - "description": "Download and extract files effortlessly", - "keywords": [ - "url", - "http", - "download", - "extract" - ], - "homepage": "https://github.com/kevva/download", - "bugs": { - "url": "https://github.com/kevva/download/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/download.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "download.js", - "files": [ - "download.js" - ], - "dependencies": { - "decompress": "~0.1.0", - "mkdirp": "~0.3.5", - "request": "~2.25.0", - "through2": "~0.1.0", - "async-foreach": "~0.1.3" - }, - "devDependencies": { - "mocha": "~1.12.0", - "rimraf": "~2.2.2" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# download [![Build Status](https://secure.travis-ci.org/kevva/download.png?branch=master)](http://travis-ci.org/kevva/download)\n\nDownload and extract files effortlessly in Node.js.\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/download): `npm install download`\n\n## Examples\n\nIf you're fetching an archive you can set `extract: true` in options and \nit'll extract it for you.\n\n```js\nvar download = require('download');\n\n// download and extract `foo.tar.gz` into `bar/`\ndownload('foo.tar.gz', 'bar', { extract: true });\n\n// download and save `foo.exe` into `bar/foo.exe` with mode `0755`\ndownload('foo.exe', 'bar', { mode: '0755' });\n\n// download and save an array of files in `bar/`\nvar files = ['foo.jpg', 'bar.jpg', 'cat.jpg'];\ndownload(files, 'bar');\n```\n\n## API\n\n### download(url, dest, opts)\n\nDownload a file or an array of files to a given destination.\n\n## Options\n\n* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/)\n* `mode` — Set mode on the downloaded files\n* `strip` — Equivalent to `--strip-components` for tar\n\nYou can also define options accepted by the [request](https://github.com/mikeal/request/) module.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "download@0.1.7", - "dist": { - "shasum": "78be2278a5600e515eff6b01cbf41d694baee855" - }, - "_from": "download@~0.1.2", - "_resolved": "https://registry.npmjs.org/download/-/download-0.1.7.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/.npmignore deleted file mode 100644 index 2ccbe46..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/.travis.yml deleted file mode 100644 index c1ffcb3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/History.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/History.md deleted file mode 100644 index d1fa533..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/History.md +++ /dev/null @@ -1,20 +0,0 @@ - -0.0.2 / 2013-05-29 -================== - - * Updated github url - * Fix bug calling isbin with list of paths - * Add tests for sync version - * Added travis CI passing image to readme - * Added node engines and keywords - * Added travis CI config - * Added basic readme - * Added basic test suite and Makefile - * Add async version - * Some refactorings using 'some' function - * Fixed issue with wrong paths if called multiple times - -0.0.1 / 2012-12-06 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/Makefile deleted file mode 100644 index 1a2444a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -REPORTER ?= dot - -test: - @NODE_ENV=test ./node_modules/mocha/bin/mocha -R $(REPORTER) - -.PHONY: test diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/README.md deleted file mode 100644 index 5224d61..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/README.md +++ /dev/null @@ -1,59 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/mbehrendt/isbin.png?branch=master)](https://travis-ci.org/mbehrendt/isbin) - -# Isbin - -Tiny little helper library to determine if a certain binary is available within $PATH or any additional folder. - -# Installation - -```bash -$ npm install isbin -``` - -# Usage - -```js -var isbin = require('isbin'); - -// Test against $PATH -isbin('mysql', function(exists) { - console.log(exists); // ==> Boolean -}); - -// With additional path to test -isbin('mysql', '/usr/local/bin', function(exists) { - console.log(exists); // ==> Boolean -}); - -// Or multiple ones -isbin('mysql', ['/usr/local/bin', '/home/me/bins'], function(exists) { - console.log(exists); // ==> Boolean -}); -``` - -There are also synchronous versions available - -```js -var exists = isbin('mysql'); -var exists = isbin('mysql', '/usr/local/bin'); -var exists = isbin('mysql', ['/usr/local/bin', '/home/me/bins']); -``` - -# Running the tests - -```bash -$ npm install -$ make test -``` - -# License - -(The MIT License) - -Copyright (c) 2012 Mario Behrendt info@mario-behrendt.de, Stephan Hoyer - -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/index.js deleted file mode 100644 index bb0a047..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/lib/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/lib/index.js deleted file mode 100644 index 1b8a5ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/lib/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Require dependencies - */ - -var fs = require('fs') - , async = require('async'); - -/** - * Check if given binary exists - * - * @param {String} bin Binary to test - * @param {String|Array} additional Additional paths to check - * @param {Function(result)} isbinChecked Callback when check is done async, optional - * @return {Boolean} True if binary was found - */ - -function isbin(bin, additional, isbinChecked) { - // isbin(bin, cb) - if (!isbinChecked) isbinChecked = additional; - - // Read $PATH to get set up bin folders - var paths = process.env.PATH.split(':') || []; - - // isbin(bin, 'path', cb) - if ('string' === typeof additional) { - paths.push(additional); - } - - // isbin(bin, ['path1', 'path2'], cb) - if ('object' === typeof additional && additional.length !== null) { - paths.concat(additional); - } - - // async check - if ('function' === typeof isbinChecked) { - return async.some(paths, function(path, pathChecked) { - fs.exists(path + '/' + bin, pathChecked); - }, isbinChecked); - } - - // sync check - return paths.reverse().some(function(path) { - return fs.existsSync(path + '/' + bin); - }); -}; - -/** - * Expose module - */ - -module.exports = isbin; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules deleted file mode 100644 index a9aae98..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "deps/nodeunit"] - path = deps/nodeunit - url = git://github.com/caolan/nodeunit.git -[submodule "deps/UglifyJS"] - path = deps/UglifyJS - url = https://github.com/mishoo/UglifyJS.git -[submodule "deps/nodelint"] - path = deps/nodelint - url = https://github.com/tav/nodelint.git diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -deps -dist -test -nodelint.cfg \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile deleted file mode 100644 index bad647c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -PACKAGE = asyncjs -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) -CWD := $(shell pwd) -NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit -UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs -NODELINT = $(CWD)/node_modules/nodelint/nodelint - -BUILDDIR = dist - -all: clean test build - -build: $(wildcard lib/*.js) - mkdir -p $(BUILDDIR) - $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js - -test: - $(NODEUNIT) test - -clean: - rm -rf $(BUILDDIR) - -lint: - $(NODELINT) --config nodelint.cfg lib/async.js - -.PHONY: test build all diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md deleted file mode 100644 index 1bbbc47..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md +++ /dev/null @@ -1,1021 +0,0 @@ -# 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. - -Async provides around 20 functions that include the usual 'functional' -suspects (map, reduce, filter, forEach…) 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 - - 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'], path.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. - - -## Download - -Releases are available for download from -[GitHub](http://github.com/caolan/async/downloads). -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) - 17.5kb Uncompressed - -__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped - - -## In the Browser - -So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: - - - - - -## Documentation - -### Collections - -* [forEach](#forEach) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [until](#until) -* [waterfall](#waterfall) -* [queue](#queue) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - -
        -### forEach(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 forEach 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 which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // assuming openFiles is an array of file names and saveFile is a function - // to save the modified contents of that file: - - async.forEach(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error - }); - ---------------------------------------- - - -### forEachSeries(arr, iterator, callback) - -The same as forEach 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. - - ---------------------------------------- - - -### forEachLimit(arr, limit, iterator, callback) - -The same as forEach only the iterator is applied to batches of items in the -array, in series. The next batch of iterators is only called once the current -one has completed processing. - -__Arguments__ - -* arr - An array to iterate over. -* limit - How many items should be in each batch. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // Assume documents is an array of JSON objects and requestApi is a - // function that interacts with a rate-limited REST api. - - async.forEachLimit(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 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__ - - 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. - - ---------------------------------------- - - -### 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 path.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 which must be called once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - - async.filter(['file1','file2','file3'], path.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 filter, 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 its 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 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__ - - 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 which must be called 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__ - - async.detect(['file1','file2','file3'], path.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 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__ - - 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 path.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 which must be called 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__ - - async.some(['file1','file2','file3'], path.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 path.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 which must be called 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__ - - async.every(['file1','file2','file3'], path.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 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__ - - 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 it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - 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 it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - 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} - }); - - ---------------------------------------- - - -### 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 which must be called once it has completed with an optional - error as the first argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - - var count = 0; - - async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } - ); - - ---------------------------------------- - - -### 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. - - ---------------------------------------- - - -### 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 it - must call on completion. -* 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__ - - 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' - }); - - ---------------------------------------- - - -### 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. -* 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. -* 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__ - - // 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'); - }); - - ---------------------------------------- - - -### 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. - -__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 - syntax is easier to understand by looking at the example. -* 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. If all tasks complete - successfully, it will receive an object containing their results. - -__Example__ - - 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: - - 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(results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - email_link: 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. Its 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, each function is passed a callback it - must call on completion. - -__Example__ - - 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__ - - // 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: - - 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 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__ - - var call_order = []; - async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two] - }); - call_order.push('one') - - -## 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. - -__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__ - - 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__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); - }; - - 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__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); - }; - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js deleted file mode 100644 index 8e23845..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// This file is just added for convenience so this repository can be -// directly checked out into a project's deps folder -module.exports = require('./lib/async'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js deleted file mode 100644 index 7cc4f5e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js +++ /dev/null @@ -1,692 +0,0 @@ -/*global setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root = this, - previous_async = root.async; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - else { - root.async = async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - //// cross-browser compatiblity functions //// - - var _forEach = 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 = []; - _forEach(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); - } - _forEach(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)) { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - } - else { - async.nextTick = process.nextTick; - } - - async.forEach = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _forEach(arr, function (x) { - iterator(x, function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - } - }); - }); - }; - - async.forEachSeries = 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.forEachLimit = function (arr, limit, 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.forEach].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEachSeries].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); - - - // 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.forEachSeries(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.forEach(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.forEach(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 () { - _forEach(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _forEach(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - if (err) { - callback(err); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - 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.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback(err); - 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.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - async.parallel = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.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 = {}; - async.forEach(_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.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.forEachSeries(_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.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.queue = function (worker, concurrency) { - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _forEach(data, function(task) { - q.tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (q.saturated && q.tasks.length == concurrency) { - q.saturated(); - } - async.nextTick(q.process); - }); - }, - 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; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if(q.drain && q.tasks.length + workers == 0) q.drain(); - q.process(); - }); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - 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]) { - _forEach(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.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - -}()); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json deleted file mode 100644 index 5e515b9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./index", - "author": { - "name": "Caolan McMahon" - }, - "version": "0.1.22", - "repository": { - "type": "git", - "url": "http://github.com/caolan/async.git" - }, - "bugs": { - "url": "http://github.com/caolan/async/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\n ]);\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n \n \n\n\n## Documentation\n\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\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### forEach(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 forEach 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 which must be called once it has completed.\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 // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach 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### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\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 // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\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 which must be called once it has completed\n 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 async.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### 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### 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 path.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 which must be called 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 async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\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 filter, 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 its 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 which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n 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 async.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### 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 which must be called 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 async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\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 which must be called once it has completed\n with an error (which can be null) and a value to use as the sort 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 async.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 path.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 which must be called 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 async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\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 path.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 which must be called 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 async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\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 which must be called once it has completed\n 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 async.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### 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 it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.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\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.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 },\n function(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 a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.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\n function(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\n async.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 },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\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 which must be called once it has completed with an optional\n error as the first 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 var count = 0;\n\n async.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### 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\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 callback it\n must call on completion.\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 async.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\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.\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* 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 // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n\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\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 syntax is easier to understand by looking at the example.\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. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.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\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n async.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 ],\n function(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 email_link: function(callback){\n // once the file is written let's email a link to it...\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. Its 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, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> 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 // using apply\n\n async.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\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\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 setTimeout(callback, 0),\nwhich means other higher priority events 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 var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\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\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 var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\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 var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> 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 var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> 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", - "_id": "async@0.1.22", - "_from": "async@0.1.22", - "scripts": {}, - "dist": { - "shasum": "3b270eedc0419d6f92a664444ce98e0f59a8fef7" - }, - "_resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/package.json deleted file mode 100644 index d5ca65e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "isbin", - "version": "0.0.2", - "description": "Checks for available binaries on unix machines", - "main": "index.js", - "engines": { - "node": ">= 0.8.0" - }, - "keywords": [ - "fs", - "bin", - "binary", - "exists", - "check", - "path" - ], - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/behrendtio/isbin.git" - }, - "author": "", - "license": "MIT", - "dependencies": { - "async": "0.1.22" - }, - "devDependencies": { - "mocha": "1.7.3", - "should": "1.2.1" - }, - "readme": "[![Build Status](https://secure.travis-ci.org/mbehrendt/isbin.png?branch=master)](https://travis-ci.org/mbehrendt/isbin)\n\n# Isbin\n\nTiny little helper library to determine if a certain binary is available within $PATH or any additional folder.\n\n# Installation\n\n```bash\n$ npm install isbin\n```\n\n# Usage\n\n```js\nvar isbin = require('isbin');\n\n// Test against $PATH\nisbin('mysql', function(exists) {\n console.log(exists); // ==> Boolean\n});\n\n// With additional path to test\nisbin('mysql', '/usr/local/bin', function(exists) {\n console.log(exists); // ==> Boolean\n});\n\n// Or multiple ones\nisbin('mysql', ['/usr/local/bin', '/home/me/bins'], function(exists) {\n console.log(exists); // ==> Boolean\n});\n```\n\nThere are also synchronous versions available\n\n```js\nvar exists = isbin('mysql');\nvar exists = isbin('mysql', '/usr/local/bin');\nvar exists = isbin('mysql', ['/usr/local/bin', '/home/me/bins']);\n```\n\n# Running the tests\n\n```bash\n$ npm install\n$ make test\n```\n\n# License\n\n(The MIT License)\n\nCopyright (c) 2012 Mario Behrendt info@mario-behrendt.de, Stephan Hoyer \n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/behrendtio/isbin/issues" - }, - "_id": "isbin@0.0.2", - "dist": { - "shasum": "2a35fb234ad5ee30f78da61b57e8f42ac43ec5a4" - }, - "_from": "isbin@0.0.2", - "_resolved": "https://registry.npmjs.org/isbin/-/isbin-0.0.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js deleted file mode 100644 index 068a38a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js +++ /dev/null @@ -1,39 +0,0 @@ -var isbin = require('../'); - -describe('isbin', function() { - it('accepts binary, additional path and callback', function(done) { - isbin('ls', '/etc', function(exists) { - exists.should.be.a('boolean'); - done(); - }) - }); - - it('accepts array of paths', function(done) { - isbin('ls', ['/etc', '/home'], function(exists) { - exists.should.be.a('boolean'); - done(); - }); - }); - - it('accepts just binary and callback', function(done) { - isbin('ls', function(exists) { - exists.should.be.a('boolean'); - done(); - }); - }); - - it('accepts binary, additional path and callback', function() { - var exists = isbin('ls', '/etc'); - exists.should.be.a('boolean'); - }); - - it('accepts array of paths', function() { - var exists = isbin('ls', ['/etc', '/home']); - exists.should.be.a('boolean'); - }); - - it('accepts just binary', function() { - var exists = isbin('ls'); - exists.should.be.a('boolean'); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts deleted file mode 100644 index e5eb9f8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---require should ---bail ---ui bdd ---slow 100 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.editorconfig b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.editorconfig deleted file mode 100644 index e036e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -; 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.jshintrc b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.jshintrc deleted file mode 100644 index bbdb29c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.jshintrc +++ /dev/null @@ -1,69 +0,0 @@ -{ - // 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.npmignore deleted file mode 100644 index 1341acd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.npmignore +++ /dev/null @@ -1,30 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.travis.yml deleted file mode 100644 index 36de153..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md deleted file mode 100644 index 0f5eac1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md +++ /dev/null @@ -1,93 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md deleted file mode 100644 index 65d9add..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md +++ /dev/null @@ -1,61 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/LICENSE.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/LICENSE.md deleted file mode 100644 index e9ccc2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/README.md deleted file mode 100644 index 872943b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/README.md +++ /dev/null @@ -1,63 +0,0 @@ -![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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array.js deleted file mode 100644 index 89d388b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array.js +++ /dev/null @@ -1,46 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/append.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/append.js deleted file mode 100644 index bf74037..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/append.js +++ /dev/null @@ -1,21 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/collect.js deleted file mode 100644 index 5863749..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/collect.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/combine.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/combine.js deleted file mode 100644 index d66e621..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/combine.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/compact.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/compact.js deleted file mode 100644 index 74c176e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/compact.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/contains.js deleted file mode 100644 index 92bb6ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/contains.js +++ /dev/null @@ -1,10 +0,0 @@ -var indexOf = require('./indexOf'); - - /** - * If array contains values. - */ - function contains(arr, val) { - return indexOf(arr, val) !== -1; - } - module.exports = contains; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/difference.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/difference.js deleted file mode 100644 index d057051..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/difference.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/every.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/every.js deleted file mode 100644 index ac59883..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/every.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/filter.js deleted file mode 100644 index ebeb58d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/filter.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/find.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/find.js deleted file mode 100644 index b4a7313..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/find.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js deleted file mode 100644 index 53f22a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/flatten.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/flatten.js deleted file mode 100644 index aa9757a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/flatten.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/forEach.js deleted file mode 100644 index 268e506..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/forEach.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js deleted file mode 100644 index 6a9ac83..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/insert.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/insert.js deleted file mode 100644 index f1f95b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/insert.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/intersection.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/intersection.js deleted file mode 100644 index e617006..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/intersection.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/invoke.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/invoke.js deleted file mode 100644 index c01aab1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/invoke.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/join.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/join.js deleted file mode 100644 index 71d8bd2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/join.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js deleted file mode 100644 index ee44a25..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/map.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/map.js deleted file mode 100644 index 54064f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/map.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/max.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/max.js deleted file mode 100644 index 183b10e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/max.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/min.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/min.js deleted file mode 100644 index dd00b6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/min.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/pick.js deleted file mode 100644 index 6a54846..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/pick.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/pluck.js deleted file mode 100644 index fef4043..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -var map = require('./map'); - - /** - * Extract a list of property values. - */ - function pluck(arr, propName){ - return map(arr, propName); - } - - module.exports = pluck; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/range.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/range.js deleted file mode 100644 index 31d3c77..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/range.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reduce.js deleted file mode 100644 index 1a350c6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reduce.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js deleted file mode 100644 index e36fd4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js +++ /dev/null @@ -1,34 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reject.js deleted file mode 100644 index 685f291..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/reject.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/remove.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/remove.js deleted file mode 100644 index aa6517d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/remove.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js deleted file mode 100644 index d5f7f3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js deleted file mode 100644 index 97805ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/some.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/some.js deleted file mode 100644 index 8d17772..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/some.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/sort.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/sort.js deleted file mode 100644 index 7807339..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/sort.js +++ /dev/null @@ -1,55 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/split.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/split.js deleted file mode 100644 index 4f3ba50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/split.js +++ /dev/null @@ -1,35 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js deleted file mode 100644 index ce4c55d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/union.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/union.js deleted file mode 100644 index f1334a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/union.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/unique.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/unique.js deleted file mode 100644 index 0192b2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/unique.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/xor.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/xor.js deleted file mode 100644 index c125a99..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/xor.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/zip.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/zip.js deleted file mode 100644 index 931eb81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/array/zip.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection.js deleted file mode 100644 index d5cf6ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection.js +++ /dev/null @@ -1,22 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/contains.js deleted file mode 100644 index a73f994..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/contains.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrContains = require('../array/contains'); -var objContains = require('../object/contains'); - - /** - */ - module.exports = make(arrContains, objContains); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/every.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/every.js deleted file mode 100644 index 300e03c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/every.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrEvery = require('../array/every'); -var objEvery = require('../object/every'); - - /** - */ - module.exports = make(arrEvery, objEvery); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/filter.js deleted file mode 100644 index 3875700..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/filter.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/find.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/find.js deleted file mode 100644 index 14317e6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/find.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js deleted file mode 100644 index 6e28dcb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrForEach = require('../array/forEach'); -var objForEach = require('../object/forOwn'); - - /** - */ - module.exports = make(arrForEach, objForEach); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/make_.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/make_.js deleted file mode 100644 index 029d27b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/make_.js +++ /dev/null @@ -1,19 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/map.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/map.js deleted file mode 100644 index fc157f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/map.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/max.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/max.js deleted file mode 100644 index a8490e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/max.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/min.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/min.js deleted file mode 100644 index 51d9f14..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/min.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js deleted file mode 100644 index 9b28377..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js deleted file mode 100644 index 4c07573..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrReduce = require('../array/reduce'); -var objReduce = require('../object/reduce'); - - /** - */ - module.exports = make(arrReduce, objReduce); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/reject.js deleted file mode 100644 index 2a92e3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/reject.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/size.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/size.js deleted file mode 100644 index 244e33e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/size.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/some.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/some.js deleted file mode 100644 index 48fd252..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/collection/some.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrSome = require('../array/some'); -var objSome = require('../object/some'); - - /** - */ - module.exports = make(arrSome, objSome); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date.js deleted file mode 100644 index 1cde1a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date.js +++ /dev/null @@ -1,21 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js deleted file mode 100644 index 85905c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/diff.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/diff.js deleted file mode 100644 index 1131cdc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/diff.js +++ /dev/null @@ -1,130 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js deleted file mode 100644 index f9526ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js +++ /dev/null @@ -1,61 +0,0 @@ - - // 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js deleted file mode 100644 index 71ebadb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js +++ /dev/null @@ -1,61 +0,0 @@ - - // 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js deleted file mode 100644 index 723fc10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js deleted file mode 100644 index 4212870..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/isSame.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/isSame.js deleted file mode 100644 index 4097d29..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/isSame.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js deleted file mode 100644 index 8ea2b17..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js +++ /dev/null @@ -1,146 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/startOf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/startOf.js deleted file mode 100644 index 072bc0e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/startOf.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/strftime.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/strftime.js deleted file mode 100644 index f033d10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/strftime.js +++ /dev/null @@ -1,118 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js deleted file mode 100644 index b100687..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js deleted file mode 100644 index 9492dce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js deleted file mode 100644 index 8aafeb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js deleted file mode 100644 index b4b7e9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js deleted file mode 100644 index dd51b7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/array.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/array.md deleted file mode 100644 index 1f390fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/array.md +++ /dev/null @@ -1,773 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/collection.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/collection.md deleted file mode 100644 index 2ffcab1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/collection.md +++ /dev/null @@ -1,233 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/date.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/date.md deleted file mode 100644 index b3f7f40..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/date.md +++ /dev/null @@ -1,295 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/function.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/function.md deleted file mode 100644 index 2695a02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/function.md +++ /dev/null @@ -1,174 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/lang.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/lang.md deleted file mode 100644 index 56d7879..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/lang.md +++ /dev/null @@ -1,385 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/math.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/math.md deleted file mode 100644 index f45be3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/math.md +++ /dev/null @@ -1,298 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/number.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/number.md deleted file mode 100644 index 8d93865..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/number.md +++ /dev/null @@ -1,225 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/object.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/object.md deleted file mode 100644 index b4d5e48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/object.md +++ /dev/null @@ -1,780 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md deleted file mode 100644 index 1be3c10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md +++ /dev/null @@ -1,115 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/random.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/random.md deleted file mode 100644 index b058b4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/random.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/string.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/string.md deleted file mode 100644 index 2b28231..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/string.md +++ /dev/null @@ -1,594 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/time.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/time.md deleted file mode 100644 index 628c2a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/doc/time.md +++ /dev/null @@ -1,64 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function.js deleted file mode 100644 index 43a16ef..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function.js +++ /dev/null @@ -1,18 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/bind.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/bind.js deleted file mode 100644 index 71bc125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/bind.js +++ /dev/null @@ -1,23 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/compose.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/compose.js deleted file mode 100644 index 8cd5c5f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/compose.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/debounce.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/debounce.js deleted file mode 100644 index a0ed07f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/debounce.js +++ /dev/null @@ -1,29 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/func.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/func.js deleted file mode 100644 index b81bf0a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/func.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js deleted file mode 100644 index 767610a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/partial.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/partial.js deleted file mode 100644 index d63ff1b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/partial.js +++ /dev/null @@ -1,19 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/prop.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/prop.js deleted file mode 100644 index 734acb7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/prop.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/series.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/series.js deleted file mode 100644 index 25159c2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/series.js +++ /dev/null @@ -1,22 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/throttle.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/throttle.js deleted file mode 100644 index 619dc54..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/throttle.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/timeout.js deleted file mode 100644 index e0d21a6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/function/timeout.js +++ /dev/null @@ -1,21 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/index.js deleted file mode 100644 index 32a1c63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/**@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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang.js deleted file mode 100644 index b981621..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang.js +++ /dev/null @@ -1,36 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/clone.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/clone.js deleted file mode 100644 index 33c4e94..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/clone.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js deleted file mode 100644 index bbc14c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js deleted file mode 100644 index d68dc50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js +++ /dev/null @@ -1,17 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js deleted file mode 100644 index 25fd95f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js +++ /dev/null @@ -1,48 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js deleted file mode 100644 index 1111b2e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js deleted file mode 100644 index cd8a379..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/is.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/is.js deleted file mode 100644 index 4a83573..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/is.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js deleted file mode 100644 index f7b08ba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js deleted file mode 100644 index 262ee40..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - var isArray = Array.isArray || function (val) { - return isKind(val, 'Array'); - }; - module.exports = isArray; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js deleted file mode 100644 index 86557cb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isBoolean(val) { - return isKind(val, 'Boolean'); - } - module.exports = isBoolean; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js deleted file mode 100644 index 4a5130f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isDate(val) { - return isKind(val, 'Date'); - } - module.exports = isDate; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js deleted file mode 100644 index 0e9f77d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js deleted file mode 100644 index 6d4006f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js deleted file mode 100644 index 216879f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isFunction(val) { - return isKind(val, 'Function'); - } - module.exports = isFunction; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js deleted file mode 100644 index 29f95d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js deleted file mode 100644 index 02301e0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js deleted file mode 100644 index f6efeb1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js deleted file mode 100644 index 6252f9e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - */ - function isNull(val){ - return val === null; - } - module.exports = isNull; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js deleted file mode 100644 index 126c1cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isNumber(val) { - return isKind(val, 'Number'); - } - module.exports = isNumber; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js deleted file mode 100644 index 7350c89..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isObject(val) { - return isKind(val, 'Object'); - } - module.exports = isObject; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js deleted file mode 100644 index 0d2d7b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js deleted file mode 100644 index fc5459a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isRegExp(val) { - return isKind(val, 'RegExp'); - } - module.exports = isRegExp; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isString.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isString.js deleted file mode 100644 index f890658..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isString.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isString(val) { - return isKind(val, 'String'); - } - module.exports = isString; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js deleted file mode 100644 index fb2261d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js +++ /dev/null @@ -1,10 +0,0 @@ - - var UNDEF; - - /** - */ - function isUndef(val){ - return val === UNDEF; - } - module.exports = isUndef; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js deleted file mode 100644 index 9dad58c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js deleted file mode 100644 index 663464d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js +++ /dev/null @@ -1,20 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js deleted file mode 100644 index e39b873..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/toString.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/toString.js deleted file mode 100644 index ae5c2b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/lang/toString.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math.js deleted file mode 100644 index c6ee889..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math.js +++ /dev/null @@ -1,19 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/ceil.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/ceil.js deleted file mode 100644 index a279e15..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/ceil.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/clamp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/clamp.js deleted file mode 100644 index e929a9a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/clamp.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Clamps value inside range. - */ - function clamp(val, min, max){ - return val < min? min : (val > max? max : val); - } - module.exports = clamp; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js deleted file mode 100644 index 60ac90c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js +++ /dev/null @@ -1,16 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/floor.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/floor.js deleted file mode 100644 index 9de5053..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/floor.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/inRange.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/inRange.js deleted file mode 100644 index 763218f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/inRange.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/isNear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/isNear.js deleted file mode 100644 index 45486b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/isNear.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Check if value is close to target. - */ - function isNear(val, target, threshold){ - return (Math.abs(val - target) <= threshold); - } - module.exports = isNear; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/lerp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/lerp.js deleted file mode 100644 index 111e271..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/lerp.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/loop.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/loop.js deleted file mode 100644 index 35207c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/loop.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * Loops value inside range. - */ - function loop(val, min, max){ - return val < min? max : (val > max? min : val); - } - - module.exports = loop; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/map.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/map.js deleted file mode 100644 index 96c4b78..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/map.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/norm.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/norm.js deleted file mode 100644 index 54caf78..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/norm.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Gets normalized ratio of value inside range. - */ - function norm(val, min, max){ - return (val - min) / (max - min); - } - module.exports = norm; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/round.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/round.js deleted file mode 100644 index d108e6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/math/round.js +++ /dev/null @@ -1,12 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number.js deleted file mode 100644 index 0b6186c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number.js +++ /dev/null @@ -1,21 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js deleted file mode 100644 index 1d6f0e4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit signed integer value. (2^31 - 1) - */ - - module.exports = 2147483647; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js deleted file mode 100644 index 700da0f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit unsigned integet value (2^32 - 1) - */ - - module.exports = 4294967295; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js deleted file mode 100644 index b34ab2c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Minimum 32-bit signed integer value (-2^31). - */ - - module.exports = -2147483648; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js deleted file mode 100644 index dd6716b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js deleted file mode 100644 index 1cf0249..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js +++ /dev/null @@ -1,26 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js deleted file mode 100644 index f73a92d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js +++ /dev/null @@ -1,13 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/pad.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/pad.js deleted file mode 100644 index da75270..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/pad.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/rol.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/rol.js deleted file mode 100644 index ecd58da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/rol.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/ror.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/ror.js deleted file mode 100644 index 2eda81d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/ror.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/sign.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/sign.js deleted file mode 100644 index b854a4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/sign.js +++ /dev/null @@ -1,15 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toInt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toInt.js deleted file mode 100644 index bcefae0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toInt.js +++ /dev/null @@ -1,15 +0,0 @@ - - - /** - * "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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js deleted file mode 100644 index 5290b62..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * "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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js deleted file mode 100644 index fcc5a97..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object.js deleted file mode 100644 index 76c0642..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object.js +++ /dev/null @@ -1,42 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js deleted file mode 100644 index b2f27d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/contains.js deleted file mode 100644 index 8076e2c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/contains.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js deleted file mode 100644 index fcde944..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js deleted file mode 100644 index d27db44..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js deleted file mode 100644 index 3366c52..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js deleted file mode 100644 index a97e98d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/equals.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/equals.js deleted file mode 100644 index f50cbe4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/equals.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/every.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/every.js deleted file mode 100644 index 01106e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/every.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js deleted file mode 100644 index 80dcdf0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/filter.js deleted file mode 100644 index 3a83a92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/filter.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/find.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/find.js deleted file mode 100644 index d39c070..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/find.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/forIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/forIn.js deleted file mode 100644 index 367f08c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/forIn.js +++ /dev/null @@ -1,62 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js deleted file mode 100644 index 5f2dfbf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/functions.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/functions.js deleted file mode 100644 index f571797..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/functions.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/get.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/get.js deleted file mode 100644 index 6673561..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/get.js +++ /dev/null @@ -1,20 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/has.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/has.js deleted file mode 100644 index ca9f228..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/has.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js deleted file mode 100644 index 7e3c82a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js +++ /dev/null @@ -1,12 +0,0 @@ - - - /** - * Safer Object.hasOwnProperty - */ - function hasOwn(obj, prop){ - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - module.exports = hasOwn; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/keys.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/keys.js deleted file mode 100644 index dd2f4f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/keys.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/map.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/map.js deleted file mode 100644 index dd449a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/map.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/matches.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/matches.js deleted file mode 100644 index 6074faa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/matches.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/max.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/max.js deleted file mode 100644 index 3e8e92c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/max.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/merge.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/merge.js deleted file mode 100644 index 6961f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/merge.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/min.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/min.js deleted file mode 100644 index e1e6697..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/min.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js deleted file mode 100644 index 55ec8fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/namespace.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/namespace.js deleted file mode 100644 index c6e79f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/namespace.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/pick.js deleted file mode 100644 index 74e56f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/pick.js +++ /dev/null @@ -1,18 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/pluck.js deleted file mode 100644 index e844df4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/pluck.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/reduce.js deleted file mode 100644 index 6f19a3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/reduce.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/reject.js deleted file mode 100644 index 7464379..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/reject.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/set.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/set.js deleted file mode 100644 index 9b3cdc4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/set.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/size.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/size.js deleted file mode 100644 index 9788595..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/size.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/some.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/some.js deleted file mode 100644 index 384c6f3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/some.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/unset.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/unset.js deleted file mode 100644 index 343bca0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/unset.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/values.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/values.js deleted file mode 100644 index 265a693..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/object/values.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/package.json deleted file mode 100644 index a3c1682..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString.js deleted file mode 100644 index 22685a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString.js +++ /dev/null @@ -1,15 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js deleted file mode 100644 index da678cf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js deleted file mode 100644 index 7e68999..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js deleted file mode 100644 index 6d2b12f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js deleted file mode 100644 index f149c3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js deleted file mode 100644 index 5194af2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js deleted file mode 100644 index 532906c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js deleted file mode 100644 index 052a9ba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random.js deleted file mode 100644 index d9267f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random.js +++ /dev/null @@ -1,16 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/choice.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/choice.js deleted file mode 100644 index 51aa82a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/choice.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/guid.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/guid.js deleted file mode 100644 index 41f6edd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/guid.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/rand.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/rand.js deleted file mode 100644 index 782dec8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/rand.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randBit.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randBit.js deleted file mode 100644 index bd20b4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randBit.js +++ /dev/null @@ -1,11 +0,0 @@ -var random = require('./random'); - - /** - * Returns random bit (0 or 1) - */ - function randomBit() { - return random() > 0.5? 1 : 0; - } - - module.exports = randomBit; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randHex.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randHex.js deleted file mode 100644 index d8d711c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randHex.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randInt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randInt.js deleted file mode 100644 index e237d96..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randInt.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randSign.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randSign.js deleted file mode 100644 index 5a9fed7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/randSign.js +++ /dev/null @@ -1,11 +0,0 @@ -var random = require('./random'); - - /** - * Returns random sign (-1 or 1) - */ - function randomSign() { - return random() > 0.5? 1 : -1; - } - - module.exports = randomSign; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/random.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/random.js deleted file mode 100644 index 670a3cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/random/random.js +++ /dev/null @@ -1,18 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array.js deleted file mode 100644 index 7bcc961..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/append.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/append.js deleted file mode 100644 index 549d875..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/append.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js deleted file mode 100644 index 8f60cda..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js deleted file mode 100644 index 22efb86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js deleted file mode 100644 index 02a8109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js deleted file mode 100644 index fca4f7c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./indexOf'], function (indexOf) { - - /** - * If array contains values. - */ - function contains(arr, val) { - return indexOf(arr, val) !== -1; - } - return contains; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js deleted file mode 100644 index 819bda3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/every.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/every.js deleted file mode 100644 index 78ba46d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/every.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js deleted file mode 100644 index 52cf685..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/find.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/find.js deleted file mode 100644 index 3957dcd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/find.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js deleted file mode 100644 index 59dfeeb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js deleted file mode 100644 index 42e87f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js deleted file mode 100644 index 0e04586..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js deleted file mode 100644 index 0e75f99..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js deleted file mode 100644 index d8d831f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js deleted file mode 100644 index 64e6ee9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js deleted file mode 100644 index a2e78b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/join.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/join.js deleted file mode 100644 index 2c618d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/join.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js deleted file mode 100644 index 931235f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/map.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/map.js deleted file mode 100644 index 1580b48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/map.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/max.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/max.js deleted file mode 100644 index a7326c8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/max.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/min.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/min.js deleted file mode 100644 index 4164448..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/min.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js deleted file mode 100644 index 97d7f59..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js deleted file mode 100644 index c908856..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./map'], function (map) { - - /** - * Extract a list of property values. - */ - function pluck(arr, propName){ - return map(arr, propName); - } - - return pluck; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/range.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/range.js deleted file mode 100644 index 148ebf9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/range.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js deleted file mode 100644 index 88aacfd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js deleted file mode 100644 index ddae0e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js deleted file mode 100644 index db105dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js deleted file mode 100644 index dec9134..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js deleted file mode 100644 index e81022b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js deleted file mode 100644 index f5a6097..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/some.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/some.js deleted file mode 100644 index e46a978..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/some.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js deleted file mode 100644 index 4c19404..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/split.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/split.js deleted file mode 100644 index a17275e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/split.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js deleted file mode 100644 index aac8fd1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/union.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/union.js deleted file mode 100644 index 5f9922e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/union.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js deleted file mode 100644 index c4bd23b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js deleted file mode 100644 index 7df89d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js deleted file mode 100644 index 374cd28..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection.js deleted file mode 100644 index 386e6da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js deleted file mode 100644 index 192167e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/contains', '../object/contains'], function (make, arrContains, objContains) { - - /** - */ - return make(arrContains, objContains); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js deleted file mode 100644 index 6317f50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/every', '../object/every'], function (make, arrEvery, objEvery) { - - /** - */ - return make(arrEvery, objEvery); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js deleted file mode 100644 index 4e7fadc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js deleted file mode 100644 index 681f941..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js deleted file mode 100644 index 3b39d3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/forEach', '../object/forOwn'], function (make, arrForEach, objForEach) { - - /** - */ - return make(arrForEach, objForEach); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js deleted file mode 100644 index 312e056..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js deleted file mode 100644 index 96e2498..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js deleted file mode 100644 index de9a6da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./make_', '../array/max', '../object/max'], function (make, arrMax, objMax) { - - /** - * Get maximum value inside collection - */ - return make(arrMax, objMax); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js deleted file mode 100644 index f0c239a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./make_', '../array/min', '../object/min'], function (make, arrMin, objMin) { - - /** - * Get minimum value inside collection. - */ - return make(arrMin, objMin); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js deleted file mode 100644 index ef784a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js deleted file mode 100644 index bd05d43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/reduce', '../object/reduce'], function (make, arrReduce, objReduce) { - - /** - */ - return make(arrReduce, objReduce); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js deleted file mode 100644 index 581adfd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js deleted file mode 100644 index 4e5ab41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js deleted file mode 100644 index c0aebee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/some', '../object/some'], function (make, arrSome, objSome) { - - /** - */ - return make(arrSome, objSome); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date.js deleted file mode 100644 index 4d44915..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js deleted file mode 100644 index dc77ae1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js deleted file mode 100644 index 667165f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js +++ /dev/null @@ -1,128 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js deleted file mode 100644 index 5e640c2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js deleted file mode 100644 index 47256dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js deleted file mode 100644 index c04ce88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js deleted file mode 100644 index e400b43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js deleted file mode 100644 index f30531f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js deleted file mode 100644 index 9a2aacb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js +++ /dev/null @@ -1,146 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js deleted file mode 100644 index 747f114..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js deleted file mode 100644 index dd78250..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js +++ /dev/null @@ -1,113 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js deleted file mode 100644 index 225a685..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js deleted file mode 100644 index ca06705..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js deleted file mode 100644 index 98f7e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js deleted file mode 100644 index e9036b4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js deleted file mode 100644 index 8dabc45..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function.js deleted file mode 100644 index 23f4fd7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js deleted file mode 100644 index 09e5e20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js deleted file mode 100644 index d8b228f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js deleted file mode 100644 index 21644ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/func.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/func.js deleted file mode 100644 index b920e00..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/func.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js deleted file mode 100644 index deb6e13..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js deleted file mode 100644 index ad73074..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js deleted file mode 100644 index c9df78c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/series.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/series.js deleted file mode 100644 index c8856a2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/series.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js deleted file mode 100644 index 8ce3929..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js deleted file mode 100644 index 15388bd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/index.js deleted file mode 100644 index 744bb11..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/**@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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang.js deleted file mode 100644 index de16b59..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js deleted file mode 100644 index 468489a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js deleted file mode 100644 index f766150..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js deleted file mode 100644 index a9ac1c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js deleted file mode 100644 index d45c10a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js deleted file mode 100644 index 5156b1b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js deleted file mode 100644 index c1fda3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js deleted file mode 100644 index 261a207..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js deleted file mode 100644 index f889ee8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js deleted file mode 100644 index 886e2aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - var isArray = Array.isArray || function (val) { - return isKind(val, 'Array'); - }; - return isArray; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js deleted file mode 100644 index 1ca27a6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isBoolean(val) { - return isKind(val, 'Boolean'); - } - return isBoolean; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js deleted file mode 100644 index 2708d67..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isDate(val) { - return isKind(val, 'Date'); - } - return isDate; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js deleted file mode 100644 index 4cc3d2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js deleted file mode 100644 index 5a982f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js deleted file mode 100644 index ff5df7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isFunction(val) { - return isKind(val, 'Function'); - } - return isFunction; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js deleted file mode 100644 index 1931f51..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./isNumber'], function (isNumber) { - - /** - * Check if value is an integer - */ - function isInteger(val){ - return isNumber(val) && (val % 1 === 0); - } - - return isInteger; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js deleted file mode 100644 index 6937a12..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js deleted file mode 100644 index 9467a3c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js deleted file mode 100644 index 506e05e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function () { - /** - */ - function isNull(val){ - return val === null; - } - return isNull; -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js deleted file mode 100644 index 9a832c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isNumber(val) { - return isKind(val, 'Number'); - } - return isNumber; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js deleted file mode 100644 index 0befb06..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isObject(val) { - return isKind(val, 'Object'); - } - return isObject; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js deleted file mode 100644 index 6c5854f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js deleted file mode 100644 index d78a03d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isRegExp(val) { - return isKind(val, 'RegExp'); - } - return isRegExp; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js deleted file mode 100644 index 8a42fe0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isString(val) { - return isKind(val, 'String'); - } - return isString; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js deleted file mode 100644 index c57b28e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function () { - var UNDEF; - - /** - */ - function isUndef(val){ - return val === UNDEF; - } - return isUndef; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js deleted file mode 100644 index d433622..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js deleted file mode 100644 index 97d21d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js deleted file mode 100644 index 552916f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js deleted file mode 100644 index c28b89a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math.js deleted file mode 100644 index e2ba870..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js deleted file mode 100644 index d73b058..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js deleted file mode 100644 index fb5a148..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function(){ - /** - * Clamps value inside range. - */ - function clamp(val, min, max){ - return val < min? min : (val > max? max : val); - } - return clamp; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js deleted file mode 100644 index 0ecb32f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js deleted file mode 100644 index 8a4456b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js deleted file mode 100644 index 0c89053..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js deleted file mode 100644 index b308a0b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js deleted file mode 100644 index 26b99d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js deleted file mode 100644 index c735ecf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function(){ - /** - * Loops value inside range. - */ - function loop(val, min, max){ - return val < min? max : (val > max? min : val); - } - - return loop; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/map.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/map.js deleted file mode 100644 index bf7dc5d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/map.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js deleted file mode 100644 index fccae20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function(){ - /** - * Gets normalized ratio of value inside range. - */ - function norm(val, min, max){ - return (val - min) / (max - min); - } - return norm; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/round.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/round.js deleted file mode 100644 index b43e4ac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/math/round.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number.js deleted file mode 100644 index cb52fc7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js deleted file mode 100644 index 23a6e1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit signed integer value. (2^31 - 1) - */ -define(function(){ - return 2147483647; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js deleted file mode 100644 index a035096..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit unsigned integet value (2^32 - 1) - */ -define(function(){ - return 4294967295; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js deleted file mode 100644 index 9b3e978..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Minimum 32-bit signed integer value (-2^31). - */ -define(function(){ - return -2147483648; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js deleted file mode 100644 index 7e7405a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js deleted file mode 100644 index dcde8fc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js deleted file mode 100644 index 84554d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js deleted file mode 100644 index 3b2c062..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js deleted file mode 100644 index a148f44..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js deleted file mode 100644 index b5c66f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js deleted file mode 100644 index dfc131d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js deleted file mode 100644 index 1e9b4c0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js deleted file mode 100644 index d5b25b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js deleted file mode 100644 index 9785a05..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object.js deleted file mode 100644 index 343e782..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js deleted file mode 100644 index b131ed1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js deleted file mode 100644 index 297e898..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js deleted file mode 100644 index 8b7d5d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js deleted file mode 100644 index 84ba154..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js deleted file mode 100644 index 2eae629..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js deleted file mode 100644 index 1b4178e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js deleted file mode 100644 index 596cb95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/every.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/every.js deleted file mode 100644 index 52983a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/every.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js deleted file mode 100644 index 0845d3c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js deleted file mode 100644 index f213b91..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/find.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/find.js deleted file mode 100644 index 47e6b09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/find.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js deleted file mode 100644 index 2058e9c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js +++ /dev/null @@ -1,62 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js deleted file mode 100644 index b40cbaf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js deleted file mode 100644 index 60fee3d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/get.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/get.js deleted file mode 100644 index ca80b05..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/get.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/has.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/has.js deleted file mode 100644 index cc29817..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/has.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js deleted file mode 100644 index 5c53bcf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - /** - * Safer Object.hasOwnProperty - */ - function hasOwn(obj, prop){ - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - return hasOwn; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js deleted file mode 100644 index ed7c4f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/map.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/map.js deleted file mode 100644 index 2958f6b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/map.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js deleted file mode 100644 index 73ff427..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/max.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/max.js deleted file mode 100644 index ef311dc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/max.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js deleted file mode 100644 index d7cfede..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js +++ /dev/null @@ -1,38 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/min.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/min.js deleted file mode 100644 index 9fb4c1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/min.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js deleted file mode 100644 index 6210b7e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js deleted file mode 100644 index 7ed65db..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js deleted file mode 100644 index 76e22bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js deleted file mode 100644 index d47744b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js deleted file mode 100644 index d3a5778..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js deleted file mode 100644 index 8429642..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/set.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/set.js deleted file mode 100644 index b8fa25a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/set.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/size.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/size.js deleted file mode 100644 index c6e377c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/size.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['./forOwn'], function (forOwn) { - - /** - * Get object size - */ - function size(obj) { - var count = 0; - forOwn(obj, function(){ - count++; - }); - return count; - } - - return size; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/some.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/some.js deleted file mode 100644 index 1bd6fda..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/some.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js deleted file mode 100644 index 787fc19..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/values.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/values.js deleted file mode 100644 index b311fd0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/object/values.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString.js deleted file mode 100644 index 4434612..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js deleted file mode 100644 index a6d11cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js deleted file mode 100644 index 02bc160..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js deleted file mode 100644 index bd72a5b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js deleted file mode 100644 index d981372..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js deleted file mode 100644 index aa3d99f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js deleted file mode 100644 index ac153e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js deleted file mode 100644 index 97081aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random.js deleted file mode 100644 index b2641ee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js deleted file mode 100644 index 0d0c38d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js deleted file mode 100644 index 82f3a2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js deleted file mode 100644 index b8c231d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js deleted file mode 100644 index b3422d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./random'], function (random) { - - /** - * Returns random bit (0 or 1) - */ - function randomBit() { - return random() > 0.5? 1 : 0; - } - - return randomBit; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js deleted file mode 100644 index 6e9bf1c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js deleted file mode 100644 index 1750e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js deleted file mode 100644 index 4141cdf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./random'], function (random) { - - /** - * Returns random sign (-1 or 1) - */ - function randomSign() { - return random() > 0.5? 1 : -1; - } - - return randomSign; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/random.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/random.js deleted file mode 100644 index 4270822..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/random/random.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string.js deleted file mode 100644 index 3f5fd80..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js deleted file mode 100644 index e830d86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js deleted file mode 100644 index 02e6c04..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js deleted file mode 100644 index 825b5a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js deleted file mode 100644 index 3c073f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js deleted file mode 100644 index 31a73f2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js deleted file mode 100644 index de34b61..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js deleted file mode 100644 index 32facac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js deleted file mode 100644 index bd5e8c4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js deleted file mode 100644 index 679c405..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js deleted file mode 100644 index ecb8ba8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js deleted file mode 100644 index b045d69..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['../lang/toString'], function(toString){ - /** - * "Safer" String.toLowerCase() - */ - function lowerCase(str){ - str = toString(str); - return str.toLowerCase(); - } - - return lowerCase; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js deleted file mode 100644 index ea4f5fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js deleted file mode 100644 index 477df95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js deleted file mode 100644 index 7aa7bab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js deleted file mode 100644 index 44e4194..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js deleted file mode 100644 index ead9ead..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js deleted file mode 100644 index 2987b50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js deleted file mode 100644 index 4905869..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js deleted file mode 100644 index 2b1a204..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js deleted file mode 100644 index 02f5659..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js deleted file mode 100644 index 8b762fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js deleted file mode 100644 index 3a63f55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js deleted file mode 100644 index 2efd9c8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js deleted file mode 100644 index a4cc282..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js deleted file mode 100644 index cfe45af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js deleted file mode 100644 index c6d68c7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js deleted file mode 100644 index 88ae545..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js deleted file mode 100644 index e8da956..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js deleted file mode 100644 index 5552604..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js deleted file mode 100644 index 34000d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js deleted file mode 100644 index a7c8315..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js deleted file mode 100644 index eeef39b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js deleted file mode 100644 index 75dd464..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js deleted file mode 100644 index 173c69c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js deleted file mode 100644 index d4a7ba1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js deleted file mode 100644 index 6ac2fa4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js deleted file mode 100644 index 8b2073e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['../lang/toString'], function(toString){ - /** - * "Safer" String.toUpperCase() - */ - function upperCase(str){ - str = toString(str); - return str.toUpperCase(); - } - return upperCase; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time.js deleted file mode 100644 index 67c9068..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js deleted file mode 100644 index 2de0cf2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/now.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/now.js deleted file mode 100644 index a3a38bc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/now.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - /** - * Get current time in miliseconds - */ - var now = (typeof Date.now === 'function')? Date.now : function(){ - return +(new Date()); - }; - - return now; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js deleted file mode 100644 index 964929a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js deleted file mode 100644 index edf1821..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string.js deleted file mode 100644 index 7f0ca3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string.js +++ /dev/null @@ -1,45 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js deleted file mode 100644 index 03e0125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js +++ /dev/null @@ -1,12 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js deleted file mode 100644 index aadb69a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/contains.js deleted file mode 100644 index cb22cae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/contains.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/crop.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/crop.js deleted file mode 100644 index 53b93b4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/crop.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js deleted file mode 100644 index d504e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js deleted file mode 100644 index e67c4b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js deleted file mode 100644 index 70cb84f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js deleted file mode 100644 index ec649ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js deleted file mode 100644 index 95e3243..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js deleted file mode 100644 index ac88fac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js deleted file mode 100644 index 30bb7ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js +++ /dev/null @@ -1,11 +0,0 @@ -var toString = require('../lang/toString'); - /** - * "Safer" String.toLowerCase() - */ - function lowerCase(str){ - str = toString(str); - return str.toLowerCase(); - } - - module.exports = lowerCase; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/lpad.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/lpad.js deleted file mode 100644 index 694d711..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/lpad.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js deleted file mode 100644 index 23d7b33..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/makePath.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/makePath.js deleted file mode 100644 index 69aef31..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/makePath.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js deleted file mode 100644 index 8a8dccf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js deleted file mode 100644 index fd19035..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/properCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/properCase.js deleted file mode 100644 index 61636be..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/properCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js deleted file mode 100644 index fb46381..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js deleted file mode 100644 index bdd153b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/repeat.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/repeat.js deleted file mode 100644 index 0f9b475..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/repeat.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/replace.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/replace.js deleted file mode 100644 index 14433fc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/replace.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js deleted file mode 100644 index bb22126..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/rpad.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/rpad.js deleted file mode 100644 index 99f6378..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/rpad.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js deleted file mode 100644 index 66ba80e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js deleted file mode 100644 index 354104c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/slugify.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/slugify.js deleted file mode 100644 index 142f0d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/slugify.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js deleted file mode 100644 index bce2bd2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js deleted file mode 100644 index 01d17b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/trim.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/trim.js deleted file mode 100644 index 9652b0c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/trim.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/truncate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/truncate.js deleted file mode 100644 index a98d6c7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/truncate.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/typecast.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/typecast.js deleted file mode 100644 index c1386a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/typecast.js +++ /dev/null @@ -1,29 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js deleted file mode 100644 index 4968f37..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/underscore.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/underscore.js deleted file mode 100644 index ebd6e2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/underscore.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js deleted file mode 100644 index 52cf3f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js deleted file mode 100644 index 0b7fb73..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js deleted file mode 100644 index 311dfa1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js deleted file mode 100644 index 6c92552..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js +++ /dev/null @@ -1,10 +0,0 @@ -var toString = require('../lang/toString'); - /** - * "Safer" String.toUpperCase() - */ - function upperCase(str){ - str = toString(str); - return str.toUpperCase(); - } - module.exports = upperCase; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time.js deleted file mode 100644 index 9f53329..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time.js +++ /dev/null @@ -1,12 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/convert.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/convert.js deleted file mode 100644 index 852a0f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/convert.js +++ /dev/null @@ -1,41 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/now.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/now.js deleted file mode 100644 index effcfbe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/now.js +++ /dev/null @@ -1,12 +0,0 @@ - - - /** - * Get current time in miliseconds - */ - var now = (typeof Date.now === 'function')? Date.now : function(){ - return +(new Date()); - }; - - module.exports = now; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js deleted file mode 100644 index 6d99797..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js deleted file mode 100644 index 101d69f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/History.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/History.md deleted file mode 100644 index 8811948..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/History.md +++ /dev/null @@ -1,42 +0,0 @@ - -1.0.0 / 2013-06-18 -================== - - * remove .version - * >=. Closes #19 - * Merge pull request #15 from davglass/readline-osx - * On OSX revert back to terminal hack to avoid a readline bug - -0.1.0 / 2012-09-19 -================== - - * Fixed logic bug that caused bar to jump one extra space at the end [davglass] - * Working with readline impl, even on Windows [davglass] - * Using readline instead of the \r hack [davglass] - -0.0.5 / 2012-08-07 -================== - - * add ability to tick by zero chunks - tick(0) - * fix ETA. Closes #4 [lwille] - -0.0.4 / 2011-11-14 -================== - - * Allow more recent versions of node - -0.0.3 / 2011-04-20 -================== - - * Changed; erase the line when complete - -0.0.2 / 2011-04-20 -================== - - * Added custom tokens support - * Fixed; clear line before writing - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/Makefile deleted file mode 100644 index 36a3ed7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @echo "populate me" - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/Readme.md deleted file mode 100644 index 4e08a49..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/Readme.md +++ /dev/null @@ -1,117 +0,0 @@ -# node-progress - - Flexible ascii progress bar - -## Installation - - npm install progress - -## Usage - - First we create a `ProgressBar`, giving it a format string - as well as the `total`, telling the progress bar when it will - be considered complete. After that all we need to do is `tick()` appropriately. - -```javascript -var ProgressBar = require('progress'); - -var bar = new ProgressBar(':bar', { total: 10 }); -var timer = setInterval(function(){ - bar.tick(); - if (bar.complete) { - console.log('\ncomplete\n'); - clearInterval(timer); - } -}, 100); -``` - -## Options: - - - `total` total number of ticks to complete - - `width` the displayed width of the progress bar defaulting to total - - `stream` the output stream defaulting to stdout - - `complete` completion character defaulting to "=" - - `incomplete` incomplete character defaulting to "-" - - `clear` option to clear the bar on completion defaulting to false - - `callback` optional function to call when the progress bar completes - -## Tokens: - - - `:bar` the progress bar itself - - `:current` current tick number - - `:total` total ticks - - `:elapsed` time elapsed in seconds - - `:percent` completion percentage - - `:eta` estimated completion time in seconds - -## Examples - -### Download - - In our download example each tick has a variable influence, so we pass the chunk length which adjusts the progress bar appropriately relative to the total length. - -```javascript -var ProgressBar = require('../') - , https = require('https'); - -var req = https.request({ - host: 'download.github.com' - , port: 443 - , path: '/visionmedia-node-jscoverage-0d4608a.zip' -}); - -req.on('response', function(res){ - var len = parseInt(res.headers['content-length'], 10); - - console.log(); - var bar = new ProgressBar(' downloading [:bar] :percent :etas', { - complete: '=' - , incomplete: ' ' - , width: 20 - , total: len - }); - - res.on('data', function(chunk){ - bar.tick(chunk.length); - }); - - res.on('end', function(){ - console.log('\n'); - }); -}); - -req.end(); -``` - - The code above will generate a progress bar that looks like this: - -``` -downloading [===== ] 29% 3.7s -``` - -You can see more examples in the `examples` folder. - -## License - -(The MIT License) - -Copyright (c) 2011 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/index.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/index.js deleted file mode 100644 index 07ef91f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/node-progress'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js deleted file mode 100644 index 638d919..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js +++ /dev/null @@ -1,172 +0,0 @@ -/*! - * node-progress - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Expose `ProgressBar`. - */ - -exports = module.exports = ProgressBar; - -/** - * Initialize a `ProgressBar` with the given - * `fmt` string and `options`. - * - * Options: - * - * - `total` total number of ticks to complete - * - `width` the displayed width of the progress bar defaulting to total - * - `stream` the output stream defaulting to stdout - * - `complete` completion character defaulting to "=" - * - `incomplete` incomplete character defaulting to "-" - * - `callback` optional function to call when the progress bar completes - * - * Tokens: - * - * - `:bar` the progress bar itself - * - `:current` current tick number - * - `:total` total ticks - * - `:elapsed` time elapsed in seconds - * - `:percent` completion percentage - * - `:eta` eta in seconds - * - * @param {String} fmt - * @param {Object} options - * @api public - */ - -function ProgressBar(fmt, options) { - this.rl = require('readline').createInterface({ - input: process.stdin, - output: options.stream || process.stdout - }); - this.rl.setPrompt('', 0); - this.rl.clearLine = function() { - this.write(null, {ctrl: true, name: 'u'}); - }; - - options = options || {}; - if ('string' != typeof fmt) throw new Error('format required'); - if ('number' != typeof options.total) throw new Error('total required'); - this.fmt = fmt; - this.curr = 0; - this.total = options.total; - this.width = options.width || this.total; - this.clear = options.clear - this.chars = { - complete: options.complete || '=' - , incomplete: options.incomplete || '-' - }; - this.callback = options.callback || function () {}; -} - -/** - * "tick" the progress bar with optional `len` and - * optional `tokens`. - * - * @param {Number|Object} len or tokens - * @param {Object} tokens - * @api public - */ - -ProgressBar.prototype.tick = function(len, tokens){ - if (len !== 0) - len = len || 1; - - // swap tokens - if ('object' == typeof len) tokens = len, len = 1; - - // start time for eta - if (0 == this.curr) this.start = new Date; - - this.curr += len - this.render(tokens); - - // progress complete - if (this.curr >= this.total) { - this.complete = true; - this.terminate(); - this.callback(this); - return; - } -}; - -/** - * Method to render the progress bar with optional `tokens` to - * place in the progress bar's `fmt` field. - * - * @param {Object} tokens - * @api public - */ - -ProgressBar.prototype.render = function(tokens){ - if(!process.stdout.isTTY) { - return; - } - - var percent = (this.curr >= this.total) ? 100 : this.curr / this.total * 100 - , complete = Math.round(this.width * (this.curr / this.total)) - , incomplete - , elapsed = new Date - this.start - , eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1) - complete = Array(complete).join(this.chars.complete); - incomplete = Array(this.width - complete.length).join(this.chars.incomplete); - - var str = this.fmt - .replace(':bar', complete + incomplete) - .replace(':current', this.curr) - .replace(':total', this.total) - .replace(':elapsed', isNaN(elapsed) ? "0.0" : (elapsed / 1000).toFixed(1)) - .replace(':eta', isNaN(eta) ? "0.0" : (eta / 1000).toFixed(1)) - .replace(':percent', percent.toFixed(0) + '%'); - - if (tokens) { - for (var key in tokens) { - str = str.replace(':' + key, tokens[key]); - } - } - - this.rl.clearLine(); - this.rl.write(str); -}; - -/** - * "update" the progress bar to represent an exact percentage. - * The ratio (between 0 and 1) specified will be multiplied by `total` and - * floored, representing the closest available "tick." For example, if a - * progress bar has a length of 3 and `update(0.5)` is called, the progress - * will be set to 1. - * - * A ratio of 0.5 will attempt to set the progress to halfway. - * - * @param {Number} ratio The ratio (between 0 and 1 inclusive) to set the - * overall completion to. - * @api public - */ - -ProgressBar.prototype.update = function(ratio) { - var goal = Math.floor(ratio * this.total); - var delta = goal - this.curr; - - this.tick(delta); -}; - -/** - * Terminates a progress bar. - * - * @api public - */ - -ProgressBar.prototype.terminate = function() { - this.rl.resume(); - - if (this.clear) { - this.rl.clearLine(); - this.rl.close(); - } else { - this.rl.close(); - console.log(); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/package.json deleted file mode 100644 index a4facb9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/progress/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "progress", - "version": "1.1.2", - "description": "Flexible ascii progress bar", - "keywords": [ - "cli", - "progress" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "main": "index", - "engines": { - "node": ">=0.4.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-progress" - }, - "readme": "# node-progress\n\n Flexible ascii progress bar\n\n## Installation\n\n npm install progress\n\n## Usage\n\n First we create a `ProgressBar`, giving it a format string\n as well as the `total`, telling the progress bar when it will\n be considered complete. After that all we need to do is `tick()` appropriately.\n\n```javascript\nvar ProgressBar = require('progress');\n\nvar bar = new ProgressBar(':bar', { total: 10 });\nvar timer = setInterval(function(){\n bar.tick();\n if (bar.complete) {\n console.log('\\ncomplete\\n');\n clearInterval(timer);\n }\n}, 100);\n```\n\n## Options:\n\n - `total` total number of ticks to complete\n - `width` the displayed width of the progress bar defaulting to total\n - `stream` the output stream defaulting to stdout\n - `complete` completion character defaulting to \"=\"\n - `incomplete` incomplete character defaulting to \"-\"\n - `clear` option to clear the bar on completion defaulting to false\n - `callback` optional function to call when the progress bar completes\n\n## Tokens:\n\n - `:bar` the progress bar itself\n - `:current` current tick number\n - `:total` total ticks\n - `:elapsed` time elapsed in seconds\n - `:percent` completion percentage\n - `:eta` estimated completion time in seconds\n\n## Examples\n\n### Download\n\n In our download example each tick has a variable influence, so we pass the chunk length which adjusts the progress bar appropriately relative to the total length.\n\n```javascript\nvar ProgressBar = require('../')\n , https = require('https');\n\nvar req = https.request({\n host: 'download.github.com'\n , port: 443\n , path: '/visionmedia-node-jscoverage-0d4608a.zip'\n});\n\nreq.on('response', function(res){\n var len = parseInt(res.headers['content-length'], 10);\n\n console.log();\n var bar = new ProgressBar(' downloading [:bar] :percent :etas', {\n complete: '='\n , incomplete: ' '\n , width: 20\n , total: len\n });\n\n res.on('data', function(chunk){\n bar.tick(chunk.length);\n });\n\n res.on('end', function(){\n console.log('\\n');\n });\n});\n\nreq.end();\n```\n\n The code above will generate a progress bar that looks like this:\n\n```\ndownloading [===== ] 29% 3.7s\n```\n\nYou can see more examples in the `examples` folder.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 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.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/node-progress/issues" - }, - "_id": "progress@1.1.2", - "dist": { - "shasum": "87fdbc7c76a784020897b5e9665554b05fc58cd1" - }, - "_from": "progress@~1.1.0", - "_resolved": "https://registry.npmjs.org/progress/-/progress-1.1.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/README.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/README.md deleted file mode 100644 index ff1eb53..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/README.md +++ /dev/null @@ -1,5 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/bin/which b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/bin/which deleted file mode 100755 index 8432ce2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/bin/which +++ /dev/null @@ -1,14 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/package.json deleted file mode 100644 index 9458b87..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "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" - }, - "_id": "which@1.0.5", - "_from": "which@~1.0.5", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/which.js b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/which.js deleted file mode 100644 index db7e8f7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/which/which.js +++ /dev/null @@ -1,104 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/package.json deleted file mode 100644 index 37239f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "bin-wrapper", - "version": "0.1.6", - "description": "Binary wrapper for Node.js that makes your programs seamlessly available as local dependencies", - "keywords": [ - "bin", - "build", - "make", - "wrapper" - ], - "homepage": "https://github.com/kevva/bin-wrapper", - "bugs": { - "url": "https://github.com/kevva/bin-wrapper/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/bin-wrapper.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "bin-wrapper.js", - "files": [ - "bin-wrapper.js" - ], - "dependencies": { - "download": "~0.1.2", - "isbin": "0.0.2", - "mout": "~0.6.0", - "progress": "~1.1.0", - "which": "~1.0.5" - }, - "devDependencies": { - "mocha": "~1.12.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# bin-wrapper [![Build Status](https://secure.travis-ci.org/kevva/bin-wrapper.png?branch=master)](http://travis-ci.org/kevva/bin-wrapper)\n\nBinary wrapper for Node.js that makes your programs seamlessly available as local dependencies\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/bin-wrapper): `npm install bin-wrapper`\n\n## Examples\n\nAll `platform` and `arch` specific options takes precedence over the base \noptions. See [test.js](test.js) for a full fleshed example.\n\n```js\nvar Bin = require('bin-wrapper');\n\nvar opts = {\n name: 'Gifsicle',\n bin: 'gifsicle',\n path: 'vendor',\n url: 'http://url/to/gifsicle',\n src: 'http://www.lcdf.org/gifsicle/gifsicle-1.71.tar.gz',\n buildScript: './configure --bindir=\"vendor\" && make install',\n platform: {\n win32: {\n bin: 'gifsicle.exe',\n url: [\n 'http://url/to/gifsicle.exe'\n 'http://url/to/gifsicle.dll'\n ]\n }\n }\n}\nvar bin = new Bin(opts);\n\nbin.check('--version', function (works) {\n if (!works) {\n console.log('Pre-build test failed, compiling from source');\n return bin.build();\n }\n\n console.log('Binary passed the test');\n});\n```\n\nGet the path to your binary with `bin.path`.\n\n```js\nconsole.log(bin.path);\n// => path/to/vendor/gifsicle\n```\n\n## API\n\n### .check(cmd, cb)\n\nCheck if a binary is present and working. If it isn't, download and test it by \nrunning the binary with `cmd` and see if it exits correctly.\n\n### .build(cb)\n\nDownload the source archive defined in the `src` property and build it using the \nbuild script defined in the `buildScript` property.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "bin-wrapper@0.1.6", - "dist": { - "shasum": "2f010154f7155220f9b705e469e01fb20655626d" - }, - "_from": "bin-wrapper@~0.1.3", - "_resolved": "https://registry.npmjs.org/bin-wrapper/-/bin-wrapper-0.1.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/package.json b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/package.json deleted file mode 100644 index f830eef..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "optipng-bin", - "version": "0.3.1", - "description": "OptiPNG wrapper that makes it seamlessly available as a local dependency on OS X, Linux, FreeBSD and Windows", - "keywords": [ - "png", - "compress", - "minify", - "optimize", - "img", - "image" - ], - "homepage": "https://github.com/yeoman/node-optipng-bin", - "bugs": { - "url": "https://github.com/yeoman/node-optipng-bin/issues" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "maintainers": [ - { - "name": "Duncan Wong" - }, - { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - } - ], - "main": "lib/optipng", - "bin": { - "optipng": "bin/optipng.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/yeoman/node-optipng-bin.git" - }, - "scripts": { - "test": "mocha", - "postinstall": "node lib/check.js" - }, - "engines": { - "node": ">=0.8.0" - }, - "licenses": [ - { - "type": "BSD" - } - ], - "dependencies": { - "bin-wrapper": "~0.1.3", - "chalk": "~0.2.0" - }, - "devDependencies": { - "mocha": "~1.13.0" - }, - "files": [ - "bin", - "lib" - ], - "readme": "# node-optipng-bin [![Build Status](https://secure.travis-ci.org/yeoman/node-optipng-bin.png?branch=master)](http://travis-ci.org/yeoman/node-optipng-bin)\n\n[OptiPNG](http://optipng.sourceforge.net) 0.7.4 Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux, FreeBSD, Solaris and Windows.\n\n> OptiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information.\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/optipng-bin): `npm install --save optipng-bin`\n\n\n## Example usage\n\n```js\nvar execFile = require('child_process').execFile;\nvar optipngPath = require('optipng-bin').path;\n\nexecFile(optipngPath, ['-v'], function(err, stdout, stderr) {\n console.log('OptiPNG version:', stdout.match(/\\d\\.\\d\\.\\d/)[0]);\n});\n```\n\nCan also be run directly from `./node_modules/.bin/optipng`.\n\n\n## License\n\nEverything excluding the binaries licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google.\n\nOptiPNG licensed under the [zlib license](http://optipng.sourceforge.net/license.txt) and copyright Cosmin Truta and the Contributing Authors.\n", - "readmeFilename": "readme.md", - "_id": "optipng-bin@0.3.1", - "dist": { - "shasum": "d3eee5ee9dfcc8d7ae2086fd8f9dcec084c6e79b" - }, - "_from": "optipng-bin@~0.3.0", - "_resolved": "https://registry.npmjs.org/optipng-bin/-/optipng-bin-0.3.1.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/readme.md b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/readme.md deleted file mode 100644 index db45322..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# node-optipng-bin [![Build Status](https://secure.travis-ci.org/yeoman/node-optipng-bin.png?branch=master)](http://travis-ci.org/yeoman/node-optipng-bin) - -[OptiPNG](http://optipng.sourceforge.net) 0.7.4 Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux, FreeBSD, Solaris and Windows. - -> OptiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information. - -## Install - -Install with [npm](https://npmjs.org/package/optipng-bin): `npm install --save optipng-bin` - - -## Example usage - -```js -var execFile = require('child_process').execFile; -var optipngPath = require('optipng-bin').path; - -execFile(optipngPath, ['-v'], function(err, stdout, stderr) { - console.log('OptiPNG version:', stdout.match(/\d\.\d\.\d/)[0]); -}); -``` - -Can also be run directly from `./node_modules/.bin/optipng`. - - -## License - -Everything excluding the binaries licensed under the [BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google. - -OptiPNG licensed under the [zlib license](http://optipng.sourceforge.net/license.txt) and copyright Cosmin Truta and the Contributing Authors. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/vendor/optipng b/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/vendor/optipng deleted file mode 100755 index 069639b..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/vendor/optipng and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/bin/pngquant.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/bin/pngquant.js deleted file mode 100755 index bf2f587..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/bin/pngquant.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var binPath = require('../lib/pngquant').path; -var spawn = require('child_process').spawn; - -spawn(binPath, process.argv.slice(2), { stdio: 'inherit' }) - .on('exit', process.exit); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/lib/check.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/lib/check.js deleted file mode 100644 index d6f6126..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/lib/check.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var bin = require('./pngquant').bin; -var chalk = require('chalk'); - -bin.check(function (w) { - if (!w) { - console.log(chalk.red('✗ pre-build test failed, compiling from source...')); - - if (process.platform === 'win32') { - throw new Error('building is not supported on ' + process.platform); - } - - return bin.build(function (err) { - if (err) { - return console.log(chalk.red('✗ ' + err.message)); - } - - console.log(chalk.green('✓ pngquant rebuilt successfully')); - }); - } - - console.log(chalk.green('✓ pre-build test passed successfully')); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/lib/pngquant.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/lib/pngquant.js deleted file mode 100644 index aa186dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/lib/pngquant.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var Bin = require('bin-wrapper'); -var path = require('path'); - -var options = { - name: 'pngquant', - bin: 'pngquant', - path: path.join(__dirname, '../vendor'), - src: 'https://github.com/pornel/pngquant/archive/2.0.0.tar.gz', - buildScript: 'make install BINPREFIX="' + path.join(__dirname, '../vendor') + '"', - platform: { - darwin: { - url: 'https://raw.github.com/sindresorhus/node-pngquant-bin/master/vendor/osx/pngquant' - }, - linux: { - url: 'https://raw.github.com/sindresorhus/node-pngquant-bin/master/vendor/linux/x86/pngquant', - arch: { - x64: { - url: 'https://raw.github.com/sindresorhus/node-pngquant-bin/master/vendor/linux/x64/pngquant' - } - } - }, - win32: { - bin: 'pngquant.exe', - url: 'https://raw.github.com/sindresorhus/node-pngquant-bin/master/vendor/win/pngquant.exe' - } - } -}; -var bin = new Bin(options); - -exports.bin = bin; -exports.options = options; -exports.path = bin.path; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/README.md deleted file mode 100644 index 05419cd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# bin-wrapper [![Build Status](https://secure.travis-ci.org/kevva/bin-wrapper.png?branch=master)](http://travis-ci.org/kevva/bin-wrapper) - -Binary wrapper for Node.js that makes your programs seamlessly available as local dependencies - -## Getting started - -Install with [npm](https://npmjs.org/package/bin-wrapper): `npm install bin-wrapper` - -## Examples - -All `platform` and `arch` specific options takes precedence over the base -options. See [test.js](test.js) for a full fleshed example. - -```js -var Bin = require('bin-wrapper'); - -var opts = { - name: 'Gifsicle', - bin: 'gifsicle', - path: 'vendor', - url: 'http://url/to/gifsicle', - src: 'http://www.lcdf.org/gifsicle/gifsicle-1.71.tar.gz', - buildScript: './configure --bindir="vendor" && make install', - platform: { - win32: { - bin: 'gifsicle.exe', - url: [ - 'http://url/to/gifsicle.exe' - 'http://url/to/gifsicle.dll' - ] - } - } -} -var bin = new Bin(opts); - -bin.check('--version', function (works) { - if (!works) { - console.log('Pre-build test failed, compiling from source'); - return bin.build(); - } - - console.log('Binary passed the test'); -}); -``` - -Get the path to your binary with `bin.path`. - -```js -console.log(bin.path); -// => path/to/vendor/gifsicle -``` - -## API - -### .check(cmd, cb) - -Check if a binary is present and working. If it isn't, download and test it by -running the binary with `cmd` and see if it exits correctly. - -### .build(cb) - -Download the source archive defined in the `src` property and build it using the -build script defined in the `buildScript` property. - -## License - -[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/bin-wrapper.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/bin-wrapper.js deleted file mode 100644 index 33227ac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/bin-wrapper.js +++ /dev/null @@ -1,221 +0,0 @@ -'use strict'; - -var download = require('download'); -var exec = require('child_process').exec; -var fs = require('fs'); -var isbin = require('isbin'); -var mout = require('mout'); -var os = require('os'); -var path = require('path'); -var ProgressBar = require('progress'); -var spawn = require('child_process').spawn; -var which = require('which'); - -/** - * Initialize BinWrapper with options - * - * @param {Object} opts - * @api public - */ - -function BinWrapper(opts) { - opts = opts || {}; - this.opts = this._parse(opts); - this.name = this.opts.name; - this.bin = this.opts.bin; - this.dest = this.opts.path; - this.path = this._path() || path.join(this.dest, this.bin); - this.url = this.opts.url; - this.src = this.opts.src; - this.buildScript = this.opts.buildScript; - this.proxy = process.env.http_proxy || - process.env.HTTP_PROXY || - process.env.https_proxy || - process.env.HTTPS_PROXY || - null; -} - -/** - * Check if a binary is present and working - * - * @param {String|Array} cmd - * @param {Function} cb - * @api public - */ - -BinWrapper.prototype.check = function (cmd, cb) { - var self = this; - - if (!cb && mout.lang.isFunction(cmd)) { - cb = cmd; - cmd = ['--help']; - } - - cmd = cmd; - cmd = Array.isArray(cmd) ? cmd : [cmd]; - - if (this._path()) { - return self._test(cmd, cb); - } - - this._download(this.url, this.dest, { mode: '0755', proxy: this.proxy }) - .on('close', function () { - return self._test(cmd, cb); - }); -}; - -/** - * Download source and build a binary - * - * @param {Function} cb - * @api public - */ - -BinWrapper.prototype.build = function (cb) { - var self = this; - var tmpDir = os.tmpdir ? os.tmpdir() : os.tmpDir(); - var tmp = path.join(tmpDir, this.name); - var get = this._download(this.src, tmp, { extract: true, strip: '1', proxy: this.proxy }); - - if (!cb || !mout.lang.isFunction(cb)) { - cb = function () {}; - } - - if (!isbin('make')) { - throw new Error('failed to find make'); - } - - get.on('close', function () { - exec(self.buildScript, { cwd: tmp }, function (err) { - if (err) { - return cb(err); - } - - return cb(); - }); - }); -}; - -/** - * Download a string or an array of files - * - * @param {String|Array} src - * @param {String} dest - * @param {Object} opts - * @api private - */ - -BinWrapper.prototype._download = function (src, dest, opts) { - var get = download(src, dest, opts); - - get.on('response', function (res) { - var len = parseInt(res.headers['content-length'], 10); - var bar = new ProgressBar(' ' + path.basename(src) + ': downloading [:bar] :percent :etas', { - complete: '=', - incomplete: ' ', - width: 20, - total: len - }); - - res.on('data', function (data) { - bar.tick(data.length); - }); - - res.on('end', function () { - console.log('\n'); - }); - }); - - return get; -}; - -/** - * If a binary exists, get its path - * - * @api private - */ - -BinWrapper.prototype._path = function () { - var self = this; - - if (fs.existsSync(path.join(this.dest, this.bin))) { - return path.join(self.dest, self.bin); - } - - if (isbin(this.bin)) { - if (!which.sync(self.bin).indexOf('node_modules/.bin')) { - return which.sync(self.bin); - } - } - - return false; -}; - -/** - * Test if a binary is working by checking its exit code - * - * @param {Array} cmd - * @param {Function} cb - * @api private - */ - -BinWrapper.prototype._test = function (cmd, cb) { - var working; - var bin = spawn(this.path, cmd); - - bin.on('error', function () { - working = false; - return cb(working); - }); - - bin.on('exit', function (code) { - working = code === 0; - return cb(working); - }); -}; - -/** - * Parse options - * - * @param {Object} opts - * @api private - */ - -BinWrapper.prototype._parse = function (opts) { - opts.platform = opts.platform || {}; - opts.arch = opts.arch || {}; - - var platform = process.platform; - var arch = process.arch === 'x64' ? 'x64' : 'x86'; - var required = [ - 'bin', - 'name', - 'path', - 'url' - ]; - - if (mout.object.hasOwn(opts.platform, [platform])) { - opts = mout.object.mixIn(opts, opts.platform[platform]); - } - - if (mout.object.hasOwn(opts.arch, [arch])) { - opts = mout.object.mixIn(opts, opts.arch[arch]); - } - - required.forEach(function (val) { - if (!mout.object.hasOwn(opts, val)) { - throw new Error(val + ' option is required'); - } - }); - - delete opts.platform; - delete opts.arch; - - return opts; -}; - -/** - * Module exports - */ - -module.exports = BinWrapper; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/.bin/which b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/.bin/which deleted file mode 120000 index f62471c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/README.md deleted file mode 100644 index a9cca0a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# download [![Build Status](https://secure.travis-ci.org/kevva/download.png?branch=master)](http://travis-ci.org/kevva/download) - -Download and extract files effortlessly in Node.js. - -## Getting started - -Install with [npm](https://npmjs.org/package/download): `npm install download` - -## Examples - -If you're fetching an archive you can set `extract: true` in options and -it'll extract it for you. - -```js -var download = require('download'); - -// download and extract `foo.tar.gz` into `bar/` -download('foo.tar.gz', 'bar', { extract: true }); - -// download and save `foo.exe` into `bar/foo.exe` with mode `0755` -download('foo.exe', 'bar', { mode: '0755' }); - -// download and save an array of files in `bar/` -var files = ['foo.jpg', 'bar.jpg', 'cat.jpg']; -download(files, 'bar'); -``` - -## API - -### download(url, dest, opts) - -Download a file or an array of files to a given destination. - -## Options - -* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/) -* `mode` — Set mode on the downloaded files -* `strip` — Equivalent to `--strip-components` for tar - -You can also define options accepted by the [request](https://github.com/mikeal/request/) module. - -## License - -[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/download.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/download.js deleted file mode 100644 index 43efa9f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/download.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -var decompress = require('decompress'); -var forEach = require('async-foreach').forEach; -var fs = require('fs'); -var mkdir = require('mkdirp'); -var path = require('path'); -var request = require('request'); -var stream = require('through2')(); - -/** - * Download a file to a given destination - * - * Options: - * - * - `extract` Try extracting the file - * - `mode` Set mode on the downloaded files - * - `strip` Equivalent to --strip-components for tar - * - * @param {String|Array} url - * @param {String} dest - * @param {Object} opts - * @api public - */ - -module.exports = function (url, dest, opts) { - url = Array.isArray(url) ? url : [url]; - - forEach(url, function (url) { - opts = opts || {}; - opts.url = url; - opts.dest = path.join(dest, path.basename(url)); - opts.strip = opts.strip || '0'; - - var req = request.get(opts) - .on('response', function (res) { - stream.emit('response', res); - }) - .on('data', function (data) { - stream.emit('data', data); - }) - .on('error', function (err) { - stream.emit('error', err); - }); - - req.on('response', function (res) { - var mime = res.headers['content-type']; - var status = res.statusCode; - var end; - - if (status < 200 || status >= 300) { - return; - } - - if (opts.extract && decompress.canExtract(url, mime)) { - var ext; - - if (decompress.canExtract(url)) { - ext = url; - } else { - ext = mime; - } - - end = decompress.extract({ ext: ext, path: dest, strip: opts.strip }); - } else { - if (!fs.existsSync(dest)) { - mkdir.sync(dest); - } - - end = fs.createWriteStream(opts.dest); - } - - req.pipe(end); - - end.on('close', function () { - if (!opts.extract && opts.mode) { - fs.chmodSync(opts.dest, opts.mode); - } - - stream.emit('close'); - }); - }); - }); - - return stream; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/LICENSE-MIT b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/LICENSE-MIT deleted file mode 100644 index 7505716..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2011 "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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/README.md deleted file mode 100644 index f574204..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/README.md +++ /dev/null @@ -1,195 +0,0 @@ -# JavaScript Sync/Async forEach - -An optionally-asynchronous forEach with an interesting interface. - -## Getting Started - -This code should work just fine in Node.js: - -First, install the module with: `npm install async-foreach` - -```javascript -var forEach = require('async-foreach').forEach; -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); -}); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -``` - -Or in the browser: - -```html - - -``` - -In the browser, you can attach the forEach method to any object. - -```html - - - -``` - -## The General Idea (Why I thought this was worth sharing) - -The idea is to allow the callback to decide _at runtime_ whether the loop will be synchronous or asynchronous. By using `this` in a creative way (in situations where that value isn't already spoken for), an entire control API can be offered without over-complicating function signatures. - -```javascript -forEach(arr, function(item, index) { - // Synchronous. -}); - -forEach(arr, function(item, index) { - // Only when `this.async` is called does iteration becomes asynchronous. The - // loop won't be continued until the `done` function is executed. - var done = this.async(); - // Continue in one second. - setTimeout(done, 1000); -}); - -forEach(arr, function(item, index) { - // Break out of synchronous iteration early by returning false. - return index !== 1; -}); - -forEach(arr, function(item, index) { - // Break out of asynchronous iteration early... - var done = this.async(); - // ...by passing false to the done function. - setTimeout(function() { - done(index !== 1); - }); -}); -``` - -## Examples -See the unit tests for more examples. - -```javascript -// Generic "done" callback. -function allDone(notAborted, arr) { - console.log("done", notAborted, arr); -} - -// Synchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Synchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - if (item === "b") { return false; } -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] - -// Asynchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(); - }, 500); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Asynchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(item !== "b"); - }, 500); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] - -// Not actually asynchronous. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async() - done(); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// each c 2 ["a", "b", "c"] -// done true ["a", "b", "c"] - -// Not actually asynchronous with early abort. -forEach(["a", "b", "c"], function(item, index, arr) { - console.log("each", item, index, arr); - var done = this.async(); - done(item !== "b"); -}, allDone); -// logs: -// each a 0 ["a", "b", "c"] -// each b 1 ["a", "b", "c"] -// done false ["a", "b", "c"] -``` - -## 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](https://github.com/cowboy/grunt). - -_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_ - -## Release History - -04/29/2013 -v0.1.3 -Removed hard Node.js version dependency. - -11/17/2011 -v0.1.2 -Adding sparse array support. -Invalid length properties are now sanitized. -This closes issue #1 (like a boss). - -11/11/2011 -v0.1.1 -Refactored code to be much simpler. Yay for unit tests! - -11/11/2011 -v0.1.0 -Initial Release. - -## License -Copyright (c) 2012 "Cowboy" Ben Alman -Licensed under the MIT license. - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js deleted file mode 100644 index 64c6eb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.js +++ /dev/null @@ -1,58 +0,0 @@ -/* JavaScript Sync/Async forEach - v0.1.2 - 1/10/2012 - * http://github.com/cowboy/javascript-sync-async-foreach - * Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ - -(function(exports) { - - // Iterate synchronously or asynchronously. - exports.forEach = function(arr, eachFn, doneFn) { - var i = -1; - // Resolve array length to a valid (ToUint32) number. - var len = arr.length >>> 0; - - // This IIFE is called once now, and then again, by name, for each loop - // iteration. - (function next(result) { - // This flag will be set to true if `this.async` is called inside the - // eachFn` callback. - var async; - // Was false returned from the `eachFn` callback or passed to the - // `this.async` done function? - var abort = result === false; - - // Increment counter variable and skip any indices that don't exist. This - // allows sparse arrays to be iterated. - do { ++i; } while (!(i in arr) && i !== len); - - // Exit if result passed to `this.async` done function or returned from - // the `eachFn` callback was false, or when done iterating. - if (abort || i === len) { - // If a `doneFn` callback was specified, invoke that now. Pass in a - // boolean value representing "not aborted" state along with the array. - if (doneFn) { - doneFn(!abort, arr); - } - return; - } - - // Invoke the `eachFn` callback, setting `this` inside the callback to a - // custom object that contains one method, and passing in the array item, - // index, and the array. - result = eachFn.call({ - // If `this.async` is called inside the `eachFn` callback, set the async - // flag and return a function that can be used to continue iterating. - async: function() { - async = true; - return next; - } - }, arr[i], i, arr); - - // If the async flag wasn't set, continue by calling `next` synchronously, - // passing in the result of the `eachFn` callback. - if (!async) { - next(result); - } - }()); - }; - -}(typeof exports === "object" && exports || this)); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js deleted file mode 100644 index c218a91..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/dist/ba-foreach.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/* JavaScript Sync/Async forEach - v0.1.2 - 1/10/2012 - * http://github.com/cowboy/javascript-sync-async-foreach - * Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ -(function(a){a.forEach=function(a,b,c){var d=-1,e=a.length>>>0;(function f(g){var h,j=g===!1;do++d;while(!(d in a)&&d!==e);if(j||d===e){c&&c(!j,a);return}g=b.call({async:function(){return h=!0,f}},a[d],d,a),h||f(g)})()}})(typeof exports=="object"&&exports||this) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js deleted file mode 100644 index 079a23a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/grunt.js +++ /dev/null @@ -1,48 +0,0 @@ -/*global config:true, task:true*/ -config.init({ - pkg: '', - meta: { - title: 'JavaScript Sync/Async forEach', - license: ['MIT'], - copyright: 'Copyright (c) 2012 "Cowboy" Ben Alman', - banner: '/* {{meta.title}} - v{{pkg.version}} - {{today "m/d/yyyy"}}\n' + - ' * {{pkg.homepage}}\n' + - ' * {{{meta.copyright}}}; Licensed {{join meta.license}} */' - }, - concat: { - 'dist/ba-foreach.js': ['', ''] - }, - min: { - 'dist/ba-foreach.min.js': ['', 'dist/ba-foreach.js'] - }, - test: { - files: ['test/**/*.js'] - }, - lint: { - files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] - }, - watch: { - files: '', - tasks: 'lint:files test:files' - }, - jshint: { - options: { - curly: true, - eqeqeq: true, - immed: true, - latedef: true, - newcap: true, - noarg: true, - sub: true, - undef: true, - eqnull: true - }, - globals: { - exports: true - } - }, - uglify: {} -}); - -// Default task. -task.registerTask('default', 'lint:files test:files concat min'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js deleted file mode 100644 index 9ee98b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/lib/foreach.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * Sync/Async forEach - * https://github.com/cowboy/javascript-sync-async-foreach - * - * Copyright (c) 2012 "Cowboy" Ben Alman - * Licensed under the MIT license. - * http://benalman.com/about/license/ - */ - -(function(exports) { - - // Iterate synchronously or asynchronously. - exports.forEach = function(arr, eachFn, doneFn) { - var i = -1; - // Resolve array length to a valid (ToUint32) number. - var len = arr.length >>> 0; - - // This IIFE is called once now, and then again, by name, for each loop - // iteration. - (function next(result) { - // This flag will be set to true if `this.async` is called inside the - // eachFn` callback. - var async; - // Was false returned from the `eachFn` callback or passed to the - // `this.async` done function? - var abort = result === false; - - // Increment counter variable and skip any indices that don't exist. This - // allows sparse arrays to be iterated. - do { ++i; } while (!(i in arr) && i !== len); - - // Exit if result passed to `this.async` done function or returned from - // the `eachFn` callback was false, or when done iterating. - if (abort || i === len) { - // If a `doneFn` callback was specified, invoke that now. Pass in a - // boolean value representing "not aborted" state along with the array. - if (doneFn) { - doneFn(!abort, arr); - } - return; - } - - // Invoke the `eachFn` callback, setting `this` inside the callback to a - // custom object that contains one method, and passing in the array item, - // index, and the array. - result = eachFn.call({ - // If `this.async` is called inside the `eachFn` callback, set the async - // flag and return a function that can be used to continue iterating. - async: function() { - async = true; - return next; - } - }, arr[i], i, arr); - - // If the async flag wasn't set, continue by calling `next` synchronously, - // passing in the result of the `eachFn` callback. - if (!async) { - next(result); - } - }()); - }; - -}(typeof exports === "object" && exports || this)); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json deleted file mode 100644 index a55647b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "name": "async-foreach", - "description": "An optionally-asynchronous forEach with an interesting interface.", - "version": "0.1.3", - "homepage": "http://github.com/cowboy/javascript-sync-async-foreach", - "bugs": { - "url": "https://github.com/cowboy/javascript-sync-async-foreach/issues" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/javascript-sync-async-foreach.git" - }, - "main": "lib/foreach", - "engines": { - "node": "*" - }, - "keywords": [ - "array", - "loop", - "sync", - "async", - "foreach" - ], - "dependencies": {}, - "devDependencies": {}, - "readme": "# JavaScript Sync/Async forEach\n\nAn optionally-asynchronous forEach with an interesting interface.\n\n## Getting Started\n\nThis code should work just fine in Node.js:\n\nFirst, install the module with: `npm install async-foreach`\n\n```javascript\nvar forEach = require('async-foreach').forEach;\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n});\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n```\n\nOr in the browser:\n\n```html\n\n\n```\n\nIn the browser, you can attach the forEach method to any object.\n\n```html\n\n\n\n```\n\n## The General Idea (Why I thought this was worth sharing)\n\nThe idea is to allow the callback to decide _at runtime_ whether the loop will be synchronous or asynchronous. By using `this` in a creative way (in situations where that value isn't already spoken for), an entire control API can be offered without over-complicating function signatures.\n\n```javascript\nforEach(arr, function(item, index) {\n // Synchronous.\n});\n\nforEach(arr, function(item, index) {\n // Only when `this.async` is called does iteration becomes asynchronous. The\n // loop won't be continued until the `done` function is executed.\n var done = this.async();\n // Continue in one second.\n setTimeout(done, 1000);\n});\n\nforEach(arr, function(item, index) {\n // Break out of synchronous iteration early by returning false.\n return index !== 1;\n});\n\nforEach(arr, function(item, index) {\n // Break out of asynchronous iteration early...\n var done = this.async();\n // ...by passing false to the done function.\n setTimeout(function() {\n done(index !== 1);\n });\n});\n```\n\n## Examples\nSee the unit tests for more examples.\n\n```javascript\n// Generic \"done\" callback.\nfunction allDone(notAborted, arr) {\n console.log(\"done\", notAborted, arr);\n}\n\n// Synchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Synchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n if (item === \"b\") { return false; }\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n\n// Asynchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n setTimeout(function() {\n done();\n }, 500);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Asynchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n setTimeout(function() {\n done(item !== \"b\");\n }, 500);\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n\n// Not actually asynchronous.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async()\n done();\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// each c 2 [\"a\", \"b\", \"c\"]\n// done true [\"a\", \"b\", \"c\"]\n\n// Not actually asynchronous with early abort.\nforEach([\"a\", \"b\", \"c\"], function(item, index, arr) {\n console.log(\"each\", item, index, arr);\n var done = this.async();\n done(item !== \"b\");\n}, allDone);\n// logs:\n// each a 0 [\"a\", \"b\", \"c\"]\n// each b 1 [\"a\", \"b\", \"c\"]\n// done false [\"a\", \"b\", \"c\"]\n```\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](https://github.com/cowboy/grunt).\n\n_Also, please don't edit files in the \"dist\" subdirectory as they are generated via grunt. You'll find source code in the \"lib\" subdirectory!_\n\n## Release History\n\n04/29/2013\nv0.1.3\nRemoved hard Node.js version dependency.\n\n11/17/2011\nv0.1.2\nAdding sparse array support.\nInvalid length properties are now sanitized.\nThis closes issue #1 (like a boss).\n\n11/11/2011\nv0.1.1\nRefactored code to be much simpler. Yay for unit tests!\n\n11/11/2011\nv0.1.0\nInitial Release.\n\n## License\nCopyright (c) 2012 \"Cowboy\" Ben Alman \nLicensed under the MIT license. \n\n", - "readmeFilename": "README.md", - "_id": "async-foreach@0.1.3", - "dist": { - "shasum": "fcc0e658c316931d1c56909a12c8370eafc16cfa" - }, - "_from": "async-foreach@~0.1.3", - "_resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js deleted file mode 100644 index be18c43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/async-foreach/test/foreach_test.js +++ /dev/null @@ -1,200 +0,0 @@ -/*global require:true, setTimeout:true */ -var forEach = require('../lib/foreach').forEach; - -exports['foreach'] = { - setUp: function(done) { - this.order = []; - this.track = function() { - [].push.apply(this.order, arguments); - }; - done(); - }, - 'Synchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr - ], "should call eachFn for each array item, in order."); - test.done(); - }, - 'Synchronous, done': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }, - 'Synchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - if (item === "b") { return false; } - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }, - 'Asynchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(done, 10); - }); - - setTimeout(function() { - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr - ], "should call eachFn for each array item, in order."); - test.done(); - }, 100); - }, - 'Asynchronous, done': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(done, 10); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Asynchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - setTimeout(function() { - done(item !== "b"); - }, 10); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Not actually asynchronous': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - done(); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "each", "c", 2, arr, - "done", true, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Not actually asynchronous, early abort': function(test) { - test.expect(1); - var that = this; - - var arr = ["a", "b", "c"]; - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - var done = this.async(); - done(item !== "b"); - }, function(notAborted, arr) { - that.track("done", notAborted, arr); - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "b", 1, arr, - "done", false, arr - ], "should call eachFn for each array item, in order, followed by doneFn."); - test.done(); - }); - }, - 'Sparse array support': function(test) { - test.expect(1); - var that = this; - - var arr = []; - arr[0] = "a"; - arr[9] = "z"; - - forEach(arr, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, arr, - "each", "z", 9, arr - ], "should skip nonexistent array items."); - test.done(); - }, - 'Invalid length sanitization': function(test) { - test.expect(1); - var that = this; - - var obj = {length: 4294967299, 0: "a", 2: "b", 3: "c" }; - - forEach(obj, function(item, index, arr) { - that.track("each", item, index, arr); - }); - - test.deepEqual(that.order, [ - "each", "a", 0, obj, - "each", "b", 2, obj - ], "should sanitize length property (ToUint32)."); - test.done(); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md deleted file mode 100644 index dea4f3d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# decompress [![Build Status](https://secure.travis-ci.org/kevva/decompress.png?branch=master)](http://travis-ci.org/kevva/decompress) - -Easily extract `.zip`, `.tar` and `.tar.gz` archives. Based on the extract -utility in [Bower](https://github.com/bower/bower). - -## Getting started - -Install with [npm](https://npmjs.org/package/decompress): `npm install decompress` - -## Examples - -You'll only need to pass a type into `ext` and it'll figure the rest out for -you. - -```js -var decompress = require('decompress'); -var fs = require('fs'); - -var src = fs.createReadStream('foo.tar.gz'); -var dest = decompress.extract({ ext: '.tar.gz' }); - -src.pipe(dest); -``` - -## API - -### .extract(opts) - -Extract an archive using the `ext` option to determine which extractor to use. -If no `path` is specified it'll extract it to your current location. - -### .canExtract(src, mime) - -Determine if a file can be extracted or not by checking the file extension -and/or the MIME type. - -```js -decompress.canExtract('foo.zip'); -// => true - -decompress.canExtract('application/zip'); -// => true -``` - -## Options - -* `ext` — String that can be a file name, URL, MIME type etc. -* `path` — Path to extract the archive to. If no `path` is defined it'll -extract it to your current location. -* `strip` — Equivalent to `--strip-components` for tar. - -## License - -[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js deleted file mode 100644 index 5c65d4c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/decompress.js +++ /dev/null @@ -1,167 +0,0 @@ -'use strict'; - -var AdmZip = require('adm-zip'); -var fs = require('fs'); -var mkdir = require('mkdirp'); -var mout = require('mout'); -var path = require('path'); -var pipeline = require('stream-combiner'); -var rm = require('rimraf'); -var tar = require('tar'); -var temp = require('temp'); -var zlib = require('zlib'); - -/** - * Initialize Decompress with options - * - * Options: - * - * - `ext` String with file name, MIME type, etc - * - `path` Path to extract to - * - * @param {Object} opts - * @api private - */ - -function Decompress(opts) { - opts = opts || {}; - opts.strip = opts.strip || 0; - this.opts = opts; - this.path = opts.path || process.cwd(); - this.ext = opts.ext || ''; - this.strip = opts.strip >= 0 ? opts.strip : 0; - this.extractors = { - '.zip': this._extractZip, - '.tar': this._extractTar, - '.tar.gz': this._extractTarGz, - '.tgz': this._extractTarGz, - 'application/zip': this._extractZip, - 'application/x-tar': this._extractTar, - 'application/x-tgz': this._extractTarGz - }; - this.extractorTypes = Object.keys(this.extractors); - this.extractor = this._getExtractor(this.ext); -} - -/** - * Extract an archive - * - * @api public - */ - -Decompress.prototype.extract = function () { - var self = this; - var stream = this.extractor(); - - if (!fs.existsSync(this.path)) { - mkdir.sync(self.path); - } - - return stream; -}; - -/** - * Check if a file can be extracted - * - * @param {String} src - * @param {String} mime - * @api public - */ - -Decompress.prototype.canExtract = function (src, mime) { - if (this._getExtractor(src)) { - return true; - } - - if (mime && this._getExtractor(mime)) { - return true; - } - - return false; -}; - -/** - * Get the extractor for a desired file - * - * @param {String} src - * @api private - */ - -Decompress.prototype._getExtractor = function (src) { - src = src.toLowerCase(); - - var ext = mout.array.find(this.extractorTypes, function (ext) { - return mout.string.endsWith(src, ext); - }); - - return ext ? this.extractors[ext] : null; -}; - -/** - * Extract a zip file - * - * @api private - */ - -Decompress.prototype._extractZip = function () { - var self = this; - var tmp = temp.path({ suffix: '.zip' }); - - var stream = fs.createWriteStream(tmp).on('close', function () { - var zip = new AdmZip(tmp); - var zipEntries = zip.getEntries(); - - zipEntries.forEach(function (entry) { - var e = entry.entryName.toString().split('/').slice(self.strip).join('/'); - var d = path.join(self.path, e); - var c = entry.getData().toString(); - - if (!entry.isDirectory) { - mkdir.sync(path.dirname(d)); - fs.writeFileSync(d, c); - } - }); - }); - - return stream.on('close', function () { - rm.sync(tmp); - }); -}; - -/** - * Extract a tar file - * - * @api private - */ - -Decompress.prototype._extractTar = function () { - var stream = tar.Extract(this.opts); - return stream; -}; - -/** - * Extract a tar.gz file - * - * @api private - */ - -Decompress.prototype._extractTarGz = function () { - var stream = zlib.Unzip(); - var dest = tar.Extract(this.opts); - - return pipeline(stream, dest); -}; - -/** - * Module exports - */ - -module.exports.extract = function (opts) { - var decompress = new Decompress(opts); - return decompress.extract(); -}; - -module.exports.canExtract = function (src, mime) { - var decompress = new Decompress(); - return decompress.canExtract(src, mime); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt deleted file mode 100644 index 14c3ee5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/MIT-LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2012 Another-D-Mention Software and other contributors, -http://www.another-d-mention.ro/ - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md deleted file mode 100644 index 84296fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# ADM-ZIP for NodeJS - -ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/). - -# Installation - -With [npm](http://npmjs.org) do: - - $ npm install adm-zip - -## What is it good for? -The library allows you to: - -* decompress zip files directly to disk or in memory buffers -* compress files and store them to disk in .zip format or in compressed buffers -* update content of/add new/delete files from an existing .zip - -# Dependencies -There are no other nodeJS libraries that ADM-ZIP is dependent of - -# Examples - -## Basic usage -```javascript - - var AdmZip = require('adm-zip'); - - // reading archives - var zip = new AdmZip("./my_file.zip"); - var zipEntries = zip.getEntries(); // an array of ZipEntry records - - zipEntries.forEach(function(zipEntry) { - console.log(zipEntry.toString()); // outputs zip entries information - if (zipEntry.entryName == "my_file.txt") { - console.log(zipEntry.data.toString('utf8')); - } - }); - // outputs the content of some_folder/my_file.txt - console.log(zip.readAsText("some_folder/my_file.txt")); - // extracts the specified file to the specified location - zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*overwrite*/true) - // extracts everything - zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); - - - // creating archives - var zip = new AdmZip(); - - // add file directly - zip.addFile("test.txt", new Buffer("inner content of the file"), "entry comment goes here"); - // add local file - zip.addLocalFile("/home/me/some_picture.png"); - // get everything as a buffer - var willSendthis = zip.toBuffer(); - // or write everything to disk - zip.writeZip(/*target file name*/"/home/me/files.zip"); - - - // ... more examples in the wiki -``` - -For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki). - -[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js deleted file mode 100644 index fcfa00b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/adm-zip.js +++ /dev/null @@ -1,387 +0,0 @@ -var fs = require("fs"), - pth = require("path"); - -fs.existsSync = fs.existsSync || pth.existsSync; - -var ZipEntry = require("./zipEntry"), - ZipFile = require("./zipFile"), - Utils = require("./util"); - -module.exports = function(/*String*/input) { - var _zip = undefined, - _filename = ""; - - if (input && typeof input === "string") { // load zip file - if (fs.existsSync(input)) { - _filename = input; - _zip = new ZipFile(input, Utils.Constants.FILE); - } else { - throw Utils.Errors.INVALID_FILENAME; - } - } else if(input && Buffer.isBuffer(input)) { // load buffer - _zip = new ZipFile(input, Utils.Constants.BUFFER); - } else { // create new zip file - _zip = new ZipFile(null, Utils.Constants.NONE); - } - - function getEntry(/*Object*/entry) { - if (entry && _zip) { - var item; - // If entry was given as a file name - if (typeof entry === "string") - item = _zip.getEntry(entry); - // if entry was given as a ZipEntry object - if (typeof entry === "object" && entry.entryName != undefined && entry.header != undefined) - item = _zip.getEntry(entry.entryName); - - if (item) { - return item; - } - } - return null; - } - - return { - /** - * Extracts the given entry from the archive and returns the content as a Buffer object - * @param entry ZipEntry object or String with the full path of the entry - * - * @return Buffer or Null in case of error - */ - readFile : function(/*Object*/entry) { - var item = getEntry(entry); - return item && item.getData() || null; - }, - - /** - * Asynchronous readFile - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * - * @return Buffer or Null in case of error - */ - readFileAsync : function(/*Object*/entry, /*Function*/callback) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(callback); - } else { - callback(null,"getEntry failed for:" + entry) - } - }, - - /** - * Extracts the given entry from the archive and returns the content as plain text in the given encoding - * @param entry ZipEntry object or String with the full path of the entry - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsText : function(/*Object*/entry, /*String - Optional*/encoding) { - var item = getEntry(entry); - if (item) { - var data = item.getData(); - if (data && data.length) { - return data.toString(encoding || "utf8"); - } - } - return ""; - }, - - /** - * Asynchronous readAsText - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsTextAsync : function(/*Object*/entry, /*Function*/callback, /*String - Optional*/encoding) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(function(data) { - if (data && data.length) { - callback(data.toString(encoding || "utf8")); - } else { - callback(""); - } - }) - } else { - callback(""); - } - }, - - /** - * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory - * - * @param entry - */ - deleteFile : function(/*Object*/entry) { // @TODO: test deleteFile - var item = getEntry(entry); - if (item) { - _zip.deleteEntry(item.entryName); - } - }, - - /** - * Adds a comment to the zip. The zip must be rewritten after adding the comment. - * - * @param comment - */ - addZipComment : function(/*String*/comment) { // @TODO: test addZipComment - _zip.comment = comment; - }, - - /** - * Returns the zip comment - * - * @return String - */ - getZipComment : function() { - return _zip.comment || ''; - }, - - /** - * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment - * The comment cannot exceed 65535 characters in length - * - * @param entry - * @param comment - */ - addZipEntryComment : function(/*Object*/entry,/*String*/comment) { - var item = getEntry(entry); - if (item) { - item.comment = comment; - } - }, - - /** - * Returns the comment of the specified entry - * - * @param entry - * @return String - */ - getZipEntryComment : function(/*Object*/entry) { - var item = getEntry(entry); - if (item) { - return item.comment || ''; - } - return '' - }, - - /** - * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content - * - * @param entry - * @param content - */ - updateFile : function(/*Object*/entry, /*Buffer*/content) { - var item = getEntry(entry); - if (item) { - item.setData(content); - } - }, - - /** - * Adds a file from the disk to the archive - * - * @param localPath - */ - addLocalFile : function(/*String*/localPath) { - if (fs.existsSync(localPath)) { - var p = localPath.split("\\").join("/").split("/").pop(); - this.addFile(p, fs.readFileSync(localPath), "", 0) - } else { - throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath); - } - }, - - /** - * Adds a local directory and all its nested files and directories to the archive - * - * @param localPath - */ - addLocalFolder : function(/*String*/localPath) { - localPath = localPath.split("\\").join("/"); //windows fix - if (localPath.charAt(localPath.length - 1) != "/") - localPath += "/"; - - if (fs.existsSync(localPath)) { - - var items = Utils.findFiles(localPath), - self = this; - - if (items.length) { - items.forEach(function(path) { - var p = path.split("\\").join("/").replace(localPath, ""); //windows fix - if (p.charAt(p.length - 1) !== "/") { - self.addFile(p, fs.readFileSync(path), "", 0) - } else { - self.addFile(p, new Buffer(0), "", 0) - } - }); - } - } else { - throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath); - } - }, - - /** - * Allows you to create a entry (file or directory) in the zip file. - * If you want to create a directory the entryName must end in / and a null buffer should be provided. - * Comment and attributes are optional - * - * @param entryName - * @param content - * @param comment - * @param attr - */ - addFile : function(/*String*/entryName, /*Buffer*/content, /*String*/comment, /*Number*/attr) { - var entry = new ZipEntry(); - entry.entryName = entryName; - entry.comment = comment || ""; - entry.attr = attr || 0666; - if (entry.isDirectory && content.length) { - // throw Utils.Errors.DIRECTORY_CONTENT_ERROR; - } - entry.setData(content); - _zip.setEntry(entry); - }, - - /** - * Returns an array of ZipEntry objects representing the files and folders inside the archive - * - * @return Array - */ - getEntries : function() { - if (_zip) { - return _zip.entries; - } else { - return []; - } - }, - - /** - * Returns a ZipEntry object representing the file or folder specified by ``name``. - * - * @param name - * @return ZipEntry - */ - getEntry : function(/*String*/name) { - return getEntry(name); - }, - - /** - * Extracts the given entry to the given targetPath - * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted - * - * @param entry ZipEntry object or String with the full path of the entry - * @param targetPath Target folder where to write the file - * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder - * will be created in targetPath as well. Default is TRUE - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - * - * @return Boolean - */ - extractEntryTo : function(/*Object*/entry, /*String*/targetPath, /*Boolean*/maintainEntryPath, /*Boolean*/overwrite) { - overwrite = overwrite || false; - maintainEntryPath = typeof maintainEntryPath == "undefined" ? true : maintainEntryPath; - - var item = getEntry(entry); - if (!item) { - throw Utils.Errors.NO_ENTRY; - } - - var target = pth.resolve(targetPath, maintainEntryPath ? item.entryName : pth.basename(item.entryName)); - - if (item.isDirectory) { - target = pth.resolve(target, ".."); - var children = _zip.getEntryChildren(item); - children.forEach(function(child) { - if (child.isDirectory) return; - var content = child.getData(); - if (!content) { - throw Utils.Errors.CANT_EXTRACT_FILE; - } - Utils.writeFileTo(pth.resolve(targetPath, maintainEntryPath ? child.entryName : child.entryName.substr(item.entryName.length)), content, overwrite); - }); - return true; - } - - var content = item.getData(); - if (!content) throw Utils.Errors.CANT_EXTRACT_FILE; - - if (fs.existsSync(targetPath) && !overwrite) { - throw Utils.Errors.CANT_OVERRIDE; - } - Utils.writeFileTo(target, content, overwrite); - - return true; - }, - - /** - * Extracts the entire archive to the given location - * - * @param targetPath Target location - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - */ - extractAllTo : function(/*String*/targetPath, /*Boolean*/overwrite) { - overwrite = overwrite || false; - if (!_zip) { - throw Utils.Errors.NO_ZIP; - } - - _zip.entries.forEach(function(entry) { - if (entry.isDirectory) { - Utils.makeDir(pth.resolve(targetPath, entry.entryName.toString())); - return; - } - var content = entry.getData(); - if (!content) { - throw Utils.Errors.CANT_EXTRACT_FILE + "2"; - } - Utils.writeFileTo(pth.resolve(targetPath, entry.entryName.toString()), content, overwrite); - }) - }, - - /** - * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip - * - * @param targetFileName - * @param callback - */ - writeZip : function(/*String*/targetFileName, /*Function*/callback) { - if (arguments.length == 1) { - if (typeof targetFileName == "function") { - callback = targetFileName; - targetFileName = ""; - } - } - - if (!targetFileName && _filename) { - targetFileName = _filename; - } - if (!targetFileName) return; - - var zipData = _zip.compressToBuffer(); - if (zipData) { - Utils.writeFileTo(targetFileName, zipData, true); - } - }, - - /** - * Returns the content of the entire zip file as a Buffer object - * - * @return Buffer - */ - toBuffer : function(/*Function*/callback) { - this.valueOf = 2; - if (typeof callback == "function") { - _zip.toAsyncBuffer(callback); - return null; - } - return _zip.compressToBuffer() - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js deleted file mode 100644 index a29c70f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/entryHeader.js +++ /dev/null @@ -1,261 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The central directory file header */ -module.exports = function () { - var _verMade = 0x0A, - _version = 0x0A, - _flags = 0, - _method = 0, - _time = 0, - _crc = 0, - _compressedSize = 0, - _size = 0, - _fnameLen = 0, - _extraLen = 0, - - _comLen = 0, - _diskStart = 0, - _inattr = 0, - _attr = 0, - _offset = 0; - - var _dataHeader = {}; - - function setTime(val) { - var val = new Date(val); - _time = (val.getFullYear() - 1980 & 0x7f) << 25 // b09-16 years from 1980 - | (val.getMonth() + 1) << 21 // b05-08 month - | val.getDay() << 16 // b00-04 hour - - // 2 bytes time - | val.getHours() << 11 // b11-15 hour - | val.getMinutes() << 5 // b05-10 minute - | val.getSeconds() >> 1; // b00-04 seconds divided by 2 - } - - setTime(+new Date()); - - return { - get made () { return _verMade; }, - set made (val) { _verMade = val; }, - - get version () { return _version; }, - set version (val) { _version = val }, - - get flags () { return _flags }, - set flags (val) { _flags = val; }, - - get method () { return _method; }, - set method (val) { _method = val; }, - - get time () { return new Date( - ((_time >> 25) & 0x7f) + 1980, - ((_time >> 21) & 0x0f) - 1, - (_time >> 16) & 0x1f, - (_time >> 11) & 0x1f, - (_time >> 5) & 0x3f, - (_time & 0x1f) << 1 - ); - }, - set time (val) { - setTime(val); - }, - - get crc () { return _crc; }, - set crc (val) { _crc = val; }, - - get compressedSize () { return _compressedSize; }, - set compressedSize (val) { _compressedSize = val; }, - - get size () { return _size; }, - set size (val) { _size = val; }, - - get fileNameLength () { return _fnameLen; }, - set fileNameLength (val) { _fnameLen = val; }, - - get extraLength () { return _extraLen }, - set extraLength (val) { _extraLen = val; }, - - get commentLength () { return _comLen }, - set commentLength (val) { _comLen = val }, - - get diskNumStart () { return _diskStart }, - set diskNumStart (val) { _diskStart = val }, - - get inAttr () { return _inattr }, - set inAttr (val) { _inattr = val }, - - get attr () { return _attr }, - set attr (val) { _attr = val }, - - get offset () { return _offset }, - set offset (val) { _offset = val }, - - get encripted () { return (_flags & 1) == 1 }, - - get entryHeaderSize () { - return Constants.CENHDR + _fnameLen + _extraLen + _comLen; - }, - - get realDataOffset () { - return _offset + Constants.LOCHDR + _dataHeader.fnameLen + _dataHeader.extraLen; - }, - - get dataHeader () { - return _dataHeader; - }, - - loadDataHeaderFromBinary : function(/*Buffer*/input) { - var data = input.slice(_offset, _offset + Constants.LOCHDR); - // 30 bytes and should start with "PK\003\004" - if (data.readUInt32LE(0) != Constants.LOCSIG) { - throw Utils.Errors.INVALID_LOC; - } - _dataHeader = { - // version needed to extract - version : data.readUInt16LE(Constants.LOCVER), - // general purpose bit flag - flags : data.readUInt16LE(Constants.LOCFLG), - // compression method - method : data.readUInt16LE(Constants.LOCHOW), - // modification time (2 bytes time, 2 bytes date) - time : data.readUInt32LE(Constants.LOCTIM), - // uncompressed file crc-32 value - crc : data.readUInt32LE(Constants.LOCCRC), - // compressed size - compressedSize : data.readUInt32LE(Constants.LOCSIZ), - // uncompressed size - size : data.readUInt32LE(Constants.LOCLEN), - // filename length - fnameLen : data.readUInt16LE(Constants.LOCNAM), - // extra field length - extraLen : data.readUInt16LE(Constants.LOCEXT) - } - }, - - loadFromBinary : function(/*Buffer*/data) { - // data should be 46 bytes and start with "PK 01 02" - if (data.length != Constants.CENHDR || data.readUInt32LE(0) != Constants.CENSIG) { - throw Utils.Errors.INVALID_CEN; - } - // version made by - _verMade = data.readUInt16LE(Constants.CENVEM); - // version needed to extract - _version = data.readUInt16LE(Constants.CENVER); - // encrypt, decrypt flags - _flags = data.readUInt16LE(Constants.CENFLG); - // compression method - _method = data.readUInt16LE(Constants.CENHOW); - // modification time (2 bytes time, 2 bytes date) - _time = data.readUInt32LE(Constants.CENTIM); - // uncompressed file crc-32 value - _crc = data.readUInt32LE(Constants.CENCRC); - // compressed size - _compressedSize = data.readUInt32LE(Constants.CENSIZ); - // uncompressed size - _size = data.readUInt32LE(Constants.CENLEN); - // filename length - _fnameLen = data.readUInt16LE(Constants.CENNAM); - // extra field length - _extraLen = data.readUInt16LE(Constants.CENEXT); - // file comment length - _comLen = data.readUInt16LE(Constants.CENCOM); - // volume number start - _diskStart = data.readUInt16LE(Constants.CENDSK); - // internal file attributes - _inattr = data.readUInt16LE(Constants.CENATT); - // external file attributes - _attr = data.readUInt32LE(Constants.CENATX); - // LOC header offset - _offset = data.readUInt32LE(Constants.CENOFF); - }, - - dataHeaderToBinary : function() { - // LOC header size (30 bytes) - var data = new Buffer(Constants.LOCHDR); - // "PK\003\004" - data.writeUInt32LE(Constants.LOCSIG, 0); - // version needed to extract - data.writeUInt16LE(_version, Constants.LOCVER); - // general purpose bit flag - data.writeUInt16LE(_flags, Constants.LOCFLG); - // compression method - data.writeUInt16LE(_method, Constants.LOCHOW); - // modification time (2 bytes time, 2 bytes date) - data.writeUInt32LE(_time, Constants.LOCTIM); - // uncompressed file crc-32 value - data.writeUInt32LE(_crc, Constants.LOCCRC); - // compressed size - data.writeUInt32LE(_compressedSize, Constants.LOCSIZ); - // uncompressed size - data.writeUInt32LE(_size, Constants.LOCLEN); - // filename length - data.writeUInt16LE(_fnameLen, Constants.LOCNAM); - // extra field length - data.writeUInt16LE(_extraLen, Constants.LOCEXT); - return data; - }, - - entryHeaderToBinary : function() { - // CEN header size (46 bytes) - var data = new Buffer(Constants.CENHDR + _fnameLen + _extraLen + _comLen); - // "PK\001\002" - data.writeUInt32LE(Constants.CENSIG, 0); - // version made by - data.writeUInt16LE(_verMade, Constants.CENVEM); - // version needed to extract - data.writeUInt16LE(_version, Constants.CENVER); - // encrypt, decrypt flags - data.writeUInt16LE(_flags, Constants.CENFLG); - // compression method - data.writeUInt16LE(_method, Constants.CENHOW); - // modification time (2 bytes time, 2 bytes date) - data.writeUInt32LE(_time, Constants.CENTIM); - // uncompressed file crc-32 value - data.writeInt32LE(_crc, Constants.CENCRC, true); - // compressed size - data.writeUInt32LE(_compressedSize, Constants.CENSIZ); - // uncompressed size - data.writeUInt32LE(_size, Constants.CENLEN); - // filename length - data.writeUInt16LE(_fnameLen, Constants.CENNAM); - // extra field length - data.writeUInt16LE(_extraLen, Constants.CENEXT); - // file comment length - data.writeUInt16LE(_comLen, Constants.CENCOM); - // volume number start - data.writeUInt16LE(_diskStart, Constants.CENDSK); - // internal file attributes - data.writeUInt16LE(_inattr, Constants.CENATT); - // external file attributes - data.writeUInt32LE(_attr, Constants.CENATX); - // LOC header offset - data.writeUInt32LE(_offset, Constants.CENOFF); - // fill all with - data.fill(0x00, Constants.CENHDR); - return data; - }, - - toString : function() { - return '{\n' + - '\t"made" : ' + _verMade + ",\n" + - '\t"version" : ' + _version + ",\n" + - '\t"flags" : ' + _flags + ",\n" + - '\t"method" : ' + Utils.methodToString(_method) + ",\n" + - '\t"time" : ' + _time + ",\n" + - '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" + - '\t"compressedSize" : ' + _compressedSize + " bytes,\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"fileNameLength" : ' + _fnameLen + ",\n" + - '\t"extraLength" : ' + _extraLen + " bytes,\n" + - '\t"commentLength" : ' + _comLen + " bytes,\n" + - '\t"diskNumStart" : ' + _diskStart + ",\n" + - '\t"inAttr" : ' + _inattr + ",\n" + - '\t"attr" : ' + _attr + ",\n" + - '\t"offset" : ' + _offset + ",\n" + - '\t"entryHeaderSize" : ' + (Constants.CENHDR + _fnameLen + _extraLen + _comLen) + " bytes\n" + - '}'; - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js deleted file mode 100644 index b8c67b9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.EntryHeader = require("./entryHeader"); -exports.MainHeader = require("./mainHeader"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js deleted file mode 100644 index 002bc8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/headers/mainHeader.js +++ /dev/null @@ -1,80 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The entries in the end of central directory */ -module.exports = function () { - var _volumeEntries = 0, - _totalEntries = 0, - _size = 0, - _offset = 0, - _commentLength = 0; - - return { - get diskEntries () { return _volumeEntries }, - set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; }, - - get totalEntries () { return _totalEntries }, - set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; }, - - get size () { return _size }, - set size (/*Number*/val) { _size = val; }, - - get offset () { return _offset }, - set offset (/*Number*/val) { _offset = val; }, - - get commentLength () { return _commentLength }, - set commentLength (/*Number*/val) { _commentLength = val; }, - - get mainHeaderSize () { - return Constants.ENDHDR + _commentLength; - }, - - loadFromBinary : function(/*Buffer*/data) { - // data should be 22 bytes and start with "PK 05 06" - if (data.length != Constants.ENDHDR || data.readUInt32LE(0) != Constants.ENDSIG) - throw Utils.Errors.INVALID_END; - - // number of entries on this volume - _volumeEntries = data.readUInt16LE(Constants.ENDSUB); - // total number of entries - _totalEntries = data.readUInt16LE(Constants.ENDTOT); - // central directory size in bytes - _size = data.readUInt32LE(Constants.ENDSIZ); - // offset of first CEN header - _offset = data.readUInt32LE(Constants.ENDOFF); - // zip file comment length - _commentLength = data.readUInt16LE(Constants.ENDCOM); - }, - - toBinary : function() { - var b = new Buffer(Constants.ENDHDR + _commentLength); - // "PK 05 06" signature - b.writeUInt32LE(Constants.ENDSIG, 0); - b.writeUInt32LE(0, 4); - // number of entries on this volume - b.writeUInt16LE(_volumeEntries, Constants.ENDSUB); - // total number of entries - b.writeUInt16LE(_totalEntries, Constants.ENDTOT); - // central directory size in bytes - b.writeUInt32LE(_size, Constants.ENDSIZ); - // offset of first CEN header - b.writeUInt32LE(_offset, Constants.ENDOFF); - // zip file comment length - b.writeUInt16LE(_commentLength, Constants.ENDCOM); - // fill comment memory with spaces so no garbage is left there - b.fill(" ", Constants.ENDHDR); - - return b; - }, - - toString : function() { - return '{\n' + - '\t"diskEntries" : ' + _volumeEntries + ",\n" + - '\t"totalEntries" : ' + _totalEntries + ",\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" + - '\t"commentLength" : 0x' + _commentLength + "\n" + - '}'; - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js deleted file mode 100644 index 70137b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/deflater.js +++ /dev/null @@ -1,1565 +0,0 @@ -/* - * $Id: rawdeflate.js,v 0.5 2013/04/09 14:25:38 dankogai Exp dankogai $ - * - * GNU General Public License, version 2 (GPL-2.0) - * http://opensource.org/licenses/GPL-2.0 - * Original: - * http://www.onicos.com/staff/iz/amuse/javascript/expert/deflate.txt - */ -function JSDeflater(/*inbuff*/inbuf) { - - /* Copyright (C) 1999 Masanao Izumo - * Version: 1.0.1 - * LastModified: Dec 25 1999 - */ - - var WSIZE = 32768, // Sliding Window size - zip_STORED_BLOCK = 0, - zip_STATIC_TREES = 1, - zip_DYN_TREES = 2, - zip_DEFAULT_LEVEL = 6, - zip_FULL_SEARCH = true, - zip_INBUFSIZ = 32768, // Input buffer size - zip_INBUF_EXTRA = 64, // Extra buffer - zip_OUTBUFSIZ = 1024 * 8, - zip_window_size = 2 * WSIZE, - MIN_MATCH = 3, - MAX_MATCH = 258, - zip_BITS = 16, - LIT_BUFSIZE = 0x2000, - zip_HASH_BITS = 13, - zip_DIST_BUFSIZE = LIT_BUFSIZE, - zip_HASH_SIZE = 1 << zip_HASH_BITS, - zip_HASH_MASK = zip_HASH_SIZE - 1, - zip_WMASK = WSIZE - 1, - zip_NIL = 0, // Tail of hash chains - zip_TOO_FAR = 4096, - zip_MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1, - zip_MAX_DIST = WSIZE - zip_MIN_LOOKAHEAD, - zip_SMALLEST = 1, - zip_MAX_BITS = 15, - zip_MAX_BL_BITS = 7, - zip_LENGTH_CODES = 29, - zip_LITERALS = 256, - zip_END_BLOCK = 256, - zip_L_CODES = zip_LITERALS + 1 + zip_LENGTH_CODES, - zip_D_CODES = 30, - zip_BL_CODES = 19, - zip_REP_3_6 = 16, - zip_REPZ_3_10 = 17, - zip_REPZ_11_138 = 18, - zip_HEAP_SIZE = 2 * zip_L_CODES + 1, - zip_H_SHIFT = parseInt((zip_HASH_BITS + MIN_MATCH - 1) / MIN_MATCH); - - var zip_free_queue, zip_qhead, zip_qtail, zip_initflag, zip_outbuf = null, zip_outcnt, zip_outoff, zip_complete, - zip_window, zip_d_buf, zip_l_buf, zip_prev, zip_bi_buf, zip_bi_valid, zip_block_start, zip_ins_h, zip_hash_head, - zip_prev_match, zip_match_available, zip_match_length, zip_prev_length, zip_strstart, zip_match_start, zip_eofile, - zip_lookahead, zip_max_chain_length, zip_max_lazy_match, zip_compr_level, zip_good_match, zip_nice_match, - zip_dyn_ltree, zip_dyn_dtree, zip_static_ltree, zip_static_dtree, zip_bl_tree, zip_l_desc, zip_d_desc, zip_bl_desc, - zip_bl_count, zip_heap, zip_heap_len, zip_heap_max, zip_depth, zip_length_code, zip_dist_code, zip_base_length, - zip_base_dist, zip_flag_buf, zip_last_lit, zip_last_dist, zip_last_flags, zip_flags, zip_flag_bit, zip_opt_len, - zip_static_len, zip_deflate_data, zip_deflate_pos; - - var zip_DeflateCT = function () { - this.fc = 0; // frequency count or bit string - this.dl = 0; // father node in Huffman tree or length of bit string - }; - - var zip_DeflateTreeDesc = function () { - this.dyn_tree = null; // the dynamic tree - this.static_tree = null; // corresponding static tree or NULL - this.extra_bits = null; // extra bits for each code or NULL - this.extra_base = 0; // base index for extra_bits - this.elems = 0; // max number of elements in the tree - this.max_length = 0; // max bit length for the codes - this.max_code = 0; // largest code with non zero frequency - }; - - /* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ - var zip_DeflateConfiguration = function (a, b, c, d) { - this.good_length = a; // reduce lazy search above this match length - this.max_lazy = b; // do not perform lazy search above this match length - this.nice_length = c; // quit search above this match length - this.max_chain = d; - }; - - var zip_DeflateBuffer = function () { - this.next = null; - this.len = 0; - this.ptr = new Array(zip_OUTBUFSIZ); - this.off = 0; - }; - - /* constant tables */ - var zip_extra_lbits = new Array( - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0); - var zip_extra_dbits = new Array( - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13); - var zip_extra_blbits = new Array( - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7); - var zip_bl_order = new Array( - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15); - var zip_configuration_table = new Array( - new zip_DeflateConfiguration(0, 0, 0, 0), - new zip_DeflateConfiguration(4, 4, 8, 4), - new zip_DeflateConfiguration(4, 5, 16, 8), - new zip_DeflateConfiguration(4, 6, 32, 32), - new zip_DeflateConfiguration(4, 4, 16, 16), - new zip_DeflateConfiguration(8, 16, 32, 32), - new zip_DeflateConfiguration(8, 16, 128, 128), - new zip_DeflateConfiguration(8, 32, 128, 256), - new zip_DeflateConfiguration(32, 128, 258, 1024), - new zip_DeflateConfiguration(32, 258, 258, 4096)); - - - /* routines (deflate) */ - - var zip_deflate_start = function (level) { - var i; - - if (!level) - level = zip_DEFAULT_LEVEL; - else if (level < 1) - level = 1; - else if (level > 9) - level = 9; - - zip_compr_level = level; - zip_initflag = false; - zip_eofile = false; - if (zip_outbuf != null) - return; - - zip_free_queue = zip_qhead = zip_qtail = null; - zip_outbuf = new Array(zip_OUTBUFSIZ); - zip_window = new Array(zip_window_size); - zip_d_buf = new Array(zip_DIST_BUFSIZE); - zip_l_buf = new Array(zip_INBUFSIZ + zip_INBUF_EXTRA); - zip_prev = new Array(1 << zip_BITS); - zip_dyn_ltree = new Array(zip_HEAP_SIZE); - for (i = 0; i < zip_HEAP_SIZE; i++) zip_dyn_ltree[i] = new zip_DeflateCT(); - zip_dyn_dtree = new Array(2 * zip_D_CODES + 1); - for (i = 0; i < 2 * zip_D_CODES + 1; i++) zip_dyn_dtree[i] = new zip_DeflateCT(); - zip_static_ltree = new Array(zip_L_CODES + 2); - for (i = 0; i < zip_L_CODES + 2; i++) zip_static_ltree[i] = new zip_DeflateCT(); - zip_static_dtree = new Array(zip_D_CODES); - for (i = 0; i < zip_D_CODES; i++) zip_static_dtree[i] = new zip_DeflateCT(); - zip_bl_tree = new Array(2 * zip_BL_CODES + 1); - for (i = 0; i < 2 * zip_BL_CODES + 1; i++) zip_bl_tree[i] = new zip_DeflateCT(); - zip_l_desc = new zip_DeflateTreeDesc(); - zip_d_desc = new zip_DeflateTreeDesc(); - zip_bl_desc = new zip_DeflateTreeDesc(); - zip_bl_count = new Array(zip_MAX_BITS + 1); - zip_heap = new Array(2 * zip_L_CODES + 1); - zip_depth = new Array(2 * zip_L_CODES + 1); - zip_length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zip_dist_code = new Array(512); - zip_base_length = new Array(zip_LENGTH_CODES); - zip_base_dist = new Array(zip_D_CODES); - zip_flag_buf = new Array(parseInt(LIT_BUFSIZE / 8)); - }; - - var zip_deflate_end = function () { - zip_free_queue = zip_qhead = zip_qtail = null; - zip_outbuf = null; - zip_window = null; - zip_d_buf = null; - zip_l_buf = null; - zip_prev = null; - zip_dyn_ltree = null; - zip_dyn_dtree = null; - zip_static_ltree = null; - zip_static_dtree = null; - zip_bl_tree = null; - zip_l_desc = null; - zip_d_desc = null; - zip_bl_desc = null; - zip_bl_count = null; - zip_heap = null; - zip_depth = null; - zip_length_code = null; - zip_dist_code = null; - zip_base_length = null; - zip_base_dist = null; - zip_flag_buf = null; - }; - - var zip_reuse_queue = function (p) { - p.next = zip_free_queue; - zip_free_queue = p; - }; - - var zip_new_queue = function () { - var p; - - if (zip_free_queue != null) { - p = zip_free_queue; - zip_free_queue = zip_free_queue.next; - } - else - p = new zip_DeflateBuffer(); - p.next = null; - p.len = p.off = 0; - - return p; - }; - - var zip_head1 = function (i) { - return zip_prev[WSIZE + i]; - }; - - var zip_head2 = function (i, val) { - return zip_prev[WSIZE + i] = val; - }; - - /* put_byte is used for the compressed output, put_ubyte for the - * uncompressed output. However unlzw() uses window for its - * suffix table instead of its output buffer, so it does not use put_ubyte - * (to be cleaned up). - */ - var zip_put_byte = function (c) { - zip_outbuf[zip_outoff + zip_outcnt++] = c; - if (zip_outoff + zip_outcnt == zip_OUTBUFSIZ) - zip_qoutbuf(); - }; - - /* Output a 16 bit value, lsb first */ - var zip_put_short = function (w) { - w &= 0xffff; - if (zip_outoff + zip_outcnt < zip_OUTBUFSIZ - 2) { - zip_outbuf[zip_outoff + zip_outcnt++] = (w & 0xff); - zip_outbuf[zip_outoff + zip_outcnt++] = (w >>> 8); - } else { - zip_put_byte(w & 0xff); - zip_put_byte(w >>> 8); - } - }; - - /* ========================================================================== - * Insert string s in the dictionary and set match_head to the previous head - * of the hash chain (the most recent string with same hash key). Return - * the previous length of the hash chain. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of s are valid - * (except for the last MIN_MATCH-1 bytes of the input file). - */ - var zip_INSERT_STRING = function () { - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) - ^ (zip_window[zip_strstart + MIN_MATCH - 1] & 0xff)) - & zip_HASH_MASK; - zip_hash_head = zip_head1(zip_ins_h); - zip_prev[zip_strstart & zip_WMASK] = zip_hash_head; - zip_head2(zip_ins_h, zip_strstart); - }; - - /* Send a code of the given tree. c and tree must not have side effects */ - var zip_SEND_CODE = function (c, tree) { - zip_send_bits(tree[c].fc, tree[c].dl); - }; - - /* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. dist_code[256] and dist_code[257] are never - * used. - */ - var zip_D_CODE = function (dist) { - return (dist < 256 ? zip_dist_code[dist] - : zip_dist_code[256 + (dist >> 7)]) & 0xff; - }; - - /* ========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ - var zip_SMALLER = function (tree, n, m) { - return tree[n].fc < tree[m].fc || - (tree[n].fc == tree[m].fc && zip_depth[n] <= zip_depth[m]); - }; - - /* ========================================================================== - * read string data - */ - var zip_read_buff = function (buff, offset, n) { - var i; - for (i = 0; i < n && zip_deflate_pos < zip_deflate_data.length; i++) - buff[offset + i] = - zip_deflate_data[zip_deflate_pos++] & 0xff; - return i; - }; - - /* ========================================================================== - * Initialize the "longest match" routines for a new file - */ - var zip_lm_init = function () { - var j; - - /* Initialize the hash table. */ - for (j = 0; j < zip_HASH_SIZE; j++) - zip_prev[WSIZE + j] = 0; - zip_max_lazy_match = zip_configuration_table[zip_compr_level].max_lazy; - zip_good_match = zip_configuration_table[zip_compr_level].good_length; - if (!zip_FULL_SEARCH) - zip_nice_match = zip_configuration_table[zip_compr_level].nice_length; - zip_max_chain_length = zip_configuration_table[zip_compr_level].max_chain; - - zip_strstart = 0; - zip_block_start = 0; - - zip_lookahead = zip_read_buff(zip_window, 0, 2 * WSIZE); - if (zip_lookahead <= 0) { - zip_eofile = true; - zip_lookahead = 0; - return; - } - zip_eofile = false; - /* Make sure that we always have enough lookahead. This is important - * if input comes from a device such as a tty. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - - /* If lookahead < MIN_MATCH, ins_h is garbage, but this is - * not important since only literal bytes will be emitted. - */ - zip_ins_h = 0; - for (j = 0; j < MIN_MATCH - 1; j++) { - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[j] & 0xff)) & zip_HASH_MASK; - } - }; - - /* ========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - */ - var zip_longest_match = function (cur_match) { - var chain_length = zip_max_chain_length; // max hash chain length - var scanp = zip_strstart; // current string - var matchp; // matched string - var len; // length of current match - var best_len = zip_prev_length; // best match length so far - - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - var limit = (zip_strstart > zip_MAX_DIST ? zip_strstart - zip_MAX_DIST : zip_NIL); - - var strendp = zip_strstart + MAX_MATCH; - var scan_end1 = zip_window[scanp + best_len - 1]; - var scan_end = zip_window[scanp + best_len]; - - /* Do not waste too much time if we already have a good match: */ - if (zip_prev_length >= zip_good_match) - chain_length >>= 2; - - do { - matchp = cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2: - */ - if (zip_window[matchp + best_len] != scan_end || - zip_window[matchp + best_len - 1] != scan_end1 || - zip_window[matchp] != zip_window[scanp] || - zip_window[++matchp] != zip_window[scanp + 1]) { - continue; - } - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scanp += 2; - matchp++; - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - } while (zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - zip_window[++scanp] == zip_window[++matchp] && - scanp < strendp); - - len = MAX_MATCH - (strendp - scanp); - scanp = strendp - MAX_MATCH; - - if (len > best_len) { - zip_match_start = cur_match; - best_len = len; - if (zip_FULL_SEARCH) { - if (len >= MAX_MATCH) break; - } else { - if (len >= zip_nice_match) break; - } - - scan_end1 = zip_window[scanp + best_len - 1]; - scan_end = zip_window[scanp + best_len]; - } - } while ((cur_match = zip_prev[cur_match & zip_WMASK]) > limit - && --chain_length != 0); - - return best_len; - }; - - /* ========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead, and sets eofile if end of input file. - * IN assertion: lookahead < MIN_LOOKAHEAD && strstart + lookahead > 0 - * OUT assertions: at least one byte has been read, or eofile is set; - * file reads are performed for at least two bytes (required for the - * translate_eol option). - */ - var zip_fill_window = function () { - var n, m; - - // Amount of free space at the end of the window. - var more = zip_window_size - zip_lookahead - zip_strstart; - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (more == -1) { - /* Very unlikely, but possible on 16 bit machine if strstart == 0 - * and lookahead == 1 (input done one byte at time) - */ - more--; - } else if (zip_strstart >= WSIZE + zip_MAX_DIST) { - /* By the IN assertion, the window is not empty so we can't confuse - * more == 0 with more == 64K on a 16 bit machine. - */ - for (n = 0; n < WSIZE; n++) - zip_window[n] = zip_window[n + WSIZE]; - - zip_match_start -= WSIZE; - zip_strstart -= WSIZE; - /* we now have strstart >= MAX_DIST: */ - zip_block_start -= WSIZE; - - for (n = 0; n < zip_HASH_SIZE; n++) { - m = zip_head1(n); - zip_head2(n, m >= WSIZE ? m - WSIZE : zip_NIL); - } - for (n = 0; n < WSIZE; n++) { - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - m = zip_prev[n]; - zip_prev[n] = (m >= WSIZE ? m - WSIZE : zip_NIL); - } - more += WSIZE; - } - // At this point, more >= 2 - if (!zip_eofile) { - n = zip_read_buff(zip_window, zip_strstart + zip_lookahead, more); - if (n <= 0) - zip_eofile = true; - else - zip_lookahead += n; - } - }; - - /* ========================================================================== - * Processes a new input file and return its compressed length. This - * function does not perform lazy evaluationof matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ - var zip_deflate_fast = function () { - while (zip_lookahead != 0 && zip_qhead == null) { - var flush; // set if current block must be flushed - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - zip_INSERT_STRING(); - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (zip_hash_head != zip_NIL && - zip_strstart - zip_hash_head <= zip_MAX_DIST) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - zip_match_length = zip_longest_match(zip_hash_head); - /* longest_match() sets match_start */ - if (zip_match_length > zip_lookahead) - zip_match_length = zip_lookahead; - } - if (zip_match_length >= MIN_MATCH) { - flush = zip_ct_tally(zip_strstart - zip_match_start, - zip_match_length - MIN_MATCH); - zip_lookahead -= zip_match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ - if (zip_match_length <= zip_max_lazy_match) { - zip_match_length--; // string at strstart already in hash table - do { - zip_strstart++; - zip_INSERT_STRING(); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH - * these bytes are garbage, but it does not matter since - * the next lookahead bytes will be emitted as literals. - */ - } while (--zip_match_length != 0); - zip_strstart++; - } else { - zip_strstart += zip_match_length; - zip_match_length = 0; - zip_ins_h = zip_window[zip_strstart] & 0xff; - zip_ins_h = ((zip_ins_h << zip_H_SHIFT) ^ (zip_window[zip_strstart + 1] & 0xff)) & zip_HASH_MASK; - } - } else { - /* No match, output a literal byte */ - flush = zip_ct_tally(0, zip_window[zip_strstart] & 0xff); - zip_lookahead--; - zip_strstart++; - } - if (flush) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - } - }; - - var zip_deflate_better = function () { - /* Process the input block. */ - while (zip_lookahead != 0 && zip_qhead == null) { - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - zip_INSERT_STRING(); - - /* Find the longest match, discarding those <= prev_length. - */ - zip_prev_length = zip_match_length; - zip_prev_match = zip_match_start; - zip_match_length = MIN_MATCH - 1; - - if (zip_hash_head != zip_NIL && - zip_prev_length < zip_max_lazy_match && - zip_strstart - zip_hash_head <= zip_MAX_DIST) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - zip_match_length = zip_longest_match(zip_hash_head); - /* longest_match() sets match_start */ - if (zip_match_length > zip_lookahead) - zip_match_length = zip_lookahead; - - /* Ignore a length 3 match if it is too distant: */ - if (zip_match_length == MIN_MATCH && - zip_strstart - zip_match_start > zip_TOO_FAR) { - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - zip_match_length--; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (zip_prev_length >= MIN_MATCH && - zip_match_length <= zip_prev_length) { - var flush; // set if current block must be flushed - flush = zip_ct_tally(zip_strstart - 1 - zip_prev_match, - zip_prev_length - MIN_MATCH); - - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. - */ - zip_lookahead -= zip_prev_length - 1; - zip_prev_length -= 2; - do { - zip_strstart++; - zip_INSERT_STRING(); - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. If lookahead < MIN_MATCH - * these bytes are garbage, but it does not matter since the - * next lookahead bytes will always be emitted as literals. - */ - } while (--zip_prev_length != 0); - zip_match_available = 0; - zip_match_length = MIN_MATCH - 1; - zip_strstart++; - if (flush) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - } else if (zip_match_available != 0) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - if (zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff)) { - zip_flush_block(0); - zip_block_start = zip_strstart; - } - zip_strstart++; - zip_lookahead--; - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - zip_match_available = 1; - zip_strstart++; - zip_lookahead--; - } - - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - while (zip_lookahead < zip_MIN_LOOKAHEAD && !zip_eofile) - zip_fill_window(); - } - }; - - var zip_init_deflate = function () { - if (zip_eofile) - return; - zip_bi_buf = 0; - zip_bi_valid = 0; - zip_ct_init(); - zip_lm_init(); - - zip_qhead = null; - zip_outcnt = 0; - zip_outoff = 0; - zip_match_available = 0; - - if (zip_compr_level <= 3) { - zip_prev_length = MIN_MATCH - 1; - zip_match_length = 0; - } - else { - zip_match_length = MIN_MATCH - 1; - zip_match_available = 0; - zip_match_available = 0; - } - - zip_complete = false; - }; - - /* ========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ - var zip_deflate_internal = function (buff, off, buff_size) { - var n; - - if (!zip_initflag) { - zip_init_deflate(); - zip_initflag = true; - if (zip_lookahead == 0) { // empty - zip_complete = true; - return 0; - } - } - - if ((n = zip_qcopy(buff, off, buff_size)) == buff_size) - return buff_size; - - if (zip_complete) - return n; - - if (zip_compr_level <= 3) // optimized for speed - zip_deflate_fast(); - else - zip_deflate_better(); - if (zip_lookahead == 0) { - if (zip_match_available != 0) - zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff); - zip_flush_block(1); - zip_complete = true; - } - return n + zip_qcopy(buff, n + off, buff_size - n); - }; - - var zip_qcopy = function (buff, off, buff_size) { - var n, i, j; - - n = 0; - while (zip_qhead != null && n < buff_size) { - i = buff_size - n; - if (i > zip_qhead.len) - i = zip_qhead.len; - for (j = 0; j < i; j++) - buff[off + n + j] = zip_qhead.ptr[zip_qhead.off + j]; - - zip_qhead.off += i; - zip_qhead.len -= i; - n += i; - if (zip_qhead.len == 0) { - var p; - p = zip_qhead; - zip_qhead = zip_qhead.next; - zip_reuse_queue(p); - } - } - - if (n == buff_size) - return n; - - if (zip_outoff < zip_outcnt) { - i = buff_size - n; - if (i > zip_outcnt - zip_outoff) - i = zip_outcnt - zip_outoff; - // System.arraycopy(outbuf, outoff, buff, off + n, i); - for (j = 0; j < i; j++) - buff[off + n + j] = zip_outbuf[zip_outoff + j]; - zip_outoff += i; - n += i; - if (zip_outcnt == zip_outoff) - zip_outcnt = zip_outoff = 0; - } - return n; - }; - - /* ========================================================================== - * Allocate the match buffer, initialize the various tables and save the - * location of the internal file attribute (ascii/binary) and method - * (DEFLATE/STORE). - */ - var zip_ct_init = function () { - var n; // iterates over tree elements - var bits; // bit counter - var length; // length value - var code; // code value - var dist; // distance index - - if (zip_static_dtree[0].dl != 0) return; // ct_init already called - - zip_l_desc.dyn_tree = zip_dyn_ltree; - zip_l_desc.static_tree = zip_static_ltree; - zip_l_desc.extra_bits = zip_extra_lbits; - zip_l_desc.extra_base = zip_LITERALS + 1; - zip_l_desc.elems = zip_L_CODES; - zip_l_desc.max_length = zip_MAX_BITS; - zip_l_desc.max_code = 0; - - zip_d_desc.dyn_tree = zip_dyn_dtree; - zip_d_desc.static_tree = zip_static_dtree; - zip_d_desc.extra_bits = zip_extra_dbits; - zip_d_desc.extra_base = 0; - zip_d_desc.elems = zip_D_CODES; - zip_d_desc.max_length = zip_MAX_BITS; - zip_d_desc.max_code = 0; - - zip_bl_desc.dyn_tree = zip_bl_tree; - zip_bl_desc.static_tree = null; - zip_bl_desc.extra_bits = zip_extra_blbits; - zip_bl_desc.extra_base = 0; - zip_bl_desc.elems = zip_BL_CODES; - zip_bl_desc.max_length = zip_MAX_BL_BITS; - zip_bl_desc.max_code = 0; - - // Initialize the mapping length (0..255) -> length code (0..28) - length = 0; - for (code = 0; code < zip_LENGTH_CODES - 1; code++) { - zip_base_length[code] = length; - for (n = 0; n < (1 << zip_extra_lbits[code]); n++) - zip_length_code[length++] = code; - } - /* Note that the length 255 (match length 258) can be represented - * in two different ways: code 284 + 5 bits or code 285, so we - * overwrite length_code[255] to use the best encoding: - */ - zip_length_code[length - 1] = code; - - /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ - dist = 0; - for (code = 0; code < 16; code++) { - zip_base_dist[code] = dist; - for (n = 0; n < (1 << zip_extra_dbits[code]); n++) { - zip_dist_code[dist++] = code; - } - } - dist >>= 7; // from now on, all distances are divided by 128 - for (; code < zip_D_CODES; code++) { - zip_base_dist[code] = dist << 7; - for (n = 0; n < (1 << (zip_extra_dbits[code] - 7)); n++) - zip_dist_code[256 + dist++] = code; - } - // Construct the codes of the static literal tree - for (bits = 0; bits <= zip_MAX_BITS; bits++) - zip_bl_count[bits] = 0; - n = 0; - while (n <= 143) { - zip_static_ltree[n++].dl = 8; - zip_bl_count[8]++; - } - while (n <= 255) { - zip_static_ltree[n++].dl = 9; - zip_bl_count[9]++; - } - while (n <= 279) { - zip_static_ltree[n++].dl = 7; - zip_bl_count[7]++; - } - while (n <= 287) { - zip_static_ltree[n++].dl = 8; - zip_bl_count[8]++; - } - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - zip_gen_codes(zip_static_ltree, zip_L_CODES + 1); - - /* The static distance tree is trivial: */ - for (n = 0; n < zip_D_CODES; n++) { - zip_static_dtree[n].dl = 5; - zip_static_dtree[n].fc = zip_bi_reverse(n, 5); - } - - // Initialize the first block of the first file: - zip_init_block(); - }; - - /* ========================================================================== - * Initialize a new block. - */ - var zip_init_block = function () { - var n; // iterates over tree elements - - // Initialize the trees. - for (n = 0; n < zip_L_CODES; n++) zip_dyn_ltree[n].fc = 0; - for (n = 0; n < zip_D_CODES; n++) zip_dyn_dtree[n].fc = 0; - for (n = 0; n < zip_BL_CODES; n++) zip_bl_tree[n].fc = 0; - - zip_dyn_ltree[zip_END_BLOCK].fc = 1; - zip_opt_len = zip_static_len = 0; - zip_last_lit = zip_last_dist = zip_last_flags = 0; - zip_flags = 0; - zip_flag_bit = 1; - }; - - /* ========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ - var zip_pqdownheap = function (tree, // the tree to restore - k) { // node to move down - var v = zip_heap[k]; - var j = k << 1; // left son of k - - while (j <= zip_heap_len) { - // Set j to the smallest of the two sons: - if (j < zip_heap_len && - zip_SMALLER(tree, zip_heap[j + 1], zip_heap[j])) - j++; - - // Exit if v is smaller than both sons - if (zip_SMALLER(tree, v, zip_heap[j])) - break; - - // Exchange v with the smallest son - zip_heap[k] = zip_heap[j]; - k = j; - - // And continue down the tree, setting j to the left son of k - j <<= 1; - } - zip_heap[k] = v; - }; - - /* ========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ - var zip_gen_bitlen = function (desc) { // the tree descriptor - var tree = desc.dyn_tree; - var extra = desc.extra_bits; - var base = desc.extra_base; - var max_code = desc.max_code; - var max_length = desc.max_length; - var stree = desc.static_tree; - var h; // heap index - var n, m; // iterate over the tree elements - var bits; // bit length - var xbits; // extra bits - var f; // frequency - var overflow = 0; // number of elements with bit length too large - - for (bits = 0; bits <= zip_MAX_BITS; bits++) - zip_bl_count[bits] = 0; - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[zip_heap[zip_heap_max]].dl = 0; // root of the heap - - for (h = zip_heap_max + 1; h < zip_HEAP_SIZE; h++) { - n = zip_heap[h]; - bits = tree[tree[n].dl].dl + 1; - if (bits > max_length) { - bits = max_length; - overflow++; - } - tree[n].dl = bits; - // We overwrite tree[n].dl which is no longer needed - - if (n > max_code) - continue; // not a leaf node - - zip_bl_count[bits]++; - xbits = 0; - if (n >= base) - xbits = extra[n - base]; - f = tree[n].fc; - zip_opt_len += f * (bits + xbits); - if (stree != null) - zip_static_len += f * (stree[n].dl + xbits); - } - if (overflow == 0) - return; - - // This happens for example on obj2 and pic of the Calgary corpus - - // Find the first bit length which could increase: - do { - bits = max_length - 1; - while (zip_bl_count[bits] == 0) - bits--; - zip_bl_count[bits]--; // move one leaf down the tree - zip_bl_count[bits + 1] += 2; // move one overflow item as its brother - zip_bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits != 0; bits--) { - n = zip_bl_count[bits]; - while (n != 0) { - m = zip_heap[--h]; - if (m > max_code) - continue; - if (tree[m].dl != bits) { - zip_opt_len += (bits - tree[m].dl) * tree[m].fc; - tree[m].fc = bits; - } - n--; - } - } - }; - - /* ========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ - var zip_gen_codes = function (tree, // the tree to decorate - max_code) { // largest code with non zero frequency - var next_code = new Array(zip_MAX_BITS + 1); // next code value for each bit length - var code = 0; // running code value - var bits; // bit index - var n; // code index - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= zip_MAX_BITS; bits++) { - code = ((code + zip_bl_count[bits - 1]) << 1); - next_code[bits] = code; - } - - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - for (n = 0; n <= max_code; n++) { - var len = tree[n].dl; - if (len == 0) - continue; - // Now reverse the bits - tree[n].fc = zip_bi_reverse(next_code[len]++, len); - } - }; - - /* ========================================================================== - * Construct one Huffman tree and assigns the code bit strings and lengths. - * Update the total bit length for the current block. - * IN assertion: the field freq is set for all tree elements. - * OUT assertions: the fields len and code are set to the optimal bit length - * and corresponding code. The length opt_len is updated; static_len is - * also updated if stree is not null. The field max_code is set. - */ - var zip_build_tree = function (desc) { // the tree descriptor - var tree = desc.dyn_tree; - var stree = desc.static_tree; - var elems = desc.elems; - var n, m; // iterate over heap elements - var max_code = -1; // largest code with non zero frequency - var node = elems; // next internal node of the tree - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - zip_heap_len = 0; - zip_heap_max = zip_HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n].fc != 0) { - zip_heap[++zip_heap_len] = max_code = n; - zip_depth[n] = 0; - } else - tree[n].dl = 0; - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (zip_heap_len < 2) { - var xnew = zip_heap[++zip_heap_len] = (max_code < 2 ? ++max_code : 0); - tree[xnew].fc = 1; - zip_depth[xnew] = 0; - zip_opt_len--; - if (stree != null) - zip_static_len -= stree[xnew].dl; - // new is 0 or 1 so it does not have extra bits - } - desc.max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = zip_heap_len >> 1; n >= 1; n--) - zip_pqdownheap(tree, n); - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - do { - n = zip_heap[zip_SMALLEST]; - zip_heap[zip_SMALLEST] = zip_heap[zip_heap_len--]; - zip_pqdownheap(tree, zip_SMALLEST); - - m = zip_heap[zip_SMALLEST]; // m = node of next least frequency - - // keep the nodes sorted by frequency - zip_heap[--zip_heap_max] = n; - zip_heap[--zip_heap_max] = m; - - // Create a new node father of n and m - tree[node].fc = tree[n].fc + tree[m].fc; - if (zip_depth[n] > zip_depth[m] + 1) - zip_depth[node] = zip_depth[n]; - else - zip_depth[node] = zip_depth[m] + 1; - tree[n].dl = tree[m].dl = node; - - // and insert the new node in the heap - zip_heap[zip_SMALLEST] = node++; - zip_pqdownheap(tree, zip_SMALLEST); - - } while (zip_heap_len >= 2); - - zip_heap[--zip_heap_max] = zip_heap[zip_SMALLEST]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - zip_gen_bitlen(desc); - - // The field len is now set, we can generate the bit codes - zip_gen_codes(tree, max_code); - }; - - /* ========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. Updates opt_len to take into account the repeat - * counts. (The contribution of the bit length codes will be added later - * during the construction of bl_tree.) - */ - var zip_scan_tree = function (tree,// the tree to be scanned - max_code) { // and its largest code of non zero frequency - var n; // iterates over all tree elements - var prevlen = -1; // last emitted length - var curlen; // length of current code - var nextlen = tree[0].dl; // length of next code - var count = 0; // repeat count of the current code - var max_count = 7; // max repeat count - var min_count = 4; // min repeat count - - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } - tree[max_code + 1].dl = 0xffff; // guard - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - if (++count < max_count && curlen == nextlen) - continue; - else if (count < min_count) - zip_bl_tree[curlen].fc += count; - else if (curlen != 0) { - if (curlen != prevlen) - zip_bl_tree[curlen].fc++; - zip_bl_tree[zip_REP_3_6].fc++; - } else if (count <= 10) - zip_bl_tree[zip_REPZ_3_10].fc++; - else - zip_bl_tree[zip_REPZ_11_138].fc++; - count = 0; - prevlen = curlen; - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } else if (curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - }; - - /* ========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ - var zip_send_tree = function (tree, // the tree to be scanned - max_code) { // and its largest code of non zero frequency - var n; // iterates over all tree elements - var prevlen = -1; // last emitted length - var curlen; // length of current code - var nextlen = tree[0].dl; // length of next code - var count = 0; // repeat count of the current code - var max_count = 7; // max repeat count - var min_count = 4; // min repeat count - - /* tree[max_code+1].dl = -1; */ - /* guard already set */ - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - if (++count < max_count && curlen == nextlen) { - continue; - } else if (count < min_count) { - do { - zip_SEND_CODE(curlen, zip_bl_tree); - } while (--count != 0); - } else if (curlen != 0) { - if (curlen != prevlen) { - zip_SEND_CODE(curlen, zip_bl_tree); - count--; - } - // Assert(count >= 3 && count <= 6, " 3_6?"); - zip_SEND_CODE(zip_REP_3_6, zip_bl_tree); - zip_send_bits(count - 3, 2); - } else if (count <= 10) { - zip_SEND_CODE(zip_REPZ_3_10, zip_bl_tree); - zip_send_bits(count - 3, 3); - } else { - zip_SEND_CODE(zip_REPZ_11_138, zip_bl_tree); - zip_send_bits(count - 11, 7); - } - count = 0; - prevlen = curlen; - if (nextlen == 0) { - max_count = 138; - min_count = 3; - } else if (curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - }; - - /* ========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ - var zip_build_bl_tree = function () { - var max_blindex; // index of last bit length code of non zero freq - - // Determine the bit length frequencies for literal and distance trees - zip_scan_tree(zip_dyn_ltree, zip_l_desc.max_code); - zip_scan_tree(zip_dyn_dtree, zip_d_desc.max_code); - - // Build the bit length tree: - zip_build_tree(zip_bl_desc); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = zip_BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (zip_bl_tree[zip_bl_order[max_blindex]].dl != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - zip_opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - return max_blindex; - }; - - /* ========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ - var zip_send_all_trees = function (lcodes, dcodes, blcodes) { // number of codes for each tree - var rank; // index in bl_order - zip_send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt - zip_send_bits(dcodes - 1, 5); - zip_send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt - for (rank = 0; rank < blcodes; rank++) { - zip_send_bits(zip_bl_tree[zip_bl_order[rank]].dl, 3); - } - - // send the literal tree - zip_send_tree(zip_dyn_ltree, lcodes - 1); - - // send the distance tree - zip_send_tree(zip_dyn_dtree, dcodes - 1); - }; - - /* ========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ - var zip_flush_block = function (eof) { // true if this is the last block for a file - var opt_lenb, static_lenb; // opt_len and static_len in bytes - var max_blindex; // index of last bit length code of non zero freq - var stored_len; // length of input block - - stored_len = zip_strstart - zip_block_start; - zip_flag_buf[zip_last_flags] = zip_flags; // Save the flags for the last 8 items - - // Construct the literal and distance trees - zip_build_tree(zip_l_desc); - zip_build_tree(zip_d_desc); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = zip_build_bl_tree(); - - // Determine the best encoding. Compute first the block length in bytes - opt_lenb = (zip_opt_len + 3 + 7) >> 3; - static_lenb = (zip_static_len + 3 + 7) >> 3; - if (static_lenb <= opt_lenb) - opt_lenb = static_lenb; - if (stored_len + 4 <= opt_lenb // 4: two words for the lengths - && zip_block_start >= 0) { - var i; - - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - zip_send_bits((zip_STORED_BLOCK << 1) + eof, 3); - /* send block type */ - zip_bi_windup(); - /* align on byte boundary */ - zip_put_short(stored_len); - zip_put_short(~stored_len); - - // copy block - for (i = 0; i < stored_len; i++) - zip_put_byte(zip_window[zip_block_start + i]); - - } else if (static_lenb == opt_lenb) { - zip_send_bits((zip_STATIC_TREES << 1) + eof, 3); - zip_compress_block(zip_static_ltree, zip_static_dtree); - } else { - zip_send_bits((zip_DYN_TREES << 1) + eof, 3); - zip_send_all_trees(zip_l_desc.max_code + 1, - zip_d_desc.max_code + 1, - max_blindex + 1); - zip_compress_block(zip_dyn_ltree, zip_dyn_dtree); - } - - zip_init_block(); - - if (eof != 0) - zip_bi_windup(); - }; - - /* ========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ - var zip_ct_tally = function (dist, // distance of matched string - lc) { // match length-MIN_MATCH or unmatched char (if dist==0) - zip_l_buf[zip_last_lit++] = lc; - if (dist == 0) { - // lc is the unmatched char - zip_dyn_ltree[lc].fc++; - } else { - // Here, lc is the match length - MIN_MATCH - dist--; // dist = match distance - 1 - zip_dyn_ltree[zip_length_code[lc] + zip_LITERALS + 1].fc++; - zip_dyn_dtree[zip_D_CODE(dist)].fc++; - - zip_d_buf[zip_last_dist++] = dist; - zip_flags |= zip_flag_bit; - } - zip_flag_bit <<= 1; - - // Output the flags if they fill a byte - if ((zip_last_lit & 7) == 0) { - zip_flag_buf[zip_last_flags++] = zip_flags; - zip_flags = 0; - zip_flag_bit = 1; - } - // Try to guess if it is profitable to stop the current block here - if (zip_compr_level > 2 && (zip_last_lit & 0xfff) == 0) { - // Compute an upper bound for the compressed length - var out_length = zip_last_lit * 8; - var in_length = zip_strstart - zip_block_start; - var dcode; - - for (dcode = 0; dcode < zip_D_CODES; dcode++) { - out_length += zip_dyn_dtree[dcode].fc * (5 + zip_extra_dbits[dcode]); - } - out_length >>= 3; - if (zip_last_dist < parseInt(zip_last_lit / 2) && - out_length < parseInt(in_length / 2)) - return true; - } - return (zip_last_lit == LIT_BUFSIZE - 1 || - zip_last_dist == zip_DIST_BUFSIZE); - /* We avoid equality with LIT_BUFSIZE because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ - }; - - /* ========================================================================== - * Send the block data compressed using the given Huffman trees - */ - var zip_compress_block = function (ltree, // literal tree - dtree) { // distance tree - var dist; // distance of matched string - var lc; // match length or unmatched char (if dist == 0) - var lx = 0; // running index in l_buf - var dx = 0; // running index in d_buf - var fx = 0; // running index in flag_buf - var flag = 0; // current flags - var code; // the code to send - var extra; // number of extra bits to send - - if (zip_last_lit != 0) do { - if ((lx & 7) == 0) - flag = zip_flag_buf[fx++]; - lc = zip_l_buf[lx++] & 0xff; - if ((flag & 1) == 0) { - zip_SEND_CODE(lc, ltree); - /* send a literal byte */ - } else { - // Here, lc is the match length - MIN_MATCH - code = zip_length_code[lc]; - zip_SEND_CODE(code + zip_LITERALS + 1, ltree); // send the length code - extra = zip_extra_lbits[code]; - if (extra != 0) { - lc -= zip_base_length[code]; - zip_send_bits(lc, extra); // send the extra length bits - } - dist = zip_d_buf[dx++]; - // Here, dist is the match distance - 1 - code = zip_D_CODE(dist); - zip_SEND_CODE(code, dtree); // send the distance code - extra = zip_extra_dbits[code]; - if (extra != 0) { - dist -= zip_base_dist[code]; - zip_send_bits(dist, extra); // send the extra distance bits - } - } // literal or match pair ? - flag >>= 1; - } while (lx < zip_last_lit); - - zip_SEND_CODE(zip_END_BLOCK, ltree); - }; - - /* ========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ - var zip_Buf_size = 16; // bit size of bi_buf - var zip_send_bits = function (value, // value to send - length) { // number of bits - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) - * unused bits in value. - */ - if (zip_bi_valid > zip_Buf_size - length) { - zip_bi_buf |= (value << zip_bi_valid); - zip_put_short(zip_bi_buf); - zip_bi_buf = (value >> (zip_Buf_size - zip_bi_valid)); - zip_bi_valid += length - zip_Buf_size; - } else { - zip_bi_buf |= value << zip_bi_valid; - zip_bi_valid += length; - } - }; - - /* ========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ - var zip_bi_reverse = function (code, // the value to invert - len) { // its bit length - var res = 0; - do { - res |= code & 1; - code >>= 1; - res <<= 1; - } while (--len > 0); - return res >> 1; - }; - - /* ========================================================================== - * Write out any remaining bits in an incomplete byte. - */ - var zip_bi_windup = function () { - if (zip_bi_valid > 8) { - zip_put_short(zip_bi_buf); - } else if (zip_bi_valid > 0) { - zip_put_byte(zip_bi_buf); - } - zip_bi_buf = 0; - zip_bi_valid = 0; - }; - - var zip_qoutbuf = function () { - if (zip_outcnt != 0) { - var q, i; - q = zip_new_queue(); - if (zip_qhead == null) - zip_qhead = zip_qtail = q; - else - zip_qtail = zip_qtail.next = q; - q.len = zip_outcnt - zip_outoff; - for (i = 0; i < q.len; i++) - q.ptr[i] = zip_outbuf[zip_outoff + i]; - zip_outcnt = zip_outoff = 0; - } - }; - - function deflate(buffData, level) { - zip_deflate_data = buffData; - zip_deflate_pos = 0; - zip_deflate_start(level); - - var buff = new Array(1024), - pages = [], - totalSize = 0, - i; - - for (i = 0; i < 1024; i++) buff[i] = 0; - while ((i = zip_deflate_internal(buff, 0, buff.length)) > 0) { - var buf = new Buffer(buff.slice(0, i)); - pages.push(buf); - totalSize += buf.length; - } - - if (pages.length == 1) { - return pages[0]; - } - - var result = new Buffer(totalSize), - index = 0; - - for (i = 0; i < pages.length; i++) { - pages[i].copy(result, index); - index = index + pages[i].length - } - - return result; - } - - return { - deflate: function () { - return deflate(inbuf, 8); - } - } -} - -module.exports = function (/*Buffer*/inbuf) { - - var zlib = require("zlib"); - - return { - deflate: function () { - return new JSDeflater(inbuf).deflate(); - }, - - deflateAsync: function (/*Function*/callback) { - var tmp = zlib.createDeflateRaw(); - tmp.on('data', function (data) { - callback(data); - }); - tmp.end(inbuf) - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js deleted file mode 100644 index ddcbba6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.Deflater = require("./deflater"); -exports.Inflater = require("./inflater"); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js deleted file mode 100644 index ba95063..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/methods/inflater.js +++ /dev/null @@ -1,446 +0,0 @@ -var Buffer = require("buffer").Buffer; - -function JSInflater(/*Buffer*/input) { - - var WSIZE = 0x8000, - slide = new Buffer(0x10000), - windowPos = 0, - fixedTableList = null, - fixedTableDist, - fixedLookup, - bitBuf = 0, - bitLen = 0, - method = -1, - eof = false, - copyLen = 0, - copyDist = 0, - tblList, tblDist, bitList, bitdist, - - inputPosition = 0, - - MASK_BITS = [0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff], - LENS = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], - LEXT = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99], - DISTS = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577], - DEXT = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], - BITORDER = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - - function HuffTable(clen, cnum, cval, blist, elist, lookupm) { - - this.status = 0; - this.root = null; - this.maxbit = 0; - - var el, f, tail, - offsets = [], - countTbl = [], - sTbl = [], - values = [], - tentry = {extra: 0, bitcnt: 0, lbase: 0, next: null}; - - tail = this.root = null; - for(var i = 0; i < 0x11; i++) { countTbl[i] = 0; sTbl[i] = 0; offsets[i] = 0; } - for(i = 0; i < 0x120; i++) values[i] = 0; - - el = cnum > 256 ? clen[256] : 16; - - var pidx = -1; - while (++pidx < cnum) countTbl[clen[pidx]]++; - - if(countTbl[0] == cnum) return; - - for(var j = 1; j <= 16; j++) if(countTbl[j] != 0) break; - var bitLen = j; - for(i = 16; i != 0; i--) if(countTbl[i] != 0) break; - var maxLen = i; - - lookupm < j && (lookupm = j); - - var dCodes = 1 << j; - for(; j < i; j++, dCodes <<= 1) - if((dCodes -= countTbl[j]) < 0) { - this.status = 2; - this.maxbit = lookupm; - return; - } - - if((dCodes -= countTbl[i]) < 0) { - this.status = 2; - this.maxbit = lookupm; - return; - } - - countTbl[i] += dCodes; - offsets[1] = j = 0; - pidx = 1; - var xp = 2; - while(--i > 0) offsets[xp++] = (j += countTbl[pidx++]); - pidx = 0; - i = 0; - do { - (j = clen[pidx++]) && (values[offsets[j]++] = i); - } while(++i < cnum); - cnum = offsets[maxLen]; - offsets[0] = i = 0; - pidx = 0; - - var level = -1, - w = sTbl[0] = 0, - cnode = null, - tblCnt = 0, - tblStack = []; - - for(; bitLen <= maxLen; bitLen++) { - var kccnt = countTbl[bitLen]; - while(kccnt-- > 0) { - while(bitLen > w + sTbl[1 + level]) { - w += sTbl[1 + level]; - level++; - tblCnt = (tblCnt = maxLen - w) > lookupm ? lookupm : tblCnt; - if((f = 1 << (j = bitLen - w)) > kccnt + 1) { - f -= kccnt + 1; - xp = bitLen; - while(++j < tblCnt) { - if((f <<= 1) <= countTbl[++xp]) break; - f -= countTbl[xp]; - } - } - if(w + j > el && w < el) j = el - w; - tblCnt = 1 << j; - sTbl[1 + level] = j; - cnode = []; - while (cnode.length < tblCnt) cnode.push({extra: 0, bitcnt: 0, lbase: 0, next: null}); - if (tail == null) { - tail = this.root = {next:null, list:null}; - } else { - tail = tail.next = {next:null, list:null} - } - tail.next = null; - tail.list = cnode; - - tblStack[level] = cnode; - - if(level > 0) { - offsets[level] = i; - tentry.bitcnt = sTbl[level]; - tentry.extra = 16 + j; - tentry.next = cnode; - j = (i & ((1 << w) - 1)) >> (w - sTbl[level]); - - tblStack[level-1][j].extra = tentry.extra; - tblStack[level-1][j].bitcnt = tentry.bitcnt; - tblStack[level-1][j].lbase = tentry.lbase; - tblStack[level-1][j].next = tentry.next; - } - } - tentry.bitcnt = bitLen - w; - if(pidx >= cnum) - tentry.extra = 99; - else if(values[pidx] < cval) { - tentry.extra = (values[pidx] < 256 ? 16 : 15); - tentry.lbase = values[pidx++]; - } else { - tentry.extra = elist[values[pidx] - cval]; - tentry.lbase = blist[values[pidx++] - cval]; - } - - f = 1 << (bitLen - w); - for(j = i >> w; j < tblCnt; j += f) { - cnode[j].extra = tentry.extra; - cnode[j].bitcnt = tentry.bitcnt; - cnode[j].lbase = tentry.lbase; - cnode[j].next = tentry.next; - } - for(j = 1 << (bitLen - 1); (i & j) != 0; j >>= 1) - i ^= j; - i ^= j; - while((i & ((1 << w) - 1)) != offsets[level]) { - w -= sTbl[level]; - level--; - } - } - } - - this.maxbit = sTbl[1]; - this.status = ((dCodes != 0 && maxLen != 1) ? 1 : 0); - } - - function addBits(n) { - while(bitLen < n) { - bitBuf |= input[inputPosition++] << bitLen; - bitLen += 8; - } - return bitBuf; - } - - function cutBits(n) { - bitLen -= n; - return bitBuf >>= n; - } - - function maskBits(n) { - while(bitLen < n) { - bitBuf |= input[inputPosition++] << bitLen; - bitLen += 8; - } - var res = bitBuf & MASK_BITS[n]; - bitBuf >>= n; - bitLen -= n; - return res; - } - - function codes(buff, off, size) { - var e, t; - if(size == 0) return 0; - - var n = 0; - for(;;) { - t = tblList.list[addBits(bitList) & MASK_BITS[bitList]]; - e = t.extra; - while(e > 16) { - if(e == 99) return -1; - cutBits(t.bitcnt); - e -= 16; - t = t.next[addBits(e) & MASK_BITS[e]]; - e = t.extra; - } - cutBits(t.bitcnt); - if(e == 16) { - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = t.lbase; - if(n == size) return size; - continue; - } - if(e == 15) break; - - copyLen = t.lbase + maskBits(e); - t = tblDist.list[addBits(bitdist) & MASK_BITS[bitdist]]; - e = t.extra; - - while(e > 16) { - if(e == 99) return -1; - cutBits(t.bitcnt); - e -= 16; - t = t.next[addBits(e) & MASK_BITS[e]]; - e = t.extra - } - cutBits(t.bitcnt); - copyDist = windowPos - t.lbase - maskBits(e); - - while(copyLen > 0 && n < size) { - copyLen--; - copyDist &= WSIZE - 1; - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = slide[copyDist++]; - } - - if(n == size) return size; - } - - method = -1; // done - return n; - } - - function stored(buff, off, size) { - cutBits(bitLen & 7); - var n = maskBits(0x10); - if(n != ((~maskBits(0x10)) & 0xffff)) return -1; - copyLen = n; - - n = 0; - while(copyLen > 0 && n < size) { - copyLen--; - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = maskBits(8); - } - - if(copyLen == 0) method = -1; - return n; - } - - function fixed(buff, off, size) { - var fixed_bd = 0; - if(fixedTableList == null) { - var lengths = []; - - for(var symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; - for(; symbol < 256; symbol++) lengths[symbol] = 9; - for(; symbol < 280; symbol++) lengths[symbol] = 7; - for(; symbol < 288; symbol++) lengths[symbol] = 8; - - fixedLookup = 7; - - var htbl = new HuffTable(lengths, 288, 257, LENS, LEXT, fixedLookup); - - if(htbl.status != 0) return -1; - - fixedTableList = htbl.root; - fixedLookup = htbl.maxbit; - - for(symbol = 0; symbol < 30; symbol++) lengths[symbol] = 5; - fixed_bd = 5; - - htbl = new HuffTable(lengths, 30, 0, DISTS, DEXT, fixed_bd); - if(htbl.status > 1) { - fixedTableList = null; - return -1; - } - fixedTableDist = htbl.root; - fixed_bd = htbl.maxbit; - } - - tblList = fixedTableList; - tblDist = fixedTableDist; - bitList = fixedLookup; - bitdist = fixed_bd; - return codes(buff, off, size); - } - - function dynamic(buff, off, size) { - var ll = new Array(0x023C); - - for (var m = 0; m < 0x023C; m++) ll[m] = 0; - - var llencnt = 257 + maskBits(5), - dcodescnt = 1 + maskBits(5), - bitlencnt = 4 + maskBits(4); - - if(llencnt > 286 || dcodescnt > 30) return -1; - - for(var j = 0; j < bitlencnt; j++) ll[BITORDER[j]] = maskBits(3); - for(; j < 19; j++) ll[BITORDER[j]] = 0; - - // build decoding table for trees--single level, 7 bit lookup - bitList = 7; - var hufTable = new HuffTable(ll, 19, 19, null, null, bitList); - if(hufTable.status != 0) - return -1; // incomplete code set - - tblList = hufTable.root; - bitList = hufTable.maxbit; - var lencnt = llencnt + dcodescnt, - i = 0, - lastLen = 0; - while(i < lencnt) { - var hufLcode = tblList.list[addBits(bitList) & MASK_BITS[bitList]]; - j = hufLcode.bitcnt; - cutBits(j); - j = hufLcode.lbase; - if(j < 16) - ll[i++] = lastLen = j; - else if(j == 16) { - j = 3 + maskBits(2); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = lastLen; - } else if(j == 17) { - j = 3 + maskBits(3); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = 0; - lastLen = 0; - } else { - j = 11 + maskBits(7); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = 0; - lastLen = 0; - } - } - bitList = 9; - hufTable = new HuffTable(ll, llencnt, 257, LENS, LEXT, bitList); - bitList == 0 && (hufTable.status = 1); - - if (hufTable.status != 0) return -1; - - tblList = hufTable.root; - bitList = hufTable.maxbit; - - for(i = 0; i < dcodescnt; i++) ll[i] = ll[i + llencnt]; - bitdist = 6; - hufTable = new HuffTable(ll, dcodescnt, 0, DISTS, DEXT, bitdist); - tblDist = hufTable.root; - bitdist = hufTable.maxbit; - - if((bitdist == 0 && llencnt > 257) || hufTable.status != 0) return -1; - - return codes(buff, off, size); - } - - return { - inflate : function(/*Buffer*/outputBuffer) { - tblList = null; - - var size = outputBuffer.length, - offset = 0, i; - - while(offset < size) { - if(eof && method == -1) return; - if(copyLen > 0) { - if(method != 0) { - while(copyLen > 0 && offset < size) { - copyLen--; - copyDist &= WSIZE - 1; - windowPos &= WSIZE - 1; - outputBuffer[offset++] = (slide[windowPos++] = slide[copyDist++]); - } - } else { - while(copyLen > 0 && offset < size) { - copyLen--; - windowPos &= WSIZE - 1; - outputBuffer[offset++] = (slide[windowPos++] = maskBits(8)); - } - copyLen == 0 && (method = -1); // done - } - if (offset == size) return; - } - - if(method == -1) { - if(eof) break; - eof = maskBits(1) != 0; - method = maskBits(2); - tblList = null; - copyLen = 0; - } - switch(method) { - case 0: i = stored(outputBuffer, offset, size - offset); break; - case 1: i = tblList != null ? codes(outputBuffer, offset, size - offset) : fixed(outputBuffer, offset, size - offset); break; - case 2: i = tblList != null ? codes(outputBuffer, offset, size - offset) : dynamic(outputBuffer, offset, size - offset); break; - default: i = -1; break; - } - - if(i == -1) return; - offset += i; - } - } - }; -} - -module.exports = function(/*Buffer*/inbuf) { - var zlib = require("zlib"); - return { - inflateAsync : function(/*Function*/callback) { - var tmp = zlib.createInflateRaw(), - parts = [], total = 0; - tmp.on('data', function(data) { - parts.push(data); - total += data.length; - }); - tmp.on('end', function() { - var buf = new Buffer(total), written = 0; - buf.fill(0); - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - part.copy(buf, written); - written += part.length; - } - callback && callback(buf); - }); - tmp.end(inbuf) - }, - - inflate : function(/*Buffer*/outputBuffer) { - var x = new JSInflater(inbuf); - x.inflate(outputBuffer); - delete(x); - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json deleted file mode 100644 index af35d53..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "adm-zip", - "version": "0.4.3", - "description": "A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk", - "keywords": [ - "zip", - "methods", - "archive", - "unzip" - ], - "homepage": "http://github.com/cthackers/adm-zip", - "author": { - "name": "Nasca Iacob", - "email": "sy@another-d-mention.ro", - "url": "https://github.com/cthackers" - }, - "bugs": { - "url": "https://github.com/cthackers/adm-zip/issues", - "email": "sy@another-d-mention.ro" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/kriskowal/zip/raw/master/LICENSE" - } - ], - "main": "adm-zip.js", - "repository": { - "type": "git", - "url": "https://github.com/cthackers/adm-zip.git" - }, - "engines": { - "node": ">=0.3.0" - }, - "readme": "# ADM-ZIP for NodeJS\r\n\r\nADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/). \r\n\r\n# Installation\r\n\r\nWith [npm](http://npmjs.org) do:\r\n\r\n $ npm install adm-zip\r\n\t\r\n## What is it good for?\r\nThe library allows you to:\r\n\r\n* decompress zip files directly to disk or in memory buffers\r\n* compress files and store them to disk in .zip format or in compressed buffers\r\n* update content of/add new/delete files from an existing .zip\r\n\r\n# Dependencies\r\nThere are no other nodeJS libraries that ADM-ZIP is dependent of\r\n\r\n# Examples\r\n\r\n## Basic usage\r\n```javascript\r\n\r\n\tvar AdmZip = require('adm-zip');\r\n\r\n\t// reading archives\r\n\tvar zip = new AdmZip(\"./my_file.zip\");\r\n\tvar zipEntries = zip.getEntries(); // an array of ZipEntry records\r\n\r\n\tzipEntries.forEach(function(zipEntry) {\r\n\t console.log(zipEntry.toString()); // outputs zip entries information\r\n\t\tif (zipEntry.entryName == \"my_file.txt\") {\r\n\t\t console.log(zipEntry.data.toString('utf8')); \r\n\t\t}\r\n\t});\r\n\t// outputs the content of some_folder/my_file.txt\r\n\tconsole.log(zip.readAsText(\"some_folder/my_file.txt\")); \r\n\t// extracts the specified file to the specified location\r\n\tzip.extractEntryTo(/*entry name*/\"some_folder/my_file.txt\", /*target path*/\"/home/me/tempfolder\", /*overwrite*/true)\r\n\t// extracts everything\r\n\tzip.extractAllTo(/*target path*/\"/home/me/zipcontent/\", /*overwrite*/true);\r\n\t\r\n\t\r\n\t// creating archives\r\n\tvar zip = new AdmZip();\r\n\t\r\n\t// add file directly\r\n\tzip.addFile(\"test.txt\", new Buffer(\"inner content of the file\"), \"entry comment goes here\");\r\n\t// add local file\r\n\tzip.addLocalFile(\"/home/me/some_picture.png\");\r\n\t// get everything as a buffer\r\n\tvar willSendthis = zip.toBuffer();\r\n\t// or write everything to disk\r\n\tzip.writeZip(/*target file name*/\"/home/me/files.zip\");\r\n\t\r\n\t\r\n\t// ... more examples in the wiki\r\n```\r\n\r\nFor more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).\n\n[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip)", - "readmeFilename": "README.md", - "_id": "adm-zip@0.4.3", - "dist": { - "shasum": "0714e822e1c21ce989b832150faad1316ad50f3f" - }, - "_from": "adm-zip@~0.4.3", - "_resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.3.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip deleted file mode 100644 index d57bfc0..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden_readonly.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/readonly.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt deleted file mode 100644 index 3c3ca55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/somefile.txt +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/asd/New Text Document.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/asd/New Text Document.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/blank file.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/blank file.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip deleted file mode 100644 index f4ed17b..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fast.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip deleted file mode 100644 index f4ed17b..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/fastest.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip deleted file mode 100644 index 188eccb..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/linux_arc.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip deleted file mode 100644 index 86a8ec7..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/maximum.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip deleted file mode 100644 index b4602c9..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/normal.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip deleted file mode 100644 index e2add30..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/store.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip deleted file mode 100644 index 86a8ec7..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/ultra.zip and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js deleted file mode 100644 index abf3bd8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/index.js +++ /dev/null @@ -1,15 +0,0 @@ -var Attr = require("../util").FileAttr, - Zip = require("../adm-zip"), - fs = require("fs"); - -/* -var zip = new Zip(); -zip.addLocalFolder("c:/asd/"); -zip.writeZip("c:/asd.zip"); -*/ - -var zip = new Zip("c:/asd.zip"); -zip.getEntries().forEach(function(entry) { - // console.log(entry.toString()); -}); -zip.extractAllTo("C:/test"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js deleted file mode 100644 index 0548054..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/constants.js +++ /dev/null @@ -1,84 +0,0 @@ -module.exports = { - /* The local file header */ - LOCHDR : 30, // LOC header size - LOCSIG : 0x04034b50, // "PK\003\004" - LOCVER : 4, // version needed to extract - LOCFLG : 6, // general purpose bit flag - LOCHOW : 8, // compression method - LOCTIM : 10, // modification time (2 bytes time, 2 bytes date) - LOCCRC : 14, // uncompressed file crc-32 value - LOCSIZ : 18, // compressed size - LOCLEN : 22, // uncompressed size - LOCNAM : 26, // filename length - LOCEXT : 28, // extra field length - - /* The Data descriptor */ - EXTSIG : 0x08074b50, // "PK\007\008" - EXTHDR : 16, // EXT header size - EXTCRC : 4, // uncompressed file crc-32 value - EXTSIZ : 8, // compressed size - EXTLEN : 12, // uncompressed size - - /* The central directory file header */ - CENHDR : 46, // CEN header size - CENSIG : 0x02014b50, // "PK\001\002" - CENVEM : 4, // version made by - CENVER : 6, // version needed to extract - CENFLG : 8, // encrypt, decrypt flags - CENHOW : 10, // compression method - CENTIM : 12, // modification time (2 bytes time, 2 bytes date) - CENCRC : 16, // uncompressed file crc-32 value - CENSIZ : 20, // compressed size - CENLEN : 24, // uncompressed size - CENNAM : 28, // filename length - CENEXT : 30, // extra field length - CENCOM : 32, // file comment length - CENDSK : 34, // volume number start - CENATT : 36, // internal file attributes - CENATX : 38, // external file attributes (host system dependent) - CENOFF : 42, // LOC header offset - - /* The entries in the end of central directory */ - ENDHDR : 22, // END header size - ENDSIG : 0x06054b50, // "PK\005\006" - ENDSUB : 8, // number of entries on this disk - ENDTOT : 10, // total number of entries - ENDSIZ : 12, // central directory size in bytes - ENDOFF : 16, // offset of first CEN header - ENDCOM : 20, // zip file comment length - - /* Compression methods */ - STORED : 0, // no compression - SHRUNK : 1, // shrunk - REDUCED1 : 2, // reduced with compression factor 1 - REDUCED2 : 3, // reduced with compression factor 2 - REDUCED3 : 4, // reduced with compression factor 3 - REDUCED4 : 5, // reduced with compression factor 4 - IMPLODED : 6, // imploded - // 7 reserved - DEFLATED : 8, // deflated - ENHANCED_DEFLATED: 9, // enhanced deflated - PKWARE : 10,// PKWare DCL imploded - // 11 reserved - BZIP2 : 12, // compressed using BZIP2 - // 13 reserved - LZMA : 14, // LZMA - // 15-17 reserved - IBM_TERSE : 18, // compressed using IBM TERSE - IBM_LZ77 : 19, //IBM LZ77 z - - /* General purpose bit flag */ - FLG_ENC : 0, // encripted file - FLG_COMP1 : 1, // compression option - FLG_COMP2 : 2, // compression option - FLG_DESC : 4, // data descriptor - FLG_ENH : 8, // enhanced deflation - FLG_STR : 16, // strong encryption - FLG_LNG : 1024, // language encoding - FLG_MSK : 4096, // mask header values - - /* Load type */ - FILE : 0, - BUFFER : 1, - NONE : 2 -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js deleted file mode 100644 index db5d69e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/errors.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - /* Header error messages */ - "INVALID_LOC" : "Invalid LOC header (bad signature)", - "INVALID_CEN" : "Invalid CEN header (bad signature)", - "INVALID_END" : "Invalid END header (bad signature)", - - /* ZipEntry error messages*/ - "NO_DATA" : "Nothing to decompress", - "BAD_CRC" : "CRC32 checksum failed", - "FILE_IN_THE_WAY" : "There is a file in the way: %s", - "UNKNOWN_METHOD" : "Invalid/unsupported compression method", - - /* Inflater error messages */ - "AVAIL_DATA" : "inflate::Available inflate data did not terminate", - "INVALID_DISTANCE" : "inflate::Invalid literal/length or distance code in fixed or dynamic block", - "TO_MANY_CODES" : "inflate::Dynamic block code description: too many length or distance codes", - "INVALID_REPEAT_LEN" : "inflate::Dynamic block code description: repeat more than specified lengths", - "INVALID_REPEAT_FIRST" : "inflate::Dynamic block code description: repeat lengths with no first length", - "INCOMPLETE_CODES" : "inflate::Dynamic block code description: code lengths codes incomplete", - "INVALID_DYN_DISTANCE": "inflate::Dynamic block code description: invalid distance code lengths", - "INVALID_CODES_LEN": "inflate::Dynamic block code description: invalid literal/length code lengths", - "INVALID_STORE_BLOCK" : "inflate::Stored block length did not match one's complement", - "INVALID_BLOCK_TYPE" : "inflate::Invalid block type (type == 3)", - - /* ADM-ZIP error messages */ - "CANT_EXTRACT_FILE" : "Could not extract the file", - "CANT_OVERRIDE" : "Target file already exists", - "NO_ZIP" : "No zip file was loaded", - "NO_ENTRY" : "Entry doesn't exist", - "DIRECTORY_CONTENT_ERROR" : "A directory cannot have content", - "FILE_NOT_FOUND" : "File not found: %s", - "NOT_IMPLEMENTED" : "Not implemented", - "INVALID_FILENAME" : "Invalid filename", - "INVALID_FORMAT" : "Invalid or unsupported zip format. No END header found" -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js deleted file mode 100644 index 2191ec1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/fattr.js +++ /dev/null @@ -1,84 +0,0 @@ -var fs = require("fs"), - pth = require("path"); - -fs.existsSync = fs.existsSync || pth.existsSync; - -module.exports = function(/*String*/path) { - - var _path = path || "", - _permissions = 0, - _obj = newAttr(), - _stat = null; - - function newAttr() { - return { - directory : false, - readonly : false, - hidden : false, - executable : false, - mtime : 0, - atime : 0 - } - } - - if (_path && fs.existsSync(_path)) { - _stat = fs.statSync(_path); - _obj.directory = _stat.isDirectory(); - _obj.mtime = _stat.mtime; - _obj.atime = _stat.atime; - _obj.executable = !!(1 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.readonly = !!(2 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.hidden = pth.basename(_path)[0] === "."; - } else { - console.warn("Invalid path: " + _path) - } - - return { - - get directory () { - return _obj.directory; - }, - - get readOnly () { - return _obj.readonly; - }, - - get hidden () { - return _obj.hidden; - }, - - get mtime () { - return _obj.mtime; - }, - - get atime () { - return _obj.atime; - }, - - - get executable () { - return _obj.executable; - }, - - decodeAttributes : function(val) { - - }, - - encodeAttributes : function (val) { - - }, - - toString : function() { - return '{\n' + - '\t"path" : "' + _path + ",\n" + - '\t"isDirectory" : ' + _obj.directory + ",\n" + - '\t"isReadOnly" : ' + _obj.readonly + ",\n" + - '\t"isHidden" : ' + _obj.hidden + ",\n" + - '\t"isExecutable" : ' + _obj.executable + ",\n" + - '\t"mTime" : ' + _obj.mtime + "\n" + - '\t"aTime" : ' + _obj.atime + "\n" + - '}'; - } - } - -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js deleted file mode 100644 index 935fc1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = require("./utils"); -module.exports.Constants = require("./constants"); -module.exports.Errors = require("./errors"); -module.exports.FileAttr = require("./fattr"); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js deleted file mode 100644 index bbd5366..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/util/utils.js +++ /dev/null @@ -1,145 +0,0 @@ -var fs = require("fs"), - pth = require('path'); - -fs.existsSync = fs.existsSync || pth.existsSync; - -module.exports = (function() { - - var crcTable = [], - Constants = require('./constants'), - Errors = require('./errors'), - - PATH_SEPARATOR = pth.normalize("/"); - - - function mkdirSync(/*String*/path) { - var resolvedPath = path.split(PATH_SEPARATOR)[0]; - path.split(PATH_SEPARATOR).forEach(function(name) { - if (!name || name.substr(-1,1) == ":") return; - resolvedPath += PATH_SEPARATOR + name; - var stat; - try { - stat = fs.statSync(resolvedPath); - } catch (e) { - fs.mkdirSync(resolvedPath); - } - if (stat && stat.isFile()) - throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath); - }); - } - - function findSync(/*String*/root, /*RegExp*/pattern, /*Boolean*/recoursive) { - if (typeof pattern === 'boolean') { - recoursive = pattern; - pattern = undefined; - } - var files = []; - fs.readdirSync(root).forEach(function(file) { - var path = pth.join(root, file); - - if (fs.statSync(path).isDirectory() && recoursive) - files = files.concat(findSync(path, pattern, recoursive)); - - if (!pattern || pattern.test(path)) { - files.push(pth.normalize(path) + (fs.statSync(path).isDirectory() ? PATH_SEPARATOR : "")); - } - - }); - return files; - } - - return { - makeDir : function(/*String*/path) { - mkdirSync(path); - }, - - crc32 : function(buf) { - var b = new Buffer(4); - if (!crcTable.length) { - for (var n = 0; n < 256; n++) { - var c = n; - for (var k = 8; --k >= 0;) // - if ((c & 1) != 0) { c = 0xedb88320 ^ (c >>> 1); } else { c = c >>> 1; } - if (c < 0) { - b.writeInt32LE(c, 0); - c = b.readUInt32LE(0); - } - crcTable[n] = c; - } - } - var crc = 0, off = 0, len = buf.length, c1 = ~crc; - while(--len >= 0) c1 = crcTable[(c1 ^ buf[off++]) & 0xff] ^ (c1 >>> 8); - crc = ~c1; - b.writeInt32LE(crc & 0xffffffff, 0); - return b.readUInt32LE(0); - }, - - methodToString : function(/*Number*/method) { - switch (method) { - case Constants.STORED: - return 'STORED (' + method + ')'; - case Constants.DEFLATED: - return 'DEFLATED (' + method + ')'; - default: - return 'UNSUPPORTED (' + method + ')' - } - - }, - - writeFileTo : function(/*String*/path, /*Buffer*/content, /*Boolean*/overwrite, /*Number*/attr) { - if (fs.existsSync(path)) { - if (!overwrite) - return false; // cannot overwite - - var stat = fs.statSync(path); - if (stat.isDirectory()) { - return false; - } - } - var folder = pth.dirname(path); - if (!fs.existsSync(folder)) { - mkdirSync(folder); - } - - var fd; - try { - fd = fs.openSync(path, 'w', 0666); - } catch(e) { - fs.chmodSync(path, 0666); - fd = fs.openSync(path, 'w', 0666); - } - if (fd) { - fs.writeSync(fd, content, 0, content.length, 0); - fs.closeSync(fd); - } - fs.chmodSync(path, attr || 0666); - return true; - }, - - findFiles : function(/*String*/path) { - return findSync(path, true); - }, - - getAttributes : function(/*String*/path) { - - }, - - setAttributes : function(/*String*/path) { - - }, - - toBuffer : function(input) { - if (Buffer.isBuffer(input)) { - return input; - } else { - if (input.length == 0) { - return new Buffer(0) - } - return new Buffer(input, 'utf8'); - } - }, - - Constants : Constants, - Errors : Errors - } -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js deleted file mode 100644 index fd0fa81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipEntry.js +++ /dev/null @@ -1,224 +0,0 @@ -var Utils = require("./util"), - Headers = require("./headers"), - Constants = Utils.Constants, - Methods = require("./methods"); - -module.exports = function (/*Buffer*/input) { - - var _entryHeader = new Headers.EntryHeader(), - _entryName = new Buffer(0), - _comment = new Buffer(0), - _isDirectory = false, - uncompressedData = null, - _extra = new Buffer(0); - - function getCompressedDataFromZip() { - if (!input || !Buffer.isBuffer(input)) { - return new Buffer(0); - } - _entryHeader.loadDataHeaderFromBinary(input); - return input.slice(_entryHeader.realDataOffset, _entryHeader.realDataOffset + _entryHeader.compressedSize) - } - - function crc32OK(data) { - // if bit 3 (0x08) of the general-purpose flags field is set, then the CRC-32 and file sizes are not known when the header is written - if (_entryHeader.flags & 0x8 != 0x8) { - if (Utils.crc32(data) != _entryHeader.crc) { - return false; - } - } else { - // @TODO: load and check data descriptor header - // The fields in the local header are filled with zero, and the CRC-32 and size are appended in a 12-byte structure - // (optionally preceded by a 4-byte signature) immediately after the compressed data: - } - return true; - } - - function decompress(/*Boolean*/async, /*Function*/callback) { - if (_isDirectory) { - if (async && callback) { - callback(new Buffer(0), Utils.Errors.DIRECTORY_CONTENT_ERROR); //si added error. - } - return new Buffer(0); - } - - var compressedData = getCompressedDataFromZip(); - if (compressedData.length == 0) { - if (async && callback) callback(compressedData, Utils.Errors.NO_DATA);//si added error. - return compressedData; - } - - var data = new Buffer(_entryHeader.size); - data.fill(0); - - switch (_entryHeader.method) { - case Utils.Constants.STORED: - compressedData.copy(data); - if (!crc32OK(data)) { - if (async && callback) callback(data, Utils.Errors.BAD_CRC);//si added error - return Utils.Errors.BAD_CRC; - } else {//si added otherwise did not seem to return data. - if (async && callback) callback(data); - return data; - } - break; - case Utils.Constants.DEFLATED: - var inflater = new Methods.Inflater(compressedData); - if (!async) { - inflater.inflate(data); - if (!crc32OK(data)) { - console.warn(Utils.Errors.BAD_CRC + " " + _entryName.toString()) - } - return data; - } else { - inflater.inflateAsync(function(result) { - result.copy(data, 0); - if (crc32OK(data)) { - if (callback) callback(data, Utils.Errors.BAD_CRC); //si added error - } else { //si added otherwise did not seem to return data. - if (callback) callback(data); - } - }) - } - break; - default: - if (async && callback) callback(new Buffer(0), Utils.Errors.UNKNOWN_METHOD); - return Utils.Errors.UNKNOWN_METHOD; - } - } - - function compress(/*Boolean*/async, /*Function*/callback) { - if ((!uncompressedData || !uncompressedData.length) && Buffer.isBuffer(input)) { - // no data set or the data wasn't changed to require recompression - if (async && callback) callback(getCompressedDataFromZip()); - return getCompressedDataFromZip(); - } - - if (uncompressedData.length && !_isDirectory) { - var compressedData; - // Local file header - switch (_entryHeader.method) { - case Utils.Constants.STORED: - _entryHeader.compressedSize = _entryHeader.size; - - compressedData = new Buffer(uncompressedData.length); - uncompressedData.copy(compressedData); - - if (async && callback) callback(compressedData); - return compressedData; - - break; - default: - case Utils.Constants.DEFLATED: - var deflater = new Methods.Deflater(uncompressedData); - if (!async) { - console.log(_entryName.toString()); - var deflated = deflater.deflate(); - _entryHeader.compressedSize = deflated.length; - return deflated; - } else { - deflater.deflateAsync(function(data) { - compressedData = new Buffer(data.length); - _entryHeader.compressedSize = data.length; - data.copy(compressedData); - callback && callback(compressedData); - }) - } - deflater = null; - break; - } - } else { - if (async && callback) { - callback(new Buffer(0)); - } else { - return new Buffer(0); - } - } - } - - return { - get entryName () { return _entryName.toString(); }, - get rawEntryName() { return _entryName; }, - set entryName (val) { - _entryName = Utils.toBuffer(val); - var lastChar = _entryName[_entryName.length - 1]; - _isDirectory = (lastChar == 47) || (lastChar == 92); - _entryHeader.fileNameLength = _entryName.length; - }, - - get extra () { return _extra; }, - set extra (val) { - _extra = val; - _entryHeader.extraLength = val.length; - }, - - get comment () { return _comment.toString(); }, - set comment (val) { - _comment = Utils.toBuffer(val); - _entryHeader.commentLength = _comment.length; - }, - - get name () { var n = _entryName.toString(); return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop(); }, - get isDirectory () { return _isDirectory }, - - getCompressedData : function() { - return compress(false, null) - }, - - getCompressedDataAsync : function(/*Function*/callback) { - compress(true, callback) - }, - - setData : function(value) { - uncompressedData = Utils.toBuffer(value); - if (!_isDirectory && uncompressedData.length) { - _entryHeader.size = uncompressedData.length; - _entryHeader.method = Utils.Constants.DEFLATED; - _entryHeader.crc = Utils.crc32(value); - } else { // folders and blank files should be stored - _entryHeader.method = Utils.Constants.STORED; - } - }, - - getData : function() { - return decompress(false, null); - }, - - getDataAsync : function(/*Function*/callback) { - decompress(true, callback) - }, - - set header(/*Buffer*/data) { - _entryHeader.loadFromBinary(data); - }, - - get header() { - return _entryHeader; - }, - - packHeader : function() { - var header = _entryHeader.entryHeaderToBinary(); - // add - _entryName.copy(header, Utils.Constants.CENHDR); - if (_entryHeader.extraLength) { - _extra.copy(header, Utils.Constants.CENHDR + _entryName.length) - } - if (_entryHeader.commentLength) { - _comment.copy(header, Utils.Constants.CENHDR + _entryName.length + _entryHeader.extraLength, _comment.length); - } - return header; - }, - - toString : function() { - return '{\n' + - '\t"entryName" : "' + _entryName.toString() + "\",\n" + - '\t"name" : "' + _entryName.toString().split("/").pop() + "\",\n" + - '\t"comment" : "' + _comment.toString() + "\",\n" + - '\t"isDirectory" : ' + _isDirectory + ",\n" + - '\t"header" : ' + _entryHeader.toString().replace(/\t/mg, "\t\t") + ",\n" + - '\t"compressedData" : <' + (input && input.length + " bytes buffer" || "null") + ">\n" + - '\t"data" : <' + (uncompressedData && uncompressedData.length + " bytes buffer" || "null") + ">\n" + - '}'; - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js deleted file mode 100644 index b0f78cf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/zipFile.js +++ /dev/null @@ -1,233 +0,0 @@ -var ZipEntry = require("./zipEntry"), - Headers = require("./headers"); - Utils = require("./util"); - -module.exports = function(/*String|Buffer*/input, /*Number*/inputType) { - var entryList = [], - entryTable = {}, - _comment = new Buffer(0), - filename = "", - fs = require("fs"), - inBuffer = null, - mainHeader = new Headers.MainHeader(); - - if (inputType == Utils.Constants.FILE) { - // is a filename - filename = input; - inBuffer = fs.readFileSync(filename); - readMainHeader(); - } else if (inputType == Utils.Constants.BUFFER) { - // is a memory buffer - inBuffer = input; - readMainHeader(); - } else { - // none. is a new file - } - - function readEntries() { - entryTable = {}; - entryList = new Array(mainHeader.diskEntries); // total number of entries - var index = mainHeader.offset; // offset of first CEN header - for(var i = 0; i < entryList.length; i++) { - - var tmp = index, - entry = new ZipEntry(inBuffer); - entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR); - - entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength); - - if (entry.header.extraLength) { - entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength); - } - - if (entry.header.commentLength) - entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength); - - index += entry.header.entryHeaderSize; - - entryList[i] = entry; - entryTable[entry.entryName] = entry; - } - } - - function readMainHeader() { - var i = inBuffer.length - Utils.Constants.ENDHDR, // END header size - n = Math.max(0, i - 0xFFFF), // 0xFFFF is the max zip file comment length - endOffset = 0; // Start offset of the END header - - for (i; i >= n; i--) { - if (inBuffer[i] != 0x50) continue; // quick check that the byte is 'P' - if (inBuffer.readUInt32LE(i) == Utils.Constants.ENDSIG) { // "PK\005\006" - endOffset = i; - break; - } - } - if (!endOffset) - throw Utils.Errors.INVALID_FORMAT; - - mainHeader.loadFromBinary(inBuffer.slice(endOffset, endOffset + Utils.Constants.ENDHDR)); - if (mainHeader.commentLength) { - _comment = inBuffer.slice(endOffset + Utils.Constants.ENDHDR); - } - readEntries(); - } - - return { - /** - * Returns an array of ZipEntry objects existent in the current opened archive - * @return Array - */ - get entries () { - return entryList; - }, - - /** - * Archive comment - * @return {String} - */ - get comment () { return _comment.toString(); }, - set comment(val) { - mainHeader.commentLength = val.length; - _comment = val; - }, - - /** - * Returns a reference to the entry with the given name or null if entry is inexistent - * - * @param entryName - * @return ZipEntry - */ - getEntry : function(/*String*/entryName) { - return entryTable[entryName] || null; - }, - - /** - * Adds the given entry to the entry list - * - * @param entry - */ - setEntry : function(/*ZipEntry*/entry) { - entryList.push(entry); - entryTable[entry.entryName] = entry; - mainHeader.totalEntries = entryList.length; - }, - - /** - * Removes the entry with the given name from the entry list. - * - * If the entry is a directory, then all nested files and directories will be removed - * @param entryName - */ - deleteEntry : function(/*String*/entryName) { - var entry = entryTable[entryName]; - if (entry && entry.isDirectory) { - var _self = this; - this.getEntryChildren(entry).forEach(function(child) { - if (child.entryName != entryName) { - _self.deleteEntry(child.entryName) - } - }) - } - entryList.slice(entryList.indexOf(entry), 1); - delete(entryTable[entryName]); - mainHeader.totalEntries = entryList.length; - }, - - /** - * Iterates and returns all nested files and directories of the given entry - * - * @param entry - * @return Array - */ - getEntryChildren : function(/*ZipEntry*/entry) { - if (entry.isDirectory) { - var list = [], - name = entry.entryName, - len = name.length; - - entryList.forEach(function(zipEntry) { - if (zipEntry.entryName.substr(0, len) == name) { - list.push(zipEntry); - } - }); - return list; - } - return [] - }, - - /** - * Returns the zip file - * - * @return Buffer - */ - compressToBuffer : function() { - if (entryList.length > 1) { - entryList.sort(function(a, b) { - var nameA = a.entryName.toLowerCase(); - var nameB = b.entryName.toLowerCase(); - if (nameA < nameB) {return -1} - if (nameA > nameB) {return 1} - return 0; - }); - } - - var totalSize = 0, - dataBlock = [], - entryHeaders = [], - dindex = 0; - - mainHeader.size = 0; - mainHeader.offset = 0; - - entryList.forEach(function(entry) { - entry.header.offset = dindex; - - // compress data and set local and entry header accordingly. Reason why is called first - var compressedData = entry.getCompressedData(); - // data header - var dataHeader = entry.header.dataHeaderToBinary(); - var postHeader = new Buffer(entry.entryName + entry.extra.toString()); - var dataLength = dataHeader.length + postHeader.length + compressedData.length; - - dindex += dataLength; - - dataBlock.push(dataHeader); - dataBlock.push(postHeader); - dataBlock.push(compressedData); - - var entryHeader = entry.packHeader(); - entryHeaders.push(entryHeader); - mainHeader.size += entryHeader.length; - totalSize += (dataLength + entryHeader.length); - }); - - totalSize += mainHeader.mainHeaderSize; // also includes zip file comment length - // point to end of data and begining of central directory first record - mainHeader.offset = dindex; - - dindex = 0; - var outBuffer = new Buffer(totalSize); - dataBlock.forEach(function(content) { - content.copy(outBuffer, dindex); // write data blocks - dindex += content.length; - }); - entryHeaders.forEach(function(content) { - content.copy(outBuffer, dindex); // write central directory entries - dindex += content.length; - }); - - var mh = mainHeader.toBinary(); - if (_comment) { - _comment.copy(mh, Utils.Constants.ENDHDR); // add zip file comment - } - - mh.copy(outBuffer, dindex); // write main header - - return outBuffer - }, - - toAsyncBuffer : function(/*Function*/callback) { - - } - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md deleted file mode 100644 index 8fc6779..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/README.md +++ /dev/null @@ -1,26 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js deleted file mode 100755 index 29bfa8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/bin.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index 5c1147c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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": "2.0.1", - "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* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index afc83b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,228 +0,0 @@ -var fs = require('fs') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - 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') - - 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.end() - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json deleted file mode 100644 index 08516f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "rimraf", - "version": "2.2.2", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~2" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~2" - }, - "_id": "rimraf@2.2.2", - "_from": "rimraf@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js deleted file mode 100644 index 55f8d9a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,184 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - 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 (er.code === "EBUSY" && 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() - 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")) - 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") - rmkidsSync(p) - } -} - -function rmkidsSync (p) { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore deleted file mode 100644 index 13abef4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -node_modules/* -npm_debug.log diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml deleted file mode 100644 index 895dbd3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE deleted file mode 100644 index 6d03581..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 'Dominic Tarr' - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md deleted file mode 100644 index 565e0e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# stream-combiner - - - -## Combine (stream1,...,streamN) - -Turn a pipeline into a single stream. `pipeline` returns a stream that writes to the first stream -and reads from the last stream. - -Listening for 'error' will recieve errors from all streams inside the pipe. - -``` js - var Combine = require('stream-combiner') - var es = require('event-stream') - - Combine( //connect streams together with `pipe` - process.openStdin(), //open stdin - es.split(), //split stream to break on newlines - es.map(function (data, callback) {//turn this async function into a stream - callback(null - , inspect(JSON.parse(data))) //render it nicely - }), - process.stdout // pipe it to stdout ! - ) -``` - -## License - -MIT diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js deleted file mode 100644 index 99cf5b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/index.js +++ /dev/null @@ -1,39 +0,0 @@ -var duplexer = require('duplexer') - -module.exports = function () { - - var streams = [].slice.call(arguments) - , first = streams[0] - , last = streams[streams.length - 1] - , thepipe = duplexer(first, last) - - if(streams.length == 1) - return streams[0] - else if (!streams.length) - throw new Error('connect called with empty args') - - //pipe all the streams together - - function recurse (streams) { - if(streams.length < 2) - return - streams[0].pipe(streams[1]) - recurse(streams.slice(1)) - } - - recurse(streams) - - function onerror () { - var args = [].slice.call(arguments) - args.unshift('error') - thepipe.emit.apply(thepipe, args) - } - - //es.duplex already reemits the error from the first and last stream. - //add a listener for the inner streams in the pipeline. - for(var i = 1; i < streams.length - 1; i ++) - streams[i].on('error', onerror) - - return thepipe -} - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore deleted file mode 100644 index 062c11e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.log -*.err \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml deleted file mode 100644 index c2ba3f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile deleted file mode 100644 index 1f8985d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -test: - node test.js - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md deleted file mode 100644 index a24cecb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# duplexer [![build status][1]][2] - -Creates a duplex stream - -Taken from [event-stream][3] - -## duplex (writeStream, readStream) - -Takes a writable stream and a readable stream and makes them appear as a readable writable stream. - -It is assumed that the two streams are connected to each other in some way. - -## Example - - var grep = cp.exec('grep Stream') - - duplex(grep.stdin, grep.stdout) - -## Installation - -`npm install duplexer` - -## Tests - -`make test` - -## Contributors - - - Dominictarr - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Raynos/duplexer.png - [2]: http://travis-ci.org/Raynos/duplexer - [3]: https://github.com/dominictarr/event-stream#duplex-writestream-readstream \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js deleted file mode 100644 index 22e0d51..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/index.js +++ /dev/null @@ -1,77 +0,0 @@ -var Stream = require("stream") - , writeMethods = ["write", "end", "destroy"] - , readMethods = ["resume", "pause"] - , readEvents = ["data", "close"] - , slice = Array.prototype.slice - -module.exports = duplex - -function duplex(writer, reader) { - var stream = new Stream() - , ended = false - - writeMethods.forEach(proxyWriter) - - readMethods.forEach(proxyReader) - - readEvents.forEach(proxyStream) - - reader.on("end", handleEnd) - - writer.on("drain", function() { - stream.emit("drain") - }) - - writer.on("error", reemit) - reader.on("error", reemit) - - stream.writable = writer.writable - stream.readable = reader.readable - - return stream - - function proxyWriter(methodName) { - stream[methodName] = method - - function method() { - return writer[methodName].apply(writer, arguments) - } - } - - function proxyReader(methodName) { - stream[methodName] = method - - function method() { - stream.emit(methodName) - var func = reader[methodName] - if (func) { - return func.apply(reader, arguments) - } - reader.emit(methodName) - } - } - - function proxyStream(methodName) { - reader.on(methodName, reemit) - - function reemit() { - var args = slice.call(arguments) - args.unshift(methodName) - stream.emit.apply(stream, args) - } - } - - function handleEnd() { - if (ended) { - return - } - ended = true - var args = slice.call(arguments) - args.unshift("end") - stream.emit.apply(stream, args) - } - - function reemit(err) { - stream.emit("error", err) - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json deleted file mode 100644 index cc6d314..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "duplexer", - "version": "0.0.4", - "description": "Creates a duplex stream", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/duplexer.git" - }, - "main": "index", - "homepage": "https://github.com/Raynos/duplexer", - "contributors": [ - { - "name": "Jake Verbaten" - } - ], - "bugs": { - "url": "https://github.com/Raynos/duplexer/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "through": "~0.1.4" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Raynos/duplexer/raw/master/LICENSE" - } - ], - "scripts": { - "test": "make test" - }, - "readme": "# duplexer [![build status][1]][2]\n\nCreates a duplex stream\n\nTaken from [event-stream][3]\n\n## duplex (writeStream, readStream)\n\nTakes a writable stream and a readable stream and makes them appear as a readable writable stream.\n\nIt is assumed that the two streams are connected to each other in some way.\n\n## Example\n\n var grep = cp.exec('grep Stream')\n\n duplex(grep.stdin, grep.stdout)\n\n## Installation\n\n`npm install duplexer`\n\n## Tests\n\n`make test`\n\n## Contributors\n\n - Dominictarr\n - Raynos\n\n## MIT Licenced\n\n [1]: https://secure.travis-ci.org/Raynos/duplexer.png\n [2]: http://travis-ci.org/Raynos/duplexer\n [3]: https://github.com/dominictarr/event-stream#duplex-writestream-readstream", - "readmeFilename": "README.md", - "_id": "duplexer@0.0.4", - "dist": { - "shasum": "3d8e199c895711c70cdf7c16cfc99d09c2760540" - }, - "_from": "duplexer@~0.0.3", - "_resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.0.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js deleted file mode 100644 index e06a864..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/node_modules/duplexer/test.js +++ /dev/null @@ -1,27 +0,0 @@ -var duplex = require("./index") - , assert = require("assert") - , through = require("through") - -var readable = through() - , writable = through(write) - , written = 0 - , data = 0 - -var stream = duplex(writable, readable) - -function write() { - written++ -} - -stream.on("data", ondata) - -function ondata() { - data++ -} - -stream.write() -readable.emit("data") - -assert.equal(written, 1) -assert.equal(data, 1) -console.log("DONE") \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json deleted file mode 100644 index 3c10d93..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "stream-combiner", - "version": "0.0.2", - "homepage": "https://github.com/dominictarr/stream-combiner", - "repository": { - "type": "git", - "url": "git://github.com/dominictarr/stream-combiner.git" - }, - "dependencies": { - "duplexer": "~0.0.3" - }, - "devDependencies": { - "tape": "0.0.4", - "event-stream": "~3.0.7" - }, - "scripts": { - "test": "set -e; for t in test/*.js; do node $t; done" - }, - "author": { - "name": "'Dominic Tarr'", - "email": "dominic.tarr@gmail.com", - "url": "http://dominictarr.com" - }, - "license": "MIT", - "readme": "# stream-combiner\n\n\n\n## Combine (stream1,...,streamN)\n\nTurn a pipeline into a single stream. `pipeline` returns a stream that writes to the first stream\nand reads from the last stream. \n\nListening for 'error' will recieve errors from all streams inside the pipe.\n\n``` js\n var Combine = require('stream-combiner')\n var es = require('event-stream')\n\n Combine( //connect streams together with `pipe`\n process.openStdin(), //open stdin\n es.split(), //split stream to break on newlines\n es.map(function (data, callback) {//turn this async function into a stream\n callback(null\n , inspect(JSON.parse(data))) //render it nicely\n }),\n process.stdout // pipe it to stdout !\n )\n```\n\n## License\n\nMIT\n", - "readmeFilename": "README.md", - "description": "", - "bugs": { - "url": "https://github.com/dominictarr/stream-combiner/issues" - }, - "_id": "stream-combiner@0.0.2", - "dist": { - "shasum": "dfe0e74675742565e76c6056788ea5c23bd97db4" - }, - "_from": "stream-combiner@~0.0.2", - "_resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js deleted file mode 100644 index d17ddad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/stream-combiner/test/index.js +++ /dev/null @@ -1,52 +0,0 @@ -var es = require('event-stream') -var combine = require('..') -var test = require('tape') - -test('do not duplicate errors', function (test) { - - var errors = 0; - var pipe = combine( - es.through(function(data) { - return this.emit('data', data); - }), - es.through(function(data) { - return this.emit('error', new Error(data)); - }) - ) - - pipe.on('error', function(err) { - errors++ - test.ok(errors, 'expected error count') - process.nextTick(function () { - return test.end(); - }) - }) - - return pipe.write('meh'); -}) - -test('3 pipe do not duplicate errors', function (test) { - - var errors = 0; - var pipe = combine( - es.through(function(data) { - return this.emit('data', data); - }), - es.through(function(data) { - return this.emit('error', new Error(data)); - }), - es.through() - ) - - pipe.on('error', function(err) { - errors++ - test.ok(errors, 'expected error count') - process.nextTick(function () { - return test.end(); - }) - }) - - return pipe.write('meh'); - -}) - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore deleted file mode 100644 index c167ad5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules -examples/extract/ -test/tmp/ -test/fixtures/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml deleted file mode 100644 index 2d26206..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md deleted file mode 100644 index c6b0f82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js deleted file mode 100644 index e150abf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/extracter.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js deleted file mode 100644 index 39f3f08..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/examples/reader.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js deleted file mode 100644 index 4af5c41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/entry.js +++ /dev/null @@ -1,213 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js deleted file mode 100644 index 1728c45..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header-writer.js +++ /dev/null @@ -1,191 +0,0 @@ - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js deleted file mode 100644 index 74f432c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extended-header.js +++ /dev/null @@ -1,140 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js deleted file mode 100644 index c34a81e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/extract.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js deleted file mode 100644 index 0bfc7b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/global-header-writer.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js deleted file mode 100644 index 05b237c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/header.js +++ /dev/null @@ -1,385 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js deleted file mode 100644 index 3ff14dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/pack.js +++ /dev/null @@ -1,231 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js deleted file mode 100644 index 884e73d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/lib/parse.js +++ /dev/null @@ -1,270 +0,0 @@ - -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md deleted file mode 100644 index c16e9c4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js deleted file mode 100644 index 9328844..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js deleted file mode 100644 index 1141f3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/block-stream.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js deleted file mode 100644 index 93e4068..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js deleted file mode 100644 index 55fa133..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/bench/dropper.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js deleted file mode 100644 index 008de03..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/block-stream.js +++ /dev/null @@ -1,209 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json deleted file mode 100644 index 21bdee0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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" - }, - "_id": "block-stream@0.0.7", - "_from": "block-stream@*" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js deleted file mode 100644 index b4b9305..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/basic.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js deleted file mode 100644 index 7a8de88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js deleted file mode 100644 index 6d38429..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/nopad.js +++ /dev/null @@ -1,57 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js deleted file mode 100644 index 64d0d09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js deleted file mode 100644 index 1cc9ea0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/thorough.js +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js deleted file mode 100644 index c6db79a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/block-stream/test/two-stream.js +++ /dev/null @@ -1,59 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore deleted file mode 100644 index 494272a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules/ -examples/deep-copy/ -examples/path/ -examples/filter-copy/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml deleted file mode 100644 index 2d26206..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md deleted file mode 100644 index 9d8cb77..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js deleted file mode 100644 index c6b55b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/filter-pipe.js +++ /dev/null @@ -1,131 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - !this.basename.match(/^filter-copy$/) - } - }) - -// this writer will only write directories -var w = fstream.Writer({ path: path.resolve(__dirname, "filter-copy") - , type: "Directory" - , filter: function () { - return this.type === "Directory" - } - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 1000) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -var i = 1 -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok " + (i ++) + " A WINNAR IS YOU") - ended = true - // now go through and verify that everything in there is a dir. - var p = path.resolve(__dirname, "filter-copy") - var checker = fstream.Reader({ path: p }) - checker.checker = true - checker.on("child", function (e) { - var ok = e.type === "Directory" - console.log((ok ? "" : "not ") + "ok " + (i ++) + - " should be a dir: " + - e.path.substr(checker.path.length + 1)) - }) -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok " + (i ++) + " ended") -}) - -r.pipe(w) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js deleted file mode 100644 index 648ec84..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/pipe.js +++ /dev/null @@ -1,115 +0,0 @@ -var fstream = require("../fstream.js") -var path = require("path") - -var r = fstream.Reader({ path: path.dirname(__dirname) - , filter: function () { - return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) - } - }) - -var w = fstream.Writer({ path: path.resolve(__dirname, "deep-copy") - , type: "Directory" - }) - -var indent = "" -var escape = {} - -r.on("entry", appears) -r.on("ready", function () { - console.error("ready to begin!", r.path) -}) - -function appears (entry) { - console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename, entry) - if (foggy) { - console.error("FOGGY!") - var p = entry - do { - console.error(p.depth, p.path, p._paused) - } while (p = p.parent) - - throw new Error("\033[mshould not have entries while foggy") - } - indent += "\t" - entry.on("data", missile(entry)) - entry.on("end", runaway(entry)) - entry.on("entry", appears) -} - -var foggy -function missile (entry) { - if (entry.type === "Directory") { - var ended = false - entry.once("end", function () { ended = true }) - return function (c) { - // throw in some pathological pause()/resume() behavior - // just for extra fun. - process.nextTick(function () { - if (!foggy && !ended) { // && Math.random() < 0.3) { - console.error(indent +"%s casts a spell", entry.basename) - console.error("\na slowing fog comes over the battlefield...\n\033[32m") - entry.pause() - entry.once("resume", liftFog) - foggy = setTimeout(liftFog, 10) - - function liftFog (who) { - if (!foggy) return - if (who) { - console.error("%s breaks the spell!", who && who.path) - } else { - console.error("the spell expires!") - } - console.error("\033[mthe fog lifts!\n") - clearTimeout(foggy) - foggy = null - if (entry._paused) entry.resume() - } - - } - }) - } - } - - return function (c) { - var e = Math.random() < 0.5 - console.error(indent + "%s %s for %d damage!", - entry.basename, - e ? "is struck" : "fires a chunk", - c.length) - } -} - -function runaway (entry) { return function () { - var e = Math.random() < 0.5 - console.error(indent + "%s %s", - entry.basename, - e ? "turns to flee" : "is vanquished!") - indent = indent.slice(0, -1) -}} - - -w.on("entry", attacks) -//w.on("ready", function () { attacks(w) }) -function attacks (entry) { - console.error(indent + "%s %s!", entry.basename, - entry.type === "Directory" ? "calls for backup" : "attacks") - entry.on("entry", attacks) -} - -ended = false -r.on("end", function () { - if (foggy) clearTimeout(foggy) - console.error("\033[mIT'S OVER!!") - console.error("A WINNAR IS YOU!") - - console.log("ok 1 A WINNAR IS YOU") - ended = true -}) - -process.on("exit", function () { - console.log((ended ? "" : "not ") + "ok 2 ended") -}) - -r.pipe(w) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js deleted file mode 100644 index 9aa1a95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/reader.js +++ /dev/null @@ -1,54 +0,0 @@ -var fstream = require("../fstream.js") -var tap = require("tap") -var fs = require("fs") -var path = require("path") -var children = -1 -var dir = path.dirname(__dirname) - -var gotReady = false -var ended = false - -tap.test("reader test", function (t) { - - var r = fstream.Reader({ path: dir - , filter: function () { - // return this.parent === r - return this.parent === r || this === r - } - }) - - r.on("ready", function () { - gotReady = true - children = fs.readdirSync(dir).length - console.error("Setting expected children to "+children) - t.equal(r.type, "Directory", "should be a directory") - }) - - r.on("entry", function (entry) { - children -- - if (!gotReady) { - t.fail("children before ready!") - } - t.equal(entry.dirname, r.path, "basename is parent dir") - }) - - r.on("error", function (er) { - t.fail(er) - t.end() - process.exit(1) - }) - - r.on("end", function () { - t.equal(children, 0, "should have seen all children") - ended = true - }) - - var closed = false - r.on("close", function () { - t.ok(ended, "saw end before close") - t.notOk(closed, "close should only happen once") - closed = true - t.end() - }) - -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js deleted file mode 100644 index d7816d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/examples/symlink-write.js +++ /dev/null @@ -1,24 +0,0 @@ -var fstream = require("../fstream.js") - , closed = false - -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , isSymbolicLink: true - , mode: "0755" // octal strings supported - }) - .on("close", function () { - closed = true - var fs = require("fs") - var s = fs.lstatSync("path/to/symlink") - var isSym = s.isSymbolicLink() - console.log((isSym?"":"not ") +"ok 1 should be symlink") - var t = fs.readlinkSync("path/to/symlink") - var isTarget = t === "./file" - console.log((isTarget?"":"not ") +"ok 2 should link to ./file") - }) - .end() - -process.on("exit", function () { - console.log((closed?"":"not ")+"ok 3 should be closed") -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js deleted file mode 100644 index c66d26f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/fstream.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.Abstract = require("./lib/abstract.js") -exports.Reader = require("./lib/reader.js") -exports.Writer = require("./lib/writer.js") - -exports.File = - { Reader: require("./lib/file-reader.js") - , Writer: require("./lib/file-writer.js") } - -exports.Dir = - { Reader : require("./lib/dir-reader.js") - , Writer : require("./lib/dir-writer.js") } - -exports.Link = - { Reader : require("./lib/link-reader.js") - , Writer : require("./lib/link-writer.js") } - -exports.Proxy = - { Reader : require("./lib/proxy-reader.js") - , Writer : require("./lib/proxy-writer.js") } - -exports.Reader.Dir = exports.DirReader = exports.Dir.Reader -exports.Reader.File = exports.FileReader = exports.File.Reader -exports.Reader.Link = exports.LinkReader = exports.Link.Reader -exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader - -exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer -exports.Writer.File = exports.FileWriter = exports.File.Writer -exports.Writer.Link = exports.LinkWriter = exports.Link.Writer -exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer - -exports.collect = require("./lib/collect.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js deleted file mode 100644 index 11ef0e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/abstract.js +++ /dev/null @@ -1,85 +0,0 @@ -// the parent class for all fstreams. - -module.exports = Abstract - -var Stream = require("stream").Stream - , inherits = require("inherits") - -function Abstract () { - Stream.call(this) -} - -inherits(Abstract, Stream) - -Abstract.prototype.on = function (ev, fn) { - if (ev === "ready" && this.ready) { - process.nextTick(fn.bind(this)) - } else { - Stream.prototype.on.call(this, ev, fn) - } - return this -} - -Abstract.prototype.abort = function () { - this._aborted = true - this.emit("abort") -} - -Abstract.prototype.destroy = function () {} - -Abstract.prototype.warn = function (msg, code) { - var me = this - , er = decorate(msg, code, me) - if (!me.listeners("warn")) { - console.error("%s %s\n" + - "path = %s\n" + - "syscall = %s\n" + - "fstream_type = %s\n" + - "fstream_path = %s\n" + - "fstream_unc_path = %s\n" + - "fstream_class = %s\n" + - "fstream_stack =\n%s\n", - code || "UNKNOWN", - er.stack, - er.path, - er.syscall, - er.fstream_type, - er.fstream_path, - er.fstream_unc_path, - er.fstream_class, - er.fstream_stack.join("\n")) - } else { - me.emit("warn", er) - } -} - -Abstract.prototype.info = function (msg, code) { - this.emit("info", msg, code) -} - -Abstract.prototype.error = function (msg, code, th) { - var er = decorate(msg, code, this) - if (th) throw er - else this.emit("error", er) -} - -function decorate (er, code, me) { - if (!(er instanceof Error)) er = new Error(er) - er.code = er.code || code - er.path = er.path || me.path - er.fstream_type = er.fstream_type || me.type - er.fstream_path = er.fstream_path || me.path - if (me._path !== me.path) { - er.fstream_unc_path = er.fstream_unc_path || me._path - } - if (me.linkpath) { - er.fstream_linkpath = er.fstream_linkpath || me.linkpath - } - er.fstream_class = er.fstream_class || me.constructor.name - er.fstream_stack = er.fstream_stack || - new Error().stack.split(/\n/).slice(3).map(function (s) { - return s.replace(/^ at /, "") - }) - - return er -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js deleted file mode 100644 index a36f780..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/collect.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = collect - -function collect (stream) { - if (stream._collected) return - - stream._collected = true - stream.pause() - - stream.on("data", save) - stream.on("end", save) - var buf = [] - function save (b) { - if (typeof b === "string") b = new Buffer(b) - if (Buffer.isBuffer(b) && !b.length) return - buf.push(b) - } - - stream.on("entry", saveEntry) - var entryBuffer = [] - function saveEntry (e) { - collect(e) - entryBuffer.push(e) - } - - stream.on("proxy", proxyPause) - function proxyPause (p) { - p.pause() - } - - - // replace the pipe method with a new version that will - // unlock the buffered stuff. if you just call .pipe() - // without a destination, then it'll re-play the events. - stream.pipe = (function (orig) { return function (dest) { - // console.error(" === open the pipes", dest && dest.path) - - // let the entries flow through one at a time. - // Once they're all done, then we can resume completely. - var e = 0 - ;(function unblockEntry () { - var entry = entryBuffer[e++] - // console.error(" ==== unblock entry", entry && entry.path) - if (!entry) return resume() - entry.on("end", unblockEntry) - if (dest) dest.add(entry) - else stream.emit("entry", entry) - })() - - function resume () { - stream.removeListener("entry", saveEntry) - stream.removeListener("data", save) - stream.removeListener("end", save) - - stream.pipe = orig - if (dest) stream.pipe(dest) - - buf.forEach(function (b) { - if (b) stream.emit("data", b) - else stream.emit("end") - }) - - stream.resume() - } - - return dest - }})(stream.pipe) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js deleted file mode 100644 index dd9883b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-reader.js +++ /dev/null @@ -1,250 +0,0 @@ -// A thing that emits "entry" events with Reader objects -// Pausing it causes it to stop emitting entry events, and also -// pauses the current entry if there is one. - -module.exports = DirReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , Reader = require("./reader.js") - , assert = require("assert").ok - -inherits(DirReader, Reader) - -function DirReader (props) { - var me = this - if (!(me instanceof DirReader)) throw new Error( - "DirReader must be called as constructor.") - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - throw new Error("Non-directory type "+ props.type) - } - - me.entries = null - me._index = -1 - me._paused = false - me._length = -1 - - if (props.sort) { - this.sort = props.sort - } - - Reader.call(this, props) -} - -DirReader.prototype._getEntries = function () { - var me = this - - // race condition. might pause() before calling _getEntries, - // and then resume, and try to get them a second time. - if (me._gotEntries) return - me._gotEntries = true - - fs.readdir(me._path, function (er, entries) { - if (er) return me.error(er) - - me.entries = entries - - me.emit("entries", entries) - if (me._paused) me.once("resume", processEntries) - else processEntries() - - function processEntries () { - me._length = me.entries.length - if (typeof me.sort === "function") { - me.entries = me.entries.sort(me.sort.bind(me)) - } - me._read() - } - }) -} - -// start walking the dir, and emit an "entry" event for each one. -DirReader.prototype._read = function () { - var me = this - - if (!me.entries) return me._getEntries() - - if (me._paused || me._currentEntry || me._aborted) { - // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted) - return - } - - me._index ++ - if (me._index >= me.entries.length) { - if (!me._ended) { - me._ended = true - me.emit("end") - me.emit("close") - } - return - } - - // ok, handle this one, then. - - // save creating a proxy, by stat'ing the thing now. - var p = path.resolve(me._path, me.entries[me._index]) - assert(p !== me._path) - assert(me.entries[me._index]) - - // set this to prevent trying to _read() again in the stat time. - me._currentEntry = p - fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) { - if (er) return me.error(er) - - var who = me._proxy || me - - stat.path = p - stat.basename = path.basename(p) - stat.dirname = path.dirname(p) - var childProps = me.getChildProps.call(who, stat) - childProps.path = p - childProps.basename = path.basename(p) - childProps.dirname = path.dirname(p) - - var entry = Reader(childProps, stat) - - // console.error("DR Entry", p, stat.size) - - me._currentEntry = entry - - // "entry" events are for direct entries in a specific dir. - // "child" events are for any and all children at all levels. - // This nomenclature is not completely final. - - entry.on("pause", function (who) { - if (!me._paused && !entry._disowned) { - me.pause(who) - } - }) - - entry.on("resume", function (who) { - if (me._paused && !entry._disowned) { - me.resume(who) - } - }) - - entry.on("stat", function (props) { - me.emit("_entryStat", entry, props) - if (entry._aborted) return - if (entry._paused) entry.once("resume", function () { - me.emit("entryStat", entry, props) - }) - else me.emit("entryStat", entry, props) - }) - - entry.on("ready", function EMITCHILD () { - // console.error("DR emit child", entry._path) - if (me._paused) { - // console.error(" DR emit child - try again later") - // pause the child, and emit the "entry" event once we drain. - // console.error("DR pausing child entry") - entry.pause(me) - return me.once("resume", EMITCHILD) - } - - // skip over sockets. they can't be piped around properly, - // so there's really no sense even acknowledging them. - // if someone really wants to see them, they can listen to - // the "socket" events. - if (entry.type === "Socket") { - me.emit("socket", entry) - } else { - me.emitEntry(entry) - } - }) - - var ended = false - entry.on("close", onend) - entry.on("disown", onend) - function onend () { - if (ended) return - ended = true - me.emit("childEnd", entry) - me.emit("entryEnd", entry) - me._currentEntry = null - if (!me._paused) { - me._read() - } - } - - // XXX Remove this. Works in node as of 0.6.2 or so. - // Long filenames should not break stuff. - entry.on("error", function (er) { - if (entry._swallowErrors) { - me.warn(er) - entry.emit("end") - entry.emit("close") - } else { - me.emit("error", er) - } - }) - - // proxy up some events. - ; [ "child" - , "childEnd" - , "warn" - ].forEach(function (ev) { - entry.on(ev, me.emit.bind(me, ev)) - }) - }) -} - -DirReader.prototype.disown = function (entry) { - entry.emit("beforeDisown") - entry._disowned = true - entry.parent = entry.root = null - if (entry === this._currentEntry) { - this._currentEntry = null - } - entry.emit("disown") -} - -DirReader.prototype.getChildProps = function (stat) { - return { depth: this.depth + 1 - , root: this.root || this - , parent: this - , follow: this.follow - , filter: this.filter - , sort: this.props.sort - } -} - -DirReader.prototype.pause = function (who) { - var me = this - if (me._paused) return - who = who || me - me._paused = true - if (me._currentEntry && me._currentEntry.pause) { - me._currentEntry.pause(who) - } - me.emit("pause", who) -} - -DirReader.prototype.resume = function (who) { - var me = this - if (!me._paused) return - who = who || me - - me._paused = false - // console.error("DR Emit Resume", me._path) - me.emit("resume", who) - if (me._paused) { - // console.error("DR Re-paused", me._path) - return - } - - if (me._currentEntry) { - if (me._currentEntry.resume) me._currentEntry.resume(who) - } else me._read() -} - -DirReader.prototype.emitEntry = function (entry) { - this.emit("entry", entry) - this.emit("child", entry) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js deleted file mode 100644 index 7073b88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/dir-writer.js +++ /dev/null @@ -1,171 +0,0 @@ -// It is expected that, when .add() returns false, the consumer -// of the DirWriter will pause until a "drain" event occurs. Note -// that this is *almost always going to be the case*, unless the -// thing being written is some sort of unsupported type, and thus -// skipped over. - -module.exports = DirWriter - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Writer = require("./writer.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , path = require("path") - , collect = require("./collect.js") - -inherits(DirWriter, Writer) - -function DirWriter (props) { - var me = this - if (!(me instanceof DirWriter)) me.error( - "DirWriter must be called as constructor.", null, true) - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - me.error("Non-directory type "+ props.type + " " + - JSON.stringify(props), null, true) - } - - Writer.call(this, props) -} - -DirWriter.prototype._create = function () { - var me = this - mkdir(me._path, Writer.dirmode, function (er) { - if (er) return me.error(er) - // ready to start getting entries! - me.ready = true - me.emit("ready") - me._process() - }) -} - -// a DirWriter has an add(entry) method, but its .write() doesn't -// do anything. Why a no-op rather than a throw? Because this -// leaves open the door for writing directory metadata for -// gnu/solaris style dumpdirs. -DirWriter.prototype.write = function () { - return true -} - -DirWriter.prototype.end = function () { - this._ended = true - this._process() -} - -DirWriter.prototype.add = function (entry) { - var me = this - - // console.error("\tadd", entry._path, "->", me._path) - collect(entry) - if (!me.ready || me._currentEntry) { - me._buffer.push(entry) - return false - } - - // create a new writer, and pipe the incoming entry into it. - if (me._ended) { - return me.error("add after end") - } - - me._buffer.push(entry) - me._process() - - return 0 === this._buffer.length -} - -DirWriter.prototype._process = function () { - var me = this - - // console.error("DW Process p=%j", me._processing, me.basename) - - if (me._processing) return - - var entry = me._buffer.shift() - if (!entry) { - // console.error("DW Drain") - me.emit("drain") - if (me._ended) me._finish() - return - } - - me._processing = true - // console.error("DW Entry", entry._path) - - me.emit("entry", entry) - - // ok, add this entry - // - // don't allow recursive copying - var p = entry - do { - var pp = p._path || p.path - if (pp === me.root._path || pp === me._path || - (pp && pp.indexOf(me._path) === 0)) { - // console.error("DW Exit (recursive)", entry.basename, me._path) - me._processing = false - if (entry._collected) entry.pipe() - return me._process() - } - } while (p = p.parent) - - // console.error("DW not recursive") - - // chop off the entry's root dir, replace with ours - var props = { parent: me - , root: me.root || me - , type: entry.type - , depth: me.depth + 1 } - - var p = entry._path || entry.path || entry.props.path - if (entry.parent) { - p = p.substr(entry.parent._path.length + 1) - } - // get rid of any ../../ shenanigans - props.path = path.join(me.path, path.join("/", p)) - - // if i have a filter, the child should inherit it. - props.filter = me.filter - - // all the rest of the stuff, copy over from the source. - Object.keys(entry.props).forEach(function (k) { - if (!props.hasOwnProperty(k)) { - props[k] = entry.props[k] - } - }) - - // not sure at this point what kind of writer this is. - var child = me._currentChild = new Writer(props) - child.on("ready", function () { - // console.error("DW Child Ready", child.type, child._path) - // console.error(" resuming", entry._path) - entry.pipe(child) - entry.resume() - }) - - // XXX Make this work in node. - // Long filenames should not break stuff. - child.on("error", function (er) { - if (child._swallowErrors) { - me.warn(er) - child.emit("end") - child.emit("close") - } else { - me.emit("error", er) - } - }) - - // we fire _end internally *after* end, so that we don't move on - // until any "end" listeners have had their chance to do stuff. - child.on("close", onend) - var ended = false - function onend () { - if (ended) return - ended = true - // console.error("* DW Child end", child.basename) - me._currentChild = null - me._processing = false - me._process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js deleted file mode 100644 index b1f9861..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-reader.js +++ /dev/null @@ -1,147 +0,0 @@ -// Basically just a wrapper around an fs.ReadStream - -module.exports = FileReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - , EOF = {EOF: true} - , CLOSE = {CLOSE: true} - -inherits(FileReader, Reader) - -function FileReader (props) { - // console.error(" FR create", props.path, props.size, new Error().stack) - var me = this - if (!(me instanceof FileReader)) throw new Error( - "FileReader must be called as constructor.") - - // should already be established as a File type - // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, - // with a HardLinkReader class. - if (!((props.type === "Link" && props.Link) || - (props.type === "File" && props.File))) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesEmitted = 0 - Reader.call(me, props) -} - -FileReader.prototype._getStream = function () { - var me = this - , stream = me._stream = fs.createReadStream(me._path, me.props) - - if (me.props.blksize) { - stream.bufferSize = me.props.blksize - } - - stream.on("open", me.emit.bind(me, "open")) - - stream.on("data", function (c) { - // console.error("\t\t%d %s", c.length, me.basename) - me._bytesEmitted += c.length - // no point saving empty chunks - if (!c.length) return - else if (me._paused || me._buffer.length) { - me._buffer.push(c) - me._read() - } else me.emit("data", c) - }) - - stream.on("end", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering End", me._path) - me._buffer.push(EOF) - me._read() - } else { - me.emit("end") - } - - if (me._bytesEmitted !== me.props.size) { - me.error("Didn't get expected byte count\n"+ - "expect: "+me.props.size + "\n" + - "actual: "+me._bytesEmitted) - } - }) - - stream.on("close", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering Close", me._path) - me._buffer.push(CLOSE) - me._read() - } else { - // console.error("FR close 1", me._path) - me.emit("close") - } - }) - - me._read() -} - -FileReader.prototype._read = function () { - var me = this - // console.error("FR _read", me._path) - if (me._paused) { - // console.error("FR _read paused", me._path) - return - } - - if (!me._stream) { - // console.error("FR _getStream calling", me._path) - return me._getStream() - } - - // clear out the buffer, if there is one. - if (me._buffer.length) { - // console.error("FR _read has buffer", me._buffer.length, me._path) - var buf = me._buffer - for (var i = 0, l = buf.length; i < l; i ++) { - var c = buf[i] - if (c === EOF) { - // console.error("FR Read emitting buffered end", me._path) - me.emit("end") - } else if (c === CLOSE) { - // console.error("FR Read emitting buffered close", me._path) - me.emit("close") - } else { - // console.error("FR Read emitting buffered data", me._path) - me.emit("data", c) - } - - if (me._paused) { - // console.error("FR Read Re-pausing at "+i, me._path) - me._buffer = buf.slice(i) - return - } - } - me._buffer.length = 0 - } - // console.error("FR _read done") - // that's about all there is to it. -} - -FileReader.prototype.pause = function (who) { - var me = this - // console.error("FR Pause", me._path) - if (me._paused) return - who = who || me - me._paused = true - if (me._stream) me._stream.pause() - me.emit("pause", who) -} - -FileReader.prototype.resume = function (who) { - var me = this - // console.error("FR Resume", me._path) - if (!me._paused) return - who = who || me - me.emit("resume", who) - me._paused = false - if (me._stream) me._stream.resume() - me._read() -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js deleted file mode 100644 index 6811462..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/file-writer.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = FileWriter - -var fs = require("graceful-fs") - , mkdir = require("mkdirp") - , Writer = require("./writer.js") - , inherits = require("inherits") - , EOF = {} - -inherits(FileWriter, Writer) - -function FileWriter (props) { - var me = this - if (!(me instanceof FileWriter)) throw new Error( - "FileWriter must be called as constructor.") - - // should already be established as a File type - if (props.type !== "File" || !props.File) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesWritten = 0 - - Writer.call(this, props) -} - -FileWriter.prototype._create = function () { - var me = this - if (me._stream) return - - var so = {} - if (me.props.flags) so.flags = me.props.flags - so.mode = Writer.filemode - if (me._old && me._old.blksize) so.bufferSize = me._old.blksize - - me._stream = fs.createWriteStream(me._path, so) - - me._stream.on("open", function (fd) { - // console.error("FW open", me._buffer, me._path) - me.ready = true - me._buffer.forEach(function (c) { - if (c === EOF) me._stream.end() - else me._stream.write(c) - }) - me.emit("ready") - // give this a kick just in case it needs it. - me.emit("drain") - }) - - me._stream.on("drain", function () { me.emit("drain") }) - - me._stream.on("close", function () { - // console.error("\n\nFW Stream Close", me._path, me.size) - me._finish() - }) -} - -FileWriter.prototype.write = function (c) { - var me = this - - me._bytesWritten += c.length - - if (!me.ready) { - if (!Buffer.isBuffer(c) && typeof c !== 'string') - throw new Error('invalid write data') - me._buffer.push(c) - return false - } - - var ret = me._stream.write(c) - // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length) - - // allow 2 buffered writes, because otherwise there's just too - // much stop and go bs. - return ret || (me._stream._queue && me._stream._queue.length <= 2) -} - -FileWriter.prototype.end = function (c) { - var me = this - - if (c) me.write(c) - - if (!me.ready) { - me._buffer.push(EOF) - return false - } - - return me._stream.end() -} - -FileWriter.prototype._finish = function () { - var me = this - if (typeof me.size === "number" && me._bytesWritten != me.size) { - me.error( - "Did not get expected byte count.\n" + - "expect: " + me.size + "\n" + - "actual: " + me._bytesWritten) - } - Writer.prototype._finish.call(me) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js deleted file mode 100644 index cd65c41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/get-type.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = getType - -function getType (st) { - var types = - [ "Directory" - , "File" - , "SymbolicLink" - , "Link" // special for hardlinks from tarballs - , "BlockDevice" - , "CharacterDevice" - , "FIFO" - , "Socket" ] - , type - - if (st.type && -1 !== types.indexOf(st.type)) { - st[st.type] = true - return st.type - } - - for (var i = 0, l = types.length; i < l; i ++) { - type = types[i] - var is = st[type] || st["is" + type] - if (typeof is === "function") is = is.call(st) - if (is) { - st[type] = true - st.type = type - return type - } - } - - return null -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js deleted file mode 100644 index 7e7ab6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-reader.js +++ /dev/null @@ -1,54 +0,0 @@ -// Basically just a wrapper around an fs.readlink -// -// XXX: Enhance this to support the Link type, by keeping -// a lookup table of {:}, so that hardlinks -// can be preserved in tarballs. - -module.exports = LinkReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(LinkReader, Reader) - -function LinkReader (props) { - var me = this - if (!(me instanceof LinkReader)) throw new Error( - "LinkReader must be called as constructor.") - - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - Reader.call(me, props) -} - -// When piping a LinkReader into a LinkWriter, we have to -// already have the linkpath property set, so that has to -// happen *before* the "ready" event, which means we need to -// override the _stat method. -LinkReader.prototype._stat = function (currentStat) { - var me = this - fs.readlink(me._path, function (er, linkpath) { - if (er) return me.error(er) - me.linkpath = me.props.linkpath = linkpath - me.emit("linkpath", linkpath) - Reader.prototype._stat.call(me, currentStat) - }) -} - -LinkReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we need - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js deleted file mode 100644 index 5c8f1e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/link-writer.js +++ /dev/null @@ -1,95 +0,0 @@ - -module.exports = LinkWriter - -var fs = require("graceful-fs") - , Writer = require("./writer.js") - , inherits = require("inherits") - , path = require("path") - , rimraf = require("rimraf") - -inherits(LinkWriter, Writer) - -function LinkWriter (props) { - var me = this - if (!(me instanceof LinkWriter)) throw new Error( - "LinkWriter must be called as constructor.") - - // should already be established as a Link type - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - if (props.linkpath === "") props.linkpath = "." - if (!props.linkpath) { - me.error("Need linkpath property to create " + props.type) - } - - Writer.call(this, props) -} - -LinkWriter.prototype._create = function () { - // console.error(" LW _create") - var me = this - , hard = me.type === "Link" || process.platform === "win32" - , link = hard ? "link" : "symlink" - , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath - - // can only change the link path by clobbering - // For hard links, let's just assume that's always the case, since - // there's no good way to read them if we don't already know. - if (hard) return clobber(me, lp, link) - - fs.readlink(me._path, function (er, p) { - // only skip creation if it's exactly the same link - if (p && p === lp) return finish(me) - clobber(me, lp, link) - }) -} - -function clobber (me, lp, link) { - rimraf(me._path, function (er) { - if (er) return me.error(er) - create(me, lp, link) - }) -} - -function create (me, lp, link) { - fs[link](lp, me._path, function (er) { - // if this is a hard link, and we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier in. - // Additionally, an EPERM or EACCES can happen on win32 if it's trying - // to make a link to a directory. Again, just skip it. - // A better solution would be to have fs.symlink be supported on - // windows in some nice fashion. - if (er) { - if ((er.code === "ENOENT" || - er.code === "EACCES" || - er.code === "EPERM" ) && process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - } else return me.error(er) - } - finish(me) - }) -} - -function finish (me) { - me.ready = true - me.emit("ready") - if (me._ended && !me._finished) me._finish() -} - -LinkWriter.prototype.end = function () { - // console.error("LW finish in end") - this._ended = true - if (this.ready) { - this._finished = true - this._finish() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js deleted file mode 100644 index a0ece34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-reader.js +++ /dev/null @@ -1,93 +0,0 @@ -// A reader for when we don't yet know what kind of thing -// the thing is. - -module.exports = ProxyReader - -var Reader = require("./reader.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , fs = require("graceful-fs") - -inherits(ProxyReader, Reader) - -function ProxyReader (props) { - var me = this - if (!(me instanceof ProxyReader)) throw new Error( - "ProxyReader must be called as constructor.") - - me.props = props - me._buffer = [] - me.ready = false - - Reader.call(me, props) -} - -ProxyReader.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Reader(props, current)) - }) -} - -ProxyReader.prototype._addProxy = function (proxy) { - var me = this - if (me._proxyTarget) { - return me.error("proxy already set") - } - - me._proxyTarget = proxy - proxy._proxy = me - - ; [ "error" - , "data" - , "end" - , "close" - , "linkpath" - , "entry" - , "entryEnd" - , "child" - , "childEnd" - , "warn" - , "stat" - ].forEach(function (ev) { - // console.error("~~ proxy event", ev, me.path) - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - proxy.on("ready", function () { - // console.error("~~ proxy is ready!", me.path) - me.ready = true - me.emit("ready") - }) - - var calls = me._buffer - me._buffer.length = 0 - calls.forEach(function (c) { - proxy[c[0]].apply(proxy, c[1]) - }) -} - -ProxyReader.prototype.pause = function () { - return this._proxyTarget ? this._proxyTarget.pause() : false -} - -ProxyReader.prototype.resume = function () { - return this._proxyTarget ? this._proxyTarget.resume() : false -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js deleted file mode 100644 index b047663..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/proxy-writer.js +++ /dev/null @@ -1,109 +0,0 @@ -// A writer for when we don't know what kind of thing -// the thing is. That is, it's not explicitly set, -// so we're going to make it whatever the thing already -// is, or "File" -// -// Until then, collect all events. - -module.exports = ProxyWriter - -var Writer = require("./writer.js") - , getType = require("./get-type.js") - , inherits = require("inherits") - , collect = require("./collect.js") - , fs = require("fs") - -inherits(ProxyWriter, Writer) - -function ProxyWriter (props) { - var me = this - if (!(me instanceof ProxyWriter)) throw new Error( - "ProxyWriter must be called as constructor.") - - me.props = props - me._needDrain = false - - Writer.call(me, props) -} - -ProxyWriter.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Writer(props, current)) - }) -} - -ProxyWriter.prototype._addProxy = function (proxy) { - // console.error("~~ set proxy", this.path) - var me = this - if (me._proxy) { - return me.error("proxy already set") - } - - me._proxy = proxy - ; [ "ready" - , "error" - , "close" - , "pipe" - , "drain" - , "warn" - ].forEach(function (ev) { - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - var calls = me._buffer - calls.forEach(function (c) { - // console.error("~~ ~~ proxy buffered call", c[0], c[1]) - proxy[c[0]].apply(proxy, c[1]) - }) - me._buffer.length = 0 - if (me._needsDrain) me.emit("drain") -} - -ProxyWriter.prototype.add = function (entry) { - // console.error("~~ proxy add") - collect(entry) - - if (!this._proxy) { - this._buffer.push(["add", [entry]]) - this._needDrain = true - return false - } - return this._proxy.add(entry) -} - -ProxyWriter.prototype.write = function (c) { - // console.error("~~ proxy write") - if (!this._proxy) { - this._buffer.push(["write", [c]]) - this._needDrain = true - return false - } - return this._proxy.write(c) -} - -ProxyWriter.prototype.end = function (c) { - // console.error("~~ proxy end") - if (!this._proxy) { - this._buffer.push(["end", [c]]) - return false - } - return this._proxy.end(c) -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js deleted file mode 100644 index e4e1b48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/reader.js +++ /dev/null @@ -1,259 +0,0 @@ - -module.exports = Reader - -var fs = require("graceful-fs") - , Stream = require("stream").Stream - , inherits = require("inherits") - , path = require("path") - , getType = require("./get-type.js") - , hardLinks = Reader.hardLinks = {} - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Reader, Abstract) - -var DirReader = require("./dir-reader.js") - , FileReader = require("./file-reader.js") - , LinkReader = require("./link-reader.js") - , SocketReader = require("./socket-reader.js") - , ProxyReader = require("./proxy-reader.js") - -function Reader (props, currentStat) { - var me = this - if (!(me instanceof Reader)) return new Reader(props, currentStat) - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) { - me.error("Must provide a path", null, true) - } - - // polymorphism. - // call fstream.Reader(dir) to get a DirReader object, etc. - // Note that, unlike in the Writer case, ProxyReader is going - // to be the *normal* state of affairs, since we rarely know - // the type of a file prior to reading it. - - - var type - , ClassType - - if (props.type && typeof props.type === "function") { - type = props.type - ClassType = type - } else { - type = getType(props) - ClassType = Reader - } - - if (currentStat && !type) { - type = getType(currentStat) - props[type] = true - props.type = type - } - - switch (type) { - case "Directory": - ClassType = DirReader - break - - case "Link": - // XXX hard links are just files. - // However, it would be good to keep track of files' dev+inode - // and nlink values, and create a HardLinkReader that emits - // a linkpath value of the original copy, so that the tar - // writer can preserve them. - // ClassType = HardLinkReader - // break - - case "File": - ClassType = FileReader - break - - case "SymbolicLink": - ClassType = LinkReader - break - - case "Socket": - ClassType = SocketReader - break - - case null: - ClassType = ProxyReader - break - } - - if (!(me instanceof ClassType)) { - return new ClassType(props) - } - - Abstract.call(me) - - me.readable = true - me.writable = false - - me.type = type - me.props = props - me.depth = props.depth = props.depth || 0 - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - // how DOES one create files on the moon? - // if the path has spaces in it, then UNC will fail. - me._swallowErrors = true - //if (me._path.indexOf(" ") === -1) { - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - //} - } - } - me.basename = props.basename = path.basename(me.path) - me.dirname = props.dirname = path.dirname(me.path) - - // these have served their purpose, and are now just noisy clutter - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - me.filter = typeof props.filter === "function" ? props.filter : null - if (props.sort === "alpha") props.sort = alphasort - - // start the ball rolling. - // this will stat the thing, and then call me._read() - // to start reading whatever it is. - // console.error("calling stat", props.path, currentStat) - me._stat(currentStat) -} - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - -Reader.prototype._stat = function (currentStat) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - - // console.error("Reader._stat", me._path, currentStat) - if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) - else fs[stat](me._path, statCb) - - - function statCb (er, props_) { - // console.error("Reader._stat, statCb", me._path, props_, props_.nlink) - if (er) return me.error(er) - - Object.keys(props_).forEach(function (k) { - props[k] = props_[k] - }) - - // if it's not the expected size, then abort here. - if (undefined !== me.size && props.size !== me.size) { - return me.error("incorrect size") - } - me.size = props.size - - var type = getType(props) - // special little thing for handling hardlinks. - if (type !== "Directory" && props.nlink && props.nlink > 1) { - var k = props.dev + ":" + props.ino - // console.error("Reader has nlink", me._path, k) - if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path - else { - // switch into hardlink mode. - type = me.type = me.props.type = "Link" - me.Link = me.props.Link = true - me.linkpath = me.props.linkpath = hardLinks[k] - // console.error("Hardlink detected, switching mode", me._path, me.linkpath) - // Setting __proto__ would arguably be the "correct" - // approach here, but that just seems too wrong. - me._stat = me._read = LinkReader.prototype._read - } - } - - if (me.type && me.type !== type) { - me.error("Unexpected type: " + type) - } - - // if the filter doesn't pass, then just skip over this one. - // still have to emit end so that dir-walking can move on. - if (me.filter) { - var who = me._proxy || me - // special handling for ProxyReaders - if (!me.filter.call(who, who, props)) { - if (!me._disowned) { - me.abort() - me.emit("end") - me.emit("close") - } - return - } - } - - // last chance to abort or disown before the flow starts! - var events = ["_stat", "stat", "ready"] - var e = 0 - ;(function go () { - if (me._aborted) { - me.emit("end") - me.emit("close") - return - } - - if (me._paused) { - me.once("resume", go) - return - } - - var ev = events[e ++] - if (!ev) return me._read() - me.emit(ev, props) - go() - })() - } -} - -Reader.prototype.pipe = function (dest, opts) { - var me = this - if (typeof dest.add === "function") { - // piping to a multi-compatible, and we've got directory entries. - me.on("entry", function (entry) { - var ret = dest.add(entry) - if (false === ret) { - me.pause() - } - }) - } - - // console.error("R Pipe apply Stream Pipe") - return Stream.prototype.pipe.apply(this, arguments) -} - -Reader.prototype.pause = function (who) { - this._paused = true - who = who || this - this.emit("pause", who) - if (this._stream) this._stream.pause(who) -} - -Reader.prototype.resume = function (who) { - this._paused = false - who = who || this - this.emit("resume", who) - if (this._stream) this._stream.resume(who) - this._read() -} - -Reader.prototype._read = function () { - this.error("Cannot read unknown type: "+this.type) -} - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js deleted file mode 100644 index e89c173..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/socket-reader.js +++ /dev/null @@ -1,38 +0,0 @@ -// Just get the stats, and then don't do anything. -// You can't really "read" from a socket. You "connect" to it. -// Mostly, this is here so that reading a dir with a socket in it -// doesn't blow up. - -module.exports = SocketReader - -var fs = require("graceful-fs") - , fstream = require("../fstream.js") - , inherits = require("inherits") - , mkdir = require("mkdirp") - , Reader = require("./reader.js") - -inherits(SocketReader, Reader) - -function SocketReader (props) { - var me = this - if (!(me instanceof SocketReader)) throw new Error( - "SocketReader must be called as constructor.") - - if (!(props.type === "Socket" && props.Socket)) { - throw new Error("Non-socket type "+ props.type) - } - - Reader.call(me, props) -} - -SocketReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we have - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js deleted file mode 100644 index 5599fb2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/lib/writer.js +++ /dev/null @@ -1,389 +0,0 @@ - -module.exports = Writer - -var fs = require("graceful-fs") - , inherits = require("inherits") - , rimraf = require("rimraf") - , mkdir = require("mkdirp") - , path = require("path") - , umask = process.platform === "win32" ? 0 : process.umask() - , getType = require("./get-type.js") - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Writer, Abstract) - -Writer.dirmode = 0777 & (~umask) -Writer.filemode = 0666 & (~umask) - -var DirWriter = require("./dir-writer.js") - , LinkWriter = require("./link-writer.js") - , FileWriter = require("./file-writer.js") - , ProxyWriter = require("./proxy-writer.js") - -// props is the desired state. current is optionally the current stat, -// provided here so that subclasses can avoid statting the target -// more than necessary. -function Writer (props, current) { - var me = this - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) me.error("Must provide a path", null, true) - - // polymorphism. - // call fstream.Writer(dir) to get a DirWriter object, etc. - var type = getType(props) - , ClassType = Writer - - switch (type) { - case "Directory": - ClassType = DirWriter - break - case "File": - ClassType = FileWriter - break - case "Link": - case "SymbolicLink": - ClassType = LinkWriter - break - case null: - // Don't know yet what type to create, so we wrap in a proxy. - ClassType = ProxyWriter - break - } - - if (!(me instanceof ClassType)) return new ClassType(props) - - // now get down to business. - - Abstract.call(me) - - // props is what we want to set. - // set some convenience properties as well. - me.type = props.type - me.props = props - me.depth = props.depth || 0 - me.clobber = false === props.clobber ? props.clobber : true - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - me._swallowErrors = true - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - } - } - me.basename = path.basename(props.path) - me.dirname = path.dirname(props.path) - me.linkpath = props.linkpath || null - - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - - if (typeof props.mode === "string") { - props.mode = parseInt(props.mode, 8) - } - - me.readable = false - me.writable = true - - // buffer until ready, or while handling another entry - me._buffer = [] - me.ready = false - - me.filter = typeof props.filter === "function" ? props.filter: null - - // start the ball rolling. - // this checks what's there already, and then calls - // me._create() to call the impl-specific creation stuff. - me._stat(current) -} - -// Calling this means that it's something we can't create. -// Just assert that it's already there, otherwise raise a warning. -Writer.prototype._create = function () { - var me = this - fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) { - if (er) { - return me.warn("Cannot create " + me._path + "\n" + - "Unsupported type: "+me.type, "ENOTSUP") - } - me._finish() - }) -} - -Writer.prototype._stat = function (current) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - , who = me._proxy || me - - if (current) statCb(null, current) - else fs[stat](me._path, statCb) - - function statCb (er, current) { - if (me.filter && !me.filter.call(who, who, current)) { - me._aborted = true - me.emit("end") - me.emit("close") - return - } - - // if it's not there, great. We'll just create it. - // if it is there, then we'll need to change whatever differs - if (er || !current) { - return create(me) - } - - me._old = current - var currentType = getType(current) - - // if it's a type change, then we need to clobber or error. - // if it's not a type change, then let the impl take care of it. - if (currentType !== me.type) { - return rimraf(me._path, function (er) { - if (er) return me.error(er) - me._old = null - create(me) - }) - } - - // otherwise, just handle in the app-specific way - // this creates a fs.WriteStream, or mkdir's, or whatever - create(me) - } -} - -function create (me) { - // console.error("W create", me._path, Writer.dirmode) - - // XXX Need to clobber non-dirs that are in the way, - // unless { clobber: false } in the props. - mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) { - // console.error("W created", path.dirname(me._path), er) - if (er) return me.error(er) - - // later on, we have to set the mode and owner for these - me._madeDir = made - return me._create() - }) -} - -function endChmod (me, want, current, path, cb) { - var wantMode = want.mode - , chmod = want.follow || me.type !== "SymbolicLink" - ? "chmod" : "lchmod" - - if (!fs[chmod]) return cb() - if (typeof wantMode !== "number") return cb() - - var curMode = current.mode & 0777 - wantMode = wantMode & 0777 - if (wantMode === curMode) return cb() - - fs[chmod](path, wantMode, cb) -} - - -function endChown (me, want, current, path, cb) { - // Don't even try it unless root. Too easy to EPERM. - if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() - if (typeof want.uid !== "number" && - typeof want.gid !== "number" ) return cb() - - if (current.uid === want.uid && - current.gid === want.gid) return cb() - - var chown = (me.props.follow || me.type !== "SymbolicLink") - ? "chown" : "lchown" - if (!fs[chown]) return cb() - - if (typeof want.uid !== "number") want.uid = current.uid - if (typeof want.gid !== "number") want.gid = current.gid - - fs[chown](path, want.uid, want.gid, cb) -} - -function endUtimes (me, want, current, path, cb) { - if (!fs.utimes || process.platform === "win32") return cb() - - var utimes = (want.follow || me.type !== "SymbolicLink") - ? "utimes" : "lutimes" - - if (utimes === "lutimes" && !fs[utimes]) { - utimes = "utimes" - } - - if (!fs[utimes]) return cb() - - var curA = current.atime - , curM = current.mtime - , meA = want.atime - , meM = want.mtime - - if (meA === undefined) meA = curA - if (meM === undefined) meM = curM - - if (!isDate(meA)) meA = new Date(meA) - if (!isDate(meM)) meA = new Date(meM) - - if (meA.getTime() === curA.getTime() && - meM.getTime() === curM.getTime()) return cb() - - fs[utimes](path, meA, meM, cb) -} - - -// XXX This function is beastly. Break it up! -Writer.prototype._finish = function () { - var me = this - - // console.error(" W Finish", me._path, me.size) - - // set up all the things. - // At this point, we're already done writing whatever we've gotta write, - // adding files to the dir, etc. - var todo = 0 - var errState = null - var done = false - - if (me._old) { - // the times will almost *certainly* have changed. - // adds the utimes syscall, but remove another stat. - me._old.atime = new Date(0) - me._old.mtime = new Date(0) - // console.error(" W Finish Stale Stat", me._path, me.size) - setProps(me._old) - } else { - var stat = me.props.follow ? "stat" : "lstat" - // console.error(" W Finish Stating", me._path, me.size) - fs[stat](me._path, function (er, current) { - // console.error(" W Finish Stated", me._path, me.size, current) - if (er) { - // if we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier on. - if (er.code === "ENOENT" && - (me.type === "Link" || me.type === "SymbolicLink") && - process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - return - } else return me.error(er) - } - setProps(me._old = current) - }) - } - - return - - function setProps (current) { - todo += 3 - endChmod(me, me.props, current, me._path, next("chmod")) - endChown(me, me.props, current, me._path, next("chown")) - endUtimes(me, me.props, current, me._path, next("utimes")) - } - - function next (what) { - return function (er) { - // console.error(" W Finish", what, todo) - if (errState) return - if (er) { - er.fstream_finish_call = what - return me.error(errState = er) - } - if (--todo > 0) return - if (done) return - done = true - - // we may still need to set the mode/etc. on some parent dirs - // that were created previously. delay end/close until then. - if (!me._madeDir) return end() - else endMadeDir(me, me._path, end) - - function end (er) { - if (er) { - er.fstream_finish_call = "setupMadeDir" - return me.error(er) - } - // all the props have been set, so we're completely done. - me.emit("end") - me.emit("close") - } - } - } -} - -function endMadeDir (me, p, cb) { - var made = me._madeDir - // everything *between* made and path.dirname(me._path) - // needs to be set up. Note that this may just be one dir. - var d = path.dirname(p) - - endMadeDir_(me, d, function (er) { - if (er) return cb(er) - if (d === made) { - return cb() - } - endMadeDir(me, d, cb) - }) -} - -function endMadeDir_ (me, p, cb) { - var dirProps = {} - Object.keys(me.props).forEach(function (k) { - dirProps[k] = me.props[k] - - // only make non-readable dirs if explicitly requested. - if (k === "mode" && me.type !== "Directory") { - dirProps[k] = dirProps[k] | 0111 - } - }) - - var todo = 3 - , errState = null - fs.stat(p, function (er, current) { - if (er) return cb(errState = er) - endChmod(me, dirProps, current, p, next) - endChown(me, dirProps, current, p, next) - endUtimes(me, dirProps, current, p, next) - }) - - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- todo === 0) return cb() - } -} - -Writer.prototype.pipe = function () { - this.error("Can't pipe from writable stream") -} - -Writer.prototype.add = function () { - this.error("Cannot add to non-Directory type") -} - -Writer.prototype.write = function () { - return true -} - -function objectToString (d) { - return Object.prototype.toString.call(d) -} - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md deleted file mode 100644 index eb1a109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 1865f92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,159 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -// The EMFILE enqueuing stuff - -var util = require('util') - -function noop () {} - -var debug = noop -var util = require('util') -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json deleted file mode 100644 index 1b4a21c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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": "2.0.1", - "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* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@2.0.1", - "_from": "graceful-fs@~2.0.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index afc83b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,228 +0,0 @@ -var fs = require('fs') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 104f36b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - 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') - - 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.end() - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json deleted file mode 100644 index 3bad3de..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/fstream/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "fstream", - "description": "Advanced file system stream things", - "version": "0.1.24", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/fstream.git" - }, - "main": "fstream.js", - "engines": { - "node": ">=0.6" - }, - "dependencies": { - "rimraf": "2", - "mkdirp": "0.3", - "graceful-fs": "~2.0.0", - "inherits": "~2.0.0" - }, - "devDependencies": { - "tap": "" - }, - "scripts": { - "test": "tap examples/*.js" - }, - "license": "BSD", - "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/fstream/issues" - }, - "_id": "fstream@0.1.24", - "_from": "fstream@~0.1.8" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md deleted file mode 100644 index b1c5665..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json deleted file mode 100644 index cee4a9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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" - }, - "_id": "inherits@2.0.1", - "_from": "inherits@2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js deleted file mode 100644 index fc53012..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json deleted file mode 100644 index 4c9e2cd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "tar", - "description": "tar for node", - "version": "0.1.18", - "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## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-tar/issues" - }, - "_id": "tar@0.1.18", - "_from": "tar@~0.1.18" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js deleted file mode 100644 index a81298b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/tar.js +++ /dev/null @@ -1,173 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js deleted file mode 100644 index 1524ff7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/00-setup-fixtures.js +++ /dev/null @@ -1,53 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js deleted file mode 100644 index fff4818..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/extract.js +++ /dev/null @@ -1,358 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz deleted file mode 100644 index 4501bcf..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/fixtures.tgz and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js deleted file mode 100644 index 8ea6f79..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/header.js +++ /dev/null @@ -1,183 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js deleted file mode 100644 index 5bf0e54..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack-no-proprietary.js +++ /dev/null @@ -1,854 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js deleted file mode 100644 index 0f50994..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/pack.js +++ /dev/null @@ -1,897 +0,0 @@ - -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js deleted file mode 100644 index f765a50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/parse.js +++ /dev/null @@ -1,359 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js deleted file mode 100644 index a00ff7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/tar/test/zz-cleanup.js +++ /dev/null @@ -1,20 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore deleted file mode 100644 index 0593600..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -.\#* -/node_modules -\#* -npm-debug.log -node_modules -*.tgz diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml deleted file mode 100644 index ec43125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.11" - - "0.10" - - "0.8" - - "0.6" \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE deleted file mode 100644 index 0146c4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 Bruce Williams - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md deleted file mode 100644 index d7fb9c3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/README.md +++ /dev/null @@ -1,277 +0,0 @@ -node-temp -========= - -Temporary files, directories, and streams for Node.js. - -Handles generating a unique file/directory name under the appropriate -system temporary directory, changing the file to an appropriate mode, -and supports automatic removal (if asked) - -`temp` has a similar API to the `fs` module. - -Node.js Compatibility ---------------------- - -Supports v0.6.0+. - -[![Build Status](https://travis-ci.org/bruce/node-temp.png)](https://travis-ci.org/bruce/node-temp) - -Please let me know if you have problems running it on a later version of Node.js or -have platform-specific problems. - -Installation ------------- - -Install it using [npm](http://github.com/isaacs/npm): - - $ npm install temp - -Or get it directly from: -http://github.com/bruce/node-temp - -Synopsis --------- - -You can create temporary files with `open` and `openSync`, temporary -directories with `mkdir` and `mkdirSync`, or you can get a unique name -in the system temporary directory with `path`. - -Working copies of the following examples can be found under the -`examples` directory. - -### Temporary Files - -To create a temporary file use `open` or `openSync`, passing -them an optional prefix, suffix, or both (see below for details on -affixes). The object passed to the callback (or returned) has -`path` and `fd` keys: - -```javascript -{ path: "/path/to/file", -, fd: theFileDescriptor -} -``` - -In this example we write to a temporary file and call out to `grep` and -`wc -l` to determine the number of time `foo` occurs in the text. The -temporary file is chmod'd `0600` and cleaned up automatically when the -process at exit (because `temp.track()` is called): - -```javascript -var temp = require('temp'), - fs = require('fs'), - util = require('util'), - exec = require('child_process').exec; - -// Automatically track and cleanup files at exit -temp.track(); - -// Fake data -var myData = "foo\nbar\nfoo\nbaz"; - -// Process the data (note: error handling omitted) -temp.open('myprefix', function(err, info) { - fs.write(info.fd, myData); - fs.close(info.fd, function(err) { - exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) { - util.puts(stdout.trim()); - }); - }); -}); -``` - -### Want Cleanup? Make sure you ask for it. - -As noted in the example above, if you want temp to track the files and directories -it creates and handle removing those files and directories on exit, you must call `track()`. -It's recommended that you do this immediately after requiring the module. - -```javascript -var temp = require("temp"); -temp.track(); -``` - -Why is this necessary? In pre-0.6 versions of temp, tracking was automatic. While this works -great for scripts and [Grunt tasks](http://gruntjs.com/), it's not so great for long-running -server processes. Since that's arguably what Node.js is _for_, you have to opt-in to tracking. - -But it's easy. - -#### Cleanup anytime - -When tracking, you can `cleanup()` anytime. An object will be returned with cleanup statistics -and the file/directory lists will be reset. - -```javascript -> temp.cleanup(); -{ files: { removed: 1, missing: 0 }, - dirs: { removed: 0, missing: 0 } } -``` - -Note: If you're not tracking, `false` will be returned. - -### Temporary Directories - -To create a temporary directory, use `mkdir` or `mkdirSync`, passing -it an optional prefix, suffix, or both (see below for details on affixes). - -In this example we create a temporary directory, write to a file -within it, call out to an external program to create a PDF, and read -the result. While the external process creates a lot of additional -files, the temporary directory is removed automatically at exit (because -`temp.track()` is called): - -```javascript -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - path = require('path'), - exec = require('child_process').exec; - -// Automatically track and cleanup files at exit -temp.track(); - -// For use with ConTeXt, http://wiki.contextgarden.net -var myData = "\\starttext\nHello World\n\\stoptext"; - -temp.mkdir('pdfcreator', function(err, dirPath) { - var inputPath = path.join(dirPath, 'input.tex') - fs.writeFile(inputPath, myData, function(err) { - if (err) throw err; - process.chdir(dirPath); - exec("texexec '" + inputPath + "'", function(err) { - if (err) throw err; - fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) { - if (err) throw err; - sys.print(data); - }); - }); - }); -}); -``` - -### Temporary Streams - -To create a temporary WriteStream, use 'createWriteStream', which sits -on top of `fs.createWriteStream`. The return value is a -`fs.WriteStream` whose `path` is registered for removal when -`temp.cleanup` is called (because `temp.track()` is called). - -```javascript -var temp = require('temp'); - -// Automatically track and cleanup files at exit -temp.track(); - -var stream = temp.createWriteStream(); -stream.write("Some data"); -// Maybe do some other things -stream.end(); -``` - -### Affixes - -You can provide custom prefixes and suffixes when creating temporary -files and directories. If you provide a string, it is used as the prefix -for the temporary name. If you provide an object with `prefix`, -`suffix` and `dir` keys, they are used for the temporary name. - -Here are some examples: - -* `"aprefix"`: A simple prefix, prepended to the filename; this is - shorthand for: -* `{prefix: "aprefix"}`: A simple prefix, prepended to the filename -* `{suffix: ".asuffix"}`: A suffix, appended to the filename - (especially useful when the file needs to be named with specific - extension for use with an external program). -* `{prefix: "myprefix", suffix: "mysuffix"}`: Customize both affixes -* `{dir: path.join(os.tmpDir()), "myapp"}`: default prefix and suffix - within a new temporary directory. -* `null`: Use the defaults for files and directories (prefixes `"f-"` - and `"d-"`, respectively, no suffixes). - -In this simple example we read a `pdf`, write it to a temporary file with -a `.pdf` extension, and close it. - -```javascript -var fs = require('fs'), - temp = require('temp'); - -fs.readFile('/path/to/source.pdf', function(err, data) { - temp.open({suffix: '.pdf'}, function(err, info) { - if (err) throw err; - fs.write(info.fd, contents); - fs.close(info.fd, function(err) { - if (err) throw err; - // Do something with the file - }); - }); -}); -``` - -### Just a path, please - -If you just want a unique name in your temporary directory, use -`path`: - -```javascript -var fs = require('fs'); -var tempName = temp.path({suffix: '.pdf'}); -// Do something with tempName -``` - -Note: The file isn't created for you, and the mode is not changed -- and it -will not be removed automatically at exit. If you use `path`, it's -all up to you. - -Using it with Grunt -------------------- - -If you want to use the module with [Grunt](http://gruntjs.com/), make sure you -use `async()` in your Gruntfile: - -```javascript -module.exports = function (grunt) { - var temp = require("temp"); - temp.track(); // Cleanup files, please - grunt.registerTast("temptest", "Testing temp", function() { - - var done = this.async(); // Don't forget this! - - grunt.log.writeln("About to write a file..."); - temp.open('tempfile', function(err, info) { - // File writing shenanigans here - grunt.log.writeln("Wrote a file!") - - done(); // REALLY don't forget this! - - }); - }); -}; -``` - -For more information, see the [Grunt FAQ](http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete). - -Testing -------- - -For now, run `test/temp-test.js`: - - $ node test/temp-test.js - -Contributing ------------- - -You can find the repository at: -http://github.com/bruce/node-temp - -Issues/Feature Requests can be submitted at: -http://github.com/bruce/node-temp/issues - -I'd really like to hear your feedback, and I'd love to receive your -pull-requests! - -Copyright ---------- - -Copyright (c) 2010-2012 Bruce Williams. See LICENSE for details. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js deleted file mode 100644 index 420d864..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/grepcount.js +++ /dev/null @@ -1,18 +0,0 @@ -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - exec = require('child_process').exec; - -var myData = "foo\nbar\nfoo\nbaz"; - -temp.open('myprefix', function(err, info) { - if (err) throw err; - fs.write(info.fd, myData); - fs.close(info.fd, function(err) { - if (err) throw err; - exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) { - if (err) throw err; - util.puts(stdout.trim()); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js deleted file mode 100644 index 63fd277..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/examples/pdfcreator.js +++ /dev/null @@ -1,22 +0,0 @@ -var temp = require('../lib/temp'), - fs = require('fs'), - util = require('util'), - path = require('path'), - exec = require('child_process').exec; - -var myData = "\\starttext\nHello World\n\\stoptext"; - -temp.mkdir('pdfcreator', function(err, dirPath) { - var inputPath = path.join(dirPath, 'input.tex') - fs.writeFile(inputPath, myData, function(err) { - if (err) throw err; - process.chdir(dirPath); - exec("texexec '" + inputPath + "'", function(err) { - if (err) throw err; - fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) { - if (err) throw err; - util.print(data); - }); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js deleted file mode 100644 index 41edf98..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/lib/temp.js +++ /dev/null @@ -1,182 +0,0 @@ -var fs = require('fs'), - os = require('osenv'), - path = require('path'), - cnst = require('constants'); - -/* HELPERS */ - -var RDWR_EXCL = cnst.O_CREAT | cnst.O_TRUNC | cnst.O_RDWR | cnst.O_EXCL; - -var environmentVariables = ['TMPDIR', 'TMP', 'TEMP']; - -var generateName = function(rawAffixes, defaultPrefix) { - var affixes = parseAffixes(rawAffixes, defaultPrefix); - var now = new Date(); - var name = [affixes.prefix, - now.getYear(), now.getMonth(), now.getDate(), - '-', - process.pid, - '-', - (Math.random() * 0x100000000 + 1).toString(36), - affixes.suffix].join(''); - return path.join(affixes.dir || exports.dir, name); -} - -var parseAffixes = function(rawAffixes, defaultPrefix) { - var affixes = {prefix: null, suffix: null}; - if(rawAffixes) { - switch (typeof(rawAffixes)) { - case 'string': - affixes.prefix = rawAffixes; - break; - case 'object': - affixes = rawAffixes; - break - default: - throw("Unknown affix declaration: " + affixes); - } - } else { - affixes.prefix = defaultPrefix; - } - return affixes; -} - -/* ------------------------------------------------------------------------- - * Don't forget to call track() if you want file tracking and exit handlers! - * ------------------------------------------------------------------------- - * When any temp file or directory is created, it is added to filesToDelete - * or dirsToDelete. The first time any temp file is created, a listener is - * added to remove all temp files and directories at exit. - */ -var tracking = false; -var track = function(value) { - tracking = (value != false) -}; -var exitListenerAttached = false; -var filesToDelete = []; -var dirsToDelete = []; - -var deleteFileOnExit = function(filePath) { - if (!tracking) return false; - attachExitListener(); - filesToDelete.push(filePath); -}; - -var deleteDirOnExit = function(dirPath) { - if (!tracking) return false; - attachExitListener(); - dirsToDelete.push(dirPath); -}; - -var attachExitListener = function() { - if (!tracking) return false; - if (!exitListenerAttached) { - process.addListener('exit', cleanup); - exitListenerAttached = true; - } -}; - -var cleanupFiles = function() { - if (!tracking) return false; - var counts = {removed: 0, missing: 0} - var toDelete; - while (toDelete = filesToDelete.shift()) { - try { - fs.unlinkSync(toDelete); - counts.removed++; - } catch (rmErr) { - /* removed normally */ - counts.missing++; - } - } - return counts; -}; - -var cleanupDirs = function() { - if (!tracking) return false; - var rimrafSync = require('rimraf').sync; - var counts = {removed: 0, missing: 0} - var toDelete; - while (toDelete = dirsToDelete.shift()) { - try { - rimrafSync(toDelete, function (er) { - if (er) { - throw er; - } else { - counts.removed++; - } - }); - } catch (rmErr) { - /* removed normally */ - counts.missing++; - } - } - return counts; -}; - -var cleanup = function() { - if (!tracking) return false; - fileCount = cleanupFiles(); - dirCount = cleanupDirs(); - return {files: fileCount, dirs: dirCount}; -} - -/* DIRECTORIES */ - -var mkdir = function(affixes, callback) { - var dirPath = generateName(affixes, 'd-'); - fs.mkdir(dirPath, 0700, function(err) { - if (!err) { - deleteDirOnExit(dirPath); - } - if (callback) - callback(err, dirPath); - }); -} -var mkdirSync = function(affixes) { - var dirPath = generateName(affixes, 'd-'); - fs.mkdirSync(dirPath, 0700); - deleteDirOnExit(dirPath); - return dirPath; -} - -/* FILES */ - -var open = function(affixes, callback) { - var filePath = generateName(affixes, 'f-') - fs.open(filePath, RDWR_EXCL, 0600, function(err, fd) { - if (!err) - deleteFileOnExit(filePath); - if (callback) - callback(err, {path: filePath, fd: fd}); - }); -} - -var openSync = function(affixes) { - var filePath = generateName(affixes, 'f-') - var fd = fs.openSync(filePath, RDWR_EXCL, 0600); - deleteFileOnExit(filePath); - return {path: filePath, fd: fd}; -} - -var createWriteStream = function(affixes) { - var filePath = generateName(affixes, 's-') - var stream = fs.createWriteStream(filePath, {flags: RDWR_EXCL, mode: 0600}); - deleteFileOnExit(filePath); - return stream; -} - -/* EXPORTS */ -// Settings -exports.dir = path.resolve(os.tmpdir()); -exports.track = track; -// Functions -exports.mkdir = mkdir; -exports.mkdirSync = mkdirSync; -exports.open = open; -exports.openSync = openSync; -exports.path = generateName; -exports.cleanup = cleanup; -exports.createWriteStream = createWriteStream; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md deleted file mode 100644 index 08fd900..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# osenv - -Look up environment settings specific to different operating systems. - -## Usage - -```javascript -var osenv = require('osenv') -var path = osenv.path() -var user = osenv.user() -// etc. - -// Some things are not reliably in the env, and have a fallback command: -var h = osenv.hostname(function (er, hostname) { - h = hostname -}) -// This will still cause it to be memoized, so calling osenv.hostname() -// is now an immediate operation. - -// You can always send a cb, which will get called in the nextTick -// if it's been memoized, or wait for the fallback data if it wasn't -// found in the environment. -osenv.hostname(function (er, hostname) { - if (er) console.error('error looking up hostname') - else console.log('this machine calls itself %s', hostname) -}) -``` - -## osenv.hostname() - -The machine name. Calls `hostname` if not found. - -## osenv.user() - -The currently logged-in user. Calls `whoami` if not found. - -## osenv.prompt() - -Either PS1 on unix, or PROMPT on Windows. - -## osenv.tmpdir() - -The place where temporary files should be created. - -## osenv.home() - -No place like it. - -## osenv.path() - -An array of the places that the operating system will search for -executables. - -## osenv.editor() - -Return the executable name of the editor program. This uses the EDITOR -and VISUAL environment variables, and falls back to `vi` on Unix, or -`notepad.exe` on Windows. - -## osenv.shell() - -The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash' -or 'cmd'. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js deleted file mode 100644 index e3367a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/osenv.js +++ /dev/null @@ -1,80 +0,0 @@ -var isWindows = process.platform === 'win32' -var windir = isWindows ? process.env.windir || 'C:\\Windows' : null -var path = require('path') -var exec = require('child_process').exec - -// looking up envs is a bit costly. -// Also, sometimes we want to have a fallback -// Pass in a callback to wait for the fallback on failures -// After the first lookup, always returns the same thing. -function memo (key, lookup, fallback) { - var fell = false - var falling = false - exports[key] = function (cb) { - var val = lookup() - if (!val && !fell && !falling && fallback) { - fell = true - falling = true - exec(fallback, function (er, output, stderr) { - falling = false - if (er) return // oh well, we tried - val = output.trim() - }) - } - exports[key] = function (cb) { - if (cb) process.nextTick(cb.bind(null, null, val)) - return val - } - if (cb && !falling) process.nextTick(cb.bind(null, null, val)) - return val - } -} - -memo('user', function () { - return ( isWindows - ? process.env.USERDOMAIN + '\\' + process.env.USERNAME - : process.env.USER - ) -}, 'whoami') - -memo('prompt', function () { - return isWindows ? process.env.PROMPT : process.env.PS1 -}) - -memo('hostname', function () { - return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME -}, 'hostname') - -memo('tmpdir', function () { - var t = isWindows ? 'temp' : 'tmp' - return process.env.TMPDIR || - process.env.TMP || - process.env.TEMP || - ( exports.home() ? path.resolve(exports.home(), t) - : isWindows ? path.resolve(windir, t) - : '/tmp' - ) -}) - -memo('home', function () { - return ( isWindows ? process.env.USERPROFILE - : process.env.HOME - ) -}) - -memo('path', function () { - return (process.env.PATH || - process.env.Path || - process.env.path).split(isWindows ? ';' : ':') -}) - -memo('editor', function () { - return process.env.EDITOR || - process.env.VISUAL || - (isWindows ? 'notepad.exe' : 'vi') -}) - -memo('shell', function () { - return isWindows ? process.env.ComSpec || 'cmd' - : process.env.SHELL || 'bash' -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json deleted file mode 100644 index 721c45f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "osenv", - "version": "0.0.3", - "main": "osenv.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.2.5" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/osenv" - }, - "keywords": [ - "environment", - "variable", - "home", - "tmpdir", - "path", - "prompt", - "ps1" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "description": "Look up environment settings specific to different operating systems", - "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/osenv/issues" - }, - "_id": "osenv@0.0.3", - "_from": "osenv@0.0.3" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js deleted file mode 100644 index b72eb0b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/unix.js +++ /dev/null @@ -1,76 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform === 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip unix tests, this is not unix\n') - return -} -var tap = require('tap') - -// like unix, but funny -process.env.USER = 'sirUser' -process.env.HOME = '/home/sirUser' -process.env.HOSTNAME = 'my-machine' -process.env.TMPDIR = '/tmpdir' -process.env.TMP = '/tmp' -process.env.TEMP = '/temp' -process.env.PATH = '/opt/local/bin:/usr/local/bin:/usr/bin/:bin' -process.env.PS1 = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.SHELL = 'zsh' - - -tap.test('basic unix sanity test', function (t) { - var osenv = require('../osenv.js') - - t.equal(osenv.user(), process.env.USER) - t.equal(osenv.home(), process.env.HOME) - t.equal(osenv.hostname(), process.env.HOSTNAME) - t.same(osenv.path(), process.env.PATH.split(':')) - t.equal(osenv.prompt(), process.env.PS1) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), '/home/sirUser/tmp') - - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), '/tmp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'vi') - - t.equal(osenv.shell(), 'zsh') - process.env.SHELL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'bash') - - t.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js deleted file mode 100644 index dd3fe80..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/osenv/test/windows.js +++ /dev/null @@ -1,82 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform !== 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip windows tests, this is not windows\n') - return -} - -// load this before clubbing the platform name. -var tap = require('tap') - -process.env.windir = 'C:\\windows' -process.env.USERDOMAIN = 'some-domain' -process.env.USERNAME = 'sirUser' -process.env.USERPROFILE = 'C:\\Users\\sirUser' -process.env.COMPUTERNAME = 'my-machine' -process.env.TMPDIR = 'C:\\tmpdir' -process.env.TMP = 'C:\\tmp' -process.env.TEMP = 'C:\\temp' -process.env.Path = 'C:\\Program Files\\;C:\\Binary Stuff\\bin' -process.env.PROMPT = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.ComSpec = 'some-com' - -tap.test('basic windows sanity test', function (t) { - var osenv = require('../osenv.js') - - var osenv = require('../osenv.js') - - t.equal(osenv.user(), - process.env.USERDOMAIN + '\\' + process.env.USERNAME) - t.equal(osenv.home(), process.env.USERPROFILE) - t.equal(osenv.hostname(), process.env.COMPUTERNAME) - t.same(osenv.path(), process.env.Path.split(';')) - t.equal(osenv.prompt(), process.env.PROMPT) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), 'C:\\Users\\sirUser\\temp') - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), 'C:\\windows\\temp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'notepad.exe') - - t.equal(osenv.shell(), 'some-com') - process.env.ComSpec = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'cmd') - - t.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index ca91152..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,442 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index bfc503c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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" - }, - "_id": "graceful-fs@1.2.3", - "_from": "graceful-fs@~1" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d532..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js deleted file mode 100644 index 8d0882d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/node_modules/graceful-fs/test/ulimit.js +++ /dev/null @@ -1,158 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json deleted file mode 100644 index f5072d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "rimraf", - "version": "2.1.4", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~1" - }, - "_id": "rimraf@2.1.4", - "_from": "rimraf@~2.1.4" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js deleted file mode 100644 index ed915f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,132 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -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 (er.code === "EBUSY" && 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 && er.code === "ENOENT") - return cb() - if (er && (er.code === "EPERM" || er.code === "EISDIR")) - return rmdir(p, er, cb) - return cb(er) - }) -} - -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")) - 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" && er.code !== "EISDIR") - throw er - try { - fs.rmdirSync(p) - } catch (er2) { - if (er2.code === "ENOENT") - return - if (er2.code === "ENOTDIR") - throw er - if (er2.code === "ENOTEMPTY") { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) - } - } - } -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json deleted file mode 100644 index 7c98f7e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "temp", - "description": "Temporary files and directories", - "tags": [ - "temporary", - "temp", - "tempfile", - "tempdir", - "tmpfile", - "tmpdir", - "security" - ], - "version": "0.6.0", - "author": { - "name": "Bruce Williams", - "email": "bruce@codefluency.com" - }, - "directories": { - "lib": "lib" - }, - "engines": [ - "node >=0.6.0" - ], - "main": "./lib/temp", - "dependencies": { - "rimraf": "~2.1.4", - "osenv": "0.0.3" - }, - "devDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/bruce/node-temp.git" - }, - "scripts": { - "test": "node test/temp-test.js" - }, - "readme": "node-temp\n=========\n\nTemporary files, directories, and streams for Node.js.\n\nHandles generating a unique file/directory name under the appropriate\nsystem temporary directory, changing the file to an appropriate mode,\nand supports automatic removal (if asked)\n\n`temp` has a similar API to the `fs` module.\n\nNode.js Compatibility\n---------------------\n\nSupports v0.6.0+.\n\n[![Build Status](https://travis-ci.org/bruce/node-temp.png)](https://travis-ci.org/bruce/node-temp)\n\nPlease let me know if you have problems running it on a later version of Node.js or\nhave platform-specific problems.\n\nInstallation\n------------\n\nInstall it using [npm](http://github.com/isaacs/npm):\n\n $ npm install temp\n\nOr get it directly from:\nhttp://github.com/bruce/node-temp\n\nSynopsis\n--------\n\nYou can create temporary files with `open` and `openSync`, temporary\ndirectories with `mkdir` and `mkdirSync`, or you can get a unique name\nin the system temporary directory with `path`.\n\nWorking copies of the following examples can be found under the\n`examples` directory.\n\n### Temporary Files\n\nTo create a temporary file use `open` or `openSync`, passing\nthem an optional prefix, suffix, or both (see below for details on\naffixes). The object passed to the callback (or returned) has\n`path` and `fd` keys:\n\n```javascript\n{ path: \"/path/to/file\",\n, fd: theFileDescriptor\n}\n```\n\nIn this example we write to a temporary file and call out to `grep` and\n`wc -l` to determine the number of time `foo` occurs in the text. The\ntemporary file is chmod'd `0600` and cleaned up automatically when the\nprocess at exit (because `temp.track()` is called):\n\n```javascript\nvar temp = require('temp'),\n fs = require('fs'),\n util = require('util'),\n exec = require('child_process').exec;\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\n// Fake data\nvar myData = \"foo\\nbar\\nfoo\\nbaz\";\n\n// Process the data (note: error handling omitted)\ntemp.open('myprefix', function(err, info) {\n fs.write(info.fd, myData);\n fs.close(info.fd, function(err) {\n exec(\"grep foo '\" + info.path + \"' | wc -l\", function(err, stdout) {\n util.puts(stdout.trim());\n });\n });\n});\n```\n\n### Want Cleanup? Make sure you ask for it.\n\nAs noted in the example above, if you want temp to track the files and directories\nit creates and handle removing those files and directories on exit, you must call `track()`.\nIt's recommended that you do this immediately after requiring the module.\n\n```javascript\nvar temp = require(\"temp\");\ntemp.track();\n```\n\nWhy is this necessary? In pre-0.6 versions of temp, tracking was automatic. While this works\ngreat for scripts and [Grunt tasks](http://gruntjs.com/), it's not so great for long-running\nserver processes. Since that's arguably what Node.js is _for_, you have to opt-in to tracking.\n\nBut it's easy.\n\n#### Cleanup anytime\n\nWhen tracking, you can `cleanup()` anytime. An object will be returned with cleanup statistics\nand the file/directory lists will be reset.\n\n```javascript\n> temp.cleanup();\n{ files: { removed: 1, missing: 0 },\n dirs: { removed: 0, missing: 0 } }\n```\n\nNote: If you're not tracking, `false` will be returned.\n\n### Temporary Directories\n\nTo create a temporary directory, use `mkdir` or `mkdirSync`, passing\nit an optional prefix, suffix, or both (see below for details on affixes).\n\nIn this example we create a temporary directory, write to a file\nwithin it, call out to an external program to create a PDF, and read\nthe result. While the external process creates a lot of additional\nfiles, the temporary directory is removed automatically at exit (because\n`temp.track()` is called):\n\n```javascript\nvar temp = require('../lib/temp'),\n fs = require('fs'),\n util = require('util'),\n path = require('path'),\n exec = require('child_process').exec;\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\n// For use with ConTeXt, http://wiki.contextgarden.net\nvar myData = \"\\\\starttext\\nHello World\\n\\\\stoptext\";\n\ntemp.mkdir('pdfcreator', function(err, dirPath) {\n var inputPath = path.join(dirPath, 'input.tex')\n fs.writeFile(inputPath, myData, function(err) {\n if (err) throw err;\n process.chdir(dirPath);\n exec(\"texexec '\" + inputPath + \"'\", function(err) {\n if (err) throw err;\n fs.readFile(path.join(dirPath, 'input.pdf'), function(err, data) {\n if (err) throw err;\n sys.print(data);\n });\n });\n });\n});\n```\n\n### Temporary Streams\n\nTo create a temporary WriteStream, use 'createWriteStream', which sits\non top of `fs.createWriteStream`. The return value is a\n`fs.WriteStream` whose `path` is registered for removal when\n`temp.cleanup` is called (because `temp.track()` is called).\n\n```javascript\nvar temp = require('temp');\n\n// Automatically track and cleanup files at exit\ntemp.track();\n\nvar stream = temp.createWriteStream();\nstream.write(\"Some data\");\n// Maybe do some other things\nstream.end();\n```\n\n### Affixes\n\nYou can provide custom prefixes and suffixes when creating temporary\nfiles and directories. If you provide a string, it is used as the prefix\nfor the temporary name. If you provide an object with `prefix`,\n`suffix` and `dir` keys, they are used for the temporary name.\n\nHere are some examples:\n\n* `\"aprefix\"`: A simple prefix, prepended to the filename; this is\n shorthand for:\n* `{prefix: \"aprefix\"}`: A simple prefix, prepended to the filename\n* `{suffix: \".asuffix\"}`: A suffix, appended to the filename\n (especially useful when the file needs to be named with specific\n extension for use with an external program).\n* `{prefix: \"myprefix\", suffix: \"mysuffix\"}`: Customize both affixes\n* `{dir: path.join(os.tmpDir()), \"myapp\"}`: default prefix and suffix\n within a new temporary directory.\n* `null`: Use the defaults for files and directories (prefixes `\"f-\"`\n and `\"d-\"`, respectively, no suffixes).\n\nIn this simple example we read a `pdf`, write it to a temporary file with\na `.pdf` extension, and close it.\n\n```javascript\nvar fs = require('fs'),\n temp = require('temp');\n\nfs.readFile('/path/to/source.pdf', function(err, data) {\n temp.open({suffix: '.pdf'}, function(err, info) {\n if (err) throw err;\n fs.write(info.fd, contents);\n fs.close(info.fd, function(err) {\n if (err) throw err;\n // Do something with the file\n });\n });\n});\n```\n\n### Just a path, please\n\nIf you just want a unique name in your temporary directory, use\n`path`:\n\n```javascript\nvar fs = require('fs');\nvar tempName = temp.path({suffix: '.pdf'});\n// Do something with tempName\n```\n\nNote: The file isn't created for you, and the mode is not changed -- and it\nwill not be removed automatically at exit. If you use `path`, it's\nall up to you.\n\nUsing it with Grunt\n-------------------\n\nIf you want to use the module with [Grunt](http://gruntjs.com/), make sure you\nuse `async()` in your Gruntfile:\n\n```javascript\nmodule.exports = function (grunt) {\n var temp = require(\"temp\");\n temp.track(); // Cleanup files, please\n grunt.registerTast(\"temptest\", \"Testing temp\", function() {\n\n var done = this.async(); // Don't forget this!\n\n grunt.log.writeln(\"About to write a file...\");\n temp.open('tempfile', function(err, info) {\n // File writing shenanigans here\n grunt.log.writeln(\"Wrote a file!\")\n\n done(); // REALLY don't forget this!\n\n });\n });\n};\n```\n\nFor more information, see the [Grunt FAQ](http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete).\n\nTesting\n-------\n\nFor now, run `test/temp-test.js`:\n\n $ node test/temp-test.js\n\nContributing\n------------\n\nYou can find the repository at:\nhttp://github.com/bruce/node-temp\n\nIssues/Feature Requests can be submitted at:\nhttp://github.com/bruce/node-temp/issues\n\nI'd really like to hear your feedback, and I'd love to receive your\npull-requests!\n\nCopyright\n---------\n\nCopyright (c) 2010-2012 Bruce Williams. See LICENSE for details.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/bruce/node-temp/issues" - }, - "_id": "temp@0.6.0", - "dist": { - "shasum": "29d2d63697c79fb5108af11e1cba8edf097877bd" - }, - "_from": "temp@~0.6.0", - "_resolved": "https://registry.npmjs.org/temp/-/temp-0.6.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js deleted file mode 100644 index 34071fa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/temp/test/temp-test.js +++ /dev/null @@ -1,77 +0,0 @@ -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); -var util = require('util'); - -var temp = require('../lib/temp'); -temp.track(); - -var existsSync = function(path){ - try { - fs.statSync(path); - return true; - } catch (e){ - return false; - } -}; - -// Use path.exists for 0.6 if necessary -var safeExists = fs.exists || path.exists; - -var mkdirFired = false; -var mkdirPath = null; -temp.mkdir('foo', function(err, tpath) { - mkdirFired = true; - assert.ok(!err, "temp.mkdir did not execute without errors"); - assert.ok(path.basename(tpath).slice(0, 3) == 'foo', 'temp.mkdir did not use the prefix'); - assert.ok(existsSync(tpath), 'temp.mkdir did not create the directory'); - - fs.writeFileSync(path.join(tpath, 'a file'), 'a content'); - temp.cleanup(); - assert.ok(!existsSync(tpath), 'temp.cleanup did not remove the directory'); - - mkdirPath = tpath; -}); - -var openFired = false; -var openPath = null; -temp.open('bar', function(err, info) { - openFired = true; - assert.equal('object', typeof(info), "temp.open did not invoke the callback with the err and info object"); - assert.equal('number', typeof(info.fd), 'temp.open did not invoke the callback with an fd'); - fs.writeSync(info.fd, 'foo'); - fs.closeSync(info.fd); - assert.equal('string', typeof(info.path), 'temp.open did not invoke the callback with a path'); - assert.ok(existsSync(info.path), 'temp.open did not create a file'); - - temp.cleanup(); - assert.ok(!existsSync(info.path), 'temp.cleanup did not remove the file'); - - openPath = info.path; -}); - - -var stream = temp.createWriteStream('baz'); -assert.ok(stream instanceof fs.WriteStream, "temp.createWriteStream did not invoke the callback with the err and stream object"); -stream.write('foo'); -stream.end("More text here\nand more..."); -assert.ok(existsSync(stream.path), 'temp.createWriteStream did not create a file'); - -console.log(temp.cleanup()); -assert.ok(!existsSync(stream.path), 'temp.cleanup did not remove the createWriteStream file'); - -var tempPath = temp.path(); -assert.ok(path.dirname(tempPath) === temp.dir, "temp.path does not work in default os temporary directory"); - -tempPath = temp.path({dir: process.cwd()}); -assert.ok(path.dirname(tempPath) === process.cwd(), "temp.path does not work in user-provided temporary directory"); - -for (var i=0; i <= 10; i++) { - temp.openSync(); -}; -assert.equal(process.listeners('exit').length, 1, 'temp created more than one listener for exit'); - -process.addListener('exit', function() { - assert.ok(mkdirFired, "temp.mkdir callback did not fire"); - assert.ok(openFired, "temp.open callback did not fire"); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json deleted file mode 100644 index 111c20f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "decompress", - "version": "0.1.4", - "description": "Easily extract zip, tar and tar.gz archives", - "keywords": [ - "extract", - "zip", - "tar", - "tar.gz" - ], - "homepage": "https://github.com/kevva/decompress", - "bugs": { - "url": "https://github.com/kevva/decompress/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/decompress.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "decompress.js", - "files": [ - "decompress.js" - ], - "dependencies": { - "adm-zip": "~0.4.3", - "mkdirp": "~0.3.5", - "mout": "~0.6.0", - "rimraf": "~2.2.2", - "stream-combiner": "~0.0.2", - "tar": "~0.1.18", - "temp": "~0.6.0" - }, - "devDependencies": { - "mocha": "~1.12.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# decompress [![Build Status](https://secure.travis-ci.org/kevva/decompress.png?branch=master)](http://travis-ci.org/kevva/decompress)\n\nEasily extract `.zip`, `.tar` and `.tar.gz` archives. Based on the extract \nutility in [Bower](https://github.com/bower/bower).\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/decompress): `npm install decompress`\n\n## Examples\n\nYou'll only need to pass a type into `ext` and it'll figure the rest out for \nyou.\n\n```js\nvar decompress = require('decompress');\nvar fs = require('fs');\n\nvar src = fs.createReadStream('foo.tar.gz');\nvar dest = decompress.extract({ ext: '.tar.gz' });\n\nsrc.pipe(dest);\n```\n\n## API\n\n### .extract(opts)\n\nExtract an archive using the `ext` option to determine which extractor to use. \nIf no `path` is specified it'll extract it to your current location.\n\n### .canExtract(src, mime)\n\nDetermine if a file can be extracted or not by checking the file extension \nand/or the MIME type.\n\n```js\ndecompress.canExtract('foo.zip');\n// => true\n\ndecompress.canExtract('application/zip');\n// => true\n```\n\n## Options\n\n* `ext` — String that can be a file name, URL, MIME type etc.\n* `path` — Path to extract the archive to. If no `path` is defined it'll \nextract it to your current location.\n* `strip` — Equivalent to `--strip-components` for tar.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "decompress@0.1.4", - "dist": { - "shasum": "b5608768911f794017bfb8017344be6a7cfaf919" - }, - "_from": "decompress@~0.1.0", - "_resolved": "https://registry.npmjs.org/decompress/-/decompress-0.1.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 84fd7ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json deleted file mode 100644 index 169f15a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.5", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.4.0" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "_id": "mkdirp@0.3.5", - "_from": "mkdirp@~0.3.5" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 83b0216..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 35bd5cb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md deleted file mode 100644 index 1d2f79b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/README.md +++ /dev/null @@ -1,344 +0,0 @@ -# Request -- Simplified HTTP request method - -## Install - -
        -  npm install request
        -
        - -Or from source: - -
        -  git clone git://github.com/mikeal/request.git 
        -  cd request
        -  npm link
        -
        - -## Super simple to use - -Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. - -```javascript -var request = require('request'); -request('http://www.google.com', function (error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body) // Print the google web page. - } -}) -``` - -## Streaming - -You can stream any response to a file stream. - -```javascript -request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png')) -``` - -You 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. - -```javascript -fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json')) -``` - -Request can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers. - -```javascript -request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) -``` - -Now let's get fancy. - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - if (req.method === 'PUT') { - req.pipe(request.put('http://mysite.com/doodle.png')) - } else if (req.method === 'GET' || req.method === 'HEAD') { - request.get('http://mysite.com/doodle.png').pipe(resp) - } - } -}) -``` - -You 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: - -```javascript -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - var x = request('http://mysite.com/doodle.png') - req.pipe(x) - x.pipe(resp) - } -}) -``` - -And since pipe() returns the destination stream in node 0.5.x you can do one line proxying :) - -```javascript -req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) -``` - -Also, none of this new functionality conflicts with requests previous features, it just expands them. - -```javascript -var r = request.defaults({'proxy':'http://localproxy.com'}) - -http.createServer(function (req, resp) { - if (req.url === '/doodle.png') { - r.get('http://google.com/doodle.png').pipe(resp) - } -}) -``` -You can still use intermediate proxies, the requests will still follow HTTP forwards, etc. - -## Forms - -`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API. - -Url encoded forms are simple - -```javascript -request.post('http://service.com/upload', {form:{key:'value'}}) -// or -request.post('http://service.com/upload').form({key:'value'}) -``` - -For `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. - -```javascript -var r = request.post('http://service.com/upload') -var form = r.form() -form.append('my_field', 'my_value') -form.append('my_buffer', new Buffer([1, 2, 3])) -form.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png')) -form.append('remote_file', request('http://google.com/doodle.png')) -``` - -## HTTP Authentication - -```javascript -request.get('http://some.server.com/').auth('username', 'password', false); -// or -request.get('http://some.server.com/', { - 'auth': { - 'user': 'username', - 'pass': 'password', - 'sendImmediately': false - } -}); -``` - -If 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)`. - -`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). - -Digest 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). - -## OAuth Signing - -```javascript -// Twitter OAuth -var qs = require('querystring') - , oauth = - { callback: 'http://mysite.com/callback/' - , consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - } - , url = 'https://api.twitter.com/oauth/request_token' - ; -request.post({url:url, oauth:oauth}, function (e, r, body) { - // Ideally, you would take the body in the response - // and construct a URL that a user clicks on (like a sign in button). - // The verifier is only available in the response after a user has - // verified with twitter that they are authorizing your app. - var access_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: access_token.oauth_token - , verifier: access_token.oauth_verifier - } - , url = 'https://api.twitter.com/oauth/access_token' - ; - request.post({url:url, oauth:oauth}, function (e, r, body) { - var perm_token = qs.parse(body) - , oauth = - { consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: perm_token.oauth_token - , token_secret: perm_token.oauth_token_secret - } - , url = 'https://api.twitter.com/1/users/show.json?' - , params = - { screen_name: perm_token.screen_name - , user_id: perm_token.user_id - } - ; - url += qs.stringify(params) - request.get({url:url, oauth:oauth, json:true}, function (e, r, user) { - console.log(user) - }) - }) -}) -``` - - - -### request(options, callback) - -The first argument can be either a url or an options object. The only required option is uri, all others are optional. - -* `uri` || `url` - fully qualified uri or a parsed url object from url.parse() -* `qs` - object containing querystring values to be appended to the uri -* `method` - http method, defaults to GET -* `headers` - http headers, defaults to {} -* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string. -* `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. -* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional). See documentation above. -* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as json. -* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below. -* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true. -* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false. -* `maxRedirects` - the maximum number of redirects to follow, defaults to 10. -* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer. -* `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. -* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool. -* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request -* `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. -* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above. -* `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). -* `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. -* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section) -* `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) -* `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. -* `localAddress` - Local interface to bind for network connections. - - -The 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. - -## Convenience methods - -There are also shorthand methods for different HTTP METHODs and some other conveniences. - -### request.defaults(options) - -This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it. - -### request.put - -Same as request() but defaults to `method: "PUT"`. - -```javascript -request.put(url) -``` - -### request.patch - -Same as request() but defaults to `method: "PATCH"`. - -```javascript -request.patch(url) -``` - -### request.post - -Same as request() but defaults to `method: "POST"`. - -```javascript -request.post(url) -``` - -### request.head - -Same as request() but defaults to `method: "HEAD"`. - -```javascript -request.head(url) -``` - -### request.del - -Same as request() but defaults to `method: "DELETE"`. - -```javascript -request.del(url) -``` - -### request.get - -Alias to normal request method for uniformity. - -```javascript -request.get(url) -``` -### request.cookie - -Function that creates a new cookie. - -```javascript -request.cookie('cookie_string_here') -``` -### request.jar - -Function that creates a new cookie jar. - -```javascript -request.jar() -``` - - -## Examples: - -```javascript - var request = require('request') - , rand = Math.floor(Math.random()*100000000).toString() - ; - request( - { method: 'PUT' - , uri: 'http://mikeal.iriscouch.com/testjs/' + rand - , multipart: - [ { 'content-type': 'application/json' - , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) - } - , { body: 'I am an attachment' } - ] - } - , function (error, response, body) { - if(response.statusCode == 201){ - console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand) - } else { - console.log('error: '+ response.statusCode) - console.log(body) - } - } - ) -``` -Cookies 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). - -```javascript -var request = request.defaults({jar: true}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` - -If 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: - -```javascript -var j = request.jar() -var request = request.defaults({jar:j}) -request('http://www.google.com', function () { - request('http://images.google.com') -}) -``` -OR - -```javascript -var j = request.jar() -var cookie = request.cookie('your_cookie_here') -j.add(cookie) -request({url: 'http://www.google.com', jar: j}, function () { - request('http://images.google.com') -}) -``` diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js deleted file mode 100755 index d56f9ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/index.js +++ /dev/null @@ -1,1392 +0,0 @@ -// Copyright 2010-2012 Mikeal Rogers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -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 - ; - -try { - https = require('https') -} catch (e) {} - -try { - tls = require('tls') -} catch (e) {} - -var debug -if (/\brequest\b/.test(process.env.NODE_DEBUG)) { - debug = function() { - console.error('REQUEST %s', util.format.apply(util, arguments)) - } -} else { - debug = function() {} -} - -function toBase64 (str) { - return (new Buffer(str || "", "ascii")).toString("base64") -} - -function md5 (str) { - return crypto.createHash('md5').update(str).digest('hex') -} - -// 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 copy (obj) { - var o = {} - Object.keys(obj).forEach(function (i) { - o[i] = obj[i] - }) - return o -} - -var isUrl = /^https?:/ - -var globalPool = {} - -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.host || !self.uri.pathname) { - // 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.headers.host || self.headers.Host)) { - self.headers.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.headers.host += (':'+self.uri.port) - } - self.setHost = true - } - - self.jar(self._jar || options.jar) - - if (!self.uri.pathname) {self.uri.pathname = '/'} - 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.headers.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.headers['proxy-authorization'] && !self.tunnel) { - self.headers['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.headers['content-length'] && !self.headers['Content-Length']) - self.headers['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.headers['content-type'] && !self.headers['Content-Type']) - self.headers['content-type'] = mime.lookup(src.path) - } else { - if (src.headers) { - for (var i in src.headers) { - if (!self.headers[i]) { - self.headers[i] = src.headers[i] - } - } - } - if (self._json && !self.headers['content-type'] && !self.headers['Content-Type']) - self.headers['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.headers['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.headers['content-length'] && !self.headers['Content-Length']) { - self.headers['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) delete self.headers.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 (response.headers['set-cookie'] && (!self._disableCookies)) { - if (Array.isArray(response.headers['set-cookie'])) response.headers['set-cookie'].forEach(addCookie) - else addCookie(response.headers['set-cookie']) - } - - var redirectTo = null - if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) { - debug('redirect', response.headers.location) - - if (self.followAllRedirects) { - redirectTo = response.headers.location - } else if (self.followRedirect) { - switch (self.method) { - case 'PATCH': - case 'PUT': - case 'POST': - case 'DELETE': - // Do not follow redirects - break - default: - redirectTo = response.headers.location - break - } - } - } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) { - var authHeader = response.headers['www-authenticate'] - 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) { - delete self.headers.host - delete self.headers['content-type'] - delete self.headers['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.headers['content-type'] = response.headers['content-type'] - if (response.headers['content-length']) { - dest.headers['content-length'] = response.headers['content-length'] - } - } - 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.headers.hasOwnProperty(name)) this.headers[name] = value - else this.headers[name] += ',' + value - return this -} -Request.prototype.setHeaders = function (headers) { - for (var i in headers) {this.setHeader(i, headers[i])} - return this -} -Request.prototype.qs = function (q, clobber) { - var base - if (!clobber && this.uri.query) base = qs.parse(this.uri.query) - else base = {} - - for (var i in q) { - base[i] = q[i] - } - - if (qs.stringify(base) === ''){ - return this - } - - this.uri = url.parse(this.uri.href.split('?')[0] + '?' + qs.stringify(base)) - this.url = this.uri - this.path = this.uri.path - - return this -} -Request.prototype.form = function (form) { - if (form) { - this.headers['content-type'] = 'application/x-www-form-urlencoded; charset=utf-8' - this.body = qs.stringify(form).toString('utf8') - return this - } - // create form-data object - this._form = new FormData() - return this._form -} -Request.prototype.multipart = function (multipart) { - var self = this - self.body = [] - - if (!self.headers['content-type']) { - self.headers['content-type'] = 'multipart/related; boundary=' + self.boundary - } else { - self.headers['content-type'] = self.headers['content-type'].split(';')[0] + '; boundary=' + self.boundary - } - - if (!multipart.forEach) throw new Error('Argument error, options.multipart.') - - if (self.preambleCRLF) { - self.body.push(new Buffer('\r\n')) - } - - multipart.forEach(function (part) { - var body = part.body - if(body == null) throw Error('Body attribute missing in multipart.') - delete part.body - var preamble = '--' + self.boundary + '\r\n' - Object.keys(part).forEach(function (key) { - preamble += key + ': ' + part[key] + '\r\n' - }) - preamble += '\r\n' - self.body.push(new Buffer(preamble)) - self.body.push(new Buffer(body)) - self.body.push(new Buffer('\r\n')) - }) - self.body.push(new Buffer('--' + self.boundary + '--')) - return self -} -Request.prototype.json = function (val) { - var self = this; - var setAcceptHeader = function() { - if (!self.headers['accept'] && !self.headers['Accept']) { - self.setHeader('accept', 'application/json') - } - } - setAcceptHeader(); - this._json = true - if (typeof val === 'boolean') { - if (typeof this.body === 'object') { - setAcceptHeader(); - this.body = safeStringify(this.body) - self.setHeader('content-type', 'application/json') - } - } else { - setAcceptHeader(); - this.body = safeStringify(val) - self.setHeader('content-type', 'application/json') - } - return this -} -function getHeader(name, headers) { - var result, re, match - Object.keys(headers).forEach(function (key) { - re = new RegExp(name, 'i') - match = key.match(re) - if (match) result = headers[key] - }) - return result -} -Request.prototype.auth = function (user, pass, sendImmediately) { - if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { - throw new Error('auth() received invalid user or password') - } - this._user = user - this._pass = pass - this._hasAuth = true - if (sendImmediately || typeof sendImmediately == 'undefined') { - this.setHeader('authorization', 'Basic ' + toBase64(user + ':' + pass)) - this._sentAuth = true - } - return this -} -Request.prototype.aws = function (opts, now) { - if (!now) { - this._aws = opts - return this - } - var date = new Date() - this.setHeader('date', date.toUTCString()) - var auth = - { key: opts.key - , secret: opts.secret - , verb: this.method.toUpperCase() - , date: date - , contentType: getHeader('content-type', this.headers) || '' - , md5: getHeader('content-md5', this.headers) || '' - , amazonHeaders: aws.canonicalizeHeaders(this.headers) - } - if (opts.bucket && this.path) { - auth.resource = '/' + opts.bucket + this.path - } else if (opts.bucket && !this.path) { - auth.resource = '/' + opts.bucket - } else if (!opts.bucket && this.path) { - auth.resource = this.path - } else if (!opts.bucket && !this.path) { - auth.resource = '/' - } - auth.resource = aws.canonicalizeResource(auth.resource) - this.setHeader('authorization', aws.authorization(auth)) - - return this -} -Request.prototype.httpSignature = function (opts) { - var req = this - httpSignature.signRequest({ - getHeader: function(header) { - return getHeader(header, req.headers) - }, - setHeader: function(header, value) { - req.setHeader(header, value) - }, - method: this.method, - path: this.path - }, opts) - debug('httpSignature authorization', getHeader('authorization', this.headers)) - - return this -} - -Request.prototype.hawk = function (opts) { - this.headers.Authorization = hawk.client.header(this.uri, this.method, opts).field -} - -Request.prototype.oauth = function (_oauth) { - var form - if (this.headers['content-type'] && - this.headers['content-type'].slice(0, 'application/x-www-form-urlencoded'.length) === - 'application/x-www-form-urlencoded' - ) { - form = qs.parse(this.body) - } - if (this.uri.query) { - form = qs.parse(this.uri.query) - } - if (!form) form = {} - var oa = {} - for (var i in form) oa[i] = form[i] - for (var i in _oauth) oa['oauth_'+i] = _oauth[i] - if (!oa.oauth_version) oa.oauth_version = '1.0' - if (!oa.oauth_timestamp) oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString() - if (!oa.oauth_nonce) oa.oauth_nonce = uuid().replace(/-/g, '') - - oa.oauth_signature_method = 'HMAC-SHA1' - - var consumer_secret = oa.oauth_consumer_secret - delete oa.oauth_consumer_secret - var token_secret = oa.oauth_token_secret - delete oa.oauth_token_secret - var timestamp = oa.oauth_timestamp - - var baseurl = this.uri.protocol + '//' + this.uri.host + this.uri.pathname - var signature = oauth.hmacsign(this.method, baseurl, oa, consumer_secret, token_secret) - - // oa.oauth_signature = signature - for (var i in form) { - if ( i.slice(0, 'oauth_') in _oauth) { - // skip - } else { - delete oa['oauth_'+i] - if (i !== 'x_auth_mode') delete oa[i] - } - } - oa.oauth_timestamp = timestamp - this.headers.Authorization = - 'OAuth '+Object.keys(oa).sort().map(function (i) {return i+'="'+oauth.rfc3986(oa[i])+'"'}).join(',') - this.headers.Authorization += ',oauth_signature="' + oauth.rfc3986(signature) + '"' - return this -} -Request.prototype.jar = function (jar) { - var cookies - - if (this._redirectsFollowed === 0) { - this.originalCookieHeader = this.headers.cookie - } - - if (!jar) { - // disable cookies - cookies = false - this._disableCookies = true - } else if (jar && jar.get) { - // fetch cookie from the user defined cookie jar - cookies = jar.get({ url: this.uri.href }) - } else { - // fetch cookie from the global cookie jar - cookies = cookieJar.get({ url: this.uri.href }) - } - - if (cookies && cookies.length) { - var cookieString = cookies.map(function (c) { - return c.name + "=" + c.value - }).join("; ") - - if (this.originalCookieHeader) { - // Don't overwrite existing Cookie header - this.headers.cookie = this.originalCookieHeader + '; ' + cookieString - } else { - this.headers.cookie = cookieString - } - } - this._jar = jar - return this -} - - -// Stream API -Request.prototype.pipe = function (dest, opts) { - if (this.response) { - if (this._destdata) { - throw new Error("You cannot pipe after data has been emitted from the response.") - } else if (this._ended) { - throw new Error("You cannot pipe after the response has been ended.") - } else { - stream.Stream.prototype.pipe.call(this, dest, opts) - this.pipeDest(dest) - return dest - } - } else { - this.dests.push(dest) - stream.Stream.prototype.pipe.call(this, dest, opts) - return dest - } -} -Request.prototype.write = function () { - if (!this._started) this.start() - return this.req.write.apply(this.req, arguments) -} -Request.prototype.end = function (chunk) { - if (chunk) this.write(chunk) - if (!this._started) this.start() - this.req.end() -} -Request.prototype.pause = function () { - if (!this.response) this._paused = true - else this.response.pause.apply(this.response, arguments) -} -Request.prototype.resume = function () { - if (!this.response) this._paused = false - else this.response.resume.apply(this.response, arguments) -} -Request.prototype.destroy = function () { - if (!this._ended) this.end() - else if (this.response) this.response.destroy() -} - -// organize params for patch, post, put, head, del -function initParams(uri, options, callback) { - if ((typeof options === 'function') && !callback) callback = options - if (options && typeof options === 'object') { - options.uri = uri - } else if (typeof uri === 'string') { - options = {uri:uri} - } else { - options = uri - uri = options.uri - } - return { uri: uri, options: options, callback: callback } -} - -function request (uri, options, callback) { - if (typeof uri === 'undefined') throw new Error('undefined is not a valid uri or options object.') - if ((typeof options === 'function') && !callback) callback = options - if (options && typeof options === 'object') { - options.uri = uri - } else if (typeof uri === 'string') { - options = {uri:uri} - } else { - options = uri - } - - options = copy(options) - - if (callback) options.callback = callback - var r = new Request(options) - return r -} - -module.exports = request - -request.Request = Request; - -request.debug = process.env.NODE_DEBUG && /request/.test(process.env.NODE_DEBUG) - -request.initParams = initParams - -request.defaults = function (options, requester) { - var def = function (method) { - var d = function (uri, opts, callback) { - var params = initParams(uri, opts, callback) - for (var i in options) { - if (params.options[i] === undefined) params.options[i] = options[i] - } - if(typeof requester === 'function') { - if(method === request) { - method = requester - } else { - params.options._requester = requester - } - } - return method(params.options, params.callback) - } - return d - } - var de = def(request) - de.get = def(request.get) - de.patch = def(request.patch) - de.post = def(request.post) - de.put = def(request.put) - de.head = def(request.head) - de.del = def(request.del) - de.cookie = def(request.cookie) - de.jar = request.jar - return de -} - -request.forever = function (agentOptions, optionsArg) { - var options = {} - if (optionsArg) { - for (option in optionsArg) { - options[option] = optionsArg[option] - } - } - if (agentOptions) options.agentOptions = agentOptions - options.forever = true - return request.defaults(options) -} - -request.get = request -request.post = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'POST' - return request(params.uri || null, params.options, params.callback) -} -request.put = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'PUT' - return request(params.uri || null, params.options, params.callback) -} -request.patch = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'PATCH' - return request(params.uri || null, params.options, params.callback) -} -request.head = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'HEAD' - if (params.options.body || - params.options.requestBodyStream || - (params.options.json && typeof params.options.json !== 'boolean') || - params.options.multipart) { - throw new Error("HTTP HEAD requests MUST NOT include a request body.") - } - return request(params.uri || null, params.options, params.callback) -} -request.del = function (uri, options, callback) { - var params = initParams(uri, options, callback) - params.options.method = 'DELETE' - if(typeof params.options._requester === 'function') { - request = params.options._requester - } - return request(params.uri || null, params.options, params.callback) -} -request.jar = function () { - return new CookieJar -} -request.cookie = function (str) { - if (str && str.uri) str = str.uri - if (typeof str !== 'string') throw new Error("The cookie function only accepts STRING as param") - return new Cookie(str) -} - -// Safe toJSON - -function getSafe (self, uuid) { - if (typeof self === 'object' || typeof self === 'function') var safe = {} - if (Array.isArray(self)) var safe = [] - - var recurse = [] - - Object.defineProperty(self, uuid, {}) - - var attrs = Object.keys(self).filter(function (i) { - if (i === uuid) return false - if ( (typeof self[i] !== 'object' && typeof self[i] !== 'function') || self[i] === null) return true - return !(Object.getOwnPropertyDescriptor(self[i], uuid)) - }) - - - for (var i=0;i - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var crypto = require('crypto') - , parse = require('url').parse - ; - -/** - * Valid keys. - */ - -var keys = - [ 'acl' - , 'location' - , 'logging' - , 'notification' - , 'partNumber' - , 'policy' - , 'requestPayment' - , 'torrent' - , 'uploadId' - , 'uploads' - , 'versionId' - , 'versioning' - , 'versions' - , 'website' - ] - -/** - * Return an "Authorization" header value with the given `options` - * in the form of "AWS :" - * - * @param {Object} options - * @return {String} - * @api private - */ - -function authorization (options) { - return 'AWS ' + options.key + ':' + sign(options) -} - -module.exports = authorization -module.exports.authorization = authorization - -/** - * Simple HMAC-SHA1 Wrapper - * - * @param {Object} options - * @return {String} - * @api private - */ - -function hmacSha1 (options) { - return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') -} - -module.exports.hmacSha1 = hmacSha1 - -/** - * Create a base64 sha1 HMAC for `options`. - * - * @param {Object} options - * @return {String} - * @api private - */ - -function sign (options) { - options.message = stringToSign(options) - return hmacSha1(options) -} -module.exports.sign = sign - -/** - * Create a base64 sha1 HMAC for `options`. - * - * Specifically to be used with S3 presigned URLs - * - * @param {Object} options - * @return {String} - * @api private - */ - -function signQuery (options) { - options.message = queryStringToSign(options) - return hmacSha1(options) -} -module.exports.signQuery= signQuery - -/** - * Return a string for sign() with the given `options`. - * - * Spec: - * - * \n - * \n - * \n - * \n - * [headers\n] - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function stringToSign (options) { - var headers = options.amazonHeaders || '' - if (headers) headers += '\n' - var r = - [ options.verb - , options.md5 - , options.contentType - , options.date.toUTCString() - , headers + options.resource - ] - return r.join('\n') -} -module.exports.queryStringToSign = stringToSign - -/** - * Return a string for sign() with the given `options`, but is meant exclusively - * for S3 presigned URLs - * - * Spec: - * - * \n - * - * - * @param {Object} options - * @return {String} - * @api private - */ - -function queryStringToSign (options){ - return 'GET\n\n\n' + options.date + '\n' + options.resource -} -module.exports.queryStringToSign = queryStringToSign - -/** - * Perform the following: - * - * - ignore non-amazon headers - * - lowercase fields - * - sort lexicographically - * - trim whitespace between ":" - * - join with newline - * - * @param {Object} headers - * @return {String} - * @api private - */ - -function canonicalizeHeaders (headers) { - var buf = [] - , fields = Object.keys(headers) - ; - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i] - , val = headers[field] - , field = field.toLowerCase() - ; - if (0 !== field.indexOf('x-amz')) continue - buf.push(field + ':' + val) - } - return buf.sort().join('\n') -} -module.exports.canonicalizeHeaders = canonicalizeHeaders - -/** - * Perform the following: - * - * - ignore non sub-resources - * - sort lexicographically - * - * @param {String} resource - * @return {String} - * @api private - */ - -function canonicalizeResource (resource) { - var url = parse(resource, true) - , path = url.pathname - , buf = [] - ; - - Object.keys(url.query).forEach(function(key){ - if (!~keys.indexOf(key)) return - var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) - buf.push(key + val) - }) - - return path + (buf.length ? '?' + buf.sort().join('&') : '') -} -module.exports.canonicalizeResource = canonicalizeResource diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json deleted file mode 100644 index 54ebc98..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/aws-sign/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "aws-sign", - "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/aws-sign" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/aws-sign/issues" - }, - "_id": "aws-sign@0.3.0", - "_from": "aws-sign@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md deleted file mode 100644 index bcd8f8d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/README.md +++ /dev/null @@ -1,4 +0,0 @@ -cookie-jar -========== - -Cookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js deleted file mode 100644 index 7d54d94..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/index.js +++ /dev/null @@ -1,67 +0,0 @@ -/*! - * Tobi - Cookie - * Copyright(c) 2010 LearnBoost - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var url = require('url'); - -/** - * Initialize a new `Cookie` with the given cookie `str` and `req`. - * - * @param {String} str - * @param {IncomingRequest} req - * @api private - */ - -var Cookie = exports = module.exports = function Cookie(str, req) { - this.str = str; - - // Map the key/val pairs - str.split(/ *; */).reduce(function(obj, pair){ - var p = pair.indexOf('='); - var key = p > 0 ? pair.substring(0, p).trim() : pair.trim(); - var lowerCasedKey = key.toLowerCase(); - var value = p > 0 ? pair.substring(p + 1).trim() : true; - - if (!obj.name) { - // First key is the name - obj.name = key; - obj.value = value; - } - else if (lowerCasedKey === 'httponly') { - obj.httpOnly = value; - } - else { - obj[lowerCasedKey] = value; - } - return obj; - }, this); - - // Expires - this.expires = this.expires - ? new Date(this.expires) - : Infinity; - - // Default or trim path - this.path = this.path - ? this.path.trim(): req - ? url.parse(req.url).pathname: '/'; -}; - -/** - * Return the original cookie string. - * - * @return {String} - * @api public - */ - -Cookie.prototype.toString = function(){ - return this.str; -}; - -module.exports.Jar = require('./jar') \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js deleted file mode 100644 index 34920e0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/jar.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! -* Tobi - CookieJar -* Copyright(c) 2010 LearnBoost -* MIT Licensed -*/ - -/** -* Module dependencies. -*/ - -var url = require('url'); - -/** -* Initialize a new `CookieJar`. -* -* @api private -*/ - -var CookieJar = exports = module.exports = function CookieJar() { - this.cookies = []; -}; - -/** -* Add the given `cookie` to the jar. -* -* @param {Cookie} cookie -* @api private -*/ - -CookieJar.prototype.add = function(cookie){ - this.cookies = this.cookies.filter(function(c){ - // Avoid duplication (same path, same name) - return !(c.name == cookie.name && c.path == cookie.path); - }); - this.cookies.push(cookie); -}; - -/** -* Get cookies for the given `req`. -* -* @param {IncomingRequest} req -* @return {Array} -* @api private -*/ - -CookieJar.prototype.get = function(req){ - var path = url.parse(req.url).pathname - , now = new Date - , specificity = {}; - return this.cookies.filter(function(cookie){ - if (0 == path.indexOf(cookie.path) && now < cookie.expires - && cookie.path.length > (specificity[cookie.name] || 0)) - return specificity[cookie.name] = cookie.path.length; - }); -}; - -/** -* Return Cookie string for the given `req`. -* -* @param {IncomingRequest} req -* @return {String} -* @api private -*/ - -CookieJar.prototype.cookieString = function(req){ - var cookies = this.get(req); - if (cookies.length) { - return cookies.map(function(cookie){ - return cookie.name + '=' + cookie.value; - }).join('; '); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json deleted file mode 100644 index b42df9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "cookie-jar", - "description": "Cookie Jar. Originally pulled form tobi, maintained as vendor in request, now a standalone module.", - "version": "0.3.0", - "repository": { - "url": "https://github.com/mikeal/cookie-jar" - }, - "main": "index.js", - "scripts": { - "test": "node tests/run.js" - }, - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "cookie-jar\n==========\n\nCookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/cookie-jar/issues" - }, - "_id": "cookie-jar@0.3.0", - "_from": "cookie-jar@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js deleted file mode 100644 index 2cdc835..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js +++ /dev/null @@ -1,29 +0,0 @@ -var Cookie = require('../index') - , assert = require('assert'); - -var str = 'Sid="s543qactge.wKE61E01Bs%2BKhzmxrwrnug="; Path=/; httpOnly; Expires=Sat, 04 Dec 2010 23:27:28 GMT'; -var cookie = new Cookie(str); - -// test .toString() -assert.equal(cookie.toString(), str); - -// test .path -assert.equal(cookie.path, '/'); - -// test .httpOnly -assert.equal(cookie.httpOnly, true); - -// test .name -assert.equal(cookie.name, 'Sid'); - -// test .value -assert.equal(cookie.value, '"s543qactge.wKE61E01Bs%2BKhzmxrwrnug="'); - -// test .expires -assert.equal(cookie.expires instanceof Date, true); - -// test .path default -var cookie = new Cookie('foo=bar', { url: 'http://foo.com/bar' }); -assert.equal(cookie.path, '/bar'); - -console.log('All tests passed'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js deleted file mode 100644 index a33cfb2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js +++ /dev/null @@ -1,90 +0,0 @@ -var Cookie = require('../index') - , Jar = Cookie.Jar - , assert = require('assert'); - -function expires(ms) { - return new Date(Date.now() + ms).toUTCString(); -} - -// test .get() expiration -(function() { - var jar = new Jar; - var cookie = new Cookie('sid=1234; path=/; expires=' + expires(1000)); - jar.add(cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], cookie); - setTimeout(function(){ - var cookies = jar.get({ url: 'http://foo.com/foo' }); - assert.equal(cookies.length, 0); - }, 1000); - }, 5); -})(); - -// test .get() path support -(function() { - var jar = new Jar; - var a = new Cookie('sid=1234; path=/'); - var b = new Cookie('sid=1111; path=/foo/bar'); - var c = new Cookie('sid=2222; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - - // should remove the duplicates - assert.equal(jar.cookies.length, 2); - - // same name, same path, latter prevails - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], c); - - // same name, diff path, path specifity prevails, latter prevails - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], a); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], b); - - var jar = new Jar; - var a = new Cookie('sid=1111; path=/foo/bar'); - var b = new Cookie('sid=3333; path=/foo/bar'); - var c = new Cookie('pid=3333; path=/foo/bar'); - var d = new Cookie('sid=2222; path=/foo/'); - var e = new Cookie('sid=1234; path=/'); - jar.add(a); - jar.add(b); - jar.add(c); - jar.add(d); - jar.add(e); - - var cookies = jar.get({ url: 'http://foo.com/foo/bar' }); - assert.equal(cookies.length, 2); - assert.equal(cookies[0], b); - assert.equal(cookies[1], c); - - var cookies = jar.get({ url: 'http://foo.com/foo/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], d); - - var cookies = jar.get({ url: 'http://foo.com/' }); - assert.equal(cookies.length, 1); - assert.equal(cookies[0], e); -})(); - -setTimeout(function() { - console.log('All tests passed'); -}, 1200); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md deleted file mode 100644 index 9d5b663..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -forever-agent -============= - -HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js deleted file mode 100644 index 5c07928..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/index.js +++ /dev/null @@ -1,119 +0,0 @@ -module.exports = ForeverAgent -ForeverAgent.SSL = ForeverAgentSSL - -var util = require('util') - , Agent = require('http').Agent - , net = require('net') - , tls = require('tls') - , AgentSSL = require('https').Agent - -function ForeverAgent(options) { - var self = this - self.options = options || {} - self.requests = {} - self.sockets = {} - self.freeSockets = {} - self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets - self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets - self.on('free', function(socket, host, port) { - var name = host + ':' + port - if (self.requests[name] && self.requests[name].length) { - self.requests[name].shift().onSocket(socket) - } else if (self.sockets[name].length < self.minSockets) { - if (!self.freeSockets[name]) self.freeSockets[name] = [] - self.freeSockets[name].push(socket) - - // if an error happens while we don't use the socket anyway, meh, throw the socket away - function onIdleError() { - socket.destroy() - } - socket._onIdleError = onIdleError - socket.on('error', onIdleError) - } else { - // If there are no pending requests just destroy the - // socket and it will get removed from the pool. This - // gets us out of timeout issues and allows us to - // default to Connection:keep-alive. - socket.destroy() - } - }) - -} -util.inherits(ForeverAgent, Agent) - -ForeverAgent.defaultMinSockets = 5 - - -ForeverAgent.prototype.createConnection = net.createConnection -ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest -ForeverAgent.prototype.addRequest = function(req, host, port) { - var name = host + ':' + port - if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { - var idleSocket = this.freeSockets[name].pop() - idleSocket.removeListener('error', idleSocket._onIdleError) - delete idleSocket._onIdleError - req._reusedSocket = true - req.onSocket(idleSocket) - } else { - this.addRequestNoreuse(req, host, port) - } -} - -ForeverAgent.prototype.removeSocket = function(s, name, host, port) { - if (this.sockets[name]) { - var index = this.sockets[name].indexOf(s) - if (index !== -1) { - this.sockets[name].splice(index, 1) - } - } else if (this.sockets[name] && this.sockets[name].length === 0) { - // don't leak - delete this.sockets[name] - delete this.requests[name] - } - - if (this.freeSockets[name]) { - var index = this.freeSockets[name].indexOf(s) - if (index !== -1) { - this.freeSockets[name].splice(index, 1) - if (this.freeSockets[name].length === 0) { - delete this.freeSockets[name] - } - } - } - - if (this.requests[name] && this.requests[name].length) { - // 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(name, host, port).emit('free') - } -} - -function ForeverAgentSSL (options) { - ForeverAgent.call(this, options) -} -util.inherits(ForeverAgentSSL, ForeverAgent) - -ForeverAgentSSL.prototype.createConnection = createConnectionSSL -ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest - -function createConnectionSSL (port, host, options) { - if (typeof port === 'object') { - options = port; - } else if (typeof host === 'object') { - options = host; - } else if (typeof options === 'object') { - options = options; - } else { - options = {}; - } - - if (typeof port === 'number') { - options.port = port; - } - - if (typeof host === 'string') { - options.host = host; - } - - return tls.connect(options); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json deleted file mode 100644 index cf20ed1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/forever-agent/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "name": "forever-agent", - "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", - "version": "0.5.0", - "repository": { - "url": "https://github.com/mikeal/forever-agent" - }, - "main": "index.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/forever-agent/issues" - }, - "_id": "forever-agent@0.5.0", - "_from": "forever-agent@~0.5.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License deleted file mode 100644 index c7ff12a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md deleted file mode 100644 index dc73c46..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/Readme.md +++ /dev/null @@ -1,163 +0,0 @@ -# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data) - -A module to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. - -The API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. - -[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface -[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions - -## Install - -``` -npm install form-data -``` - -## Usage - -In this example we are constructing a form with 3 fields that contain a string, -a buffer and a file stream. - -``` javascript -var FormData = require('form-data'); -var fs = require('fs'); - -var form = new FormData(); -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); -``` - -Also you can use http-response stream: - -``` javascript -var FormData = require('form-data'); -var http = require('http'); - -var form = new FormData(); - -http.request('http://nodejs.org/images/logo.png', function(response) { - form.append('my_field', 'my value'); - form.append('my_buffer', new Buffer(10)); - form.append('my_logo', response); -}); -``` - -Or @mikeal's request stream: - -``` javascript -var FormData = require('form-data'); -var request = require('request'); - -var form = new FormData(); - -form.append('my_field', 'my value'); -form.append('my_buffer', new Buffer(10)); -form.append('my_logo', request('http://nodejs.org/images/logo.png')); -``` - -In order to submit this form to a web application, call ```submit(url, [callback])``` method: - -``` javascript -form.submit('http://example.org/', function(err, res) { - // res – response object (http.IncomingMessage) // - res.resume(); // for node-0.10.x -}); - -``` - -For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. - -### Alternative submission methods - -You can use node's http client interface: - -``` javascript -var http = require('http'); - -var request = http.request({ - method: 'post', - host: 'example.org', - path: '/upload', - headers: form.getHeaders() -}); - -form.pipe(request); - -request.on('response', function(res) { - console.log(res.statusCode); -}); -``` - -Or if you would prefer the `'Content-Length'` header to be set for you: - -``` javascript -form.submit('example.org/upload', function(err, res) { - console.log(res.statusCode); -}); -``` - -To use custom headers and pre-known length in parts: - -``` javascript -var CRLF = '\r\n'; -var form = new FormData(); - -var options = { - header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, - knownLength: 1 -}; - -form.append('my_buffer', buffer, options); - -form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); -}); -``` - -Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: - -``` javascript -someModule.stream(function(err, stdout, stderr) { - if (err) throw err; - - var form = new FormData(); - - form.append('file', stdout, { - filename: 'unicycle.jpg', - contentType: 'image/jpg', - knownLength: 19806 - }); - - form.submit('http://example.com/', function(err, res) { - if (err) throw err; - console.log('Done'); - }); -}); -``` - -For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: - -``` javascript -form.submit({ - host: 'example.com', - path: '/probably.php?extra=params', - auth: 'username:password' -}, function(err, res) { - console.log(res.statusCode); -}); -``` - -## Notes - -- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. -- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing] - -## TODO - -- Add new streams (0.10) support and try really hard not to break it for 0.8.x. - -## License - -Form-Data is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js deleted file mode 100644 index d106474..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/lib/form_data.js +++ /dev/null @@ -1,325 +0,0 @@ -var CombinedStream = require('combined-stream'); -var util = require('util'); -var path = require('path'); -var http = require('http'); -var https = require('https'); -var parseUrl = require('url').parse; -var fs = require('fs'); -var mime = require('mime'); -var async = require('async'); - -module.exports = FormData; -function FormData() { - this._overheadLength = 0; - this._valueLength = 0; - this._lengthRetrievers = []; - - CombinedStream.call(this); -} -util.inherits(FormData, CombinedStream); - -FormData.LINE_BREAK = '\r\n'; - -FormData.prototype.append = function(field, value, options) { - options = options || {}; - - var append = CombinedStream.prototype.append.bind(this); - - // all that streamy business can't handle numbers - if (typeof value == 'number') value = ''+value; - - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; - } - - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(field, value, options); - - append(header); - append(value); - append(footer); - - // pass along options.knownLength - this._trackLength(header, value, options); -}; - -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; - - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } - - this._valueLength += valueLength; - - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - + FormData.LINE_BREAK.length; - - // empty or either doesn't have path or not an http response - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { - return; - } - - // no need to bother with the length - if (!options.knownLength) - this._lengthRetrievers.push(function(next) { - - if (value.hasOwnProperty('fd')) { - fs.stat(value.path, function(err, stat) { - if (err) { - next(err); - return; - } - - next(null, stat.size); - }); - - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - next(null, +value.headers['content-length']); - - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - next(null, +response.headers['content-length']); - }); - value.resume(); - - // something else - } else { - next('Unknown stream'); - } - }); -}; - -FormData.prototype._multiPartHeader = function(field, value, options) { - var boundary = this.getBoundary(); - var header = ''; - - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (options.header != null) { - header = options.header; - } else { - header += '--' + boundary + FormData.LINE_BREAK + - 'Content-Disposition: form-data; name="' + field + '"'; - - // fs- and request- streams have path property - // or use custom filename and/or contentType - // TODO: Use request's response mime-type - if (options.filename || value.path) { - header += - '; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + (options.contentType || mime.lookup(options.filename || value.path)); - - // http response has not - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - header += - '; filename="' + path.basename(value.client._httpMessage.path) + '"' + FormData.LINE_BREAK + - 'Content-Type: ' + value.headers['content-type']; - } - - header += FormData.LINE_BREAK + FormData.LINE_BREAK; - } - - return header; -}; - -FormData.prototype._multiPartFooter = function(field, value, options) { - return function(next) { - var footer = FormData.LINE_BREAK; - - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); - } - - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--'; -}; - -FormData.prototype.getHeaders = function(userHeaders) { - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; - - for (var header in userHeaders) { - formHeaders[header.toLowerCase()] = userHeaders[header]; - } - - return formHeaders; -} - -FormData.prototype.getCustomHeaders = function(contentType) { - contentType = contentType ? contentType : 'multipart/form-data'; - - var formHeaders = { - 'content-type': contentType + '; boundary=' + this.getBoundary(), - 'content-length': this.getLengthSync() - }; - - return formHeaders; -} - -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } - - return this._boundary; -}; - -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } - - this._boundary = boundary; -}; - -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function(debug) { - var knownLength = this._overheadLength + this._valueLength; - - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - // https://github.com/felixge/node-form-data/issues/40 - if (this._lengthRetrievers.length) { - // Some async length retrivers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } - - return knownLength; -}; - -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; - - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } - - if (!this._lengthRetrievers.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } - - async.parallel(this._lengthRetrievers, function(err, values) { - if (err) { - cb(err); - return; - } - - values.forEach(function(length) { - knownLength += length; - }); - - cb(null, knownLength); - }); -}; - -FormData.prototype.submit = function(params, cb) { - - var request - , options - , defaults = { - method : 'post', - headers: this.getHeaders() - }; - - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { - params = parseUrl(params); - - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname - }, defaults); - } - else // use custom params - { - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; - } - } - - // https if specified, fallback to http in any other case - if (params.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } - - // get content length and fire away - this.getLength(function(err, length) { - - // TODO: Add chunked encoding when no length (if err) - - // add content length - request.setHeader('Content-Length', length); - - this.pipe(request); - if (cb) { - request.on('error', cb); - request.on('response', cb.bind(this, null)); - } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (this.error) return; - - this.error = err; - this.pause(); - this.emit('error', err); -}; - -/* - * Santa's little helpers - */ - -// populates missing values -function populate(dst, src) { - for (var prop in src) { - if (!dst[prop]) dst[prop] = src[prop]; - } - return dst; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md deleted file mode 100644 index 9ff1acf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/README.md +++ /dev/null @@ -1,1414 +0,0 @@ -# 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) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [doWhilst](#doWhilst) -* [until](#until) -* [doUntil](#doUntil) -* [forever](#forever) -* [waterfall](#waterfall) -* [compose](#compose) -* [applyEach](#applyEach) -* [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.map(['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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json deleted file mode 100644 index bbb0115..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js deleted file mode 100755 index cb6320d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +++ /dev/null @@ -1,955 +0,0 @@ -/*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 = setImmediate; - } - 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* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\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* [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.map(['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", - "_id": "async@0.2.9", - "_from": "async@~0.2.9" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore deleted file mode 100644 index aba34f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -*.un~ -/node_modules -/test/tmp diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile deleted file mode 100644 index b4ff85a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md deleted file mode 100644 index 1a9999e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +++ /dev/null @@ -1,132 +0,0 @@ -# combined-stream - -A stream that emits multiple other streams one after another. - -## Installation - -``` bash -npm install combined-stream -``` - -## Usage - -Here is a simple example that shows how you can use combined-stream to combine -two files into one: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -While the example above works great, it will pause all source streams until -they are needed. If you don't want that to happen, you can set `pauseStreams` -to `false`: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create({pauseStreams: false}); -combinedStream.append(fs.createReadStream('file1.txt')); -combinedStream.append(fs.createReadStream('file2.txt')); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -However, what if you don't have all the source streams yet, or you don't want -to allocate the resources (file descriptors, memory, etc.) for them right away? -Well, in that case you can simply provide a callback that supplies the stream -by calling a `next()` function: - -``` javascript -var CombinedStream = require('combined-stream'); -var fs = require('fs'); - -var combinedStream = CombinedStream.create(); -combinedStream.append(function(next) { - next(fs.createReadStream('file1.txt')); -}); -combinedStream.append(function(next) { - next(fs.createReadStream('file2.txt')); -}); - -combinedStream.pipe(fs.createWriteStream('combined.txt')); -``` - -## API - -### CombinedStream.create([options]) - -Returns a new combined stream object. Available options are: - -* `maxDataSize` -* `pauseStreams` - -The effect of those options is described below. - -### combinedStream.pauseStreams = true - -Whether to apply back pressure to the underlaying streams. If set to `false`, -the underlaying streams will never be paused. If set to `true`, the -underlaying streams will be paused right after being appended, as well as when -`delayedStream.pipe()` wants to throttle. - -### combinedStream.maxDataSize = 2 * 1024 * 1024 - -The maximum amount of bytes (or characters) to buffer for all source streams. -If this value is exceeded, `combinedStream` emits an `'error'` event. - -### combinedStream.dataSize = 0 - -The amount of bytes (or characters) currently buffered by `combinedStream`. - -### combinedStream.append(stream) - -Appends the given `stream` to the combinedStream object. If `pauseStreams` is -set to `true, this stream will also be paused right away. - -`streams` can also be a function that takes one parameter called `next`. `next` -is a function that must be invoked in order to provide the `next` stream, see -example above. - -Regardless of how the `stream` is appended, combined-stream always attaches an -`'error'` listener to it, so you don't have to do that manually. - -Special case: `stream` can also be a String or Buffer. - -### combinedStream.write(data) - -You should not call this, `combinedStream` takes care of piping the appended -streams into itself for you. - -### combinedStream.resume() - -Causes `combinedStream` to start drain the streams it manages. The function is -idempotent, and also emits a `'resume'` event each time which usually goes to -the stream that is currently being drained. - -### combinedStream.pause(); - -If `combinedStream.pauseStreams` is set to `false`, this does nothing. -Otherwise a `'pause'` event is emitted, this goes to the stream that is -currently being drained, so you can use it to apply back pressure. - -### combinedStream.end(); - -Sets `combinedStream.writable` to false, emits an `'end'` event, and removes -all streams from the queue. - -### combinedStream.destroy(); - -Same as `combinedStream.end()`, except it emits a `'close'` event instead of -`'end'`. - -## License - -combined-stream is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js deleted file mode 100644 index 32849fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +++ /dev/null @@ -1,185 +0,0 @@ -var util = require('util'); -var Stream = require('stream').Stream; -var DelayedStream = require('delayed-stream'); - -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; - - this._released = false; - this._streams = []; - this._currentStream = null; -} -util.inherits(CombinedStream, Stream); - -CombinedStream.create = function(options) { - var combinedStream = new this(); - - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } - - return combinedStream; -}; - -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; - -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - stream.on('data', this._checkDataSize.bind(this)); - - stream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - } - - this._handleErrors(stream); - - if (this.pauseStreams) { - stream.pause(); - } - } - - this._streams.push(stream); - return this; -}; - -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); -}; - -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - var stream = this._streams.shift(); - - - if (typeof stream == 'undefined') { - this.end(); - return; - } - - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } - - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); - } - - this._pipeNext(stream); - }.bind(this)); -}; - -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)) - stream.pipe(this, {end: false}); - return; - } - - var value = stream; - this.write(value); - this._getNext(); -}; - -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; - -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; - -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - - this.emit('pause'); -}; - -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); - } - - this.emit('resume'); -}; - -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; - -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; - -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; - -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this._emitError(new Error(message)); -}; - -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; - - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } - - self.dataSize += stream.dataSize; - }); - - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; - } -}; - -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore deleted file mode 100644 index 2fedb26..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -*.un~ -/node_modules/* diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License deleted file mode 100644 index 4804b7a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011 Debuggable Limited - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile deleted file mode 100644 index b4ff85a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -.PHONY: test - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md deleted file mode 100644 index 5cb5b35..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +++ /dev/null @@ -1,154 +0,0 @@ -# delayed-stream - -Buffers events from a stream until you are ready to handle them. - -## Installation - -``` bash -npm install delayed-stream -``` - -## Usage - -The following example shows how to write a http echo server that delays its -response by 1000 ms. - -``` javascript -var DelayedStream = require('delayed-stream'); -var http = require('http'); - -http.createServer(function(req, res) { - var delayed = DelayedStream.create(req); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 1000); -}); -``` - -If you are not using `Stream#pipe`, you can also manually release the buffered -events by calling `delayedStream.resume()`: - -``` javascript -var delayed = DelayedStream.create(req); - -setTimeout(function() { - // Emit all buffered events and resume underlaying source - delayed.resume(); -}, 1000); -``` - -## Implementation - -In order to use this meta stream properly, here are a few things you should -know about the implementation. - -### Event Buffering / Proxying - -All events of the `source` stream are hijacked by overwriting the `source.emit` -method. Until node implements a catch-all event listener, this is the only way. - -However, delayed-stream still continues to emit all events it captures on the -`source`, regardless of whether you have released the delayed stream yet or -not. - -Upon creation, delayed-stream captures all `source` events and stores them in -an internal event buffer. Once `delayedStream.release()` is called, all -buffered events are emitted on the `delayedStream`, and the event buffer is -cleared. After that, delayed-stream merely acts as a proxy for the underlaying -source. - -### Error handling - -Error events on `source` are buffered / proxied just like any other events. -However, `delayedStream.create` attaches a no-op `'error'` listener to the -`source`. This way you only have to handle errors on the `delayedStream` -object, rather than in two places. - -### Buffer limits - -delayed-stream provides a `maxDataSize` property that can be used to limit -the amount of data being buffered. In order to protect you from bad `source` -streams that don't react to `source.pause()`, this feature is enabled by -default. - -## API - -### DelayedStream.create(source, [options]) - -Returns a new `delayedStream`. Available options are: - -* `pauseStream` -* `maxDataSize` - -The description for those properties can be found below. - -### delayedStream.source - -The `source` stream managed by this object. This is useful if you are -passing your `delayedStream` around, and you still want to access properties -on the `source` object. - -### delayedStream.pauseStream = true - -Whether to pause the underlaying `source` when calling -`DelayedStream.create()`. Modifying this property afterwards has no effect. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. You can also modify this property during runtime. - -### delayedStream.maxDataSize = 1024 * 1024 - -The amount of data to buffer before emitting an `error`. - -If the underlaying source is emitting `Buffer` objects, the `maxDataSize` -refers to bytes. - -If the underlaying source is emitting JavaScript strings, the size refers to -characters. - -If you know what you are doing, you can set this property to `Infinity` to -disable this feature. - -### delayedStream.dataSize = 0 - -The amount of data buffered so far. - -### delayedStream.readable - -An ECMA5 getter that returns the value of `source.readable`. - -### delayedStream.resume() - -If the `delayedStream` has not been released so far, `delayedStream.release()` -is called. - -In either case, `source.resume()` is called. - -### delayedStream.pause() - -Calls `source.pause()`. - -### delayedStream.pipe(dest) - -Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. - -### delayedStream.release() - -Emits and clears all events that have been buffered up so far. This does not -resume the underlaying source, use `delayedStream.resume()` instead. - -## License - -delayed-stream is licensed under the MIT license. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js deleted file mode 100644 index 7c10d48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +++ /dev/null @@ -1,99 +0,0 @@ -var Stream = require('stream').Stream; -var util = require('util'); - -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; - - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); - -DelayedStream.create = function(source, options) { - var delayedStream = new this(); - - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; - } - - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; - - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); - } - - return delayedStream; -}; - -DelayedStream.prototype.__defineGetter__('readable', function() { - return this.source.readable; -}); - -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); - } - - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; - -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; - -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; - } - - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); - } - - this._bufferedEvents.push(args); -}; - -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; - } - - if (this.dataSize <= this.maxDataSize) { - return; - } - - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json deleted file mode 100644 index 38341b8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "version": "0.0.5", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n var delayed = DelayedStream.create(req);\n\n setTimeout(function() {\n res.writeHead(200);\n delayed.pipe(res);\n }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n // Emit all buffered events and resume underlaying source\n delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-delayed-stream/issues" - }, - "_id": "delayed-stream@0.0.5", - "_from": "delayed-stream@0.0.5" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js deleted file mode 100644 index 4d71b8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +++ /dev/null @@ -1,6 +0,0 @@ -var common = module.exports; - -common.DelayedStream = require('..'); -common.assert = require('assert'); -common.fake = require('fake'); -common.PORT = 49252; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js deleted file mode 100644 index 9ecad5b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var DelayedStream = common.DelayedStream; -var http = require('http'); - -var UPLOAD = new Buffer(10 * 1024 * 1024); - -var server = http.createServer(function(req, res) { - var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length}); - - setTimeout(function() { - res.writeHead(200); - delayed.pipe(res); - }, 10); -}); -server.listen(common.PORT, function() { - var request = http.request({ - method: 'POST', - port: common.PORT, - }); - - request.write(UPLOAD); - request.end(); - - request.on('response', function(res) { - var received = 0; - res - .on('data', function(chunk) { - received += chunk.length; - }) - .on('end', function() { - assert.equal(received, UPLOAD.length); - server.close(); - }); - }); -}); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js deleted file mode 100644 index 6f417f3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +++ /dev/null @@ -1,21 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testAutoPause() { - var source = new Stream(); - - fake.expect(source, 'pause', 1); - var delayedStream = DelayedStream.create(source); - fake.verify(); -})(); - -(function testDisableAutoPause() { - var source = new Stream(); - fake.expect(source, 'pause', 0); - - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js deleted file mode 100644 index b50c397..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +++ /dev/null @@ -1,14 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(source, 'pause'); - delayedStream.pause(); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js deleted file mode 100644 index fc4047e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +++ /dev/null @@ -1,48 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testDelayEventsUntilResume() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // delayedStream must not emit until we resume - fake.expect(delayedStream, 'emit', 0); - - // but our original source must emit - var params = []; - source.on('foo', function(param) { - params.push(param); - }); - - source.emit('foo', 1); - source.emit('foo', 2); - - // Make sure delayedStream did not emit, and source did - assert.deepEqual(params, [1, 2]); - fake.verify(); - - // After resume, delayedStream must playback all events - fake - .stub(delayedStream, 'emit') - .times(Infinity) - .withArg(1, 'newListener'); - fake.expect(delayedStream, 'emit', ['foo', 1]); - fake.expect(delayedStream, 'emit', ['foo', 2]); - fake.expect(source, 'resume'); - - delayedStream.resume(); - fake.verify(); - - // Calling resume again will delegate to source - fake.expect(source, 'resume'); - delayedStream.resume(); - fake.verify(); - - // Emitting more events directly leads to them being emitted - fake.expect(delayedStream, 'emit', ['foo', 3]); - source.emit('foo', 3); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js deleted file mode 100644 index a9d35e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +++ /dev/null @@ -1,15 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testHandleSourceErrors() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - // We deal with this by attaching a no-op listener to 'error' on the source - // when creating a new DelayedStream. This way error events on the source - // won't throw. - source.emit('error', new Error('something went wrong')); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 7638a2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,18 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testMaxDataSize() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false}); - - source.emit('data', new Buffer(1024)); - - fake - .expect(delayedStream, 'emit') - .withArg(1, 'error'); - source.emit('data', new Buffer(1)); - fake.verify(); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js deleted file mode 100644 index 7d312ab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testPipeReleases() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - fake.expect(delayedStream, 'resume'); - delayedStream.pipe(new Stream()); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js deleted file mode 100644 index d436163..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +++ /dev/null @@ -1,13 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var DelayedStream = common.DelayedStream; -var Stream = require('stream').Stream; - -(function testProxyReadableProperty() { - var source = new Stream(); - var delayedStream = DelayedStream.create(source, {pauseStream: false}); - - source.readable = fake.value('source.readable'); - assert.strictEqual(delayedStream.readable, source.readable); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js deleted file mode 100755 index 0bb8e82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json deleted file mode 100644 index 0dd4141..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "combined-stream", - "description": "A stream that emits multiple other streams one after another.", - "version": "0.0.4", - "homepage": "https://github.com/felixge/node-combined-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-combined-stream.git" - }, - "main": "./lib/combined_stream", - "engines": { - "node": "*" - }, - "dependencies": { - "delayed-stream": "0.0.5" - }, - "devDependencies": { - "far": "0.0.1" - }, - "readme": "# combined-stream\n\nA stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = true\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = 2 * 1024 * 1024\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = 0\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-combined-stream/issues" - }, - "_id": "combined-stream@0.0.4", - "_from": "combined-stream@~0.0.4" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js deleted file mode 100644 index 8154348..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js +++ /dev/null @@ -1,23 +0,0 @@ -var common = module.exports; - -var path = require('path'); -var fs = require('fs'); -var root = path.join(__dirname, '..'); - -common.dir = { - fixture: root + '/test/fixture', - tmp: root + '/test/tmp', -}; - -// Create tmp directory if it does not exist -// Not using fs.exists so as to be node 0.6.x compatible -try { - fs.statSync(common.dir.tmp); -} -catch (e) { - // Dir does not exist - fs.mkdirSync(common.dir.tmp); -} - -common.CombinedStream = require(root); -common.assert = require('assert'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt deleted file mode 100644 index 50e0218..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt +++ /dev/null @@ -1,256 +0,0 @@ -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 -10101010101010101010101010101010101010101010101010101010101010101010101010101010 -01010101010101010101010101010101010101010101010101010101010101010101010101010101 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt deleted file mode 100644 index da1d821..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt +++ /dev/null @@ -1,256 +0,0 @@ -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 -20202020202020202020202020202020202020202020202020202020202020202020202020202020 -02020202020202020202020202020202020202020202020202020202020202020202020202020202 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js deleted file mode 100644 index 44ecaba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js +++ /dev/null @@ -1,27 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE1)); - }); - combinedStream.append(function(next) { - next(fs.createReadStream(FILE2)); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js deleted file mode 100644 index e3fbd18..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js +++ /dev/null @@ -1,34 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; - -(function testDataSizeGetter() { - var combinedStream = CombinedStream.create(); - - assert.strictEqual(combinedStream.dataSize, 0); - - // Test one stream - combinedStream._streams.push({dataSize: 10}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 10); - - // Test two streams - combinedStream._streams.push({dataSize: 23}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test currentStream - combinedStream._currentStream = {dataSize: 20}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 53); - - // Test currentStream without dataSize - combinedStream._currentStream = {}; - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); - - // Test stream function - combinedStream._streams.push(function() {}); - combinedStream._updateDataSize(); - assert.strictEqual(combinedStream.dataSize, 33); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js deleted file mode 100644 index c678575..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var BUFFER = new Buffer('Bacon is delicious'); -var FILE2 = common.dir.fixture + '/file2.txt'; -var STRING = 'The € kicks the $\'s ass!'; - -var EXPECTED = - fs.readFileSync(FILE1) - + BUFFER - + fs.readFileSync(FILE2) - + STRING; -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(BUFFER); - combinedStream.append(fs.createReadStream(FILE2)); - combinedStream.append(function(next) { - next(STRING); - }); - - var tmpFile = common.dir.tmp + '/combined-file1-buffer-file2-string.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js deleted file mode 100644 index 263cfdf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js +++ /dev/null @@ -1,35 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); -var GOT; - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create(); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.equal(stream2.dataSize, 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('close', function() { - GOT = fs.readFileSync(tmpFile, 'utf8'); - }); -})(); - -process.on('exit', function() { - console.error(GOT.length, EXPECTED.length); - assert.strictEqual(GOT, EXPECTED); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js deleted file mode 100644 index c3d288d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js +++ /dev/null @@ -1,39 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var util = require('util'); -var Stream = require('stream').Stream; - -var s = CombinedStream.create(); - - -function StringStream(){ - this.writable=true; - this.str="" -} -util.inherits(StringStream,Stream); - -StringStream.prototype.write=function(chunk,encoding){ - this.str+=chunk.toString(); - this.emit('data',chunk); -} - -StringStream.prototype.end=function(chunk,encoding){ - this.emit('end'); -} - -StringStream.prototype.toString=function(){ - return this.str; -} - - -s.append("foo."); -s.append(""); -s.append("bar"); - -var ss = new StringStream(); - -s.pipe(ss); -s.resume(); - -assert.equal(ss.toString(),"foo.bar"); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js deleted file mode 100644 index aefa36e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var FILE1 = common.dir.fixture + '/file1.txt'; -var fileStream = fs.createReadStream(FILE1); - -var foo = function(){}; - -(function testIsStreamLike() { - assert(! CombinedStream.isStreamLike(true)); - assert(! CombinedStream.isStreamLike("I am a string")); - assert(! CombinedStream.isStreamLike(7)); - assert(! CombinedStream.isStreamLike(foo)); - - assert(CombinedStream.isStreamLike(fileStream)); -})(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js deleted file mode 100644 index 25f47a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false, maxDataSize: 20736}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var gotErr = null; - combinedStream.on('error', function(err) { - gotErr = err; - }); - - process.on('exit', function() { - assert.ok(gotErr); - assert.ok(gotErr.message.match(/bytes/)); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js deleted file mode 100644 index 30a3a6f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js +++ /dev/null @@ -1,30 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var CombinedStream = common.CombinedStream; -var fs = require('fs'); - -var FILE1 = common.dir.fixture + '/file1.txt'; -var FILE2 = common.dir.fixture + '/file2.txt'; -var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2); - -(function testDelayedStreams() { - var combinedStream = CombinedStream.create({pauseStreams: false}); - combinedStream.append(fs.createReadStream(FILE1)); - combinedStream.append(fs.createReadStream(FILE2)); - - var stream1 = combinedStream._streams[0]; - var stream2 = combinedStream._streams[1]; - - stream1.on('end', function() { - assert.ok(stream2.dataSize > 0); - }); - - var tmpFile = common.dir.tmp + '/combined.txt'; - var dest = fs.createWriteStream(tmpFile); - combinedStream.pipe(dest); - - dest.on('end', function() { - var written = fs.readFileSync(tmpFile, 'utf8'); - assert.strictEqual(written, EXPECTED); - }); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js deleted file mode 100755 index 0bb8e82..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var far = require('far').create(); - -far.add(__dirname); -far.include(/test-.*\.js$/); - -far.execute(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json deleted file mode 100644 index 146491b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" - }, - "name": "form-data", - "description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "0.1.2", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-form-data.git" - }, - "main": "./lib/form_data", - "scripts": { - "test": "node test/run.js" - }, - "engines": { - "node": ">= 0.6" - }, - "dependencies": { - "combined-stream": "~0.0.4", - "mime": "~1.2.11", - "async": "~0.2.9" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/felixge/node-form-data/master/License" - } - ], - "devDependencies": { - "fake": "~0.2.2", - "far": "~0.0.7", - "formidable": "~1.0.14", - "request": "~2.27.0" - }, - "readme": "# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)\n\nA module to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n form.append('my_field', 'my value');\n form.append('my_buffer', new Buffer(10));\n form.append('my_logo', response);\n});\n```\n\nOr @mikeal's request stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n // res – response object (http.IncomingMessage) //\n res.resume(); // for node-0.10.x\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n method: 'post',\n host: 'example.org',\n path: '/upload',\n headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n if (err) throw err;\n\n var form = new FormData();\n\n form.append('file', stdout, {\n filename: 'unicycle.jpg',\n contentType: 'image/jpg',\n knownLength: 19806\n });\n\n form.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n host: 'example.com',\n path: '/probably.php?extra=params',\n auth: 'username:password'\n}, function(err, res) {\n console.log(res.statusCode);\n});\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]\n\n## TODO\n\n- Add new streams (0.10) support and try really hard not to break it for 0.8.x.\n\n## License\n\nForm-Data is licensed under the MIT license.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/felixge/node-form-data/issues" - }, - "_id": "form-data@0.1.2", - "_from": "form-data@~0.1.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore deleted file mode 100644 index 77ba16c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml deleted file mode 100755 index 047f7e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js - -node_js: - - 0.10 - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE deleted file mode 100755 index e699a7b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2012-2013, Eran Hammer. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Eran Hammer nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile deleted file mode 100755 index 5f339bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -test: - @node node_modules/lab/bin/lab -test-cov: - @node node_modules/lab/bin/lab -r threshold -t 100 -test-cov-html: - @node node_modules/lab/bin/lab -r html -o coverage.html -complexity: - @node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib - -.PHONY: test test-cov test-cov-html complexity diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md deleted file mode 100755 index 010bac6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/hawk/README.md +++ /dev/null @@ -1,627 +0,0 @@ -![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png) - - **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial -HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz). - -Current version: **1.0** - -[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk) - -# Table of Content - -- [**Introduction**](#introduction) - - [Replay Protection](#replay-protection) - - [Usage Example](#usage-example) - - [Protocol Example](#protocol-example) - - [Payload Validation](#payload-validation) - - [Response Payload Validation](#response-payload-validation) - - [Browser Support and Considerations](#browser-support-and-considerations) -

        -- [**Single URI Authorization**](#single-uri-authorization) - - [Usage Example](#bewit-usage-example) -

        -- [**Security Considerations**](#security-considerations) - - [MAC Keys Transmission](#mac-keys-transmission) - - [Confidentiality of Requests](#confidentiality-of-requests) - - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers) - - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials) - - [Entropy of Keys](#entropy-of-keys) - - [Coverage Limitations](#coverage-limitations) - - [Future Time Manipulation](#future-time-manipulation) - - [Client Clock Poisoning](#client-clock-poisoning) - - [Bewit Limitations](#bewit-limitations) - - [Host Header Forgery](#host-header-forgery) -

        -- [**Frequently Asked Questions**](#frequently-asked-questions) -

        -- [**Acknowledgements**](#acknowledgements) - -# Introduction - -**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with -partial cryptographic verification of the request and response, covering the HTTP method, request URI, host, -and optionally the request payload. - -Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of -client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme, -the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is -included in its place. - -However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of -replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less -"chattiness" (interaction with the server). - -Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because -the client and server must both have access to the key material in the clear. - -The primary design goals of this scheme are to: -* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources, -* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where - to send an authenticated request), and -* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client - failure to validate the server's identity as part of its TLS handshake. - -In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using -a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk). - -The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server, -which is beyond the scope of this module. Typically, the shared credentials are established via an initial -TLS-protected phase or derived from some other shared confidential information available to both the client -and the server. - - -## Replay Protection - -Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more -than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when -making requests. This gives the server enough information to prevent replay attacks. - -The nonce is generated by the client, and is a string unique across all requests with the same timestamp and -key identifier combination. - -The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards -are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks. -By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in -practice translates to a maximum of 2 minutes as the skew can be positive or negative). - -Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client -clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types -(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response -to a bad timestamp. - -There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a -potential attack vector). Instead, the client only uses the server's time to calculate an offset used only -for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing -the number of round trips required to authenticate the first request. - - -## Usage Example - -Server code: - -```javascript -var Http = require('http'); -var Hawk = require('hawk'); - - -// Credentials lookup function - -var credentialsFunc = function (id, callback) { - - var credentials = { - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256', - user: 'Steve' - }; - - return callback(null, credentials); -}; - -// Create HTTP server - -var handler = function (req, res) { - - // Authenticate incoming request - - Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) { - - // Prepare response - - var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!'); - var headers = { 'Content-Type': 'text/plain' }; - - // Generate Server-Authorization response header - - var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] }); - headers['Server-Authorization'] = header; - - // Send the response back - - res.writeHead(!err ? 200 : 401, headers); - res.end(payload); - }); -}; - -// Start server - -Http.createServer(handler).listen(8000, 'example.com'); -``` - -Client code: - -```javascript -var Request = require('request'); -var Hawk = require('hawk'); - - -// Client credentials - -var credentials = { - id: 'dh37fgj492je', - key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', - algorithm: 'sha256' -} - -// Request options - -var requestOptions = { - uri: 'http://example.com:8000/resource/1?b=1&a=2', - method: 'GET', - headers: {} -}; - -// Generate Authorization request header - -var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' }); -requestOptions.headers.Authorization = header.field; - -// Send authenticated request - -Request(requestOptions, function (error, response, body) { - - // Authenticate the server's response - - var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body }); - - // Output results - - console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)')); -}); -``` - -**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local -machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method. - -```javascript -Hawk.sntp.start(); -``` - - -## Protocol Example - -The client attempts to access a protected resource without authentication, sending the following HTTP request to -the resource server: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -``` - -The resource server returns an authentication challenge. - -``` -HTTP/1.1 401 Unauthorized -WWW-Authenticate: Hawk -``` - -The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/" -server. The **Hawk** credentials issued to the client include the following attributes: - -* Key identifier: dh37fgj492je -* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn -* Algorithm: sha256 - -The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1, -1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline -character): - -``` -hawk.1.header -1353832234 -j4h3g2 -GET -/resource/1?b=1&a=2 -example.com -8000 - -some-app-ext-data - -``` - -The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string. -The result is base64-encoded to produce the request MAC: - -``` -6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE= -``` - -The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using -the HTTP `Authorization` request header field: - -``` -GET /resource/1?b=1&a=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=" -``` - -The server validates the request by calculating the request MAC again based on the request received and verifies the validity -and scope of the **Hawk** credentials. If valid, the server responds with the requested resource. - - -### Payload Validation - -**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash -using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character): -* `hawk.1.payload` -* the content-type in lowercase, without any parameters (e.g. `application/json`) -* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability) - -For example: - -* Payload: `Thank you for flying Hawk` -* Content Type: `text/plain` -* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=` - -Results in the following input to the payload hash function (newline terminated values): - -``` -hawk.1.payload -text/plain -Thank you for flying Hawk - -``` - -Which produces the following hash value: - -``` -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -``` - -The client constructs the normalized request string (newline terminated values): - -``` -hawk.1.header -1353832234 -j4h3g2 -POST -/resource/1?a=1&b=2 -example.com -8000 -Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY= -some-app-ext-data - -``` - -Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data, -and request MAC, with the request using the HTTP `Authorization` request header field: - -``` -POST /resource/1?a=1&b=2 HTTP/1.1 -Host: example.com:8000 -Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=" -``` - -It is up to the server if and when it validates the payload for any given request, based solely on it's security policy -and the nature of the data included. - -If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct -the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value -with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash. - -However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed -at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value -provided by the client after validating the MAC. - -It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value -included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided -by the client, the payload may be modified by an attacker. - - -## Response Payload Validation - -**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the -client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header -as a response header using the exact same syntax as the `Authorization` request header field. - -The header is contructed using the same process as the client's request header. The server uses the same credentials and other -artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with -new values based on the server response. The rest as identical to those used by the client. - -The result MAC digest is included with the optional `hash` and `ext` values: - -``` -Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific" -``` - - -## Browser Support and Considerations - -A browser script is provided for including using a `')); - expect(boom.response.payload.message).to.not.contain(''); - expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e'); - done(); - }); - - it('encodes \' characters', function (done) { - - var encoded = Hoek.escapeJavaScript('something(\'param\')'); - expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29'); - done(); - }); - - it('encodes large unicode characters with the correct padding', function (done) { - - var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000)); - expect(encoded).to.equal('\\u0500\\u1000'); - done(); - }); - - it('doesn\'t throw an exception when passed null', function (done) { - - var encoded = Hoek.escapeJavaScript(null); - expect(encoded).to.equal(''); - done(); - }); - }); - - describe('#escapeHtml', function () { - - it('encodes / characters', function (done) { - - var encoded = Hoek.escapeHtml(''); - expect(encoded).to.equal('<script>alert(1)</script>'); - done(); - }); - - it('encodes < and > as named characters', function (done) { - - var encoded = Hoek.escapeHtml(' -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node test.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -### 1.4.0 - -* Improved module context detection -* Removed public RNG functions - -### 1.3.2 - -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -### 1.3.0 - -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md deleted file mode 100644 index aaeb2ea..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# node-uuid Benchmarks - -### Results - -To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark - -### Run them yourself - -node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`. - -To prepare and run the benchmark issue; - -``` -npm install uuid uuid-js -node benchmark/benchmark.js -``` - -You'll see an output like this one: - -``` -# v4 -nodeuuid.v4(): 854700 uuids/second -nodeuuid.v4('binary'): 788643 uuids/second -nodeuuid.v4('binary', buffer): 1336898 uuids/second -uuid(): 479386 uuids/second -uuid('binary'): 582072 uuids/second -uuidjs.create(4): 312304 uuids/second - -# v1 -nodeuuid.v1(): 938086 uuids/second -nodeuuid.v1('binary'): 683060 uuids/second -nodeuuid.v1('binary', buffer): 1644736 uuids/second -uuidjs.create(1): 190621 uuids/second -``` - -* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library. -* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK. - -If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file: - -``` -for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done; -``` - -If you're interested in how performance varies between different node versions, you can issue the above command multiple times. - -You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot: - -``` -(cd benchmark/ && ./bench.sh) -``` - -This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu deleted file mode 100644 index a342fbb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ /dev/null @@ -1,174 +0,0 @@ -#!/opt/local/bin/gnuplot -persist -# -# -# G N U P L O T -# Version 4.4 patchlevel 3 -# last modified March 2011 -# System: Darwin 10.8.0 -# -# Copyright (C) 1986-1993, 1998, 2004, 2007-2010 -# Thomas Williams, Colin Kelley and many others -# -# gnuplot home: http://www.gnuplot.info -# faq, bugs, etc: type "help seeking-assistance" -# immediate help: type "help" -# plot window: hit 'h' -set terminal postscript eps noenhanced defaultplex \ - leveldefault color colortext \ - solid linewidth 1.2 butt noclip \ - palfuncparam 2000,0.003 \ - "Helvetica" 14 -set output 'bench.eps' -unset clip points -set clip one -unset clip two -set bar 1.000000 front -set border 31 front linetype -1 linewidth 1.000 -set xdata -set ydata -set zdata -set x2data -set y2data -set timefmt x "%d/%m/%y,%H:%M" -set timefmt y "%d/%m/%y,%H:%M" -set timefmt z "%d/%m/%y,%H:%M" -set timefmt x2 "%d/%m/%y,%H:%M" -set timefmt y2 "%d/%m/%y,%H:%M" -set timefmt cb "%d/%m/%y,%H:%M" -set boxwidth -set style fill empty border -set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 -set dummy x,y -set format x "% g" -set format y "% g" -set format x2 "% g" -set format y2 "% g" -set format z "% g" -set format cb "% g" -set angles radians -unset grid -set key title "" -set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 -set key maxcolumns 2 maxrows 0 -unset label -unset arrow -set style increment default -unset style line -set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0 -unset style arrow -set style histogram clustered gap 2 title offset character 0, 0, 0 -unset logscale -set offsets graph 0.05, 0.15, 0, 0 -set pointsize 1.5 -set pointintervalbox 1 -set encoding default -unset polar -unset parametric -unset decimalsign -set view 60, 30, 1, 1 -set samples 100, 100 -set isosamples 10, 10 -set surface -unset contour -set clabel '%8.3g' -set mapping cartesian -set datafile separator whitespace -unset hidden3d -set cntrparam order 4 -set cntrparam linear -set cntrparam levels auto 5 -set cntrparam points 5 -set size ratio 0 1,1 -set origin 0,0 -set style data points -set style function lines -set xzeroaxis linetype -2 linewidth 1.000 -set yzeroaxis linetype -2 linewidth 1.000 -set zzeroaxis linetype -2 linewidth 1.000 -set x2zeroaxis linetype -2 linewidth 1.000 -set y2zeroaxis linetype -2 linewidth 1.000 -set ticslevel 0.5 -set mxtics default -set mytics default -set mztics default -set mx2tics default -set my2tics default -set mcbtics default -set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set xtics norangelimit -set xtics () -set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set ytics autofreq norangelimit -set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0 -set ztics autofreq norangelimit -set nox2tics -set noy2tics -set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 -set cbtics autofreq norangelimit -set title "" -set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" -set timestamp offset character 0, 0, 0 font "" norotate -set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale rfixmin -set autoscale rfixmax -set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) -set autoscale tfixmin -set autoscale tfixmax -set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale ufixmin -set autoscale ufixmax -set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale vfixmin -set autoscale vfixmax -set xlabel "" -set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" -set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate -set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) -set autoscale xfixmin -set autoscale xfixmax -set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) -set autoscale x2fixmin -set autoscale x2fixmax -set ylabel "" -set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" -set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) -set autoscale yfixmin -set autoscale yfixmax -set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) -set autoscale y2fixmin -set autoscale y2fixmax -set zlabel "" -set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) -set autoscale zfixmin -set autoscale zfixmax -set cblabel "" -set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) -set autoscale cbfixmin -set autoscale cbfixmax -set zero 1e-08 -set lmargin -1 -set bmargin -1 -set rmargin -1 -set tmargin -1 -set pm3d explicit at s -set pm3d scansautomatic -set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB -set palette rgbformulae 7, 5, 15 -set colorbox default -set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath -set fit noerrorvariables -GNUTERM = "aqua" -plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 -# EOF diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh deleted file mode 100755 index d870a0c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# for a given node version run: -# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done; - -PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte') -FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es) -INDICES=(2 3 2 3 2 2 2 2 2) -VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " ) -TMPJOIN="tmp_join" -OUTPUT="bench_results.txt" - -for I in ${!FILES[*]}; do - F=${FILES[$I]} - P=${PATTERNS[$I]} - INDEX=${INDICES[$I]} - echo "version $F" > $F - for V in $VERSIONS; do - (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F - done - if [ $I == 0 ]; then - cat $F > $TMPJOIN - else - join $TMPJOIN $F > $OUTPUT - cp $OUTPUT $TMPJOIN - fi - rm $F -done - -rm $TMPJOIN - -gnuplot bench.gnu -convert -density 200 -resize 800x560 -flatten bench.eps bench.png -rm bench.eps diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c deleted file mode 100644 index dbfc75f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Test performance of native C UUID generation - -To Compile: cc -luuid benchmark-native.c -o benchmark-native -*/ - -#include -#include -#include -#include - -int main() { - uuid_t myid; - char buf[36+1]; - int i; - struct timeval t; - double start, finish; - - gettimeofday(&t, NULL); - start = t.tv_sec + t.tv_usec/1e6; - - int n = 2e5; - for (i = 0; i < n; i++) { - uuid_generate(myid); - uuid_unparse(myid, buf); - } - - gettimeofday(&t, NULL); - finish = t.tv_sec + t.tv_usec/1e6; - double dur = finish - start; - - printf("%d uuids/sec", (int)(n/dur)); - return 0; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js deleted file mode 100644 index 40e6efb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +++ /dev/null @@ -1,84 +0,0 @@ -try { - var nodeuuid = require('../uuid'); -} catch (e) { - console.error('node-uuid require failed - skipping tests'); -} - -try { - var uuid = require('uuid'); -} catch (e) { - console.error('uuid require failed - skipping tests'); -} - -try { - var uuidjs = require('uuid-js'); -} catch (e) { - console.error('uuid-js require failed - skipping tests'); -} - -var N = 5e5; - -function rate(msg, t) { - console.log(msg + ': ' + - (N / (Date.now() - t) * 1e3 | 0) + - ' uuids/second'); -} - -console.log('# v4'); - -// node-uuid - string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4(); - rate('nodeuuid.v4() - using node.js crypto RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG}); - rate('nodeuuid.v4() - using Math.random() RNG', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary'); - rate('nodeuuid.v4(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer); - rate('nodeuuid.v4(\'binary\', buffer)', t); -} - -// libuuid - string form -if (uuid) { - for (var i = 0, t = Date.now(); i < N; i++) uuid(); - rate('uuid()', t); - - for (var i = 0, t = Date.now(); i < N; i++) uuid('binary'); - rate('uuid(\'binary\')', t); -} - -// uuid-js - string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4); - rate('uuidjs.create(4)', t); -} - -// 140byte.es -for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)}); -rate('140byte.es_v4', t); - -console.log(''); -console.log('# v1'); - -// node-uuid - v1 string form -if (nodeuuid) { - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1(); - rate('nodeuuid.v1()', t); - - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary'); - rate('nodeuuid.v1(\'binary\')', t); - - var buffer = new nodeuuid.BufferClass(16); - for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer); - rate('nodeuuid.v1(\'binary\', buffer)', t); -} - -// uuid-js - v1 string form -if (uuidjs) { - for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1); - rate('uuidjs.create(1)', t); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json deleted file mode 100644 index ace2134..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/component.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "node-uuid", - "repo": "broofa/node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.0", - "author": "Robert Kieffer ", - "contributors": [ - {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} - ], - "keywords": ["uuid", "guid", "rfc4122"], - "dependencies": {}, - "development": {}, - "main": "uuid.js", - "scripts": [ - "uuid.js" - ], - "license": "MIT" -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json deleted file mode 100644 index 3fb5825..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - "contributors": [ - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - } - ], - "lib": ".", - "main": "./uuid.js", - "repository": { - "type": "git", - "url": "https://github.com/broofa/node-uuid.git" - }, - "version": "1.4.1", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "_id": "node-uuid@1.4.1", - "_from": "node-uuid@~1.4.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js deleted file mode 100644 index 05af822..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/compare_v1.js +++ /dev/null @@ -1,63 +0,0 @@ -var assert = require('assert'), - nodeuuid = require('../uuid'), - uuidjs = require('uuid-js'), - libuuid = require('uuid').generate, - util = require('util'), - exec = require('child_process').exec, - os = require('os'); - -// On Mac Os X / macports there's only the ossp-uuid package that provides uuid -// On Linux there's uuid-runtime which provides uuidgen -var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; - -function compare(ids) { - console.log(ids); - for (var i = 0; i < ids.length; i++) { - var id = ids[i].split('-'); - id = [id[2], id[1], id[0]].join(''); - ids[i] = id; - } - var sorted = ([].concat(ids)).sort(); - - if (sorted.toString() !== ids.toString()) { - console.log('Warning: sorted !== ids'); - } else { - console.log('everything in order!'); - } -} - -// Test time order of v1 uuids -var ids = []; -while (ids.length < 10e3) ids.push(nodeuuid.v1()); - -var max = 10; -console.log('node-uuid:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); -compare(ids); - -console.log(''); -console.log('uuidjs:'); -ids = []; -for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); -compare(ids); - -console.log(''); -console.log('libuuid:'); -ids = []; -var count = 0; -var last = function() { - compare(ids); -} -var cb = function(err, stdout, stderr) { - ids.push(stdout.substring(0, stdout.length-1)); - count++; - if (count < max) { - return next(); - } - last(); -}; -var next = function() { - exec(uuidCmd, cb); -}; -next(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html deleted file mode 100644 index d80326e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js deleted file mode 100644 index 2469225..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/test/test.js +++ /dev/null @@ -1,228 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js deleted file mode 100644 index 2fac6dc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/node-uuid/uuid.js +++ /dev/null @@ -1,245 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md deleted file mode 100644 index 34c4a85..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/README.md +++ /dev/null @@ -1,4 +0,0 @@ -oauth-sign -========== - -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js deleted file mode 100644 index e35bfa6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/index.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json deleted file mode 100644 index f211ed3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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" - }, - "_id": "oauth-sign@0.3.0", - "_from": "oauth-sign@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js deleted file mode 100644 index 46955ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/oauth-sign/test.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore deleted file mode 100644 index e85ce2a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -test -.travis.yml -benchmark.js -component.json -examples.js -History.md -Makefile diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md deleted file mode 100644 index 27e54a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/Readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js deleted file mode 100644 index 590491e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/index.js +++ /dev/null @@ -1,387 +0,0 @@ -/** - * 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) 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; -}; - -/** - * Create a nullary object if possible - */ - -function createObject() { - return Object.create - ? Object.create(null) - : {}; -} - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = createObject(); - var t = createObject(); - 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(); - // 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 = createObject(); - 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; -} - -/** - * Restore Object.prototype. - * see pull-request #58 - */ - -function restoreProto(obj) { - if (!Object.create) return obj; - if (isArray(obj)) return obj; - if (obj && 'object' != typeof obj) return obj; - - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - obj[key] = restoreProto(obj[key]); - } - } - - obj.__proto__ = Object.prototype; - 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: createObject() }).base; - - return restoreProto(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 (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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json deleted file mode 100644 index d1475f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/qs/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.6.5", - "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" - }, - "_id": "qs@0.6.5", - "_from": "qs@~0.6.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE deleted file mode 100644 index a4a9aee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md deleted file mode 100644 index bb533d5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/README.md +++ /dev/null @@ -1,4 +0,0 @@ -tunnel-agent -============ - -HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js deleted file mode 100644 index 3f7bbb9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/index.js +++ /dev/null @@ -1,227 +0,0 @@ -'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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json deleted file mode 100644 index 9b14d25..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/tunnel-agent/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "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" - }, - "_id": "tunnel-agent@0.3.0", - "_from": "tunnel-agent@~0.3.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json deleted file mode 100755 index 4ff48b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "request", - "description": "Simplified HTTP request client.", - "tags": [ - "http", - "simple", - "util", - "utility" - ], - "version": "2.25.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 request method\n\n## Install\n\n
        \n  npm install request\n
        \n\nOr from source:\n\n
        \n  git clone git://github.com/mikeal/request.git \n  cd request\n  npm link\n
        \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\t\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", - "_id": "request@2.25.0", - "_from": "request@~2.25.0" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg deleted file mode 100644 index f80c9c5..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/googledoodle.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js deleted file mode 100644 index e717f02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/run.js +++ /dev/null @@ -1,40 +0,0 @@ -var spawn = require('child_process').spawn - , exitCode = 0 - , timeout = 10000 - , fs = require('fs') - ; - -fs.readdir(__dirname, function (e, files) { - if (e) throw e - - var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'}) - - var next = function () { - if (tests.length === 0) process.exit(exitCode); - - var file = tests.shift() - console.log(file) - var proc = spawn('node', [ 'tests/' + file ]) - - var killed = false - var t = setTimeout(function () { - proc.kill() - exitCode += 1 - console.error(file + ' timeout') - killed = true - }, timeout) - - proc.stdout.pipe(process.stdout) - proc.stderr.pipe(process.stderr) - proc.on('exit', function (code) { - if (code && !killed) console.error(file + ' failed') - exitCode += code || 0 - clearTimeout(t) - next() - }) - } - next() - -}) - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js deleted file mode 100644 index b6eacba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/server.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('fs') - , http = require('http') - , path = require('path') - , https = require('https') - , events = require('events') - , stream = require('stream') - , assert = require('assert') - ; - -exports.createServer = function (port) { - port = port || 6767 - var s = http.createServer(function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'http://localhost:'+port - return s; -} - -exports.createSSLServer = function(port, opts) { - port = port || 16767 - - var options = { 'key' : path.join(__dirname, 'ssl', 'test.key') - , 'cert': path.join(__dirname, 'ssl', 'test.crt') - } - if (opts) { - for (var i in opts) options[i] = opts[i] - } - - for (var i in options) { - options[i] = fs.readFileSync(options[i]) - } - - var s = https.createServer(options, function (req, resp) { - s.emit(req.url, req, resp); - }) - s.port = port - s.url = 'https://localhost:'+port - return s; -} - -exports.createPostStream = function (text) { - var postStream = new stream.Stream(); - postStream.writeable = true; - postStream.readable = true; - setTimeout(function () {postStream.emit('data', new Buffer(text)); postStream.emit('end')}, 0); - return postStream; -} -exports.createPostValidator = function (text, reqContentType) { - var l = function (req, resp) { - var r = ''; - req.on('data', function (chunk) {r += chunk}) - req.on('end', function () { - if (req.headers['content-type'] && req.headers['content-type'].indexOf('boundary=') >= 0) { - var boundary = req.headers['content-type'].split('boundary=')[1]; - text = text.replace(/__BOUNDARY__/g, boundary); - } - if (r !== text) console.log(r, text); - assert.equal(r, text) - if (reqContentType) { - assert.ok(req.headers['content-type']) - assert.ok(~req.headers['content-type'].indexOf(reqContentType)) - } - resp.writeHead(200, {'content-type':'text/plain'}) - resp.write('OK') - resp.end() - }) - } - return l; -} -exports.createGetResponse = function (text, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - resp.write(text) - resp.end() - } - return l; -} -exports.createChunkResponse = function (chunks, contentType) { - var l = function (req, resp) { - contentType = contentType || 'text/plain' - resp.writeHead(200, {'content-type':contentType}) - chunks.forEach(function (chunk) { - resp.write(chunk) - }) - resp.end() - } - return l; -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf deleted file mode 100644 index 0d4a3b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/squid.conf +++ /dev/null @@ -1,77 +0,0 @@ -# -# Recommended minimum configuration: -# -acl manager proto cache_object -acl localhost src 127.0.0.1/32 ::1 -acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 - -# Example rule allowing access from your local networks. -# Adapt to list your (internal) IP networks from where browsing -# should be allowed -acl localnet src 10.0.0.0/8 # RFC1918 possible internal network -acl localnet src 172.16.0.0/12 # RFC1918 possible internal network -acl localnet src 192.168.0.0/16 # RFC1918 possible internal network -acl localnet src fc00::/7 # RFC 4193 local private network range -acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines - -acl SSL_ports port 443 -acl Safe_ports port 80 # http -acl Safe_ports port 21 # ftp -acl Safe_ports port 443 # https -acl Safe_ports port 70 # gopher -acl Safe_ports port 210 # wais -acl Safe_ports port 1025-65535 # unregistered ports -acl Safe_ports port 280 # http-mgmt -acl Safe_ports port 488 # gss-http -acl Safe_ports port 591 # filemaker -acl Safe_ports port 777 # multiling http -acl CONNECT method CONNECT - -# -# Recommended minimum Access Permission configuration: -# -# Only allow cachemgr access from localhost -http_access allow manager localhost -http_access deny manager - -# Deny requests to certain unsafe ports -http_access deny !Safe_ports - -# Deny CONNECT to other than secure SSL ports -#http_access deny CONNECT !SSL_ports - -# We strongly recommend the following be uncommented to protect innocent -# web applications running on the proxy server who think the only -# one who can access services on "localhost" is a local user -#http_access deny to_localhost - -# -# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS -# - -# Example rule allowing access from your local networks. -# Adapt localnet in the ACL section to list your (internal) IP networks -# from where browsing should be allowed -http_access allow localnet -http_access allow localhost - -# And finally deny all other access to this proxy -http_access deny all - -# Squid normally listens to port 3128 -http_port 3128 - -# We recommend you to use at least the following line. -hierarchy_stoplist cgi-bin ? - -# Uncomment and adjust the following to add a disk cache directory. -#cache_dir ufs /usr/local/var/cache 100 16 256 - -# Leave coredumps in the first cache dir -coredump_dir /usr/local/var/cache - -# Add any of your own refresh_pattern entries above these. -refresh_pattern ^ftp: 1440 20% 10080 -refresh_pattern ^gopher: 1440 0% 1440 -refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 -refresh_pattern . 0 20% 4320 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf deleted file mode 100644 index 425a889..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.cnf +++ /dev/null @@ -1,20 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no -output_password = password - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = request Certificate Authority -CN = requestCA -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crl b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crl deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt deleted file mode 100644 index b4524e4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.crt +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICvTCCAiYCCQDn+P/MSbDsWjANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGiMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxJjAkBgNVBAsTHXJlcXVlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 -MRIwEAYDVQQDEwlyZXF1ZXN0Q0ExJjAkBgkqhkiG9w0BCQEWF21pa2VhbEBtaWtl -YWxyb2dlcnMuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7t9pQUAK4 -5XJYTI6NrF0n3G2HZsfN+rPYSVzzL8SuVyb1tHXos+vbPm3NKI4E8X1yVAXU8CjJ -5SqXnp4DAypAhaseho81cbhk7LXUhFz78OvAa+OD+xTAEAnNQ8tGUr4VGyplEjfD -xsBVuqV2j8GPNTftr+drOCFlqfAgMrBn4wIDAQABMA0GCSqGSIb3DQEBBQUAA4GB -ADVdTlVAL45R+PACNS7Gs4o81CwSclukBu4FJbxrkd4xGQmurgfRrYYKjtqiopQm -D7ysRamS3HMN9/VKq2T7r3z1PMHPAy7zM4uoXbbaTKwlnX4j/8pGPn8Ca3qHXYlo -88L/OOPc6Di7i7qckS3HFbXQCTiULtxWmy97oEuTwrAj ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr deleted file mode 100644 index e48c56e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.csr +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICBjCCAW8CAQAwgaIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEmMCQGA1UECxMdcmVxdWVzdCBD -ZXJ0aWZpY2F0ZSBBdXRob3JpdHkxEjAQBgNVBAMTCXJlcXVlc3RDQTEmMCQGCSqG -SIb3DQEJARYXbWlrZWFsQG1pa2VhbHJvZ2Vycy5jb20wgZ8wDQYJKoZIhvcNAQEB -BQADgY0AMIGJAoGBALu32lBQArjlclhMjo2sXSfcbYdmx836s9hJXPMvxK5XJvW0 -deiz69s+bc0ojgTxfXJUBdTwKMnlKpeengMDKkCFqx6GjzVxuGTstdSEXPvw68Br -44P7FMAQCc1Dy0ZSvhUbKmUSN8PGwFW6pXaPwY81N+2v52s4IWWp8CAysGfjAgMB -AAGgIzAhBgkqhkiG9w0BCQcxFBMScGFzc3dvcmQgY2hhbGxlbmdlMA0GCSqGSIb3 -DQEBBQUAA4GBAGJO7grHeVHXetjHEK8urIxdnvfB2qeZeObz4GPKIkqUurjr0rfj -bA3EK1kDMR5aeQWR8RunixdM16Q6Ry0lEdLVWkdSwRN9dmirIHT9cypqnD/FYOia -SdezZ0lUzXgmJIwRYRwB1KSMMocIf52ll/xC2bEGg7/ZAEuAyAgcZV3X ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key deleted file mode 100644 index a53e7f7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.key +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,C8B5887048377F02 - -nyD5ZH0Wup2uWsDvurq5mKDaDrf8lvNn9w0SH/ZkVnfR1/bkwqrFriqJWvZNUG+q -nS0iBYczsWLJnbub9a1zLOTENWUKVD5uqbC3aGHhnoUTNSa27DONgP8gHOn6JgR+ -GAKo01HCSTiVT4LjkwN337QKHnMP2fTzg+IoC/CigvMcq09hRLwU1/guq0GJKGwH -gTxYNuYmQC4Tjh8vdS4liF+Ve/P3qPR2CehZrIOkDT8PHJBGQJRo4xGUIB7Tpk38 -VCk+UZ0JCS2coY8VkY/9tqFJp/ZnnQQVmaNbdRqg7ECKL+bXnNo7yjzmazPZmPe3 -/ShbE0+CTt7LrjCaQAxWbeDzqfo1lQfgN1LulTm8MCXpQaJpv7v1VhIhQ7afjMYb -4thW/ypHPiYS2YJCAkAVlua9Oxzzh1qJoh8Df19iHtpd79Q77X/qf+1JvITlMu0U -gi7yEatmQcmYNws1mtTC1q2DXrO90c+NZ0LK/Alse6NRL/xiUdjug2iHeTf/idOR -Gg/5dSZbnnlj1E5zjSMDkzg6EHAFmHV4jYGSAFLEQgp4V3ZhMVoWZrvvSHgKV/Qh -FqrAK4INr1G2+/QTd09AIRzfy3/j6yD4A9iNaOsEf9Ua7Qh6RcALRCAZTWR5QtEf -dX+iSNJ4E85qXs0PqwkMDkoaxIJ+tmIRJY7y8oeylV8cfGAi8Soubt/i3SlR8IHC -uDMas/2OnwafK3N7ODeE1i7r7wkzQkSHaEz0TrF8XRnP25jAICCSLiMdAAjKfxVb -EvzsFSuAy3Jt6bU3hSLY9o4YVYKE+68ITMv9yNjvTsEiW+T+IbN34w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl deleted file mode 100644 index 17128db..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/ca.srl +++ /dev/null @@ -1 +0,0 @@ -ADF62016AA40C9C3 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf deleted file mode 100644 index cd1fd1e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.cnf +++ /dev/null @@ -1,19 +0,0 @@ -[ req ] -default_bits = 1024 -days = 3650 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no - -[ req_distinguished_name ] -C = US -ST = CA -L = Oakland -O = request -OU = testing -CN = testing.request.mikealrogers.com -emailAddress = mikeal@mikealrogers.com - -[ req_attributes ] -challengePassword = password challenge - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt deleted file mode 100644 index efe96ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICejCCAeMCCQCt9iAWqkDJwzANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1 -ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG -A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n -ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGjMQswCQYD -VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT -B3JlcXVlc3QxEDAOBgNVBAsTB3Rlc3RpbmcxKTAnBgNVBAMTIHRlc3RpbmcucmVx -dWVzdC5taWtlYWxyb2dlcnMuY29tMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlr -ZWFscm9nZXJzLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDgVl0jMumvOpmM -20W5v9yhGgZj8hPhEQF/N7yCBVBn/rWGYm70IHC8T/pR5c0LkWc5gdnCJEvKWQjh -DBKxZD8FAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEABShRkNgFbgs4vUWW9R9deNJj -7HJoiTmvkmoOC7QzcYkjdgHbOxsSq3rBnwxsVjY9PAtPwBn0GRspOeG7KzKRgySB -kb22LyrCFKbEOfKO/+CJc80ioK9zEPVjGsFMyAB+ftYRqM+s/4cQlTg/m89l01wC -yapjN3RxZbInGhWR+jA= ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr deleted file mode 100644 index a8e7595..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.csr +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBgjCCASwCAQAwgaMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE -BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEQMA4GA1UECxMHdGVzdGluZzEp -MCcGA1UEAxMgdGVzdGluZy5yZXF1ZXN0Lm1pa2VhbHJvZ2Vycy5jb20xJjAkBgkq -hkiG9w0BCQEWF21pa2VhbEBtaWtlYWxyb2dlcnMuY29tMFwwDQYJKoZIhvcNAQEB -BQADSwAwSAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAaAjMCEGCSqGSIb3DQEJBzEU -ExJwYXNzd29yZCBjaGFsbGVuZ2UwDQYJKoZIhvcNAQEFBQADQQBD3E5WekQzCEJw -7yOcqvtPYIxGaX8gRKkYfLPoj3pm3GF5SGqtJKhylKfi89szHXgktnQgzff9FN+A -HidVJ/3u ------END CERTIFICATE REQUEST----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js deleted file mode 100644 index 05e21c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.js +++ /dev/null @@ -1,28 +0,0 @@ -var fs = require("fs") -var https = require("https") -var options = { key: fs.readFileSync("./server.key") - , cert: fs.readFileSync("./server.crt") } - -var server = https.createServer(options, function (req, res) { - res.writeHead(200) - res.end() - server.close() -}) -server.listen(1337) - -var ca = fs.readFileSync("./ca.crt") -var agent = new https.Agent({ host: "localhost", port: 1337, ca: ca }) - -https.request({ host: "localhost" - , method: "HEAD" - , port: 1337 - , headers: { host: "testing.request.mikealrogers.com" } - , agent: agent - , ca: [ ca ] - , path: "/" }, function (res) { - if (res.client.authorized) { - console.log("node test: OK") - } else { - throw new Error(res.client.authorizationError) - } -}).end() diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key deleted file mode 100644 index 72d8698..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/ca/server.key +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIBOwIBAAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg -cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAQJAK+r8ZM2sze8s7FRo/ApB -iRBtO9fCaIdJwbwJnXKo4RKwZDt1l2mm+fzZ+/QaQNjY1oTROkIIXmnwRvZWfYlW -gQIhAPKYsG+YSBN9o8Sdp1DMyZ/rUifKX3OE6q9tINkgajDVAiEA7Ltqh01+cnt0 -JEnud/8HHcuehUBLMofeg0G+gCnSbXECIQCqDvkXsWNNLnS/3lgsnvH0Baz4sbeJ -rjIpuVEeg8eM5QIgbu0+9JmOV6ybdmmiMV4yAncoF35R/iKGVHDZCAsQzDECIQDZ -0jGz22tlo5YMcYSqrdD3U4sds1pwiAaWFRbCunoUJw== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt deleted file mode 100644 index fde2fe9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/npm-ca.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x -IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w -bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y -MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV -BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj -YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA -aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE -OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz -Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl -y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC -l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv -yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl -ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt deleted file mode 100644 index b357f86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.crt +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICQzCCAawCCQCO/XWtRFck1jANBgkqhkiG9w0BAQUFADBmMQswCQYDVQQGEwJU -SDEQMA4GA1UECBMHQmFuZ2tvazEOMAwGA1UEBxMFU2lsb20xGzAZBgNVBAoTElRo -ZSBSZXF1ZXN0IE1vZHVsZTEYMBYGA1UEAxMPcmVxdWVzdC5leGFtcGxlMB4XDTEx -MTIwMzAyMjkyM1oXDTIxMTEzMDAyMjkyM1owZjELMAkGA1UEBhMCVEgxEDAOBgNV -BAgTB0Jhbmdrb2sxDjAMBgNVBAcTBVNpbG9tMRswGQYDVQQKExJUaGUgUmVxdWVz -dCBNb2R1bGUxGDAWBgNVBAMTD3JlcXVlc3QuZXhhbXBsZTCBnzANBgkqhkiG9w0B -AQEFAAOBjQAwgYkCgYEAwmctddZqlA48+NXs0yOy92DijcQV1jf87zMiYAIlNUto -wghVbTWgJU5r0pdKrD16AptnWJTzKanhItEX8XCCPgsNkq1afgTtJP7rNkwu3xcj -eIMkhJg/ay4ZnkbnhYdsii5VTU5prix6AqWRAhbkBgoA+iVyHyof8wvZyKBoFTMC -AwEAATANBgkqhkiG9w0BAQUFAAOBgQB6BybMJbpeiABgihDfEVBcAjDoQ8gUMgwV -l4NulugfKTDmArqnR9aPd4ET5jX5dkMP4bwCHYsvrcYDeWEQy7x5WWuylOdKhua4 -L4cEi2uDCjqEErIG3cc1MCOk6Cl6Ld6tkIzQSf953qfdEACRytOeUqLNQcrXrqeE -c7U8F6MWLQ== ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key deleted file mode 100644 index b85810d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/ssl/test.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDCZy111mqUDjz41ezTI7L3YOKNxBXWN/zvMyJgAiU1S2jCCFVt -NaAlTmvSl0qsPXoCm2dYlPMpqeEi0RfxcII+Cw2SrVp+BO0k/us2TC7fFyN4gySE -mD9rLhmeRueFh2yKLlVNTmmuLHoCpZECFuQGCgD6JXIfKh/zC9nIoGgVMwIDAQAB -AoGBALXFwfUf8vHTSmGlrdZS2AGFPvEtuvldyoxi9K5u8xmdFCvxnOcLsF2RsTHt -Mu5QYWhUpNJoG+IGLTPf7RJdj/kNtEs7xXqWy4jR36kt5z5MJzqiK+QIgiO9UFWZ -fjUb6oeDnTIJA9YFBdYi97MDuL89iU/UK3LkJN3hd4rciSbpAkEA+MCkowF5kSFb -rkOTBYBXZfiAG78itDXN6DXmqb9XYY+YBh3BiQM28oxCeQYyFy6pk/nstnd4TXk6 -V/ryA2g5NwJBAMgRKTY9KvxJWbESeMEFe2iBIV0c26/72Amgi7ZKUCLukLfD4tLF -+WSZdmTbbqI1079YtwaiOVfiLm45Q/3B0eUCQAaQ/0eWSGE+Yi8tdXoVszjr4GXb -G81qBi91DMu6U1It+jNfIba+MPsiHLcZJMVb4/oWBNukN7bD1nhwFWdlnu0CQQCf -Is9WHkdvz2RxbZDxb8verz/7kXXJQJhx5+rZf7jIYFxqX3yvTNv3wf2jcctJaWlZ -fVZwB193YSivcgt778xlAkEAprYUz3jczjF5r2hrgbizPzPDR94tM5BTO3ki2v3w -kbf+j2g7FNAx6kZiVN8XwfLc8xEeUGiPKwtq3ddPDFh17w== ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js deleted file mode 100644 index 47fe3aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-agentOptions.js +++ /dev/null @@ -1,23 +0,0 @@ -var request = require('../index') - , http = require('http') - , server = require('./server') - , assert = require('assert') - ; - -var s = http.createServer(function (req, resp) { - resp.statusCode = 200 - resp.end('') -}).listen(6767, function () { - // requests without agentOptions should use global agent - var r = request('http://localhost:6767', function (e, resp, body) { - assert.deepEqual(r.agent, http.globalAgent); - assert.equal(Object.keys(r.pool).length, 0); - - // requests with agentOptions should apply agentOptions to new agent in pool - var r2 = request('http://localhost:6767', { agentOptions: { foo: 'bar' } }, function (e, resp, body) { - assert.deepEqual(r2.agent.options, { foo: 'bar' }); - assert.equal(Object.keys(r2.pool).length, 1); - s.close() - }); - }) -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js deleted file mode 100644 index 3f48048..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-basic-auth.js +++ /dev/null @@ -1,143 +0,0 @@ -var assert = require('assert') - , http = require('http') - , request = require('../index') - ; - -var numBasicRequests = 0; - -var basicServer = http.createServer(function (req, res) { - console.error('Basic auth server: ', req.method, req.url); - numBasicRequests++; - - var ok; - - if (req.headers.authorization) { - if (req.headers.authorization == 'Basic ' + new Buffer('test:testing2').toString('base64')) { - ok = true; - } else if ( req.headers.authorization == 'Basic ' + new Buffer(':apassword').toString('base64')) { - 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', 'Basic realm="Private"'); - } - - if (req.url == '/post/') { - var expectedContent = 'data_key=data_value'; - req.on('data', function(data) { - assert.equal(data, expectedContent); - console.log('received request data: ' + data); - }); - assert.equal(req.method, 'POST'); - assert.equal(req.headers['content-length'], '' + expectedContent.length); - assert.equal(req.headers['content-type'], 'application/x-www-form-urlencoded; charset=utf-8'); - } - - if (ok) { - console.log('request ok'); - res.end('ok'); - } else { - console.log('status=401'); - res.statusCode = 401; - res.end('401'); - } -}); - -basicServer.listen(6767); - -var tests = [ - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 2); - next(); - }); - }, - - function(next) { - // If we don't set sendImmediately = false, request will send basic auth - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/test2/', - 'auth': { - 'user': 'test', - 'pass': 'testing2' - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 3); - next(); - }); - }, - - function(next) { - request({ - 'method': 'GET', - 'uri': 'http://test:testing2@localhost:6767/test2/' - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 4); - next(); - }); - }, - - function(next) { - request({ - 'method': 'POST', - 'form': { 'data_key': 'data_value' }, - 'uri': 'http://localhost:6767/post/', - 'auth': { - 'user': 'test', - 'pass': 'testing2', - 'sendImmediately': false - } - }, function(error, res, body) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 6); - next(); - }); - }, - - function(next) { - assert.doesNotThrow( function() { - request({ - 'method': 'GET', - 'uri': 'http://localhost:6767/allow_empty_user/', - 'auth': { - 'user': '', - 'pass': 'apassword', - 'sendImmediately': false - } - }, function(error, res, body ) { - assert.equal(res.statusCode, 200); - assert.equal(numBasicRequests, 8); - next(); - }); - }) - } -]; - -function runTest(i) { - if (i < tests.length) { - tests[i](function() { - runTest(i + 1); - }); - } else { - console.log('All tests passed'); - basicServer.close(); - } -} - -runTest(0); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js deleted file mode 100644 index 186de12..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-body.js +++ /dev/null @@ -1,122 +0,0 @@ -var server = require('./server') - , events = require('events') - , stream = require('stream') - , 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!") - } - , testGetEncoding : - { resp : server.createGetResponse(new Buffer('efa3bfcea9e29883', 'hex')) - , encoding: 'hex' - , expectBody: "efa3bfcea9e29883" - } - , testGetUTF8: - { resp: server.createGetResponse(new Buffer([0xEF, 0xBB, 0xBF, 226, 152, 131])) - , encoding: "utf8" - , 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.'} - ] - } - , 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js deleted file mode 100644 index f6c4024..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-defaults.js +++ /dev/null @@ -1,129 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js deleted file mode 100644 index 5f2d6eb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-digest-auth.js +++ /dev/null @@ -1,69 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js deleted file mode 100644 index 338c92e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-emptyBody.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js deleted file mode 100644 index 4df1302..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-errors.js +++ /dev/null @@ -1,37 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js deleted file mode 100644 index 956e386..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all-303.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js deleted file mode 100644 index f2e51ff..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-follow-all.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js deleted file mode 100644 index 91b9230..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-form.js +++ /dev/null @@ -1,79 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js deleted file mode 100755 index 8454625..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-hawk.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js deleted file mode 100644 index 3982b9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-headers.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js deleted file mode 100755 index 9300473..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-http-signature.js +++ /dev/null @@ -1,106 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js deleted file mode 100644 index 2c19615..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-httpModule.js +++ /dev/null @@ -1,94 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js deleted file mode 100644 index d49a9af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https-strict.js +++ /dev/null @@ -1,97 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js deleted file mode 100644 index b6858d4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-https.js +++ /dev/null @@ -1,87 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js deleted file mode 100644 index 11a1bd1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-localAddress.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js deleted file mode 100644 index 3269483..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-oauth.js +++ /dev/null @@ -1,117 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js deleted file mode 100644 index c239f89..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-onelineproxy.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js deleted file mode 100644 index a5831a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-params.js +++ /dev/null @@ -1,93 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js deleted file mode 100644 index e295ec7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-piped-redirect.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js deleted file mode 100644 index 52a15cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pipes.js +++ /dev/null @@ -1,216 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js deleted file mode 100644 index 791ee8b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-pool.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js deleted file mode 100644 index 7e83a41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-protocol-changing-redirect.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js deleted file mode 100644 index e183d68..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-proxy.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js deleted file mode 100644 index 65958e6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-qs.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js deleted file mode 100644 index cdd4606..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-redirect.js +++ /dev/null @@ -1,155 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js deleted file mode 100644 index 0f6a832..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-s3.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js deleted file mode 100644 index 7036367..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-timeout.js +++ /dev/null @@ -1,87 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js deleted file mode 100644 index 6d5f92a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-toJSON.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js deleted file mode 100644 index 2ee3f39..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/test-tunnel.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg deleted file mode 100644 index 7cea4dd..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/tests/unicycle.jpg and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc deleted file mode 100644 index c8ef3ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.jshintrc +++ /dev/null @@ -1,59 +0,0 @@ -{ - "predef": [ ] - , "bitwise": false - , "camelcase": false - , "curly": false - , "eqeqeq": false - , "forin": false - , "immed": false - , "latedef": false - , "noarg": true - , "noempty": true - , "nonew": true - , "plusplus": false - , "quotmark": true - , "regexp": false - , "undef": true - , "unused": true - , "strict": false - , "trailing": true - , "maxlen": 120 - , "asi": true - , "boss": true - , "debug": true - , "eqnull": true - , "esnext": true - , "evil": true - , "expr": true - , "funcscope": false - , "globalstrict": false - , "iterator": false - , "lastsemic": true - , "laxbreak": true - , "laxcomma": true - , "loopfunc": true - , "multistr": false - , "onecase": false - , "proto": false - , "regexdash": false - , "scripturl": true - , "smarttabs": false - , "shadow": false - , "sub": true - , "supernew": false - , "validthis": true - , "browser": true - , "couch": false - , "devel": false - , "dojo": false - , "mootools": false - , "node": true - , "nonstandard": true - , "prototypejs": false - , "rhino": false - , "worker": true - , "wsh": false - , "nomen": false - , "onevar": false - , "passfail": false -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore deleted file mode 100644 index b512c09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml deleted file mode 100644 index cece8c6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" -branches: - only: - - master -notifications: - email: - - rod@vagg.org -script: npm test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE deleted file mode 100644 index f6a0029..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -Copyright 2013, Rod Vagg (the "Original Author") -All rights reserved. - -MIT +no-false-attribs 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. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -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. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software. \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md deleted file mode 100644 index 1f7e6bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# through2 - -[![Build Status](https://secure.travis-ci.org/rvagg/through2.png)](http://travis-ci.org/rvagg/through2) - -[![NPM](https://nodei.co/npm/through2.png?compact=true)](https://nodei.co/npm/through2/) - -**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise** - -Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`. - -```js -fs.createReadStream('ex.txt') - .pipe(through2(function (chunk, enc, callback) { - for (var i = 0; i < chunk.length; i++) - if (chunk[i] == 97) - chunk[i] = 122 // swap 'a' for 'z' - this.push(chunk) - callback() - })) - .pipe(fs.createWriteStream('out.txt')) -``` - -Or object streams: - -```js -var all = [] -fs.createReadStream('data.csv') - .pipe(csv2()) - .pipe(through2({ objectMode: true }, function (chunk, enc, callback) { - var data = { - name : chunk[0] - , address : chunk[3] - , phone : chunk[10] - } - this.push(data) - callback() - })) - .on('data', function (data) { - all.push(data) - }) - .on('end', function () { - doSomethingSpecial(all) - }) -``` - -## API - -through2([ options, ] transformFunction[, flushFunction ]) - -Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`). - -### options - -The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams. - -The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call: - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2({ objectMode: true, allowHalfOpen: false }, function (chunk, enc, cb) { - this.push(new Buffer('wut?')) - cb() - }) - .pipe(fs.createWriteStream('/tmp/wut.txt')) -``` - -### transformFunction - -The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk. - -To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on. - -### flushFunction - -The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress. - -through2.ctor([ options, ] transformFunction[, flushFunction ]) - -Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances. - -```js -var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) { - if (record.temp != null && record.unit = "F") { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = "C" - } - this.push(record) - callback() -}) - -// Create instances of FToC like so: -var converter = new FToC() -// Or: -var converter = FToC() -// Or specify/override options when you instantiate, if you prefer: -var converter = FToC({objectMode: true}) - -``` - -## License - -**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md deleted file mode 100644 index be97668..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/README.md +++ /dev/null @@ -1,768 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS deleted file mode 100644 index 205a425..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS +++ /dev/null @@ -1,32 +0,0 @@ -var Transform = require('../transform'); -var inherits = require('util').inherits; - -// subclass -function MyStream () { - Transform.call(this, { - lowWaterMark: 0, - encoding: 'utf8' - }); -} -inherits(MyStream, Transform); - -MyStream.prototype._transform = function (chunk, outputFn, callback) { - outputFn(new Buffer(String(chunk).toUpperCase())); - callback(); -}; - -// use it! -var s = new MyStream(); -process.stdin.resume(); -process.stdin.pipe(s).pipe(process.stdout); -if (process.stdin.setRawMode) - process.stdin.setRawMode(true); -process.stdin.on('data', function (c) { - c = c.toString(); - if (c === '\u0003' || c === '\u0004') { - process.stdin.pause(); - s.end(); - } - if (c === '\r') - process.stdout.write('\n'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js deleted file mode 100644 index 7e71584..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer-fsr.js +++ /dev/null @@ -1,15 +0,0 @@ -var fs = require('fs'); -var FSReadable = require('../fs.js'); -var rst = new FSReadable(__filename); - -rst.on('end', function() { - process.stdin.pause(); -}); - -process.stdin.setRawMode(true); -process.stdin.on('data', function() { - var c = rst.read(3); - if (!c) return; - process.stdout.write(c); -}); -process.stdin.resume(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js deleted file mode 100644 index c16eb6f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/examples/typer.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var fst = fs.createReadStream(__filename); -var Readable = require('../readable.js'); -var rst = new Readable(); -rst.wrap(fst); - -rst.on('end', function() { - process.stdin.pause(); -}); - -process.stdin.setRawMode(true); -process.stdin.on('data', function() { - var c = rst.read(3); - if (!c) return setTimeout(process.exit, 500) - process.stdout.write(c); -}); -process.stdin.resume(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch deleted file mode 100644 index 0ad71a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/float.patch +++ /dev/null @@ -1,68 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js deleted file mode 100644 index a663af8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/fs.js +++ /dev/null @@ -1,1705 +0,0 @@ -// 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. - -// Maintainers, keep in mind that octal literals are not allowed -// in strict mode. Use the decimal value and add a comment with -// the octal value. Example: -// -// var mode = 438; /* mode=0666 */ - -var util = require('util'); -var pathModule = require('path'); - -var binding = process.binding('fs'); -var constants = process.binding('constants'); -var fs = exports; -var Stream = require('stream').Stream; -var EventEmitter = require('events').EventEmitter; - -var Readable = require('./lib/_stream_readable.js'); -var Writable = require('./lib/_stream_writable.js'); - -var kMinPoolSpace = 128; -var kPoolSize = 40 * 1024; - -var O_APPEND = constants.O_APPEND || 0; -var O_CREAT = constants.O_CREAT || 0; -var O_DIRECTORY = constants.O_DIRECTORY || 0; -var O_EXCL = constants.O_EXCL || 0; -var O_NOCTTY = constants.O_NOCTTY || 0; -var O_NOFOLLOW = constants.O_NOFOLLOW || 0; -var O_RDONLY = constants.O_RDONLY || 0; -var O_RDWR = constants.O_RDWR || 0; -var O_SYMLINK = constants.O_SYMLINK || 0; -var O_SYNC = constants.O_SYNC || 0; -var O_TRUNC = constants.O_TRUNC || 0; -var O_WRONLY = constants.O_WRONLY || 0; - -var isWindows = process.platform === 'win32'; - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - if (DEBUG) { - var backtrace = new Error; - return function(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - throw err; - } - }; - } - - return function(err) { - if (err) { - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - } - }; -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -// Ensure that callbacks run in the global context. Only use this function -// for callbacks that are passed to the binding layer, callbacks that are -// invoked from JS already run in the proper scope. -function makeCallback(cb) { - if (typeof cb !== 'function') { - return rethrow(); - } - - return function() { - return cb.apply(null, arguments); - }; -} - -function assertEncoding(encoding) { - if (encoding && !Buffer.isEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -function nullCheck(path, callback) { - if (('' + path).indexOf('\u0000') !== -1) { - var er = new Error('Path must be a string without null bytes.'); - if (!callback) - throw er; - process.nextTick(function() { - callback(er); - }); - return false; - } - return true; -} - -fs.Stats = binding.Stats; - -fs.Stats.prototype._checkModeProperty = function(property) { - return ((this.mode & constants.S_IFMT) === property); -}; - -fs.Stats.prototype.isDirectory = function() { - return this._checkModeProperty(constants.S_IFDIR); -}; - -fs.Stats.prototype.isFile = function() { - return this._checkModeProperty(constants.S_IFREG); -}; - -fs.Stats.prototype.isBlockDevice = function() { - return this._checkModeProperty(constants.S_IFBLK); -}; - -fs.Stats.prototype.isCharacterDevice = function() { - return this._checkModeProperty(constants.S_IFCHR); -}; - -fs.Stats.prototype.isSymbolicLink = function() { - return this._checkModeProperty(constants.S_IFLNK); -}; - -fs.Stats.prototype.isFIFO = function() { - return this._checkModeProperty(constants.S_IFIFO); -}; - -fs.Stats.prototype.isSocket = function() { - return this._checkModeProperty(constants.S_IFSOCK); -}; - -fs.exists = function(path, callback) { - if (!nullCheck(path, cb)) return; - binding.stat(pathModule._makeLong(path), cb); - function cb(err, stats) { - if (callback) callback(err ? false : true); - } -}; - -fs.existsSync = function(path) { - try { - nullCheck(path); - binding.stat(pathModule._makeLong(path)); - return true; - } catch (e) { - return false; - } -}; - -fs.readFile = function(path, encoding_) { - var encoding = typeof(encoding_) === 'string' ? encoding_ : null; - var callback = maybeCallback(arguments[arguments.length - 1]); - - assertEncoding(encoding); - - // first, stat the file, so we know the size. - var size; - var buffer; // single buffer with file data - var buffers; // list for when size is unknown - var pos = 0; - var fd; - - fs.open(path, constants.O_RDONLY, 438 /*=0666*/, function(er, fd_) { - if (er) return callback(er); - fd = fd_; - - fs.fstat(fd, function(er, st) { - if (er) return callback(er); - size = st.size; - if (size === 0) { - // the kernel lies about many files. - // Go ahead and try to read some bytes. - buffers = []; - return read(); - } - - buffer = new Buffer(size); - read(); - }); - }); - - function read() { - if (size === 0) { - buffer = new Buffer(8192); - fs.read(fd, buffer, 0, 8192, -1, afterRead); - } else { - fs.read(fd, buffer, pos, size - pos, -1, afterRead); - } - } - - function afterRead(er, bytesRead) { - if (er) { - return fs.close(fd, function(er2) { - return callback(er); - }); - } - - if (bytesRead === 0) { - return close(); - } - - pos += bytesRead; - if (size !== 0) { - if (pos === size) close(); - else read(); - } else { - // unknown size, just read until we don't get bytes. - buffers.push(buffer.slice(0, bytesRead)); - read(); - } - } - - function close() { - fs.close(fd, function(er) { - if (size === 0) { - // collected the data into the buffers list. - buffer = Buffer.concat(buffers, pos); - } else if (pos < size) { - buffer = buffer.slice(0, pos); - } - - if (encoding) buffer = buffer.toString(encoding); - return callback(er, buffer); - }); - } -}; - -fs.readFileSync = function(path, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, constants.O_RDONLY, 438 /*=0666*/); - - var size; - var threw = true; - try { - size = fs.fstatSync(fd).size; - threw = false; - } finally { - if (threw) fs.closeSync(fd); - } - - var pos = 0; - var buffer; // single buffer with file data - var buffers; // list for when size is unknown - - if (size === 0) { - buffers = []; - } else { - buffer = new Buffer(size); - } - - var done = false; - while (!done) { - var threw = true; - try { - if (size !== 0) { - var bytesRead = fs.readSync(fd, buffer, pos, size - pos); - } else { - // the kernel lies about many files. - // Go ahead and try to read some bytes. - buffer = new Buffer(8192); - var bytesRead = fs.readSync(fd, buffer, 0, 8192); - if (bytesRead) { - buffers.push(buffer.slice(0, bytesRead)); - } - } - threw = false; - } finally { - if (threw) fs.closeSync(fd); - } - - pos += bytesRead; - done = (bytesRead === 0) || (size !== 0 && pos >= size); - } - - fs.closeSync(fd); - - if (size === 0) { - // data was collected into the buffers list. - buffer = Buffer.concat(buffers, pos); - } else if (pos < size) { - buffer = buffer.slice(0, pos); - } - - if (encoding) buffer = buffer.toString(encoding); - return buffer; -}; - - -// Used by binding.open and friends -function stringToFlags(flag) { - // Only mess with strings - if (typeof flag !== 'string') { - return flag; - } - - // O_EXCL is mandated by POSIX, Windows supports it too. - // Let's add a check anyway, just in case. - if (!O_EXCL && ~flag.indexOf('x')) { - throw errnoException('ENOSYS', 'fs.open(O_EXCL)'); - } - - switch (flag) { - case 'r' : return O_RDONLY; - case 'rs' : return O_RDONLY | O_SYNC; - case 'r+' : return O_RDWR; - case 'rs+' : return O_RDWR | O_SYNC; - - case 'w' : return O_TRUNC | O_CREAT | O_WRONLY; - case 'wx' : // fall through - case 'xw' : return O_TRUNC | O_CREAT | O_WRONLY | O_EXCL; - - case 'w+' : return O_TRUNC | O_CREAT | O_RDWR; - case 'wx+': // fall through - case 'xw+': return O_TRUNC | O_CREAT | O_RDWR | O_EXCL; - - case 'a' : return O_APPEND | O_CREAT | O_WRONLY; - case 'ax' : // fall through - case 'xa' : return O_APPEND | O_CREAT | O_WRONLY | O_EXCL; - - case 'a+' : return O_APPEND | O_CREAT | O_RDWR; - case 'ax+': // fall through - case 'xa+': return O_APPEND | O_CREAT | O_RDWR | O_EXCL; - } - - throw new Error('Unknown file open flag: ' + flag); -} - -// exported but hidden, only used by test/simple/test-fs-open-flags.js -Object.defineProperty(exports, '_stringToFlags', { - enumerable: false, - value: stringToFlags -}); - - -// Yes, the follow could be easily DRYed up but I provide the explicit -// list to make the arguments clear. - -fs.close = function(fd, callback) { - binding.close(fd, makeCallback(callback)); -}; - -fs.closeSync = function(fd) { - return binding.close(fd); -}; - -function modeNum(m, def) { - switch (typeof m) { - case 'number': return m; - case 'string': return parseInt(m, 8); - default: - if (def) { - return modeNum(def); - } else { - return undefined; - } - } -} - -fs.open = function(path, flags, mode, callback) { - callback = makeCallback(arguments[arguments.length - 1]); - mode = modeNum(mode, 438 /*=0666*/); - - if (!nullCheck(path, callback)) return; - binding.open(pathModule._makeLong(path), - stringToFlags(flags), - mode, - callback); -}; - -fs.openSync = function(path, flags, mode) { - mode = modeNum(mode, 438 /*=0666*/); - nullCheck(path); - return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); -}; - -fs.read = function(fd, buffer, offset, length, position, callback) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, length, position, encoding, callback) - var cb = arguments[4], - encoding = arguments[3]; - - assertEncoding(encoding); - - position = arguments[2]; - length = arguments[1]; - buffer = new Buffer(length); - offset = 0; - - callback = function(err, bytesRead) { - if (!cb) return; - - var str = (bytesRead > 0) ? buffer.toString(encoding, 0, bytesRead) : ''; - - (cb)(err, str, bytesRead); - }; - } - - function wrapper(err, bytesRead) { - // Retain a reference to buffer so that it can't be GC'ed too soon. - callback && callback(err, bytesRead || 0, buffer); - } - - binding.read(fd, buffer, offset, length, position, wrapper); -}; - -fs.readSync = function(fd, buffer, offset, length, position) { - var legacy = false; - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, length, position, encoding, callback) - legacy = true; - var encoding = arguments[3]; - - assertEncoding(encoding); - - position = arguments[2]; - length = arguments[1]; - buffer = new Buffer(length); - - offset = 0; - } - - var r = binding.read(fd, buffer, offset, length, position); - if (!legacy) { - return r; - } - - var str = (r > 0) ? buffer.toString(encoding, 0, r) : ''; - return [str, r]; -}; - -fs.write = function(fd, buffer, offset, length, position, callback) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, data, position, encoding, callback) - callback = arguments[4]; - position = arguments[2]; - assertEncoding(arguments[3]); - - buffer = new Buffer('' + arguments[1], arguments[3]); - offset = 0; - length = buffer.length; - } - - if (!length) { - if (typeof callback == 'function') { - process.nextTick(function() { - callback(undefined, 0); - }); - } - return; - } - - callback = maybeCallback(callback); - - function wrapper(err, written) { - // Retain a reference to buffer so that it can't be GC'ed too soon. - callback(err, written || 0, buffer); - } - - binding.write(fd, buffer, offset, length, position, wrapper); -}; - -fs.writeSync = function(fd, buffer, offset, length, position) { - if (!Buffer.isBuffer(buffer)) { - // legacy string interface (fd, data, position, encoding) - position = arguments[2]; - assertEncoding(arguments[3]); - - buffer = new Buffer('' + arguments[1], arguments[3]); - offset = 0; - length = buffer.length; - } - if (!length) return 0; - - return binding.write(fd, buffer, offset, length, position); -}; - -fs.rename = function(oldPath, newPath, callback) { - callback = makeCallback(callback); - if (!nullCheck(oldPath, callback)) return; - if (!nullCheck(newPath, callback)) return; - binding.rename(pathModule._makeLong(oldPath), - pathModule._makeLong(newPath), - callback); -}; - -fs.renameSync = function(oldPath, newPath) { - nullCheck(oldPath); - nullCheck(newPath); - return binding.rename(pathModule._makeLong(oldPath), - pathModule._makeLong(newPath)); -}; - -fs.truncate = function(path, len, callback) { - if (typeof path === 'number') { - // legacy - return fs.ftruncate(path, len, callback); - } - if (typeof len === 'function') { - callback = len; - len = 0; - } else if (typeof len === 'undefined') { - len = 0; - } - callback = maybeCallback(callback); - fs.open(path, 'w', function(er, fd) { - if (er) return callback(er); - binding.ftruncate(fd, len, function(er) { - fs.close(fd, function(er2) { - callback(er || er2); - }); - }); - }); -}; - -fs.truncateSync = function(path, len) { - if (typeof path === 'number') { - // legacy - return fs.ftruncateSync(path, len); - } - if (typeof len === 'undefined') { - len = 0; - } - // allow error to be thrown, but still close fd. - var fd = fs.openSync(path, 'w'); - try { - var ret = fs.ftruncateSync(fd, len); - } finally { - fs.closeSync(fd); - } - return ret; -}; - -fs.ftruncate = function(fd, len, callback) { - if (typeof len === 'function') { - callback = len; - len = 0; - } else if (typeof len === 'undefined') { - len = 0; - } - binding.ftruncate(fd, len, makeCallback(callback)); -}; - -fs.ftruncateSync = function(fd, len) { - if (typeof len === 'undefined') { - len = 0; - } - return binding.ftruncate(fd, len); -}; - -fs.rmdir = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.rmdir(pathModule._makeLong(path), callback); -}; - -fs.rmdirSync = function(path) { - nullCheck(path); - return binding.rmdir(pathModule._makeLong(path)); -}; - -fs.fdatasync = function(fd, callback) { - binding.fdatasync(fd, makeCallback(callback)); -}; - -fs.fdatasyncSync = function(fd) { - return binding.fdatasync(fd); -}; - -fs.fsync = function(fd, callback) { - binding.fsync(fd, makeCallback(callback)); -}; - -fs.fsyncSync = function(fd) { - return binding.fsync(fd); -}; - -fs.mkdir = function(path, mode, callback) { - if (typeof mode === 'function') callback = mode; - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.mkdir(pathModule._makeLong(path), - modeNum(mode, 511 /*=0777*/), - callback); -}; - -fs.mkdirSync = function(path, mode) { - nullCheck(path); - return binding.mkdir(pathModule._makeLong(path), - modeNum(mode, 511 /*=0777*/)); -}; - -fs.sendfile = function(outFd, inFd, inOffset, length, callback) { - binding.sendfile(outFd, inFd, inOffset, length, makeCallback(callback)); -}; - -fs.sendfileSync = function(outFd, inFd, inOffset, length) { - return binding.sendfile(outFd, inFd, inOffset, length); -}; - -fs.readdir = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.readdir(pathModule._makeLong(path), callback); -}; - -fs.readdirSync = function(path) { - nullCheck(path); - return binding.readdir(pathModule._makeLong(path)); -}; - -fs.fstat = function(fd, callback) { - binding.fstat(fd, makeCallback(callback)); -}; - -fs.lstat = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.lstat(pathModule._makeLong(path), callback); -}; - -fs.stat = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.stat(pathModule._makeLong(path), callback); -}; - -fs.fstatSync = function(fd) { - return binding.fstat(fd); -}; - -fs.lstatSync = function(path) { - nullCheck(path); - return binding.lstat(pathModule._makeLong(path)); -}; - -fs.statSync = function(path) { - nullCheck(path); - return binding.stat(pathModule._makeLong(path)); -}; - -fs.readlink = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.readlink(pathModule._makeLong(path), callback); -}; - -fs.readlinkSync = function(path) { - nullCheck(path); - return binding.readlink(pathModule._makeLong(path)); -}; - -function preprocessSymlinkDestination(path, type) { - if (!isWindows) { - // No preprocessing is needed on Unix. - return path; - } else if (type === 'junction') { - // Junctions paths need to be absolute and \\?\-prefixed. - return pathModule._makeLong(path); - } else { - // Windows symlinks don't tolerate forward slashes. - return ('' + path).replace(/\//g, '\\'); - } -} - -fs.symlink = function(destination, path, type_, callback) { - var type = (typeof type_ === 'string' ? type_ : null); - var callback = makeCallback(arguments[arguments.length - 1]); - - if (!nullCheck(destination, callback)) return; - if (!nullCheck(path, callback)) return; - - binding.symlink(preprocessSymlinkDestination(destination, type), - pathModule._makeLong(path), - type, - callback); -}; - -fs.symlinkSync = function(destination, path, type) { - type = (typeof type === 'string' ? type : null); - - nullCheck(destination); - nullCheck(path); - - return binding.symlink(preprocessSymlinkDestination(destination, type), - pathModule._makeLong(path), - type); -}; - -fs.link = function(srcpath, dstpath, callback) { - callback = makeCallback(callback); - if (!nullCheck(srcpath, callback)) return; - if (!nullCheck(dstpath, callback)) return; - - binding.link(pathModule._makeLong(srcpath), - pathModule._makeLong(dstpath), - callback); -}; - -fs.linkSync = function(srcpath, dstpath) { - nullCheck(srcpath); - nullCheck(dstpath); - return binding.link(pathModule._makeLong(srcpath), - pathModule._makeLong(dstpath)); -}; - -fs.unlink = function(path, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.unlink(pathModule._makeLong(path), callback); -}; - -fs.unlinkSync = function(path) { - nullCheck(path); - return binding.unlink(pathModule._makeLong(path)); -}; - -fs.fchmod = function(fd, mode, callback) { - binding.fchmod(fd, modeNum(mode), makeCallback(callback)); -}; - -fs.fchmodSync = function(fd, mode) { - return binding.fchmod(fd, modeNum(mode)); -}; - -if (constants.hasOwnProperty('O_SYMLINK')) { - fs.lchmod = function(path, mode, callback) { - callback = maybeCallback(callback); - fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, 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); - - // 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; - }; -} - - -fs.chmod = function(path, mode, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.chmod(pathModule._makeLong(path), - modeNum(mode), - callback); -}; - -fs.chmodSync = function(path, mode) { - nullCheck(path); - return binding.chmod(pathModule._makeLong(path), modeNum(mode)); -}; - -if (constants.hasOwnProperty('O_SYMLINK')) { - fs.lchown = function(path, uid, gid, callback) { - callback = maybeCallback(callback); - fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, function(err, fd) { - if (err) { - callback(err); - return; - } - fs.fchown(fd, uid, gid, callback); - }); - }; - - fs.lchownSync = function(path, uid, gid) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK); - return fs.fchownSync(fd, uid, gid); - }; -} - -fs.fchown = function(fd, uid, gid, callback) { - binding.fchown(fd, uid, gid, makeCallback(callback)); -}; - -fs.fchownSync = function(fd, uid, gid) { - return binding.fchown(fd, uid, gid); -}; - -fs.chown = function(path, uid, gid, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.chown(pathModule._makeLong(path), uid, gid, callback); -}; - -fs.chownSync = function(path, uid, gid) { - nullCheck(path); - return binding.chown(pathModule._makeLong(path), uid, gid); -}; - -// converts Date or number to a fractional UNIX timestamp -function toUnixTimestamp(time) { - if (typeof time == 'number') { - return time; - } - if (time instanceof Date) { - // convert to 123.456 UNIX timestamp - return time.getTime() / 1000; - } - throw new Error('Cannot parse time: ' + time); -} - -// exported for unit tests, not for public consumption -fs._toUnixTimestamp = toUnixTimestamp; - -fs.utimes = function(path, atime, mtime, callback) { - callback = makeCallback(callback); - if (!nullCheck(path, callback)) return; - binding.utimes(pathModule._makeLong(path), - toUnixTimestamp(atime), - toUnixTimestamp(mtime), - callback); -}; - -fs.utimesSync = function(path, atime, mtime) { - nullCheck(path); - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.utimes(pathModule._makeLong(path), atime, mtime); -}; - -fs.futimes = function(fd, atime, mtime, callback) { - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.futimes(fd, atime, mtime, makeCallback(callback)); -}; - -fs.futimesSync = function(fd, atime, mtime) { - atime = toUnixTimestamp(atime); - mtime = toUnixTimestamp(mtime); - binding.futimes(fd, atime, mtime); -}; - -function writeAll(fd, buffer, offset, length, position, callback) { - callback = maybeCallback(arguments[arguments.length - 1]); - - // write(fd, buffer, offset, length, position, callback) - fs.write(fd, buffer, offset, length, position, function(writeErr, written) { - if (writeErr) { - fs.close(fd, function() { - if (callback) callback(writeErr); - }); - } else { - if (written === length) { - fs.close(fd, callback); - } else { - offset += written; - length -= written; - position += written; - writeAll(fd, buffer, offset, length, position, callback); - } - } - }); -} - -fs.writeFile = function(path, data, encoding_, callback) { - var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8'); - assertEncoding(encoding); - - callback = maybeCallback(arguments[arguments.length - 1]); - fs.open(path, 'w', 438 /*=0666*/, function(openErr, fd) { - if (openErr) { - if (callback) callback(openErr); - } else { - var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data, - encoding); - writeAll(fd, buffer, 0, buffer.length, 0, callback); - } - }); -}; - -fs.writeFileSync = function(path, data, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, 'w'); - if (!Buffer.isBuffer(data)) { - data = new Buffer('' + data, encoding || 'utf8'); - } - var written = 0; - var length = data.length; - try { - while (written < length) { - written += fs.writeSync(fd, data, written, length - written, written); - } - } finally { - fs.closeSync(fd); - } -}; - -fs.appendFile = function(path, data, encoding_, callback) { - var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8'); - assertEncoding(encoding); - - callback = maybeCallback(arguments[arguments.length - 1]); - - fs.open(path, 'a', 438 /*=0666*/, function(err, fd) { - if (err) return callback(err); - var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data, encoding); - writeAll(fd, buffer, 0, buffer.length, null, callback); - }); -}; - -fs.appendFileSync = function(path, data, encoding) { - assertEncoding(encoding); - - var fd = fs.openSync(path, 'a'); - if (!Buffer.isBuffer(data)) { - data = new Buffer('' + data, encoding || 'utf8'); - } - var written = 0; - var position = null; - var length = data.length; - - try { - while (written < length) { - written += fs.writeSync(fd, data, written, length - written, position); - position += written; // XXX not safe with multiple concurrent writers? - } - } finally { - fs.closeSync(fd); - } -}; - -function errnoException(errorno, syscall) { - // TODO make this more compatible with ErrnoException from src/node.cc - // Once all of Node is using this function the ErrnoException from - // src/node.cc should be removed. - var e = new Error(syscall + ' ' + errorno); - e.errno = e.code = errorno; - e.syscall = syscall; - return e; -} - - -function FSWatcher() { - EventEmitter.call(this); - - var self = this; - var FSEvent = process.binding('fs_event_wrap').FSEvent; - this._handle = new FSEvent(); - this._handle.owner = this; - - this._handle.onchange = function(status, event, filename) { - if (status) { - self._handle.close(); - self.emit('error', errnoException(errno, 'watch')); - } else { - self.emit('change', event, filename); - } - }; -} -util.inherits(FSWatcher, EventEmitter); - -FSWatcher.prototype.start = function(filename, persistent) { - nullCheck(filename); - var r = this._handle.start(pathModule._makeLong(filename), persistent); - - if (r) { - this._handle.close(); - throw errnoException(errno, 'watch'); - } -}; - -FSWatcher.prototype.close = function() { - this._handle.close(); -}; - -fs.watch = function(filename) { - nullCheck(filename); - var watcher; - var options; - var listener; - - if ('object' == typeof arguments[1]) { - options = arguments[1]; - listener = arguments[2]; - } else { - options = {}; - listener = arguments[1]; - } - - if (options.persistent === undefined) options.persistent = true; - - watcher = new FSWatcher(); - watcher.start(filename, options.persistent); - - if (listener) { - watcher.addListener('change', listener); - } - - return watcher; -}; - - -// Stat Change Watchers - -function StatWatcher() { - EventEmitter.call(this); - - var self = this; - this._handle = new binding.StatWatcher(); - - // uv_fs_poll is a little more powerful than ev_stat but we curb it for - // the sake of backwards compatibility - var oldStatus = -1; - - this._handle.onchange = function(current, previous, newStatus) { - if (oldStatus === -1 && - newStatus === -1 && - current.nlink === previous.nlink) return; - - oldStatus = newStatus; - self.emit('change', current, previous); - }; - - this._handle.onstop = function() { - self.emit('stop'); - }; -} -util.inherits(StatWatcher, EventEmitter); - - -StatWatcher.prototype.start = function(filename, persistent, interval) { - nullCheck(filename); - this._handle.start(pathModule._makeLong(filename), persistent, interval); -}; - - -StatWatcher.prototype.stop = function() { - this._handle.stop(); -}; - - -var statWatchers = {}; -function inStatWatchers(filename) { - return Object.prototype.hasOwnProperty.call(statWatchers, filename) && - statWatchers[filename]; -} - - -fs.watchFile = function(filename) { - nullCheck(filename); - var stat; - var listener; - - var options = { - // Poll interval in milliseconds. 5007 is what libev used to use. It's - // a little on the slow side but let's stick with it for now to keep - // behavioral changes to a minimum. - interval: 5007, - persistent: true - }; - - if ('object' == typeof arguments[1]) { - options = util._extend(options, arguments[1]); - listener = arguments[2]; - } else { - listener = arguments[1]; - } - - if (!listener) { - throw new Error('watchFile requires a listener function'); - } - - if (inStatWatchers(filename)) { - stat = statWatchers[filename]; - } else { - stat = statWatchers[filename] = new StatWatcher(); - stat.start(filename, options.persistent, options.interval); - } - stat.addListener('change', listener); - return stat; -}; - -fs.unwatchFile = function(filename, listener) { - nullCheck(filename); - if (!inStatWatchers(filename)) return; - - var stat = statWatchers[filename]; - - if (typeof listener === 'function') { - stat.removeListener('change', listener); - } else { - stat.removeAllListeners('change'); - } - - if (stat.listeners('change').length === 0) { - stat.stop(); - statWatchers[filename] = undefined; - } -}; - -// Realpath -// Not using realpath(2) because it's bad. -// See: http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -fs.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -fs.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; - - - -var pool; - -function allocNewPool() { - pool = new Buffer(kPoolSize); - pool.used = 0; -} - - - -fs.createReadStream = function(path, options) { - return new ReadStream(path, options); -}; - -util.inherits(ReadStream, Readable); -fs.ReadStream = ReadStream; - -function ReadStream(path, options) { - if (!(this instanceof ReadStream)) - return new ReadStream(path, options); - - // a little bit bigger buffer and water marks by default - options = util._extend({ - bufferSize: 64 * 1024, - lowWaterMark: 16 * 1024, - highWaterMark: 64 * 1024 - }, options || {}); - - Readable.call(this, options); - - this.path = path; - this.fd = options.hasOwnProperty('fd') ? options.fd : null; - this.flags = options.hasOwnProperty('flags') ? options.flags : 'r'; - this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ - - this.start = options.hasOwnProperty('start') ? options.start : undefined; - this.end = options.hasOwnProperty('start') ? options.end : undefined; - this.pos = undefined; - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (typeof this.fd !== 'number') - this.open(); - - this.on('end', function() { - this.destroy(); - }); -} - -fs.FileReadStream = fs.ReadStream; // support the legacy name - -ReadStream.prototype.open = function() { - var self = this; - fs.open(this.path, this.flags, this.mode, function(er, fd) { - if (er) { - self.destroy(); - self.emit('error', er); - return; - } - - self.fd = fd; - self.emit('open', fd); - // start the flow of data. - self.read(); - }); -}; - -ReadStream.prototype._read = function(n, cb) { - if (typeof this.fd !== 'number') - return this.once('open', function() { - this._read(n, cb); - }); - - if (this.destroyed) - return; - - if (!pool || pool.length - pool.used < kMinPoolSpace) { - // discard the old pool. Can't add to the free list because - // users might have refernces to slices on it. - pool = null; - allocNewPool(); - } - - // Grab another reference to the pool in the case that while we're - // in the thread pool another read() finishes up the pool, and - // allocates a new one. - var thisPool = pool; - var toRead = Math.min(pool.length - pool.used, n); - var start = pool.used; - - if (this.pos !== undefined) - toRead = Math.min(this.end - this.pos + 1, toRead); - - // already read everything we were supposed to read! - // treat as EOF. - if (toRead <= 0) - return cb(); - - // the actual read. - var self = this; - fs.read(this.fd, pool, pool.used, toRead, this.pos, onread); - - // move the pool positions, and internal position for reading. - if (this.pos !== undefined) - this.pos += toRead; - pool.used += toRead; - - function onread(er, bytesRead) { - if (er) { - self.destroy(); - return cb(er); - } - - var b = null; - if (bytesRead > 0) - b = thisPool.slice(start, start + bytesRead); - - cb(null, b); - } -}; - - -ReadStream.prototype.destroy = function() { - if (this.destroyed) - return; - this.destroyed = true; - if ('number' === typeof this.fd) - this.close(); -}; - - -ReadStream.prototype.close = function(cb) { - if (cb) - this.once('close', cb); - if (this.closed || 'number' !== typeof this.fd) { - if ('number' !== typeof this.fd) - this.once('open', close); - return process.nextTick(this.emit.bind(this, 'close')); - } - this.closed = true; - var self = this; - close(); - - function close() { - fs.close(self.fd, function(er) { - if (er) - self.emit('error', er); - else - self.emit('close'); - }); - } -}; - - - - -fs.createWriteStream = function(path, options) { - return new WriteStream(path, options); -}; - -util.inherits(WriteStream, Writable); -fs.WriteStream = WriteStream; -function WriteStream(path, options) { - if (!(this instanceof WriteStream)) - return new WriteStream(path, options); - - // a little bit bigger buffer and water marks by default - options = util._extend({ - bufferSize: 64 * 1024, - lowWaterMark: 16 * 1024, - highWaterMark: 64 * 1024 - }, options || {}); - - Writable.call(this, options); - - this.path = path; - this.fd = null; - - this.fd = options.hasOwnProperty('fd') ? options.fd : null; - this.flags = options.hasOwnProperty('flags') ? options.flags : 'w'; - this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ - - this.start = options.hasOwnProperty('start') ? options.start : undefined; - this.pos = undefined; - this.bytesWritten = 0; - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - if ('number' !== typeof this.fd) - this.open(); - - // dispose on finish. - this.once('finish', this.close); -} - -fs.FileWriteStream = fs.WriteStream; // support the legacy name - - -WriteStream.prototype.open = function() { - fs.open(this.path, this.flags, this.mode, function(er, fd) { - if (er) { - this.destroy(); - this.emit('error', er); - return; - } - - this.fd = fd; - this.emit('open', fd); - }.bind(this)); -}; - - -WriteStream.prototype._write = function(data, cb) { - if (!Buffer.isBuffer(data)) - return this.emit('error', new Error('Invalid data')); - - if (typeof this.fd !== 'number') - return this.once('open', this._write.bind(this, data, cb)); - - fs.write(this.fd, data, 0, data.length, this.pos, function(er, bytes) { - if (er) { - this.destroy(); - return cb(er); - } - this.bytesWritten += bytes; - cb(); - }.bind(this)); - - if (this.pos !== undefined) - this.pos += data.length; -}; - - -WriteStream.prototype.destroy = ReadStream.prototype.destroy; -WriteStream.prototype.close = ReadStream.prototype.close; - -// There is no shutdown() for files. -WriteStream.prototype.destroySoon = WriteStream.prototype.end; - - -// SyncWriteStream is internal. DO NOT USE. -// Temporary hack for process.stdout and process.stderr when piped to files. -function SyncWriteStream(fd) { - Stream.call(this); - - this.fd = fd; - this.writable = true; - this.readable = false; -} - -util.inherits(SyncWriteStream, Stream); - - -// Export -fs.SyncWriteStream = SyncWriteStream; - - -SyncWriteStream.prototype.write = function(data, arg1, arg2) { - var encoding, cb; - - // parse arguments - if (arg1) { - if (typeof arg1 === 'string') { - encoding = arg1; - cb = arg2; - } else if (typeof arg1 === 'function') { - cb = arg1; - } else { - throw new Error('bad arg'); - } - } - assertEncoding(encoding); - - // Change strings to buffers. SLOW - if (typeof data == 'string') { - data = new Buffer(data, encoding); - } - - fs.writeSync(this.fd, data, 0, data.length); - - if (cb) { - process.nextTick(cb); - } - - return true; -}; - - -SyncWriteStream.prototype.end = function(data, arg1, arg2) { - if (data) { - this.write(data, arg1, arg2); - } - this.destroy(); -}; - - -SyncWriteStream.prototype.destroy = function() { - fs.closeSync(this.fd); - this.fd = null; - this.emit('close'); - return true; -}; - -SyncWriteStream.prototype.destroySoon = SyncWriteStream.prototype.destroy; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a2e0d8e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,69 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 330c247..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 3c9da08..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,927 +0,0 @@ -// 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.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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index f08b05e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,205 +0,0 @@ -// 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 && 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 56ca47d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,367 +0,0 @@ -// 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); - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - state.needDrain = !ret; - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json deleted file mode 100644 index 76f822e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "readable-stream", - "version": "1.0.17", - "description": "An exploration of a new kind of readable streams for Node.js", - "main": "readable.js", - "dependencies": {}, - "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" - }, - "_id": "readable-stream@1.0.17", - "_from": "readable-stream@~1.0.2" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js deleted file mode 100644 index 4d1ddfc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,6 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js deleted file mode 100644 index 1dec2e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/common.js +++ /dev/null @@ -1,191 +0,0 @@ -// 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 path = require('path'); -var assert = require('assert'); - -exports.testDir = path.dirname(__filename); -exports.fixturesDir = path.join(exports.testDir, 'fixtures'); -exports.libDir = path.join(exports.testDir, '../lib'); -exports.tmpDir = path.join(exports.testDir, 'tmp'); -exports.PORT = 12346; - -if (process.platform === 'win32') { - exports.PIPE = '\\\\.\\pipe\\libuv-test'; -} else { - exports.PIPE = exports.tmpDir + '/test.sock'; -} - -var util = require('util'); -for (var i in util) exports[i] = util[i]; -//for (var i in exports) global[i] = exports[i]; - -function protoCtrChain(o) { - var result = []; - for (; o; o = o.__proto__) { result.push(o.constructor); } - return result.join(); -} - -exports.indirectInstanceOf = function(obj, cls) { - if (obj instanceof cls) { return true; } - var clsChain = protoCtrChain(cls.prototype); - var objChain = protoCtrChain(obj); - return objChain.slice(-clsChain.length) === clsChain; -}; - - -exports.ddCommand = function(filename, kilobytes) { - if (process.platform === 'win32') { - var p = path.resolve(exports.fixturesDir, 'create-file.js'); - return '"' + process.argv[0] + '" "' + p + '" "' + - filename + '" ' + (kilobytes * 1024); - } else { - return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes; - } -}; - - -exports.spawnPwd = function(options) { - var spawn = require('child_process').spawn; - - if (process.platform === 'win32') { - return spawn('cmd.exe', ['/c', 'cd'], options); - } else { - return spawn('pwd', [], options); - } -}; - - -// Turn this off if the test should not check for global leaks. -exports.globalCheck = true; - -process.on('exit', function() { - if (!exports.globalCheck) return; - var knownGlobals = [setTimeout, - setInterval, - global.setImmediate, - clearTimeout, - clearInterval, - global.clearImmediate, - console, - Buffer, - process, - global]; - - if (global.errno) { - knownGlobals.push(errno); - } - - if (global.gc) { - knownGlobals.push(gc); - } - - if (global.DTRACE_HTTP_SERVER_RESPONSE) { - knownGlobals.push(DTRACE_HTTP_SERVER_RESPONSE); - knownGlobals.push(DTRACE_HTTP_SERVER_REQUEST); - knownGlobals.push(DTRACE_HTTP_CLIENT_RESPONSE); - knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST); - knownGlobals.push(DTRACE_NET_STREAM_END); - knownGlobals.push(DTRACE_NET_SERVER_CONNECTION); - knownGlobals.push(DTRACE_NET_SOCKET_READ); - knownGlobals.push(DTRACE_NET_SOCKET_WRITE); - } - if (global.COUNTER_NET_SERVER_CONNECTION) { - knownGlobals.push(COUNTER_NET_SERVER_CONNECTION); - knownGlobals.push(COUNTER_NET_SERVER_CONNECTION_CLOSE); - knownGlobals.push(COUNTER_HTTP_SERVER_REQUEST); - knownGlobals.push(COUNTER_HTTP_SERVER_RESPONSE); - knownGlobals.push(COUNTER_HTTP_CLIENT_REQUEST); - knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE); - } - - if (global.ArrayBuffer) { - knownGlobals.push(ArrayBuffer); - knownGlobals.push(Int8Array); - knownGlobals.push(Uint8Array); - knownGlobals.push(Uint8ClampedArray); - knownGlobals.push(Int16Array); - knownGlobals.push(Uint16Array); - knownGlobals.push(Int32Array); - knownGlobals.push(Uint32Array); - knownGlobals.push(Float32Array); - knownGlobals.push(Float64Array); - knownGlobals.push(DataView); - } - - for (var x in global) { - var found = false; - - for (var y in knownGlobals) { - if (global[x] === knownGlobals[y]) { - found = true; - break; - } - } - - if (!found) { - console.error('Unknown global: %s', x); - assert.ok(false, 'Unknown global found'); - } - } -}); - - -var mustCallChecks = []; - - -function runCallChecks() { - var failed = mustCallChecks.filter(function(context) { - return context.actual !== context.expected; - }); - - failed.forEach(function(context) { - console.log('Mismatched %s function calls. Expected %d, actual %d.', - context.name, - context.expected, - context.actual); - console.log(context.stack.split('\n').slice(2).join('\n')); - }); - - if (failed.length) process.exit(1); -} - - -exports.mustCall = function(fn, expected) { - if (typeof expected !== 'number') expected = 1; - - var context = { - expected: expected, - actual: 0, - stack: (new Error).stack, - name: fn.name || '' - }; - - // add the exit listener only once to avoid listener leak warnings - if (mustCallChecks.length === 0) process.on('exit', runCallChecks); - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt deleted file mode 100644 index c6a9d2f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/fixtures/x1024.txt +++ /dev/null @@ -1 +0,0 @@ -xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js deleted file mode 100644 index edc3811..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-basic.js +++ /dev/null @@ -1,475 +0,0 @@ -// 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 common = require('../common.js'); -var R = require('../../lib/_stream_readable'); -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - -function TestReader(n) { - R.apply(this); - this._buffer = new Buffer(n || 100); - this._buffer.fill('x'); - this._pos = 0; - this._bufs = 10; -} - -util.inherits(TestReader, R); - -TestReader.prototype.read = function(n) { - if (n === 0) return null; - var max = this._buffer.length - this._pos; - n = n || max; - n = Math.max(n, 0); - var toRead = Math.min(n, max); - if (toRead === 0) { - // simulate the read buffer filling up with some more bytes some time - // in the future. - setTimeout(function() { - this._pos = 0; - this._bufs -= 1; - if (this._bufs <= 0) { - // read them all! - if (!this.ended) { - this.emit('end'); - this.ended = true; - } - } else { - this.emit('readable'); - } - }.bind(this), 10); - return null; - } - - var ret = this._buffer.slice(this._pos, this._pos + toRead); - this._pos += toRead; - return ret; -}; - -///// - -function TestWriter() { - EE.apply(this); - this.received = []; - this.flush = false; -} - -util.inherits(TestWriter, EE); - -TestWriter.prototype.write = function(c) { - this.received.push(c.toString()); - this.emit('write', c); - return true; -}; - -TestWriter.prototype.end = function(c) { - if (c) this.write(c); - this.emit('end', this.received); -}; - -//////// - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - ok: assert, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - - -test('a most basic test', function(t) { - var r = new TestReader(20); - - var reads = []; - var expect = [ 'x', - 'xx', - 'xxx', - 'xxxx', - 'xxxxx', - 'xxxxx', - 'xxxxxxxx', - 'xxxxxxxxx', - 'xxx', - 'xxxxxxxxxxxx', - 'xxxxxxxx', - 'xxxxxxxxxxxxxxx', - 'xxxxx', - 'xxxxxxxxxxxxxxxxxx', - 'xx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx', - 'xxxxxxxxxxxxxxxxxxxx' ]; - - r.on('end', function() { - t.same(reads, expect); - t.end(); - }); - - var readSize = 1; - function flow() { - var res; - while (null !== (res = r.read(readSize++))) { - reads.push(res.toString()); - } - r.once('readable', flow); - } - - flow(); -}); - -test('pipe', function(t) { - var r = new TestReader(5); - - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ] - - var w = new TestWriter; - var flush = true; - - w.on('end', function(received) { - t.same(received, expect); - t.end(); - }); - - r.pipe(w); -}); - - - -[1,2,3,4,5,6,7,8,9].forEach(function(SPLIT) { - test('unpipe', function(t) { - var r = new TestReader(5); - - // unpipe after 3 writes, then write to another stream instead. - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - expect = [ expect.slice(0, SPLIT), expect.slice(SPLIT) ]; - - var w = [ new TestWriter(), new TestWriter() ]; - - var writes = SPLIT; - w[0].on('write', function() { - if (--writes === 0) { - r.unpipe(); - t.equal(r._readableState.pipes, null); - w[0].end(); - r.pipe(w[1]); - t.equal(r._readableState.pipes, w[1]); - } - }); - - var ended = 0; - - var ended0 = false; - var ended1 = false; - w[0].on('end', function(results) { - t.equal(ended0, false); - ended0 = true; - ended++; - t.same(results, expect[0]); - }); - - w[1].on('end', function(results) { - t.equal(ended1, false); - ended1 = true; - ended++; - t.equal(ended, 2); - t.same(results, expect[1]); - t.end(); - }); - - r.pipe(w[0]); - }); -}); - - -// both writers should get the same exact data. -test('multipipe', function(t) { - var r = new TestReader(5); - var w = [ new TestWriter, new TestWriter ]; - - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - - var c = 2; - w[0].on('end', function(received) { - t.same(received, expect, 'first'); - if (--c === 0) t.end(); - }); - w[1].on('end', function(received) { - t.same(received, expect, 'second'); - if (--c === 0) t.end(); - }); - - r.pipe(w[0]); - r.pipe(w[1]); -}); - - -[1,2,3,4,5,6,7,8,9].forEach(function(SPLIT) { - test('multi-unpipe', function(t) { - var r = new TestReader(5); - - // unpipe after 3 writes, then write to another stream instead. - var expect = [ 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx', - 'xxxxx' ]; - expect = [ expect.slice(0, SPLIT), expect.slice(SPLIT) ]; - - var w = [ new TestWriter(), new TestWriter(), new TestWriter() ]; - - var writes = SPLIT; - w[0].on('write', function() { - if (--writes === 0) { - r.unpipe(); - w[0].end(); - r.pipe(w[1]); - } - }); - - var ended = 0; - - w[0].on('end', function(results) { - ended++; - t.same(results, expect[0]); - }); - - w[1].on('end', function(results) { - ended++; - t.equal(ended, 2); - t.same(results, expect[1]); - t.end(); - }); - - r.pipe(w[0]); - r.pipe(w[2]); - }); -}); - -test('back pressure respected', function (t) { - function noop() {} - - var r = new R({ objectMode: true }); - r._read = noop; - var counter = 0; - r.push(["one"]); - r.push(["two"]); - r.push(["three"]); - r.push(["four"]); - r.push(null); - - var w1 = new R(); - w1.write = function (chunk) { - assert.equal(chunk[0], "one"); - w1.emit("close"); - process.nextTick(function () { - r.pipe(w2); - r.pipe(w3); - }) - }; - w1.end = noop; - - r.pipe(w1); - - var expected = ["two", "two", "three", "three", "four", "four"]; - - var w2 = new R(); - w2.write = function (chunk) { - assert.equal(chunk[0], expected.shift()); - assert.equal(counter, 0); - - counter++; - - if (chunk[0] === "four") { - return true; - } - - setTimeout(function () { - counter--; - w2.emit("drain"); - }, 10); - - return false; - } - w2.end = noop; - - var w3 = new R(); - w3.write = function (chunk) { - assert.equal(chunk[0], expected.shift()); - assert.equal(counter, 1); - - counter++; - - if (chunk[0] === "four") { - return true; - } - - setTimeout(function () { - counter--; - w3.emit("drain"); - }, 50); - - return false; - }; - w3.end = function () { - assert.equal(counter, 2); - assert.equal(expected.length, 0); - t.end(); - }; -}); - -test('read(0) for ended streams', function (t) { - var r = new R(); - var written = false; - var ended = false; - r._read = function (n) {}; - - r.push(new Buffer("foo")); - r.push(null); - - var v = r.read(0); - - assert.equal(v, null); - - var w = new R(); - - w.write = function (buffer) { - written = true; - assert.equal(ended, false); - assert.equal(buffer.toString(), "foo") - }; - - w.end = function () { - ended = true; - assert.equal(written, true); - t.end(); - }; - - r.pipe(w); -}) - -test('sync _read ending', function (t) { - var r = new R(); - var called = false; - r._read = function (n) { - r.push(null); - }; - - r.once('end', function () { - called = true; - }) - - r.read(); - - process.nextTick(function () { - assert.equal(called, true); - t.end(); - }) -}); - -test('adding readable triggers data flow', function(t) { - var r = new R({ highWaterMark: 5 }); - var onReadable = false; - var readCalled = 0; - - r._read = function(n) { - if (readCalled++ === 2) - r.push(null); - else - r.push(new Buffer('asdf')); - }; - - var called = false; - r.on('readable', function() { - onReadable = true; - r.read(); - }); - - r.on('end', function() { - t.equal(readCalled, 3); - t.ok(onReadable); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js deleted file mode 100644 index 4de76b5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-compatibility.js +++ /dev/null @@ -1,50 +0,0 @@ -// 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 common = require('../common.js'); -var R = require('../../lib/_stream_readable'); -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - -var ondataCalled = 0; - -function TestReader() { - R.apply(this); - this._buffer = new Buffer(100); - this._buffer.fill('x'); - - this.on('data', function() { - ondataCalled++; - }); -} - -util.inherits(TestReader, R); - -TestReader.prototype._read = function(n) { - this.push(this._buffer); - this._buffer = new Buffer(0); -}; - -var reader = new TestReader(); -assert.equal(ondataCalled, 1); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js deleted file mode 100644 index 6a7e41e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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 common = require('../common.js'); -var stream = require('../../readable'); -var Buffer = require('buffer').Buffer; - -var r = new stream.Readable(); -r._read = function(size) { - r.push(new Buffer(size)); -}; - -var w = new stream.Writable(); -w._write = function(data, encoding, cb) { - cb(null); -}; - -r.pipe(w); - -// This might sound unrealistic, but it happens in net.js. When -// `socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which -// ends the writable side of net.Socket. -w.end(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js deleted file mode 100644 index 6da70e8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js +++ /dev/null @@ -1,82 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); - -// If everything aligns so that you do a read(n) of exactly the -// remaining buffer, then make sure that 'end' still emits. - -var READSIZE = 100; -var PUSHSIZE = 20; -var PUSHCOUNT = 1000; -var HWM = 50; - -var Readable = require('../../readable').Readable; -var r = new Readable({ - highWaterMark: HWM -}); -var rs = r._readableState; - -r._read = push; - -r.on('readable', function() { - console.error('>> readable'); - do { - console.error(' > read(%d)', READSIZE); - var ret = r.read(READSIZE); - console.error(' < %j (%d remain)', ret && ret.length, rs.length); - } while (ret && ret.length === READSIZE); - - console.error('<< after read()', - ret && ret.length, - rs.needReadable, - rs.length); -}); - -var endEmitted = false; -r.on('end', function() { - endEmitted = true; - console.error('end'); -}); - -var pushes = 0; -function push() { - if (pushes > PUSHCOUNT) - return; - - if (pushes++ === PUSHCOUNT) { - console.error(' push(EOF)'); - return r.push(null); - } - - console.error(' push #%d', pushes); - if (r.push(new Buffer(PUSHSIZE))) - setTimeout(push); -} - -// start the flow -var ret = r.read(0); - -process.on('exit', function() { - assert.equal(pushes, PUSHCOUNT + 1); - assert(endEmitted); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js deleted file mode 100644 index cd23539..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-objects.js +++ /dev/null @@ -1,348 +0,0 @@ -// 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 common = require('../common.js'); -var Readable = require('../../lib/_stream_readable'); -var Writable = require('../../lib/_stream_writable'); -var assert = require('assert'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function() { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on('exit', function() { - assert.equal(count, 0); -}); - -process.nextTick(run); - -function toArray(callback) { - var stream = new Writable({ objectMode: true }); - var list = []; - stream.write = function(chunk) { - list.push(chunk); - }; - - stream.end = function() { - callback(list); - }; - - return stream; -} - -function fromArray(list) { - var r = new Readable({ objectMode: true }); - r._read = noop; - list.forEach(function(chunk) { - r.push(chunk); - }); - r.push(null); - - return r; -} - -function noop() {} - -test('can read objects from stream', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - var v1 = r.read(); - var v2 = r.read(); - var v3 = r.read(); - - assert.deepEqual(v1, { one: '1' }); - assert.deepEqual(v2, { two: '2' }); - assert.deepEqual(v3, null); - - t.end(); -}); - -test('can pipe objects into stream', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('read(n) is ignored', function(t) { - var r = fromArray([{ one: '1'}, { two: '2' }]); - - var value = r.read(2); - - assert.deepEqual(value, { one: '1' }); - - t.end(); -}); - -test('can read objects from _read (sync)', function(t) { - var r = new Readable({ objectMode: true }); - var list = [{ one: '1'}, { two: '2' }]; - r._read = function(n) { - var item = list.shift(); - r.push(item || null); - }; - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('can read objects from _read (async)', function(t) { - var r = new Readable({ objectMode: true }); - var list = [{ one: '1'}, { two: '2' }]; - r._read = function(n) { - var item = list.shift(); - process.nextTick(function() { - r.push(item || null); - }); - }; - - r.pipe(toArray(function(list) { - assert.deepEqual(list, [ - { one: '1' }, - { two: '2' } - ]); - - t.end(); - })); -}); - -test('can read strings as objects', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - var list = ['one', 'two', 'three']; - list.forEach(function(str) { - r.push(str); - }); - r.push(null); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, list); - - t.end(); - })); -}); - -test('read(0) for object streams', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - - r.push('foobar'); - r.push(null); - - var v = r.read(0); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, ['foobar']); - - t.end(); - })); -}); - -test('falsey values', function(t) { - var r = new Readable({ - objectMode: true - }); - r._read = noop; - - r.push(false); - r.push(0); - r.push(''); - r.push(null); - - r.pipe(toArray(function(array) { - assert.deepEqual(array, [false, 0, '']); - - t.end(); - })); -}); - -test('high watermark _read', function(t) { - var r = new Readable({ - highWaterMark: 6, - objectMode: true - }); - var calls = 0; - var list = ['1', '2', '3', '4', '5', '6', '7', '8']; - - r._read = function(n) { - calls++; - }; - - list.forEach(function(c) { - r.push(c); - }); - - var v = r.read(); - - assert.equal(calls, 0); - assert.equal(v, '1'); - - var v2 = r.read(); - - assert.equal(calls, 1); - assert.equal(v2, '2'); - - t.end(); -}); - -test('high watermark push', function(t) { - var r = new Readable({ - highWaterMark: 6, - objectMode: true - }); - r._read = function(n) {}; - for (var i = 0; i < 6; i++) { - var bool = r.push(i); - assert.equal(bool, i === 5 ? false : true); - } - - t.end(); -}); - -test('can write objects to stream', function(t) { - var w = new Writable({ objectMode: true }); - - w._write = function(chunk, encoding, cb) { - assert.deepEqual(chunk, { foo: 'bar' }); - cb(); - }; - - w.on('finish', function() { - t.end(); - }); - - w.write({ foo: 'bar' }); - w.end(); -}); - -test('can write multiple objects to stream', function(t) { - var w = new Writable({ objectMode: true }); - var list = []; - - w._write = function(chunk, encoding, cb) { - list.push(chunk); - cb(); - }; - - w.on('finish', function() { - assert.deepEqual(list, [0, 1, 2, 3, 4]); - - t.end(); - }); - - w.write(0); - w.write(1); - w.write(2); - w.write(3); - w.write(4); - w.end(); -}); - -test('can write strings as objects', function(t) { - var w = new Writable({ - objectMode: true - }); - var list = []; - - w._write = function(chunk, encoding, cb) { - list.push(chunk); - process.nextTick(cb); - }; - - w.on('finish', function() { - assert.deepEqual(list, ['0', '1', '2', '3', '4']); - - t.end(); - }); - - w.write('0'); - w.write('1'); - w.write('2'); - w.write('3'); - w.write('4'); - w.end(); -}); - -test('buffers finish until cb is called', function(t) { - var w = new Writable({ - objectMode: true - }); - var called = false; - - w._write = function(chunk, encoding, cb) { - assert.equal(chunk, 'foo'); - - process.nextTick(function() { - called = true; - cb(); - }); - }; - - w.on('finish', function() { - assert.equal(called, true); - - t.end(); - }); - - w.write('foo'); - w.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js deleted file mode 100644 index 823dae2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js +++ /dev/null @@ -1,105 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); -var stream = require('../../readable'); - -(function testErrorListenerCatches() { - var count = 1000; - - var source = new stream.Readable(); - source._read = function(n) { - n = Math.min(count, n); - count -= n; - source.push(new Buffer(n)); - }; - - var unpipedDest; - source.unpipe = function(dest) { - unpipedDest = dest; - stream.Readable.prototype.unpipe.call(this, dest); - }; - - var dest = new stream.Writable(); - dest._write = function(chunk, encoding, cb) { - cb(); - }; - - source.pipe(dest); - - var gotErr = null; - dest.on('error', function(err) { - gotErr = err; - }); - - var unpipedSource; - dest.on('unpipe', function(src) { - unpipedSource = src; - }); - - var err = new Error('This stream turned into bacon.'); - dest.emit('error', err); - assert.strictEqual(gotErr, err); - assert.strictEqual(unpipedSource, source); - assert.strictEqual(unpipedDest, dest); -})(); - -(function testErrorWithoutListenerThrows() { - var count = 1000; - - var source = new stream.Readable(); - source._read = function(n) { - n = Math.min(count, n); - count -= n; - source.push(new Buffer(n)); - }; - - var unpipedDest; - source.unpipe = function(dest) { - unpipedDest = dest; - stream.Readable.prototype.unpipe.call(this, dest); - }; - - var dest = new stream.Writable(); - dest._write = function(chunk, encoding, cb) { - cb(); - }; - - source.pipe(dest); - - var unpipedSource; - dest.on('unpipe', function(src) { - unpipedSource = src; - }); - - var err = new Error('This stream turned into bacon.'); - - var gotErr = null; - try { - dest.emit('error', err); - } catch (e) { - gotErr = e; - } - assert.strictEqual(gotErr, err); - assert.strictEqual(unpipedSource, source); - assert.strictEqual(unpipedDest, dest); -})(); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js deleted file mode 100644 index e85f785..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-push.js +++ /dev/null @@ -1,138 +0,0 @@ -// 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 common = require('../common.js'); -var stream = require('../../readable'); -var Readable = stream.Readable; -var Writable = stream.Writable; -var assert = require('assert'); - -var util = require('util'); -var EE = require('events').EventEmitter; - - -// a mock thing a bit like the net.Socket/tcp_wrap.handle interaction - -var stream = new Readable({ - highWaterMark: 16, - encoding: 'utf8' -}); - -var source = new EE; - -stream._read = function() { - console.error('stream._read'); - readStart(); -}; - -var ended = false; -stream.on('end', function() { - ended = true; -}); - -source.on('data', function(chunk) { - var ret = stream.push(chunk); - console.error('data', stream._readableState.length); - if (!ret) - readStop(); -}); - -source.on('end', function() { - stream.push(null); -}); - -var reading = false; - -function readStart() { - console.error('readStart'); - reading = true; -} - -function readStop() { - console.error('readStop'); - reading = false; - process.nextTick(function() { - var r = stream.read(); - if (r !== null) - writer.write(r); - }); -} - -var writer = new Writable({ - decodeStrings: false -}); - -var written = []; - -var expectWritten = - [ 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg', - 'asdfgasdfgasdfgasdfg' ]; - -writer._write = function(chunk, encoding, cb) { - console.error('WRITE %s', chunk); - written.push(chunk); - process.nextTick(cb); -}; - -writer.on('finish', finish); - - -// now emit some chunks. - -var chunk = "asdfg"; - -var set = 0; -readStart(); -data(); -function data() { - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(reading); - source.emit('data', chunk); - assert(!reading); - if (set++ < 5) - setTimeout(data, 10); - else - end(); -} - -function finish() { - console.error('finish'); - assert.deepEqual(written, expectWritten); - console.log('ok'); -} - -function end() { - source.emit('end'); - assert(!reading); - writer.end(stream.read()); - setTimeout(function() { - assert(ended); - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js deleted file mode 100644 index 7e86eec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js +++ /dev/null @@ -1,54 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); -var Readable = require('../../readable').Readable; -var r = new Readable(); -var N = 256 * 1024; - -// Go ahead and allow the pathological case for this test. -// Yes, it's an infinite loop, that's the point. -process.maxTickDepth = N + 2; - -var reads = 0; -r._read = function(n) { - var chunk = reads++ === N ? null : new Buffer(1); - r.push(chunk); -}; - -r.on('readable', function onReadable() { - if (!(r._readableState.length % 256)) - console.error('readable', r._readableState.length); - r.read(N * 2); -}); - -var ended = false; -r.on('end', function onEnd() { - ended = true; -}); - -r.read(0); - -process.on('exit', function() { - assert(ended); - console.log('ok'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js deleted file mode 100644 index 1b067f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js +++ /dev/null @@ -1,119 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); - -var Readable = require('../../readable').Readable; - -test1(); -if (!/^v0\.[0-8]\./.test(process.version)) - test2(); - -function test1() { - var r = new Readable(); - - // should not end when we get a Buffer(0) or '' as the _read result - // that just means that there is *temporarily* no data, but to go - // ahead and try again later. - // - // note that this is very unusual. it only works for crypto streams - // because the other side of the stream will call read(0) to cycle - // data through openssl. that's why we set the timeouts to call - // r.read(0) again later, otherwise there is no more work being done - // and the process just exits. - - var buf = new Buffer(5); - buf.fill('x'); - var reads = 5; - r._read = function(n) { - switch (reads--) { - case 0: - return r.push(null); // EOF - case 1: - return r.push(buf); - case 2: - setTimeout(r.read.bind(r, 0), 10); - return r.push(new Buffer(0)); // Not-EOF! - case 3: - setTimeout(r.read.bind(r, 0), 10); - return process.nextTick(function() { - return r.push(new Buffer(0)); - }); - case 4: - setTimeout(r.read.bind(r, 0), 10); - return setTimeout(function() { - return r.push(new Buffer(0)); - }); - case 5: - return setTimeout(function() { - return r.push(buf); - }); - default: - throw new Error('unreachable'); - } - }; - - var results = []; - function flow() { - var chunk; - while (null !== (chunk = r.read())) - results.push(chunk + ''); - } - r.on('readable', flow); - r.on('end', function() { - results.push('EOF'); - }); - flow(); - - process.on('exit', function() { - assert.deepEqual(results, [ 'xxxxx', 'xxxxx', 'EOF' ]); - console.log('ok'); - }); -} - -function test2() { - var r = new Readable({ encoding: 'base64' }); - var reads = 5; - r._read = function(n) { - if (!reads--) - return r.push(null); // EOF - else - return r.push(new Buffer('x')); - }; - - var results = []; - function flow() { - var chunk; - while (null !== (chunk = r.read())) - results.push(chunk + ''); - } - r.on('readable', flow); - r.on('end', function() { - results.push('EOF'); - }); - flow(); - - process.on('exit', function() { - assert.deepEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]); - console.log('ok'); - }); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js deleted file mode 100644 index 04a96f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js +++ /dev/null @@ -1,120 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var fromList = require('../../lib/_stream_readable')._fromList; - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - - - -test('buffers', function(t) { - // have a length - var len = 16; - var list = [ new Buffer('foog'), - new Buffer('bark'), - new Buffer('bazy'), - new Buffer('kuel') ]; - - // read more than the first element. - var ret = fromList(6, { buffer: list, length: 16 }); - t.equal(ret.toString(), 'foogba'); - - // read exactly the first element. - ret = fromList(2, { buffer: list, length: 10 }); - t.equal(ret.toString(), 'rk'); - - // read less than the first element. - ret = fromList(2, { buffer: list, length: 8 }); - t.equal(ret.toString(), 'ba'); - - // read more than we have. - ret = fromList(100, { buffer: list, length: 6 }); - t.equal(ret.toString(), 'zykuel'); - - // all consumed. - t.same(list, []); - - t.end(); -}); - -test('strings', function(t) { - // have a length - var len = 16; - var list = [ 'foog', - 'bark', - 'bazy', - 'kuel' ]; - - // read more than the first element. - var ret = fromList(6, { buffer: list, length: 16, decoder: true }); - t.equal(ret, 'foogba'); - - // read exactly the first element. - ret = fromList(2, { buffer: list, length: 10, decoder: true }); - t.equal(ret, 'rk'); - - // read less than the first element. - ret = fromList(2, { buffer: list, length: 8, decoder: true }); - t.equal(ret, 'ba'); - - // read more than we have. - ret = fromList(100, { buffer: list, length: 6, decoder: true }); - t.equal(ret, 'zykuel'); - - // all consumed. - t.same(list, []); - - t.end(); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js deleted file mode 100644 index c6cbc7d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 common = require('../common'); -var assert = require('assert'); - -var Stream = require('../../readable'); -var Readable = Stream.Readable; - -var r = new Readable(); -var N = 256; -var reads = 0; -r._read = function(n) { - return r.push(++reads === N ? null : new Buffer(1)); -}; - -var rended = false; -r.on('end', function() { - rended = true; -}); - -var w = new Stream(); -w.writable = true; -var writes = 0; -var buffered = 0; -w.write = function(c) { - writes += c.length; - buffered += c.length; - process.nextTick(drain); - return false; -}; - -function drain() { - assert(buffered <= 2); - buffered = 0; - w.emit('drain'); -} - - -var wended = false; -w.end = function() { - wended = true; -}; - -// Just for kicks, let's mess with the drain count. -// This verifies that even if it gets negative in the -// pipe() cleanup function, we'll still function properly. -r.on('readable', function() { - w.emit('drain'); -}); - -r.pipe(w); -process.on('exit', function() { - assert(rended); - assert(wended); - console.error('ok'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js deleted file mode 100644 index c971898..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var Readable = require('../../lib/_stream_readable'); - -var len = 0; -var chunks = new Array(10); -for (var i = 1; i <= 10; i++) { - chunks[i-1] = new Buffer(i); - len += i; -} - -var test = new Readable(); -var n = 0; -test._read = function(size) { - var chunk = chunks[n++]; - setTimeout(function() { - test.push(chunk); - }); -}; - -test.on('end', thrower); -function thrower() { - throw new Error('this should not happen!'); -} - -var bytesread = 0; -test.on('readable', function() { - var b = len - bytesread - 1; - var res = test.read(b); - if (res) { - bytesread += res.length; - console.error('br=%d len=%d', bytesread, len); - setTimeout(next); - } - test.read(0); -}); -test.read(0); - -function next() { - // now let's make 'end' happen - test.removeListener('end', thrower); - - var endEmitted = false; - process.on('exit', function() { - assert(endEmitted, 'end should be emitted by now'); - }); - test.on('end', function() { - endEmitted = true; - }); - - // one to get the last byte - var r = test.read(); - assert(r); - assert.equal(r.length, 1); - r = test.read(); - assert.equal(r, null); -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js deleted file mode 100644 index 602acd6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js +++ /dev/null @@ -1,312 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var R = require('../../lib/_stream_readable'); -var util = require('util'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -///// - -util.inherits(TestReader, R); - -function TestReader(n, opts) { - R.call(this, opts); - - this.pos = 0; - this.len = n || 100; -} - -TestReader.prototype._read = function(n) { - setTimeout(function() { - - if (this.pos >= this.len) { - return this.push(null); - } - - n = Math.min(n, this.len - this.pos); - if (n <= 0) { - return this.push(null); - } - - this.pos += n; - var ret = new Buffer(n); - ret.fill('a'); - - console.log("this.push(ret)", ret) - - return this.push(ret); - }.bind(this), 1); -}; - -test('setEncoding utf8', function(t) { - var tr = new TestReader(100); - tr.setEncoding('utf8'); - var out = []; - var expect = - [ 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - - -test('setEncoding hex', function(t) { - var tr = new TestReader(100); - tr.setEncoding('hex'); - var out = []; - var expect = - [ '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('setEncoding hex with read(13)', function(t) { - var tr = new TestReader(100); - tr.setEncoding('hex'); - var out = []; - var expect = - [ "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "16161" ]; - - tr.on('readable', function flow() { - console.log("readable once") - var chunk; - while (null !== (chunk = tr.read(13))) - out.push(chunk); - }); - - tr.on('end', function() { - console.log("END") - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('encoding: utf8', function(t) { - var tr = new TestReader(100, { encoding: 'utf8' }); - var out = []; - var expect = - [ 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa', - 'aaaaaaaaaa' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - - -test('encoding: hex', function(t) { - var tr = new TestReader(100, { encoding: 'hex' }); - var out = []; - var expect = - [ '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161', - '6161616161' ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(10))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); - -test('encoding: hex with read(13)', function(t) { - var tr = new TestReader(100, { encoding: 'hex' }); - var out = []; - var expect = - [ "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "1616161616161", - "6161616161616", - "16161" ]; - - tr.on('readable', function flow() { - var chunk; - while (null !== (chunk = tr.read(13))) - out.push(chunk); - }); - - tr.on('end', function() { - t.same(out, expect); - t.end(); - }); - - // just kick it off. - tr.emit('readable'); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js deleted file mode 100644 index 5804c39..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-transform.js +++ /dev/null @@ -1,435 +0,0 @@ -// 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 assert = require('assert'); -var common = require('../common.js'); -var PassThrough = require('../../lib/_stream_passthrough'); -var Transform = require('../../lib/_stream_transform'); - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - ok: assert, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -///// - -test('writable side consumption', function(t) { - var tx = new Transform({ - highWaterMark: 10 - }); - - var transformed = 0; - tx._transform = function(chunk, encoding, cb) { - transformed += chunk.length; - tx.push(chunk); - cb(); - }; - - for (var i = 1; i <= 10; i++) { - tx.write(new Buffer(i)); - } - tx.end(); - - t.equal(tx._readableState.length, 10); - t.equal(transformed, 10); - t.equal(tx._transformState.writechunk.length, 5); - t.same(tx._writableState.buffer.map(function(c) { - return c.chunk.length; - }), [6, 7, 8, 9, 10]); - - t.end(); -}); - -test('passthrough', function(t) { - var pt = new PassThrough(); - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5).toString(), 'l'); - t.end(); -}); - -test('simple transform', function(t) { - var pt = new Transform; - pt._transform = function(c, e, cb) { - var ret = new Buffer(c.length); - ret.fill('x'); - pt.push(ret); - cb(); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'xxxxx'); - t.equal(pt.read(5).toString(), 'x'); - t.end(); -}); - -test('async passthrough', function(t) { - var pt = new Transform; - pt._transform = function(chunk, encoding, cb) { - setTimeout(function() { - pt.push(chunk); - cb(); - }, 10); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5).toString(), 'l'); - t.end(); - }); -}); - -test('assymetric transform (expand)', function(t) { - var pt = new Transform; - - // emit each chunk 2 times. - pt._transform = function(chunk, encoding, cb) { - setTimeout(function() { - pt.push(chunk); - setTimeout(function() { - pt.push(chunk); - cb(); - }, 10) - }, 10); - }; - - pt.write(new Buffer('foog')); - pt.write(new Buffer('bark')); - pt.write(new Buffer('bazy')); - pt.write(new Buffer('kuel')); - pt.end(); - - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'foogf'); - t.equal(pt.read(5).toString(), 'oogba'); - t.equal(pt.read(5).toString(), 'rkbar'); - t.equal(pt.read(5).toString(), 'kbazy'); - t.equal(pt.read(5).toString(), 'bazyk'); - t.equal(pt.read(5).toString(), 'uelku'); - t.equal(pt.read(5).toString(), 'el'); - t.end(); - }); -}); - -test('assymetric transform (compress)', function(t) { - var pt = new Transform; - - // each output is the first char of 3 consecutive chunks, - // or whatever's left. - pt.state = ''; - - pt._transform = function(chunk, encoding, cb) { - if (!chunk) - chunk = ''; - var s = chunk.toString(); - setTimeout(function() { - this.state += s.charAt(0); - if (this.state.length === 3) { - pt.push(new Buffer(this.state)); - this.state = ''; - } - cb(); - }.bind(this), 10); - }; - - pt._flush = function(cb) { - // just output whatever we have. - pt.push(new Buffer(this.state)); - this.state = ''; - cb(); - }; - - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.write(new Buffer('eeee')); - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.write(new Buffer('eeee')); - pt.write(new Buffer('aaaa')); - pt.write(new Buffer('bbbb')); - pt.write(new Buffer('cccc')); - pt.write(new Buffer('dddd')); - pt.end(); - - // 'abcdeabcdeabcd' - pt.on('finish', function() { - t.equal(pt.read(5).toString(), 'abcde'); - t.equal(pt.read(5).toString(), 'abcde'); - t.equal(pt.read(5).toString(), 'abcd'); - t.end(); - }); -}); - - -test('passthrough event emission', function(t) { - var pt = new PassThrough(); - var emits = 0; - pt.on('readable', function() { - var state = pt._readableState; - console.error('>>> emit readable %d', emits); - emits++; - }); - - var i = 0; - - pt.write(new Buffer('foog')); - - console.error('need emit 0'); - pt.write(new Buffer('bark')); - - console.error('should have emitted readable now 1 === %d', emits); - t.equal(emits, 1); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5) + '', 'null'); - - console.error('need emit 1'); - - pt.write(new Buffer('bazy')); - console.error('should have emitted, but not again'); - pt.write(new Buffer('kuel')); - - console.error('should have emitted readable now 2 === %d', emits); - t.equal(emits, 2); - - t.equal(pt.read(5).toString(), 'arkba'); - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5), null); - - console.error('need emit 2'); - - pt.end(); - - t.equal(emits, 3); - - t.equal(pt.read(5).toString(), 'l'); - t.equal(pt.read(5), null); - - console.error('should not have emitted again'); - t.equal(emits, 3); - t.end(); -}); - -test('passthrough event emission reordered', function(t) { - var pt = new PassThrough; - var emits = 0; - pt.on('readable', function() { - console.error('emit readable', emits) - emits++; - }); - - pt.write(new Buffer('foog')); - console.error('need emit 0'); - pt.write(new Buffer('bark')); - console.error('should have emitted readable now 1 === %d', emits); - t.equal(emits, 1); - - t.equal(pt.read(5).toString(), 'foogb'); - t.equal(pt.read(5), null); - - console.error('need emit 1'); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'arkba'); - - t.equal(pt.read(5), null); - - console.error('need emit 2'); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'zykue'); - t.equal(pt.read(5), null); - pt.once('readable', function() { - t.equal(pt.read(5).toString(), 'l'); - t.equal(pt.read(5), null); - t.equal(emits, 4); - t.end(); - }); - pt.end(); - }); - pt.write(new Buffer('kuel')); - }); - - pt.write(new Buffer('bazy')); -}); - -test('passthrough facaded', function(t) { - console.error('passthrough facaded'); - var pt = new PassThrough; - var datas = []; - pt.on('data', function(chunk) { - datas.push(chunk.toString()); - }); - - pt.on('end', function() { - t.same(datas, ['foog', 'bark', 'bazy', 'kuel']); - t.end(); - }); - - pt.write(new Buffer('foog')); - setTimeout(function() { - pt.write(new Buffer('bark')); - setTimeout(function() { - pt.write(new Buffer('bazy')); - setTimeout(function() { - pt.write(new Buffer('kuel')); - setTimeout(function() { - pt.end(); - }, 10); - }, 10); - }, 10); - }, 10); -}); - -test('object transform (json parse)', function(t) { - console.error('json parse stream'); - var jp = new Transform({ objectMode: true }); - jp._transform = function(data, encoding, cb) { - try { - jp.push(JSON.parse(data)); - cb(); - } catch (er) { - cb(er); - } - }; - - // anything except null/undefined is fine. - // those are "magic" in the stream API, because they signal EOF. - var objects = [ - { foo: 'bar' }, - 100, - "string", - { nested: { things: [ { foo: 'bar' }, 100, "string" ] } } - ]; - - var ended = false; - jp.on('end', function() { - ended = true; - }); - - objects.forEach(function(obj) { - jp.write(JSON.stringify(obj)); - var res = jp.read(); - t.same(res, obj); - }); - - jp.end(); - - process.nextTick(function() { - t.ok(ended); - t.end(); - }) -}); - -test('object transform (json stringify)', function(t) { - console.error('json parse stream'); - var js = new Transform({ objectMode: true }); - js._transform = function(data, encoding, cb) { - try { - js.push(JSON.stringify(data)); - cb(); - } catch (er) { - cb(er); - } - }; - - // anything except null/undefined is fine. - // those are "magic" in the stream API, because they signal EOF. - var objects = [ - { foo: 'bar' }, - 100, - "string", - { nested: { things: [ { foo: 'bar' }, 100, "string" ] } } - ]; - - var ended = false; - js.on('end', function() { - ended = true; - }); - - objects.forEach(function(obj) { - js.write(obj); - var res = js.read(); - t.equal(res, JSON.stringify(obj)); - }); - - js.end(); - - process.nextTick(function() { - t.ok(ended); - t.end(); - }) -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js deleted file mode 100644 index a3b5394..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js +++ /dev/null @@ -1,76 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var stream = require('../../readable'); -var crypto = require('crypto'); - -var util = require('util'); - -function TestWriter() { - stream.Writable.call(this); -} -util.inherits(TestWriter, stream.Writable); - -TestWriter.prototype._write = function (buffer, encoding, callback) { - console.log('write called'); - // super slow write stream (callback never called) -}; - -var dest = new TestWriter(); - -function TestReader(id) { - stream.Readable.call(this); - this.reads = 0; -} -util.inherits(TestReader, stream.Readable); - -TestReader.prototype._read = function (size) { - this.reads += 1; - this.push(crypto.randomBytes(size)); -}; - -var src1 = new TestReader(); -var src2 = new TestReader(); - -src1.pipe(dest); - -src1.once('readable', function () { - process.nextTick(function () { - - src2.pipe(dest); - - src2.once('readable', function () { - process.nextTick(function () { - - src1.unpipe(dest); - }); - }); - }); -}); - - -process.on('exit', function () { - assert.equal(src1.reads, 2); - assert.equal(src2.reads, 2); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js deleted file mode 100644 index 6882f20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js +++ /dev/null @@ -1,74 +0,0 @@ -// 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 common = require('../common.js'); -var assert = require('assert'); -var stream = require('../../readable'); - -var chunk = new Buffer('hallo'); - -var util = require('util'); - -function TestWriter() { - stream.Writable.call(this); -} -util.inherits(TestWriter, stream.Writable); - -TestWriter.prototype._write = function(buffer, encoding, callback) { - callback(null); -}; - -var dest = new TestWriter(); - -// Set this high so that we'd trigger a nextTick warning -// and/or RangeError if we do maybeReadMore wrong. -function TestReader() { - stream.Readable.call(this, { highWaterMark: 0x10000 }); -} -util.inherits(TestReader, stream.Readable); - -TestReader.prototype._read = function(size) { - this.push(chunk); -}; - -var src = new TestReader(); - -for (var i = 0; i < 10; i++) { - src.pipe(dest); - src.unpipe(dest); -} - -assert.equal(src.listeners('end').length, 0); -assert.equal(src.listeners('readable').length, 0); - -assert.equal(dest.listeners('unpipe').length, 0); -assert.equal(dest.listeners('drain').length, 0); -assert.equal(dest.listeners('error').length, 0); -assert.equal(dest.listeners('close').length, 0); -assert.equal(dest.listeners('finish').length, 0); - -console.error(src._readableState); -process.on('exit', function() { - assert(src._readableState.length >= src._readableState.highWaterMark); - src._readableState.buffer.length = 0; - console.error(src._readableState); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js deleted file mode 100644 index a60e65c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/test/simple/test-stream2-writable.js +++ /dev/null @@ -1,328 +0,0 @@ -// 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 common = require('../common.js'); -var W = require('../../lib/_stream_writable'); -var D = require('../../lib/_stream_duplex'); -var assert = require('assert'); - -var util = require('util'); -util.inherits(TestWriter, W); - -function TestWriter() { - W.apply(this, arguments); - this.buffer = []; - this.written = 0; -} - -TestWriter.prototype._write = function(chunk, encoding, cb) { - // simulate a small unpredictable latency - setTimeout(function() { - this.buffer.push(chunk.toString()); - this.written += chunk.length; - cb(); - }.bind(this), Math.floor(Math.random() * 10)); -}; - -var chunks = new Array(50); -for (var i = 0; i < chunks.length; i++) { - chunks[i] = new Array(i + 1).join('x'); -} - -// tiny node-tap lookalike. -var tests = []; -var count = 0; - -function test(name, fn) { - count++; - tests.push([name, fn]); -} - -function run() { - var next = tests.shift(); - if (!next) - return console.error('ok'); - - var name = next[0]; - var fn = next[1]; - console.log('# %s', name); - fn({ - same: assert.deepEqual, - equal: assert.equal, - end: function () { - count--; - run(); - } - }); -} - -// ensure all tests have run -process.on("exit", function () { - assert.equal(count, 0); -}); - -process.nextTick(run); - -test('write fast', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.end(); - }); - - chunks.forEach(function(chunk) { - // screw backpressure. Just buffer it all up. - tw.write(chunk); - }); - tw.end(); -}); - -test('write slow', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.end(); - }); - - var i = 0; - (function W() { - tw.write(chunks[i++]); - if (i < chunks.length) - setTimeout(W, 10); - else - tw.end(); - })(); -}); - -test('write backpressure', function(t) { - var tw = new TestWriter({ - highWaterMark: 50 - }); - - var drains = 0; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.equal(drains, 17); - t.end(); - }); - - tw.on('drain', function() { - drains++; - }); - - var i = 0; - (function W() { - do { - var ret = tw.write(chunks[i++]); - } while (ret !== false && i < chunks.length); - - if (i < chunks.length) { - assert(tw._writableState.length >= 50); - tw.once('drain', W); - } else { - tw.end(); - } - })(); -}); - -test('write bufferize', function(t) { - var tw = new TestWriter({ - highWaterMark: 100 - }); - - var encodings = - [ 'hex', - 'utf8', - 'utf-8', - 'ascii', - 'binary', - 'base64', - 'ucs2', - 'ucs-2', - 'utf16le', - 'utf-16le', - undefined ]; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got the expected chunks'); - }); - - chunks.forEach(function(chunk, i) { - var enc = encodings[ i % encodings.length ]; - chunk = new Buffer(chunk); - tw.write(chunk.toString(enc), enc); - }); - t.end(); -}); - -test('write no bufferize', function(t) { - var tw = new TestWriter({ - highWaterMark: 100, - decodeStrings: false - }); - - tw._write = function(chunk, encoding, cb) { - assert(typeof chunk === 'string'); - chunk = new Buffer(chunk, encoding); - return TestWriter.prototype._write.call(this, chunk, encoding, cb); - }; - - var encodings = - [ 'hex', - 'utf8', - 'utf-8', - 'ascii', - 'binary', - 'base64', - 'ucs2', - 'ucs-2', - 'utf16le', - 'utf-16le', - undefined ]; - - tw.on('finish', function() { - t.same(tw.buffer, chunks, 'got the expected chunks'); - }); - - chunks.forEach(function(chunk, i) { - var enc = encodings[ i % encodings.length ]; - chunk = new Buffer(chunk); - tw.write(chunk.toString(enc), enc); - }); - t.end(); -}); - -test('write callbacks', function (t) { - var callbacks = chunks.map(function(chunk, i) { - return [i, function(er) { - callbacks._called[i] = chunk; - }]; - }).reduce(function(set, x) { - set['callback-' + x[0]] = x[1]; - return set; - }, {}); - callbacks._called = []; - - var tw = new TestWriter({ - highWaterMark: 100 - }); - - tw.on('finish', function() { - process.nextTick(function() { - t.same(tw.buffer, chunks, 'got chunks in the right order'); - t.same(callbacks._called, chunks, 'called all callbacks'); - t.end(); - }); - }); - - chunks.forEach(function(chunk, i) { - tw.write(chunk, callbacks['callback-' + i]); - }); - tw.end(); -}); - -test('end callback', function (t) { - var tw = new TestWriter(); - tw.end(function () { - t.end(); - }); -}); - -test('end callback with chunk', function (t) { - var tw = new TestWriter(); - tw.end(new Buffer('hello world'), function () { - t.end(); - }); -}); - -test('end callback with chunk and encoding', function (t) { - var tw = new TestWriter(); - tw.end('hello world', 'ascii', function () { - t.end(); - }); -}); - -test('end callback after .write() call', function (t) { - var tw = new TestWriter(); - tw.write(new Buffer('hello world')); - tw.end(function () { - t.end(); - }); -}); - -test('encoding should be ignored for buffers', function(t) { - var tw = new W(); - var hex = '018b5e9a8f6236ffe30e31baf80d2cf6eb'; - tw._write = function(chunk, encoding, cb) { - t.equal(chunk.toString('hex'), hex); - t.end(); - }; - var buf = new Buffer(hex, 'hex'); - tw.write(buf, 'binary'); -}); - -test('writables are not pipable', function(t) { - var w = new W(); - w._write = function() {}; - var gotError = false; - w.on('error', function(er) { - gotError = true; - }); - w.pipe(process.stdout); - assert(gotError); - t.end(); -}); - -test('duplexes are pipable', function(t) { - var d = new D(); - d._read = function() {}; - d._write = function() {}; - var gotError = false; - d.on('error', function(er) { - gotError = true; - }); - d.pipe(process.stdout); - assert(!gotError); - t.end(); -}); - -test('end(chunk) two times is an error', function(t) { - var w = new W(); - w._write = function() {}; - var gotError = false; - w.on('error', function(er) { - gotError = true; - t.equal(er.message, 'write after end'); - }); - w.end('this is the end'); - w.end('and so is this'); - process.nextTick(function() { - assert(gotError); - t.end(); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js deleted file mode 100644 index a30ca20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/readable-stream/zlib.js +++ /dev/null @@ -1,452 +0,0 @@ -// 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 Transform = require('./lib/_stream_transform.js'); - -var binding = process.binding('zlib'); -var util = require('util'); -var assert = require('assert').ok; - -// zlib doesn't provide these, so kludge them in following the same -// const naming scheme zlib uses. -binding.Z_MIN_WINDOWBITS = 8; -binding.Z_MAX_WINDOWBITS = 15; -binding.Z_DEFAULT_WINDOWBITS = 15; - -// fewer than 64 bytes per chunk is stupid. -// technically it could work with as few as 8, but even 64 bytes -// is absurdly low. Usually a MB or more is best. -binding.Z_MIN_CHUNK = 64; -binding.Z_MAX_CHUNK = Infinity; -binding.Z_DEFAULT_CHUNK = (16 * 1024); - -binding.Z_MIN_MEMLEVEL = 1; -binding.Z_MAX_MEMLEVEL = 9; -binding.Z_DEFAULT_MEMLEVEL = 8; - -binding.Z_MIN_LEVEL = -1; -binding.Z_MAX_LEVEL = 9; -binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION; - -// expose all the zlib constants -Object.keys(binding).forEach(function(k) { - if (k.match(/^Z/)) exports[k] = binding[k]; -}); - -// translation table for return codes. -exports.codes = { - Z_OK: binding.Z_OK, - Z_STREAM_END: binding.Z_STREAM_END, - Z_NEED_DICT: binding.Z_NEED_DICT, - Z_ERRNO: binding.Z_ERRNO, - Z_STREAM_ERROR: binding.Z_STREAM_ERROR, - Z_DATA_ERROR: binding.Z_DATA_ERROR, - Z_MEM_ERROR: binding.Z_MEM_ERROR, - Z_BUF_ERROR: binding.Z_BUF_ERROR, - Z_VERSION_ERROR: binding.Z_VERSION_ERROR -}; - -Object.keys(exports.codes).forEach(function(k) { - exports.codes[exports.codes[k]] = k; -}); - -exports.Deflate = Deflate; -exports.Inflate = Inflate; -exports.Gzip = Gzip; -exports.Gunzip = Gunzip; -exports.DeflateRaw = DeflateRaw; -exports.InflateRaw = InflateRaw; -exports.Unzip = Unzip; - -exports.createDeflate = function(o) { - return new Deflate(o); -}; - -exports.createInflate = function(o) { - return new Inflate(o); -}; - -exports.createDeflateRaw = function(o) { - return new DeflateRaw(o); -}; - -exports.createInflateRaw = function(o) { - return new InflateRaw(o); -}; - -exports.createGzip = function(o) { - return new Gzip(o); -}; - -exports.createGunzip = function(o) { - return new Gunzip(o); -}; - -exports.createUnzip = function(o) { - return new Unzip(o); -}; - - -// Convenience methods. -// compress/decompress a string or buffer in one step. -exports.deflate = function(buffer, callback) { - zlibBuffer(new Deflate(), buffer, callback); -}; - -exports.gzip = function(buffer, callback) { - zlibBuffer(new Gzip(), buffer, callback); -}; - -exports.deflateRaw = function(buffer, callback) { - zlibBuffer(new DeflateRaw(), buffer, callback); -}; - -exports.unzip = function(buffer, callback) { - zlibBuffer(new Unzip(), buffer, callback); -}; - -exports.inflate = function(buffer, callback) { - zlibBuffer(new Inflate(), buffer, callback); -}; - -exports.gunzip = function(buffer, callback) { - zlibBuffer(new Gunzip(), buffer, callback); -}; - -exports.inflateRaw = function(buffer, callback) { - zlibBuffer(new InflateRaw(), buffer, callback); -}; - -function zlibBuffer(engine, buffer, callback) { - var buffers = []; - var nread = 0; - - engine.on('error', onError); - engine.on('end', onEnd); - - engine.end(buffer); - flow(); - - function flow() { - var chunk; - while (null !== (chunk = engine.read())) { - buffers.push(chunk); - nread += chunk.length; - } - engine.once('readable', flow); - } - - function onError(err) { - engine.removeListener('end', onEnd); - engine.removeListener('readable', flow); - callback(err); - } - - function onEnd() { - var buf = Buffer.concat(buffers, nread); - buffers = []; - callback(null, buf); - } -} - - -// generic zlib -// minimal 2-byte header -function Deflate(opts) { - if (!(this instanceof Deflate)) return new Deflate(opts); - Zlib.call(this, opts, binding.DEFLATE); -} - -function Inflate(opts) { - if (!(this instanceof Inflate)) return new Inflate(opts); - Zlib.call(this, opts, binding.INFLATE); -} - - - -// gzip - bigger header, same deflate compression -function Gzip(opts) { - if (!(this instanceof Gzip)) return new Gzip(opts); - Zlib.call(this, opts, binding.GZIP); -} - -function Gunzip(opts) { - if (!(this instanceof Gunzip)) return new Gunzip(opts); - Zlib.call(this, opts, binding.GUNZIP); -} - - - -// raw - no header -function DeflateRaw(opts) { - if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts); - Zlib.call(this, opts, binding.DEFLATERAW); -} - -function InflateRaw(opts) { - if (!(this instanceof InflateRaw)) return new InflateRaw(opts); - Zlib.call(this, opts, binding.INFLATERAW); -} - - -// auto-detect header. -function Unzip(opts) { - if (!(this instanceof Unzip)) return new Unzip(opts); - Zlib.call(this, opts, binding.UNZIP); -} - - -// the Zlib class they all inherit from -// This thing manages the queue of requests, and returns -// true or false if there is anything in the queue when -// you call the .write() method. - -function Zlib(opts, mode) { - this._opts = opts = opts || {}; - this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK; - - Transform.call(this, opts); - - // means a different thing there. - this._readableState.chunkSize = null; - - if (opts.chunkSize) { - if (opts.chunkSize < exports.Z_MIN_CHUNK || - opts.chunkSize > exports.Z_MAX_CHUNK) { - throw new Error('Invalid chunk size: ' + opts.chunkSize); - } - } - - if (opts.windowBits) { - if (opts.windowBits < exports.Z_MIN_WINDOWBITS || - opts.windowBits > exports.Z_MAX_WINDOWBITS) { - throw new Error('Invalid windowBits: ' + opts.windowBits); - } - } - - if (opts.level) { - if (opts.level < exports.Z_MIN_LEVEL || - opts.level > exports.Z_MAX_LEVEL) { - throw new Error('Invalid compression level: ' + opts.level); - } - } - - if (opts.memLevel) { - if (opts.memLevel < exports.Z_MIN_MEMLEVEL || - opts.memLevel > exports.Z_MAX_MEMLEVEL) { - throw new Error('Invalid memLevel: ' + opts.memLevel); - } - } - - if (opts.strategy) { - if (opts.strategy != exports.Z_FILTERED && - opts.strategy != exports.Z_HUFFMAN_ONLY && - opts.strategy != exports.Z_RLE && - opts.strategy != exports.Z_FIXED && - opts.strategy != exports.Z_DEFAULT_STRATEGY) { - throw new Error('Invalid strategy: ' + opts.strategy); - } - } - - if (opts.dictionary) { - if (!Buffer.isBuffer(opts.dictionary)) { - throw new Error('Invalid dictionary: it should be a Buffer instance'); - } - } - - this._binding = new binding.Zlib(mode); - - var self = this; - this._hadError = false; - this._binding.onerror = function(message, errno) { - // there is no way to cleanly recover. - // continuing only obscures problems. - self._binding = null; - self._hadError = true; - - var error = new Error(message); - error.errno = errno; - error.code = exports.codes[errno]; - self.emit('error', error); - }; - - this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, - opts.level || exports.Z_DEFAULT_COMPRESSION, - opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, - opts.strategy || exports.Z_DEFAULT_STRATEGY, - opts.dictionary); - - this._buffer = new Buffer(this._chunkSize); - this._offset = 0; - this._closed = false; - - this.once('end', this.close); -} - -util.inherits(Zlib, Transform); - -Zlib.prototype.reset = function reset() { - return this._binding.reset(); -}; - -Zlib.prototype._flush = function(output, callback) { - var rs = this._readableState; - var self = this; - this._transform(null, output, function(er) { - if (er) - return callback(er); - - // now a weird thing happens... it could be that you called flush - // but everything had already actually been consumed, but it wasn't - // enough to get over the Readable class's lowWaterMark. - // In that case, we emit 'readable' now to make sure it's consumed. - if (rs.length && - rs.length < rs.lowWaterMark && - !rs.ended && - rs.needReadable) - self.emit('readable'); - - callback(); - }); -}; - -Zlib.prototype.flush = function(callback) { - var ws = this._writableState; - var ts = this._transformState; - - if (ws.writing) { - ws.needDrain = true; - var self = this; - this.once('drain', function() { - self._flush(ts.output, callback); - }); - return; - } - - this._flush(ts.output, callback || function() {}); -}; - -Zlib.prototype.close = function(callback) { - if (callback) - process.nextTick(callback); - - if (this._closed) - return; - - this._closed = true; - - this._binding.close(); - - var self = this; - process.nextTick(function() { - self.emit('close'); - }); -}; - -Zlib.prototype._transform = function(chunk, output, cb) { - var flushFlag; - var ws = this._writableState; - var ending = ws.ending || ws.ended; - var last = ending && (!chunk || ws.length === chunk.length); - - if (chunk !== null && !Buffer.isBuffer(chunk)) - return cb(new Error('invalid input')); - - // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag. - // If it's explicitly flushing at some other time, then we use - // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression - // goodness. - if (last) - flushFlag = binding.Z_FINISH; - else if (chunk === null) - flushFlag = binding.Z_FULL_FLUSH; - else - flushFlag = binding.Z_NO_FLUSH; - - var availInBefore = chunk && chunk.length; - var availOutBefore = this._chunkSize - this._offset; - var inOff = 0; - - var req = this._binding.write(flushFlag, - chunk, // in - inOff, // in_off - availInBefore, // in_len - this._buffer, // out - this._offset, //out_off - availOutBefore); // out_len - - req.buffer = chunk; - req.callback = callback; - - var self = this; - function callback(availInAfter, availOutAfter, buffer) { - if (self._hadError) - return; - - var have = availOutBefore - availOutAfter; - assert(have >= 0, 'have should not go down'); - - if (have > 0) { - var out = self._buffer.slice(self._offset, self._offset + have); - self._offset += have; - // serve some output to the consumer. - output(out); - } - - // exhausted the output buffer, or used all the input create a new one. - if (availOutAfter === 0 || self._offset >= self._chunkSize) { - availOutBefore = self._chunkSize; - self._offset = 0; - self._buffer = new Buffer(self._chunkSize); - } - - if (availOutAfter === 0) { - // Not actually done. Need to reprocess. - // Also, update the availInBefore to the availInAfter value, - // so that if we have to hit it a third (fourth, etc.) time, - // it'll have the correct byte counts. - inOff += (availInBefore - availInAfter); - availInBefore = availInAfter; - - var newReq = self._binding.write(flushFlag, - chunk, - inOff, - availInBefore, - self._buffer, - self._offset, - self._chunkSize); - newReq.callback = callback; // this same function - newReq.buffer = chunk; - return; - } - - // finished with the chunk. - cb(); - } -}; - -util.inherits(Deflate, Zlib); -util.inherits(Inflate, Zlib); -util.inherits(Gzip, Zlib); -util.inherits(Gunzip, Zlib); -util.inherits(DeflateRaw, Zlib); -util.inherits(InflateRaw, Zlib); -util.inherits(Unzip, Zlib); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md deleted file mode 100644 index 389adae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# xtend - -[![browser support][3]][4] - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes presedence. - -## Examples - -```js -var extend = require("xtend") - -var combination = extend({ - a: "a" -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js deleted file mode 100644 index 62391e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/has-keys.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = hasKeys - -function hasKeys(source) { - return source !== null && - (typeof source === "object" || - typeof source === "function") -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js deleted file mode 100644 index 20937d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/index.js +++ /dev/null @@ -1,25 +0,0 @@ -var Keys = require("object-keys") -var hasKeys = require("./has-keys") - -module.exports = extend - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - if (!hasKeys(source)) { - continue - } - - var keys = Keys(source) - - for (var j = 0; j < keys.length; j++) { - var name = keys[j] - target[name] = source[name] - } - } - - return target -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js deleted file mode 100644 index 29e3b22..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/mutable.js +++ /dev/null @@ -1,19 +0,0 @@ -var hasKeys = require("./has-keys") - -module.exports = extend - -function extend(target) { - var sources = [].slice.call(arguments, 1) - - sources.forEach(function (source) { - if (!hasKeys(source)) { - return - } - - Object.keys(source).forEach(function (name) { - target[name] = source[name] - }) - }) - - return target -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore deleted file mode 100644 index fd31f5e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json deleted file mode 100644 index 287edfe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.testem.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "launchers": { - "node": { - "command": "node ./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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml deleted file mode 100644 index ed178f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE deleted file mode 100644 index 72d356c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Colingo. - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md deleted file mode 100644 index 607a7d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# is-object - -[![build status][1]][2] [![dependency status][3]][4] - -[![browser support][5]][6] - -Checks whether a value is an object - -Because `typeof null` is a troll. - -## Example - -```js -var isObject = require("is-object") - -console.log(isObject(null)) // false -console.log(isObject(require("util"))) // true -``` - -## Installation - -`npm install is-object` - -## Contributors - - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Colingo/is-object.png - [2]: http://travis-ci.org/Colingo/is-object - [3]: http://david-dm.org/Colingo/is-object/status.png - [4]: http://david-dm.org/Colingo/is-object - [5]: http://ci.testling.com/Colingo/is-object.png - [6]: http://ci.testling.com/Colingo/is-object diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/examples/simple.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/examples/simple.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js deleted file mode 100644 index 38348b1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = isObject - -function isObject(x) { - return typeof x === "object" && x !== null -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json deleted file mode 100644 index 92cd3b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "is-object", - "version": "0.1.2", - "description": "Checks whether a value is an object", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Colingo/is-object.git" - }, - "main": "index", - "homepage": "https://github.com/Colingo/is-object", - "contributors": [ - { - "name": "Raynos" - } - ], - "bugs": { - "url": "https://github.com/Colingo/is-object/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~0.2.2", - "browserify-server": "~2.1.18", - "browservefy": "~0.0.7", - "testem": "https://github.com/raynos/testem/tarball/master" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Colingo/is-object/raw/master/LICENSE" - } - ], - "scripts": { - "test": "testem ci", - "build": "browserify-server --bundle=test/index.js -o test/static/bundle.js --debug", - "testem": "testem", - "example": "browservefy ./examples/simple.js --browserify='browserify-server' --live -- --debug --bundle" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "readme": "# is-object\n\n[![build status][1]][2] [![dependency status][3]][4]\n\n[![browser support][5]][6]\n\nChecks whether a value is an object\n\nBecause `typeof null` is a troll.\n\n## Example\n\n```js\nvar isObject = require(\"is-object\")\n\nconsole.log(isObject(null)) // false\nconsole.log(isObject(require(\"util\"))) // true\n```\n\n## Installation\n\n`npm install is-object`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n\n [1]: https://secure.travis-ci.org/Colingo/is-object.png\n [2]: http://travis-ci.org/Colingo/is-object\n [3]: http://david-dm.org/Colingo/is-object/status.png\n [4]: http://david-dm.org/Colingo/is-object\n [5]: http://ci.testling.com/Colingo/is-object.png\n [6]: http://ci.testling.com/Colingo/is-object\n", - "readmeFilename": "README.md", - "_id": "is-object@0.1.2", - "dist": { - "shasum": "d4ef6cf2e33bfa0407ba25176b1266f44999f8c9" - }, - "_from": "is-object@~0.1.2", - "_resolved": "https://registry.npmjs.org/is-object/-/is-object-0.1.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js deleted file mode 100644 index b4c7abb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/index.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require("tape") - -var isObject = require("../index") - -test("returns true for objects", function (assert) { - assert.equal(isObject({}), true) - assert.equal(isObject([]), true) - - assert.end() -}) - -test("returns false for null", function (assert) { - assert.equal(isObject(null), false) - - assert.end() -}) - -test("returns false for primitives", function (assert) { - assert.equal(isObject(42), false) - assert.equal(isObject("foo"), false) - - assert.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html deleted file mode 100644 index 60f6ef8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - TAPE Example - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js deleted file mode 100644 index c512792..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/is-object/test/static/test-adapter.js +++ /dev/null @@ -1,49 +0,0 @@ -(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 { - results.failed++ - } - - results.total++ - - socket.emit('test-result', test) - results.tests.push(test) - } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml deleted file mode 100644 index 8170a81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.6" diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md deleted file mode 100644 index c49e3a8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/README.md +++ /dev/null @@ -1,38 +0,0 @@ -#object-keys [![Version Badge][2]][1] - -[![Build Status][3]][4] [![dependency status][5]][6] - -[![browser support][7]][8] - -An Object.keys shim. Uses Object.keys if available. - -## Example - -```js -var keys = require('object-keys'); -var assert = require('assert'); -var obj = { - a: true, - b: true, - c: true -}; - -assert.equal(keys(obj), ['a', 'b', 'c']); -``` - -## Source -Implementation taken directly from [9] - -## Tests -Tests currently use tape - which doesn't work in node 0.10, but works in browserify. Rest assured, they pass. - -[1]: https://npmjs.org/package/object-keys -[2]: http://vb.teelaun.ch/ljharb/object-keys.svg -[3]: https://travis-ci.org/ljharb/object-keys.png -[4]: https://travis-ci.org/ljharb/object-keys -[5]: https://david-dm.org/ljharb/object-keys.png -[6]: https://david-dm.org/ljharb/object-keys -[7]: https://ci.testling.com/ljharb/object-keys.png -[8]: https://ci.testling.com/ljharb/object-keys -[9]: https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js#L542-589 - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js deleted file mode 100644 index f5b24b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/index.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = Object.keys || require('./shim'); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name deleted file mode 100644 index 373ccea..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -manuelstofer-foreach \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml deleted file mode 100644 index 6b8184f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/manuelstofer-foreach.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml deleted file mode 100644 index 1162f43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml deleted file mode 100644 index 63665ee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml deleted file mode 100644 index c80f219..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml deleted file mode 100644 index 269a33c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.idea/workspace.xml +++ /dev/null @@ -1,467 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1365371005647 - 1365371005647 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore deleted file mode 100644 index d135df6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -components -build \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile deleted file mode 100644 index eae4117..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -build: components - @component build - -components: component.json - @component install --dev - -clean: - rm -fr build components template.js - -.PHONY: clean diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md deleted file mode 100644 index 2752b57..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/Readme.md +++ /dev/null @@ -1,30 +0,0 @@ - -# foreach - -Iterate over the key value pairs of either an array-like object or a dictionary like object. - -[![browser support][1]][2] - -## API - -### foreach(object, function, [context]) - -```js -var each = require('foreach'); - -each([1,2,3], function (value, key, array) { - // value === 1, 2, 3 - // key === 0, 1, 2 - // array === [1, 2, 3] -}); - -each({0:1,1:2,2:3}, function (value, key, object) { - // value === 1, 2, 3 - // key === 0, 1, 2 - // object === {0:1,1:2,2:3} -}); -``` - -[1]: https://ci.testling.com/manuelstofer/foreach.png -[2]: https://ci.testling.com/manuelstofer/foreach - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json deleted file mode 100644 index 9495f56..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "foreach", - "description": "foreach component + npm package", - "version": "2.0.3", - "keywords": [], - "dependencies": {}, - "scripts": [ - "index.js" - ], - "repo": "manuelstofer/foreach" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js deleted file mode 100644 index a961e4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/index.js +++ /dev/null @@ -1,22 +0,0 @@ - -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; - -module.exports = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } -}; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json deleted file mode 100644 index 72a947c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "foreach", - "description": "foreach component + npm package", - "version": "2.0.4", - "author": { - "name": "Manuel Stofer", - "email": "manuel@takimata.ch" - }, - "contributors": [ - { - "name": "Manuel Stofer" - }, - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/manuelstofer/foreach" - }, - "keywords": [ - "shim", - "Array.prototype.forEach", - "forEach", - "Array#forEach", - "each" - ], - "dependencies": {}, - "devDependencies": { - "tape": "*" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0", - "chrome/22.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/5.0.5..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "readme": "\n# foreach\n\nIterate over the key value pairs of either an array-like object or a dictionary like object.\n\n[![browser support][1]][2]\n\n## API\n\n### foreach(object, function, [context])\n\n```js\nvar each = require('foreach');\n\neach([1,2,3], function (value, key, array) {\n // value === 1, 2, 3\n // key === 0, 1, 2\n // array === [1, 2, 3]\n});\n\neach({0:1,1:2,2:3}, function (value, key, object) {\n // value === 1, 2, 3\n // key === 0, 1, 2\n // object === {0:1,1:2,2:3}\n});\n```\n\n[1]: https://ci.testling.com/manuelstofer/foreach.png\n[2]: https://ci.testling.com/manuelstofer/foreach\n\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/manuelstofer/foreach/issues" - }, - "_id": "foreach@2.0.4", - "dist": { - "shasum": "cc5d0d8ae1d46cc9a555c2682f910977859935df" - }, - "_from": "foreach@~2.0.1", - "_resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.4.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js deleted file mode 100644 index e66aebc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/foreach/test.js +++ /dev/null @@ -1,155 +0,0 @@ -var test = require('tape'); -var forEach = require('./index.js'); - - -test('second argument: iterator', function (t) { - var arr = []; - t.throws(function () { forEach(arr); }, TypeError, 'undefined is not a function'); - t.throws(function () { forEach(arr, null); }, TypeError, 'null is not a function'); - t.throws(function () { forEach(arr, ''); }, TypeError, 'string is not a function'); - t.throws(function () { forEach(arr, /a/); }, TypeError, 'regex is not a function'); - t.throws(function () { forEach(arr, true); }, TypeError, 'true is not a function'); - t.throws(function () { forEach(arr, false); }, TypeError, 'false is not a function'); - t.throws(function () { forEach(arr, NaN); }, TypeError, 'NaN is not a function'); - t.throws(function () { forEach(arr, 42); }, TypeError, '42 is not a function'); - t.doesNotThrow(function () { forEach(arr, function () {}); }, 'function is a function'); - t.doesNotThrow(function () { forEach(arr, setTimeout); }, 'setTimeout is a function'); - if (typeof window !== 'undefined') { - t.doesNotThrow(function () { forEach(arr, window.alert); }, 'alert is a function'); - } - t.end(); -}); - -test('array', function (t) { - var arr = [1, 2, 3]; - - t.test('iterates over every item', function (st) { - var index = 0; - forEach(arr, function () { index += 1; }); - st.equal(index, arr.length, 'iterates ' + arr.length + ' times'); - st.end(); - }); - - t.test('first iterator argument', function (st) { - var index = 0; - st.plan(arr.length); - forEach(arr, function (item) { - st.equal(arr[index], item, 'item ' + index + ' is passed as first argument'); - index += 1; - }); - st.end(); - }); - - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(arr.length); - forEach(arr, function (item, index) { - st.equal(counter, index, 'index ' + index + ' is passed as second argument'); - counter += 1; - }); - st.end(); - }); - - t.test('third iterator argument', function (st) { - st.plan(arr.length); - forEach(arr, function (item, index, array) { - st.deepEqual(arr, array, 'array is passed as third argument'); - }); - st.end(); - }); - - t.test('context argument', function (st) { - var context = {}; - forEach([], function () { - st.equal(this, context, '"this" is the passed context'); - }, context); - st.end(); - }); - - t.end(); -}); - -test('object', function (t) { - var obj = { - a: 1, - b: 2, - c: 3 - }; - var keys = ['a', 'b', 'c']; - - var F = function () { - this.a = 1; - this.b = 2; - }; - F.prototype.c = 3; - var fKeys = ['a', 'b']; - - t.test('iterates over every object literal key', function (st) { - var counter = 0; - forEach(obj, function () { counter += 1; }); - st.equal(counter, keys.length, 'iterated ' + counter + ' times'); - st.end(); - }); - - t.test('iterates only over own keys', function (st) { - var counter = 0; - forEach(new F(), function () { counter += 1; }); - st.equal(counter, fKeys.length, 'iterated ' + fKeys.length + ' times'); - st.end(); - }); - - t.test('first iterator argument', function (st) { - var index = 0; - st.plan(keys.length); - forEach(obj, function (item) { - st.equal(obj[keys[index]], item, 'item at key ' + keys[index] + ' is passed as first argument'); - index += 1; - }); - st.end(); - }); - - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(keys.length); - forEach(obj, function (item, key) { - st.equal(keys[counter], key, 'key ' + key + ' is passed as second argument'); - counter += 1; - }); - st.end(); - }); - - t.test('third iterator argument', function (st) { - st.plan(keys.length); - forEach(obj, function (item, key, object) { - st.deepEqual(obj, object, 'object is passed as third argument'); - }); - st.end(); - }); - - t.test('context argument', function (st) { - var context = {}; - forEach({}, function () { - st.equal(this, context, '"this" is the passed context'); - }, context); - st.end(); - }); - - t.end(); -}); - - -test('string', function (t) { - var str = 'str'; - t.test('second iterator argument', function (st) { - var counter = 0; - st.plan(str.length * 2 + 1); - forEach(str, function (item, index) { - st.equal(counter, index, 'index ' + index + ' is passed as second argument'); - st.equal(str.charAt(index), item); - counter += 1; - }); - st.equal(counter, str.length, 'iterates ' + str.length + ' times'); - }); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore deleted file mode 100644 index 48a2e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -components -build diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile deleted file mode 100644 index 3f6119d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -build: components index.js - @component build - -components: - @Component install - -clean: - rm -fr build components template.js - -.PHONY: clean diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md deleted file mode 100644 index 99c8dfc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ - -# indexOf - - Lame indexOf thing, thanks microsoft - -## Example - -```js -var index = require('indexof'); -index(arr, obj); -``` - -## License - - MIT \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json deleted file mode 100644 index e3430d7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/component.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "indexof", - "description": "Microsoft sucks", - "version": "0.0.1", - "keywords": ["index", "array", "indexOf"], - "dependencies": {}, - "scripts": [ - "index.js" - ] -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js deleted file mode 100644 index 9d9667b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/index.js +++ /dev/null @@ -1,10 +0,0 @@ - -var indexOf = [].indexOf; - -module.exports = function(arr, obj){ - if (indexOf) return arr.indexOf(obj); - for (var i = 0; i < arr.length; ++i) { - if (arr[i] === obj) return i; - } - return -1; -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json deleted file mode 100644 index 72018b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/indexof/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "indexof", - "description": "Microsoft sucks", - "version": "0.0.1", - "keywords": [ - "index", - "array", - "indexOf" - ], - "dependencies": {}, - "component": { - "scripts": { - "indexof/index.js": "index.js" - } - }, - "readme": "\n# indexOf\n\n Lame indexOf thing, thanks microsoft\n\n## Example\n\n```js\nvar index = require('indexof');\nindex(arr, obj);\n```\n\n## License\n\n MIT", - "readmeFilename": "Readme.md", - "_id": "indexof@0.0.1", - "dist": { - "shasum": "505290cfca5bc41bb05cfe36a3a8b43bf5c6cb95" - }, - "_from": "indexof@~0.0.1", - "_resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md deleted file mode 100644 index b0b7e1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Enrico Marino - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md deleted file mode 100644 index 412a962..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# is - -The definitive JavaScript type testing library - -To be or not to be? This is the library! - -[![browser support][1]][2] - -## Installation - -As a node.js module - - $ npm install is - -As a component - - $ component install enricomarino/is - -## API - -### general - - - is.a (value, type) or is.type (value, type) - - is.defined (value) - - is.empty (value) - - is.equal (value, other) - - is.hosted (value, host) - - is.instance (value, constructor) - - is.instanceof (value, constructor) - deprecated, because in ES3 browsers, "instanceof" is a reserved word - - is.null (value) - deprecated, because in ES3 browsers, "null" is a reserved word - - is.undefined (value) - -### arguments - - - is.arguments (value) - - is.arguments.empty (value) - -### array - - - is.array (value) - - is.array.empty (value) - - is.arraylike (value) - -### boolean - - - is.boolean (value) - - is.false (value) - deprecated, because in ES3 browsers, "false" is a reserved word - - is.true (value) - deprecated, because in ES3 browsers, "true" is a reserved word - -### date - - - is.date (value) - -### element - - - is.element (value) - -### error - - - is.error (value) - -### function - - - is.fn(value) - - is.function(value) - deprecated, because in ES3 browsers, "function" is a reserved word - -### number - - - is.number (value) - - is.infinite (value) - - is.decimal (value) - - is.divisibleBy (value, n) - - is.int (value) - - is.maximum (value, others) - - is.minimum (value, others) - - is.nan (value) - - is.even (value) - - is.odd (value) - - is.ge (value, other) - - is.gt (value, other) - - is.le (value, other) - - is.lt (value, other) - - is.within (value, start, finish) - -### object - - - is.object (value) - -### regexp - - - is.regexp (value) - -### string - - - is.string (value) - - -## Contributors - -- [Jordan Harband](https://github.com/ljharb) - -## License - -(The MIT License) - -Copyright (c) 2013 Enrico Marino - -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. - -[1]: https://ci.testling.com/enricomarino/is.png -[2]: https://ci.testling.com/enricomarino/is - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json deleted file mode 100644 index 50f6cd9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/component.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "is", - "repo": "enricomarino/is", - "description": "The definitive type testing library", - "version": "0.2.0", - "dependencies": {}, - "scripts": ["index.js"] -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js deleted file mode 100644 index b14b0f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/index.js +++ /dev/null @@ -1,702 +0,0 @@ - -/**! - * is - * the definitive JavaScript type testing library - * - * @copyright 2013 Enrico Marino - * @license MIT - */ - -var objProto = Object.prototype; -var owns = objProto.hasOwnProperty; -var toString = objProto.toString; -var isActualNaN = function (value) { - return value !== value; -}; -var NON_HOST_TYPES = { - "boolean": 1, - "number": 1, - "string": 1, - "undefined": 1 -}; - -/** - * Expose `is` - */ - -var is = module.exports = {}; - -/** - * Test general. - */ - -/** - * is.type - * Test if `value` is a type of `type`. - * - * @param {Mixed} value value to test - * @param {String} type type - * @return {Boolean} true if `value` is a type of `type`, false otherwise - * @api public - */ - -is.a = -is.type = function (value, type) { - return typeof value === type; -}; - -/** - * is.defined - * Test if `value` is defined. - * - * @param {Mixed} value value to test - * @return {Boolean} true if 'value' is defined, false otherwise - * @api public - */ - -is.defined = function (value) { - return value !== undefined; -}; - -/** - * is.empty - * Test if `value` is empty. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is empty, false otherwise - * @api public - */ - -is.empty = function (value) { - var type = toString.call(value); - var key; - - if ('[object Array]' === type || '[object Arguments]' === type) { - return value.length === 0; - } - - if ('[object Object]' === type) { - for (key in value) if (owns.call(value, key)) return false; - return true; - } - - if ('[object String]' === type) { - return '' === value; - } - - return false; -}; - -/** - * is.equal - * Test if `value` is equal to `other`. - * - * @param {Mixed} value value to test - * @param {Mixed} other value to compare with - * @return {Boolean} true if `value` is equal to `other`, false otherwise - */ - -is.equal = function (value, other) { - var type = toString.call(value) - var key; - - if (type !== toString.call(other)) { - return false; - } - - if ('[object Object]' === type) { - for (key in value) { - if (!is.equal(value[key], other[key])) { - return false; - } - } - return true; - } - - if ('[object Array]' === type) { - key = value.length; - if (key !== other.length) { - return false; - } - while (--key) { - if (!is.equal(value[key], other[key])) { - return false; - } - } - return true; - } - - if ('[object Function]' === type) { - return value.prototype === other.prototype; - } - - if ('[object Date]' === type) { - return value.getTime() === other.getTime(); - } - - return value === other; -}; - -/** - * is.hosted - * Test if `value` is hosted by `host`. - * - * @param {Mixed} value to test - * @param {Mixed} host host to test with - * @return {Boolean} true if `value` is hosted by `host`, false otherwise - * @api public - */ - -is.hosted = function (value, host) { - var type = typeof host[value]; - return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type]; -}; - -/** - * is.instance - * Test if `value` is an instance of `constructor`. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an instance of `constructor` - * @api public - */ - -is.instance = is['instanceof'] = function (value, constructor) { - return value instanceof constructor; -}; - -/** - * is.null - * Test if `value` is null. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is null, false otherwise - * @api public - */ - -is['null'] = function (value) { - return value === null; -}; - -/** - * is.undefined - * Test if `value` is undefined. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is undefined, false otherwise - * @api public - */ - -is.undefined = function (value) { - return value === undefined; -}; - -/** - * Test arguments. - */ - -/** - * is.arguments - * Test if `value` is an arguments object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an arguments object, false otherwise - * @api public - */ - -is.arguments = function (value) { - var isStandardArguments = '[object Arguments]' === toString.call(value); - var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee); - return isStandardArguments || isOldArguments; -}; - -/** - * Test array. - */ - -/** - * is.array - * Test if 'value' is an array. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an array, false otherwise - * @api public - */ - -is.array = function (value) { - return '[object Array]' === toString.call(value); -}; - -/** - * is.arguments.empty - * Test if `value` is an empty arguments object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an empty arguments object, false otherwise - * @api public - */ -is.arguments.empty = function (value) { - return is.arguments(value) && value.length === 0; -}; - -/** - * is.array.empty - * Test if `value` is an empty array. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an empty array, false otherwise - * @api public - */ -is.array.empty = function (value) { - return is.array(value) && value.length === 0; -}; - -/** - * is.arraylike - * Test if `value` is an arraylike object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an arguments object, false otherwise - * @api public - */ - -is.arraylike = function (value) { - return !!value && !is.boolean(value) - && owns.call(value, 'length') - && isFinite(value.length) - && is.number(value.length) - && value.length >= 0; -}; - -/** - * Test boolean. - */ - -/** - * is.boolean - * Test if `value` is a boolean. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a boolean, false otherwise - * @api public - */ - -is.boolean = function (value) { - return '[object Boolean]' === toString.call(value); -}; - -/** - * is.false - * Test if `value` is false. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is false, false otherwise - * @api public - */ - -is['false'] = function (value) { - return is.boolean(value) && (value === false || value.valueOf() === false); -}; - -/** - * is.true - * Test if `value` is true. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is true, false otherwise - * @api public - */ - -is['true'] = function (value) { - return is.boolean(value) && (value === true || value.valueOf() === true); -}; - -/** - * Test date. - */ - -/** - * is.date - * Test if `value` is a date. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a date, false otherwise - * @api public - */ - -is.date = function (value) { - return '[object Date]' === toString.call(value); -}; - -/** - * Test element. - */ - -/** - * is.element - * Test if `value` is an html element. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an HTML Element, false otherwise - * @api public - */ - -is.element = function (value) { - return value !== undefined - && typeof HTMLElement !== 'undefined' - && value instanceof HTMLElement - && value.nodeType === 1; -}; - -/** - * Test error. - */ - -/** - * is.error - * Test if `value` is an error object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an error object, false otherwise - * @api public - */ - -is.error = function (value) { - return '[object Error]' === toString.call(value); -}; - -/** - * Test function. - */ - -/** - * is.fn / is.function (deprecated) - * Test if `value` is a function. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a function, false otherwise - * @api public - */ - -is.fn = is['function'] = function (value) { - var isAlert = typeof window !== 'undefined' && value === window.alert; - return isAlert || '[object Function]' === toString.call(value); -}; - -/** - * Test number. - */ - -/** - * is.number - * Test if `value` is a number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a number, false otherwise - * @api public - */ - -is.number = function (value) { - return '[object Number]' === toString.call(value); -}; - -/** - * is.infinite - * Test if `value` is positive or negative infinity. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is positive or negative Infinity, false otherwise - * @api public - */ -is.infinite = function (value) { - return value === Infinity || value === -Infinity; -}; - -/** - * is.decimal - * Test if `value` is a decimal number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a decimal number, false otherwise - * @api public - */ - -is.decimal = function (value) { - return is.number(value) && !isActualNaN(value) && value % 1 !== 0; -}; - -/** - * is.divisibleBy - * Test if `value` is divisible by `n`. - * - * @param {Number} value value to test - * @param {Number} n dividend - * @return {Boolean} true if `value` is divisible by `n`, false otherwise - * @api public - */ - -is.divisibleBy = function (value, n) { - var isDividendInfinite = is.infinite(value); - var isDivisorInfinite = is.infinite(n); - var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0; - return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0); -}; - -/** - * is.int - * Test if `value` is an integer. - * - * @param value to test - * @return {Boolean} true if `value` is an integer, false otherwise - * @api public - */ - -is.int = function (value) { - return is.number(value) && !isActualNaN(value) && value % 1 === 0; -}; - -/** - * is.maximum - * Test if `value` is greater than 'others' values. - * - * @param {Number} value value to test - * @param {Array} others values to compare with - * @return {Boolean} true if `value` is greater than `others` values - * @api public - */ - -is.maximum = function (value, others) { - if (isActualNaN(value)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.arraylike(others)) { - throw new TypeError('second argument must be array-like'); - } - var len = others.length; - - while (--len >= 0) { - if (value < others[len]) { - return false; - } - } - - return true; -}; - -/** - * is.minimum - * Test if `value` is less than `others` values. - * - * @param {Number} value value to test - * @param {Array} others values to compare with - * @return {Boolean} true if `value` is less than `others` values - * @api public - */ - -is.minimum = function (value, others) { - if (isActualNaN(value)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.arraylike(others)) { - throw new TypeError('second argument must be array-like'); - } - var len = others.length; - - while (--len >= 0) { - if (value > others[len]) { - return false; - } - } - - return true; -}; - -/** - * is.nan - * Test if `value` is not a number. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is not a number, false otherwise - * @api public - */ - -is.nan = function (value) { - return !is.number(value) || value !== value; -}; - -/** - * is.even - * Test if `value` is an even number. - * - * @param {Number} value value to test - * @return {Boolean} true if `value` is an even number, false otherwise - * @api public - */ - -is.even = function (value) { - return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0); -}; - -/** - * is.odd - * Test if `value` is an odd number. - * - * @param {Number} value value to test - * @return {Boolean} true if `value` is an odd number, false otherwise - * @api public - */ - -is.odd = function (value) { - return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0); -}; - -/** - * is.ge - * Test if `value` is greater than or equal to `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} - * @api public - */ - -is.ge = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value >= other; -}; - -/** - * is.gt - * Test if `value` is greater than `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} - * @api public - */ - -is.gt = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value > other; -}; - -/** - * is.le - * Test if `value` is less than or equal to `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} if 'value' is less than or equal to 'other' - * @api public - */ - -is.le = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value <= other; -}; - -/** - * is.lt - * Test if `value` is less than `other`. - * - * @param {Number} value value to test - * @param {Number} other value to compare with - * @return {Boolean} if `value` is less than `other` - * @api public - */ - -is.lt = function (value, other) { - if (isActualNaN(value) || isActualNaN(other)) { - throw new TypeError('NaN is not a valid value'); - } - return !is.infinite(value) && !is.infinite(other) && value < other; -}; - -/** - * is.within - * Test if `value` is within `start` and `finish`. - * - * @param {Number} value value to test - * @param {Number} start lower bound - * @param {Number} finish upper bound - * @return {Boolean} true if 'value' is is within 'start' and 'finish' - * @api public - */ -is.within = function (value, start, finish) { - if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) { - throw new TypeError('NaN is not a valid value'); - } else if (!is.number(value) || !is.number(start) || !is.number(finish)) { - throw new TypeError('all arguments must be numbers'); - } - var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish); - return isAnyInfinite || (value >= start && value <= finish); -}; - -/** - * Test object. - */ - -/** - * is.object - * Test if `value` is an object. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is an object, false otherwise - * @api public - */ - -is.object = function (value) { - return value && '[object Object]' === toString.call(value); -}; - -/** - * is.hash - * Test if `value` is a hash - a plain object literal. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a hash, false otherwise - * @api public - */ - -is.hash = function (value) { - return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval; -}; - -/** - * Test regexp. - */ - -/** - * is.regexp - * Test if `value` is a regular expression. - * - * @param {Mixed} value value to test - * @return {Boolean} true if `value` is a regexp, false otherwise - * @api public - */ - -is.regexp = function (value) { - return '[object RegExp]' === toString.call(value); -}; - -/** - * Test string. - */ - -/** - * is.string - * Test if `value` is a string. - * - * @param {Mixed} value value to test - * @return {Boolean} true if 'value' is a string, false otherwise - * @api public - */ - -is.string = function (value) { - return '[object String]' === toString.call(value); -}; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json deleted file mode 100644 index 975d47a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "is", - "author": { - "name": "Enrico Marino", - "url": "http://onirame.com" - }, - "description": "the definitive JavaScript type testing library", - "homepage": "https://github.com/enricomarino/is", - "keywords": [ - "util", - "type", - "test" - ], - "contributors": [ - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "dependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/enricomarino/is.git" - }, - "main": "index.js", - "version": "0.2.6", - "scripts": { - "test": "node test/index.js" - }, - "devDependencies": { - "tape": "~1.0.1", - "foreach": "~2.0.3" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0", - "chrome/22.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/5.0.5..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "engines": { - "node": "*" - }, - "readme": "# is\n\nThe definitive JavaScript type testing library\n\nTo be or not to be? This is the library!\n\n[![browser support][1]][2]\n\n## Installation\n\nAs a node.js module\n\n $ npm install is\n\nAs a component\n\n $ component install enricomarino/is\n\n## API\n\n### general\n\n - is.a (value, type) or is.type (value, type)\n - is.defined (value)\n - is.empty (value)\n - is.equal (value, other)\n - is.hosted (value, host)\n - is.instance (value, constructor)\n - is.instanceof (value, constructor) - deprecated, because in ES3 browsers, \"instanceof\" is a reserved word\n - is.null (value) - deprecated, because in ES3 browsers, \"null\" is a reserved word\n - is.undefined (value)\n\n### arguments\n\n - is.arguments (value)\n - is.arguments.empty (value)\n\n### array\n\n - is.array (value)\n - is.array.empty (value)\n - is.arraylike (value)\n\n### boolean\n\n - is.boolean (value)\n - is.false (value) - deprecated, because in ES3 browsers, \"false\" is a reserved word\n - is.true (value) - deprecated, because in ES3 browsers, \"true\" is a reserved word\n\n### date\n\n - is.date (value)\n\n### element\n\n - is.element (value)\n\n### error\n\n - is.error (value)\n\n### function\n\n - is.fn(value)\n - is.function(value) - deprecated, because in ES3 browsers, \"function\" is a reserved word\n\n### number\n\n - is.number (value)\n - is.infinite (value)\n - is.decimal (value)\n - is.divisibleBy (value, n)\n - is.int (value)\n - is.maximum (value, others)\n - is.minimum (value, others)\n - is.nan (value)\n - is.even (value)\n - is.odd (value)\n - is.ge (value, other)\n - is.gt (value, other)\n - is.le (value, other)\n - is.lt (value, other)\n - is.within (value, start, finish)\n\n### object\n\n - is.object (value)\n\n### regexp\n\n - is.regexp (value)\n\n### string\n\n - is.string (value)\n\n\n## Contributors\n\n- [Jordan Harband](https://github.com/ljharb)\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2013 Enrico Marino\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.\n\n[1]: https://ci.testling.com/enricomarino/is.png\n[2]: https://ci.testling.com/enricomarino/is\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/enricomarino/is/issues" - }, - "_id": "is@0.2.6", - "dist": { - "shasum": "36681b7c4328a75a6dd4b6d8f7131e4f81de55c0" - }, - "_from": "is@~0.2.6", - "_resolved": "https://registry.npmjs.org/is/-/is-0.2.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js deleted file mode 100644 index 32e1430..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/node_modules/is/test/index.js +++ /dev/null @@ -1,481 +0,0 @@ -var test = require('tape'); -var is = require('../index.js'); - -var forEach = require('foreach'); -var now = Date.now || function () { return +new Date(); }; - -test('is.type', function (t) { - var booleans = [true, false]; - forEach(booleans, function (boolean) { - t.ok(is.type(boolean, 'boolean'), '"' + boolean + '" is a boolean'); - }); - - var numbers = [1, 0 / 1, 0 / -1, NaN, Infinity, -Infinity]; - forEach(numbers, function (number) { - t.ok(is.type(number, 'number'), '"' + number + '" is a number'); - }); - - var objects = [{}, null, new Date()]; - forEach(objects, function (object) { - t.ok(is.type(object, 'object'), '"' + object + '" is an object'); - }); - - var strings = ['', 'abc']; - forEach(strings, function (string) { - t.ok(is.type(string, 'string'), '"' + string + '" is a string'); - }); - - t.ok(is.type(undefined, 'undefined'), 'undefined is undefined'); - - t.end(); -}); - -test('is.undefined', function (t) { - t.ok(is.undefined(), 'undefined is undefined'); - t.notOk(is.undefined(null), 'null is not undefined'); - t.notOk(is.undefined({}), 'object is not undefined'); - t.end(); -}); - -test('is.defined', function (t) { - t.notOk(is.defined(), 'undefined is not defined'); - t.ok(is.defined(null), 'null is defined'); - t.ok(is.defined({}), 'object is undefined'); - t.end(); -}); - -test('is.empty', function (t) { - t.ok(is.empty(''), 'empty string is empty'); - t.ok(is.empty([]), 'empty array is empty'); - t.ok(is.empty({}), 'empty object is empty'); - (function () { t.ok(is.empty(arguments), 'empty arguments is empty'); }()); - t.end(); -}); - -test('is.equal', function (t) { - t.ok(is.equal([1, 2, 3], [1, 2, 3]), 'arrays are shallowly equal'); - t.ok(is.equal([1, 2, [3, 4]], [1, 2, [3, 4]]), 'arrays are deep equal'); - t.ok(is.equal({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 }), 'objects are shallowly equal'); - t.ok(is.equal({ a: { b: 1 } }, { a: { b: 1 } }), 'objects are deep equal'); - var nowTS = now(); - t.ok(is.equal(new Date(nowTS), new Date(nowTS)), 'two equal date objects are equal'); - - var F = function () {}; - F.prototype = {}; - t.ok(is.equal(new F(), new F()), 'two object instances are equal when the prototype is the same'); - t.end(); -}); - -test('is.hosted', function (t) { - t.ok(is.hosted('a', { a: {} }), 'object is hosted'); - t.ok(is.hosted('a', { a: [] }), 'array is hosted'); - t.ok(is.hosted('a', { a: function () {} }), 'function is hosted'); - t.notOk(is.hosted('a', { a: true }), 'boolean value is not hosted'); - t.notOk(is.hosted('a', { a: false }), 'boolean value is not hosted'); - t.notOk(is.hosted('a', { a: 3 }), 'number value is not hosted'); - t.notOk(is.hosted('a', { a: undefined }), 'undefined value is not hosted'); - t.notOk(is.hosted('a', { a: 'abc' }), 'string value is not hosted'); - t.notOk(is.hosted('a', { a: null }), 'null value is not hosted'); - t.end(); -}); - -test('is.instance', function (t) { - t.ok(is.instance(new Date(), Date), 'new Date is instanceof Date'); - var F = function () {}; - t.ok(is.instance(new F(), F), 'new constructor is instanceof constructor'); - t.end(); -}); - -test('is.null', function (t) { - var isNull = is['null']; - t.ok(isNull(null), 'null is null'); - t.notOk(isNull(undefined), 'undefined is not null'); - t.notOk(isNull({}), 'object is not null'); - t.end(); -}); - -test('is.arguments', function (t) { - t.notOk(is.arguments([]), 'array is not arguments'); - (function () { t.ok(is.arguments(arguments), 'arguments is arguments'); }()); - (function () { t.notOk(is.arguments(Array.prototype.slice.call(arguments)), 'sliced arguments is not arguments'); }()); - t.end(); -}); - -test('is.array', function (t) { - t.ok(is.array([]), 'array is array'); - (function () { t.ok(is.array(Array.prototype.slice.call(arguments)), 'sliced arguments is array'); }()); - t.end(); -}); - -test('is.array.empty', function (t) { - t.ok(is.array.empty([]), 'empty array is empty array'); - (function () { t.notOk(is.array.empty(arguments), 'empty arguments is not empty array'); }()); - (function () { t.ok(is.array.empty(Array.prototype.slice.call(arguments)), 'empty sliced arguments is empty array'); }()); - t.end(); -}); - -test('is.arguments.empty', function (t) { - t.notOk(is.arguments.empty([]), 'empty array is not empty arguments'); - (function () { t.ok(is.arguments.empty(arguments), 'empty arguments is empty arguments'); }()); - (function () { t.notOk(is.arguments.empty(Array.prototype.slice.call(arguments)), 'empty sliced arguments is not empty arguments'); }()); - t.end(); -}); - -test('is.isarraylike', function (t) { - t.notOk(is.arraylike(), 'undefined is not array-like'); - t.notOk(is.arraylike(null), 'null is not array-like'); - t.notOk(is.arraylike(false), 'false is not array-like'); - t.notOk(is.arraylike(true), 'true is not array-like'); - t.ok(is.arraylike({ length: 0 }), 'object with zero length is array-like'); - t.ok(is.arraylike({ length: 1 }), 'object with positive length is array-like'); - t.notOk(is.arraylike({ length: -1 }), 'object with negative length is not array-like'); - t.notOk(is.arraylike({ length: NaN }), 'object with NaN length is not array-like'); - t.notOk(is.arraylike({ length: 'foo' }), 'object with string length is not array-like'); - t.notOk(is.arraylike({ length: '' }), 'object with empty string length is not array-like'); - t.ok(is.arraylike([]), 'array is array-like'); - (function () { t.ok(is.arraylike(arguments), 'empty arguments is array-like'); }()); - (function () { t.ok(is.arraylike(arguments), 'nonempty arguments is array-like'); }(1, 2, 3)); - t.end(); -}); - -test('is.boolean', function (t) { - t.ok(is.boolean(true), 'literal true is a boolean'); - t.ok(is.boolean(false), 'literal false is a boolean'); - t.ok(is.boolean(new Boolean(true)), 'object true is a boolean'); - t.ok(is.boolean(new Boolean(false)), 'object false is a boolean'); - t.notOk(is.boolean(), 'undefined is not a boolean'); - t.notOk(is.boolean(null), 'null is not a boolean'); - t.end(); -}); - -test('is.false', function (t) { - var isFalse = is['false']; - t.ok(isFalse(false), 'false is false'); - t.ok(isFalse(new Boolean(false)), 'object false is false'); - t.notOk(isFalse(true), 'true is not false'); - t.notOk(isFalse(), 'undefined is not false'); - t.notOk(isFalse(null), 'null is not false'); - t.notOk(isFalse(''), 'empty string is not false'); - t.end(); -}); - -test('is.true', function (t) { - var isTrue = is['true']; - t.ok(isTrue(true), 'true is true'); - t.ok(isTrue(new Boolean(true)), 'object true is true'); - t.notOk(isTrue(false), 'false is not true'); - t.notOk(isTrue(), 'undefined is not true'); - t.notOk(isTrue(null), 'null is not true'); - t.notOk(isTrue(''), 'empty string is not true'); - t.end(); -}); - -test('is.date', function (t) { - t.ok(is.date(new Date()), 'new Date is date'); - t.notOk(is.date(), 'undefined is not date'); - t.notOk(is.date(null), 'null is not date'); - t.notOk(is.date(''), 'empty string is not date'); - t.notOk(is.date(now()), 'timestamp is not date'); - var F = function () {}; - F.prototype = new Date(); - t.notOk(is.date(new F()), 'Date subtype is not date'); - t.end(); -}); - -test('is.element', function (t) { - if (typeof HTMLElement !== 'undefined') { - var element = document.createElement('div'); - t.ok(is.element(element), 'HTMLElement is element'); - t.notOk(is.element({ nodeType: 1 }), 'object with nodeType is not element'); - } else { - t.ok(true, 'Skipping is.element test in a non-browser environment'); - } - t.end(); -}); - -test('is.error', function (t) { - var err = new Error('foo'); - t.ok(is.error(err), 'Error is error'); - t.notOk(is.error({}), 'object is not error'); - t.notOk(is.error({ toString: function () { return '[object Error]'; } }), 'object with error\'s toString is not error'); - t.end(); -}); - -test('is.fn', function (t) { - t.equal(is['function'], is.fn, 'alias works'); - t.ok(is.fn(function () {}), 'function is function'); - t.ok(is.fn(console.log), 'console.log is function'); - if (typeof window !== 'undefined') { - // in IE7/8, typeof alert === 'object' - t.ok(is.fn(window.alert), 'window.alert is function'); - } - t.notOk(is.fn({}), 'object is not function'); - t.notOk(is.fn(null), 'null is not function'); - t.end(); -}); - -test('is.number', function (t) { - t.ok(is.number(0), 'positive zero is number'); - t.ok(is.number(0 / -1), 'negative zero is number'); - t.ok(is.number(3), 'three is number'); - t.ok(is.number(NaN), 'NaN is number'); - t.ok(is.number(Infinity), 'infinity is number'); - t.ok(is.number(-Infinity), 'negative infinity is number'); - t.ok(is.number(new Number(42)), 'object number is number'); - t.notOk(is.number(), 'undefined is not number'); - t.notOk(is.number(null), 'null is not number'); - t.notOk(is.number(true), 'true is not number'); - t.end(); -}); - -test('is.infinite', function (t) { - t.ok(is.infinite(Infinity), 'positive infinity is infinite'); - t.ok(is.infinite(-Infinity), 'negative infinity is infinite'); - t.notOk(is.infinite(NaN), 'NaN is not infinite'); - t.notOk(is.infinite(0), 'a number is not infinite'); - t.end(); -}); - -test('is.decimal', function (t) { - t.ok(is.decimal(1.1), 'decimal is decimal'); - t.notOk(is.decimal(0), 'zero is not decimal'); - t.notOk(is.decimal(1), 'integer is not decimal'); - t.notOk(is.decimal(NaN), 'NaN is not decimal'); - t.end(); -}); - -test('is.divisibleBy', function (t) { - t.ok(is.divisibleBy(4, 2), '4 is divisible by 2'); - t.ok(is.divisibleBy(4, 2), '4 is divisible by 2'); - t.ok(is.divisibleBy(0, 1), '0 is divisible by 1'); - t.ok(is.divisibleBy(Infinity, 1), 'infinity is divisible by anything'); - t.ok(is.divisibleBy(1, Infinity), 'anything is divisible by infinity'); - t.ok(is.divisibleBy(Infinity, Infinity), 'infinity is divisible by infinity'); - t.notOk(is.divisibleBy(1, 0), '1 is not divisible by 0'); - t.notOk(is.divisibleBy(NaN, 1), 'NaN is not divisible by 1'); - t.notOk(is.divisibleBy(1, NaN), '1 is not divisible by NaN'); - t.notOk(is.divisibleBy(NaN, NaN), 'NaN is not divisible by NaN'); - t.notOk(is.divisibleBy(1, 3), '1 is not divisible by 3'); - t.end(); -}); - -test('is.int', function (t) { - t.ok(is.int(0), '0 is integer'); - t.ok(is.int(3), '3 is integer'); - t.notOk(is.int(1.1), '1.1 is not integer'); - t.notOk(is.int(NaN), 'NaN is not integer'); - t.notOk(is.int(Infinity), 'infinity is not integer'); - t.notOk(is.int(null), 'null is not integer'); - t.notOk(is.int(), 'undefined is not integer'); - t.end(); -}); - -test('is.maximum', function (t) { - t.ok(is.maximum(3, [3, 2, 1]), '3 is maximum of [3,2,1]'); - t.ok(is.maximum(3, [1, 2, 3]), '3 is maximum of [1,2,3]'); - t.ok(is.maximum(4, [1, 2, 3]), '4 is maximum of [1,2,3]'); - t.ok(is.maximum('c', ['a', 'b', 'c']), 'c is maximum of [a,b,c]'); - t.notOk(is.maximum(2, [1, 2, 3]), '2 is not maximum of [1,2,3]'); - var error = new TypeError('second argument must be array-like'); - t.throws(function () { return is.maximum(2, null); }, error, 'throws when second value is not array-like'); - t.throws(function () { return is.maximum(2, {}); }, error, 'throws when second value is not array-like'); - t.end(); -}); - -test('is.minimum', function (t) { - t.ok(is.minimum(1, [1, 2, 3]), '1 is minimum of [1,2,3]'); - t.ok(is.minimum(0, [1, 2, 3]), '0 is minimum of [1,2,3]'); - t.ok(is.minimum('a', ['a', 'b', 'c']), 'a is minimum of [a,b,c]'); - t.notOk(is.minimum(2, [1, 2, 3]), '2 is not minimum of [1,2,3]'); - var error = new TypeError('second argument must be array-like'); - t.throws(function () { return is.minimum(2, null); }, error, 'throws when second value is not array-like'); - t.throws(function () { return is.minimum(2, {}); }, error, 'throws when second value is not array-like'); - t.end(); -}); - -test('is.nan', function (t) { - t.ok(is.nan(NaN), 'NaN is not a number'); - t.ok(is.nan('abc'), 'string is not a number'); - t.ok(is.nan(true), 'boolean is not a number'); - t.ok(is.nan({}), 'object is not a number'); - t.ok(is.nan([]), 'array is not a number'); - t.ok(is.nan(function () {}), 'function is not a number'); - t.notOk(is.nan(0), 'zero is a number'); - t.notOk(is.nan(3), 'three is a number'); - t.notOk(is.nan(1.1), '1.1 is a number'); - t.notOk(is.nan(Infinity), 'infinity is a number'); - t.end(); -}); - -test('is.even', function (t) { - t.ok(is.even(0), 'zero is even'); - t.ok(is.even(2), 'two is even'); - t.ok(is.even(Infinity), 'infinity is even'); - t.notOk(is.even(1), '1 is not even'); - t.notOk(is.even(), 'undefined is not even'); - t.notOk(is.even(null), 'null is not even'); - t.notOk(is.even(NaN), 'NaN is not even'); - t.end(); -}); - -test('is.odd', function (t) { - t.ok(is.odd(1), 'zero is odd'); - t.ok(is.odd(3), 'two is odd'); - t.ok(is.odd(Infinity), 'infinity is odd'); - t.notOk(is.odd(0), '0 is not odd'); - t.notOk(is.odd(2), '2 is not odd'); - t.notOk(is.odd(), 'undefined is not odd'); - t.notOk(is.odd(null), 'null is not odd'); - t.notOk(is.odd(NaN), 'NaN is not odd'); - t.end(); -}); - -test('is.ge', function (t) { - t.ok(is.ge(3, 2), '3 is greater than 2'); - t.notOk(is.ge(2, 3), '2 is not greater than 3'); - t.ok(is.ge(3, 3), '3 is greater than or equal to 3'); - t.ok(is.ge('abc', 'a'), 'abc is greater than a'); - t.ok(is.ge('abc', 'abc'), 'abc is greater than or equal to abc'); - t.notOk(is.ge('a', 'abc'), 'a is not greater than abc'); - t.notOk(is.ge(Infinity, 0), 'infinity is not greater than anything'); - t.notOk(is.ge(0, Infinity), 'anything is not greater than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.ge(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.ge(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.gt', function (t) { - t.ok(is.gt(3, 2), '3 is greater than 2'); - t.notOk(is.gt(2, 3), '2 is not greater than 3'); - t.notOk(is.gt(3, 3), '3 is not greater than 3'); - t.ok(is.gt('abc', 'a'), 'abc is greater than a'); - t.notOk(is.gt('abc', 'abc'), 'abc is not greater than abc'); - t.notOk(is.gt('a', 'abc'), 'a is not greater than abc'); - t.notOk(is.gt(Infinity, 0), 'infinity is not greater than anything'); - t.notOk(is.gt(0, Infinity), 'anything is not greater than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.gt(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.gt(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.le', function (t) { - t.ok(is.le(2, 3), '2 is lesser than or equal to 3'); - t.notOk(is.le(3, 2), '3 is not lesser than or equal to 2'); - t.ok(is.le(3, 3), '3 is lesser than or equal to 3'); - t.ok(is.le('a', 'abc'), 'a is lesser than or equal to abc'); - t.ok(is.le('abc', 'abc'), 'abc is lesser than or equal to abc'); - t.notOk(is.le('abc', 'a'), 'abc is not lesser than or equal to a'); - t.notOk(is.le(Infinity, 0), 'infinity is not lesser than or equal to anything'); - t.notOk(is.le(0, Infinity), 'anything is not lesser than or equal to infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.le(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.le(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.lt', function (t) { - t.ok(is.lt(2, 3), '2 is lesser than 3'); - t.notOk(is.lt(3, 2), '3 is not lesser than 2'); - t.notOk(is.lt(3, 3), '3 is not lesser than 3'); - t.ok(is.lt('a', 'abc'), 'a is lesser than abc'); - t.notOk(is.lt('abc', 'abc'), 'abc is not lesser than abc'); - t.notOk(is.lt('abc', 'a'), 'abc is not lesser than a'); - t.notOk(is.lt(Infinity, 0), 'infinity is not lesser than anything'); - t.notOk(is.lt(0, Infinity), 'anything is not lesser than infinity'); - var error = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.lt(NaN, 2); }, error, 'throws when first value is NaN'); - t.throws(function () { return is.lt(2, NaN); }, error, 'throws when second value is NaN'); - t.end(); -}); - -test('is.within', function (t) { - var nanError = new TypeError('NaN is not a valid value'); - t.throws(function () { return is.within(NaN, 0, 0); }, nanError, 'throws when first value is NaN'); - t.throws(function () { return is.within(0, NaN, 0); }, nanError, 'throws when second value is NaN'); - t.throws(function () { return is.within(0, 0, NaN); }, nanError, 'throws when third value is NaN'); - - var error = new TypeError('all arguments must be numbers'); - t.throws(function () { return is.within('', 0, 0); }, error, 'throws when first value is string'); - t.throws(function () { return is.within(0, '', 0); }, error, 'throws when second value is string'); - t.throws(function () { return is.within(0, 0, ''); }, error, 'throws when third value is string'); - t.throws(function () { return is.within({}, 0, 0); }, error, 'throws when first value is object'); - t.throws(function () { return is.within(0, {}, 0); }, error, 'throws when second value is object'); - t.throws(function () { return is.within(0, 0, {}); }, error, 'throws when third value is object'); - t.throws(function () { return is.within(null, 0, 0); }, error, 'throws when first value is null'); - t.throws(function () { return is.within(0, null, 0); }, error, 'throws when second value is null'); - t.throws(function () { return is.within(0, 0, null); }, error, 'throws when third value is null'); - t.throws(function () { return is.within(undefined, 0, 0); }, error, 'throws when first value is undefined'); - t.throws(function () { return is.within(0, undefined, 0); }, error, 'throws when second value is undefined'); - t.throws(function () { return is.within(0, 0, undefined); }, error, 'throws when third value is undefined'); - - t.ok(is.within(2, 1, 3), '2 is between 1 and 3'); - t.ok(is.within(0, -1, 1), '0 is between -1 and 1'); - t.ok(is.within(2, 0, Infinity), 'infinity always returns true'); - t.ok(is.within(2, Infinity, 2), 'infinity always returns true'); - t.ok(is.within(Infinity, 0, 1), 'infinity always returns true'); - t.notOk(is.within(2, -1, -1), '2 is not between -1 and 1'); - t.end(); -}); - -test('is.object', function (t) { - t.ok(is.object({}), 'object literal is object'); - t.notOk(is.object(), 'undefined is not an object'); - t.notOk(is.object(null), 'null is not an object'); - t.notOk(is.object(true), 'true is not an object'); - t.notOk(is.object(''), 'string is not an object'); - t.notOk(is.object(NaN), 'NaN is not an object'); - t.notOk(is.object(Object), 'object constructor is not an object'); - t.notOk(is.object(function () {}), 'function is not an object'); - t.end(); -}); - -test('is.hash', function (t) { - t.ok(is.hash({}), 'empty object literal is hash'); - t.ok(is.hash({ 1: 2, a: "b" }), 'object literal is hash'); - t.notOk(is.hash(), 'undefined is not a hash'); - t.notOk(is.hash(null), 'null is not a hash'); - t.notOk(is.hash(new Date()), 'date is not a hash'); - t.notOk(is.hash(new String()), 'string object is not a hash'); - t.notOk(is.hash(''), 'string literal is not a hash'); - t.notOk(is.hash(new Number()), 'number object is not a hash'); - t.notOk(is.hash(1), 'number literal is not a hash'); - t.notOk(is.hash(true), 'true is not a hash'); - t.notOk(is.hash(false), 'false is not a hash'); - t.notOk(is.hash(new Boolean()), 'boolean obj is not hash'); - t.notOk(is.hash(false), 'literal false is not hash'); - t.notOk(is.hash(true), 'literal true is not hash'); - if (typeof module !== 'undefined') { - t.ok(is.hash(module.exports), 'module.exports is a hash'); - } - if (typeof window !== 'undefined') { - t.notOk(is.hash(window), 'window is not a hash'); - t.notOk(is.hash(document.createElement('div')), 'element is not a hash'); - } else if (typeof process !== 'undefined') { - t.notOk(is.hash(global), 'global is not a hash'); - t.notOk(is.hash(process), 'process is not a hash'); - } - t.end(); -}); - -test('is.regexp', function (t) { - t.ok(is.regexp(/a/g), 'regex literal is regex'); - t.ok(is.regexp(new RegExp('a', 'g')), 'regex object is regex'); - t.notOk(is.regexp(), 'undefined is not regex'); - t.notOk(is.regexp(function () {}), 'function is not regex'); - t.notOk(is.regexp('/a/g'), 'string regex is not regex'); - t.end(); -}); - -test('is.string', function (t) { - t.ok(is.string('foo'), 'string literal is string'); - t.ok(is.string(new String('foo')), 'string literal is string'); - t.notOk(is.string(), 'undefined is not string'); - t.notOk(is.string(String), 'string constructor is not string'); - var F = function () {}; - F.prototype = new String(); - t.notOk(is.string(F), 'string subtype is not string'); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json deleted file mode 100644 index 4cb38a1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "object-keys", - "version": "0.2.0", - "author": { - "name": "Jordan Harband" - }, - "description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/kriskowal/es5-shim", - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/object-keys.git" - }, - "keywords": [ - "Object.keys", - "keys", - "ES5", - "shim" - ], - "dependencies": { - "foreach": "~2.0.1", - "indexof": "~0.0.1", - "is": "~0.2.6" - }, - "devDependencies": { - "tape": "~1.0.2" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "readme": "#object-keys [![Version Badge][2]][1]\n\n[![Build Status][3]][4] [![dependency status][5]][6]\n\n[![browser support][7]][8]\n\nAn Object.keys shim. Uses Object.keys if available.\n\n## Example\n\n```js\nvar keys = require('object-keys');\nvar assert = require('assert');\nvar obj = {\n\ta: true,\n\tb: true,\n\tc: true\n};\n\nassert.equal(keys(obj), ['a', 'b', 'c']);\n```\n\n## Source\nImplementation taken directly from [9]\n\n## Tests\nTests currently use tape - which doesn't work in node 0.10, but works in browserify. Rest assured, they pass.\n\n[1]: https://npmjs.org/package/object-keys\n[2]: http://vb.teelaun.ch/ljharb/object-keys.svg\n[3]: https://travis-ci.org/ljharb/object-keys.png\n[4]: https://travis-ci.org/ljharb/object-keys\n[5]: https://david-dm.org/ljharb/object-keys.png\n[6]: https://david-dm.org/ljharb/object-keys\n[7]: https://ci.testling.com/ljharb/object-keys.png\n[8]: https://ci.testling.com/ljharb/object-keys\n[9]: https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js#L542-589\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/ljharb/object-keys/issues" - }, - "_id": "object-keys@0.2.0", - "dist": { - "shasum": "cddec02998b091be42bf1035ae32e49f1cb6ea67" - }, - "deprecated": "Please update to the latest object-keys", - "_from": "object-keys@~0.2.0", - "_resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.2.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js deleted file mode 100644 index 0d13f4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/shim.js +++ /dev/null @@ -1,44 +0,0 @@ -(function () { - "use strict"; - - // modified from https://github.com/kriskowal/es5-shim - var has = Object.prototype.hasOwnProperty, - is = require('is'), - forEach = require('foreach'), - hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString'), - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ], - keysShim; - - keysShim = function keys(object) { - if (!is.object(object) && !is.array(object)) { - throw new TypeError("Object.keys called on a non-object"); - } - - var name, theKeys = []; - for (name in object) { - if (has.call(object, name)) { - theKeys.push(name); - } - } - - if (hasDontEnumBug) { - forEach(dontEnums, function (dontEnum) { - if (has.call(object, dontEnum)) { - theKeys.push(dontEnum); - } - }); - } - return theKeys; - }; - - module.exports = keysShim; -}()); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js deleted file mode 100644 index 6673701..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/node_modules/object-keys/test.js +++ /dev/null @@ -1,88 +0,0 @@ -var test = require('tape'); -var shimmedKeys = require('./index.js'); -var is = require('is'); -var keys = require('./shim.js'); -var forEach = require('foreach'); -var indexOf = require('indexof'); - -test('works', function (t) { - var obj = { - "str": "boz", - "obj": {}, - "arr": [], - "bool": true, - "num": 42, - "aNull": null, - "undef": undefined - }; - var objKeys = ['str', 'obj', 'arr', 'bool', 'num', 'aNull', 'undef']; - - t.test('exports a function', function (st) { - if (Object.keys) { - st.equal(Object.keys, shimmedKeys, 'Object.keys is supported and exported'); - } else { - st.equal(keys, shimmedKeys, 'Object.keys is not supported; shim is exported'); - } - st.end(); - }); - - t.test('working with actual shim', function (st) { - st.notEqual(Object.keys, keys, 'keys shim is not native Object.keys'); - st.end(); - }); - - t.test('works with an object literal', function (st) { - var theKeys = keys(obj); - st.equal(is.array(theKeys), true, 'returns an array'); - st.deepEqual(theKeys, objKeys, 'Object has expected keys'); - st.end(); - }); - - t.test('works with an array', function (st) { - var arr = [1, 2, 3]; - var theKeys = keys(arr); - st.equal(is.array(theKeys), true, 'returns an array'); - st.deepEqual(theKeys, ['0', '1', '2'], 'Array has expected keys'); - st.end(); - }); - - t.test('returns names which are own properties', function (st) { - forEach(keys(obj), function (name) { - st.equal(obj.hasOwnProperty(name), true, name + ' should be returned'); - }); - st.end(); - }); - - t.test('returns names which are enumerable', function (st) { - var k, loopedValues = []; - for (k in obj) { - loopedValues.push(k); - } - forEach(keys(obj), function (name) { - st.notEqual(indexOf(loopedValues, name), -1, name + ' is not enumerable'); - }); - st.end(); - }); - - t.test('throws an error for a non-object', function (st) { - st.throws( - function () { return keys(42); }, - new TypeError('Object.keys called on a non-object'), - 'throws on a non-object' - ); - st.end(); - }); - t.end(); -}); - -test('works with an object instance', function (t) { - var Prototype = function () {}; - Prototype.prototype.foo = true; - var obj = new Prototype(); - obj.bar = true; - var theKeys = keys(obj); - t.equal(is.array(theKeys), true, 'returns an array'); - t.deepEqual(theKeys, ['bar'], 'Instance has expected keys'); - t.end(); -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json deleted file mode 100644 index 6552b71..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "xtend", - "version": "2.0.6", - "description": "extend like a boss", - "keywords": [], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "main": "index", - "scripts": { - "test": "node test" - }, - "dependencies": { - "is-object": "~0.1.2", - "object-keys": "~0.2.0" - }, - "devDependencies": { - "tape": "~1.0.2" - }, - "homepage": "https://github.com/Raynos/xtend", - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/raynos/xtend/raw/master/LICENSE" - } - ], - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "engines": { - "node": ">=0.4" - }, - "readme": "# xtend\n\n[![browser support][3]][4]\n\nExtend like a boss\n\nxtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes presedence.\n\n## Examples\n\n```js\nvar extend = require(\"xtend\")\n\nvar combination = extend({\n a: \"a\"\n}, {\n b: \"b\"\n})\n// { a: \"a\", b: \"b\" }\n```\n\n\n## MIT Licenced\n\n\n [3]: http://ci.testling.com/Raynos/xtend.png\n [4]: http://ci.testling.com/Raynos/xtend\n", - "readmeFilename": "README.md", - "_id": "xtend@2.0.6", - "dist": { - "shasum": "0b24228c06a6e7adf36447626c37ae73f8ae7f23" - }, - "_from": "xtend@~2.0.6", - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-2.0.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js deleted file mode 100644 index 3369d79..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/node_modules/xtend/test.js +++ /dev/null @@ -1,63 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json deleted file mode 100644 index 1277837..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "through2", - "version": "0.1.0", - "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", - "main": "through2.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/rvagg/through2.git" - }, - "keywords": [ - "stream", - "streams2", - "through", - "transform" - ], - "author": { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.2", - "xtend": "~2.0.6" - }, - "devDependencies": { - "tape": "~1.0.4", - "bl": "~0.2.0", - "stream-spigot": "~2.0.0" - }, - "readme": "# through2\n\n[![Build Status](https://secure.travis-ci.org/rvagg/through2.png)](http://travis-ci.org/rvagg/through2)\n\n[![NPM](https://nodei.co/npm/through2.png?compact=true)](https://nodei.co/npm/through2/) \n\n**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise**\n\nInspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.\n\n```js\nfs.createReadStream('ex.txt')\n .pipe(through2(function (chunk, enc, callback) {\n for (var i = 0; i < chunk.length; i++)\n if (chunk[i] == 97)\n chunk[i] = 122 // swap 'a' for 'z'\n this.push(chunk)\n callback()\n }))\n .pipe(fs.createWriteStream('out.txt'))\n```\n\nOr object streams:\n\n```js\nvar all = []\nfs.createReadStream('data.csv')\n .pipe(csv2())\n .pipe(through2({ objectMode: true }, function (chunk, enc, callback) {\n \tvar data = {\n name : chunk[0]\n , address : chunk[3]\n , phone : chunk[10]\n }\n this.push(data)\n callback()\n }))\n .on('data', function (data) {\n all.push(data)\n })\n .on('end', function () {\n doSomethingSpecial(all)\n })\n```\n\n## API\n\nthrough2([ options, ] transformFunction[, flushFunction ])\n\nConsult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).\n\n### options\n\nThe options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams.\n\nThe `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:\n\n```js\nfs.createReadStream('/tmp/important.dat')\n\t.pipe(through2({ objectMode: true, allowHalfOpen: false }, function (chunk, enc, cb) {\n\t\tthis.push(new Buffer('wut?'))\n \tcb()\n\t})\n .pipe(fs.createWriteStream('/tmp/wut.txt'))\n```\n\n### transformFunction\n\nThe `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.\n\nTo queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on.\n\n### flushFunction\n\nThe optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.\n\nthrough2.ctor([ options, ] transformFunction[, flushFunction ])\n\nInstead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.\n\n```js\nvar FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {\n if (record.temp != null && record.unit = \"F\") {\n record.temp = ( ( record.temp - 32 ) * 5 ) / 9\n record.unit = \"C\"\n }\n this.push(record)\n callback()\n})\n\n// Create instances of FToC like so:\nvar converter = new FToC()\n// Or:\nvar converter = FToC()\n// Or specify/override options when you instantiate, if you prefer:\nvar converter = FToC({objectMode: true})\n\n```\n\n## License\n\n**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/rvagg/through2/issues" - }, - "_id": "through2@0.1.0", - "dist": { - "shasum": "18d0402eec882cf582ca4945ffbe7f205e7a9bc5" - }, - "_from": "through2@~0.1.0", - "_resolved": "https://registry.npmjs.org/through2/-/through2-0.1.0.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js deleted file mode 100644 index 13a328f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/test.js +++ /dev/null @@ -1,314 +0,0 @@ -const test = require('tape') - , through2 = require('./') - , crypto = require('crypto') - , bl = require('bl') - , spigot = require('stream-spigot') - -test('plain through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('pipeable through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - // bl() acts like a proper streams2 stream and passes as much as it's - // asked for, so we really only get one write with such a small amount - // of data - t.equal(s, 'aaaaaaaaaaaaaaaaaaaaaaaaa', 'got transformed string') - t.end() - })) - - var bufs = bl() - bufs.append(crypto.randomBytes(10)) - bufs.append(crypto.randomBytes(5)) - bufs.append(crypto.randomBytes(10)) - bufs.pipe(th2) -}) - -test('object through', function (t) { - t.plan(3) - - var th2 = through2({ objectMode: true}, function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('flushing through', function (t) { - var th2 = through2(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }, function (callback) { - this.push(new Buffer([ 101, 110, 100 ])) - callback() - }) - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal(s, 'aaaaaaaaaabbbbbccccccccccend', 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('plain through ctor', function (t) { - var Th2 = through2.ctor(function (chunk, enc, callback) { - if (!this._i) - this._i = 97 // 'a' - else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - var th2 = new Th2() - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - t.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('reuse through ctor', function (t) { - t.plan(4) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - if (!this._i) { - t.ok(1, 'did not contain previous instance data (this._i)') - this._i = 97 // 'a' - } else - this._i++ - var b = new Buffer(chunk.length) - for (var i = 0; i < chunk.length; i++) - b[i] = this._i - this.push(b) - callback() - }) - - var th2 = Th2() - - th2.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaaaaabbbbbcccccccccc', s, 'got transformed string') - - var newInstance = Th2() - newInstance.pipe(bl(function (err, b) { - var s = b.toString('ascii') - t.equal('aaaaaaabbbbccccccc', s, 'got transformed string') - })) - - newInstance.write(crypto.randomBytes(7)) - newInstance.write(crypto.randomBytes(4)) - newInstance.write(crypto.randomBytes(7)) - newInstance.end() - })) - - th2.write(crypto.randomBytes(10)) - th2.write(crypto.randomBytes(5)) - th2.write(crypto.randomBytes(10)) - th2.end() -}) - -test('object through ctor', function (t) { - t.plan(3) - - var Th2 = through2.ctor({ objectMode: true}, function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = new Th2() - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('pipeable object through ctor', function (t) { - t.plan(4) - - var Th2 = through2.ctor({ objectMode: true}, function (record, enc, callback) { - if (record.temp != null && record.unit == 'F') { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = 'C' - } - this.push(record) - callback() - }) - - var th2 = Th2() - - var expect = [-19, -40, 100, 22] - th2.on('data', function (o) { - t.deepEqual(o, { temp: expect.shift(), unit: 'C' }, 'got transformed object') - }) - - spigot([ - {temp: -2.2, unit: 'F'}, - {temp: -40, unit: 'F'}, - {temp: 212, unit: 'F'}, - {temp: 22, unit: 'C'} - ], {objectMode: true}).pipe(th2) -}) - -test('object through ctor override', function (t) { - t.plan(3) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({objectMode: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object settings available in transform', function (t) { - t.plan(6) - - var Th2 = through2.ctor({objectMode: true, peek: true}, function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2() - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object settings available in transform override', function (t) { - t.plan(6) - - var Th2 = through2.ctor(function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({objectMode: true, peek: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) - -test('object override extends options', function (t) { - t.plan(6) - - var Th2 = through2.ctor({objectMode: true}, function (chunk, enc, callback) { - t.ok(this.options.peek, "reading options from inside _transform") - this.push({ out: chunk.in + 1 }) - callback() - }) - - var th2 = Th2({peek: true}) - - var e = 0 - th2.on('data', function (o) { - t.deepEqual(o, { out: e === 0 ? 102 : e == 1 ? 203 : -99 }, 'got transformed object') - e++ - }) - - th2.write({ in: 101 }) - th2.write({ in: 202 }) - th2.write({ in: -100 }) - th2.end() -}) \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js deleted file mode 100644 index c1d1329..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/through2/through2.js +++ /dev/null @@ -1,35 +0,0 @@ -const Transform = require('stream').Transform || require('readable-stream/transform') - , inherits = require('util').inherits - , xtend = require('xtend') - -function ctor (options, transform, flush) { - if (typeof options == 'function') { - flush = transform - transform = options - options = {} - } - - function Through2 (override) { - if (!(this instanceof Through2)) - return new Through2(override) - - this.options = xtend(options, override) - Transform.call(this, this.options) - } - - inherits(Through2, Transform) - - Through2.prototype._transform = transform - - if (typeof flush == 'function') - Through2.prototype._flush = flush - - return Through2 -} - -function make (options, transform, flush) { - return ctor(options, transform, flush)() -} - -module.exports = make -module.exports.ctor = ctor \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/package.json deleted file mode 100644 index c86ddfb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "download", - "version": "0.1.7", - "description": "Download and extract files effortlessly", - "keywords": [ - "url", - "http", - "download", - "extract" - ], - "homepage": "https://github.com/kevva/download", - "bugs": { - "url": "https://github.com/kevva/download/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/download.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "download.js", - "files": [ - "download.js" - ], - "dependencies": { - "decompress": "~0.1.0", - "mkdirp": "~0.3.5", - "request": "~2.25.0", - "through2": "~0.1.0", - "async-foreach": "~0.1.3" - }, - "devDependencies": { - "mocha": "~1.12.0", - "rimraf": "~2.2.2" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# download [![Build Status](https://secure.travis-ci.org/kevva/download.png?branch=master)](http://travis-ci.org/kevva/download)\n\nDownload and extract files effortlessly in Node.js.\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/download): `npm install download`\n\n## Examples\n\nIf you're fetching an archive you can set `extract: true` in options and \nit'll extract it for you.\n\n```js\nvar download = require('download');\n\n// download and extract `foo.tar.gz` into `bar/`\ndownload('foo.tar.gz', 'bar', { extract: true });\n\n// download and save `foo.exe` into `bar/foo.exe` with mode `0755`\ndownload('foo.exe', 'bar', { mode: '0755' });\n\n// download and save an array of files in `bar/`\nvar files = ['foo.jpg', 'bar.jpg', 'cat.jpg'];\ndownload(files, 'bar');\n```\n\n## API\n\n### download(url, dest, opts)\n\nDownload a file or an array of files to a given destination.\n\n## Options\n\n* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/)\n* `mode` — Set mode on the downloaded files\n* `strip` — Equivalent to `--strip-components` for tar\n\nYou can also define options accepted by the [request](https://github.com/mikeal/request/) module.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "download@0.1.7", - "dist": { - "shasum": "78be2278a5600e515eff6b01cbf41d694baee855" - }, - "_from": "download@~0.1.2", - "_resolved": "https://registry.npmjs.org/download/-/download-0.1.7.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/.npmignore deleted file mode 100644 index 2ccbe46..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/.travis.yml deleted file mode 100644 index c1ffcb3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/History.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/History.md deleted file mode 100644 index d1fa533..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/History.md +++ /dev/null @@ -1,20 +0,0 @@ - -0.0.2 / 2013-05-29 -================== - - * Updated github url - * Fix bug calling isbin with list of paths - * Add tests for sync version - * Added travis CI passing image to readme - * Added node engines and keywords - * Added travis CI config - * Added basic readme - * Added basic test suite and Makefile - * Add async version - * Some refactorings using 'some' function - * Fixed issue with wrong paths if called multiple times - -0.0.1 / 2012-12-06 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/Makefile deleted file mode 100644 index 1a2444a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -REPORTER ?= dot - -test: - @NODE_ENV=test ./node_modules/mocha/bin/mocha -R $(REPORTER) - -.PHONY: test diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/README.md deleted file mode 100644 index 5224d61..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/README.md +++ /dev/null @@ -1,59 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/mbehrendt/isbin.png?branch=master)](https://travis-ci.org/mbehrendt/isbin) - -# Isbin - -Tiny little helper library to determine if a certain binary is available within $PATH or any additional folder. - -# Installation - -```bash -$ npm install isbin -``` - -# Usage - -```js -var isbin = require('isbin'); - -// Test against $PATH -isbin('mysql', function(exists) { - console.log(exists); // ==> Boolean -}); - -// With additional path to test -isbin('mysql', '/usr/local/bin', function(exists) { - console.log(exists); // ==> Boolean -}); - -// Or multiple ones -isbin('mysql', ['/usr/local/bin', '/home/me/bins'], function(exists) { - console.log(exists); // ==> Boolean -}); -``` - -There are also synchronous versions available - -```js -var exists = isbin('mysql'); -var exists = isbin('mysql', '/usr/local/bin'); -var exists = isbin('mysql', ['/usr/local/bin', '/home/me/bins']); -``` - -# Running the tests - -```bash -$ npm install -$ make test -``` - -# License - -(The MIT License) - -Copyright (c) 2012 Mario Behrendt info@mario-behrendt.de, Stephan Hoyer - -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/index.js deleted file mode 100644 index bb0a047..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/lib/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/lib/index.js deleted file mode 100644 index 1b8a5ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/lib/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Require dependencies - */ - -var fs = require('fs') - , async = require('async'); - -/** - * Check if given binary exists - * - * @param {String} bin Binary to test - * @param {String|Array} additional Additional paths to check - * @param {Function(result)} isbinChecked Callback when check is done async, optional - * @return {Boolean} True if binary was found - */ - -function isbin(bin, additional, isbinChecked) { - // isbin(bin, cb) - if (!isbinChecked) isbinChecked = additional; - - // Read $PATH to get set up bin folders - var paths = process.env.PATH.split(':') || []; - - // isbin(bin, 'path', cb) - if ('string' === typeof additional) { - paths.push(additional); - } - - // isbin(bin, ['path1', 'path2'], cb) - if ('object' === typeof additional && additional.length !== null) { - paths.concat(additional); - } - - // async check - if ('function' === typeof isbinChecked) { - return async.some(paths, function(path, pathChecked) { - fs.exists(path + '/' + bin, pathChecked); - }, isbinChecked); - } - - // sync check - return paths.reverse().some(function(path) { - return fs.existsSync(path + '/' + bin); - }); -}; - -/** - * Expose module - */ - -module.exports = isbin; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules deleted file mode 100644 index a9aae98..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "deps/nodeunit"] - path = deps/nodeunit - url = git://github.com/caolan/nodeunit.git -[submodule "deps/UglifyJS"] - path = deps/UglifyJS - url = https://github.com/mishoo/UglifyJS.git -[submodule "deps/nodelint"] - path = deps/nodelint - url = https://github.com/tav/nodelint.git diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -deps -dist -test -nodelint.cfg \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile deleted file mode 100644 index bad647c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -PACKAGE = asyncjs -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) -CWD := $(shell pwd) -NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit -UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs -NODELINT = $(CWD)/node_modules/nodelint/nodelint - -BUILDDIR = dist - -all: clean test build - -build: $(wildcard lib/*.js) - mkdir -p $(BUILDDIR) - $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js - -test: - $(NODEUNIT) test - -clean: - rm -rf $(BUILDDIR) - -lint: - $(NODELINT) --config nodelint.cfg lib/async.js - -.PHONY: test build all diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md deleted file mode 100644 index 1bbbc47..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/README.md +++ /dev/null @@ -1,1021 +0,0 @@ -# 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. - -Async provides around 20 functions that include the usual 'functional' -suspects (map, reduce, filter, forEach…) 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 - - 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'], path.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. - - -## Download - -Releases are available for download from -[GitHub](http://github.com/caolan/async/downloads). -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) - 17.5kb Uncompressed - -__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped - - -## In the Browser - -So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: - - - - - -## Documentation - -### Collections - -* [forEach](#forEach) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [until](#until) -* [waterfall](#waterfall) -* [queue](#queue) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - -
        -### forEach(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 forEach 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 which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // assuming openFiles is an array of file names and saveFile is a function - // to save the modified contents of that file: - - async.forEach(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error - }); - ---------------------------------------- - - -### forEachSeries(arr, iterator, callback) - -The same as forEach 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. - - ---------------------------------------- - - -### forEachLimit(arr, limit, iterator, callback) - -The same as forEach only the iterator is applied to batches of items in the -array, in series. The next batch of iterators is only called once the current -one has completed processing. - -__Arguments__ - -* arr - An array to iterate over. -* limit - How many items should be in each batch. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // Assume documents is an array of JSON objects and requestApi is a - // function that interacts with a rate-limited REST api. - - async.forEachLimit(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 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__ - - 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. - - ---------------------------------------- - - -### 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 path.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 which must be called once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - - async.filter(['file1','file2','file3'], path.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 filter, 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 its 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 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__ - - 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 which must be called 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__ - - async.detect(['file1','file2','file3'], path.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 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__ - - 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 path.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 which must be called 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__ - - async.some(['file1','file2','file3'], path.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 path.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 which must be called 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__ - - async.every(['file1','file2','file3'], path.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 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__ - - 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 it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - 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 it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - 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} - }); - - ---------------------------------------- - - -### 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 which must be called once it has completed with an optional - error as the first argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - - var count = 0; - - async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } - ); - - ---------------------------------------- - - -### 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. - - ---------------------------------------- - - -### 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 it - must call on completion. -* 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__ - - 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' - }); - - ---------------------------------------- - - -### 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. -* 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. -* 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__ - - // 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'); - }); - - ---------------------------------------- - - -### 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. - -__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 - syntax is easier to understand by looking at the example. -* 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. If all tasks complete - successfully, it will receive an object containing their results. - -__Example__ - - 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: - - 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(results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - email_link: 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. Its 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, each function is passed a callback it - must call on completion. - -__Example__ - - 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__ - - // 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: - - 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 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__ - - var call_order = []; - async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two] - }); - call_order.push('one') - - -## 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. - -__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__ - - 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__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); - }; - - 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__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); - }; - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js deleted file mode 100644 index 8e23845..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// This file is just added for convenience so this repository can be -// directly checked out into a project's deps folder -module.exports = require('./lib/async'); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js deleted file mode 100644 index 7cc4f5e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/lib/async.js +++ /dev/null @@ -1,692 +0,0 @@ -/*global setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root = this, - previous_async = root.async; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - else { - root.async = async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - //// cross-browser compatiblity functions //// - - var _forEach = 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 = []; - _forEach(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); - } - _forEach(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)) { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - } - else { - async.nextTick = process.nextTick; - } - - async.forEach = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _forEach(arr, function (x) { - iterator(x, function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - } - }); - }); - }; - - async.forEachSeries = 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.forEachLimit = function (arr, limit, 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.forEach].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEachSeries].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); - - - // 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.forEachSeries(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.forEach(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.forEach(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 () { - _forEach(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _forEach(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - if (err) { - callback(err); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - 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.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback(err); - 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.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - async.parallel = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.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 = {}; - async.forEach(_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.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.forEachSeries(_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.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.queue = function (worker, concurrency) { - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _forEach(data, function(task) { - q.tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (q.saturated && q.tasks.length == concurrency) { - q.saturated(); - } - async.nextTick(q.process); - }); - }, - 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; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if(q.drain && q.tasks.length + workers == 0) q.drain(); - q.process(); - }); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - 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]) { - _forEach(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.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - -}()); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json deleted file mode 100644 index 5e515b9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/node_modules/async/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./index", - "author": { - "name": "Caolan McMahon" - }, - "version": "0.1.22", - "repository": { - "type": "git", - "url": "http://github.com/caolan/async.git" - }, - "bugs": { - "url": "http://github.com/caolan/async/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\n ]);\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n \n \n\n\n## Documentation\n\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\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### forEach(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 forEach 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 which must be called once it has completed.\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 // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach 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### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\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 // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\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 which must be called once it has completed\n 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 async.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### 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### 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 path.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 which must be called 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 async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\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 filter, 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 its 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 which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n 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 async.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### 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 which must be called 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 async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\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 which must be called once it has completed\n with an error (which can be null) and a value to use as the sort 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 async.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 path.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 which must be called 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 async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\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 path.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 which must be called 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 async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\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 which must be called once it has completed\n 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 async.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### 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 it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.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\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.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 },\n function(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 a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.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\n function(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\n async.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 },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\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 which must be called once it has completed with an optional\n error as the first 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 var count = 0;\n\n async.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### 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\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 callback it\n must call on completion.\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 async.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\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.\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* 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 // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n\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\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 syntax is easier to understand by looking at the example.\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. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.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\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n async.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 ],\n function(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 email_link: function(callback){\n // once the file is written let's email a link to it...\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. Its 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, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> 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 // using apply\n\n async.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\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\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 setTimeout(callback, 0),\nwhich means other higher priority events 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 var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\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\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 var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\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 var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> 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 var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> 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", - "_id": "async@0.1.22", - "_from": "async@0.1.22", - "scripts": {}, - "dist": { - "shasum": "3b270eedc0419d6f92a664444ce98e0f59a8fef7" - }, - "_resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/package.json deleted file mode 100644 index d5ca65e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "isbin", - "version": "0.0.2", - "description": "Checks for available binaries on unix machines", - "main": "index.js", - "engines": { - "node": ">= 0.8.0" - }, - "keywords": [ - "fs", - "bin", - "binary", - "exists", - "check", - "path" - ], - "scripts": { - "test": "make test" - }, - "repository": { - "type": "git", - "url": "git://github.com/behrendtio/isbin.git" - }, - "author": "", - "license": "MIT", - "dependencies": { - "async": "0.1.22" - }, - "devDependencies": { - "mocha": "1.7.3", - "should": "1.2.1" - }, - "readme": "[![Build Status](https://secure.travis-ci.org/mbehrendt/isbin.png?branch=master)](https://travis-ci.org/mbehrendt/isbin)\n\n# Isbin\n\nTiny little helper library to determine if a certain binary is available within $PATH or any additional folder.\n\n# Installation\n\n```bash\n$ npm install isbin\n```\n\n# Usage\n\n```js\nvar isbin = require('isbin');\n\n// Test against $PATH\nisbin('mysql', function(exists) {\n console.log(exists); // ==> Boolean\n});\n\n// With additional path to test\nisbin('mysql', '/usr/local/bin', function(exists) {\n console.log(exists); // ==> Boolean\n});\n\n// Or multiple ones\nisbin('mysql', ['/usr/local/bin', '/home/me/bins'], function(exists) {\n console.log(exists); // ==> Boolean\n});\n```\n\nThere are also synchronous versions available\n\n```js\nvar exists = isbin('mysql');\nvar exists = isbin('mysql', '/usr/local/bin');\nvar exists = isbin('mysql', ['/usr/local/bin', '/home/me/bins']);\n```\n\n# Running the tests\n\n```bash\n$ npm install\n$ make test\n```\n\n# License\n\n(The MIT License)\n\nCopyright (c) 2012 Mario Behrendt info@mario-behrendt.de, Stephan Hoyer \n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/behrendtio/isbin/issues" - }, - "_id": "isbin@0.0.2", - "dist": { - "shasum": "2a35fb234ad5ee30f78da61b57e8f42ac43ec5a4" - }, - "_from": "isbin@0.0.2", - "_resolved": "https://registry.npmjs.org/isbin/-/isbin-0.0.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js deleted file mode 100644 index 068a38a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/test/isbin.js +++ /dev/null @@ -1,39 +0,0 @@ -var isbin = require('../'); - -describe('isbin', function() { - it('accepts binary, additional path and callback', function(done) { - isbin('ls', '/etc', function(exists) { - exists.should.be.a('boolean'); - done(); - }) - }); - - it('accepts array of paths', function(done) { - isbin('ls', ['/etc', '/home'], function(exists) { - exists.should.be.a('boolean'); - done(); - }); - }); - - it('accepts just binary and callback', function(done) { - isbin('ls', function(exists) { - exists.should.be.a('boolean'); - done(); - }); - }); - - it('accepts binary, additional path and callback', function() { - var exists = isbin('ls', '/etc'); - exists.should.be.a('boolean'); - }); - - it('accepts array of paths', function() { - var exists = isbin('ls', ['/etc', '/home']); - exists.should.be.a('boolean'); - }); - - it('accepts just binary', function() { - var exists = isbin('ls'); - exists.should.be.a('boolean'); - }); -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts deleted file mode 100644 index e5eb9f8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/isbin/test/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---require should ---bail ---ui bdd ---slow 100 diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.editorconfig b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.editorconfig deleted file mode 100644 index e036e24..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -; 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.jshintrc b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.jshintrc deleted file mode 100644 index bbdb29c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.jshintrc +++ /dev/null @@ -1,69 +0,0 @@ -{ - // 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.npmignore deleted file mode 100644 index 1341acd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.npmignore +++ /dev/null @@ -1,30 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.travis.yml b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.travis.yml deleted file mode 100644 index 36de153..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md deleted file mode 100644 index 0f5eac1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/CHANGELOG.md +++ /dev/null @@ -1,93 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md deleted file mode 100644 index 65d9add..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/CONTRIBUTING.md +++ /dev/null @@ -1,61 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/LICENSE.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/LICENSE.md deleted file mode 100644 index e9ccc2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/README.md deleted file mode 100644 index 872943b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/README.md +++ /dev/null @@ -1,63 +0,0 @@ -![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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array.js deleted file mode 100644 index 89d388b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array.js +++ /dev/null @@ -1,46 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/append.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/append.js deleted file mode 100644 index bf74037..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/append.js +++ /dev/null @@ -1,21 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/collect.js deleted file mode 100644 index 5863749..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/collect.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/combine.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/combine.js deleted file mode 100644 index d66e621..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/combine.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/compact.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/compact.js deleted file mode 100644 index 74c176e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/compact.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/contains.js deleted file mode 100644 index 92bb6ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/contains.js +++ /dev/null @@ -1,10 +0,0 @@ -var indexOf = require('./indexOf'); - - /** - * If array contains values. - */ - function contains(arr, val) { - return indexOf(arr, val) !== -1; - } - module.exports = contains; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/difference.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/difference.js deleted file mode 100644 index d057051..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/difference.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/every.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/every.js deleted file mode 100644 index ac59883..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/every.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/filter.js deleted file mode 100644 index ebeb58d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/filter.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/find.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/find.js deleted file mode 100644 index b4a7313..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/find.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js deleted file mode 100644 index 53f22a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/findIndex.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/flatten.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/flatten.js deleted file mode 100644 index aa9757a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/flatten.js +++ /dev/null @@ -1,43 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/forEach.js deleted file mode 100644 index 268e506..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/forEach.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js deleted file mode 100644 index 6a9ac83..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/indexOf.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/insert.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/insert.js deleted file mode 100644 index f1f95b7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/insert.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/intersection.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/intersection.js deleted file mode 100644 index e617006..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/intersection.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/invoke.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/invoke.js deleted file mode 100644 index c01aab1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/invoke.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/join.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/join.js deleted file mode 100644 index 71d8bd2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/join.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js deleted file mode 100644 index ee44a25..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/lastIndexOf.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/map.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/map.js deleted file mode 100644 index 54064f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/map.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/max.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/max.js deleted file mode 100644 index 183b10e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/max.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/min.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/min.js deleted file mode 100644 index dd00b6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/min.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/pick.js deleted file mode 100644 index 6a54846..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/pick.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/pluck.js deleted file mode 100644 index fef4043..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -var map = require('./map'); - - /** - * Extract a list of property values. - */ - function pluck(arr, propName){ - return map(arr, propName); - } - - module.exports = pluck; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/range.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/range.js deleted file mode 100644 index 31d3c77..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/range.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reduce.js deleted file mode 100644 index 1a350c6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reduce.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js deleted file mode 100644 index e36fd4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reduceRight.js +++ /dev/null @@ -1,34 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reject.js deleted file mode 100644 index 685f291..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/reject.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/remove.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/remove.js deleted file mode 100644 index aa6517d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/remove.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js deleted file mode 100644 index d5f7f3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/removeAll.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js deleted file mode 100644 index 97805ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/shuffle.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/some.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/some.js deleted file mode 100644 index 8d17772..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/some.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/sort.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/sort.js deleted file mode 100644 index 7807339..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/sort.js +++ /dev/null @@ -1,55 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/split.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/split.js deleted file mode 100644 index 4f3ba50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/split.js +++ /dev/null @@ -1,35 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js deleted file mode 100644 index ce4c55d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/toLookup.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/union.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/union.js deleted file mode 100644 index f1334a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/union.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/unique.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/unique.js deleted file mode 100644 index 0192b2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/unique.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/xor.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/xor.js deleted file mode 100644 index c125a99..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/xor.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/zip.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/zip.js deleted file mode 100644 index 931eb81..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/array/zip.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection.js deleted file mode 100644 index d5cf6ca..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection.js +++ /dev/null @@ -1,22 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/contains.js deleted file mode 100644 index a73f994..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/contains.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrContains = require('../array/contains'); -var objContains = require('../object/contains'); - - /** - */ - module.exports = make(arrContains, objContains); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/every.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/every.js deleted file mode 100644 index 300e03c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/every.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrEvery = require('../array/every'); -var objEvery = require('../object/every'); - - /** - */ - module.exports = make(arrEvery, objEvery); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/filter.js deleted file mode 100644 index 3875700..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/filter.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/find.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/find.js deleted file mode 100644 index 14317e6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/find.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js deleted file mode 100644 index 6e28dcb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/forEach.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrForEach = require('../array/forEach'); -var objForEach = require('../object/forOwn'); - - /** - */ - module.exports = make(arrForEach, objForEach); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/make_.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/make_.js deleted file mode 100644 index 029d27b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/make_.js +++ /dev/null @@ -1,19 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/map.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/map.js deleted file mode 100644 index fc157f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/map.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/max.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/max.js deleted file mode 100644 index a8490e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/max.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/min.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/min.js deleted file mode 100644 index 51d9f14..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/min.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js deleted file mode 100644 index 9b28377..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/pluck.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js deleted file mode 100644 index 4c07573..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/reduce.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrReduce = require('../array/reduce'); -var objReduce = require('../object/reduce'); - - /** - */ - module.exports = make(arrReduce, objReduce); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/reject.js deleted file mode 100644 index 2a92e3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/reject.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/size.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/size.js deleted file mode 100644 index 244e33e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/size.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/some.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/some.js deleted file mode 100644 index 48fd252..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/collection/some.js +++ /dev/null @@ -1,9 +0,0 @@ -var make = require('./make_'); -var arrSome = require('../array/some'); -var objSome = require('../object/some'); - - /** - */ - module.exports = make(arrSome, objSome); - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date.js deleted file mode 100644 index 1cde1a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date.js +++ /dev/null @@ -1,21 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js deleted file mode 100644 index 85905c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/dayOfTheYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/diff.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/diff.js deleted file mode 100644 index 1131cdc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/diff.js +++ /dev/null @@ -1,130 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js deleted file mode 100644 index f9526ce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/en-US.js +++ /dev/null @@ -1,61 +0,0 @@ - - // 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js deleted file mode 100644 index 71ebadb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n/pt-BR.js +++ /dev/null @@ -1,61 +0,0 @@ - - // 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js deleted file mode 100644 index 723fc10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/i18n_.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js deleted file mode 100644 index 4212870..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/isLeapYear.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/isSame.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/isSame.js deleted file mode 100644 index 4097d29..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/isSame.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js deleted file mode 100644 index 8ea2b17..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/parseIso.js +++ /dev/null @@ -1,146 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/startOf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/startOf.js deleted file mode 100644 index 072bc0e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/startOf.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/strftime.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/strftime.js deleted file mode 100644 index f033d10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/strftime.js +++ /dev/null @@ -1,118 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js deleted file mode 100644 index b100687..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneAbbr.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js deleted file mode 100644 index 9492dce..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/timezoneOffset.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js deleted file mode 100644 index 8aafeb8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInMonth.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js deleted file mode 100644 index b4b7e9b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/totalDaysInYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js deleted file mode 100644 index dd51b7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/date/weekOfTheYear.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/array.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/array.md deleted file mode 100644 index 1f390fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/array.md +++ /dev/null @@ -1,773 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/collection.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/collection.md deleted file mode 100644 index 2ffcab1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/collection.md +++ /dev/null @@ -1,233 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/date.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/date.md deleted file mode 100644 index b3f7f40..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/date.md +++ /dev/null @@ -1,295 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/function.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/function.md deleted file mode 100644 index 2695a02..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/function.md +++ /dev/null @@ -1,174 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/lang.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/lang.md deleted file mode 100644 index 56d7879..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/lang.md +++ /dev/null @@ -1,385 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/math.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/math.md deleted file mode 100644 index f45be3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/math.md +++ /dev/null @@ -1,298 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/number.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/number.md deleted file mode 100644 index 8d93865..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/number.md +++ /dev/null @@ -1,225 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/object.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/object.md deleted file mode 100644 index b4d5e48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/object.md +++ /dev/null @@ -1,780 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md deleted file mode 100644 index 1be3c10..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/queryString.md +++ /dev/null @@ -1,115 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/random.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/random.md deleted file mode 100644 index b058b4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/random.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/string.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/string.md deleted file mode 100644 index 2b28231..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/string.md +++ /dev/null @@ -1,594 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/time.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/time.md deleted file mode 100644 index 628c2a9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/doc/time.md +++ /dev/null @@ -1,64 +0,0 @@ -# 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function.js deleted file mode 100644 index 43a16ef..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function.js +++ /dev/null @@ -1,18 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/bind.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/bind.js deleted file mode 100644 index 71bc125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/bind.js +++ /dev/null @@ -1,23 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/compose.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/compose.js deleted file mode 100644 index 8cd5c5f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/compose.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/debounce.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/debounce.js deleted file mode 100644 index a0ed07f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/debounce.js +++ /dev/null @@ -1,29 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/func.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/func.js deleted file mode 100644 index b81bf0a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/func.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js deleted file mode 100644 index 767610a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/makeIterator_.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/partial.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/partial.js deleted file mode 100644 index d63ff1b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/partial.js +++ /dev/null @@ -1,19 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/prop.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/prop.js deleted file mode 100644 index 734acb7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/prop.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/series.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/series.js deleted file mode 100644 index 25159c2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/series.js +++ /dev/null @@ -1,22 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/throttle.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/throttle.js deleted file mode 100644 index 619dc54..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/throttle.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/timeout.js deleted file mode 100644 index e0d21a6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/function/timeout.js +++ /dev/null @@ -1,21 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/index.js deleted file mode 100644 index 32a1c63..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/**@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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang.js deleted file mode 100644 index b981621..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang.js +++ /dev/null @@ -1,36 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/clone.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/clone.js deleted file mode 100644 index 33c4e94..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/clone.js +++ /dev/null @@ -1,49 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js deleted file mode 100644 index bbc14c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/createObject.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js deleted file mode 100644 index d68dc50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/ctorApply.js +++ /dev/null @@ -1,17 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js deleted file mode 100644 index 25fd95f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/deepClone.js +++ /dev/null @@ -1,48 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js deleted file mode 100644 index 1111b2e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/defaults.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js deleted file mode 100644 index cd8a379..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/inheritPrototype.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/is.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/is.js deleted file mode 100644 index 4a83573..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/is.js +++ /dev/null @@ -1,23 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js deleted file mode 100644 index f7b08ba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArguments.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js deleted file mode 100644 index 262ee40..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isArray.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - var isArray = Array.isArray || function (val) { - return isKind(val, 'Array'); - }; - module.exports = isArray; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js deleted file mode 100644 index 86557cb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isBoolean.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isBoolean(val) { - return isKind(val, 'Boolean'); - } - module.exports = isBoolean; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js deleted file mode 100644 index 4a5130f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isDate.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isDate(val) { - return isKind(val, 'Date'); - } - module.exports = isDate; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js deleted file mode 100644 index 0e9f77d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isEmpty.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js deleted file mode 100644 index 6d4006f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFinite.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js deleted file mode 100644 index 216879f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isFunction.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isFunction(val) { - return isKind(val, 'Function'); - } - module.exports = isFunction; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js deleted file mode 100644 index 29f95d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isInteger.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js deleted file mode 100644 index 02301e0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isKind.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js deleted file mode 100644 index f6efeb1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNaN.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js deleted file mode 100644 index 6252f9e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNull.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - */ - function isNull(val){ - return val === null; - } - module.exports = isNull; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js deleted file mode 100644 index 126c1cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isNumber.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isNumber(val) { - return isKind(val, 'Number'); - } - module.exports = isNumber; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js deleted file mode 100644 index 7350c89..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isObject.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isObject(val) { - return isKind(val, 'Object'); - } - module.exports = isObject; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js deleted file mode 100644 index 0d2d7b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isPlainObject.js +++ /dev/null @@ -1,14 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js deleted file mode 100644 index fc5459a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isRegExp.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isRegExp(val) { - return isKind(val, 'RegExp'); - } - module.exports = isRegExp; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isString.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isString.js deleted file mode 100644 index f890658..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isString.js +++ /dev/null @@ -1,8 +0,0 @@ -var isKind = require('./isKind'); - /** - */ - function isString(val) { - return isKind(val, 'String'); - } - module.exports = isString; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js deleted file mode 100644 index fb2261d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isUndefined.js +++ /dev/null @@ -1,10 +0,0 @@ - - var UNDEF; - - /** - */ - function isUndef(val){ - return val === UNDEF; - } - module.exports = isUndef; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js deleted file mode 100644 index 9dad58c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/isnt.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js deleted file mode 100644 index 663464d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/kindOf.js +++ /dev/null @@ -1,20 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js deleted file mode 100644 index e39b873..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/toArray.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/toString.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/toString.js deleted file mode 100644 index ae5c2b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/lang/toString.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math.js deleted file mode 100644 index c6ee889..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math.js +++ /dev/null @@ -1,19 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/ceil.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/ceil.js deleted file mode 100644 index a279e15..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/ceil.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/clamp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/clamp.js deleted file mode 100644 index e929a9a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/clamp.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Clamps value inside range. - */ - function clamp(val, min, max){ - return val < min? min : (val > max? max : val); - } - module.exports = clamp; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js deleted file mode 100644 index 60ac90c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/countSteps.js +++ /dev/null @@ -1,16 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/floor.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/floor.js deleted file mode 100644 index 9de5053..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/floor.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/inRange.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/inRange.js deleted file mode 100644 index 763218f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/inRange.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/isNear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/isNear.js deleted file mode 100644 index 45486b6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/isNear.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Check if value is close to target. - */ - function isNear(val, target, threshold){ - return (Math.abs(val - target) <= threshold); - } - module.exports = isNear; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/lerp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/lerp.js deleted file mode 100644 index 111e271..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/lerp.js +++ /dev/null @@ -1,11 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/loop.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/loop.js deleted file mode 100644 index 35207c1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/loop.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * Loops value inside range. - */ - function loop(val, min, max){ - return val < min? max : (val > max? min : val); - } - - module.exports = loop; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/map.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/map.js deleted file mode 100644 index 96c4b78..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/map.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/norm.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/norm.js deleted file mode 100644 index 54caf78..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/norm.js +++ /dev/null @@ -1,9 +0,0 @@ - - /** - * Gets normalized ratio of value inside range. - */ - function norm(val, min, max){ - return (val - min) / (max - min); - } - module.exports = norm; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/round.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/round.js deleted file mode 100644 index d108e6c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/math/round.js +++ /dev/null @@ -1,12 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number.js deleted file mode 100644 index 0b6186c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number.js +++ /dev/null @@ -1,21 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js deleted file mode 100644 index 1d6f0e4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit signed integer value. (2^31 - 1) - */ - - module.exports = 2147483647; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js deleted file mode 100644 index 700da0f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MAX_UINT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit unsigned integet value (2^32 - 1) - */ - - module.exports = 4294967295; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js deleted file mode 100644 index b34ab2c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/MIN_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Minimum 32-bit signed integer value (-2^31). - */ - - module.exports = -2147483648; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js deleted file mode 100644 index dd6716b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/abbreviate.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js deleted file mode 100644 index 1cf0249..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/currencyFormat.js +++ /dev/null @@ -1,26 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js deleted file mode 100644 index f73a92d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/enforcePrecision.js +++ /dev/null @@ -1,13 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/pad.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/pad.js deleted file mode 100644 index da75270..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/pad.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/rol.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/rol.js deleted file mode 100644 index ecd58da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/rol.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/ror.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/ror.js deleted file mode 100644 index 2eda81d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/ror.js +++ /dev/null @@ -1,10 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/sign.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/sign.js deleted file mode 100644 index b854a4e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/sign.js +++ /dev/null @@ -1,15 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toInt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toInt.js deleted file mode 100644 index bcefae0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toInt.js +++ /dev/null @@ -1,15 +0,0 @@ - - - /** - * "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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js deleted file mode 100644 index 5290b62..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * "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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js deleted file mode 100644 index fcc5a97..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/number/toUInt31.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object.js deleted file mode 100644 index 76c0642..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object.js +++ /dev/null @@ -1,42 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js deleted file mode 100644 index b2f27d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/bindAll.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/contains.js deleted file mode 100644 index 8076e2c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/contains.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js deleted file mode 100644 index fcde944..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepEquals.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js deleted file mode 100644 index d27db44..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepFillIn.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js deleted file mode 100644 index 3366c52..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMatches.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js deleted file mode 100644 index a97e98d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/deepMixIn.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/equals.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/equals.js deleted file mode 100644 index f50cbe4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/equals.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/every.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/every.js deleted file mode 100644 index 01106e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/every.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js deleted file mode 100644 index 80dcdf0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/fillIn.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/filter.js deleted file mode 100644 index 3a83a92..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/filter.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/find.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/find.js deleted file mode 100644 index d39c070..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/find.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/forIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/forIn.js deleted file mode 100644 index 367f08c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/forIn.js +++ /dev/null @@ -1,62 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js deleted file mode 100644 index 5f2dfbf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/forOwn.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/functions.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/functions.js deleted file mode 100644 index f571797..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/functions.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/get.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/get.js deleted file mode 100644 index 6673561..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/get.js +++ /dev/null @@ -1,20 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/has.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/has.js deleted file mode 100644 index ca9f228..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/has.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js deleted file mode 100644 index 7e3c82a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/hasOwn.js +++ /dev/null @@ -1,12 +0,0 @@ - - - /** - * Safer Object.hasOwnProperty - */ - function hasOwn(obj, prop){ - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - module.exports = hasOwn; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/keys.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/keys.js deleted file mode 100644 index dd2f4f5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/keys.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/map.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/map.js deleted file mode 100644 index dd449a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/map.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/matches.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/matches.js deleted file mode 100644 index 6074faa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/matches.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/max.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/max.js deleted file mode 100644 index 3e8e92c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/max.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/merge.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/merge.js deleted file mode 100644 index 6961f60..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/merge.js +++ /dev/null @@ -1,40 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/min.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/min.js deleted file mode 100644 index e1e6697..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/min.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js deleted file mode 100644 index 55ec8fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/mixIn.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/namespace.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/namespace.js deleted file mode 100644 index c6e79f6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/namespace.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/pick.js deleted file mode 100644 index 74e56f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/pick.js +++ /dev/null @@ -1,18 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/pluck.js deleted file mode 100644 index e844df4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/pluck.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/reduce.js deleted file mode 100644 index 6f19a3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/reduce.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/reject.js deleted file mode 100644 index 7464379..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/reject.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/set.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/set.js deleted file mode 100644 index 9b3cdc4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/set.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/size.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/size.js deleted file mode 100644 index 9788595..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/size.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/some.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/some.js deleted file mode 100644 index 384c6f3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/some.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/unset.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/unset.js deleted file mode 100644 index 343bca0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/unset.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/values.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/values.js deleted file mode 100644 index 265a693..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/object/values.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/package.json deleted file mode 100644 index a3c1682..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString.js deleted file mode 100644 index 22685a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString.js +++ /dev/null @@ -1,15 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js deleted file mode 100644 index da678cf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/contains.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js deleted file mode 100644 index 7e68999..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/decode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js deleted file mode 100644 index 6d2b12f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/encode.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js deleted file mode 100644 index f149c3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getParam.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js deleted file mode 100644 index 5194af2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/getQuery.js +++ /dev/null @@ -1,13 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js deleted file mode 100644 index 532906c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/parse.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js deleted file mode 100644 index 052a9ba..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/queryString/setParam.js +++ /dev/null @@ -1,28 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random.js deleted file mode 100644 index d9267f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random.js +++ /dev/null @@ -1,16 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/choice.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/choice.js deleted file mode 100644 index 51aa82a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/choice.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/guid.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/guid.js deleted file mode 100644 index 41f6edd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/guid.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/rand.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/rand.js deleted file mode 100644 index 782dec8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/rand.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randBit.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randBit.js deleted file mode 100644 index bd20b4a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randBit.js +++ /dev/null @@ -1,11 +0,0 @@ -var random = require('./random'); - - /** - * Returns random bit (0 or 1) - */ - function randomBit() { - return random() > 0.5? 1 : 0; - } - - module.exports = randomBit; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randHex.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randHex.js deleted file mode 100644 index d8d711c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randHex.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randInt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randInt.js deleted file mode 100644 index e237d96..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randInt.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randSign.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randSign.js deleted file mode 100644 index 5a9fed7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/randSign.js +++ /dev/null @@ -1,11 +0,0 @@ -var random = require('./random'); - - /** - * Returns random sign (-1 or 1) - */ - function randomSign() { - return random() > 0.5? 1 : -1; - } - - module.exports = randomSign; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/random.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/random.js deleted file mode 100644 index 670a3cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/random/random.js +++ /dev/null @@ -1,18 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array.js deleted file mode 100644 index 7bcc961..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/append.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/append.js deleted file mode 100644 index 549d875..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/append.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js deleted file mode 100644 index 8f60cda..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/collect.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js deleted file mode 100644 index 22efb86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/combine.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js deleted file mode 100644 index 02a8109..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/compact.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js deleted file mode 100644 index fca4f7c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/contains.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['./indexOf'], function (indexOf) { - - /** - * If array contains values. - */ - function contains(arr, val) { - return indexOf(arr, val) !== -1; - } - return contains; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js deleted file mode 100644 index 819bda3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/difference.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/every.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/every.js deleted file mode 100644 index 78ba46d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/every.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js deleted file mode 100644 index 52cf685..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/filter.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/find.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/find.js deleted file mode 100644 index 3957dcd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/find.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js deleted file mode 100644 index 59dfeeb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/findIndex.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js deleted file mode 100644 index 42e87f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/flatten.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js deleted file mode 100644 index 0e04586..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/forEach.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js deleted file mode 100644 index 0e75f99..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/indexOf.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js deleted file mode 100644 index d8d831f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/insert.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js deleted file mode 100644 index 64e6ee9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/intersection.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js deleted file mode 100644 index a2e78b3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/invoke.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/join.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/join.js deleted file mode 100644 index 2c618d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/join.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js deleted file mode 100644 index 931235f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/lastIndexOf.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/map.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/map.js deleted file mode 100644 index 1580b48..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/map.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/max.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/max.js deleted file mode 100644 index a7326c8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/max.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/min.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/min.js deleted file mode 100644 index 4164448..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/min.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js deleted file mode 100644 index 97d7f59..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pick.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js deleted file mode 100644 index c908856..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./map'], function (map) { - - /** - * Extract a list of property values. - */ - function pluck(arr, propName){ - return map(arr, propName); - } - - return pluck; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/range.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/range.js deleted file mode 100644 index 148ebf9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/range.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js deleted file mode 100644 index 88aacfd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduce.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js deleted file mode 100644 index ddae0e7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reduceRight.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js deleted file mode 100644 index db105dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/reject.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js deleted file mode 100644 index dec9134..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/remove.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js deleted file mode 100644 index e81022b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/removeAll.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js deleted file mode 100644 index f5a6097..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/shuffle.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/some.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/some.js deleted file mode 100644 index e46a978..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/some.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js deleted file mode 100644 index 4c19404..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/sort.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/split.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/split.js deleted file mode 100644 index a17275e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/split.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js deleted file mode 100644 index aac8fd1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/toLookup.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/union.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/union.js deleted file mode 100644 index 5f9922e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/union.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js deleted file mode 100644 index c4bd23b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/unique.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js deleted file mode 100644 index 7df89d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/xor.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js deleted file mode 100644 index 374cd28..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/array/zip.js +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection.js deleted file mode 100644 index 386e6da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js deleted file mode 100644 index 192167e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/contains.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/contains', '../object/contains'], function (make, arrContains, objContains) { - - /** - */ - return make(arrContains, objContains); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js deleted file mode 100644 index 6317f50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/every.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/every', '../object/every'], function (make, arrEvery, objEvery) { - - /** - */ - return make(arrEvery, objEvery); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js deleted file mode 100644 index 4e7fadc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/filter.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js deleted file mode 100644 index 681f941..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/find.js +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js deleted file mode 100644 index 3b39d3e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/forEach.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/forEach', '../object/forOwn'], function (make, arrForEach, objForEach) { - - /** - */ - return make(arrForEach, objForEach); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js deleted file mode 100644 index 312e056..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/make_.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js deleted file mode 100644 index 96e2498..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/map.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js deleted file mode 100644 index de9a6da..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/max.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./make_', '../array/max', '../object/max'], function (make, arrMax, objMax) { - - /** - * Get maximum value inside collection - */ - return make(arrMax, objMax); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js deleted file mode 100644 index f0c239a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/min.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./make_', '../array/min', '../object/min'], function (make, arrMin, objMin) { - - /** - * Get minimum value inside collection. - */ - return make(arrMin, objMin); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js deleted file mode 100644 index ef784a7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/pluck.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js deleted file mode 100644 index bd05d43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reduce.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/reduce', '../object/reduce'], function (make, arrReduce, objReduce) { - - /** - */ - return make(arrReduce, objReduce); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js deleted file mode 100644 index 581adfd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/reject.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js deleted file mode 100644 index 4e5ab41..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/size.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js deleted file mode 100644 index c0aebee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/collection/some.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['./make_', '../array/some', '../object/some'], function (make, arrSome, objSome) { - - /** - */ - return make(arrSome, objSome); - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date.js deleted file mode 100644 index 4d44915..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js deleted file mode 100644 index dc77ae1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/dayOfTheYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js deleted file mode 100644 index 667165f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/diff.js +++ /dev/null @@ -1,128 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js deleted file mode 100644 index 5e640c2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/en-US.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js deleted file mode 100644 index 47256dd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n/pt-BR.js +++ /dev/null @@ -1,61 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js deleted file mode 100644 index c04ce88..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/i18n_.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js deleted file mode 100644 index e400b43..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isLeapYear.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js deleted file mode 100644 index f30531f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/isSame.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js deleted file mode 100644 index 9a2aacb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/parseIso.js +++ /dev/null @@ -1,146 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js deleted file mode 100644 index 747f114..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/startOf.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js deleted file mode 100644 index dd78250..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/strftime.js +++ /dev/null @@ -1,113 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js deleted file mode 100644 index 225a685..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneAbbr.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js deleted file mode 100644 index ca06705..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/timezoneOffset.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js deleted file mode 100644 index 98f7e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInMonth.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js deleted file mode 100644 index e9036b4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/totalDaysInYear.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js deleted file mode 100644 index 8dabc45..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/date/weekOfTheYear.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function.js deleted file mode 100644 index 23f4fd7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js deleted file mode 100644 index 09e5e20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/bind.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js deleted file mode 100644 index d8b228f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/compose.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js deleted file mode 100644 index 21644ec..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/debounce.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/func.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/func.js deleted file mode 100644 index b920e00..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/func.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js deleted file mode 100644 index deb6e13..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/makeIterator_.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js deleted file mode 100644 index ad73074..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/partial.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js deleted file mode 100644 index c9df78c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/prop.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/series.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/series.js deleted file mode 100644 index c8856a2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/series.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js deleted file mode 100644 index 8ce3929..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/throttle.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js deleted file mode 100644 index 15388bd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/function/timeout.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/index.js deleted file mode 100644 index 744bb11..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/**@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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang.js deleted file mode 100644 index de16b59..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js deleted file mode 100644 index 468489a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/clone.js +++ /dev/null @@ -1,47 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js deleted file mode 100644 index f766150..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/createObject.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js deleted file mode 100644 index a9ac1c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/ctorApply.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js deleted file mode 100644 index d45c10a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/deepClone.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js deleted file mode 100644 index 5156b1b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/defaults.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js deleted file mode 100644 index c1fda3a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/inheritPrototype.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js deleted file mode 100644 index 261a207..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/is.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js deleted file mode 100644 index f889ee8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArguments.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js deleted file mode 100644 index 886e2aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isArray.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - var isArray = Array.isArray || function (val) { - return isKind(val, 'Array'); - }; - return isArray; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js deleted file mode 100644 index 1ca27a6..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isBoolean.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isBoolean(val) { - return isKind(val, 'Boolean'); - } - return isBoolean; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js deleted file mode 100644 index 2708d67..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isDate.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isDate(val) { - return isKind(val, 'Date'); - } - return isDate; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js deleted file mode 100644 index 4cc3d2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isEmpty.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js deleted file mode 100644 index 5a982f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFinite.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js deleted file mode 100644 index ff5df7f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isFunction.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isFunction(val) { - return isKind(val, 'Function'); - } - return isFunction; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js deleted file mode 100644 index 1931f51..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isInteger.js +++ /dev/null @@ -1,12 +0,0 @@ -define(['./isNumber'], function (isNumber) { - - /** - * Check if value is an integer - */ - function isInteger(val){ - return isNumber(val) && (val % 1 === 0); - } - - return isInteger; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js deleted file mode 100644 index 6937a12..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isKind.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js deleted file mode 100644 index 9467a3c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNaN.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js deleted file mode 100644 index 506e05e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNull.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function () { - /** - */ - function isNull(val){ - return val === null; - } - return isNull; -}); - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js deleted file mode 100644 index 9a832c5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isNumber.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isNumber(val) { - return isKind(val, 'Number'); - } - return isNumber; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js deleted file mode 100644 index 0befb06..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isObject.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isObject(val) { - return isKind(val, 'Object'); - } - return isObject; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js deleted file mode 100644 index 6c5854f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isPlainObject.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js deleted file mode 100644 index d78a03d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isRegExp.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isRegExp(val) { - return isKind(val, 'RegExp'); - } - return isRegExp; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js deleted file mode 100644 index 8a42fe0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isString.js +++ /dev/null @@ -1,8 +0,0 @@ -define(['./isKind'], function (isKind) { - /** - */ - function isString(val) { - return isKind(val, 'String'); - } - return isString; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js deleted file mode 100644 index c57b28e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isUndefined.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function () { - var UNDEF; - - /** - */ - function isUndef(val){ - return val === UNDEF; - } - return isUndef; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js deleted file mode 100644 index d433622..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/isnt.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js deleted file mode 100644 index 97d21d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/kindOf.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js deleted file mode 100644 index 552916f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toArray.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js deleted file mode 100644 index c28b89a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/lang/toString.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math.js deleted file mode 100644 index e2ba870..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js deleted file mode 100644 index d73b058..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/ceil.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js deleted file mode 100644 index fb5a148..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/clamp.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function(){ - /** - * Clamps value inside range. - */ - function clamp(val, min, max){ - return val < min? min : (val > max? max : val); - } - return clamp; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js deleted file mode 100644 index 0ecb32f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/countSteps.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js deleted file mode 100644 index 8a4456b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/floor.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js deleted file mode 100644 index 0c89053..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/inRange.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js deleted file mode 100644 index b308a0b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/isNear.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js deleted file mode 100644 index 26b99d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/lerp.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js deleted file mode 100644 index c735ecf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/loop.js +++ /dev/null @@ -1,10 +0,0 @@ -define(function(){ - /** - * Loops value inside range. - */ - function loop(val, min, max){ - return val < min? max : (val > max? min : val); - } - - return loop; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/map.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/map.js deleted file mode 100644 index bf7dc5d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/map.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js deleted file mode 100644 index fccae20..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/norm.js +++ /dev/null @@ -1,9 +0,0 @@ -define(function(){ - /** - * Gets normalized ratio of value inside range. - */ - function norm(val, min, max){ - return (val - min) / (max - min); - } - return norm; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/round.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/round.js deleted file mode 100644 index b43e4ac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/math/round.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number.js deleted file mode 100644 index cb52fc7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js deleted file mode 100644 index 23a6e1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit signed integer value. (2^31 - 1) - */ -define(function(){ - return 2147483647; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js deleted file mode 100644 index a035096..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MAX_UINT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Maximum 32-bit unsigned integet value (2^32 - 1) - */ -define(function(){ - return 4294967295; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js deleted file mode 100644 index 9b3e978..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/MIN_INT.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @constant Minimum 32-bit signed integer value (-2^31). - */ -define(function(){ - return -2147483648; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js deleted file mode 100644 index 7e7405a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/abbreviate.js +++ /dev/null @@ -1,35 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js deleted file mode 100644 index dcde8fc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/currencyFormat.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js deleted file mode 100644 index 84554d0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/enforcePrecision.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js deleted file mode 100644 index 3b2c062..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/pad.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js deleted file mode 100644 index a148f44..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/rol.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js deleted file mode 100644 index b5c66f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/ror.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js deleted file mode 100644 index dfc131d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/sign.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js deleted file mode 100644 index 1e9b4c0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toInt.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js deleted file mode 100644 index d5b25b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js deleted file mode 100644 index 9785a05..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/number/toUInt31.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object.js deleted file mode 100644 index 343e782..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object.js +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js deleted file mode 100644 index b131ed1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/bindAll.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js deleted file mode 100644 index 297e898..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/contains.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js deleted file mode 100644 index 8b7d5d1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepEquals.js +++ /dev/null @@ -1,26 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js deleted file mode 100644 index 84ba154..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepFillIn.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js deleted file mode 100644 index 2eae629..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMatches.js +++ /dev/null @@ -1,54 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js deleted file mode 100644 index 1b4178e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/deepMixIn.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js deleted file mode 100644 index 596cb95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/equals.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/every.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/every.js deleted file mode 100644 index 52983a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/every.js +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js deleted file mode 100644 index 0845d3c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/fillIn.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js deleted file mode 100644 index f213b91..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/filter.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/find.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/find.js deleted file mode 100644 index 47e6b09..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/find.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js deleted file mode 100644 index 2058e9c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forIn.js +++ /dev/null @@ -1,62 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js deleted file mode 100644 index b40cbaf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/forOwn.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js deleted file mode 100644 index 60fee3d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/functions.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/get.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/get.js deleted file mode 100644 index ca80b05..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/get.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/has.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/has.js deleted file mode 100644 index cc29817..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/has.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js deleted file mode 100644 index 5c53bcf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/hasOwn.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - /** - * Safer Object.hasOwnProperty - */ - function hasOwn(obj, prop){ - return Object.prototype.hasOwnProperty.call(obj, prop); - } - - return hasOwn; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js deleted file mode 100644 index ed7c4f9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/keys.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/map.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/map.js deleted file mode 100644 index 2958f6b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/map.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js deleted file mode 100644 index 73ff427..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/matches.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/max.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/max.js deleted file mode 100644 index ef311dc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/max.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js deleted file mode 100644 index d7cfede..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/merge.js +++ /dev/null @@ -1,38 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/min.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/min.js deleted file mode 100644 index 9fb4c1a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/min.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js deleted file mode 100644 index 6210b7e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/mixIn.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js deleted file mode 100644 index 7ed65db..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/namespace.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js deleted file mode 100644 index 76e22bf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pick.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js deleted file mode 100644 index d47744b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/pluck.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js deleted file mode 100644 index d3a5778..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reduce.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js deleted file mode 100644 index 8429642..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/reject.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/set.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/set.js deleted file mode 100644 index b8fa25a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/set.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/size.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/size.js deleted file mode 100644 index c6e377c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/size.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['./forOwn'], function (forOwn) { - - /** - * Get object size - */ - function size(obj) { - var count = 0; - forOwn(obj, function(){ - count++; - }); - return count; - } - - return size; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/some.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/some.js deleted file mode 100644 index 1bd6fda..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/some.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js deleted file mode 100644 index 787fc19..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/unset.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/values.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/values.js deleted file mode 100644 index b311fd0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/object/values.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString.js deleted file mode 100644 index 4434612..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js deleted file mode 100644 index a6d11cc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/contains.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js deleted file mode 100644 index 02bc160..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/decode.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js deleted file mode 100644 index bd72a5b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/encode.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js deleted file mode 100644 index d981372..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getParam.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js deleted file mode 100644 index aa3d99f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/getQuery.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js deleted file mode 100644 index ac153e3..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/parse.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js deleted file mode 100644 index 97081aa..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/queryString/setParam.js +++ /dev/null @@ -1,28 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random.js deleted file mode 100644 index b2641ee..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js deleted file mode 100644 index 0d0c38d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/choice.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js deleted file mode 100644 index 82f3a2d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/guid.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js deleted file mode 100644 index b8c231d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/rand.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js deleted file mode 100644 index b3422d2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randBit.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./random'], function (random) { - - /** - * Returns random bit (0 or 1) - */ - function randomBit() { - return random() > 0.5? 1 : 0; - } - - return randomBit; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js deleted file mode 100644 index 6e9bf1c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randHex.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js deleted file mode 100644 index 1750e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randInt.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js deleted file mode 100644 index 4141cdf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/randSign.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['./random'], function (random) { - - /** - * Returns random sign (-1 or 1) - */ - function randomSign() { - return random() > 0.5? 1 : -1; - } - - return randomSign; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/random.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/random.js deleted file mode 100644 index 4270822..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/random/random.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string.js deleted file mode 100644 index 3f5fd80..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js deleted file mode 100644 index e830d86..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/WHITE_SPACES.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js deleted file mode 100644 index 02e6c04..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/camelCase.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js deleted file mode 100644 index 825b5a5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/contains.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js deleted file mode 100644 index 3c073f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/crop.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js deleted file mode 100644 index 31a73f2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/endsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js deleted file mode 100644 index de34b61..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js deleted file mode 100644 index 32facac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeRegExp.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js deleted file mode 100644 index bd5e8c4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/escapeUnicode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js deleted file mode 100644 index 679c405..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/hyphenate.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js deleted file mode 100644 index ecb8ba8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/interpolate.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js deleted file mode 100644 index b045d69..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lowerCase.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['../lang/toString'], function(toString){ - /** - * "Safer" String.toLowerCase() - */ - function lowerCase(str){ - str = toString(str); - return str.toLowerCase(); - } - - return lowerCase; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js deleted file mode 100644 index ea4f5fb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/lpad.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js deleted file mode 100644 index 477df95..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/ltrim.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js deleted file mode 100644 index 7aa7bab..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/makePath.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js deleted file mode 100644 index 44e4194..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/normalizeLineBreaks.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js deleted file mode 100644 index ead9ead..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/pascalCase.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js deleted file mode 100644 index 2987b50..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/properCase.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js deleted file mode 100644 index 4905869..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonASCII.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js deleted file mode 100644 index 2b1a204..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/removeNonWord.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js deleted file mode 100644 index 02f5659..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/repeat.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js deleted file mode 100644 index 8b762fd..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replace.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js deleted file mode 100644 index 3a63f55..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/replaceAccents.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js deleted file mode 100644 index 2efd9c8..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rpad.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js deleted file mode 100644 index a4cc282..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/rtrim.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js deleted file mode 100644 index cfe45af..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/sentenceCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js deleted file mode 100644 index c6d68c7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/slugify.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js deleted file mode 100644 index 88ae545..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/startsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js deleted file mode 100644 index e8da956..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/stripHtmlTags.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js deleted file mode 100644 index 5552604..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/trim.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js deleted file mode 100644 index 34000d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/truncate.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js deleted file mode 100644 index a7c8315..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/typecast.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js deleted file mode 100644 index eeef39b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unCamelCase.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js deleted file mode 100644 index 75dd464..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/underscore.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js deleted file mode 100644 index 173c69c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js deleted file mode 100644 index d4a7ba1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unescapeUnicode.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js deleted file mode 100644 index 6ac2fa4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/unhyphenate.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js deleted file mode 100644 index 8b2073e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/string/upperCase.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['../lang/toString'], function(toString){ - /** - * "Safer" String.toUpperCase() - */ - function upperCase(str){ - str = toString(str); - return str.toUpperCase(); - } - return upperCase; -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time.js deleted file mode 100644 index 67c9068..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js deleted file mode 100644 index 2de0cf2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/convert.js +++ /dev/null @@ -1,41 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/now.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/now.js deleted file mode 100644 index a3a38bc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/now.js +++ /dev/null @@ -1,12 +0,0 @@ -define(function () { - - /** - * Get current time in miliseconds - */ - var now = (typeof Date.now === 'function')? Date.now : function(){ - return +(new Date()); - }; - - return now; - -}); diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js deleted file mode 100644 index 964929a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/parseMs.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js deleted file mode 100644 index edf1821..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/src/time/toTimeString.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string.js deleted file mode 100644 index 7f0ca3b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string.js +++ /dev/null @@ -1,45 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js deleted file mode 100644 index 03e0125..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/WHITE_SPACES.js +++ /dev/null @@ -1,12 +0,0 @@ - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js deleted file mode 100644 index aadb69a..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/camelCase.js +++ /dev/null @@ -1,20 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/contains.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/contains.js deleted file mode 100644 index cb22cae..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/contains.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/crop.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/crop.js deleted file mode 100644 index 53b93b4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/crop.js +++ /dev/null @@ -1,12 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js deleted file mode 100644 index d504e9d..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/endsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js deleted file mode 100644 index e67c4b2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js deleted file mode 100644 index 70cb84f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeRegExp.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js deleted file mode 100644 index ec649ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/escapeUnicode.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js deleted file mode 100644 index 95e3243..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/hyphenate.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js deleted file mode 100644 index ac88fac..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/interpolate.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js deleted file mode 100644 index 30bb7ad..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/lowerCase.js +++ /dev/null @@ -1,11 +0,0 @@ -var toString = require('../lang/toString'); - /** - * "Safer" String.toLowerCase() - */ - function lowerCase(str){ - str = toString(str); - return str.toLowerCase(); - } - - module.exports = lowerCase; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/lpad.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/lpad.js deleted file mode 100644 index 694d711..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/lpad.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js deleted file mode 100644 index 23d7b33..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/ltrim.js +++ /dev/null @@ -1,34 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/makePath.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/makePath.js deleted file mode 100644 index 69aef31..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/makePath.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js deleted file mode 100644 index 8a8dccf..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/normalizeLineBreaks.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js deleted file mode 100644 index fd19035..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/pascalCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/properCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/properCase.js deleted file mode 100644 index 61636be..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/properCase.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js deleted file mode 100644 index fb46381..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonASCII.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js deleted file mode 100644 index bdd153b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/removeNonWord.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/repeat.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/repeat.js deleted file mode 100644 index 0f9b475..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/repeat.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/replace.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/replace.js deleted file mode 100644 index 14433fc..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/replace.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js deleted file mode 100644 index bb22126..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/replaceAccents.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/rpad.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/rpad.js deleted file mode 100644 index 99f6378..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/rpad.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js deleted file mode 100644 index 66ba80e..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/rtrim.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js deleted file mode 100644 index 354104c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/sentenceCase.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/slugify.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/slugify.js deleted file mode 100644 index 142f0d9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/slugify.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js deleted file mode 100644 index bce2bd2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/startsWith.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js deleted file mode 100644 index 01d17b0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/stripHtmlTags.js +++ /dev/null @@ -1,11 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/trim.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/trim.js deleted file mode 100644 index 9652b0c..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/trim.js +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/truncate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/truncate.js deleted file mode 100644 index a98d6c7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/truncate.js +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/typecast.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/typecast.js deleted file mode 100644 index c1386a4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/typecast.js +++ /dev/null @@ -1,29 +0,0 @@ - - - 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js deleted file mode 100644 index 4968f37..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unCamelCase.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/underscore.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/underscore.js deleted file mode 100644 index ebd6e2b..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/underscore.js +++ /dev/null @@ -1,13 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js deleted file mode 100644 index 52cf3f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeHtml.js +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js deleted file mode 100644 index 0b7fb73..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unescapeUnicode.js +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js deleted file mode 100644 index 311dfa1..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/unhyphenate.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js deleted file mode 100644 index 6c92552..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/string/upperCase.js +++ /dev/null @@ -1,10 +0,0 @@ -var toString = require('../lang/toString'); - /** - * "Safer" String.toUpperCase() - */ - function upperCase(str){ - str = toString(str); - return str.toUpperCase(); - } - module.exports = upperCase; - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time.js deleted file mode 100644 index 9f53329..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time.js +++ /dev/null @@ -1,12 +0,0 @@ - - -//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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/convert.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/convert.js deleted file mode 100644 index 852a0f0..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/convert.js +++ /dev/null @@ -1,41 +0,0 @@ - - - /** - * 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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/now.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/now.js deleted file mode 100644 index effcfbe..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/now.js +++ /dev/null @@ -1,12 +0,0 @@ - - - /** - * Get current time in miliseconds - */ - var now = (typeof Date.now === 'function')? Date.now : function(){ - return +(new Date()); - }; - - module.exports = now; - - diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js deleted file mode 100644 index 6d99797..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/parseMs.js +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js deleted file mode 100644 index 101d69f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/mout/time/toTimeString.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/.npmignore b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/History.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/History.md deleted file mode 100644 index 8811948..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/History.md +++ /dev/null @@ -1,42 +0,0 @@ - -1.0.0 / 2013-06-18 -================== - - * remove .version - * >=. Closes #19 - * Merge pull request #15 from davglass/readline-osx - * On OSX revert back to terminal hack to avoid a readline bug - -0.1.0 / 2012-09-19 -================== - - * Fixed logic bug that caused bar to jump one extra space at the end [davglass] - * Working with readline impl, even on Windows [davglass] - * Using readline instead of the \r hack [davglass] - -0.0.5 / 2012-08-07 -================== - - * add ability to tick by zero chunks - tick(0) - * fix ETA. Closes #4 [lwille] - -0.0.4 / 2011-11-14 -================== - - * Allow more recent versions of node - -0.0.3 / 2011-04-20 -================== - - * Changed; erase the line when complete - -0.0.2 / 2011-04-20 -================== - - * Added custom tokens support - * Fixed; clear line before writing - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/Makefile b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/Makefile deleted file mode 100644 index 36a3ed7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @echo "populate me" - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/Readme.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/Readme.md deleted file mode 100644 index 4e08a49..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/Readme.md +++ /dev/null @@ -1,117 +0,0 @@ -# node-progress - - Flexible ascii progress bar - -## Installation - - npm install progress - -## Usage - - First we create a `ProgressBar`, giving it a format string - as well as the `total`, telling the progress bar when it will - be considered complete. After that all we need to do is `tick()` appropriately. - -```javascript -var ProgressBar = require('progress'); - -var bar = new ProgressBar(':bar', { total: 10 }); -var timer = setInterval(function(){ - bar.tick(); - if (bar.complete) { - console.log('\ncomplete\n'); - clearInterval(timer); - } -}, 100); -``` - -## Options: - - - `total` total number of ticks to complete - - `width` the displayed width of the progress bar defaulting to total - - `stream` the output stream defaulting to stdout - - `complete` completion character defaulting to "=" - - `incomplete` incomplete character defaulting to "-" - - `clear` option to clear the bar on completion defaulting to false - - `callback` optional function to call when the progress bar completes - -## Tokens: - - - `:bar` the progress bar itself - - `:current` current tick number - - `:total` total ticks - - `:elapsed` time elapsed in seconds - - `:percent` completion percentage - - `:eta` estimated completion time in seconds - -## Examples - -### Download - - In our download example each tick has a variable influence, so we pass the chunk length which adjusts the progress bar appropriately relative to the total length. - -```javascript -var ProgressBar = require('../') - , https = require('https'); - -var req = https.request({ - host: 'download.github.com' - , port: 443 - , path: '/visionmedia-node-jscoverage-0d4608a.zip' -}); - -req.on('response', function(res){ - var len = parseInt(res.headers['content-length'], 10); - - console.log(); - var bar = new ProgressBar(' downloading [:bar] :percent :etas', { - complete: '=' - , incomplete: ' ' - , width: 20 - , total: len - }); - - res.on('data', function(chunk){ - bar.tick(chunk.length); - }); - - res.on('end', function(){ - console.log('\n'); - }); -}); - -req.end(); -``` - - The code above will generate a progress bar that looks like this: - -``` -downloading [===== ] 29% 3.7s -``` - -You can see more examples in the `examples` folder. - -## License - -(The MIT License) - -Copyright (c) 2011 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. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/index.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/index.js deleted file mode 100644 index 07ef91f..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/node-progress'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js deleted file mode 100644 index 638d919..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/lib/node-progress.js +++ /dev/null @@ -1,172 +0,0 @@ -/*! - * node-progress - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Expose `ProgressBar`. - */ - -exports = module.exports = ProgressBar; - -/** - * Initialize a `ProgressBar` with the given - * `fmt` string and `options`. - * - * Options: - * - * - `total` total number of ticks to complete - * - `width` the displayed width of the progress bar defaulting to total - * - `stream` the output stream defaulting to stdout - * - `complete` completion character defaulting to "=" - * - `incomplete` incomplete character defaulting to "-" - * - `callback` optional function to call when the progress bar completes - * - * Tokens: - * - * - `:bar` the progress bar itself - * - `:current` current tick number - * - `:total` total ticks - * - `:elapsed` time elapsed in seconds - * - `:percent` completion percentage - * - `:eta` eta in seconds - * - * @param {String} fmt - * @param {Object} options - * @api public - */ - -function ProgressBar(fmt, options) { - this.rl = require('readline').createInterface({ - input: process.stdin, - output: options.stream || process.stdout - }); - this.rl.setPrompt('', 0); - this.rl.clearLine = function() { - this.write(null, {ctrl: true, name: 'u'}); - }; - - options = options || {}; - if ('string' != typeof fmt) throw new Error('format required'); - if ('number' != typeof options.total) throw new Error('total required'); - this.fmt = fmt; - this.curr = 0; - this.total = options.total; - this.width = options.width || this.total; - this.clear = options.clear - this.chars = { - complete: options.complete || '=' - , incomplete: options.incomplete || '-' - }; - this.callback = options.callback || function () {}; -} - -/** - * "tick" the progress bar with optional `len` and - * optional `tokens`. - * - * @param {Number|Object} len or tokens - * @param {Object} tokens - * @api public - */ - -ProgressBar.prototype.tick = function(len, tokens){ - if (len !== 0) - len = len || 1; - - // swap tokens - if ('object' == typeof len) tokens = len, len = 1; - - // start time for eta - if (0 == this.curr) this.start = new Date; - - this.curr += len - this.render(tokens); - - // progress complete - if (this.curr >= this.total) { - this.complete = true; - this.terminate(); - this.callback(this); - return; - } -}; - -/** - * Method to render the progress bar with optional `tokens` to - * place in the progress bar's `fmt` field. - * - * @param {Object} tokens - * @api public - */ - -ProgressBar.prototype.render = function(tokens){ - if(!process.stdout.isTTY) { - return; - } - - var percent = (this.curr >= this.total) ? 100 : this.curr / this.total * 100 - , complete = Math.round(this.width * (this.curr / this.total)) - , incomplete - , elapsed = new Date - this.start - , eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1) - complete = Array(complete).join(this.chars.complete); - incomplete = Array(this.width - complete.length).join(this.chars.incomplete); - - var str = this.fmt - .replace(':bar', complete + incomplete) - .replace(':current', this.curr) - .replace(':total', this.total) - .replace(':elapsed', isNaN(elapsed) ? "0.0" : (elapsed / 1000).toFixed(1)) - .replace(':eta', isNaN(eta) ? "0.0" : (eta / 1000).toFixed(1)) - .replace(':percent', percent.toFixed(0) + '%'); - - if (tokens) { - for (var key in tokens) { - str = str.replace(':' + key, tokens[key]); - } - } - - this.rl.clearLine(); - this.rl.write(str); -}; - -/** - * "update" the progress bar to represent an exact percentage. - * The ratio (between 0 and 1) specified will be multiplied by `total` and - * floored, representing the closest available "tick." For example, if a - * progress bar has a length of 3 and `update(0.5)` is called, the progress - * will be set to 1. - * - * A ratio of 0.5 will attempt to set the progress to halfway. - * - * @param {Number} ratio The ratio (between 0 and 1 inclusive) to set the - * overall completion to. - * @api public - */ - -ProgressBar.prototype.update = function(ratio) { - var goal = Math.floor(ratio * this.total); - var delta = goal - this.curr; - - this.tick(delta); -}; - -/** - * Terminates a progress bar. - * - * @api public - */ - -ProgressBar.prototype.terminate = function() { - this.rl.resume(); - - if (this.clear) { - this.rl.clearLine(); - this.rl.close(); - } else { - this.rl.close(); - console.log(); - } -}; diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/package.json deleted file mode 100644 index a4facb9..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/progress/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "progress", - "version": "1.1.2", - "description": "Flexible ascii progress bar", - "keywords": [ - "cli", - "progress" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "main": "index", - "engines": { - "node": ">=0.4.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-progress" - }, - "readme": "# node-progress\n\n Flexible ascii progress bar\n\n## Installation\n\n npm install progress\n\n## Usage\n\n First we create a `ProgressBar`, giving it a format string\n as well as the `total`, telling the progress bar when it will\n be considered complete. After that all we need to do is `tick()` appropriately.\n\n```javascript\nvar ProgressBar = require('progress');\n\nvar bar = new ProgressBar(':bar', { total: 10 });\nvar timer = setInterval(function(){\n bar.tick();\n if (bar.complete) {\n console.log('\\ncomplete\\n');\n clearInterval(timer);\n }\n}, 100);\n```\n\n## Options:\n\n - `total` total number of ticks to complete\n - `width` the displayed width of the progress bar defaulting to total\n - `stream` the output stream defaulting to stdout\n - `complete` completion character defaulting to \"=\"\n - `incomplete` incomplete character defaulting to \"-\"\n - `clear` option to clear the bar on completion defaulting to false\n - `callback` optional function to call when the progress bar completes\n\n## Tokens:\n\n - `:bar` the progress bar itself\n - `:current` current tick number\n - `:total` total ticks\n - `:elapsed` time elapsed in seconds\n - `:percent` completion percentage\n - `:eta` estimated completion time in seconds\n\n## Examples\n\n### Download\n\n In our download example each tick has a variable influence, so we pass the chunk length which adjusts the progress bar appropriately relative to the total length.\n\n```javascript\nvar ProgressBar = require('../')\n , https = require('https');\n\nvar req = https.request({\n host: 'download.github.com'\n , port: 443\n , path: '/visionmedia-node-jscoverage-0d4608a.zip'\n});\n\nreq.on('response', function(res){\n var len = parseInt(res.headers['content-length'], 10);\n\n console.log();\n var bar = new ProgressBar(' downloading [:bar] :percent :etas', {\n complete: '='\n , incomplete: ' '\n , width: 20\n , total: len\n });\n\n res.on('data', function(chunk){\n bar.tick(chunk.length);\n });\n\n res.on('end', function(){\n console.log('\\n');\n });\n});\n\nreq.end();\n```\n\n The code above will generate a progress bar that looks like this:\n\n```\ndownloading [===== ] 29% 3.7s\n```\n\nYou can see more examples in the `examples` folder.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 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.\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/node-progress/issues" - }, - "_id": "progress@1.1.2", - "dist": { - "shasum": "87fdbc7c76a784020897b5e9665554b05fc58cd1" - }, - "_from": "progress@~1.1.0", - "_resolved": "https://registry.npmjs.org/progress/-/progress-1.1.2.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/LICENSE b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/README.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/README.md deleted file mode 100644 index ff1eb53..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/README.md +++ /dev/null @@ -1,5 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/bin/which b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/bin/which deleted file mode 100755 index 8432ce2..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/bin/which +++ /dev/null @@ -1,14 +0,0 @@ -#!/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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/package.json deleted file mode 100644 index 9458b87..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "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" - }, - "_id": "which@1.0.5", - "_from": "which@~1.0.5", - "scripts": {} -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/which.js b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/which.js deleted file mode 100644 index db7e8f7..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/which/which.js +++ /dev/null @@ -1,104 +0,0 @@ -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/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/package.json deleted file mode 100644 index 37239f4..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "bin-wrapper", - "version": "0.1.6", - "description": "Binary wrapper for Node.js that makes your programs seamlessly available as local dependencies", - "keywords": [ - "bin", - "build", - "make", - "wrapper" - ], - "homepage": "https://github.com/kevva/bin-wrapper", - "bugs": { - "url": "https://github.com/kevva/bin-wrapper/issues" - }, - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/kevva/bin-wrapper.git" - }, - "scripts": { - "test": "mocha --reporter list" - }, - "main": "bin-wrapper.js", - "files": [ - "bin-wrapper.js" - ], - "dependencies": { - "download": "~0.1.2", - "isbin": "0.0.2", - "mout": "~0.6.0", - "progress": "~1.1.0", - "which": "~1.0.5" - }, - "devDependencies": { - "mocha": "~1.12.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# bin-wrapper [![Build Status](https://secure.travis-ci.org/kevva/bin-wrapper.png?branch=master)](http://travis-ci.org/kevva/bin-wrapper)\n\nBinary wrapper for Node.js that makes your programs seamlessly available as local dependencies\n\n## Getting started\n\nInstall with [npm](https://npmjs.org/package/bin-wrapper): `npm install bin-wrapper`\n\n## Examples\n\nAll `platform` and `arch` specific options takes precedence over the base \noptions. See [test.js](test.js) for a full fleshed example.\n\n```js\nvar Bin = require('bin-wrapper');\n\nvar opts = {\n name: 'Gifsicle',\n bin: 'gifsicle',\n path: 'vendor',\n url: 'http://url/to/gifsicle',\n src: 'http://www.lcdf.org/gifsicle/gifsicle-1.71.tar.gz',\n buildScript: './configure --bindir=\"vendor\" && make install',\n platform: {\n win32: {\n bin: 'gifsicle.exe',\n url: [\n 'http://url/to/gifsicle.exe'\n 'http://url/to/gifsicle.dll'\n ]\n }\n }\n}\nvar bin = new Bin(opts);\n\nbin.check('--version', function (works) {\n if (!works) {\n console.log('Pre-build test failed, compiling from source');\n return bin.build();\n }\n\n console.log('Binary passed the test');\n});\n```\n\nGet the path to your binary with `bin.path`.\n\n```js\nconsole.log(bin.path);\n// => path/to/vendor/gifsicle\n```\n\n## API\n\n### .check(cmd, cb)\n\nCheck if a binary is present and working. If it isn't, download and test it by \nrunning the binary with `cmd` and see if it exits correctly.\n\n### .build(cb)\n\nDownload the source archive defined in the `src` property and build it using the \nbuild script defined in the `buildScript` property.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)\n", - "readmeFilename": "README.md", - "_id": "bin-wrapper@0.1.6", - "dist": { - "shasum": "2f010154f7155220f9b705e469e01fb20655626d" - }, - "_from": "bin-wrapper@~0.1.3", - "_resolved": "https://registry.npmjs.org/bin-wrapper/-/bin-wrapper-0.1.6.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/package.json b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/package.json deleted file mode 100644 index 69c7d70..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "pngquant-bin", - "version": "0.1.5", - "description": "pngquant wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows", - "keywords": [ - "png", - "img", - "image", - "compress", - "minify", - "optimize" - ], - "homepage": "https://github.com/sindresorhus/node-pngquant-bin", - "bugs": { - "url": "https://github.com/sindresorhus/node-pngquant-bin/issues" - }, - "license": "MIT", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "contributors": [ - { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "http://kevinmartensson.com" - } - ], - "files": [ - "bin", - "lib" - ], - "main": "lib/pngquant", - "bin": { - "pngquant": "bin/pngquant.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/node-pngquant-bin.git" - }, - "scripts": { - "test": "mocha", - "postinstall": "node lib/check.js" - }, - "dependencies": { - "bin-wrapper": "~0.1.3", - "chalk": "~0.2.0" - }, - "devDependencies": { - "mocha": "~1.13.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# node-pngquant-bin [![Build Status](https://secure.travis-ci.org/sindresorhus/node-pngquant-bin.png?branch=master)](http://travis-ci.org/sindresorhus/node-pngquant-bin)\n\n[pngquant](http://pngquant.org) 1.8.4 Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows.\n\n> pngquant is a command-line utility for converting 24/32-bit PNG images to paletted (8-bit) PNGs. The conversion reduces file sizes significantly (often as much as 70%) and preserves full alpha transparency.\n\n\n## Install\n\n- Install with [npm](https://npmjs.org/package/pngquant-bin): `npm install --save pngquant-bin`\n\n\n## Example usage\n\n```js\nvar execFile = require('child_process').execFile;\nvar binPath = require('pngquant-bin').path;\n\nexecFile(binPath, ['input.png'], function() {\n\tconsole.log('Image minified');\n});\n```\n\nCan also be run directly from `./node_modules/.bin/pngquant`.\n\n\n## Dev\n\nNote to self on how to update the binaries.\n\n### OS X\n\n- Run `npm install` on a OS X 10.7 machine to build the binary.\n\n### Linux\n\n- Install dependencies by running `sudo apt-get install build-essential libpng-dev zlib1g-dev`.\n- Run `npm install` to build the binary.\n\n### Windows\n\n- Download the [Windows binary](http://pngquant.org/pngquant-windows.zip) and put it in `vendor/win/`.\n\n\n## License\n\nEverything except binaries: MIT License • © [Sindre Sorhus](http://sindresorhus.com)\n\ngifsicle licensed under the GNU General Public License, Version 2.\n", - "readmeFilename": "readme.md", - "_id": "pngquant-bin@0.1.5", - "dist": { - "shasum": "f5afb4cccebd03ed75fa948d9f16b9b6571a92d3" - }, - "_from": "pngquant-bin@~0.1.0", - "_resolved": "https://registry.npmjs.org/pngquant-bin/-/pngquant-bin-0.1.5.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/readme.md b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/readme.md deleted file mode 100644 index 954dcbb..0000000 --- a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/readme.md +++ /dev/null @@ -1,49 +0,0 @@ -# node-pngquant-bin [![Build Status](https://secure.travis-ci.org/sindresorhus/node-pngquant-bin.png?branch=master)](http://travis-ci.org/sindresorhus/node-pngquant-bin) - -[pngquant](http://pngquant.org) 1.8.4 Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows. - -> pngquant is a command-line utility for converting 24/32-bit PNG images to paletted (8-bit) PNGs. The conversion reduces file sizes significantly (often as much as 70%) and preserves full alpha transparency. - - -## Install - -- Install with [npm](https://npmjs.org/package/pngquant-bin): `npm install --save pngquant-bin` - - -## Example usage - -```js -var execFile = require('child_process').execFile; -var binPath = require('pngquant-bin').path; - -execFile(binPath, ['input.png'], function() { - console.log('Image minified'); -}); -``` - -Can also be run directly from `./node_modules/.bin/pngquant`. - - -## Dev - -Note to self on how to update the binaries. - -### OS X - -- Run `npm install` on a OS X 10.7 machine to build the binary. - -### Linux - -- Install dependencies by running `sudo apt-get install build-essential libpng-dev zlib1g-dev`. -- Run `npm install` to build the binary. - -### Windows - -- Download the [Windows binary](http://pngquant.org/pngquant-windows.zip) and put it in `vendor/win/`. - - -## License - -Everything except binaries: MIT License • © [Sindre Sorhus](http://sindresorhus.com) - -gifsicle licensed under the GNU General Public License, Version 2. diff --git a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/vendor/pngquant b/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/vendor/pngquant deleted file mode 100755 index 9fe362c..0000000 Binary files a/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/vendor/pngquant and /dev/null differ diff --git a/node_modules/grunt-contrib-imagemin/package.json b/node_modules/grunt-contrib-imagemin/package.json deleted file mode 100644 index 238db9a..0000000 --- a/node_modules/grunt-contrib-imagemin/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "grunt-contrib-imagemin", - "description": "Minify PNG and JPEG images", - "version": "0.2.1", - "homepage": "https://github.com/gruntjs/grunt-contrib-imagemin", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-imagemin.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-imagemin/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-imagemin/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">=0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "dependencies": { - "filesize": "~1.10.0", - "jpegtran-bin": "~0.2.0", - "optipng-bin": "~0.3.0", - "gifsicle": "~0.1.0", - "pngquant-bin": "~0.1.0", - "chalk": "~0.2.0" - }, - "devDependencies": { - "grunt-contrib-internal": "~0.4.3", - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-jshint": "~0.6.2", - "grunt-contrib-nodeunit": "~0.2.0", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin", - "image", - "img", - "minify", - "compress", - "png", - "jpg", - "jpeg" - ], - "files": [ - "tasks/imagemin.js" - ], - "readme": "# grunt-contrib-imagemin [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-imagemin.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-imagemin)\n\n> Minify PNG and JPEG images\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-imagemin --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-contrib-imagemin');\n```\n\n\n\n\n## Imagemin task\n_Run this task with the `grunt imagemin` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n\nMinify images using [OptiPNG](http://optipng.sourceforge.net), [pngquant](http://pngquant.org), [jpegtran](http://jpegclub.org/jpegtran/) and [gifsicle](http://www.lcdf.org/gifsicle).\n\nImages will be cached and only minified again if they change.\n\n### Options\n\nOptions will only apply to the relevant files, so you don't need separate targets for png/jpg.\n\n\n#### optimizationLevel *(png only)*\n\nType: `Number`\nDefault: `7`\n\nSelect optimization level between `0` and `7`.\n\n> The optimization level 0 enables a set of optimization operations that require minimal effort. There will be no changes to image attributes like bit depth or color type, and no recompression of existing IDAT datastreams. The optimization level 1 enables a single IDAT compression trial. The trial chosen is what. OptiPNG thinks it’s probably the most effective. The optimization levels 2 and higher enable multiple IDAT compression trials; the higher the level, the more trials.\n\nLevel and trials:\n\n1. 1 trial\n2. 8 trials\n3. 16 trials\n4. 24 trials\n5. 48 trials\n6. 120 trials\n7. 240 trials\n\n\n#### progressive *(jpg only)*\n\nType: `Boolean`\nDefault: `true`\n\nLossless conversion to progressive.\n\n\n#### pngquant\n\nType: `Boolean`\nDefault: `true`\n\nWhether to enable pngquant compression.\n\n> pngquant is a command-line utility for converting 24/32-bit PNG images to paletted (8-bit) PNGs. The conversion reduces file sizes significantly (often as much as 70%) and preserves full alpha transparency.\n\n#### Example config\n\nYou can either map your files statically or [dynamically](https://github.com/gruntjs/grunt/wiki/Configuring-tasks#building-the-files-object-dynamically).\n\n```javascript\ngrunt.initConfig({\n imagemin: { // Task\n static: { // Target\n options: { // Target options\n optimizationLevel: 3\n },\n files: { // Dictionary of files\n 'dist/img.png': 'src/img.png', // 'destination': 'source'\n 'dist/img.jpg': 'src/img.jpg',\n 'dist/img.gif': 'src/img.gif'\n }\n },\n dynamic: { // Another target\n files: [{\n expand: true, // Enable dynamic expansion\n cwd: 'src/', // Src matches are relative to this path\n src: ['**/*.{png,jpg,gif}'], // Actual patterns to match\n dest: 'dist/' // Destination path prefix\n }]\n }\n }\n});\n\ngrunt.loadNpmTasks('grunt-contrib-imagemin');\ngrunt.registerTask('default', ['imagemin']);\n```\n\n\n## Release History\n\n * 2013-08-16   v0.2.0   Add `gifsicle` and `pngquant`. Cache images so only changed images are optimized. Default `optimizationLevel` to `7` and `progressive` to `true`.\n * 2013-04-10   v0.1.4   Fix exception when running in verbose mode.\n * 2013-04-05   v0.1.3   Fix OptiPNG not being able to overwrite file. Allow overwriting src when dest/src is the same. Limit to 10 concurrent optimizations.\n * 2013-02-22   v0.1.2   Fix OptiPNG not working on some systems. Prevent OptiPNG from producing .bak files.\n * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0.\n * 2013-01-30   v0.1.1rc8   Fix task not creating destination folders\n * 2013-01-30   v0.1.1rc7   Updating to work with grunt v0.4.0rc7. Switching to this.files api.\n * 2012-11-01   v0.1.0   Initial release.\n\n---\n\nTask submitted by [Sindre Sorhus](http://github.com/sindresorhus)\n\n*This file was generated on Fri Aug 16 2013 20:16:49.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-imagemin@0.2.1", - "dist": { - "shasum": "a7a36010e0a7200d9146016bda4ffa3507be189b" - }, - "_from": "grunt-contrib-imagemin@~0.2.0", - "_resolved": "https://registry.npmjs.org/grunt-contrib-imagemin/-/grunt-contrib-imagemin-0.2.1.tgz" -} diff --git a/node_modules/grunt-contrib-imagemin/tasks/imagemin.js b/node_modules/grunt-contrib-imagemin/tasks/imagemin.js deleted file mode 100644 index 223d55d..0000000 --- a/node_modules/grunt-contrib-imagemin/tasks/imagemin.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * grunt-contrib-imagemin - * http://gruntjs.com/ - * - * Copyright (c) 2012 Sindre Sorhus, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function (grunt) { - var path = require('path'); - var fs = require('fs'); - var os = require('os'); - var crypto = require('crypto'); - var childProcess = require('child_process'); - var filesize = require('filesize'); - var chalk = require('chalk'); - var optipngPath = require('optipng-bin').path; - var pngquantPath = require('pngquant-bin').path; - var jpegtranPath = require('jpegtran-bin').path; - var gifsiclePath = require('gifsicle').path; - var numCPUs = os.cpus().length; - var tmpdir = os.tmpdir ? os.tmpdir() : os.tmpDir(); - var cacheDir = path.join(tmpdir, 'grunt-contrib-imagemin.cache'); - - function hashFile(filePath) { - var content = grunt.file.read(filePath); - return crypto.createHash('sha1').update(content).digest('hex'); - } - - grunt.registerMultiTask('imagemin', 'Minify PNG and JPEG images', function () { - var done = this.async(); - var options = this.options({ - optimizationLevel: 7, - progressive: true, - pngquant: true - }); - var optipngArgs = ['-strip', 'all']; - var pngquantArgs = ['-']; - var jpegtranArgs = ['-copy', 'none', '-optimize']; - var gifsicleArgs = ['-w']; - var totalSaved = 0; - - if (typeof options.optimizationLevel === 'number') { - optipngArgs.push('-o', options.optimizationLevel); - } - - if (options.progressive === true) { - jpegtranArgs.push('-progressive'); - } - - grunt.verbose.writeflags(options, 'Options'); - - grunt.util.async.forEachLimit(this.files, numCPUs, function (file, next) { - optimize(file.src[0], file.dest, next); - }.bind(this), function (err) { - if (err) { - grunt.warn(err); - } - - grunt.log.writeln('Minified ' + this.files.length + ' ' + - (this.files.length === 1 ? 'image' : 'images') + - chalk.gray(' (saved ' + filesize(totalSaved) + ')')); - done(); - }.bind(this)); - - function optimize(src, dest, next) { - var cp; - var originalSize = fs.statSync(src).size; - var cachePath = path.join(cacheDir, hashFile(src)); - - function processed(err, result, code) { - var saved, savedMsg; - - if (err) { - grunt.log.writeln(err); - } - - saved = originalSize - fs.statSync(dest).size; - totalSaved += saved; - - if (result && (result.stderr.indexOf('already optimized') !== -1 || saved < 10)) { - savedMsg = 'already optimized'; - } else { - savedMsg = 'saved ' + filesize(saved); - } - - if (!grunt.file.exists(cachePath)) { - grunt.file.copy(dest, cachePath); - - if (grunt.option('verbose')) { - grunt.log.writeln('[caching] ' + src + ' → ' + cachePath); - } - } - - grunt.log.writeln(chalk.green('✔ ') + src + chalk.gray(' (' + savedMsg + ')')); - next(); - } - - grunt.file.mkdir(path.dirname(dest)); - - if (grunt.file.exists(cachePath)) { - if (grunt.option('verbose')) { - grunt.log.writeln('[cached] ' + src + ' ← ' + cachePath); - } - - grunt.file.copy(cachePath, dest); - processed(); - } else if (path.extname(src).toLowerCase() === '.png') { - if (options.pngquant) { - var tmpDest = dest + '.tmp'; - - cp = grunt.util.spawn({ - cmd: pngquantPath, - args: pngquantArgs - }, function () { - if (grunt.file.exists(dest)) { - grunt.file.delete(dest); - } - - grunt.util.spawn({ - cmd: optipngPath, - args: optipngArgs.concat(['-out', dest, tmpDest]) - }, function () { - grunt.file.delete(tmpDest); - processed(); - }); - }); - - cp.stdout.pipe(fs.createWriteStream(tmpDest)); - fs.createReadStream(src).pipe(cp.stdin); - } else { - if (dest !== src && grunt.file.exists(dest)) { - grunt.file.delete(dest); - } - - cp = grunt.util.spawn({ - cmd: optipngPath, - args: optipngArgs.concat(['-out', dest, src]) - }, processed); - } - } else if (['.jpg', '.jpeg'].indexOf(path.extname(src).toLowerCase()) !== -1) { - cp = grunt.util.spawn({ - cmd: jpegtranPath, - args: jpegtranArgs.concat(['-outfile', dest, src]) - }, processed); - } else if (path.extname(src).toLowerCase() === '.gif') { - cp = grunt.util.spawn({ - cmd: gifsiclePath, - args: gifsicleArgs.concat(['-o', dest, src]) - }, processed); - } else { - next(); - } - - if (cp && grunt.option('verbose')) { - cp.stdout.pipe(process.stdout); - cp.stderr.pipe(process.stderr); - } - } - }); -}; diff --git a/node_modules/grunt-contrib-jshint/.jshintignore b/node_modules/grunt-contrib-jshint/.jshintignore deleted file mode 100644 index 7365357..0000000 --- a/node_modules/grunt-contrib-jshint/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -test/fixtures/dontlint.txt \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/.jshintrc b/node_modules/grunt-contrib-jshint/.jshintrc deleted file mode 100644 index 6b61881..0000000 --- a/node_modules/grunt-contrib-jshint/.jshintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "curly": true, // true: Require {} for every new block or scope - "eqeqeq": true, // true: Require triple equals (===) for comparison - "immed": true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` - "latedef": true, // true: Require variables/functions to be defined before being used - "newcap": true, // true: Require capitalization of all constructor functions e.g. `new F()` - "noarg": true, // true: Prohibit use of `arguments.caller` and `arguments.callee` - "sub": true, // true: Tolerate using `[]` notation when it can still be expressed in dot notation - "undef": true, // true: Require all non-global variables to be declared (prevents global leaks) - "boss": true, // true: Tolerate assignments where comparisons would be expected - "eqnull": true, // true: Tolerate use of `== null` - "node": true // Node.js -} diff --git a/node_modules/grunt-contrib-jshint/.npmignore b/node_modules/grunt-contrib-jshint/.npmignore deleted file mode 100644 index 5cb6bfd..0000000 --- a/node_modules/grunt-contrib-jshint/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/.travis.yml b/node_modules/grunt-contrib-jshint/.travis.yml deleted file mode 100644 index 5766191..0000000 --- a/node_modules/grunt-contrib-jshint/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/AUTHORS b/node_modules/grunt-contrib-jshint/AUTHORS deleted file mode 100644 index 75165ef..0000000 --- a/node_modules/grunt-contrib-jshint/AUTHORS +++ /dev/null @@ -1,2 +0,0 @@ -"Cowboy" Ben Alman (http://benalman.com/) -Tyler Kellen (http://goingslowly.com/) diff --git a/node_modules/grunt-contrib-jshint/CHANGELOG b/node_modules/grunt-contrib-jshint/CHANGELOG deleted file mode 100644 index 93aa85b..0000000 --- a/node_modules/grunt-contrib-jshint/CHANGELOG +++ /dev/null @@ -1,89 +0,0 @@ -v0.6.4: - date: 2013-08-29 - changes: - - jshintrc now loaded by jshint allowing comments. -v0.6.3: - date: 2013-08-15 - changes: - - Fix module location for jshint 2.1.10. -v0.6.2: - date: 2013-07-29 - changes: - - Update to jshint 2.1.7. -v0.6.1: - date: 2013-07-27 - changes: - - Peg jshint to 2.1.4 until breaking changes in 2.1.5 are fixed. -v0.6.0: - date: 2013-06-02 - changes: - - Dont always succeed the task when using a custom reporter. - - Bump jshint to 2.1.3. -v0.5.4: - date: 2013-05-22 - changes: - - Fix default reporter to show offending file. -v0.5.3: - date: 2013-05-19 - changes: - - "Performance: Execute the reporter once rather than per file." -v0.5.2: - date: 2013-05-18 - changes: - - Fix printing too many erroneous ignored file errors. -v0.5.1: - date: 2013-05-17 - changes: - - Fix for when only 1 file is lint free. -v0.5.0: - date: 2013-05-17 - changes: - - Bump to jshint 2.0. - - Add support for .jshintignore files and ignores option - - Add support for extensions option. - - Add support for custom reporters and output report to a file. -v0.4.3: - date: 2013-04-08 - changes: - - Fix evaluation of predef option when it's an object. -v0.4.2: - date: 2013-04-08 - changes: - - Avoid wiping force option when jshintrc is used. -v0.4.1: - date: 2013-04-06 - changes: - - Fix to allow object type for deprecated predef. -v0.4.0: - date: 2013-04-04 - changes: - - Revert task level options to override jshintrc files. -v0.3.0: - date: 2013-03-13 - changes: - - Bump to JSHint 1.1.0. - - Add force option to report JSHint errors but not fail the task. - - Add error/warning code to message. - - Allow task level options to override jshintrc file. -v0.2.0: - date: 2013-02-26 - changes: - - Bump to JSHint 1.0 -v0.1.1: - date: 2013-02-15 - changes: - - First official release for Grunt 0.4.0. -v0.1.1rc6: - date: 2013-01-18 - changes: - - Updating grunt/gruntplugin dependencies to rc6. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.1.1rc5: - date: 2013-01-09 - changes: - - Updating to work with grunt v0.4.0rc5. - - Switching to this.filesSrc api. -v0.1.0: - date: 2012-10-18 - changes: - - Work in progress, not yet officially released. diff --git a/node_modules/grunt-contrib-jshint/CONTRIBUTING.md b/node_modules/grunt-contrib-jshint/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-jshint/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-jshint/Gruntfile.js b/node_modules/grunt-contrib-jshint/Gruntfile.js deleted file mode 100644 index 0a65eeb..0000000 --- a/node_modules/grunt-contrib-jshint/Gruntfile.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * grunt-contrib-jshint - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - jshint: { - allFiles: [ - 'Gruntfile.js', - 'tasks/**/*.js', - '<%= nodeunit.tests %>', - ], - individualFiles: { - files: [ - {src: 'Gruntfile.js'}, - {src: 'tasks/**/*.js'}, - {src: '<%= nodeunit.tests %>'}, - ], - }, - withReporterShouldFail: { - options: { - reporter: 'checkstyle', - reporterOutput: 'tmp/report.xml', - force: true, - }, - src: ['test/fixtures/missingsemicolon.js'], - }, - ignoresSupport: { - src: ['test/fixtures/dontlint.txt'], - }, - options: { - jshintrc: '.jshintrc', - }, - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'], - }, - }); - - // Actually load this plugin's task(s). - grunt.loadTasks('tasks'); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - // Whenever the "test" task is run, run the "nodeunit" task. - grunt.registerTask('test', ['jshint', 'nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['test', 'build-contrib']); - -}; diff --git a/node_modules/grunt-contrib-jshint/LICENSE-MIT b/node_modules/grunt-contrib-jshint/LICENSE-MIT deleted file mode 100644 index 8368849..0000000 --- a/node_modules/grunt-contrib-jshint/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman, 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/node_modules/grunt-contrib-jshint/README.md b/node_modules/grunt-contrib-jshint/README.md deleted file mode 100644 index c477209..0000000 --- a/node_modules/grunt-contrib-jshint/README.md +++ /dev/null @@ -1,231 +0,0 @@ -# grunt-contrib-jshint v0.6.4 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-jshint.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jshint) - -> Validate files with JSHint. - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-jshint --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-jshint'); -``` - - - - -## Jshint task -_Run this task with the `grunt jshint` command._ - -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. - -For more explanations of the lint errors JSHint will throw at you please visit [jslinterrors.com](http://jslinterrors.com/). - -### Options - -Any specified option will be passed through directly to [JSHint][], thus you can specify any option that JSHint supports. See the [JSHint documentation][] for a list of supported options. - -[JSHint]: http://www.jshint.com/ -[JSHint documentation]: http://www.jshint.com/docs/ - -A few additional options are supported: - -#### globals -Type: `Object` -Default value: `null` - -A map of global variables, with keys as names and a boolean value to determine if they are assignable. This is not a standard JSHint option, but is passed into the `JSHINT` function as its third argument. See the [JSHint documentation][] for more information. - -#### jshintrc -Type: `String` -Default value: `null` - -If this filename is specified, options and globals defined therein will be used. The `jshintrc` file must be valid JSON and looks something like this: - -```json -{ - "curly": true, - "eqnull": true, - "eqeqeq": true, - "undef": true, - "globals": { - "jQuery": true - } -} -``` - -*Be aware that `jshintrc` settings are not merged with your Grunt options.* - -#### extensions -Type: `String` -Default value: `''` - -A list of non-dot-js extensions to check. - -#### ignores -Type: `Array` -Default value: `null` - -A list of files and dirs to ignore. This will override your `.jshintignore` file if set and does not merge. - -#### force -Type: `Boolean` -Default value: `false` - -Set `force` to `true` to report JSHint errors but not fail the task. - -#### reporter -Type: `String` -Default value: `null` - -Allows you to modify this plugins output. By default it will use a built-in Grunt reporter. Set the path to your own custom reporter or to one of the built-in JSHint reporters: `jslint` or `checkstyle`. - -See also: [Writing your own JSHint reporter.](http://jshint.com/docs/reporter/) - -#### reporterOutput -Type: `String` -Default value: `null` - -Specify a filepath to output the results of a reporter. If `reporterOutput` is specified then all output will be written to the given filepath instead of printed to stdout. - -### Usage examples - -#### Wildcards -In this example, running `grunt jshint:all` (or `grunt jshint` because `jshint` is a [multi task](http://gruntjs.com/configuring-tasks#task-configuration-and-targets)) will lint the project's Gruntfile as well as all JavaScript files in the `lib` and `test` directories and their subdirectores, using the default JSHint options. - -```js -// Project configuration. -grunt.initConfig({ - jshint: { - all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'] - } -}); -``` - -#### Linting before and after concatenating -In this example, running `grunt jshint` will lint both the "beforeconcat" set and "afterconcat" sets of files. This is not ideal, because `dist/output.js` may get linted before it gets created via the [grunt-contrib-concat plugin](https://github.com/gruntjs/grunt-contrib-concat) `concat` task. - -In this case, you should lint the "beforeconcat" files first, then concat, then lint the "afterconcat" files, by running `grunt jshint:beforeconcat concat jshint:afterconcat`. - -```js -// Project configuration. -grunt.initConfig({ - concat: { - dist: { - src: ['src/foo.js', 'src/bar.js'], - dest: 'dist/output.js' - } - }, - jshint: { - beforeconcat: ['src/foo.js', 'src/bar.js'], - afterconcat: ['dist/output.js'] - } -}); -``` - -#### Specifying JSHint options and globals - -In this example, custom JSHint options are specified. Note that when `grunt jshint:uses_defaults` is run, those files are linted using the default options, but when `grunt jshint:with_overrides` is run, those files are linted using _merged_ task/target options. - -```js -// Project configuration. -grunt.initConfig({ - jshint: { - options: { - curly: true, - eqeqeq: true, - eqnull: true, - browser: true, - globals: { - jQuery: true - }, - }, - uses_defaults: ['dir1/**/*.js', 'dir2/**/*.js'], - with_overrides: { - options: { - curly: false, - undef: true, - }, - files: { - src: ['dir3/**/*.js', 'dir4/**/*.js'] - }, - } - }, -}); -``` - -#### Ignoring specific warnings - -If you would like to ignore a specific warning: - -```shell -[L24:C9] W015: Expected '}' to have an indentation at 11 instead at 9. -``` - -You can toggle it by prepending `-` to the warning id as an option: - -```js -grunt.initConfig({ - jshint: { - ignore_warning: { - options: { - '-W015': true, - }, - src: ['**/*.js'], - }, - }, -}); -``` - -#### Ignoring specific files - -Occasionally application files and third party libraries share the same directory. To exclude third party code, but include all current and future application files, use a glob for `files` and specifically exclude libraries using `ignores`. In this example, the jQuery file is matched by the glob but subsequently ignored when JSHint does its analysis. - -```js -grunt.initConfig({ - jshint: { - files: ['js/*.js'], - options: { - ignores: ['js/jquery.js'] - } - } -}); -``` - - -## Release History - - * 2013-08-29   v0.6.4   jshintrc now loaded by jshint allowing comments. - * 2013-08-15   v0.6.3   Fix module location for jshint 2.1.10. - * 2013-07-29   v0.6.2   Update to jshint 2.1.7. - * 2013-07-27   v0.6.1   Peg jshint to 2.1.4 until breaking changes in 2.1.5 are fixed. - * 2013-06-02   v0.6.0   Dont always succeed the task when using a custom reporter. Bump jshint to 2.1.3. - * 2013-05-22   v0.5.4   Fix default reporter to show offending file. - * 2013-05-19   v0.5.3   Performance: Execute the reporter once rather than per file. - * 2013-05-18   v0.5.2   Fix printing too many erroneous ignored file errors. - * 2013-05-17   v0.5.1   Fix for when only 1 file is lint free. - * 2013-05-17   v0.5.0   Bump to jshint 2.0. Add support for .jshintignore files and ignores option Add support for extensions option. Add support for custom reporters and output report to a file. - * 2013-04-08   v0.4.3   Fix evaluation of predef option when it's an object. - * 2013-04-08   v0.4.2   Avoid wiping force option when jshintrc is used. - * 2013-04-06   v0.4.1   Fix to allow object type for deprecated predef. - * 2013-04-04   v0.4.0   Revert task level options to override jshintrc files. - * 2013-03-13   v0.3.0   Bump to JSHint 1.1.0. Add force option to report JSHint errors but not fail the task. Add error/warning code to message. Allow task level options to override jshintrc file. - * 2013-02-26   v0.2.0   Bump to JSHint 1.0 - * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0. - * 2013-01-18   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. - * 2013-01-09   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. Switching to this.filesSrc api. - * 2012-10-18   v0.1.0   Work in progress, not yet officially released. - ---- - -Task submitted by ["Cowboy" Ben Alman](http://benalman.com/) - -*This file was generated on Thu Aug 29 2013 08:46:48.* diff --git a/node_modules/grunt-contrib-jshint/docs/jshint-examples.md b/node_modules/grunt-contrib-jshint/docs/jshint-examples.md deleted file mode 100644 index a64ef65..0000000 --- a/node_modules/grunt-contrib-jshint/docs/jshint-examples.md +++ /dev/null @@ -1,103 +0,0 @@ -# Usage examples - -## Wildcards -In this example, running `grunt jshint:all` (or `grunt jshint` because `jshint` is a [multi task](http://gruntjs.com/configuring-tasks#task-configuration-and-targets)) will lint the project's Gruntfile as well as all JavaScript files in the `lib` and `test` directories and their subdirectores, using the default JSHint options. - -```js -// Project configuration. -grunt.initConfig({ - jshint: { - all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'] - } -}); -``` - -## Linting before and after concatenating -In this example, running `grunt jshint` will lint both the "beforeconcat" set and "afterconcat" sets of files. This is not ideal, because `dist/output.js` may get linted before it gets created via the [grunt-contrib-concat plugin](https://github.com/gruntjs/grunt-contrib-concat) `concat` task. - -In this case, you should lint the "beforeconcat" files first, then concat, then lint the "afterconcat" files, by running `grunt jshint:beforeconcat concat jshint:afterconcat`. - -```js -// Project configuration. -grunt.initConfig({ - concat: { - dist: { - src: ['src/foo.js', 'src/bar.js'], - dest: 'dist/output.js' - } - }, - jshint: { - beforeconcat: ['src/foo.js', 'src/bar.js'], - afterconcat: ['dist/output.js'] - } -}); -``` - -## Specifying JSHint options and globals - -In this example, custom JSHint options are specified. Note that when `grunt jshint:uses_defaults` is run, those files are linted using the default options, but when `grunt jshint:with_overrides` is run, those files are linted using _merged_ task/target options. - -```js -// Project configuration. -grunt.initConfig({ - jshint: { - options: { - curly: true, - eqeqeq: true, - eqnull: true, - browser: true, - globals: { - jQuery: true - }, - }, - uses_defaults: ['dir1/**/*.js', 'dir2/**/*.js'], - with_overrides: { - options: { - curly: false, - undef: true, - }, - files: { - src: ['dir3/**/*.js', 'dir4/**/*.js'] - }, - } - }, -}); -``` - -## Ignoring specific warnings - -If you would like to ignore a specific warning: - -```shell -[L24:C9] W015: Expected '}' to have an indentation at 11 instead at 9. -``` - -You can toggle it by prepending `-` to the warning id as an option: - -```js -grunt.initConfig({ - jshint: { - ignore_warning: { - options: { - '-W015': true, - }, - src: ['**/*.js'], - }, - }, -}); -``` - -## Ignoring specific files - -Occasionally application files and third party libraries share the same directory. To exclude third party code, but include all current and future application files, use a glob for `files` and specifically exclude libraries using `ignores`. In this example, the jQuery file is matched by the glob but subsequently ignored when JSHint does its analysis. - -```js -grunt.initConfig({ - jshint: { - files: ['js/*.js'], - options: { - ignores: ['js/jquery.js'] - } - } -}); -``` diff --git a/node_modules/grunt-contrib-jshint/docs/jshint-options.md b/node_modules/grunt-contrib-jshint/docs/jshint-options.md deleted file mode 100644 index 553864a..0000000 --- a/node_modules/grunt-contrib-jshint/docs/jshint-options.md +++ /dev/null @@ -1,66 +0,0 @@ -# Options - -Any specified option will be passed through directly to [JSHint][], thus you can specify any option that JSHint supports. See the [JSHint documentation][] for a list of supported options. - -[JSHint]: http://www.jshint.com/ -[JSHint documentation]: http://www.jshint.com/docs/ - -A few additional options are supported: - -## globals -Type: `Object` -Default value: `null` - -A map of global variables, with keys as names and a boolean value to determine if they are assignable. This is not a standard JSHint option, but is passed into the `JSHINT` function as its third argument. See the [JSHint documentation][] for more information. - -## jshintrc -Type: `String` -Default value: `null` - -If this filename is specified, options and globals defined therein will be used. The `jshintrc` file must be valid JSON and looks something like this: - -```json -{ - "curly": true, - "eqnull": true, - "eqeqeq": true, - "undef": true, - "globals": { - "jQuery": true - } -} -``` - -*Be aware that `jshintrc` settings are not merged with your Grunt options.* - -## extensions -Type: `String` -Default value: `''` - -A list of non-dot-js extensions to check. - -## ignores -Type: `Array` -Default value: `null` - -A list of files and dirs to ignore. This will override your `.jshintignore` file if set and does not merge. - -## force -Type: `Boolean` -Default value: `false` - -Set `force` to `true` to report JSHint errors but not fail the task. - -## reporter -Type: `String` -Default value: `null` - -Allows you to modify this plugins output. By default it will use a built-in Grunt reporter. Set the path to your own custom reporter or to one of the built-in JSHint reporters: `jslint` or `checkstyle`. - -See also: [Writing your own JSHint reporter.](http://jshint.com/docs/reporter/) - -## reporterOutput -Type: `String` -Default value: `null` - -Specify a filepath to output the results of a reporter. If `reporterOutput` is specified then all output will be written to the given filepath instead of printed to stdout. diff --git a/node_modules/grunt-contrib-jshint/docs/jshint-overview.md b/node_modules/grunt-contrib-jshint/docs/jshint-overview.md deleted file mode 100644 index 70cb954..0000000 --- a/node_modules/grunt-contrib-jshint/docs/jshint-overview.md +++ /dev/null @@ -1,3 +0,0 @@ -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. - -For more explanations of the lint errors JSHint will throw at you please visit [jslinterrors.com](http://jslinterrors.com/). diff --git a/node_modules/grunt-contrib-jshint/node_modules/.bin/jshint b/node_modules/grunt-contrib-jshint/node_modules/.bin/jshint deleted file mode 120000 index 1b5b30c..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/.bin/jshint +++ /dev/null @@ -1 +0,0 @@ -../jshint/bin/jshint \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/README.md deleted file mode 100644 index c37da25..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/README.md +++ /dev/null @@ -1,40 +0,0 @@ -JSHint, A Static Code Analysis Tool for JavaScript --------------------------------------------------- - -\[ [Use it online](http://jshint.com/) • [About](http://jshint.com/about/) • -[Docs](http://jshint.com/docs/) • [FAQ](http://jshint.com/docs/faq) • -[Install](http://jshint.com/install/) • [Hack](http://jshint.com/hack/) • -[Blog](http://jshint.com/blog/) • [Twitter](https://twitter.com/jshint/) \] - -[![Build Status](https://travis-ci.org/jshint/jshint.png?branch=master)](https://travis-ci.org/jshint/jshint) -[![NPM version](https://badge.fury.io/js/jshint.png)](http://badge.fury.io/js/jshint) - -JSHint is a community-driven tool to detect errors and potential problems -in JavaScript code and to enforce your team’s coding conventions. It is -very flexible so you can easily adjust it to your particular coding guidelines -and the environment you expect your code to execute in. - -#### Reporting a bug - -To report a bug simply create a -[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe -your problem or suggestion. We welcome all kind of feedback regarding -JSHint including but not limited to: - - * When JSHint doesn't work as expected - * When JSHint complains about valid JavaScript code that works in all browsers - * When you simply want a new option or feature - -Before reporting a bug look around to see if there are any open or closed tickets -that cover your issue. And remember the wisdom: pull request > bug report > tweet. - - -#### License - -JSHint is distributed under the MIT License. One file and one file only -(src/stable/jshint.js) is distributed under the slightly modified MIT License. - - -#### Thank you! - -We really appreciate all kind of feedback and contributions. Thanks for using and supporting JSHint! diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/apply b/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/apply deleted file mode 100755 index ab0da40..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/apply +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node - -var shjs = require("shelljs"); -var url = "https://github.com/jshint/jshint/pull/" + process.argv[2] + ".diff"; - -shjs.exec('curl "' + url + '" | git apply'); \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/build b/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/build deleted file mode 100755 index 92dd2f9..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/build +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node -/*jshint shelljs:true */ - -"use strict"; - -var browserify = require("browserify"); -var bundle = browserify("./src/jshint.js"); -var version = require("../package.json").version; -require("shelljs/make"); - -if (!test("-e", "../dist")) - mkdir("../dist"); - -bundle.require("./src/jshint.js", { expose: "jshint" }); -bundle.bundle({}, function (err, src) { - var web = "./dist/jshint-" + version + ".js"; - var rhino = "./dist/jshint-rhino-" + version + ".js"; - - [ "// " + version, - "var JSHINT;", - "var window;", - "if (typeof window === 'undefined') window = {};", - "(function () {", - "var require;", - src, - "JSHINT = require('jshint').JSHINT;", - "}());" - ].join("\n").to(web); - - ("#!/usr/bin/env rhino\nvar window = {};\n" + cat(web, "./src/platforms/rhino.js")).to(rhino); - chmod("+x", rhino); -}); \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/changelog b/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/changelog deleted file mode 100755 index 48f5e6f..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/changelog +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env node -/*jshint shelljs:true, lastsemic:true, -W101*/ - -"use strict"; - -var version = require("../package.json").version; -require("shelljs/make"); - -exec("git log --format='%H|%h|%an|%s' " + version + "..HEAD", { silent: true }, function (code, output) { - if (code !== 0) - return void console.log("git log return code is non-zero"); - - var commits = output.split("\n") - .filter(function (cmt) { return cmt.trim() !== "" }) - .map(function (cmt) { return cmt.split("|") }); - - var html = ""; - var authors = {}; - - commits.forEach(function (cmt) { - var tr = ""; - tr += "
        " + 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/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/jshint b/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/jshint deleted file mode 100755 index f56105f..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/jshint +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -require("../src/cli.js").interpret(process.argv); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/land b/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/land deleted file mode 100755 index 2e3c026..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/bin/land +++ /dev/null @@ -1,37 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/.bin/shjs b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/.bin/shjs deleted file mode 120000 index a044997..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/.bin/shjs +++ /dev/null @@ -1 +0,0 @@ -../shelljs/bin/shjs \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/README.md deleted file mode 100644 index 0fe30d4..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/README.md +++ /dev/null @@ -1,196 +0,0 @@ -**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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/cli.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/cli.js deleted file mode 100644 index f94e973..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/cli.js +++ /dev/null @@ -1,1133 +0,0 @@ -/** - * 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/cat.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/cat.js deleted file mode 100755 index 14c4e79..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/cat.js +++ /dev/null @@ -1,17 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/command.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/command.js deleted file mode 100755 index 2f04491..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/command.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/echo.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/echo.js deleted file mode 100755 index dac9cca..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/echo.js +++ /dev/null @@ -1,54 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/glob.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/glob.js deleted file mode 100755 index 12585c0..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/glob.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/long_desc.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/long_desc.js deleted file mode 100755 index 63632f4..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/long_desc.js +++ /dev/null @@ -1,20 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/progress.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/progress.js deleted file mode 100755 index 300c674..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/progress.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/sort.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/sort.js deleted file mode 100755 index 5d22313..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/sort.js +++ /dev/null @@ -1,18 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/spinner.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/spinner.js deleted file mode 100755 index 6100001..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/spinner.js +++ /dev/null @@ -1,9 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.coffee b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.coffee deleted file mode 100755 index cbf3b16..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.coffee +++ /dev/null @@ -1,27 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.js deleted file mode 100755 index eb6fd24..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/examples/static.js +++ /dev/null @@ -1,25 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/index.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/index.js deleted file mode 100644 index 3966bd7..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./cli'); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore deleted file mode 100644 index 2af4b71..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.*.swp -test/a/ diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml deleted file mode 100644 index baa0031..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/README.md deleted file mode 100644 index cc69164..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/README.md +++ /dev/null @@ -1,250 +0,0 @@ -# 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js deleted file mode 100644 index be122df..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js deleted file mode 100644 index 327a425..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js deleted file mode 100644 index 176be02..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js +++ /dev/null @@ -1,675 +0,0 @@ -// 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 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) - } - - if (this.mark) { - // at *some* point we statted all of these - all = all.map(function (m) { - var sc = this.cache[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) { - if (!this.stat || this.statCache[m] || m === this.EOF) { - this._emitQueue.push(m) - this._processEmitQueue() - } else { - this._stat(m, function(exists, isDir) { - if (exists) { - 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) - - 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.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) - }) - -} - -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md deleted file mode 100644 index b1c5665..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a7..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json deleted file mode 100644 index cee4a9b..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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" - }, - "_id": "inherits@2.0.1", - "_from": "inherits@2" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js deleted file mode 100644 index fc53012..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/package.json deleted file mode 100644 index 10aab94..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "3.2.6", - "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" - }, - "_id": "glob@3.2.6", - "_from": "glob@>= 3.1.4" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js deleted file mode 100644 index 245afaf..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js +++ /dev/null @@ -1,176 +0,0 @@ -// 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js deleted file mode 100644 index 239ed1a..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json deleted file mode 100644 index 3ffadba..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,349 +0,0 @@ -{ - "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/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js deleted file mode 100644 index 352c27e..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js deleted file mode 100644 index 9b234fa..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js deleted file mode 100644 index ed68a33..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js +++ /dev/null @@ -1,74 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js deleted file mode 100644 index 2503f23..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js +++ /dev/null @@ -1,113 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js deleted file mode 100644 index e1ffbab..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js deleted file mode 100644 index 3ac5979..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js deleted file mode 100644 index 95c23f9..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js deleted file mode 100644 index 6291711..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js deleted file mode 100644 index e085f0f..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -// 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/package.json deleted file mode 100755 index 44ca437..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "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", - "_from": "cli@0.4.x" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.npmignore deleted file mode 100644 index aa3fd4b..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.testem.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.testem.json deleted file mode 100644 index 633c2ba..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.testem.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.travis.yml b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.travis.yml deleted file mode 100644 index ed178f6..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/LICENCE b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/README.md deleted file mode 100644 index 5e480ba..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/index.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/index.js deleted file mode 100644 index bfdf4b3..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/index.js +++ /dev/null @@ -1,85 +0,0 @@ -/*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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/package.json deleted file mode 100644 index dbd58ae..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "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", - "_from": "console-browserify@0.1.x" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/index.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/index.js deleted file mode 100644 index 26dfaad..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/index.js +++ /dev/null @@ -1,67 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/index.html b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/index.html deleted file mode 100644 index dd55012..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - TAPE Example - - - - - - - diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js deleted file mode 100644 index 8b4c12d..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js +++ /dev/null @@ -1,53 +0,0 @@ -(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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/LICENSE b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/README.md deleted file mode 100644 index 6fd07d2..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -### 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. **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 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. - - -## 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.) diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/minimatch.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/minimatch.js deleted file mode 100644 index 405746b..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1079 +0,0 @@ -;(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.monkeyPatch = monkeyPatch -function monkeyPatch () { - var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") - var orig = desc.value - desc.value = function (p) { - if (p instanceof Minimatch) return p.match(this) - return orig.call(this, p) - } - Object.defineProperty(String.prototype, desc) -} - -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.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) console.error(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) - }) - - if (options.debug) console.error(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - if (options.debug) console.error(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - if (options.debug) console.error(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) !== "{") { - // console.error(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error(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) { - // console.error("no sets") - return [pattern] - } - - var tail = braceExpand(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) { - // console.error("numset", numset[1], numset[2]) - var suf = braceExpand(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 = "" - } - - // console.error("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error("", 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) { - // console.error("didn't close", pattern) - return braceExpand("\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - // console.error("set", set) - // console.error("suffix", pattern.substr(i)) - var suf = braceExpand(pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - // console.error("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand(p, options) - }) - // console.error("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}(?:$|\\\/))" - : "(?!\\.)" - - 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 - } - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - if (options.debug) { - console.error("%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 "!": - if (options.debug) { - console.error("%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) { - 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. - 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 === "!" ? "(?:(?!" : "(?:" - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - 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 - } - - 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 + "|" - }) - - // console.error("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) { - // console.error("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) - if (options.debug) { - console.error(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 - // console.error(this.pattern, "set", set) - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i] - var hit = this.matchOne(f, 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 - - if (options.debug) { - console.error("matchOne", - { "this": this - , file: file - , pattern: pattern }) - } - - if (options.matchBase && pattern.length === 1) { - file = path.basename(file.join("/")).split("/") - } - - if (options.debug) { - console.error("matchOne", file.length, pattern.length) - } - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - if (options.debug) { - console.error("matchOne loop") - } - var p = pattern[pi] - , f = file[fi] - - if (options.debug) { - console.error(pattern, p, f) - } - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - if (options.debug) - console.error('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) { - if (options.debug) - console.error('** 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] - - if (options.debug) { - console.error('\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)) { - if (options.debug) - console.error('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) === ".")) { - if (options.debug) - console.error("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - if (options.debug) - console.error('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 - // console.error("\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 - } - if (options.debug) { - console.error("string match", p, f, hit) - } - } else { - hit = f.match(p) - if (options.debug) { - console.error("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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/AUTHORS deleted file mode 100644 index 016d7fb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Carlos Brito Lage -Marko Mikulicic -Trent Mick -Kevin O'Hara -Marco Rogers -Jesse Dailey diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f9..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/bench.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/bench.js deleted file mode 100644 index 9111540..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/bench.js +++ /dev/null @@ -1,25 +0,0 @@ -var LRU = require('lru-cache'); - -var max = +process.argv[2] || 10240; -var more = 102400; - -var cache = LRU({ - max: max, maxAge: 86400e3 -}); - -// fill cache -for (var i = 0; i < max; ++i) { - cache.set(i, {}); -} - -var start = process.hrtime(); - -// adding more items -for ( ; i < max+more; ++i) { - cache.set(i, {}); -} - -var end = process.hrtime(start); -var msecs = end[0] * 1E3 + end[1] / 1E6; - -console.log('adding %d items took %d ms', more, msecs.toPrecision(5)); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 49c1dc6..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,263 +0,0 @@ -;(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) - } - - var max - if (typeof options === 'number') { - max = options - options = { max: max } - } - - if (!options) options = {} - - max = options.max - - var lengthCalculator = options.length || naiveLength - - if (typeof lengthCalculator !== "function") { - lengthCalculator = naiveLength - } - - if (!max || !(typeof max === "number") || max <= 0 ) { - // a little bit silly. maybe this should throw? - max = Infinity - } - - var allowStale = options.stale || false - - var maxAge = options.maxAge || null - - var dispose = options.dispose - - var cache = Object.create(null) // hash of items by key - , lruList = Object.create(null) // list of items in order of use recency - , mru = 0 // most recently used - , lru = 0 // least recently used - , length = 0 // number of items in the list - , itemCount = 0 - - - // resize the cache when the max changes. - Object.defineProperty(this, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - max = mL - // if it gets above double max, trim right away. - // otherwise, do it whenever it's convenient. - if (length > max) trim() - } - , get : function () { return max } - , enumerable : true - }) - - // resize the cache when the lengthCalculator changes. - Object.defineProperty(this, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - lengthCalculator = naiveLength - length = itemCount - for (var key in cache) { - cache[key].length = 1 - } - } else { - lengthCalculator = lC - length = 0 - for (var key in cache) { - cache[key].length = lengthCalculator(cache[key].value) - length += cache[key].length - } - } - - if (length > max) trim() - } - , get : function () { return lengthCalculator } - , enumerable : true - }) - - Object.defineProperty(this, "length", - { get : function () { return length } - , enumerable : true - }) - - - Object.defineProperty(this, "itemCount", - { get : function () { return itemCount } - , enumerable : true - }) - - this.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - i++ - var hit = lruList[k] - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } - } - - this.keys = function () { - var keys = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - keys[i++] = hit.key - } - return keys - } - - this.values = function () { - var values = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - values[i++] = hit.value - } - return values - } - - this.reset = function () { - if (dispose) { - for (var k in cache) { - dispose(k, cache[k].value) - } - } - cache = {} - lruList = {} - lru = 0 - mru = 0 - length = 0 - itemCount = 0 - } - - // Provided for debugging/dev purposes only. No promises whatsoever that - // this API stays stable. - this.dump = function () { - return cache - } - - this.dumpLru = function () { - return lruList - } - - this.set = function (key, value) { - if (hOP(cache, key)) { - // dispose of the old one before overwriting - if (dispose) dispose(key, cache[key].value) - if (maxAge) cache[key].now = Date.now() - cache[key].value = value - this.get(key) - return true - } - - var len = lengthCalculator(value) - var age = maxAge ? Date.now() : 0 - var hit = new Entry(key, value, mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > max) { - if (dispose) dispose(key, value) - return false - } - - length += hit.length - lruList[hit.lu] = cache[key] = hit - itemCount ++ - - if (length > max) trim() - return true - } - - this.has = function (key) { - if (!hOP(cache, key)) return false - var hit = cache[key] - if (maxAge && (Date.now() - hit.now > maxAge)) { - return false - } - return true - } - - this.get = function (key) { - return get(key, true) - } - - this.peek = function (key) { - return get(key, false) - } - - function get (key, doUse) { - var hit = cache[key] - if (hit) { - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } else { - if (doUse) use(hit) - } - if (hit) hit = hit.value - } - return hit - } - - function use (hit) { - shiftLU(hit) - hit.lu = mru ++ - lruList[hit.lu] = hit - } - - this.del = function (key) { - del(cache[key]) - } - - function trim () { - while (lru < mru && length > max) - del(lruList[lru]) - } - - function shiftLU(hit) { - delete lruList[ hit.lu ] - while (lru < mru && !lruList[lru]) lru ++ - } - - function del(hit) { - if (hit) { - if (dispose) dispose(hit.key, hit.value) - length -= hit.length - itemCount -- - delete cache[ hit.key ] - shiftLU(hit) - } - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, mru, len, age) { - this.key = key - this.value = value - this.lu = mru - this.length = len - this.now = age -} - -})() diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 411acad..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.3.1", - "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" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Carlos Brito Lage", - "email": "carlos@carloslage.net" - }, - { - "name": "Marko Mikulicic", - "email": "marko.mikulicic@isti.cnr.it" - }, - { - "name": "Trent Mick", - "email": "trentm@gmail.com" - }, - { - "name": "Kevin O'Hara", - "email": "kevinohara80@gmail.com" - }, - { - "name": "Marco Rogers", - "email": "marco.rogers@gmail.com" - }, - { - "name": "Jesse Dailey", - "email": "jesse.dailey@gmail.com" - } - ], - "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" - }, - "_id": "lru-cache@2.3.1", - "_from": "lru-cache@2" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index 70f3f8b..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,329 +0,0 @@ -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() -}) diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b0..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index ec8e2eb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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" - }, - "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/package.json deleted file mode 100644 index d5a1fd0..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "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.12", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "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!\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### 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. **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 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\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "_id": "minimatch@0.2.12", - "_from": "minimatch@0.x.x" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/basic.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/brace-expand.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index 7ee278a..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/caching.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/defaults.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 25f1f60..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.documentup.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.documentup.json deleted file mode 100644 index 57fe301..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.documentup.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ShellJS", - "twitter": [ - "r2r" - ] -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.travis.yml b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.travis.yml deleted file mode 100644 index 5caf599..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/LICENSE b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/LICENSE deleted file mode 100644 index 1b35ee9..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2012, Artur Adib -All rights reserved. - -You may use this project under the terms of the New BSD license as follows: - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Artur Adib nor the - names of the contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB 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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/README.md deleted file mode 100644 index 8b45592..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/README.md +++ /dev/null @@ -1,513 +0,0 @@ -# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/shelljs) - -ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts! - -The project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled-tested in projects like: - -+ [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader -+ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger -+ [JSHint](http://jshint.com) - Most popular JavaScript linter -+ [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers -+ [Yeoman](http://yeoman.io/) - Web application stack and development tool -+ [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation - -and [many more](https://npmjs.org/browse/depended/shelljs). - -## Installing - -Via npm: - -```bash -$ npm install [-g] shelljs -``` - -If the global option `-g` is specified, the binary `shjs` will be installed. This makes it possible to -run ShellJS scripts much like any shell script from the command line, i.e. without requiring a `node_modules` folder: - -```bash -$ shjs my_script -``` - -You can also just copy `shell.js` into your project's directory, and `require()` accordingly. - - -## Examples - -### JavaScript - -```javascript -require('shelljs/global'); - -if (!which('git')) { - echo('Sorry, this script requires git'); - exit(1); -} - -// Copy files to release dir -mkdir('-p', 'out/Release'); -cp('-R', 'stuff/*', 'out/Release'); - -// Replace macros in each .js file -cd('lib'); -ls('*.js').forEach(function(file) { - sed('-i', 'BUILD_VERSION', 'v0.1.2', file); - sed('-i', /.*REMOVE_THIS_LINE.*\n/, '', file); - sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat('macro.js'), file); -}); -cd('..'); - -// Run external tool synchronously -if (exec('git commit -am "Auto-commit"').code !== 0) { - echo('Error: Git commit failed'); - exit(1); -} -``` - -### CoffeeScript - -```coffeescript -require 'shelljs/global' - -if not which 'git' - echo 'Sorry, this script requires git' - exit 1 - -# Copy files to release dir -mkdir '-p', 'out/Release' -cp '-R', 'stuff/*', 'out/Release' - -# Replace macros in each .js file -cd 'lib' -for file in ls '*.js' - sed '-i', 'BUILD_VERSION', 'v0.1.2', file - sed '-i', /.*REMOVE_THIS_LINE.*\n/, '', file - sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat 'macro.js', file -cd '..' - -# Run external tool synchronously -if (exec 'git commit -am "Auto-commit"').code != 0 - echo 'Error: Git commit failed' - exit 1 -``` - -## Global vs. Local - -The example above uses the convenience script `shelljs/global` to reduce verbosity. If polluting your global namespace is not desirable, simply require `shelljs`. - -Example: - -```javascript -var shell = require('shelljs'); -shell.echo('hello world'); -``` - -## Make tool - -A convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. In this case all shell objects are global, and command line arguments will cause the script to execute only the corresponding function in the global `target` object. To avoid redundant calls, target functions are executed only once per script. - -Example (CoffeeScript): - -```coffeescript -require 'shelljs/make' - -target.all = -> - target.bundle() - target.docs() - -target.bundle = -> - cd __dirname - mkdir 'build' - cd 'lib' - (cat '*.js').to '../build/output.js' - -target.docs = -> - cd __dirname - mkdir 'docs' - cd 'lib' - for file in ls '*.js' - text = grep '//@', file # extract special comments - text.replace '//@', '' # remove comment tags - text.to 'docs/my_docs.md' -``` - -To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`, and so on. - - - - - - -## Command reference - - -All commands run synchronously, unless otherwise stated. - - -### cd('dir') -Changes to directory `dir` for the duration of the script - -### pwd() -Returns the current directory. - -### ls([options ,] path [,path ...]) -### ls([options ,] path_array) -Available options: - -+ `-R`: recursive -+ `-A`: all files (include files beginning with `.`, except for `.` and `..`) - -Examples: - -```javascript -ls('projs/*.js'); -ls('-R', '/users/me', '/tmp'); -ls('-R', ['/users/me', '/tmp']); // same as above -``` - -Returns array of files in the given path, or in current directory if no path provided. - -### find(path [,path ...]) -### find(path_array) -Examples: - -```javascript -find('src', 'lib'); -find(['src', 'lib']); // same as above -find('.').filter(function(file) { return file.match(/\.js$/); }); -``` - -Returns array of all files (however deep) in the given paths. - -The main difference from `ls('-R', path)` is that the resulting file names -include the base directories, e.g. `lib/resources/file1` instead of just `file1`. - -### cp([options ,] source [,source ...], dest) -### cp([options ,] source_array, dest) -Available options: - -+ `-f`: force -+ `-r, -R`: recursive - -Examples: - -```javascript -cp('file1', 'dir1'); -cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); -cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above -``` - -Copies files. The wildcard `*` is accepted. - -### rm([options ,] file [, file ...]) -### rm([options ,] file_array) -Available options: - -+ `-f`: force -+ `-r, -R`: recursive - -Examples: - -```javascript -rm('-rf', '/tmp/*'); -rm('some_file.txt', 'another_file.txt'); -rm(['some_file.txt', 'another_file.txt']); // same as above -``` - -Removes files. The wildcard `*` is accepted. - -### mv(source [, source ...], dest') -### mv(source_array, dest') -Available options: - -+ `f`: force - -Examples: - -```javascript -mv('-f', 'file', 'dir/'); -mv('file1', 'file2', 'dir/'); -mv(['file1', 'file2'], 'dir/'); // same as above -``` - -Moves files. The wildcard `*` is accepted. - -### mkdir([options ,] dir [, dir ...]) -### mkdir([options ,] dir_array) -Available options: - -+ `p`: full path (will create intermediate dirs if necessary) - -Examples: - -```javascript -mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); -mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above -``` - -Creates directories. - -### test(expression) -Available expression primaries: - -+ `'-b', 'path'`: true if path is a block device -+ `'-c', 'path'`: true if path is a character device -+ `'-d', 'path'`: true if path is a directory -+ `'-e', 'path'`: true if path exists -+ `'-f', 'path'`: true if path is a regular file -+ `'-L', 'path'`: true if path is a symboilc link -+ `'-p', 'path'`: true if path is a pipe (FIFO) -+ `'-S', 'path'`: true if path is a socket - -Examples: - -```javascript -if (test('-d', path)) { /* do something with dir */ }; -if (!test('-f', path)) continue; // skip if it's a regular file -``` - -Evaluates expression using the available primaries and returns corresponding value. - -### cat(file [, file ...]) -### cat(file_array) - -Examples: - -```javascript -var str = cat('file*.txt'); -var str = cat('file1', 'file2'); -var str = cat(['file1', 'file2']); // same as above -``` - -Returns a string containing the given file, or a concatenated string -containing the files if more than one file is given (a new line character is -introduced between each file). Wildcard `*` accepted. - -### 'string'.to(file) - -Examples: - -```javascript -cat('input.txt').to('output.txt'); -``` - -Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as -those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ - -### sed([options ,] search_regex, replace_str, file) -Available options: - -+ `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ - -Examples: - -```javascript -sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); -sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); -``` - -Reads an input string from `file` and performs a JavaScript `replace()` on the input -using the given search regex and replacement string. Returns the new string after replacement. - -### grep([options ,] regex_filter, file [, file ...]) -### grep([options ,] regex_filter, file_array) -Available options: - -+ `-v`: Inverse the sense of the regex and print the lines not matching the criteria. - -Examples: - -```javascript -grep('-v', 'GLOBAL_VARIABLE', '*.js'); -grep('GLOBAL_VARIABLE', '*.js'); -``` - -Reads input string from given files and returns a string containing all lines of the -file that match the given `regex_filter`. Wildcard `*` accepted. - -### which(command) - -Examples: - -```javascript -var nodeExec = which('node'); -``` - -Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. -Returns string containing the absolute path to the command. - -### echo(string [,string ...]) - -Examples: - -```javascript -echo('hello world'); -var str = echo('hello world'); -``` - -Prints string to stdout, and returns string with additional utility methods -like `.to()`. - -### dirs([options | '+N' | '-N']) - -Available options: - -+ `-c`: Clears the directory stack by deleting all of the elements. - -Arguments: - -+ `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. -+ `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. - -Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. - -See also: pushd, popd - -### pushd([options,] [dir | '-N' | '+N']) - -Available options: - -+ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. - -Arguments: - -+ `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. -+ `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -+ `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. - -Examples: - -```javascript -// process.cwd() === '/usr' -pushd('/etc'); // Returns /etc /usr -pushd('+1'); // Returns /usr /etc -``` - -Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. - -### popd([options,] ['-N' | '+N']) - -Available options: - -+ `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. - -Arguments: - -+ `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. -+ `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. - -Examples: - -```javascript -echo(process.cwd()); // '/usr' -pushd('/etc'); // '/etc /usr' -echo(process.cwd()); // '/etc' -popd(); // '/usr' -echo(process.cwd()); // '/usr' -``` - -When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. - -### exit(code) -Exits the current process with the given exit code. - -### env['VAR_NAME'] -Object containing environment variables (both getter and setter). Shortcut to process.env. - -### exec(command [, options] [, callback]) -Available options (all `false` by default): - -+ `async`: Asynchronous execution. Defaults to true if a callback is provided. -+ `silent`: Do not echo program output to console. - -Examples: - -```javascript -var version = exec('node --version', {silent:true}).output; - -var child = exec('some_long_running_process', {async:true}); -child.stdout.on('data', function(data) { - /* ... do something with data ... */ -}); - -exec('some_long_running_process', function(code, output) { - console.log('Exit code:', code); - console.log('Program output:', output); -}); -``` - -Executes the given `command` _synchronously_, unless otherwise specified. -When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's -`output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and -the `callback` gets the arguments `(code, output)`. - -**Note:** For long-lived processes, it's best to run `exec()` asynchronously as -the current synchronous implementation uses a lot of CPU. This should be getting -fixed soon. - -### chmod(octal_mode || octal_string, file) -### chmod(symbolic_mode, file) - -Available options: - -+ `-v`: output a diagnostic for every file processed -+ `-c`: like verbose but report only when a change is made -+ `-R`: change files and directories recursively - -Examples: - -```javascript -chmod(755, '/Users/brandon'); -chmod('755', '/Users/brandon'); // same as above -chmod('u+x', '/Users/brandon'); -``` - -Alters the permissions of a file or directory by either specifying the -absolute permissions in octal form or expressing the changes in symbols. -This command tries to mimic the POSIX behavior as much as possible. -Notable exceptions: - -+ In symbolic modes, 'a-r' and '-r' are identical. No consideration is - given to the umask. -+ There is no "quiet" option since default behavior is to run silent. - -## Configuration - - -### config.silent -Example: - -```javascript -var silentState = config.silent; // save old silent state -config.silent = true; -/* ... */ -config.silent = silentState; // restore old silent state -``` - -Suppresses all command output if `true`, except for `echo()` calls. -Default is `false`. - -### config.fatal -Example: - -```javascript -config.fatal = true; -cp('this_file_does_not_exist', '/dev/null'); // dies here -/* more commands... */ -``` - -If `true` the script will die on errors. Default is `false`. - -## Non-Unix commands - - -### tempdir() -Searches and returns string containing a writeable, platform-dependent temporary directory. -Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). - -### error() -Tests if error occurred in the last command. Returns `null` if no error occurred, -otherwise returns string explaining the error diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/bin/shjs b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/bin/shjs deleted file mode 100755 index d239a7a..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/bin/shjs +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -if (process.argv.length < 3) { - console.log('ShellJS: missing argument (script name)'); - console.log(); - process.exit(1); -} - -var args, - scriptName = process.argv[2]; -env['NODE_PATH'] = __dirname + '/../..'; - -if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { - if (test('-f', scriptName + '.js')) - scriptName += '.js'; - if (test('-f', scriptName + '.coffee')) - scriptName += '.coffee'; -} - -if (!test('-f', scriptName)) { - console.log('ShellJS: script not found ('+scriptName+')'); - console.log(); - process.exit(1); -} - -args = process.argv.slice(3); - -for (var i = 0, l = args.length; i < l; i++) { - if (args[i][0] !== "-"){ - args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words - } -} - -if (scriptName.match(/\.coffee$/)) { - // - // CoffeeScript - // - if (which('coffee')) { - exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true }); - } else { - console.log('ShellJS: CoffeeScript interpreter not found'); - console.log(); - process.exit(1); - } -} else { - // - // JavaScript - // - exec('node ' + scriptName + ' ' + args.join(' '), { async: true }); -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/global.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/global.js deleted file mode 100644 index 97f0033..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/global.js +++ /dev/null @@ -1,3 +0,0 @@ -var shell = require('./shell.js'); -for (var cmd in shell) - global[cmd] = shell[cmd]; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/jshint.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/jshint.json deleted file mode 100644 index 205ed9c..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/jshint.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "loopfunc": true, - "sub": true -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/make.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/make.js deleted file mode 100644 index b636447..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/make.js +++ /dev/null @@ -1,48 +0,0 @@ -require('./global'); -config.fatal = true; - -global.target = {}; - -// This ensures we only execute the script targets after the entire script has -// been evaluated -var args = process.argv.slice(2); -setTimeout(function() { - var t; - - if (args.length === 1 && args[0] === '--help') { - console.log('Available targets:'); - for (t in target) - console.log(' ' + t); - return; - } - - // Wrap targets to prevent duplicate execution - for (t in target) { - (function(t, oldTarget){ - - // Wrap it - target[t] = function(force) { - if (oldTarget.done && !force) - return; - oldTarget.done = true; - return oldTarget.apply(oldTarget, arguments); - }; - - })(t, target[t]); - } - - // Execute desired targets - if (args.length > 0) { - args.forEach(function(arg) { - if (arg in target) - target[arg](); - else { - console.log('no such target: ' + arg); - exit(1); - } - }); - } else if ('all' in target) { - target.all(); - } - -}, 0); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/package.json deleted file mode 100644 index 7f815c5..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "shelljs", - "version": "0.1.4", - "author": { - "name": "Artur Adib", - "email": "aadib@mozilla.com" - }, - "description": "Portable Unix shell commands for Node.js", - "keywords": [ - "unix", - "shell", - "makefile", - "make", - "jake", - "synchronous" - ], - "repository": { - "type": "git", - "url": "git://github.com/arturadib/shelljs.git" - }, - "homepage": "http://github.com/arturadib/shelljs", - "main": "./shell.js", - "scripts": { - "test": "node scripts/run-tests" - }, - "bin": { - "shjs": "./bin/shjs" - }, - "dependencies": {}, - "devDependencies": { - "jshint": "~1.1.0" - }, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/shelljs)\n\nShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts!\n\nThe project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled-tested in projects like:\n\n+ [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader\n+ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger\n+ [JSHint](http://jshint.com) - Most popular JavaScript linter\n+ [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers\n+ [Yeoman](http://yeoman.io/) - Web application stack and development tool\n+ [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation\n\nand [many more](https://npmjs.org/browse/depended/shelljs).\n\n## Installing\n\nVia npm:\n\n```bash\n$ npm install [-g] shelljs\n```\n\nIf the global option `-g` is specified, the binary `shjs` will be installed. This makes it possible to\nrun ShellJS scripts much like any shell script from the command line, i.e. without requiring a `node_modules` folder:\n\n```bash\n$ shjs my_script\n```\n\nYou can also just copy `shell.js` into your project's directory, and `require()` accordingly.\n\n\n## Examples\n\n### JavaScript\n\n```javascript\nrequire('shelljs/global');\n\nif (!which('git')) {\n echo('Sorry, this script requires git');\n exit(1);\n}\n\n// Copy files to release dir\nmkdir('-p', 'out/Release');\ncp('-R', 'stuff/*', 'out/Release');\n\n// Replace macros in each .js file\ncd('lib');\nls('*.js').forEach(function(file) {\n sed('-i', 'BUILD_VERSION', 'v0.1.2', file);\n sed('-i', /.*REMOVE_THIS_LINE.*\\n/, '', file);\n sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\\n/, cat('macro.js'), file);\n});\ncd('..');\n\n// Run external tool synchronously\nif (exec('git commit -am \"Auto-commit\"').code !== 0) {\n echo('Error: Git commit failed');\n exit(1);\n}\n```\n\n### CoffeeScript\n\n```coffeescript\nrequire 'shelljs/global'\n\nif not which 'git'\n echo 'Sorry, this script requires git'\n exit 1\n\n# Copy files to release dir\nmkdir '-p', 'out/Release'\ncp '-R', 'stuff/*', 'out/Release'\n\n# Replace macros in each .js file\ncd 'lib'\nfor file in ls '*.js'\n sed '-i', 'BUILD_VERSION', 'v0.1.2', file\n sed '-i', /.*REMOVE_THIS_LINE.*\\n/, '', file\n sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\\n/, cat 'macro.js', file\ncd '..'\n\n# Run external tool synchronously\nif (exec 'git commit -am \"Auto-commit\"').code != 0\n echo 'Error: Git commit failed'\n exit 1\n```\n\n## Global vs. Local\n\nThe example above uses the convenience script `shelljs/global` to reduce verbosity. If polluting your global namespace is not desirable, simply require `shelljs`.\n\nExample:\n\n```javascript\nvar shell = require('shelljs');\nshell.echo('hello world');\n```\n\n## Make tool\n\nA convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. In this case all shell objects are global, and command line arguments will cause the script to execute only the corresponding function in the global `target` object. To avoid redundant calls, target functions are executed only once per script.\n\nExample (CoffeeScript):\n\n```coffeescript\nrequire 'shelljs/make'\n\ntarget.all = ->\n target.bundle()\n target.docs()\n\ntarget.bundle = ->\n cd __dirname\n mkdir 'build'\n cd 'lib'\n (cat '*.js').to '../build/output.js'\n\ntarget.docs = ->\n cd __dirname\n mkdir 'docs'\n cd 'lib'\n for file in ls '*.js'\n text = grep '//@', file # extract special comments\n text.replace '//@', '' # remove comment tags\n text.to 'docs/my_docs.md'\n```\n\nTo run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`, and so on.\n\n\n\n\n\n\n## Command reference\n\n\nAll commands run synchronously, unless otherwise stated.\n\n\n### cd('dir')\nChanges to directory `dir` for the duration of the script\n\n### pwd()\nReturns the current directory.\n\n### ls([options ,] path [,path ...])\n### ls([options ,] path_array)\nAvailable options:\n\n+ `-R`: recursive\n+ `-A`: all files (include files beginning with `.`, except for `.` and `..`)\n\nExamples:\n\n```javascript\nls('projs/*.js');\nls('-R', '/users/me', '/tmp');\nls('-R', ['/users/me', '/tmp']); // same as above\n```\n\nReturns array of files in the given path, or in current directory if no path provided.\n\n### find(path [,path ...])\n### find(path_array)\nExamples:\n\n```javascript\nfind('src', 'lib');\nfind(['src', 'lib']); // same as above\nfind('.').filter(function(file) { return file.match(/\\.js$/); });\n```\n\nReturns array of all files (however deep) in the given paths.\n\nThe main difference from `ls('-R', path)` is that the resulting file names\ninclude the base directories, e.g. `lib/resources/file1` instead of just `file1`.\n\n### cp([options ,] source [,source ...], dest)\n### cp([options ,] source_array, dest)\nAvailable options:\n\n+ `-f`: force\n+ `-r, -R`: recursive\n\nExamples:\n\n```javascript\ncp('file1', 'dir1');\ncp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp');\ncp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above\n```\n\nCopies files. The wildcard `*` is accepted.\n\n### rm([options ,] file [, file ...])\n### rm([options ,] file_array)\nAvailable options:\n\n+ `-f`: force\n+ `-r, -R`: recursive\n\nExamples:\n\n```javascript\nrm('-rf', '/tmp/*');\nrm('some_file.txt', 'another_file.txt');\nrm(['some_file.txt', 'another_file.txt']); // same as above\n```\n\nRemoves files. The wildcard `*` is accepted.\n\n### mv(source [, source ...], dest')\n### mv(source_array, dest')\nAvailable options:\n\n+ `f`: force\n\nExamples:\n\n```javascript\nmv('-f', 'file', 'dir/');\nmv('file1', 'file2', 'dir/');\nmv(['file1', 'file2'], 'dir/'); // same as above\n```\n\nMoves files. The wildcard `*` is accepted.\n\n### mkdir([options ,] dir [, dir ...])\n### mkdir([options ,] dir_array)\nAvailable options:\n\n+ `p`: full path (will create intermediate dirs if necessary)\n\nExamples:\n\n```javascript\nmkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g');\nmkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above\n```\n\nCreates directories.\n\n### test(expression)\nAvailable expression primaries:\n\n+ `'-b', 'path'`: true if path is a block device\n+ `'-c', 'path'`: true if path is a character device\n+ `'-d', 'path'`: true if path is a directory\n+ `'-e', 'path'`: true if path exists\n+ `'-f', 'path'`: true if path is a regular file\n+ `'-L', 'path'`: true if path is a symboilc link\n+ `'-p', 'path'`: true if path is a pipe (FIFO)\n+ `'-S', 'path'`: true if path is a socket\n\nExamples:\n\n```javascript\nif (test('-d', path)) { /* do something with dir */ };\nif (!test('-f', path)) continue; // skip if it's a regular file\n```\n\nEvaluates expression using the available primaries and returns corresponding value.\n\n### cat(file [, file ...])\n### cat(file_array)\n\nExamples:\n\n```javascript\nvar str = cat('file*.txt');\nvar str = cat('file1', 'file2');\nvar str = cat(['file1', 'file2']); // same as above\n```\n\nReturns a string containing the given file, or a concatenated string\ncontaining the files if more than one file is given (a new line character is\nintroduced between each file). Wildcard `*` accepted.\n\n### 'string'.to(file)\n\nExamples:\n\n```javascript\ncat('input.txt').to('output.txt');\n```\n\nAnalogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as\nthose returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_\n\n### sed([options ,] search_regex, replace_str, file)\nAvailable options:\n\n+ `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_\n\nExamples:\n\n```javascript\nsed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');\nsed(/.*DELETE_THIS_LINE.*\\n/, '', 'source.js');\n```\n\nReads an input string from `file` and performs a JavaScript `replace()` on the input\nusing the given search regex and replacement string. Returns the new string after replacement.\n\n### grep([options ,] regex_filter, file [, file ...])\n### grep([options ,] regex_filter, file_array)\nAvailable options:\n\n+ `-v`: Inverse the sense of the regex and print the lines not matching the criteria.\n\nExamples:\n\n```javascript\ngrep('-v', 'GLOBAL_VARIABLE', '*.js');\ngrep('GLOBAL_VARIABLE', '*.js');\n```\n\nReads input string from given files and returns a string containing all lines of the\nfile that match the given `regex_filter`. Wildcard `*` accepted.\n\n### which(command)\n\nExamples:\n\n```javascript\nvar nodeExec = which('node');\n```\n\nSearches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions.\nReturns string containing the absolute path to the command.\n\n### echo(string [,string ...])\n\nExamples:\n\n```javascript\necho('hello world');\nvar str = echo('hello world');\n```\n\nPrints string to stdout, and returns string with additional utility methods\nlike `.to()`.\n\n### dirs([options | '+N' | '-N'])\n\nAvailable options:\n\n+ `-c`: Clears the directory stack by deleting all of the elements.\n\nArguments:\n\n+ `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.\n+ `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.\n\nDisplay the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.\n\nSee also: pushd, popd\n\n### pushd([options,] [dir | '-N' | '+N'])\n\nAvailable options:\n\n+ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated.\n\nArguments:\n\n+ `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`.\n+ `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.\n+ `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.\n\nExamples:\n\n```javascript\n// process.cwd() === '/usr'\npushd('/etc'); // Returns /etc /usr\npushd('+1'); // Returns /usr /etc\n```\n\nSave the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.\n\n### popd([options,] ['-N' | '+N'])\n\nAvailable options:\n\n+ `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated.\n\nArguments:\n\n+ `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.\n+ `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.\n\nExamples:\n\n```javascript\necho(process.cwd()); // '/usr'\npushd('/etc'); // '/etc /usr'\necho(process.cwd()); // '/etc'\npopd(); // '/usr'\necho(process.cwd()); // '/usr'\n```\n\nWhen no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.\n\n### exit(code)\nExits the current process with the given exit code.\n\n### env['VAR_NAME']\nObject containing environment variables (both getter and setter). Shortcut to process.env.\n\n### exec(command [, options] [, callback])\nAvailable options (all `false` by default):\n\n+ `async`: Asynchronous execution. Defaults to true if a callback is provided.\n+ `silent`: Do not echo program output to console.\n\nExamples:\n\n```javascript\nvar version = exec('node --version', {silent:true}).output;\n\nvar child = exec('some_long_running_process', {async:true});\nchild.stdout.on('data', function(data) {\n /* ... do something with data ... */\n});\n\nexec('some_long_running_process', function(code, output) {\n console.log('Exit code:', code);\n console.log('Program output:', output);\n});\n```\n\nExecutes the given `command` _synchronously_, unless otherwise specified.\nWhen in synchronous mode returns the object `{ code:..., output:... }`, containing the program's\n`output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and\nthe `callback` gets the arguments `(code, output)`.\n\n**Note:** For long-lived processes, it's best to run `exec()` asynchronously as\nthe current synchronous implementation uses a lot of CPU. This should be getting\nfixed soon.\n\n### chmod(octal_mode || octal_string, file)\n### chmod(symbolic_mode, file)\n\nAvailable options:\n\n+ `-v`: output a diagnostic for every file processed\n+ `-c`: like verbose but report only when a change is made\n+ `-R`: change files and directories recursively\n\nExamples:\n\n```javascript\nchmod(755, '/Users/brandon');\nchmod('755', '/Users/brandon'); // same as above \nchmod('u+x', '/Users/brandon');\n```\n\nAlters the permissions of a file or directory by either specifying the\nabsolute permissions in octal form or expressing the changes in symbols.\nThis command tries to mimic the POSIX behavior as much as possible.\nNotable exceptions:\n\n+ In symbolic modes, 'a-r' and '-r' are identical. No consideration is\n given to the umask.\n+ There is no \"quiet\" option since default behavior is to run silent.\n\n## Configuration\n\n\n### config.silent\nExample:\n\n```javascript\nvar silentState = config.silent; // save old silent state\nconfig.silent = true;\n/* ... */\nconfig.silent = silentState; // restore old silent state\n```\n\nSuppresses all command output if `true`, except for `echo()` calls.\nDefault is `false`.\n\n### config.fatal\nExample:\n\n```javascript\nconfig.fatal = true;\ncp('this_file_does_not_exist', '/dev/null'); // dies here\n/* more commands... */\n```\n\nIf `true` the script will die on errors. Default is `false`.\n\n## Non-Unix commands\n\n\n### tempdir()\nSearches and returns string containing a writeable, platform-dependent temporary directory.\nFollows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir).\n\n### error()\nTests if error occurred in the last command. Returns `null` if no error occurred,\notherwise returns string explaining the error\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/arturadib/shelljs/issues" - }, - "_id": "shelljs@0.1.4", - "_from": "shelljs@0.1.x" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/scripts/docs.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/scripts/docs.js deleted file mode 100755 index 68a2138..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/scripts/docs.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -echo('Appending docs to README.md'); - -cd(__dirname + '/..'); - -// Extract docs from shell.js -var docs = grep('//@', 'shell.js'); -// Remove '//@' -docs = docs.replace(/\/\/\@ ?/g, ''); -// Append docs to README -sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md'); - -echo('All done.'); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js deleted file mode 100755 index a9d32fc..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -var path = require('path'); - -var failed = false; - -// -// Lint -// -JSHINT_BIN = './node_modules/jshint/bin/jshint'; -cd(__dirname + '/..'); - -if (!test('-f', JSHINT_BIN)) { - echo('JSHint not found. Run `npm install` in the root dir first.'); - exit(1); -} - -if (exec(JSHINT_BIN + ' --config jshint.json *.js test/*.js').code !== 0) { - failed = true; - echo('*** JSHINT FAILED! (return code != 0)'); - echo(); -} else { - echo('All JSHint tests passed'); - echo(); -} - -// -// Unit tests -// -cd(__dirname + '/../test'); -ls('*.js').forEach(function(file) { - echo('Running test:', file); - if (exec('node ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit) - failed = true; - echo('*** TEST FAILED! (missing exit code "123")'); - echo(); - } -}); - -if (failed) { - echo(); - echo('*******************************************************'); - echo('WARNING: Some tests did not pass!'); - echo('*******************************************************'); - exit(1); -} else { - echo(); - echo('All tests passed.'); -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/shell.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/shell.js deleted file mode 100644 index 7a4f4c8..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/shell.js +++ /dev/null @@ -1,1901 +0,0 @@ -// -// ShellJS -// Unix shell commands on top of Node's API -// -// Copyright (c) 2012 Artur Adib -// http://github.com/arturadib/shelljs -// - -var fs = require('fs'), - path = require('path'), - util = require('util'), - vm = require('vm'), - child = require('child_process'), - os = require('os'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -var config = { - silent: false, - fatal: false -}; - -var state = { - error: null, - currentCmd: 'shell.js', - tempDir: null - }, - platform = os.type().match(/^Win/) ? 'win' : 'unix'; - - -//@ -//@ All commands run synchronously, unless otherwise stated. -//@ - - -//@ -//@ ### cd('dir') -//@ Changes to directory `dir` for the duration of the script -function _cd(options, dir) { - if (!dir) - error('directory not specified'); - - if (!fs.existsSync(dir)) - error('no such file or directory: ' + dir); - - if (!fs.statSync(dir).isDirectory()) - error('not a directory: ' + dir); - - process.chdir(dir); -} -exports.cd = wrap('cd', _cd); - -//@ -//@ ### pwd() -//@ Returns the current directory. -function _pwd(options) { - var pwd = path.resolve(process.cwd()); - return ShellString(pwd); -} -exports.pwd = wrap('pwd', _pwd); - - -//@ -//@ ### ls([options ,] path [,path ...]) -//@ ### ls([options ,] path_array) -//@ Available options: -//@ -//@ + `-R`: recursive -//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ ls('projs/*.js'); -//@ ls('-R', '/users/me', '/tmp'); -//@ ls('-R', ['/users/me', '/tmp']); // same as above -//@ ``` -//@ -//@ Returns array of files in the given path, or in current directory if no path provided. -function _ls(options, paths) { - options = parseOptions(options, { - 'R': 'recursive', - 'A': 'all', - 'a': 'all_deprecated' - }); - - if (options.all_deprecated) { - // We won't support the -a option as it's hard to image why it's useful - // (it includes '.' and '..' in addition to '.*' files) - // For backwards compatibility we'll dump a deprecated message and proceed as before - log('ls: Option -a is deprecated. Use -A instead'); - options.all = true; - } - - if (!paths) - paths = ['.']; - else if (typeof paths === 'object') - paths = paths; // assume array - else if (typeof paths === 'string') - paths = [].slice.call(arguments, 1); - - var list = []; - - // Conditionally pushes file to list - returns true if pushed, false otherwise - // (e.g. prevents hidden files to be included unless explicitly told so) - function pushFile(file, query) { - // hidden file? - if (path.basename(file)[0] === '.') { - // not explicitly asking for hidden files? - if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) - return false; - } - - if (platform === 'win') - file = file.replace(/\\/g, '/'); - - list.push(file); - return true; - } - - paths.forEach(function(p) { - if (fs.existsSync(p)) { - var stats = fs.statSync(p); - // Simple file? - if (stats.isFile()) { - pushFile(p, p); - return; // continue - } - - // Simple dir? - if (stats.isDirectory()) { - // Iterate over p contents - fs.readdirSync(p).forEach(function(file) { - if (!pushFile(file, p)) - return; - - // Recursive? - if (options.recursive) { - var oldDir = _pwd(); - _cd('', p); - if (fs.statSync(file).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'A':''), file+'/*')); - _cd('', oldDir); - } - }); - return; // continue - } - } - - // p does not exist - possible wildcard present - - var basename = path.basename(p); - var dirname = path.dirname(p); - // Wildcard present on an existing dir? (e.g. '/tmp/*.js') - if (basename.search(/\*/) > -1 && fs.existsSync(dirname) && fs.statSync(dirname).isDirectory) { - // Escape special regular expression chars - var regexp = basename.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\.|\+|\?)/g, '\\$1'); - // Translates wildcard into regex - regexp = '^' + regexp.replace(/\*/g, '.*') + '$'; - // Iterate over directory contents - fs.readdirSync(dirname).forEach(function(file) { - if (file.match(new RegExp(regexp))) { - if (!pushFile(path.normalize(dirname+'/'+file), basename)) - return; - - // Recursive? - if (options.recursive) { - var pp = dirname + '/' + file; - if (fs.lstatSync(pp).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); - } // recursive - } // if file matches - }); // forEach - return; - } - - error('no such file or directory: ' + p, true); - }); - - return list; -} -exports.ls = wrap('ls', _ls); - - -//@ -//@ ### find(path [,path ...]) -//@ ### find(path_array) -//@ Examples: -//@ -//@ ```javascript -//@ find('src', 'lib'); -//@ find(['src', 'lib']); // same as above -//@ find('.').filter(function(file) { return file.match(/\.js$/); }); -//@ ``` -//@ -//@ Returns array of all files (however deep) in the given paths. -//@ -//@ The main difference from `ls('-R', path)` is that the resulting file names -//@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`. -function _find(options, paths) { - if (!paths) - error('no path specified'); - else if (typeof paths === 'object') - paths = paths; // assume array - else if (typeof paths === 'string') - paths = [].slice.call(arguments, 1); - - var list = []; - - function pushFile(file) { - if (platform === 'win') - file = file.replace(/\\/g, '/'); - list.push(file); - } - - // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs - // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory - - paths.forEach(function(file) { - pushFile(file); - - if (fs.statSync(file).isDirectory()) { - _ls('-RA', file+'/*').forEach(function(subfile) { - pushFile(subfile); - }); - } - }); - - return list; -} -exports.find = wrap('find', _find); - - -//@ -//@ ### cp([options ,] source [,source ...], dest) -//@ ### cp([options ,] source_array, dest) -//@ Available options: -//@ -//@ + `-f`: force -//@ + `-r, -R`: recursive -//@ -//@ Examples: -//@ -//@ ```javascript -//@ cp('file1', 'dir1'); -//@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); -//@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above -//@ ``` -//@ -//@ Copies files. The wildcard `*` is accepted. -function _cp(options, sources, dest) { - options = parseOptions(options, { - 'f': 'force', - 'R': 'recursive', - 'r': 'recursive' - }); - - // Get sources, dest - if (arguments.length < 3) { - error('missing and/or '); - } else if (arguments.length > 3) { - sources = [].slice.call(arguments, 1, arguments.length - 1); - dest = arguments[arguments.length - 1]; - } else if (typeof sources === 'string') { - sources = [sources]; - } else if ('length' in sources) { - sources = sources; // no-op for array - } else { - error('invalid arguments'); - } - - var exists = fs.existsSync(dest), - stats = exists && fs.statSync(dest); - - // Dest is not existing dir, but multiple sources given - if ((!exists || !stats.isDirectory()) && sources.length > 1) - error('dest is not a directory (too many sources)'); - - // Dest is an existing file, but no -f given - if (exists && stats.isFile() && !options.force) - error('dest file already exists: ' + dest); - - if (options.recursive) { - // Recursive allows the shortcut syntax "sourcedir/" for "sourcedir/*" - // (see Github issue #15) - sources.forEach(function(src, i) { - if (src[src.length - 1] === '/') - sources[i] += '*'; - }); - - // Create dest - try { - fs.mkdirSync(dest, parseInt('0777', 8)); - } catch (e) { - // like Unix's cp, keep going even if we can't create dest dir - } - } - - sources = expand(sources); - - sources.forEach(function(src) { - if (!fs.existsSync(src)) { - error('no such file or directory: '+src, true); - return; // skip file - } - - // If here, src exists - if (fs.statSync(src).isDirectory()) { - if (!options.recursive) { - // Non-Recursive - log(src + ' is a directory (not copied)'); - } else { - // Recursive - // 'cp /a/source dest' should create 'source' in 'dest' - var newDest = path.join(dest, path.basename(src)), - checkDir = fs.statSync(src); - try { - fs.mkdirSync(newDest, checkDir.mode); - } catch (e) { - //if the directory already exists, that's okay - if (e.code !== 'EEXIST') throw e; - } - - cpdirSyncRecursive(src, newDest, {force: options.force}); - } - return; // done with dir - } - - // If here, src is a file - - // When copying to '/path/dir': - // thisDest = '/path/dir/file1' - var thisDest = dest; - if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) - thisDest = path.normalize(dest + '/' + path.basename(src)); - - if (fs.existsSync(thisDest) && !options.force) { - error('dest file already exists: ' + thisDest, true); - return; // skip file - } - - copyFileSync(src, thisDest); - }); // forEach(src) -} -exports.cp = wrap('cp', _cp); - -//@ -//@ ### rm([options ,] file [, file ...]) -//@ ### rm([options ,] file_array) -//@ Available options: -//@ -//@ + `-f`: force -//@ + `-r, -R`: recursive -//@ -//@ Examples: -//@ -//@ ```javascript -//@ rm('-rf', '/tmp/*'); -//@ rm('some_file.txt', 'another_file.txt'); -//@ rm(['some_file.txt', 'another_file.txt']); // same as above -//@ ``` -//@ -//@ Removes files. The wildcard `*` is accepted. -function _rm(options, files) { - options = parseOptions(options, { - 'f': 'force', - 'r': 'recursive', - 'R': 'recursive' - }); - if (!files) - error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 1); - // if it's array leave it as it is - - files = expand(files); - - files.forEach(function(file) { - if (!fs.existsSync(file)) { - // Path does not exist, no force flag given - if (!options.force) - error('no such file or directory: '+file, true); - - return; // skip file - } - - // If here, path exists - - var stats = fs.statSync(file); - // Remove simple file - if (stats.isFile()) { - - // Do not check for file writing permissions - if (options.force) { - _unlinkSync(file); - return; - } - - if (isWriteable(file)) - _unlinkSync(file); - else - error('permission denied: '+file, true); - - return; - } // simple file - - // Path is an existing directory, but no -r flag given - if (stats.isDirectory() && !options.recursive) { - error('path is a directory', true); - return; // skip path - } - - // Recursively remove existing directory - if (stats.isDirectory() && options.recursive) { - rmdirSyncRecursive(file, options.force); - } - }); // forEach(file) -} // rm -exports.rm = wrap('rm', _rm); - -//@ -//@ ### mv(source [, source ...], dest') -//@ ### mv(source_array, dest') -//@ Available options: -//@ -//@ + `f`: force -//@ -//@ Examples: -//@ -//@ ```javascript -//@ mv('-f', 'file', 'dir/'); -//@ mv('file1', 'file2', 'dir/'); -//@ mv(['file1', 'file2'], 'dir/'); // same as above -//@ ``` -//@ -//@ Moves files. The wildcard `*` is accepted. -function _mv(options, sources, dest) { - options = parseOptions(options, { - 'f': 'force' - }); - - // Get sources, dest - if (arguments.length < 3) { - error('missing and/or '); - } else if (arguments.length > 3) { - sources = [].slice.call(arguments, 1, arguments.length - 1); - dest = arguments[arguments.length - 1]; - } else if (typeof sources === 'string') { - sources = [sources]; - } else if ('length' in sources) { - sources = sources; // no-op for array - } else { - error('invalid arguments'); - } - - sources = expand(sources); - - var exists = fs.existsSync(dest), - stats = exists && fs.statSync(dest); - - // Dest is not existing dir, but multiple sources given - if ((!exists || !stats.isDirectory()) && sources.length > 1) - error('dest is not a directory (too many sources)'); - - // Dest is an existing file, but no -f given - if (exists && stats.isFile() && !options.force) - error('dest file already exists: ' + dest); - - sources.forEach(function(src) { - if (!fs.existsSync(src)) { - error('no such file or directory: '+src, true); - return; // skip file - } - - // If here, src exists - - // When copying to '/path/dir': - // thisDest = '/path/dir/file1' - var thisDest = dest; - if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) - thisDest = path.normalize(dest + '/' + path.basename(src)); - - if (fs.existsSync(thisDest) && !options.force) { - error('dest file already exists: ' + thisDest, true); - return; // skip file - } - - if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { - error('cannot move to self: '+src, true); - return; // skip file - } - - fs.renameSync(src, thisDest); - }); // forEach(src) -} // mv -exports.mv = wrap('mv', _mv); - -//@ -//@ ### mkdir([options ,] dir [, dir ...]) -//@ ### mkdir([options ,] dir_array) -//@ Available options: -//@ -//@ + `p`: full path (will create intermediate dirs if necessary) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); -//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above -//@ ``` -//@ -//@ Creates directories. -function _mkdir(options, dirs) { - options = parseOptions(options, { - 'p': 'fullpath' - }); - if (!dirs) - error('no paths given'); - - if (typeof dirs === 'string') - dirs = [].slice.call(arguments, 1); - // if it's array leave it as it is - - dirs.forEach(function(dir) { - if (fs.existsSync(dir)) { - if (!options.fullpath) - error('path already exists: ' + dir, true); - return; // skip dir - } - - // Base dir does not exist, and no -p option given - var baseDir = path.dirname(dir); - if (!fs.existsSync(baseDir) && !options.fullpath) { - error('no such file or directory: ' + baseDir, true); - return; // skip dir - } - - if (options.fullpath) - mkdirSyncRecursive(dir); - else - fs.mkdirSync(dir, parseInt('0777', 8)); - }); -} // mkdir -exports.mkdir = wrap('mkdir', _mkdir); - -//@ -//@ ### test(expression) -//@ Available expression primaries: -//@ -//@ + `'-b', 'path'`: true if path is a block device -//@ + `'-c', 'path'`: true if path is a character device -//@ + `'-d', 'path'`: true if path is a directory -//@ + `'-e', 'path'`: true if path exists -//@ + `'-f', 'path'`: true if path is a regular file -//@ + `'-L', 'path'`: true if path is a symboilc link -//@ + `'-p', 'path'`: true if path is a pipe (FIFO) -//@ + `'-S', 'path'`: true if path is a socket -//@ -//@ Examples: -//@ -//@ ```javascript -//@ if (test('-d', path)) { /* do something with dir */ }; -//@ if (!test('-f', path)) continue; // skip if it's a regular file -//@ ``` -//@ -//@ Evaluates expression using the available primaries and returns corresponding value. -function _test(options, path) { - if (!path) - error('no path given'); - - // hack - only works with unary primaries - options = parseOptions(options, { - 'b': 'block', - 'c': 'character', - 'd': 'directory', - 'e': 'exists', - 'f': 'file', - 'L': 'link', - 'p': 'pipe', - 'S': 'socket' - }); - - var canInterpret = false; - for (var key in options) - if (options[key] === true) { - canInterpret = true; - break; - } - - if (!canInterpret) - error('could not interpret expression'); - - if (options.link) { - try { - return fs.lstatSync(path).isSymbolicLink(); - } catch(e) { - return false; - } - } - - if (!fs.existsSync(path)) - return false; - - if (options.exists) - return true; - - var stats = fs.statSync(path); - - if (options.block) - return stats.isBlockDevice(); - - if (options.character) - return stats.isCharacterDevice(); - - if (options.directory) - return stats.isDirectory(); - - if (options.file) - return stats.isFile(); - - if (options.pipe) - return stats.isFIFO(); - - if (options.socket) - return stats.isSocket(); -} // test -exports.test = wrap('test', _test); - - -//@ -//@ ### cat(file [, file ...]) -//@ ### cat(file_array) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var str = cat('file*.txt'); -//@ var str = cat('file1', 'file2'); -//@ var str = cat(['file1', 'file2']); // same as above -//@ ``` -//@ -//@ Returns a string containing the given file, or a concatenated string -//@ containing the files if more than one file is given (a new line character is -//@ introduced between each file). Wildcard `*` accepted. -function _cat(options, files) { - var cat = ''; - - if (!files) - error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 1); - // if it's array leave it as it is - - files = expand(files); - - files.forEach(function(file) { - if (!fs.existsSync(file)) - error('no such file or directory: ' + file); - - cat += fs.readFileSync(file, 'utf8') + '\n'; - }); - - if (cat[cat.length-1] === '\n') - cat = cat.substring(0, cat.length-1); - - return ShellString(cat); -} -exports.cat = wrap('cat', _cat); - -//@ -//@ ### 'string'.to(file) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ cat('input.txt').to('output.txt'); -//@ ``` -//@ -//@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as -//@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ -function _to(options, file) { - if (!file) - error('wrong arguments'); - - if (!fs.existsSync( path.dirname(file) )) - error('no such file or directory: ' + path.dirname(file)); - - try { - fs.writeFileSync(file, this.toString(), 'utf8'); - } catch(e) { - error('could not write to file (code '+e.code+'): '+file, true); - } -} -// In the future, when Proxies are default, we can add methods like `.to()` to primitive strings. -// For now, this is a dummy function to bookmark places we need such strings -function ShellString(str) { - return str; -} -String.prototype.to = wrap('to', _to); - -//@ -//@ ### sed([options ,] search_regex, replace_str, file) -//@ Available options: -//@ -//@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ -//@ -//@ Examples: -//@ -//@ ```javascript -//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); -//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); -//@ ``` -//@ -//@ Reads an input string from `file` and performs a JavaScript `replace()` on the input -//@ using the given search regex and replacement string. Returns the new string after replacement. -function _sed(options, regex, replacement, file) { - options = parseOptions(options, { - 'i': 'inplace' - }); - - if (typeof replacement === 'string') - replacement = replacement; // no-op - else if (typeof replacement === 'number') - replacement = replacement.toString(); // fallback - else - error('invalid replacement string'); - - if (!file) - error('no file given'); - - if (!fs.existsSync(file)) - error('no such file or directory: ' + file); - - var result = fs.readFileSync(file, 'utf8').replace(regex, replacement); - if (options.inplace) - fs.writeFileSync(file, result, 'utf8'); - - return ShellString(result); -} -exports.sed = wrap('sed', _sed); - -//@ -//@ ### grep([options ,] regex_filter, file [, file ...]) -//@ ### grep([options ,] regex_filter, file_array) -//@ Available options: -//@ -//@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); -//@ grep('GLOBAL_VARIABLE', '*.js'); -//@ ``` -//@ -//@ Reads input string from given files and returns a string containing all lines of the -//@ file that match the given `regex_filter`. Wildcard `*` accepted. -function _grep(options, regex, files) { - options = parseOptions(options, { - 'v': 'inverse' - }); - - if (!files) - error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 2); - // if it's array leave it as it is - - files = expand(files); - - var grep = ''; - files.forEach(function(file) { - if (!fs.existsSync(file)) { - error('no such file or directory: ' + file, true); - return; - } - - var contents = fs.readFileSync(file, 'utf8'), - lines = contents.split(/\r*\n/); - lines.forEach(function(line) { - var matched = line.match(regex); - if ((options.inverse && !matched) || (!options.inverse && matched)) - grep += line + '\n'; - }); - }); - - return ShellString(grep); -} -exports.grep = wrap('grep', _grep); - - -//@ -//@ ### which(command) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var nodeExec = which('node'); -//@ ``` -//@ -//@ Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. -//@ Returns string containing the absolute path to the command. -function _which(options, cmd) { - if (!cmd) - error('must specify command'); - - var pathEnv = process.env.path || process.env.Path || process.env.PATH, - pathArray = splitPath(pathEnv), - where = null; - - // No relative/absolute paths provided? - if (cmd.search(/\//) === -1) { - // Search for command in PATH - pathArray.forEach(function(dir) { - if (where) - return; // already found it - - var attempt = path.resolve(dir + '/' + cmd); - if (fs.existsSync(attempt)) { - where = attempt; - return; - } - - if (platform === 'win') { - var baseAttempt = attempt; - attempt = baseAttempt + '.exe'; - if (fs.existsSync(attempt)) { - where = attempt; - return; - } - attempt = baseAttempt + '.cmd'; - if (fs.existsSync(attempt)) { - where = attempt; - return; - } - attempt = baseAttempt + '.bat'; - if (fs.existsSync(attempt)) { - where = attempt; - return; - } - } // if 'win' - }); - } - - // Command not found anywhere? - if (!fs.existsSync(cmd) && !where) - return null; - - where = where || path.resolve(cmd); - - return ShellString(where); -} -exports.which = wrap('which', _which); - -//@ -//@ ### echo(string [,string ...]) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ echo('hello world'); -//@ var str = echo('hello world'); -//@ ``` -//@ -//@ Prints string to stdout, and returns string with additional utility methods -//@ like `.to()`. -function _echo() { - var messages = [].slice.call(arguments, 0); - console.log.apply(this, messages); - return ShellString(messages.join(' ')); -} -exports.echo = _echo; // don't wrap() as it could parse '-options' - -// Pushd/popd/dirs internals -var _dirStack = []; - -function _isStackIndex(index) { - return (/^[\-+]\d+$/).test(index); -} - -function _parseStackIndex(index) { - if (_isStackIndex(index)) { - if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd - return (/^-/).test(index) ? Number(index) - 1 : Number(index); - } else { - error(index + ': directory stack index out of range'); - } - } else { - error(index + ': invalid number'); - } -} - -function _actualDirStack() { - return [process.cwd()].concat(_dirStack); -} - -//@ -//@ ### dirs([options | '+N' | '-N']) -//@ -//@ Available options: -//@ -//@ + `-c`: Clears the directory stack by deleting all of the elements. -//@ -//@ Arguments: -//@ -//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. -//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. -//@ -//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. -//@ -//@ See also: pushd, popd -function _dirs(options, index) { - if (_isStackIndex(options)) { - index = options; - options = ''; - } - - options = parseOptions(options, { - 'c' : 'clear' - }); - - if (options['clear']) { - _dirStack = []; - return _dirStack; - } - - var stack = _actualDirStack(); - - if (index) { - index = _parseStackIndex(index); - - if (index < 0) { - index = stack.length + index; - } - - log(stack[index]); - return stack[index]; - } - - log(stack.join(' ')); - - return stack; -} -exports.dirs = wrap("dirs", _dirs); - -//@ -//@ ### pushd([options,] [dir | '-N' | '+N']) -//@ -//@ Available options: -//@ -//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. -//@ -//@ Arguments: -//@ -//@ + `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. -//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ // process.cwd() === '/usr' -//@ pushd('/etc'); // Returns /etc /usr -//@ pushd('+1'); // Returns /usr /etc -//@ ``` -//@ -//@ Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. -function _pushd(options, dir) { - if (_isStackIndex(options)) { - dir = options; - options = ''; - } - - options = parseOptions(options, { - 'n' : 'no-cd' - }); - - var dirs = _actualDirStack(); - - if (dir === '+0') { - return dirs; // +0 is a noop - } else if (!dir) { - if (dirs.length > 1) { - dirs = dirs.splice(1, 1).concat(dirs); - } else { - return error('no other directory'); - } - } else if (_isStackIndex(dir)) { - var n = _parseStackIndex(dir); - dirs = dirs.slice(n).concat(dirs.slice(0, n)); - } else { - if (options['no-cd']) { - dirs.splice(1, 0, dir); - } else { - dirs.unshift(dir); - } - } - - if (options['no-cd']) { - dirs = dirs.slice(1); - } else { - dir = path.resolve(dirs.shift()); - _cd('', dir); - } - - _dirStack = dirs; - return _dirs(''); -} -exports.pushd = wrap('pushd', _pushd); - -//@ -//@ ### popd([options,] ['-N' | '+N']) -//@ -//@ Available options: -//@ -//@ + `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. -//@ -//@ Arguments: -//@ -//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. -//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ echo(process.cwd()); // '/usr' -//@ pushd('/etc'); // '/etc /usr' -//@ echo(process.cwd()); // '/etc' -//@ popd(); // '/usr' -//@ echo(process.cwd()); // '/usr' -//@ ``` -//@ -//@ When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. -function _popd(options, index) { - if (_isStackIndex(options)) { - index = options; - options = ''; - } - - options = parseOptions(options, { - 'n' : 'no-cd' - }); - - if (!_dirStack.length) { - return error('directory stack empty'); - } - - index = _parseStackIndex(index || '+0'); - - if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { - index = index > 0 ? index - 1 : index; - _dirStack.splice(index, 1); - } else { - var dir = path.resolve(_dirStack.shift()); - _cd('', dir); - } - - return _dirs(''); -} -exports.popd = wrap("popd", _popd); - -//@ -//@ ### exit(code) -//@ Exits the current process with the given exit code. -exports.exit = process.exit; - -//@ -//@ ### env['VAR_NAME'] -//@ Object containing environment variables (both getter and setter). Shortcut to process.env. -exports.env = process.env; - -//@ -//@ ### exec(command [, options] [, callback]) -//@ Available options (all `false` by default): -//@ -//@ + `async`: Asynchronous execution. Defaults to true if a callback is provided. -//@ + `silent`: Do not echo program output to console. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var version = exec('node --version', {silent:true}).output; -//@ -//@ var child = exec('some_long_running_process', {async:true}); -//@ child.stdout.on('data', function(data) { -//@ /* ... do something with data ... */ -//@ }); -//@ -//@ exec('some_long_running_process', function(code, output) { -//@ console.log('Exit code:', code); -//@ console.log('Program output:', output); -//@ }); -//@ ``` -//@ -//@ Executes the given `command` _synchronously_, unless otherwise specified. -//@ When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's -//@ `output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and -//@ the `callback` gets the arguments `(code, output)`. -//@ -//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as -//@ the current synchronous implementation uses a lot of CPU. This should be getting -//@ fixed soon. -function _exec(command, options, callback) { - if (!command) - error('must specify command'); - - // Callback is defined instead of options. - if (typeof options === 'function') { - callback = options; - options = { async: true }; - } - - // Callback is defined with options. - if (typeof options === 'object' && typeof callback === 'function') { - options.async = true; - } - - options = extend({ - silent: config.silent, - async: false - }, options); - - if (options.async) - return execAsync(command, options, callback); - else - return execSync(command, options); -} -exports.exec = wrap('exec', _exec, {notUnix:true}); - -var PERMS = (function (base) { - return { - OTHER_EXEC : base.EXEC, - OTHER_WRITE : base.WRITE, - OTHER_READ : base.READ, - - GROUP_EXEC : base.EXEC << 3, - GROUP_WRITE : base.WRITE << 3, - GROUP_READ : base.READ << 3, - - OWNER_EXEC : base.EXEC << 6, - OWNER_WRITE : base.WRITE << 6, - OWNER_READ : base.READ << 6, - - // Literal octal numbers are apparently not allowed in "strict" javascript. Using parseInt is - // the preferred way, else a jshint warning is thrown. - STICKY : parseInt('01000', 8), - SETGID : parseInt('02000', 8), - SETUID : parseInt('04000', 8), - - TYPE_MASK : parseInt('0770000', 8) - }; -})({ - EXEC : 1, - WRITE : 2, - READ : 4 -}); - - -//@ -//@ ### chmod(octal_mode || octal_string, file) -//@ ### chmod(symbolic_mode, file) -//@ -//@ Available options: -//@ -//@ + `-v`: output a diagnostic for every file processed//@ -//@ + `-c`: like verbose but report only when a change is made//@ -//@ + `-R`: change files and directories recursively//@ -//@ -//@ Examples: -//@ -//@ ```javascript -//@ chmod(755, '/Users/brandon'); -//@ chmod('755', '/Users/brandon'); // same as above -//@ chmod('u+x', '/Users/brandon'); -//@ ``` -//@ -//@ Alters the permissions of a file or directory by either specifying the -//@ absolute permissions in octal form or expressing the changes in symbols. -//@ This command tries to mimic the POSIX behavior as much as possible. -//@ Notable exceptions: -//@ -//@ + In symbolic modes, 'a-r' and '-r' are identical. No consideration is -//@ given to the umask. -//@ + There is no "quiet" option since default behavior is to run silent. -function _chmod(options, mode, filePattern) { - if (!filePattern) { - if (options.length > 0 && options.charAt(0) === '-') { - // Special case where the specified file permissions started with - to subtract perms, which - // get picked up by the option parser as command flags. - // If we are down by one argument and options starts with -, shift everything over. - filePattern = mode; - mode = options; - options = ''; - } - else { - error('You must specify a file.'); - } - } - - options = parseOptions(options, { - 'R': 'recursive', - 'c': 'changes', - 'v': 'verbose' - }); - - if (typeof filePattern === 'string') { - filePattern = [ filePattern ]; - } - - var files; - - if (options.recursive) { - files = []; - expand(filePattern).forEach(function addFile(expandedFile) { - var stat = fs.lstatSync(expandedFile); - - if (!stat.isSymbolicLink()) { - files.push(expandedFile); - - if (stat.isDirectory()) { // intentionally does not follow symlinks. - fs.readdirSync(expandedFile).forEach(function (child) { - addFile(expandedFile + '/' + child); - }); - } - } - }); - } - else { - files = expand(filePattern); - } - - files.forEach(function innerChmod(file) { - file = path.resolve(file); - if (!fs.existsSync(file)) { - error('File not found: ' + file); - } - - // When recursing, don't follow symlinks. - if (options.recursive && fs.lstatSync(file).isSymbolicLink()) { - return; - } - - var perms = fs.statSync(file).mode; - var type = perms & PERMS.TYPE_MASK; - - var newPerms = perms; - - if (isNaN(parseInt(mode, 8))) { - // parse options - mode.split(',').forEach(function (symbolicMode) { - /*jshint regexdash:true */ - var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; - var matches = pattern.exec(symbolicMode); - - if (matches) { - var applyTo = matches[1]; - var operator = matches[2]; - var change = matches[3]; - - var changeOwner = applyTo.indexOf('u') != -1 || applyTo === 'a' || applyTo === ''; - var changeGroup = applyTo.indexOf('g') != -1 || applyTo === 'a' || applyTo === ''; - var changeOther = applyTo.indexOf('o') != -1 || applyTo === 'a' || applyTo === ''; - - var changeRead = change.indexOf('r') != -1; - var changeWrite = change.indexOf('w') != -1; - var changeExec = change.indexOf('x') != -1; - var changeSticky = change.indexOf('t') != -1; - var changeSetuid = change.indexOf('s') != -1; - - var mask = 0; - if (changeOwner) { - mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); - } - if (changeGroup) { - mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); - } - if (changeOther) { - mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); - } - - // Sticky bit is special - it's not tied to user, group or other. - if (changeSticky) { - mask |= PERMS.STICKY; - } - - switch (operator) { - case '+': - newPerms |= mask; - break; - - case '-': - newPerms &= ~mask; - break; - - case '=': - newPerms = type + mask; - - // According to POSIX, when using = to explicitly set the permissions, setuid and setgid can never be cleared. - if (fs.statSync(file).isDirectory()) { - newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; - } - break; - } - - if (options.verbose) { - log(file + ' -> ' + newPerms.toString(8)); - } - - if (perms != newPerms) { - if (!options.verbose && options.changes) { - log(file + ' -> ' + newPerms.toString(8)); - } - fs.chmodSync(file, newPerms); - } - } - else { - error('Invalid symbolic mode change: ' + symbolicMode); - } - }); - } - else { - // they gave us a full number - newPerms = type + parseInt(mode, 8); - - // POSIX rules are that setuid and setgid can only be added using numeric form, but not cleared. - if (fs.statSync(file).isDirectory()) { - newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; - } - - fs.chmodSync(file, newPerms); - } - }); -} -exports.chmod = wrap('chmod', _chmod); - - -//@ -//@ ## Configuration -//@ - - - -exports.config = config; - -//@ -//@ ### config.silent -//@ Example: -//@ -//@ ```javascript -//@ var silentState = config.silent; // save old silent state -//@ config.silent = true; -//@ /* ... */ -//@ config.silent = silentState; // restore old silent state -//@ ``` -//@ -//@ Suppresses all command output if `true`, except for `echo()` calls. -//@ Default is `false`. - -//@ -//@ ### config.fatal -//@ Example: -//@ -//@ ```javascript -//@ config.fatal = true; -//@ cp('this_file_does_not_exist', '/dev/null'); // dies here -//@ /* more commands... */ -//@ ``` -//@ -//@ If `true` the script will die on errors. Default is `false`. - - - - -//@ -//@ ## Non-Unix commands -//@ - - - - - - -//@ -//@ ### tempdir() -//@ Searches and returns string containing a writeable, platform-dependent temporary directory. -//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). -exports.tempdir = wrap('tempdir', tempDir); - - -//@ -//@ ### error() -//@ Tests if error occurred in the last command. Returns `null` if no error occurred, -//@ otherwise returns string explaining the error -exports.error = function() { - return state.error; -}; - - - - - -//////////////////////////////////////////////////////////////////////////////////////////////// -// -// Auxiliary functions (internal use only) -// - -function log() { - if (!config.silent) - console.log.apply(this, arguments); -} - -function deprecate(what, msg) { - console.log('*** ShellJS.'+what+': This function is deprecated.', msg); -} - -function write(msg) { - if (!config.silent) - process.stdout.write(msg); -} - -// Shows error message. Throws unless _continue or config.fatal are true -function error(msg, _continue) { - if (state.error === null) - state.error = ''; - state.error += state.currentCmd + ': ' + msg + '\n'; - - log(state.error); - - if (config.fatal) - process.exit(1); - - if (!_continue) - throw ''; -} - -// Returns {'alice': true, 'bob': false} when passed: -// parseOptions('-a', {'a':'alice', 'b':'bob'}); -function parseOptions(str, map) { - if (!map) - error('parseOptions() internal error: no map given'); - - // All options are false by default - var options = {}; - for (var letter in map) - options[map[letter]] = false; - - if (!str) - return options; // defaults - - if (typeof str !== 'string') - error('parseOptions() internal error: wrong str'); - - // e.g. match[1] = 'Rf' for str = '-Rf' - var match = str.match(/^\-(.+)/); - if (!match) - return options; - - // e.g. chars = ['R', 'f'] - var chars = match[1].split(''); - - chars.forEach(function(c) { - if (c in map) - options[map[c]] = true; - else - error('option not recognized: '+c); - }); - - return options; -} - -// Common wrapper for all Unix-like commands -function wrap(cmd, fn, options) { - return function() { - var retValue = null; - - state.currentCmd = cmd; - state.error = null; - - try { - var args = [].slice.call(arguments, 0); - - if (options && options.notUnix) { - retValue = fn.apply(this, args); - } else { - if (args.length === 0 || typeof args[0] !== 'string' || args[0][0] !== '-') - args.unshift(''); // only add dummy option if '-option' not already present - retValue = fn.apply(this, args); - } - } catch (e) { - if (!state.error) { - // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug... - console.log('shell.js: internal error'); - console.log(e.stack || e); - process.exit(1); - } - if (config.fatal) - throw e; - } - - state.currentCmd = 'shell.js'; - return retValue; - }; -} // wrap - -// Buffered file copy, synchronous -// (Using readFileSync() + writeFileSync() could easily cause a memory overflow -// with large files) -function copyFileSync(srcFile, destFile) { - if (!fs.existsSync(srcFile)) - error('copyFileSync: no such file or directory: ' + srcFile); - - var BUF_LENGTH = 64*1024, - buf = new Buffer(BUF_LENGTH), - bytesRead = BUF_LENGTH, - pos = 0, - fdr = null, - fdw = null; - - try { - fdr = fs.openSync(srcFile, 'r'); - } catch(e) { - error('copyFileSync: could not read src file ('+srcFile+')'); - } - - try { - fdw = fs.openSync(destFile, 'w'); - } catch(e) { - error('copyFileSync: could not write to dest file (code='+e.code+'):'+destFile); - } - - while (bytesRead === BUF_LENGTH) { - bytesRead = fs.readSync(fdr, buf, 0, BUF_LENGTH, pos); - fs.writeSync(fdw, buf, 0, bytesRead); - pos += bytesRead; - } - - fs.closeSync(fdr); - fs.closeSync(fdw); -} - -// Recursively copies 'sourceDir' into 'destDir' -// Adapted from https://github.com/ryanmcgrath/wrench-js -// -// Copyright (c) 2010 Ryan McGrath -// Copyright (c) 2012 Artur Adib -// -// Licensed under the MIT License -// http://www.opensource.org/licenses/mit-license.php -function cpdirSyncRecursive(sourceDir, destDir, opts) { - if (!opts) opts = {}; - - /* Create the directory where all our junk is moving to; read the mode of the source directory and mirror it */ - var checkDir = fs.statSync(sourceDir); - try { - fs.mkdirSync(destDir, checkDir.mode); - } catch (e) { - //if the directory already exists, that's okay - if (e.code !== 'EEXIST') throw e; - } - - var files = fs.readdirSync(sourceDir); - - for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); - - if (currFile.isDirectory()) { - /* recursion this thing right on back. */ - cpdirSyncRecursive(sourceDir + "/" + files[i], destDir + "/" + files[i], opts); - } else if (currFile.isSymbolicLink()) { - var symlinkFull = fs.readlinkSync(sourceDir + "/" + files[i]); - fs.symlinkSync(symlinkFull, destDir + "/" + files[i]); - } else { - /* At this point, we've hit a file actually worth copying... so copy it on over. */ - if (fs.existsSync(destDir + "/" + files[i]) && !opts.force) { - log('skipping existing file: ' + files[i]); - } else { - copyFileSync(sourceDir + "/" + files[i], destDir + "/" + files[i]); - } - } - - } // for files -} // cpdirSyncRecursive - -// Recursively removes 'dir' -// Adapted from https://github.com/ryanmcgrath/wrench-js -// -// Copyright (c) 2010 Ryan McGrath -// Copyright (c) 2012 Artur Adib -// -// Licensed under the MIT License -// http://www.opensource.org/licenses/mit-license.php -function rmdirSyncRecursive(dir, force) { - var files; - - files = fs.readdirSync(dir); - - // Loop through and delete everything in the sub-tree after checking it - for(var i = 0; i < files.length; i++) { - var file = dir + "/" + files[i], - currFile = fs.lstatSync(file); - - if(currFile.isDirectory()) { // Recursive function back to the beginning - rmdirSyncRecursive(file, force); - } - - else if(currFile.isSymbolicLink()) { // Unlink symlinks - if (force || isWriteable(file)) { - try { - _unlinkSync(file); - } catch (e) { - error('could not remove file (code '+e.code+'): ' + file, true); - } - } - } - - else // Assume it's a file - perhaps a try/catch belongs here? - if (force || isWriteable(file)) { - try { - _unlinkSync(file); - } catch (e) { - error('could not remove file (code '+e.code+'): ' + file, true); - } - } - } - - // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. - // Huzzah for the shopkeep. - - var result; - try { - result = fs.rmdirSync(dir); - } catch(e) { - error('could not remove directory (code '+e.code+'): ' + dir, true); - } - - return result; -} // rmdirSyncRecursive - -// Recursively creates 'dir' -function mkdirSyncRecursive(dir) { - var baseDir = path.dirname(dir); - - // Base dir exists, no recursion necessary - if (fs.existsSync(baseDir)) { - fs.mkdirSync(dir, parseInt('0777', 8)); - return; - } - - // Base dir does not exist, go recursive - mkdirSyncRecursive(baseDir); - - // Base dir created, can create dir - fs.mkdirSync(dir, parseInt('0777', 8)); -} - -// e.g. 'shelljs_a5f185d0443ca...' -function randomFileName() { - function randomHash(count) { - if (count === 1) - return parseInt(16*Math.random(), 10).toString(16); - else { - var hash = ''; - for (var i=0; i&1'; // works on both win/unix - - var script = - "var child = require('child_process')," + - " fs = require('fs');" + - "child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {" + - " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');" + - "});"; - - if (fs.existsSync(scriptFile)) _unlinkSync(scriptFile); - if (fs.existsSync(stdoutFile)) _unlinkSync(stdoutFile); - if (fs.existsSync(codeFile)) _unlinkSync(codeFile); - - fs.writeFileSync(scriptFile, script); - child.exec('"'+process.execPath+'" '+scriptFile, { - env: process.env, - cwd: exports.pwd(), - maxBuffer: 20*1024*1024 - }); - - // The wait loop - // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage - // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing - // CPU usage, though apparently not so much on Windows) - while (!fs.existsSync(codeFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } - while (!fs.existsSync(stdoutFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } - - // At this point codeFile exists, but it's not necessarily flushed yet. - // Keep reading it until it is. - var code = parseInt('', 10); - while (isNaN(code)) { - code = parseInt(fs.readFileSync(codeFile, 'utf8'), 10); - } - - var stdout = fs.readFileSync(stdoutFile, 'utf8'); - - // No biggie if we can't erase the files now -- they're in a temp dir anyway - try { _unlinkSync(scriptFile); } catch(e) {} - try { _unlinkSync(stdoutFile); } catch(e) {} - try { _unlinkSync(codeFile); } catch(e) {} - try { _unlinkSync(sleepFile); } catch(e) {} - - // True if successful, false if not - var obj = { - code: code, - output: stdout - }; - return obj; -} // execSync() - -// Expands wildcards with matching file names. For a given array of file names 'list', returns -// another array containing all file names as per ls(list[i]). -// For example: -// expand(['file*.js']) = ['file1.js', 'file2.js', ...] -// (if the files 'file1.js', 'file2.js', etc, exist in the current dir) -function expand(list) { - var expanded = []; - list.forEach(function(listEl) { - // Wildcard present? - if (listEl.search(/\*/) > -1) { - _ls('', listEl).forEach(function(file) { - expanded.push(file); - }); - } else { - expanded.push(listEl); - } - }); - return expanded; -} - -// Cross-platform method for splitting environment PATH variables -function splitPath(p) { - if (!p) - return []; - - if (platform === 'win') - return p.split(';'); - else - return p.split(':'); -} - -// extend(target_obj, source_obj1 [, source_obj2 ...]) -// Shallow extend, e.g.: -// extend({A:1}, {b:2}, {c:3}) returns {A:1, b:2, c:3} -function extend(target) { - var sources = [].slice.call(arguments, 1); - sources.forEach(function(source) { - for (var key in source) - target[key] = source[key]; - }); - - return target; -} - -// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. -// file can be unlinked even if it's read-only, see joyent/node#3006 -function _unlinkSync(file) { - try { - fs.unlinkSync(file); - } catch(e) { - // Try to override file permission - if (e.code === 'EPERM') { - fs.chmodSync(file, '0666'); - fs.unlinkSync(file); - } else { - throw e; - } - } -} - -// Hack to determine if file has write permissions for current user -// Avoids having to check user, group, etc, but it's probably slow -function isWriteable(file) { - var writePermission = true; - try { - var __fd = fs.openSync(file, 'a'); - fs.closeSync(__fd); - } catch(e) { - writePermission = false; - } - - return writePermission; -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/.npmignore deleted file mode 100644 index a1632ab..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -tmp/ - diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cat.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cat.js deleted file mode 100644 index d0d9ddb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cat.js +++ /dev/null @@ -1,57 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// save current dir -var cur = shell.pwd(); - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.cat(); -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.cat('/adsfasdf'); // file does not exist -assert.ok(shell.error()); - -// -// Valids -// - -// simple -var result = shell.cat('resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, 'test1'); - -// multiple files -var result = shell.cat('resources/file2', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, 'test2\ntest1'); - -// multiple files, array syntax -var result = shell.cat(['resources/file2', 'resources/file1']); -assert.equal(shell.error(), null); -assert.equal(result, 'test2\ntest1'); - -var result = shell.cat('resources/file*.txt'); -assert.equal(shell.error(), null); -assert.ok(result.search('test1') > -1); // file order might be random -assert.ok(result.search('test2') > -1); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cd.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cd.js deleted file mode 100644 index e6f6c38..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cd.js +++ /dev/null @@ -1,64 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// save current dir -var cur = shell.pwd(); - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.cd(); -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.cd('/adsfasdf'); // dir does not exist -assert.ok(shell.error()); - -assert.equal(fs.existsSync('resources/file1'), true); // sanity check -shell.cd('resources/file1'); // file, not dir -assert.ok(shell.error()); - -// -// Valids -// - -shell.cd(cur); -shell.cd('tmp'); -assert.equal(shell.error(), null); -assert.equal(path.basename(process.cwd()), 'tmp'); - -shell.cd(cur); -shell.cd('/'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), path.resolve('/')); - -// cd + other commands - -shell.cd(cur); -shell.rm('-f', 'tmp/*'); -assert.equal(fs.existsSync('tmp/file1'), false); -shell.cd('resources'); -assert.equal(shell.error(), null); -shell.cp('file1', '../tmp'); -assert.equal(shell.error(), null); -shell.cd('../tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), true); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/chmod.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/chmod.js deleted file mode 100644 index b31e25e..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/chmod.js +++ /dev/null @@ -1,81 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -shell.config.silent = true; - -// -// Invalids -// - -shell.chmod('blah'); // missing args -assert.ok(shell.error()); -shell.chmod('893', 'resources/chmod'); // invalid permissions - mode must be in octal -assert.ok(shell.error()); - -// -// Valids -// - -// Test files - the bitmasking is to ignore the upper bits. -shell.chmod('755', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('755', 8)); -shell.chmod('644', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); - -shell.chmod('o+x', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('007', 8), parseInt('005', 8)); -shell.chmod('644', 'resources/chmod/file1'); - -shell.chmod('+x', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('755', 8)); -shell.chmod('644', 'resources/chmod/file1'); - -// Test setuid -shell.chmod('u+s', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('4000', 8), parseInt('4000', 8)); -shell.chmod('u-s', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); - -// according to POSIX standards at http://linux.die.net/man/1/chmod, -// setuid is never cleared from a directory unless explicitly asked for. -shell.chmod('u+s', 'resources/chmod/c'); -shell.chmod('755', 'resources/chmod/c'); -assert.equal(fs.statSync('resources/chmod/c').mode & parseInt('4000', 8), parseInt('4000', 8)); -shell.chmod('u-s', 'resources/chmod/c'); - -// Test setgid -shell.chmod('g+s', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('2000', 8), parseInt('2000', 8)); -shell.chmod('g-s', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); - -// Test sticky bit -shell.chmod('+t', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('1000', 8), parseInt('1000', 8)); -shell.chmod('-t', 'resources/chmod/file1'); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('777', 8), parseInt('644', 8)); -assert.equal(fs.statSync('resources/chmod/file1').mode & parseInt('1000', 8), 0); - -// Test directories -shell.chmod('a-w', 'resources/chmod/b/a/b'); -assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('555', 8)); -shell.chmod('755', 'resources/chmod/b/a/b'); - -// Test recursion -shell.chmod('-R', 'a+w', 'resources/chmod/b'); -assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('777', 8)); -shell.chmod('-R', '755', 'resources/chmod/b'); -assert.equal(fs.statSync('resources/chmod/b/a/b').mode & parseInt('777', 8), parseInt('755', 8)); - -// Test symbolic links w/ recursion - WARNING: *nix only -fs.symlinkSync('resources/chmod/b/a', 'resources/chmod/a/b/c/link', 'dir'); -shell.chmod('-R', 'u-w', 'resources/chmod/a/b'); -assert.equal(fs.statSync('resources/chmod/a/b/c').mode & parseInt('700', 8), parseInt('500', 8)); -assert.equal(fs.statSync('resources/chmod/b/a').mode & parseInt('700', 8), parseInt('700', 8)); -shell.chmod('-R', 'u+w', 'resources/chmod/a/b'); -fs.unlinkSync('resources/chmod/a/b/c/link'); - -shell.exit(123); \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/config.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/config.js deleted file mode 100644 index bd81ec0..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/config.js +++ /dev/null @@ -1,50 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - child = require('child_process'); - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// -// config.silent -// - -assert.equal(shell.config.silent, false); // default - -shell.config.silent = true; -assert.equal(shell.config.silent, true); - -shell.config.silent = false; -assert.equal(shell.config.silent, false); - -// -// config.fatal -// - -assert.equal(shell.config.fatal, false); // default - -// -// config.fatal = false -// -shell.mkdir('-p', 'tmp'); -var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); config.silent=true; config.fatal=false; cp("this_file_doesnt_exist", "."); echo("got here");'; -script.to(file); -child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout.match('got here')); - - // - // config.fatal = true - // - shell.mkdir('-p', 'tmp'); - var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); config.silent=true; config.fatal=true; cp("this_file_doesnt_exist", "."); echo("got here");'; - script.to(file); - child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(!stdout.match('got here')); - - shell.exit(123); - }); -}); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cp.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cp.js deleted file mode 100644 index 39b3ba9..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/cp.js +++ /dev/null @@ -1,143 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.cp(); -assert.ok(shell.error()); - -shell.cp('file1'); -assert.ok(shell.error()); - -shell.cp('-f'); -assert.ok(shell.error()); - -shell.rm('-rf', 'tmp/*'); -shell.cp('-@', 'resources/file1', 'tmp/file1'); // option not supported, files OK -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file1'), false); - -shell.cp('-Z', 'asdfasdf', 'tmp/file2'); // option not supported, files NOT OK -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file2'), false); - -shell.cp('asdfasdf', 'tmp'); // source does not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 1); -assert.equal(fs.existsSync('tmp/asdfasdf'), false); - -shell.cp('asdfasdf1', 'asdfasdf2', 'tmp'); // sources do not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 2); -assert.equal(fs.existsSync('tmp/asdfasdf1'), false); -assert.equal(fs.existsSync('tmp/asdfasdf2'), false); - -shell.cp('asdfasdf1', 'asdfasdf2', 'resources/file1'); // too many sources (dest is file) -assert.ok(shell.error()); - -shell.cp('resources/file1', 'resources/file2'); // dest already exists -assert.ok(shell.error()); - -shell.cp('resources/file1', 'resources/file2', 'tmp/a_file'); // too many sources -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/a_file'), false); - -// -// Valids -// - -// simple - to dir -shell.cp('resources/file1', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); - -// simple - to file -shell.cp('resources/file2', 'tmp/file2'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file2'), true); - -// simple - file list -shell.rm('-rf', 'tmp/*'); -shell.cp('resources/file1', 'resources/file2', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); - -// simple - file list, array syntax -shell.rm('-rf', 'tmp/*'); -shell.cp(['resources/file1', 'resources/file2'], 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); - -shell.cp('resources/file2', 'tmp/file3'); -assert.equal(fs.existsSync('tmp/file3'), true); -shell.cp('-f', 'resources/file2', 'tmp/file3'); // file exists, but -f specified -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file3'), true); - -// wildcard -shell.rm('tmp/file1', 'tmp/file2'); -shell.cp('resources/file*', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); - -//recursive, nothing exists -shell.rm('-rf', 'tmp/*'); -shell.cp('-R', 'resources/cp', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(shell.ls('-R', 'resources/cp') + '', shell.ls('-R', 'tmp/cp') + ''); - -//recursive, nothing exists, source ends in '/' (see Github issue #15) -shell.rm('-rf', 'tmp/*'); -shell.cp('-R', 'resources/cp/', 'tmp/'); -assert.equal(shell.error(), null); -assert.equal(shell.ls('-R', 'resources/cp') + '', shell.ls('-R', 'tmp') + ''); - -//recursive, everything exists, no force flag -shell.rm('-rf', 'tmp/*'); -shell.cp('-R', 'resources/cp', 'tmp'); -shell.cp('-R', 'resources/cp', 'tmp'); -assert.equal(shell.error(), null); // crash test only - -//recursive, everything exists, with force flag -shell.rm('-rf', 'tmp/*'); -shell.cp('-R', 'resources/cp', 'tmp'); -'changing things around'.to('tmp/cp/dir_a/z'); -assert.notEqual(shell.cat('resources/cp/dir_a/z'), shell.cat('tmp/cp/dir_a/z')); // before cp -shell.cp('-Rf', 'resources/cp', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(shell.cat('resources/cp/dir_a/z'), shell.cat('tmp/cp/dir_a/z')); // after cp - -//recursive, creates dest dir since it's only one level deep (see Github issue #44) -shell.rm('-rf', 'tmp/*'); -shell.cp('-r', 'resources/issue44/*', 'tmp/dir2'); -assert.equal(shell.error(), null); -assert.equal(shell.ls('-R', 'resources/issue44') + '', shell.ls('-R', 'tmp/dir2') + ''); -assert.equal(shell.cat('resources/issue44/main.js'), shell.cat('tmp/dir2/main.js')); - -//recursive, does *not* create dest dir since it's too deep (see Github issue #44) -shell.rm('-rf', 'tmp/*'); -shell.cp('-r', 'resources/issue44/*', 'tmp/dir2/dir3'); -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/dir2'), false); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/dirs.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/dirs.js deleted file mode 100644 index e9f11e6..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/dirs.js +++ /dev/null @@ -1,37 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -var root = path.resolve(); - -shell.pushd('resources/pushd'); -shell.pushd('a'); - -var trail = [ - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]; - -assert.deepEqual(shell.dirs(), trail); - -// Single items -assert.equal(shell.dirs('+0'), trail[0]); -assert.equal(shell.dirs('+1'), trail[1]); -assert.equal(shell.dirs('+2'), trail[2]); -assert.equal(shell.dirs('-0'), trail[2]); -assert.equal(shell.dirs('-1'), trail[1]); -assert.equal(shell.dirs('-2'), trail[0]); - -// Clearing items -assert.deepEqual(shell.dirs('-c'), []); -assert(!shell.error()); - -shell.exit(123); \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/echo.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/echo.js deleted file mode 100644 index 82faa51..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/echo.js +++ /dev/null @@ -1,50 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'), - child = require('child_process'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - - -// From here on we use child.exec() to intercept the stdout - - -// simple test with defaults -shell.mkdir('-p', 'tmp'); -var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); echo("-asdf", "111");'; // test '-' bug (see issue #20) -script.to(file); -child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout === '-asdf 111\n' || stdout === '-asdf 111\nundefined\n'); // 'undefined' for v0.4 - - // simple test with silent(true) - shell.mkdir('-p', 'tmp'); - var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../global.js\'); config.silent=true; echo(555);'; - script.to(file); - child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout === '555\n' || stdout === '555\nundefined\n'); // 'undefined' for v0.4 - - theEnd(); - }); -}); - -function theEnd() { - shell.exit(123); -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/env.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/env.js deleted file mode 100644 index 0e041d6..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/env.js +++ /dev/null @@ -1,19 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'); - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -assert.equal(shell.env['PATH'], process.env['PATH']); - -shell.env['SHELLJS_TEST'] = 'hello world'; -assert.equal(shell.env['SHELLJS_TEST'], process.env['SHELLJS_TEST']); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/exec.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/exec.js deleted file mode 100644 index e721808..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/exec.js +++ /dev/null @@ -1,109 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'), - util = require('util'), - child = require('child_process'); - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -// -// Invalids -// - -shell.exec(); -assert.ok(shell.error()); - -var result = shell.exec('asdfasdf'); // could not find command -assert.ok(result.code > 0); - - -// -// Valids -// - -// -// sync -// - -// check if stdout goes to output -var result = shell.exec('node -e \"console.log(1234);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n' || result.output === '1234\nundefined\n'); // 'undefined' for v0.4 - -// check if stderr goes to output -var result = shell.exec('node -e \"console.error(1234);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n' || result.output === '1234\nundefined\n'); // 'undefined' for v0.4 - -// check if stdout + stderr go to output -var result = shell.exec('node -e \"console.error(1234); console.log(666);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.ok(result.output === '1234\n666\n' || result.output === '1234\n666\nundefined\n'); // 'undefined' for v0.4 - -// check exit code -var result = shell.exec('node -e \"process.exit(12);\"'); -assert.equal(shell.error(), null); -assert.equal(result.code, 12); - -// interaction with cd -shell.cd('resources/external'); -var result = shell.exec('node node_script.js'); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.equal(result.output, 'node_script_1234\n'); -shell.cd('../..'); - -// check quotes escaping -var result = shell.exec( util.format('node -e "console.log(%s);"', "\\\"\\'+\\'_\\'+\\'\\\"") ); -assert.equal(shell.error(), null); -assert.equal(result.code, 0); -assert.equal(result.output, "'+'_'+'\n"); - -// -// async -// - -// no callback -var c = shell.exec('node -e \"console.log(1234)\"', {async:true}); -assert.equal(shell.error(), null); -assert.ok('stdout' in c, 'async exec returns child process object'); - -// -// callback as 2nd argument -// -shell.exec('node -e \"console.log(5678);\"', function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5678\n' || output === '5678\nundefined\n'); // 'undefined' for v0.4 - - // - // callback as 3rd argument - // - shell.exec('node -e \"console.log(5566);\"', {async:true}, function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5566\n' || output === '5566\nundefined\n'); // 'undefined' for v0.4 - - // - // callback as 3rd argument (slient:true) - // - shell.exec('node -e \"console.log(5678);\"', {silent:true}, function(code, output) { - assert.equal(code, 0); - assert.ok(output === '5678\n' || output === '5678\nundefined\n'); // 'undefined' for v0.4 - - shell.exit(123); - - }); - - }); - -}); - -assert.equal(shell.error(), null); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/find.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/find.js deleted file mode 100644 index d375f86..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/find.js +++ /dev/null @@ -1,56 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -var result = shell.find(); // no paths given -assert.ok(shell.error()); - -// -// Valids -// - -// current path -shell.cd('resources/find'); -var result = shell.find('.'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('.hidden') > -1, true); -assert.equal(result.indexOf('dir1/dir11/a_dir11') > -1, true); -assert.equal(result.length, 11); -shell.cd('../..'); - -// simple path -var result = shell.find('resources/find'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/.hidden') > -1, true); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.length, 11); - -// multiple paths - comma -var result = shell.find('resources/find/dir1', 'resources/find/dir2'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.indexOf('resources/find/dir2/a_dir1') > -1, true); -assert.equal(result.length, 6); - -// multiple paths - array -var result = shell.find(['resources/find/dir1', 'resources/find/dir2']); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/find/dir1/dir11/a_dir11') > -1, true); -assert.equal(result.indexOf('resources/find/dir2/a_dir1') > -1, true); -assert.equal(result.length, 6); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/grep.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/grep.js deleted file mode 100644 index 71db982..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/grep.js +++ /dev/null @@ -1,59 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.grep(); -assert.ok(shell.error()); - -shell.grep(/asdf/g); // too few args -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.grep(/asdf/g, '/asdfasdf'); // no such file -assert.ok(shell.error()); - -// -// Valids -// - -var result = shell.grep('line', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result.split('\n').length - 1, 4); - -var result = shell.grep('-v', 'line', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result.split('\n').length - 1, 8); - -var result = shell.grep('line one', 'resources/a.txt'); -assert.equal(shell.error(), null); -assert.equal(result, 'This is line one\n'); - -// multiple files -var result = shell.grep(/test/, 'resources/file1.txt', 'resources/file2.txt'); -assert.equal(shell.error(), null); -assert.equal(result, 'test1\ntest2\n'); - -// multiple files, array syntax -var result = shell.grep(/test/, ['resources/file1.txt', 'resources/file2.txt']); -assert.equal(shell.error(), null); -assert.equal(result, 'test1\ntest2\n'); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/ls.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/ls.js deleted file mode 100644 index 5067b7d..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/ls.js +++ /dev/null @@ -1,202 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -var result = shell.ls('/asdfasdf'); // no such file or dir -assert.ok(shell.error()); -assert.equal(result.length, 0); - -// -// Valids -// - -var result = shell.ls(); -assert.equal(shell.error(), null); - -var result = shell.ls('/'); -assert.equal(shell.error(), null); - -// no args -shell.cd('resources/ls'); -var result = shell.ls(); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.length, 6); -shell.cd('../..'); - -// simple arg -var result = shell.ls('resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.length, 6); - -// no args, 'all' option -shell.cd('resources/ls'); -var result = shell.ls('-A'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('.hidden_file') > -1, true); -assert.equal(result.indexOf('.hidden_dir') > -1, true); -assert.equal(result.length, 8); -shell.cd('../..'); - -// no args, 'all' option -shell.cd('resources/ls'); -var result = shell.ls('-a'); // (deprecated) backwards compatibility test -assert.equal(shell.error(), null); -assert.equal(result.indexOf('file1') > -1, true); -assert.equal(result.indexOf('file2') > -1, true); -assert.equal(result.indexOf('file1.js') > -1, true); -assert.equal(result.indexOf('file2.js') > -1, true); -assert.equal(result.indexOf('filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('.hidden_file') > -1, true); -assert.equal(result.indexOf('.hidden_dir') > -1, true); -assert.equal(result.length, 8); -shell.cd('../..'); - -// wildcard, simple -var result = shell.ls('resources/ls/*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/file1') > -1, true); -assert.equal(result.indexOf('resources/ls/file2') > -1, true); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir') > -1, true); -assert.equal(result.length, 6); - -// wildcard, hidden only -var result = shell.ls('resources/ls/.*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/.hidden_file') > -1, true); -assert.equal(result.indexOf('resources/ls/.hidden_dir') > -1, true); -assert.equal(result.length, 2); - -// wildcard, mid-file -var result = shell.ls('resources/ls/f*le*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 5); -assert.equal(result.indexOf('resources/ls/file1') > -1, true); -assert.equal(result.indexOf('resources/ls/file2') > -1, true); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); - -// wildcard, mid-file with dot (should escape dot for regex) -var result = shell.ls('resources/ls/f*le*.js'); -assert.equal(shell.error(), null); -assert.equal(result.length, 2); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); - -// wildcard, should not do partial matches -var result = shell.ls('resources/ls/*.j'); // shouldn't get .js -assert.equal(shell.error(), null); -assert.equal(result.length, 0); - -// wildcard, all files with extension -var result = shell.ls('resources/ls/*.*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 3); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/filename(with)[chars$]^that.must+be-escaped') > -1, true); - -// wildcard, with additional path -var result = shell.ls('resources/ls/f*le*.js', 'resources/ls/a_dir'); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('b_dir') > -1, true); // no wildcard == no path prefix -assert.equal(result.indexOf('nada') > -1, true); // no wildcard == no path prefix - -// wildcard for both paths -var result = shell.ls('resources/ls/f*le*.js', 'resources/ls/a_dir/*'); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/nada') > -1, true); - -// wildcard for both paths, array -var result = shell.ls(['resources/ls/f*le*.js', 'resources/ls/a_dir/*']); -assert.equal(shell.error(), null); -assert.equal(result.length, 4); -assert.equal(result.indexOf('resources/ls/file1.js') > -1, true); -assert.equal(result.indexOf('resources/ls/file2.js') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/nada') > -1, true); - -// recursive, no path -shell.cd('resources/ls'); -var result = shell.ls('-R'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); -shell.cd('../..'); - -// recusive, path given -var result = shell.ls('-R', 'resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); - -// recusive, path given - 'all' flag -var result = shell.ls('-RA', 'resources/ls'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('a_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); -assert.equal(result.indexOf('a_dir/.hidden_dir/nada') > -1, true); -assert.equal(result.length, 14); - -// recursive, wildcard -var result = shell.ls('-R', 'resources/ls/*'); -assert.equal(shell.error(), null); -assert.equal(result.indexOf('resources/ls/a_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir') > -1, true); -assert.equal(result.indexOf('resources/ls/a_dir/b_dir/z') > -1, true); -assert.equal(result.length, 9); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/make.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/make.js deleted file mode 100644 index 3edbd8c..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/make.js +++ /dev/null @@ -1,20 +0,0 @@ -var shell = require('..'), - child = require('child_process'), - assert = require('assert'); - -shell.mkdir('-p', 'tmp'); -var file = 'tmp/tempscript'+Math.random()+'.js', - script = 'require(\'../../make.js\');' + - 'target.all=function(){' + - ' echo("first"); '+ - ' cp("this_file_doesnt_exist", ".");' + - ' echo("second");' + - '}'; - -script.to(file); -child.exec('node '+file, function(err, stdout, stderr) { - assert.ok(stdout.match('first')); - assert.ok(!stdout.match('second')); // Make should die on errors, so this should never get echoed - - shell.exit(123); -}); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/mkdir.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/mkdir.js deleted file mode 100644 index 1f93422..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/mkdir.js +++ /dev/null @@ -1,79 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.mkdir(); -assert.ok(shell.error()); - -var mtime = fs.statSync('tmp').mtime.toString(); -shell.mkdir('tmp'); // dir already exists -assert.ok(shell.error()); -assert.equal(fs.statSync('tmp').mtime.toString(), mtime); // didn't mess with dir - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.mkdir('/asdfasdf/asdfasdf'); // root path does not exist -assert.ok(shell.error()); -assert.equal(fs.existsSync('/asdfasdf'), false); - -// -// Valids -// - -assert.equal(fs.existsSync('tmp/t1'), false); -shell.mkdir('tmp/t1'); // simple dir -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/t1'), true); - -assert.equal(fs.existsSync('tmp/t2'), false); -assert.equal(fs.existsSync('tmp/t3'), false); -shell.mkdir('tmp/t2', 'tmp/t3'); // multiple dirs -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/t2'), true); -assert.equal(fs.existsSync('tmp/t3'), true); - -assert.equal(fs.existsSync('tmp/t1'), true); -assert.equal(fs.existsSync('tmp/t4'), false); -shell.mkdir('tmp/t1', 'tmp/t4'); // one dir exists, one doesn't -assert.equal(numLines(shell.error()), 1); -assert.equal(fs.existsSync('tmp/t1'), true); -assert.equal(fs.existsSync('tmp/t4'), true); - -assert.equal(fs.existsSync('tmp/a'), false); -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', 'tmp/a'); // revert - -// multiple dirs -shell.mkdir('-p', 'tmp/zzza', 'tmp/zzzb', 'tmp/zzzc'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/zzza'), true); -assert.equal(fs.existsSync('tmp/zzzb'), true); -assert.equal(fs.existsSync('tmp/zzzc'), true); - -// multiple dirs, array syntax -shell.mkdir('-p', ['tmp/yyya', 'tmp/yyyb', 'tmp/yyyc']); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/yyya'), true); -assert.equal(fs.existsSync('tmp/yyyb'), true); -assert.equal(fs.existsSync('tmp/yyyc'), true); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/mv.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/mv.js deleted file mode 100644 index 89bca91..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/mv.js +++ /dev/null @@ -1,130 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// Prepare tmp/ -shell.cp('resources/*', 'tmp'); - -// -// Invalids -// - -shell.mv(); -assert.ok(shell.error()); - -shell.mv('file1'); -assert.ok(shell.error()); - -shell.mv('-f'); -assert.ok(shell.error()); - -shell.mv('-Z', 'tmp/file1', 'tmp/file1'); // option not supported -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file1'), true); - -shell.mv('asdfasdf', 'tmp'); // source does not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 1); -assert.equal(fs.existsSync('tmp/asdfasdf'), false); - -shell.mv('asdfasdf1', 'asdfasdf2', 'tmp'); // sources do not exist -assert.ok(shell.error()); -assert.equal(numLines(shell.error()), 2); -assert.equal(fs.existsSync('tmp/asdfasdf1'), false); -assert.equal(fs.existsSync('tmp/asdfasdf2'), false); - -shell.mv('asdfasdf1', 'asdfasdf2', 'tmp/file1'); // too many sources (dest is file) -assert.ok(shell.error()); - -shell.mv('tmp/file1', 'tmp/file2'); // dest already exists -assert.ok(shell.error()); - -shell.mv('tmp/file1', 'tmp/file2', 'tmp/a_file'); // too many sources (exist, but dest is file) -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/a_file'), false); - -shell.mv('tmp/file*', 'tmp/file1'); // can't use wildcard when dest is file -assert.ok(shell.error()); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); -assert.equal(fs.existsSync('tmp/file1.js'), true); -assert.equal(fs.existsSync('tmp/file2.js'), true); - -// -// Valids -// - -shell.cd('tmp'); - -// handles self OK -shell.mkdir('tmp2'); -shell.mv('*', 'tmp2'); // has to handle self (tmp2 --> tmp2) without throwing error -assert.ok(shell.error()); // there's an error, but not fatal -assert.equal(fs.existsSync('tmp2/file1'), true); // moved OK -shell.mv('tmp2/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); // moved OK - -shell.mv('file1', 'file3'); // one source -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file3'), true); -shell.mv('file3', 'file1'); // revert -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), true); - -// two sources -shell.rm('-rf', 't'); -shell.mkdir('-p', 't'); -shell.mv('file1', 'file2', 't'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), false); -assert.equal(fs.existsSync('t/file1'), true); -assert.equal(fs.existsSync('t/file2'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); -assert.equal(fs.existsSync('file2'), true); - -// two sources, array style -shell.rm('-rf', 't'); -shell.mkdir('-p', 't'); -shell.mv(['file1', 'file2'], 't'); // two sources -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), false); -assert.equal(fs.existsSync('t/file1'), true); -assert.equal(fs.existsSync('t/file2'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1'), true); -assert.equal(fs.existsSync('file2'), true); - -shell.mv('file*.js', 't'); // wildcard -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1.js'), false); -assert.equal(fs.existsSync('file2.js'), false); -assert.equal(fs.existsSync('t/file1.js'), true); -assert.equal(fs.existsSync('t/file2.js'), true); -shell.mv('t/*', '.'); // revert -assert.equal(fs.existsSync('file1.js'), true); -assert.equal(fs.existsSync('file2.js'), true); - -shell.mv('-f', 'file1', 'file2'); // dest exists, but -f given -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('file1'), false); -assert.equal(fs.existsSync('file2'), true); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/popd.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/popd.js deleted file mode 100644 index fd79533..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/popd.js +++ /dev/null @@ -1,118 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -var root = path.resolve(), trail; - -function reset() { - shell.dirs('-c'); - shell.cd(root); -} - -// Valid -shell.pushd('resources/pushd'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -shell.pushd('resources/pushd'); -shell.pushd('a'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -shell.pushd('b'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -shell.pushd('b'); -shell.pushd('c'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 1); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -// Valid by index -shell.pushd('resources/pushd'); -trail = shell.popd('+0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - -shell.pushd('resources/pushd'); -trail = shell.popd('+1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ root ]); - - -reset(); shell.pushd('resources/pushd'); -trail = shell.popd('-n'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ path.resolve(root, 'resources/pushd') ]); - -// Invalid -trail = shell.popd(); -assert.ok(shell.error('popd: directory stack empty\n')); - -// Test that the root dir is not stored -shell.cd('resources/pushd'); -shell.pushd('b'); -trail = shell.popd(); -assert.equal(shell.error(), null); -assert.equal(trail[0], path.resolve(root, 'resources/pushd')); -assert.equal(process.cwd(), trail[0]); -shell.popd(); -assert.ok(shell.error(), null); - -shell.cd(root); - -shell.exit(123); \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/pushd.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/pushd.js deleted file mode 100644 index 32089dc..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/pushd.js +++ /dev/null @@ -1,228 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -var root = path.resolve(), trail; - -function reset() { - shell.dirs('-c'); - shell.cd(root); -} - -// Push valid directories -trail = shell.pushd('resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('a'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('../b'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('c'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push stuff around with positive indices -trail = shell.pushd('+0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('+1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c') -]); - -trail = shell.pushd('+2'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a') -]); - -trail = shell.pushd('+3'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c') -]); - -trail = shell.pushd('+4'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push stuff around with negative indices -trail = shell.pushd('-0'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd') -]); - -trail = shell.pushd('-1'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b') -]); - -trail = shell.pushd('-2'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd') -]); - -trail = shell.pushd('-3'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -trail = shell.pushd('-4'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - path.resolve(root, 'resources/pushd/b/c'), - path.resolve(root, 'resources/pushd/b'), - path.resolve(root, 'resources/pushd/a'), - path.resolve(root, 'resources/pushd'), - root -]); - -// Push without changing directory or resolving paths -reset(); trail = shell.pushd('-n', 'resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - 'resources/pushd' -]); - -trail = shell.pushd('-n', 'resources/pushd/a'); -assert.equal(shell.error(), null); -assert.equal(process.cwd(), trail[0]); -assert.deepEqual(trail, [ - root, - 'resources/pushd/a', - 'resources/pushd' -]); - -// Push invalid directory -shell.pushd('does/not/exist'); -assert.equal(shell.error(), 'pushd: no such file or directory: ' + path.resolve('.', 'does/not/exist') + '\n'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments should swap top two directories when stack length is 2 -reset(); trail = shell.pushd('resources/pushd'); -assert.equal(shell.error(), null); -assert.equal(trail.length, 2); -assert.equal(path.relative(root, trail[0]), 'resources/pushd'); -assert.equal(trail[1], root); -assert.equal(process.cwd(), trail[0]); -trail = shell.pushd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 2); -assert.equal(trail[0], root); -assert.equal(path.relative(root, trail[1]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments should swap top two directories when stack length is > 2 -trail = shell.pushd('resources/pushd/a'); -assert.equal(shell.error(), null); -assert.equal(trail.length, 3); -assert.equal(path.relative(root, trail[0]), 'resources/pushd/a'); -assert.equal(trail[1], root); -assert.equal(path.relative(root, trail[2]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -trail = shell.pushd(); -assert.equal(shell.error(), null); -assert.equal(trail.length, 3); -assert.equal(trail[0], root); -assert.equal(path.relative(root, trail[1]), 'resources/pushd/a'); -assert.equal(path.relative(root, trail[2]), 'resources/pushd'); -assert.equal(process.cwd(), trail[0]); - -// Push without arguments invalid when stack is empty -reset(); shell.pushd(); -assert.equal(shell.error(), 'pushd: no other directory\n'); - -shell.exit(123); \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/pwd.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/pwd.js deleted file mode 100644 index d1f563f..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/pwd.js +++ /dev/null @@ -1,28 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'); - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -var _pwd = shell.pwd(); -assert.equal(shell.error(), null); -assert.equal(_pwd, path.resolve('.')); - -shell.cd('tmp'); -var _pwd = shell.pwd(); -assert.equal(shell.error(), null); -assert.equal(path.basename(_pwd), 'tmp'); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/a.txt b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/a.txt deleted file mode 100644 index 356ce49..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/a.txt +++ /dev/null @@ -1,11 +0,0 @@ -This is line one -This is line two - -This is line four -. -. -More content here -. -. - -This is line eleven diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/a/b/c/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/b/a/b/.npmignore deleted file mode 100755 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/c/a/b/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/file1 b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/file1 deleted file mode 100644 index db3f9ca..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/chmod/file1 +++ /dev/null @@ -1,2 +0,0 @@ -this is test file 1 -default state should be 0644 (rw-r--r--) diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/a b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/a deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/a +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/b b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/b deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/b +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_a/z b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_a/z deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_a/z +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/cp/dir_b/dir_b_a/dir_b_a_a/z +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/external/node_script.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/external/node_script.js deleted file mode 100755 index 3b2d24a..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/external/node_script.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('node_script_1234'); - diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1 b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1 deleted file mode 100644 index f079749..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1 +++ /dev/null @@ -1 +0,0 @@ -test1 \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1.js deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1.js +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1.txt b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1.txt deleted file mode 100644 index a5bce3f..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file1.txt +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2 b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2 deleted file mode 100644 index d606037..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2 +++ /dev/null @@ -1 +0,0 @@ -test2 \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2.js deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2.js +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2.txt b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2.txt deleted file mode 100644 index 180cf83..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/file2.txt +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/.hidden b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/.hidden deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/.hidden +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/a b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/a deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/a +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/b b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/b deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/b +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/a_dir1 b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/a_dir1 deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/a_dir1 +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir1/dir11/a_dir11 +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir2/a_dir1 b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir2/a_dir1 deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/find/dir2/a_dir1 +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/issue44/main.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/issue44/main.js deleted file mode 100644 index d800886..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/issue44/main.js +++ /dev/null @@ -1 +0,0 @@ -123 \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_dir/nada b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_dir/nada deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_dir/nada +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_file b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_file deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/.hidden_file +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada deleted file mode 100644 index 5fedf57..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/.hidden_dir/nada +++ /dev/null @@ -1 +0,0 @@ -nada \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/b_dir/z +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/nada b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/nada deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/a_dir/nada +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1 b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1 deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1 +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1.js deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file1.js +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2 b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2 deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2 +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2.js deleted file mode 100644 index 9daeafb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/file2.js +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped deleted file mode 100644 index 8bd6648..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/ls/filename(with)[chars$]^that.must+be-escaped +++ /dev/null @@ -1 +0,0 @@ -asdf diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/pushd/a/dummy b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/pushd/a/dummy deleted file mode 100644 index 72e12a9..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/pushd/a/dummy +++ /dev/null @@ -1 +0,0 @@ -meh \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/pushd/b/c/dummy b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/pushd/b/c/dummy deleted file mode 100644 index 72e12a9..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/resources/pushd/b/c/dummy +++ /dev/null @@ -1 +0,0 @@ -meh \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/rm.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/rm.js deleted file mode 100644 index 61182a1..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/rm.js +++ /dev/null @@ -1,183 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.rm(); -assert.ok(shell.error()); - -shell.rm('asdfasdf'); // file does not exist -assert.ok(shell.error()); - -shell.rm('-f'); // no file -assert.ok(shell.error()); - -shell.rm('-@', 'resources/file1'); // invalid option -assert.ok(shell.error()); -assert.equal(fs.existsSync('resources/file1'), true); - -// -// Valids -// - -// file does not exist, but -f specified -shell.rm('-f', 'asdfasdf'); -assert.equal(shell.error(), null); - -// simple rm -shell.cp('-f', 'resources/file1', 'tmp/file1'); -assert.equal(fs.existsSync('tmp/file1'), true); -shell.rm('tmp/file1'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), false); - -// recursive dir removal - small-caps '-r' -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-rf', 'tmp/a'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// recursive dir removal - capital '-R' -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', 'tmp/a'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// recursive dir removal - absolute path -shell.mkdir('-p', 'tmp/a/b/c'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -shell.rm('-Rf', path.resolve('./tmp/a')); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/a'), false); - -// wildcard -shell.cp('-f', 'resources/file*', 'tmp'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), true); -assert.equal(fs.existsSync('tmp/file2'), true); -assert.equal(fs.existsSync('tmp/file1.js'), true); -assert.equal(fs.existsSync('tmp/file2.js'), true); -shell.rm('tmp/file*'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync('tmp/file1'), false); -assert.equal(fs.existsSync('tmp/file2'), false); -assert.equal(fs.existsSync('tmp/file1.js'), false); -assert.equal(fs.existsSync('tmp/file2.js'), false); - -// recursive dir removal -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', 'tmp/*'); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 1); -assert.equal(contents[0], '.hidden'); // shouldn't remove hiddden if no .* given - -// recursive dir removal -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', 'tmp/*', 'tmp/.*'); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 0); - -// recursive dir removal - array-syntax -shell.mkdir('-p', 'tmp/a/b/c'); -shell.mkdir('-p', 'tmp/b'); -shell.mkdir('-p', 'tmp/c'); -shell.mkdir('-p', 'tmp/.hidden'); -assert.equal(fs.existsSync('tmp/a/b/c'), true); -assert.equal(fs.existsSync('tmp/b'), true); -assert.equal(fs.existsSync('tmp/c'), true); -assert.equal(fs.existsSync('tmp/.hidden'), true); -shell.rm('-rf', ['tmp/*', 'tmp/.*']); -assert.equal(shell.error(), null); -var contents = fs.readdirSync('tmp'); -assert.equal(contents.length, 0); - -// removal of a read-only file (unforced) -shell.mkdir('-p', 'tmp/readonly'); -'asdf'.to('tmp/readonly/file1'); -fs.chmodSync('tmp/readonly/file1', '0444'); // -r--r--r-- -shell.rm('tmp/readonly/file1'); -assert.equal(fs.existsSync('tmp/readonly/file1'), true); // bash's rm always asks before removing read-only files - // here we just assume "no" - -// removal of a read-only file (forced) -shell.mkdir('-p', 'tmp/readonly'); -'asdf'.to('tmp/readonly/file2'); -fs.chmodSync('tmp/readonly/file2', '0444'); // -r--r--r-- -shell.rm('-f', 'tmp/readonly/file2'); -assert.equal(fs.existsSync('tmp/readonly/file2'), false); - -// removal of a tree containing read-only files (unforced) -shell.mkdir('-p', 'tmp/tree2'); -'asdf'.to('tmp/tree2/file1'); -'asdf'.to('tmp/tree2/file2'); -fs.chmodSync('tmp/tree2/file1', '0444'); // -r--r--r-- -shell.rm('-r', 'tmp/tree2'); -assert.equal(fs.existsSync('tmp/tree2/file1'), true); -assert.equal(fs.existsSync('tmp/tree2/file2'), false); - -// removal of a tree containing read-only files (forced) -shell.mkdir('-p', 'tmp/tree'); -'asdf'.to('tmp/tree/file1'); -'asdf'.to('tmp/tree/file2'); -fs.chmodSync('tmp/tree/file1', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree'); -assert.equal(fs.existsSync('tmp/tree'), false); - -// removal of a sub-tree containing read-only and hidden files - rm('dir/*') -shell.mkdir('-p', 'tmp/tree3'); -shell.mkdir('-p', 'tmp/tree3/subtree'); -shell.mkdir('-p', 'tmp/tree3/.hidden'); -'asdf'.to('tmp/tree3/subtree/file'); -'asdf'.to('tmp/tree3/.hidden/file'); -'asdf'.to('tmp/tree3/file'); -fs.chmodSync('tmp/tree3/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree3/subtree/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree3/.hidden/file', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree3/*', 'tmp/tree3/.*'); // erase dir contents -assert.equal(shell.ls('tmp/tree3').length, 0); - -// removal of a sub-tree containing read-only and hidden files - rm('dir') -shell.mkdir('-p', 'tmp/tree4'); -shell.mkdir('-p', 'tmp/tree4/subtree'); -shell.mkdir('-p', 'tmp/tree4/.hidden'); -'asdf'.to('tmp/tree4/subtree/file'); -'asdf'.to('tmp/tree4/.hidden/file'); -'asdf'.to('tmp/tree4/file'); -fs.chmodSync('tmp/tree4/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree4/subtree/file', '0444'); // -r--r--r-- -fs.chmodSync('tmp/tree4/.hidden/file', '0444'); // -r--r--r-- -shell.rm('-rf', 'tmp/tree4'); // erase dir contents -assert.equal(fs.existsSync('tmp/tree4'), false); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/sed.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/sed.js deleted file mode 100644 index d3d66b1..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/sed.js +++ /dev/null @@ -1,58 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.sed(); -assert.ok(shell.error()); - -shell.sed(/asdf/g); // too few args -assert.ok(shell.error()); - -shell.sed(/asdf/g, 'nada'); // too few args -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.sed(/asdf/g, 'nada', '/asdfasdf'); // no such file -assert.ok(shell.error()); - -// -// Valids -// - -shell.cp('-f', 'resources/file1', 'tmp/file1'); -var result = shell.sed('test1', 'hello', 'tmp/file1'); // search string -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); - -var result = shell.sed(/test1/, 'hello', 'tmp/file1'); // search regex -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); - -var result = shell.sed(/test1/, 1234, 'tmp/file1'); // numeric replacement -assert.equal(shell.error(), null); -assert.equal(result, '1234'); - -var result = shell.sed('-i', /test1/, 'hello', 'tmp/file1'); -assert.equal(shell.error(), null); -assert.equal(result, 'hello'); -assert.equal(shell.cat('tmp/file1'), 'hello'); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/tempdir.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/tempdir.js deleted file mode 100644 index 704ca56..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/tempdir.js +++ /dev/null @@ -1,27 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Valids -// - -var tmp = shell.tempdir(); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync(tmp), true); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/test.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/test.js deleted file mode 100644 index a824edb..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/test.js +++ /dev/null @@ -1,91 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -var result = shell.test(); // no expression given -assert.ok(shell.error()); - -var result = shell.test('asdf'); // bad expression -assert.ok(shell.error()); - -var result = shell.test('f', 'resources/file1'); // bad expression -assert.ok(shell.error()); - -var result = shell.test('-f'); // no file -assert.ok(shell.error()); - -// -// Valids -// - -//exists -var result = shell.test('-e', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-e', 'resources/404'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//directory -var result = shell.test('-d', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-f', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-L', 'resources'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//file -var result = shell.test('-d', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-f', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/file1'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -//link -var result = shell.test('-d', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, false); - -var result = shell.test('-f', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/link'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/badlink'); -assert.equal(shell.error(), null); -assert.equal(result, true);//true - -var result = shell.test('-L', 'resources/404'); -assert.equal(shell.error(), null); -assert.equal(result, false);//false - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/to.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/to.js deleted file mode 100644 index 2e1253d..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/to.js +++ /dev/null @@ -1,39 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -'hello world'.to(); -assert.ok(shell.error()); - -assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -'hello world'.to('/asdfasdf/file'); -assert.ok(shell.error()); - -// -// Valids -// - -'hello world'.to('tmp/to1'); -var result = shell.cat('tmp/to1'); -assert.equal(shell.error(), null); -assert.equal(result, 'hello world'); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/which.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/which.js deleted file mode 100644 index ac9a04d..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/shelljs/test/which.js +++ /dev/null @@ -1,38 +0,0 @@ -var shell = require('..'); - -var assert = require('assert'), - path = require('path'), - fs = require('fs'); - -// Node shims for < v0.7 -fs.existsSync = fs.existsSync || path.existsSync; - -shell.config.silent = true; - -function numLines(str) { - return typeof str === 'string' ? str.match(/\n/g).length : 0; -} - -shell.rm('-rf', 'tmp'); -shell.mkdir('tmp'); - -// -// Invalids -// - -shell.which(); -assert.ok(shell.error()); - -var result = shell.which('asdfasdfasdfasdfasdf'); // what are the odds... -assert.equal(shell.error(), null); -assert.equal(result, null); - -// -// Valids -// - -var result = shell.which('node'); -assert.equal(shell.error(), null); -assert.equal(fs.existsSync(result), true); - -shell.exit(123); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/.npmignore b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/.npmignore deleted file mode 100644 index 4e5886d..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -test/ -Rakefile -docs/ -raw/ diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/.travis.yml b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/.travis.yml deleted file mode 100644 index 99dc771..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.8 -notifications: - email: false diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/CNAME b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/CNAME deleted file mode 100644 index a007e65..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/CNAME +++ /dev/null @@ -1 +0,0 @@ -underscorejs.org diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/CONTRIBUTING.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/CONTRIBUTING.md deleted file mode 100644 index de5d562..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -## How to contribute to Underscore.js - -* Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one. - -* Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/). - -* Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js). - -* In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release. diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/LICENSE b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/LICENSE deleted file mode 100644 index 0d8dbe4..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud - -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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/README.md b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/README.md deleted file mode 100644 index b1f3e50..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/favicon.ico b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/favicon.ico deleted file mode 100644 index 0304968..0000000 Binary files a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/favicon.ico and /dev/null differ diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/index.html b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/index.html deleted file mode 100644 index 8c5793a..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/index.html +++ /dev/null @@ -1,2467 +0,0 @@ - - - - - - - - - Underscore.js - - - - - - -
        - -

        - -

        - -

        - Underscore is a - utility-belt library for JavaScript that provides a lot of the - functional programming support that you would expect in - Prototype.js - (or Ruby), - but without extending any of the built-in JavaScript objects. It's the - tie to go along with jQuery's tux, - and Backbone.js's suspenders. -

        - -

        - Underscore provides 80-odd functions that support both the usual - functional suspects: map, select, invoke — - as well as more specialized helpers: function binding, javascript - templating, deep equality testing, and so on. It delegates to built-in - functions, if present, so modern browsers will use the - native implementations of forEach, map, reduce, - filter, every, some and indexOf. -

        - -

        - A complete Test & Benchmark Suite - is included for your perusal. -

        - -

        - You may also read through the annotated source code. -

        - -

        - The project is - hosted on GitHub. - You can report bugs and discuss features on the - issues page, - on Freenode in the #documentcloud channel, - or send tweets to @documentcloud. -

        - -

        - Underscore is an open-source component of DocumentCloud. -

        - -

        Downloads (Right-click, and use "Save As")

        - - - - - - - - - - - - - - - - - -
        Development Version (1.4.4)40kb, Uncompressed with Plentiful Comments
        Production Version (1.4.4)4kb, Minified and Gzipped
        Edge VersionUnreleased, current master, use at your own risk
        - -
        - -

        Collection Functions (Arrays or Objects)

        - -

        - each_.each(list, iterator, [context]) - Alias: forEach -
        - Iterates over a list of elements, yielding each in turn to an iterator - function. The iterator is bound to the context object, if one is - passed. Each invocation of iterator is called with three arguments: - (element, index, list). If list is a JavaScript object, iterator's - arguments will be (value, key, list). Delegates to the native - forEach function if it exists. -

        -
        -_.each([1, 2, 3], alert);
        -=> alerts each number in turn...
        -_.each({one : 1, two : 2, three : 3}, alert);
        -=> alerts each number value in turn...
        - -

        - map_.map(list, iterator, [context]) - Alias: collect -
        - Produces a new array of values by mapping each value in list - through a transformation function (iterator). If the native map method - exists, it will be used instead. If list is a JavaScript object, - iterator's arguments will be (value, key, list). -

        -
        -_.map([1, 2, 3], function(num){ return num * 3; });
        -=> [3, 6, 9]
        -_.map({one : 1, two : 2, three : 3}, function(num, key){ return num * 3; });
        -=> [3, 6, 9]
        - -

        - reduce_.reduce(list, iterator, memo, [context]) - Aliases: inject, foldl -
        - Also known as inject and foldl, reduce boils down a - list of values into a single value. Memo is the initial state - of the reduction, and each successive step of it should be returned by - iterator. The iterator is passed four arguments: the memo, - then the value and index (or key) of the iteration, - and finally a reference to the entire list. -

        -
        -var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
        -=> 6
        -
        - -

        - reduceRight_.reduceRight(list, iterator, memo, [context]) - Alias: foldr -
        - The right-associative version of reduce. Delegates to the - JavaScript 1.8 version of reduceRight, if it exists. Foldr - is not as useful in JavaScript as it would be in a language with lazy - evaluation. -

        -
        -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]
        -
        - -

        - find_.find(list, iterator, [context]) - Alias: detect -
        - Looks through each value in the list, returning the first one that - passes a truth test (iterator). The function returns as - soon as it finds an acceptable element, and doesn't traverse the - entire list. -

        -
        -var even = _.find([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
        -=> 2
        -
        - -

        - filter_.filter(list, iterator, [context]) - Alias: select -
        - Looks through each value in the list, returning an array of all - the values that pass a truth test (iterator). Delegates to the - native filter method, if it exists. -

        -
        -var evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
        -=> [2, 4, 6]
        -
        - -

        - where_.where(list, properties) -
        - Looks through each value in the list, returning an array of all - the values that contain all of the key-value pairs listed in properties. -

        -
        -_.where(listOfPlays, {author: "Shakespeare", year: 1611});
        -=> [{title: "Cymbeline", author: "Shakespeare", year: 1611},
        -    {title: "The Tempest", author: "Shakespeare", year: 1611}]
        -
        - -

        - findWhere_.findWhere(list, properties) -
        - Looks through the list and returns the first value that matches - all of the key-value pairs listed in properties. -

        -
        -_.findWhere(publicServicePulitzers, {newsroom: "The New York Times"});
        -=> {year: 1918, newsroom: "The New York Times",
        -  reason: "For its public service in publishing in full so many official reports,
        -  documents and speeches by European statesmen relating to the progress and
        -  conduct of the war."}
        -
        - -

        - reject_.reject(list, iterator, [context]) -
        - Returns the values in list without the elements that the truth - test (iterator) passes. The opposite of filter. -

        -
        -var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
        -=> [1, 3, 5]
        -
        - -

        - every_.every(list, iterator, [context]) - Alias: all -
        - Returns true if all of the values in the list pass the iterator - truth test. Delegates to the native method every, if present. -

        -
        -_.every([true, 1, null, 'yes'], _.identity);
        -=> false
        -
        - -

        - some_.some(list, [iterator], [context]) - Alias: any -
        - Returns true if any of the values in the list pass the - iterator truth test. Short-circuits and stops traversing the list - if a true element is found. Delegates to the native method some, - if present. -

        -
        -_.some([null, 0, 'yes', false]);
        -=> true
        -
        - -

        - contains_.contains(list, value) - Alias: include -
        - Returns true if the value is present in the list. - Uses indexOf internally, if list is an Array. -

        -
        -_.contains([1, 2, 3], 3);
        -=> true
        -
        - -

        - invoke_.invoke(list, methodName, [*arguments]) -
        - Calls the method named by methodName on each value in the list. - Any extra arguments passed to invoke will be forwarded on to the - method invocation. -

        -
        -_.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
        -=> [[1, 5, 7], [1, 2, 3]]
        -
        - -

        - pluck_.pluck(list, propertyName) -
        - A convenient version of what is perhaps the most common use-case for - map: extracting a list of property values. -

        -
        -var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
        -_.pluck(stooges, 'name');
        -=> ["moe", "larry", "curly"]
        -
        - -

        - max_.max(list, [iterator], [context]) -
        - Returns the maximum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

        -
        -var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
        -_.max(stooges, function(stooge){ return stooge.age; });
        -=> {name : 'curly', age : 60};
        -
        - -

        - min_.min(list, [iterator], [context]) -
        - Returns the minimum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

        -
        -var numbers = [10, 5, 100, 2, 1000];
        -_.min(numbers);
        -=> 2
        -
        - -

        - sortBy_.sortBy(list, iterator, [context]) -
        - Returns a sorted copy of list, ranked in ascending order by the - results of running each value through iterator. Iterator may - also be the string name of the property to sort by (eg. length). -

        -
        -_.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
        -=> [5, 4, 6, 3, 1, 2]
        -
        - -

        - groupBy_.groupBy(list, iterator, [context]) -
        - Splits a collection into sets, grouped by the result of running each - value through iterator. If iterator is a string instead of - a function, groups by the property named by iterator on each of - the values. -

        -
        -_.groupBy([1.3, 2.1, 2.4], function(num){ return Math.floor(num); });
        -=> {1: [1.3], 2: [2.1, 2.4]}
        -
        -_.groupBy(['one', 'two', 'three'], 'length');
        -=> {3: ["one", "two"], 5: ["three"]}
        -
        - -

        - countBy_.countBy(list, iterator, [context]) -
        - Sorts a list into groups and returns a count for the number of objects - in each group. - Similar to groupBy, but instead of returning a list of values, - returns a count for the number of values in that group. -

        -
        -_.countBy([1, 2, 3, 4, 5], function(num) {
        -  return num % 2 == 0 ? 'even' : 'odd';
        -});
        -=> {odd: 3, even: 2}
        -
        - -

        - shuffle_.shuffle(list) -
        - Returns a shuffled copy of the list, using a version of the - Fisher-Yates shuffle. -

        -
        -_.shuffle([1, 2, 3, 4, 5, 6]);
        -=> [4, 1, 6, 3, 5, 2]
        -
        - -

        - toArray_.toArray(list) -
        - Converts the list (anything that can be iterated over), into a - real Array. Useful for transmuting the arguments object. -

        -
        -(function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
        -=> [2, 3, 4]
        -
        - -

        - size_.size(list) -
        - Return the number of values in the list. -

        -
        -_.size({one : 1, two : 2, three : 3});
        -=> 3
        -
        - -

        Array Functions

        - -

        - - Note: All array functions will also work on the arguments object. - However, Underscore functions are not designed to work on "sparse" arrays. - -

        - -

        - first_.first(array, [n]) - Alias: head, take -
        - Returns the first element of an array. Passing n will - return the first n elements of the array. -

        -
        -_.first([5, 4, 3, 2, 1]);
        -=> 5
        -
        - -

        - initial_.initial(array, [n]) -
        - Returns everything but the last entry of the array. Especially useful on - the arguments object. Pass n to exclude the last n elements - from the result. -

        -
        -_.initial([5, 4, 3, 2, 1]);
        -=> [5, 4, 3, 2]
        -
        - -

        - last_.last(array, [n]) -
        - Returns the last element of an array. Passing n will return - the last n elements of the array. -

        -
        -_.last([5, 4, 3, 2, 1]);
        -=> 1
        -
        - -

        - rest_.rest(array, [index]) - Alias: tail, drop -
        - Returns the rest of the elements in an array. Pass an index - to return the values of the array from that index onward. -

        -
        -_.rest([5, 4, 3, 2, 1]);
        -=> [4, 3, 2, 1]
        -
        - -

        - compact_.compact(array) -
        - Returns a copy of the array with all falsy values removed. - In JavaScript, false, null, 0, "", - undefined and NaN are all falsy. -

        -
        -_.compact([0, 1, false, 2, '', 3]);
        -=> [1, 2, 3]
        -
        - -

        - flatten_.flatten(array, [shallow]) -
        - Flattens a nested array (the nesting can be to any depth). If you - pass shallow, the array will only be flattened a single level. -

        -
        -_.flatten([1, [2], [3, [[4]]]]);
        -=> [1, 2, 3, 4];
        -
        -_.flatten([1, [2], [3, [[4]]]], true);
        -=> [1, 2, 3, [[4]]];
        -
        - -

        - without_.without(array, [*values]) -
        - Returns a copy of the array with all instances of the values - removed. -

        -
        -_.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
        -=> [2, 3, 4]
        -
        - -

        - union_.union(*arrays) -
        - Computes the union of the passed-in arrays: the list of unique items, - in order, that are present in one or more of the arrays. -

        -
        -_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
        -=> [1, 2, 3, 101, 10]
        -
        - -

        - intersection_.intersection(*arrays) -
        - Computes the list of values that are the intersection of all the arrays. - Each value in the result is present in each of the arrays. -

        -
        -_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
        -=> [1, 2]
        -
        - -

        - difference_.difference(array, *others) -
        - Similar to without, but returns the values from array that - are not present in the other arrays. -

        -
        -_.difference([1, 2, 3, 4, 5], [5, 2, 10]);
        -=> [1, 3, 4]
        -
        - -

        - uniq_.uniq(array, [isSorted], [iterator]) - Alias: unique -
        - Produces a duplicate-free version of the array, using === to test - object equality. If you know in advance that the array is sorted, - passing true for isSorted will run a much faster algorithm. - If you want to compute unique items based on a transformation, pass an - iterator function. -

        -
        -_.uniq([1, 2, 1, 3, 1, 4]);
        -=> [1, 2, 3, 4]
        -
        - -

        - zip_.zip(*arrays) -
        - Merges together the values of each of the arrays with the - values at the corresponding position. Useful when you have separate - data sources that are coordinated through matching array indexes. - If you're working with a matrix of nested arrays, zip.apply - can transpose the matrix in a similar fashion. -

        -
        -_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
        -=> [["moe", 30, true], ["larry", 40, false], ["curly", 50, false]]
        -
        - -

        - object_.object(list, [values]) -
        - Converts arrays into objects. Pass either a single list of - [key, value] pairs, or a list of keys, and a list of values. -

        -
        -_.object(['moe', 'larry', 'curly'], [30, 40, 50]);
        -=> {moe: 30, larry: 40, curly: 50}
        -
        -_.object([['moe', 30], ['larry', 40], ['curly', 50]]);
        -=> {moe: 30, larry: 40, curly: 50}
        -
        - -

        - indexOf_.indexOf(array, value, [isSorted]) -
        - Returns the index at which value can be found in the array, - or -1 if value is not present in the array. Uses the native - indexOf function unless it's missing. If you're working with a - large array, and you know that the array is already sorted, pass true - for isSorted to use a faster binary search ... or, pass a number as - the third argument in order to look for the first matching value in the - array after the given index. -

        -
        -_.indexOf([1, 2, 3], 2);
        -=> 1
        -
        - -

        - lastIndexOf_.lastIndexOf(array, value, [fromIndex]) -
        - Returns the index of the last occurrence of value in the array, - or -1 if value is not present. Uses the native lastIndexOf - function if possible. Pass fromIndex to start your search at a - given index. -

        -
        -_.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
        -=> 4
        -
        - -

        - sortedIndex_.sortedIndex(list, value, [iterator], [context]) -
        - Uses a binary search to determine the index at which the value - should be inserted into the list in order to maintain the list's - sorted order. If an iterator is passed, it will be used to compute - the sort ranking of each value, including the value you pass. -

        -
        -_.sortedIndex([10, 20, 30, 40, 50], 35);
        -=> 3
        -
        - -

        - range_.range([start], stop, [step]) -
        - A function to create flexibly-numbered lists of integers, handy for - each and map loops. start, if omitted, defaults - to 0; step defaults to 1. Returns a list of integers - from start to stop, incremented (or decremented) by step, - exclusive. -

        -
        -_.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 (uh, ahem) Functions

        - -

        - bind_.bind(function, object, [*arguments]) -
        - Bind a function to an object, meaning that whenever - the function is called, the value of this will be the object. - Optionally, pass arguments to the function to pre-fill them, - also known as partial application. -

        -
        -var func = function(greeting){ return greeting + ': ' + this.name };
        -func = _.bind(func, {name : 'moe'}, 'hi');
        -func();
        -=> 'hi: moe'
        -
        - -

        - bindAll_.bindAll(object, [*methodNames]) -
        - Binds a number of methods on the object, specified by - methodNames, to be run in the context of that object whenever they - are invoked. Very handy for binding functions that are going to be used - as event handlers, which would otherwise be invoked with a fairly useless - this. If no methodNames are provided, all of the object's - function properties will be bound to it. -

        -
        -var buttonView = {
        -  label   : 'underscore',
        -  onClick : function(){ alert('clicked: ' + this.label); },
        -  onHover : function(){ console.log('hovering: ' + this.label); }
        -};
        -_.bindAll(buttonView);
        -jQuery('#underscore_button').bind('click', buttonView.onClick);
        -=> When the button is clicked, this.label will have the correct value...
        -
        - -

        - partial_.partial(function, [*arguments]) -
        - Partially apply a function by filling in any number of its arguments, - without changing its dynamic this value. A close cousin - of bind. -

        -
        -var add = function(a, b) { return a + b; };
        -add5 = _.partial(add, 5);
        -add5(10);
        -=> 15
        -
        - -

        - memoize_.memoize(function, [hashFunction]) -
        - Memoizes a given function by caching the computed result. Useful - for speeding up slow-running computations. If passed an optional - hashFunction, it will be used to compute the hash key for storing - the result, based on the arguments to the original function. The default - hashFunction just uses the first argument to the memoized function - as the key. -

        -
        -var fibonacci = _.memoize(function(n) {
        -  return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
        -});
        -
        - -

        - delay_.delay(function, wait, [*arguments]) -
        - Much like setTimeout, invokes function after wait - milliseconds. If you pass the optional arguments, they will be - forwarded on to the function when it is invoked. -

        -
        -var log = _.bind(console.log, console);
        -_.delay(log, 1000, 'logged later');
        -=> 'logged later' // Appears after one second.
        -
        - -

        - defer_.defer(function, [*arguments]) -
        - Defers invoking the function until the current call stack has cleared, - similar to using setTimeout with a delay of 0. Useful for performing - expensive computations or HTML rendering in chunks without blocking the UI thread - from updating. If you pass the optional arguments, they will be - forwarded on to the function when it is invoked. -

        -
        -_.defer(function(){ alert('deferred'); });
        -// Returns from the function before the alert runs.
        -
        - -

        - throttle_.throttle(function, wait) -
        - Creates and returns a new, throttled version of the passed function, - that, when invoked repeatedly, will only actually call the original function - at most once per every wait - milliseconds. Useful for rate-limiting events that occur faster than you - can keep up with. -

        -
        -var throttled = _.throttle(updatePosition, 100);
        -$(window).scroll(throttled);
        -
        - -

        - debounce_.debounce(function, wait, [immediate]) -
        - Creates and returns a new debounced version of the passed function that - will postpone its execution until after - wait milliseconds have elapsed since the last time it - was invoked. Useful for implementing behavior that should only happen - after the input has stopped arriving. For example: rendering a - preview of a Markdown comment, recalculating a layout after the window - has stopped being resized, and so on. -

        - -

        - Pass true for the immediate parameter to cause - debounce to trigger the function on the leading instead of the - trailing edge of the wait interval. Useful in circumstances like - preventing accidental double-clicks on a "submit" button from firing a - second time. -

        - -
        -var lazyLayout = _.debounce(calculateLayout, 300);
        -$(window).resize(lazyLayout);
        -
        - -

        - once_.once(function) -
        - Creates a version of the function that can only be called one time. - Repeated calls to the modified function will have no effect, returning - the value from the original call. Useful for initialization functions, - instead of having to set a boolean flag and then check it later. -

        -
        -var initialize = _.once(createApplication);
        -initialize();
        -initialize();
        -// Application is only created once.
        -
        - -

        - after_.after(count, function) -
        - Creates a version of the function that will only be run after first - being called count times. Useful for grouping asynchronous responses, - where you want to be sure that all the async calls have finished, before - proceeding. -

        -
        -var renderNotes = _.after(notes.length, render);
        -_.each(notes, function(note) {
        -  note.asyncSave({success: renderNotes});
        -});
        -// renderNotes is run once, after all notes have saved.
        -
        - -

        - wrap_.wrap(function, wrapper) -
        - Wraps the first function inside of the wrapper function, - passing it as the first argument. This allows the wrapper to - execute code before and after the function runs, adjust the arguments, - and execute it conditionally. -

        -
        -var hello = function(name) { return "hello: " + name; };
        -hello = _.wrap(hello, function(func) {
        -  return "before, " + func("moe") + ", after";
        -});
        -hello();
        -=> 'before, hello: moe, after'
        -
        - -

        - compose_.compose(*functions) -
        - 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())). -

        -
        -var greet    = function(name){ return "hi: " + name; };
        -var exclaim  = function(statement){ return statement + "!"; };
        -var welcome = _.compose(exclaim, greet);
        -welcome('moe');
        -=> 'hi: moe!'
        -
        - -

        Object Functions

        - -

        - keys_.keys(object) -
        - Retrieve all the names of the object's properties. -

        -
        -_.keys({one : 1, two : 2, three : 3});
        -=> ["one", "two", "three"]
        -
        - -

        - values_.values(object) -
        - Return all of the values of the object's properties. -

        -
        -_.values({one : 1, two : 2, three : 3});
        -=> [1, 2, 3]
        -
        - -

        - pairs_.pairs(object) -
        - Convert an object into a list of [key, value] pairs. -

        -
        -_.pairs({one: 1, two: 2, three: 3});
        -=> [["one", 1], ["two", 2], ["three", 3]]
        -
        - -

        - invert_.invert(object) -
        - Returns a copy of the object where the keys have become the values - and the values the keys. For this to work, all of your object's values - should be unique and string serializable. -

        -
        -_.invert({Moe: "Moses", Larry: "Louis", Curly: "Jerome"});
        -=> {Moses: "Moe", Louis: "Larry", Jerome: "Curly"};
        -
        - -

        - functions_.functions(object) - Alias: methods -
        - Returns a sorted list of the names of every method in an object — - that is to say, the name of every function property of the object. -

        -
        -_.functions(_);
        -=> ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...
        -
        - -

        - extend_.extend(destination, *sources) -
        - Copy all of the properties in the source objects over to the - destination object, and return the destination object. - It's in-order, so the last source will override properties of the same - name in previous arguments. -

        -
        -_.extend({name : 'moe'}, {age : 50});
        -=> {name : 'moe', age : 50}
        -
        - -

        - pick_.pick(object, *keys) -
        - Return a copy of the object, filtered to only have values for - the whitelisted keys (or array of valid keys). -

        -
        -_.pick({name : 'moe', age: 50, userid : 'moe1'}, 'name', 'age');
        -=> {name : 'moe', age : 50}
        -
        - -

        - omit_.omit(object, *keys) -
        - Return a copy of the object, filtered to omit the blacklisted - keys (or array of keys). -

        -
        -_.omit({name : 'moe', age : 50, userid : 'moe1'}, 'userid');
        -=> {name : 'moe', age : 50}
        -
        - -

        - defaults_.defaults(object, *defaults) -
        - Fill in null and undefined properties in object with values from the - defaults objects, and return the object. As soon as the - property is filled, further defaults will have no effect. -

        -
        -var iceCream = {flavor : "chocolate"};
        -_.defaults(iceCream, {flavor : "vanilla", sprinkles : "lots"});
        -=> {flavor : "chocolate", sprinkles : "lots"}
        -
        - -

        - clone_.clone(object) -
        - Create a shallow-copied clone of the object. Any nested objects - or arrays will be copied by reference, not duplicated. -

        -
        -_.clone({name : 'moe'});
        -=> {name : 'moe'};
        -
        - -

        - tap_.tap(object, interceptor) -
        - Invokes interceptor with the object, and then returns object. - The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. -

        -
        -_.chain([1,2,3,200])
        -  .filter(function(num) { return num % 2 == 0; })
        -  .tap(alert)
        -  .map(function(num) { return num * num })
        -  .value();
        -=> // [2, 200] (alerted)
        -=> [4, 40000]
        -
        - -

        - has_.has(object, key) -
        - Does the object contain the given key? Identical to - object.hasOwnProperty(key), but uses a safe reference to the - hasOwnProperty function, in case it's been - overridden accidentally. -

        -
        -_.has({a: 1, b: 2, c: 3}, "b");
        -=> true
        -
        - -

        - isEqual_.isEqual(object, other) -
        - Performs an optimized deep comparison between the two objects, to determine - if they should be considered equal. -

        -
        -var moe   = {name : 'moe', luckyNumbers : [13, 27, 34]};
        -var clone = {name : 'moe', luckyNumbers : [13, 27, 34]};
        -moe == clone;
        -=> false
        -_.isEqual(moe, clone);
        -=> true
        -
        - -

        - isEmpty_.isEmpty(object) -
        - Returns true if object contains no values. -

        -
        -_.isEmpty([1, 2, 3]);
        -=> false
        -_.isEmpty({});
        -=> true
        -
        - -

        - isElement_.isElement(object) -
        - Returns true if object is a DOM element. -

        -
        -_.isElement(jQuery('body')[0]);
        -=> true
        -
        - -

        - isArray_.isArray(object) -
        - Returns true if object is an Array. -

        -
        -(function(){ return _.isArray(arguments); })();
        -=> false
        -_.isArray([1,2,3]);
        -=> true
        -
        - -

        - isObject_.isObject(value) -
        - Returns true if value is an Object. Note that JavaScript - arrays and functions are objects, while (normal) strings and numbers are not. -

        -
        -_.isObject({});
        -=> true
        -_.isObject(1);
        -=> false
        -
        - -

        - isArguments_.isArguments(object) -
        - Returns true if object is an Arguments object. -

        -
        -(function(){ return _.isArguments(arguments); })(1, 2, 3);
        -=> true
        -_.isArguments([1,2,3]);
        -=> false
        -
        - -

        - isFunction_.isFunction(object) -
        - Returns true if object is a Function. -

        -
        -_.isFunction(alert);
        -=> true
        -
        - -

        - isString_.isString(object) -
        - Returns true if object is a String. -

        -
        -_.isString("moe");
        -=> true
        -
        - -

        - isNumber_.isNumber(object) -
        - Returns true if object is a Number (including NaN). -

        -
        -_.isNumber(8.4 * 5);
        -=> true
        -
        - -

        - isFinite_.isFinite(object) -
        - Returns true if object is a finite Number. -

        -
        -_.isFinite(-101);
        -=> true
        -
        -_.isFinite(-Infinity);
        -=> false
        -
        - -

        - isBoolean_.isBoolean(object) -
        - Returns true if object is either true or false. -

        -
        -_.isBoolean(null);
        -=> false
        -
        - -

        - isDate_.isDate(object) -
        - Returns true if object is a Date. -

        -
        -_.isDate(new Date());
        -=> true
        -
        - -

        - isRegExp_.isRegExp(object) -
        - Returns true if object is a RegExp. -

        -
        -_.isRegExp(/moe/);
        -=> true
        -
        - -

        - isNaN_.isNaN(object) -
        - Returns true if object is NaN.
        Note: this is not - the same as the native isNaN function, which will also return - true if the variable is undefined. -

        -
        -_.isNaN(NaN);
        -=> true
        -isNaN(undefined);
        -=> true
        -_.isNaN(undefined);
        -=> false
        -
        - -

        - isNull_.isNull(object) -
        - Returns true if the value of object is null. -

        -
        -_.isNull(null);
        -=> true
        -_.isNull(undefined);
        -=> false
        -
        - -

        - isUndefined_.isUndefined(value) -
        - Returns true if value is undefined. -

        -
        -_.isUndefined(window.missingVariable);
        -=> true
        -
        - -

        Utility Functions

        - -

        - noConflict_.noConflict() -
        - Give control of the "_" variable back to its previous owner. Returns - a reference to the Underscore object. -

        -
        -var underscore = _.noConflict();
        - -

        - identity_.identity(value) -
        - Returns the same value that is used as the argument. In math: - f(x) = x
        - This function looks useless, but is used throughout Underscore as - a default iterator. -

        -
        -var moe = {name : 'moe'};
        -moe === _.identity(moe);
        -=> true
        - -

        - times_.times(n, iterator, [context]) -
        - Invokes the given iterator function n times. Each invocation of - iterator is called with an index argument. -
        - Note: this example uses the chaining syntax. -

        -
        -_(3).times(function(n){ genie.grantWishNumber(n); });
        - -

        - random_.random(min, max) -
        - Returns a random integer between min and max, inclusive. - If you only pass one argument, it will return a number between 0 - and that number. -

        -
        -_.random(0, 100);
        -=> 42
        - -

        - mixin_.mixin(object) -
        - Allows you to extend Underscore with your own utility functions. Pass - a hash of {name: function} definitions to have your functions - added to the Underscore object, as well as the OOP wrapper. -

        -
        -_.mixin({
        -  capitalize : function(string) {
        -    return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
        -  }
        -});
        -_("fabio").capitalize();
        -=> "Fabio"
        -
        - -

        - uniqueId_.uniqueId([prefix]) -
        - Generate a globally-unique id for client-side models or DOM elements - that need one. If prefix is passed, the id will be appended to it. -

        -
        -_.uniqueId('contact_');
        -=> 'contact_104'
        - -

        - escape_.escape(string) -
        - Escapes a string for insertion into HTML, replacing - &, <, >, ", ', and / characters. -

        -
        -_.escape('Curly, Larry & Moe');
        -=> "Curly, Larry &amp; Moe"
        - -

        - unescape_.unescape(string) -
        - The opposite of escape, replaces - &amp;, &lt;, &gt;, - &quot;, &#x27;, and &#x2F; - with their unescaped counterparts. -

        -
        -_.unescape('Curly, Larry &amp; Moe');
        -=> "Curly, Larry & Moe"
        - -

        - result_.result(object, property) -
        - If the value of the named property is a function then invoke it; otherwise, return it. -

        -
        -var object = {cheese: 'crumpets', stuff: function(){ return 'nonsense'; }};
        -_.result(object, 'cheese');
        -=> "crumpets"
        -_.result(object, 'stuff');
        -=> "nonsense"
        - -

        - template_.template(templateString, [data], [settings]) -
        - Compiles JavaScript templates into functions that can be evaluated - for rendering. Useful for rendering complicated bits of HTML from JSON - data sources. Template functions can both interpolate variables, using - <%= … %>, as well as execute arbitrary JavaScript code, with - <% … %>. If you wish to interpolate a value, and have - it be HTML-escaped, use <%- … %> When you evaluate a template function, pass in a - data object that has properties corresponding to the template's free - variables. If you're writing a one-off, you can pass the data - object as the second parameter to template in order to render - immediately instead of returning a template function. The settings argument - should be a hash containing any _.templateSettings that should be overridden. -

        - -
        -var compiled = _.template("hello: <%= name %>");
        -compiled({name : 'moe'});
        -=> "hello: moe"
        -
        -var list = "<% _.each(people, function(name) { %> <li><%= name %></li> <% }); %>";
        -_.template(list, {people : ['moe', 'curly', 'larry']});
        -=> "<li>moe</li><li>curly</li><li>larry</li>"
        -
        -var template = _.template("<b><%- value %></b>");
        -template({value : '<script>'});
        -=> "<b>&lt;script&gt;</b>"
        - -

        - You can also use print from within JavaScript code. This is - sometimes more convenient than using <%= ... %>. -

        - -
        -var compiled = _.template("<% print('Hello ' + epithet); %>");
        -compiled({epithet: "stooge"});
        -=> "Hello stooge."
        - -

        - If ERB-style delimiters aren't your cup of tea, you can change Underscore's - template settings to use different symbols to set off interpolated code. - Define an interpolate regex to match expressions that should be - interpolated verbatim, an escape regex to match expressions that should - be inserted after being HTML escaped, and an evaluate regex to match - expressions that should be evaluated without insertion into the resulting - string. You may define or omit any combination of the three. - For example, to perform - Mustache.js - style templating: -

        - -
        -_.templateSettings = {
        -  interpolate : /\{\{(.+?)\}\}/g
        -};
        -
        -var template = _.template("Hello {{ name }}!");
        -template({name : "Mustache"});
        -=> "Hello Mustache!"
        - -

        - By default, template places the values from your data in the local scope - via the with statement. However, you can specify a single variable name - with the variable setting. This can significantly improve the speed - at which a template is able to render. -

        - -
        -_.template("Using 'with': <%= data.answer %>", {answer: 'no'}, {variable: 'data'});
        -=> "Using 'with': no"
        - -

        - Precompiling your templates can be a big help when debugging errors you can't - reproduce. This is because precompiled templates can provide line numbers and - a stack trace, something that is not possible when compiling templates on the client. - The source property is available on the compiled template - function for easy precompilation. -

        - -
        <script>
        -  JST.project = <%= _.template(jstText).source %>;
        -</script>
        - - -

        Chaining

        - -

        - You can use Underscore in either an object-oriented or a functional style, - depending on your preference. The following two lines of code are - identical ways to double a list of numbers. -

        - -
        -_.map([1, 2, 3], function(n){ return n * 2; });
        -_([1, 2, 3]).map(function(n){ return n * 2; });
        - -

        - Calling chain will cause all future method calls to return - wrapped objects. When you've finished the computation, use - value to retrieve the final value. Here's an example of chaining - together a map/flatten/reduce, in order to get the word count of - every word in a song. -

        - -
        -var lyrics = [
        -  {line : 1, words : "I'm a lumberjack and I'm okay"},
        -  {line : 2, words : "I sleep all night and I work all day"},
        -  {line : 3, words : "He's a lumberjack and he's okay"},
        -  {line : 4, words : "He sleeps all night and he works all day"}
        -];
        -
        -_.chain(lyrics)
        -  .map(function(line) { return line.words.split(' '); })
        -  .flatten()
        -  .reduce(function(counts, word) {
        -    counts[word] = (counts[word] || 0) + 1;
        -    return counts;
        -  }, {})
        -  .value();
        -
        -=> {lumberjack : 2, all : 4, night : 2 ... }
        - -

        - In addition, the - Array prototype's methods - are proxied through the chained Underscore object, so you can slip a - reverse or a push into your chain, and continue to - modify the array. -

        - -

        - chain_.chain(obj) -
        - Returns a wrapped object. Calling methods on this object will continue - to return wrapped objects until value is used. -

        -
        -var stooges = [{name : 'curly', age : 25}, {name : 'moe', age : 21}, {name : 'larry', age : 23}];
        -var youngest = _.chain(stooges)
        -  .sortBy(function(stooge){ return stooge.age; })
        -  .map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
        -  .first()
        -  .value();
        -=> "moe is 21"
        -
        - -

        - value_(obj).value() -
        - Extracts the value of a wrapped object. -

        -
        -_([1, 2, 3]).value();
        -=> [1, 2, 3]
        -
        - - - -

        - The Underscore documentation is also available in - Simplified Chinese. -

        - -

        - Underscore.lua, - a Lua port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - (source) -

        - -

        - Underscore.m, an Objective-C port - of many of the Underscore.js functions, using a syntax that encourages - chaining. - (source) -

        - -

        - _.m, an alternative - Objective-C port that tries to stick a little closer to the original - Underscore.js API. - (source) -

        - -

        - Underscore.php, - a PHP port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - (source) -

        - -

        - Underscore-perl, - a Perl port of many of the Underscore.js functions, - aimed at on Perl hashes and arrays. - (source) -

        - -

        - Underscore.cfc, - a Coldfusion port of many of the Underscore.js functions. - (source) -

        - -

        - Underscore.string, - an Underscore extension that adds functions for string-manipulation: - trim, startsWith, contains, capitalize, - reverse, sprintf, and more. -

        - -

        - Ruby's Enumerable module. -

        - -

        - Prototype.js, which provides - JavaScript with collection functions in the manner closest to Ruby's Enumerable. -

        - -

        - Oliver Steele's - Functional JavaScript, - which includes comprehensive higher-order function support as well as string lambdas. -

        - -

        - Michael Aufreiter's Data.js, - a data manipulation + persistence library for JavaScript. -

        - -

        - Python's itertools. -

        - -

        Change Log

        - -

        - 1.4.4Jan. 30, 2013Diff
        -

          -
        • - Added _.findWhere, for finding the first element in a list - that matches a particular set of keys and values. -
        • -
        • - Added _.partial, for partially applying a function without - changing its dynamic reference to this. -
        • -
        • - Simplified bind by removing some edge cases involving - constructor functions. In short: don't _.bind your - constructors. -
        • -
        • - A minor optimization to invoke. -
        • -
        • - Fix bug in the minified version due to the minifier incorrectly - optimizing-away isFunction. -
        • -
        -

        - -

        - 1.4.3Dec. 4, 2012Diff
        -

          -
        • - Improved Underscore compatibility with Adobe's JS engine that can be - used to script Illustrator, Photoshop, and friends. -
        • -
        • - Added a default _.identity iterator to countBy and - groupBy. -
        • -
        • - The uniq function can now take array, iterator, context - as the argument list. -
        • -
        • - The times function now returns the mapped array of iterator - results. -
        • -
        • - Simplified and fixed bugs in throttle. -
        • -
        -

        - -

        - 1.4.2Oct. 1, 2012Diff
        -

          -
        • - For backwards compatibility, returned to pre-1.4.0 behavior when - passing null to iteration functions. They now become no-ops - again. -
        • -
        -

        - -

        - 1.4.1Oct. 1, 2012Diff
        -

          -
        • - Fixed a 1.4.0 regression in the lastIndexOf function. -
        • -
        -

        - -

        - 1.4.0Sept. 27, 2012Diff
        -

          -
        • - Added a pairs function, for turning a JavaScript object - into [key, value] pairs ... as well as an object - function, for converting an array of [key, value] pairs - into an object. -
        • -
        • - Added a countBy function, for counting the number of objects - in a list that match a certain criteria. -
        • -
        • - Added an invert function, for performing a simple inversion - of the keys and values in an object. -
        • -
        • - Added a where function, for easy cases of filtering a list - for objects with specific values. -
        • -
        • - Added an omit function, for filtering an object to remove - certain keys. -
        • -
        • - Added a random function, to return a random number in a - given range. -
        • -
        • - _.debounce'd functions now return their last updated value, - just like _.throttle'd functions do. -
        • -
        • - The sortBy function now runs a stable sort algorithm. -
        • -
        • - Added the optional fromIndex option to indexOf and - lastIndexOf. -
        • -
        • - "Sparse" arrays are no longer supported in Underscore iteration - functions. Use a for loop instead (or better yet, an object). -
        • -
        • - The min and max functions may now be called on - very large arrays. -
        • -
        • - Interpolation in templates now represents null and - undefined as the empty string. -
        • -
        • - Underscore iteration functions no longer accept null values - as a no-op argument. You'll get an early error instead. -
        • -
        • - A number of edge-cases fixes and tweaks, which you can spot in the - diff. - Depending on how you're using Underscore, 1.4.0 may be more - backwards-incompatible than usual — please test when you upgrade. -
        • -
        -

        - -

        - 1.3.3April 10, 2012
        -

          -
        • - Many improvements to _.template, which now provides the - source of the template function as a property, for potentially - even more efficient pre-compilation on the server-side. You may now - also set the variable option when creating a template, - which will cause your passed-in data to be made available under the - variable you named, instead of using a with statement — - significantly improving the speed of rendering the template. -
        • -
        • - Added the pick function, which allows you to filter an - object literal with a whitelist of allowed property names. -
        • -
        • - Added the result function, for convenience when working - with APIs that allow either functions or raw properties. -
        • -
        • - Added the isFinite function, because sometimes knowing that - a value is a number just ain't quite enough. -
        • -
        • - The sortBy function may now also be passed the string name - of a property to use as the sort order on each object. -
        • -
        • - Fixed uniq to work with sparse arrays. -
        • -
        • - The difference function now performs a shallow flatten - instead of a deep one when computing array differences. -
        • -
        • - The debounce function now takes an immediate - parameter, which will cause the callback to fire on the leading - instead of the trailing edge. -
        • -
        -

        - -

        - 1.3.1Jan. 23, 2012
        -

          -
        • - Added an _.has function, as a safer way to use hasOwnProperty. -
        • -
        • - Added _.collect as an alias for _.map. Smalltalkers, rejoice. -
        • -
        • - Reverted an old change so that _.extend will correctly copy - over keys with undefined values again. -
        • -
        • - Bugfix to stop escaping slashes within interpolations in _.template. -
        • -
        -

        - -

        - 1.3.0Jan. 11, 2012
        -

          -
        • - Removed AMD (RequireJS) support from Underscore. If you'd like to use - Underscore with RequireJS, you can load it as a normal script, wrap - or patch your copy, or download a forked version. -
        • -
        -

        - -

        - 1.2.4Jan. 4, 2012
        -

          -
        • - You now can (and probably should, as it's simpler) - write _.chain(list) - instead of _(list).chain(). -
        • -
        • - Fix for escaped characters in Underscore templates, and for supporting - customizations of _.templateSettings that only define one or - two of the required regexes. -
        • -
        • - Fix for passing an array as the first argument to an _.wrap'd function. -
        • -
        • - Improved compatibility with ClojureScript, which adds a call - function to String.prototype. -
        • -
        -

        - -

        - 1.2.3Dec. 7, 2011
        -

          -
        • - Dynamic scope is now preserved for compiled _.template functions, - so you can use the value of this if you like. -
        • -
        • - Sparse array support of _.indexOf, _.lastIndexOf. -
        • -
        • - Both _.reduce and _.reduceRight can now be passed an - explicitly undefined value. (There's no reason why you'd - want to do this.) -
        • -
        -

        - -

        - 1.2.2Nov. 14, 2011
        -

          -
        • - Continued tweaks to _.isEqual semantics. Now JS primitives are - considered equivalent to their wrapped versions, and arrays are compared - by their numeric properties only (#351). -
        • -
        • - _.escape no longer tries to be smart about not double-escaping - already-escaped HTML entities. Now it just escapes regardless (#350). -
        • -
        • - In _.template, you may now leave semicolons out of evaluated - statements if you wish: <% }) %> (#369). -
        • -
        • - _.after(callback, 0) will now trigger the callback immediately, - making "after" easier to use with asynchronous APIs (#366). -
        • -
        -

        - -

        - 1.2.1Oct. 24, 2011
        -

          -
        • - Several important bug fixes for _.isEqual, which should now - do better on mutated Arrays, and on non-Array objects with - length properties. (#329) -
        • -
        • - jrburke contributed Underscore exporting for AMD module loaders, - and tonylukasavage for Appcelerator Titanium. - (#335, #338) -
        • -
        • - You can now _.groupBy(list, 'property') as a shortcut for - grouping values by a particular common property. -
        • -
        • - _.throttle'd functions now fire immediately upon invocation, - and are rate-limited thereafter (#170, #266). -
        • -
        • - Most of the _.is[Type] checks no longer ducktype. -
        • -
        • - The _.bind function now also works on constructors, a-la - ES5 ... but you would never want to use _.bind on a - constructor function. -
        • -
        • - _.clone no longer wraps non-object types in Objects. -
        • -
        • - _.find and _.filter are now the preferred names for - _.detect and _.select. -
        • -
        -

        - -

        - 1.2.0Oct. 5, 2011
        -

          -
        • - The _.isEqual function now - supports true deep equality comparisons, with checks for cyclic structures, - thanks to Kit Cambridge. -
        • -
        • - Underscore templates now support HTML escaping interpolations, using - <%- ... %> syntax. -
        • -
        • - Ryan Tenney contributed _.shuffle, which uses a modified - Fisher-Yates to give you a shuffled copy of an array. -
        • -
        • - _.uniq can now be passed an optional iterator, to determine by - what criteria an object should be considered unique. -
        • -
        • - _.last now takes an optional argument which will return the last - N elements of the list. -
        • -
        • - A new _.initial function was added, as a mirror of _.rest, - which returns all the initial values of a list (except the last N). -
        • -
        -

        - -

        - 1.1.7July 13, 2011
        - Added _.groupBy, which aggregates a collection into groups of like items. - Added _.union and _.difference, to complement the - (re-named) _.intersection. - Various improvements for support of sparse arrays. - _.toArray now returns a clone, if directly passed an array. - _.functions now also returns the names of functions that are present - in the prototype chain. -

        - -

        - 1.1.6April 18, 2011
        - Added _.after, which will return a function that only runs after - first being called a specified number of times. - _.invoke can now take a direct function reference. - _.every now requires an iterator function to be passed, which - mirrors the ECMA5 API. - _.extend no longer copies keys when the value is undefined. - _.bind now errors when trying to bind an undefined value. -

        - -

        - 1.1.5Mar 20, 2011
        - Added an _.defaults function, for use merging together JS objects - representing default options. - Added an _.once function, for manufacturing functions that should - only ever execute a single time. - _.bind now delegates to the native ECMAScript 5 version, - where available. - _.keys now throws an error when used on non-Object values, as in - ECMAScript 5. - Fixed a bug with _.keys when used over sparse arrays. -

        - -

        - 1.1.4Jan 9, 2011
        - Improved compliance with ES5's Array methods when passing null - as a value. _.wrap now correctly sets this for the - wrapped function. _.indexOf now takes an optional flag for - finding the insertion index in an array that is guaranteed to already - be sorted. Avoiding the use of .callee, to allow _.isArray - to work properly in ES5's strict mode. -

        - -

        - 1.1.3Dec 1, 2010
        - In CommonJS, Underscore may now be required with just:
        - var _ = require("underscore"). - Added _.throttle and _.debounce functions. - Removed _.breakLoop, in favor of an ECMA5-style un-break-able - each implementation — this removes the try/catch, and you'll now have - better stack traces for exceptions that are thrown within an Underscore iterator. - Improved the isType family of functions for better interoperability - with Internet Explorer host objects. - _.template now correctly escapes backslashes in templates. - Improved _.reduce compatibility with the ECMA5 version: - if you don't pass an initial value, the first item in the collection is used. - _.each no longer returns the iterated collection, for improved - consistency with ES5's forEach. -

        - -

        - 1.1.2
        - Fixed _.contains, which was mistakenly pointing at - _.intersect instead of _.include, like it should - have been. Added _.unique as an alias for _.uniq. -

        - -

        - 1.1.1
        - Improved the speed of _.template, and its handling of multiline - interpolations. Ryan Tenney contributed optimizations to many Underscore - functions. An annotated version of the source code is now available. -

        - -

        - 1.1.0
        - The method signature of _.reduce has been changed to match - the ECMAScript 5 signature, instead of the Ruby/Prototype.js version. - This is a backwards-incompatible change. _.template may now be - called with no arguments, and preserves whitespace. _.contains - is a new alias for _.include. -

        - -

        - 1.0.4
        - Andri Möll contributed the _.memoize - function, which can be used to speed up expensive repeated computations - by caching the results. -

        - -

        - 1.0.3
        - Patch that makes _.isEqual return false if any property - of the compared object has a NaN value. Technically the correct - thing to do, but of questionable semantics. Watch out for NaN comparisons. -

        - -

        - 1.0.2
        - Fixes _.isArguments in recent versions of Opera, which have - arguments objects as real Arrays. -

        - -

        - 1.0.1
        - Bugfix for _.isEqual, when comparing two objects with the same - number of undefined keys, but with different names. -

        - -

        - 1.0.0
        - Things have been stable for many months now, so Underscore is now - considered to be out of beta, at 1.0. Improvements since 0.6 - include _.isBoolean, and the ability to have _.extend - take multiple source objects. -

        - -

        - 0.6.0
        - Major release. Incorporates a number of - Mile Frawley's refactors for - safer duck-typing on collection functions, and cleaner internals. A new - _.mixin method that allows you to extend Underscore with utility - functions of your own. Added _.times, which works the same as in - Ruby or Prototype.js. Native support for ECMAScript 5's Array.isArray, - and Object.keys. -

        - -

        - 0.5.8
        - Fixed Underscore's collection functions to work on - NodeLists and - HTMLCollections - once more, thanks to - Justin Tulloss. -

        - -

        - 0.5.7
        - A safer implementation of _.isArguments, and a - faster _.isNumber,
        thanks to - Jed Schmidt. -

        - -

        - 0.5.6
        - Customizable delimiters for _.template, contributed by - Noah Sloan. -

        - -

        - 0.5.5
        - Fix for a bug in MobileSafari's OOP-wrapper, with the arguments object. -

        - -

        - 0.5.4
        - Fix for multiple single quotes within a template string for - _.template. See: - Rick Strahl's blog post. -

        - -

        - 0.5.2
        - New implementations of isArray, isDate, isFunction, - isNumber, isRegExp, and isString, thanks to - a suggestion from - Robert Kieffer. - Instead of doing Object#toString - comparisons, they now check for expected properties, which is less safe, - but more than an order of magnitude faster. Most other Underscore - functions saw minor speed improvements as a result. - Evgeniy Dolzhenko - contributed _.tap, - similar to Ruby 1.9's, - which is handy for injecting side effects (like logging) into chained calls. -

        - -

        - 0.5.1
        - Added an _.isArguments function. Lots of little safety checks - and optimizations contributed by - Noah Sloan and - Andri Möll. -

        - -

        - 0.5.0
        - [API Changes] _.bindAll now takes the context object as - its first parameter. If no method names are passed, all of the context - object's methods are bound to it, enabling chaining and easier binding. - _.functions now takes a single argument and returns the names - of its Function properties. Calling _.functions(_) will get you - the previous behavior. - Added _.isRegExp so that isEqual can now test for RegExp equality. - All of the "is" functions have been shrunk down into a single definition. - Karl Guertin contributed patches. -

        - -

        - 0.4.7
        - Added isDate, isNaN, and isNull, for completeness. - Optimizations for isEqual when checking equality between Arrays - or Dates. _.keys is now 25%–2X faster (depending on your - browser) which speeds up the functions that rely on it, such as _.each. -

        - -

        - 0.4.6
        - Added the range function, a port of the - Python - function of the same name, for generating flexibly-numbered lists - of integers. Original patch contributed by - Kirill Ishanov. -

        - -

        - 0.4.5
        - Added rest for Arrays and arguments objects, and aliased - first as head, and rest as tail, - thanks to Luke Sutton's patches. - Added tests ensuring that all Underscore Array functions also work on - arguments objects. -

        - -

        - 0.4.4
        - Added isString, and isNumber, for consistency. Fixed - _.isEqual(NaN, NaN) to return true (which is debatable). -

        - -

        - 0.4.3
        - Started using the native StopIteration object in browsers that support it. - Fixed Underscore setup for CommonJS environments. -

        - -

        - 0.4.2
        - Renamed the unwrapping function to value, for clarity. -

        - -

        - 0.4.1
        - Chained Underscore objects now support the Array prototype methods, so - that you can perform the full range of operations on a wrapped array - without having to break your chain. Added a breakLoop method - to break in the middle of any Underscore iteration. Added an - isEmpty function that works on arrays and objects. -

        - -

        - 0.4.0
        - All Underscore functions can now be called in an object-oriented style, - like so: _([1, 2, 3]).map(...);. Original patch provided by - Marc-André Cournoyer. - Wrapped objects can be chained through multiple - method invocations. A functions method - was added, providing a sorted list of all the functions in Underscore. -

        - -

        - 0.3.3
        - Added the JavaScript 1.8 function reduceRight. Aliased it - as foldr, and aliased reduce as foldl. -

        - -

        - 0.3.2
        - Now runs on stock Rhino - interpreters with: load("underscore.js"). - Added identity as a utility function. -

        - -

        - 0.3.1
        - All iterators are now passed in the original collection as their third - argument, the same as JavaScript 1.6's forEach. Iterating over - objects is now called with (value, key, collection), for details - see _.each. -

        - -

        - 0.3.0
        - Added Dmitry Baranovskiy's - comprehensive optimizations, merged in - Kris Kowal's patches to make Underscore - CommonJS and - Narwhal compliant. -

        - -

        - 0.2.0
        - Added compose and lastIndexOf, renamed inject to - reduce, added aliases for inject, filter, - every, some, and forEach. -

        - -

        - 0.1.1
        - Added noConflict, so that the "Underscore" object can be assigned to - other variables. -

        - -

        - 0.1.0
        - Initial release of Underscore.js. -

        - -

        - - A DocumentCloud Project - -

        - -
        - -
        - - - - - - diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/index.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/package.json deleted file mode 100644 index 4c89a67..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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.x" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/underscore-min.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/underscore-min.js deleted file mode 100644 index c1d9d3a..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1 +0,0 @@ -(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/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/underscore.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/underscore.js deleted file mode 100644 index a12f0d9..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// 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/node_modules/grunt-contrib-jshint/node_modules/jshint/package.json b/node_modules/grunt-contrib-jshint/node_modules/jshint/package.json deleted file mode 100644 index 1e90b22..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "jshint", - "version": "2.1.11", - "homepage": "http://jshint.com/", - "description": "Static analysis tool for JavaScript", - "author": { - "name": "Anton Kovalyov", - "email": "anton@kovalyov.net", - "url": "http://anton.kovalyov.net/" - }, - "repository": { - "type": "git", - "url": "https://github.com/jshint/jshint.git" - }, - "bugs": { - "url": "https://github.com/jshint/jshint/issues" - }, - "bin": { - "jshint": "./bin/jshint" - }, - "scripts": { - "build": "node bin/build", - "test": "nodeunit tests tests/regression tests/unit", - "pretest": "jshint src" - }, - "main": "./src/jshint.js", - "dependencies": { - "shelljs": "0.1.x", - "underscore": "1.4.x", - "cli": "0.4.x", - "minimatch": "0.x.x", - "console-browserify": "0.1.x" - }, - "devDependencies": { - "jshint": "2.1.x", - "shelljs": "0.1.x", - "browserify": "2.12.x", - "coveraje": "0.2.x", - "nodeunit": "0.8.x", - "sinon": "1.7.x" - }, - "jshintConfig": { - "boss": true, - "node": true, - "strict": true, - "white": true, - "smarttabs": true, - "maxlen": 100, - "newcap": false, - "undef": true, - "unused": true, - "onecase": true, - "indent": 2 - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/jshint/jshint/blob/master/LICENSE" - } - ], - "preferGlobal": true, - "files": [ - "bin", - "src" - ], - "readme": "JSHint, A Static Code Analysis Tool for JavaScript\n--------------------------------------------------\n\n\\[ [Use it online](http://jshint.com/) • [About](http://jshint.com/about/) • \n[Docs](http://jshint.com/docs/) • [FAQ](http://jshint.com/docs/faq) • \n[Install](http://jshint.com/install/) • [Hack](http://jshint.com/hack/) • \n[Blog](http://jshint.com/blog/) • [Twitter](https://twitter.com/jshint/) \\]\n\n[![Build Status](https://travis-ci.org/jshint/jshint.png?branch=master)](https://travis-ci.org/jshint/jshint)\n[![NPM version](https://badge.fury.io/js/jshint.png)](http://badge.fury.io/js/jshint)\n\nJSHint is a community-driven tool to detect errors and potential problems\nin JavaScript code and to enforce your team’s coding conventions. It is\nvery flexible so you can easily adjust it to your particular coding guidelines\nand the environment you expect your code to execute in.\n\n#### Reporting a bug\n\nTo report a bug simply create a\n[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe\nyour problem or suggestion. We welcome all kind of feedback regarding\nJSHint including but not limited to:\n\n * When JSHint doesn't work as expected\n * When JSHint complains about valid JavaScript code that works in all browsers\n * When you simply want a new option or feature\n\nBefore reporting a bug look around to see if there are any open or closed tickets\nthat cover your issue. And remember the wisdom: pull request > bug report > tweet.\n\n\n#### License\n\nJSHint is distributed under the MIT License. One file and one file only\n(src/stable/jshint.js) is distributed under the slightly modified MIT License.\n\n\n#### Thank you!\n\nWe really appreciate all kind of feedback and contributions. Thanks for using and supporting JSHint!\n", - "readmeFilename": "README.md", - "_id": "jshint@2.1.11", - "_from": "jshint@~2.1.10" -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/cli.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/cli.js deleted file mode 100644 index d4fcd47..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/cli.js +++ /dev/null @@ -1,506 +0,0 @@ -"use strict"; - -var cli = require("cli"); -var path = require("path"); -var shjs = require("shelljs"); -var minimatch = require("minimatch"); -var JSHINT = require("./jshint.js").JSHINT; -var defReporter = require("./reporters/default").reporter; - -var OPTIONS = { - "config": ["c", "Custom configuration file", "string", false ], - "reporter": ["reporter", "Custom reporter (|jslint|checkstyle)", "string", undefined ], - "exclude": ["exclude", - "Exclude files matching the given filename pattern (same as .jshintignore)", "string", null], - "verbose": ["verbose", "Show message codes"], - "show-non-errors": ["show-non-errors", "Show additional data generated by jshint"], - "extra-ext": ["e", - "Comma-separated list of file extensions to use (default is .js)", "string", ""], - - // Deprecated options. - "jslint-reporter": [ - "jslint-reporter", - deprecated("Use a jslint compatible reporter", "--reporter=jslint") - ], - - "checkstyle-reporter": [ - "checkstyle-reporter", - deprecated("Use a CheckStyle compatible XML reporter", "--reporter=checkstyle") - ] -}; - -/** - * Returns the same text but with a deprecation notice. - * Useful for options descriptions. - * - * @param {string} text - * @param {string} alt (optional) Alternative command to include in the - * deprecation notice. - * - * @returns {string} - */ -function deprecated(text, alt) { - if (!alt) { - return text + " (DEPRECATED)"; - } - - return text + " (DEPRECATED, use " + alt + " instead)"; -} - -/** - * Removes JavaScript comments from a string by replacing - * everything between block comments and everything after - * single-line comments in a non-greedy way. - * - * English version of the regex: - * match '/*' - * then match zero or more instances of any character (incl. \n) - * except for instances of '* /' (without a space, obv.) - * then match '* /' (again, without a space) - * - * @param {string} str a string with potential JavaScript comments. - * @returns {string} a string without JavaScript comments. - */ -function removeComments(str) { - str = str || ""; - - str = str.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\//g, ""); - str = str.replace(/\/\/[^\n\r]*/g, ""); // Everything after '//' - - return str; -} - -/** - * Tries to find a configuration file in either project directory - * or in the home directory. Configuration files are named - * '.jshintrc'. - * - * @param {string} file path to the file to be linted - * @returns {string} a path to the config file - */ -function findConfig(file) { - var dir = path.dirname(path.resolve(file)); - var envs = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE; - var home = path.normalize(path.join(envs, ".jshintrc")); - - var proj = findFile(".jshintrc", dir); - if (proj) - return proj; - - if (shjs.test("-e", home)) - return home; - - return null; -} - -/** - * Tries to find JSHint configuration within a package.json file - * (if any). It search in the current directory and then goes up - * all the way to the root just like findFile. - * - * @param {string} file path to the file to be linted - * @returns {object} config object - */ -function loadNpmConfig(file) { - var dir = path.dirname(path.resolve(file)); - var fp = findFile("package.json", dir); - - if (!fp) - return null; - - return require(fp).jshintConfig || null; -} - -/** - * Tries to import a reporter file and returns its reference. - * - * @param {string} fp a path to the reporter file - * @returns {object} imported module for the reporter or 'null' - * if a module cannot be imported. - */ -function loadReporter(fp) { - try { - return require(fp).reporter; - } catch (err) { - return null; - } -} - -// Storage for memoized results from find file -// Should prevent lots of directory traversal & -// lookups when liniting an entire project -var findFileResults = {}; - -/** - * Searches for a file with a specified name starting with - * 'dir' and going all the way up either until it finds the file - * or hits the root. - * - * @param {string} name filename to search for (e.g. .jshintrc) - * @param {string} dir directory to start search from (default: - * current working directory) - * - * @returns {string} normalized filename - */ -function findFile(name, dir) { - dir = dir || process.cwd(); - - var filename = path.normalize(path.join(dir, name)); - if (findFileResults[filename] !== undefined) { - return findFileResults[filename]; - } - - var parent = path.resolve(dir, "../"); - - if (shjs.test("-e", filename)) { - findFileResults[filename] = filename; - return filename; - } - - if (dir === parent) { - findFileResults[filename] = null; - return null; - } - - return findFile(name, parent); -} - -/** - * Loads a list of files that have to be skipped. JSHint assumes that - * the list is located in a file called '.jshintignore'. - * - * @return {array} a list of files to ignore. - */ -function loadIgnores(exclude) { - var file = findFile(".jshintignore"); - - if (!file && !exclude) { - return []; - } - - var lines = (file ? shjs.cat(file) : "").split("\n"); - lines.unshift(exclude || ""); - - return lines - .filter(function (line) { - return !!line.trim(); - }) - .map(function (line) { - if (line[0] === "!") - return "!" + path.resolve(path.dirname(file), line.substr(1).trim()); - - return path.resolve(path.dirname(file), line.trim()); - }); -} - -/** - * Checks whether we should ignore a file or not. - * - * @param {string} fp a path to a file - * @param {array} patterns a list of patterns for files to ignore - * - * @return {boolean} 'true' if file should be ignored, 'false' otherwise. - */ -function isIgnored(fp, patterns) { - return patterns.some(function (ip) { - if (minimatch(path.resolve(fp), ip, { nocase: true })) { - return true; - } - - if (path.resolve(fp) === ip) { - return true; - } - - if (shjs.test("-d", fp) && ip.match(/^[^\/]*\/?$/) && - fp.match(new RegExp("^" + ip + ".*"))) { - return true; - } - }); -} - -/** - * Recursively gather all files that need to be linted, - * excluding those that user asked to ignore. - * - * @param {string} fp a path to a file or directory to lint - * @param {array} files a pointer to an array that stores a list of files - * @param {array} ignores a list of patterns for files to ignore - * @param {array} ext a list of non-dot-js extensions to lint - */ -function collect(fp, files, ignores, ext) { - if (ignores && isIgnored(fp, ignores)) { - return; - } - - if (!shjs.test("-e", fp)) { - cli.error("Can't open " + fp); - return; - } - - if (shjs.test("-d", fp)) { - shjs.ls(fp).forEach(function (item) { - var itempath = path.join(fp, item); - if (shjs.test("-d", itempath) || item.match(ext)) { - collect(itempath, files, ignores, ext); - } - }); - - return; - } - - files.push(fp); -} - -/** - * Runs JSHint against provided file and saves the result - * - * @param {string} code code that needs to be linted - * @param {object} results a pointer to an object with results - * @param {object} config an object with JSHint configuration - * @param {object} data a pointer to an object with extra data - * @param {string} file (optional) file name that is being linted - */ -function lint(code, results, config, data, file) { - var globals; - var lintData; - var buffer = []; - - config = config || {}; - config = JSON.parse(JSON.stringify(config)); - - if (config.prereq) { - config.prereq.forEach(function (fp) { - fp = path.join(config.dirname, fp); - if (shjs.test("-e", fp)) - buffer.push(shjs.cat(fp)); - }); - delete config.prereq; - } - - if (config.globals) { - globals = config.globals; - delete config.globals; - } - - delete config.dirname; - buffer.push(code); - buffer = buffer.join("\n"); - buffer = buffer.replace(/^\uFEFF/, ""); // Remove potential Unicode BOM. - - if (!JSHINT(buffer, config, globals)) { - JSHINT.errors.forEach(function (err) { - if (err) { - results.push({ file: file || "stdin", error: err }); - } - }); - } - - lintData = JSHINT.data(); - - if (lintData) { - lintData.file = file || "stdin"; - data.push(lintData); - } -} - -var exports = { - /** - * Loads and parses a configuration file. - * - * @param {string} fp a path to the config file - * @returns {object} config object - */ - loadConfig: function (fp) { - if (!fp) { - return {}; - } - - if (!shjs.test("-e", fp)) { - cli.error("Can't find config file: " + fp); - process.exit(1); - } - - try { - var config = JSON.parse(removeComments(shjs.cat(fp))); - config.dirname = path.dirname(fp); - return config; - } catch (err) { - cli.error("Can't parse config file: " + fp); - process.exit(1); - } - }, - - /** - * Gathers all files that need to be linted - * - * @param {object} post-processed options from 'interpret': - * args - CLI arguments - * ignores - A list of files/dirs to ignore (defaults to .jshintignores) - * extensions - A list of non-dot-js extensions to check - */ - gather: function (opts) { - var files = []; - - var reg = new RegExp("\\.(js" + - (!opts.extensions ? "" : "|" + - opts.extensions.replace(/,/g, "|").replace(/[\. ]/g, "")) + ")$"); - - var ignores = !opts.ignores ? loadIgnores() : opts.ignores.map(function (target) { - return path.resolve(target); - }); - - opts.args.forEach(function (target) { - collect(target, files, ignores, reg); - }); - - return files; - }, - - /** - * Gathers all files that need to be linted, lints them, sends them to - * a reporter and returns the overall result. - * - * @param {object} post-processed options from 'interpret': - * args - CLI arguments - * config - Configuration object - * reporter - Reporter function - * ignores - A list of files/dirs to ignore - * extensions - A list of non-dot-js extensions to check - * @param {function} cb a callback to call when function is finished - * asynchronously. - * - * @returns {bool} 'true' if all files passed, 'false' otherwise and 'null' - * when function will be finished asynchronously. - */ - run: function (opts, cb) { - var files = exports.gather(opts); - var results = []; - var data = []; - - if (opts.useStdin) { - cli.withStdin(function (code) { - lint(code, results, opts.config || {}, data); - (opts.reporter || defReporter)(results, data, { verbose: opts.verbose }); - cb(results.length === 0); - }); - - return null; - } - - files.forEach(function (file) { - var config = opts.config || loadNpmConfig(file) || exports.loadConfig(findConfig(file)); - var code; - - try { - code = shjs.cat(file); - } catch (err) { - cli.error("Can't open " + file); - process.exit(1); - } - - lint(code, results, config, data, file); - }); - - (opts.reporter || defReporter)(results, data, { verbose: opts.verbose }); - return results.length === 0; - }, - - /** - * Helper exposed for testing. - * Used to determine is stdout has any buffered output before exiting the program - */ - getBufferSize: function () { - return process.stdout.bufferSize; - }, - - /** - * Main entrance function. Parses arguments and calls 'run' when - * its done. This function is called from bin/jshint file. - * - * @param {object} args, arguments in the process.argv format. - */ - interpret: function (args) { - cli.setArgv(args); - cli.options = {}; - - cli.enable("version", "glob", "help"); - cli.setApp(path.resolve(__dirname + "/../package.json")); - - var options = cli.parse(OPTIONS); - // Use config file if specified - var config; - if (options.config) { - config = exports.loadConfig(options.config); - } - - switch (true) { - // JSLint reporter - case options.reporter === "jslint": - case options["jslint-reporter"]: - options.reporter = "./reporters/jslint_xml.js"; - break; - - // CheckStyle (XML) reporter - case options.reporter === "checkstyle": - case options["checkstyle-reporter"]: - options.reporter = "./reporters/checkstyle.js"; - break; - - // Reporter that displays additional JSHint data - case options["show-non-errors"]: - options.reporter = "./reporters/non_error.js"; - break; - - // Custom reporter - case options.reporter !== undefined: - options.reporter = path.resolve(process.cwd(), options.reporter); - } - - var reporter; - if (options.reporter) { - reporter = loadReporter(options.reporter); - - if (reporter === null) { - cli.error("Can't load reporter file: " + options.reporter); - process.exit(1); - } - } - - // This is a hack. exports.run is both sync and async function - // because I needed stdin support (and cli.withStdin is async) - // and was too lazy to change tests. - - function done(passed) { - /*jshint eqnull:true */ - - if (passed == null) - return; - - // Patch as per https://github.com/visionmedia/mocha/issues/333 - // fixes issues with piped output on Windows. - // Root issue is here https://github.com/joyent/node/issues/3584 - function exit() { process.exit(passed ? 0 : 2); } - try { - if (exports.getBufferSize()) { - process.stdout.once('drain', exit); - } else { - exit(); - } - } catch (err) { - exit(); - } - } - - done(exports.run({ - args: cli.args, - config: config, - reporter: reporter, - ignores: loadIgnores(options.exclude), - extensions: options["extra-ext"], - verbose: options.verbose, - useStdin: {"-": true, "/dev/stdin": true}[args[args.length - 1]] - }, done)); - } -}; - -module.exports = exports; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/jshint.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/jshint.js deleted file mode 100644 index 37ff87c..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/jshint.js +++ /dev/null @@ -1,4872 +0,0 @@ -/*! - * JSHint, by JSHint Community. - * - * This file (and this file only) is licensed under the same slightly modified - * MIT license that JSLint is. It stops evil-doers everywhere: - * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.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 shall be used for Good, not Evil. - * - * 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. - * - */ - -/*jshint quotmark:double */ -/*global console:true */ -/*exported console */ - -var _ = require("underscore"); -var events = require("events"); -var vars = require("./vars.js"); -var messages = require("./messages.js"); -var Lexer = require("./lex.js").Lexer; -var reg = require("./reg.js"); -var state = require("./state.js").state; -var style = require("./style.js"); - -// We need this module here because environments such as IE and Rhino -// don't necessarilly expose the 'console' API and browserify uses -// it to log things. It's a sad state of affair, really. -var console = require("console-browserify"); - -// We build the application inside a function so that we produce only a singleton -// variable. That function will be invoked immediately, and its return value is -// the JSHINT function itself. - -var JSHINT = (function () { - "use strict"; - - var anonname, // The guessed name for anonymous functions. - api, // Extension API - - // These are operators that should not be used with the ! operator. - bang = { - "<" : true, - "<=" : true, - "==" : true, - "===": true, - "!==": true, - "!=" : true, - ">" : true, - ">=" : true, - "+" : true, - "-" : true, - "*" : true, - "/" : true, - "%" : true - }, - - // These are the JSHint boolean options. - boolOptions = { - asi : true, // if automatic semicolon insertion should be tolerated - bitwise : true, // if bitwise operators should not be allowed - boss : true, // if advanced usage of assignments should be allowed - browser : true, // if the standard browser globals should be predefined - camelcase : true, // if identifiers should be required in camel case - couch : true, // if CouchDB globals should be predefined - curly : true, // if curly braces around all blocks should be required - debug : true, // if debugger statements should be allowed - devel : true, // if logging globals should be predefined (console, alert, etc.) - dojo : true, // if Dojo Toolkit globals should be predefined - eqeqeq : true, // if === should be required - eqnull : true, // if == null comparisons should be tolerated - es3 : true, // if ES3 syntax should be allowed - es5 : true, // if ES5 syntax should be allowed (is now set per default) - esnext : true, // if es.next specific syntax should be allowed - moz : true, // if mozilla specific syntax should be allowed - evil : true, // if eval should be allowed - expr : true, // if ExpressionStatement should be allowed as Programs - forin : true, // if for in statements must filter - funcscope : true, // if only function scope should be used for scope tests - gcl : true, // if JSHint should be compatible with Google Closure Linter - globalstrict: true, // if global "use strict"; should be allowed (also enables 'strict') - immed : true, // if immediate invocations must be wrapped in parens - iterator : true, // if the `__iterator__` property should be allowed - jquery : true, // if jQuery globals should be predefined - lastsemic : true, // if semicolons may be ommitted for the trailing - // statements inside of a one-line blocks. - laxbreak : true, // if line breaks should not be checked - laxcomma : true, // if line breaks should not be checked around commas - loopfunc : true, // if functions should be allowed to be defined within - // loops - mootools : true, // if MooTools globals should be predefined - multistr : true, // allow multiline strings - newcap : true, // if constructor names must be capitalized - noarg : true, // if arguments.caller and arguments.callee should be - // disallowed - node : true, // if the Node.js environment globals should be - // predefined - noempty : true, // if empty blocks should be disallowed - nonew : true, // if using `new` for side-effects should be disallowed - nonstandard : true, // if non-standard (but widely adopted) globals should - // be predefined - nomen : true, // if names should be checked - onevar : true, // if only one var statement per function should be - // allowed - passfail : true, // if the scan should stop on first error - phantom : true, // if PhantomJS symbols should be allowed - plusplus : true, // if increment/decrement should not be allowed - proto : true, // if the `__proto__` property should be allowed - prototypejs : true, // if Prototype and Scriptaculous globals should be - // predefined - rhino : true, // if the Rhino environment globals should be predefined - shelljs : true, // if ShellJS globals should be predefined - typed : true, // if typed array globals should be predefined - undef : true, // if variables should be declared before used - scripturl : true, // if script-targeted URLs should be tolerated - shadow : true, // if variable shadowing should be tolerated - smarttabs : true, // if smarttabs should be tolerated - // (http://www.emacswiki.org/emacs/SmartTabs) - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - supernew : true, // if `new function () { ... };` and `new Object;` - // should be tolerated - trailing : true, // if trailing whitespace rules apply - validthis : true, // if 'this' inside a non-constructor function is valid. - // This is a function scoped option only. - withstmt : true, // if with statements should be allowed - white : true, // if strict whitespace rules apply - worker : true, // if Web Worker script symbols should be allowed - wsh : true, // if the Windows Scripting Host environment globals - // should be predefined - yui : true, // YUI variables should be predefined - - // Obsolete options - onecase : true, // if one case switch statements should be allowed - regexp : true, // if the . should not be allowed in regexp literals - regexdash : true // if unescaped first/last dash (-) inside brackets - // should be tolerated - }, - - // These are the JSHint options that can take any value - // (we use this object to detect invalid options) - valOptions = { - maxlen : false, - indent : false, - maxerr : false, - predef : false, - quotmark : false, //'single'|'double'|true - scope : false, - maxstatements: false, // {int} max statements per function - maxdepth : false, // {int} max nested block depth per function - maxparams : false, // {int} max params per function - maxcomplexity: false, // {int} max cyclomatic complexity per function - unused : true, // warn if variables are unused. Available options: - // false - don't check for unused variables - // true - "vars" + check last function param - // "vars" - skip checking unused function params - // "strict" - "vars" + check all function params - latedef : false // warn if the variable is used before its definition - // false - don't emit any warnings - // true - warn if any variable is used before its definition - // "nofunc" - warn for any variable but function declarations - }, - - // These are JSHint boolean options which are shared with JSLint - // where the definition in JSHint is opposite JSLint - invertedOptions = { - bitwise : true, - forin : true, - newcap : true, - nomen : true, - plusplus: true, - regexp : true, - undef : true, - white : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - onevar : true, - strict : true - }, - - // These are JSHint boolean options which are shared with JSLint - // where the name has been changed but the effect is unchanged - renamedOptions = { - eqeq : "eqeqeq", - vars : "onevar", - windows: "wsh", - sloppy : "strict" - }, - - declared, // Globals that were declared using /*global ... */ syntax. - exported, // Variables that are used outside of the current file. - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - funct, // The current function - functions, // All of the functions - - global, // The global scope - implied, // Implied globals - inblock, - indent, - lookahead, - lex, - member, - membersOnly, - noreach, - predefined, // Global variables defined by option - - scope, // The current scope - stack, - unuseds, - urls, - warnings, - - extraModules = [], - emitter = new events.EventEmitter(); - - function checkOption(name, t) { - name = name.trim(); - - if (/^[+-]W\d{3}$/g.test(name)) { - return true; - } - - if (valOptions[name] === undefined && boolOptions[name] === undefined) { - if (t.type !== "jslint") { - error("E001", t, name); - return false; - } - } - - return true; - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - function isIdentifier(tkn, value) { - if (!tkn) - return false; - - if (!tkn.identifier || tkn.value !== value) - return false; - - return true; - } - - function isReserved(token) { - if (!token.reserved) { - return false; - } - var meta = token.meta; - - if (meta && meta.isFutureReservedWord && state.option.inES5()) { - // ES3 FutureReservedWord in an ES5 environment. - if (!meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (token.isProperty) { - return false; - } - } - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(t, o) { - var n; - for (n in o) { - if (_.has(o, n) && !_.has(JSHINT.blacklist, n)) { - t[n] = o[n]; - } - } - } - - function updatePredefined() { - Object.keys(JSHINT.blacklist).forEach(function (key) { - delete predefined[key]; - }); - } - - function assume() { - if (state.option.es5) { - warning("I003"); - } - if (state.option.couch) { - combine(predefined, vars.couch); - } - - if (state.option.rhino) { - combine(predefined, vars.rhino); - } - - if (state.option.shelljs) { - combine(predefined, vars.shelljs); - combine(predefined, vars.node); - } - if (state.option.typed) { - combine(predefined, vars.typed); - } - - if (state.option.phantom) { - combine(predefined, vars.phantom); - } - - if (state.option.prototypejs) { - combine(predefined, vars.prototypejs); - } - - if (state.option.node) { - combine(predefined, vars.node); - combine(predefined, vars.typed); - } - - if (state.option.devel) { - combine(predefined, vars.devel); - } - - if (state.option.dojo) { - combine(predefined, vars.dojo); - } - - if (state.option.browser) { - combine(predefined, vars.browser); - combine(predefined, vars.typed); - } - - if (state.option.nonstandard) { - combine(predefined, vars.nonstandard); - } - - if (state.option.jquery) { - combine(predefined, vars.jquery); - } - - if (state.option.mootools) { - combine(predefined, vars.mootools); - } - - if (state.option.worker) { - combine(predefined, vars.worker); - } - - if (state.option.wsh) { - combine(predefined, vars.wsh); - } - - if (state.option.globalstrict && state.option.strict !== false) { - state.option.strict = true; - } - - if (state.option.yui) { - combine(predefined, vars.yui); - } - - // Let's assume that chronologically ES3 < ES5 < ES6/ESNext < Moz - - state.option.inMoz = function (strict) { - if (strict) { - return state.option.moz && !state.option.esnext; - } - return state.option.moz; - }; - - state.option.inESNext = function (strict) { - if (strict) { - return !state.option.moz && state.option.esnext; - } - return state.option.moz || state.option.esnext; - }; - - state.option.inES5 = function (/* strict */) { - return !state.option.es3; - }; - - state.option.inES3 = function (strict) { - if (strict) { - return !state.option.moz && !state.option.esnext && state.option.es3; - } - return state.option.es3; - }; - } - - // Produce an error warning. - function quit(code, line, chr) { - var percentage = Math.floor((line / state.lines.length) * 100); - var message = messages.errors[code].desc; - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message, - code: code - }; - } - - function isundef(scope, code, token, a) { - return JSHINT.undefs.push([scope, code, token, a]); - } - - function warning(code, t, a, b, c, d) { - var ch, l, w, msg; - - if (/^W\d{3}$/.test(code)) { - if (state.ignored[code]) - return; - - msg = messages.warnings[code]; - } else if (/E\d{3}/.test(code)) { - msg = messages.errors[code]; - } else if (/I\d{3}/.test(code)) { - msg = messages.info[code]; - } - - t = t || state.tokens.next; - if (t.id === "(end)") { // `~ - t = state.tokens.curr; - } - - l = t.line || 0; - ch = t.from || 0; - - w = { - id: "(error)", - raw: msg.desc, - code: msg.code, - evidence: state.lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - - w.reason = supplant(msg.desc, w); - JSHINT.errors.push(w); - - if (state.option.passfail) { - quit("E042", l, ch); - } - - warnings += 1; - if (warnings >= state.option.maxerr) { - quit("E043", l, ch); - } - - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - warning(m, t, a, b, c, d); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - function addlabel(t, type, tkn, islet) { - // Define t in the current function in the current scope. - if (type === "exception") { - if (_.has(funct["(context)"], t)) { - if (funct[t] !== true && !state.option.node) { - warning("W002", state.tokens.next, t); - } - } - } - - if (_.has(funct, t) && !funct["(global)"]) { - if (funct[t] === true) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - } else { - if (!state.option.shadow && type !== "exception" || - (funct["(blockscope)"].getlabel(t))) { - warning("W004", state.tokens.next, t); - } - } - } - - // a double definition of a let variable in same block throws a TypeError - if (funct["(blockscope)"] && funct["(blockscope)"].current.has(t)) { - error("E044", state.tokens.next, t); - } - - // if the identifier is from a let, adds it only to the current blockscope - if (islet) { - funct["(blockscope)"].current.add(t, type, state.tokens.curr); - } else { - - funct[t] = type; - - if (tkn) { - funct["(tokens)"][t] = tkn; - } - - if (funct["(global)"]) { - global[t] = funct; - if (_.has(implied, t)) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[t], type], "unction")) || - !_.contains([funct[t], type], "unction")) { - warning("W003", state.tokens.next, t); - } - } - - delete implied[t]; - } - } else { - scope[t] = funct; - } - } - } - - function doOption() { - var nt = state.tokens.next; - var body = nt.body.split(",").map(function (s) { return s.trim(); }); - var predef = {}; - - if (nt.type === "globals") { - body.forEach(function (g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (key.charAt(0) === "-") { - key = key.slice(1); - val = false; - - JSHINT.blacklist[key] = key; - updatePredefined(); - } else { - predef[key] = (val === "true"); - } - }); - - combine(predefined, predef); - - for (var key in predef) { - if (_.has(predef, key)) { - declared[key] = nt; - } - } - } - - if (nt.type === "exported") { - body.forEach(function (e) { - exported[e] = true; - }); - } - - if (nt.type === "members") { - membersOnly = membersOnly || {}; - - body.forEach(function (m) { - var ch1 = m.charAt(0); - var ch2 = m.charAt(m.length - 1); - - if (ch1 === ch2 && (ch1 === "\"" || ch1 === "'")) { - m = m - .substr(1, m.length - 2) - .replace("\\b", "\b") - .replace("\\t", "\t") - .replace("\\n", "\n") - .replace("\\v", "\v") - .replace("\\f", "\f") - .replace("\\r", "\r") - .replace("\\\\", "\\") - .replace("\\\"", "\""); - } - - membersOnly[m] = false; - }); - } - - var numvals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (nt.type === "jshint" || nt.type === "jslint") { - body.forEach(function (g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (!checkOption(key, nt)) { - return; - } - - if (numvals.indexOf(key) >= 0) { - - // GH988 - numeric options can be disabled by setting them to `false` - if (val !== "false") { - val = +val; - - if (typeof val !== "number" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) { - error("E032", nt, g[1].trim()); - return; - } - - if (key === "indent") { - state.option["(explicitIndent)"] = true; - } - state.option[key] = val; - } else { - if (key === "indent") { - state.option["(explicitIndent)"] = false; - } else { - state.option[key] = false; - } - } - - return; - } - - if (key === "validthis") { - // `validthis` is valid only within a function scope. - if (funct["(global)"]) { - error("E009"); - } else { - if (val === "true" || val === "false") { - state.option.validthis = (val === "true"); - } else { - error("E002", nt); - } - } - return; - } - - if (key === "quotmark") { - switch (val) { - case "true": - case "false": - state.option.quotmark = (val === "true"); - break; - case "double": - case "single": - state.option.quotmark = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "unused") { - switch (val) { - case "true": - state.option.unused = true; - break; - case "false": - state.option.unused = false; - break; - case "vars": - case "strict": - state.option.unused = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "latedef") { - switch (val) { - case "true": - state.option.latedef = true; - break; - case "false": - state.option.latedef = false; - break; - case "nofunc": - state.option.latedef = "nofunc"; - break; - default: - error("E002", nt); - } - return; - } - - var match = /^([+-])(W\d{3})$/g.exec(key); - if (match) { - // ignore for -W..., unignore for +W... - state.ignored[match[2]] = (match[1] === "-"); - return; - } - - var tn; - if (val === "true" || val === "false") { - if (nt.type === "jslint") { - tn = renamedOptions[key] || key; - state.option[tn] = (val === "true"); - - if (invertedOptions[tn] !== undefined) { - state.option[tn] = !state.option[tn]; - } - } else { - state.option[key] = (val === "true"); - } - - if (key === "newcap") { - state.option["(explicitNewcap)"] = true; - } - return; - } - - error("E002", nt); - }); - - assume(); - } - } - - // We need a peek function. If it has an argument, it peeks that much farther - // ahead. It is used to distinguish - // for ( var i in ... - // from - // for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - // Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (state.tokens.curr.id) { - case "(number)": - if (state.tokens.next.id === ".") { - warning("W005", state.tokens.curr); - } - break; - case "-": - if (state.tokens.next.id === "-" || state.tokens.next.id === "--") { - warning("W006"); - } - break; - case "+": - if (state.tokens.next.id === "+" || state.tokens.next.id === "++") { - warning("W007"); - } - break; - } - - if (state.tokens.curr.type === "(string)" || state.tokens.curr.identifier) { - anonname = state.tokens.curr.value; - } - - if (id && state.tokens.next.id !== id) { - if (t) { - if (state.tokens.next.id === "(end)") { - error("E019", t, t.id); - } else { - error("E020", state.tokens.next, id, t.id, t.line, state.tokens.next.value); - } - } else if (state.tokens.next.type !== "(identifier)" || state.tokens.next.value !== id) { - warning("W116", state.tokens.next, id, state.tokens.next.value); - } - } - - state.tokens.prev = state.tokens.curr; - state.tokens.curr = state.tokens.next; - for (;;) { - state.tokens.next = lookahead.shift() || lex.token(); - - if (!state.tokens.next) { // No more tokens left, give up - quit("E041", state.tokens.curr.line); - } - - if (state.tokens.next.id === "(end)" || state.tokens.next.id === "(error)") { - return; - } - - if (state.tokens.next.check) { - state.tokens.next.check(); - } - - if (state.tokens.next.isSpecial) { - doOption(); - } else { - if (state.tokens.next.id !== "(endline)") { - break; - } - } - } - } - - function isInfix(token) { - return token.infix || (!token.identifier && !!token.led); - } - - function isEndOfExpr() { - var curr = state.tokens.curr; - var next = state.tokens.next; - if (next.id === ";" || next.id === "}" || next.id === ":") { - return true; - } - if (isInfix(next) === isInfix(curr) || (curr.id === "yield" && state.option.inMoz(true))) { - return curr.line !== next.line; - } - return false; - } - - // This is the heart of JSHINT, the Pratt parser. In addition to parsing, it - // is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is - // like .nud except that it is only used on the first token of a statement. - // Having .fud makes it much easier to define statement-oriented languages like - // JavaScript. I retained Pratt's nomenclature. - - // .nud Null denotation - // .fud First null denotation - // .led Left denotation - // lbp Left binding power - // rbp Right binding power - - // They are elements of the parsing method called Top Down Operator Precedence. - - function expression(rbp, initial) { - var left, isArray = false, isObject = false, isLetExpr = false; - - // if current expression is a let expression - if (!initial && state.tokens.next.value === "let" && peek(0).value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let expressions"); - } - isLetExpr = true; - // create a new block scope we use only for the current expression - funct["(blockscope)"].stack(); - advance("let"); - advance("("); - state.syntax["let"].fud.call(state.syntax["let"].fud, false); - advance(")"); - } - - if (state.tokens.next.id === "(end)") - error("E006", state.tokens.curr); - - advance(); - - if (initial) { - anonname = "anonymous"; - funct["(verb)"] = state.tokens.curr.value; - } - - if (initial === true && state.tokens.curr.fud) { - left = state.tokens.curr.fud(); - } else { - if (state.tokens.curr.nud) { - left = state.tokens.curr.nud(); - } else { - error("E030", state.tokens.curr, state.tokens.curr.id); - } - - while (rbp < state.tokens.next.lbp && !isEndOfExpr()) { - isArray = state.tokens.curr.value === "Array"; - isObject = state.tokens.curr.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and state.tokens.curr.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== state.tokens.curr.value) { - isObject = false; - } - } - } - - advance(); - - if (isArray && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W009", state.tokens.curr); - } - - if (isObject && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W010", state.tokens.curr); - } - - if (left && state.tokens.curr.led) { - left = state.tokens.curr.led(left); - } else { - error("E033", state.tokens.curr, state.tokens.curr.id); - } - } - } - if (isLetExpr) { - funct["(blockscope)"].unstack(); - } - return left; - } - - -// Functions for conformance of style. - - function adjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white) { - if (left.character !== right.from && left.line === right.line) { - left.from += (left.character - left.from); - warning("W011", left, left.value); - } - } - } - - function nobreak(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && (left.character !== right.from || left.line !== right.line)) { - warning("W012", right, right.value); - } - } - - function nospace(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (state.option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - function nonadjacent(left, right) { - if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - - if (left.value === ";" && right.value === ";") { - return; - } - - if (left.line === right.line && left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (!state.option.laxbreak && left.line !== right.line) { - warning("W014", right, right.value); - } else if (state.option.white) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (left.character === right.from) { - left.from += (left.character - left.from); - warning("W013", left, left.value); - } - } - } - - function indentation(bias) { - if (!state.option.white && !state.option["(explicitIndent)"]) { - return; - } - - if (state.tokens.next.id === "(end)") { - return; - } - - var i = indent + (bias || 0); - if (state.tokens.next.from !== i) { - warning("W015", state.tokens.next, state.tokens.next.value, i, state.tokens.next.from); - } - } - - function nolinebreak(t) { - t = t || state.tokens.curr; - if (t.line !== state.tokens.next.line) { - warning("E022", t, t.value); - } - } - - function nobreakcomma(left, right) { - if (left.line !== right.line) { - if (!state.option.laxcomma) { - if (comma.first) { - warning("I001"); - comma.first = false; - } - warning("W014", left, right.value); - } - } else if (!left.comment && left.character !== right.from && state.option.white) { - left.from += (left.character - left.from); - warning("W011", left, left.value); - } - } - - function comma(opts) { - opts = opts || {}; - - if (!opts.peek) { - nobreakcomma(state.tokens.curr, state.tokens.next); - advance(","); - } else { - nobreakcomma(state.tokens.prev, state.tokens.curr); - } - - // TODO: This is a temporary solution to fight against false-positives in - // arrays and objects with trailing commas (see GH-363). The best solution - // would be to extract all whitespace rules out of parser. - - if (state.tokens.next.value !== "]" && state.tokens.next.value !== "}") { - nonadjacent(state.tokens.curr, state.tokens.next); - } - - if (state.tokens.next.identifier && !(opts.property && state.option.inES5())) { - // Keywords that cannot follow a comma operator. - switch (state.tokens.next.value) { - case "break": - case "case": - case "catch": - case "continue": - case "default": - case "do": - case "else": - case "finally": - case "for": - case "if": - case "in": - case "instanceof": - case "return": - case "switch": - case "throw": - case "try": - case "var": - case "let": - case "while": - case "with": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - - if (state.tokens.next.type === "(punctuator)") { - switch (state.tokens.next.value) { - case "}": - case "]": - case ",": - if (opts.allowTrailing) { - return true; - } - - /* falls through */ - case ")": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - return true; - } - - // Functional constructors for making the symbols that will be inherited by - // tokens. - - function symbol(s, p) { - var x = state.syntax[s]; - if (!x || typeof x !== "object") { - state.syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - function delim(s) { - return symbol(s, 0); - } - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= "a" && c <= "z") || (c >= "A" && c <= "Z")) { - x.identifier = x.reserved = true; - } - return x; - } - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === "function") ? f : function () { - this.right = expression(150); - this.arity = "unary"; - if (this.id === "++" || this.id === "--") { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!this.right.identifier || isReserved(this.right)) && - this.right.id !== "." && this.right.id !== "[") { - warning("W017", this); - } - } - return this; - }; - return x; - } - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - function reserve(name, func) { - var x = type(name, func); - x.identifier = true; - x.reserved = true; - return x; - } - - function FutureReservedWord(name, meta) { - var x = type(name, (meta && meta.nud) || function () { - return this; - }); - - meta = meta || {}; - meta.isFutureReservedWord = true; - - x.value = name; - x.identifier = true; - x.reserved = true; - x.meta = meta; - - return x; - } - - function reservevar(s, v) { - return reserve(s, function () { - if (typeof v === "function") { - v(this); - } - return this; - }); - } - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.infix = true; - x.led = function (left) { - if (!w) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - } - if (s === "in" && left.id === "!") { - warning("W018", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - - function application(s) { - var x = symbol(s, 42); - - x.led = function (left) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "arrow function syntax (=>)"); - } - - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - - this.left = left; - this.right = doFunction(undefined, undefined, false, left); - return this; - }; - return x; - } - - function relation(s, f) { - var x = symbol(s, 100); - - x.led = function (left) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("W019", this); - } else if (f) { - f.apply(this, [left, right]); - } - - if (!left || !right) { - quit("E041", state.tokens.curr.line); - } - - if (left.id === "!") { - warning("W018", left, "!"); - } - - if (right.id === "!") { - warning("W018", right, "!"); - } - - this.left = left; - this.right = right; - return this; - }; - return x; - } - - function isPoorRelation(node) { - return node && - ((node.type === "(number)" && +node.value === 0) || - (node.type === "(string)" && node.value === "") || - (node.type === "null" && !state.option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - function assignop(s, f, p) { - var x = infix(s, typeof f === "function" ? f : function (left, that) { - that.left = left; - - if (left) { - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("W020", left); - } else if (left["function"]) { - warning("W021", left, left.value); - } - - if (funct[left.value] === "const") { - error("E013", left, left.value); - } - - if (left.id === ".") { - if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - - that.right = expression(10); - return that; - } else if (left.id === "[") { - if (state.tokens.curr.left.first) { - state.tokens.curr.left.first.forEach(function (t) { - if (funct[t.value] === "const") { - error("E013", t, t.value); - } - }); - } else if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - that.right = expression(10); - return that; - } else if (left.identifier && !isReserved(left)) { - if (funct[left.value] === "exception") { - warning("W022", left); - } - that.right = expression(10); - return that; - } - - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - } - - error("E031", that); - }, p); - - x.exps = true; - x.assign = true; - return x; - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function (left) { - if (state.option.bitwise) { - warning("W016", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - return assignop(s, function (left, that) { - if (state.option.bitwise) { - warning("W016", that, that.id); - } - nonadjacent(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !isReserved(left))) { - expression(10); - return that; - } - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - return that; - } - error("E031", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - - x.led = function (left) { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!left.identifier || isReserved(left)) && left.id !== "." && left.id !== "[") { - warning("W017", this); - } - - this.left = left; - return this; - }; - return x; - } - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - // prop means that this identifier is that of an object property - - function optionalidentifier(fnparam, prop) { - if (!state.tokens.next.identifier) { - return; - } - - advance(); - - var curr = state.tokens.curr; - var val = state.tokens.curr.value; - - if (!isReserved(curr)) { - return val; - } - - if (prop) { - if (state.option.inES5()) { - return val; - } - } - - if (fnparam && val === "undefined") { - return val; - } - - // Display an info message about reserved words as properties - // and ES5 but do it only once. - if (prop && !api.getCache("displayed:I002")) { - api.setCache("displayed:I002", true); - warning("I002"); - } - - warning("W024", state.tokens.curr, state.tokens.curr.id); - return val; - } - - // fnparam means that this identifier is being defined as a function - // argument - // prop means that this identifier is that of an object property - function identifier(fnparam, prop) { - var i = optionalidentifier(fnparam, prop); - if (i) { - return i; - } - if (state.tokens.curr.id === "function" && state.tokens.next.id === "(") { - warning("W025"); - } else { - error("E030", state.tokens.next, state.tokens.next.value); - } - } - - - function reachable(s) { - var i = 0, t; - if (state.tokens.next.id !== ";" || noreach) { - return; - } - for (;;) { - do { - t = peek(i); - i += 1; - } while (t.id != "(end)" && t.id === "(comment)"); - - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (!state.option.latedef) { - break; - } - - warning("W026", t); - break; - } - - warning("W027", t, t.value, s); - break; - } - } - } - - - function statement(noindent) { - var values; - var i = indent, r, s = scope, t = state.tokens.next; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - var res = isReserved(t); - - // We're being more tolerant here: if someone uses - // a FutureReservedWord as a label, we warn but proceed - // anyway. - - if (res && t.meta && t.meta.isFutureReservedWord && peek().id === ":") { - warning("W024", t, t.id); - res = false; - } - - // detect a destructuring assignment - if (_.has(["[", "{"], t.value)) { - if (lookupBlockType().isDestAssign) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - values = destructuringExpression(); - values.forEach(function (tok) { - isundef(funct, "W117", tok.token, tok.id); - }); - advance("="); - destructuringExpressionMatch(values, expression(10, true)); - advance(";"); - return; - } - } - if (t.identifier && !res && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, "label"); - - if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { - warning("W028", state.tokens.next, t.value, state.tokens.next.value); - } - - state.tokens.next.label = t.value; - t = state.tokens.next; - } - - // Is it a lonely block? - - if (t.id === "{") { - block(true, true); - return; - } - - // Parse the statement. - - if (!noindent) { - indentation(); - } - r = expression(0, true); - - // Look for the final semicolon. - - if (!t.block) { - if (!state.option.expr && (!r || !r.exps)) { - warning("W030", state.tokens.curr); - } else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") { - warning("W031", t); - } - - if (state.tokens.next.id !== ";") { - if (!state.option.asi) { - // If this is the last statement in a block that ends on - // the same line *and* option lastsemic is on, ignore the warning. - // Otherwise, complain about missing semicolon. - if (!state.option.lastsemic || state.tokens.next.id !== "}" || - state.tokens.next.line !== state.tokens.curr.line) { - warningAt("W033", state.tokens.curr.line, state.tokens.curr.character); - } - } - } else { - adjacent(state.tokens.curr, state.tokens.next); - advance(";"); - nonadjacent(state.tokens.curr, state.tokens.next); - } - } - - // Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements(startLine) { - var a = [], p; - - while (!state.tokens.next.reach && state.tokens.next.id !== "(end)") { - if (state.tokens.next.id === ";") { - p = peek(); - - if (!p || (p.id !== "(" && p.id !== "[")) { - warning("W032"); - } - - advance(";"); - } else { - a.push(statement(startLine === state.tokens.next.line)); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - for (;;) { - if (state.tokens.next.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i); - i = i + 1; - } while (pn.id === "(endline)"); - - if (pn.id !== ";") { - if (pn.id !== "(string)" && pn.id !== "(number)" && - pn.id !== "(regexp)" && pn.identifier !== true && - pn.id !== "}") { - break; - } - warning("W033", state.tokens.next); - } else { - p = pn; - } - } else if (p.id === "}") { - // Directive with no other statements, warn about missing semicolon - warning("W033", p); - } else if (p.id !== ";") { - break; - } - - indentation(); - advance(); - if (state.directive[state.tokens.curr.value]) { - warning("W034", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.curr.value === "use strict") { - if (!state.option["(explicitNewcap)"]) - state.option.newcap = true; - state.option.undef = true; - } - - // there's no directive negation, so always set to true - state.directive[state.tokens.curr.value] = true; - - if (p.id === ";") { - advance(";"); - } - continue; - } - break; - } - } - - - /* - * Parses a single block. A block is a sequence of statements wrapped in - * braces. - * - * ordinary - true for everything but function bodies and try blocks. - * stmt - true if block can be a single statement (e.g. in if/for/while). - * isfunc - true if block is a function body - */ - function block(ordinary, stmt, isfunc, isfatarrow) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !state.option.funcscope) - scope = Object.create(scope); - - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (state.tokens.next.id === "{") { - advance("{"); - - // create a new block scope - funct["(blockscope)"].stack(); - - line = state.tokens.curr.line; - if (state.tokens.next.id !== "}") { - indent += state.option.indent; - while (!ordinary && state.tokens.next.from > indent) { - indent += state.option.indent; - } - - if (isfunc) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - directives(); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } - - a = statements(line); - - metrics.statementCount += a.length; - - if (isfunc) { - state.directive = m; - } - - indent -= state.option.indent; - if (line !== state.tokens.next.line) { - indentation(); - } - } else if (line !== state.tokens.next.line) { - indentation(); - } - advance("}", t); - - funct["(blockscope)"].unstack(); - - indent = old_indent; - } else if (!ordinary) { - if (isfunc) { - m = {}; - if (stmt && !isfatarrow && !state.option.inMoz(true)) { - error("W118", state.tokens.curr, "function closure expressions"); - } - - if (!stmt) { - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - } - expression(10); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } else { - error("E021", state.tokens.next, "{", state.tokens.next.value); - } - } else { - - // check to avoid let declaration not within a block - funct["(nolet)"] = true; - - if (!stmt || state.option.curly) { - warning("W116", state.tokens.next, "{", state.tokens.next.value); - } - - noreach = true; - indent += state.option.indent; - // test indentation only if statement is in new line - a = [statement(state.tokens.next.line === state.tokens.curr.line)]; - indent -= state.option.indent; - noreach = false; - - delete funct["(nolet)"]; - } - funct["(verb)"] = null; - if (!ordinary || !state.option.funcscope) scope = s; - inblock = b; - if (ordinary && state.option.noempty && (!a || a.length === 0)) { - warning("W035"); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("W036", state.tokens.curr, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(tkn) { - var name = tkn.value, line = tkn.line, a = implied[name]; - if (typeof a === "function") { - a = false; - } - - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function () { - return this; - }); - - type("(string)", function () { - return this; - }); - - state.syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v], - f; - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, "var"); - s = funct; - funct = f; - } - var block; - if (_.has(funct, "(blockscope)")) { - block = funct["(blockscope)"].getlabel(v); - } - - // The name is in scope and defined in the current function. - if (funct === s || block) { - // Change 'unused' to 'var', and reject labels. - // the name is in a block scope - switch (block ? block[v]["(type)"] : funct[v]) { - case "unused": - if (block) block[v]["(type)"] = "var"; - else funct[v] = "var"; - break; - case "unction": - if (block) block[v]["(type)"] = "function"; - else funct[v] = "function"; - this["function"] = true; - break; - case "function": - this["function"] = true; - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - } - } else if (funct["(global)"]) { - // The name is not defined in the function. If we are in the global - // scope, then we have an undefined variable. - // - // Operators typeof and delete do not raise runtime errors even if - // the base object of a reference is null so no need to display warning - // if we're inside of typeof or delete. - - if (typeof predefined[v] !== "boolean") { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && (state.tokens.next.value === "." || - state.tokens.next.value === "["))) { - - // if we're in a list comprehension, variables are declared - // locally and used before being defined. So we check - // the presence of the given variable in the comp array - // before declaring it undefined. - - if (!funct["(comparray)"].check(v)) { - isundef(funct, "W117", state.tokens.curr, v); - } - } - } - - note_implied(state.tokens.curr); - } else { - // If the name is already defined in the current - // function, but not as outer, then there is a scope error. - - switch (funct[v]) { - case "closure": - case "function": - case "var": - case "unused": - warning("W038", state.tokens.curr, v); - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - case "outer": - case "global": - break; - default: - // If the name is defined in an outer function, make an outer entry, - // and if it was unused, make it var. - if (s === true) { - funct[v] = true; - } else if (s === null) { - warning("W039", state.tokens.curr, v); - note_implied(state.tokens.curr); - } else if (typeof s !== "object") { - // Operators typeof and delete do not raise runtime errors even - // if the base object of a reference is null so no need to - // - // display warning if we're inside of typeof or delete. - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (state.tokens.next && - (state.tokens.next.value === "." || state.tokens.next.value === "["))) { - - isundef(funct, "W117", state.tokens.curr, v); - } - funct[v] = true; - note_implied(state.tokens.curr); - } else { - switch (s[v]) { - case "function": - case "unction": - this["function"] = true; - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "var": - case "unused": - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("W037", state.tokens.curr, v); - } - } - } - } - return this; - }, - led: function () { - error("E033", state.tokens.next, state.tokens.next.value); - } - }; - - type("(regexp)", function () { - return this; - }); - - // ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim("#"); - - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function (x) { - if (state.directive["use strict"] && funct["(global)"]) { - warning("E008", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function (x) { - if (state.directive["use strict"] && !state.option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("W040", x); - } - }); - reservevar("true"); - reservevar("undefined"); - - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function () { - error("E014"); - }; - assignop("%=", "assignmod", 20); - - bitwiseassignop("&=", "assignbitand", 20); - bitwiseassignop("|=", "assignbitor", 20); - bitwiseassignop("^=", "assignbitxor", 20); - bitwiseassignop("<<=", "assignshiftleft", 20); - bitwiseassignop(">>=", "assignshiftright", 20); - bitwiseassignop(">>>=", "assignshiftrightunsigned", 20); - infix(",", function (left, that) { - var expr; - that.exprs = [left]; - if (!comma({peek: true})) { - return that; - } - while (true) { - if (!(expr = expression(10))) { - break; - } - that.exprs.push(expr); - if (state.tokens.next.value !== "," || !comma()) { - break; - } - } - return that; - }, 10, true); - - infix("?", function (left, that) { - increaseComplexityCount(); - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - var orPrecendence = 40; - infix("||", function (left, that) { - increaseComplexityCount(); - that.left = left; - that.right = expression(orPrecendence); - return that; - }, orPrecendence); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function (left, right) { - var eqnull = state.option.eqnull && (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) - warning("W116", this, "===", "=="); - else if (isPoorRelation(left)) - warning("W041", this, "===", left.value); - else if (isPoorRelation(right)) - warning("W041", this, "===", right.value); - - return this; - }); - relation("==="); - relation("!=", function (left, right) { - var eqnull = state.option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) { - warning("W116", this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("W041", this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("W041", this, "!==", right.value); - } - return this; - }); - relation("!=="); - relation("<"); - relation(">"); - relation("<="); - relation(">="); - bitwise("<<", "shiftleft", 120); - bitwise(">>", "shiftright", 120); - bitwise(">>>", "shiftrightunsigned", 120); - infix("in", "in", 120); - infix("instanceof", "instanceof", 120); - infix("+", function (left, that) { - var right = expression(130); - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!state.option.scripturl && reg.javascriptURL.test(left.value)) { - warning("W050", left); - } - return left; - } - that.left = left; - that.right = right; - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function () { - warning("W007"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("+++", function (left) { - warning("W007"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function () { - warning("W006"); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("---", function (left) { - warning("W006"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++", "postinc"); - prefix("++", "preinc"); - state.syntax["++"].exps = true; - - suffix("--", "postdec"); - prefix("--", "predec"); - state.syntax["--"].exps = true; - prefix("delete", function () { - var p = expression(10); - if (!p || (p.id !== "." && p.id !== "[")) { - warning("W051"); - } - this.first = p; - return this; - }).exps = true; - - prefix("~", function () { - if (state.option.bitwise) { - warning("W052", this, "~"); - } - expression(150); - return this; - }); - - prefix("...", function () { - if (!state.option.inESNext()) { - warning("W104", this, "spread/rest operator"); - } - if (!state.tokens.next.identifier) { - error("E030", state.tokens.next, state.tokens.next.value); - } - expression(150); - return this; - }); - - prefix("!", function () { - this.right = expression(150); - this.arity = "unary"; - - if (!this.right) { // '!' followed by nothing? Give up. - quit("E041", this.line || 0); - } - - if (bang[this.right.id] === true) { - warning("W018", this, "!"); - } - return this; - }); - - prefix("typeof", "typeof"); - prefix("new", function () { - var c = expression(155), i; - if (c && c.id !== "function") { - if (c.identifier) { - c["new"] = true; - switch (c.value) { - case "Number": - case "String": - case "Boolean": - case "Math": - case "JSON": - warning("W053", state.tokens.prev, c.value); - break; - case "Function": - if (!state.option.evil) { - warning("W054"); - } - break; - case "Date": - case "RegExp": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (state.option.newcap && (i < "A" || i > "Z") && !_.has(global, c.value)) { - warning("W055", state.tokens.curr); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("W056", state.tokens.curr); - } - } - } else { - if (!state.option.supernew) - warning("W057", this); - } - adjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id !== "(" && !state.option.supernew) { - warning("W058", state.tokens.curr, state.tokens.curr.value); - } - this.first = c; - return this; - }); - state.syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function (left, that) { - adjacent(state.tokens.prev, state.tokens.curr); - nobreak(); - var m = identifier(false, true); - - if (typeof m === "string") { - countMember(m); - } - - that.left = left; - that.right = m; - - if (m && m === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (state.option.noarg) - warning("W059", left, m); - else if (state.directive["use strict"]) - error("E008"); - } else if (!state.option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("W060", left); - } - - if (!state.option.evil && (m === "eval" || m === "execScript")) { - warning("W061"); - } - - return that; - }, 160, true); - - infix("(", function (left, that) { - if (state.tokens.prev.id !== "}" && state.tokens.prev.id !== ")") { - nobreak(state.tokens.prev, state.tokens.curr); - } - - nospace(); - if (state.option.immed && left && !left.immed && left.id === "function") { - warning("W062"); - } - - var n = 0; - var p = []; - - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("W063", left); - } else if (state.option.newcap) { - warning("W064", left); - } - } - } - } - } - - if (state.tokens.next.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")"); - nospace(state.tokens.prev, state.tokens.curr); - - if (typeof left === "object") { - if (left.value === "parseInt" && n === 1) { - warning("W065", state.tokens.curr); - } - if (!state.option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("W061", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?") { - warning("W067", left); - } - } - - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function () { - nospace(); - var bracket, brackets = []; - var pn, pn1, i = 0; - var ret; - - do { - pn = peek(i); - i += 1; - pn1 = peek(i); - i += 1; - } while (pn.value !== ")" && pn1.value !== "=>" && pn1.value !== ";" && pn1.type !== "(end)"); - - if (state.tokens.next.id === "function") { - state.tokens.next.immed = true; - } - - var exprs = []; - - if (state.tokens.next.id !== ")") { - for (;;) { - if (pn1.value === "=>" && state.tokens.next.value === "{") { - bracket = state.tokens.next; - bracket.left = destructuringExpression(); - brackets.push(bracket); - for (var t in bracket.left) { - exprs.push(bracket.left[t].token); - } - } else { - exprs.push(expression(10)); - } - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")", this); - nospace(state.tokens.prev, state.tokens.curr); - if (state.option.immed && exprs[0] && exprs[0].id === "function") { - if (state.tokens.next.id !== "(" && - (state.tokens.next.id !== "." || (peek().value !== "call" && peek().value !== "apply"))) { - warning("W068", this); - } - } - - if (state.tokens.next.value === "=>") { - return exprs; - } - if (!exprs.length) { - return; - } - if (exprs.length > 1) { - ret = Object.create(state.syntax[","]); - ret.exprs = exprs; - } else { - ret = exprs[0]; - } - if (ret) { - ret.paren = true; - } - return ret; - }); - - application("=>"); - - infix("[", function (left, that) { - nobreak(state.tokens.prev, state.tokens.curr); - nospace(); - var e = expression(10), s; - if (e && e.type === "(string)") { - if (!state.option.evil && (e.value === "eval" || e.value === "execScript")) { - warning("W061", that); - } - - countMember(e.value); - if (!state.option.sub && reg.identifier.test(e.value)) { - s = state.syntax[e.value]; - if (!s || !isReserved(s)) { - warning("W069", state.tokens.prev, e.value); - } - } - } - advance("]", that); - - if (e && e.value === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - nospace(state.tokens.prev, state.tokens.curr); - that.left = left; - that.right = e; - return that; - }, 160, true); - - function comprehensiveArrayExpression() { - var res = {}; - res.exps = true; - funct["(comparray)"].stack(); - - // Handle reversed for expressions, used in spidermonkey - var reversed = false; - if (state.tokens.next.value !== "for") { - reversed = true; - if (!state.option.inMoz(true)) { - warning("W116", state.tokens.next, "for", state.tokens.next.value); - } - funct["(comparray)"].setState("use"); - res.right = expression(10); - } - - advance("for"); - if (state.tokens.next.value === "each") { - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - advance("("); - funct["(comparray)"].setState("define"); - res.left = expression(130); - if (_.contains(["in", "of"], state.tokens.next.value)) { - advance(); - } else { - error("E045", state.tokens.curr); - } - funct["(comparray)"].setState("generate"); - expression(10); - - advance(")"); - if (state.tokens.next.value === "if") { - advance("if"); - advance("("); - funct["(comparray)"].setState("filter"); - res.filter = expression(10); - advance(")"); - } - - if (!reversed) { - funct["(comparray)"].setState("use"); - res.right = expression(10); - } - - advance("]"); - funct["(comparray)"].unstack(); - return res; - } - - prefix("[", function () { - var blocktype = lookupBlockType(true); - if (blocktype.isCompArray) { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "array comprehension"); - } - return comprehensiveArrayExpression(); - } else if (blocktype.isDestAssign && !state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - var b = state.tokens.curr.line !== state.tokens.next.line; - this.first = []; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - while (state.tokens.next.id !== "(end)") { - while (state.tokens.next.id === ",") { - if (!state.option.inES5()) - warning("W070"); - advance(","); - } - if (state.tokens.next.id === "]") { - break; - } - if (b && state.tokens.curr.line !== state.tokens.next.line) { - indentation(); - } - this.first.push(expression(10)); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === "]" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - break; - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("]", this); - return this; - }, 160); - - - function property_name() { - var id = optionalidentifier(false, true); - - if (!id) { - if (state.tokens.next.id === "(string)") { - id = state.tokens.next.value; - advance(); - } else if (state.tokens.next.id === "(number)") { - id = state.tokens.next.value.toString(); - advance(); - } - } - - if (id === "hasOwnProperty") { - warning("W001"); - } - - return id; - } - - - function functionparams(parsed) { - var curr, next; - var params = []; - var ident; - var tokens = []; - var t; - var pastDefault = false; - - if (parsed) { - if (parsed instanceof Array) { - for (var i in parsed) { - curr = parsed[i]; - if (_.contains(["{", "["], curr.id)) { - for (t in curr.left) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else if (curr.value === "...") { - if (!state.option.inESNext()) { - warning("W104", curr, "spread/rest operator"); - } - continue; - } else { - addlabel(curr.value, "unused", curr); - } - } - return params; - } else { - if (parsed.identifier === true) { - addlabel(parsed.value, "unused", parsed); - return [parsed]; - } - } - } - - next = state.tokens.next; - - advance("("); - nospace(); - - if (state.tokens.next.id === ")") { - advance(")"); - return; - } - - for (;;) { - if (_.contains(["{", "["], state.tokens.next.id)) { - tokens = destructuringExpression(); - for (t in tokens) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, "unused", t.token); - } - } - } else if (state.tokens.next.value === "...") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "spread/rest operator"); - } - advance("..."); - nospace(); - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } else { - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", state.tokens.curr); - } - - // it is a syntax error to have a regular argument after a default argument - if (pastDefault) { - if (state.tokens.next.id !== "=") { - error("E051", state.tokens.current); - } - } - if (state.tokens.next.id === "=") { - if (!state.option.inESNext()) { - warning("W119", state.tokens.next, "default parameters"); - } - advance("="); - pastDefault = true; - expression(10); - } - if (state.tokens.next.id === ",") { - comma(); - } else { - advance(")", next); - nospace(state.tokens.prev, state.tokens.curr); - return params; - } - } - } - - - function doFunction(name, statement, generator, fatarrowparams) { - var f; - var oldOption = state.option; - var oldIgnored = state.ignored; - var oldScope = scope; - - state.option = Object.create(state.option); - state.ignored = Object.create(state.ignored); - scope = Object.create(scope); - - funct = { - "(name)" : name || "\"" + anonname + "\"", - "(line)" : state.tokens.next.line, - "(character)" : state.tokens.next.character, - "(context)" : funct, - "(breakage)" : 0, - "(loopage)" : 0, - "(metrics)" : createMetrics(state.tokens.next), - "(scope)" : scope, - "(statement)" : statement, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)" : funct["(comparray)"] - }; - - if (generator) { - funct["(generator)"] = true; - } - - f = funct; - state.tokens.curr.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, "function"); - } - - funct["(params)"] = functionparams(fatarrowparams); - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - block(false, true, true, fatarrowparams ? true:false); - - if (generator && funct["(generator)"] !== "yielded") { - error("E047", state.tokens.curr); - } - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - funct["(unusedOption)"] = state.option.unused; - - scope = oldScope; - state.option = oldOption; - state.ignored = oldIgnored; - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - - verifyMaxStatementsPerFunction: function () { - if (state.option.maxstatements && - this.statementCount > state.option.maxstatements) { - warning("W071", functionStartToken, this.statementCount); - } - }, - - verifyMaxParametersPerFunction: function (params) { - params = params || []; - - if (state.option.maxparams && params.length > state.option.maxparams) { - warning("W072", functionStartToken, params.length); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function () { - if (state.option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === state.option.maxdepth + 1) { - warning("W073", null, this.nestedBlockDepth); - } - }, - - verifyMaxComplexityPerFunction: function () { - var max = state.option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - warning("W074", functionStartToken, cc); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - // Parse assignments that were found instead of conditionals. - // For example: if (a = 1) { ... } - - function checkCondAssignment(expr) { - var id, paren; - if (expr) { - id = expr.id; - paren = expr.paren; - if (id === "," && (expr = expr.exprs[expr.exprs.length - 1])) { - id = expr.id; - paren = paren || expr.paren; - } - } - switch (id) { - case "=": - case "+=": - case "-=": - case "*=": - case "%=": - case "&=": - case "|=": - case "^=": - case "/=": - if (!paren && !state.option.boss) { - warning("W084"); - } - } - } - - - (function (x) { - x.nud = function (isclassdef) { - var b, f, i, p, t, g; - var props = {}; // All properties, including accessors - var tag = ""; - - function saveProperty(name, tkn) { - if (props[name] && _.has(props, name)) - warning("W075", state.tokens.next, i); - else - props[name] = {}; - - props[name].basic = true; - props[name].basictkn = tkn; - } - - function saveSetter(name, tkn) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].setter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].setter = true; - props[name].setterToken = tkn; - } - - function saveGetter(name) { - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name].getter) - warning("W075", state.tokens.next, i); - } else { - props[name] = {}; - } - - props[name].getter = true; - props[name].getterToken = state.tokens.curr; - } - - b = state.tokens.curr.line !== state.tokens.next.line; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - - for (;;) { - if (state.tokens.next.id === "}") { - break; - } - - if (b) { - indentation(); - } - - if (isclassdef && state.tokens.next.value === "static") { - advance("static"); - tag = "static "; - } - - if (state.tokens.next.value === "get" && peek().id !== ":") { - advance("get"); - - if (!state.option.inES5(!isclassdef)) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - // It is a Syntax Error if PropName of MethodDefinition is - // "constructor" and SpecialMethod of MethodDefinition is true. - if (isclassdef && i === "constructor") { - error("E049", state.tokens.next, "class getter method", i); - } - - saveGetter(tag + i); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (p) { - warning("W076", t, p[0], i); - } - - adjacent(state.tokens.curr, state.tokens.next); - } else if (state.tokens.next.value === "set" && peek().id !== ":") { - advance("set"); - - if (!state.option.inES5(!isclassdef)) { - error("E034"); - } - - i = property_name(); - if (!i) { - error("E035"); - } - - // It is a Syntax Error if PropName of MethodDefinition is - // "constructor" and SpecialMethod of MethodDefinition is true. - if (isclassdef && i === "constructor") { - error("E049", state.tokens.next, "class setter method", i); - } - - saveSetter(tag + i, state.tokens.next); - t = state.tokens.next; - adjacent(state.tokens.curr, state.tokens.next); - f = doFunction(); - p = f["(params)"]; - - if (!p || p.length !== 1) { - warning("W077", t, i); - } - } else { - g = false; - if (state.tokens.next.value === "*" && state.tokens.next.type === "(punctuator)") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "generator functions"); - } - advance("*"); - g = true; - } - i = property_name(); - saveProperty(tag + i, state.tokens.next); - - if (typeof i !== "string") { - break; - } - - if (state.tokens.next.value === "(") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "concise methods"); - } - doFunction(i, undefined, g); - } else if (!isclassdef) { - advance(":"); - nonadjacent(state.tokens.curr, state.tokens.next); - expression(10); - } - } - // It is a Syntax Error if PropName of MethodDefinition is "prototype". - if (isclassdef && i === "prototype") { - error("E049", state.tokens.next, "class method", i); - } - - countMember(i); - if (isclassdef) { - tag = ""; - continue; - } - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true, property: true }); - if (state.tokens.next.id === ",") { - warning("W070", state.tokens.curr); - } else if (state.tokens.next.id === "}" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - indentation(); - } - advance("}", this); - - // Check for lonely setters if in the ES5 mode. - if (state.option.inES5()) { - for (var name in props) { - if (_.has(props, name) && props[name].setter && !props[name].getter) { - warning("W078", props[name].setterToken); - } - } - } - return this; - }; - x.fud = function () { - error("E036", state.tokens.curr); - }; - }(delim("{"))); - - function destructuringExpression() { - var id, ids; - var identifiers = []; - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - var nextInnerDE = function () { - var ident; - if (_.contains(["[", "{"], state.tokens.next.value)) { - ids = destructuringExpression(); - for (var id in ids) { - id = ids[id]; - identifiers.push({ id: id.id, token: id.token }); - } - } else if (state.tokens.next.value === ",") { - identifiers.push({ id: null, token: state.tokens.curr }); - } else { - ident = identifier(); - if (ident) - identifiers.push({ id: ident, token: state.tokens.curr }); - } - }; - if (state.tokens.next.value === "[") { - advance("["); - nextInnerDE(); - while (state.tokens.next.value !== "]") { - advance(","); - nextInnerDE(); - } - advance("]"); - } else if (state.tokens.next.value === "{") { - advance("{"); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - while (state.tokens.next.value !== "}") { - advance(","); - id = identifier(); - if (state.tokens.next.value === ":") { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - } - advance("}"); - } - return identifiers; - } - function destructuringExpressionMatch(tokens, value) { - if (value.first) { - _.zip(tokens, value.first).forEach(function (val) { - var token = val[0]; - var value = val[1]; - if (token && value) { - token.first = value; - } else if (token && token.first && !value) { - warning("W080", token.first, token.first.value); - } /* else { - XXX value is discarded: wouldn't it need a warning ? - } */ - }); - } - } - - var conststatement = stmt("const", function (prefix) { - var tokens, value; - // state variable to know if it is a lone identifier, or a destructuring statement. - var lone; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "const"); - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "const"); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id !== "=") { - warning("E012", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.prev, state.tokens.prev.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - warning("W120", state.tokens.next, state.tokens.next.value); - } - value = expression(10); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - conststatement.exps = true; - var varstatement = stmt("var", function (prefix) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var tokens, lone, value; - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, "unused", t.token); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.prev, state.tokens.prev.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - warning("W120", state.tokens.next, state.tokens.next.value); - } - value = expression(10); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - var letstatement = stmt("let", function (prefix) { - var tokens, lone, value, letblock; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "let"); - } - - if (state.tokens.next.value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let block"); - } - advance("("); - funct["(blockscope)"].stack(); - letblock = true; - } else if (funct["(nolet)"]) { - error("E048", state.tokens.curr); - } - - if (funct["(onevar)"] && state.option.onevar) { - warning("W081"); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - for (;;) { - var names = []; - nonadjacent(state.tokens.curr, state.tokens.next); - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr.value } ]; - lone = true; - } - for (var t in tokens) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id && !funct["(nolet)"]) { - addlabel(t.id, "unused", t.token, true); - names.push(t.token); - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("="); - nonadjacent(state.tokens.curr, state.tokens.next); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.prev, state.tokens.prev.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - warning("W120", state.tokens.next, state.tokens.next.value); - } - value = expression(10); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - if (letblock) { - advance(")"); - block(true, true); - this.block = true; - funct["(blockscope)"].unstack(); - } - - return this; - }); - letstatement.exps = true; - - blockstmt("class", function () { - return classdef.call(this, true); - }); - - function classdef(stmt) { - /*jshint validthis:true */ - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "class"); - } - if (stmt) { - // BindingIdentifier - this.name = identifier(); - addlabel(this.name, "unused", state.tokens.curr); - } else if (state.tokens.next.identifier && state.tokens.next.value !== "extends") { - // BindingIdentifier(opt) - this.name = identifier(); - } - classtail(this); - return this; - } - - function classtail(c) { - var strictness = state.directive["use strict"]; - - // ClassHeritage(opt) - if (state.tokens.next.value === "extends") { - advance("extends"); - c.heritage = expression(10); - } - - // A ClassBody is always strict code. - state.directive["use strict"] = true; - advance("{"); - // ClassBody(opt) - c.body = state.syntax["{"].nud(true); - state.directive["use strict"] = strictness; - } - - blockstmt("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - advance("*"); - if (state.option.inESNext(true)) { - generator = true; - } else { - warning("W119", state.tokens.curr, "function*"); - } - } - if (inblock) { - warning("W082", state.tokens.curr); - - } - var i = identifier(); - if (funct[i] === "const") { - warning("E011", null, i); - } - adjacent(state.tokens.curr, state.tokens.next); - addlabel(i, "unction", state.tokens.curr); - - doFunction(i, { statement: true }, generator); - if (state.tokens.next.id === "(" && state.tokens.next.line === state.tokens.curr.line) { - error("E039"); - } - return this; - }); - - prefix("function", function () { - var generator = false; - if (state.tokens.next.value === "*") { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "function*"); - } - advance("*"); - generator = true; - } - var i = optionalidentifier(); - if (i || state.option.gcl) { - adjacent(state.tokens.curr, state.tokens.next); - } else { - nonadjacent(state.tokens.curr, state.tokens.next); - } - doFunction(i, undefined, generator); - if (!state.option.loopfunc && funct["(loopage)"]) { - warning("W083"); - } - return this; - }); - - blockstmt("if", function () { - var t = state.tokens.next; - increaseComplexityCount(); - state.condition = true; - advance("("); - nonadjacent(this, t); - nospace(); - checkCondAssignment(expression(0)); - advance(")", t); - state.condition = false; - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - if (state.tokens.next.id === "else") { - nonadjacent(state.tokens.curr, state.tokens.next); - advance("else"); - if (state.tokens.next.id === "if" || state.tokens.next.id === "switch") { - statement(true); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function () { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - nonadjacent(state.tokens.curr, state.tokens.next); - advance("("); - - scope = Object.create(oldScope); - - e = state.tokens.next.value; - if (state.tokens.next.type !== "(identifier)") { - e = null; - warning("E030", state.tokens.next, e); - } - - advance(); - - funct = { - "(name)" : "(catch)", - "(line)" : state.tokens.next.line, - "(character)": state.tokens.next.character, - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(scope)" : scope, - "(statement)": false, - "(metrics)" : createMetrics(state.tokens.next), - "(catch)" : true, - "(tokens)" : {}, - "(blockscope)": funct["(blockscope)"], - "(comparray)": funct["(comparray)"] - }; - - if (e) { - addlabel(e, "exception"); - } - - if (state.tokens.next.value === "if") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "catch filter"); - } - advance("if"); - expression(0); - } - - advance(")"); - - state.tokens.curr.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - } - - block(false); - - while (state.tokens.next.id === "catch") { - increaseComplexityCount(); - if (b && (!state.option.inMoz(true))) { - warning("W118", state.tokens.next, "multiple catch blocks"); - } - doCatch(); - b = true; - } - - if (state.tokens.next.id === "finally") { - advance("finally"); - block(false); - return; - } - - if (!b) { - error("E021", state.tokens.next, "catch", state.tokens.next.value); - } - - return this; - }); - - blockstmt("while", function () { - var t = state.tokens.next; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - checkCondAssignment(expression(0)); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function () { - var t = state.tokens.next; - if (state.directive["use strict"]) { - error("E010", state.tokens.curr); - } else if (!state.option.withstmt) { - warning("W085", state.tokens.curr); - } - - advance("("); - nonadjacent(this, t); - nospace(); - expression(0); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - - return this; - }); - - blockstmt("switch", function () { - var t = state.tokens.next, - g = false; - funct["(breakage)"] += 1; - advance("("); - nonadjacent(this, t); - nospace(); - checkCondAssignment(expression(0)); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - nonadjacent(state.tokens.curr, state.tokens.next); - t = state.tokens.next; - advance("{"); - nonadjacent(state.tokens.curr, state.tokens.next); - indent += state.option.indent; - this.cases = []; - - for (;;) { - switch (state.tokens.next.id) { - case "case": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "case": - case "continue": - case "return": - case "switch": - case "throw": - break; - default: - // You can tell JSHint that you don't use break intentionally by - // adding a comment /* falls through */ on a line just before - // the next `case`. - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "case"); - } - } - indentation(-state.option.indent); - advance("case"); - this.cases.push(expression(20)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "continue": - case "return": - case "throw": - break; - default: - // Do not display a warning if 'default' is the first statement or if - // there is a special /* falls through */ comment. - if (this.cases.length) { - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "default"); - } - } - } - indentation(-state.option.indent); - advance("default"); - g = true; - advance(":"); - break; - case "}": - indent -= state.option.indent; - indentation(); - advance("}", t); - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("E023", state.tokens.next, "}"); - return; - default: - if (g) { - switch (state.tokens.curr.id) { - case ",": - error("E040"); - return; - case ":": - g = false; - statements(); - break; - default: - error("E025", state.tokens.curr); - return; - } - } else { - if (state.tokens.curr.id === ":") { - advance(":"); - error("E024", state.tokens.curr, ":"); - statements(); - } else { - error("E021", state.tokens.next, "case", state.tokens.next.value); - return; - } - } - } - } - }).labelled = true; - - stmt("debugger", function () { - if (!state.option.debug) { - warning("W087", this); - } - return this; - }).exps = true; - - (function () { - var x = stmt("do", function () { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true, true); - advance("while"); - var t = state.tokens.next; - nonadjacent(state.tokens.curr, t); - advance("("); - nospace(); - checkCondAssignment(expression(0)); - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function () { - var s, t = state.tokens.next; - var letscope = false; - var foreachtok = null; - - if (t.value === "each") { - foreachtok = t; - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - - // what kind of for(…) statement it is? for(…of…)? for(…in…)? for(…;…;…)? - var nextop; // contains the token of the "in" or "of" operator - var i = 0; - var inof = ["in", "of"]; - do { - nextop = peek(i); - ++i; - } while (!_.contains(inof, nextop.value) && nextop.value !== ";" && - nextop.type !== "(end)"); - - // if we're in a for (… in|of …) statement - if (_.contains(inof, nextop.value)) { - if (!state.option.inESNext() && nextop.value === "of") { - error("W104", nextop, "for of"); - } - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud, true); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud, true); - } else { - switch (funct[state.tokens.next.value]) { - case "unused": - funct[state.tokens.next.value] = "var"; - break; - case "var": - break; - default: - if (!funct["(blockscope)"].getlabel(state.tokens.next.value)) - warning("W088", state.tokens.next, state.tokens.next.value); - } - advance(); - } - advance(nextop.value); - expression(20); - advance(")", t); - s = block(true, true); - if (state.option.forin && s && (s.length > 1 || typeof s[0] !== "object" || - s[0].value !== "if")) { - warning("W089", this); - } - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - } else { - if (foreachtok) { - error("E045", foreachtok); - } - if (state.tokens.next.id !== ";") { - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.syntax["let"].fud.call(state.syntax["let"].fud); - } else { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id !== ";") { - checkCondAssignment(expression(0)); - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id === ";") { - error("E021", state.tokens.next, ")", ";"); - } - if (state.tokens.next.id !== ")") { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - nospace(state.tokens.prev, state.tokens.curr); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - - } - // unstack loop blockscope - if (letscope) { - funct["(blockscope)"].unstack(); - } - return this; - }).labelled = true; - - - stmt("break", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } - reachable("break"); - return this; - }).exps = true; - - - stmt("continue", function () { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - if (state.tokens.curr.line === state.tokens.next.line) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("W052", state.tokens.next, this.value); - } - reachable("continue"); - return this; - }).exps = true; - - - stmt("return", function () { - if (this.line === state.tokens.next.line) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(0); - - if (this.first && - this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else { - if (state.tokens.next.type === "(punctuator)" && - ["[", "{", "+", "-"].indexOf(state.tokens.next.value) > -1) { - nolinebreak(this); // always warn (Line breaking error) - } - } - reachable("return"); - return this; - }).exps = true; - - (function (x) { - x.exps = true; - x.lbp = 25; - }(prefix("yield", function () { - var prev = state.tokens.prev; - if (state.option.inESNext(true) && !funct["(generator)"]) { - error("E046", state.tokens.curr, "yield"); - } else if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "yield"); - } - funct["(generator)"] = "yielded"; - if (this.line === state.tokens.next.line || !state.option.inMoz(true)) { - if (state.tokens.next.id === "(regexp)") - warning("W092"); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach && state.tokens.next.nud) { - nobreaknonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(10); - - if (this.first.type === "(punctuator)" && this.first.value === "=" && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - - if (state.option.inMoz(true) && state.tokens.next.id !== ")" && - (prev.lbp > 30 || (!prev.assign && !isEndOfExpr()) || prev.id === "yield")) { - error("E050", this); - } - } else if (!state.option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - return this; - }))); - - - stmt("throw", function () { - nolinebreak(this); - nonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(20); - reachable("throw"); - return this; - }).exps = true; - - stmt("import", function () { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "import"); - } - - if (state.tokens.next.identifier) { - this.name = identifier(); - addlabel(this.name, "unused", state.tokens.curr); - } else { - advance("{"); - for (;;) { - var importName; - if (state.tokens.next.type === "default") { - importName = "default"; - advance("default"); - } else { - importName = identifier(); - } - if (state.tokens.next.value === "as") { - advance("as"); - importName = identifier(); - } - addlabel(importName, "unused", state.tokens.curr); - - if (state.tokens.next.value === ",") { - advance(","); - } else if (state.tokens.next.value === "}") { - advance("}"); - break; - } else { - error("E024", state.tokens.next, state.tokens.next.value); - break; - } - } - } - - advance("from"); - advance("(string)"); - return this; - }).exps = true; - - stmt("export", function () { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "export"); - } - - if (state.tokens.next.type === "default") { - advance("default"); - if (state.tokens.next.id === "function" || state.tokens.next.id === "class") { - this.block = true; - } - this.exportee = expression(10); - - return this; - } - - if (state.tokens.next.value === "{") { - advance("{"); - for (;;) { - identifier(); - - if (state.tokens.next.value === ",") { - advance(","); - } else if (state.tokens.next.value === "}") { - advance("}"); - break; - } else { - error("E024", state.tokens.next, state.tokens.next.value); - break; - } - } - return this; - } - - if (state.tokens.next.id === "var") { - advance("var"); - state.syntax["var"].fud.call(state.syntax["var"].fud); - } else if (state.tokens.next.id === "let") { - advance("let"); - state.syntax["let"].fud.call(state.syntax["let"].fud); - } else if (state.tokens.next.id === "const") { - advance("const"); - state.syntax["const"].fud.call(state.syntax["const"].fud); - } else if (state.tokens.next.id === "function") { - this.block = true; - advance("function"); - state.syntax["function"].fud(); - } else if (state.tokens.next.id === "class") { - this.block = true; - advance("class"); - state.syntax["class"].fud(); - } else { - error("E024", state.tokens.next, state.tokens.next.value); - } - - return this; - }).exps = true; - - // Future Reserved Words - - FutureReservedWord("abstract"); - FutureReservedWord("boolean"); - FutureReservedWord("byte"); - FutureReservedWord("char"); - FutureReservedWord("class", { es5: true, nud: classdef }); - FutureReservedWord("double"); - FutureReservedWord("enum", { es5: true }); - FutureReservedWord("export", { es5: true }); - FutureReservedWord("extends", { es5: true }); - FutureReservedWord("final"); - FutureReservedWord("float"); - FutureReservedWord("goto"); - FutureReservedWord("implements", { es5: true, strictOnly: true }); - FutureReservedWord("import", { es5: true }); - FutureReservedWord("int"); - FutureReservedWord("interface", { es5: true, strictOnly: true }); - FutureReservedWord("long"); - FutureReservedWord("native"); - FutureReservedWord("package", { es5: true, strictOnly: true }); - FutureReservedWord("private", { es5: true, strictOnly: true }); - FutureReservedWord("protected", { es5: true, strictOnly: true }); - FutureReservedWord("public", { es5: true, strictOnly: true }); - FutureReservedWord("short"); - FutureReservedWord("static", { es5: true, strictOnly: true }); - FutureReservedWord("super", { es5: true }); - FutureReservedWord("synchronized"); - FutureReservedWord("throws"); - FutureReservedWord("transient"); - FutureReservedWord("volatile"); - - // this function is used to determine wether a squarebracket or a curlybracket - // expression is a comprehension array, destructuring assignment or a json value. - - var lookupBlockType = function () { - var pn, pn1; - var i = -1; - var bracketStack = 0; - var ret = {}; - if (_.contains(["[", "{"], state.tokens.curr.value)) - bracketStack += 1; - do { - pn = (i === -1) ? state.tokens.next : peek(i); - pn1 = peek(i + 1); - i = i + 1; - if (_.contains(["[", "{"], pn.value)) { - bracketStack += 1; - } else if (_.contains(["]", "}"], pn.value)) { - bracketStack -= 1; - } - if (pn.identifier && pn.value === "for" && bracketStack === 1) { - ret.isCompArray = true; - ret.notJson = true; - break; - } - if (_.contains(["}", "]"], pn.value) && pn1.value === "=" && bracketStack === 0) { - ret.isDestAssign = true; - ret.notJson = true; - break; - } - if (pn.value === ";") { - ret.isBlock = true; - ret.notJson = true; - } - } while (bracketStack > 0 && pn.id !== "(end)" && i < 15); - return ret; - }; - - // Check whether this function has been reached for a destructuring assign with undeclared values - function destructuringAssignOrJsonValue() { - // lookup for the assignment (esnext only) - // if it has semicolons, it is a block, so go parse it as a block - // or it's not a block, but there are assignments, check for undeclared variables - - var block = lookupBlockType(); - if (block.notJson) { - if (!state.option.inESNext() && block.isDestAssign) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - statements(); - // otherwise parse json value - } else { - state.option.laxbreak = true; - state.jsonMode = true; - jsonValue(); - } - } - - // array comprehension parsing function - // parses and defines the three states of the list comprehension in order - // to avoid defining global variables, but keeping them to the list comprehension scope - // only. The order of the states are as follows: - // * "use" which will be the returned iterative part of the list comprehension - // * "define" which will define the variables local to the list comprehension - // * "filter" which will help filter out values - - var arrayComprehension = function () { - var CompArray = function () { - this.mode = "use"; - this.variables = []; - }; - var _carrays = []; - var _current; - function declare(v) { - var l = _current.variables.filter(function (elt) { - // if it has, change its undef state - if (elt.value === v) { - elt.undef = false; - return v; - } - }).length; - return l !== 0; - } - function use(v) { - var l = _current.variables.filter(function (elt) { - // and if it has been defined - if (elt.value === v && !elt.undef) { - if (elt.unused === true) { - elt.unused = false; - } - return v; - } - }).length; - // otherwise we warn about it - return (l === 0); - } - return {stack: function () { - _current = new CompArray(); - _carrays.push(_current); - }, - unstack: function () { - _current.variables.filter(function (v) { - if (v.unused) - warning("W098", v.token, v.value); - if (v.undef) - isundef(v.funct, "W117", v.token, v.value); - }); - _carrays.splice(-1, 1); - _current = _carrays[_carrays.length - 1]; - }, - setState: function (s) { - if (_.contains(["use", "define", "generate", "filter"], s)) - _current.mode = s; - }, - check: function (v) { - if (!_current) { - return; - } - // When we are in "use" state of the list comp, we enqueue that var - if (_current && _current.mode === "use") { - if (use(v)) { - _current.variables.push({ - funct: funct, - token: state.tokens.curr, - value: v, - undef: true, - unused: false - }); - } - return true; - // When we are in "define" state of the list comp, - } else if (_current && _current.mode === "define") { - // check if the variable has been used previously - if (!declare(v)) { - _current.variables.push({ - funct: funct, - token: state.tokens.curr, - value: v, - undef: false, - unused: true - }); - } - return true; - // When we are in the "generate" state of the list comp, - } else if (_current && _current.mode === "generate") { - isundef(funct, "W117", state.tokens.curr, v); - return true; - // When we are in "filter" state, - } else if (_current && _current.mode === "filter") { - // we check whether current variable has been declared - if (use(v)) { - // if not we warn about it - isundef(funct, "W117", state.tokens.curr, v); - } - return true; - } - return false; - } - }; - }; - - - // Parse JSON - - function jsonValue() { - - function jsonObject() { - var o = {}, t = state.tokens.next; - advance("{"); - if (state.tokens.next.id !== "}") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E026", state.tokens.next, t.line); - } else if (state.tokens.next.id === "}") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } else if (state.tokens.next.id !== "(string)") { - warning("W095", state.tokens.next, state.tokens.next.value); - } - if (o[state.tokens.next.value] === true) { - warning("W075", state.tokens.next, state.tokens.next.value); - } else if ((state.tokens.next.value === "__proto__" && - !state.option.proto) || (state.tokens.next.value === "__iterator__" && - !state.option.iterator)) { - warning("W096", state.tokens.next, state.tokens.next.value); - } else { - o[state.tokens.next.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = state.tokens.next; - advance("["); - if (state.tokens.next.id !== "]") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E027", state.tokens.next, t.line); - } else if (state.tokens.next.id === "]") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (state.tokens.next.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - if (state.tokens.curr.character !== state.tokens.next.from) { - warning("W011", state.tokens.curr); - } - adjacent(state.tokens.curr, state.tokens.next); - advance("(number)"); - break; - default: - error("E003", state.tokens.next); - } - } - - var blockScope = function () { - var _current = {}; - var _variables = [_current]; - - function _checkBlockLabels() { - for (var t in _current) { - if (_current[t]["(type)"] === "unused") { - if (state.option.unused) { - var tkn = _current[t]["(token)"]; - var line = tkn.line; - var chr = tkn.character; - warningAt("W098", line, chr, t); - } - } - } - } - - return { - stack: function () { - _current = {}; - _variables.push(_current); - }, - - unstack: function () { - _checkBlockLabels(); - _variables.splice(_variables.length - 1, 1); - _current = _.last(_variables); - }, - - getlabel: function (l) { - for (var i = _variables.length - 1 ; i >= 0; --i) { - if (_.has(_variables[i], l)) { - return _variables[i]; - } - } - }, - - current: { - has: function (t) { - return _.has(_current, t); - }, - add: function (t, type, tok) { - _current[t] = { "(type)" : type, - "(token)": tok }; - } - } - }; - }; - - // The actual JSHINT function itself. - var itself = function (s, o, g) { - var i, k, x; - var optionKeys; - var newOptionObj = {}; - var newIgnoredObj = {}; - - state.reset(); - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(null); - combine(predefined, vars.ecmaIdentifiers); - combine(predefined, vars.reservedVars); - - combine(predefined, g || {}); - - declared = Object.create(null); - exported = Object.create(null); - - function each(obj, cb) { - if (!obj) - return; - - if (!Array.isArray(obj) && typeof obj === "object") - obj = Object.keys(obj); - - obj.forEach(cb); - } - - if (o) { - each(o.predef || null, function (item) { - var slice, prop; - - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - } else { - prop = Object.getOwnPropertyDescriptor(o.predef, item); - predefined[item] = prop ? prop.value : false; - } - }); - - each(o.exported || null, function (item) { - exported[item] = true; - }); - - delete o.predef; - delete o.exported; - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - if (/^-W\d{3}$/g.test(optionKeys[x])) { - newIgnoredObj[optionKeys[x].slice(1)] = true; - } else { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - - if (optionKeys[x] === "indent") - newOptionObj["(explicitIndent)"] = o[optionKeys[x]] === false ? false : true; - } - } - } - - state.option = newOptionObj; - state.ignored = newIgnoredObj; - - state.option.indent = state.option.indent || 4; - state.option.maxerr = state.option.maxerr || 50; - - indent = 1; - global = Object.create(predefined); - scope = global; - funct = { - "(global)": true, - "(name)": "(global)", - "(scope)": scope, - "(breakage)": 0, - "(loopage)": 0, - "(tokens)": {}, - "(metrics)": createMetrics(state.tokens.next), - "(blockscope)": blockScope(), - "(comparray)": arrayComprehension() - }; - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - warnings = 0; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("E004", 0); - return false; - } - - api = { - get isJSON() { - return state.jsonMode; - }, - - getOption: function (name) { - return state.option[name] || null; - }, - - getCache: function (name) { - return state.cache[name]; - }, - - setCache: function (name, value) { - state.cache[name] = value; - }, - - warn: function (code, data) { - warningAt.apply(null, [ code, data.line, data.char ].concat(data.data)); - }, - - on: function (names, listener) { - names.split(" ").forEach(function (name) { - emitter.on(name, listener); - }.bind(this)); - } - }; - - emitter.removeAllListeners(); - (extraModules || []).forEach(function (func) { - func(api); - }); - - state.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax["(begin)"]; - - lex = new Lexer(s); - - lex.on("warning", function (ev) { - warningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data)); - }); - - lex.on("error", function (ev) { - errorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data)); - }); - - lex.on("fatal", function (ev) { - quit("E041", ev.line, ev.from); - }); - - lex.on("Identifier", function (ev) { - emitter.emit("Identifier", ev); - }); - - lex.on("String", function (ev) { - emitter.emit("String", ev); - }); - - lex.on("Number", function (ev) { - emitter.emit("Number", ev); - }); - - lex.start(); - - // Check options - for (var name in o) { - if (_.has(o, name)) { - checkOption(name, state.tokens.curr); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - - try { - advance(); - switch (state.tokens.next.id) { - case "{": - case "[": - destructuringAssignOrJsonValue(); - break; - default: - directives(); - - if (state.directive["use strict"]) { - if (!state.option.globalstrict && !(state.option.node || state.option.phantom)) { - warning("W097", state.tokens.prev); - } - } - - statements(); - } - advance((state.tokens.next && state.tokens.next.value !== ".") ? "(end)" : undefined); - funct["(blockscope)"].unstack(); - - var markDefined = function (name, context) { - do { - if (typeof context[name] === "string") { - // JSHINT marks unused variables as 'unused' and - // unused function declaration as 'unction'. This - // code changes such instances back 'var' and - // 'closure' so that the code in JSHINT.data() - // doesn't think they're unused. - - if (context[name] === "unused") - context[name] = "var"; - else if (context[name] === "unction") - context[name] = "closure"; - - return true; - } - - context = context["(context)"]; - } while (context); - - return false; - }; - - var clearImplied = function (name, line) { - if (!implied[name]) - return; - - var newImplied = []; - for (var i = 0; i < implied[name].length; i += 1) { - if (implied[name][i] !== line) - newImplied.push(implied[name][i]); - } - - if (newImplied.length === 0) - delete implied[name]; - else - implied[name] = newImplied; - }; - - var warnUnused = function (name, tkn, type, unused_opt) { - var line = tkn.line; - var chr = tkn.character; - - if (unused_opt === undefined) { - unused_opt = state.option.unused; - } - - if (unused_opt === true) { - unused_opt = "last-param"; - } - - var warnable_types = { - "vars": ["var"], - "last-param": ["var", "param"], - "strict": ["var", "param", "last-param"] - }; - - if (unused_opt) { - if (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) { - warningAt("W098", line, chr, name); - } - } - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function (func, key) { - var type = func[key]; - var tkn = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - // Variable is in global scope and defined as exported. - if (func["(global)"] && _.has(exported, key)) { - return; - } - - warnUnused(key, tkn, "var"); - }; - - // Check queued 'x is not defined' instances to see if they're still undefined. - for (i = 0; i < JSHINT.undefs.length; i += 1) { - k = JSHINT.undefs[i].slice(0); - - if (markDefined(k[2].value, k[0])) { - clearImplied(k[2].value, k[2].line); - } else if (state.option.undef) { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function (func) { - if (func["(unusedOption)"] === false) { - return; - } - - for (var key in func) { - if (_.has(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type, unused_opt; - - while (param) { - type = func[param]; - unused_opt = func["(unusedOption)"] || state.option.unused; - unused_opt = unused_opt === true ? "last-param" : unused_opt; - - // 'undefined' is a special case for (function (window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type === "unused" || type === "unction") { - warnUnused(param, func["(tokens)"][param], "param", func["(unusedOption)"]); - } else if (unused_opt === "last-param") { - return; - } - - param = params.pop(); - } - }); - - for (var key in declared) { - if (_.has(declared, key) && !_.has(global, key)) { - warnUnused(key, declared[key], "var"); - } - } - - } catch (err) { - if (err && err.name === "JSHintError") { - var nt = state.tokens.next || {}; - JSHINT.errors.push({ - scope : "(main)", - raw : err.raw, - code : err.code, - reason : err.message, - line : err.line || nt.line, - character : err.character || nt.from - }, null); - } else { - throw err; - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Modules. - itself.addModule = function (func) { - extraModules.push(func); - }; - - itself.addModule(style.register); - - // Data summary. - itself.data = function () { - var data = { - functions: [], - options: state.option - }; - - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (state.jsonMode) { - data.json = true; - } - - for (n in implied) { - if (_.has(implied, n)) { - implieds.push({ - name: n, - line: implied[n] - }); - } - } - - if (implieds.length > 0) { - data.implieds = implieds; - } - - if (urls.length > 0) { - data.urls = urls; - } - - globals = Object.keys(scope); - if (globals.length > 0) { - data.globals = globals; - } - - for (i = 1; i < functions.length; i += 1) { - f = functions[i]; - fu = {}; - - for (j = 0; j < functionicity.length; j += 1) { - fu[functionicity[j]] = []; - } - - for (j = 0; j < functionicity.length; j += 1) { - if (fu[functionicity[j]].length === 0) { - delete fu[functionicity[j]]; - } - } - - fu.name = f["(name)"]; - fu.param = f["(params)"]; - fu.line = f["(line)"]; - fu.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - - fu.metrics = { - complexity: f["(metrics)"].ComplexityCount, - parameters: (f["(params)"] || []).length, - statements: f["(metrics)"].statementCount - }; - - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -} diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/lex.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/lex.js deleted file mode 100644 index ccdb4cc..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/lex.js +++ /dev/null @@ -1,1694 +0,0 @@ -/* - * Lexical analysis and token construction. - */ - -"use strict"; - -var _ = require("underscore"); -var events = require("events"); -var reg = require("./reg.js"); -var state = require("./state.js").state; - -// Some of these token types are from JavaScript Parser API -// while others are specific to JSHint parser. -// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -var Token = { - Identifier: 1, - Punctuator: 2, - NumericLiteral: 3, - StringLiteral: 4, - Comment: 5, - Keyword: 6, - NullLiteral: 7, - BooleanLiteral: 8, - RegExp: 9 -}; - -// This is auto generated from the unicode tables. -// The tables are at: -// http://www.fileformat.info/info/unicode/category/Lu/list.htm -// http://www.fileformat.info/info/unicode/category/Ll/list.htm -// http://www.fileformat.info/info/unicode/category/Lt/list.htm -// http://www.fileformat.info/info/unicode/category/Lm/list.htm -// http://www.fileformat.info/info/unicode/category/Lo/list.htm -// http://www.fileformat.info/info/unicode/category/Nl/list.htm - -var unicodeLetterTable = [ - 170, 170, 181, 181, 186, 186, 192, 214, - 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, - 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, - 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, - 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, - 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, - 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, - 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, - 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2308, 2361, - 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, - 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, - 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, - 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, - 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, - 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, - 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, - 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, - 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, - 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, - 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, - 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, - 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, - 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, - 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, - 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, - 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, - 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, - 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, - 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, - 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, - 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, - 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, - 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4304, 4346, - 4348, 4348, 4352, 4680, 4682, 4685, 4688, 4694, 4696, 4696, - 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, - 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, - 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, - 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, - 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, - 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, - 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, - 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, - 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7104, 7141, - 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, - 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, - 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, - 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, - 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, - 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, - 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, - 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, - 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, - 11360, 11492, 11499, 11502, 11520, 11557, 11568, 11621, - 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, - 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, - 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, - 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, - 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, - 12593, 12686, 12704, 12730, 12784, 12799, 13312, 13312, - 19893, 19893, 19968, 19968, 40907, 40907, 40960, 42124, - 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, - 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, - 42786, 42888, 42891, 42894, 42896, 42897, 42912, 42921, - 43002, 43009, 43011, 43013, 43015, 43018, 43020, 43042, - 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, - 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, - 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, - 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, - 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, - 43739, 43741, 43777, 43782, 43785, 43790, 43793, 43798, - 43808, 43814, 43816, 43822, 43968, 44002, 44032, 44032, - 55203, 55203, 55216, 55238, 55243, 55291, 63744, 64045, - 64048, 64109, 64112, 64217, 64256, 64262, 64275, 64279, - 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, - 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, - 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, - 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, - 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, - 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, - 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, - 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66334, - 66352, 66378, 66432, 66461, 66464, 66499, 66504, 66511, - 66513, 66517, 66560, 66717, 67584, 67589, 67592, 67592, - 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, - 67840, 67861, 67872, 67897, 68096, 68096, 68112, 68115, - 68117, 68119, 68121, 68147, 68192, 68220, 68352, 68405, - 68416, 68437, 68448, 68466, 68608, 68680, 69635, 69687, - 69763, 69807, 73728, 74606, 74752, 74850, 77824, 78894, - 92160, 92728, 110592, 110593, 119808, 119892, 119894, 119964, - 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, - 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, - 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, - 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, - 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, - 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, - 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, - 131072, 131072, 173782, 173782, 173824, 173824, 177972, 177972, - 177984, 177984, 178205, 178205, 194560, 195101 -]; - -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 -} - -// Object that handles postponed lexing verifications that checks the parsed -// environment state. - -function asyncTrigger() { - var _checks = []; - - return { - push: function (fn) { - _checks.push(fn); - }, - - check: function () { - for (var check = 0; check < _checks.length; ++check) { - _checks[check](); - } - - _checks.splice(0, _checks.length); - } - }; -} - -/* - * Lexer for JSHint. - * - * This object does a char-by-char scan of the provided source code - * and produces a sequence of tokens. - * - * var lex = new Lexer("var i = 0;"); - * lex.start(); - * lex.token(); // returns the next token - * - * You have to use the token() method to move the lexer forward - * but you don't have to use its return value to get tokens. In addition - * to token() method returning the next token, the Lexer object also - * emits events. - * - * lex.on("Identifier", function (data) { - * if (data.name.indexOf("_") >= 0) { - * // Produce a warning. - * } - * }); - * - * Note that the token() method returns tokens in a JSLint-compatible - * format while the event emitter uses a slightly modified version of - * Mozilla's JavaScript Parser API. Eventually, we will move away from - * JSLint format. - */ -function Lexer(source) { - var lines = source; - - if (typeof lines === "string") { - lines = lines - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } - - // If the first line is a shebang (#!), make it a blank and move on. - // Shebangs are used by Node scripts. - - if (lines[0] && lines[0].substr(0, 2) === "#!") { - lines[0] = ""; - } - - this.emitter = new events.EventEmitter(); - this.source = source; - this.setLines(lines); - this.prereg = true; - - this.line = 0; - this.char = 1; - this.from = 1; - this.input = ""; - - for (var i = 0; i < state.option.indent; i += 1) { - state.tab += " "; - } -} - -Lexer.prototype = { - _lines: [], - - getLines: function () { - this._lines = state.lines; - return this._lines; - }, - - setLines: function (val) { - this._lines = val; - state.lines = this._lines; - }, - - /* - * Return the next i character without actually moving the - * char pointer. - */ - peek: function (i) { - return this.input.charAt(i || 0); - }, - - /* - * Move the char pointer forward i times. - */ - skip: function (i) { - i = i || 1; - this.char += i; - this.input = this.input.slice(i); - }, - - /* - * Subscribe to a token event. The API for this method is similar - * Underscore.js i.e. you can subscribe to multiple events with - * one call: - * - * lex.on("Identifier Number", function (data) { - * // ... - * }); - */ - on: function (names, listener) { - names.split(" ").forEach(function (name) { - this.emitter.on(name, listener); - }.bind(this)); - }, - - /* - * Trigger a token event. All arguments will be passed to each - * listener. - */ - trigger: function () { - this.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments)); - }, - - /* - * Postpone a token event. the checking condition is set as - * last parameter, and the trigger function is called in a - * stored callback. To be later called using the check() function - * by the parser. This avoids parser's peek() to give the lexer - * a false context. - */ - triggerAsync: function (type, args, checks, fn) { - checks.push(function () { - if (fn()) { - this.trigger(type, args); - } - }.bind(this)); - }, - - /* - * Extract a punctuator out of the next sequence of characters - * or return 'null' if its not possible. - * - * This method's implementation was heavily influenced by the - * scanPunctuator function in the Esprima parser's source code. - */ - scanPunctuator: function () { - var ch1 = this.peek(); - var ch2, ch3, ch4; - - switch (ch1) { - // Most common single-character punctuators - case ".": - if ((/^[0-9]$/).test(this.peek(1))) { - return null; - } - if (this.peek(1) === "." && this.peek(2) === ".") { - return { - type: Token.Punctuator, - value: "..." - }; - } - /* falls through */ - case "(": - case ")": - case ";": - case ",": - case "{": - case "}": - case "[": - case "]": - case ":": - case "~": - case "?": - return { - type: Token.Punctuator, - value: ch1 - }; - - // A pound sign (for Node shebangs) - case "#": - return { - type: Token.Punctuator, - value: ch1 - }; - - // We're at the end of input - case "": - return null; - } - - // Peek more characters - - ch2 = this.peek(1); - ch3 = this.peek(2); - ch4 = this.peek(3); - - // 4-character punctuator: >>>= - - if (ch1 === ">" && ch2 === ">" && ch3 === ">" && ch4 === "=") { - return { - type: Token.Punctuator, - value: ">>>=" - }; - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === "=" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "===" - }; - } - - if (ch1 === "!" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "!==" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === ">") { - return { - type: Token.Punctuator, - value: ">>>" - }; - } - - if (ch1 === "<" && ch2 === "<" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === "=") { - return { - type: Token.Punctuator, - value: ">>=" - }; - } - - // Fat arrow punctuator - if (ch1 === "=" && ch2 === ">") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= (but not /=, see below) - if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - if ("<>=!+-*%&|^".indexOf(ch1) >= 0) { - if (ch2 === "=") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - return { - type: Token.Punctuator, - value: ch1 - }; - } - - // Special case: /=. We need to make sure that this is an - // operator and not a regular expression. - - if (ch1 === "/") { - if (ch2 === "=" && /\/=(?!(\S*\/[gim]?))/.test(this.input)) { - // /= is not a part of a regular expression, return it as a - // punctuator. - return { - type: Token.Punctuator, - value: "/=" - }; - } - - return { - type: Token.Punctuator, - value: "/" - }; - } - - return null; - }, - - /* - * Extract a comment out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since comments can - * span across multiple lines this method has to move the char - * pointer. - * - * In addition to normal JavaScript comments (// and /*) this method - * also recognizes JSHint- and JSLint-specific comments such as - * /*jshint, /*jslint, /*globals and so on. - */ - scanComments: function () { - var ch1 = this.peek(); - var ch2 = this.peek(1); - var rest = this.input.substr(2); - var startLine = this.line; - var startChar = this.char; - - // Create a comment token object and make sure it - // has all the data JSHint needs to work with special - // comments. - - function commentToken(label, body, opt) { - var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"]; - var isSpecial = false; - var value = label + body; - var commentType = "plain"; - opt = opt || {}; - - if (opt.isMultiline) { - value += "*/"; - } - - special.forEach(function (str) { - if (isSpecial) { - return; - } - - // Don't recognize any special comments other than jshint for single-line - // comments. This introduced many problems with legit comments. - if (label === "//" && str !== "jshint") { - return; - } - - if (body.substr(0, str.length) === str) { - isSpecial = true; - label = label + str; - body = body.substr(str.length); - } - - if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) { - isSpecial = true; - label = label + " " + str; - body = body.substr(str.length + 1); - } - - if (!isSpecial) { - return; - } - - switch (str) { - case "member": - commentType = "members"; - break; - case "global": - commentType = "globals"; - break; - default: - commentType = str; - } - }); - - return { - type: Token.Comment, - commentType: commentType, - value: value, - body: body, - isSpecial: isSpecial, - isMultiline: opt.isMultiline || false, - isMalformed: opt.isMalformed || false - }; - } - - // End of unbegun comment. Raise an error and skip that input. - if (ch1 === "*" && ch2 === "/") { - this.trigger("error", { - code: "E018", - line: startLine, - character: startChar - }); - - this.skip(2); - return null; - } - - // Comments must start either with // or /* - if (ch1 !== "/" || (ch2 !== "*" && ch2 !== "/")) { - return null; - } - - // One-line comment - if (ch2 === "/") { - this.skip(this.input.length); // Skip to the EOL. - return commentToken("//", rest); - } - - var body = ""; - - /* Multi-line comment */ - if (ch2 === "*") { - this.skip(2); - - while (this.peek() !== "*" || this.peek(1) !== "/") { - if (this.peek() === "") { // End of Line - body += "\n"; - - // If we hit EOF and our comment is still unclosed, - // trigger an error and end the comment implicitly. - if (!this.nextLine()) { - this.trigger("error", { - code: "E017", - line: startLine, - character: startChar - }); - - return commentToken("/*", body, { - isMultiline: true, - isMalformed: true - }); - } - } else { - body += this.peek(); - this.skip(); - } - } - - this.skip(2); - return commentToken("/*", body, { isMultiline: true }); - } - }, - - /* - * Extract a keyword out of the next sequence of characters or - * return 'null' if its not possible. - */ - scanKeyword: function () { - var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input); - var keywords = [ - "if", "in", "do", "var", "for", "new", - "try", "let", "this", "else", "case", - "void", "with", "enum", "while", "break", - "catch", "throw", "const", "yield", "class", - "super", "return", "typeof", "delete", - "switch", "export", "import", "default", - "finally", "extends", "function", "continue", - "debugger", "instanceof" - ]; - - if (result && keywords.indexOf(result[0]) >= 0) { - return { - type: Token.Keyword, - value: result[0] - }; - } - - return null; - }, - - /* - * Extract a JavaScript identifier out of the next sequence of - * characters or return 'null' if its not possible. In addition, - * to Identifier this method can also produce BooleanLiteral - * (true/false) and NullLiteral (null). - */ - scanIdentifier: function () { - var id = ""; - var index = 0; - var type, char; - - // Detects any character in the Unicode categories "Uppercase - // letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter - // (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or - // "Letter number (Nl)". - // - // Both approach and unicodeLetterTable were borrowed from - // Google's Traceur. - - function isUnicodeLetter(code) { - for (var i = 0; i < unicodeLetterTable.length;) { - if (code < unicodeLetterTable[i++]) { - return false; - } - - if (code <= unicodeLetterTable[i++]) { - return true; - } - } - - return false; - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - var readUnicodeEscapeSequence = function () { - /*jshint validthis:true */ - index += 1; - - if (this.peek(index) !== "u") { - return null; - } - - var ch1 = this.peek(index + 1); - var ch2 = this.peek(index + 2); - var ch3 = this.peek(index + 3); - var ch4 = this.peek(index + 4); - var code; - - if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) { - code = parseInt(ch1 + ch2 + ch3 + ch4, 16); - - if (isUnicodeLetter(code)) { - index += 5; - return "\\u" + ch1 + ch2 + ch3 + ch4; - } - - return null; - } - - return null; - }.bind(this); - - var getIdentifierStart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierStartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - var getIdentifierPart = function () { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (identifierPartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isUnicodeLetter(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - char = getIdentifierStart(); - if (char === null) { - return null; - } - - id = char; - for (;;) { - char = getIdentifierPart(); - - if (char === null) { - break; - } - - id += char; - } - - switch (id) { - case "true": - case "false": - type = Token.BooleanLiteral; - break; - case "null": - type = Token.NullLiteral; - break; - default: - type = Token.Identifier; - } - - return { - type: type, - value: id - }; - }, - - /* - * Extract a numeric literal out of the next sequence of - * characters or return 'null' if its not possible. This method - * supports all numeric literals described in section 7.8.3 - * of the EcmaScript 5 specification. - * - * This method's implementation was heavily influenced by the - * scanNumericLiteral function in the Esprima parser's source code. - */ - scanNumericLiteral: function () { - var index = 0; - var value = ""; - var length = this.input.length; - var char = this.peek(index); - var bad; - - function isDecimalDigit(str) { - return (/^[0-9]$/).test(str); - } - - function isOctalDigit(str) { - return (/^[0-7]$/).test(str); - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - function isIdentifierStart(ch) { - return (ch === "$") || (ch === "_") || (ch === "\\") || - (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); - } - - // Numbers must start either with a decimal digit or a point. - - if (char !== "." && !isDecimalDigit(char)) { - return null; - } - - if (char !== ".") { - value = this.peek(index); - index += 1; - char = this.peek(index); - - if (value === "0") { - // Base-16 numbers. - if (char === "x" || char === "X") { - index += 1; - value += char; - - while (index < length) { - char = this.peek(index); - if (!isHexDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (value.length <= 2) { // 0x - return { - type: Token.NumericLiteral, - value: value, - isMalformed: true - }; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 16, - isMalformed: false - }; - } - - // Base-8 numbers. - if (isOctalDigit(char)) { - index += 1; - value += char; - bad = false; - - while (index < length) { - char = this.peek(index); - - // Numbers like '019' (note the 9) are not valid octals - // but we still parse them and mark as malformed. - - if (isDecimalDigit(char)) { - bad = true; - } else if (!isOctalDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 8, - isMalformed: false - }; - } - - // Decimal numbers that start with '0' such as '09' are illegal - // but we still parse them and return as malformed. - - if (isDecimalDigit(char)) { - index += 1; - value += char; - } - } - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Decimal digits. - - if (char === ".") { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Exponent part. - - if (char === "e" || char === "E") { - value += char; - index += 1; - char = this.peek(index); - - if (char === "+" || char === "-") { - value += this.peek(index); - index += 1; - } - - char = this.peek(index); - if (isDecimalDigit(char)) { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } else { - return null; - } - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: 10, - isMalformed: !isFinite(value) - }; - }, - - /* - * Extract a string out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since strings can - * span across multiple lines this method has to move the char - * pointer. - * - * This method recognizes pseudo-multiline JavaScript strings: - * - * var str = "hello\ - * world"; - */ - scanStringLiteral: function (checks) { - /*jshint loopfunc:true */ - var quote = this.peek(); - - // String must start with a quote. - if (quote !== "\"" && quote !== "'") { - return null; - } - - // In JSON strings must always use double quotes. - this.triggerAsync("warning", { - code: "W108", - line: this.line, - character: this.char // +1? - }, checks, function () { return state.jsonMode && quote !== "\""; }); - - var value = ""; - var startLine = this.line; - var startChar = this.char; - var allowNewLine = false; - - this.skip(); - - while (this.peek() !== quote) { - while (this.peek() === "") { // End Of Line - - // If an EOL is not preceded by a backslash, show a warning - // and proceed like it was a legit multi-line string where - // author simply forgot to escape the newline symbol. - // - // Another approach is to implicitly close a string on EOL - // but it generates too many false positives. - - if (!allowNewLine) { - this.trigger("warning", { - code: "W112", - line: this.line, - character: this.char - }); - } else { - allowNewLine = false; - - // Otherwise show a warning if multistr option was not set. - // For JSON, show warning no matter what. - - this.triggerAsync("warning", { - code: "W043", - line: this.line, - character: this.char - }, checks, function () { return !state.option.multistr; }); - - this.triggerAsync("warning", { - code: "W042", - line: this.line, - character: this.char - }, checks, function () { return state.jsonMode && state.option.multistr; }); - } - - // If we get an EOF inside of an unclosed string, show an - // error and implicitly close it at the EOF point. - - if (!this.nextLine()) { - this.trigger("error", { - code: "E029", - line: startLine, - character: startChar - }); - - return { - type: Token.StringLiteral, - value: value, - isUnclosed: true, - quote: quote - }; - } - } - - allowNewLine = false; - var char = this.peek(); - var jump = 1; // A length of a jump, after we're done - // parsing this character. - - if (char < " ") { - // Warn about a control character in a string. - this.trigger("warning", { - code: "W113", - line: this.line, - character: this.char, - data: [ "" ] - }); - } - - // Special treatment for some escaped characters. - - if (char === "\\") { - this.skip(); - char = this.peek(); - - switch (char) { - case "'": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }, checks, function () {return state.jsonMode; }); - break; - case "b": - char = "\b"; - break; - case "f": - char = "\f"; - break; - case "n": - char = "\n"; - break; - case "r": - char = "\r"; - break; - case "t": - char = "\t"; - break; - case "0": - char = "\0"; - - // Octal literals fail in strict mode. - // Check if the number is between 00 and 07. - var n = parseInt(this.peek(1), 10); - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, - function () { return n >= 0 && n <= 7 && state.directive["use strict"]; }); - break; - case "u": - char = String.fromCharCode(parseInt(this.input.substr(1, 4), 16)); - jump = 5; - break; - case "v": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }, checks, function () { return state.jsonMode; }); - - char = "\v"; - break; - case "x": - var x = parseInt(this.input.substr(1, 2), 16); - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }, checks, function () { return state.jsonMode; }); - - char = String.fromCharCode(x); - jump = 3; - break; - case "\\": - case "\"": - case "/": - break; - case "": - allowNewLine = true; - char = ""; - break; - case "!": - if (value.slice(value.length - 2) === "<") { - break; - } - - /*falls through */ - default: - // Weird escaping. - this.trigger("warning", { - code: "W044", - line: this.line, - character: this.char - }); - } - } - - value += char; - this.skip(jump); - } - - this.skip(); - return { - type: Token.StringLiteral, - value: value, - isUnclosed: false, - quote: quote - }; - }, - - /* - * Extract a regular expression out of the next sequence of - * characters and/or lines or return 'null' if its not possible. - * - * This method is platform dependent: it accepts almost any - * regular expression values but then tries to compile and run - * them using system's RegExp object. This means that there are - * rare edge cases where one JavaScript engine complains about - * your regular expression while others don't. - */ - scanRegExp: function () { - var index = 0; - var length = this.input.length; - var char = this.peek(); - var value = char; - var body = ""; - var flags = []; - var malformed = false; - var isCharSet = false; - var terminated; - - var scanUnexpectedChars = function () { - // Unexpected control character - if (char < " ") { - malformed = true; - this.trigger("warning", { - code: "W048", - line: this.line, - character: this.char - }); - } - - // Unexpected escaped character - if (char === "<") { - malformed = true; - this.trigger("warning", { - code: "W049", - line: this.line, - character: this.char, - data: [ char ] - }); - } - }.bind(this); - - // Regular expressions must start with '/' - if (!this.prereg || char !== "/") { - return null; - } - - index += 1; - terminated = false; - - // Try to get everything in between slashes. A couple of - // cases aside (see scanUnexpectedChars) we don't really - // care whether the resulting expression is valid or not. - // We will check that later using the RegExp object. - - while (index < length) { - char = this.peek(index); - value += char; - body += char; - - if (isCharSet) { - if (char === "]") { - if (this.peek(index - 1) !== "\\" || this.peek(index - 2) === "\\") { - isCharSet = false; - } - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - } - - index += 1; - continue; - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - - if (char === "/") { - index += 1; - continue; - } - - if (char === "[") { - index += 1; - continue; - } - } - - if (char === "[") { - isCharSet = true; - index += 1; - continue; - } - - if (char === "/") { - body = body.substr(0, body.length - 1); - terminated = true; - index += 1; - break; - } - - index += 1; - } - - // A regular expression that was never closed is an - // error from which we cannot recover. - - if (!terminated) { - this.trigger("error", { - code: "E015", - line: this.line, - character: this.from - }); - - return void this.trigger("fatal", { - line: this.line, - from: this.from - }); - } - - // Parse flags (if any). - - while (index < length) { - char = this.peek(index); - if (!/[gim]/.test(char)) { - break; - } - flags.push(char); - value += char; - index += 1; - } - - // Check regular expression for correctness. - - try { - new RegExp(body, flags.join("")); - } catch (err) { - malformed = true; - this.trigger("error", { - code: "E016", - line: this.line, - character: this.char, - data: [ err.message ] // Platform dependent! - }); - } - - return { - type: Token.RegExp, - value: value, - flags: flags, - isMalformed: malformed - }; - }, - - /* - * Scan for any occurence of mixed tabs and spaces. If smarttabs option - * is on, ignore tabs followed by spaces. - * - * Tabs followed by one space followed by a block comment are allowed. - */ - scanMixedSpacesAndTabs: function () { - var at, match; - - if (state.option.smarttabs) { - // Negative look-behind for "//" - match = this.input.match(/(\/\/|^\s?\*)? \t/); - at = match && !match[1] ? 0 : -1; - } else { - at = this.input.search(/ \t|\t [^\*]/); - } - - return at; - }, - - /* - * Scan for characters that get silently deleted by one or more browsers. - */ - scanUnsafeChars: function () { - return this.input.search(reg.unsafeChars); - }, - - /* - * Produce the next raw token or return 'null' if no tokens can be matched. - * This method skips over all space characters. - */ - next: function (checks) { - this.from = this.char; - - // Move to the next non-space character. - var start; - if (/\s/.test(this.peek())) { - start = this.char; - - while (/\s/.test(this.peek())) { - this.from += 1; - this.skip(); - } - - if (this.peek() === "") { // EOL - if (!/^\s*$/.test(this.getLines()[this.line - 1]) && state.option.trailing) { - this.trigger("warning", { code: "W102", line: this.line, character: start }); - } - } - } - - // Methods that work with multi-line structures and move the - // character pointer. - - var match = this.scanComments() || - this.scanStringLiteral(checks); - - if (match) { - return match; - } - - // Methods that don't move the character pointer. - - match = - this.scanRegExp() || - this.scanPunctuator() || - this.scanKeyword() || - this.scanIdentifier() || - this.scanNumericLiteral(); - - if (match) { - this.skip(match.value.length); - return match; - } - - // No token could be matched, give up. - - return null; - }, - - /* - * Switch to the next line and reset all char pointers. Once - * switched, this method also checks for mixed spaces and tabs - * and other minor warnings. - */ - nextLine: function () { - var char; - - if (this.line >= this.getLines().length) { - return false; - } - - this.input = this.getLines()[this.line]; - this.line += 1; - this.char = 1; - this.from = 1; - - char = this.scanMixedSpacesAndTabs(); - if (char >= 0) { - this.trigger("warning", { code: "W099", line: this.line, character: char + 1 }); - } - - this.input = this.input.replace(/\t/g, state.tab); - char = this.scanUnsafeChars(); - - if (char >= 0) { - this.trigger("warning", { code: "W100", line: this.line, character: char }); - } - - // If there is a limit on line length, warn when lines get too - // long. - - if (state.option.maxlen && state.option.maxlen < this.input.length) { - this.trigger("warning", { code: "W101", line: this.line, character: this.input.length }); - } - - return true; - }, - - /* - * This is simply a synonym for nextLine() method with a friendlier - * public name. - */ - start: function () { - this.nextLine(); - }, - - /* - * Produce the next token. This function is called by advance() to get - * the next token. It retuns a token in a JSLint-compatible format. - */ - token: function () { - /*jshint loopfunc:true */ - var checks = asyncTrigger(); - var token; - - - function isReserved(token, isProperty) { - if (!token.reserved) { - return false; - } - var meta = token.meta; - - if (meta && meta.isFutureReservedWord && state.option.inES5()) { - // ES3 FutureReservedWord in an ES5 environment. - if (!meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (isProperty) { - return false; - } - } - - return true; - } - - // Produce a token object. - var create = function (type, value, isProperty) { - /*jshint validthis:true */ - var obj; - - if (type !== "(endline)" && type !== "(end)") { - this.prereg = false; - } - - if (type === "(punctuator)") { - switch (value) { - case ".": - case ")": - case "~": - case "#": - case "]": - this.prereg = false; - break; - default: - this.prereg = true; - } - - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - } - - if (type === "(identifier)") { - if (value === "return" || value === "case" || value === "typeof") { - this.prereg = true; - } - - if (_.has(state.syntax, value)) { - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - - // If this can't be a reserved keyword, reset the object. - if (!isReserved(obj, isProperty && type === "(identifier)")) { - obj = null; - } - } - } - - if (!obj) { - obj = Object.create(state.syntax[type]); - } - - obj.identifier = (type === "(identifier)"); - obj.type = obj.type || type; - obj.value = value; - obj.line = this.line; - obj.character = this.char; - obj.from = this.from; - - if (isProperty && obj.identifier) { - obj.isProperty = isProperty; - } - - obj.check = checks.check; - - return obj; - }.bind(this); - - for (;;) { - if (!this.input.length) { - return create(this.nextLine() ? "(endline)" : "(end)", ""); - } - - token = this.next(checks); - - if (!token) { - if (this.input.length) { - // Unexpected character. - this.trigger("error", { - code: "E024", - line: this.line, - character: this.char, - data: [ this.peek() ] - }); - - this.input = ""; - } - - continue; - } - - switch (token.type) { - case Token.StringLiteral: - this.triggerAsync("String", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - quote: token.quote - }, checks, function () { return true; }); - - return create("(string)", token.value); - case Token.Identifier: - this.trigger("Identifier", { - line: this.line, - char: this.char, - from: this.form, - name: token.value, - isProperty: state.tokens.curr.id === "." - }); - - /* falls through */ - case Token.Keyword: - case Token.NullLiteral: - case Token.BooleanLiteral: - return create("(identifier)", token.value, state.tokens.curr.id === "."); - - case Token.NumericLiteral: - if (token.isMalformed) { - this.trigger("warning", { - code: "W045", - line: this.line, - character: this.char, - data: [ token.value ] - }); - } - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }, checks, function () { return token.base === 16 && state.jsonMode; }); - - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, function () { - return state.directive["use strict"] && token.base === 8; - }); - - this.trigger("Number", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - base: token.base, - isMalformed: token.malformed - }); - - return create("(number)", token.value); - - case Token.RegExp: - return create("(regexp)", token.value); - - case Token.Comment: - state.tokens.curr.comment = true; - - if (token.isSpecial) { - return { - id: '(comment)', - value: token.value, - body: token.body, - type: token.commentType, - isSpecial: token.isSpecial, - line: this.line, - character: this.char, - from: this.from - }; - } - - break; - - case "": - break; - - default: - return create("(punctuator)", token.value); - } - } - } -}; - -exports.Lexer = Lexer; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/messages.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/messages.js deleted file mode 100644 index 241ce16..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/messages.js +++ /dev/null @@ -1,218 +0,0 @@ -"use strict"; - -var _ = require("underscore"); - -var errors = { - // JSHint options - E001: "Bad option: '{a}'.", - E002: "Bad option value.", - - // JSHint input - E003: "Expected a JSON value.", - E004: "Input is neither a string nor an array of strings.", - E005: "Input is empty.", - E006: "Unexpected early end of program.", - - // Strict mode - E007: "Missing \"use strict\" statement.", - E008: "Strict violation.", - E009: "Option 'validthis' can't be used in a global scope.", - E010: "'with' is not allowed in strict mode.", - - // Constants - E011: "const '{a}' has already been declared.", - E012: "const '{a}' is initialized to 'undefined'.", - E013: "Attempting to override '{a}' which is a constant.", - - // Regular expressions - E014: "A regular expression literal can be confused with '/='.", - E015: "Unclosed regular expression.", - E016: "Invalid regular expression.", - - // Tokens - E017: "Unclosed comment.", - E018: "Unbegun comment.", - E019: "Unmatched '{a}'.", - E020: "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - E021: "Expected '{a}' and instead saw '{b}'.", - E022: "Line breaking error '{a}'.", - E023: "Missing '{a}'.", - E024: "Unexpected '{a}'.", - E025: "Missing ':' on a case clause.", - E026: "Missing '}' to match '{' from line {a}.", - E027: "Missing ']' to match '[' form line {a}.", - E028: "Illegal comma.", - E029: "Unclosed string.", - - // Everything else - E030: "Expected an identifier and instead saw '{a}'.", - E031: "Bad assignment.", // FIXME: Rephrase - E032: "Expected a small integer or 'false' and instead saw '{a}'.", - E033: "Expected an operator and instead saw '{a}'.", - E034: "get/set are ES5 features.", - E035: "Missing property name.", - E036: "Expected to see a statement and instead saw a block.", - E037: null, // Vacant - E038: null, // Vacant - E039: "Function declarations are not invocable. Wrap the whole function invocation in parens.", - E040: "Each value should have its own case label.", - E041: "Unrecoverable syntax error.", - E042: "Stopping.", - E043: "Too many errors.", - E044: "'{a}' is already defined and can't be redefined.", - E045: "Invalid for each loop.", - E046: "A yield statement shall be within a generator function (with syntax: `function*`)", - E047: "A generator function shall contain a yield statement.", - E048: "Let declaration not directly within block.", - E049: "A {a} cannot be named '{b}'.", - E050: "Mozilla requires the yield expression to be parenthesized here.", - E051: "Regular parameters cannot come after default parameters." -}; - -var warnings = { - W001: "'hasOwnProperty' is a really bad name.", - W002: "Value of '{a}' may be overwritten in IE 8 and earlier.", - W003: "'{a}' was used before it was defined.", - W004: "'{a}' is already defined.", - W005: "A dot following a number can be confused with a decimal point.", - W006: "Confusing minuses.", - W007: "Confusing pluses.", - W008: "A leading decimal point can be confused with a dot: '{a}'.", - W009: "The array literal notation [] is preferrable.", - W010: "The object literal notation {} is preferrable.", - W011: "Unexpected space after '{a}'.", - W012: "Unexpected space before '{a}'.", - W013: "Missing space after '{a}'.", - W014: "Bad line breaking before '{a}'.", - W015: "Expected '{a}' to have an indentation at {b} instead at {c}.", - W016: "Unexpected use of '{a}'.", - W017: "Bad operand.", - W018: "Confusing use of '{a}'.", - W019: "Use the isNaN function to compare with NaN.", - W020: "Read only.", - W021: "'{a}' is a function.", - W022: "Do not assign to the exception parameter.", - W023: "Expected an identifier in an assignment and instead saw a function invocation.", - W024: "Expected an identifier and instead saw '{a}' (a reserved word).", - W025: "Missing name in function declaration.", - W026: "Inner functions should be listed at the top of the outer function.", - W027: "Unreachable '{a}' after '{b}'.", - W028: "Label '{a}' on {b} statement.", - W030: "Expected an assignment or function call and instead saw an expression.", - W031: "Do not use 'new' for side effects.", - W032: "Unnecessary semicolon.", - W033: "Missing semicolon.", - W034: "Unnecessary directive \"{a}\".", - W035: "Empty block.", - W036: "Unexpected /*member '{a}'.", - W037: "'{a}' is a statement label.", - W038: "'{a}' used out of scope.", - W039: "'{a}' is not allowed.", - W040: "Possible strict violation.", - W041: "Use '{a}' to compare with '{b}'.", - W042: "Avoid EOL escaping.", - W043: "Bad escaping of EOL. Use option multistr if needed.", - W044: "Bad or unnecessary escaping.", - W045: "Bad number '{a}'.", - W046: "Don't use extra leading zeros '{a}'.", - W047: "A trailing decimal point can be confused with a dot: '{a}'.", - W048: "Unexpected control character in regular expression.", - W049: "Unexpected escaped character '{a}' in regular expression.", - W050: "JavaScript URL.", - W051: "Variables should not be deleted.", - W052: "Unexpected '{a}'.", - W053: "Do not use {a} as a constructor.", - W054: "The Function constructor is a form of eval.", - W055: "A constructor name should start with an uppercase letter.", - W056: "Bad constructor.", - W057: "Weird construction. Is 'new' unnecessary?", - W058: "Missing '()' invoking a constructor.", - W059: "Avoid arguments.{a}.", - W060: "document.write can be a form of eval.", - W061: "eval can be harmful.", - W062: "Wrap an immediate function invocation in parens " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself.", - W063: "Math is not a function.", - W064: "Missing 'new' prefix when invoking a constructor.", - W065: "Missing radix parameter.", - W066: "Implied eval. Consider passing a function instead of a string.", - W067: "Bad invocation.", - W068: "Wrapping non-IIFE function literals in parens is unnecessary.", - W069: "['{a}'] is better written in dot notation.", - W070: "Extra comma. (it breaks older versions of IE)", - W071: "This function has too many statements. ({a})", - W072: "This function has too many parameters. ({a})", - W073: "Blocks are nested too deeply. ({a})", - W074: "This function's cyclomatic complexity is too high. ({a})", - W075: "Duplicate key '{a}'.", - W076: "Unexpected parameter '{a}' in get {b} function.", - W077: "Expected a single parameter in set {a} function.", - W078: "Setter is defined without getter.", - W079: "Redefinition of '{a}'.", - W080: "It's not necessary to initialize '{a}' to 'undefined'.", - W081: "Too many var statements.", - W082: "Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", - W083: "Don't make functions within a loop.", - W084: "Expected a conditional expression and instead saw an assignment.", - W085: "Don't use 'with'.", - W086: "Expected a 'break' statement before '{a}'.", - W087: "Forgotten 'debugger' statement?", - W088: "Creating global 'for' variable. Should be 'for (var {a} ...'.", - W089: "The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", - W090: "'{a}' is not a statement label.", - W091: "'{a}' is out of scope.", - W092: "Wrap the /regexp/ literal in parens to disambiguate the slash operator.", - W093: "Did you mean to return a conditional instead of an assignment?", - W094: "Unexpected comma.", - W095: "Expected a string and instead saw {a}.", - W096: "The '{a}' key may produce unexpected results.", - W097: "Use the function form of \"use strict\".", - W098: "'{a}' is defined but never used.", - W099: "Mixed spaces and tabs.", - W100: "This character may get silently deleted by one or more browsers.", - W101: "Line is too long.", - W102: "Trailing whitespace.", - W103: "The '{a}' property is deprecated.", - W104: "'{a}' is only available in JavaScript 1.7.", - W105: "Unexpected {a} in '{b}'.", - W106: "Identifier '{a}' is not in camel case.", - W107: "Script URL.", - W108: "Strings must use doublequote.", - W109: "Strings must use singlequote.", - W110: "Mixed double and single quotes.", - W112: "Unclosed string.", - W113: "Control character in string: {a}.", - W114: "Avoid {a}.", - W115: "Octal literals are not allowed in strict mode.", - W116: "Expected '{a}' and instead saw '{b}'.", - W117: "'{a}' is not defined.", - W118: "'{a}' is only available in Mozilla JavaScript extensions (use moz option).", - W119: "'{a}' is only available in ES6 (use esnext option).", - W120: "You might be leaking a variable ({a}) here." -}; - -var info = { - I001: "Comma warnings can be turned off with 'laxcomma'.", - I002: "Reserved words as properties can be used under the 'es5' option.", - I003: "ES5 option is now set per default" -}; - -exports.errors = {}; -exports.warnings = {}; -exports.info = {}; - -_.each(errors, function (desc, code) { - exports.errors[code] = { code: code, desc: desc }; -}); - -_.each(warnings, function (desc, code) { - exports.warnings[code] = { code: code, desc: desc }; -}); - -_.each(info, function (desc, code) { - exports.info[code] = { code: code, desc: desc }; -}); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/platforms/rhino.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/platforms/rhino.js deleted file mode 100644 index cc4116a..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/platforms/rhino.js +++ /dev/null @@ -1,113 +0,0 @@ -/*jshint boss: true, rhino: true, unused: true, undef: true, white: true, quotmark: double */ -/*global JSHINT */ - -(function (args) { - "use strict"; - - var filenames = []; - var flags = {}; - var optstr; // arg1=val1,arg2=val2,... - var predef; // global1=true,global2,global3,... - var opts = {}; - var globals = {}; - var retval = 0; - - args.forEach(function (arg) { - if (arg.indexOf("--") === 0) { - // Configuration Flags might be boolean or will be split into name and value - if (arg.indexOf("=") > -1) { - var o = arg.split("="); - flags[o[0].slice(2)] = o[1]; - } else { - flags[arg.slice(2)] = true; - } - - return; - } else if (arg.indexOf("=") > -1) { - // usual rhino configuration, like "boss=true,browser=true" - if (!optstr) { - // First time it's the options. - optstr = arg; - } else { - predef = arg; - } - - return; - } - - if (optstr) { - predef = arg; - return; - } - - filenames.push(arg); - }); - - if (filenames.length === 0) { - print("Usage: jshint.js file.js"); - quit(1); - } - - // If a config flag has been provided, try and load that - if ("config" in flags) { - var cfgFileContent; - try { - cfgFileContent = readFile(flags.config); - } catch (e) { - print("Could not read config file " + flags.config); - quit(1); - } - - opts = JSON.parse(cfgFileContent); - } - - if (optstr) { - optstr.split(",").forEach(function (arg) { - var o = arg.split("="); - if (o[0] === "indent") { - opts[o[0]] = parseInt(o[1], 10); - } else { - opts[o[0]] = (function (ov) { - switch (ov) { - case "true": - return true; - case "false": - return false; - default: - return ov; - } - }(o[1])); - } - }); - } - - globals = opts.globals || {}; - delete(opts.globals); - - if (predef) { - predef.split(",").forEach(function (arg) { - var global = arg.split("="); - globals[global[0]] = global[1] === "true" ? true : false; - }); - } - - filenames.forEach(function (name) { - var input = readFile(name); - - if (!input) { - print("jshint: Couldn't open file " + name); - quit(1); - } - - if (!JSHINT(input, opts, globals)) { - for (var i = 0, err; err = JSHINT.errors[i]; i += 1) { - print(err.reason + " (" + name + ":" + err.line + ":" + err.character + ")"); - print("> " + (err.evidence || "").replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); - print(""); - } - retval = 2; - } - }); - - quit(retval); -}(arguments)); diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reg.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reg.js deleted file mode 100644 index 5a54a31..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reg.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Regular expressions. Some of these are stupidly long. - */ - -/*jshint maxlen:1000 */ - -"use string"; - -// Unsafe comment or string (ax) -exports.unsafeString = - /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - -// Unsafe characters that are silently deleted by one or more browsers (cx) -exports.unsafeChars = - /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -// Characters in strings that need escaping (nx and nxg) -exports.needEsc = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -exports.needEscGlobal = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - -// Star slash (lx) -exports.starSlash = /\*\//; - -// Identifier (ix) -exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - -// JavaScript URL (jx) -exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - -// Catches /* falls through */ comments (ft) -exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/checkstyle.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/checkstyle.js deleted file mode 100644 index 5306d1c..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/checkstyle.js +++ /dev/null @@ -1,115 +0,0 @@ -// Author: Boy Baukema -// http://github.com/relaxnow -module.exports = -{ - reporter: function (results, data, opts) - { - "use strict"; - - var files = {}, - out = [], - pairs = { - "&": "&", - '"': """, - "'": "'", - "<": "<", - ">": ">" - }, - file, fileName, i, issue, globals, unuseds, errorMessage; - - opts = opts || {}; - - function encode(s) { - for (var r in pairs) { - if (typeof(s) !== "undefined") { - s = s.replace(new RegExp(r, "g"), pairs[r]); - } - } - return s || ""; - } - - results.forEach(function (result) { - // Register the file - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - - // Create the error message - errorMessage = result.error.reason; - if (opts.verbose) { - errorMessage += ' (' + result.error.code + ')'; - } - - // Add the error - files[result.file].push({ - severity: 'error', - line: result.error.line, - column: result.error.character, - message: errorMessage, - source: 'jshint.' + result.error.code - }); - }); - - data.forEach(function (result) { - file = data.file; - globals = result.implieds; - unuseds = result.unused; - - // Register the file - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - - if (globals) { - globals.forEach(function (global) { - files[result.file].push({ - severity: 'warning', - line: global.line, - column: 0, - message: "Implied global '" + global.name + "'", - source: 'jshint.implied-globals' - }); - }); - } - if (unuseds) { - unuseds.forEach(function (unused) { - files[result.file].push({ - severity: 'warning', - line: unused.line, - column: 0, - message: "Unused variable: '" + unused.name + "'", - source: 'jshint.implied-unuseds' - }); - }); - } - }); - - out.push(""); - out.push(""); - - for (fileName in files) { - if (files.hasOwnProperty(fileName)) { - out.push("\t"); - for (i = 0; i < files[fileName].length; i++) { - issue = files[fileName][i]; - out.push( - "\t\t" - ); - } - out.push("\t"); - } - } - - out.push(""); - - process.stdout.write(out.join("\n") + "\n"); - } -}; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/default.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/default.js deleted file mode 100644 index 2a432f1..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/default.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -module.exports = { - reporter: function (results, data, opts) { - var len = results.length; - var str = ''; - var prevfile; - - opts = opts || {}; - - results.forEach(function (result) { - var file = result.file; - var error = result.error; - - if (prevfile && prevfile !== file) { - str += "\n"; - } - prevfile = file; - - str += file + ': line ' + error.line + ', col ' + - error.character + ', ' + error.reason; - - if (opts.verbose) { - str += ' (' + error.code + ')'; - } - - str += '\n'; - }); - - if (str) { - process.stdout.write(str + "\n" + len + ' error' + ((len === 1) ? '' : 's') + "\n"); - } - } -}; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/jslint_xml.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/jslint_xml.js deleted file mode 100644 index 6900471..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/jslint_xml.js +++ /dev/null @@ -1,57 +0,0 @@ -module.exports = -{ - reporter: function (results) - { - "use strict"; - - var files = {}, - out = [], - pairs = { - "&": "&", - '"': """, - "'": "'", - "<": "<", - ">": ">" - }, - file, i, issue; - - function encode(s) { - for (var r in pairs) { - if (typeof(s) !== "undefined") { - s = s.replace(new RegExp(r, "g"), pairs[r]); - } - } - return s || ""; - } - - - results.forEach(function (result) { - result.file = result.file.replace(/^\.\//, ''); - if (!files[result.file]) { - files[result.file] = []; - } - files[result.file].push(result.error); - }); - - out.push(""); - out.push(""); - - for (file in files) { - out.push("\t"); - for (i = 0; i < files[file].length; i++) { - issue = files[file][i]; - out.push("\t\t"); - } - out.push("\t"); - } - - out.push(""); - - process.stdout.write(out.join("\n") + "\n"); - } -}; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/non_error.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/non_error.js deleted file mode 100644 index 384ce56..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/reporters/non_error.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; - -module.exports = { - reporter: function (results, data, opts) { - var len = results.length, - str = '', - file, error, globals, unuseds; - - results.forEach(function (result) { - file = result.file; - error = result.error; - str += file + ': line ' + error.line + ', col ' + - error.character + ', ' + error.reason; - - // Add the error code if the --verbose option is set - if (opts.verbose) { - str += ' (' + error.code + ')'; - } - - str += '\n'; - }); - - str += len > 0 ? ("\n" + len + ' error' + ((len === 1) ? '' : 's')) : ""; - - data.forEach(function (data) { - file = data.file; - globals = data.implieds; - unuseds = data.unused; - - if (globals || unuseds) { - str += '\n\n' + file + ' :\n'; - } - - if (globals) { - str += '\tImplied globals:\n'; - globals.forEach(function (global) { - str += '\t\t' + global.name + ': ' + global.line + '\n'; - }); - } - if (unuseds) { - str += '\tUnused Variables:\n\t\t'; - unuseds.forEach(function (unused) { - str += unused.name + '(' + unused.line + '), '; - }); - } - }); - - if (str) { - process.stdout.write(str + "\n"); - } - } -}; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/state.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/state.js deleted file mode 100644 index 52ce387..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/state.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -var state = { - syntax: {}, - - reset: function () { - this.tokens = { - prev: null, - next: null, - curr: null - }; - - this.option = {}; - this.ignored = {}; - this.directive = {}; - this.jsonMode = false; - this.jsonWarnings = []; - this.lines = []; - this.tab = ""; - this.cache = {}; // Node.JS doesn't have Map. Sniff. - } -}; - -exports.state = state; diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/style.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/style.js deleted file mode 100644 index bb1b365..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/style.js +++ /dev/null @@ -1,171 +0,0 @@ -"use strict"; - -exports.register = function (linter) { - // Check for properties named __proto__. This special property was - // deprecated and then re-introduced for ES6. - - linter.on("Identifier", function style_scanProto(data) { - if (linter.getOption("proto")) { - return; - } - - if (data.name === "__proto__") { - linter.warn("W103", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for properties named __iterator__. This is a special property - // available only in browsers with JavaScript 1.7 implementation. - - linter.on("Identifier", function style_scanIterator(data) { - if (linter.getOption("iterator")) { - return; - } - - if (data.name === "__iterator__") { - linter.warn("W104", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for dangling underscores. - - linter.on("Identifier", function style_scanDangling(data) { - if (!linter.getOption("nomen")) { - return; - } - - // Underscore.js - if (data.name === "_") { - return; - } - - // In Node, __dirname and __filename should be ignored. - if (linter.getOption("node")) { - if (/^(__dirname|__filename)$/.test(data.name) && !data.isProperty) { - return; - } - } - - if (/^(_+.*|.*_+)$/.test(data.name)) { - linter.warn("W105", { - line: data.line, - char: data.from, - data: [ "dangling '_'", data.name ] - }); - } - }); - - // Check that all identifiers are using camelCase notation. - // Exceptions: names like MY_VAR and _myVar. - - linter.on("Identifier", function style_scanCamelCase(data) { - if (!linter.getOption("camelcase")) { - return; - } - - if (data.name.replace(/^_+/, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) { - linter.warn("W106", { - line: data.line, - char: data.from, - data: [ data.name ] - }); - } - }); - - // Enforce consistency in style of quoting. - - linter.on("String", function style_scanQuotes(data) { - var quotmark = linter.getOption("quotmark"); - var code; - - if (!quotmark) { - return; - } - - // If quotmark is set to 'single' warn about all double-quotes. - - if (quotmark === "single" && data.quote !== "'") { - code = "W109"; - } - - // If quotmark is set to 'double' warn about all single-quotes. - - if (quotmark === "double" && data.quote !== "\"") { - code = "W108"; - } - - // If quotmark is set to true, remember the first quotation style - // and then warn about all others. - - if (quotmark === true) { - if (!linter.getCache("quotmark")) { - linter.setCache("quotmark", data.quote); - } - - if (linter.getCache("quotmark") !== data.quote) { - code = "W110"; - } - } - - if (code) { - linter.warn(code, { - line: data.line, - char: data.char, - }); - } - }); - - linter.on("Number", function style_scanNumbers(data) { - if (data.value.charAt(0) === ".") { - // Warn about a leading decimal point. - linter.warn("W008", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (data.value.substr(data.value.length - 1) === ".") { - // Warn about a trailing decimal point. - linter.warn("W047", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (/^00+/.test(data.value)) { - // Multiple leading zeroes. - linter.warn("W046", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - }); - - // Warn about script URLs. - - linter.on("String", function style_scanJavaScriptURLs(data) { - var re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - - if (linter.getOption("scripturl")) { - return; - } - - if (re.test(data.value)) { - linter.warn("W107", { - line: data.line, - char: data.char - }); - } - }); -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/vars.js b/node_modules/grunt-contrib-jshint/node_modules/jshint/src/vars.js deleted file mode 100644 index 327678d..0000000 --- a/node_modules/grunt-contrib-jshint/node_modules/jshint/src/vars.js +++ /dev/null @@ -1,588 +0,0 @@ -// jshint -W001 - -"use strict"; - -// Identifiers provided by the ECMAScript standard. - -exports.reservedVars = { - arguments : false, - NaN : false -}; - -exports.ecmaIdentifiers = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Math : false, - Map : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false -}; - -// Global variables commonly provided by a web browser environment. - -exports.browser = { - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - CustomEvent : false, - DOMParser : false, - defaultStatus : false, - document : false, - Element : false, - ElementTimeControl : false, - event : false, - FileReader : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement: false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement: false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement: false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - MouseEvent : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - SVGAElement : false, - SVGAltGlyphDefElement: false, - SVGAltGlyphElement : false, - SVGAltGlyphItemElement: false, - SVGAngle : false, - SVGAnimateColorElement: false, - SVGAnimateElement : false, - SVGAnimateMotionElement: false, - SVGAnimateTransformElement: false, - SVGAnimatedAngle : false, - SVGAnimatedBoolean : false, - SVGAnimatedEnumeration: false, - SVGAnimatedInteger : false, - SVGAnimatedLength : false, - SVGAnimatedLengthList: false, - SVGAnimatedNumber : false, - SVGAnimatedNumberList: false, - SVGAnimatedPathData : false, - SVGAnimatedPoints : false, - SVGAnimatedPreserveAspectRatio: false, - SVGAnimatedRect : false, - SVGAnimatedString : false, - SVGAnimatedTransformList: false, - SVGAnimationElement : false, - SVGCSSRule : false, - SVGCircleElement : false, - SVGClipPathElement : false, - SVGColor : false, - SVGColorProfileElement: false, - SVGColorProfileRule : false, - SVGComponentTransferFunctionElement: false, - SVGCursorElement : false, - SVGDefsElement : false, - SVGDescElement : false, - SVGDocument : false, - SVGElement : false, - SVGElementInstance : false, - SVGElementInstanceList: false, - SVGEllipseElement : false, - SVGExternalResourcesRequired: false, - SVGFEBlendElement : false, - SVGFEColorMatrixElement: false, - SVGFEComponentTransferElement: false, - SVGFECompositeElement: false, - SVGFEConvolveMatrixElement: false, - SVGFEDiffuseLightingElement: false, - SVGFEDisplacementMapElement: false, - SVGFEDistantLightElement: false, - SVGFEFloodElement : false, - SVGFEFuncAElement : false, - SVGFEFuncBElement : false, - SVGFEFuncGElement : false, - SVGFEFuncRElement : false, - SVGFEGaussianBlurElement: false, - SVGFEImageElement : false, - SVGFEMergeElement : false, - SVGFEMergeNodeElement: false, - SVGFEMorphologyElement: false, - SVGFEOffsetElement : false, - SVGFEPointLightElement: false, - SVGFESpecularLightingElement: false, - SVGFESpotLightElement: false, - SVGFETileElement : false, - SVGFETurbulenceElement: false, - SVGFilterElement : false, - SVGFilterPrimitiveStandardAttributes: false, - SVGFitToViewBox : false, - SVGFontElement : false, - SVGFontFaceElement : false, - SVGFontFaceFormatElement: false, - SVGFontFaceNameElement: false, - SVGFontFaceSrcElement: false, - SVGFontFaceUriElement: false, - SVGForeignObjectElement: false, - SVGGElement : false, - SVGGlyphElement : false, - SVGGlyphRefElement : false, - SVGGradientElement : false, - SVGHKernElement : false, - SVGICCColor : false, - SVGImageElement : false, - SVGLangSpace : false, - SVGLength : false, - SVGLengthList : false, - SVGLineElement : false, - SVGLinearGradientElement: false, - SVGLocatable : false, - SVGMPathElement : false, - SVGMarkerElement : false, - SVGMaskElement : false, - SVGMatrix : false, - SVGMetadataElement : false, - SVGMissingGlyphElement: false, - SVGNumber : false, - SVGNumberList : false, - SVGPaint : false, - SVGPathElement : false, - SVGPathSeg : false, - SVGPathSegArcAbs : false, - SVGPathSegArcRel : false, - SVGPathSegClosePath : false, - SVGPathSegCurvetoCubicAbs: false, - SVGPathSegCurvetoCubicRel: false, - SVGPathSegCurvetoCubicSmoothAbs: false, - SVGPathSegCurvetoCubicSmoothRel: false, - SVGPathSegCurvetoQuadraticAbs: false, - SVGPathSegCurvetoQuadraticRel: false, - SVGPathSegCurvetoQuadraticSmoothAbs: false, - SVGPathSegCurvetoQuadraticSmoothRel: false, - SVGPathSegLinetoAbs : false, - SVGPathSegLinetoHorizontalAbs: false, - SVGPathSegLinetoHorizontalRel: false, - SVGPathSegLinetoRel : false, - SVGPathSegLinetoVerticalAbs: false, - SVGPathSegLinetoVerticalRel: false, - SVGPathSegList : false, - SVGPathSegMovetoAbs : false, - SVGPathSegMovetoRel : false, - SVGPatternElement : false, - SVGPoint : false, - SVGPointList : false, - SVGPolygonElement : false, - SVGPolylineElement : false, - SVGPreserveAspectRatio: false, - SVGRadialGradientElement: false, - SVGRect : false, - SVGRectElement : false, - SVGRenderingIntent : false, - SVGSVGElement : false, - SVGScriptElement : false, - SVGSetElement : false, - SVGStopElement : false, - SVGStringList : false, - SVGStylable : false, - SVGStyleElement : false, - SVGSwitchElement : false, - SVGSymbolElement : false, - SVGTRefElement : false, - SVGTSpanElement : false, - SVGTests : false, - SVGTextContentElement: false, - SVGTextElement : false, - SVGTextPathElement : false, - SVGTextPositioningElement: false, - SVGTitleElement : false, - SVGTransform : false, - SVGTransformList : false, - SVGTransformable : false, - SVGURIReference : false, - SVGUnitTypes : false, - SVGUseElement : false, - SVGVKernElement : false, - SVGViewElement : false, - SVGViewSpec : false, - SVGZoomAndPan : false, - TimeEvent : false, - top : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false -}; - -exports.devel = { - alert : false, - confirm: false, - console: false, - Debug : false, - opera : false, - prompt : false -}; - -exports.worker = { - importScripts: true, - postMessage : true, - self : true -}; - -// Widely adopted global names that are not part of ECMAScript standard -exports.nonstandard = { - escape : false, - unescape: false -}; - -// Globals provided by popular JavaScript environments. - -exports.couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false -}; - -exports.node = { - __filename : false, - __dirname : false, - Buffer : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval : false, - setImmediate : false, // v0.9.1+ - clearImmediate: false // v0.9.1+ -}; - -exports.phantom = { - phantom : true, - require : true, - WebPage : true, - console : true, // in examples, but undocumented - exports : true // v1.7+ -}; - -exports.rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false -}; - -exports.shelljs = { - target : false, - echo : false, - exit : false, - cd : false, - pwd : false, - ls : false, - find : false, - cp : false, - rm : false, - mv : false, - mkdir : false, - test : false, - cat : false, - sed : false, - grep : false, - which : false, - dirs : false, - pushd : false, - popd : false, - env : false, - exec : false, - chmod : false, - config : false, - error : false, - tempdir : false -}; - -exports.typed = { - ArrayBuffer : false, - ArrayBufferView : false, - DataView : false, - Float32Array : false, - Float64Array : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - Uint8ClampedArray : false -}; - -exports.wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true -}; - -// Globals provided by popular JavaScript libraries. - -exports.dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require": false -}; - -exports.jquery = { - "$" : false, - jQuery : false -}; - -exports.mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator: false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false -}; - -exports.prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false -}; - -exports.yui = { - YUI : false, - Y : false, - YUI_config: false -}; - diff --git a/node_modules/grunt-contrib-jshint/package.json b/node_modules/grunt-contrib-jshint/package.json deleted file mode 100644 index 431210c..0000000 --- a/node_modules/grunt-contrib-jshint/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "grunt-contrib-jshint", - "description": "Validate files with JSHint.", - "version": "0.6.4", - "homepage": "https://github.com/gruntjs/grunt-contrib-jshint", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-jshint.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-jshint/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-jshint/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "dependencies": { - "jshint": "~2.1.10" - }, - "devDependencies": { - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-internal": "~0.4.6", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin" - ], - "contributors": [ - { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com/" - } - ], - "readme": "# grunt-contrib-jshint v0.6.4 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-jshint.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jshint)\n\n> Validate files with JSHint.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-jshint --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-contrib-jshint');\n```\n\n\n\n\n## Jshint task\n_Run this task with the `grunt jshint` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n\nFor more explanations of the lint errors JSHint will throw at you please visit [jslinterrors.com](http://jslinterrors.com/).\n\n### Options\n\nAny specified option will be passed through directly to [JSHint][], thus you can specify any option that JSHint supports. See the [JSHint documentation][] for a list of supported options.\n\n[JSHint]: http://www.jshint.com/\n[JSHint documentation]: http://www.jshint.com/docs/\n\nA few additional options are supported:\n\n#### globals\nType: `Object`\nDefault value: `null`\n\nA map of global variables, with keys as names and a boolean value to determine if they are assignable. This is not a standard JSHint option, but is passed into the `JSHINT` function as its third argument. See the [JSHint documentation][] for more information.\n\n#### jshintrc\nType: `String`\nDefault value: `null`\n\nIf this filename is specified, options and globals defined therein will be used. The `jshintrc` file must be valid JSON and looks something like this:\n\n```json\n{\n \"curly\": true,\n \"eqnull\": true,\n \"eqeqeq\": true,\n \"undef\": true,\n \"globals\": {\n \"jQuery\": true\n }\n}\n```\n\n*Be aware that `jshintrc` settings are not merged with your Grunt options.*\n\n#### extensions\nType: `String`\nDefault value: `''`\n\nA list of non-dot-js extensions to check.\n\n#### ignores\nType: `Array`\nDefault value: `null`\n\nA list of files and dirs to ignore. This will override your `.jshintignore` file if set and does not merge.\n\n#### force\nType: `Boolean`\nDefault value: `false`\n\nSet `force` to `true` to report JSHint errors but not fail the task.\n\n#### reporter\nType: `String`\nDefault value: `null`\n\nAllows you to modify this plugins output. By default it will use a built-in Grunt reporter. Set the path to your own custom reporter or to one of the built-in JSHint reporters: `jslint` or `checkstyle`.\n\nSee also: [Writing your own JSHint reporter.](http://jshint.com/docs/reporter/)\n\n#### reporterOutput\nType: `String`\nDefault value: `null`\n\nSpecify a filepath to output the results of a reporter. If `reporterOutput` is specified then all output will be written to the given filepath instead of printed to stdout.\n\n### Usage examples\n\n#### Wildcards\nIn this example, running `grunt jshint:all` (or `grunt jshint` because `jshint` is a [multi task](http://gruntjs.com/configuring-tasks#task-configuration-and-targets)) will lint the project's Gruntfile as well as all JavaScript files in the `lib` and `test` directories and their subdirectores, using the default JSHint options.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n jshint: {\n all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js']\n }\n});\n```\n\n#### Linting before and after concatenating\nIn this example, running `grunt jshint` will lint both the \"beforeconcat\" set and \"afterconcat\" sets of files. This is not ideal, because `dist/output.js` may get linted before it gets created via the [grunt-contrib-concat plugin](https://github.com/gruntjs/grunt-contrib-concat) `concat` task.\n\nIn this case, you should lint the \"beforeconcat\" files first, then concat, then lint the \"afterconcat\" files, by running `grunt jshint:beforeconcat concat jshint:afterconcat`.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n concat: {\n dist: {\n src: ['src/foo.js', 'src/bar.js'],\n dest: 'dist/output.js'\n }\n },\n jshint: {\n beforeconcat: ['src/foo.js', 'src/bar.js'],\n afterconcat: ['dist/output.js']\n }\n});\n```\n\n#### Specifying JSHint options and globals\n\nIn this example, custom JSHint options are specified. Note that when `grunt jshint:uses_defaults` is run, those files are linted using the default options, but when `grunt jshint:with_overrides` is run, those files are linted using _merged_ task/target options.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n jshint: {\n options: {\n curly: true,\n eqeqeq: true,\n eqnull: true,\n browser: true,\n globals: {\n jQuery: true\n },\n },\n uses_defaults: ['dir1/**/*.js', 'dir2/**/*.js'],\n with_overrides: {\n options: {\n curly: false,\n undef: true,\n },\n files: {\n src: ['dir3/**/*.js', 'dir4/**/*.js']\n },\n }\n },\n});\n```\n\n#### Ignoring specific warnings\n\nIf you would like to ignore a specific warning:\n\n```shell\n[L24:C9] W015: Expected '}' to have an indentation at 11 instead at 9.\n```\n\nYou can toggle it by prepending `-` to the warning id as an option:\n\n```js\ngrunt.initConfig({\n jshint: {\n ignore_warning: {\n options: {\n '-W015': true,\n },\n src: ['**/*.js'],\n },\n },\n});\n```\n\n#### Ignoring specific files\n\nOccasionally application files and third party libraries share the same directory. To exclude third party code, but include all current and future application files, use a glob for `files` and specifically exclude libraries using `ignores`. In this example, the jQuery file is matched by the glob but subsequently ignored when JSHint does its analysis.\n\n```js\ngrunt.initConfig({\n jshint: {\n files: ['js/*.js'],\n options: {\n ignores: ['js/jquery.js']\n }\n }\n});\n```\n\n\n## Release History\n\n * 2013-08-29   v0.6.4   jshintrc now loaded by jshint allowing comments.\n * 2013-08-15   v0.6.3   Fix module location for jshint 2.1.10.\n * 2013-07-29   v0.6.2   Update to jshint 2.1.7.\n * 2013-07-27   v0.6.1   Peg jshint to 2.1.4 until breaking changes in 2.1.5 are fixed.\n * 2013-06-02   v0.6.0   Dont always succeed the task when using a custom reporter. Bump jshint to 2.1.3.\n * 2013-05-22   v0.5.4   Fix default reporter to show offending file.\n * 2013-05-19   v0.5.3   Performance: Execute the reporter once rather than per file.\n * 2013-05-18   v0.5.2   Fix printing too many erroneous ignored file errors.\n * 2013-05-17   v0.5.1   Fix for when only 1 file is lint free.\n * 2013-05-17   v0.5.0   Bump to jshint 2.0. Add support for .jshintignore files and ignores option Add support for extensions option. Add support for custom reporters and output report to a file.\n * 2013-04-08   v0.4.3   Fix evaluation of predef option when it's an object.\n * 2013-04-08   v0.4.2   Avoid wiping force option when jshintrc is used.\n * 2013-04-06   v0.4.1   Fix to allow object type for deprecated predef.\n * 2013-04-04   v0.4.0   Revert task level options to override jshintrc files.\n * 2013-03-13   v0.3.0   Bump to JSHint 1.1.0. Add force option to report JSHint errors but not fail the task. Add error/warning code to message. Allow task level options to override jshintrc file.\n * 2013-02-26   v0.2.0   Bump to JSHint 1.0\n * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0.\n * 2013-01-18   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-09   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. Switching to this.filesSrc api.\n * 2012-10-18   v0.1.0   Work in progress, not yet officially released.\n\n---\n\nTask submitted by [\"Cowboy\" Ben Alman](http://benalman.com/)\n\n*This file was generated on Thu Aug 29 2013 08:46:48.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-jshint@0.6.4", - "_from": "grunt-contrib-jshint@~0.6.3" -} diff --git a/node_modules/grunt-contrib-jshint/tasks/jshint.js b/node_modules/grunt-contrib-jshint/tasks/jshint.js deleted file mode 100644 index c9ae207..0000000 --- a/node_modules/grunt-contrib-jshint/tasks/jshint.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * grunt-contrib-jshint - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - var path = require('path'); - var jshint = require('./lib/jshint').init(grunt); - - grunt.registerMultiTask('jshint', 'Validate files with JSHint.', function() { - var done = this.async(); - - // Merge task-specific and/or target-specific options with these defaults. - var options = this.options({ - force: false, - reporterOutput: null, - }); - - // log (verbose) options before hooking in the reporter - grunt.verbose.writeflags(options, 'JSHint options'); - - // Report JSHint errors but dont fail the task - var force = options.force; - delete options.force; - - // Whether to output the report to a file - var reporterOutput = options.reporterOutput; - delete options.reporterOutput; - - // Hook into stdout to capture report - var output = ''; - if (reporterOutput) { - grunt.util.hooker.hook(process.stdout, 'write', { - pre: function(out) { - output += out; - return grunt.util.hooker.preempt(); - } - }); - } - - jshint.lint(this.filesSrc, options, function(results, data) { - var failed = 0; - if (results.length > 0) { - // Fail task if errors were logged except if force was set. - failed = force; - } else { - if (jshint.usingGruntReporter === true && data.length > 0) { - grunt.log.ok(data.length + ' file' + (data.length === 1 ? '' : 's') + ' lint free.'); - } - } - - // Write the output of the reporter if wanted - if (reporterOutput) { - grunt.util.hooker.unhook(process.stdout, 'write'); - reporterOutput = grunt.template.process(reporterOutput); - var destDir = path.dirname(reporterOutput); - if (!grunt.file.exists(destDir)) { - grunt.file.mkdir(destDir); - } - grunt.file.write(reporterOutput, output); - grunt.log.ok('Report "' + reporterOutput + '" created.'); - } - - done(failed); - }); - }); - -}; diff --git a/node_modules/grunt-contrib-jshint/tasks/lib/jshint.js b/node_modules/grunt-contrib-jshint/tasks/lib/jshint.js deleted file mode 100644 index fa4d3a6..0000000 --- a/node_modules/grunt-contrib-jshint/tasks/lib/jshint.js +++ /dev/null @@ -1,219 +0,0 @@ -/* - * grunt-contrib-jshint - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -var path = require('path'); -var jshint = require('jshint').JSHINT; -var jshintcli = require('jshint/src/cli'); - -exports.init = function(grunt) { - var exports = { - usingGruntReporter: false - }; - - // No idea why JSHint treats tabs as options.indent # characters wide, but it - // does. See issue: https://github.com/jshint/jshint/issues/430 - var getTabStr = function(options) { - // Do something that's going to error. - jshint('\tx', options || {}); - // If an error occurred, figure out what character JSHint reported and - // subtract one. - var character = jshint.errors && jshint.errors[0] && jshint.errors[0].character - 1; - // If character is actually a number, use it. Otherwise use 1. - var tabsize = isNaN(character) ? 1 : character; - // If tabsize > 1, return something that should be safe to use as a - // placeholder. \uFFFF repeated 2+ times. - return tabsize > 1 && grunt.util.repeat(tabsize, '\uFFFF'); - }; - - var tabregex = /\t/g; - - // Select a reporter (if not using the default Grunt reporter) - // Copied from jshint/src/cli/cli.js until that part is exposed - exports.selectReporter = function(options) { - switch (true) { - // JSLint reporter - case options.reporter === 'jslint': - case options['jslint-reporter']: - options.reporter = 'jshint/src/reporters/jslint_xml.js'; - break; - - // CheckStyle (XML) reporter - case options.reporter === 'checkstyle': - case options['checkstyle-reporter']: - options.reporter = 'jshint/src/reporters/checkstyle.js'; - break; - - // Reporter that displays additional JSHint data - case options['show-non-errors']: - options.reporter = 'jshint/src/reporters/non_error.js'; - break; - - // Custom reporter - case options.reporter !== undefined: - options.reporter = path.resolve(process.cwd(), options.reporter); - } - - var reporter; - if (options.reporter) { - try { - reporter = require(options.reporter).reporter; - exports.usingGruntReporter = false; - } catch (err) { - grunt.fatal(err); - } - } - - // Use the default Grunt reporter if none are found - if (!reporter) { - reporter = exports.reporter; - exports.usingGruntReporter = true; - } - - return reporter; - }; - - // Default Grunt JSHint reporter - exports.reporter = function(results, data) { - // Dont report empty data as its an ignored file - if (data.length < 1) { - grunt.log.error('0 files linted. Please check your ignored files.'); - return; - } - - if (results.length === 0) { - // Success! - grunt.verbose.ok(); - return; - } - - var options = data[0].options; - - // Tab size as reported by JSHint. - var tabstr = getTabStr(options); - var placeholderregex = new RegExp(tabstr, 'g'); - - // Iterate over all errors. - results.forEach(function(result) { - // Display the defending file - var msg = 'Linting' + (result.file ? ' ' + result.file : '') + ' ...'; - grunt.verbose.write(msg); - - // Something went wrong. - grunt.verbose.or.write(msg); - grunt.log.error(); - - var e = result.error; - // Sometimes there's no error object. - if (!e) { return; } - var pos; - var code = ''; - var evidence = e.evidence; - var character = e.character; - if (evidence) { - // Manually increment errorcount since we're not using grunt.log.error(). - grunt.fail.errorcount++; - // Descriptive code error. - pos = '['.red + ('L' + e.line).yellow + ':'.red + ('C' + character).yellow + ']'.red; - if (e.code) { - code = e.code.yellow + ':'.red + ' '; - } - grunt.log.writeln(pos + ' ' + code + e.reason.yellow); - // If necessary, eplace each tab char with something that can be - // swapped out later. - if (tabstr) { - evidence = evidence.replace(tabregex, tabstr); - } - if (character === 0) { - // Beginning of line. - evidence = '?'.inverse.red + evidence; - } else if (character > evidence.length) { - // End of line. - evidence = evidence + ' '.inverse.red; - } else { - // Middle of line. - evidence = evidence.slice(0, character - 1) + evidence[character - 1].inverse.red + - evidence.slice(character); - } - // Replace tab placeholder (or tabs) but with a 2-space soft tab. - evidence = evidence.replace(tabstr ? placeholderregex : tabregex, ' '); - grunt.log.writeln(evidence); - } else { - // Generic "Whoops, too many errors" error. - grunt.log.error(e.reason); - } - }); - grunt.log.writeln(); - }; - - // Run JSHint on the given files with the given options - exports.lint = function(files, options, done) { - var cliOptions = { - verbose: grunt.option('verbose'), - extensions: '', - }; - - // A list of non-dot-js extensions to check - if (options.extensions) { - cliOptions.extensions = options.extensions; - delete options.extensions; - } - - // A list ignored files - if (options.ignores) { - if (typeof options.ignores === 'string') { - options.ignores = [options.ignores]; - } - cliOptions.ignores = options.ignores; - delete options.ignores; - } - - // Select a reporter to use - var reporter = exports.selectReporter(options); - - // Remove bad options that may have came in from the cli - ['reporter', 'jslint-reporter', 'checkstyle-reporter', 'show-non-errors'].forEach(function(opt) { - if (options.hasOwnProperty(opt)) { - delete options[opt]; - } - }); - - // Read JSHint options from a specified jshintrc file. - if (options.jshintrc) { - options = jshintcli.loadConfig(options.jshintrc); - delete options.jshintrc; - } - - // Enable/disable debugging if option explicitly set. - if (grunt.option('debug') !== undefined) { - options.devel = options.debug = grunt.option('debug'); - // Tweak a few things. - if (grunt.option('debug')) { - options.maxerr = Infinity; - } - } - - cliOptions.config = options; - - // Run JSHint on all file and collect results/data - var allResults = []; - var allData = []; - var cliopts = grunt.util._.clone(cliOptions); - cliopts.args = files; - cliopts.reporter = function(results, data) { - reporter(results, data); - allResults = allResults.concat(results); - allData = allData.concat(data); - }; - jshintcli.run(cliopts); - done(allResults, allData); - }; - - return exports; -}; diff --git a/node_modules/grunt-contrib-jshint/test/fixtures/dontlint.txt b/node_modules/grunt-contrib-jshint/test/fixtures/dontlint.txt deleted file mode 100644 index 8aaf1b4..0000000 --- a/node_modules/grunt-contrib-jshint/test/fixtures/dontlint.txt +++ /dev/null @@ -1 +0,0 @@ -Dont lint me! \ No newline at end of file diff --git a/node_modules/grunt-contrib-jshint/test/fixtures/lint.txt b/node_modules/grunt-contrib-jshint/test/fixtures/lint.txt deleted file mode 100644 index 62b1156..0000000 Binary files a/node_modules/grunt-contrib-jshint/test/fixtures/lint.txt and /dev/null differ diff --git a/node_modules/grunt-contrib-jshint/test/fixtures/missingsemicolon.js b/node_modules/grunt-contrib-jshint/test/fixtures/missingsemicolon.js deleted file mode 100644 index 2b2ab22..0000000 --- a/node_modules/grunt-contrib-jshint/test/fixtures/missingsemicolon.js +++ /dev/null @@ -1 +0,0 @@ -var missingsemicolon = true diff --git a/node_modules/grunt-contrib-jshint/test/fixtures/nodemodule.js b/node_modules/grunt-contrib-jshint/test/fixtures/nodemodule.js deleted file mode 100644 index d0e1f2a..0000000 --- a/node_modules/grunt-contrib-jshint/test/fixtures/nodemodule.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -module.exports = function() { -}; diff --git a/node_modules/grunt-contrib-jshint/test/jshint_test.js b/node_modules/grunt-contrib-jshint/test/jshint_test.js deleted file mode 100644 index 7ac3176..0000000 --- a/node_modules/grunt-contrib-jshint/test/jshint_test.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict'; - -var path = require('path'); -var grunt = require('grunt'); -var jshint = require('../tasks/lib/jshint').init(grunt); - -var fixtures = path.join(__dirname, 'fixtures'); - -// Helper for testing stdout -var hooker = grunt.util.hooker; -var stdoutEqual = function(callback, done) { - var actual = ''; - // Hook process.stdout.write - hooker.hook(process.stdout, 'write', { - // This gets executed before the original process.stdout.write. - pre: function(result) { - // Concatenate uncolored result onto actual. - actual += grunt.log.uncolor(result); - // Prevent the original process.stdout.write from executing. - return hooker.preempt(); - } - }); - // Execute the logging code to be tested. - callback(); - // Restore process.stdout.write to its original value. - hooker.unhook(process.stdout, 'write'); - // Actually test the actually-logged stdout string to the expected value. - done(actual); -}; - -exports.jshint = { - basic: function(test) { - test.expect(1); - var files = [path.join(fixtures, 'missingsemicolon.js')]; - var options = {}; - jshint.lint(files, options, function(results, data) { - test.equal(results[0].error.reason, 'Missing semicolon.', 'Should reporter a missing semicolon.'); - test.done(); - }); - }, - jshintrc: function(test) { - test.expect(1); - var files = [path.join(fixtures, 'nodemodule.js')]; - var options = { - jshintrc: path.join(__dirname, '..', '.jshintrc') - }; - jshint.lint(files, options, function(results, data) { - test.ok(results.length === 0, 'Should not have reported any errors with supplied .jshintrc'); - test.done(); - }); - }, - defaultReporter: function(test) { - test.expect(2); - grunt.log.muted = false; - var files = [path.join(fixtures, 'nodemodule.js')]; - var options = {}; - stdoutEqual(function() { - jshint.lint(files, options, function(results, data) {}); - }, function(result) { - test.ok(jshint.usingGruntReporter, 'Should be using the default grunt reporter.'); - test.ok(result.indexOf('[L3:C1] W117: \'module\' is not defined.') !== -1, 'Should have reported errors with the default grunt reporter.'); - test.done(); - }); - }, - defaultReporterErrors: function(test) { - test.expect(3); - grunt.log.muted = false; - var files = [path.join(fixtures, 'nodemodule.js'), path.join(fixtures, 'missingsemicolon.js')]; - var options = {}; - stdoutEqual(function() { - jshint.lint(files, options, function(results, data) {}); - }, function(result) { - test.ok(jshint.usingGruntReporter, 'Should be using the default grunt reporter.'); - test.ok(result.match(/nodemodule\.js\s\.\.\.ERROR/g).length === 2, 'Should have reported nodemodule.js once per error.'); - test.ok(result.match(/missingsemicolon\.js\s\.\.\.ERROR/g).length === 1, 'Should have reported missingsemicolon.js once per error.'); - test.done(); - }); - }, - alternateReporter: function(test) { - test.expect(2); - var files = [path.join(fixtures, 'nodemodule.js')]; - var options = { - reporter: 'jslint' - }; - stdoutEqual(function() { - jshint.lint(files, options, function(results, data) {}); - }, function(result) { - test.ok((jshint.usingGruntReporter === false), 'Should NOT be using the default grunt reporter.'); - test.ok(result.indexOf('') !== -1, 'Should have reported errors with the jslint reporter.'); - test.done(); - }); - }, - reporterOutput: function(test) { - test.expect(1); - var result = grunt.file.read(path.join('tmp', 'report.xml')); - test.ok(result.indexOf('') !== -1, 'Should have reported errors with the checkstyle reporter.'); - test.done(); - }, - dontBlowUp: function(test) { - test.expect(1); - var files = [path.join(fixtures, 'lint.txt')]; - jshint.lint(files, {}, function(results, data) { - test.equal(results[0].error.code, 'W100', 'It should not blow up if an error occurs on character 0.'); - test.done(); - }); - }, - jshintignore: function(test) { - test.expect(1); - var files = [path.join(fixtures, 'dontlint.txt')]; - jshint.lint(files, {}, function(results, data) { - test.equal(data.length, 0, 'Should not have linted a file listed in the .jshintignore.'); - test.done(); - }); - }, - ignoresOption: function(test) { - test.expect(1); - var files = [path.join(fixtures, 'lint.txt')]; - var options = { - ignores: files - }; - jshint.lint(files, options, function(results, data) { - test.equal(data.length, 0, 'Should not have linted a file listed in the ignores option.'); - test.done(); - }); - }, - singleReportCall: function(test) { - test.expect(2); - - // stub jshint.reporter - var reporterCallCount = 0; - var _report = jshint.reporter; - jshint.reporter = function() { reporterCallCount++; }; - - var files = [path.join(fixtures, 'dontlint.txt'), path.join(fixtures, 'lint.txt')]; - jshint.lint(files, {}, function(results, data) { - test.equal(data.length, 1, 'Should not have linted a file listed in the .jshintignore.'); - test.equal(reporterCallCount, 1, 'Should have called the reporter once.'); - test.done(); - }); - } -}; diff --git a/node_modules/grunt-contrib-uglify/.jshintrc b/node_modules/grunt-contrib-uglify/.jshintrc deleted file mode 100644 index f57a8ff..0000000 --- a/node_modules/grunt-contrib-uglify/.jshintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "boss": true, - "eqnull": true, - "node": true -} diff --git a/node_modules/grunt-contrib-uglify/.npmignore b/node_modules/grunt-contrib-uglify/.npmignore deleted file mode 100644 index 9a1b41a..0000000 --- a/node_modules/grunt-contrib-uglify/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -npm-debug.log -tmp -.idea diff --git a/node_modules/grunt-contrib-uglify/.travis.yml b/node_modules/grunt-contrib-uglify/.travis.yml deleted file mode 100644 index 5766191..0000000 --- a/node_modules/grunt-contrib-uglify/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/AUTHORS b/node_modules/grunt-contrib-uglify/AUTHORS deleted file mode 100644 index ae935c1..0000000 --- a/node_modules/grunt-contrib-uglify/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -"Cowboy" Ben Alman (http://benalman.com) -Tyler Kellen (http://goingslowly.com) -Jarrod Overson (http://jarrodoverson.com) \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/CHANGELOG b/node_modules/grunt-contrib-uglify/CHANGELOG deleted file mode 100644 index 1eba962..0000000 --- a/node_modules/grunt-contrib-uglify/CHANGELOG +++ /dev/null @@ -1,47 +0,0 @@ -v0.2.4: - date: 2013-09-02 - changes: - - updated sourcemap format via /83 -v0.2.3: - date: 2013-06-10 - changes: - - added footer option -v0.2.2: - date: 2013-05-31 - changes: - - Reverted /56 due to /58 until [chrome/239660](https://code.google.com/p/chromium/issues/detail?id=239660&q=sourcemappingurl&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified) [firefox/870361](https://bugzilla.mozilla.org/show_bug.cgi?id=870361) drop -v0.2.1: - date: 2013-05-22 - changes: - - Bumped uglify to ~2.3.5 /55 /40 - - Changed sourcemappingUrl syntax /56 - - Disabled sorting of names for consistent mangling /44 - - Updated docs for sourceMapRoot /47 /25 -v0.2.0: - date: 2013-03-14 - changes: - - No longer report gzip results by default. - - Support `report` option. -v0.1.2: - date: 2013-01-30 - changes: - - Added better error reporting - - Support for dynamic names of multiple sourcemaps -v0.1.1: - date: 2013-02-15 - changes: - - First official release for Grunt 0.4.0. -v0.1.1rc6: - date: 2013-01-18 - changes: - - Updating grunt/gruntplugin dependencies to rc6. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.1.1rc5: - date: 2013-01-09 - changes: - - Updating to work with grunt v0.4.0rc5. - - Switching back to this.files api. -v0.1.0: - date: 2012-11-28 - changes: - - Work in progress, not yet officially released. diff --git a/node_modules/grunt-contrib-uglify/CONTRIBUTING.md b/node_modules/grunt-contrib-uglify/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-uglify/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-uglify/Gruntfile.js b/node_modules/grunt-contrib-uglify/Gruntfile.js deleted file mode 100644 index e50ddab..0000000 --- a/node_modules/grunt-contrib-uglify/Gruntfile.js +++ /dev/null @@ -1,177 +0,0 @@ -/* - * grunt-contrib-uglify - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'tasks/**/*.js', - '<%= nodeunit.tests %>' - ], - options: { - jshintrc: '.jshintrc' - } - }, - - // Before generating any new files, remove any previously-created files. - clean: { - tests: ['tmp'] - }, - - // Configuration to be run (and then tested). - uglify: { - compress: { - files: { - 'tmp/compress.js': ['test/fixtures/src/simple.js'] - }, - options: { - mangle: false - } - }, - compress_mangle: { - files: { - 'tmp/compress_mangle.js': ['test/fixtures/src/simple.js'] - } - }, - no_src: { - files: { - 'tmp/compress_mangle.js': [] - } - }, - compress_mangle_except: { - files: { - 'tmp/compress_mangle_except.js': ['test/fixtures/src/simple.js'] - }, - options: { - mangle: { - except: ['argumentC'] - } - } - }, - compress_mangle_beautify: { - files: { - 'tmp/compress_mangle_beautify.js': ['test/fixtures/src/simple.js'] - }, - options: { - beautify: true - } - }, - multifile: { - files: { - 'tmp/multifile.js': ['test/fixtures/src/simple.js','test/fixtures/src/comments.js'] - }, - options: { - mangle: false - } - }, - compress_mangle_sourcemap: { - files: { - '/dev/null': ['test/fixtures/src/simple.js'] - }, - options: { - sourceMap: 'tmp/compress_mangle_sourcemap' - } - }, - sourcemapin: { - files: { - 'tmp/sourcemapin.js': ['test/fixtures/src/simple2.js'] - }, - options: { - mangle : false, - sourceMap: 'tmp/sourcemapin', - sourceMapIn: 'test/fixtures/src/simple2.map', - sourceMapRoot: 'http://local.host/js/' - } - }, - sourcemapurl: { - files: { - 'tmp/sourcemapurl.js': ['test/fixtures/src/simple.js'] - }, - options: { - sourceMappingURL: 'js/sourcemapurl.js.map' - } - }, - comments: { - src: 'test/fixtures/src/comments.js', - dest: 'tmp/comments.js', - options: { - mangle: false, - preserveComments: 'some' - } - }, - wrap: { - src: 'test/fixtures/src/simple.js', - dest: 'tmp/wrap.js', - options: { - mangle: false, - wrap: 'testExport' - } - }, - exportAll: { - src: 'test/fixtures/src/simple.js', - dest: 'tmp/exportAll.js', - options: { - mangle: false, - wrap: 'testExport', - exportAll: true - } - }, - sourcemap_prefix: { - files: { - '/dev/null': ['test/fixtures/src/simple.js'] - }, - options: { - sourceMap: 'tmp/sourcemap_prefix', - sourceMapPrefix: 3 - } - }, - multiple_sourcemaps: { - files: { - 'tmp/multiple_sourcemaps1.js': ['test/fixtures/src/simple.js'], - 'tmp/multiple_sourcemaps2.js': ['test/fixtures/src/comments.js'] - }, - options: { - sourceMap: function(dest) { - return dest.replace(/\.js$/,".map"); - }, - sourceMappingURL: function(dest) { - return dest.replace(/\.js$/,".mapurl"); - } - } - } - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'] - } - - }); - - // Actually load this plugin's task(s). - grunt.loadTasks('tasks'); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - // 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', 'uglify', 'nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['jshint', 'test', 'build-contrib']); - -}; diff --git a/node_modules/grunt-contrib-uglify/LICENSE-MIT b/node_modules/grunt-contrib-uglify/LICENSE-MIT deleted file mode 100644 index 7f9d346..0000000 --- a/node_modules/grunt-contrib-uglify/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 "Cowboy" Ben Alman, 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/node_modules/grunt-contrib-uglify/README.md b/node_modules/grunt-contrib-uglify/README.md deleted file mode 100644 index 249864a..0000000 --- a/node_modules/grunt-contrib-uglify/README.md +++ /dev/null @@ -1,349 +0,0 @@ -# grunt-contrib-uglify [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-uglify.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-uglify) - -> Minify files with UglifyJS. - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-uglify --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-uglify'); -``` - - - - -## Uglify task -_Run this task with the `grunt uglify` command._ - -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. -### Options - -This task primarily delegates to [UglifyJS2][], so please consider the [UglifyJS documentation][] as required reading for advanced configuration. - -[UglifyJS2]: https://github.com/mishoo/UglifyJS2 -[UglifyJS documentation]: http://lisperator.net/uglifyjs/ - -#### mangle -Type: `Boolean` `Object` -Default: `{}` - -Turn on or off mangling with default options. If an `Object` is specified, it is passed directly to `ast.mangle_names()` *and* `ast.compute_char_frequency()` (mimicking command line behavior). - -#### compress -Type: `Boolean` `Object` -Default: `{}` - -Turn on or off source compression with default options. If an `Object` is specified, it is passed as options to `UglifyJS.Compressor()`. - -#### beautify -Type: `Boolean` `Object` -Default: `false` - -Turns on beautification of the generated source code. An `Object` will be merged and passed with the options sent to `UglifyJS.OutputStream()` - -#### report -Choices: `false` `'min'` `'gzip'` -Default: `false` - -Either do not report anything, report only minification result, or report minification and gzip results. This is useful to see exactly how well Uglify is performing, but using `'gzip'` can add 5-10x runtime task execution. - -Example ouput using `'gzip'`: - -``` -Original: 198444 bytes. -Minified: 101615 bytes. -Gzipped: 20084 bytes. -``` - -#### sourceMap -Type: `String` `Function` -Default: `undefined` - -The location to output the sourcemap. If a function is provided, the uglify destination is passed as the argument -and the return value will be used as the sourceMap name. - -#### sourceMapRoot -Type: `String` -Default: `undefined` - -The location where your source files can be found. This sets the sourceRoot field in the source map. - -#### sourceMapIn -Type: `String` -Default: `undefined` - -The location of an input source map from an earlier compilation, e.g. from CoffeeScript. - -#### sourceMappingURL -Type: `String` `Function` -Default: `undefined` - -The location of your sourcemap. Defaults to the location you use for sourceMap, override if you need finer control. Provide -a function to dynamically generate the sourceMappingURL based off the destination. - -#### sourceMapPrefix -Type: `Number` -Default: `undefined` - -The number of directories to drop from the path prefix when declaring files in the source map. - -#### wrap -Type: `String` -Default: `undefined` - -Wrap all of the code in a closure, an easy way to make sure nothing is leaking. -For variables that need to be public `exports` and `global` variables are made available. -The value of wrap is the global variable exports will be available as. - -#### exportAll -Type: `Boolean` -Default: `false` - -When using `wrap` this will make all global functions and variables available via the export variable. - -#### preserveComments -Type: `Boolean` `String` `Function` -Default: `undefined` -Options: `false` `'all'` `'some'` - -Turn on preservation of comments. - -- `false` will strip all comments -- `'all'` will preserve all comments in code blocks that have not been squashed or dropped -- `'some'` will preserve all comments that start with a bang (`!`) or include a closure compiler style directive (`@preserve` `@license` `@cc_on`) -- `Function` specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either `true` or `false` - -#### banner -Type: `String` -Default: empty string - -This string will be prepended to the beginning of the minified output. It is processed using [grunt.template.process][], using the default options. - -_(Default processing options are explained in the [grunt.template.process][] documentation)_ - -[grunt.template.process]: https://github.com/gruntjs/grunt/wiki/grunt.template#wiki-grunt-template-process - - -### Usage examples - -#### Basic compression - -This configuration will compress and mangle the input files using the default options. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - my_target: { - files: { - 'dest/output.min.js': ['src/input1.js', 'src/input2.js'] - } - } - } -}); -``` - -#### No mangling - -Specify `mangle: false` to prevent changes to your variable and function names. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - options: { - mangle: false - }, - my_target: { - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -#### Reserved identifiers - -You can specify identifiers to leave untouched with an `except` array in the `mangle` options. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - options: { - mangle: { - except: ['jQuery', 'Backbone'] - } - }, - my_target: { - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -#### Source maps - -Configure basic source map output by specifying a file path for the `sourceMap` option. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - my_target: { - options: { - sourceMap: 'path/to/source-map.js' - }, - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -#### Advanced source maps - -You can specify the parameters to pass to `UglifyJS.SourceMap()` which will -allow you to configure advanced settings. - -Refer to the [UglifyJS SourceMap Documentation](http://lisperator.net/uglifyjs/codegen#source-map) for more information. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - my_target: { - options: { - sourceMap: 'path/to/source-map.js', - sourceMapRoot: 'http://example.com/path/to/src/', // the location to find your original source - sourceMapIn: 'example/coffeescript-sourcemap.js', // input sourcemap from a previous compilation - }, - files: { - 'dest/output.min.js': ['src/input.js'], - }, - }, - }, -}); -``` - - -#### Beautify - -Specify `beautify: true` to beautify your code for debugging/troubleshooting purposes. -Pass an object to manually configure any other output options passed directly to `UglifyJS.OutputStream()`. - -See [UglifyJS Codegen documentation](http://lisperator.net/uglifyjs/codegen) for more information. - -_Note that manual configuration will require you to explicitly set `beautify: true` if you want traditional, beautified output._ - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - my_target: { - options: { - beautify: true - }, - files: { - 'dest/output.min.js': ['src/input.js'] - } - }, - my_advanced_target: { - options: { - beautify: { - width: 80, - beautify: true - } - }, - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -#### Banner comments - -In this example, running `grunt uglify:my_target` will prepend a banner created by interpolating the `banner` template string with the config object. Here, those properties are the values imported from the `package.json` file (which are available via the `pkg` config property) plus today's date. - -_Note: you don't have to use an external JSON file. It's also valid to create the `pkg` object inline in the config. That being said, if you already have a JSON file, you might as well reference it._ - -```js -// Project configuration. -grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - uglify: { - options: { - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + - '<%= grunt.template.today("yyyy-mm-dd") %> */' - }, - my_target: { - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -#### Conditional compilation - -You can also enable UglifyJS conditional compilation. This is commonly used to remove debug code blocks for production builds. - -See [UglifyJS global definitions documentation](http://lisperator.net/uglifyjs/compress#global-defs) for more information. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - options: { - compress: { - global_defs: { - "DEBUG": false - }, - dead_code: true - } - }, - my_target: { - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - - -## Release History - - * 2013-09-02   v0.2.4   updated sourcemap format via /83 - * 2013-06-10   v0.2.3   added footer option - * 2013-05-31   v0.2.2   Reverted /56 due to /58 until [chrome/239660](https://code.google.com/p/chromium/issues/detail?id=239660&q=sourcemappingurl&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified) [firefox/870361](https://bugzilla.mozilla.org/show_bug.cgi?id=870361) drop - * 2013-05-22   v0.2.1   Bumped uglify to ~2.3.5 /55 /40 Changed sourcemappingUrl syntax /56 Disabled sorting of names for consistent mangling /44 Updated docs for sourceMapRoot /47 /25 - * 2013-03-14   v0.2.0   No longer report gzip results by default. Support `report` option. - * 2013-01-30   v0.1.2   Added better error reporting Support for dynamic names of multiple sourcemaps - * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0. - * 2013-01-18   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. - * 2013-01-09   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. Switching back to this.files api. - * 2012-11-28   v0.1.0   Work in progress, not yet officially released. - ---- - -Task submitted by ["Cowboy" Ben Alman](http://benalman.com) - -*This file was generated on Mon Sep 02 2013 11:35:39.* diff --git a/node_modules/grunt-contrib-uglify/docs/uglify-examples.md b/node_modules/grunt-contrib-uglify/docs/uglify-examples.md deleted file mode 100644 index dbc828c..0000000 --- a/node_modules/grunt-contrib-uglify/docs/uglify-examples.md +++ /dev/null @@ -1,193 +0,0 @@ -# Usage examples - -## Basic compression - -This configuration will compress and mangle the input files using the default options. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - my_target: { - files: { - 'dest/output.min.js': ['src/input1.js', 'src/input2.js'] - } - } - } -}); -``` - -## No mangling - -Specify `mangle: false` to prevent changes to your variable and function names. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - options: { - mangle: false - }, - my_target: { - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -## Reserved identifiers - -You can specify identifiers to leave untouched with an `except` array in the `mangle` options. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - options: { - mangle: { - except: ['jQuery', 'Backbone'] - } - }, - my_target: { - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -## Source maps - -Configure basic source map output by specifying a file path for the `sourceMap` option. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - my_target: { - options: { - sourceMap: 'path/to/source-map.js' - }, - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -## Advanced source maps - -You can specify the parameters to pass to `UglifyJS.SourceMap()` which will -allow you to configure advanced settings. - -Refer to the [UglifyJS SourceMap Documentation](http://lisperator.net/uglifyjs/codegen#source-map) for more information. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - my_target: { - options: { - sourceMap: 'path/to/source-map.js', - sourceMapRoot: 'http://example.com/path/to/src/', // the location to find your original source - sourceMapIn: 'example/coffeescript-sourcemap.js', // input sourcemap from a previous compilation - }, - files: { - 'dest/output.min.js': ['src/input.js'], - }, - }, - }, -}); -``` - - -## Beautify - -Specify `beautify: true` to beautify your code for debugging/troubleshooting purposes. -Pass an object to manually configure any other output options passed directly to `UglifyJS.OutputStream()`. - -See [UglifyJS Codegen documentation](http://lisperator.net/uglifyjs/codegen) for more information. - -_Note that manual configuration will require you to explicitly set `beautify: true` if you want traditional, beautified output._ - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - my_target: { - options: { - beautify: true - }, - files: { - 'dest/output.min.js': ['src/input.js'] - } - }, - my_advanced_target: { - options: { - beautify: { - width: 80, - beautify: true - } - }, - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -## Banner comments - -In this example, running `grunt uglify:my_target` will prepend a banner created by interpolating the `banner` template string with the config object. Here, those properties are the values imported from the `package.json` file (which are available via the `pkg` config property) plus today's date. - -_Note: you don't have to use an external JSON file. It's also valid to create the `pkg` object inline in the config. That being said, if you already have a JSON file, you might as well reference it._ - -```js -// Project configuration. -grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - uglify: { - options: { - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + - '<%= grunt.template.today("yyyy-mm-dd") %> */' - }, - my_target: { - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` - -## Conditional compilation - -You can also enable UglifyJS conditional compilation. This is commonly used to remove debug code blocks for production builds. - -See [UglifyJS global definitions documentation](http://lisperator.net/uglifyjs/compress#global-defs) for more information. - -```js -// Project configuration. -grunt.initConfig({ - uglify: { - options: { - compress: { - global_defs: { - "DEBUG": false - }, - dead_code: true - } - }, - my_target: { - files: { - 'dest/output.min.js': ['src/input.js'] - } - } - } -}); -``` diff --git a/node_modules/grunt-contrib-uglify/docs/uglify-options.md b/node_modules/grunt-contrib-uglify/docs/uglify-options.md deleted file mode 100644 index 1b63bc7..0000000 --- a/node_modules/grunt-contrib-uglify/docs/uglify-options.md +++ /dev/null @@ -1,107 +0,0 @@ -# Options - -This task primarily delegates to [UglifyJS2][], so please consider the [UglifyJS documentation][] as required reading for advanced configuration. - -[UglifyJS2]: https://github.com/mishoo/UglifyJS2 -[UglifyJS documentation]: http://lisperator.net/uglifyjs/ - -## mangle -Type: `Boolean` `Object` -Default: `{}` - -Turn on or off mangling with default options. If an `Object` is specified, it is passed directly to `ast.mangle_names()` *and* `ast.compute_char_frequency()` (mimicking command line behavior). - -## compress -Type: `Boolean` `Object` -Default: `{}` - -Turn on or off source compression with default options. If an `Object` is specified, it is passed as options to `UglifyJS.Compressor()`. - -## beautify -Type: `Boolean` `Object` -Default: `false` - -Turns on beautification of the generated source code. An `Object` will be merged and passed with the options sent to `UglifyJS.OutputStream()` - -## report -Choices: `false` `'min'` `'gzip'` -Default: `false` - -Either do not report anything, report only minification result, or report minification and gzip results. This is useful to see exactly how well Uglify is performing, but using `'gzip'` can add 5-10x runtime task execution. - -Example ouput using `'gzip'`: - -``` -Original: 198444 bytes. -Minified: 101615 bytes. -Gzipped: 20084 bytes. -``` - -## sourceMap -Type: `String` `Function` -Default: `undefined` - -The location to output the sourcemap. If a function is provided, the uglify destination is passed as the argument -and the return value will be used as the sourceMap name. - -## sourceMapRoot -Type: `String` -Default: `undefined` - -The location where your source files can be found. This sets the sourceRoot field in the source map. - -## sourceMapIn -Type: `String` -Default: `undefined` - -The location of an input source map from an earlier compilation, e.g. from CoffeeScript. - -## sourceMappingURL -Type: `String` `Function` -Default: `undefined` - -The location of your sourcemap. Defaults to the location you use for sourceMap, override if you need finer control. Provide -a function to dynamically generate the sourceMappingURL based off the destination. - -## sourceMapPrefix -Type: `Number` -Default: `undefined` - -The number of directories to drop from the path prefix when declaring files in the source map. - -## wrap -Type: `String` -Default: `undefined` - -Wrap all of the code in a closure, an easy way to make sure nothing is leaking. -For variables that need to be public `exports` and `global` variables are made available. -The value of wrap is the global variable exports will be available as. - -## exportAll -Type: `Boolean` -Default: `false` - -When using `wrap` this will make all global functions and variables available via the export variable. - -## preserveComments -Type: `Boolean` `String` `Function` -Default: `undefined` -Options: `false` `'all'` `'some'` - -Turn on preservation of comments. - -- `false` will strip all comments -- `'all'` will preserve all comments in code blocks that have not been squashed or dropped -- `'some'` will preserve all comments that start with a bang (`!`) or include a closure compiler style directive (`@preserve` `@license` `@cc_on`) -- `Function` specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either `true` or `false` - -## banner -Type: `String` -Default: empty string - -This string will be prepended to the beginning of the minified output. It is processed using [grunt.template.process][], using the default options. - -_(Default processing options are explained in the [grunt.template.process][] documentation)_ - -[grunt.template.process]: https://github.com/gruntjs/grunt/wiki/grunt.template#wiki-grunt-template-process - diff --git a/node_modules/grunt-contrib-uglify/docs/uglify-overview.md b/node_modules/grunt-contrib-uglify/docs/uglify-overview.md deleted file mode 100644 index f0c452b..0000000 --- a/node_modules/grunt-contrib-uglify/docs/uglify-overview.md +++ /dev/null @@ -1 +0,0 @@ -Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/.bin/uglifyjs b/node_modules/grunt-contrib-uglify/node_modules/.bin/uglifyjs deleted file mode 120000 index fef3468..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/.bin/uglifyjs +++ /dev/null @@ -1 +0,0 @@ -../uglify-js/bin/uglifyjs \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.gitattributes b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.gitattributes deleted file mode 100644 index 176a458..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.jshintrc b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.jshintrc deleted file mode 100644 index e0cc7bb..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.npmignore b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.npmignore deleted file mode 100644 index 5cb6bfd..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.travis.yml b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.travis.yml deleted file mode 100644 index f2c257a..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_install: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/AUTHORS b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/AUTHORS deleted file mode 100644 index 5de1a92..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/AUTHORS +++ /dev/null @@ -1,4 +0,0 @@ -Tyler Kellen (http://goingslowly.com/) -Chris Talkington (http://christalkington.com/) -Larry Davis (http://lazd.net/) -Sindre Sorhus (http://sindresorhus.com) diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/CHANGELOG b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/CHANGELOG deleted file mode 100644 index f1e4c30..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/CHANGELOG +++ /dev/null @@ -1,47 +0,0 @@ -v0.6.1: - date: 2013-03-24 - changes: - - Add formatForType option -v0.6.0: - date: 2013-03-14 - changes: - - Change API/reportying style for minMaxInfo -v0.5.3: - date: 2013-02-23 - changes: - - use MIT licensed zlib-browserify instead of unlicensed gzip-js -v0.5.2: - date: 2013-01-24 - changes: - - add minMaxGzip & minMaxInfo. -v0.5.0: - date: 2012-12-05 - changes: - - remove findBasePath, buildIndividualDest and isIndividualDest. - - remove options and normalizeMultiTaskFiles. - - remove node v0.6 and grunt v0.3 support. -v0.4.0: - date: 2012-11-20 - changes: - - findBasePath returns '' if passed false. - - Added stripPath. -v0.3.1: - date: 2012-10-29 - changes: - - Tweaked findBasePath to handle single dot differently. - - Start testing with Travis. - - Docs cleanup. -v0.3.0: - date: 2012-09-24 - changes: - - Added findBasePath, buildIndividualDest, isIndividualDest, optsToArgs. - - Refactored tests. - - Automatically parse templates in options. -v0.2.1: - date: 2012-09-14 - changes: - - Added non-destuctive namespace declarations. -v0.2.0: - date: 2012-09-10 - changes: - - Refactored from grunt-contrib into individual repo. diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/Gruntfile.js b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/Gruntfile.js deleted file mode 100644 index 6e602bb..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/Gruntfile.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * grunt-lib-contrib - * http://gruntjs.com/ - * - * Copyright (c) 2012 Tyler Kellen, contributors - * Licensed under the MIT license. - */ - -module.exports = function(grunt) { - 'use strict'; - - // Project configuration. - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'lib/*.js', - '<%= nodeunit.tests %>' - ], - options: { - jshintrc: '.jshintrc' - } - }, - - test_vars: { - source: 'source/' - }, - - test_task: { - options: { - param: 'task', - param2: 'task', - template: '<%= test_vars.source %>', - data: { - template: ['<%= test_vars.source %>'] - } - }, - target: { - options: { - param: 'target' - } - } - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'] - } - }); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - - // Whenever the "test" task is run, then test the result. - grunt.registerTask('test', ['nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['jshint', 'test']); -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/LICENSE-MIT b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/LICENSE-MIT deleted file mode 100644 index 358b067..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -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. \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/README.md b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/README.md deleted file mode 100644 index 88116eb..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# grunt-lib-contrib [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-lib-contrib.png?branch=master)](http://travis-ci.org/gruntjs/grunt-lib-contrib) - -> Common functionality shared across grunt-contrib tasks. - -The purpose of grunt-lib-contrib is to explore solutions to common problems task writers encounter, and to ease the upgrade path for contrib tasks. - -**These APIs should be considered highly unstable. Depend on them at your own risk!** - -_Over time, some of the functionality provided here may be incorporated directly into grunt for mainstream use. Until then, you may require `grunt-lib-contrib` as a dependency in your projects, but be very careful to specify an exact version number instead of a range, as backwards-incompatible changes are likely to be introduced._ - -### Helper Functions - -#### getNamespaceDeclaration(ns) - -This helper is used to build JS namespace declarations. - -#### optsToArgs(options) - -Convert an object to an array of CLI arguments, which can be used with `child_process.spawn()`. - -```js -// Example -{ - fooBar: 'a', // ['--foo-bar', 'a'] - fooBar: 1, // ['--foo-bar', '1'] - fooBar: true, // ['--foo-bar'] - fooBar: false, // - fooBar: ['a', 'b'] // ['--foo-bar', 'a', '--foo-bar', 'b'] -} -``` - -#### stripPath(pth, strip) - -Strip a path from a path. normalize both paths for best results. - -#### minMaxInfo(min, max, report) - -Helper for logging compressed, uncompressed and gzipped sizes of strings. - -#### report -Choices: `false`, `'min'`, `'gzip'` -Default: `false` - -Either do not report anything, report only minification result, or report minification and gzip results. - -**Important** Including `'gzip'` results can make this task 5-10x slower depending on the size of the file. - - -```js -var max = grunt.file.read('max.js'); -var min = minify(max); -minMaxInfo(min, max, 'gzip'); -``` - -Would print: - -``` -Original: 495 bytes. -Minified: 396 bytes. -Gzipped: 36 bytes. -``` - --- - -*Lib submitted by [Tyler Kellen](https://goingslowly.com/).* \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/lib/contrib.js b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/lib/contrib.js deleted file mode 100644 index 9dcf945..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/lib/contrib.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * grunt-lib-contrib - * http://gruntjs.com/ - * - * Copyright (c) 2012 Tyler Kellen, contributors - * Licensed under the MIT license. - */ - -exports.init = function(grunt) { - 'use strict'; - - var exports = {}; - - var path = require('path'); - - exports.getNamespaceDeclaration = function(ns) { - var output = []; - var curPath = 'this'; - if (ns !== 'this') { - var nsParts = ns.split('.'); - nsParts.forEach(function(curPart, index) { - if (curPart !== 'this') { - curPath += '[' + JSON.stringify(curPart) + ']'; - output.push(curPath + ' = ' + curPath + ' || {};'); - } - }); - } - - return { - namespace: curPath, - declaration: output.join('\n') - }; - }; - - // Convert an object to an array of CLI arguments - exports.optsToArgs = function(options) { - var args = []; - - Object.keys(options).forEach(function(flag) { - var val = options[flag]; - - flag = flag.replace(/[A-Z]/g, function(match) { - return '-' + match.toLowerCase(); - }); - - if (val === true) { - args.push('--' + flag); - } - - if (grunt.util._.isString(val)) { - args.push('--' + flag, val); - } - - if (grunt.util._.isNumber(val)) { - args.push('--' + flag, '' + val); - } - - if (grunt.util._.isArray(val)) { - val.forEach(function(arrVal) { - args.push('--' + flag, arrVal); - }); - } - }); - - return args; - }; - - // Strip a path from a path. normalize both paths for best results. - exports.stripPath = function(pth, strip) { - if (strip && strip.length >= 1) { - strip = path.normalize(strip); - pth = path.normalize(pth); - pth = grunt.util._(pth).strRight(strip); - pth = grunt.util._(pth).ltrim(path.sep); - } - - return pth; - }; - - // Log min and max info - function gzipSize(src) { - return src ? require('zlib-browserify').gzipSync(src).length : 0; - } - exports.minMaxInfo = function(min, max, report) { - if (report === 'min' || report === 'gzip') { - grunt.log.writeln('Original: ' + String(max.length).green + ' bytes.'); - grunt.log.writeln('Minified: ' + String(min.length).green + ' bytes.'); - } - if (report === 'gzip') { - // Note this option is pretty slow so it is not enabled by default - grunt.log.write('Gzipped: '); - grunt.log.writeln(String(gzipSize(min)).green + ' bytes.'); - } - }; - - exports.formatForType = function(string, type, namespace, filename) { - namespace = namespace || false; - - if (type === 'amd' && namespace === false) { - string = 'return ' + string; - } else if (type === 'commonjs' && namespace === false) { - string = 'module.exports = ' + string; - } else if (type === 'amd' && namespace !== false || type === 'commonjs' && namespace !== false || type === 'js' && namespace !== false) { - string = namespace+'['+JSON.stringify(filename)+'] = '+string+';'; - } - - return string; - }; - - return exports; -}; diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/.npmignore b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/.npmignore deleted file mode 100644 index b512c09..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/index.js b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/index.js deleted file mode 100644 index 6674043..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/index.js +++ /dev/null @@ -1,43 +0,0 @@ -const Zlib = module.exports = require('./zlib'); - -// the least I can do is make error messages for the rest of the node.js/zlib api. -// (thanks, dominictarr) -function error () { - var m = [].slice.call(arguments).join(' ') - throw new Error([ - m, - 'we accept pull requests', - 'http://github.com/brianloveswords/zlib-browserify' - ].join('\n')) -} - -;['createGzip' -, 'createGunzip' -, 'createDeflate' -, 'createDeflateRaw' -, 'createInflate' -, 'createInflateRaw' -, 'createUnzip' -, 'Gzip' -, 'Gunzip' -, 'Inflate' -, 'InflateRaw' -, 'Deflate' -, 'DeflateRaw' -, 'Unzip' -, 'inflateRaw' -, 'deflateRaw'].forEach(function (name) { - Zlib[name] = function () { - error('sorry,', name, 'is not implemented yet') - } -}); - -const _deflate = Zlib.deflate; -const _gzip = Zlib.gzip; - -Zlib.deflate = function deflate(stringOrBuffer, callback) { - return _deflate(Buffer(stringOrBuffer), callback); -}; -Zlib.gzip = function gzip(stringOrBuffer, callback) { - return _gzip(Buffer(stringOrBuffer), callback); -}; \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/package.json b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/package.json deleted file mode 100644 index 633cb6e..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "zlib-browserify", - "version": "0.0.1", - "description": "Wrapper for zlib.js to allow for browserifyication", - "main": "index.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.3" - }, - "scripts": { - "test": "./node_modules/tap test/*.test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/brianloveswords/zlib-browserify.git" - }, - "keywords": [ - "zlib", - "browserify" - ], - "author": { - "name": "Brian J. Brennan" - }, - "license": "MIT", - "gitHead": "4be9419f0e8e9dec9629c8a538b33a4efd7df17b", - "readmeFilename": "readme.md", - "readme": "Zlib in yo' browser.\n", - "bugs": { - "url": "https://github.com/brianloveswords/zlib-browserify/issues" - }, - "_id": "zlib-browserify@0.0.1", - "_from": "zlib-browserify@0.0.1" -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/readme.md b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/readme.md deleted file mode 100644 index ca4a5ee..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/readme.md +++ /dev/null @@ -1 +0,0 @@ -Zlib in yo' browser. diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/test/zlib.test.js b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/test/zlib.test.js deleted file mode 100644 index 5b7a3ce..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/test/zlib.test.js +++ /dev/null @@ -1,65 +0,0 @@ -const test = require('tap').test; -const zlibA = require('zlib'); -const zlibB = require('..'); -const crypto = require('crypto'); - -test('zlibA.deflate -> zlibB.inflate', function (t) { - const expect = crypto.randomBytes(1024); - zlibA.deflate(expect, function (err, cmpA) { - zlibB.inflate(cmpA, function (err, result) { - t.same(result, expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibB.deflate -> zlibA.inflate', function (t) { - const expect = crypto.randomBytes(1024); - zlibB.deflate(expect, function (err, cmpA) { - zlibA.inflate(cmpA, function (err, result) { - t.same(result, expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibB.deflate -> zlibA.inflate (string)', function (t) { - const expect = 'ohaihihihihihihihihihihihihihihihi'; - zlibB.deflate(expect, function (err, cmpA) { - zlibA.inflate(cmpA, function (err, result) { - t.same(result.toString(), expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibA.gzip -> zlibB.gunzip', function (t) { - const expect = crypto.randomBytes(1024); - zlibA.gzip(expect, function (err, cmpA) { - zlibB.gunzip(cmpA, function (err, result) { - t.same(result, expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibB.gzip -> zlibA.gunzip', function (t) { - const expect = crypto.randomBytes(1024); - zlibB.gzip(expect, function (err, cmpA) { - zlibA.gunzip(cmpA, function (err, result) { - t.same(result, expect, 'should match'); - t.end(); - }); - }); -}); - -test('zlibB.gzip -> zlibA.gunzip', function (t) { - const expect = 'lololololoollolololoololololololololololololololololololololol'; - zlibB.gzip(expect, function (err, cmpA) { - zlibA.gunzip(cmpA, function (err, result) { - t.same(result.toString(), expect, 'should match'); - t.end(); - }); - }); -}); - diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/zlib.js b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/zlib.js deleted file mode 100644 index a9ea566..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/node_modules/zlib-browserify/zlib.js +++ /dev/null @@ -1,55 +0,0 @@ -/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */ -(function() {'use strict';function m(c){throw c;}var r=void 0,u=!0;var B="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array;function aa(c){if("string"===typeof c){var a=c.split(""),b,e;b=0;for(e=a.length;b>>0;c=a}for(var f=1,d=0,g=c.length,h,j=0;0>>0};function I(c,a){this.index="number"===typeof a?a:0;this.n=0;this.buffer=c instanceof(B?Uint8Array:Array)?c:new (B?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&m(Error("invalid index"));this.buffer.length<=this.index&&this.f()}I.prototype.f=function(){var c=this.buffer,a,b=c.length,e=new (B?Uint8Array:Array)(b<<1);if(B)e.set(c);else for(a=0;a>>8&255]<<16|K[c>>>16&255]<<8|K[c>>>24&255])>>32-a:K[c]>>8-a);if(8>a+d)g=g<>a-h-1&1,8===++d&&(d=0,e[f++]=K[g],g=0,f===e.length&&(e=this.f()));e[f]=g;this.buffer=e;this.n=d;this.index=f};I.prototype.finish=function(){var c=this.buffer,a=this.index,b;0Q;++Q){for(var R=Q,ga=R,ha=7,R=R>>>1;R;R>>>=1)ga<<=1,ga|=R&1,--ha;ba[Q]=(ga<>>0}var K=ba;var S={k:function(c,a,b){return S.update(c,0,a,b)},update:function(c,a,b,e){for(var f=S.L,d="number"===typeof b?b:b=0,g="number"===typeof e?e:c.length,a=a^4294967295,d=g&7;d--;++b)a=a>>>8^f[(a^c[b])&255];for(d=g>>3;d--;b+=8)a=a>>>8^f[(a^c[b])&255],a=a>>>8^f[(a^c[b+1])&255],a=a>>>8^f[(a^c[b+2])&255],a=a>>>8^f[(a^c[b+3])&255],a=a>>>8^f[(a^c[b+4])&255],a=a>>>8^f[(a^c[b+5])&255],a=a>>>8^f[(a^c[b+6])&255],a=a>>>8^f[(a^c[b+7])&255];return(a^4294967295)>>>0}},ia=S,ja,ka=[0,1996959894,3993919788,2567524794, -124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304, -3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486, -2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580, -2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221, -2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863, -817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];ja=B?new Uint32Array(ka):ka;ia.L=ja;function na(){};function oa(c){this.buffer=new (B?Uint16Array:Array)(2*c);this.length=0}oa.prototype.getParent=function(c){return 2*((c-2)/4|0)};oa.prototype.push=function(c,a){var b,e,f=this.buffer,d;b=this.length;f[this.length++]=a;for(f[this.length++]=c;0f[e])d=f[b],f[b]=f[e],f[e]=d,d=f[b+1],f[b+1]=f[e+1],f[e+1]=d,b=e;else break;return this.length}; -oa.prototype.pop=function(){var c,a,b=this.buffer,e,f,d;a=b[0];c=b[1];this.length-=2;b[0]=b[this.length];b[1]=b[this.length+1];for(d=0;;){f=2*d+2;if(f>=this.length)break;f+2b[f]&&(f+=2);if(b[f]>b[d])e=b[d],b[d]=b[f],b[f]=e,e=b[d+1],b[d+1]=b[f+1],b[f+1]=e;else break;d=f}return{index:c,value:a,length:this.length}};function T(c){var a=c.length,b=0,e=Number.POSITIVE_INFINITY,f,d,g,h,j,i,q,l,k;for(l=0;lb&&(b=c[l]),c[l]>=1;for(k=i;kU;U++)switch(u){case 143>=U:sa.push([U+48,8]);break;case 255>=U:sa.push([U-144+400,9]);break;case 279>=U:sa.push([U-256+0,7]);break;case 287>=U:sa.push([U-280+192,8]);break;default:m("invalid literal: "+U)} -pa.prototype.h=function(){var c,a,b,e,f=this.input;switch(this.l){case 0:b=0;for(e=f.length;b>>8&255;k[p++]=i&255;k[p++]=i>>>8&255;if(B)k.set(d,p),p+=d.length,k=k.subarray(0,p);else{q=0;for(l=d.length;qz)for(;0z?z:138,H>z-3&&H=H?(L[J++]=17,L[J++]=H-3,O[17]++):(L[J++]=18,L[J++]=H-11,O[18]++),z-=H;else if(L[J++]=M[y],O[M[y]]++,z--,3>z)for(;0z?z:6,H>z-3&&HG;G++)va[G]=la[ca[G]];for(D=19;4=c:return[265,c-11,1];case 14>=c:return[266,c-13,1];case 16>=c:return[267,c-15,1];case 18>=c:return[268,c-17,1];case 22>=c:return[269,c-19,2];case 26>=c:return[270,c-23,2];case 30>=c:return[271,c-27,2];case 34>=c:return[272,c- -31,2];case 42>=c:return[273,c-35,3];case 50>=c:return[274,c-43,3];case 58>=c:return[275,c-51,3];case 66>=c:return[276,c-59,3];case 82>=c:return[277,c-67,4];case 98>=c:return[278,c-83,4];case 114>=c:return[279,c-99,4];case 130>=c:return[280,c-115,4];case 162>=c:return[281,c-131,5];case 194>=c:return[282,c-163,5];case 226>=c:return[283,c-195,5];case 257>=c:return[284,c-227,5];case 258===c:return[285,c-258,0];default:m("invalid length: "+c)}}var Ba=[],Aa,Ca; -for(Aa=3;258>=Aa;Aa++)Ca=za(),Ba[Aa]=Ca[2]<<24|Ca[1]<<16|Ca[0];var Da=B?new Uint32Array(Ba):Ba; -function ta(c,a){function b(a,c){var b=a.N,d=[],e=0,f;f=Da[a.length];d[e++]=f&65535;d[e++]=f>>16&255;d[e++]=f>>24;var g;switch(u){case 1===b:g=[0,b-1,0];break;case 2===b:g=[1,b-2,0];break;case 3===b:g=[2,b-3,0];break;case 4===b:g=[3,b-4,0];break;case 6>=b:g=[4,b-5,1];break;case 8>=b:g=[5,b-7,1];break;case 12>=b:g=[6,b-9,2];break;case 16>=b:g=[7,b-13,2];break;case 24>=b:g=[8,b-17,3];break;case 32>=b:g=[9,b-25,3];break;case 48>=b:g=[10,b-33,4];break;case 64>=b:g=[11,b-49,4];break;case 96>=b:g=[12,b- -65,5];break;case 128>=b:g=[13,b-97,5];break;case 192>=b:g=[14,b-129,6];break;case 256>=b:g=[15,b-193,6];break;case 384>=b:g=[16,b-257,7];break;case 512>=b:g=[17,b-385,7];break;case 768>=b:g=[18,b-513,8];break;case 1024>=b:g=[19,b-769,8];break;case 1536>=b:g=[20,b-1025,9];break;case 2048>=b:g=[21,b-1537,9];break;case 3072>=b:g=[22,b-2049,10];break;case 4096>=b:g=[23,b-3073,10];break;case 6144>=b:g=[24,b-4097,11];break;case 8192>=b:g=[25,b-6145,11];break;case 12288>=b:g=[26,b-8193,12];break;case 16384>= -b:g=[27,b-12289,12];break;case 24576>=b:g=[28,b-16385,13];break;case 32768>=b:g=[29,b-24577,13];break;default:m("invalid distance")}f=g;d[e++]=f[0];d[e++]=f[1];d[e++]=f[2];var h,i;h=0;for(i=d.length;h=d;)v[d++]=0;for(d=0;29>=d;)x[d++]=0}v[256]=1;e=0;for(f=a.length;e=f){l&&b(l,-1);d=0;for(g=f-e;ds&&e+sn&&(C=A,n=s);if(258===s)break}q=new xa(n,e-C);l?l.length2*k[n-1]+p[n]&&(k[n]=2*k[n-1]+p[n]),v[n]=Array(k[n]),x[n]=Array(k[n]);for(C=0;Ch[C]?(v[n][s]=E,x[n][s]=l,D+=2): -(v[n][s]=h[C],x[n][s]=C,++C);F[n]=0;1===p[n]&&b(n)}j=t;i=0;for(q=g.length;i>>=1}return a};function Ea(c,a){this.input=c;this.a=new (B?Uint8Array:Array)(32768);this.l=Fa.u;var b={},e;if((a||!(a={}))&&"number"===typeof a.compressionType)this.l=a.compressionType;for(e in a)b[e]=a[e];b.outputBuffer=this.a;this.H=new pa(this.input,b)}var Fa=ra; -Ea.prototype.h=function(){var c,a,b,e,f,d,g,h=0;g=this.a;c=Ga;switch(c){case Ga:a=Math.LOG2E*Math.log(32768)-8;break;default:m(Error("invalid compression method"))}b=a<<4|c;g[h++]=b;switch(c){case Ga:switch(this.l){case Fa.NONE:f=0;break;case Fa.K:f=1;break;case Fa.u:f=2;break;default:m(Error("unsupported compression type"))}break;default:m(Error("invalid compression method"))}e=f<<6|0;g[h++]=e|31-(256*b+e)%31;d=aa(this.input);this.H.b=h;g=this.H.h();h=g.length;B&&(g=new Uint8Array(g.buffer),g.length<= -h+4&&(this.a=new Uint8Array(g.length+4),this.a.set(g),g=this.a),g=g.subarray(0,h+4));g[h++]=d>>24&255;g[h++]=d>>16&255;g[h++]=d>>8&255;g[h++]=d&255;return g};function Ha(c,a){this.input=c;this.b=this.c=0;this.g={};a&&(a.flags&&(this.g=a.flags),"string"===typeof a.filename&&(this.filename=a.filename),"string"===typeof a.comment&&(this.comment=a.comment),a.deflateOptions&&(this.m=a.deflateOptions));this.m||(this.m={})} -Ha.prototype.h=function(){var c,a,b,e,f,d,g,h,j=new (B?Uint8Array:Array)(32768),i=0,q=this.input,l=this.c,k=this.filename,p=this.comment;j[i++]=31;j[i++]=139;j[i++]=8;c=0;this.g.fname&&(c|=Ia);this.g.fcomment&&(c|=Ja);this.g.fhcrc&&(c|=Ka);j[i++]=c;a=(Date.now?Date.now():+new Date)/1E3|0;j[i++]=a&255;j[i++]=a>>>8&255;j[i++]=a>>>16&255;j[i++]=a>>>24&255;j[i++]=0;j[i++]=Ya;if(this.g.fname!==r){g=0;for(h=k.length;g>>8&255),j[i++]=d&255;j[i++]=0}if(this.g.comment){g= -0;for(h=p.length;g>>8&255),j[i++]=d&255;j[i++]=0}this.g.fhcrc&&(b=S.k(j,0,i)&65535,j[i++]=b&255,j[i++]=b>>>8&255);this.m.outputBuffer=j;this.m.outputIndex=i;f=new pa(q,this.m);j=f.h();i=f.b;B&&(i+8>j.buffer.byteLength?(this.a=new Uint8Array(i+8),this.a.set(new Uint8Array(j.buffer)),j=this.a):j=new Uint8Array(j.buffer));e=S.k(q);j[i++]=e&255;j[i++]=e>>>8&255;j[i++]=e>>>16&255;j[i++]=e>>>24&255;h=q.length;j[i++]=h&255;j[i++]=h>>>8&255;j[i++]=h>>>16&255;j[i++]= -h>>>24&255;this.c=l;B&&i>>=1;switch(c){case 0:var a=this.input,b=this.c,e=this.a,f=this.b,d=r,g=r,h=r,j=e.length,i=r;this.e=this.j=0;d=a[b++];d===r&&m(Error("invalid uncompressed block header: LEN (first byte)"));g=d;d=a[b++];d===r&&m(Error("invalid uncompressed block header: LEN (second byte)"));g|=d<<8;d=a[b++];d===r&&m(Error("invalid uncompressed block header: NLEN (first byte)"));h=d;d=a[b++];d===r&&m(Error("invalid uncompressed block header: NLEN (second byte)"));h|= -d<<8;g===~h&&m(Error("invalid uncompressed block header: length verify"));b+g>a.length&&m(Error("input buffer is broken"));switch(this.r){case $a:for(;f+g>e.length;){i=j-f;g-=i;if(B)e.set(a.subarray(b,b+i),f),f+=i,b+=i;else for(;i--;)e[f++]=a[b++];this.b=f;e=this.f();f=this.b}break;case Za:for(;f+g>e.length;)e=this.f({B:2});break;default:m(Error("invalid inflate mode"))}if(B)e.set(a.subarray(b,b+g),f),f+=g,b+=g;else for(;g--;)e[f++]=a[b++];this.c=b;this.b=f;this.a=e;break;case 1:this.s(ab,bb);break; -case 2:cb(this);break;default:m(Error("unknown BTYPE: "+c))}}return this.z()}; -var db=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],eb=B?new Uint16Array(db):db,fb=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],gb=B?new Uint16Array(fb):fb,hb=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],ib=B?new Uint8Array(hb):hb,jb=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],kb=B?new Uint16Array(jb):jb,lb=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10, -10,11,11,12,12,13,13],mb=B?new Uint8Array(lb):lb,nb=new (B?Uint8Array:Array)(288),Y,ob;Y=0;for(ob=nb.length;Y=Y?8:255>=Y?9:279>=Y?7:8;var ab=T(nb),pb=new (B?Uint8Array:Array)(30),qb,rb;qb=0;for(rb=pb.length;qb>>a;c.e=e-a;c.c=d;return g} -function sb(c,a){for(var b=c.j,e=c.e,f=c.input,d=c.c,g=a[0],h=a[1],j,i,q;e>>16;c.j=b>>q;c.e=e-q;c.c=d;return i&65535} -function cb(c){function a(a,b,c){var d,f,e,g;for(g=0;gd)e>=f&&(this.b=e,b=this.f(),e=this.b),b[e++]=d;else{g=d-257;j=gb[g];0=f&&(this.b=e,b=this.f(),e=this.b);for(;j--;)b[e]=b[e++-h]}for(;8<=this.e;)this.e-=8,this.c--;this.b=e}; -W.prototype.Q=function(c,a){var b=this.a,e=this.b;this.A=c;for(var f=b.length,d,g,h,j;256!==(d=sb(this,c));)if(256>d)e>=f&&(b=this.f(),f=b.length),b[e++]=d;else{g=d-257;j=gb[g];0f&&(b=this.f(),f=b.length);for(;j--;)b[e]=b[e++-h]}for(;8<=this.e;)this.e-=8,this.c--;this.b=e}; -W.prototype.f=function(){var c=new (B?Uint8Array:Array)(this.b-32768),a=this.b-32768,b,e,f=this.a;if(B)c.set(f.subarray(32768,c.length));else{b=0;for(e=c.length;bb;++b)f[b]=f[a+b];this.b=32768;return f}; -W.prototype.R=function(c){var a,b=this.input.length/this.c+1|0,e,f,d,g=this.input,h=this.a;c&&("number"===typeof c.B&&(b=c.B),"number"===typeof c.M&&(b+=c.M));2>b?(e=(g.length-this.c)/this.A[2],d=258*(e/2)|0,f=da&&(this.a.length=a),c=this.a);return this.buffer=c};function tb(c){this.input=c;this.c=0;this.member=[]} -tb.prototype.i=function(){for(var c=this.input.length;this.c>>0;S.k(f)!==q&&m(Error("invalid CRC-32 checksum: 0x"+S.k(f).toString(16)+" / 0x"+q.toString(16))); -a.Y=b=(l[k++]|l[k++]<<8|l[k++]<<16|l[k++]<<24)>>>0;(f.length&4294967295)!==b&&m(Error("invalid input size: "+(f.length&4294967295)+" / "+b));this.member.push(a);this.c=k}var p=this.member,t,v,x=0,F=0,w;t=0;for(v=p.length;t>>0,b!==aa(a)&&m(Error("invalid adler-32 checksum")));return a};exports.deflate=vb;exports.deflateSync=wb;exports.inflate=xb;exports.inflateSync=yb;exports.gzip=zb;exports.gzipSync=Ab;exports.gunzip=Bb;exports.gunzipSync=Cb;function vb(c,a,b){process.nextTick(function(){var e,f;try{f=wb(c,b)}catch(d){e=d}a(e,f)})}function wb(c,a){var b;b=(new Ea(c)).h();a||(a={});return a.G?b:Db(b)}function xb(c,a,b){process.nextTick(function(){var e,f;try{f=yb(c,b)}catch(d){e=d}a(e,f)})} -function yb(c,a){var b;c.subarray=c.slice;b=(new ub(c)).i();a||(a={});return a.noBuffer?b:Db(b)}function zb(c,a,b){process.nextTick(function(){var e,f;try{f=Ab(c,b)}catch(d){e=d}a(e,f)})}function Ab(c,a){var b;c.subarray=c.slice;b=(new Ha(c)).h();a||(a={});return a.G?b:Db(b)}function Bb(c,a,b){process.nextTick(function(){var e,f;try{f=Cb(c,b)}catch(d){e=d}a(e,f)})}function Cb(c,a){var b;c.subarray=c.slice;b=(new tb(c)).i();a||(a={});return a.G?b:Db(b)} -function Db(c){var a=new Buffer(c.length),b,e;b=0;for(e=c.length;b=$?8:255>=$?9:279>=$?7:8;T(Jb);var Lb=new (B?Uint8Array:Array)(30),Mb,Nb;Mb=0;for(Nb=Lb.length;Mb= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt": "~0.4.0" - }, - "main": "lib/contrib", - "dependencies": { - "zlib-browserify": "0.0.1" - }, - "contributors": [ - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com/" - }, - { - "name": "Chris Talkington", - "url": "http://christalkington.com/" - }, - { - "name": "Larry Davis", - "url": "http://lazd.net/" - }, - { - "name": "Sindre Sorhus", - "url": "http://sindresorhus.com" - } - ], - "readme": "# grunt-lib-contrib [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-lib-contrib.png?branch=master)](http://travis-ci.org/gruntjs/grunt-lib-contrib)\n\n> Common functionality shared across grunt-contrib tasks.\n\nThe purpose of grunt-lib-contrib is to explore solutions to common problems task writers encounter, and to ease the upgrade path for contrib tasks.\n\n**These APIs should be considered highly unstable. Depend on them at your own risk!**\n\n_Over time, some of the functionality provided here may be incorporated directly into grunt for mainstream use. Until then, you may require `grunt-lib-contrib` as a dependency in your projects, but be very careful to specify an exact version number instead of a range, as backwards-incompatible changes are likely to be introduced._\n\n### Helper Functions\n\n#### getNamespaceDeclaration(ns)\n\nThis helper is used to build JS namespace declarations.\n\n#### optsToArgs(options)\n\nConvert an object to an array of CLI arguments, which can be used with `child_process.spawn()`.\n\n```js\n// Example\n{\n fooBar: 'a', // ['--foo-bar', 'a']\n fooBar: 1, // ['--foo-bar', '1']\n fooBar: true, // ['--foo-bar']\n fooBar: false, //\n fooBar: ['a', 'b'] // ['--foo-bar', 'a', '--foo-bar', 'b']\n}\n```\n\n#### stripPath(pth, strip)\n\nStrip a path from a path. normalize both paths for best results.\n\n#### minMaxInfo(min, max, report)\n\nHelper for logging compressed, uncompressed and gzipped sizes of strings.\n\n#### report\nChoices: `false`, `'min'`, `'gzip'`\nDefault: `false`\n\nEither do not report anything, report only minification result, or report minification and gzip results.\n\n**Important** Including `'gzip'` results can make this task 5-10x slower depending on the size of the file.\n\n\n```js\nvar max = grunt.file.read('max.js');\nvar min = minify(max);\nminMaxInfo(min, max, 'gzip');\n```\n\nWould print:\n\n```\nOriginal: 495 bytes.\nMinified: 396 bytes.\nGzipped: 36 bytes.\n```\n\n--\n\n*Lib submitted by [Tyler Kellen](https://goingslowly.com/).*", - "readmeFilename": "README.md", - "_id": "grunt-lib-contrib@0.6.1", - "_from": "grunt-lib-contrib@~0.6.0" -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/test/lib_test.js b/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/test/lib_test.js deleted file mode 100644 index 446864a..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/grunt-lib-contrib/test/lib_test.js +++ /dev/null @@ -1,233 +0,0 @@ -var grunt = require('grunt'); -var helper = require('../lib/contrib.js').init(grunt); - -exports.lib = { - getNamespaceDeclaration: function(test) { - 'use strict'; - - test.expect(10); - - // Both test should result in this[JST] - var expected = { - namespace: 'this["JST"]', - declaration: 'this["JST"] = this["JST"] || {};' - }; - - var actual = helper.getNamespaceDeclaration("this.JST"); - test.equal(expected.namespace, actual.namespace, 'namespace with square brackets incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration with square brackets incorrect'); - - actual = helper.getNamespaceDeclaration("JST"); - test.equal(expected.namespace, actual.namespace, 'namespace with square brackets incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration with square brackets incorrect'); - - // Templates should be declared globally if this provided - expected = { - namespace: "this", - declaration: "" - }; - - actual = helper.getNamespaceDeclaration("this"); - test.equal(expected.namespace, actual.namespace, 'namespace with square brackets incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration with square brackets incorrect'); - - // Nested namespace declaration - expected = { - namespace: 'this["GUI"]["Templates"]["Main"]', - declaration: 'this["GUI"] = this["GUI"] || {};\n' + - 'this["GUI"]["Templates"] = this["GUI"]["Templates"] || {};\n' + - 'this["GUI"]["Templates"]["Main"] = this["GUI"]["Templates"]["Main"] || {};' - }; - - actual = helper.getNamespaceDeclaration("GUI.Templates.Main"); - test.equal(expected.namespace, actual.namespace, 'namespace incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration incorrect'); - - // Namespace that contains square brackets - expected = { - namespace: 'this["main"]["[test]"]["[test2]"]', - declaration: 'this["main"] = this["main"] || {};\n' + - 'this["main"]["[test]"] = this["main"]["[test]"] || {};\n' + - 'this["main"]["[test]"]["[test2]"] = this["main"]["[test]"]["[test2]"] || {};' - }; - - actual = helper.getNamespaceDeclaration("main.[test].[test2]"); - test.equal(expected.namespace, actual.namespace, 'namespace with square brackets incorrect'); - test.equal(expected.declaration, actual.declaration, 'namespace declaration with square brackets incorrect'); - - test.done(); - }, - optsToArgs: function(test) { - 'use strict'; - - test.expect(1); - - var fixture = { - key: 'a', - key2: 1, - key3: true, - key4: false, - key5: ['a', 'b'] - }; - var expected = ['--key', 'a', '--key2', '1', '--key3', '--key5', 'a', '--key5', 'b' ].toString(); - var actual = helper.optsToArgs(fixture).toString(); - test.equal(expected, actual, 'should convert object to array of CLI arguments'); - - test.done(); - }, - stripPath: function(test) { - 'use strict'; - var path = require('path'); - - test.expect(4); - - var actual = helper.stripPath('path1/path2', 'path1'); - var expected = 'path2'; - test.equal(expected, actual, 'should strip path from a directory path and trim it.'); - - actual = helper.stripPath('path1/path2/path3/path4', 'path1/path2'); - expected = path.normalize('path3/path4'); - test.equal(expected, actual, 'should strip path from a directory path and trim it. (deep)'); - - actual = helper.stripPath('path1/file.ext', 'path1'); - expected = 'file.ext'; - test.equal(expected, actual, 'should strip path from a file path and trim it.'); - - actual = helper.stripPath('path1/path2/path3/path4/file.ext', 'path1/path2'); - expected = path.normalize('path3/path4/file.ext'); - test.equal(expected, actual, 'should strip path from a file path and trim it. (deep)'); - - test.done(); - }, - minMaxInfo: function(test) { - 'use strict'; - test.expect(3); - - var max = new Array(100).join('blah '); - var min = max.replace(/\s+/g, ''); - - var actual; - var expected; - - grunt.util.hooker.hook(grunt.log, 'writeln', { - pre: function(result) { - actual += grunt.log.uncolor(result) + grunt.util.linefeed; - return grunt.util.hooker.preempt(); - } - }); - - grunt.util.hooker.hook(grunt.log, 'write', { - pre: function(result) { - actual += grunt.log.uncolor(result); - return grunt.util.hooker.preempt(); - } - }); - - - // No reporting option - actual = ''; - expected = ''; - - helper.minMaxInfo(min, max); - test.equal(expected, actual, 'should not have reported min and max info.'); - - // Report minification results - actual = ''; - expected = [ - 'Original: 495 bytes.', - 'Minified: 396 bytes.' - ].join(grunt.util.linefeed) + grunt.util.linefeed; - - helper.minMaxInfo(min, max, 'min'); - test.equal(expected, actual, 'should have logged min and max info.'); - - // Report minification and gzip results - actual = ''; - expected = [ - 'Original: 495 bytes.', - 'Minified: 396 bytes.', - 'Gzipped: 36 bytes.' - ].join(grunt.util.linefeed) + grunt.util.linefeed; - - helper.minMaxInfo(min, max, 'gzip'); - test.equal(expected, actual, 'should have logged min, max, gzip info.'); - - grunt.util.hooker.unhook(grunt.log, 'writeln'); - grunt.util.hooker.unhook(grunt.log, 'write'); - test.done(); - }, - formatToType: { - amd: function(test) { - - 'use strict'; - - test.expect(2); - - var string = function () { }; - - var actual = helper.formatForType(string, 'amd', 'JST', 'test'); - var expected = 'JST["test"] = function () { };'; - test.equal(expected, actual, 'should format string to amd with namespace'); - - actual = helper.formatForType(string, 'amd'); - expected = "return function () { }"; - test.equal(expected, actual, 'should format string to amd'); - - test.done(); - }, - commonjs: function(test) { - - 'use strict'; - - test.expect(2); - - var string = function () { }; - - var actual = helper.formatForType(string, 'commonjs', 'JST', 'test'); - var expected = 'JST["test"] = function () { };'; - test.equal(expected, actual, 'should format string to commonjs with namespace'); - - actual = helper.formatForType(string, 'commonjs'); - expected = "module.exports = function () { }"; - test.equal(expected, actual, 'should format string to commonjs'); - - test.done(); - }, - js: function(test) { - - 'use strict'; - - test.expect(2); - - var string = function () { }; - - var actual = helper.formatForType(string, 'js', 'JST', 'test'); - var expected = 'JST["test"] = function () { };'; - test.equal(expected, actual, 'should format string to js with namespace'); - - actual = helper.formatForType(string, 'js'); - expected = 'function () { }'; - test.equal(expected, actual, 'should format string to js'); - - test.done(); - }, - html: function(test) { - - 'use strict'; - - test.expect(2); - - var string = function () { }; - - var actual = helper.formatForType(string, 'html', 'JST', 'test'); - var expected = 'function () { }'; - test.equal(expected, actual, 'should format string to html with namespace'); - - actual = helper.formatForType(string, 'html'); - expected = 'function () { }'; - test.equal(expected, actual, 'should format string to html'); - - test.done(); - } - } -}; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/.npmignore b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/.npmignore deleted file mode 100644 index 94fceeb..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -tmp/ -node_modules/ diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/.travis.yml b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/.travis.yml deleted file mode 100644 index d959127..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.4" - - "0.6" - - "0.8" - - "0.10" - - "0.11" diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/LICENSE b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/LICENSE deleted file mode 100644 index dd7706f..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -UglifyJS is released under the BSD license: - -Copyright 2012-2013 (c) Mihai Bazon - -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 HOLDER “AS IS” AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/README.md b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/README.md deleted file mode 100644 index 4356d4f..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/README.md +++ /dev/null @@ -1,593 +0,0 @@ -UglifyJS 2 -========== -[![Build Status](https://travis-ci.org/mishoo/UglifyJS2.png)](https://travis-ci.org/mishoo/UglifyJS2) - -UglifyJS is a JavaScript parser, minifier, compressor or beautifier toolkit. - -This page documents the command line utility. For -[API and internals documentation see my website](http://lisperator.net/uglifyjs/). -There's also an -[in-browser online demo](http://lisperator.net/uglifyjs/#demo) (for Firefox, -Chrome and probably Safari). - -Install -------- - -First make sure you have installed the latest version of [node.js](http://nodejs.org/) -(You may need to restart your computer after this step). - -From NPM for use as a command line app: - - npm install uglify-js -g - -From NPM for programmatic use: - - npm install uglify-js - -From Git: - - git clone git://github.com/mishoo/UglifyJS2.git - cd UglifyJS2 - npm link . - -Usage ------ - - uglifyjs [input files] [options] - -UglifyJS2 can take multiple input files. It's recommended that you pass the -input files first, then pass the options. UglifyJS will parse input files -in sequence and apply any compression options. The files are parsed in the -same global scope, that is, a reference from a file to some -variable/function declared in another file will be matched properly. - -If you want to read from STDIN instead, pass a single dash instead of input -files. - -The available options are: - -``` - --source-map Specify an output file where to generate source map. - [string] - --source-map-root The path to the original source to be included in the - source map. [string] - --source-map-url The path to the source map to be added in //# - sourceMappingURL. Defaults to the value passed with - --source-map. [string] - --in-source-map Input source map, useful if you're compressing JS that was - generated from some other original code. - --screw-ie8 Pass this flag if you don't care about full compliance - with Internet Explorer 6-8 quirks (by default UglifyJS - will try to be IE-proof). [boolean] - --expr Parse a single expression, rather than a program (for - parsing JSON) [boolean] - -p, --prefix Skip prefix for original filenames that appear in source - maps. For example -p 3 will drop 3 directories from file - names and ensure they are relative paths. You can also - specify -p relative, which will make UglifyJS figure out - itself the relative paths between original sources, the - source map and the output file. [string] - -o, --output Output file (default STDOUT). - -b, --beautify Beautify output/specify output options. [string] - -m, --mangle Mangle names/pass mangler options. [string] - -r, --reserved Reserved names to exclude from mangling. - -c, --compress Enable compressor/pass compressor options. Pass options - like -c hoist_vars=false,if_return=false. Use -c with no - argument to use the default compression options. [string] - -d, --define Global definitions [string] - -e, --enclose Embed everything in a big function, with a configurable - parameter/argument list. [string] - --comments Preserve copyright comments in the output. By default this - works like Google Closure, keeping JSDoc-style comments - that contain "@license" or "@preserve". You can optionally - pass one of the following arguments to this flag: - - "all" to keep all comments - - a valid JS regexp (needs to start with a slash) to keep - only comments that match. - Note that currently not *all* comments can be kept when - compression is on, because of dead code removal or - cascading statements into sequences. [string] - --stats Display operations run time on STDERR. [boolean] - --acorn Use Acorn for parsing. [boolean] - --spidermonkey Assume input files are SpiderMonkey AST format (as JSON). - [boolean] - --self Build itself (UglifyJS2) as a library (implies - --wrap=UglifyJS --export-all) [boolean] - --wrap Embed everything in a big function, making the “exports” - and “global” variables available. You need to pass an - argument to this option to specify the name that your - module will take when included in, say, a browser. - [string] - --export-all Only used when --wrap, this tells UglifyJS to add code to - automatically export all globals. [boolean] - --lint Display some scope warnings [boolean] - -v, --verbose Verbose [boolean] - -V, --version Print version number and exit. [boolean] -``` - -Specify `--output` (`-o`) to declare the output file. Otherwise the output -goes to STDOUT. - -## Source map options - -UglifyJS2 can generate a source map file, which is highly useful for -debugging your compressed JavaScript. To get a source map, pass -`--source-map output.js.map` (full path to the file where you want the -source map dumped). - -Additionally you might need `--source-map-root` to pass the URL where the -original files can be found. In case you are passing full paths to input -files to UglifyJS, you can use `--prefix` (`-p`) to specify the number of -directories to drop from the path prefix when declaring files in the source -map. - -For example: - - uglifyjs /home/doe/work/foo/src/js/file1.js \ - /home/doe/work/foo/src/js/file2.js \ - -o foo.min.js \ - --source-map foo.min.js.map \ - --source-map-root http://foo.com/src \ - -p 5 -c -m - -The above will compress and mangle `file1.js` and `file2.js`, will drop the -output in `foo.min.js` and the source map in `foo.min.js.map`. The source -mapping will refer to `http://foo.com/src/js/file1.js` and -`http://foo.com/src/js/file2.js` (in fact it will list `http://foo.com/src` -as the source map root, and the original files as `js/file1.js` and -`js/file2.js`). - -### Composed source map - -When you're compressing JS code that was output by a compiler such as -CoffeeScript, mapping to the JS code won't be too helpful. Instead, you'd -like to map back to the original code (i.e. CoffeeScript). UglifyJS has an -option to take an input source map. Assuming you have a mapping from -CoffeeScript → compiled JS, UglifyJS can generate a map from CoffeeScript → -compressed JS by mapping every token in the compiled JS to its original -location. - -To use this feature you need to pass `--in-source-map -/path/to/input/source.map`. Normally the input source map should also point -to the file containing the generated JS, so if that's correct you can omit -input files from the command line. - -## Mangler options - -To enable the mangler you need to pass `--mangle` (`-m`). The following -(comma-separated) options are supported: - -- `sort` — to assign shorter names to most frequently used variables. This - saves a few hundred bytes on jQuery before gzip, but the output is - _bigger_ after gzip (and seems to happen for other libraries I tried it - on) therefore it's not enabled by default. - -- `toplevel` — mangle names declared in the toplevel scope (disabled by - default). - -- `eval` — mangle names visible in scopes where `eval` or `when` are used - (disabled by default). - -When mangling is enabled but you want to prevent certain names from being -mangled, you can declare those names with `--reserved` (`-r`) — pass a -comma-separated list of names. For example: - - uglifyjs ... -m -r '$,require,exports' - -to prevent the `require`, `exports` and `$` names from being changed. - -## Compressor options - -You need to pass `--compress` (`-c`) to enable the compressor. Optionally -you can pass a comma-separated list of options. Options are in the form -`foo=bar`, or just `foo` (the latter implies a boolean option that you want -to set `true`; it's effectively a shortcut for `foo=true`). - -- `sequences` -- join consecutive simple statements using the comma operator -- `properties` -- rewrite property access using the dot notation, for - example `foo["bar"] → foo.bar` -- `dead_code` -- remove unreachable code -- `drop_debugger` -- remove `debugger;` statements -- `unsafe` (default: false) -- apply "unsafe" transformations (discussion below) -- `conditionals` -- apply optimizations for `if`-s and conditional - expressions -- `comparisons` -- apply certain optimizations to binary nodes, for example: - `!(a <= b) → a > b` (only when `unsafe`), attempts to negate binary nodes, - e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc. -- `evaluate` -- attempt to evaluate constant expressions -- `booleans` -- various optimizations for boolean context, for example `!!a - ? b : c → a ? b : c` -- `loops` -- optimizations for `do`, `while` and `for` loops when we can - statically determine the condition -- `unused` -- drop unreferenced functions and variables -- `hoist_funs` -- hoist function declarations -- `hoist_vars` (default: false) -- hoist `var` declarations (this is `false` - by default because it seems to increase the size of the output in general) -- `if_return` -- optimizations for if/return and if/continue -- `join_vars` -- join consecutive `var` statements -- `cascade` -- small optimization for sequences, transform `x, x` into `x` - and `x = something(), x` into `x = something()` -- `warnings` -- display warnings when dropping unreachable code or unused - declarations etc. -- `negate_iife` -- negate "Immediately-Called Function Expressions" - where the return value is discarded, to avoid the parens that the - code generator would insert. - -### The `unsafe` option - -It enables some transformations that *might* break code logic in certain -contrived cases, but should be fine for most code. You might want to try it -on your own code, it should reduce the minified size. Here's what happens -when this flag is on: - -- `new Array(1, 2, 3)` or `Array(1, 2, 3)` → `[1, 2, 3 ]` -- `new Object()` → `{}` -- `String(exp)` or `exp.toString()` → `"" + exp` -- `new Object/RegExp/Function/Error/Array (...)` → we discard the `new` -- `typeof foo == "undefined"` → `foo === void 0` -- `void 0` → `"undefined"` (if there is a variable named "undefined" in - scope; we do it because the variable name will be mangled, typically - reduced to a single character). - -### Conditional compilation - -You can use the `--define` (`-d`) switch in order to declare global -variables that UglifyJS will assume to be constants (unless defined in -scope). For example if you pass `--define DEBUG=false` then, coupled with -dead code removal UglifyJS will discard the following from the output: -```javascript -if (DEBUG) { - console.log("debug stuff"); -} -``` - -UglifyJS will warn about the condition being always false and about dropping -unreachable code; for now there is no option to turn off only this specific -warning, you can pass `warnings=false` to turn off *all* warnings. - -Another way of doing that is to declare your globals as constants in a -separate file and include it into the build. For example you can have a -`build/defines.js` file with the following: -```javascript -const DEBUG = false; -const PRODUCTION = true; -// etc. -``` - -and build your code like this: - - uglifyjs build/defines.js js/foo.js js/bar.js... -c - -UglifyJS will notice the constants and, since they cannot be altered, it -will evaluate references to them to the value itself and drop unreachable -code as usual. The possible downside of this approach is that the build -will contain the `const` declarations. - - -## Beautifier options - -The code generator tries to output shortest code possible by default. In -case you want beautified output, pass `--beautify` (`-b`). Optionally you -can pass additional arguments that control the code output: - -- `beautify` (default `true`) -- whether to actually beautify the output. - Passing `-b` will set this to true, but you might need to pass `-b` even - when you want to generate minified code, in order to specify additional - arguments, so you can use `-b beautify=false` to override it. -- `indent-level` (default 4) -- `indent-start` (default 0) -- prefix all lines by that many spaces -- `quote-keys` (default `false`) -- pass `true` to quote all keys in literal - objects -- `space-colon` (default `true`) -- insert a space after the colon signs -- `ascii-only` (default `false`) -- escape Unicode characters in strings and - regexps -- `inline-script` (default `false`) -- escape the slash in occurrences of - ` 0) { - sys.error("WARN: Ignoring input files since --self was passed"); - } - files = UglifyJS.FILES; - if (!ARGS.wrap) ARGS.wrap = "UglifyJS"; - ARGS.export_all = true; -} - -var ORIG_MAP = ARGS.in_source_map; - -if (ORIG_MAP) { - ORIG_MAP = JSON.parse(fs.readFileSync(ORIG_MAP)); - if (files.length == 0) { - sys.error("INFO: Using file from the input source map: " + ORIG_MAP.file); - files = [ ORIG_MAP.file ]; - } - if (ARGS.source_map_root == null) { - ARGS.source_map_root = ORIG_MAP.sourceRoot; - } -} - -if (files.length == 0) { - files = [ "-" ]; -} - -if (files.indexOf("-") >= 0 && ARGS.source_map) { - sys.error("ERROR: Source map doesn't work with input from STDIN"); - process.exit(1); -} - -if (files.filter(function(el){ return el == "-" }).length > 1) { - sys.error("ERROR: Can read a single file from STDIN (two or more dashes specified)"); - process.exit(1); -} - -var STATS = {}; -var OUTPUT_FILE = ARGS.o; -var TOPLEVEL = null; -var P_RELATIVE = ARGS.p && ARGS.p == "relative"; - -var SOURCE_MAP = ARGS.source_map ? UglifyJS.SourceMap({ - file: P_RELATIVE ? path.relative(path.dirname(ARGS.source_map), OUTPUT_FILE) : OUTPUT_FILE, - root: ARGS.source_map_root, - orig: ORIG_MAP, -}) : null; - -OUTPUT_OPTIONS.source_map = SOURCE_MAP; - -try { - var output = UglifyJS.OutputStream(OUTPUT_OPTIONS); - var compressor = COMPRESS && UglifyJS.Compressor(COMPRESS); -} catch(ex) { - if (ex instanceof UglifyJS.DefaultsError) { - sys.error(ex.msg); - sys.error("Supported options:"); - sys.error(sys.inspect(ex.defs)); - process.exit(1); - } -} - -async.eachLimit(files, 1, function (file, cb) { - read_whole_file(file, function (err, code) { - if (err) { - sys.error("ERROR: can't read file: " + file); - process.exit(1); - } - if (ARGS.p != null) { - if (P_RELATIVE) { - file = path.relative(path.dirname(ARGS.source_map), file); - } else { - var p = parseInt(ARGS.p, 10); - if (!isNaN(p)) { - file = file.replace(/^\/+/, "").split(/\/+/).slice(ARGS.p).join("/"); - } - } - } - time_it("parse", function(){ - if (ARGS.spidermonkey) { - var program = JSON.parse(code); - if (!TOPLEVEL) TOPLEVEL = program; - else TOPLEVEL.body = TOPLEVEL.body.concat(program.body); - } - else if (ARGS.acorn) { - TOPLEVEL = acorn.parse(code, { - locations : true, - trackComments : true, - sourceFile : file, - program : TOPLEVEL - }); - } - else { - TOPLEVEL = UglifyJS.parse(code, { - filename : file, - toplevel : TOPLEVEL, - expression : ARGS.expr, - }); - }; - }); - cb(); - }); -}, function () { - if (ARGS.acorn || ARGS.spidermonkey) time_it("convert_ast", function(){ - TOPLEVEL = UglifyJS.AST_Node.from_mozilla_ast(TOPLEVEL); - }); - - if (ARGS.wrap) { - TOPLEVEL = TOPLEVEL.wrap_commonjs(ARGS.wrap, ARGS.export_all); - } - - if (ARGS.enclose) { - var arg_parameter_list = ARGS.enclose; - if (arg_parameter_list === true) { - arg_parameter_list = []; - } - else if (!(arg_parameter_list instanceof Array)) { - arg_parameter_list = [arg_parameter_list]; - } - TOPLEVEL = TOPLEVEL.wrap_enclose(arg_parameter_list); - } - - var SCOPE_IS_NEEDED = COMPRESS || MANGLE || ARGS.lint; - - if (SCOPE_IS_NEEDED) { - time_it("scope", function(){ - TOPLEVEL.figure_out_scope({ screw_ie8: ARGS.screw_ie8 }); - if (ARGS.lint) { - TOPLEVEL.scope_warnings(); - } - }); - } - - if (COMPRESS) { - time_it("squeeze", function(){ - TOPLEVEL = TOPLEVEL.transform(compressor); - }); - } - - if (SCOPE_IS_NEEDED) { - time_it("scope", function(){ - TOPLEVEL.figure_out_scope({ screw_ie8: ARGS.screw_ie8 }); - if (MANGLE) { - TOPLEVEL.compute_char_frequency(MANGLE); - } - }); - } - - if (MANGLE) time_it("mangle", function(){ - TOPLEVEL.mangle_names(MANGLE); - }); - time_it("generate", function(){ - TOPLEVEL.print(output); - }); - - output = output.get(); - - if (SOURCE_MAP) { - fs.writeFileSync(ARGS.source_map, SOURCE_MAP, "utf8"); - var source_map_url = ARGS.source_map_url || ( - P_RELATIVE - ? path.relative(path.dirname(OUTPUT_FILE), ARGS.source_map) - : ARGS.source_map - ); - output += "\n//# sourceMappingURL=" + source_map_url; - } - - if (OUTPUT_FILE) { - fs.writeFileSync(OUTPUT_FILE, output, "utf8"); - } else { - sys.print(output); - sys.error("\n"); - } - - if (ARGS.stats) { - sys.error(UglifyJS.string_template("Timing information (compressed {count} files):", { - count: files.length - })); - for (var i in STATS) if (STATS.hasOwnProperty(i)) { - sys.error(UglifyJS.string_template("- {name}: {time}s", { - name: i, - time: (STATS[i] / 1000).toFixed(3) - })); - } - } -}); - -/* -----[ functions ]----- */ - -function normalize(o) { - for (var i in o) if (o.hasOwnProperty(i) && /-/.test(i)) { - o[i.replace(/-/g, "_")] = o[i]; - delete o[i]; - } -} - -function getOptions(x, constants) { - x = ARGS[x]; - if (!x) return null; - var ret = {}; - if (x !== true) { - var ast; - try { - ast = UglifyJS.parse(x); - } catch(ex) { - if (ex instanceof UglifyJS.JS_Parse_Error) { - sys.error("Error parsing arguments in: " + x); - process.exit(1); - } - } - ast.walk(new UglifyJS.TreeWalker(function(node){ - if (node instanceof UglifyJS.AST_Toplevel) return; // descend - if (node instanceof UglifyJS.AST_SimpleStatement) return; // descend - if (node instanceof UglifyJS.AST_Seq) return; // descend - if (node instanceof UglifyJS.AST_Assign) { - var name = node.left.print_to_string({ beautify: false }).replace(/-/g, "_"); - var value = node.right; - if (constants) - value = new Function("return (" + value.print_to_string() + ")")(); - ret[name] = value; - return true; // no descend - } - sys.error(node.TYPE) - sys.error("Error parsing arguments in: " + x); - process.exit(1); - })); - } - return ret; -} - -function read_whole_file(filename, cb) { - if (filename == "-") { - var chunks = []; - process.stdin.setEncoding('utf-8'); - process.stdin.on('data', function (chunk) { - chunks.push(chunk); - }).on('end', function () { - cb(null, chunks.join("")); - }); - process.openStdin(); - } else { - fs.readFile(filename, "utf-8", cb); - } -} - -function time_it(name, cont) { - var t1 = new Date().getTime(); - var ret = cont(); - if (ARGS.stats) { - var spent = new Date().getTime() - t1; - if (STATS[name]) STATS[name] += spent; - else STATS[name] = spent; - } - return ret; -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/ast.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/ast.js deleted file mode 100644 index b8e89f2..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/ast.js +++ /dev/null @@ -1,988 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -function DEFNODE(type, props, methods, base) { - if (arguments.length < 4) base = AST_Node; - if (!props) props = []; - else props = props.split(/\s+/); - var self_props = props; - if (base && base.PROPS) - props = props.concat(base.PROPS); - var code = "return function AST_" + type + "(props){ if (props) { "; - for (var i = props.length; --i >= 0;) { - code += "this." + props[i] + " = props." + props[i] + ";"; - } - var proto = base && new base; - if (proto && proto.initialize || (methods && methods.initialize)) - code += "this.initialize();"; - code += "}}"; - var ctor = new Function(code)(); - if (proto) { - ctor.prototype = proto; - ctor.BASE = base; - } - if (base) base.SUBCLASSES.push(ctor); - ctor.prototype.CTOR = ctor; - ctor.PROPS = props || null; - ctor.SELF_PROPS = self_props; - ctor.SUBCLASSES = []; - if (type) { - ctor.prototype.TYPE = ctor.TYPE = type; - } - if (methods) for (i in methods) if (methods.hasOwnProperty(i)) { - if (/^\$/.test(i)) { - ctor[i.substr(1)] = methods[i]; - } else { - ctor.prototype[i] = methods[i]; - } - } - ctor.DEFMETHOD = function(name, method) { - this.prototype[name] = method; - }; - return ctor; -}; - -var AST_Token = DEFNODE("Token", "type value line col pos endpos nlb comments_before file", { -}, null); - -var AST_Node = DEFNODE("Node", "start end", { - clone: function() { - return new this.CTOR(this); - }, - $documentation: "Base class of all AST nodes", - $propdoc: { - start: "[AST_Token] The first token of this node", - end: "[AST_Token] The last token of this node" - }, - _walk: function(visitor) { - return visitor._visit(this); - }, - walk: function(visitor) { - return this._walk(visitor); // not sure the indirection will be any help - } -}, null); - -AST_Node.warn_function = null; -AST_Node.warn = function(txt, props) { - if (AST_Node.warn_function) - AST_Node.warn_function(string_template(txt, props)); -}; - -/* -----[ statements ]----- */ - -var AST_Statement = DEFNODE("Statement", null, { - $documentation: "Base class of all statements", -}); - -var AST_Debugger = DEFNODE("Debugger", null, { - $documentation: "Represents a debugger statement", -}, AST_Statement); - -var AST_Directive = DEFNODE("Directive", "value scope", { - $documentation: "Represents a directive, like \"use strict\";", - $propdoc: { - value: "[string] The value of this directive as a plain string (it's not an AST_String!)", - scope: "[AST_Scope/S] The scope that this directive affects" - }, -}, AST_Statement); - -var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", { - $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", - $propdoc: { - body: "[AST_Node] an expression node (should not be instanceof AST_Statement)" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.body._walk(visitor); - }); - } -}, AST_Statement); - -function walk_body(node, visitor) { - if (node.body instanceof AST_Statement) { - node.body._walk(visitor); - } - else node.body.forEach(function(stat){ - stat._walk(visitor); - }); -}; - -var AST_Block = DEFNODE("Block", "body", { - $documentation: "A body of statements (usually bracketed)", - $propdoc: { - body: "[AST_Statement*] an array of statements" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - walk_body(this, visitor); - }); - } -}, AST_Statement); - -var AST_BlockStatement = DEFNODE("BlockStatement", null, { - $documentation: "A block statement", -}, AST_Block); - -var AST_EmptyStatement = DEFNODE("EmptyStatement", null, { - $documentation: "The empty statement (empty block or simply a semicolon)", - _walk: function(visitor) { - return visitor._visit(this); - } -}, AST_Statement); - -var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", { - $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", - $propdoc: { - body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.body._walk(visitor); - }); - } -}, AST_Statement); - -var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", { - $documentation: "Statement with a label", - $propdoc: { - label: "[AST_Label] a label definition" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.label._walk(visitor); - this.body._walk(visitor); - }); - } -}, AST_StatementWithBody); - -var AST_DWLoop = DEFNODE("DWLoop", "condition", { - $documentation: "Base class for do/while statements", - $propdoc: { - condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.condition._walk(visitor); - this.body._walk(visitor); - }); - } -}, AST_StatementWithBody); - -var AST_Do = DEFNODE("Do", null, { - $documentation: "A `do` statement", -}, AST_DWLoop); - -var AST_While = DEFNODE("While", null, { - $documentation: "A `while` statement", -}, AST_DWLoop); - -var AST_For = DEFNODE("For", "init condition step", { - $documentation: "A `for` statement", - $propdoc: { - init: "[AST_Node?] the `for` initialization code, or null if empty", - condition: "[AST_Node?] the `for` termination clause, or null if empty", - step: "[AST_Node?] the `for` update clause, or null if empty" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - if (this.init) this.init._walk(visitor); - if (this.condition) this.condition._walk(visitor); - if (this.step) this.step._walk(visitor); - this.body._walk(visitor); - }); - } -}, AST_StatementWithBody); - -var AST_ForIn = DEFNODE("ForIn", "init name object", { - $documentation: "A `for ... in` statement", - $propdoc: { - init: "[AST_Node] the `for/in` initialization code", - name: "[AST_SymbolRef?] the loop variable, only if `init` is AST_Var", - object: "[AST_Node] the object that we're looping through" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.init._walk(visitor); - this.object._walk(visitor); - this.body._walk(visitor); - }); - } -}, AST_StatementWithBody); - -var AST_With = DEFNODE("With", "expression", { - $documentation: "A `with` statement", - $propdoc: { - expression: "[AST_Node] the `with` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.expression._walk(visitor); - this.body._walk(visitor); - }); - } -}, AST_StatementWithBody); - -/* -----[ scope and functions ]----- */ - -var AST_Scope = DEFNODE("Scope", "directives variables functions uses_with uses_eval parent_scope enclosed cname", { - $documentation: "Base class for all statements introducing a lexical scope", - $propdoc: { - directives: "[string*/S] an array of directives declared in this scope", - variables: "[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope", - functions: "[Object/S] like `variables`, but only lists function declarations", - uses_with: "[boolean/S] tells whether this scope uses the `with` statement", - uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", - parent_scope: "[AST_Scope?/S] link to the parent scope", - enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes", - cname: "[integer/S] current index for mangling variables (used internally by the mangler)", - }, -}, AST_Block); - -var AST_Toplevel = DEFNODE("Toplevel", "globals", { - $documentation: "The toplevel scope", - $propdoc: { - globals: "[Object/S] a map of name -> SymbolDef for all undeclared names", - }, - wrap_enclose: function(arg_parameter_pairs) { - var self = this; - var args = []; - var parameters = []; - - arg_parameter_pairs.forEach(function(pair) { - var split = pair.split(":"); - - args.push(split[0]); - parameters.push(split[1]); - }); - - var wrapped_tl = "(function(" + parameters.join(",") + "){ '$ORIG'; })(" + args.join(",") + ")"; - wrapped_tl = parse(wrapped_tl); - wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){ - if (node instanceof AST_Directive && node.value == "$ORIG") { - return MAP.splice(self.body); - } - })); - return wrapped_tl; - }, - wrap_commonjs: function(name, export_all) { - var self = this; - var to_export = []; - if (export_all) { - self.figure_out_scope(); - self.walk(new TreeWalker(function(node){ - if (node instanceof AST_SymbolDeclaration && node.definition().global) { - if (!find_if(function(n){ return n.name == node.name }, to_export)) - to_export.push(node); - } - })); - } - var wrapped_tl = "(function(exports, global){ global['" + name + "'] = exports; '$ORIG'; '$EXPORTS'; }({}, (function(){return this}())))"; - wrapped_tl = parse(wrapped_tl); - wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){ - if (node instanceof AST_SimpleStatement) { - node = node.body; - if (node instanceof AST_String) switch (node.getValue()) { - case "$ORIG": - return MAP.splice(self.body); - case "$EXPORTS": - var body = []; - to_export.forEach(function(sym){ - body.push(new AST_SimpleStatement({ - body: new AST_Assign({ - left: new AST_Sub({ - expression: new AST_SymbolRef({ name: "exports" }), - property: new AST_String({ value: sym.name }), - }), - operator: "=", - right: new AST_SymbolRef(sym), - }), - })); - }); - return MAP.splice(body); - } - } - })); - return wrapped_tl; - } -}, AST_Scope); - -var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments", { - $documentation: "Base class for functions", - $propdoc: { - name: "[AST_SymbolDeclaration?] the name of this function", - argnames: "[AST_SymbolFunarg*] array of function arguments", - uses_arguments: "[boolean/S] tells whether this function accesses the arguments array" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - if (this.name) this.name._walk(visitor); - this.argnames.forEach(function(arg){ - arg._walk(visitor); - }); - walk_body(this, visitor); - }); - } -}, AST_Scope); - -var AST_Accessor = DEFNODE("Accessor", null, { - $documentation: "A setter/getter function" -}, AST_Lambda); - -var AST_Function = DEFNODE("Function", null, { - $documentation: "A function expression" -}, AST_Lambda); - -var AST_Defun = DEFNODE("Defun", null, { - $documentation: "A function definition" -}, AST_Lambda); - -/* -----[ JUMPS ]----- */ - -var AST_Jump = DEFNODE("Jump", null, { - $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)" -}, AST_Statement); - -var AST_Exit = DEFNODE("Exit", "value", { - $documentation: "Base class for “exits” (`return` and `throw`)", - $propdoc: { - value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" - }, - _walk: function(visitor) { - return visitor._visit(this, this.value && function(){ - this.value._walk(visitor); - }); - } -}, AST_Jump); - -var AST_Return = DEFNODE("Return", null, { - $documentation: "A `return` statement" -}, AST_Exit); - -var AST_Throw = DEFNODE("Throw", null, { - $documentation: "A `throw` statement" -}, AST_Exit); - -var AST_LoopControl = DEFNODE("LoopControl", "label", { - $documentation: "Base class for loop control statements (`break` and `continue`)", - $propdoc: { - label: "[AST_LabelRef?] the label, or null if none", - }, - _walk: function(visitor) { - return visitor._visit(this, this.label && function(){ - this.label._walk(visitor); - }); - } -}, AST_Jump); - -var AST_Break = DEFNODE("Break", null, { - $documentation: "A `break` statement" -}, AST_LoopControl); - -var AST_Continue = DEFNODE("Continue", null, { - $documentation: "A `continue` statement" -}, AST_LoopControl); - -/* -----[ IF ]----- */ - -var AST_If = DEFNODE("If", "condition alternative", { - $documentation: "A `if` statement", - $propdoc: { - condition: "[AST_Node] the `if` condition", - alternative: "[AST_Statement?] the `else` part, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.condition._walk(visitor); - this.body._walk(visitor); - if (this.alternative) this.alternative._walk(visitor); - }); - } -}, AST_StatementWithBody); - -/* -----[ SWITCH ]----- */ - -var AST_Switch = DEFNODE("Switch", "expression", { - $documentation: "A `switch` statement", - $propdoc: { - expression: "[AST_Node] the `switch` “discriminant”" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.expression._walk(visitor); - walk_body(this, visitor); - }); - } -}, AST_Block); - -var AST_SwitchBranch = DEFNODE("SwitchBranch", null, { - $documentation: "Base class for `switch` branches", -}, AST_Block); - -var AST_Default = DEFNODE("Default", null, { - $documentation: "A `default` switch branch", -}, AST_SwitchBranch); - -var AST_Case = DEFNODE("Case", "expression", { - $documentation: "A `case` switch branch", - $propdoc: { - expression: "[AST_Node] the `case` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.expression._walk(visitor); - walk_body(this, visitor); - }); - } -}, AST_SwitchBranch); - -/* -----[ EXCEPTIONS ]----- */ - -var AST_Try = DEFNODE("Try", "bcatch bfinally", { - $documentation: "A `try` statement", - $propdoc: { - bcatch: "[AST_Catch?] the catch block, or null if not present", - bfinally: "[AST_Finally?] the finally block, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - walk_body(this, visitor); - if (this.bcatch) this.bcatch._walk(visitor); - if (this.bfinally) this.bfinally._walk(visitor); - }); - } -}, AST_Block); - -// XXX: this is wrong according to ECMA-262 (12.4). the catch block -// should introduce another scope, as the argname should be visible -// only inside the catch block. However, doing it this way because of -// IE which simply introduces the name in the surrounding scope. If -// we ever want to fix this then AST_Catch should inherit from -// AST_Scope. -var AST_Catch = DEFNODE("Catch", "argname", { - $documentation: "A `catch` node; only makes sense as part of a `try` statement", - $propdoc: { - argname: "[AST_SymbolCatch] symbol for the exception" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.argname._walk(visitor); - walk_body(this, visitor); - }); - } -}, AST_Block); - -var AST_Finally = DEFNODE("Finally", null, { - $documentation: "A `finally` node; only makes sense as part of a `try` statement" -}, AST_Block); - -/* -----[ VAR/CONST ]----- */ - -var AST_Definitions = DEFNODE("Definitions", "definitions", { - $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)", - $propdoc: { - definitions: "[AST_VarDef*] array of variable definitions" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.definitions.forEach(function(def){ - def._walk(visitor); - }); - }); - } -}, AST_Statement); - -var AST_Var = DEFNODE("Var", null, { - $documentation: "A `var` statement" -}, AST_Definitions); - -var AST_Const = DEFNODE("Const", null, { - $documentation: "A `const` statement" -}, AST_Definitions); - -var AST_VarDef = DEFNODE("VarDef", "name value", { - $documentation: "A variable declaration; only appears in a AST_Definitions node", - $propdoc: { - name: "[AST_SymbolVar|AST_SymbolConst] name of the variable", - value: "[AST_Node?] initializer, or null of there's no initializer" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.name._walk(visitor); - if (this.value) this.value._walk(visitor); - }); - } -}); - -/* -----[ OTHER ]----- */ - -var AST_Call = DEFNODE("Call", "expression args", { - $documentation: "A function call expression", - $propdoc: { - expression: "[AST_Node] expression to invoke as function", - args: "[AST_Node*] array of arguments" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.expression._walk(visitor); - this.args.forEach(function(arg){ - arg._walk(visitor); - }); - }); - } -}); - -var AST_New = DEFNODE("New", null, { - $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties" -}, AST_Call); - -var AST_Seq = DEFNODE("Seq", "car cdr", { - $documentation: "A sequence expression (two comma-separated expressions)", - $propdoc: { - car: "[AST_Node] first element in sequence", - cdr: "[AST_Node] second element in sequence" - }, - $cons: function(x, y) { - var seq = new AST_Seq(x); - seq.car = x; - seq.cdr = y; - return seq; - }, - $from_array: function(array) { - if (array.length == 0) return null; - if (array.length == 1) return array[0].clone(); - var list = null; - for (var i = array.length; --i >= 0;) { - list = AST_Seq.cons(array[i], list); - } - var p = list; - while (p) { - if (p.cdr && !p.cdr.cdr) { - p.cdr = p.cdr.car; - break; - } - p = p.cdr; - } - return list; - }, - to_array: function() { - var p = this, a = []; - while (p) { - a.push(p.car); - if (p.cdr && !(p.cdr instanceof AST_Seq)) { - a.push(p.cdr); - break; - } - p = p.cdr; - } - return a; - }, - add: function(node) { - var p = this; - while (p) { - if (!(p.cdr instanceof AST_Seq)) { - var cell = AST_Seq.cons(p.cdr, node); - return p.cdr = cell; - } - p = p.cdr; - } - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.car._walk(visitor); - if (this.cdr) this.cdr._walk(visitor); - }); - } -}); - -var AST_PropAccess = DEFNODE("PropAccess", "expression property", { - $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`", - $propdoc: { - expression: "[AST_Node] the “container” expression", - property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node" - } -}); - -var AST_Dot = DEFNODE("Dot", null, { - $documentation: "A dotted property access expression", - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.expression._walk(visitor); - }); - } -}, AST_PropAccess); - -var AST_Sub = DEFNODE("Sub", null, { - $documentation: "Index-style property access, i.e. `a[\"foo\"]`", - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.expression._walk(visitor); - this.property._walk(visitor); - }); - } -}, AST_PropAccess); - -var AST_Unary = DEFNODE("Unary", "operator expression", { - $documentation: "Base class for unary expressions", - $propdoc: { - operator: "[string] the operator", - expression: "[AST_Node] expression that this unary operator applies to" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.expression._walk(visitor); - }); - } -}); - -var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, { - $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" -}, AST_Unary); - -var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, { - $documentation: "Unary postfix expression, i.e. `i++`" -}, AST_Unary); - -var AST_Binary = DEFNODE("Binary", "left operator right", { - $documentation: "Binary expression, i.e. `a + b`", - $propdoc: { - left: "[AST_Node] left-hand side expression", - operator: "[string] the operator", - right: "[AST_Node] right-hand side expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.left._walk(visitor); - this.right._walk(visitor); - }); - } -}); - -var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", { - $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", - $propdoc: { - condition: "[AST_Node]", - consequent: "[AST_Node]", - alternative: "[AST_Node]" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.condition._walk(visitor); - this.consequent._walk(visitor); - this.alternative._walk(visitor); - }); - } -}); - -var AST_Assign = DEFNODE("Assign", null, { - $documentation: "An assignment expression — `a = b + 5`", -}, AST_Binary); - -/* -----[ LITERALS ]----- */ - -var AST_Array = DEFNODE("Array", "elements", { - $documentation: "An array literal", - $propdoc: { - elements: "[AST_Node*] array of elements" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.elements.forEach(function(el){ - el._walk(visitor); - }); - }); - } -}); - -var AST_Object = DEFNODE("Object", "properties", { - $documentation: "An object literal", - $propdoc: { - properties: "[AST_ObjectProperty*] array of properties" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.properties.forEach(function(prop){ - prop._walk(visitor); - }); - }); - } -}); - -var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", { - $documentation: "Base class for literal object properties", - $propdoc: { - key: "[string] the property name; it's always a plain string in our AST, no matter if it was a string, number or identifier in original code", - value: "[AST_Node] property value. For setters and getters this is an AST_Function." - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.value._walk(visitor); - }); - } -}); - -var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", null, { - $documentation: "A key: value object property", -}, AST_ObjectProperty); - -var AST_ObjectSetter = DEFNODE("ObjectSetter", null, { - $documentation: "An object setter property", -}, AST_ObjectProperty); - -var AST_ObjectGetter = DEFNODE("ObjectGetter", null, { - $documentation: "An object getter property", -}, AST_ObjectProperty); - -var AST_Symbol = DEFNODE("Symbol", "scope name thedef", { - $propdoc: { - name: "[string] name of this symbol", - scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", - thedef: "[SymbolDef/S] the definition of this symbol" - }, - $documentation: "Base class for all symbols", -}); - -var AST_SymbolAccessor = DEFNODE("SymbolAccessor", null, { - $documentation: "The name of a property accessor (setter/getter function)" -}, AST_Symbol); - -var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", { - $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)", - $propdoc: { - init: "[AST_Node*/S] array of initializers for this declaration." - } -}, AST_Symbol); - -var AST_SymbolVar = DEFNODE("SymbolVar", null, { - $documentation: "Symbol defining a variable", -}, AST_SymbolDeclaration); - -var AST_SymbolConst = DEFNODE("SymbolConst", null, { - $documentation: "A constant declaration" -}, AST_SymbolDeclaration); - -var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, { - $documentation: "Symbol naming a function argument", -}, AST_SymbolVar); - -var AST_SymbolDefun = DEFNODE("SymbolDefun", null, { - $documentation: "Symbol defining a function", -}, AST_SymbolDeclaration); - -var AST_SymbolLambda = DEFNODE("SymbolLambda", null, { - $documentation: "Symbol naming a function expression", -}, AST_SymbolDeclaration); - -var AST_SymbolCatch = DEFNODE("SymbolCatch", null, { - $documentation: "Symbol naming the exception in catch", -}, AST_SymbolDeclaration); - -var AST_Label = DEFNODE("Label", "references", { - $documentation: "Symbol naming a label (declaration)", - $propdoc: { - references: "[AST_LabelRef*] a list of nodes referring to this label" - } -}, AST_Symbol); - -var AST_SymbolRef = DEFNODE("SymbolRef", null, { - $documentation: "Reference to some symbol (not definition/declaration)", -}, AST_Symbol); - -var AST_LabelRef = DEFNODE("LabelRef", null, { - $documentation: "Reference to a label symbol", -}, AST_Symbol); - -var AST_This = DEFNODE("This", null, { - $documentation: "The `this` symbol", -}, AST_Symbol); - -var AST_Constant = DEFNODE("Constant", null, { - $documentation: "Base class for all constants", - getValue: function() { - return this.value; - } -}); - -var AST_String = DEFNODE("String", "value", { - $documentation: "A string literal", - $propdoc: { - value: "[string] the contents of this string" - } -}, AST_Constant); - -var AST_Number = DEFNODE("Number", "value", { - $documentation: "A number literal", - $propdoc: { - value: "[number] the numeric value" - } -}, AST_Constant); - -var AST_RegExp = DEFNODE("RegExp", "value", { - $documentation: "A regexp literal", - $propdoc: { - value: "[RegExp] the actual regexp" - } -}, AST_Constant); - -var AST_Atom = DEFNODE("Atom", null, { - $documentation: "Base class for atoms", -}, AST_Constant); - -var AST_Null = DEFNODE("Null", null, { - $documentation: "The `null` atom", - value: null -}, AST_Atom); - -var AST_NaN = DEFNODE("NaN", null, { - $documentation: "The impossible value", - value: 0/0 -}, AST_Atom); - -var AST_Undefined = DEFNODE("Undefined", null, { - $documentation: "The `undefined` value", - value: (function(){}()) -}, AST_Atom); - -var AST_Hole = DEFNODE("Hole", null, { - $documentation: "A hole in an array", - value: (function(){}()) -}, AST_Atom); - -var AST_Infinity = DEFNODE("Infinity", null, { - $documentation: "The `Infinity` value", - value: 1/0 -}, AST_Atom); - -var AST_Boolean = DEFNODE("Boolean", null, { - $documentation: "Base class for booleans", -}, AST_Atom); - -var AST_False = DEFNODE("False", null, { - $documentation: "The `false` atom", - value: false -}, AST_Boolean); - -var AST_True = DEFNODE("True", null, { - $documentation: "The `true` atom", - value: true -}, AST_Boolean); - -/* -----[ TreeWalker ]----- */ - -function TreeWalker(callback) { - this.visit = callback; - this.stack = []; -}; -TreeWalker.prototype = { - _visit: function(node, descend) { - this.stack.push(node); - var ret = this.visit(node, descend ? function(){ - descend.call(node); - } : noop); - if (!ret && descend) { - descend.call(node); - } - this.stack.pop(); - return ret; - }, - parent: function(n) { - return this.stack[this.stack.length - 2 - (n || 0)]; - }, - push: function (node) { - this.stack.push(node); - }, - pop: function() { - return this.stack.pop(); - }, - self: function() { - return this.stack[this.stack.length - 1]; - }, - find_parent: function(type) { - var stack = this.stack; - for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof type) return x; - } - }, - has_directive: function(type) { - return this.find_parent(AST_Scope).has_directive(type); - }, - in_boolean_context: function() { - var stack = this.stack; - var i = stack.length, self = stack[--i]; - while (i > 0) { - var p = stack[--i]; - if ((p instanceof AST_If && p.condition === self) || - (p instanceof AST_Conditional && p.condition === self) || - (p instanceof AST_DWLoop && p.condition === self) || - (p instanceof AST_For && p.condition === self) || - (p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self)) - { - return true; - } - if (!(p instanceof AST_Binary && (p.operator == "&&" || p.operator == "||"))) - return false; - self = p; - } - }, - loopcontrol_target: function(label) { - var stack = this.stack; - if (label) { - for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_LabeledStatement && x.label.name == label.name) { - return x.body; - } - } - } else { - for (var i = stack.length; --i >= 0;) { - var x = stack[i]; - if (x instanceof AST_Switch - || x instanceof AST_For - || x instanceof AST_ForIn - || x instanceof AST_DWLoop) return x; - } - } - } -}; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/compress.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/compress.js deleted file mode 100644 index 8d936ba..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/compress.js +++ /dev/null @@ -1,2068 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -function Compressor(options, false_by_default) { - if (!(this instanceof Compressor)) - return new Compressor(options, false_by_default); - TreeTransformer.call(this, this.before, this.after); - this.options = defaults(options, { - sequences : !false_by_default, - properties : !false_by_default, - dead_code : !false_by_default, - drop_debugger : !false_by_default, - unsafe : false, - unsafe_comps : false, - conditionals : !false_by_default, - comparisons : !false_by_default, - evaluate : !false_by_default, - booleans : !false_by_default, - loops : !false_by_default, - unused : !false_by_default, - hoist_funs : !false_by_default, - hoist_vars : false, - if_return : !false_by_default, - join_vars : !false_by_default, - cascade : !false_by_default, - side_effects : !false_by_default, - negate_iife : !false_by_default, - screw_ie8 : false, - - warnings : true, - global_defs : {} - }, true); -}; - -Compressor.prototype = new TreeTransformer; -merge(Compressor.prototype, { - option: function(key) { return this.options[key] }, - warn: function() { - if (this.options.warnings) - AST_Node.warn.apply(AST_Node, arguments); - }, - before: function(node, descend, in_list) { - if (node._squeezed) return node; - if (node instanceof AST_Scope) { - node.drop_unused(this); - node = node.hoist_declarations(this); - } - descend(node, this); - node = node.optimize(this); - if (node instanceof AST_Scope) { - // dead code removal might leave further unused declarations. - // this'll usually save very few bytes, but the performance - // hit seems negligible so I'll just drop it here. - - // no point to repeat warnings. - var save_warnings = this.options.warnings; - this.options.warnings = false; - node.drop_unused(this); - this.options.warnings = save_warnings; - } - node._squeezed = true; - return node; - } -}); - -(function(){ - - function OPT(node, optimizer) { - node.DEFMETHOD("optimize", function(compressor){ - var self = this; - if (self._optimized) return self; - var opt = optimizer(self, compressor); - opt._optimized = true; - if (opt === self) return opt; - return opt.transform(compressor); - }); - }; - - OPT(AST_Node, function(self, compressor){ - return self; - }); - - AST_Node.DEFMETHOD("equivalent_to", function(node){ - // XXX: this is a rather expensive way to test two node's equivalence: - return this.print_to_string() == node.print_to_string(); - }); - - function make_node(ctor, orig, props) { - if (!props) props = {}; - if (orig) { - if (!props.start) props.start = orig.start; - if (!props.end) props.end = orig.end; - } - return new ctor(props); - }; - - function make_node_from_constant(compressor, val, orig) { - // XXX: WIP. - // if (val instanceof AST_Node) return val.transform(new TreeTransformer(null, function(node){ - // if (node instanceof AST_SymbolRef) { - // var scope = compressor.find_parent(AST_Scope); - // var def = scope.find_variable(node); - // node.thedef = def; - // return node; - // } - // })).transform(compressor); - - if (val instanceof AST_Node) return val.transform(compressor); - switch (typeof val) { - case "string": - return make_node(AST_String, orig, { - value: val - }).optimize(compressor); - case "number": - return make_node(isNaN(val) ? AST_NaN : AST_Number, orig, { - value: val - }).optimize(compressor); - case "boolean": - return make_node(val ? AST_True : AST_False, orig).optimize(compressor); - case "undefined": - return make_node(AST_Undefined, orig).optimize(compressor); - default: - if (val === null) { - return make_node(AST_Null, orig).optimize(compressor); - } - if (val instanceof RegExp) { - return make_node(AST_RegExp, orig).optimize(compressor); - } - throw new Error(string_template("Can't handle constant of type: {type}", { - type: typeof val - })); - } - }; - - function as_statement_array(thing) { - if (thing === null) return []; - if (thing instanceof AST_BlockStatement) return thing.body; - if (thing instanceof AST_EmptyStatement) return []; - if (thing instanceof AST_Statement) return [ thing ]; - throw new Error("Can't convert thing to statement array"); - }; - - function is_empty(thing) { - if (thing === null) return true; - if (thing instanceof AST_EmptyStatement) return true; - if (thing instanceof AST_BlockStatement) return thing.body.length == 0; - return false; - }; - - function loop_body(x) { - if (x instanceof AST_Switch) return x; - if (x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) { - return (x.body instanceof AST_BlockStatement ? x.body : x); - } - return x; - }; - - function tighten_body(statements, compressor) { - var CHANGED; - do { - CHANGED = false; - statements = eliminate_spurious_blocks(statements); - if (compressor.option("dead_code")) { - statements = eliminate_dead_code(statements, compressor); - } - if (compressor.option("if_return")) { - statements = handle_if_return(statements, compressor); - } - if (compressor.option("sequences")) { - statements = sequencesize(statements, compressor); - } - if (compressor.option("join_vars")) { - statements = join_consecutive_vars(statements, compressor); - } - } while (CHANGED); - - if (compressor.option("negate_iife")) { - negate_iifes(statements, compressor); - } - - return statements; - - function eliminate_spurious_blocks(statements) { - var seen_dirs = []; - return statements.reduce(function(a, stat){ - if (stat instanceof AST_BlockStatement) { - CHANGED = true; - a.push.apply(a, eliminate_spurious_blocks(stat.body)); - } else if (stat instanceof AST_EmptyStatement) { - CHANGED = true; - } else if (stat instanceof AST_Directive) { - if (seen_dirs.indexOf(stat.value) < 0) { - a.push(stat); - seen_dirs.push(stat.value); - } else { - CHANGED = true; - } - } else { - a.push(stat); - } - return a; - }, []); - }; - - function handle_if_return(statements, compressor) { - var self = compressor.self(); - var in_lambda = self instanceof AST_Lambda; - var ret = []; - loop: for (var i = statements.length; --i >= 0;) { - var stat = statements[i]; - switch (true) { - case (in_lambda && stat instanceof AST_Return && !stat.value && ret.length == 0): - CHANGED = true; - // note, ret.length is probably always zero - // because we drop unreachable code before this - // step. nevertheless, it's good to check. - continue loop; - case stat instanceof AST_If: - if (stat.body instanceof AST_Return) { - //--- - // pretty silly case, but: - // if (foo()) return; return; ==> foo(); return; - if (((in_lambda && ret.length == 0) - || (ret[0] instanceof AST_Return && !ret[0].value)) - && !stat.body.value && !stat.alternative) { - CHANGED = true; - var cond = make_node(AST_SimpleStatement, stat.condition, { - body: stat.condition - }); - ret.unshift(cond); - continue loop; - } - //--- - // if (foo()) return x; return y; ==> return foo() ? x : y; - if (ret[0] instanceof AST_Return && stat.body.value && ret[0].value && !stat.alternative) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = ret[0]; - ret[0] = stat.transform(compressor); - continue loop; - } - //--- - // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined; - if ((ret.length == 0 || ret[0] instanceof AST_Return) && stat.body.value && !stat.alternative && in_lambda) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = ret[0] || make_node(AST_Return, stat, { - value: make_node(AST_Undefined, stat) - }); - ret[0] = stat.transform(compressor); - continue loop; - } - //--- - // if (foo()) return; [ else x... ]; y... ==> if (!foo()) { x...; y... } - if (!stat.body.value && in_lambda) { - CHANGED = true; - stat = stat.clone(); - stat.condition = stat.condition.negate(compressor); - stat.body = make_node(AST_BlockStatement, stat, { - body: as_statement_array(stat.alternative).concat(ret) - }); - stat.alternative = null; - ret = [ stat.transform(compressor) ]; - continue loop; - } - //--- - if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement - && (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) { - CHANGED = true; - ret.push(make_node(AST_Return, ret[0], { - value: make_node(AST_Undefined, ret[0]) - }).transform(compressor)); - ret = as_statement_array(stat.alternative).concat(ret); - ret.unshift(stat); - continue loop; - } - } - - var ab = aborts(stat.body); - var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null; - if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda) - || (ab instanceof AST_Continue && self === loop_body(lct)) - || (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) { - if (ab.label) { - remove(ab.label.thedef.references, ab.label); - } - CHANGED = true; - var body = as_statement_array(stat.body).slice(0, -1); - stat = stat.clone(); - stat.condition = stat.condition.negate(compressor); - stat.body = make_node(AST_BlockStatement, stat, { - body: ret - }); - stat.alternative = make_node(AST_BlockStatement, stat, { - body: body - }); - ret = [ stat.transform(compressor) ]; - continue loop; - } - - var ab = aborts(stat.alternative); - var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null; - if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda) - || (ab instanceof AST_Continue && self === loop_body(lct)) - || (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) { - if (ab.label) { - remove(ab.label.thedef.references, ab.label); - } - CHANGED = true; - stat = stat.clone(); - stat.body = make_node(AST_BlockStatement, stat.body, { - body: as_statement_array(stat.body).concat(ret) - }); - stat.alternative = make_node(AST_BlockStatement, stat.alternative, { - body: as_statement_array(stat.alternative).slice(0, -1) - }); - ret = [ stat.transform(compressor) ]; - continue loop; - } - - ret.unshift(stat); - break; - default: - ret.unshift(stat); - break; - } - } - return ret; - }; - - function eliminate_dead_code(statements, compressor) { - var has_quit = false; - var orig = statements.length; - var self = compressor.self(); - statements = statements.reduce(function(a, stat){ - if (has_quit) { - extract_declarations_from_unreachable_code(compressor, stat, a); - } else { - if (stat instanceof AST_LoopControl) { - var lct = compressor.loopcontrol_target(stat.label); - if ((stat instanceof AST_Break - && lct instanceof AST_BlockStatement - && loop_body(lct) === self) || (stat instanceof AST_Continue - && loop_body(lct) === self)) { - if (stat.label) { - remove(stat.label.thedef.references, stat.label); - } - } else { - a.push(stat); - } - } else { - a.push(stat); - } - if (aborts(stat)) has_quit = true; - } - return a; - }, []); - CHANGED = statements.length != orig; - return statements; - }; - - function sequencesize(statements, compressor) { - if (statements.length < 2) return statements; - var seq = [], ret = []; - function push_seq() { - seq = AST_Seq.from_array(seq); - if (seq) ret.push(make_node(AST_SimpleStatement, seq, { - body: seq - })); - seq = []; - }; - statements.forEach(function(stat){ - if (stat instanceof AST_SimpleStatement) seq.push(stat.body); - else push_seq(), ret.push(stat); - }); - push_seq(); - ret = sequencesize_2(ret, compressor); - CHANGED = ret.length != statements.length; - return ret; - }; - - function sequencesize_2(statements, compressor) { - function cons_seq(right) { - ret.pop(); - var left = prev.body; - if (left instanceof AST_Seq) { - left.add(right); - } else { - left = AST_Seq.cons(left, right); - } - return left.transform(compressor); - }; - var ret = [], prev = null; - statements.forEach(function(stat){ - if (prev) { - if (stat instanceof AST_For) { - var opera = {}; - try { - prev.body.walk(new TreeWalker(function(node){ - if (node instanceof AST_Binary && node.operator == "in") - throw opera; - })); - if (stat.init && !(stat.init instanceof AST_Definitions)) { - stat.init = cons_seq(stat.init); - } - else if (!stat.init) { - stat.init = prev.body; - ret.pop(); - } - } catch(ex) { - if (ex !== opera) throw ex; - } - } - else if (stat instanceof AST_If) { - stat.condition = cons_seq(stat.condition); - } - else if (stat instanceof AST_With) { - stat.expression = cons_seq(stat.expression); - } - else if (stat instanceof AST_Exit && stat.value) { - stat.value = cons_seq(stat.value); - } - else if (stat instanceof AST_Exit) { - stat.value = cons_seq(make_node(AST_Undefined, stat)); - } - else if (stat instanceof AST_Switch) { - stat.expression = cons_seq(stat.expression); - } - } - ret.push(stat); - prev = stat instanceof AST_SimpleStatement ? stat : null; - }); - return ret; - }; - - function join_consecutive_vars(statements, compressor) { - var prev = null; - return statements.reduce(function(a, stat){ - if (stat instanceof AST_Definitions && prev && prev.TYPE == stat.TYPE) { - prev.definitions = prev.definitions.concat(stat.definitions); - CHANGED = true; - } - else if (stat instanceof AST_For - && prev instanceof AST_Definitions - && (!stat.init || stat.init.TYPE == prev.TYPE)) { - CHANGED = true; - a.pop(); - if (stat.init) { - stat.init.definitions = prev.definitions.concat(stat.init.definitions); - } else { - stat.init = prev; - } - a.push(stat); - prev = stat; - } - else { - prev = stat; - a.push(stat); - } - return a; - }, []); - }; - - function negate_iifes(statements, compressor) { - statements.forEach(function(stat){ - if (stat instanceof AST_SimpleStatement) { - stat.body = (function transform(thing) { - return thing.transform(new TreeTransformer(function(node){ - if (node instanceof AST_Call && node.expression instanceof AST_Function) { - return make_node(AST_UnaryPrefix, node, { - operator: "!", - expression: node - }); - } - else if (node instanceof AST_Call) { - node.expression = transform(node.expression); - } - else if (node instanceof AST_Seq) { - node.car = transform(node.car); - } - else if (node instanceof AST_Conditional) { - var expr = transform(node.condition); - if (expr !== node.condition) { - // it has been negated, reverse - node.condition = expr; - var tmp = node.consequent; - node.consequent = node.alternative; - node.alternative = tmp; - } - } - return node; - })); - })(stat.body); - } - }); - }; - - }; - - function extract_declarations_from_unreachable_code(compressor, stat, target) { - compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start); - stat.walk(new TreeWalker(function(node){ - if (node instanceof AST_Definitions) { - compressor.warn("Declarations in unreachable code! [{file}:{line},{col}]", node.start); - node.remove_initializers(); - target.push(node); - return true; - } - if (node instanceof AST_Defun) { - target.push(node); - return true; - } - if (node instanceof AST_Scope) { - return true; - } - })); - }; - - /* -----[ boolean/negation helpers ]----- */ - - // methods to determine whether an expression has a boolean result type - (function (def){ - var unary_bool = [ "!", "delete" ]; - var binary_bool = [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ]; - def(AST_Node, function(){ return false }); - def(AST_UnaryPrefix, function(){ - return member(this.operator, unary_bool); - }); - def(AST_Binary, function(){ - return member(this.operator, binary_bool) || - ( (this.operator == "&&" || this.operator == "||") && - this.left.is_boolean() && this.right.is_boolean() ); - }); - def(AST_Conditional, function(){ - return this.consequent.is_boolean() && this.alternative.is_boolean(); - }); - def(AST_Assign, function(){ - return this.operator == "=" && this.right.is_boolean(); - }); - def(AST_Seq, function(){ - return this.cdr.is_boolean(); - }); - def(AST_True, function(){ return true }); - def(AST_False, function(){ return true }); - })(function(node, func){ - node.DEFMETHOD("is_boolean", func); - }); - - // methods to determine if an expression has a string result type - (function (def){ - def(AST_Node, function(){ return false }); - def(AST_String, function(){ return true }); - def(AST_UnaryPrefix, function(){ - return this.operator == "typeof"; - }); - def(AST_Binary, function(compressor){ - return this.operator == "+" && - (this.left.is_string(compressor) || this.right.is_string(compressor)); - }); - def(AST_Assign, function(compressor){ - return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor); - }); - def(AST_Seq, function(compressor){ - return this.cdr.is_string(compressor); - }); - def(AST_Conditional, function(compressor){ - return this.consequent.is_string(compressor) && this.alternative.is_string(compressor); - }); - def(AST_Call, function(compressor){ - return compressor.option("unsafe") - && this.expression instanceof AST_SymbolRef - && this.expression.name == "String" - && this.expression.undeclared(); - }); - })(function(node, func){ - node.DEFMETHOD("is_string", func); - }); - - function best_of(ast1, ast2) { - return ast1.print_to_string().length > - ast2.print_to_string().length - ? ast2 : ast1; - }; - - // methods to evaluate a constant expression - (function (def){ - // The evaluate method returns an array with one or two - // elements. If the node has been successfully reduced to a - // constant, then the second element tells us the value; - // otherwise the second element is missing. The first element - // of the array is always an AST_Node descendant; when - // evaluation was successful it's a node that represents the - // constant; otherwise it's the original node. - AST_Node.DEFMETHOD("evaluate", function(compressor){ - if (!compressor.option("evaluate")) return [ this ]; - try { - var val = this._eval(), ast = make_node_from_constant(compressor, val, this); - return [ best_of(ast, this), val ]; - } catch(ex) { - if (ex !== def) throw ex; - return [ this ]; - } - }); - def(AST_Statement, function(){ - throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start)); - }); - def(AST_Function, function(){ - // XXX: AST_Function inherits from AST_Scope, which itself - // inherits from AST_Statement; however, an AST_Function - // isn't really a statement. This could byte in other - // places too. :-( Wish JS had multiple inheritance. - throw def; - }); - function ev(node) { - return node._eval(); - }; - def(AST_Node, function(){ - throw def; // not constant - }); - def(AST_Constant, function(){ - return this.getValue(); - }); - def(AST_UnaryPrefix, function(){ - var e = this.expression; - switch (this.operator) { - case "!": return !ev(e); - case "typeof": - // Function would be evaluated to an array and so typeof would - // incorrectly return 'object'. Hence making is a special case. - if (e instanceof AST_Function) return typeof function(){}; - - e = ev(e); - - // typeof returns "object" or "function" on different platforms - // so cannot evaluate reliably - if (e instanceof RegExp) throw def; - - return typeof e; - case "void": return void ev(e); - case "~": return ~ev(e); - case "-": - e = ev(e); - if (e === 0) throw def; - return -e; - case "+": return +ev(e); - } - throw def; - }); - def(AST_Binary, function(){ - var left = this.left, right = this.right; - switch (this.operator) { - case "&&" : return ev(left) && ev(right); - case "||" : return ev(left) || ev(right); - case "|" : return ev(left) | ev(right); - case "&" : return ev(left) & ev(right); - case "^" : return ev(left) ^ ev(right); - case "+" : return ev(left) + ev(right); - case "*" : return ev(left) * ev(right); - case "/" : return ev(left) / ev(right); - case "%" : return ev(left) % ev(right); - case "-" : return ev(left) - ev(right); - case "<<" : return ev(left) << ev(right); - case ">>" : return ev(left) >> ev(right); - case ">>>" : return ev(left) >>> ev(right); - case "==" : return ev(left) == ev(right); - case "===" : return ev(left) === ev(right); - case "!=" : return ev(left) != ev(right); - case "!==" : return ev(left) !== ev(right); - case "<" : return ev(left) < ev(right); - case "<=" : return ev(left) <= ev(right); - case ">" : return ev(left) > ev(right); - case ">=" : return ev(left) >= ev(right); - case "in" : return ev(left) in ev(right); - case "instanceof" : return ev(left) instanceof ev(right); - } - throw def; - }); - def(AST_Conditional, function(){ - return ev(this.condition) - ? ev(this.consequent) - : ev(this.alternative); - }); - def(AST_SymbolRef, function(){ - var d = this.definition(); - if (d && d.constant && d.init) return ev(d.init); - throw def; - }); - })(function(node, func){ - node.DEFMETHOD("_eval", func); - }); - - // method to negate an expression - (function(def){ - function basic_negation(exp) { - return make_node(AST_UnaryPrefix, exp, { - operator: "!", - expression: exp - }); - }; - def(AST_Node, function(){ - return basic_negation(this); - }); - def(AST_Statement, function(){ - throw new Error("Cannot negate a statement"); - }); - def(AST_Function, function(){ - return basic_negation(this); - }); - def(AST_UnaryPrefix, function(){ - if (this.operator == "!") - return this.expression; - return basic_negation(this); - }); - def(AST_Seq, function(compressor){ - var self = this.clone(); - self.cdr = self.cdr.negate(compressor); - return self; - }); - def(AST_Conditional, function(compressor){ - var self = this.clone(); - self.consequent = self.consequent.negate(compressor); - self.alternative = self.alternative.negate(compressor); - return best_of(basic_negation(this), self); - }); - def(AST_Binary, function(compressor){ - var self = this.clone(), op = this.operator; - if (compressor.option("unsafe_comps")) { - switch (op) { - case "<=" : self.operator = ">" ; return self; - case "<" : self.operator = ">=" ; return self; - case ">=" : self.operator = "<" ; return self; - case ">" : self.operator = "<=" ; return self; - } - } - switch (op) { - case "==" : self.operator = "!="; return self; - case "!=" : self.operator = "=="; return self; - case "===": self.operator = "!=="; return self; - case "!==": self.operator = "==="; return self; - case "&&": - self.operator = "||"; - self.left = self.left.negate(compressor); - self.right = self.right.negate(compressor); - return best_of(basic_negation(this), self); - case "||": - self.operator = "&&"; - self.left = self.left.negate(compressor); - self.right = self.right.negate(compressor); - return best_of(basic_negation(this), self); - } - return basic_negation(this); - }); - })(function(node, func){ - node.DEFMETHOD("negate", function(compressor){ - return func.call(this, compressor); - }); - }); - - // determine if expression has side effects - (function(def){ - def(AST_Node, function(){ return true }); - - def(AST_EmptyStatement, function(){ return false }); - def(AST_Constant, function(){ return false }); - def(AST_This, function(){ return false }); - - def(AST_Block, function(){ - for (var i = this.body.length; --i >= 0;) { - if (this.body[i].has_side_effects()) - return true; - } - return false; - }); - - def(AST_SimpleStatement, function(){ - return this.body.has_side_effects(); - }); - def(AST_Defun, function(){ return true }); - def(AST_Function, function(){ return false }); - def(AST_Binary, function(){ - return this.left.has_side_effects() - || this.right.has_side_effects(); - }); - def(AST_Assign, function(){ return true }); - def(AST_Conditional, function(){ - return this.condition.has_side_effects() - || this.consequent.has_side_effects() - || this.alternative.has_side_effects(); - }); - def(AST_Unary, function(){ - return this.operator == "delete" - || this.operator == "++" - || this.operator == "--" - || this.expression.has_side_effects(); - }); - def(AST_SymbolRef, function(){ return false }); - def(AST_Object, function(){ - for (var i = this.properties.length; --i >= 0;) - if (this.properties[i].has_side_effects()) - return true; - return false; - }); - def(AST_ObjectProperty, function(){ - return this.value.has_side_effects(); - }); - def(AST_Array, function(){ - for (var i = this.elements.length; --i >= 0;) - if (this.elements[i].has_side_effects()) - return true; - return false; - }); - // def(AST_Dot, function(){ - // return this.expression.has_side_effects(); - // }); - // def(AST_Sub, function(){ - // return this.expression.has_side_effects() - // || this.property.has_side_effects(); - // }); - def(AST_PropAccess, function(){ - return true; - }); - def(AST_Seq, function(){ - return this.car.has_side_effects() - || this.cdr.has_side_effects(); - }); - })(function(node, func){ - node.DEFMETHOD("has_side_effects", func); - }); - - // tell me if a statement aborts - function aborts(thing) { - return thing && thing.aborts(); - }; - (function(def){ - def(AST_Statement, function(){ return null }); - def(AST_Jump, function(){ return this }); - function block_aborts(){ - var n = this.body.length; - return n > 0 && aborts(this.body[n - 1]); - }; - def(AST_BlockStatement, block_aborts); - def(AST_SwitchBranch, block_aborts); - def(AST_If, function(){ - return this.alternative && aborts(this.body) && aborts(this.alternative); - }); - })(function(node, func){ - node.DEFMETHOD("aborts", func); - }); - - /* -----[ optimizers ]----- */ - - OPT(AST_Directive, function(self, compressor){ - if (self.scope.has_directive(self.value) !== self.scope) { - return make_node(AST_EmptyStatement, self); - } - return self; - }); - - OPT(AST_Debugger, function(self, compressor){ - if (compressor.option("drop_debugger")) - return make_node(AST_EmptyStatement, self); - return self; - }); - - OPT(AST_LabeledStatement, function(self, compressor){ - if (self.body instanceof AST_Break - && compressor.loopcontrol_target(self.body.label) === self.body) { - return make_node(AST_EmptyStatement, self); - } - return self.label.references.length == 0 ? self.body : self; - }); - - OPT(AST_Block, function(self, compressor){ - self.body = tighten_body(self.body, compressor); - return self; - }); - - OPT(AST_BlockStatement, function(self, compressor){ - self.body = tighten_body(self.body, compressor); - switch (self.body.length) { - case 1: return self.body[0]; - case 0: return make_node(AST_EmptyStatement, self); - } - return self; - }); - - AST_Scope.DEFMETHOD("drop_unused", function(compressor){ - var self = this; - if (compressor.option("unused") - && !(self instanceof AST_Toplevel) - && !self.uses_eval - ) { - var in_use = []; - var initializations = new Dictionary(); - // pass 1: find out which symbols are directly used in - // this scope (not in nested scopes). - var scope = this; - var tw = new TreeWalker(function(node, descend){ - if (node !== self) { - if (node instanceof AST_Defun) { - initializations.add(node.name.name, node); - return true; // don't go in nested scopes - } - if (node instanceof AST_Definitions && scope === self) { - node.definitions.forEach(function(def){ - if (def.value) { - initializations.add(def.name.name, def.value); - if (def.value.has_side_effects()) { - def.value.walk(tw); - } - } - }); - return true; - } - if (node instanceof AST_SymbolRef) { - push_uniq(in_use, node.definition()); - return true; - } - if (node instanceof AST_Scope) { - var save_scope = scope; - scope = node; - descend(); - scope = save_scope; - return true; - } - } - }); - self.walk(tw); - // pass 2: for every used symbol we need to walk its - // initialization code to figure out if it uses other - // symbols (that may not be in_use). - for (var i = 0; i < in_use.length; ++i) { - in_use[i].orig.forEach(function(decl){ - // undeclared globals will be instanceof AST_SymbolRef - var init = initializations.get(decl.name); - if (init) init.forEach(function(init){ - var tw = new TreeWalker(function(node){ - if (node instanceof AST_SymbolRef) { - push_uniq(in_use, node.definition()); - } - }); - init.walk(tw); - }); - }); - } - // pass 3: we should drop declarations not in_use - var tt = new TreeTransformer( - function before(node, descend, in_list) { - if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) { - for (var a = node.argnames, i = a.length; --i >= 0;) { - var sym = a[i]; - if (sym.unreferenced()) { - a.pop(); - compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", { - name : sym.name, - file : sym.start.file, - line : sym.start.line, - col : sym.start.col - }); - } - else break; - } - } - if (node instanceof AST_Defun && node !== self) { - if (!member(node.name.definition(), in_use)) { - compressor.warn("Dropping unused function {name} [{file}:{line},{col}]", { - name : node.name.name, - file : node.name.start.file, - line : node.name.start.line, - col : node.name.start.col - }); - return make_node(AST_EmptyStatement, node); - } - return node; - } - if (node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn)) { - var def = node.definitions.filter(function(def){ - if (member(def.name.definition(), in_use)) return true; - var w = { - name : def.name.name, - file : def.name.start.file, - line : def.name.start.line, - col : def.name.start.col - }; - if (def.value && def.value.has_side_effects()) { - def._unused_side_effects = true; - compressor.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", w); - return true; - } - compressor.warn("Dropping unused variable {name} [{file}:{line},{col}]", w); - return false; - }); - // place uninitialized names at the start - def = mergeSort(def, function(a, b){ - if (!a.value && b.value) return -1; - if (!b.value && a.value) return 1; - return 0; - }); - // for unused names whose initialization has - // side effects, we can cascade the init. code - // into the next one, or next statement. - var side_effects = []; - for (var i = 0; i < def.length;) { - var x = def[i]; - if (x._unused_side_effects) { - side_effects.push(x.value); - def.splice(i, 1); - } else { - if (side_effects.length > 0) { - side_effects.push(x.value); - x.value = AST_Seq.from_array(side_effects); - side_effects = []; - } - ++i; - } - } - if (side_effects.length > 0) { - side_effects = make_node(AST_BlockStatement, node, { - body: [ make_node(AST_SimpleStatement, node, { - body: AST_Seq.from_array(side_effects) - }) ] - }); - } else { - side_effects = null; - } - if (def.length == 0 && !side_effects) { - return make_node(AST_EmptyStatement, node); - } - if (def.length == 0) { - return side_effects; - } - node.definitions = def; - if (side_effects) { - side_effects.body.unshift(node); - node = side_effects; - } - return node; - } - if (node instanceof AST_For && node.init instanceof AST_BlockStatement) { - descend(node, this); - // certain combination of unused name + side effect leads to: - // https://github.com/mishoo/UglifyJS2/issues/44 - // that's an invalid AST. - // We fix it at this stage by moving the `var` outside the `for`. - var body = node.init.body.slice(0, -1); - node.init = node.init.body.slice(-1)[0].body; - body.push(node); - return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, { - body: body - }); - } - if (node instanceof AST_Scope && node !== self) - return node; - } - ); - self.transform(tt); - } - }); - - AST_Scope.DEFMETHOD("hoist_declarations", function(compressor){ - var hoist_funs = compressor.option("hoist_funs"); - var hoist_vars = compressor.option("hoist_vars"); - var self = this; - if (hoist_funs || hoist_vars) { - var dirs = []; - var hoisted = []; - var vars = new Dictionary(), vars_found = 0, var_decl = 0; - // let's count var_decl first, we seem to waste a lot of - // space if we hoist `var` when there's only one. - self.walk(new TreeWalker(function(node){ - if (node instanceof AST_Scope && node !== self) - return true; - if (node instanceof AST_Var) { - ++var_decl; - return true; - } - })); - hoist_vars = hoist_vars && var_decl > 1; - var tt = new TreeTransformer( - function before(node) { - if (node !== self) { - if (node instanceof AST_Directive) { - dirs.push(node); - return make_node(AST_EmptyStatement, node); - } - if (node instanceof AST_Defun && hoist_funs) { - hoisted.push(node); - return make_node(AST_EmptyStatement, node); - } - if (node instanceof AST_Var && hoist_vars) { - node.definitions.forEach(function(def){ - vars.set(def.name.name, def); - ++vars_found; - }); - var seq = node.to_assignments(); - var p = tt.parent(); - if (p instanceof AST_ForIn && p.init === node) { - if (seq == null) return node.definitions[0].name; - return seq; - } - if (p instanceof AST_For && p.init === node) { - return seq; - } - if (!seq) return make_node(AST_EmptyStatement, node); - return make_node(AST_SimpleStatement, node, { - body: seq - }); - } - if (node instanceof AST_Scope) - return node; // to avoid descending in nested scopes - } - } - ); - self = self.transform(tt); - if (vars_found > 0) { - // collect only vars which don't show up in self's arguments list - var defs = []; - vars.each(function(def, name){ - if (self instanceof AST_Lambda - && find_if(function(x){ return x.name == def.name.name }, - self.argnames)) { - vars.del(name); - } else { - def = def.clone(); - def.value = null; - defs.push(def); - vars.set(name, def); - } - }); - if (defs.length > 0) { - // try to merge in assignments - for (var i = 0; i < self.body.length;) { - if (self.body[i] instanceof AST_SimpleStatement) { - var expr = self.body[i].body, sym, assign; - if (expr instanceof AST_Assign - && expr.operator == "=" - && (sym = expr.left) instanceof AST_Symbol - && vars.has(sym.name)) - { - var def = vars.get(sym.name); - if (def.value) break; - def.value = expr.right; - remove(defs, def); - defs.push(def); - self.body.splice(i, 1); - continue; - } - if (expr instanceof AST_Seq - && (assign = expr.car) instanceof AST_Assign - && assign.operator == "=" - && (sym = assign.left) instanceof AST_Symbol - && vars.has(sym.name)) - { - var def = vars.get(sym.name); - if (def.value) break; - def.value = assign.right; - remove(defs, def); - defs.push(def); - self.body[i].body = expr.cdr; - continue; - } - } - if (self.body[i] instanceof AST_EmptyStatement) { - self.body.splice(i, 1); - continue; - } - if (self.body[i] instanceof AST_BlockStatement) { - var tmp = [ i, 1 ].concat(self.body[i].body); - self.body.splice.apply(self.body, tmp); - continue; - } - break; - } - defs = make_node(AST_Var, self, { - definitions: defs - }); - hoisted.push(defs); - }; - } - self.body = dirs.concat(hoisted, self.body); - } - return self; - }); - - OPT(AST_SimpleStatement, function(self, compressor){ - if (compressor.option("side_effects")) { - if (!self.body.has_side_effects()) { - compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start); - return make_node(AST_EmptyStatement, self); - } - } - return self; - }); - - OPT(AST_DWLoop, function(self, compressor){ - var cond = self.condition.evaluate(compressor); - self.condition = cond[0]; - if (!compressor.option("loops")) return self; - if (cond.length > 1) { - if (cond[1]) { - return make_node(AST_For, self, { - body: self.body - }); - } else if (self instanceof AST_While) { - if (compressor.option("dead_code")) { - var a = []; - extract_declarations_from_unreachable_code(compressor, self.body, a); - return make_node(AST_BlockStatement, self, { body: a }); - } - } - } - return self; - }); - - function if_break_in_loop(self, compressor) { - function drop_it(rest) { - rest = as_statement_array(rest); - if (self.body instanceof AST_BlockStatement) { - self.body = self.body.clone(); - self.body.body = rest.concat(self.body.body.slice(1)); - self.body = self.body.transform(compressor); - } else { - self.body = make_node(AST_BlockStatement, self.body, { - body: rest - }).transform(compressor); - } - if_break_in_loop(self, compressor); - } - var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body; - if (first instanceof AST_If) { - if (first.body instanceof AST_Break - && compressor.loopcontrol_target(first.body.label) === self) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition.negate(compressor), - }); - } else { - self.condition = first.condition.negate(compressor); - } - drop_it(first.alternative); - } - else if (first.alternative instanceof AST_Break - && compressor.loopcontrol_target(first.alternative.label) === self) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition, - }); - } else { - self.condition = first.condition; - } - drop_it(first.body); - } - } - }; - - OPT(AST_While, function(self, compressor) { - if (!compressor.option("loops")) return self; - self = AST_DWLoop.prototype.optimize.call(self, compressor); - if (self instanceof AST_While) { - if_break_in_loop(self, compressor); - self = make_node(AST_For, self, self).transform(compressor); - } - return self; - }); - - OPT(AST_For, function(self, compressor){ - var cond = self.condition; - if (cond) { - cond = cond.evaluate(compressor); - self.condition = cond[0]; - } - if (!compressor.option("loops")) return self; - if (cond) { - if (cond.length > 1 && !cond[1]) { - if (compressor.option("dead_code")) { - var a = []; - if (self.init instanceof AST_Statement) { - a.push(self.init); - } - else if (self.init) { - a.push(make_node(AST_SimpleStatement, self.init, { - body: self.init - })); - } - extract_declarations_from_unreachable_code(compressor, self.body, a); - return make_node(AST_BlockStatement, self, { body: a }); - } - } - } - if_break_in_loop(self, compressor); - return self; - }); - - OPT(AST_If, function(self, compressor){ - if (!compressor.option("conditionals")) return self; - // if condition can be statically determined, warn and drop - // one of the blocks. note, statically determined implies - // “has no side effects”; also it doesn't work for cases like - // `x && true`, though it probably should. - var cond = self.condition.evaluate(compressor); - self.condition = cond[0]; - if (cond.length > 1) { - if (cond[1]) { - compressor.warn("Condition always true [{file}:{line},{col}]", self.condition.start); - if (compressor.option("dead_code")) { - var a = []; - if (self.alternative) { - extract_declarations_from_unreachable_code(compressor, self.alternative, a); - } - a.push(self.body); - return make_node(AST_BlockStatement, self, { body: a }).transform(compressor); - } - } else { - compressor.warn("Condition always false [{file}:{line},{col}]", self.condition.start); - if (compressor.option("dead_code")) { - var a = []; - extract_declarations_from_unreachable_code(compressor, self.body, a); - if (self.alternative) a.push(self.alternative); - return make_node(AST_BlockStatement, self, { body: a }).transform(compressor); - } - } - } - if (is_empty(self.alternative)) self.alternative = null; - var negated = self.condition.negate(compressor); - var negated_is_best = best_of(self.condition, negated) === negated; - if (self.alternative && negated_is_best) { - negated_is_best = false; // because we already do the switch here. - self.condition = negated; - var tmp = self.body; - self.body = self.alternative || make_node(AST_EmptyStatement); - self.alternative = tmp; - } - if (is_empty(self.body) && is_empty(self.alternative)) { - return make_node(AST_SimpleStatement, self.condition, { - body: self.condition - }).transform(compressor); - } - if (self.body instanceof AST_SimpleStatement - && self.alternative instanceof AST_SimpleStatement) { - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Conditional, self, { - condition : self.condition, - consequent : self.body.body, - alternative : self.alternative.body - }) - }).transform(compressor); - } - if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) { - if (negated_is_best) return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "||", - left : negated, - right : self.body.body - }) - }).transform(compressor); - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "&&", - left : self.condition, - right : self.body.body - }) - }).transform(compressor); - } - if (self.body instanceof AST_EmptyStatement - && self.alternative - && self.alternative instanceof AST_SimpleStatement) { - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator : "||", - left : self.condition, - right : self.alternative.body - }) - }).transform(compressor); - } - if (self.body instanceof AST_Exit - && self.alternative instanceof AST_Exit - && self.body.TYPE == self.alternative.TYPE) { - return make_node(self.body.CTOR, self, { - value: make_node(AST_Conditional, self, { - condition : self.condition, - consequent : self.body.value || make_node(AST_Undefined, self.body).optimize(compressor), - alternative : self.alternative.value || make_node(AST_Undefined, self.alternative).optimize(compressor) - }) - }).transform(compressor); - } - if (self.body instanceof AST_If - && !self.body.alternative - && !self.alternative) { - self.condition = make_node(AST_Binary, self.condition, { - operator: "&&", - left: self.condition, - right: self.body.condition - }).transform(compressor); - self.body = self.body.body; - } - if (aborts(self.body)) { - if (self.alternative) { - var alt = self.alternative; - self.alternative = null; - return make_node(AST_BlockStatement, self, { - body: [ self, alt ] - }).transform(compressor); - } - } - if (aborts(self.alternative)) { - var body = self.body; - self.body = self.alternative; - self.condition = negated_is_best ? negated : self.condition.negate(compressor); - self.alternative = null; - return make_node(AST_BlockStatement, self, { - body: [ self, body ] - }).transform(compressor); - } - return self; - }); - - OPT(AST_Switch, function(self, compressor){ - if (self.body.length == 0 && compressor.option("conditionals")) { - return make_node(AST_SimpleStatement, self, { - body: self.expression - }).transform(compressor); - } - for(;;) { - var last_branch = self.body[self.body.length - 1]; - if (last_branch) { - var stat = last_branch.body[last_branch.body.length - 1]; // last statement - if (stat instanceof AST_Break && loop_body(compressor.loopcontrol_target(stat.label)) === self) - last_branch.body.pop(); - if (last_branch instanceof AST_Default && last_branch.body.length == 0) { - self.body.pop(); - continue; - } - } - break; - } - var exp = self.expression.evaluate(compressor); - out: if (exp.length == 2) try { - // constant expression - self.expression = exp[0]; - if (!compressor.option("dead_code")) break out; - var value = exp[1]; - var in_if = false; - var in_block = false; - var started = false; - var stopped = false; - var ruined = false; - var tt = new TreeTransformer(function(node, descend, in_list){ - if (node instanceof AST_Lambda || node instanceof AST_SimpleStatement) { - // no need to descend these node types - return node; - } - else if (node instanceof AST_Switch && node === self) { - node = node.clone(); - descend(node, this); - return ruined ? node : make_node(AST_BlockStatement, node, { - body: node.body.reduce(function(a, branch){ - return a.concat(branch.body); - }, []) - }).transform(compressor); - } - else if (node instanceof AST_If || node instanceof AST_Try) { - var save = in_if; - in_if = !in_block; - descend(node, this); - in_if = save; - return node; - } - else if (node instanceof AST_StatementWithBody || node instanceof AST_Switch) { - var save = in_block; - in_block = true; - descend(node, this); - in_block = save; - return node; - } - else if (node instanceof AST_Break && this.loopcontrol_target(node.label) === self) { - if (in_if) { - ruined = true; - return node; - } - if (in_block) return node; - stopped = true; - return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); - } - else if (node instanceof AST_SwitchBranch && this.parent() === self) { - if (stopped) return MAP.skip; - if (node instanceof AST_Case) { - var exp = node.expression.evaluate(compressor); - if (exp.length < 2) { - // got a case with non-constant expression, baling out - throw self; - } - if (exp[1] === value || started) { - started = true; - if (aborts(node)) stopped = true; - descend(node, this); - return node; - } - return MAP.skip; - } - descend(node, this); - return node; - } - }); - tt.stack = compressor.stack.slice(); // so that's able to see parent nodes - self = self.transform(tt); - } catch(ex) { - if (ex !== self) throw ex; - } - return self; - }); - - OPT(AST_Case, function(self, compressor){ - self.body = tighten_body(self.body, compressor); - return self; - }); - - OPT(AST_Try, function(self, compressor){ - self.body = tighten_body(self.body, compressor); - return self; - }); - - AST_Definitions.DEFMETHOD("remove_initializers", function(){ - this.definitions.forEach(function(def){ def.value = null }); - }); - - AST_Definitions.DEFMETHOD("to_assignments", function(){ - var assignments = this.definitions.reduce(function(a, def){ - if (def.value) { - var name = make_node(AST_SymbolRef, def.name, def.name); - a.push(make_node(AST_Assign, def, { - operator : "=", - left : name, - right : def.value - })); - } - return a; - }, []); - if (assignments.length == 0) return null; - return AST_Seq.from_array(assignments); - }); - - OPT(AST_Definitions, function(self, compressor){ - if (self.definitions.length == 0) - return make_node(AST_EmptyStatement, self); - return self; - }); - - OPT(AST_Function, function(self, compressor){ - self = AST_Lambda.prototype.optimize.call(self, compressor); - if (compressor.option("unused")) { - if (self.name && self.name.unreferenced()) { - self.name = null; - } - } - return self; - }); - - OPT(AST_Call, function(self, compressor){ - if (compressor.option("unsafe")) { - var exp = self.expression; - if (exp instanceof AST_SymbolRef && exp.undeclared()) { - switch (exp.name) { - case "Array": - if (self.args.length != 1) { - return make_node(AST_Array, self, { - elements: self.args - }); - } - break; - case "Object": - if (self.args.length == 0) { - return make_node(AST_Object, self, { - properties: [] - }); - } - break; - case "String": - if (self.args.length == 0) return make_node(AST_String, self, { - value: "" - }); - return make_node(AST_Binary, self, { - left: self.args[0], - operator: "+", - right: make_node(AST_String, self, { value: "" }) - }); - case "Function": - if (all(self.args, function(x){ return x instanceof AST_String })) { - // quite a corner-case, but we can handle it: - // https://github.com/mishoo/UglifyJS2/issues/203 - // if the code argument is a constant, then we can minify it. - try { - var code = "(function(" + self.args.slice(0, -1).map(function(arg){ - return arg.value; - }).join(",") + "){" + self.args[self.args.length - 1].value + "})()"; - var ast = parse(code); - ast.figure_out_scope(); - var comp = new Compressor(compressor.options); - ast = ast.transform(comp); - ast.figure_out_scope(); - ast.mangle_names(); - var fun = ast.body[0].body.expression; - var args = fun.argnames.map(function(arg, i){ - return make_node(AST_String, self.args[i], { - value: arg.print_to_string() - }); - }); - var code = OutputStream(); - AST_BlockStatement.prototype._codegen.call(fun, fun, code); - code = code.toString().replace(/^\{|\}$/g, ""); - args.push(make_node(AST_String, self.args[self.args.length - 1], { - value: code - })); - self.args = args; - return self; - } catch(ex) { - if (ex instanceof JS_Parse_Error) { - compressor.warn("Error parsing code passed to new Function [{file}:{line},{col}]", self.args[self.args.length - 1].start); - compressor.warn(ex.toString()); - } else { - console.log(ex); - } - } - } - break; - } - } - else if (exp instanceof AST_Dot && exp.property == "toString" && self.args.length == 0) { - return make_node(AST_Binary, self, { - left: make_node(AST_String, self, { value: "" }), - operator: "+", - right: exp.expression - }).transform(compressor); - } - } - if (compressor.option("side_effects")) { - if (self.expression instanceof AST_Function - && self.args.length == 0 - && !AST_Block.prototype.has_side_effects.call(self.expression)) { - return make_node(AST_Undefined, self).transform(compressor); - } - } - return self; - }); - - OPT(AST_New, function(self, compressor){ - if (compressor.option("unsafe")) { - var exp = self.expression; - if (exp instanceof AST_SymbolRef && exp.undeclared()) { - switch (exp.name) { - case "Object": - case "RegExp": - case "Function": - case "Error": - case "Array": - return make_node(AST_Call, self, self).transform(compressor); - } - } - } - return self; - }); - - OPT(AST_Seq, function(self, compressor){ - if (!compressor.option("side_effects")) - return self; - if (!self.car.has_side_effects()) { - // we shouldn't compress (1,eval)(something) to - // eval(something) because that changes the meaning of - // eval (becomes lexical instead of global). - var p; - if (!(self.cdr instanceof AST_SymbolRef - && self.cdr.name == "eval" - && self.cdr.undeclared() - && (p = compressor.parent()) instanceof AST_Call - && p.expression === self)) { - return self.cdr; - } - } - if (compressor.option("cascade")) { - if (self.car instanceof AST_Assign - && !self.car.left.has_side_effects() - && self.car.left.equivalent_to(self.cdr)) { - return self.car; - } - if (!self.car.has_side_effects() - && !self.cdr.has_side_effects() - && self.car.equivalent_to(self.cdr)) { - return self.car; - } - } - return self; - }); - - AST_Unary.DEFMETHOD("lift_sequences", function(compressor){ - if (compressor.option("sequences")) { - if (this.expression instanceof AST_Seq) { - var seq = this.expression; - var x = seq.to_array(); - this.expression = x.pop(); - x.push(this); - seq = AST_Seq.from_array(x).transform(compressor); - return seq; - } - } - return this; - }); - - OPT(AST_UnaryPostfix, function(self, compressor){ - return self.lift_sequences(compressor); - }); - - OPT(AST_UnaryPrefix, function(self, compressor){ - self = self.lift_sequences(compressor); - var e = self.expression; - if (compressor.option("booleans") && compressor.in_boolean_context()) { - switch (self.operator) { - case "!": - if (e instanceof AST_UnaryPrefix && e.operator == "!") { - // !!foo ==> foo, if we're in boolean context - return e.expression; - } - break; - case "typeof": - // typeof always returns a non-empty string, thus it's - // always true in booleans - compressor.warn("Boolean expression always true [{file}:{line},{col}]", self.start); - return make_node(AST_True, self); - } - if (e instanceof AST_Binary && self.operator == "!") { - self = best_of(self, e.negate(compressor)); - } - } - return self.evaluate(compressor)[0]; - }); - - AST_Binary.DEFMETHOD("lift_sequences", function(compressor){ - if (compressor.option("sequences")) { - if (this.left instanceof AST_Seq) { - var seq = this.left; - var x = seq.to_array(); - this.left = x.pop(); - x.push(this); - seq = AST_Seq.from_array(x).transform(compressor); - return seq; - } - if (this.right instanceof AST_Seq - && !(this.operator == "||" || this.operator == "&&") - && !this.left.has_side_effects()) { - var seq = this.right; - var x = seq.to_array(); - this.right = x.pop(); - x.push(this); - seq = AST_Seq.from_array(x).transform(compressor); - return seq; - } - } - return this; - }); - - var commutativeOperators = makePredicate("== === != !== * & | ^"); - - OPT(AST_Binary, function(self, compressor){ - var reverse = compressor.has_directive("use asm") ? noop - : function(op, force) { - if (force || !(self.left.has_side_effects() || self.right.has_side_effects())) { - if (op) self.operator = op; - var tmp = self.left; - self.left = self.right; - self.right = tmp; - } - }; - if (commutativeOperators(self.operator)) { - if (self.right instanceof AST_Constant - && !(self.left instanceof AST_Constant)) { - // if right is a constant, whatever side effects the - // left side might have could not influence the - // result. hence, force switch. - reverse(null, true); - } - } - self = self.lift_sequences(compressor); - if (compressor.option("comparisons")) switch (self.operator) { - case "===": - case "!==": - if ((self.left.is_string(compressor) && self.right.is_string(compressor)) || - (self.left.is_boolean() && self.right.is_boolean())) { - self.operator = self.operator.substr(0, 2); - } - // XXX: intentionally falling down to the next case - case "==": - case "!=": - if (self.left instanceof AST_String - && self.left.value == "undefined" - && self.right instanceof AST_UnaryPrefix - && self.right.operator == "typeof" - && compressor.option("unsafe")) { - if (!(self.right.expression instanceof AST_SymbolRef) - || !self.right.expression.undeclared()) { - self.right = self.right.expression; - self.left = make_node(AST_Undefined, self.left).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } - break; - } - if (compressor.option("booleans") && compressor.in_boolean_context()) switch (self.operator) { - case "&&": - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if ((ll.length > 1 && !ll[1]) || (rr.length > 1 && !rr[1])) { - compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start); - return make_node(AST_False, self); - } - if (ll.length > 1 && ll[1]) { - return rr[0]; - } - if (rr.length > 1 && rr[1]) { - return ll[0]; - } - break; - case "||": - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if ((ll.length > 1 && ll[1]) || (rr.length > 1 && rr[1])) { - compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start); - return make_node(AST_True, self); - } - if (ll.length > 1 && !ll[1]) { - return rr[0]; - } - if (rr.length > 1 && !rr[1]) { - return ll[0]; - } - break; - case "+": - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if ((ll.length > 1 && ll[0] instanceof AST_String && ll[1]) || - (rr.length > 1 && rr[0] instanceof AST_String && rr[1])) { - compressor.warn("+ in boolean context always true [{file}:{line},{col}]", self.start); - return make_node(AST_True, self); - } - break; - } - var exp = self.evaluate(compressor); - if (exp.length > 1) { - if (best_of(exp[0], self) !== self) - return exp[0]; - } - if (compressor.option("comparisons")) { - if (!(compressor.parent() instanceof AST_Binary) - || compressor.parent() instanceof AST_Assign) { - var negated = make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: self.negate(compressor) - }); - self = best_of(self, negated); - } - switch (self.operator) { - case "<": reverse(">"); break; - case "<=": reverse(">="); break; - } - } - if (self.operator == "+" && self.right instanceof AST_String - && self.right.getValue() === "" && self.left instanceof AST_Binary - && self.left.operator == "+" && self.left.is_string(compressor)) { - return self.left; - } - return self; - }); - - OPT(AST_SymbolRef, function(self, compressor){ - if (self.undeclared()) { - var defines = compressor.option("global_defs"); - if (defines && defines.hasOwnProperty(self.name)) { - return make_node_from_constant(compressor, defines[self.name], self); - } - switch (self.name) { - case "undefined": - return make_node(AST_Undefined, self); - case "NaN": - return make_node(AST_NaN, self); - case "Infinity": - return make_node(AST_Infinity, self); - } - } - return self; - }); - - OPT(AST_Undefined, function(self, compressor){ - if (compressor.option("unsafe")) { - var scope = compressor.find_parent(AST_Scope); - var undef = scope.find_variable("undefined"); - if (undef) { - var ref = make_node(AST_SymbolRef, self, { - name : "undefined", - scope : scope, - thedef : undef - }); - ref.reference(); - return ref; - } - } - return self; - }); - - var ASSIGN_OPS = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ]; - OPT(AST_Assign, function(self, compressor){ - self = self.lift_sequences(compressor); - if (self.operator == "=" - && self.left instanceof AST_SymbolRef - && self.right instanceof AST_Binary - && self.right.left instanceof AST_SymbolRef - && self.right.left.name == self.left.name - && member(self.right.operator, ASSIGN_OPS)) { - self.operator = self.right.operator + "="; - self.right = self.right.right; - } - return self; - }); - - OPT(AST_Conditional, function(self, compressor){ - if (!compressor.option("conditionals")) return self; - if (self.condition instanceof AST_Seq) { - var car = self.condition.car; - self.condition = self.condition.cdr; - return AST_Seq.cons(car, self); - } - var cond = self.condition.evaluate(compressor); - if (cond.length > 1) { - if (cond[1]) { - compressor.warn("Condition always true [{file}:{line},{col}]", self.start); - return self.consequent; - } else { - compressor.warn("Condition always false [{file}:{line},{col}]", self.start); - return self.alternative; - } - } - var negated = cond[0].negate(compressor); - if (best_of(cond[0], negated) === negated) { - self = make_node(AST_Conditional, self, { - condition: negated, - consequent: self.alternative, - alternative: self.consequent - }); - } - var consequent = self.consequent; - var alternative = self.alternative; - if (consequent instanceof AST_Assign - && alternative instanceof AST_Assign - && consequent.operator == alternative.operator - && consequent.left.equivalent_to(alternative.left) - ) { - /* - * Stuff like this: - * if (foo) exp = something; else exp = something_else; - * ==> - * exp = foo ? something : something_else; - */ - self = make_node(AST_Assign, self, { - operator: consequent.operator, - left: consequent.left, - right: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: consequent.right, - alternative: alternative.right - }) - }); - } - return self; - }); - - OPT(AST_Boolean, function(self, compressor){ - if (compressor.option("booleans")) { - var p = compressor.parent(); - if (p instanceof AST_Binary && (p.operator == "==" - || p.operator == "!=")) { - compressor.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]", { - operator : p.operator, - value : self.value, - file : p.start.file, - line : p.start.line, - col : p.start.col, - }); - return make_node(AST_Number, self, { - value: +self.value - }); - } - return make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: make_node(AST_Number, self, { - value: 1 - self.value - }) - }); - } - return self; - }); - - OPT(AST_Sub, function(self, compressor){ - var prop = self.property; - if (prop instanceof AST_String && compressor.option("properties")) { - prop = prop.getValue(); - if (RESERVED_WORDS(prop) ? compressor.option("screw_ie8") : is_identifier_string(prop)) { - return make_node(AST_Dot, self, { - expression : self.expression, - property : prop - }); - } - } - return self; - }); - - function literals_in_boolean_context(self, compressor) { - if (compressor.option("booleans") && compressor.in_boolean_context()) { - return make_node(AST_True, self); - } - return self; - }; - OPT(AST_Array, literals_in_boolean_context); - OPT(AST_Object, literals_in_boolean_context); - OPT(AST_RegExp, literals_in_boolean_context); - -})(); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/mozilla-ast.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/mozilla-ast.js deleted file mode 100644 index d795094..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/mozilla-ast.js +++ /dev/null @@ -1,267 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -(function(){ - - var MOZ_TO_ME = { - TryStatement : function(M) { - return new AST_Try({ - start : my_start_token(M), - end : my_end_token(M), - body : from_moz(M.block).body, - bcatch : from_moz(M.handlers[0]), - bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null - }); - }, - CatchClause : function(M) { - return new AST_Catch({ - start : my_start_token(M), - end : my_end_token(M), - argname : from_moz(M.param), - body : from_moz(M.body).body - }); - }, - ObjectExpression : function(M) { - return new AST_Object({ - start : my_start_token(M), - end : my_end_token(M), - properties : M.properties.map(function(prop){ - var key = prop.key; - var name = key.type == "Identifier" ? key.name : key.value; - var args = { - start : my_start_token(key), - end : my_end_token(prop.value), - key : name, - value : from_moz(prop.value) - }; - switch (prop.kind) { - case "init": - return new AST_ObjectKeyVal(args); - case "set": - args.value.name = from_moz(key); - return new AST_ObjectSetter(args); - case "get": - args.value.name = from_moz(key); - return new AST_ObjectGetter(args); - } - }) - }); - }, - SequenceExpression : function(M) { - return AST_Seq.from_array(M.expressions.map(from_moz)); - }, - MemberExpression : function(M) { - return new (M.computed ? AST_Sub : AST_Dot)({ - start : my_start_token(M), - end : my_end_token(M), - property : M.computed ? from_moz(M.property) : M.property.name, - expression : from_moz(M.object) - }); - }, - SwitchCase : function(M) { - return new (M.test ? AST_Case : AST_Default)({ - start : my_start_token(M), - end : my_end_token(M), - expression : from_moz(M.test), - body : M.consequent.map(from_moz) - }); - }, - Literal : function(M) { - var val = M.value, args = { - start : my_start_token(M), - end : my_end_token(M) - }; - if (val === null) return new AST_Null(args); - switch (typeof val) { - case "string": - args.value = val; - return new AST_String(args); - case "number": - args.value = val; - return new AST_Number(args); - case "boolean": - return new (val ? AST_True : AST_False)(args); - default: - args.value = val; - return new AST_RegExp(args); - } - }, - UnaryExpression: From_Moz_Unary, - UpdateExpression: From_Moz_Unary, - Identifier: function(M) { - var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; - return new (M.name == "this" ? AST_This - : p.type == "LabeledStatement" ? AST_Label - : p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : AST_SymbolVar) - : p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg) - : p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg) - : p.type == "CatchClause" ? AST_SymbolCatch - : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef - : AST_SymbolRef)({ - start : my_start_token(M), - end : my_end_token(M), - name : M.name - }); - } - }; - - function From_Moz_Unary(M) { - var prefix = "prefix" in M ? M.prefix - : M.type == "UnaryExpression" ? true : false; - return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({ - start : my_start_token(M), - end : my_end_token(M), - operator : M.operator, - expression : from_moz(M.argument) - }); - }; - - var ME_TO_MOZ = {}; - - map("Node", AST_Node); - map("Program", AST_Toplevel, "body@body"); - map("Function", AST_Function, "id>name, params@argnames, body%body"); - map("EmptyStatement", AST_EmptyStatement); - map("BlockStatement", AST_BlockStatement, "body@body"); - map("ExpressionStatement", AST_SimpleStatement, "expression>body"); - map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative"); - map("LabeledStatement", AST_LabeledStatement, "label>label, body>body"); - map("BreakStatement", AST_Break, "label>label"); - map("ContinueStatement", AST_Continue, "label>label"); - map("WithStatement", AST_With, "object>expression, body>body"); - map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body"); - map("ReturnStatement", AST_Return, "argument>value"); - map("ThrowStatement", AST_Throw, "argument>value"); - map("WhileStatement", AST_While, "test>condition, body>body"); - map("DoWhileStatement", AST_Do, "test>condition, body>body"); - map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body"); - map("ForInStatement", AST_ForIn, "left>init, right>object, body>body"); - map("DebuggerStatement", AST_Debugger); - map("FunctionDeclaration", AST_Defun, "id>name, params@argnames, body%body"); - map("VariableDeclaration", AST_Var, "declarations@definitions"); - map("VariableDeclarator", AST_VarDef, "id>name, init>value"); - - map("ThisExpression", AST_This); - map("ArrayExpression", AST_Array, "elements@elements"); - map("FunctionExpression", AST_Function, "id>name, params@argnames, body%body"); - map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right"); - map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right"); - map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right"); - map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative"); - map("NewExpression", AST_New, "callee>expression, arguments@args"); - map("CallExpression", AST_Call, "callee>expression, arguments@args"); - - /* -----[ tools ]----- */ - - function my_start_token(moznode) { - return new AST_Token({ - file : moznode.loc && moznode.loc.source, - line : moznode.loc && moznode.loc.start.line, - col : moznode.loc && moznode.loc.start.column, - pos : moznode.start, - endpos : moznode.start - }); - }; - - function my_end_token(moznode) { - return new AST_Token({ - file : moznode.loc && moznode.loc.source, - line : moznode.loc && moznode.loc.end.line, - col : moznode.loc && moznode.loc.end.column, - pos : moznode.end, - endpos : moznode.end - }); - }; - - function map(moztype, mytype, propmap) { - var moz_to_me = "function From_Moz_" + moztype + "(M){\n"; - moz_to_me += "return new mytype({\n" + - "start: my_start_token(M),\n" + - "end: my_end_token(M)"; - - if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop){ - var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop); - if (!m) throw new Error("Can't understand property map: " + prop); - var moz = "M." + m[1], how = m[2], my = m[3]; - moz_to_me += ",\n" + my + ": "; - if (how == "@") { - moz_to_me += moz + ".map(from_moz)"; - } else if (how == ">") { - moz_to_me += "from_moz(" + moz + ")"; - } else if (how == "=") { - moz_to_me += moz; - } else if (how == "%") { - moz_to_me += "from_moz(" + moz + ").body"; - } else throw new Error("Can't understand operator in propmap: " + prop); - }); - moz_to_me += "\n})}"; - - // moz_to_me = parse(moz_to_me).print_to_string({ beautify: true }); - // console.log(moz_to_me); - - moz_to_me = new Function("mytype", "my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")( - mytype, my_start_token, my_end_token, from_moz - ); - return MOZ_TO_ME[moztype] = moz_to_me; - }; - - var FROM_MOZ_STACK = null; - - function from_moz(node) { - FROM_MOZ_STACK.push(node); - var ret = node != null ? MOZ_TO_ME[node.type](node) : null; - FROM_MOZ_STACK.pop(); - return ret; - }; - - AST_Node.from_mozilla_ast = function(node){ - var save_stack = FROM_MOZ_STACK; - FROM_MOZ_STACK = []; - var ast = from_moz(node); - FROM_MOZ_STACK = save_stack; - return ast; - }; - -})(); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/output.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/output.js deleted file mode 100644 index b7bcd1e..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/output.js +++ /dev/null @@ -1,1229 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -function OutputStream(options) { - - options = defaults(options, { - indent_start : 0, - indent_level : 4, - quote_keys : false, - space_colon : true, - ascii_only : false, - inline_script : false, - width : 80, - max_line_len : 32000, - beautify : false, - source_map : null, - bracketize : false, - semicolons : true, - comments : false, - preserve_line : false, - screw_ie8 : false, - }, true); - - var indentation = 0; - var current_col = 0; - var current_line = 1; - var current_pos = 0; - var OUTPUT = ""; - - function to_ascii(str, identifier) { - return str.replace(/[\u0080-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - if (code.length <= 2 && !identifier) { - while (code.length < 2) code = "0" + code; - return "\\x" + code; - } else { - while (code.length < 4) code = "0" + code; - return "\\u" + code; - } - }); - }; - - function make_string(str) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){ - switch (s) { - case "\\": return "\\\\"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - case "\0": return "\\x00"; - } - return s; - }); - if (options.ascii_only) str = to_ascii(str); - if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'"; - else return '"' + str.replace(/\x22/g, '\\"') + '"'; - }; - - function encode_string(str) { - var ret = make_string(str); - if (options.inline_script) - ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1"); - return ret; - }; - - function make_name(name) { - name = name.toString(); - if (options.ascii_only) - name = to_ascii(name, true); - return name; - }; - - function make_indent(back) { - return repeat_string(" ", options.indent_start + indentation - back * options.indent_level); - }; - - /* -----[ beautification/minification ]----- */ - - var might_need_space = false; - var might_need_semicolon = false; - var last = null; - - function last_char() { - return last.charAt(last.length - 1); - }; - - function maybe_newline() { - if (options.max_line_len && current_col > options.max_line_len) - print("\n"); - }; - - var requireSemicolonChars = makePredicate("( [ + * / - , ."); - - function print(str) { - str = String(str); - var ch = str.charAt(0); - if (might_need_semicolon) { - if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) { - if (options.semicolons || requireSemicolonChars(ch)) { - OUTPUT += ";"; - current_col++; - current_pos++; - } else { - OUTPUT += "\n"; - current_pos++; - current_line++; - current_col = 0; - } - if (!options.beautify) - might_need_space = false; - } - might_need_semicolon = false; - maybe_newline(); - } - - if (!options.beautify && options.preserve_line && stack[stack.length - 1]) { - var target_line = stack[stack.length - 1].start.line; - while (current_line < target_line) { - OUTPUT += "\n"; - current_pos++; - current_line++; - current_col = 0; - might_need_space = false; - } - } - - if (might_need_space) { - var prev = last_char(); - if ((is_identifier_char(prev) - && (is_identifier_char(ch) || ch == "\\")) - || (/^[\+\-\/]$/.test(ch) && ch == prev)) - { - OUTPUT += " "; - current_col++; - current_pos++; - } - might_need_space = false; - } - var a = str.split(/\r?\n/), n = a.length - 1; - current_line += n; - if (n == 0) { - current_col += a[n].length; - } else { - current_col = a[n].length; - } - current_pos += str.length; - last = str; - OUTPUT += str; - }; - - var space = options.beautify ? function() { - print(" "); - } : function() { - might_need_space = true; - }; - - var indent = options.beautify ? function(half) { - if (options.beautify) { - print(make_indent(half ? 0.5 : 0)); - } - } : noop; - - var with_indent = options.beautify ? function(col, cont) { - if (col === true) col = next_indent(); - var save_indentation = indentation; - indentation = col; - var ret = cont(); - indentation = save_indentation; - return ret; - } : function(col, cont) { return cont() }; - - var newline = options.beautify ? function() { - print("\n"); - } : noop; - - var semicolon = options.beautify ? function() { - print(";"); - } : function() { - might_need_semicolon = true; - }; - - function force_semicolon() { - might_need_semicolon = false; - print(";"); - }; - - function next_indent() { - return indentation + options.indent_level; - }; - - function with_block(cont) { - var ret; - print("{"); - newline(); - with_indent(next_indent(), function(){ - ret = cont(); - }); - indent(); - print("}"); - return ret; - }; - - function with_parens(cont) { - print("("); - //XXX: still nice to have that for argument lists - //var ret = with_indent(current_col, cont); - var ret = cont(); - print(")"); - return ret; - }; - - function with_square(cont) { - print("["); - //var ret = with_indent(current_col, cont); - var ret = cont(); - print("]"); - return ret; - }; - - function comma() { - print(","); - space(); - }; - - function colon() { - print(":"); - if (options.space_colon) space(); - }; - - var add_mapping = options.source_map ? function(token, name) { - try { - if (token) options.source_map.add( - token.file || "?", - current_line, current_col, - token.line, token.col, - (!name && token.type == "name") ? token.value : name - ); - } catch(ex) { - AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", { - file: token.file, - line: token.line, - col: token.col, - cline: current_line, - ccol: current_col, - name: name || "" - }) - } - } : noop; - - function get() { - return OUTPUT; - }; - - var stack = []; - return { - get : get, - toString : get, - indent : indent, - indentation : function() { return indentation }, - current_width : function() { return current_col - indentation }, - should_break : function() { return options.width && this.current_width() >= options.width }, - newline : newline, - print : print, - space : space, - comma : comma, - colon : colon, - last : function() { return last }, - semicolon : semicolon, - force_semicolon : force_semicolon, - to_ascii : to_ascii, - print_name : function(name) { print(make_name(name)) }, - print_string : function(str) { print(encode_string(str)) }, - next_indent : next_indent, - with_indent : with_indent, - with_block : with_block, - with_parens : with_parens, - with_square : with_square, - add_mapping : add_mapping, - option : function(opt) { return options[opt] }, - line : function() { return current_line }, - col : function() { return current_col }, - pos : function() { return current_pos }, - push_node : function(node) { stack.push(node) }, - pop_node : function() { return stack.pop() }, - stack : function() { return stack }, - parent : function(n) { - return stack[stack.length - 2 - (n || 0)]; - } - }; - -}; - -/* -----[ code generators ]----- */ - -(function(){ - - /* -----[ utils ]----- */ - - function DEFPRINT(nodetype, generator) { - nodetype.DEFMETHOD("_codegen", generator); - }; - - AST_Node.DEFMETHOD("print", function(stream, force_parens){ - var self = this, generator = self._codegen; - function doit() { - self.add_comments(stream); - self.add_source_map(stream); - generator(self, stream); - } - stream.push_node(self); - if (force_parens || self.needs_parens(stream)) { - stream.with_parens(doit); - } else { - doit(); - } - stream.pop_node(); - }); - - AST_Node.DEFMETHOD("print_to_string", function(options){ - var s = OutputStream(options); - this.print(s); - return s.get(); - }); - - /* -----[ comments ]----- */ - - AST_Node.DEFMETHOD("add_comments", function(output){ - var c = output.option("comments"), self = this; - if (c) { - var start = self.start; - if (start && !start._comments_dumped) { - start._comments_dumped = true; - var comments = start.comments_before; - - // XXX: ugly fix for https://github.com/mishoo/UglifyJS2/issues/112 - // if this node is `return` or `throw`, we cannot allow comments before - // the returned or thrown value. - if (self instanceof AST_Exit && - self.value && self.value.start.comments_before.length > 0) { - comments = (comments || []).concat(self.value.start.comments_before); - self.value.start.comments_before = []; - } - - if (c.test) { - comments = comments.filter(function(comment){ - return c.test(comment.value); - }); - } else if (typeof c == "function") { - comments = comments.filter(function(comment){ - return c(self, comment); - }); - } - comments.forEach(function(c){ - if (c.type == "comment1") { - output.print("//" + c.value + "\n"); - output.indent(); - } - else if (c.type == "comment2") { - output.print("/*" + c.value + "*/"); - if (start.nlb) { - output.print("\n"); - output.indent(); - } else { - output.space(); - } - } - }); - } - } - }); - - /* -----[ PARENTHESES ]----- */ - - function PARENS(nodetype, func) { - nodetype.DEFMETHOD("needs_parens", func); - }; - - PARENS(AST_Node, function(){ - return false; - }); - - // a function expression needs parens around it when it's provably - // the first token to appear in a statement. - PARENS(AST_Function, function(output){ - return first_in_statement(output); - }); - - // same goes for an object literal, because otherwise it would be - // interpreted as a block of code. - PARENS(AST_Object, function(output){ - return first_in_statement(output); - }); - - PARENS(AST_Unary, function(output){ - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this; - }); - - PARENS(AST_Seq, function(output){ - var p = output.parent(); - return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4) - || p instanceof AST_Unary // !(foo, bar, baz) - || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8 - || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4 - || p instanceof AST_Dot // (1, {foo:2}).foo ==> 2 - || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ] - || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2 - || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30) - * ==> 20 (side effect, set a := 10 and b := 20) */ - ; - }); - - PARENS(AST_Binary, function(output){ - var p = output.parent(); - // (foo && bar)() - if (p instanceof AST_Call && p.expression === this) - return true; - // typeof (foo && bar) - if (p instanceof AST_Unary) - return true; - // (foo && bar)["prop"], (foo && bar).prop - if (p instanceof AST_PropAccess && p.expression === this) - return true; - // this deals with precedence: 3 * (2 + 1) - if (p instanceof AST_Binary) { - var po = p.operator, pp = PRECEDENCE[po]; - var so = this.operator, sp = PRECEDENCE[so]; - if (pp > sp - || (pp == sp - && this === p.right - && !(so == po && - (so == "*" || - so == "&&" || - so == "||")))) { - return true; - } - } - }); - - PARENS(AST_PropAccess, function(output){ - var p = output.parent(); - if (p instanceof AST_New && p.expression === this) { - // i.e. new (foo.bar().baz) - // - // if there's one call into this subtree, then we need - // parens around it too, otherwise the call will be - // interpreted as passing the arguments to the upper New - // expression. - try { - this.walk(new TreeWalker(function(node){ - if (node instanceof AST_Call) throw p; - })); - } catch(ex) { - if (ex !== p) throw ex; - return true; - } - } - }); - - PARENS(AST_Call, function(output){ - var p = output.parent(); - return p instanceof AST_New && p.expression === this; - }); - - PARENS(AST_New, function(output){ - var p = output.parent(); - if (no_constructor_parens(this, output) - && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]() - || p instanceof AST_Call && p.expression === this)) // (new foo)(bar) - return true; - }); - - PARENS(AST_Number, function(output){ - var p = output.parent(); - if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this) - return true; - }); - - PARENS(AST_NaN, function(output){ - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) - return true; - }); - - function assign_and_conditional_paren_rules(output) { - var p = output.parent(); - // !(a = false) → true - if (p instanceof AST_Unary) - return true; - // 1 + (a = 2) + 3 → 6, side effect setting a = 2 - if (p instanceof AST_Binary && !(p instanceof AST_Assign)) - return true; - // (a = func)() —or— new (a = Object)() - if (p instanceof AST_Call && p.expression === this) - return true; - // (a = foo) ? bar : baz - if (p instanceof AST_Conditional && p.condition === this) - return true; - // (a = foo)["prop"] —or— (a = foo).prop - if (p instanceof AST_PropAccess && p.expression === this) - return true; - }; - - PARENS(AST_Assign, assign_and_conditional_paren_rules); - PARENS(AST_Conditional, assign_and_conditional_paren_rules); - - /* -----[ PRINTERS ]----- */ - - DEFPRINT(AST_Directive, function(self, output){ - output.print_string(self.value); - output.semicolon(); - }); - DEFPRINT(AST_Debugger, function(self, output){ - output.print("debugger"); - output.semicolon(); - }); - - /* -----[ statements ]----- */ - - function display_body(body, is_toplevel, output) { - var last = body.length - 1; - body.forEach(function(stmt, i){ - if (!(stmt instanceof AST_EmptyStatement)) { - output.indent(); - stmt.print(output); - if (!(i == last && is_toplevel)) { - output.newline(); - if (is_toplevel) output.newline(); - } - } - }); - }; - - AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output){ - force_statement(this.body, output); - }); - - DEFPRINT(AST_Statement, function(self, output){ - self.body.print(output); - output.semicolon(); - }); - DEFPRINT(AST_Toplevel, function(self, output){ - display_body(self.body, true, output); - output.print(""); - }); - DEFPRINT(AST_LabeledStatement, function(self, output){ - self.label.print(output); - output.colon(); - self.body.print(output); - }); - DEFPRINT(AST_SimpleStatement, function(self, output){ - self.body.print(output); - output.semicolon(); - }); - function print_bracketed(body, output) { - if (body.length > 0) output.with_block(function(){ - display_body(body, false, output); - }); - else output.print("{}"); - }; - DEFPRINT(AST_BlockStatement, function(self, output){ - print_bracketed(self.body, output); - }); - DEFPRINT(AST_EmptyStatement, function(self, output){ - output.semicolon(); - }); - DEFPRINT(AST_Do, function(self, output){ - output.print("do"); - output.space(); - self._do_print_body(output); - output.space(); - output.print("while"); - output.space(); - output.with_parens(function(){ - self.condition.print(output); - }); - output.semicolon(); - }); - DEFPRINT(AST_While, function(self, output){ - output.print("while"); - output.space(); - output.with_parens(function(){ - self.condition.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_For, function(self, output){ - output.print("for"); - output.space(); - output.with_parens(function(){ - if (self.init) { - if (self.init instanceof AST_Definitions) { - self.init.print(output); - } else { - parenthesize_for_noin(self.init, output, true); - } - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.condition) { - self.condition.print(output); - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.step) { - self.step.print(output); - } - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_ForIn, function(self, output){ - output.print("for"); - output.space(); - output.with_parens(function(){ - self.init.print(output); - output.space(); - output.print("in"); - output.space(); - self.object.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_With, function(self, output){ - output.print("with"); - output.space(); - output.with_parens(function(){ - self.expression.print(output); - }); - output.space(); - self._do_print_body(output); - }); - - /* -----[ functions ]----- */ - AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword){ - var self = this; - if (!nokeyword) { - output.print("function"); - } - if (self.name) { - output.space(); - self.name.print(output); - } - output.with_parens(function(){ - self.argnames.forEach(function(arg, i){ - if (i) output.comma(); - arg.print(output); - }); - }); - output.space(); - print_bracketed(self.body, output); - }); - DEFPRINT(AST_Lambda, function(self, output){ - self._do_print(output); - }); - - /* -----[ exits ]----- */ - AST_Exit.DEFMETHOD("_do_print", function(output, kind){ - output.print(kind); - if (this.value) { - output.space(); - this.value.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_Return, function(self, output){ - self._do_print(output, "return"); - }); - DEFPRINT(AST_Throw, function(self, output){ - self._do_print(output, "throw"); - }); - - /* -----[ loop control ]----- */ - AST_LoopControl.DEFMETHOD("_do_print", function(output, kind){ - output.print(kind); - if (this.label) { - output.space(); - this.label.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_Break, function(self, output){ - self._do_print(output, "break"); - }); - DEFPRINT(AST_Continue, function(self, output){ - self._do_print(output, "continue"); - }); - - /* -----[ if ]----- */ - function make_then(self, output) { - if (output.option("bracketize")) { - make_block(self.body, output); - return; - } - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block brackets if needed. - if (!self.body) - return output.force_semicolon(); - if (self.body instanceof AST_Do - && !output.option("screw_ie8")) { - // https://github.com/mishoo/UglifyJS/issues/#issue/57 IE - // croaks with "syntax error" on code like this: if (foo) - // do ... while(cond); else ... we need block brackets - // around do/while - make_block(self.body, output); - return; - } - var b = self.body; - while (true) { - if (b instanceof AST_If) { - if (!b.alternative) { - make_block(self.body, output); - return; - } - b = b.alternative; - } - else if (b instanceof AST_StatementWithBody) { - b = b.body; - } - else break; - } - force_statement(self.body, output); - }; - DEFPRINT(AST_If, function(self, output){ - output.print("if"); - output.space(); - output.with_parens(function(){ - self.condition.print(output); - }); - output.space(); - if (self.alternative) { - make_then(self, output); - output.space(); - output.print("else"); - output.space(); - force_statement(self.alternative, output); - } else { - self._do_print_body(output); - } - }); - - /* -----[ switch ]----- */ - DEFPRINT(AST_Switch, function(self, output){ - output.print("switch"); - output.space(); - output.with_parens(function(){ - self.expression.print(output); - }); - output.space(); - if (self.body.length > 0) output.with_block(function(){ - self.body.forEach(function(stmt, i){ - if (i) output.newline(); - output.indent(true); - stmt.print(output); - }); - }); - else output.print("{}"); - }); - AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output){ - if (this.body.length > 0) { - output.newline(); - this.body.forEach(function(stmt){ - output.indent(); - stmt.print(output); - output.newline(); - }); - } - }); - DEFPRINT(AST_Default, function(self, output){ - output.print("default:"); - self._do_print_body(output); - }); - DEFPRINT(AST_Case, function(self, output){ - output.print("case"); - output.space(); - self.expression.print(output); - output.print(":"); - self._do_print_body(output); - }); - - /* -----[ exceptions ]----- */ - DEFPRINT(AST_Try, function(self, output){ - output.print("try"); - output.space(); - print_bracketed(self.body, output); - if (self.bcatch) { - output.space(); - self.bcatch.print(output); - } - if (self.bfinally) { - output.space(); - self.bfinally.print(output); - } - }); - DEFPRINT(AST_Catch, function(self, output){ - output.print("catch"); - output.space(); - output.with_parens(function(){ - self.argname.print(output); - }); - output.space(); - print_bracketed(self.body, output); - }); - DEFPRINT(AST_Finally, function(self, output){ - output.print("finally"); - output.space(); - print_bracketed(self.body, output); - }); - - /* -----[ var/const ]----- */ - AST_Definitions.DEFMETHOD("_do_print", function(output, kind){ - output.print(kind); - output.space(); - this.definitions.forEach(function(def, i){ - if (i) output.comma(); - def.print(output); - }); - var p = output.parent(); - var in_for = p instanceof AST_For || p instanceof AST_ForIn; - var avoid_semicolon = in_for && p.init === this; - if (!avoid_semicolon) - output.semicolon(); - }); - DEFPRINT(AST_Var, function(self, output){ - self._do_print(output, "var"); - }); - DEFPRINT(AST_Const, function(self, output){ - self._do_print(output, "const"); - }); - - function parenthesize_for_noin(node, output, noin) { - if (!noin) node.print(output); - else try { - // need to take some precautions here: - // https://github.com/mishoo/UglifyJS2/issues/60 - node.walk(new TreeWalker(function(node){ - if (node instanceof AST_Binary && node.operator == "in") - throw output; - })); - node.print(output); - } catch(ex) { - if (ex !== output) throw ex; - node.print(output, true); - } - }; - - DEFPRINT(AST_VarDef, function(self, output){ - self.name.print(output); - if (self.value) { - output.space(); - output.print("="); - output.space(); - var p = output.parent(1); - var noin = p instanceof AST_For || p instanceof AST_ForIn; - parenthesize_for_noin(self.value, output, noin); - } - }); - - /* -----[ other expressions ]----- */ - DEFPRINT(AST_Call, function(self, output){ - self.expression.print(output); - if (self instanceof AST_New && no_constructor_parens(self, output)) - return; - output.with_parens(function(){ - self.args.forEach(function(expr, i){ - if (i) output.comma(); - expr.print(output); - }); - }); - }); - DEFPRINT(AST_New, function(self, output){ - output.print("new"); - output.space(); - AST_Call.prototype._codegen(self, output); - }); - - AST_Seq.DEFMETHOD("_do_print", function(output){ - this.car.print(output); - if (this.cdr) { - output.comma(); - if (output.should_break()) { - output.newline(); - output.indent(); - } - this.cdr.print(output); - } - }); - DEFPRINT(AST_Seq, function(self, output){ - self._do_print(output); - // var p = output.parent(); - // if (p instanceof AST_Statement) { - // output.with_indent(output.next_indent(), function(){ - // self._do_print(output); - // }); - // } else { - // self._do_print(output); - // } - }); - DEFPRINT(AST_Dot, function(self, output){ - var expr = self.expression; - expr.print(output); - if (expr instanceof AST_Number && expr.getValue() >= 0) { - if (!/[xa-f.]/i.test(output.last())) { - output.print("."); - } - } - output.print("."); - // the name after dot would be mapped about here. - output.add_mapping(self.end); - output.print_name(self.property); - }); - DEFPRINT(AST_Sub, function(self, output){ - self.expression.print(output); - output.print("["); - self.property.print(output); - output.print("]"); - }); - DEFPRINT(AST_UnaryPrefix, function(self, output){ - var op = self.operator; - output.print(op); - if (/^[a-z]/i.test(op)) - output.space(); - self.expression.print(output); - }); - DEFPRINT(AST_UnaryPostfix, function(self, output){ - self.expression.print(output); - output.print(self.operator); - }); - DEFPRINT(AST_Binary, function(self, output){ - self.left.print(output); - output.space(); - output.print(self.operator); - output.space(); - self.right.print(output); - }); - DEFPRINT(AST_Conditional, function(self, output){ - self.condition.print(output); - output.space(); - output.print("?"); - output.space(); - self.consequent.print(output); - output.space(); - output.colon(); - self.alternative.print(output); - }); - - /* -----[ literals ]----- */ - DEFPRINT(AST_Array, function(self, output){ - output.with_square(function(){ - var a = self.elements, len = a.length; - if (len > 0) output.space(); - a.forEach(function(exp, i){ - if (i) output.comma(); - exp.print(output); - // If the final element is a hole, we need to make sure it - // doesn't look like a trailing comma, by inserting an actual - // trailing comma. - if (i === len - 1 && exp instanceof AST_Hole) - output.comma(); - }); - if (len > 0) output.space(); - }); - }); - DEFPRINT(AST_Object, function(self, output){ - if (self.properties.length > 0) output.with_block(function(){ - self.properties.forEach(function(prop, i){ - if (i) { - output.print(","); - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }); - else output.print("{}"); - }); - DEFPRINT(AST_ObjectKeyVal, function(self, output){ - var key = self.key; - if (output.option("quote_keys")) { - output.print_string(key + ""); - } else if ((typeof key == "number" - || !output.option("beautify") - && +key + "" == key) - && parseFloat(key) >= 0) { - output.print(make_num(key)); - } else if (RESERVED_WORDS(key) ? output.option("screw_ie8") : is_identifier_string(key)) { - output.print_name(key); - } else { - output.print_string(key); - } - output.colon(); - self.value.print(output); - }); - DEFPRINT(AST_ObjectSetter, function(self, output){ - output.print("set"); - self.value._do_print(output, true); - }); - DEFPRINT(AST_ObjectGetter, function(self, output){ - output.print("get"); - self.value._do_print(output, true); - }); - DEFPRINT(AST_Symbol, function(self, output){ - var def = self.definition(); - output.print_name(def ? def.mangled_name || def.name : self.name); - }); - DEFPRINT(AST_Undefined, function(self, output){ - output.print("void 0"); - }); - DEFPRINT(AST_Hole, noop); - DEFPRINT(AST_Infinity, function(self, output){ - output.print("1/0"); - }); - DEFPRINT(AST_NaN, function(self, output){ - output.print("0/0"); - }); - DEFPRINT(AST_This, function(self, output){ - output.print("this"); - }); - DEFPRINT(AST_Constant, function(self, output){ - output.print(self.getValue()); - }); - DEFPRINT(AST_String, function(self, output){ - output.print_string(self.getValue()); - }); - DEFPRINT(AST_Number, function(self, output){ - output.print(make_num(self.getValue())); - }); - DEFPRINT(AST_RegExp, function(self, output){ - var str = self.getValue().toString(); - if (output.option("ascii_only")) - str = output.to_ascii(str); - output.print(str); - var p = output.parent(); - if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === self) - output.print(" "); - }); - - function force_statement(stat, output) { - if (output.option("bracketize")) { - if (!stat || stat instanceof AST_EmptyStatement) - output.print("{}"); - else if (stat instanceof AST_BlockStatement) - stat.print(output); - else output.with_block(function(){ - output.indent(); - stat.print(output); - output.newline(); - }); - } else { - if (!stat || stat instanceof AST_EmptyStatement) - output.force_semicolon(); - else - stat.print(output); - } - }; - - // return true if the node at the top of the stack (that means the - // innermost node in the current output) is lexically the first in - // a statement. - function first_in_statement(output) { - var a = output.stack(), i = a.length, node = a[--i], p = a[--i]; - while (i > 0) { - if (p instanceof AST_Statement && p.body === node) - return true; - if ((p instanceof AST_Seq && p.car === node ) || - (p instanceof AST_Call && p.expression === node && !(p instanceof AST_New) ) || - (p instanceof AST_Dot && p.expression === node ) || - (p instanceof AST_Sub && p.expression === node ) || - (p instanceof AST_Conditional && p.condition === node ) || - (p instanceof AST_Binary && p.left === node ) || - (p instanceof AST_UnaryPostfix && p.expression === node )) - { - node = p; - p = a[--i]; - } else { - return false; - } - } - }; - - // self should be AST_New. decide if we want to show parens or not. - function no_constructor_parens(self, output) { - return self.args.length == 0 && !output.option("beautify"); - }; - - function best_of(a) { - var best = a[0], len = best.length; - for (var i = 1; i < a.length; ++i) { - if (a[i].length < len) { - best = a[i]; - len = best.length; - } - } - return best; - }; - - function make_num(num) { - var str = num.toString(10), a = [ str.replace(/^0\./, ".").replace('e+', 'e') ], m; - if (Math.floor(num) === num) { - if (num >= 0) { - a.push("0x" + num.toString(16).toLowerCase(), // probably pointless - "0" + num.toString(8)); // same. - } else { - a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless - "-0" + (-num).toString(8)); // same. - } - if ((m = /^(.*?)(0+)$/.exec(num))) { - a.push(m[1] + "e" + m[2].length); - } - } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) { - a.push(m[2] + "e-" + (m[1].length + m[2].length), - str.substr(str.indexOf("."))); - } - return best_of(a); - }; - - function make_block(stmt, output) { - if (stmt instanceof AST_BlockStatement) { - stmt.print(output); - return; - } - output.with_block(function(){ - output.indent(); - stmt.print(output); - output.newline(); - }); - }; - - /* -----[ source map generators ]----- */ - - function DEFMAP(nodetype, generator) { - nodetype.DEFMETHOD("add_source_map", function(stream){ - generator(this, stream); - }); - }; - - // We could easily add info for ALL nodes, but it seems to me that - // would be quite wasteful, hence this noop in the base class. - DEFMAP(AST_Node, noop); - - function basic_sourcemap_gen(self, output) { - output.add_mapping(self.start); - }; - - // XXX: I'm not exactly sure if we need it for all of these nodes, - // or if we should add even more. - - DEFMAP(AST_Directive, basic_sourcemap_gen); - DEFMAP(AST_Debugger, basic_sourcemap_gen); - DEFMAP(AST_Symbol, basic_sourcemap_gen); - DEFMAP(AST_Jump, basic_sourcemap_gen); - DEFMAP(AST_StatementWithBody, basic_sourcemap_gen); - DEFMAP(AST_LabeledStatement, noop); // since the label symbol will mark it - DEFMAP(AST_Lambda, basic_sourcemap_gen); - DEFMAP(AST_Switch, basic_sourcemap_gen); - DEFMAP(AST_SwitchBranch, basic_sourcemap_gen); - DEFMAP(AST_BlockStatement, basic_sourcemap_gen); - DEFMAP(AST_Toplevel, noop); - DEFMAP(AST_New, basic_sourcemap_gen); - DEFMAP(AST_Try, basic_sourcemap_gen); - DEFMAP(AST_Catch, basic_sourcemap_gen); - DEFMAP(AST_Finally, basic_sourcemap_gen); - DEFMAP(AST_Definitions, basic_sourcemap_gen); - DEFMAP(AST_Constant, basic_sourcemap_gen); - DEFMAP(AST_ObjectProperty, function(self, output){ - output.add_mapping(self.start, self.key); - }); - -})(); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js deleted file mode 100644 index 48ab216..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/parse.js +++ /dev/null @@ -1,1410 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -var KEYWORDS = 'break case catch const continue debugger default delete do else finally for function if in instanceof new return switch throw try typeof var void while with'; -var KEYWORDS_ATOM = 'false null true'; -var RESERVED_WORDS = 'abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized this throws transient volatile' - + " " + KEYWORDS_ATOM + " " + KEYWORDS; -var KEYWORDS_BEFORE_EXPRESSION = 'return new delete throw else case'; - -KEYWORDS = makePredicate(KEYWORDS); -RESERVED_WORDS = makePredicate(RESERVED_WORDS); -KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION); -KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM); - -var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^")); - -var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; -var RE_OCT_NUMBER = /^0[0-7]+$/; -var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; - -var OPERATORS = makePredicate([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "/", - "%", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "/=", - "*=", - "%=", - ">>=", - "<<=", - ">>>=", - "|=", - "^=", - "&=", - "&&", - "||" -]); - -var WHITESPACE_CHARS = makePredicate(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000")); - -var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,.;:")); - -var PUNC_CHARS = makePredicate(characters("[]{}(),;:")); - -var REGEXP_MODIFIERS = makePredicate(characters("gmsiy")); - -/* -----[ Tokenizer ]----- */ - -// regexps adapted from http://xregexp.com/plugins/#unicode -var UNICODE = { - letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\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\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\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\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\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-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\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-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\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]"), - non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), - space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"), - connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]") -}; - -function is_letter(code) { - return (code >= 97 && code <= 122) - || (code >= 65 && code <= 90) - || (code >= 0xaa && UNICODE.letter.test(String.fromCharCode(code))); -}; - -function is_digit(code) { - return code >= 48 && code <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9 -}; - -function is_alphanumeric_char(code) { - return is_digit(code) || is_letter(code); -}; - -function is_unicode_combining_mark(ch) { - return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch); -}; - -function is_unicode_connector_punctuation(ch) { - return UNICODE.connector_punctuation.test(ch); -}; - -function is_identifier(name) { - return !RESERVED_WORDS(name) && /^[a-z_$][a-z0-9_$]*$/i.test(name); -}; - -function is_identifier_start(code) { - return code == 36 || code == 95 || is_letter(code); -}; - -function is_identifier_char(ch) { - var code = ch.charCodeAt(0); - return is_identifier_start(code) - || is_digit(code) - || code == 8204 // \u200c: zero-width non-joiner - || code == 8205 // \u200d: zero-width joiner (in my ECMA-262 PDF, this is also 200c) - || is_unicode_combining_mark(ch) - || is_unicode_connector_punctuation(ch) - ; -}; - -function is_identifier_string(str){ - var i = str.length; - if (i == 0) return false; - if (is_digit(str.charCodeAt(0))) return false; - while (--i >= 0) { - if (!is_identifier_char(str.charAt(i))) - return false; - } - return true; -}; - -function parse_js_number(num) { - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } -}; - -function JS_Parse_Error(message, line, col, pos) { - this.message = message; - this.line = line; - this.col = col; - this.pos = pos; - this.stack = new Error().stack; -}; - -JS_Parse_Error.prototype.toString = function() { - return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; -}; - -function js_error(message, filename, line, col, pos) { - throw new JS_Parse_Error(message, line, col, pos); -}; - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -}; - -var EX_EOF = {}; - -function tokenizer($TEXT, filename) { - - var S = { - text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/\uFEFF/g, ''), - filename : filename, - pos : 0, - tokpos : 0, - line : 1, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - comments_before : [] - }; - - function peek() { return S.text.charAt(S.pos); }; - - function next(signal_eof, in_string) { - var ch = S.text.charAt(S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (ch == "\n") { - S.newline_before = S.newline_before || !in_string; - ++S.line; - S.col = 0; - } else { - ++S.col; - } - return ch; - }; - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - }; - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - }; - - function token(type, value, is_comment) { - S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX(value)) || - (type == "keyword" && KEYWORDS_BEFORE_EXPRESSION(value)) || - (type == "punc" && PUNC_BEFORE_EXPRESSION(value))); - var ret = { - type : type, - value : value, - line : S.tokline, - col : S.tokcol, - pos : S.tokpos, - endpos : S.pos, - nlb : S.newline_before, - file : filename - }; - if (!is_comment) { - ret.comments_before = S.comments_before; - S.comments_before = []; - // make note of any newlines in the comments that came before - for (var i = 0, len = ret.comments_before.length; i < len; i++) { - ret.nlb = ret.nlb || ret.comments_before[i].nlb; - } - } - S.newline_before = false; - return new AST_Token(ret); - }; - - function skip_whitespace() { - while (WHITESPACE_CHARS(peek())) - next(); - }; - - function read_while(pred) { - var ret = "", ch, i = 0; - while ((ch = peek()) && pred(ch, i++)) - ret += next(); - return ret; - }; - - function parse_error(err) { - js_error(err, filename, S.tokline, S.tokcol, S.tokpos); - }; - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; - var num = read_while(function(ch, i){ - var code = ch.charCodeAt(0); - switch (code) { - case 120: case 88: // xX - return has_x ? false : (has_x = true); - case 101: case 69: // eE - return has_x ? true : has_e ? false : (has_e = after_e = true); - case 45: // - - return after_e || (i == 0 && !prefix); - case 43: // + - return after_e; - case (after_e = false, 46): // . - return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false; - } - return is_alphanumeric_char(code); - }); - if (prefix) num = prefix + num; - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - }; - - function read_escaped_char(in_string) { - var ch = next(true, in_string); - switch (ch.charCodeAt(0)) { - case 110 : return "\n"; - case 114 : return "\r"; - case 116 : return "\t"; - case 98 : return "\b"; - case 118 : return "\u000b"; // \v - case 102 : return "\f"; - case 48 : return "\0"; - case 120 : return String.fromCharCode(hex_bytes(2)); // \x - case 117 : return String.fromCharCode(hex_bytes(4)); // \u - case 10 : return ""; // newline - default : return ch; - } - }; - - function hex_bytes(n) { - var num = 0; - for (; n > 0; --n) { - var digit = parseInt(next(true), 16); - if (isNaN(digit)) - parse_error("Invalid hex-character pattern in string"); - num = (num << 4) | digit; - } - return num; - }; - - var read_string = with_eof_error("Unterminated string constant", function(){ - var quote = next(), ret = ""; - for (;;) { - var ch = next(true); - if (ch == "\\") { - // read OctalEscapeSequence (XXX: deprecated if "strict mode") - // https://github.com/mishoo/UglifyJS/issues/178 - var octal_len = 0, first = null; - ch = read_while(function(ch){ - if (ch >= "0" && ch <= "7") { - if (!first) { - first = ch; - return ++octal_len; - } - else if (first <= "3" && octal_len <= 2) return ++octal_len; - else if (first >= "4" && octal_len <= 1) return ++octal_len; - } - return false; - }); - if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); - else ch = read_escaped_char(true); - } - else if (ch == quote) break; - ret += ch; - } - return token("string", ret); - }); - - function read_line_comment() { - next(); - var i = find("\n"), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - return token("comment1", ret, true); - }; - - var read_multiline_comment = with_eof_error("Unterminated multiline comment", function(){ - next(); - var i = find("*/", true); - var text = S.text.substring(S.pos, i); - var a = text.split("\n"), n = a.length; - // update stream position - S.pos = i + 2; - S.line += n - 1; - if (n > 1) S.col = a[n - 1].length; - else S.col += a[n - 1].length; - S.col += 2; - S.newline_before = S.newline_before || text.indexOf("\n") >= 0; - return token("comment2", text, true); - }); - - function read_name() { - var backslash = false, name = "", ch, escaped = false, hex; - while ((ch = peek()) != null) { - if (!backslash) { - if (ch == "\\") escaped = backslash = true, next(); - else if (is_identifier_char(ch)) name += next(); - else break; - } - else { - if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); - ch = read_escaped_char(); - if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); - name += ch; - backslash = false; - } - } - if (KEYWORDS(name) && escaped) { - hex = name.charCodeAt(0).toString(16).toUpperCase(); - name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1); - } - return name; - }; - - var read_regexp = with_eof_error("Unterminated regular expression", function(regexp){ - var prev_backslash = false, ch, in_class = false; - while ((ch = next(true))) if (prev_backslash) { - regexp += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - regexp += ch; - } else if (ch == "]" && in_class) { - in_class = false; - regexp += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - regexp += ch; - } - var mods = read_name(); - return token("regexp", new RegExp(regexp, mods)); - }); - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (OPERATORS(bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - }; - return token("operator", grow(prefix || next())); - }; - - function handle_slash() { - next(); - var regex_allowed = S.regex_allowed; - switch (peek()) { - case "/": - S.comments_before.push(read_line_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - case "*": - S.comments_before.push(read_multiline_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - } - return S.regex_allowed ? read_regexp("") : read_operator("/"); - }; - - function handle_dot() { - next(); - return is_digit(peek().charCodeAt(0)) - ? read_num(".") - : token("punc", "."); - }; - - function read_word() { - var word = read_name(); - return KEYWORDS_ATOM(word) ? token("atom", word) - : !KEYWORDS(word) ? token("name", word) - : OPERATORS(word) ? token("operator", word) - : token("keyword", word); - }; - - function with_eof_error(eof_error, cont) { - return function(x) { - try { - return cont(x); - } catch(ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - }; - - function next_token(force_regexp) { - if (force_regexp != null) - return read_regexp(force_regexp); - skip_whitespace(); - start_token(); - var ch = peek(); - if (!ch) return token("eof"); - var code = ch.charCodeAt(0); - switch (code) { - case 34: case 39: return read_string(); - case 46: return handle_dot(); - case 47: return handle_slash(); - } - if (is_digit(code)) return read_num(); - if (PUNC_CHARS(ch)) return token("punc", next()); - if (OPERATOR_CHARS(ch)) return read_operator(); - if (code == 92 || is_identifier_start(code)) return read_word(); - parse_error("Unexpected character '" + ch + "'"); - }; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - return next_token; - -}; - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = makePredicate([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = makePredicate([ "--", "++" ]); - -var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); - -var PRECEDENCE = (function(a, ret){ - for (var i = 0, n = 1; i < a.length; ++i, ++n) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = n; - } - } - return ret; -})( - [ - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"] - ], - {} -); - -var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); - -var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); - -/* -----[ Parser ]----- */ - -function parse($TEXT, options) { - - options = defaults(options, { - strict : false, - filename : null, - toplevel : null, - expression : false - }); - - var S = { - input : typeof $TEXT == "string" ? tokenizer($TEXT, options.filename) : $TEXT, - token : null, - prev : null, - peeked : null, - in_function : 0, - in_directives : true, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - }; - - function peek() { return S.peeked || (S.peeked = S.input()); }; - - function next() { - S.prev = S.token; - if (S.peeked) { - S.token = S.peeked; - S.peeked = null; - } else { - S.token = S.input(); - } - S.in_directives = S.in_directives && ( - S.token.type == "string" || is("punc", ";") - ); - return S.token; - }; - - function prev() { - return S.prev; - }; - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - ctx.filename, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - }; - - function token_error(token, msg) { - croak(msg, token.line, token.col); - }; - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - }; - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»"); - }; - - function expect(punc) { return expect_token("punc", punc); }; - - function can_insert_semicolon() { - return !options.strict && ( - S.token.nlb || is("eof") || is("punc", "}") - ); - }; - - function semicolon() { - if (is("punc", ";")) next(); - else if (!can_insert_semicolon()) unexpected(); - }; - - function parenthesised() { - expect("("); - var exp = expression(true); - expect(")"); - return exp; - }; - - function embed_tokens(parser) { - return function() { - var start = S.token; - var expr = parser(); - var end = prev(); - expr.start = start; - expr.end = end; - return expr; - }; - }; - - var statement = embed_tokens(function() { - var tmp; - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); // force regexp - } - switch (S.token.type) { - case "string": - var dir = S.in_directives, stat = simple_statement(); - // XXXv2: decide how to fix directives - if (dir && stat.body instanceof AST_String && !is("punc", ",")) - return new AST_Directive({ value: stat.body.value }); - return stat; - case "num": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - return is_token(peek(), "punc", ":") - ? labeled_statement() - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return new AST_BlockStatement({ - start : S.token, - body : block_(), - end : prev() - }); - case "[": - case "(": - return simple_statement(); - case ";": - next(); - return new AST_EmptyStatement(); - default: - unexpected(); - } - - case "keyword": - switch (tmp = S.token.value, next(), tmp) { - case "break": - return break_cont(AST_Break); - - case "continue": - return break_cont(AST_Continue); - - case "debugger": - semicolon(); - return new AST_Debugger(); - - case "do": - return new AST_Do({ - body : in_loop(statement), - condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), tmp) - }); - - case "while": - return new AST_While({ - condition : parenthesised(), - body : in_loop(statement) - }); - - case "for": - return for_(); - - case "function": - return function_(true); - - case "if": - return if_(); - - case "return": - if (S.in_function == 0) - croak("'return' outside of function"); - return new AST_Return({ - value: ( is("punc", ";") - ? (next(), null) - : can_insert_semicolon() - ? null - : (tmp = expression(true), semicolon(), tmp) ) - }); - - case "switch": - return new AST_Switch({ - expression : parenthesised(), - body : in_loop(switch_body_) - }); - - case "throw": - if (S.token.nlb) - croak("Illegal newline after 'throw'"); - return new AST_Throw({ - value: (tmp = expression(true), semicolon(), tmp) - }); - - case "try": - return try_(); - - case "var": - return tmp = var_(), semicolon(), tmp; - - case "const": - return tmp = const_(), semicolon(), tmp; - - case "with": - return new AST_With({ - expression : parenthesised(), - body : statement() - }); - - default: - unexpected(); - } - } - }); - - function labeled_statement() { - var label = as_symbol(AST_Label); - if (find_if(function(l){ return l.name == label.name }, S.labels)) { - // ECMA-262, 12.12: An ECMAScript program is considered - // syntactically incorrect if it contains a - // LabelledStatement that is enclosed by a - // LabelledStatement with the same Identifier as label. - croak("Label " + label.name + " defined twice"); - } - expect(":"); - S.labels.push(label); - var stat = statement(); - S.labels.pop(); - return new AST_LabeledStatement({ body: stat, label: label }); - }; - - function simple_statement(tmp) { - return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) }); - }; - - function break_cont(type) { - var label = null; - if (!can_insert_semicolon()) { - label = as_symbol(AST_LabelRef, true); - } - if (label != null) { - if (!find_if(function(l){ return l.name == label.name }, S.labels)) - croak("Undefined label " + label.name); - } - else if (S.in_loop == 0) - croak(type.TYPE + " not inside a loop or switch"); - semicolon(); - return new type({ label: label }); - }; - - function for_() { - expect("("); - var init = null; - if (!is("punc", ";")) { - init = is("keyword", "var") - ? (next(), var_(true)) - : expression(true, true); - if (is("operator", "in")) { - if (init instanceof AST_Var && init.definitions.length > 1) - croak("Only one variable declaration allowed in for..in loop"); - next(); - return for_in(init); - } - } - return regular_for(init); - }; - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(true); - expect(";"); - var step = is("punc", ")") ? null : expression(true); - expect(")"); - return new AST_For({ - init : init, - condition : test, - step : step, - body : in_loop(statement) - }); - }; - - function for_in(init) { - var lhs = init instanceof AST_Var ? init.definitions[0].name : null; - var obj = expression(true); - expect(")"); - return new AST_ForIn({ - init : init, - name : lhs, - object : obj, - body : in_loop(statement) - }); - }; - - var function_ = function(in_statement, ctor) { - var is_accessor = ctor === AST_Accessor; - var name = (is("name") ? as_symbol(in_statement - ? AST_SymbolDefun - : is_accessor - ? AST_SymbolAccessor - : AST_SymbolLambda) - : is_accessor && (is("string") || is("num")) ? as_atom_node() - : null); - if (in_statement && !name) - unexpected(); - expect("("); - if (!ctor) ctor = in_statement ? AST_Defun : AST_Function; - return new ctor({ - name: name, - argnames: (function(first, a){ - while (!is("punc", ")")) { - if (first) first = false; else expect(","); - a.push(as_symbol(AST_SymbolFunarg)); - } - next(); - return a; - })(true, []), - body: (function(loop, labels){ - ++S.in_function; - S.in_directives = true; - S.in_loop = 0; - S.labels = []; - var a = block_(); - --S.in_function; - S.in_loop = loop; - S.labels = labels; - return a; - })(S.in_loop, S.labels) - }); - }; - - function if_() { - var cond = parenthesised(), body = statement(), belse = null; - if (is("keyword", "else")) { - next(); - belse = statement(); - } - return new AST_If({ - condition : cond, - body : body, - alternative : belse - }); - }; - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - }; - - function switch_body_() { - expect("{"); - var a = [], cur = null, branch = null, tmp; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Case({ - start : (tmp = S.token, next(), tmp), - expression : expression(true), - body : cur - }); - a.push(branch); - expect(":"); - } - else if (is("keyword", "default")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Default({ - start : (tmp = S.token, next(), expect(":"), tmp), - body : cur - }); - a.push(branch); - } - else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - if (branch) branch.end = prev(); - next(); - return a; - }; - - function try_() { - var body = block_(), bcatch = null, bfinally = null; - if (is("keyword", "catch")) { - var start = S.token; - next(); - expect("("); - var name = as_symbol(AST_SymbolCatch); - expect(")"); - bcatch = new AST_Catch({ - start : start, - argname : name, - body : block_(), - end : prev() - }); - } - if (is("keyword", "finally")) { - var start = S.token; - next(); - bfinally = new AST_Finally({ - start : start, - body : block_(), - end : prev() - }); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return new AST_Try({ - body : body, - bcatch : bcatch, - bfinally : bfinally - }); - }; - - function vardefs(no_in, in_const) { - var a = []; - for (;;) { - a.push(new AST_VarDef({ - start : S.token, - name : as_symbol(in_const ? AST_SymbolConst : AST_SymbolVar), - value : is("operator", "=") ? (next(), expression(false, no_in)) : null, - end : prev() - })); - if (!is("punc", ",")) - break; - next(); - } - return a; - }; - - var var_ = function(no_in) { - return new AST_Var({ - start : prev(), - definitions : vardefs(no_in, false), - end : prev() - }); - }; - - var const_ = function() { - return new AST_Const({ - start : prev(), - definitions : vardefs(false, true), - end : prev() - }); - }; - - var new_ = function() { - var start = S.token; - expect_token("operator", "new"); - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")"); - } else { - args = []; - } - return subscripts(new AST_New({ - start : start, - expression : newexp, - args : args, - end : prev() - }), true); - }; - - function as_atom_node() { - var tok = S.token, ret; - switch (tok.type) { - case "name": - return as_symbol(AST_SymbolRef); - case "num": - ret = new AST_Number({ start: tok, end: tok, value: tok.value }); - break; - case "string": - ret = new AST_String({ start: tok, end: tok, value: tok.value }); - break; - case "regexp": - ret = new AST_RegExp({ start: tok, end: tok, value: tok.value }); - break; - case "atom": - switch (tok.value) { - case "false": - ret = new AST_False({ start: tok, end: tok }); - break; - case "true": - ret = new AST_True({ start: tok, end: tok }); - break; - case "null": - ret = new AST_Null({ start: tok, end: tok }); - break; - } - break; - } - next(); - return ret; - }; - - var expr_atom = function(allow_calls) { - if (is("operator", "new")) { - return new_(); - } - var start = S.token; - if (is("punc")) { - switch (start.value) { - case "(": - next(); - var ex = expression(true); - ex.start = start; - ex.end = S.token; - expect(")"); - return subscripts(ex, allow_calls); - case "[": - return subscripts(array_(), allow_calls); - case "{": - return subscripts(object_(), allow_calls); - } - unexpected(); - } - if (is("keyword", "function")) { - next(); - var func = function_(false); - func.start = start; - func.end = prev(); - return subscripts(func, allow_calls); - } - if (ATOMIC_START_TOKEN[S.token.type]) { - return subscripts(as_atom_node(), allow_calls); - } - unexpected(); - }; - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push(new AST_Hole({ start: S.token, end: S.token })); - } else { - a.push(expression(false)); - } - } - next(); - return a; - }; - - var array_ = embed_tokens(function() { - expect("["); - return new AST_Array({ - elements: expr_list("]", !options.strict, true) - }); - }); - - var object_ = embed_tokens(function() { - expect("{"); - var first = true, a = []; - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!options.strict && is("punc", "}")) - // allow trailing comma - break; - var start = S.token; - var type = start.type; - var name = as_property_name(); - if (type == "name" && !is("punc", ":")) { - if (name == "get") { - a.push(new AST_ObjectGetter({ - start : start, - key : name, - value : function_(false, AST_Accessor), - end : prev() - })); - continue; - } - if (name == "set") { - a.push(new AST_ObjectSetter({ - start : start, - key : name, - value : function_(false, AST_Accessor), - end : prev() - })); - continue; - } - } - expect(":"); - a.push(new AST_ObjectKeyVal({ - start : start, - key : name, - value : expression(false), - end : prev() - })); - } - next(); - return new AST_Object({ properties: a }); - }); - - function as_property_name() { - var tmp = S.token; - next(); - switch (tmp.type) { - case "num": - case "string": - case "name": - case "operator": - case "keyword": - case "atom": - return tmp.value; - default: - unexpected(); - } - }; - - function as_name() { - var tmp = S.token; - next(); - switch (tmp.type) { - case "name": - case "operator": - case "keyword": - case "atom": - return tmp.value; - default: - unexpected(); - } - }; - - function as_symbol(type, noerror) { - if (!is("name")) { - if (!noerror) croak("Name expected"); - return null; - } - var name = S.token.value; - var sym = new (name == "this" ? AST_This : type)({ - name : String(S.token.value), - start : S.token, - end : S.token - }); - next(); - return sym; - }; - - var subscripts = function(expr, allow_calls) { - var start = expr.start; - if (is("punc", ".")) { - next(); - return subscripts(new AST_Dot({ - start : start, - expression : expr, - property : as_name(), - end : prev() - }), allow_calls); - } - if (is("punc", "[")) { - next(); - var prop = expression(true); - expect("]"); - return subscripts(new AST_Sub({ - start : start, - expression : expr, - property : prop, - end : prev() - }), allow_calls); - } - if (allow_calls && is("punc", "(")) { - next(); - return subscripts(new AST_Call({ - start : start, - expression : expr, - args : expr_list(")"), - end : prev() - }), true); - } - return expr; - }; - - var maybe_unary = function(allow_calls) { - var start = S.token; - if (is("operator") && UNARY_PREFIX(start.value)) { - next(); - var ex = make_unary(AST_UnaryPrefix, start.value, maybe_unary(allow_calls)); - ex.start = start; - ex.end = prev(); - return ex; - } - var val = expr_atom(allow_calls); - while (is("operator") && UNARY_POSTFIX(S.token.value) && !S.token.nlb) { - val = make_unary(AST_UnaryPostfix, S.token.value, val); - val.start = start; - val.end = S.token; - next(); - } - return val; - }; - - function make_unary(ctor, op, expr) { - if ((op == "++" || op == "--") && !is_assignable(expr)) - croak("Invalid use of " + op + " operator"); - return new ctor({ operator: op, expression: expr }); - }; - - var expr_op = function(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op == "in" && no_in) op = null; - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && prec > min_prec) { - next(); - var right = expr_op(maybe_unary(true), prec, no_in); - return expr_op(new AST_Binary({ - start : left.start, - left : left, - operator : op, - right : right, - end : right.end - }), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(maybe_unary(true), 0, no_in); - }; - - var maybe_conditional = function(no_in) { - var start = S.token; - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return new AST_Conditional({ - start : start, - condition : expr, - consequent : yes, - alternative : expression(false, no_in), - end : peek() - }); - } - return expr; - }; - - function is_assignable(expr) { - if (!options.strict) return true; - if (expr instanceof AST_This) return false; - return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol); - }; - - var maybe_assign = function(no_in) { - var start = S.token; - var left = maybe_conditional(no_in), val = S.token.value; - if (is("operator") && ASSIGNMENT(val)) { - if (is_assignable(left)) { - next(); - return new AST_Assign({ - start : start, - left : left, - operator : val, - right : maybe_assign(no_in), - end : prev() - }); - } - croak("Invalid assignment"); - } - return left; - }; - - var expression = function(commas, no_in) { - var start = S.token; - var expr = maybe_assign(no_in); - if (commas && is("punc", ",")) { - next(); - return new AST_Seq({ - start : start, - car : expr, - cdr : expression(true, no_in), - end : peek() - }); - } - return expr; - }; - - function in_loop(cont) { - ++S.in_loop; - var ret = cont(); - --S.in_loop; - return ret; - }; - - if (options.expression) { - return expression(true); - } - - return (function(){ - var start = S.token; - var body = []; - while (!is("eof")) - body.push(statement()); - var end = prev(); - var toplevel = options.toplevel; - if (toplevel) { - toplevel.body = toplevel.body.concat(body); - toplevel.end = end; - } else { - toplevel = new AST_Toplevel({ start: start, body: body, end: end }); - } - return toplevel; - })(); - -}; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/scope.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/scope.js deleted file mode 100644 index d15cec7..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/scope.js +++ /dev/null @@ -1,581 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -function SymbolDef(scope, index, orig) { - this.name = orig.name; - this.orig = [ orig ]; - this.scope = scope; - this.references = []; - this.global = false; - this.mangled_name = null; - this.undeclared = false; - this.constant = false; - this.index = index; -}; - -SymbolDef.prototype = { - unmangleable: function(options) { - return (this.global && !(options && options.toplevel)) - || this.undeclared - || (!(options && options.eval) && (this.scope.uses_eval || this.scope.uses_with)); - }, - mangle: function(options) { - if (!this.mangled_name && !this.unmangleable(options)) { - var s = this.scope; - if (this.orig[0] instanceof AST_SymbolLambda && !options.screw_ie8) - s = s.parent_scope; - this.mangled_name = s.next_mangled(options); - } - } -}; - -AST_Toplevel.DEFMETHOD("figure_out_scope", function(){ - // This does what ast_add_scope did in UglifyJS v1. - // - // Part of it could be done at parse time, but it would complicate - // the parser (and it's already kinda complex). It's also worth - // having it separated because we might need to call it multiple - // times on the same tree. - - // pass 1: setup scope chaining and handle definitions - var self = this; - var scope = self.parent_scope = null; - var labels = new Dictionary(); - var nesting = 0; - var tw = new TreeWalker(function(node, descend){ - if (node instanceof AST_Scope) { - node.init_scope_vars(nesting); - var save_scope = node.parent_scope = scope; - var save_labels = labels; - ++nesting; - scope = node; - labels = new Dictionary(); - descend(); - labels = save_labels; - scope = save_scope; - --nesting; - return true; // don't descend again in TreeWalker - } - if (node instanceof AST_Directive) { - node.scope = scope; - push_uniq(scope.directives, node.value); - return true; - } - if (node instanceof AST_With) { - for (var s = scope; s; s = s.parent_scope) - s.uses_with = true; - return; - } - if (node instanceof AST_LabeledStatement) { - var l = node.label; - if (labels.has(l.name)) - throw new Error(string_template("Label {name} defined twice", l)); - labels.set(l.name, l); - descend(); - labels.del(l.name); - return true; // no descend again - } - if (node instanceof AST_Symbol) { - node.scope = scope; - } - if (node instanceof AST_Label) { - node.thedef = node; - node.init_scope_vars(); - } - if (node instanceof AST_SymbolLambda) { - scope.def_function(node); - } - else if (node instanceof AST_SymbolDefun) { - // Careful here, the scope where this should be defined is - // the parent scope. The reason is that we enter a new - // scope when we encounter the AST_Defun node (which is - // instanceof AST_Scope) but we get to the symbol a bit - // later. - (node.scope = scope.parent_scope).def_function(node); - } - else if (node instanceof AST_SymbolVar - || node instanceof AST_SymbolConst) { - var def = scope.def_variable(node); - def.constant = node instanceof AST_SymbolConst; - def.init = tw.parent().value; - } - else if (node instanceof AST_SymbolCatch) { - // XXX: this is wrong according to ECMA-262 (12.4). the - // `catch` argument name should be visible only inside the - // catch block. For a quick fix AST_Catch should inherit - // from AST_Scope. Keeping it this way because of IE, - // which doesn't obey the standard. (it introduces the - // identifier in the enclosing scope) - scope.def_variable(node); - } - if (node instanceof AST_LabelRef) { - var sym = labels.get(node.name); - if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", { - name: node.name, - line: node.start.line, - col: node.start.col - })); - node.thedef = sym; - } - }); - self.walk(tw); - - // pass 2: find back references and eval - var func = null; - var globals = self.globals = new Dictionary(); - var tw = new TreeWalker(function(node, descend){ - if (node instanceof AST_Lambda) { - var prev_func = func; - func = node; - descend(); - func = prev_func; - return true; - } - if (node instanceof AST_LabelRef) { - node.reference(); - return true; - } - if (node instanceof AST_SymbolRef) { - var name = node.name; - var sym = node.scope.find_variable(name); - if (!sym) { - var g; - if (globals.has(name)) { - g = globals.get(name); - } else { - g = new SymbolDef(self, globals.size(), node); - g.undeclared = true; - g.global = true; - globals.set(name, g); - } - node.thedef = g; - if (name == "eval" && tw.parent() instanceof AST_Call) { - for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) - s.uses_eval = true; - } - if (name == "arguments") { - func.uses_arguments = true; - } - } else { - node.thedef = sym; - } - node.reference(); - return true; - } - }); - self.walk(tw); -}); - -AST_Scope.DEFMETHOD("init_scope_vars", function(nesting){ - this.directives = []; // contains the directives defined in this scope, i.e. "use strict" - this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions) - this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope) - this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement - this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval` - this.parent_scope = null; // the parent scope - this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes - this.cname = -1; // the current index for mangling functions/variables - this.nesting = nesting; // the nesting level of this scope (0 means toplevel) -}); - -AST_Scope.DEFMETHOD("strict", function(){ - return this.has_directive("use strict"); -}); - -AST_Lambda.DEFMETHOD("init_scope_vars", function(){ - AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; -}); - -AST_SymbolRef.DEFMETHOD("reference", function() { - var def = this.definition(); - def.references.push(this); - var s = this.scope; - while (s) { - push_uniq(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } - this.frame = this.scope.nesting - def.scope.nesting; -}); - -AST_Label.DEFMETHOD("init_scope_vars", function(){ - this.references = []; -}); - -AST_LabelRef.DEFMETHOD("reference", function(){ - this.thedef.references.push(this); -}); - -AST_Scope.DEFMETHOD("find_variable", function(name){ - if (name instanceof AST_Symbol) name = name.name; - return this.variables.get(name) - || (this.parent_scope && this.parent_scope.find_variable(name)); -}); - -AST_Scope.DEFMETHOD("has_directive", function(value){ - return this.parent_scope && this.parent_scope.has_directive(value) - || (this.directives.indexOf(value) >= 0 ? this : null); -}); - -AST_Scope.DEFMETHOD("def_function", function(symbol){ - this.functions.set(symbol.name, this.def_variable(symbol)); -}); - -AST_Scope.DEFMETHOD("def_variable", function(symbol){ - var def; - if (!this.variables.has(symbol.name)) { - def = new SymbolDef(this, this.variables.size(), symbol); - this.variables.set(symbol.name, def); - def.global = !this.parent_scope; - } else { - def = this.variables.get(symbol.name); - def.orig.push(symbol); - } - return symbol.thedef = def; -}); - -AST_Scope.DEFMETHOD("next_mangled", function(options){ - var ext = this.enclosed; - out: while (true) { - var m = base54(++this.cname); - if (!is_identifier(m)) continue; // skip over "do" - // we must ensure that the mangled name does not shadow a name - // from some parent scope that is referenced in this or in - // inner scopes. - for (var i = ext.length; --i >= 0;) { - var sym = ext[i]; - var name = sym.mangled_name || (sym.unmangleable(options) && sym.name); - if (m == name) continue out; - } - return m; - } -}); - -AST_Scope.DEFMETHOD("references", function(sym){ - if (sym instanceof AST_Symbol) sym = sym.definition(); - return this.enclosed.indexOf(sym) < 0 ? null : sym; -}); - -AST_Symbol.DEFMETHOD("unmangleable", function(options){ - return this.definition().unmangleable(options); -}); - -// property accessors are not mangleable -AST_SymbolAccessor.DEFMETHOD("unmangleable", function(){ - return true; -}); - -// labels are always mangleable -AST_Label.DEFMETHOD("unmangleable", function(){ - return false; -}); - -AST_Symbol.DEFMETHOD("unreferenced", function(){ - return this.definition().references.length == 0 - && !(this.scope.uses_eval || this.scope.uses_with); -}); - -AST_Symbol.DEFMETHOD("undeclared", function(){ - return this.definition().undeclared; -}); - -AST_LabelRef.DEFMETHOD("undeclared", function(){ - return false; -}); - -AST_Label.DEFMETHOD("undeclared", function(){ - return false; -}); - -AST_Symbol.DEFMETHOD("definition", function(){ - return this.thedef; -}); - -AST_Symbol.DEFMETHOD("global", function(){ - return this.definition().global; -}); - -AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){ - return defaults(options, { - except : [], - eval : false, - sort : false, - toplevel : false, - screw_ie8 : false - }); -}); - -AST_Toplevel.DEFMETHOD("mangle_names", function(options){ - options = this._default_mangler_options(options); - // We only need to mangle declaration nodes. Special logic wired - // into the code generator will display the mangled name if it's - // present (and for AST_SymbolRef-s it'll use the mangled name of - // the AST_SymbolDeclaration that it points to). - var lname = -1; - var to_mangle = []; - var tw = new TreeWalker(function(node, descend){ - if (node instanceof AST_LabeledStatement) { - // lname is incremented when we get to the AST_Label - var save_nesting = lname; - descend(); - lname = save_nesting; - return true; // don't descend again in TreeWalker - } - if (node instanceof AST_Scope) { - var p = tw.parent(), a = []; - node.variables.each(function(symbol){ - if (options.except.indexOf(symbol.name) < 0) { - a.push(symbol); - } - }); - if (options.sort) a.sort(function(a, b){ - return b.references.length - a.references.length; - }); - to_mangle.push.apply(to_mangle, a); - return; - } - if (node instanceof AST_Label) { - var name; - do name = base54(++lname); while (!is_identifier(name)); - node.mangled_name = name; - return true; - } - }); - this.walk(tw); - to_mangle.forEach(function(def){ def.mangle(options) }); -}); - -AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options){ - options = this._default_mangler_options(options); - var tw = new TreeWalker(function(node){ - if (node instanceof AST_Constant) - base54.consider(node.print_to_string()); - else if (node instanceof AST_Return) - base54.consider("return"); - else if (node instanceof AST_Throw) - base54.consider("throw"); - else if (node instanceof AST_Continue) - base54.consider("continue"); - else if (node instanceof AST_Break) - base54.consider("break"); - else if (node instanceof AST_Debugger) - base54.consider("debugger"); - else if (node instanceof AST_Directive) - base54.consider(node.value); - else if (node instanceof AST_While) - base54.consider("while"); - else if (node instanceof AST_Do) - base54.consider("do while"); - else if (node instanceof AST_If) { - base54.consider("if"); - if (node.alternative) base54.consider("else"); - } - else if (node instanceof AST_Var) - base54.consider("var"); - else if (node instanceof AST_Const) - base54.consider("const"); - else if (node instanceof AST_Lambda) - base54.consider("function"); - else if (node instanceof AST_For) - base54.consider("for"); - else if (node instanceof AST_ForIn) - base54.consider("for in"); - else if (node instanceof AST_Switch) - base54.consider("switch"); - else if (node instanceof AST_Case) - base54.consider("case"); - else if (node instanceof AST_Default) - base54.consider("default"); - else if (node instanceof AST_With) - base54.consider("with"); - else if (node instanceof AST_ObjectSetter) - base54.consider("set" + node.key); - else if (node instanceof AST_ObjectGetter) - base54.consider("get" + node.key); - else if (node instanceof AST_ObjectKeyVal) - base54.consider(node.key); - else if (node instanceof AST_New) - base54.consider("new"); - else if (node instanceof AST_This) - base54.consider("this"); - else if (node instanceof AST_Try) - base54.consider("try"); - else if (node instanceof AST_Catch) - base54.consider("catch"); - else if (node instanceof AST_Finally) - base54.consider("finally"); - else if (node instanceof AST_Symbol && node.unmangleable(options)) - base54.consider(node.name); - else if (node instanceof AST_Unary || node instanceof AST_Binary) - base54.consider(node.operator); - else if (node instanceof AST_Dot) - base54.consider(node.property); - }); - this.walk(tw); - base54.sort(); -}); - -var base54 = (function() { - var string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789"; - var chars, frequency; - function reset() { - frequency = Object.create(null); - chars = string.split("").map(function(ch){ return ch.charCodeAt(0) }); - chars.forEach(function(ch){ frequency[ch] = 0 }); - } - base54.consider = function(str){ - for (var i = str.length; --i >= 0;) { - var code = str.charCodeAt(i); - if (code in frequency) ++frequency[code]; - } - }; - base54.sort = function() { - chars = mergeSort(chars, function(a, b){ - if (is_digit(a) && !is_digit(b)) return 1; - if (is_digit(b) && !is_digit(a)) return -1; - return frequency[b] - frequency[a]; - }); - }; - base54.reset = reset; - reset(); - base54.get = function(){ return chars }; - base54.freq = function(){ return frequency }; - function base54(num) { - var ret = "", base = 54; - do { - ret += String.fromCharCode(chars[num % base]); - num = Math.floor(num / base); - base = 64; - } while (num > 0); - return ret; - }; - return base54; -})(); - -AST_Toplevel.DEFMETHOD("scope_warnings", function(options){ - options = defaults(options, { - undeclared : false, // this makes a lot of noise - unreferenced : true, - assign_to_global : true, - func_arguments : true, - nested_defuns : true, - eval : true - }); - var tw = new TreeWalker(function(node){ - if (options.undeclared - && node instanceof AST_SymbolRef - && node.undeclared()) - { - // XXX: this also warns about JS standard names, - // i.e. Object, Array, parseInt etc. Should add a list of - // exceptions. - AST_Node.warn("Undeclared symbol: {name} [{file}:{line},{col}]", { - name: node.name, - file: node.start.file, - line: node.start.line, - col: node.start.col - }); - } - if (options.assign_to_global) - { - var sym = null; - if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef) - sym = node.left; - else if (node instanceof AST_ForIn && node.init instanceof AST_SymbolRef) - sym = node.init; - if (sym - && (sym.undeclared() - || (sym.global() && sym.scope !== sym.definition().scope))) { - AST_Node.warn("{msg}: {name} [{file}:{line},{col}]", { - msg: sym.undeclared() ? "Accidental global?" : "Assignment to global", - name: sym.name, - file: sym.start.file, - line: sym.start.line, - col: sym.start.col - }); - } - } - if (options.eval - && node instanceof AST_SymbolRef - && node.undeclared() - && node.name == "eval") { - AST_Node.warn("Eval is used [{file}:{line},{col}]", node.start); - } - if (options.unreferenced - && (node instanceof AST_SymbolDeclaration || node instanceof AST_Label) - && node.unreferenced()) { - AST_Node.warn("{type} {name} is declared but not referenced [{file}:{line},{col}]", { - type: node instanceof AST_Label ? "Label" : "Symbol", - name: node.name, - file: node.start.file, - line: node.start.line, - col: node.start.col - }); - } - if (options.func_arguments - && node instanceof AST_Lambda - && node.uses_arguments) { - AST_Node.warn("arguments used in function {name} [{file}:{line},{col}]", { - name: node.name ? node.name.name : "anonymous", - file: node.start.file, - line: node.start.line, - col: node.start.col - }); - } - if (options.nested_defuns - && node instanceof AST_Defun - && !(tw.parent() instanceof AST_Scope)) { - AST_Node.warn("Function {name} declared in nested statement \"{type}\" [{file}:{line},{col}]", { - name: node.name.name, - type: tw.parent().TYPE, - file: node.start.file, - line: node.start.line, - col: node.start.col - }); - } - }); - this.walk(tw); -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/sourcemap.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/sourcemap.js deleted file mode 100644 index 3429908..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/sourcemap.js +++ /dev/null @@ -1,81 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -// a small wrapper around fitzgen's source-map library -function SourceMap(options) { - options = defaults(options, { - file : null, - root : null, - orig : null, - }); - var generator = new MOZ_SourceMap.SourceMapGenerator({ - file : options.file, - sourceRoot : options.root - }); - var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig); - function add(source, gen_line, gen_col, orig_line, orig_col, name) { - if (orig_map) { - var info = orig_map.originalPositionFor({ - line: orig_line, - column: orig_col - }); - source = info.source; - orig_line = info.line; - orig_col = info.column; - name = info.name; - } - generator.addMapping({ - generated : { line: gen_line, column: gen_col }, - original : { line: orig_line, column: orig_col }, - source : source, - name : name - }); - }; - return { - add : add, - get : function() { return generator }, - toString : function() { return generator.toString() } - }; -}; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/transform.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/transform.js deleted file mode 100644 index c3c34f5..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/transform.js +++ /dev/null @@ -1,218 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -// Tree transformer helpers. - -function TreeTransformer(before, after) { - TreeWalker.call(this); - this.before = before; - this.after = after; -} -TreeTransformer.prototype = new TreeWalker; - -(function(undefined){ - - function _(node, descend) { - node.DEFMETHOD("transform", function(tw, in_list){ - var x, y; - tw.push(this); - if (tw.before) x = tw.before(this, descend, in_list); - if (x === undefined) { - if (!tw.after) { - x = this; - descend(x, tw); - } else { - tw.stack[tw.stack.length - 1] = x = this.clone(); - descend(x, tw); - y = tw.after(x, in_list); - if (y !== undefined) x = y; - } - } - tw.pop(); - return x; - }); - }; - - function do_list(list, tw) { - return MAP(list, function(node){ - return node.transform(tw, true); - }); - }; - - _(AST_Node, noop); - - _(AST_LabeledStatement, function(self, tw){ - self.label = self.label.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_SimpleStatement, function(self, tw){ - self.body = self.body.transform(tw); - }); - - _(AST_Block, function(self, tw){ - self.body = do_list(self.body, tw); - }); - - _(AST_DWLoop, function(self, tw){ - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_For, function(self, tw){ - if (self.init) self.init = self.init.transform(tw); - if (self.condition) self.condition = self.condition.transform(tw); - if (self.step) self.step = self.step.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_ForIn, function(self, tw){ - self.init = self.init.transform(tw); - self.object = self.object.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_With, function(self, tw){ - self.expression = self.expression.transform(tw); - self.body = self.body.transform(tw); - }); - - _(AST_Exit, function(self, tw){ - if (self.value) self.value = self.value.transform(tw); - }); - - _(AST_LoopControl, function(self, tw){ - if (self.label) self.label = self.label.transform(tw); - }); - - _(AST_If, function(self, tw){ - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - if (self.alternative) self.alternative = self.alternative.transform(tw); - }); - - _(AST_Switch, function(self, tw){ - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); - }); - - _(AST_Case, function(self, tw){ - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); - }); - - _(AST_Try, function(self, tw){ - self.body = do_list(self.body, tw); - if (self.bcatch) self.bcatch = self.bcatch.transform(tw); - if (self.bfinally) self.bfinally = self.bfinally.transform(tw); - }); - - _(AST_Catch, function(self, tw){ - self.argname = self.argname.transform(tw); - self.body = do_list(self.body, tw); - }); - - _(AST_Definitions, function(self, tw){ - self.definitions = do_list(self.definitions, tw); - }); - - _(AST_VarDef, function(self, tw){ - self.name = self.name.transform(tw); - if (self.value) self.value = self.value.transform(tw); - }); - - _(AST_Lambda, function(self, tw){ - if (self.name) self.name = self.name.transform(tw); - self.argnames = do_list(self.argnames, tw); - self.body = do_list(self.body, tw); - }); - - _(AST_Call, function(self, tw){ - self.expression = self.expression.transform(tw); - self.args = do_list(self.args, tw); - }); - - _(AST_Seq, function(self, tw){ - self.car = self.car.transform(tw); - self.cdr = self.cdr.transform(tw); - }); - - _(AST_Dot, function(self, tw){ - self.expression = self.expression.transform(tw); - }); - - _(AST_Sub, function(self, tw){ - self.expression = self.expression.transform(tw); - self.property = self.property.transform(tw); - }); - - _(AST_Unary, function(self, tw){ - self.expression = self.expression.transform(tw); - }); - - _(AST_Binary, function(self, tw){ - self.left = self.left.transform(tw); - self.right = self.right.transform(tw); - }); - - _(AST_Conditional, function(self, tw){ - self.condition = self.condition.transform(tw); - self.consequent = self.consequent.transform(tw); - self.alternative = self.alternative.transform(tw); - }); - - _(AST_Array, function(self, tw){ - self.elements = do_list(self.elements, tw); - }); - - _(AST_Object, function(self, tw){ - self.properties = do_list(self.properties, tw); - }); - - _(AST_ObjectProperty, function(self, tw){ - self.value = self.value.transform(tw); - }); - -})(); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/utils.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/utils.js deleted file mode 100644 index 73964a0..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/lib/utils.js +++ /dev/null @@ -1,295 +0,0 @@ -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - https://github.com/mishoo/UglifyJS2 - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2012 (c) Mihai Bazon - - 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 HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. - - ***********************************************************************/ - -"use strict"; - -function array_to_hash(a) { - var ret = Object.create(null); - for (var i = 0; i < a.length; ++i) - ret[a[i]] = true; - return ret; -}; - -function slice(a, start) { - return Array.prototype.slice.call(a, start || 0); -}; - -function characters(str) { - return str.split(""); -}; - -function member(name, array) { - for (var i = array.length; --i >= 0;) - if (array[i] == name) - return true; - return false; -}; - -function find_if(func, array) { - for (var i = 0, n = array.length; i < n; ++i) { - if (func(array[i])) - return array[i]; - } -}; - -function repeat_string(str, i) { - if (i <= 0) return ""; - if (i == 1) return str; - var d = repeat_string(str, i >> 1); - d += d; - if (i & 1) d += str; - return d; -}; - -function DefaultsError(msg, defs) { - this.msg = msg; - this.defs = defs; -}; - -function defaults(args, defs, croak) { - if (args === true) - args = {}; - var ret = args || {}; - if (croak) for (var i in ret) if (ret.hasOwnProperty(i) && !defs.hasOwnProperty(i)) - throw new DefaultsError("`" + i + "` is not a supported option", defs); - for (var i in defs) if (defs.hasOwnProperty(i)) { - ret[i] = (args && args.hasOwnProperty(i)) ? args[i] : defs[i]; - } - return ret; -}; - -function merge(obj, ext) { - for (var i in ext) if (ext.hasOwnProperty(i)) { - obj[i] = ext[i]; - } - return obj; -}; - -function noop() {}; - -var MAP = (function(){ - function MAP(a, f, backwards) { - var ret = [], top = [], i; - function doit() { - var val = f(a[i], i); - var is_last = val instanceof Last; - if (is_last) val = val.v; - if (val instanceof AtTop) { - val = val.v; - if (val instanceof Splice) { - top.push.apply(top, backwards ? val.v.slice().reverse() : val.v); - } else { - top.push(val); - } - } - else if (val !== skip) { - if (val instanceof Splice) { - ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v); - } else { - ret.push(val); - } - } - return is_last; - }; - if (a instanceof Array) { - if (backwards) { - for (i = a.length; --i >= 0;) if (doit()) break; - ret.reverse(); - top.reverse(); - } else { - for (i = 0; i < a.length; ++i) if (doit()) break; - } - } - else { - for (i in a) if (a.hasOwnProperty(i)) if (doit()) break; - } - return top.concat(ret); - }; - MAP.at_top = function(val) { return new AtTop(val) }; - MAP.splice = function(val) { return new Splice(val) }; - MAP.last = function(val) { return new Last(val) }; - var skip = MAP.skip = {}; - function AtTop(val) { this.v = val }; - function Splice(val) { this.v = val }; - function Last(val) { this.v = val }; - return MAP; -})(); - -function push_uniq(array, el) { - if (array.indexOf(el) < 0) - array.push(el); -}; - -function string_template(text, props) { - return text.replace(/\{(.+?)\}/g, function(str, p){ - return props[p]; - }); -}; - -function remove(array, el) { - for (var i = array.length; --i >= 0;) { - if (array[i] === el) array.splice(i, 1); - } -}; - -function mergeSort(array, cmp) { - if (array.length < 2) return array.slice(); - function merge(a, b) { - var r = [], ai = 0, bi = 0, i = 0; - while (ai < a.length && bi < b.length) { - cmp(a[ai], b[bi]) <= 0 - ? r[i++] = a[ai++] - : r[i++] = b[bi++]; - } - if (ai < a.length) r.push.apply(r, a.slice(ai)); - if (bi < b.length) r.push.apply(r, b.slice(bi)); - return r; - }; - function _ms(a) { - if (a.length <= 1) - return a; - var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); - left = _ms(left); - right = _ms(right); - return merge(left, right); - }; - return _ms(array); -}; - -function set_difference(a, b) { - return a.filter(function(el){ - return b.indexOf(el) < 0; - }); -}; - -function set_intersection(a, b) { - return a.filter(function(el){ - return b.indexOf(el) >= 0; - }); -}; - -// this function is taken from Acorn [1], written by Marijn Haverbeke -// [1] https://github.com/marijnh/acorn -function makePredicate(words) { - if (!(words instanceof Array)) words = words.split(" "); - var f = "", cats = []; - out: for (var i = 0; i < words.length; ++i) { - for (var j = 0; j < cats.length; ++j) - if (cats[j][0].length == words[i].length) { - cats[j].push(words[i]); - continue out; - } - cats.push([words[i]]); - } - function compareTo(arr) { - if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";"; - f += "switch(str){"; - for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":"; - f += "return true}return false;"; - } - // When there are more than three length categories, an outer - // switch first dispatches on the lengths, to save on comparisons. - if (cats.length > 3) { - cats.sort(function(a, b) {return b.length - a.length;}); - f += "switch(str.length){"; - for (var i = 0; i < cats.length; ++i) { - var cat = cats[i]; - f += "case " + cat[0].length + ":"; - compareTo(cat); - } - f += "}"; - // Otherwise, simply generate a flat `switch` statement. - } else { - compareTo(words); - } - return new Function("str", f); -}; - -function all(array, predicate) { - for (var i = array.length; --i >= 0;) - if (!predicate(array[i])) - return false; - return true; -}; - -function Dictionary() { - this._values = Object.create(null); - this._size = 0; -}; -Dictionary.prototype = { - set: function(key, val) { - if (!this.has(key)) ++this._size; - this._values["$" + key] = val; - return this; - }, - add: function(key, val) { - if (this.has(key)) { - this.get(key).push(val); - } else { - this.set(key, [ val ]); - } - return this; - }, - get: function(key) { return this._values["$" + key] }, - del: function(key) { - if (this.has(key)) { - --this._size; - delete this._values["$" + key]; - } - return this; - }, - has: function(key) { return ("$" + key) in this._values }, - each: function(f) { - for (var i in this._values) - f(this._values[i], i.substr(1)); - }, - size: function() { - return this._size; - }, - map: function(f) { - var ret = []; - for (var i in this._values) - ret.push(f(this._values[i], i.substr(1))); - return ret; - } -}; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/LICENSE b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/README.md b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/README.md deleted file mode 100644 index 9ff1acf..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/README.md +++ /dev/null @@ -1,1414 +0,0 @@ -# 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) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [doWhilst](#doWhilst) -* [until](#until) -* [doUntil](#doUntil) -* [forever](#forever) -* [waterfall](#waterfall) -* [compose](#compose) -* [applyEach](#applyEach) -* [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.map(['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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/component.json b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/component.json deleted file mode 100644 index bbb0115..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/lib/async.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/lib/async.js deleted file mode 100755 index cb6320d..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/async/lib/async.js +++ /dev/null @@ -1,955 +0,0 @@ -/*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 = setImmediate; - } - 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* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\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* [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.map(['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", - "_id": "async@0.2.9", - "_from": "async@~0.2.9" -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/.travis.yml b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/.travis.yml deleted file mode 100644 index cc4dba2..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/LICENSE b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/bool.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/bool.js deleted file mode 100644 index a998fb7..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/bool.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js deleted file mode 100644 index a35a7e6..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js deleted file mode 100644 index 017bb68..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .boolean('v') - .argv -; -console.dir(argv.v); -console.dir(argv._); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/default_hash.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/default_hash.js deleted file mode 100644 index ade7768..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/default_hash.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env node - -var argv = require('optimist') - .default({ x : 10, y : 10 }) - .argv -; - -console.log(argv.x + argv.y); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/default_singles.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/default_singles.js deleted file mode 100644 index d9b1ff4..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/default_singles.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist') - .default('x', 10) - .default('y', 10) - .argv -; -console.log(argv.x + argv.y); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/divide.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/divide.js deleted file mode 100644 index 5e2ee82..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/divide.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count.js deleted file mode 100644 index b5f95bf..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count.js +++ /dev/null @@ -1,20 +0,0 @@ -#!/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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js deleted file mode 100644 index d9ac709..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js deleted file mode 100644 index 4267511..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/nonopt.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/nonopt.js deleted file mode 100644 index ee633ee..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/nonopt.js +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); -console.log(argv._); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/reflect.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/reflect.js deleted file mode 100644 index 816b3e1..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/reflect.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -console.dir(require('optimist').argv); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/short.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/short.js deleted file mode 100644 index 1db0ad0..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/short.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -var argv = require('optimist').argv; -console.log('(%d,%d)', argv.x, argv.y); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/string.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/string.js deleted file mode 100644 index a8e5aeb..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/string.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/usage-options.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/usage-options.js deleted file mode 100644 index b999977..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/usage-options.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/xup.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/xup.js deleted file mode 100644 index 8f6ecd2..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/example/xup.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/index.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/index.js deleted file mode 100644 index 8ac67eb..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/index.js +++ /dev/null @@ -1,478 +0,0 @@ -var path = require('path'); -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 (args, 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 flags = { bools : {}, strings : {} }; - - self.boolean = function (bools) { - if (!Array.isArray(bools)) { - bools = [].slice.call(arguments); - } - - bools.forEach(function (name) { - flags.bools[name] = true; - }); - - return self; - }; - - self.string = function (strings) { - if (!Array.isArray(strings)) { - strings = [].slice.call(arguments); - } - - strings.forEach(function (name) { - flags.strings[name] = true; - }); - - return self; - }; - - var aliases = {}; - self.alias = function (x, y) { - if (typeof x === 'object') { - Object.keys(x).forEach(function (key) { - self.alias(key, x[key]); - }); - } - else if (Array.isArray(y)) { - y.forEach(function (yy) { - self.alias(x, yy); - }); - } - else { - var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y); - aliases[x] = zs.filter(function (z) { return z != x }); - aliases[y] = zs.filter(function (z) { return z != 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 defaults = {}; - self.default = function (key, value) { - if (typeof key === 'object') { - Object.keys(key).forEach(function (k) { - self.default(k, key[k]); - }); - } - else { - defaults[key] = value; - } - - 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 Argv(args).argv; - }; - - 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(defaults)) - .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(aliases[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 (flags.bools[key]) type = '[boolean]'; - if (flags.strings[key]) type = '[string]'; - - if (!wrap && dpadding.length > 0) { - desc += dpadding; - } - - var prelude = ' ' + kswitch + spadding; - var extra = [ - type, - demanded[key] - ? '[required]' - : null - , - defaults[key] !== undefined - ? '[default: ' + JSON.stringify(defaults[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 : parseArgs, - enumerable : true, - }); - - function parseArgs () { - var argv = { _ : [], $0 : self.$0 }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] || false); - }); - - function setArg (key, val) { - var num = Number(val); - var value = typeof val !== 'string' || isNaN(num) ? val : num; - if (flags.strings[key]) value = val; - - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - argv[x] = argv[key]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (arg === '--') { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - else if (arg.match(/^--.+=/)) { - // 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 (arg.match(/^--no-.+/)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (arg.match(/^--.+/)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !next.match(/^-/) - && !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 (arg.match(/^-[^-]+/)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], true); - } - } - - if (!broken) { - var key = arg.slice(-1)[0]; - - if (args[i+1] && !args[i+1].match(/^-/) - && !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 { - var n = Number(arg); - argv._.push(flags.strings['_'] || isNaN(n) ? arg : n); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!(key in argv)) { - argv[key] = defaults[key]; - if (key in aliases) { - argv[aliases[key]] = defaults[key]; - } - } - }); - - 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; -}; - -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 ]; - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/.npmignore b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown deleted file mode 100644 index 346374e..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown +++ /dev/null @@ -1,70 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js deleted file mode 100644 index a3fbaae..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js +++ /dev/null @@ -1,10 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js deleted file mode 100644 index a4665e1..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js +++ /dev/null @@ -1,3 +0,0 @@ -var wrap = require('wordwrap')(15); - -console.log(wrap('You and your whole family are made out of meat.')); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js deleted file mode 100644 index c9bc945..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js +++ /dev/null @@ -1,76 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json deleted file mode 100644 index 887800f..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "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" - }, - "_id": "wordwrap@0.0.2", - "_from": "wordwrap@~0.0.2" -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js deleted file mode 100644 index 749292e..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js +++ /dev/null @@ -1,30 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt deleted file mode 100644 index aa3f490..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt +++ /dev/null @@ -1,63 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js deleted file mode 100644 index 0cfb76d..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js +++ /dev/null @@ -1,31 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/package.json b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/package.json deleted file mode 100644 index d39475a..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "optimist", - "version": "0.3.7", - "description": "Light-weight option parsing with an argv hash. No optstrings attached.", - "main": "./index.js", - "dependencies": { - "wordwrap": "~0.0.2" - }, - "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": "optimist\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\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" - }, - "_id": "optimist@0.3.7", - "_from": "optimist@~0.3.5" -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/readme.markdown b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/readme.markdown deleted file mode 100644 index ad9d3fd..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/readme.markdown +++ /dev/null @@ -1,487 +0,0 @@ -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 } } - -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_.js deleted file mode 100644 index d9c58b3..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_.js +++ /dev/null @@ -1,71 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_/argv.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_/argv.js deleted file mode 100644 index 3d09606..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_/argv.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -console.log(JSON.stringify(process.argv)); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_/bin.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_/bin.js deleted file mode 100755 index 4a18d85..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/_/bin.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -var argv = require('../../index').argv -console.log(JSON.stringify(argv._)); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/parse.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/parse.js deleted file mode 100644 index d320f43..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/parse.js +++ /dev/null @@ -1,446 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/usage.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/usage.js deleted file mode 100644 index 300454c..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/optimist/test/usage.js +++ /dev/null @@ -1,292 +0,0 @@ -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/.npmignore b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/.npmignore deleted file mode 100644 index 3dddf3f..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -dist/* -node_modules/* diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/.travis.yml b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/.travis.yml deleted file mode 100644 index ddc9c4f..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - "0.10" \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md deleted file mode 100644 index 94429f4..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md +++ /dev/null @@ -1,104 +0,0 @@ -# Change Log - -## 0.1.30 - -* Do not join source root with a source, when the source is a data URI. - -* Extend the test runner to allow running single specific test files at a time. - -* Performance improvements in `SourceNode.prototype.walk` and - `SourceMapConsumer.prototype.eachMapping`. - -* Source map browser builds will now work inside Workers. - -* Better error messages when attempting to add an invalid mapping to a - `SourceMapGenerator`. - -## 0.1.29 - -* Allow duplicate entries in the `names` and `sources` arrays of source maps - (usually from TypeScript) we are parsing. Fixes github isse 72. - -## 0.1.28 - -* Skip duplicate mappings when creating source maps from SourceNode; github - issue 75. - -## 0.1.27 - -* Don't throw an error when the `file` property is missing in SourceMapConsumer, - we don't use it anyway. - -## 0.1.26 - -* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. - -## 0.1.25 - -* Make compatible with browserify - -## 0.1.24 - -* Fix issue with absolute paths and `file://` URIs. See - https://bugzilla.mozilla.org/show_bug.cgi?id=885597 - -## 0.1.23 - -* Fix issue with absolute paths and sourcesContent, github issue 64. - -## 0.1.22 - -* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. - -## 0.1.21 - -* Fixed handling of sources that start with a slash so that they are relative to - the source root's host. - -## 0.1.20 - -* Fixed github issue #43: absolute URLs aren't joined with the source root - anymore. - -## 0.1.19 - -* Using Travis CI to run tests. - -## 0.1.18 - -* Fixed a bug in the handling of sourceRoot. - -## 0.1.17 - -* Added SourceNode.fromStringWithSourceMap. - -## 0.1.16 - -* Added missing documentation. - -* Fixed the generating of empty mappings in SourceNode. - -## 0.1.15 - -* Added SourceMapGenerator.applySourceMap. - -## 0.1.14 - -* The sourceRoot is now handled consistently. - -## 0.1.13 - -* Added SourceMapGenerator.fromSourceMap. - -## 0.1.12 - -* SourceNode now generates empty mappings too. - -## 0.1.11 - -* Added name support to SourceNode. - -## 0.1.10 - -* Added sourcesContent support to the customer and generator. - diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/LICENSE b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/LICENSE deleted file mode 100644 index ed1b7cf..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js deleted file mode 100644 index d6fc26a..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -var path = require('path'); -var fs = require('fs'); -var copy = require('dryice').copy; - -function removeAmdefine(src) { - src = String(src).replace( - /if\s*\(typeof\s*define\s*!==\s*'function'\)\s*{\s*var\s*define\s*=\s*require\('amdefine'\)\(module,\s*require\);\s*}\s*/g, - ''); - src = src.replace( - /\b(define\(.*)('amdefine',?)/gm, - '$1'); - return src; -} -removeAmdefine.onRead = true; - -function makeNonRelative(src) { - return src - .replace(/require\('.\//g, 'require(\'source-map/') - .replace(/\.\.\/\.\.\/lib\//g, ''); -} -makeNonRelative.onRead = true; - -function buildBrowser() { - console.log('\nCreating dist/source-map.js'); - - var project = copy.createCommonJsProject({ - roots: [ path.join(__dirname, 'lib') ] - }); - - copy({ - source: [ - 'build/mini-require.js', - { - project: project, - require: [ 'source-map/source-map-generator', - 'source-map/source-map-consumer', - 'source-map/source-node'] - }, - 'build/suffix-browser.js' - ], - filter: [ - copy.filter.moduleDefines, - removeAmdefine - ], - dest: 'dist/source-map.js' - }); -} - -function buildBrowserMin() { - console.log('\nCreating dist/source-map.min.js'); - - copy({ - source: 'dist/source-map.js', - filter: copy.filter.uglifyjs, - dest: 'dist/source-map.min.js' - }); -} - -function buildFirefox() { - console.log('\nCreating dist/SourceMap.jsm'); - - var project = copy.createCommonJsProject({ - roots: [ path.join(__dirname, 'lib') ] - }); - - copy({ - source: [ - 'build/prefix-source-map.jsm', - { - project: project, - require: [ 'source-map/source-map-consumer', - 'source-map/source-map-generator', - 'source-map/source-node' ] - }, - 'build/suffix-source-map.jsm' - ], - filter: [ - copy.filter.moduleDefines, - removeAmdefine, - makeNonRelative - ], - dest: 'dist/SourceMap.jsm' - }); - - // Create dist/test/Utils.jsm - console.log('\nCreating dist/test/Utils.jsm'); - - project = copy.createCommonJsProject({ - roots: [ __dirname, path.join(__dirname, 'lib') ] - }); - - copy({ - source: [ - 'build/prefix-utils.jsm', - 'build/assert-shim.js', - { - project: project, - require: [ 'test/source-map/util' ] - }, - 'build/suffix-utils.jsm' - ], - filter: [ - copy.filter.moduleDefines, - removeAmdefine, - makeNonRelative - ], - dest: 'dist/test/Utils.jsm' - }); - - function isTestFile(f) { - return /^test\-.*?\.js/.test(f); - } - - var testFiles = fs.readdirSync(path.join(__dirname, 'test', 'source-map')).filter(isTestFile); - - testFiles.forEach(function (testFile) { - console.log('\nCreating', path.join('dist', 'test', testFile.replace(/\-/g, '_'))); - - copy({ - source: [ - 'build/test-prefix.js', - path.join('test', 'source-map', testFile), - 'build/test-suffix.js' - ], - filter: [ - removeAmdefine, - makeNonRelative, - function (input, source) { - return input.replace('define(', - 'define("' - + path.join('test', 'source-map', testFile.replace(/\.js$/, '')) - + '", ["require", "exports", "module"], '); - }, - function (input, source) { - return input.replace('{THIS_MODULE}', function () { - return "test/source-map/" + testFile.replace(/\.js$/, ''); - }); - } - ], - dest: path.join('dist', 'test', testFile.replace(/\-/g, '_')) - }); - }); -} - -function ensureDir(name) { - var dirExists = false; - try { - dirExists = fs.statSync(name).isDirectory(); - } catch (err) {} - - if (!dirExists) { - fs.mkdirSync(name, 0777); - } -} - -ensureDir("dist"); -ensureDir("dist/test"); -buildFirefox(); -buildBrowser(); -buildBrowserMin(); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/README.md b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/README.md deleted file mode 100644 index c20437b..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/README.md +++ /dev/null @@ -1,434 +0,0 @@ -# Source Map - -This is a library to generate and consume the source map format -[described here][format]. - -This library is written in the Asynchronous Module Definition format, and works -in the following environments: - -* Modern Browsers supporting ECMAScript 5 (either after the build, or with an - AMD loader such as RequireJS) - -* Inside Firefox (as a JSM file, after the build) - -* With NodeJS versions 0.8.X and higher - -## Node - - $ npm install source-map - -## Building from Source (for everywhere else) - -Install Node and then run - - $ git clone https://fitzgen@github.com/mozilla/source-map.git - $ cd source-map - $ npm link . - -Next, run - - $ node Makefile.dryice.js - -This should spew a bunch of stuff to stdout, and create the following files: - -* `dist/source-map.js` - The unminified browser version. - -* `dist/source-map.min.js` - The minified browser version. - -* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source. - -## Examples - -### Consuming a source map - - var rawSourceMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' - }; - - var smc = new SourceMapConsumer(rawSourceMap); - - console.log(smc.sources); - // [ 'http://example.com/www/js/one.js', - // 'http://example.com/www/js/two.js' ] - - console.log(smc.originalPositionFor({ - line: 2, - column: 28 - })); - // { source: 'http://example.com/www/js/two.js', - // line: 2, - // column: 10, - // name: 'n' } - - console.log(smc.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 - })); - // { line: 2, column: 28 } - - smc.eachMapping(function (m) { - // ... - }); - -### Generating a source map - -In depth guide: -[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) - -#### With SourceNode (high level API) - - function compile(ast) { - switch (ast.type) { - case 'BinaryExpression': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - [compile(ast.left), " + ", compile(ast.right)] - ); - case 'Literal': - return new SourceNode( - ast.location.line, - ast.location.column, - ast.location.source, - String(ast.value) - ); - // ... - default: - throw new Error("Bad AST"); - } - } - - var ast = parse("40 + 2", "add.js"); - console.log(compile(ast).toStringWithSourceMap({ - file: 'add.js' - })); - // { code: '40 + 2', - // map: [object SourceMapGenerator] } - -#### With SourceMapGenerator (low level API) - - var map = new SourceMapGenerator({ - file: "source-mapped.js" - }); - - map.addMapping({ - generated: { - line: 10, - column: 35 - }, - source: "foo.js", - original: { - line: 33, - column: 2 - }, - name: "christopher" - }); - - console.log(map.toString()); - // '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' - -## API - -Get a reference to the module: - - // NodeJS - var sourceMap = require('source-map'); - - // Browser builds - var sourceMap = window.sourceMap; - - // Inside Firefox - let sourceMap = {}; - Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); - -### SourceMapConsumer - -A SourceMapConsumer instance represents a parsed source map which we can query -for information about the original file positions by giving it a file position -in the generated source. - -#### new SourceMapConsumer(rawSourceMap) - -The only parameter is the raw source map (either as a string which can be -`JSON.parse`'d, or an object). According to the spec, source maps have the -following attributes: - -* `version`: Which version of the source map spec this map is following. - -* `sources`: An array of URLs to the original source files. - -* `names`: An array of identifiers which can be referrenced by individual - mappings. - -* `sourceRoot`: Optional. The URL root from which all sources are relative. - -* `sourcesContent`: Optional. An array of contents of the original source files. - -* `mappings`: A string of base64 VLQs which contain the actual mappings. - -* `file`: The generated filename this source map is associated with. - -#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) - -Returns the original source, line, and column information for the generated -source's line and column positions provided. The only argument is an object with -the following properties: - -* `line`: The line number in the generated source. - -* `column`: The column number in the generated source. - -and an object is returned with the following properties: - -* `source`: The original source file, or null if this information is not - available. - -* `line`: The line number in the original source, or null if this information is - not available. - -* `column`: The column number in the original source, or null or null if this - information is not available. - -* `name`: The original identifier, or null if this information is not available. - -#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) - -Returns the generated line and column information for the original source, -line, and column positions provided. The only argument is an object with -the following properties: - -* `source`: The filename of the original source. - -* `line`: The line number in the original source. - -* `column`: The column number in the original source. - -and an object is returned with the following properties: - -* `line`: The line number in the generated source, or null. - -* `column`: The column number in the generated source, or null. - -#### SourceMapConsumer.prototype.sourceContentFor(source) - -Returns the original source content for the source provided. The only -argument is the URL of the original source file. - -#### SourceMapConsumer.prototype.eachMapping(callback, context, order) - -Iterate over each mapping between an original source/line/column and a -generated line/column in this source map. - -* `callback`: The function that is called with each mapping. Mappings have the - form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, - name }` - -* `context`: Optional. If specified, this object will be the value of `this` - every time that `callback` is called. - -* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or - `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over - the mappings sorted by the generated file's line/column order or the - original's source/line/column order, respectively. Defaults to - `SourceMapConsumer.GENERATED_ORDER`. - -### SourceMapGenerator - -An instance of the SourceMapGenerator represents a source map which is being -built incrementally. - -#### new SourceMapGenerator(startOfSourceMap) - -To create a new one, you must pass an object with the following properties: - -* `file`: The filename of the generated source that this source map is - associated with. - -* `sourceRoot`: An optional root for all relative URLs in this source map. - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) - -Creates a new SourceMapGenerator based on a SourceMapConsumer - -* `sourceMapConsumer` The SourceMap. - -#### SourceMapGenerator.prototype.addMapping(mapping) - -Add a single mapping from original source line and column to the generated -source's line and column for this source map being created. The mapping object -should have the following properties: - -* `generated`: An object with the generated line and column positions. - -* `original`: An object with the original line and column positions. - -* `source`: The original source file (relative to the sourceRoot). - -* `name`: An optional original token name for this mapping. - -#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for an original source file. - -* `sourceFile` the URL of the original source file. - -* `sourceContent` the content of the source file. - -#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile]) - -Applies a SourceMap for a source file to the SourceMap. -Each mapping to the supplied source file is rewritten using the -supplied SourceMap. Note: The resolution for the resulting mappings -is the minimium of this map and the supplied map. - -* `sourceMapConsumer`: The SourceMap to be applied. - -* `sourceFile`: Optional. The filename of the source file. - If omitted, sourceMapConsumer.file will be used. - -#### SourceMapGenerator.prototype.toString() - -Renders the source map being generated to a string. - -### SourceNode - -SourceNodes provide a way to abstract over interpolating and/or concatenating -snippets of generated JavaScript source code, while maintaining the line and -column information associated between those snippets and the original source -code. This is useful as the final intermediate representation a compiler might -use before outputting the generated JS and source map. - -#### new SourceNode(line, column, source[, chunk[, name]]) - -* `line`: The original line number associated with this source node, or null if - it isn't associated with an original line. - -* `column`: The original column number associated with this source node, or null - if it isn't associated with an original column. - -* `source`: The original source's filename. - -* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see - below. - -* `name`: Optional. The original identifier. - -#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer) - -Creates a SourceNode from generated code and a SourceMapConsumer. - -* `code`: The generated code - -* `sourceMapConsumer` The SourceMap for the generated code - -#### SourceNode.prototype.add(chunk) - -Add a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -#### SourceNode.prototype.prepend(chunk) - -Prepend a chunk of generated JS to this source node. - -* `chunk`: A string snippet of generated JS code, another instance of - `SourceNode`, or an array where each member is one of those things. - -#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) - -Set the source content for a source file. This will be added to the -`SourceMap` in the `sourcesContent` field. - -* `sourceFile`: The filename of the source file - -* `sourceContent`: The content of the source file - -#### SourceNode.prototype.walk(fn) - -Walk over the tree of JS snippets in this node and its children. The walking -function is called once for each snippet of JS and is passed that snippet and -the its original associated source's line/column location. - -* `fn`: The traversal function. - -#### SourceNode.prototype.walkSourceContents(fn) - -Walk over the tree of SourceNodes. The walking function is called for each -source file content and is passed the filename and source content. - -* `fn`: The traversal function. - -#### SourceNode.prototype.join(sep) - -Like `Array.prototype.join` except for SourceNodes. Inserts the separator -between each of this source node's children. - -* `sep`: The separator. - -#### SourceNode.prototype.replaceRight(pattern, replacement) - -Call `String.prototype.replace` on the very right-most source snippet. Useful -for trimming whitespace from the end of a source node, etc. - -* `pattern`: The pattern to replace. - -* `replacement`: The thing to replace the pattern with. - -#### SourceNode.prototype.toString() - -Return the string representation of this source node. Walks over the tree and -concatenates all the various snippets together to one string. - -### SourceNode.prototype.toStringWithSourceMap(startOfSourceMap) - -Returns the string representation of this tree of source nodes, plus a -SourceMapGenerator which contains all the mappings between the generated and -original sources. - -The arguments are the same as those to `new SourceMapGenerator`. - -## Tests - -[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) - -Install NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`. - -To add new tests, create a new file named `test/test-.js` -and export your test functions with names that start with "test", for example - - exports["test doing the foo bar"] = function (assert, util) { - ... - }; - -The new test will be located automatically when you run the suite. - -The `util` argument is the test utility module located at `test/source-map/util`. - -The `assert` argument is a cut down version of node's assert module. You have -access to the following assertion functions: - -* `doesNotThrow` - -* `equal` - -* `ok` - -* `strictEqual` - -* `throws` - -(The reason for the restricted set of test functions is because we need the -tests to run inside Firefox's test suite as well and so the assert module is -shimmed in that environment. See `build/assert-shim.js`.) - -[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit -[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap -[Dryice]: https://github.com/mozilla/dryice diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js deleted file mode 100644 index daa1a62..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -define('test/source-map/assert', ['exports'], function (exports) { - - let do_throw = function (msg) { - throw new Error(msg); - }; - - exports.init = function (throw_fn) { - do_throw = throw_fn; - }; - - exports.doesNotThrow = function (fn) { - try { - fn(); - } - catch (e) { - do_throw(e.message); - } - }; - - exports.equal = function (actual, expected, msg) { - msg = msg || String(actual) + ' != ' + String(expected); - if (actual != expected) { - do_throw(msg); - } - }; - - exports.ok = function (val, msg) { - msg = msg || String(val) + ' is falsey'; - if (!Boolean(val)) { - do_throw(msg); - } - }; - - exports.strictEqual = function (actual, expected, msg) { - msg = msg || String(actual) + ' !== ' + String(expected); - if (actual !== expected) { - do_throw(msg); - } - }; - - exports.throws = function (fn) { - try { - fn(); - do_throw('Expected an error to be thrown, but it wasn\'t.'); - } - catch (e) { - } - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/mini-require.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/mini-require.js deleted file mode 100644 index 0daf453..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/mini-require.js +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * Define a module along with a payload. - * @param {string} moduleName Name for the payload - * @param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec - * @param {function} payload Function with (require, exports, module) params - */ -function define(moduleName, deps, payload) { - if (typeof moduleName != "string") { - throw new TypeError('Expected string, got: ' + moduleName); - } - - if (arguments.length == 2) { - payload = deps; - } - - if (moduleName in define.modules) { - throw new Error("Module already defined: " + moduleName); - } - define.modules[moduleName] = payload; -}; - -/** - * The global store of un-instantiated modules - */ -define.modules = {}; - - -/** - * We invoke require() in the context of a Domain so we can have multiple - * sets of modules running separate from each other. - * This contrasts with JSMs which are singletons, Domains allows us to - * optionally load a CommonJS module twice with separate data each time. - * Perhaps you want 2 command lines with a different set of commands in each, - * for example. - */ -function Domain() { - this.modules = {}; - this._currentModule = null; -} - -(function () { - - /** - * Lookup module names and resolve them by calling the definition function if - * needed. - * There are 2 ways to call this, either with an array of dependencies and a - * callback to call when the dependencies are found (which can happen - * asynchronously in an in-page context) or with a single string an no callback - * where the dependency is resolved synchronously and returned. - * The API is designed to be compatible with the CommonJS AMD spec and - * RequireJS. - * @param {string[]|string} deps A name, or names for the payload - * @param {function|undefined} callback Function to call when the dependencies - * are resolved - * @return {undefined|object} The module required or undefined for - * array/callback method - */ - Domain.prototype.require = function(deps, callback) { - if (Array.isArray(deps)) { - var params = deps.map(function(dep) { - return this.lookup(dep); - }, this); - if (callback) { - callback.apply(null, params); - } - return undefined; - } - else { - return this.lookup(deps); - } - }; - - function normalize(path) { - var bits = path.split('/'); - var i = 1; - while (i < bits.length) { - if (bits[i] === '..') { - bits.splice(i-1, 1); - } else if (bits[i] === '.') { - bits.splice(i, 1); - } else { - i++; - } - } - return bits.join('/'); - } - - function join(a, b) { - a = a.trim(); - b = b.trim(); - if (/^\//.test(b)) { - return b; - } else { - return a.replace(/\/*$/, '/') + b; - } - } - - function dirname(path) { - var bits = path.split('/'); - bits.pop(); - return bits.join('/'); - } - - /** - * Lookup module names and resolve them by calling the definition function if - * needed. - * @param {string} moduleName A name for the payload to lookup - * @return {object} The module specified by aModuleName or null if not found. - */ - Domain.prototype.lookup = function(moduleName) { - if (/^\./.test(moduleName)) { - moduleName = normalize(join(dirname(this._currentModule), moduleName)); - } - - if (moduleName in this.modules) { - var module = this.modules[moduleName]; - return module; - } - - if (!(moduleName in define.modules)) { - throw new Error("Module not defined: " + moduleName); - } - - var module = define.modules[moduleName]; - - if (typeof module == "function") { - var exports = {}; - var previousModule = this._currentModule; - this._currentModule = moduleName; - module(this.require.bind(this), exports, { id: moduleName, uri: "" }); - this._currentModule = previousModule; - module = exports; - } - - // cache the resulting module object for next time - this.modules[moduleName] = module; - - return module; - }; - -}()); - -define.Domain = Domain; -define.globalDomain = new Domain(); -var require = define.globalDomain.require.bind(define.globalDomain); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm deleted file mode 100644 index ee2539d..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm +++ /dev/null @@ -1,20 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/* - * WARNING! - * - * Do not edit this file directly, it is built from the sources at - * https://github.com/mozilla/source-map/ - */ - -/////////////////////////////////////////////////////////////////////////////// - - -this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; - -Components.utils.import('resource://gre/modules/devtools/Require.jsm'); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm deleted file mode 100644 index 80341d4..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm +++ /dev/null @@ -1,18 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/* - * WARNING! - * - * Do not edit this file directly, it is built from the sources at - * https://github.com/mozilla/source-map/ - */ - -Components.utils.import('resource://gre/modules/devtools/Require.jsm'); -Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm'); - -this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js deleted file mode 100644 index fb29ff5..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/////////////////////////////////////////////////////////////////////////////// - -this.sourceMap = { - SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer, - SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator, - SourceNode: require('source-map/source-node').SourceNode -}; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm deleted file mode 100644 index cf3c2d8..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm +++ /dev/null @@ -1,6 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/////////////////////////////////////////////////////////////////////////////// - -this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer; -this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator; -this.SourceNode = require('source-map/source-node').SourceNode; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm deleted file mode 100644 index b31b84c..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -function runSourceMapTests(modName, do_throw) { - let mod = require(modName); - let assert = require('test/source-map/assert'); - let util = require('test/source-map/util'); - - assert.init(do_throw); - - for (let k in mod) { - if (/^test/.test(k)) { - mod[k](assert, util); - } - } - -} -this.runSourceMapTests = runSourceMapTests; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js deleted file mode 100644 index 1b13f30..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * WARNING! - * - * Do not edit this file directly, it is built from the sources at - * https://github.com/mozilla/source-map/ - */ - -Components.utils.import('resource://test/Utils.jsm'); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js deleted file mode 100644 index bec2de3..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js +++ /dev/null @@ -1,3 +0,0 @@ -function run_test() { - runSourceMapTests('{THIS_MODULE}', do_throw); -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map.js deleted file mode 100644 index 121ad24..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./source-map/source-node').SourceNode; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js deleted file mode 100644 index 40f9a18..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js +++ /dev/null @@ -1,97 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var util = require('./util'); - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = {}; - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var isDuplicate = this.has(aStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - this._set[util.toSetString(aStr)] = idx; - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - return Object.prototype.hasOwnProperty.call(this._set, - util.toSetString(aStr)); - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (this.has(aStr)) { - return this._set[util.toSetString(aStr)]; - } - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js deleted file mode 100644 index 1b67bb3..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var base64 = require('./base64'); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string. - */ - exports.decode = function base64VLQ_decode(aStr) { - var i = 0; - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (i >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - digit = base64.decode(aStr.charAt(i++)); - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - return { - value: fromVLQSigned(result), - rest: aStr.slice(i) - }; - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js deleted file mode 100644 index 863cc46..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var charToIntMap = {}; - var intToCharMap = {}; - - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' - .split('') - .forEach(function (ch, index) { - charToIntMap[ch] = index; - intToCharMap[index] = ch; - }); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function base64_encode(aNumber) { - if (aNumber in intToCharMap) { - return intToCharMap[aNumber]; - } - throw new TypeError("Must be between 0 and 63: " + aNumber); - }; - - /** - * Decode a single base 64 digit to an integer. - */ - exports.decode = function base64_decode(aChar) { - if (aChar in charToIntMap) { - return charToIntMap[aChar]; - } - throw new TypeError("Not a valid base 64 digit: " + aChar); - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js deleted file mode 100644 index ff347c6..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the next - // closest element that is less than that element. - // - // 3. We did not find the exact element, and there is no next-closest - // element which is less than the one we are searching for, so we - // return null. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return aHaystack[mid]; - } - else if (cmp > 0) { - // aHaystack[mid] is greater than our needle. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare); - } - // We did not find an exact match, return the next closest one - // (termination case 2). - return aHaystack[mid]; - } - else { - // aHaystack[mid] is less than our needle. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare); - } - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (2) or (3) and return the appropriate thing. - return aLow < 0 - ? null - : aHaystack[aLow]; - } - } - - /** - * This is an implementation of binary search which will always try and return - * the next lowest value checked if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - */ - exports.search = function search(aNeedle, aHaystack, aCompare) { - return aHaystack.length > 0 - ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) - : null; - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js deleted file mode 100644 index 8f0d9fe..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js +++ /dev/null @@ -1,441 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var util = require('./util'); - var binarySearch = require('./binary-search'); - var ArraySet = require('./array-set').ArraySet; - var base64VLQ = require('./base64-vlq'); - - /** - * A SourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The only parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function SourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - var names = util.getArg(sourceMap, 'names'); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - if (version !== this._version) { - throw new Error('Unsupported version: ' + version); - } - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names, true); - this._sources = ArraySet.fromArray(sources, true); - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this.file = file; - - // `this._generatedMappings` and `this._originalMappings` hold the parsed - // mapping coordinates from the source map's "mappings" attribute. Each - // object in the array is of the form - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `this._generatedMappings` is ordered by the generated positions. - // - // `this._originalMappings` is ordered by the original positions. - this._generatedMappings = []; - this._originalMappings = []; - this._parseMappings(mappings, sourceRoot); - } - - /** - * Create a SourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @returns SourceMapConsumer - */ - SourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap) { - var smc = Object.create(SourceMapConsumer.prototype); - - smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - - smc._generatedMappings = aSourceMap._mappings.slice() - .sort(util.compareByGeneratedPositions); - smc._originalMappings = aSourceMap._mappings.slice() - .sort(util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(SourceMapConsumer.prototype, 'sources', { - get: function () { - return this._sources.toArray().map(function (s) { - return this.sourceRoot ? util.join(this.sourceRoot, s) : s; - }, this); - } - }); - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (an ordered list in this._generatedMappings). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var mappingSeparator = /^[,;]/; - var str = aStr; - var mapping; - var temp; - - while (str.length > 0) { - if (str.charAt(0) === ';') { - generatedLine++; - str = str.slice(1); - previousGeneratedColumn = 0; - } - else if (str.charAt(0) === ',') { - str = str.slice(1); - } - else { - mapping = {}; - mapping.generatedLine = generatedLine; - - // Generated column. - temp = base64VLQ.decode(str); - mapping.generatedColumn = previousGeneratedColumn + temp.value; - previousGeneratedColumn = mapping.generatedColumn; - str = temp.rest; - - if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { - // Original source. - temp = base64VLQ.decode(str); - mapping.source = this._sources.at(previousSource + temp.value); - previousSource += temp.value; - str = temp.rest; - if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { - throw new Error('Found a source, but no line and column'); - } - - // Original line. - temp = base64VLQ.decode(str); - mapping.originalLine = previousOriginalLine + temp.value; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - str = temp.rest; - if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { - throw new Error('Found a source and line, but no column'); - } - - // Original column. - temp = base64VLQ.decode(str); - mapping.originalColumn = previousOriginalColumn + temp.value; - previousOriginalColumn = mapping.originalColumn; - str = temp.rest; - - if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { - // Original name. - temp = base64VLQ.decode(str); - mapping.name = this._names.at(previousName + temp.value); - previousName += temp.value; - str = temp.rest; - } - } - - this._generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - this._originalMappings.push(mapping); - } - } - } - - this._originalMappings.sort(util.compareByOriginalPositions); - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - SourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator); - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. - * - column: The column number in the generated source. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. - * - column: The column number in the original source, or null. - * - name: The original identifier, or null. - */ - SourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var mapping = this._findMapping(needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositions); - - if (mapping) { - var source = util.getArg(mapping, 'source', null); - if (source && this.sourceRoot) { - source = util.join(this.sourceRoot, source); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: util.getArg(mapping, 'name', null) - }; - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * availible. - */ - SourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource) { - if (!this.sourcesContent) { - return null; - } - - if (this.sourceRoot) { - aSource = util.relative(this.sourceRoot, aSource); - } - - if (this._sources.has(aSource)) { - return this.sourcesContent[this._sources.indexOf(aSource)]; - } - - var url; - if (this.sourceRoot - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + aSource)) { - return this.sourcesContent[this._sources.indexOf("/" + aSource)]; - } - } - - throw new Error('"' + aSource + '" is not in the SourceMap.'); - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: The column number in the original source. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - SourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - if (this.sourceRoot) { - needle.source = util.relative(this.sourceRoot, needle.source); - } - - var mapping = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions); - - if (mapping) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null) - }; - } - - return { - line: null, - column: null - }; - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source; - if (source && sourceRoot) { - source = util.join(sourceRoot, source); - } - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name - }; - }).forEach(aCallback, context); - }; - - exports.SourceMapConsumer = SourceMapConsumer; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js deleted file mode 100644 index 48ead7d..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js +++ /dev/null @@ -1,380 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var base64VLQ = require('./base64-vlq'); - var util = require('./util'); - var ArraySet = require('./array-set').ArraySet; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. To create a new one, you must pass an object - * with the following properties: - * - * - file: The filename of the generated source. - * - sourceRoot: An optional root for all URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - this._file = util.getArg(aArgs, 'file'); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = []; - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source) { - newMapping.source = mapping.source; - if (sourceRoot) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - this._validateMapping(generated, original, source, name); - - if (source && !this._sources.has(source)) { - this._sources.add(source); - } - - if (name && !this._names.has(name)) { - this._names.add(name); - } - - this._mappings.push({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent !== null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = {}; - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) { - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (!aSourceFile) { - aSourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "aSourceFile" relative if an absolute Url is passed. - if (sourceRoot) { - aSourceFile = util.relative(sourceRoot, aSourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "aSourceFile" - this._mappings.forEach(function (mapping) { - if (mapping.source === aSourceFile && mapping.originalLine) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source !== null) { - // Copy mapping - if (sourceRoot) { - mapping.source = util.relative(sourceRoot, original.source); - } else { - mapping.source = original.source; - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name !== null && mapping.name !== null) { - // Only use the identifier name if it's an identifier - // in both SourceMaps - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - if (sourceRoot) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - orginal: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var mapping; - - // The mappings must be guaranteed to be in sorted order before we start - // serializing them or else the generated line numbers (which are defined - // via the ';' separators) will be all messed up. Note: it might be more - // performant to maintain the sorting as we insert them, rather than as we - // serialize them, but the big O is the same either way. - this._mappings.sort(util.compareByGeneratedPositions); - - for (var i = 0, len = this._mappings.length; i < len; i++) { - mapping = this._mappings[i]; - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - result += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) { - continue; - } - result += ','; - } - } - - result += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source) { - result += base64VLQ.encode(this._sources.indexOf(mapping.source) - - previousSource); - previousSource = this._sources.indexOf(mapping.source); - - // lines are stored 0-based in SourceMap spec version 3 - result += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - result += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name) { - result += base64VLQ.encode(this._names.indexOf(mapping.name) - - previousName); - previousName = this._names.indexOf(mapping.name); - } - } - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, - key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - file: this._file, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._sourceRoot) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js deleted file mode 100644 index 626cb65..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js +++ /dev/null @@ -1,371 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; - var util = require('./util'); - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine === undefined ? null : aLine; - this.column = aColumn === undefined ? null : aColumn; - this.source = aSource === undefined ? null : aSource; - this.name = aName === undefined ? null : aName; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // The generated code - // Processed fragments are removed from this array. - var remainingLines = aGeneratedCode.split('\n'); - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping === null) { - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(remainingLines.shift() + "\n"); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - } else { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - var code = ""; - // Associate full lines with "lastMapping" - do { - code += remainingLines.shift() + "\n"; - lastGeneratedLine++; - lastGeneratedColumn = 0; - } while (lastGeneratedLine < mapping.generatedLine); - // When we reached the correct line, we add code until we - // reach the correct column too. - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; - code += nextLine.substr(0, mapping.generatedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - // Create the SourceNode. - addMappingWithCode(lastMapping, code); - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[0]; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - } - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - // Associate the remaining code in the current line with "lastMapping" - // and add the remaining lines without any mapping - addMappingWithCode(lastMapping, remainingLines.join("\n")); - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - mapping.source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk instanceof SourceNode) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild instanceof SourceNode) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i] instanceof SourceNode) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - chunk.split('').forEach(function (ch) { - if (ch === '\n') { - generated.line++; - generated.column = 0; - } else { - generated.column++; - } - }); - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js deleted file mode 100644 index 87946d3..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js +++ /dev/null @@ -1,205 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/; - var dataUrlRegexp = /^data:.+\,.+/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[3], - host: match[4], - port: match[6], - path: match[7] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = aParsedUrl.scheme + "://"; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + "@" - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - function join(aRoot, aPath) { - var url; - - if (aPath.match(urlRegexp) || aPath.match(dataUrlRegexp)) { - return aPath; - } - - if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) { - url.path = aPath; - return urlGenerate(url); - } - - return aRoot.replace(/\/$/, '') + '/' + aPath; - } - exports.join = join; - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - return '$' + aStr; - } - exports.toSetString = toSetString; - - function fromSetString(aStr) { - return aStr.substr(1); - } - exports.fromSetString = fromSetString; - - function relative(aRoot, aPath) { - aRoot = aRoot.replace(/\/$/, ''); - - var url = urlParse(aRoot); - if (aPath.charAt(0) == "/" && url && url.path == "/") { - return aPath.slice(1); - } - - return aPath.indexOf(aRoot + '/') === 0 - ? aPath.substr(aRoot.length + 1) - : aPath; - } - exports.relative = relative; - - function strcmp(aStr1, aStr2) { - var s1 = aStr1 || ""; - var s2 = aStr2 || ""; - return (s1 > s2) - (s1 < s2); - } - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp; - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp || onlyCompareOriginal) { - return cmp; - } - - cmp = strcmp(mappingA.name, mappingB.name); - if (cmp) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp) { - return cmp; - } - - return mappingA.generatedColumn - mappingB.generatedColumn; - }; - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings where the generated positions are - * compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) { - var cmp; - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - }; - exports.compareByGeneratedPositions = compareByGeneratedPositions; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE deleted file mode 100644 index f33d665..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE +++ /dev/null @@ -1,58 +0,0 @@ -amdefine is released under two licenses: new BSD, and MIT. You may pick the -license that best suits your development needs. The text of both licenses are -provided below. - - -The "New" BSD License: ----------------------- - -Copyright (c) 2011, The Dojo Foundation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the Dojo Foundation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -MIT License ------------ - -Copyright (c) 2011, The Dojo Foundation - -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md deleted file mode 100644 index c6995c0..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# amdefine - -A module that can be used to implement AMD's define() in Node. This allows you -to code to the AMD API and have the module work in node programs without -requiring those other programs to use AMD. - -## Usage - -**1)** Update your package.json to indicate amdefine as a dependency: - -```javascript - "dependencies": { - "amdefine": ">=0.1.0" - } -``` - -Then run `npm install` to get amdefine into your project. - -**2)** At the top of each module that uses define(), place this code: - -```javascript -if (typeof define !== 'function') { var define = require('amdefine')(module) } -``` - -**Only use these snippets** when loading amdefine. If you preserve the basic structure, -with the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer). - -You can add spaces, line breaks and even require amdefine with a local path, but -keep the rest of the structure to get the stripping behavior. - -As you may know, because `if` statements in JavaScript don't have their own scope, the var -declaration in the above snippet is made whether the `if` expression is truthy or not. If -RequireJS is loaded then the declaration is superfluous because `define` is already already -declared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var` -declarations of the same variable in the same scope gracefully. - -If you want to deliver amdefine.js with your code rather than specifying it as a dependency -with npm, then just download the latest release and refer to it using a relative path: - -[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js) - -### amdefine/intercept - -Consider this very experimental. - -Instead of pasting the piece of text for the amdefine setup of a `define` -variable in each module you create or consume, you can use `amdefine/intercept` -instead. It will automatically insert the above snippet in each .js file loaded -by Node. - -**Warning**: you should only use this if you are creating an application that -is consuming AMD style defined()'d modules that are distributed via npm and want -to run that code in Node. - -For library code where you are not sure if it will be used by others in Node or -in the browser, then explicitly depending on amdefine and placing the code -snippet above is suggested path, instead of using `amdefine/intercept`. The -intercept module affects all .js files loaded in the Node app, and it is -inconsiderate to modify global state like that unless you are also controlling -the top level app. - -#### Why distribute AMD-style nodes via npm? - -npm has a lot of weaknesses for front-end use (installed layout is not great, -should have better support for the `baseUrl + moduleID + '.js' style of loading, -single file JS installs), but some people want a JS package manager and are -willing to live with those constraints. If that is you, but still want to author -in AMD style modules to get dynamic require([]), better direct source usage and -powerful loader plugin support in the browser, then this tool can help. - -#### amdefine/intercept usage - -Just require it in your top level app module (for example index.js, server.js): - -```javascript -require('amdefine/intercept'); -``` - -The module does not return a value, so no need to assign the result to a local -variable. - -Then just require() code as you normally would with Node's require(). Any .js -loaded after the intercept require will have the amdefine check injected in -the .js source as it is loaded. It does not modify the source on disk, just -prepends some content to the text of the module as it is loaded by Node. - -#### How amdefine/intercept works - -It overrides the `Module._extensions['.js']` in Node to automatically prepend -the amdefine snippet above. So, it will affect any .js file loaded by your -app. - -## define() usage - -It is best if you use the anonymous forms of define() in your module: - -```javascript -define(function (require) { - var dependency = require('dependency'); -}); -``` - -or - -```javascript -define(['dependency'], function (dependency) { - -}); -``` - -## RequireJS optimizer integration. - -Version 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html) -will have support for stripping the `if (typeof define !== 'function')` check -mentioned above, so you can include this snippet for code that runs in the -browser, but avoid taking the cost of the if() statement once the code is -optimized for deployment. - -## Node 0.4 Support - -If you want to support Node 0.4, then add `require` as the second parameter to amdefine: - -```javascript -//Only if you want Node 0.4. If using 0.5 or later, use the above snippet. -if (typeof define !== 'function') { var define = require('amdefine')(module, require) } -``` - -## Limitations - -### Synchronous vs Asynchronous - -amdefine creates a define() function that is callable by your code. It will -execute and trace dependencies and call the factory function *synchronously*, -to keep the behavior in line with Node's synchronous dependency tracing. - -The exception: calling AMD's callback-style require() from inside a factory -function. The require callback is called on process.nextTick(): - -```javascript -define(function (require) { - require(['a'], function(a) { - //'a' is loaded synchronously, but - //this callback is called on process.nextTick(). - }); -}); -``` - -### Loader Plugins - -Loader plugins are supported as long as they call their load() callbacks -synchronously. So ones that do network requests will not work. However plugins -like [text](http://requirejs.org/docs/api.html#text) can load text files locally. - -The plugin API's `load.fromText()` is **not supported** in amdefine, so this means -transpiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs) -will not work. This may be fixable, but it is a bit complex, and I do not have -enough node-fu to figure it out yet. See the source for amdefine.js if you want -to get an idea of the issues involved. - -## Tests - -To run the tests, cd to **tests** and run: - -``` -node all.js -node all-intercept.js -``` - -## License - -New BSD and MIT. Check the LICENSE file for all the details. diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js deleted file mode 100644 index 53bf5a6..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js +++ /dev/null @@ -1,299 +0,0 @@ -/** vim: et:ts=4:sw=4:sts=4 - * @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/amdefine for details - */ - -/*jslint node: true */ -/*global module, process */ -'use strict'; - -/** - * Creates a define for node. - * @param {Object} module the "module" object that is defined by Node for the - * current module. - * @param {Function} [requireFn]. Node's require function for the current module. - * It only needs to be passed in Node versions before 0.5, when module.require - * did not exist. - * @returns {Function} a define function that is usable for the current node - * module. - */ -function amdefine(module, requireFn) { - 'use strict'; - var defineCache = {}, - loaderCache = {}, - alreadyCalled = false, - path = require('path'), - makeRequire, stringRequire; - - /** - * Trims the . and .. from an array of path segments. - * It will keep a leading path segment if a .. will become - * the first path segment, to help with module name lookups, - * which act like paths, but can be remapped. But the end result, - * all paths that use this function should look normalized. - * NOTE: this method MODIFIES the input array. - * @param {Array} ary the array of path segments. - */ - function trimDots(ary) { - var i, part; - for (i = 0; ary[i]; i+= 1) { - part = ary[i]; - if (part === '.') { - ary.splice(i, 1); - i -= 1; - } else if (part === '..') { - if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { - //End of the line. Keep at least one non-dot - //path segment at the front so it can be mapped - //correctly to disk. Otherwise, there is likely - //no path mapping for a path starting with '..'. - //This can still fail, but catches the most reasonable - //uses of .. - break; - } else if (i > 0) { - ary.splice(i - 1, 2); - i -= 2; - } - } - } - } - - function normalize(name, baseName) { - var baseParts; - - //Adjust any relative paths. - if (name && name.charAt(0) === '.') { - //If have a base name, try to normalize against it, - //otherwise, assume it is a top-level require that will - //be relative to baseUrl in the end. - if (baseName) { - baseParts = baseName.split('/'); - baseParts = baseParts.slice(0, baseParts.length - 1); - baseParts = baseParts.concat(name.split('/')); - trimDots(baseParts); - name = baseParts.join('/'); - } - } - - return name; - } - - /** - * Create the normalize() function passed to a loader plugin's - * normalize method. - */ - function makeNormalize(relName) { - return function (name) { - return normalize(name, relName); - }; - } - - function makeLoad(id) { - function load(value) { - loaderCache[id] = value; - } - - load.fromText = function (id, text) { - //This one is difficult because the text can/probably uses - //define, and any relative paths and requires should be relative - //to that id was it would be found on disk. But this would require - //bootstrapping a module/require fairly deeply from node core. - //Not sure how best to go about that yet. - throw new Error('amdefine does not implement load.fromText'); - }; - - return load; - } - - makeRequire = function (systemRequire, exports, module, relId) { - function amdRequire(deps, callback) { - if (typeof deps === 'string') { - //Synchronous, single module require('') - return stringRequire(systemRequire, exports, module, deps, relId); - } else { - //Array of dependencies with a callback. - - //Convert the dependencies to modules. - deps = deps.map(function (depName) { - return stringRequire(systemRequire, exports, module, depName, relId); - }); - - //Wait for next tick to call back the require call. - process.nextTick(function () { - callback.apply(null, deps); - }); - } - } - - amdRequire.toUrl = function (filePath) { - if (filePath.indexOf('.') === 0) { - return normalize(filePath, path.dirname(module.filename)); - } else { - return filePath; - } - }; - - return amdRequire; - }; - - //Favor explicit value, passed in if the module wants to support Node 0.4. - requireFn = requireFn || function req() { - return module.require.apply(module, arguments); - }; - - function runFactory(id, deps, factory) { - var r, e, m, result; - - if (id) { - e = loaderCache[id] = {}; - m = { - id: id, - uri: __filename, - exports: e - }; - r = makeRequire(requireFn, e, m, id); - } else { - //Only support one define call per file - if (alreadyCalled) { - throw new Error('amdefine with no module ID cannot be called more than once per file.'); - } - alreadyCalled = true; - - //Use the real variables from node - //Use module.exports for exports, since - //the exports in here is amdefine exports. - e = module.exports; - m = module; - r = makeRequire(requireFn, e, m, module.id); - } - - //If there are dependencies, they are strings, so need - //to convert them to dependency values. - if (deps) { - deps = deps.map(function (depName) { - return r(depName); - }); - } - - //Call the factory with the right dependencies. - if (typeof factory === 'function') { - result = factory.apply(m.exports, deps); - } else { - result = factory; - } - - if (result !== undefined) { - m.exports = result; - if (id) { - loaderCache[id] = m.exports; - } - } - } - - stringRequire = function (systemRequire, exports, module, id, relId) { - //Split the ID by a ! so that - var index = id.indexOf('!'), - originalId = id, - prefix, plugin; - - if (index === -1) { - id = normalize(id, relId); - - //Straight module lookup. If it is one of the special dependencies, - //deal with it, otherwise, delegate to node. - if (id === 'require') { - return makeRequire(systemRequire, exports, module, relId); - } else if (id === 'exports') { - return exports; - } else if (id === 'module') { - return module; - } else if (loaderCache.hasOwnProperty(id)) { - return loaderCache[id]; - } else if (defineCache[id]) { - runFactory.apply(null, defineCache[id]); - return loaderCache[id]; - } else { - if(systemRequire) { - return systemRequire(originalId); - } else { - throw new Error('No module with ID: ' + id); - } - } - } else { - //There is a plugin in play. - prefix = id.substring(0, index); - id = id.substring(index + 1, id.length); - - plugin = stringRequire(systemRequire, exports, module, prefix, relId); - - if (plugin.normalize) { - id = plugin.normalize(id, makeNormalize(relId)); - } else { - //Normalize the ID normally. - id = normalize(id, relId); - } - - if (loaderCache[id]) { - return loaderCache[id]; - } else { - plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {}); - - return loaderCache[id]; - } - } - }; - - //Create a define function specific to the module asking for amdefine. - function define(id, deps, factory) { - if (Array.isArray(id)) { - factory = deps; - deps = id; - id = undefined; - } else if (typeof id !== 'string') { - factory = id; - id = deps = undefined; - } - - if (deps && !Array.isArray(deps)) { - factory = deps; - deps = undefined; - } - - if (!deps) { - deps = ['require', 'exports', 'module']; - } - - //Set up properties for this module. If an ID, then use - //internal cache. If no ID, then use the external variables - //for this node module. - if (id) { - //Put the module in deep freeze until there is a - //require call for it. - defineCache[id] = [id, deps, factory]; - } else { - runFactory(id, deps, factory); - } - } - - //define.require, which has access to all the values in the - //cache. Useful for AMD modules that all have IDs in the file, - //but need to finally export a value to node based on one of those - //IDs. - define.require = function (id) { - if (loaderCache[id]) { - return loaderCache[id]; - } - - if (defineCache[id]) { - runFactory.apply(null, defineCache[id]); - return loaderCache[id]; - } - }; - - define.amd = {}; - - return define; -} - -module.exports = amdefine; diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js deleted file mode 100644 index 771a983..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js +++ /dev/null @@ -1,36 +0,0 @@ -/*jshint node: true */ -var inserted, - Module = require('module'), - fs = require('fs'), - existingExtFn = Module._extensions['.js'], - amdefineRegExp = /amdefine\.js/; - -inserted = "if (typeof define !== 'function') {var define = require('amdefine')(module)}"; - -//From the node/lib/module.js source: -function stripBOM(content) { - // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - // because the buffer-to-string conversion in `fs.readFileSync()` - // translates it to FEFF, the UTF-16 BOM. - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -//Also adapted from the node/lib/module.js source: -function intercept(module, filename) { - var content = stripBOM(fs.readFileSync(filename, 'utf8')); - - if (!amdefineRegExp.test(module.id)) { - content = inserted + content; - } - - module._compile(content, filename); -} - -intercept._id = 'amdefine/intercept'; - -if (!existingExtFn._id || existingExtFn._id !== intercept._id) { - Module._extensions['.js'] = intercept; -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json deleted file mode 100644 index 8caf15c..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "amdefine", - "description": "Provide AMD's define() API for declaring modules in the AMD format", - "version": "0.1.0", - "homepage": "http://github.com/jrburke/amdefine", - "author": { - "name": "James Burke", - "email": "jrburke@gmail.com", - "url": "http://github.com/jrburke" - }, - "licenses": [ - { - "type": "BSD", - "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE" - }, - { - "type": "MIT", - "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/jrburke/amdefine.git" - }, - "main": "./amdefine.js", - "engines": { - "node": ">=0.4.2" - }, - "readme": "# amdefine\n\nA module that can be used to implement AMD's define() in Node. This allows you\nto code to the AMD API and have the module work in node programs without\nrequiring those other programs to use AMD.\n\n## Usage\n\n**1)** Update your package.json to indicate amdefine as a dependency:\n\n```javascript\n \"dependencies\": {\n \"amdefine\": \">=0.1.0\"\n }\n```\n\nThen run `npm install` to get amdefine into your project.\n\n**2)** At the top of each module that uses define(), place this code:\n\n```javascript\nif (typeof define !== 'function') { var define = require('amdefine')(module) }\n```\n\n**Only use these snippets** when loading amdefine. If you preserve the basic structure,\nwith the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).\n\nYou can add spaces, line breaks and even require amdefine with a local path, but\nkeep the rest of the structure to get the stripping behavior.\n\nAs you may know, because `if` statements in JavaScript don't have their own scope, the var\ndeclaration in the above snippet is made whether the `if` expression is truthy or not. If\nRequireJS is loaded then the declaration is superfluous because `define` is already already\ndeclared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`\ndeclarations of the same variable in the same scope gracefully.\n\nIf you want to deliver amdefine.js with your code rather than specifying it as a dependency\nwith npm, then just download the latest release and refer to it using a relative path:\n\n[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)\n\n### amdefine/intercept\n\nConsider this very experimental.\n\nInstead of pasting the piece of text for the amdefine setup of a `define`\nvariable in each module you create or consume, you can use `amdefine/intercept`\ninstead. It will automatically insert the above snippet in each .js file loaded\nby Node.\n\n**Warning**: you should only use this if you are creating an application that\nis consuming AMD style defined()'d modules that are distributed via npm and want\nto run that code in Node.\n\nFor library code where you are not sure if it will be used by others in Node or\nin the browser, then explicitly depending on amdefine and placing the code\nsnippet above is suggested path, instead of using `amdefine/intercept`. The\nintercept module affects all .js files loaded in the Node app, and it is\ninconsiderate to modify global state like that unless you are also controlling\nthe top level app.\n\n#### Why distribute AMD-style nodes via npm?\n\nnpm has a lot of weaknesses for front-end use (installed layout is not great,\nshould have better support for the `baseUrl + moduleID + '.js' style of loading,\nsingle file JS installs), but some people want a JS package manager and are\nwilling to live with those constraints. If that is you, but still want to author\nin AMD style modules to get dynamic require([]), better direct source usage and\npowerful loader plugin support in the browser, then this tool can help.\n\n#### amdefine/intercept usage\n\nJust require it in your top level app module (for example index.js, server.js):\n\n```javascript\nrequire('amdefine/intercept');\n```\n\nThe module does not return a value, so no need to assign the result to a local\nvariable.\n\nThen just require() code as you normally would with Node's require(). Any .js\nloaded after the intercept require will have the amdefine check injected in\nthe .js source as it is loaded. It does not modify the source on disk, just\nprepends some content to the text of the module as it is loaded by Node.\n\n#### How amdefine/intercept works\n\nIt overrides the `Module._extensions['.js']` in Node to automatically prepend\nthe amdefine snippet above. So, it will affect any .js file loaded by your\napp.\n\n## define() usage\n\nIt is best if you use the anonymous forms of define() in your module:\n\n```javascript\ndefine(function (require) {\n var dependency = require('dependency');\n});\n```\n\nor\n\n```javascript\ndefine(['dependency'], function (dependency) {\n\n});\n```\n\n## RequireJS optimizer integration. \n\nVersion 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)\nwill have support for stripping the `if (typeof define !== 'function')` check\nmentioned above, so you can include this snippet for code that runs in the\nbrowser, but avoid taking the cost of the if() statement once the code is\noptimized for deployment.\n\n## Node 0.4 Support\n\nIf you want to support Node 0.4, then add `require` as the second parameter to amdefine:\n\n```javascript\n//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.\nif (typeof define !== 'function') { var define = require('amdefine')(module, require) }\n```\n\n## Limitations\n\n### Synchronous vs Asynchronous\n\namdefine creates a define() function that is callable by your code. It will\nexecute and trace dependencies and call the factory function *synchronously*,\nto keep the behavior in line with Node's synchronous dependency tracing.\n\nThe exception: calling AMD's callback-style require() from inside a factory\nfunction. The require callback is called on process.nextTick():\n\n```javascript\ndefine(function (require) {\n require(['a'], function(a) {\n //'a' is loaded synchronously, but\n //this callback is called on process.nextTick().\n });\n});\n```\n\n### Loader Plugins\n\nLoader plugins are supported as long as they call their load() callbacks\nsynchronously. So ones that do network requests will not work. However plugins\nlike [text](http://requirejs.org/docs/api.html#text) can load text files locally.\n\nThe plugin API's `load.fromText()` is **not supported** in amdefine, so this means\ntranspiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)\nwill not work. This may be fixable, but it is a bit complex, and I do not have\nenough node-fu to figure it out yet. See the source for amdefine.js if you want\nto get an idea of the issues involved.\n\n## Tests\n\nTo run the tests, cd to **tests** and run:\n\n```\nnode all.js\nnode all-intercept.js\n```\n\n## License\n\nNew BSD and MIT. Check the LICENSE file for all the details.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/jrburke/amdefine/issues" - }, - "_id": "amdefine@0.1.0", - "_from": "amdefine@>=0.0.4" -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/package.json b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/package.json deleted file mode 100644 index 4477931..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "name": "source-map", - "description": "Generates and consumes source maps", - "version": "0.1.30", - "homepage": "https://github.com/mozilla/source-map", - "author": { - "name": "Nick Fitzgerald", - "email": "nfitzgerald@mozilla.com" - }, - "contributors": [ - { - "name": "Tobias Koppers", - "email": "tobias.koppers@googlemail.com" - }, - { - "name": "Duncan Beevers", - "email": "duncan@dweebd.com" - }, - { - "name": "Stephen Crane", - "email": "scrane@mozilla.com" - }, - { - "name": "Ryan Seddon", - "email": "seddon.ryan@gmail.com" - }, - { - "name": "Miles Elam", - "email": "miles.elam@deem.com" - }, - { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com" - }, - { - "name": "Michael Ficarra", - "email": "github.public.email@michael.ficarra.me" - }, - { - "name": "Todd Wolfson", - "email": "todd@twolfson.com" - }, - { - "name": "Alexander Solovyov", - "email": "alexander@solovyov.net" - }, - { - "name": "Felix Gnass", - "email": "fgnass@gmail.com" - }, - { - "name": "Conrad Irwin", - "email": "conrad.irwin@gmail.com" - }, - { - "name": "usrbincc", - "email": "usrbincc@yahoo.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Chase Douglas", - "email": "chase@newrelic.com" - }, - { - "name": "Evan Wallace", - "email": "evan.exe@gmail.com" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/mozilla/source-map.git" - }, - "directories": { - "lib": "./lib" - }, - "main": "./lib/source-map.js", - "engines": { - "node": ">=0.8.0" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://opensource.org/licenses/BSD-3-Clause" - } - ], - "dependencies": { - "amdefine": ">=0.0.4" - }, - "devDependencies": { - "dryice": ">=0.4.8" - }, - "scripts": { - "test": "node test/run-tests.js", - "build": "node Makefile.dryice.js" - }, - "readme": "# Source Map\n\nThis is a library to generate and consume the source map format\n[described here][format].\n\nThis library is written in the Asynchronous Module Definition format, and works\nin the following environments:\n\n* Modern Browsers supporting ECMAScript 5 (either after the build, or with an\n AMD loader such as RequireJS)\n\n* Inside Firefox (as a JSM file, after the build)\n\n* With NodeJS versions 0.8.X and higher\n\n## Node\n\n $ npm install source-map\n\n## Building from Source (for everywhere else)\n\nInstall Node and then run\n\n $ git clone https://fitzgen@github.com/mozilla/source-map.git\n $ cd source-map\n $ npm link .\n\nNext, run\n\n $ node Makefile.dryice.js\n\nThis should spew a bunch of stuff to stdout, and create the following files:\n\n* `dist/source-map.js` - The unminified browser version.\n\n* `dist/source-map.min.js` - The minified browser version.\n\n* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source.\n\n## Examples\n\n### Consuming a source map\n\n var rawSourceMap = {\n version: 3,\n file: 'min.js',\n names: ['bar', 'baz', 'n'],\n sources: ['one.js', 'two.js'],\n sourceRoot: 'http://example.com/www/js/',\n mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'\n };\n\n var smc = new SourceMapConsumer(rawSourceMap);\n\n console.log(smc.sources);\n // [ 'http://example.com/www/js/one.js',\n // 'http://example.com/www/js/two.js' ]\n\n console.log(smc.originalPositionFor({\n line: 2,\n column: 28\n }));\n // { source: 'http://example.com/www/js/two.js',\n // line: 2,\n // column: 10,\n // name: 'n' }\n\n console.log(smc.generatedPositionFor({\n source: 'http://example.com/www/js/two.js',\n line: 2,\n column: 10\n }));\n // { line: 2, column: 28 }\n\n smc.eachMapping(function (m) {\n // ...\n });\n\n### Generating a source map\n\nIn depth guide:\n[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)\n\n#### With SourceNode (high level API)\n\n function compile(ast) {\n switch (ast.type) {\n case 'BinaryExpression':\n return new SourceNode(\n ast.location.line,\n ast.location.column,\n ast.location.source,\n [compile(ast.left), \" + \", compile(ast.right)]\n );\n case 'Literal':\n return new SourceNode(\n ast.location.line,\n ast.location.column,\n ast.location.source,\n String(ast.value)\n );\n // ...\n default:\n throw new Error(\"Bad AST\");\n }\n }\n\n var ast = parse(\"40 + 2\", \"add.js\");\n console.log(compile(ast).toStringWithSourceMap({\n file: 'add.js'\n }));\n // { code: '40 + 2',\n // map: [object SourceMapGenerator] }\n\n#### With SourceMapGenerator (low level API)\n\n var map = new SourceMapGenerator({\n file: \"source-mapped.js\"\n });\n\n map.addMapping({\n generated: {\n line: 10,\n column: 35\n },\n source: \"foo.js\",\n original: {\n line: 33,\n column: 2\n },\n name: \"christopher\"\n });\n\n console.log(map.toString());\n // '{\"version\":3,\"file\":\"source-mapped.js\",\"sources\":[\"foo.js\"],\"names\":[\"christopher\"],\"mappings\":\";;;;;;;;;mCAgCEA\"}'\n\n## API\n\nGet a reference to the module:\n\n // NodeJS\n var sourceMap = require('source-map');\n\n // Browser builds\n var sourceMap = window.sourceMap;\n\n // Inside Firefox\n let sourceMap = {};\n Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);\n\n### SourceMapConsumer\n\nA SourceMapConsumer instance represents a parsed source map which we can query\nfor information about the original file positions by giving it a file position\nin the generated source.\n\n#### new SourceMapConsumer(rawSourceMap)\n\nThe only parameter is the raw source map (either as a string which can be\n`JSON.parse`'d, or an object). According to the spec, source maps have the\nfollowing attributes:\n\n* `version`: Which version of the source map spec this map is following.\n\n* `sources`: An array of URLs to the original source files.\n\n* `names`: An array of identifiers which can be referrenced by individual\n mappings.\n\n* `sourceRoot`: Optional. The URL root from which all sources are relative.\n\n* `sourcesContent`: Optional. An array of contents of the original source files.\n\n* `mappings`: A string of base64 VLQs which contain the actual mappings.\n\n* `file`: The generated filename this source map is associated with.\n\n#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)\n\nReturns the original source, line, and column information for the generated\nsource's line and column positions provided. The only argument is an object with\nthe following properties:\n\n* `line`: The line number in the generated source.\n\n* `column`: The column number in the generated source.\n\nand an object is returned with the following properties:\n\n* `source`: The original source file, or null if this information is not\n available.\n\n* `line`: The line number in the original source, or null if this information is\n not available.\n\n* `column`: The column number in the original source, or null or null if this\n information is not available.\n\n* `name`: The original identifier, or null if this information is not available.\n\n#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)\n\nReturns the generated line and column information for the original source,\nline, and column positions provided. The only argument is an object with\nthe following properties:\n\n* `source`: The filename of the original source.\n\n* `line`: The line number in the original source.\n\n* `column`: The column number in the original source.\n\nand an object is returned with the following properties:\n\n* `line`: The line number in the generated source, or null.\n\n* `column`: The column number in the generated source, or null.\n\n#### SourceMapConsumer.prototype.sourceContentFor(source)\n\nReturns the original source content for the source provided. The only\nargument is the URL of the original source file.\n\n#### SourceMapConsumer.prototype.eachMapping(callback, context, order)\n\nIterate over each mapping between an original source/line/column and a\ngenerated line/column in this source map.\n\n* `callback`: The function that is called with each mapping. Mappings have the\n form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,\n name }`\n\n* `context`: Optional. If specified, this object will be the value of `this`\n every time that `callback` is called.\n\n* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or\n `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over\n the mappings sorted by the generated file's line/column order or the\n original's source/line/column order, respectively. Defaults to\n `SourceMapConsumer.GENERATED_ORDER`.\n\n### SourceMapGenerator\n\nAn instance of the SourceMapGenerator represents a source map which is being\nbuilt incrementally.\n\n#### new SourceMapGenerator(startOfSourceMap)\n\nTo create a new one, you must pass an object with the following properties:\n\n* `file`: The filename of the generated source that this source map is\n associated with.\n\n* `sourceRoot`: An optional root for all relative URLs in this source map.\n\n#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)\n\nCreates a new SourceMapGenerator based on a SourceMapConsumer\n\n* `sourceMapConsumer` The SourceMap.\n\n#### SourceMapGenerator.prototype.addMapping(mapping)\n\nAdd a single mapping from original source line and column to the generated\nsource's line and column for this source map being created. The mapping object\nshould have the following properties:\n\n* `generated`: An object with the generated line and column positions.\n\n* `original`: An object with the original line and column positions.\n\n* `source`: The original source file (relative to the sourceRoot).\n\n* `name`: An optional original token name for this mapping.\n\n#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)\n\nSet the source content for an original source file.\n\n* `sourceFile` the URL of the original source file.\n\n* `sourceContent` the content of the source file.\n\n#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile])\n\nApplies a SourceMap for a source file to the SourceMap.\nEach mapping to the supplied source file is rewritten using the\nsupplied SourceMap. Note: The resolution for the resulting mappings\nis the minimium of this map and the supplied map.\n\n* `sourceMapConsumer`: The SourceMap to be applied.\n\n* `sourceFile`: Optional. The filename of the source file.\n If omitted, sourceMapConsumer.file will be used.\n\n#### SourceMapGenerator.prototype.toString()\n\nRenders the source map being generated to a string.\n\n### SourceNode\n\nSourceNodes provide a way to abstract over interpolating and/or concatenating\nsnippets of generated JavaScript source code, while maintaining the line and\ncolumn information associated between those snippets and the original source\ncode. This is useful as the final intermediate representation a compiler might\nuse before outputting the generated JS and source map.\n\n#### new SourceNode(line, column, source[, chunk[, name]])\n\n* `line`: The original line number associated with this source node, or null if\n it isn't associated with an original line.\n\n* `column`: The original column number associated with this source node, or null\n if it isn't associated with an original column.\n\n* `source`: The original source's filename.\n\n* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see\n below.\n\n* `name`: Optional. The original identifier.\n\n#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer)\n\nCreates a SourceNode from generated code and a SourceMapConsumer.\n\n* `code`: The generated code\n\n* `sourceMapConsumer` The SourceMap for the generated code\n\n#### SourceNode.prototype.add(chunk)\n\nAdd a chunk of generated JS to this source node.\n\n* `chunk`: A string snippet of generated JS code, another instance of\n `SourceNode`, or an array where each member is one of those things.\n\n#### SourceNode.prototype.prepend(chunk)\n\nPrepend a chunk of generated JS to this source node.\n\n* `chunk`: A string snippet of generated JS code, another instance of\n `SourceNode`, or an array where each member is one of those things.\n\n#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)\n\nSet the source content for a source file. This will be added to the\n`SourceMap` in the `sourcesContent` field.\n\n* `sourceFile`: The filename of the source file\n\n* `sourceContent`: The content of the source file\n\n#### SourceNode.prototype.walk(fn)\n\nWalk over the tree of JS snippets in this node and its children. The walking\nfunction is called once for each snippet of JS and is passed that snippet and\nthe its original associated source's line/column location.\n\n* `fn`: The traversal function.\n\n#### SourceNode.prototype.walkSourceContents(fn)\n\nWalk over the tree of SourceNodes. The walking function is called for each\nsource file content and is passed the filename and source content.\n\n* `fn`: The traversal function.\n\n#### SourceNode.prototype.join(sep)\n\nLike `Array.prototype.join` except for SourceNodes. Inserts the separator\nbetween each of this source node's children.\n\n* `sep`: The separator.\n\n#### SourceNode.prototype.replaceRight(pattern, replacement)\n\nCall `String.prototype.replace` on the very right-most source snippet. Useful\nfor trimming whitespace from the end of a source node, etc.\n\n* `pattern`: The pattern to replace.\n\n* `replacement`: The thing to replace the pattern with.\n\n#### SourceNode.prototype.toString()\n\nReturn the string representation of this source node. Walks over the tree and\nconcatenates all the various snippets together to one string.\n\n### SourceNode.prototype.toStringWithSourceMap(startOfSourceMap)\n\nReturns the string representation of this tree of source nodes, plus a\nSourceMapGenerator which contains all the mappings between the generated and\noriginal sources.\n\nThe arguments are the same as those to `new SourceMapGenerator`.\n\n## Tests\n\n[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map)\n\nInstall NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`.\n\nTo add new tests, create a new file named `test/test-.js`\nand export your test functions with names that start with \"test\", for example\n\n exports[\"test doing the foo bar\"] = function (assert, util) {\n ...\n };\n\nThe new test will be located automatically when you run the suite.\n\nThe `util` argument is the test utility module located at `test/source-map/util`.\n\nThe `assert` argument is a cut down version of node's assert module. You have\naccess to the following assertion functions:\n\n* `doesNotThrow`\n\n* `equal`\n\n* `ok`\n\n* `strictEqual`\n\n* `throws`\n\n(The reason for the restricted set of test functions is because we need the\ntests to run inside Firefox's test suite as well and so the assert module is\nshimmed in that environment. See `build/assert-shim.js`.)\n\n[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\n[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap\n[Dryice]: https://github.com/mozilla/dryice\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mozilla/source-map/issues" - }, - "_id": "source-map@0.1.30", - "_from": "source-map@~0.1.7" -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/run-tests.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/run-tests.js deleted file mode 100755 index 626c53f..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/run-tests.js +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env node -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); -var util = require('./source-map/util'); - -function run(tests) { - var failures = []; - var total = 0; - var passed = 0; - - for (var i = 0; i < tests.length; i++) { - for (var k in tests[i].testCase) { - if (/^test/.test(k)) { - total++; - try { - tests[i].testCase[k](assert, util); - passed++; - } - catch (e) { - console.log('FAILED ' + tests[i].name + ': ' + k + '!'); - console.log(e.stack); - } - } - } - } - - console.log(""); - console.log(passed + ' / ' + total + ' tests passed.'); - console.log(""); - - failures.forEach(function (f) { - }); - - return failures.length; -} - -var code; - -process.stdout.on('close', function () { - process.exit(code); -}); - -function isTestFile(f) { - var testToRun = process.argv[2]; - return testToRun - ? path.basename(testToRun) === f - : /^test\-.*?\.js/.test(f); -} - -function toModule(f) { - return './source-map/' + f.replace(/\.js$/, ''); -} - -var requires = fs.readdirSync(path.join(__dirname, 'source-map')) - .filter(isTestFile) - .map(toModule); - -code = run(requires.map(require).map(function (mod, i) { - return { - name: requires[i], - testCase: mod - }; -})); -process.exit(code); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js deleted file mode 100644 index 3801233..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2012 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var sourceMap; - try { - sourceMap = require('../../lib/source-map'); - } catch (e) { - sourceMap = {}; - Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); - } - - exports['test that the api is properly exposed in the top level'] = function (assert, util) { - assert.equal(typeof sourceMap.SourceMapGenerator, "function"); - assert.equal(typeof sourceMap.SourceMapConsumer, "function"); - assert.equal(typeof sourceMap.SourceNode, "function"); - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js deleted file mode 100644 index b5797ed..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var ArraySet = require('../../lib/source-map/array-set').ArraySet; - - function makeTestSet() { - var set = new ArraySet(); - for (var i = 0; i < 100; i++) { - set.add(String(i)); - } - return set; - } - - exports['test .has() membership'] = function (assert, util) { - var set = makeTestSet(); - for (var i = 0; i < 100; i++) { - assert.ok(set.has(String(i))); - } - }; - - exports['test .indexOf() elements'] = function (assert, util) { - var set = makeTestSet(); - for (var i = 0; i < 100; i++) { - assert.strictEqual(set.indexOf(String(i)), i); - } - }; - - exports['test .at() indexing'] = function (assert, util) { - var set = makeTestSet(); - for (var i = 0; i < 100; i++) { - assert.strictEqual(set.at(i), String(i)); - } - }; - - exports['test creating from an array'] = function (assert, util) { - var set = ArraySet.fromArray(['foo', 'bar', 'baz', 'quux', 'hasOwnProperty']); - - assert.ok(set.has('foo')); - assert.ok(set.has('bar')); - assert.ok(set.has('baz')); - assert.ok(set.has('quux')); - assert.ok(set.has('hasOwnProperty')); - - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.indexOf('bar'), 1); - assert.strictEqual(set.indexOf('baz'), 2); - assert.strictEqual(set.indexOf('quux'), 3); - - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.at(1), 'bar'); - assert.strictEqual(set.at(2), 'baz'); - assert.strictEqual(set.at(3), 'quux'); - }; - - exports['test that you can add __proto__; see github issue #30'] = function (assert, util) { - var set = new ArraySet(); - set.add('__proto__'); - assert.ok(set.has('__proto__')); - assert.strictEqual(set.at(0), '__proto__'); - assert.strictEqual(set.indexOf('__proto__'), 0); - }; - - exports['test .fromArray() with duplicates'] = function (assert, util) { - var set = ArraySet.fromArray(['foo', 'foo']); - assert.ok(set.has('foo')); - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.toArray().length, 1); - - set = ArraySet.fromArray(['foo', 'foo'], true); - assert.ok(set.has('foo')); - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.at(1), 'foo'); - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.toArray().length, 2); - }; - - exports['test .add() with duplicates'] = function (assert, util) { - var set = new ArraySet(); - set.add('foo'); - - set.add('foo'); - assert.ok(set.has('foo')); - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.toArray().length, 1); - - set.add('foo', true); - assert.ok(set.has('foo')); - assert.strictEqual(set.at(0), 'foo'); - assert.strictEqual(set.at(1), 'foo'); - assert.strictEqual(set.indexOf('foo'), 0); - assert.strictEqual(set.toArray().length, 2); - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js deleted file mode 100644 index 653a874..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var base64VLQ = require('../../lib/source-map/base64-vlq'); - - exports['test normal encoding and decoding'] = function (assert, util) { - var result; - for (var i = -255; i < 256; i++) { - result = base64VLQ.decode(base64VLQ.encode(i)); - assert.ok(result); - assert.equal(result.value, i); - assert.equal(result.rest, ""); - } - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js deleted file mode 100644 index ff3a244..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var base64 = require('../../lib/source-map/base64'); - - exports['test out of range encoding'] = function (assert, util) { - assert.throws(function () { - base64.encode(-1); - }); - assert.throws(function () { - base64.encode(64); - }); - }; - - exports['test out of range decoding'] = function (assert, util) { - assert.throws(function () { - base64.decode('='); - }); - }; - - exports['test normal encoding and decoding'] = function (assert, util) { - for (var i = 0; i < 64; i++) { - assert.equal(base64.decode(base64.encode(i)), i); - } - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js deleted file mode 100644 index ee30683..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var binarySearch = require('../../lib/source-map/binary-search'); - - function numberCompare(a, b) { - return a - b; - } - - exports['test too high'] = function (assert, util) { - var needle = 30; - var haystack = [2,4,6,8,10,12,14,16,18,20]; - - assert.doesNotThrow(function () { - binarySearch.search(needle, haystack, numberCompare); - }); - - assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); - }; - - exports['test too low'] = function (assert, util) { - var needle = 1; - var haystack = [2,4,6,8,10,12,14,16,18,20]; - - assert.doesNotThrow(function () { - binarySearch.search(needle, haystack, numberCompare); - }); - - assert.equal(binarySearch.search(needle, haystack, numberCompare), null); - }; - - exports['test exact search'] = function (assert, util) { - var needle = 4; - var haystack = [2,4,6,8,10,12,14,16,18,20]; - - assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); - }; - - exports['test fuzzy search'] = function (assert, util) { - var needle = 19; - var haystack = [2,4,6,8,10,12,14,16,18,20]; - - assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js deleted file mode 100644 index d831b92..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; - var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; - - exports['test eating our own dog food'] = function (assert, util) { - var smg = new SourceMapGenerator({ - file: 'testing.js', - sourceRoot: '/wu/tang' - }); - - smg.addMapping({ - source: 'gza.coffee', - original: { line: 1, column: 0 }, - generated: { line: 2, column: 2 } - }); - - smg.addMapping({ - source: 'gza.coffee', - original: { line: 2, column: 0 }, - generated: { line: 3, column: 2 } - }); - - smg.addMapping({ - source: 'gza.coffee', - original: { line: 3, column: 0 }, - generated: { line: 4, column: 2 } - }); - - smg.addMapping({ - source: 'gza.coffee', - original: { line: 4, column: 0 }, - generated: { line: 5, column: 2 } - }); - - var smc = new SourceMapConsumer(smg.toString()); - - // Exact - util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 0, null, smc, assert); - util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 0, null, smc, assert); - util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 0, null, smc, assert); - util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 0, null, smc, assert); - - // Fuzzy - - // Original to generated - util.assertMapping(2, 0, null, null, null, null, smc, assert, true); - util.assertMapping(2, 9, '/wu/tang/gza.coffee', 1, 0, null, smc, assert, true); - util.assertMapping(3, 0, '/wu/tang/gza.coffee', 1, 0, null, smc, assert, true); - util.assertMapping(3, 9, '/wu/tang/gza.coffee', 2, 0, null, smc, assert, true); - util.assertMapping(4, 0, '/wu/tang/gza.coffee', 2, 0, null, smc, assert, true); - util.assertMapping(4, 9, '/wu/tang/gza.coffee', 3, 0, null, smc, assert, true); - util.assertMapping(5, 0, '/wu/tang/gza.coffee', 3, 0, null, smc, assert, true); - util.assertMapping(5, 9, '/wu/tang/gza.coffee', 4, 0, null, smc, assert, true); - - // Generated to original - util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 1, null, smc, assert, null, true); - util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 3, null, smc, assert, null, true); - util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 6, null, smc, assert, null, true); - util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 9, null, smc, assert, null, true); - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js deleted file mode 100644 index f2c65a7..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js +++ /dev/null @@ -1,451 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; - var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; - - exports['test that we can instantiate with a string or an objects'] = function (assert, util) { - assert.doesNotThrow(function () { - var map = new SourceMapConsumer(util.testMap); - }); - assert.doesNotThrow(function () { - var map = new SourceMapConsumer(JSON.stringify(util.testMap)); - }); - }; - - exports['test that the `sources` field has the original sources'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var sources = map.sources; - - assert.equal(sources[0], '/the/root/one.js'); - assert.equal(sources[1], '/the/root/two.js'); - assert.equal(sources.length, 2); - }; - - exports['test that the source root is reflected in a mapping\'s source field'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var mapping; - - mapping = map.originalPositionFor({ - line: 2, - column: 1 - }); - assert.equal(mapping.source, '/the/root/two.js'); - - mapping = map.originalPositionFor({ - line: 1, - column: 1 - }); - assert.equal(mapping.source, '/the/root/one.js'); - }; - - exports['test mapping tokens back exactly'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - - util.assertMapping(1, 1, '/the/root/one.js', 1, 1, null, map, assert); - util.assertMapping(1, 5, '/the/root/one.js', 1, 5, null, map, assert); - util.assertMapping(1, 9, '/the/root/one.js', 1, 11, null, map, assert); - util.assertMapping(1, 18, '/the/root/one.js', 1, 21, 'bar', map, assert); - util.assertMapping(1, 21, '/the/root/one.js', 2, 3, null, map, assert); - util.assertMapping(1, 28, '/the/root/one.js', 2, 10, 'baz', map, assert); - util.assertMapping(1, 32, '/the/root/one.js', 2, 14, 'bar', map, assert); - - util.assertMapping(2, 1, '/the/root/two.js', 1, 1, null, map, assert); - util.assertMapping(2, 5, '/the/root/two.js', 1, 5, null, map, assert); - util.assertMapping(2, 9, '/the/root/two.js', 1, 11, null, map, assert); - util.assertMapping(2, 18, '/the/root/two.js', 1, 21, 'n', map, assert); - util.assertMapping(2, 21, '/the/root/two.js', 2, 3, null, map, assert); - util.assertMapping(2, 28, '/the/root/two.js', 2, 10, 'n', map, assert); - }; - - exports['test mapping tokens fuzzy'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - - // Finding original positions - util.assertMapping(1, 20, '/the/root/one.js', 1, 21, 'bar', map, assert, true); - util.assertMapping(1, 30, '/the/root/one.js', 2, 10, 'baz', map, assert, true); - util.assertMapping(2, 12, '/the/root/two.js', 1, 11, null, map, assert, true); - - // Finding generated positions - util.assertMapping(1, 18, '/the/root/one.js', 1, 22, 'bar', map, assert, null, true); - util.assertMapping(1, 28, '/the/root/one.js', 2, 13, 'baz', map, assert, null, true); - util.assertMapping(2, 9, '/the/root/two.js', 1, 16, null, map, assert, null, true); - }; - - exports['test creating source map consumers with )]}\' prefix'] = function (assert, util) { - assert.doesNotThrow(function () { - var map = new SourceMapConsumer(")]}'" + JSON.stringify(util.testMap)); - }); - }; - - exports['test eachMapping'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var previousLine = -Infinity; - var previousColumn = -Infinity; - map.eachMapping(function (mapping) { - assert.ok(mapping.generatedLine >= previousLine); - - if (mapping.source) { - assert.equal(mapping.source.indexOf(util.testMap.sourceRoot), 0); - } - - if (mapping.generatedLine === previousLine) { - assert.ok(mapping.generatedColumn >= previousColumn); - previousColumn = mapping.generatedColumn; - } - else { - previousLine = mapping.generatedLine; - previousColumn = -Infinity; - } - }); - }; - - exports['test iterating over mappings in a different order'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var previousLine = -Infinity; - var previousColumn = -Infinity; - var previousSource = ""; - map.eachMapping(function (mapping) { - assert.ok(mapping.source >= previousSource); - - if (mapping.source === previousSource) { - assert.ok(mapping.originalLine >= previousLine); - - if (mapping.originalLine === previousLine) { - assert.ok(mapping.originalColumn >= previousColumn); - previousColumn = mapping.originalColumn; - } - else { - previousLine = mapping.originalLine; - previousColumn = -Infinity; - } - } - else { - previousSource = mapping.source; - previousLine = -Infinity; - previousColumn = -Infinity; - } - }, null, SourceMapConsumer.ORIGINAL_ORDER); - }; - - exports['test that we can set the context for `this` in eachMapping'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMap); - var context = {}; - map.eachMapping(function () { - assert.equal(this, context); - }, context); - }; - - exports['test that the `sourcesContent` field has the original sources'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMapWithSourcesContent); - var sourcesContent = map.sourcesContent; - - assert.equal(sourcesContent[0], ' ONE.foo = function (bar) {\n return baz(bar);\n };'); - assert.equal(sourcesContent[1], ' TWO.inc = function (n) {\n return n + 1;\n };'); - assert.equal(sourcesContent.length, 2); - }; - - exports['test that we can get the original sources for the sources'] = function (assert, util) { - var map = new SourceMapConsumer(util.testMapWithSourcesContent); - var sources = map.sources; - - assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); - assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };'); - assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); - assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };'); - assert.throws(function () { - map.sourceContentFor(""); - }, Error); - assert.throws(function () { - map.sourceContentFor("/the/root/three.js"); - }, Error); - assert.throws(function () { - map.sourceContentFor("three.js"); - }, Error); - }; - - exports['test sourceRoot + generatedPositionFor'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'foo/bar', - file: 'baz.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'bang.coffee' - }); - map.addMapping({ - original: { line: 5, column: 5 }, - generated: { line: 6, column: 6 }, - source: 'bang.coffee' - }); - map = new SourceMapConsumer(map.toString()); - - // Should handle without sourceRoot. - var pos = map.generatedPositionFor({ - line: 1, - column: 1, - source: 'bang.coffee' - }); - - assert.equal(pos.line, 2); - assert.equal(pos.column, 2); - - // Should handle with sourceRoot. - var pos = map.generatedPositionFor({ - line: 1, - column: 1, - source: 'foo/bar/bang.coffee' - }); - - assert.equal(pos.line, 2); - assert.equal(pos.column, 2); - }; - - exports['test sourceRoot + originalPositionFor'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'foo/bar', - file: 'baz.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'bang.coffee' - }); - map = new SourceMapConsumer(map.toString()); - - var pos = map.originalPositionFor({ - line: 2, - column: 2, - }); - - // Should always have the prepended source root - assert.equal(pos.source, 'foo/bar/bang.coffee'); - assert.equal(pos.line, 1); - assert.equal(pos.column, 1); - }; - - exports['test github issue #56'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'http://', - file: 'www.example.com/foo.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'www.example.com/original.js' - }); - map = new SourceMapConsumer(map.toString()); - - var sources = map.sources; - assert.equal(sources.length, 1); - assert.equal(sources[0], 'http://www.example.com/original.js'); - }; - - exports['test github issue #43'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'http://example.com', - file: 'foo.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'http://cdn.example.com/original.js' - }); - map = new SourceMapConsumer(map.toString()); - - var sources = map.sources; - assert.equal(sources.length, 1, - 'Should only be one source.'); - assert.equal(sources[0], 'http://cdn.example.com/original.js', - 'Should not be joined with the sourceRoot.'); - }; - - exports['test absolute path, but same host sources'] = function (assert, util) { - var map = new SourceMapGenerator({ - sourceRoot: 'http://example.com/foo/bar', - file: 'foo.js' - }); - map.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: '/original.js' - }); - map = new SourceMapConsumer(map.toString()); - - var sources = map.sources; - assert.equal(sources.length, 1, - 'Should only be one source.'); - assert.equal(sources[0], 'http://example.com/original.js', - 'Source should be relative the host of the source root.'); - }; - - exports['test github issue #64'] = function (assert, util) { - var map = new SourceMapConsumer({ - "version": 3, - "file": "foo.js", - "sourceRoot": "http://example.com/", - "sources": ["/a"], - "names": [], - "mappings": "AACA", - "sourcesContent": ["foo"] - }); - - assert.equal(map.sourceContentFor("a"), "foo"); - assert.equal(map.sourceContentFor("/a"), "foo"); - }; - - exports['test bug 885597'] = function (assert, util) { - var map = new SourceMapConsumer({ - "version": 3, - "file": "foo.js", - "sourceRoot": "file:///Users/AlGore/Invented/The/Internet/", - "sources": ["/a"], - "names": [], - "mappings": "AACA", - "sourcesContent": ["foo"] - }); - - var s = map.sources[0]; - assert.equal(map.sourceContentFor(s), "foo"); - }; - - exports['test github issue #72, duplicate sources'] = function (assert, util) { - var map = new SourceMapConsumer({ - "version": 3, - "file": "foo.js", - "sources": ["source1.js", "source1.js", "source3.js"], - "names": [], - "mappings": ";EAAC;;IAEE;;MEEE", - "sourceRoot": "http://example.com" - }); - - var pos = map.originalPositionFor({ - line: 2, - column: 2 - }); - assert.equal(pos.source, 'http://example.com/source1.js'); - assert.equal(pos.line, 1); - assert.equal(pos.column, 1); - - var pos = map.originalPositionFor({ - line: 4, - column: 4 - }); - assert.equal(pos.source, 'http://example.com/source1.js'); - assert.equal(pos.line, 3); - assert.equal(pos.column, 3); - - var pos = map.originalPositionFor({ - line: 6, - column: 6 - }); - assert.equal(pos.source, 'http://example.com/source3.js'); - assert.equal(pos.line, 5); - assert.equal(pos.column, 5); - }; - - exports['test github issue #72, duplicate names'] = function (assert, util) { - var map = new SourceMapConsumer({ - "version": 3, - "file": "foo.js", - "sources": ["source.js"], - "names": ["name1", "name1", "name3"], - "mappings": ";EAACA;;IAEEA;;MAEEE", - "sourceRoot": "http://example.com" - }); - - var pos = map.originalPositionFor({ - line: 2, - column: 2 - }); - assert.equal(pos.name, 'name1'); - assert.equal(pos.line, 1); - assert.equal(pos.column, 1); - - var pos = map.originalPositionFor({ - line: 4, - column: 4 - }); - assert.equal(pos.name, 'name1'); - assert.equal(pos.line, 3); - assert.equal(pos.column, 3); - - var pos = map.originalPositionFor({ - line: 6, - column: 6 - }); - assert.equal(pos.name, 'name3'); - assert.equal(pos.line, 5); - assert.equal(pos.column, 5); - }; - - exports['test SourceMapConsumer.fromSourceMap'] = function (assert, util) { - var smg = new SourceMapGenerator({ - sourceRoot: 'http://example.com/', - file: 'foo.js' - }); - smg.addMapping({ - original: { line: 1, column: 1 }, - generated: { line: 2, column: 2 }, - source: 'bar.js' - }); - smg.addMapping({ - original: { line: 2, column: 2 }, - generated: { line: 4, column: 4 }, - source: 'baz.js', - name: 'dirtMcGirt' - }); - smg.setSourceContent('baz.js', 'baz.js content'); - - var smc = SourceMapConsumer.fromSourceMap(smg); - assert.equal(smc.file, 'foo.js'); - assert.equal(smc.sourceRoot, 'http://example.com/'); - assert.equal(smc.sources.length, 2); - assert.equal(smc.sources[0], 'http://example.com/bar.js'); - assert.equal(smc.sources[1], 'http://example.com/baz.js'); - assert.equal(smc.sourceContentFor('baz.js'), 'baz.js content'); - - var pos = smc.originalPositionFor({ - line: 2, - column: 2 - }); - assert.equal(pos.line, 1); - assert.equal(pos.column, 1); - assert.equal(pos.source, 'http://example.com/bar.js'); - assert.equal(pos.name, null); - - pos = smc.generatedPositionFor({ - line: 1, - column: 1, - source: 'http://example.com/bar.js' - }); - assert.equal(pos.line, 2); - assert.equal(pos.column, 2); - - pos = smc.originalPositionFor({ - line: 4, - column: 4 - }); - assert.equal(pos.line, 2); - assert.equal(pos.column, 2); - assert.equal(pos.source, 'http://example.com/baz.js'); - assert.equal(pos.name, 'dirtMcGirt'); - - pos = smc.generatedPositionFor({ - line: 2, - column: 2, - source: 'http://example.com/baz.js' - }); - assert.equal(pos.line, 4); - assert.equal(pos.column, 4); - }; -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js deleted file mode 100644 index ba292f5..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js +++ /dev/null @@ -1,417 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; - var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; - var SourceNode = require('../../lib/source-map/source-node').SourceNode; - var util = require('./util'); - - exports['test some simple stuff'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'foo.js', - sourceRoot: '.' - }); - assert.ok(true); - }; - - exports['test JSON serialization'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'foo.js', - sourceRoot: '.' - }); - assert.equal(map.toString(), JSON.stringify(map)); - }; - - exports['test adding mappings (case 1)'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.' - }); - - assert.doesNotThrow(function () { - map.addMapping({ - generated: { line: 1, column: 1 } - }); - }); - }; - - exports['test adding mappings (case 2)'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.' - }); - - assert.doesNotThrow(function () { - map.addMapping({ - generated: { line: 1, column: 1 }, - source: 'bar.js', - original: { line: 1, column: 1 } - }); - }); - }; - - exports['test adding mappings (case 3)'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.' - }); - - assert.doesNotThrow(function () { - map.addMapping({ - generated: { line: 1, column: 1 }, - source: 'bar.js', - original: { line: 1, column: 1 }, - name: 'someToken' - }); - }); - }; - - exports['test adding mappings (invalid)'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'generated-foo.js', - sourceRoot: '.' - }); - - // Not enough info. - assert.throws(function () { - map.addMapping({}); - }); - - // Original file position, but no source. - assert.throws(function () { - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 1, column: 1 } - }); - }); - }; - - exports['test that the correct mappings are being generated'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'min.js', - sourceRoot: '/the/root' - }); - - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 1, column: 1 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 1, column: 5 }, - original: { line: 1, column: 5 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 1, column: 9 }, - original: { line: 1, column: 11 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 1, column: 18 }, - original: { line: 1, column: 21 }, - source: 'one.js', - name: 'bar' - }); - map.addMapping({ - generated: { line: 1, column: 21 }, - original: { line: 2, column: 3 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 1, column: 28 }, - original: { line: 2, column: 10 }, - source: 'one.js', - name: 'baz' - }); - map.addMapping({ - generated: { line: 1, column: 32 }, - original: { line: 2, column: 14 }, - source: 'one.js', - name: 'bar' - }); - - map.addMapping({ - generated: { line: 2, column: 1 }, - original: { line: 1, column: 1 }, - source: 'two.js' - }); - map.addMapping({ - generated: { line: 2, column: 5 }, - original: { line: 1, column: 5 }, - source: 'two.js' - }); - map.addMapping({ - generated: { line: 2, column: 9 }, - original: { line: 1, column: 11 }, - source: 'two.js' - }); - map.addMapping({ - generated: { line: 2, column: 18 }, - original: { line: 1, column: 21 }, - source: 'two.js', - name: 'n' - }); - map.addMapping({ - generated: { line: 2, column: 21 }, - original: { line: 2, column: 3 }, - source: 'two.js' - }); - map.addMapping({ - generated: { line: 2, column: 28 }, - original: { line: 2, column: 10 }, - source: 'two.js', - name: 'n' - }); - - map = JSON.parse(map.toString()); - - util.assertEqualMaps(assert, map, util.testMap); - }; - - exports['test that source content can be set'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'min.js', - sourceRoot: '/the/root' - }); - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 1, column: 1 }, - source: 'one.js' - }); - map.addMapping({ - generated: { line: 2, column: 1 }, - original: { line: 1, column: 1 }, - source: 'two.js' - }); - map.setSourceContent('one.js', 'one file content'); - - map = JSON.parse(map.toString()); - assert.equal(map.sources[0], 'one.js'); - assert.equal(map.sources[1], 'two.js'); - assert.equal(map.sourcesContent[0], 'one file content'); - assert.equal(map.sourcesContent[1], null); - }; - - exports['test .fromSourceMap'] = function (assert, util) { - var map = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(util.testMap)); - util.assertEqualMaps(assert, map.toJSON(), util.testMap); - }; - - exports['test .fromSourceMap with sourcesContent'] = function (assert, util) { - var map = SourceMapGenerator.fromSourceMap( - new SourceMapConsumer(util.testMapWithSourcesContent)); - util.assertEqualMaps(assert, map.toJSON(), util.testMapWithSourcesContent); - }; - - exports['test applySourceMap'] = function (assert, util) { - var node = new SourceNode(null, null, null, [ - new SourceNode(2, 0, 'fileX', 'lineX2\n'), - 'genA1\n', - new SourceNode(2, 0, 'fileY', 'lineY2\n'), - 'genA2\n', - new SourceNode(1, 0, 'fileX', 'lineX1\n'), - 'genA3\n', - new SourceNode(1, 0, 'fileY', 'lineY1\n') - ]); - var mapStep1 = node.toStringWithSourceMap({ - file: 'fileA' - }).map; - mapStep1.setSourceContent('fileX', 'lineX1\nlineX2\n'); - mapStep1 = mapStep1.toJSON(); - - node = new SourceNode(null, null, null, [ - 'gen1\n', - new SourceNode(1, 0, 'fileA', 'lineA1\n'), - new SourceNode(2, 0, 'fileA', 'lineA2\n'), - new SourceNode(3, 0, 'fileA', 'lineA3\n'), - new SourceNode(4, 0, 'fileA', 'lineA4\n'), - new SourceNode(1, 0, 'fileB', 'lineB1\n'), - new SourceNode(2, 0, 'fileB', 'lineB2\n'), - 'gen2\n' - ]); - var mapStep2 = node.toStringWithSourceMap({ - file: 'fileGen' - }).map; - mapStep2.setSourceContent('fileB', 'lineB1\nlineB2\n'); - mapStep2 = mapStep2.toJSON(); - - node = new SourceNode(null, null, null, [ - 'gen1\n', - new SourceNode(2, 0, 'fileX', 'lineA1\n'), - new SourceNode(2, 0, 'fileA', 'lineA2\n'), - new SourceNode(2, 0, 'fileY', 'lineA3\n'), - new SourceNode(4, 0, 'fileA', 'lineA4\n'), - new SourceNode(1, 0, 'fileB', 'lineB1\n'), - new SourceNode(2, 0, 'fileB', 'lineB2\n'), - 'gen2\n' - ]); - var expectedMap = node.toStringWithSourceMap({ - file: 'fileGen' - }).map; - expectedMap.setSourceContent('fileX', 'lineX1\nlineX2\n'); - expectedMap.setSourceContent('fileB', 'lineB1\nlineB2\n'); - expectedMap = expectedMap.toJSON(); - - // apply source map "mapStep1" to "mapStep2" - var generator = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(mapStep2)); - generator.applySourceMap(new SourceMapConsumer(mapStep1)); - var actualMap = generator.toJSON(); - - util.assertEqualMaps(assert, actualMap, expectedMap); - }; - - exports['test sorting with duplicate generated mappings'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'test.js' - }); - map.addMapping({ - generated: { line: 3, column: 0 }, - original: { line: 2, column: 0 }, - source: 'a.js' - }); - map.addMapping({ - generated: { line: 2, column: 0 } - }); - map.addMapping({ - generated: { line: 2, column: 0 } - }); - map.addMapping({ - generated: { line: 1, column: 0 }, - original: { line: 1, column: 0 }, - source: 'a.js' - }); - - util.assertEqualMaps(assert, map.toJSON(), { - version: 3, - file: 'test.js', - sources: ['a.js'], - names: [], - mappings: 'AAAA;A;AACA' - }); - }; - - exports['test ignore duplicate mappings.'] = function (assert, util) { - var init = { file: 'min.js', sourceRoot: '/the/root' }; - var map1, map2; - - // null original source location - var nullMapping1 = { - generated: { line: 1, column: 0 } - }; - var nullMapping2 = { - generated: { line: 2, column: 2 } - }; - - map1 = new SourceMapGenerator(init); - map2 = new SourceMapGenerator(init); - - map1.addMapping(nullMapping1); - map1.addMapping(nullMapping1); - - map2.addMapping(nullMapping1); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - map1.addMapping(nullMapping2); - map1.addMapping(nullMapping1); - - map2.addMapping(nullMapping2); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - // original source location - var srcMapping1 = { - generated: { line: 1, column: 0 }, - original: { line: 11, column: 0 }, - source: 'srcMapping1.js' - }; - var srcMapping2 = { - generated: { line: 2, column: 2 }, - original: { line: 11, column: 0 }, - source: 'srcMapping2.js' - }; - - map1 = new SourceMapGenerator(init); - map2 = new SourceMapGenerator(init); - - map1.addMapping(srcMapping1); - map1.addMapping(srcMapping1); - - map2.addMapping(srcMapping1); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - map1.addMapping(srcMapping2); - map1.addMapping(srcMapping1); - - map2.addMapping(srcMapping2); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - // full original source and name information - var fullMapping1 = { - generated: { line: 1, column: 0 }, - original: { line: 11, column: 0 }, - source: 'fullMapping1.js', - name: 'fullMapping1' - }; - var fullMapping2 = { - generated: { line: 2, column: 2 }, - original: { line: 11, column: 0 }, - source: 'fullMapping2.js', - name: 'fullMapping2' - }; - - map1 = new SourceMapGenerator(init); - map2 = new SourceMapGenerator(init); - - map1.addMapping(fullMapping1); - map1.addMapping(fullMapping1); - - map2.addMapping(fullMapping1); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - - map1.addMapping(fullMapping2); - map1.addMapping(fullMapping1); - - map2.addMapping(fullMapping2); - - util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON()); - }; - - exports['test github issue #72, check for duplicate names or sources'] = function (assert, util) { - var map = new SourceMapGenerator({ - file: 'test.js' - }); - map.addMapping({ - generated: { line: 1, column: 1 }, - original: { line: 2, column: 2 }, - source: 'a.js', - name: 'foo' - }); - map.addMapping({ - generated: { line: 3, column: 3 }, - original: { line: 4, column: 4 }, - source: 'a.js', - name: 'foo' - }); - util.assertEqualMaps(assert, map.toJSON(), { - version: 3, - file: 'test.js', - sources: ['a.js'], - names: ['foo'], - mappings: 'CACEA;;GAEEA' - }); - }; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js deleted file mode 100644 index 6e0eca8..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js +++ /dev/null @@ -1,365 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator; - var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer; - var SourceNode = require('../../lib/source-map/source-node').SourceNode; - - exports['test .add()'] = function (assert, util) { - var node = new SourceNode(null, null, null); - - // Adding a string works. - node.add('function noop() {}'); - - // Adding another source node works. - node.add(new SourceNode(null, null, null)); - - // Adding an array works. - node.add(['function foo() {', - new SourceNode(null, null, null, - 'return 10;'), - '}']); - - // Adding other stuff doesn't. - assert.throws(function () { - node.add({}); - }); - assert.throws(function () { - node.add(function () {}); - }); - }; - - exports['test .prepend()'] = function (assert, util) { - var node = new SourceNode(null, null, null); - - // Prepending a string works. - node.prepend('function noop() {}'); - assert.equal(node.children[0], 'function noop() {}'); - assert.equal(node.children.length, 1); - - // Prepending another source node works. - node.prepend(new SourceNode(null, null, null)); - assert.equal(node.children[0], ''); - assert.equal(node.children[1], 'function noop() {}'); - assert.equal(node.children.length, 2); - - // Prepending an array works. - node.prepend(['function foo() {', - new SourceNode(null, null, null, - 'return 10;'), - '}']); - assert.equal(node.children[0], 'function foo() {'); - assert.equal(node.children[1], 'return 10;'); - assert.equal(node.children[2], '}'); - assert.equal(node.children[3], ''); - assert.equal(node.children[4], 'function noop() {}'); - assert.equal(node.children.length, 5); - - // Prepending other stuff doesn't. - assert.throws(function () { - node.prepend({}); - }); - assert.throws(function () { - node.prepend(function () {}); - }); - }; - - exports['test .toString()'] = function (assert, util) { - assert.equal((new SourceNode(null, null, null, - ['function foo() {', - new SourceNode(null, null, null, 'return 10;'), - '}'])).toString(), - 'function foo() {return 10;}'); - }; - - exports['test .join()'] = function (assert, util) { - assert.equal((new SourceNode(null, null, null, - ['a', 'b', 'c', 'd'])).join(', ').toString(), - 'a, b, c, d'); - }; - - exports['test .walk()'] = function (assert, util) { - var node = new SourceNode(null, null, null, - ['(function () {\n', - ' ', new SourceNode(1, 0, 'a.js', ['someCall()']), ';\n', - ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n', - '}());']); - var expected = [ - { str: '(function () {\n', source: null, line: null, column: null }, - { str: ' ', source: null, line: null, column: null }, - { str: 'someCall()', source: 'a.js', line: 1, column: 0 }, - { str: ';\n', source: null, line: null, column: null }, - { str: ' ', source: null, line: null, column: null }, - { str: 'if (foo) bar()', source: 'b.js', line: 2, column: 0 }, - { str: ';\n', source: null, line: null, column: null }, - { str: '}());', source: null, line: null, column: null }, - ]; - var i = 0; - node.walk(function (chunk, loc) { - assert.equal(expected[i].str, chunk); - assert.equal(expected[i].source, loc.source); - assert.equal(expected[i].line, loc.line); - assert.equal(expected[i].column, loc.column); - i++; - }); - }; - - exports['test .replaceRight'] = function (assert, util) { - var node; - - // Not nested - node = new SourceNode(null, null, null, 'hello world'); - node.replaceRight(/world/, 'universe'); - assert.equal(node.toString(), 'hello universe'); - - // Nested - node = new SourceNode(null, null, null, - [new SourceNode(null, null, null, 'hey sexy mama, '), - new SourceNode(null, null, null, 'want to kill all humans?')]); - node.replaceRight(/kill all humans/, 'watch Futurama'); - assert.equal(node.toString(), 'hey sexy mama, want to watch Futurama?'); - }; - - exports['test .toStringWithSourceMap()'] = function (assert, util) { - var node = new SourceNode(null, null, null, - ['(function () {\n', - ' ', - new SourceNode(1, 0, 'a.js', 'someCall', 'originalCall'), - new SourceNode(1, 8, 'a.js', '()'), - ';\n', - ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n', - '}());']); - var map = node.toStringWithSourceMap({ - file: 'foo.js' - }).map; - - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = new SourceMapConsumer(map.toString()); - - var actual; - - actual = map.originalPositionFor({ - line: 1, - column: 4 - }); - assert.equal(actual.source, null); - assert.equal(actual.line, null); - assert.equal(actual.column, null); - - actual = map.originalPositionFor({ - line: 2, - column: 2 - }); - assert.equal(actual.source, 'a.js'); - assert.equal(actual.line, 1); - assert.equal(actual.column, 0); - assert.equal(actual.name, 'originalCall'); - - actual = map.originalPositionFor({ - line: 3, - column: 2 - }); - assert.equal(actual.source, 'b.js'); - assert.equal(actual.line, 2); - assert.equal(actual.column, 0); - - actual = map.originalPositionFor({ - line: 3, - column: 16 - }); - assert.equal(actual.source, null); - assert.equal(actual.line, null); - assert.equal(actual.column, null); - - actual = map.originalPositionFor({ - line: 4, - column: 2 - }); - assert.equal(actual.source, null); - assert.equal(actual.line, null); - assert.equal(actual.column, null); - }; - - exports['test .fromStringWithSourceMap()'] = function (assert, util) { - var node = SourceNode.fromStringWithSourceMap( - util.testGeneratedCode, - new SourceMapConsumer(util.testMap)); - - var result = node.toStringWithSourceMap({ - file: 'min.js' - }); - var map = result.map; - var code = result.code; - - assert.equal(code, util.testGeneratedCode); - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = map.toJSON(); - assert.equal(map.version, util.testMap.version); - assert.equal(map.file, util.testMap.file); - assert.equal(map.mappings, util.testMap.mappings); - }; - - exports['test .fromStringWithSourceMap() empty map'] = function (assert, util) { - var node = SourceNode.fromStringWithSourceMap( - util.testGeneratedCode, - new SourceMapConsumer(util.emptyMap)); - var result = node.toStringWithSourceMap({ - file: 'min.js' - }); - var map = result.map; - var code = result.code; - - assert.equal(code, util.testGeneratedCode); - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = map.toJSON(); - assert.equal(map.version, util.emptyMap.version); - assert.equal(map.file, util.emptyMap.file); - assert.equal(map.mappings.length, util.emptyMap.mappings.length); - assert.equal(map.mappings, util.emptyMap.mappings); - }; - - exports['test .fromStringWithSourceMap() complex version'] = function (assert, util) { - var input = new SourceNode(null, null, null, [ - "(function() {\n", - " var Test = {};\n", - " ", new SourceNode(1, 0, "a.js", "Test.A = { value: 1234 };\n"), - " ", new SourceNode(2, 0, "a.js", "Test.A.x = 'xyz';"), "\n", - "}());\n", - "/* Generated Source */"]); - input = input.toStringWithSourceMap({ - file: 'foo.js' - }); - - var node = SourceNode.fromStringWithSourceMap( - input.code, - new SourceMapConsumer(input.map.toString())); - - var result = node.toStringWithSourceMap({ - file: 'foo.js' - }); - var map = result.map; - var code = result.code; - - assert.equal(code, input.code); - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = map.toJSON(); - var inputMap = input.map.toJSON(); - util.assertEqualMaps(assert, map, inputMap); - }; - - exports['test .fromStringWithSourceMap() merging duplicate mappings'] = function (assert, util) { - var input = new SourceNode(null, null, null, [ - new SourceNode(1, 0, "a.js", "(function"), - new SourceNode(1, 0, "a.js", "() {\n"), - " ", - new SourceNode(1, 0, "a.js", "var Test = "), - new SourceNode(1, 0, "b.js", "{};\n"), - new SourceNode(2, 0, "b.js", "Test"), - new SourceNode(2, 0, "b.js", ".A", "A"), - new SourceNode(2, 20, "b.js", " = { value: 1234 };\n", "A"), - "}());\n", - "/* Generated Source */" - ]); - input = input.toStringWithSourceMap({ - file: 'foo.js' - }); - - var correctMap = new SourceMapGenerator({ - file: 'foo.js' - }); - correctMap.addMapping({ - generated: { line: 1, column: 0 }, - source: 'a.js', - original: { line: 1, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 2, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 2, column: 2 }, - source: 'a.js', - original: { line: 1, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 2, column: 13 }, - source: 'b.js', - original: { line: 1, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 3, column: 0 }, - source: 'b.js', - original: { line: 2, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 3, column: 4 }, - source: 'b.js', - name: 'A', - original: { line: 2, column: 0 } - }); - correctMap.addMapping({ - generated: { line: 3, column: 6 }, - source: 'b.js', - name: 'A', - original: { line: 2, column: 20 } - }); - correctMap.addMapping({ - generated: { line: 4, column: 0 } - }); - - var inputMap = input.map.toJSON(); - correctMap = correctMap.toJSON(); - util.assertEqualMaps(assert, correctMap, inputMap); - }; - - exports['test setSourceContent with toStringWithSourceMap'] = function (assert, util) { - var aNode = new SourceNode(1, 1, 'a.js', 'a'); - aNode.setSourceContent('a.js', 'someContent'); - var node = new SourceNode(null, null, null, - ['(function () {\n', - ' ', aNode, - ' ', new SourceNode(1, 1, 'b.js', 'b'), - '}());']); - node.setSourceContent('b.js', 'otherContent'); - var map = node.toStringWithSourceMap({ - file: 'foo.js' - }).map; - - assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator'); - map = new SourceMapConsumer(map.toString()); - - assert.equal(map.sources.length, 2); - assert.equal(map.sources[0], 'a.js'); - assert.equal(map.sources[1], 'b.js'); - assert.equal(map.sourcesContent.length, 2); - assert.equal(map.sourcesContent[0], 'someContent'); - assert.equal(map.sourcesContent[1], 'otherContent'); - }; - - exports['test walkSourceContents'] = function (assert, util) { - var aNode = new SourceNode(1, 1, 'a.js', 'a'); - aNode.setSourceContent('a.js', 'someContent'); - var node = new SourceNode(null, null, null, - ['(function () {\n', - ' ', aNode, - ' ', new SourceNode(1, 1, 'b.js', 'b'), - '}());']); - node.setSourceContent('b.js', 'otherContent'); - var results = []; - node.walkSourceContents(function (sourceFile, sourceContent) { - results.push([sourceFile, sourceContent]); - }); - assert.equal(results.length, 2); - assert.equal(results[0][0], 'a.js'); - assert.equal(results[0][1], 'someContent'); - assert.equal(results[1][0], 'b.js'); - assert.equal(results[1][1], 'otherContent'); - }; -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js deleted file mode 100644 index 288046b..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js +++ /dev/null @@ -1,161 +0,0 @@ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -if (typeof define !== 'function') { - var define = require('amdefine')(module, require); -} -define(function (require, exports, module) { - - var util = require('../../lib/source-map/util'); - - // This is a test mapping which maps functions from two different files - // (one.js and two.js) to a minified generated source. - // - // Here is one.js: - // - // ONE.foo = function (bar) { - // return baz(bar); - // }; - // - // Here is two.js: - // - // TWO.inc = function (n) { - // return n + 1; - // }; - // - // And here is the generated code (min.js): - // - // ONE.foo=function(a){return baz(a);}; - // TWO.inc=function(a){return a+1;}; - exports.testGeneratedCode = " ONE.foo=function(a){return baz(a);};\n"+ - " TWO.inc=function(a){return a+1;};"; - exports.testMap = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: '/the/root', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' - }; - exports.testMapWithSourcesContent = { - version: 3, - file: 'min.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourcesContent: [ - ' ONE.foo = function (bar) {\n' + - ' return baz(bar);\n' + - ' };', - ' TWO.inc = function (n) {\n' + - ' return n + 1;\n' + - ' };' - ], - sourceRoot: '/the/root', - mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' - }; - exports.emptyMap = { - version: 3, - file: 'min.js', - names: [], - sources: [], - mappings: '' - }; - - - function assertMapping(generatedLine, generatedColumn, originalSource, - originalLine, originalColumn, name, map, assert, - dontTestGenerated, dontTestOriginal) { - if (!dontTestOriginal) { - var origMapping = map.originalPositionFor({ - line: generatedLine, - column: generatedColumn - }); - assert.equal(origMapping.name, name, - 'Incorrect name, expected ' + JSON.stringify(name) - + ', got ' + JSON.stringify(origMapping.name)); - assert.equal(origMapping.line, originalLine, - 'Incorrect line, expected ' + JSON.stringify(originalLine) - + ', got ' + JSON.stringify(origMapping.line)); - assert.equal(origMapping.column, originalColumn, - 'Incorrect column, expected ' + JSON.stringify(originalColumn) - + ', got ' + JSON.stringify(origMapping.column)); - - var expectedSource; - - if (originalSource && map.sourceRoot && originalSource.indexOf(map.sourceRoot) === 0) { - expectedSource = originalSource; - } else if (originalSource) { - expectedSource = map.sourceRoot - ? util.join(map.sourceRoot, originalSource) - : originalSource; - } else { - expectedSource = null; - } - - assert.equal(origMapping.source, expectedSource, - 'Incorrect source, expected ' + JSON.stringify(expectedSource) - + ', got ' + JSON.stringify(origMapping.source)); - } - - if (!dontTestGenerated) { - var genMapping = map.generatedPositionFor({ - source: originalSource, - line: originalLine, - column: originalColumn - }); - assert.equal(genMapping.line, generatedLine, - 'Incorrect line, expected ' + JSON.stringify(generatedLine) - + ', got ' + JSON.stringify(genMapping.line)); - assert.equal(genMapping.column, generatedColumn, - 'Incorrect column, expected ' + JSON.stringify(generatedColumn) - + ', got ' + JSON.stringify(genMapping.column)); - } - } - exports.assertMapping = assertMapping; - - function assertEqualMaps(assert, actualMap, expectedMap) { - assert.equal(actualMap.version, expectedMap.version, "version mismatch"); - assert.equal(actualMap.file, expectedMap.file, "file mismatch"); - assert.equal(actualMap.names.length, - expectedMap.names.length, - "names length mismatch: " + - actualMap.names.join(", ") + " != " + expectedMap.names.join(", ")); - for (var i = 0; i < actualMap.names.length; i++) { - assert.equal(actualMap.names[i], - expectedMap.names[i], - "names[" + i + "] mismatch: " + - actualMap.names.join(", ") + " != " + expectedMap.names.join(", ")); - } - assert.equal(actualMap.sources.length, - expectedMap.sources.length, - "sources length mismatch: " + - actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", ")); - for (var i = 0; i < actualMap.sources.length; i++) { - assert.equal(actualMap.sources[i], - expectedMap.sources[i], - "sources[" + i + "] length mismatch: " + - actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", ")); - } - assert.equal(actualMap.sourceRoot, - expectedMap.sourceRoot, - "sourceRoot mismatch: " + - actualMap.sourceRoot + " != " + expectedMap.sourceRoot); - assert.equal(actualMap.mappings, expectedMap.mappings, - "mappings mismatch:\nActual: " + actualMap.mappings + "\nExpected: " + expectedMap.mappings); - if (actualMap.sourcesContent) { - assert.equal(actualMap.sourcesContent.length, - expectedMap.sourcesContent.length, - "sourcesContent length mismatch"); - for (var i = 0; i < actualMap.sourcesContent.length; i++) { - assert.equal(actualMap.sourcesContent[i], - expectedMap.sourcesContent[i], - "sourcesContent[" + i + "] mismatch"); - } - } - } - exports.assertEqualMaps = assertEqualMaps; - -}); diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/.npmignore b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/.npmignore deleted file mode 100644 index 3e56974..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz -pids -logs -results -npm-debug.log -node_modules -/test/output.js diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/.travis.yml b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/.travis.yml deleted file mode 100644 index 9a61f6b..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/LICENSE b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/LICENSE deleted file mode 100644 index dfb0b19..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Forbes Lindesay - -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/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/README.md b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/README.md deleted file mode 100644 index 99685da..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# uglify-to-browserify - -A transform to make UglifyJS work in browserify. - -[![Build Status](https://travis-ci.org/ForbesLindesay/uglify-to-browserify.png?branch=master)](https://travis-ci.org/ForbesLindesay/uglify-to-browserify) -[![Dependency Status](https://gemnasium.com/ForbesLindesay/uglify-to-browserify.png)](https://gemnasium.com/ForbesLindesay/uglify-to-browserify) -[![NPM version](https://badge.fury.io/js/uglify-to-browserify.png)](http://badge.fury.io/js/uglify-to-browserify) - -## Installation - - npm install uglify-to-browserify - -## License - - MIT \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/index.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/index.js deleted file mode 100644 index 11cb627..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict' - -var fs = require('fs') -var PassThrough = require('stream').PassThrough -var Transform = require('stream').Transform - -if (typeof Transform === 'undefined') { - throw new Error('UglifyJS only supports browserify when using node >= 0.10.x') -} - -var cache = {} -module.exports = transform -function transform(file) { - if (!/tools\/node\.js$/.test(file.replace(/\\/g,'/'))) return new PassThrough(); - if (cache[file]) return makeStream(cache[file]) - var uglify = require(file) - var src = 'var sys = require("util");\nvar MOZ_SourceMap = require("source-map");\nvar UglifyJS = exports;\n' + uglify.FILES.map(function (path) { return fs.readFileSync(path, 'utf8') }).join('\n') - - var ast = uglify.parse(src) - ast.figure_out_scope() - - var variables = ast.variables - .map(function (node, name) { - return name - }) - - src += '\n\n' + variables.map(function (v) { return 'exports.' + v + ' = ' + v + ';' }).join('\n') + '\n\n' - - src += 'exports.AST_Node.warn_function = function (txt) { if (typeof console != "undefined" && typeof console.warn === "function") console.warn(txt) }\n\n' - - src += 'exports.minify = ' + uglify.minify.toString() + ';\n\n' - src += 'exports.describe_ast = ' + uglify.describe_ast.toString() + ';' - - cache[file] = src - return makeStream(src); -} - -function makeStream(src) { - var res = new Transform(); - res._transform = function (chunk, encoding, callback) { callback() } - res._flush = function (callback) { - res.push(src) - callback() - } - return res; -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/package.json b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/package.json deleted file mode 100644 index 803cec8..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "uglify-to-browserify", - "version": "1.0.1", - "description": "A transform to make UglifyJS work in browserify.", - "keywords": [], - "dependencies": {}, - "devDependencies": { - "uglify-js": "~2.4.0", - "source-map": "~0.1.27" - }, - "scripts": { - "test": "node test/index.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/ForbesLindesay/uglify-to-browserify.git" - }, - "author": { - "name": "ForbesLindesay" - }, - "license": "MIT", - "readme": "# uglify-to-browserify\r\n\r\nA transform to make UglifyJS work in browserify.\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/uglify-to-browserify.png?branch=master)](https://travis-ci.org/ForbesLindesay/uglify-to-browserify)\r\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/uglify-to-browserify.png)](https://gemnasium.com/ForbesLindesay/uglify-to-browserify)\r\n[![NPM version](https://badge.fury.io/js/uglify-to-browserify.png)](http://badge.fury.io/js/uglify-to-browserify)\r\n\r\n## Installation\r\n\r\n npm install uglify-to-browserify\r\n\r\n## License\r\n\r\n MIT", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/ForbesLindesay/uglify-to-browserify/issues" - }, - "_id": "uglify-to-browserify@1.0.1", - "dist": { - "shasum": "7e977b388edca6d77e667939b1956d180bcdfc8e" - }, - "_from": "uglify-to-browserify@~1.0.0", - "_resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.1.tgz" -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/test/index.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/test/index.js deleted file mode 100644 index 4117894..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/uglify-to-browserify/test/index.js +++ /dev/null @@ -1,22 +0,0 @@ -var fs = require('fs') -var br = require('../') -var test = fs.readFileSync(require.resolve('uglify-js/test/run-tests.js'), 'utf8') - .replace(/^#.*\n/, '') - -var transform = br(require.resolve('uglify-js')) -transform.pipe(fs.createWriteStream(__dirname + '/output.js')) - .on('close', function () { - Function('module,require', test)({ - filename: require.resolve('uglify-js/test/run-tests.js') - }, - function (name) { - if (name === '../tools/node') { - return require('./output.js') - } else if (/^[a-z]+$/.test(name)) { - return require(name) - } else { - throw new Error('I didn\'t expect you to require ' + name) - } - }) - }) -transform.end(fs.readFileSync(require.resolve('uglify-js'), 'utf8')) \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/package.json b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/package.json deleted file mode 100644 index 4c78775..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "uglify-js", - "description": "JavaScript parser, mangler/compressor and beautifier toolkit", - "homepage": "http://lisperator.net/uglifyjs", - "main": "tools/node.js", - "version": "2.4.0", - "engines": { - "node": ">=0.4.0" - }, - "maintainers": [ - { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com", - "url": "http://lisperator.net/" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/mishoo/UglifyJS2.git" - }, - "dependencies": { - "async": "~0.2.6", - "source-map": "~0.1.7", - "optimist": "~0.3.5", - "uglify-to-browserify": "~1.0.0" - }, - "browserify": { - "transform": [ - "uglify-to-browserify" - ] - }, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "scripts": { - "test": "node test/run-tests.js" - }, - "readme": "UglifyJS 2\n==========\n[![Build Status](https://travis-ci.org/mishoo/UglifyJS2.png)](https://travis-ci.org/mishoo/UglifyJS2)\n\nUglifyJS is a JavaScript parser, minifier, compressor or beautifier toolkit.\n\nThis page documents the command line utility. For\n[API and internals documentation see my website](http://lisperator.net/uglifyjs/).\nThere's also an\n[in-browser online demo](http://lisperator.net/uglifyjs/#demo) (for Firefox,\nChrome and probably Safari).\n\nInstall\n-------\n\nFirst make sure you have installed the latest version of [node.js](http://nodejs.org/)\n(You may need to restart your computer after this step).\n\nFrom NPM for use as a command line app:\n\n npm install uglify-js -g\n\nFrom NPM for programmatic use:\n\n npm install uglify-js\n\nFrom Git:\n\n git clone git://github.com/mishoo/UglifyJS2.git\n cd UglifyJS2\n npm link .\n\nUsage\n-----\n\n uglifyjs [input files] [options]\n\nUglifyJS2 can take multiple input files. It's recommended that you pass the\ninput files first, then pass the options. UglifyJS will parse input files\nin sequence and apply any compression options. The files are parsed in the\nsame global scope, that is, a reference from a file to some\nvariable/function declared in another file will be matched properly.\n\nIf you want to read from STDIN instead, pass a single dash instead of input\nfiles.\n\nThe available options are:\n\n```\n --source-map Specify an output file where to generate source map.\n [string]\n --source-map-root The path to the original source to be included in the\n source map. [string]\n --source-map-url The path to the source map to be added in //#\n sourceMappingURL. Defaults to the value passed with\n --source-map. [string]\n --in-source-map Input source map, useful if you're compressing JS that was\n generated from some other original code.\n --screw-ie8 Pass this flag if you don't care about full compliance\n with Internet Explorer 6-8 quirks (by default UglifyJS\n will try to be IE-proof). [boolean]\n --expr Parse a single expression, rather than a program (for\n parsing JSON) [boolean]\n -p, --prefix Skip prefix for original filenames that appear in source\n maps. For example -p 3 will drop 3 directories from file\n names and ensure they are relative paths. You can also\n specify -p relative, which will make UglifyJS figure out\n itself the relative paths between original sources, the\n source map and the output file. [string]\n -o, --output Output file (default STDOUT).\n -b, --beautify Beautify output/specify output options. [string]\n -m, --mangle Mangle names/pass mangler options. [string]\n -r, --reserved Reserved names to exclude from mangling.\n -c, --compress Enable compressor/pass compressor options. Pass options\n like -c hoist_vars=false,if_return=false. Use -c with no\n argument to use the default compression options. [string]\n -d, --define Global definitions [string]\n -e, --enclose Embed everything in a big function, with a configurable\n parameter/argument list. [string]\n --comments Preserve copyright comments in the output. By default this\n works like Google Closure, keeping JSDoc-style comments\n that contain \"@license\" or \"@preserve\". You can optionally\n pass one of the following arguments to this flag:\n - \"all\" to keep all comments\n - a valid JS regexp (needs to start with a slash) to keep\n only comments that match.\n Note that currently not *all* comments can be kept when\n compression is on, because of dead code removal or\n cascading statements into sequences. [string]\n --stats Display operations run time on STDERR. [boolean]\n --acorn Use Acorn for parsing. [boolean]\n --spidermonkey Assume input files are SpiderMonkey AST format (as JSON).\n [boolean]\n --self Build itself (UglifyJS2) as a library (implies\n --wrap=UglifyJS --export-all) [boolean]\n --wrap Embed everything in a big function, making the “exports”\n and “global” variables available. You need to pass an\n argument to this option to specify the name that your\n module will take when included in, say, a browser.\n [string]\n --export-all Only used when --wrap, this tells UglifyJS to add code to\n automatically export all globals. [boolean]\n --lint Display some scope warnings [boolean]\n -v, --verbose Verbose [boolean]\n -V, --version Print version number and exit. [boolean]\n```\n\nSpecify `--output` (`-o`) to declare the output file. Otherwise the output\ngoes to STDOUT.\n\n## Source map options\n\nUglifyJS2 can generate a source map file, which is highly useful for\ndebugging your compressed JavaScript. To get a source map, pass\n`--source-map output.js.map` (full path to the file where you want the\nsource map dumped).\n\nAdditionally you might need `--source-map-root` to pass the URL where the\noriginal files can be found. In case you are passing full paths to input\nfiles to UglifyJS, you can use `--prefix` (`-p`) to specify the number of\ndirectories to drop from the path prefix when declaring files in the source\nmap.\n\nFor example:\n\n uglifyjs /home/doe/work/foo/src/js/file1.js \\\n /home/doe/work/foo/src/js/file2.js \\\n -o foo.min.js \\\n --source-map foo.min.js.map \\\n --source-map-root http://foo.com/src \\\n -p 5 -c -m\n\nThe above will compress and mangle `file1.js` and `file2.js`, will drop the\noutput in `foo.min.js` and the source map in `foo.min.js.map`. The source\nmapping will refer to `http://foo.com/src/js/file1.js` and\n`http://foo.com/src/js/file2.js` (in fact it will list `http://foo.com/src`\nas the source map root, and the original files as `js/file1.js` and\n`js/file2.js`).\n\n### Composed source map\n\nWhen you're compressing JS code that was output by a compiler such as\nCoffeeScript, mapping to the JS code won't be too helpful. Instead, you'd\nlike to map back to the original code (i.e. CoffeeScript). UglifyJS has an\noption to take an input source map. Assuming you have a mapping from\nCoffeeScript → compiled JS, UglifyJS can generate a map from CoffeeScript →\ncompressed JS by mapping every token in the compiled JS to its original\nlocation.\n\nTo use this feature you need to pass `--in-source-map\n/path/to/input/source.map`. Normally the input source map should also point\nto the file containing the generated JS, so if that's correct you can omit\ninput files from the command line.\n\n## Mangler options\n\nTo enable the mangler you need to pass `--mangle` (`-m`). The following\n(comma-separated) options are supported:\n\n- `sort` — to assign shorter names to most frequently used variables. This\n saves a few hundred bytes on jQuery before gzip, but the output is\n _bigger_ after gzip (and seems to happen for other libraries I tried it\n on) therefore it's not enabled by default.\n\n- `toplevel` — mangle names declared in the toplevel scope (disabled by\n default).\n\n- `eval` — mangle names visible in scopes where `eval` or `when` are used\n (disabled by default).\n\nWhen mangling is enabled but you want to prevent certain names from being\nmangled, you can declare those names with `--reserved` (`-r`) — pass a\ncomma-separated list of names. For example:\n\n uglifyjs ... -m -r '$,require,exports'\n\nto prevent the `require`, `exports` and `$` names from being changed.\n\n## Compressor options\n\nYou need to pass `--compress` (`-c`) to enable the compressor. Optionally\nyou can pass a comma-separated list of options. Options are in the form\n`foo=bar`, or just `foo` (the latter implies a boolean option that you want\nto set `true`; it's effectively a shortcut for `foo=true`).\n\n- `sequences` -- join consecutive simple statements using the comma operator\n- `properties` -- rewrite property access using the dot notation, for\n example `foo[\"bar\"] → foo.bar`\n- `dead_code` -- remove unreachable code\n- `drop_debugger` -- remove `debugger;` statements\n- `unsafe` (default: false) -- apply \"unsafe\" transformations (discussion below)\n- `conditionals` -- apply optimizations for `if`-s and conditional\n expressions\n- `comparisons` -- apply certain optimizations to binary nodes, for example:\n `!(a <= b) → a > b` (only when `unsafe`), attempts to negate binary nodes,\n e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc.\n- `evaluate` -- attempt to evaluate constant expressions\n- `booleans` -- various optimizations for boolean context, for example `!!a\n ? b : c → a ? b : c`\n- `loops` -- optimizations for `do`, `while` and `for` loops when we can\n statically determine the condition\n- `unused` -- drop unreferenced functions and variables\n- `hoist_funs` -- hoist function declarations\n- `hoist_vars` (default: false) -- hoist `var` declarations (this is `false`\n by default because it seems to increase the size of the output in general)\n- `if_return` -- optimizations for if/return and if/continue\n- `join_vars` -- join consecutive `var` statements\n- `cascade` -- small optimization for sequences, transform `x, x` into `x`\n and `x = something(), x` into `x = something()`\n- `warnings` -- display warnings when dropping unreachable code or unused\n declarations etc.\n- `negate_iife` -- negate \"Immediately-Called Function Expressions\"\n where the return value is discarded, to avoid the parens that the\n code generator would insert.\n\n### The `unsafe` option\n\nIt enables some transformations that *might* break code logic in certain\ncontrived cases, but should be fine for most code. You might want to try it\non your own code, it should reduce the minified size. Here's what happens\nwhen this flag is on:\n\n- `new Array(1, 2, 3)` or `Array(1, 2, 3)` → `[1, 2, 3 ]`\n- `new Object()` → `{}`\n- `String(exp)` or `exp.toString()` → `\"\" + exp`\n- `new Object/RegExp/Function/Error/Array (...)` → we discard the `new`\n- `typeof foo == \"undefined\"` → `foo === void 0`\n- `void 0` → `\"undefined\"` (if there is a variable named \"undefined\" in\n scope; we do it because the variable name will be mangled, typically\n reduced to a single character).\n\n### Conditional compilation\n\nYou can use the `--define` (`-d`) switch in order to declare global\nvariables that UglifyJS will assume to be constants (unless defined in\nscope). For example if you pass `--define DEBUG=false` then, coupled with\ndead code removal UglifyJS will discard the following from the output:\n```javascript\nif (DEBUG) {\n\tconsole.log(\"debug stuff\");\n}\n```\n\nUglifyJS will warn about the condition being always false and about dropping\nunreachable code; for now there is no option to turn off only this specific\nwarning, you can pass `warnings=false` to turn off *all* warnings.\n\nAnother way of doing that is to declare your globals as constants in a\nseparate file and include it into the build. For example you can have a\n`build/defines.js` file with the following:\n```javascript\nconst DEBUG = false;\nconst PRODUCTION = true;\n// etc.\n```\n\nand build your code like this:\n\n uglifyjs build/defines.js js/foo.js js/bar.js... -c\n\nUglifyJS will notice the constants and, since they cannot be altered, it\nwill evaluate references to them to the value itself and drop unreachable\ncode as usual. The possible downside of this approach is that the build\nwill contain the `const` declarations.\n\n\n## Beautifier options\n\nThe code generator tries to output shortest code possible by default. In\ncase you want beautified output, pass `--beautify` (`-b`). Optionally you\ncan pass additional arguments that control the code output:\n\n- `beautify` (default `true`) -- whether to actually beautify the output.\n Passing `-b` will set this to true, but you might need to pass `-b` even\n when you want to generate minified code, in order to specify additional\n arguments, so you can use `-b beautify=false` to override it.\n- `indent-level` (default 4)\n- `indent-start` (default 0) -- prefix all lines by that many spaces\n- `quote-keys` (default `false`) -- pass `true` to quote all keys in literal\n objects\n- `space-colon` (default `true`) -- insert a space after the colon signs\n- `ascii-only` (default `false`) -- escape Unicode characters in strings and\n regexps\n- `inline-script` (default `false`) -- escape the slash in occurrences of\n `= (x = f(…)) - * - * For example, let the equation be: - * (a = parseInt('100')) <= a - * - * If a was an integer and has the value of 99, - * (a = parseInt('100')) <= a → 100 <= 100 → true - * - * When transformed incorrectly: - * a >= (a = parseInt('100')) → 99 >= 100 → false - */ - -tranformation_sort_order_equal: { - options = { - comparisons: true, - }; - - input: { (a = parseInt('100')) == a } - expect: { (a = parseInt('100')) == a } -} - -tranformation_sort_order_unequal: { - options = { - comparisons: true, - }; - - input: { (a = parseInt('100')) != a } - expect: { (a = parseInt('100')) != a } -} - -tranformation_sort_order_lesser_or_equal: { - options = { - comparisons: true, - }; - - input: { (a = parseInt('100')) <= a } - expect: { (a = parseInt('100')) <= a } -} -tranformation_sort_order_greater_or_equal: { - options = { - comparisons: true, - }; - - input: { (a = parseInt('100')) >= a } - expect: { (a = parseInt('100')) >= a } -} \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-22.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-22.js deleted file mode 100644 index a8b7bc6..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-22.js +++ /dev/null @@ -1,17 +0,0 @@ -return_with_no_value_in_if_body: { - options = { conditionals: true }; - input: { - function foo(bar) { - if (bar) { - return; - } else { - return 1; - } - } - } - expect: { - function foo (bar) { - return bar ? void 0 : 1; - } - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-44.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-44.js deleted file mode 100644 index 7a972f9..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-44.js +++ /dev/null @@ -1,31 +0,0 @@ -issue_44_valid_ast_1: { - options = { unused: true }; - input: { - function a(b) { - for (var i = 0, e = b.qoo(); ; i++) {} - } - } - expect: { - function a(b) { - var i = 0; - for (b.qoo(); ; i++); - } - } -} - -issue_44_valid_ast_2: { - options = { unused: true }; - input: { - function a(b) { - if (foo) for (var i = 0, e = b.qoo(); ; i++) {} - } - } - expect: { - function a(b) { - if (foo) { - var i = 0; - for (b.qoo(); ; i++); - } - } - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-59.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-59.js deleted file mode 100644 index 82b3880..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/issue-59.js +++ /dev/null @@ -1,30 +0,0 @@ -keep_continue: { - options = { - dead_code: true, - evaluate: true - }; - input: { - while (a) { - if (b) { - switch (true) { - case c(): - d(); - } - continue; - } - f(); - } - } - expect: { - while (a) { - if (b) { - switch (true) { - case c(): - d(); - } - continue; - } - f(); - } - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/labels.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/labels.js deleted file mode 100644 index 044b7a7..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/labels.js +++ /dev/null @@ -1,163 +0,0 @@ -labels_1: { - options = { if_return: true, conditionals: true, dead_code: true }; - input: { - out: { - if (foo) break out; - console.log("bar"); - } - }; - expect: { - foo || console.log("bar"); - } -} - -labels_2: { - options = { if_return: true, conditionals: true, dead_code: true }; - input: { - out: { - if (foo) print("stuff"); - else break out; - console.log("here"); - } - }; - expect: { - if (foo) { - print("stuff"); - console.log("here"); - } - } -} - -labels_3: { - options = { if_return: true, conditionals: true, dead_code: true }; - input: { - for (var i = 0; i < 5; ++i) { - if (i < 3) continue; - console.log(i); - } - }; - expect: { - for (var i = 0; i < 5; ++i) - i < 3 || console.log(i); - } -} - -labels_4: { - options = { if_return: true, conditionals: true, dead_code: true }; - input: { - out: for (var i = 0; i < 5; ++i) { - if (i < 3) continue out; - console.log(i); - } - }; - expect: { - for (var i = 0; i < 5; ++i) - i < 3 || console.log(i); - } -} - -labels_5: { - options = { if_return: true, conditionals: true, dead_code: true }; - // should keep the break-s in the following - input: { - while (foo) { - if (bar) break; - console.log("foo"); - } - out: while (foo) { - if (bar) break out; - console.log("foo"); - } - }; - expect: { - while (foo) { - if (bar) break; - console.log("foo"); - } - out: while (foo) { - if (bar) break out; - console.log("foo"); - } - } -} - -labels_6: { - input: { - out: break out; - }; - expect: {} -} - -labels_7: { - options = { if_return: true, conditionals: true, dead_code: true }; - input: { - while (foo) { - x(); - y(); - continue; - } - }; - expect: { - while (foo) { - x(); - y(); - } - } -} - -labels_8: { - options = { if_return: true, conditionals: true, dead_code: true }; - input: { - while (foo) { - x(); - y(); - break; - } - }; - expect: { - while (foo) { - x(); - y(); - break; - } - } -} - -labels_9: { - options = { if_return: true, conditionals: true, dead_code: true }; - input: { - out: while (foo) { - x(); - y(); - continue out; - z(); - k(); - } - }; - expect: { - while (foo) { - x(); - y(); - } - } -} - -labels_10: { - options = { if_return: true, conditionals: true, dead_code: true }; - input: { - out: while (foo) { - x(); - y(); - break out; - z(); - k(); - } - }; - expect: { - out: while (foo) { - x(); - y(); - break out; - } - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/loops.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/loops.js deleted file mode 100644 index cdf1f04..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/loops.js +++ /dev/null @@ -1,123 +0,0 @@ -while_becomes_for: { - options = { loops: true }; - input: { - while (foo()) bar(); - } - expect: { - for (; foo(); ) bar(); - } -} - -drop_if_break_1: { - options = { loops: true }; - input: { - for (;;) - if (foo()) break; - } - expect: { - for (; !foo();); - } -} - -drop_if_break_2: { - options = { loops: true }; - input: { - for (;bar();) - if (foo()) break; - } - expect: { - for (; bar() && !foo();); - } -} - -drop_if_break_3: { - options = { loops: true }; - input: { - for (;bar();) { - if (foo()) break; - stuff1(); - stuff2(); - } - } - expect: { - for (; bar() && !foo();) { - stuff1(); - stuff2(); - } - } -} - -drop_if_break_4: { - options = { loops: true, sequences: true }; - input: { - for (;bar();) { - x(); - y(); - if (foo()) break; - z(); - k(); - } - } - expect: { - for (; bar() && (x(), y(), !foo());) z(), k(); - } -} - -drop_if_else_break_1: { - options = { loops: true }; - input: { - for (;;) if (foo()) bar(); else break; - } - expect: { - for (; foo(); ) bar(); - } -} - -drop_if_else_break_2: { - options = { loops: true }; - input: { - for (;bar();) { - if (foo()) baz(); - else break; - } - } - expect: { - for (; bar() && foo();) baz(); - } -} - -drop_if_else_break_3: { - options = { loops: true }; - input: { - for (;bar();) { - if (foo()) baz(); - else break; - stuff1(); - stuff2(); - } - } - expect: { - for (; bar() && foo();) { - baz(); - stuff1(); - stuff2(); - } - } -} - -drop_if_else_break_4: { - options = { loops: true, sequences: true }; - input: { - for (;bar();) { - x(); - y(); - if (foo()) baz(); - else break; - z(); - k(); - } - } - expect: { - for (; bar() && (x(), y(), foo());) baz(), z(), k(); - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/negate-iife.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/negate-iife.js deleted file mode 100644 index 0362ffc..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/negate-iife.js +++ /dev/null @@ -1,76 +0,0 @@ -negate_iife_1: { - options = { - negate_iife: true - }; - input: { - (function(){ stuff() })(); - } - expect: { - !function(){ stuff() }(); - } -} - -negate_iife_2: { - options = { - negate_iife: true - }; - input: { - (function(){ return {} })().x = 10; // should not transform this one - } - expect: { - (function(){ return {} })().x = 10; - } -} - -negate_iife_3: { - options = { - negate_iife: true, - }; - input: { - (function(){ return true })() ? console.log(true) : console.log(false); - } - expect: { - !function(){ return true }() ? console.log(false) : console.log(true); - } -} - -negate_iife_3: { - options = { - negate_iife: true, - sequences: true - }; - input: { - (function(){ return true })() ? console.log(true) : console.log(false); - (function(){ - console.log("something"); - })(); - } - expect: { - !function(){ return true }() ? console.log(false) : console.log(true), function(){ - console.log("something"); - }(); - } -} - -negate_iife_4: { - options = { - negate_iife: true, - sequences: true, - conditionals: true, - }; - input: { - if ((function(){ return true })()) { - console.log(true); - } else { - console.log(false); - } - (function(){ - console.log("something"); - })(); - } - expect: { - !function(){ return true }() ? console.log(false) : console.log(true), function(){ - console.log("something"); - }(); - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/properties.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/properties.js deleted file mode 100644 index 8504596..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/properties.js +++ /dev/null @@ -1,54 +0,0 @@ -keep_properties: { - options = { - properties: false - }; - input: { - a["foo"] = "bar"; - } - expect: { - a["foo"] = "bar"; - } -} - -dot_properties: { - options = { - properties: true - }; - input: { - a["foo"] = "bar"; - a["if"] = "if"; - a["*"] = "asterisk"; - a["\u0EB3"] = "unicode"; - a[""] = "whitespace"; - a["1_1"] = "foo"; - } - expect: { - a.foo = "bar"; - a["if"] = "if"; - a["*"] = "asterisk"; - a.\u0EB3 = "unicode"; - a[""] = "whitespace"; - a["1_1"] = "foo"; - } -} - -dot_properties_es5: { - options = { - properties: true, - screw_ie8: true - }; - input: { - a["foo"] = "bar"; - a["if"] = "if"; - a["*"] = "asterisk"; - a["\u0EB3"] = "unicode"; - a[""] = "whitespace"; - } - expect: { - a.foo = "bar"; - a.if = "if"; - a["*"] = "asterisk"; - a.\u0EB3 = "unicode"; - a[""] = "whitespace"; - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/sequences.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/sequences.js deleted file mode 100644 index 6f63ace..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/sequences.js +++ /dev/null @@ -1,161 +0,0 @@ -make_sequences_1: { - options = { - sequences: true - }; - input: { - foo(); - bar(); - baz(); - } - expect: { - foo(),bar(),baz(); - } -} - -make_sequences_2: { - options = { - sequences: true - }; - input: { - if (boo) { - foo(); - bar(); - baz(); - } else { - x(); - y(); - z(); - } - } - expect: { - if (boo) foo(),bar(),baz(); - else x(),y(),z(); - } -} - -make_sequences_3: { - options = { - sequences: true - }; - input: { - function f() { - foo(); - bar(); - return baz(); - } - function g() { - foo(); - bar(); - throw new Error(); - } - } - expect: { - function f() { - return foo(), bar(), baz(); - } - function g() { - throw foo(), bar(), new Error(); - } - } -} - -make_sequences_4: { - options = { - sequences: true - }; - input: { - x = 5; - if (y) z(); - - x = 5; - for (i = 0; i < 5; i++) console.log(i); - - x = 5; - for (; i < 5; i++) console.log(i); - - x = 5; - switch (y) {} - - x = 5; - with (obj) {} - } - expect: { - if (x = 5, y) z(); - for (x = 5, i = 0; i < 5; i++) console.log(i); - for (x = 5; i < 5; i++) console.log(i); - switch (x = 5, y) {} - with (x = 5, obj); - } -} - -lift_sequences_1: { - options = { sequences: true }; - input: { - foo = !(x(), y(), bar()); - } - expect: { - x(), y(), foo = !bar(); - } -} - -lift_sequences_2: { - options = { sequences: true, evaluate: true }; - input: { - q = 1 + (foo(), bar(), 5) + 7 * (5 / (3 - (a(), (QW=ER), c(), 2))) - (x(), y(), 5); - } - expect: { - foo(), bar(), a(), QW = ER, c(), x(), y(), q = 36 - } -} - -lift_sequences_3: { - options = { sequences: true, conditionals: true }; - input: { - x = (foo(), bar(), baz()) ? 10 : 20; - } - expect: { - foo(), bar(), x = baz() ? 10 : 20; - } -} - -lift_sequences_4: { - options = { side_effects: true }; - input: { - x = (foo, bar, baz); - } - expect: { - x = baz; - } -} - -for_sequences: { - options = { sequences: true }; - input: { - // 1 - foo(); - bar(); - for (; false;); - // 2 - foo(); - bar(); - for (x = 5; false;); - // 3 - x = (foo in bar); - for (; false;); - // 4 - x = (foo in bar); - for (y = 5; false;); - } - expect: { - // 1 - for (foo(), bar(); false;); - // 2 - for (foo(), bar(), x = 5; false;); - // 3 - x = (foo in bar); - for (; false;); - // 4 - x = (foo in bar); - for (y = 5; false;); - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/switch.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/switch.js deleted file mode 100644 index 62e39cf..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/switch.js +++ /dev/null @@ -1,260 +0,0 @@ -constant_switch_1: { - options = { dead_code: true, evaluate: true }; - input: { - switch (1+1) { - case 1: foo(); break; - case 1+1: bar(); break; - case 1+1+1: baz(); break; - } - } - expect: { - bar(); - } -} - -constant_switch_2: { - options = { dead_code: true, evaluate: true }; - input: { - switch (1) { - case 1: foo(); - case 1+1: bar(); break; - case 1+1+1: baz(); - } - } - expect: { - foo(); - bar(); - } -} - -constant_switch_3: { - options = { dead_code: true, evaluate: true }; - input: { - switch (10) { - case 1: foo(); - case 1+1: bar(); break; - case 1+1+1: baz(); - default: - def(); - } - } - expect: { - def(); - } -} - -constant_switch_4: { - options = { dead_code: true, evaluate: true }; - input: { - switch (2) { - case 1: - x(); - if (foo) break; - y(); - break; - case 1+1: - bar(); - default: - def(); - } - } - expect: { - bar(); - def(); - } -} - -constant_switch_5: { - options = { dead_code: true, evaluate: true }; - input: { - switch (1) { - case 1: - x(); - if (foo) break; - y(); - break; - case 1+1: - bar(); - default: - def(); - } - } - expect: { - // the break inside the if ruins our job - // we can still get rid of irrelevant cases. - switch (1) { - case 1: - x(); - if (foo) break; - y(); - } - // XXX: we could optimize this better by inventing an outer - // labeled block, but that's kinda tricky. - } -} - -constant_switch_6: { - options = { dead_code: true, evaluate: true }; - input: { - OUT: { - foo(); - switch (1) { - case 1: - x(); - if (foo) break OUT; - y(); - case 1+1: - bar(); - break; - default: - def(); - } - } - } - expect: { - OUT: { - foo(); - x(); - if (foo) break OUT; - y(); - bar(); - } - } -} - -constant_switch_7: { - options = { dead_code: true, evaluate: true }; - input: { - OUT: { - foo(); - switch (1) { - case 1: - x(); - if (foo) break OUT; - for (var x = 0; x < 10; x++) { - if (x > 5) break; // this break refers to the for, not to the switch; thus it - // shouldn't ruin our optimization - console.log(x); - } - y(); - case 1+1: - bar(); - break; - default: - def(); - } - } - } - expect: { - OUT: { - foo(); - x(); - if (foo) break OUT; - for (var x = 0; x < 10; x++) { - if (x > 5) break; - console.log(x); - } - y(); - bar(); - } - } -} - -constant_switch_8: { - options = { dead_code: true, evaluate: true }; - input: { - OUT: switch (1) { - case 1: - x(); - for (;;) break OUT; - y(); - break; - case 1+1: - bar(); - default: - def(); - } - } - expect: { - OUT: { - x(); - for (;;) break OUT; - y(); - } - } -} - -constant_switch_9: { - options = { dead_code: true, evaluate: true }; - input: { - OUT: switch (1) { - case 1: - x(); - for (;;) if (foo) break OUT; - y(); - case 1+1: - bar(); - default: - def(); - } - } - expect: { - OUT: { - x(); - for (;;) if (foo) break OUT; - y(); - bar(); - def(); - } - } -} - -drop_default_1: { - options = { dead_code: true }; - input: { - switch (foo) { - case 'bar': baz(); - default: - } - } - expect: { - switch (foo) { - case 'bar': baz(); - } - } -} - -drop_default_2: { - options = { dead_code: true }; - input: { - switch (foo) { - case 'bar': baz(); break; - default: - break; - } - } - expect: { - switch (foo) { - case 'bar': baz(); - } - } -} - -keep_default: { - options = { dead_code: true }; - input: { - switch (foo) { - case 'bar': baz(); - default: - something(); - break; - } - } - expect: { - switch (foo) { - case 'bar': baz(); - default: - something(); - } - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/typeof.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/typeof.js deleted file mode 100644 index cefdd43..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/compress/typeof.js +++ /dev/null @@ -1,25 +0,0 @@ -typeof_evaluation: { - options = { - evaluate: true - }; - input: { - a = typeof 1; - b = typeof 'test'; - c = typeof []; - d = typeof {}; - e = typeof /./; - f = typeof false; - g = typeof function(){}; - h = typeof undefined; - } - expect: { - a='number'; - b='string'; - c=typeof[]; - d=typeof{}; - e=typeof/./; - f='boolean'; - g='function'; - h='undefined'; - } -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/run-tests.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/run-tests.js deleted file mode 100755 index 0568c6a..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/test/run-tests.js +++ /dev/null @@ -1,170 +0,0 @@ -#! /usr/bin/env node - -var U = require("../tools/node"); -var path = require("path"); -var fs = require("fs"); -var assert = require("assert"); -var sys = require("util"); - -var tests_dir = path.dirname(module.filename); - -run_compress_tests(); - -/* -----[ utils ]----- */ - -function tmpl() { - return U.string_template.apply(this, arguments); -} - -function log() { - var txt = tmpl.apply(this, arguments); - sys.puts(txt); -} - -function log_directory(dir) { - log("*** Entering [{dir}]", { dir: dir }); -} - -function log_start_file(file) { - log("--- {file}", { file: file }); -} - -function log_test(name) { - log(" Running test [{name}]", { name: name }); -} - -function find_test_files(dir) { - var files = fs.readdirSync(dir).filter(function(name){ - return /\.js$/i.test(name); - }); - if (process.argv.length > 2) { - var x = process.argv.slice(2); - files = files.filter(function(f){ - return x.indexOf(f) >= 0; - }); - } - return files; -} - -function test_directory(dir) { - return path.resolve(tests_dir, dir); -} - -function as_toplevel(input) { - if (input instanceof U.AST_BlockStatement) input = input.body; - else if (input instanceof U.AST_Statement) input = [ input ]; - else throw new Error("Unsupported input syntax"); - var toplevel = new U.AST_Toplevel({ body: input }); - toplevel.figure_out_scope(); - return toplevel; -} - -function run_compress_tests() { - var dir = test_directory("compress"); - log_directory("compress"); - var files = find_test_files(dir); - function test_file(file) { - log_start_file(file); - function test_case(test) { - log_test(test.name); - var options = U.defaults(test.options, { - warnings: false - }); - var cmp = new U.Compressor(options, true); - var expect = make_code(as_toplevel(test.expect), false); - var input = as_toplevel(test.input); - var input_code = make_code(test.input); - var output = input.transform(cmp); - output.figure_out_scope(); - output = make_code(output, false); - if (expect != output) { - log("!!! failed\n---INPUT---\n{input}\n---OUTPUT---\n{output}\n---EXPECTED---\n{expected}\n\n", { - input: input_code, - output: output, - expected: expect - }); - } - } - var tests = parse_test(path.resolve(dir, file)); - for (var i in tests) if (tests.hasOwnProperty(i)) { - test_case(tests[i]); - } - } - files.forEach(function(file){ - test_file(file); - }); -} - -function parse_test(file) { - var script = fs.readFileSync(file, "utf8"); - var ast = U.parse(script, { - filename: file - }); - var tests = {}; - var tw = new U.TreeWalker(function(node, descend){ - if (node instanceof U.AST_LabeledStatement - && tw.parent() instanceof U.AST_Toplevel) { - var name = node.label.name; - tests[name] = get_one_test(name, node.body); - return true; - } - if (!(node instanceof U.AST_Toplevel)) croak(node); - }); - ast.walk(tw); - return tests; - - function croak(node) { - throw new Error(tmpl("Can't understand test file {file} [{line},{col}]\n{code}", { - file: file, - line: node.start.line, - col: node.start.col, - code: make_code(node, false) - })); - } - - function get_one_test(name, block) { - var test = { name: name, options: {} }; - var tw = new U.TreeWalker(function(node, descend){ - if (node instanceof U.AST_Assign) { - if (!(node.left instanceof U.AST_SymbolRef)) { - croak(node); - } - var name = node.left.name; - test[name] = evaluate(node.right); - return true; - } - if (node instanceof U.AST_LabeledStatement) { - assert.ok( - node.label.name == "input" || node.label.name == "expect", - tmpl("Unsupported label {name} [{line},{col}]", { - name: node.label.name, - line: node.label.start.line, - col: node.label.start.col - }) - ); - var stat = node.body; - if (stat instanceof U.AST_BlockStatement) { - if (stat.body.length == 1) stat = stat.body[0]; - else if (stat.body.length == 0) stat = new U.AST_EmptyStatement(); - } - test[node.label.name] = stat; - return true; - } - }); - block.walk(tw); - return test; - }; -} - -function make_code(ast, beautify) { - if (arguments.length == 1) beautify = true; - var stream = U.OutputStream({ beautify: beautify }); - ast.print(stream); - return stream.get(); -} - -function evaluate(code) { - if (code instanceof U.AST_Node) - code = make_code(code); - return new Function("return(" + code + ")")(); -} diff --git a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/tools/node.js b/node_modules/grunt-contrib-uglify/node_modules/uglify-js/tools/node.js deleted file mode 100644 index 614e083..0000000 --- a/node_modules/grunt-contrib-uglify/node_modules/uglify-js/tools/node.js +++ /dev/null @@ -1,167 +0,0 @@ -var path = require("path"); -var fs = require("fs"); -var vm = require("vm"); -var sys = require("util"); - -var UglifyJS = vm.createContext({ - sys : sys, - console : console, - MOZ_SourceMap : require("source-map") -}); - -function load_global(file) { - file = path.resolve(path.dirname(module.filename), file); - try { - var code = fs.readFileSync(file, "utf8"); - return vm.runInContext(code, UglifyJS, file); - } catch(ex) { - // XXX: in case of a syntax error, the message is kinda - // useless. (no location information). - sys.debug("ERROR in file: " + file + " / " + ex); - process.exit(1); - } -}; - -var FILES = exports.FILES = [ - "../lib/utils.js", - "../lib/ast.js", - "../lib/parse.js", - "../lib/transform.js", - "../lib/scope.js", - "../lib/output.js", - "../lib/compress.js", - "../lib/sourcemap.js", - "../lib/mozilla-ast.js" -].map(function(file){ - return path.join(path.dirname(fs.realpathSync(__filename)), file); -}); - -FILES.forEach(load_global); - -UglifyJS.AST_Node.warn_function = function(txt) { - sys.error("WARN: " + txt); -}; - -// XXX: perhaps we shouldn't export everything but heck, I'm lazy. -for (var i in UglifyJS) { - if (UglifyJS.hasOwnProperty(i)) { - exports[i] = UglifyJS[i]; - } -} - -exports.minify = function(files, options) { - options = UglifyJS.defaults(options, { - outSourceMap : null, - sourceRoot : null, - inSourceMap : null, - fromString : false, - warnings : false, - mangle : {}, - output : null, - compress : {} - }); - if (typeof files == "string") - files = [ files ]; - - UglifyJS.base54.reset(); - - // 1. parse - var toplevel = null; - files.forEach(function(file){ - var code = options.fromString - ? file - : fs.readFileSync(file, "utf8"); - toplevel = UglifyJS.parse(code, { - filename: options.fromString ? "?" : file, - toplevel: toplevel - }); - }); - - // 2. compress - if (options.compress) { - var compress = { warnings: options.warnings }; - UglifyJS.merge(compress, options.compress); - toplevel.figure_out_scope(); - var sq = UglifyJS.Compressor(compress); - toplevel = toplevel.transform(sq); - } - - // 3. mangle - if (options.mangle) { - toplevel.figure_out_scope(); - toplevel.compute_char_frequency(); - toplevel.mangle_names(options.mangle); - } - - // 4. output - var inMap = options.inSourceMap; - var output = {}; - if (typeof options.inSourceMap == "string") { - inMap = fs.readFileSync(options.inSourceMap, "utf8"); - } - if (options.outSourceMap) { - output.source_map = UglifyJS.SourceMap({ - file: options.outSourceMap, - orig: inMap, - root: options.sourceRoot - }); - } - if (options.output) { - UglifyJS.merge(output, options.output); - } - var stream = UglifyJS.OutputStream(output); - toplevel.print(stream); - return { - code : stream + "", - map : output.source_map + "" - }; -}; - -// exports.describe_ast = function() { -// function doitem(ctor) { -// var sub = {}; -// ctor.SUBCLASSES.forEach(function(ctor){ -// sub[ctor.TYPE] = doitem(ctor); -// }); -// var ret = {}; -// if (ctor.SELF_PROPS.length > 0) ret.props = ctor.SELF_PROPS; -// if (ctor.SUBCLASSES.length > 0) ret.sub = sub; -// return ret; -// } -// return doitem(UglifyJS.AST_Node).sub; -// } - -exports.describe_ast = function() { - var out = UglifyJS.OutputStream({ beautify: true }); - function doitem(ctor) { - out.print("AST_" + ctor.TYPE); - var props = ctor.SELF_PROPS.filter(function(prop){ - return !/^\$/.test(prop); - }); - if (props.length > 0) { - out.space(); - out.with_parens(function(){ - props.forEach(function(prop, i){ - if (i) out.space(); - out.print(prop); - }); - }); - } - if (ctor.documentation) { - out.space(); - out.print_string(ctor.documentation); - } - if (ctor.SUBCLASSES.length > 0) { - out.space(); - out.with_block(function(){ - ctor.SUBCLASSES.forEach(function(ctor, i){ - out.indent(); - doitem(ctor); - out.newline(); - }); - }); - } - }; - doitem(UglifyJS.AST_Node); - return out + ""; -}; diff --git a/node_modules/grunt-contrib-uglify/package.json b/node_modules/grunt-contrib-uglify/package.json deleted file mode 100644 index 0a38da4..0000000 --- a/node_modules/grunt-contrib-uglify/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "grunt-contrib-uglify", - "description": "Minify files with UglifyJS.", - "version": "0.2.4", - "homepage": "https://github.com/gruntjs/grunt-contrib-uglify", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-contrib-uglify.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-contrib-uglify/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/gruntjs/grunt-contrib-uglify/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "dependencies": { - "uglify-js": "~2.4.0", - "grunt-lib-contrib": "~0.6.1" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.6.3", - "grunt-contrib-nodeunit": "~0.2.0", - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-internal": "~0.4.2", - "grunt": "~0.4.0" - }, - "peerDependencies": { - "grunt": "~0.4.0" - }, - "keywords": [ - "gruntplugin" - ], - "contributors": [ - { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com" - }, - { - "name": "Tyler Kellen", - "url": "http://goingslowly.com" - }, - { - "name": "Jarrod Overson", - "url": "http://jarrodoverson.com" - } - ], - "readme": "# grunt-contrib-uglify [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-uglify.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-uglify)\n\n> Minify files with UglifyJS.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\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-contrib-uglify --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-contrib-uglify');\n```\n\n\n\n\n## Uglify task\n_Run this task with the `grunt uglify` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n### Options\n\nThis task primarily delegates to [UglifyJS2][], so please consider the [UglifyJS documentation][] as required reading for advanced configuration.\n\n[UglifyJS2]: https://github.com/mishoo/UglifyJS2\n[UglifyJS documentation]: http://lisperator.net/uglifyjs/\n\n#### mangle\nType: `Boolean` `Object`\nDefault: `{}`\n\nTurn on or off mangling with default options. If an `Object` is specified, it is passed directly to `ast.mangle_names()` *and* `ast.compute_char_frequency()` (mimicking command line behavior).\n\n#### compress\nType: `Boolean` `Object`\nDefault: `{}`\n\nTurn on or off source compression with default options. If an `Object` is specified, it is passed as options to `UglifyJS.Compressor()`.\n\n#### beautify\nType: `Boolean` `Object`\nDefault: `false`\n\nTurns on beautification of the generated source code. An `Object` will be merged and passed with the options sent to `UglifyJS.OutputStream()`\n\n#### report\nChoices: `false` `'min'` `'gzip'`\nDefault: `false`\n\nEither do not report anything, report only minification result, or report minification and gzip results. This is useful to see exactly how well Uglify is performing, but using `'gzip'` can add 5-10x runtime task execution.\n\nExample ouput using `'gzip'`:\n\n```\nOriginal: 198444 bytes.\nMinified: 101615 bytes.\nGzipped: 20084 bytes.\n```\n\n#### sourceMap\nType: `String` `Function`\nDefault: `undefined`\n\nThe location to output the sourcemap. If a function is provided, the uglify destination is passed as the argument\nand the return value will be used as the sourceMap name.\n\n#### sourceMapRoot\nType: `String`\nDefault: `undefined`\n\nThe location where your source files can be found. This sets the sourceRoot field in the source map.\n\n#### sourceMapIn\nType: `String`\nDefault: `undefined`\n\nThe location of an input source map from an earlier compilation, e.g. from CoffeeScript.\n\n#### sourceMappingURL\nType: `String` `Function`\nDefault: `undefined`\n\nThe location of your sourcemap. Defaults to the location you use for sourceMap, override if you need finer control. Provide\na function to dynamically generate the sourceMappingURL based off the destination.\n\n#### sourceMapPrefix\nType: `Number`\nDefault: `undefined`\n\nThe number of directories to drop from the path prefix when declaring files in the source map.\n\n#### wrap\nType: `String`\nDefault: `undefined`\n\nWrap all of the code in a closure, an easy way to make sure nothing is leaking.\nFor variables that need to be public `exports` and `global` variables are made available.\nThe value of wrap is the global variable exports will be available as.\n\n#### exportAll\nType: `Boolean`\nDefault: `false`\n\nWhen using `wrap` this will make all global functions and variables available via the export variable.\n\n#### preserveComments\nType: `Boolean` `String` `Function`\nDefault: `undefined`\nOptions: `false` `'all'` `'some'`\n\nTurn on preservation of comments.\n\n- `false` will strip all comments\n- `'all'` will preserve all comments in code blocks that have not been squashed or dropped\n- `'some'` will preserve all comments that start with a bang (`!`) or include a closure compiler style directive (`@preserve` `@license` `@cc_on`)\n- `Function` specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either `true` or `false`\n\n#### banner\nType: `String`\nDefault: empty string\n\nThis string will be prepended to the beginning of the minified output. It is processed using [grunt.template.process][], using the default options.\n\n_(Default processing options are explained in the [grunt.template.process][] documentation)_\n\n[grunt.template.process]: https://github.com/gruntjs/grunt/wiki/grunt.template#wiki-grunt-template-process\n\n\n### Usage examples\n\n#### Basic compression\n\nThis configuration will compress and mangle the input files using the default options.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n uglify: {\n my_target: {\n files: {\n 'dest/output.min.js': ['src/input1.js', 'src/input2.js']\n }\n }\n }\n});\n```\n\n#### No mangling\n\nSpecify `mangle: false` to prevent changes to your variable and function names.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n uglify: {\n options: {\n mangle: false\n },\n my_target: {\n files: {\n 'dest/output.min.js': ['src/input.js']\n }\n }\n }\n});\n```\n\n#### Reserved identifiers\n\nYou can specify identifiers to leave untouched with an `except` array in the `mangle` options.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n uglify: {\n options: {\n mangle: {\n except: ['jQuery', 'Backbone']\n }\n },\n my_target: {\n files: {\n 'dest/output.min.js': ['src/input.js']\n }\n }\n }\n});\n```\n\n#### Source maps\n\nConfigure basic source map output by specifying a file path for the `sourceMap` option.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n uglify: {\n my_target: {\n options: {\n sourceMap: 'path/to/source-map.js'\n },\n files: {\n 'dest/output.min.js': ['src/input.js']\n }\n }\n }\n});\n```\n\n#### Advanced source maps\n\nYou can specify the parameters to pass to `UglifyJS.SourceMap()` which will\nallow you to configure advanced settings.\n\nRefer to the [UglifyJS SourceMap Documentation](http://lisperator.net/uglifyjs/codegen#source-map) for more information.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n uglify: {\n my_target: {\n options: {\n sourceMap: 'path/to/source-map.js',\n sourceMapRoot: 'http://example.com/path/to/src/', // the location to find your original source\n sourceMapIn: 'example/coffeescript-sourcemap.js', // input sourcemap from a previous compilation\n },\n files: {\n 'dest/output.min.js': ['src/input.js'],\n },\n },\n },\n});\n```\n\n\n#### Beautify\n\nSpecify `beautify: true` to beautify your code for debugging/troubleshooting purposes.\nPass an object to manually configure any other output options passed directly to `UglifyJS.OutputStream()`.\n\nSee [UglifyJS Codegen documentation](http://lisperator.net/uglifyjs/codegen) for more information.\n\n_Note that manual configuration will require you to explicitly set `beautify: true` if you want traditional, beautified output._\n\n```js\n// Project configuration.\ngrunt.initConfig({\n uglify: {\n my_target: {\n options: {\n beautify: true\n },\n files: {\n 'dest/output.min.js': ['src/input.js']\n }\n },\n my_advanced_target: {\n options: {\n beautify: {\n width: 80,\n beautify: true\n }\n },\n files: {\n 'dest/output.min.js': ['src/input.js']\n }\n }\n }\n});\n```\n\n#### Banner comments\n\nIn this example, running `grunt uglify:my_target` will prepend a banner created by interpolating the `banner` template string with the config object. Here, those properties are the values imported from the `package.json` file (which are available via the `pkg` config property) plus today's date.\n\n_Note: you don't have to use an external JSON file. It's also valid to create the `pkg` object inline in the config. That being said, if you already have a JSON file, you might as well reference it._\n\n```js\n// Project configuration.\ngrunt.initConfig({\n pkg: grunt.file.readJSON('package.json'),\n uglify: {\n options: {\n banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +\n '<%= grunt.template.today(\"yyyy-mm-dd\") %> */'\n },\n my_target: {\n files: {\n 'dest/output.min.js': ['src/input.js']\n }\n }\n }\n});\n```\n\n#### Conditional compilation\n\nYou can also enable UglifyJS conditional compilation. This is commonly used to remove debug code blocks for production builds.\n\nSee [UglifyJS global definitions documentation](http://lisperator.net/uglifyjs/compress#global-defs) for more information.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n uglify: {\n options: {\n compress: {\n global_defs: {\n \"DEBUG\": false\n },\n dead_code: true\n }\n },\n my_target: {\n files: {\n 'dest/output.min.js': ['src/input.js']\n }\n }\n }\n});\n```\n\n\n## Release History\n\n * 2013-09-02   v0.2.4   updated sourcemap format via /83\n * 2013-06-10   v0.2.3   added footer option\n * 2013-05-31   v0.2.2   Reverted /56 due to /58 until [chrome/239660](https://code.google.com/p/chromium/issues/detail?id=239660&q=sourcemappingurl&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified) [firefox/870361](https://bugzilla.mozilla.org/show_bug.cgi?id=870361) drop\n * 2013-05-22   v0.2.1   Bumped uglify to ~2.3.5 /55 /40 Changed sourcemappingUrl syntax /56 Disabled sorting of names for consistent mangling /44 Updated docs for sourceMapRoot /47 /25\n * 2013-03-14   v0.2.0   No longer report gzip results by default. Support `report` option.\n * 2013-01-30   v0.1.2   Added better error reporting Support for dynamic names of multiple sourcemaps\n * 2013-02-15   v0.1.1   First official release for Grunt 0.4.0.\n * 2013-01-18   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-09   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. Switching back to this.files api.\n * 2012-11-28   v0.1.0   Work in progress, not yet officially released.\n\n---\n\nTask submitted by [\"Cowboy\" Ben Alman](http://benalman.com)\n\n*This file was generated on Mon Sep 02 2013 11:35:39.*\n", - "readmeFilename": "README.md", - "_id": "grunt-contrib-uglify@0.2.4", - "dist": { - "shasum": "51113f28a72432521e35e63f7f18a251fda2fd49" - }, - "_from": "grunt-contrib-uglify@~0.2.0", - "_resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.2.4.tgz" -} diff --git a/node_modules/grunt-contrib-uglify/tasks/lib/uglify.js b/node_modules/grunt-contrib-uglify/tasks/lib/uglify.js deleted file mode 100644 index 3d98057..0000000 --- a/node_modules/grunt-contrib-uglify/tasks/lib/uglify.js +++ /dev/null @@ -1,145 +0,0 @@ -/* - * grunt-contrib-uglify - * https://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -// External libs. -var UglifyJS = require('uglify-js'); -var fs = require('fs'); - -exports.init = function(grunt) { - var exports = {}; - - // Minify with UglifyJS. - // From https://github.com/mishoo/UglifyJS2 - // API docs at http://lisperator.net/uglifyjs/ - exports.minify = function(files, dest, options) { - options = options || {}; - - grunt.verbose.write('Minifying with UglifyJS...'); - - var topLevel = null; - var totalCode = ''; - - var outputOptions = getOutputOptions(options, dest); - var output = UglifyJS.OutputStream(outputOptions); - - // Grab and parse all source files - files.forEach(function(file){ - var code = grunt.file.read(file); - if (typeof options.sourceMapPrefix !== 'undefined') { - file = file.replace(/^\/+/, "").split(/\/+/).slice(options.sourceMapPrefix).join("/"); - } - totalCode += code; - topLevel = UglifyJS.parse(code, { - filename: file, - toplevel: topLevel - }); - }); - - // Wrap code in a common js wrapper. - if (options.wrap) { - topLevel = topLevel.wrap_commonjs(options.wrap, options.exportAll); - } - - // Need to call this before we mangle or compress, - // and call after any compression or ast altering - topLevel.figure_out_scope(); - - if (options.compress !== false) { - if (options.compress.warnings !== true) { - options.compress.warnings = false; - } - var compressor = UglifyJS.Compressor(options.compress); - topLevel = topLevel.transform(compressor); - - // Need to figure out scope again after source being altered - topLevel.figure_out_scope(); - } - - if (options.mangle !== false) { - // disabled due to: - // 1) preserve stable name mangling - // 2) it increases gzipped file size, see https://github.com/mishoo/UglifyJS2#mangler-options - // // compute_char_frequency optimizes names for compression - // topLevel.compute_char_frequency(options.mangle); - - // Requires previous call to figure_out_scope - // and should always be called after compressor transform - topLevel.mangle_names(options.mangle); - } - - // Print the ast to OutputStream - topLevel.print(output); - - var min = output.get(); - - if (options.sourceMappingURL || options.sourceMap) { - min += "\n//# sourceMappingURL=" + (options.sourceMappingURL || options.sourceMap); - } - - var result = { - max: totalCode, - min: min, - sourceMap: outputOptions.source_map - }; - - grunt.verbose.ok(); - - return result; - }; - - var getOutputOptions = function(options, dest) { - var outputOptions = { - beautify: false, - source_map: null - }; - - if (options.preserveComments) { - if (options.preserveComments === 'all' || options.preserveComments === true) { - - // preserve all the comments we can - outputOptions.comments = true; - } else if (options.preserveComments === 'some') { - // preserve comments with directives or that start with a bang (!) - outputOptions.comments = /^!|@preserve|@license|@cc_on/i; - } else if (grunt.util._.isFunction(options.preserveComments)) { - - // support custom functions passed in - outputOptions.comments = options.preserveComments; - } - } - - if (options.beautify) { - if (grunt.util._.isObject(options.beautify)) { - // beautify options sent as an object are merged - // with outputOptions and passed to the OutputStream - grunt.util._.extend(outputOptions, options.beautify); - } else { - outputOptions.beautify = true; - } - } - - - if (options.sourceMap) { - var sourceMapIn; - if (options.sourceMapIn) { - sourceMapIn = grunt.file.readJSON(options.sourceMapIn); - } - outputOptions.source_map = UglifyJS.SourceMap({ - file: dest, - root: options.sourceMapRoot, - orig: sourceMapIn - }); - } - - return outputOptions; - }; - - return exports; -}; diff --git a/node_modules/grunt-contrib-uglify/tasks/uglify.js b/node_modules/grunt-contrib-uglify/tasks/uglify.js deleted file mode 100644 index d656c52..0000000 --- a/node_modules/grunt-contrib-uglify/tasks/uglify.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - * grunt-contrib-uglify - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - // Internal lib. - var contrib = require('grunt-lib-contrib').init(grunt); - var uglify = require('./lib/uglify').init(grunt); - - grunt.registerMultiTask('uglify', 'Minify files with UglifyJS.', function() { - // Merge task-specific and/or target-specific options with these defaults. - var options = this.options({ - banner: '', - footer: '', - compress: { - warnings: false - }, - mangle: {}, - beautify: false, - report: false - }); - - // Process banner. - var banner = grunt.template.process(options.banner); - var footer = grunt.template.process(options.footer); - var mapNameGenerator, mappingURLGenerator; - - // Iterate over all src-dest file pairs. - this.files.forEach(function(f) { - var src = f.src.filter(function(filepath) { - // Warn on and remove invalid source files (if nonull was set). - if (!grunt.file.exists(filepath)) { - grunt.log.warn('Source file "' + filepath + '" not found.'); - return false; - } else { - return true; - } - }); - - if (src.length === 0) { - grunt.log.warn('Destination (' + f.dest + ') not written because src files were empty.'); - return; - } - - // function to get the name of the sourceMap - if (typeof options.sourceMap === "function") { - mapNameGenerator = options.sourceMap; - } - - // function to get the sourceMappingURL - if (typeof options.sourceMappingURL === "function") { - mappingURLGenerator = options.sourceMappingURL; - } - - if (mapNameGenerator) { - try { - options.sourceMap = mapNameGenerator(f.dest); - } catch (e) { - var err = new Error('SourceMapName failed.'); - err.origError = e; - grunt.fail.warn(err); - } - } - - if (mappingURLGenerator) { - try { - options.sourceMappingURL = mappingURLGenerator(f.dest); - } catch (e) { - var err = new Error('SourceMapName failed.'); - err.origError = e; - grunt.fail.warn(err); - } - } - - // Minify files, warn and fail on error. - var result; - try { - result = uglify.minify(src, f.dest, options); - } catch (e) { - var err = new Error('Uglification failed.'); - if (e.msg) { - err.message += ', ' + e.msg + '.'; - } - err.origError = e; - grunt.log.warn('Uglifying source "' + src + '" failed.'); - grunt.fail.warn(err); - } - - // Concat banner + minified source. - var output = banner + result.min + footer; - - // Write the destination file. - grunt.file.write(f.dest, output); - - // Write source map - if (options.sourceMap) { - grunt.file.write(options.sourceMap, result.sourceMap); - grunt.log.writeln('Source Map "' + options.sourceMap + '" created.'); - } - - // Print a success message. - grunt.log.writeln('File "' + f.dest + '" created.'); - - // ...and report some size information. - if (options.report) { - contrib.minMaxInfo(output, result.max, options.report); - } - }); - }); - -}; diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/comments.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/comments.js deleted file mode 100644 index fbb3703..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/comments.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * I am a comment - */ -function foo(){return 42}// @preserve preserve -// @license license -function bar(){return 2*foo()}/* @preserve - * multiline preserve - */ -/* @license - * multiline license - */ -function baz(){return bar()*bar()} \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress.js deleted file mode 100644 index a9c123e..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress.js +++ /dev/null @@ -1 +0,0 @@ -function longFunctionC(argumentC,argumentD){return longNameA+longNameB+argumentC+argumentD}var longNameA=1,longNameB=2,result=longFunctionC(3,4); \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle.js deleted file mode 100644 index c66c512..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle.js +++ /dev/null @@ -1 +0,0 @@ -function longFunctionC(a,b){return longNameA+longNameB+a+b}var longNameA=1,longNameB=2,result=longFunctionC(3,4); \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_beautify.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_beautify.js deleted file mode 100644 index 9bcd387..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_beautify.js +++ /dev/null @@ -1,5 +0,0 @@ -function longFunctionC(a, b) { - return longNameA + longNameB + a + b; -} - -var longNameA = 1, longNameB = 2, result = longFunctionC(3, 4); \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_except.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_except.js deleted file mode 100644 index 6830da9..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_except.js +++ /dev/null @@ -1 +0,0 @@ -function longFunctionC(argumentC,a){return longNameA+longNameB+argumentC+a}var longNameA=1,longNameB=2,result=longFunctionC(3,4); \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_sourcemap b/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_sourcemap deleted file mode 100644 index 864317a..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/compress_mangle_sourcemap +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"/dev/null","sources":["test/fixtures/src/simple.js"],"names":["longFunctionC","argumentC","argumentD","longNameA","longNameB","result"],"mappings":"AAOA,QAASA,eAAcC,EAAUC,GAC/B,MAAOC,WAAYC,UAAYH,EAAYC,EAL7C,GAAIC,WAAY,EAEZC,UAAY,EAMZC,OAASL,cAAc,EAAE"} \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/exportAll.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/exportAll.js deleted file mode 100644 index d072a33..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/exportAll.js +++ /dev/null @@ -1 +0,0 @@ -!function(exports,global){function longFunctionC(argumentC,argumentD){return longNameA+longNameB+argumentC+argumentD}global.testExport=exports;var longNameA=1,longNameB=2,result=longFunctionC(3,4);exports.longNameA=longNameA,exports.longNameB=longNameB,exports.longFunctionC=longFunctionC,exports.result=result}({},function(){return this}()); \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multifile.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/multifile.js deleted file mode 100644 index beb6c51..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multifile.js +++ /dev/null @@ -1 +0,0 @@ -function longFunctionC(argumentC,argumentD){return longNameA+longNameB+argumentC+argumentD}function foo(){return 42}function bar(){return 2*foo()}function baz(){return bar()*bar()}var longNameA=1,longNameB=2,result=longFunctionC(3,4); \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps1.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps1.js deleted file mode 100644 index 48e7cb9..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps1.js +++ /dev/null @@ -1,2 +0,0 @@ -function longFunctionC(a,b){return longNameA+longNameB+a+b}var longNameA=1,longNameB=2,result=longFunctionC(3,4); -//# sourceMappingURL=test/fixtures/expected/multiple_sourcemaps1.mapurl \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps1.map b/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps1.map deleted file mode 100644 index c5e3601..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps1.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test/fixtures/expected/multiple_sourcemaps1.js","sources":["test/fixtures/src/simple.js"],"names":["longFunctionC","argumentC","argumentD","longNameA","longNameB","result"],"mappings":"AAOA,QAASA,eAAcC,EAAUC,GAC/B,MAAOC,WAAYC,UAAYH,EAAYC,EAL7C,GAAIC,WAAY,EAEZC,UAAY,EAMZC,OAASL,cAAc,EAAE"} \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps2.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps2.js deleted file mode 100644 index 4e6814b..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps2.js +++ /dev/null @@ -1,2 +0,0 @@ -function foo(){return 42}function bar(){return 2*foo()}function baz(){return bar()*bar()} -//# sourceMappingURL=test/fixtures/expected/multiple_sourcemaps2.mapurl \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps2.map b/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps2.map deleted file mode 100644 index 18dd794..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/multiple_sourcemaps2.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test/fixtures/expected/multiple_sourcemaps2.js","sources":["test/fixtures/src/comments.js"],"names":["foo","bar","baz"],"mappings":"AAGA,QAASA,OACP,MAAO,IAIT,QAASC,OACP,MAAa,GAAND,MAQT,QAASE,OACP,MAAOD,OAAMA"} \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemap_prefix b/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemap_prefix deleted file mode 100644 index 0fcd108..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemap_prefix +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"/dev/null","sources":["simple.js"],"names":["longFunctionC","argumentC","argumentD","longNameA","longNameB","result"],"mappings":"AAOA,QAASA,eAAcC,EAAUC,GAC/B,MAAOC,WAAYC,UAAYH,EAAYC,EAL7C,GAAIC,WAAY,EAEZC,UAAY,EAMZC,OAASL,cAAc,EAAE"} \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapin b/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapin deleted file mode 100644 index ba936a7..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapin +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test/fixtures/expected/sourcemapin.js","sources":["test/fixtures/src/simple2.coffee"],"names":[],"mappings":"IAAC,YAAA,GAAA,OAAA,KAAA,KAAA,OAAA,SAAA,KAAA,MACA,QAAW,GACX,UAAW,EAGK,WAAhB,OAAS,KAGT,OAAS,SAAA,GAAA,MAAO,GAAI,GAGpB,MAAQ,EAAG,EAAG,EAAG,EAAG,GAGpB,MACG,KAAQ,KAAI,KACb,OAAQ,OACR,KAAQ,SAAA,GAAA,MAAO,GAAI,OAAO,KAG1B,KAAO,SAAA,OAAA,SAAS,MAAA,SAAA,GAAA,UAAA,UAAA,MAAA,KAAA,UAAA,MACf,MAAM,OAAQ,UAGf,mBAAsB,QAAA,MAAA,OAAtB,MAAM,cAGR,MAAA,SAAA,QAAS,IAAA,GAAT,KAAS,GAAA,EAAA,QAAyB,KAAA,OAAzB,QAAA,KAAA,GAAkB,IAAO,KAAA,IAAA,OAAA,KAAzB,KAAI,KAAM,KAAV,OAAA,SAAA,KAAA,UAAA,KAAA","sourceRoot":"http://local.host/js/"} \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapin.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapin.js deleted file mode 100644 index 959c179..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapin.js +++ /dev/null @@ -1,2 +0,0 @@ -void function(){var cubes,list,math,number,opposite,race,square;number=42,opposite=!0,opposite&&(number=-42),square=function(x){return x*x},list=[1,2,3,4,5],math={root:Math.sqrt,square:square,cube:function(x){return x*square(x)}},race=function(winner,runners){return runners=2<=arguments.length?[].slice.call(arguments,1):[],print(winner,runners)},"undefined"!=typeof elvis&&null!=elvis&&alert("I knew it!"),cubes=function(accum$){for(var num,i$=0,length$=list.length;length$>i$;++i$)num=list[i$],accum$.push(math.cube(num));return accum$}.call(this,[])}.call(this); -//# sourceMappingURL=test/fixtures/expected/sourcemapin \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapurl.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapurl.js deleted file mode 100644 index 930c9f4..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/sourcemapurl.js +++ /dev/null @@ -1,2 +0,0 @@ -function longFunctionC(a,b){return longNameA+longNameB+a+b}var longNameA=1,longNameB=2,result=longFunctionC(3,4); -//# sourceMappingURL=js/sourcemapurl.js.map \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/expected/wrap.js b/node_modules/grunt-contrib-uglify/test/fixtures/expected/wrap.js deleted file mode 100644 index 751c195..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/expected/wrap.js +++ /dev/null @@ -1 +0,0 @@ -!function(exports,global){function longFunctionC(argumentC,argumentD){return longNameA+longNameB+argumentC+argumentD}global.testExport=exports;var longNameA=1,longNameB=2;longFunctionC(3,4)}({},function(){return this}()); \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/src/comments.js b/node_modules/grunt-contrib-uglify/test/fixtures/src/comments.js deleted file mode 100644 index 32e5578..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/src/comments.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * I am a comment - */ -function foo() { - return 42; -} -// @preserve preserve -// @license license -function bar() { - return foo()*2; -} -/* @preserve - * multiline preserve - */ -/* @license - * multiline license - */ -function baz() { - return bar()*bar(); -} -// end - not preserved \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/src/simple.js b/node_modules/grunt-contrib-uglify/test/fixtures/src/simple.js deleted file mode 100644 index 00bc938..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/src/simple.js +++ /dev/null @@ -1,15 +0,0 @@ - -// Hello world, I'm a comment! - -var longNameA = 1; - -var longNameB = 2; - -function longFunctionC(argumentC,argumentD) { - return longNameA + longNameB + argumentC + argumentD; -} - -var result = longFunctionC(3,4); - -/*! I might be preserved, yay! */ - diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.coffee b/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.coffee deleted file mode 100644 index 113aa34..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.coffee +++ /dev/null @@ -1,28 +0,0 @@ -# Assignment: -number = 42 -opposite = true - -# Conditions: -number = -42 if opposite - -# Functions: -square = (x) -> x * x - -# Arrays: -list = [1, 2, 3, 4, 5] - -# Objects: -math = - root: Math.sqrt - square: square - cube: (x) -> x * square x - -# Splats: -race = (winner, runners...) -> - print winner, runners - -# Existence: -alert "I knew it!" if elvis? - -# Array comprehensions: -cubes = (math.cube num for num in list) \ No newline at end of file diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.js b/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.js deleted file mode 100644 index 31fd083..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.js +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by CoffeeScript 2.0.0-dev -void function () { - var cubes, list, math, number, opposite, race, square; - number = 42; - opposite = true; - if (opposite) - number = -42; - square = function (x) { - return x * x; - }; - list = [ - 1, - 2, - 3, - 4, - 5 - ]; - math = { - root: Math.sqrt, - square: square, - cube: function (x) { - return x * square(x); - } - }; - race = function (winner, runners) { - runners = 2 <= arguments.length ? [].slice.call(arguments, 1) : []; - return print(winner, runners); - }; - if ('undefined' !== typeof elvis && null != elvis) - alert('I knew it!'); - cubes = function (accum$) { - var num; - for (var i$ = 0, length$ = list.length; i$ < length$; ++i$) { - num = list[i$]; - accum$.push(math.cube(num)); - } - return accum$; - }.call(this, []); -}.call(this); diff --git a/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.map b/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.map deleted file mode 100644 index c77033c..0000000 --- a/node_modules/grunt-contrib-uglify/test/fixtures/src/simple2.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test/fixtures/src/simple2.coffee","sources":["test/fixtures/src/simple2.coffee"],"names":[],"mappings":"AAAC;;;EACA,MAAA,GAAW;EACX,QAAA,GAAW;EAGX,IAAgB,QAAhB,CAAA;AAAA,IAAA,MAAA,GAAS,CAAC;EAGV,MAAA,GAAS,SAAA,CAAA,CAAA,CAAA;WAAO,CAAA,CAAA,CAAA,CAAI;;EAGpB,IAAA,GAAO,CAAA;AAAA,IAAC,CAAD;AAAA,IAAI,CAAJ;AAAA,IAAO,CAAP;AAAA,IAAU,CAAV;AAAA,IAAa,CAAb;AAAA,EAAA;EAGP,IAAA,GACG,CAAA;AAAA,IAAA,IAAA,EAAQ,IAAI,KAAZ;AAAA,IACD,MAAA,EAAQ,MADP;AAAA,IAED,IAAA,EAAQ,SAAA,CAAA,CAAA,CAAA;aAAO,CAAA,CAAA,CAAA,CAAI,MAAA,CAAO,CAAP;KAFlB;AAAA,EAAA;EAKD,IAAA,GAAO,SAAA,CAAA,MAAA,EAAA,OAAA,CAAA;IAAS;WACf,KAAA,CAAM,MAAN,EAAc,OAAd;;EAGD,2BAAsB,KAAA,CAAA,EAAA,SAAA,KAAtB,CAAA;AAAA,IAAA,KAAA,CAAM,YAAN;EAGF,KAAA;;IAAS,2BAAyB,YAAzB,aAAA,CAAA,KAAA,CAAA;MAAkB,MAAO;kBAAzB,IAAI,KAAJ,CAAU,GAAV"} diff --git a/node_modules/grunt-contrib-uglify/test/uglify_test.js b/node_modules/grunt-contrib-uglify/test/uglify_test.js deleted file mode 100644 index 34838b7..0000000 --- a/node_modules/grunt-contrib-uglify/test/uglify_test.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -var grunt = require('grunt'); - -var tmp = 'tmp/', - fixtures = 'test/fixtures/expected/'; - -exports.contrib_uglify = { - preuglified_files: function(test) { - - var files = [ - 'comments.js', - 'compress.js', - 'compress_mangle.js', - 'compress_mangle_beautify.js', - 'compress_mangle_except.js', - 'compress_mangle_sourcemap', - 'sourcemapurl.js', - 'multifile.js', - 'wrap.js', - 'exportAll.js', - 'sourcemap_prefix' - ]; - - test.expect(files.length); - - files.forEach(function(file){ - var actual = grunt.file.read(tmp + file); - var expected = grunt.file.read(fixtures + file); - test.equal(actual, expected, 'task output should equal ' + file); - }); - - test.done(); - }, - relative_test : function(test) { - - var files = [ - 'sourcemapin', - 'sourcemapin.js', - 'multiple_sourcemaps1.js', - 'multiple_sourcemaps1.map', - 'multiple_sourcemaps2.js', - 'multiple_sourcemaps2.map', - ]; - - test.expect(files.length); - - files.forEach(function(file){ - var actual = grunt.file.read(tmp + file).replace(tmp,'REPLACED'); - var expected = grunt.file.read(fixtures + file).replace(fixtures,'REPLACED'); - test.equal(actual, expected, 'task output should equal ' + file); - }); - - test.done(); - } -}; diff --git a/node_modules/grunt-contrib-watch/.editorconfig b/node_modules/grunt-contrib-watch/.editorconfig deleted file mode 100644 index 6c5424e..0000000 --- a/node_modules/grunt-contrib-watch/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -# editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/.gitattributes b/node_modules/grunt-contrib-watch/.gitattributes deleted file mode 100644 index 2125666..0000000 --- a/node_modules/grunt-contrib-watch/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/.jshintrc b/node_modules/grunt-contrib-watch/.jshintrc deleted file mode 100644 index e0cc7bb..0000000 --- a/node_modules/grunt-contrib-watch/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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/node_modules/grunt-contrib-watch/.npmignore b/node_modules/grunt-contrib-watch/.npmignore deleted file mode 100644 index b785247..0000000 --- a/node_modules/grunt-contrib-watch/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp diff --git a/node_modules/grunt-contrib-watch/.travis.yml b/node_modules/grunt-contrib-watch/.travis.yml deleted file mode 100644 index 5766191..0000000 --- a/node_modules/grunt-contrib-watch/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/AUTHORS b/node_modules/grunt-contrib-watch/AUTHORS deleted file mode 100644 index 8353937..0000000 --- a/node_modules/grunt-contrib-watch/AUTHORS +++ /dev/null @@ -1,21 +0,0 @@ -Kyle Robinson Young (http://dontkry.com) -"Cowboy" Ben Alman (http://benalman.com) -Tyler Kellen (http://goingslowly.com) -Gong Hao -Jaime Pillora -Chris Danford -Jason San Jose -Oleg Seletsky -Jamie Stackhouse -Chris Talkington -Oliver Joseph Ash -Iskren Chernev -Joey Baker -John K. Paul -Jurie-Jan Botha -Michał Gołębiowski -Willie V -cfddream -Chris Wren -Daniel Steigerwald -Rich Trott diff --git a/node_modules/grunt-contrib-watch/CHANGELOG b/node_modules/grunt-contrib-watch/CHANGELOG deleted file mode 100644 index 13b2e94..0000000 --- a/node_modules/grunt-contrib-watch/CHANGELOG +++ /dev/null @@ -1,118 +0,0 @@ -v0.5.3: - date: 2013-08-25 - changes: - - Fixed for live reload missing files. -v0.5.2: - date: 2013-08-16 - changes: - - Fixed issue running tasks after gruntfile is reloaded. - - Ignores empty file paths. -v0.5.1: - date: 2013-07-20 - changes: - - Fixed issue with options resetting. -v0.5.0: - date: 2013-07-18 - changes: - - Added target name to watch event. - - Added atBegin option to run tasks when watcher starts. - - Changed nospawn option to spawn (nospawn still available for backwards compatibility). - - Moved libs/vars into top scope to prevent re-init. - - Bumped Gaze version to ~0.4. - - Re-grab task/target options upon each task run. - - Add dateFormat option to override the date/time output upon completion. -v0.4.4: - date: 2013-05-27 - changes: - - Remove gracefully closing SIGINT. Not needed and causes problems for Windows. - - Ensure tasks are an array to not conflict with cliArgs. -v0.4.3: - date: 2013-05-11 - changes: - - Only group changed files per target to send correct files to live reload. -v0.4.2: - date: 2013-05-09 - changes: - - Fix for closing watchers. -v0.4.1: - date: 2013-05-09 - changes: - - Removed "beep" notification. - - Tasks now optional with livereload option. - - Reverted "run again" with interrupt off to fix infinite recursion issue. - - Watchers now close more properly on task run. -v0.4.0: - date: 2013-05-03 - changes: - - Option livereload to start live reload servers. - - Will reload a Gruntfile before running tasks if Gruntfile is modified. - - Option event to only trigger watch on certain events. - - Refactor watch task into separate task runs per target. - - Option forever to override grunt.fatal/warn to help keeping the watch alive with nospawn enabled. - - Emit a beep upon complete. - - Logs all watched files with verbose flag set. - - If interrupt is off, will run the tasks once more if watch triggered during a previous task run. - - tasks property is optional for use with watch event. - - Watchers properly closed when exiting. -v0.3.1: - date: 2013-02-28 - changes: - - Fix for top level options. -v0.3.0: - date: 2013-02-27 - changes: - - nospawn option added to run tasks without spawning as child processes. - - Watch emits 'watch' events upon files being triggered with grunt.event. - - Completion time in seconds and date/time shown after tasks ran. - - Negate file patterns fixed. - - Tasks debounced individually to handle simultaneous triggering for multiple targets. - - Errors handled better and viewable with --stack cli option. - - Code complexity reduced making the watch task code easier to read. -v0.2.0: - date: 2013-02-15 - changes: - - First official release for Grunt 0.4.0. -v0.2.0rc7: - date: 2013-01-18 - changes: - - Updating grunt/gruntplugin dependencies to rc6. - - Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. -v0.2.0rc5: - date: 2013-01-09 - changes: - - Updating to work with grunt v0.4.0rc5. -v0.2.0a: - date: 2012-12-15 - changes: - - Conversion to grunt v0.4 conventions. - - Remove node v0.6 and grunt v0.3 support. - - Allow watch task to be renamed. - - Use grunt.util.spawn "grunt" option. - - Updated to gaze@0.3.0, forceWatchMethod option removed. -v0.1.4: - date: 2012-11-01 - changes: - - Prevent watch from spawning duplicate watch tasks -v0.1.3: - date: 2012-10-28 - changes: - - Better method to spawn the grunt bin - - Bump gaze to v0.2.0. Better handles some events and new option forceWatchMethod - - Only support Node.js >= v0.8 -v0.1.2: - date: 2012-10-17 - changes: - - Only spawn a process per task one at a time - - Add interrupt option to cancel previous spawned process - - Grunt v0.3 compatibility changes -v0.1.1: - date: 2012-10-16 - changes: - - Fallback to global grunt bin if local doesnt exist. Fatal if bin cannot be found - - Update to gaze 0.1.6 -v0.1.0: - date: 2012-10-08 - changes: - - Release watch task - - Remove spawn from helper - - Run on Grunt v0.4 diff --git a/node_modules/grunt-contrib-watch/CONTRIBUTING.md b/node_modules/grunt-contrib-watch/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt-contrib-watch/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt-contrib-watch/Gruntfile.js b/node_modules/grunt-contrib-watch/Gruntfile.js deleted file mode 100644 index f14da2f..0000000 --- a/node_modules/grunt-contrib-watch/Gruntfile.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * grunt-contrib-watch - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'tasks/**/*.js', - '<%= nodeunit.tests %>', - ], - options: { - jshintrc: '.jshintrc', - }, - }, - watch: { - all: { - files: ['<%= jshint.all %>'], - tasks: ['jshint', 'nodeunit'], - }, - }, - nodeunit: { - tests: ['test/tasks/*_test.js'], - }, - }); - - // Dynamic alias task to nodeunit. Run individual tests with: grunt test:events - grunt.registerTask('test', function(file) { - grunt.config('nodeunit.tests', String(grunt.config('nodeunit.tests')).replace('*', file || '*')); - grunt.task.run('nodeunit'); - }); - - grunt.loadTasks('tasks'); - - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-internal'); - - grunt.registerTask('default', ['jshint', 'nodeunit', 'build-contrib']); -}; diff --git a/node_modules/grunt-contrib-watch/LICENSE-MIT b/node_modules/grunt-contrib-watch/LICENSE-MIT deleted file mode 100644 index 9edf753..0000000 --- a/node_modules/grunt-contrib-watch/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 "Cowboy" Ben Alman, 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/node_modules/grunt-contrib-watch/README.md b/node_modules/grunt-contrib-watch/README.md deleted file mode 100644 index fd7c6da..0000000 --- a/node_modules/grunt-contrib-watch/README.md +++ /dev/null @@ -1,429 +0,0 @@ -# grunt-contrib-watch v0.5.3 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-watch.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-watch) - -> Run predefined tasks whenever watched file patterns are added, changed or deleted. - - - -## Getting Started -This plugin requires Grunt `~0.4.0` - -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-contrib-watch --save-dev -``` - -Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: - -```js -grunt.loadNpmTasks('grunt-contrib-watch'); -``` - - - - -## Watch task -_Run this task with the `grunt watch` command._ - - -### Settings - -There are a number of options available. Please review the [minimatch options here](https://github.com/isaacs/minimatch#options). As well as some additional options as follows: - -#### files -Type: `String|Array` - -This defines what file patterns this task will watch. Can be a string or an array of files and/or minimatch patterns. - -#### tasks -Type: `String|Array` - -This defines which tasks to run when a watched file event occurs. - -#### options.spawn -Type: `Boolean` -Default: true - -Whether to spawn task runs in a child process. Setting this option to `false` speeds up the reaction time of the watch (usually 500ms faster for most) and allows subsequent task runs to share the same context. Not spawning task runs can make the watch more prone to failing so please use as needed. - -Example: -```js -watch: { - scripts: { - files: ['**/*.js'], - tasks: ['jshint'], - options: { - spawn: false, - }, - }, -}, -``` - -*For backwards compatibility the option `nospawn` is still available and will do the opposite of `spawn`.* - -#### options.interrupt -Type: `Boolean` -Default: false - -As files are modified this watch task will spawn tasks in child processes. The default behavior will only spawn a new child process per target when the previous process has finished. Set the `interrupt` option to true to terminate the previous process and spawn a new one upon later changes. - -Example: -```js -watch: { - scripts: { - files: '**/*.js', - tasks: ['jshint'], - options: { - interrupt: true, - }, - }, -}, -``` - -#### options.debounceDelay -Type: `Integer` -Default: 500 - -How long to wait before emitting events in succession for the same filepath and status. For example if your `Gruntfile.js` file was `changed`, a `changed` event will only fire again after the given milliseconds. - -Example: -```js -watch: { - scripts: { - files: '**/*.js', - tasks: ['jshint'], - options: { - debounceDelay: 250, - }, - }, -}, -``` - -#### options.interval -Type: `Integer` -Default: 100 - -The `interval` is passed to `fs.watchFile`. Since `interval` is only used by `fs.watchFile` and this watcher also uses `fs.watch`; it is recommended to ignore this option. *Default is 100ms*. - -#### options.event -Type: `String|Array` -Default: `'all'` - -Specify the type watch event that trigger the specified task. This option can be one or many of: `'all'`, `'changed'`, `'added'` and `'deleted'`. - -Example: -```js -watch: { - scripts: { - files: '**/*.js', - tasks: ['generateFileManifest'], - options: { - event: ['added', 'deleted'], - }, - }, -}, -``` - -#### options.forever -Type: `Boolean` -Default: true - -This is *only a task level option* and cannot be configured per target. By default the watch task will duck punch `grunt.fatal` and `grunt.warn` to try and prevent them from exiting the watch process. If you don't want `grunt.fatal` and `grunt.warn` to be overridden set the `forever` option to `false`. - -#### options.dateFormat -Type: `Function` - -This is *only a task level option* and cannot be configured per target. By default when the watch has finished running tasks it will display the message `Completed in 1.301s at Thu Jul 18 2013 14:58:21 GMT-0700 (PDT) - Waiting...`. You can override this message by supplying your own function: - -```js -watch: { - options: { - dateFormat: function(time) { - grunt.log.writeln('The watch finished in ' + time + 'ms at' + (new Date()).toString()); - grunt.log.writeln('Waiting for more changes...'); - }, - }, - scripts: { - files: '**/*.js', - tasks: 'jshint', - }, -}, -``` - -#### options.atBegin -Type: `Boolean` -Default: false - -This option will trigger the run of each specified task at startup of the watcher. - -#### options.livereload -Type: `Boolean|Number|Object` -Default: false - -Set to `true` or set `livereload: 1337` to a port number to enable live reloading. Default and recommended port is `35729`. - -If enabled a live reload server will be started with the watch task per target. Then after the indicated tasks have ran, the live reload server will be triggered with the modified files. - -Example: -```js -watch: { - css: { - files: '**/*.sass', - tasks: ['sass'], - options: { - livereload: true, - }, - }, -}, -``` - -### Examples - -```js -// Simple config to run jshint any time a file is added, changed or deleted -grunt.initConfig({ - watch: { - files: ['**/*'], - tasks: ['jshint'], - }, -}); -``` - -```js -// Advanced config. Run specific tasks when specific files are added, changed or deleted. -grunt.initConfig({ - watch: { - gruntfile: { - files: 'Gruntfile.js', - tasks: ['jshint:gruntfile'], - }, - src: { - files: ['lib/*.js', 'css/**/*.scss', '!lib/dontwatch.js'], - tasks: ['default'], - }, - test: { - files: '<%= jshint.test.src %>', - tasks: ['jshint:test', 'qunit'], - }, - }, -}); -``` - -#### Using the `watch` event -This task will emit a `watch` event when watched files are modified. This is useful if you would like a simple notification when files are edited or if you're using this task in tandem with another task. Here is a simple example using the `watch` event: - -```js -grunt.initConfig({ - watch: { - scripts: { - files: ['lib/*.js'], - }, - }, -}); -grunt.event.on('watch', function(action, filepath, target) { - grunt.log.writeln(target + ': ' + filepath + ' has ' + action); -}); -``` - -**The `watch` event is not intended for replacing the standard Grunt API for configuring and running tasks. If you're trying to run tasks from within the `watch` event you're more than likely doing it wrong. Please read [configuring tasks](http://gruntjs.com/configuring-tasks).** - -##### Compiling Files As Needed -A very common request is to only compile files as needed. Here is an example that will only lint changed files with the `jshint` task: - -```js -grunt.initConfig({ - watch: { - scripts: { - files: ['lib/*.js'], - tasks: ['jshint'], - options: { - spawn: false, - }, - }, - }, - jshint: { - all: ['lib/*.js'], - }, -}); - -// on watch events configure jshint:all to only run on changed file -grunt.event.on('watch', function(action, filepath) { - grunt.config(['jshint', 'all'], filepath); -}); -``` - -If you need to dynamically modify your config, the `spawn` option must be disabled to keep the watch running under the same context. - -If you save multiple files simultaneously you may opt for a more robust method: - -```js -var changedFiles = Object.create(null); -var onChange = grunt.util._.debounce(function() { - grunt.config(['jshint', 'all'], Object.keys(changedFiles)); - changedFiles = Object.create(null); -}, 200); -grunt.event.on('watch', function(action, filepath) { - changedFiles[filepath] = action; - onChange(); -}); -``` - -#### Live Reloading -Live reloading is built into the watch task. Set the option `livereload` to `true` to enable on the default port `35729` or set to a custom port: `livereload: 1337`. - -The simplest way to add live reloading to all your watch targets is by setting `livereload` to `true` at the task level. This will run a single live reload server and trigger the live reload for all your watch targets: - -```js -grunt.initConfig({ - watch: { - options: { - livereload: true, - }, - css: { - files: ['public/scss/*.scss'], - tasks: ['compass'], - }, - }, -}); -``` - -You can also configure live reload for individual watch targets or run multiple live reload servers. Just be sure if you're starting multiple servers they operate on different ports: - -```js -grunt.initConfig({ - watch: { - css: { - files: ['public/scss/*.scss'], - tasks: ['compass'], - options: { - // Start a live reload server on the default port 35729 - livereload: true, - }, - }, - another: { - files: ['lib/*.js'], - tasks: ['anothertask'], - options: { - // Start another live reload server on port 1337 - livereload: 1337, - }, - }, - dont: { - files: ['other/stuff/*'], - tasks: ['dostuff'], - }, - }, -}); -``` - -##### Enabling Live Reload in Your HTML -Once you've started a live reload server you'll be able to access the live reload script. To enable live reload on your page, add a script tag before your closing `` tag pointing to the `livereload.js` script: - -```html - -``` - -Feel free to add this script to your template situation and toggle with some sort of `dev` flag. - -##### Using Live Reload with the Browser Extension -Instead of adding a script tag to your page, you can live reload your page by installing a browser extension. Please visit [how do I install and use the browser extensions](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-) for help installing an extension for your browser. - -Once installed please use the default live reload port `35729` and the browser extension will automatically reload your page without needing the ` -``` - -Feel free to add this script to your template situation and toggle with some sort of `dev` flag. - -### Using Live Reload with the Browser Extension -Instead of adding a script tag to your page, you can live reload your page by installing a browser extension. Please visit [how do I install and use the browser extensions](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-) for help installing an extension for your browser. - -Once installed please use the default live reload port `35729` and the browser extension will automatically reload your page without needing 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/bestiejs/lodash/wiki/Changelog). - -## BestieJS - -Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Kit Cambridge](http://kitcambridge.github.com/) - [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build.js deleted file mode 100755 index 4e34c82..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build.js +++ /dev/null @@ -1,2509 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** Load modules */ - var fs = require('fs'), - path = require('path'), - vm = require('vm'), - minify = require(path.join(__dirname, 'build', 'minify.js')), - _ = require(path.join(__dirname, 'lodash.js')); - - /** The current working directory */ - var cwd = process.cwd(); - - /** Used for array method references */ - var arrayRef = []; - - /** Shortcut used to push arrays of values to an array */ - var push = arrayRef.push; - - /** Shortcut used to convert array-like objects to arrays */ - var slice = arrayRef.slice; - - /** Shortcut to the `stdout` object */ - var stdout = process.stdout; - - /** Used to associate aliases with their real names */ - var aliasToRealMap = { - 'all': 'every', - 'any': 'some', - 'collect': 'map', - 'detect': 'find', - 'drop': 'rest', - 'each': 'forEach', - 'extend': 'assign', - 'foldl': 'reduce', - 'foldr': 'reduceRight', - 'head': 'first', - 'include': 'contains', - 'inject': 'reduce', - 'methods': 'functions', - 'select': 'filter', - 'tail': 'rest', - 'take': 'first', - 'unique': 'uniq' - }; - - /** Used to associate real names with their aliases */ - var realToAliasMap = { - 'assign': ['extend'], - 'contains': ['include'], - 'every': ['all'], - 'filter': ['select'], - 'find': ['detect'], - 'first': ['head', 'take'], - 'forEach': ['each'], - 'functions': ['methods'], - 'map': ['collect'], - 'reduce': ['foldl', 'inject'], - 'reduceRight': ['foldr'], - 'rest': ['drop', 'tail'], - 'some': ['any'], - 'uniq': ['unique'] - }; - - /** Used to track function dependencies */ - var dependencyMap = { - 'after': [], - 'assign': ['isArray', 'forEach', 'forOwn'], - 'at': ['isString'], - 'bind': ['isFunction', 'isObject'], - 'bindAll': ['bind', 'functions'], - 'bindKey': ['isFunction', 'isObject'], - 'clone': ['assign', 'forEach', 'forOwn', 'isArray', 'isObject'], - 'cloneDeep': ['clone'], - 'compact': [], - 'compose': [], - 'contains': ['indexOf', 'isString'], - 'countBy': ['forEach', 'identity', 'isEqual', 'keys'], - 'debounce': [], - 'defaults': ['isArray', 'forEach', 'forOwn'], - 'defer': ['bind'], - 'delay': [], - 'difference': ['indexOf'], - 'escape': [], - 'every': ['identity', 'isArray', 'isEqual', 'keys'], - 'filter': ['identity', 'isArray', 'isEqual', 'keys'], - 'find': ['forEach', 'identity', 'isEqual', 'keys'], - 'first': [], - 'flatten': ['isArray'], - 'forEach': ['identity', 'isArguments', 'isArray', 'isString'], - 'forIn': ['identity', 'isArguments'], - 'forOwn': ['identity', 'isArguments'], - 'functions': ['forIn', 'isFunction'], - 'groupBy': ['forEach', 'identity', 'isEqual', 'keys'], - 'has': [], - 'identity': [], - 'indexOf': ['sortedIndex'], - 'initial': [], - 'intersection': ['indexOf'], - 'invert': ['keys'], - 'invoke': ['forEach'], - 'isArguments': [], - 'isArray': [], - 'isBoolean': [], - 'isDate': [], - 'isElement': [], - 'isEmpty': ['forOwn', 'isArguments', 'isFunction'], - 'isEqual': ['forIn', 'isArguments', 'isFunction'], - 'isFinite': [], - 'isFunction': [], - 'isNaN': ['isNumber'], - 'isNull': [], - 'isNumber': [], - 'isObject': [], - 'isPlainObject': ['forIn', 'isArguments', 'isFunction'], - 'isRegExp': [], - 'isString': [], - 'isUndefined': [], - 'keys': ['forOwn', 'isArguments', 'isObject'], - 'last': [], - 'lastIndexOf': [], - 'map': ['identity', 'isArray', 'isEqual', 'keys'], - 'max': ['isArray', 'isEqual', 'isString', 'keys'], - 'memoize': [], - 'merge': ['forEach', 'forOwn', 'isArray', 'isObject', 'isPlainObject'], - 'min': ['isArray', 'isEqual', 'isString', 'keys'], - 'mixin': ['forEach', 'forOwn', 'functions'], - 'noConflict': [], - 'object': [], - 'omit': ['forIn', 'indexOf'], - 'once': [], - 'pairs': ['keys'], - 'partial': ['isFunction', 'isObject'], - 'partialRight': ['isFunction', 'isObject'], - 'pick': ['forIn', 'isObject'], - 'pluck': ['map'], - 'random': [], - 'range': [], - 'reduce': ['identity', 'isArray', 'isEqual', 'keys'], - 'reduceRight': ['forEach', 'identity', 'isEqual', 'isString', 'keys'], - 'reject': ['filter', 'identity', 'isEqual', 'keys'], - 'rest': [], - 'result': ['isFunction'], - 'shuffle': ['forEach'], - 'size': ['keys'], - 'some': ['identity', 'isArray', 'isEqual', 'keys'], - 'sortBy': ['forEach', 'identity', 'isEqual', 'keys'], - 'sortedIndex': ['identity', 'isEqual', 'keys'], - 'tap': ['mixin'], - 'template': ['defaults', 'escape', 'keys', 'values'], - 'throttle': [], - 'times': [], - 'toArray': ['isString', 'values'], - 'unescape': [], - 'union': ['uniq'], - 'uniq': ['indexOf', 'isEqual', 'keys'], - 'uniqueId': [], - 'value': ['mixin'], - 'values': ['keys'], - 'where': ['filter'], - 'without': ['indexOf'], - 'wrap': [], - 'zip': ['max', 'pluck'], - - // method used by the `backbone` and `underscore` builds - 'chain': ['mixin'], - 'findWhere': ['where'] - }; - - /** Used to inline `iteratorTemplate` */ - var iteratorOptions = [ - 'args', - 'arrays', - 'bottom', - 'firstArg', - 'hasDontEnumBug', - 'hasEnumPrototype', - 'isKeysFast', - 'loop', - 'nonEnumArgs', - 'noCharByIndex', - 'shadowed', - 'top', - 'useHas' - ]; - - /** List of all Lo-Dash methods */ - var allMethods = _.keys(dependencyMap); - - /** List of Backbone's Lo-Dash dependencies */ - var backboneDependencies = [ - 'bind', - 'bindAll', - 'chain', - 'clone', - 'contains', - 'countBy', - 'defaults', - 'escape', - 'every', - 'extend', - 'filter', - 'find', - 'first', - 'forEach', - 'groupBy', - 'has', - 'indexOf', - 'initial', - 'invoke', - 'isArray', - 'isEmpty', - 'isEqual', - 'isFunction', - 'isObject', - 'isRegExp', - 'isString', - 'keys', - 'last', - 'lastIndexOf', - 'map', - 'max', - 'min', - 'mixin', - 'once', - 'pick', - 'reduce', - 'reduceRight', - 'reject', - 'rest', - 'result', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'sortedIndex', - 'toArray', - 'uniqueId', - 'value', - 'without' - ]; - - /** List of methods used by Underscore */ - var underscoreMethods = _.without.apply(_, [allMethods].concat([ - 'at', - 'bindKey', - 'cloneDeep', - 'forIn', - 'forOwn', - 'isPlainObject', - 'merge', - 'partialRight' - ])); - - /** List of ways to export the `lodash` function */ - var exportsAll = [ - 'amd', - 'commonjs', - 'global', - 'node' - ]; - - /*--------------------------------------------------------------------------*/ - - /** - * Adds support for Underscore style chaining to the `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function addChainMethods(source) { - // add `_.chain` - source = source.replace(matchFunction(source, 'tap'), function(match) { - return [ - '', - ' /**', - ' * Creates a `lodash` object that wraps the given `value`.', - ' *', - ' * @static', - ' * @memberOf _', - ' * @category Chaining', - ' * @param {Mixed} value The value to wrap.', - ' * @returns {Object} Returns the wrapper object.', - ' * @example', - ' *', - ' * var stooges = [', - " * { 'name': 'moe', 'age': 40 },", - " * { 'name': 'larry', 'age': 50 },", - " * { 'name': 'curly', 'age': 60 }", - ' * ];', - ' *', - ' * var youngest = _.chain(stooges)', - ' * .sortBy(function(stooge) { return stooge.age; })', - " * .map(function(stooge) { return stooge.name + ' is ' + stooge.age; })", - ' * .first();', - " * // => 'moe is 40'", - ' */', - ' function chain(value) {', - ' value = new lodash(value);', - ' value.__chain__ = true;', - ' return value;', - ' }', - '', - match - ].join('\n'); - }); - - // add `wrapperChain` - source = source.replace(matchFunction(source, 'wrapperToString'), function(match) { - return [ - '', - ' /**', - ' * Enables method chaining on the wrapper object.', - ' *', - ' * @name chain', - ' * @memberOf _', - ' * @category Chaining', - ' * @returns {Mixed} Returns the wrapper object.', - ' * @example', - ' *', - ' * var sum = _([1, 2, 3])', - ' * .chain()', - ' * .reduce(function(sum, num) { return sum + num; })', - ' * .value()', - ' * // => 6`', - ' */', - ' function wrapperChain() {', - ' this.__chain__ = true;', - ' return this;', - ' }', - '', - match - ].join('\n'); - }); - - // add `lodash.chain` assignment - source = source.replace(getMethodAssignments(source), function(match) { - return match.replace(/^(?: *\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\n)?( *)lodash\.VERSION *=/m, '$1lodash.chain = chain;\n\n$&'); - }); - - // add `lodash.prototype.chain` assignment - source = source.replace(/^( *)lodash\.prototype\.value *=.+\n/m, '$1lodash.prototype.chain = wrapperChain;\n$&'); - - // remove `lodash.prototype.toString` and `lodash.prototype.valueOf` assignments - source = source.replace(/^ *lodash\.prototype\.(?:toString|valueOf) *=.+\n/gm, ''); - - // remove `lodash.prototype` batch method assignments - source = source.replace(/(?:\s*\/\/.*)*\n( *)forOwn\(lodash, *function\(func, *methodName\)[\s\S]+?\n\1}.+/g, ''); - - // move `mixin(lodash)` to after the method assignments - source = source.replace(/(?:\s*\/\/.*)*\s*mixin\(lodash\).+/, ''); - source = source.replace(getMethodAssignments(source), function(match) { - return match + [ - '', - '', - ' // add functions to `lodash.prototype`', - ' mixin(lodash);' - ].join('\n'); - }); - - // add `__chain__` checks to `_.mixin` - source = source.replace(matchFunction(source, 'mixin'), function(match) { - return match.replace(/^( *)return new lodash.+/m, function() { - var indent = arguments[1]; - return indent + [ - '', - 'var result = func.apply(lodash, args);', - 'if (this.__chain__) {', - ' result = new lodash(result);', - ' result.__chain__ = true;', - '}', - 'return result;' - ].join('\n' + indent); - }); - }); - - // replace wrapper `Array` method assignments - source = source.replace(/^(?: *\/\/.*\n)*( *)each\(\['[\s\S]+?\n\1}$/m, function() { - return [ - ' // add `Array` mutator functions to the wrapper', - " each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {", - ' var func = arrayRef[methodName];', - ' lodash.prototype[methodName] = function() {', - ' var value = this.__wrapped__;', - ' func.apply(value, arguments);', - '', - ' // avoid array-like object bugs with `Array#shift` and `Array#splice`', - ' // in Firefox < 10 and IE < 9', - ' if (hasObjectSpliceBug && value.length === 0) {', - ' delete value[0];', - ' }', - ' return this;', - ' };', - ' });', - '', - ' // add `Array` accessor functions to the wrapper', - " each(['concat', 'join', 'slice'], function(methodName) {", - ' var func = arrayRef[methodName];', - ' lodash.prototype[methodName] = function() {', - ' var value = this.__wrapped__,', - ' result = func.apply(value, arguments);', - '', - ' if (this.__chain__) {', - ' result = new lodash(result);', - ' result.__chain__ = true;', - ' }', - ' return result;', - ' };', - ' });' - ].join('\n'); - }); - - return source; - } - - /** - * Adds build `commands` to the copyright/license header of the `source`. - * - * @private - * @param {String} source The source to process. - * @param {Array} [commands=[]] An array of commands. - * @returns {String} Returns the modified source. - */ - function addCommandsToHeader(source, commands) { - return source.replace(/(\/\**\n)( \*)( *@license[\s*]+)( *Lo-Dash [\w.-]+)(.*)/, function() { - // remove `node path/to/build.js` from `commands` - if (commands[0] == 'node') { - commands.splice(0, 2); - } - // add quotes to commands with spaces or equals signs - commands = _.map(commands, function(command) { - var separator = (command.match(/[= ]/) || [''])[0]; - if (separator) { - var pair = command.split(separator); - command = pair[0] + separator + '"' + pair[1] + '"'; - } - // escape newlines, carriage returns, multi-line comment end tokens - command = command - .replace(/\n/g, '\\n') - .replace(/\r/g, '\\r') - .replace(/\*\//g, '*\\/'); - - return command; - }); - // add build commands to copyright/license header - var parts = slice.call(arguments, 1); - return ( - parts[0] + - parts[1] + - parts[2] + parts[3] + ' (Custom Build)' + parts[4] + '\n' + - parts[1] + ' Build: `lodash ' + commands.join(' ') + '`' - ); - }); - } - - /** - * Compiles template files matched by the given file path `pattern` into a - * single source, extending `_.templates` with precompiled templates named after - * each template file's basename. - * - * @private - * @param {String} [pattern='/*.jst'] The file path pattern. - * @param {Object} options The options object. - * @returns {String} Returns the compiled source. - */ - function buildTemplate(pattern, options) { - pattern || (pattern = path.join(cwd, '*.jst')); - - var directory = path.dirname(pattern); - - var source = [ - ';(function(window) {', - " var freeExports = typeof exports == 'object' && exports;", - '', - " var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;", - '', - " var freeGlobal = typeof global == 'object' && global;", - ' if (freeGlobal.global === freeGlobal) {', - ' window = freeGlobal;', - ' }', - '', - ' var templates = {},', - ' _ = window._;', - '' - ]; - - // convert to a regexp - pattern = RegExp( - path.basename(pattern) - .replace(/[.+?^=!:${}()|[\]\/\\]/g, '\\$&') - .replace(/\*/g, '.*?') + '$' - ); - - fs.readdirSync(directory).forEach(function(filename) { - var filePath = path.join(directory, filename); - if (pattern.test(filename)) { - var text = fs.readFileSync(filePath, 'utf8'), - precompiled = getFunctionSource(_.template(text, null, options)), - prop = filename.replace(/\..*$/, ''); - - source.push(" templates['" + prop.replace(/['\n\r\t]/g, '\\$&') + "'] = " + precompiled + ';', ''); - } - }); - - source.push( - " if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {", - " define(['" + options.moduleId + "'], function(lodash) {", - ' _ = lodash;', - ' lodash.templates = lodash.extend(lodash.templates || {}, templates);', - ' });', - " } else if (freeExports) {", - " if (freeModule) {", - ' (freeModule.exports = templates).templates = templates;', - ' } else {', - ' freeExports.templates = templates;', - ' }', - ' } else if (_) {', - ' _.templates = _.extend(_.templates || {}, templates);', - ' }', - '}(this));' - ); - - return source.join('\n'); - } - - /** - * Capitalizes a given string. - * - * @private - * @param {String} string The string to capitalize. - * @returns {String} Returns the capitalized string. - */ - function capitalize(string) { - return string[0].toUpperCase() + string.toLowerCase().slice(1); - } - - /** - * Removes unnecessary comments, whitespace, and pseudo private properties. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function cleanupSource(source) { - return source - // remove pseudo private properties - .replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n') - // remove lines with just whitespace and semicolons - .replace(/^ *;\n/gm, '') - // consolidate multiple newlines - .replace(/\n{3,}/g, '\n\n') - // consolidate consecutive horizontal rule comment separators - .replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) { - return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*')); - }); - } - - /** - * Writes the help message to standard output. - * - * @private - */ - function displayHelp() { - console.log([ - '', - ' Commands:', - '', - ' lodash backbone Build with only methods required by Backbone', - ' lodash csp Build supporting default Content Security Policy restrictions', - ' lodash legacy Build tailored for older environments without ES5 support', - ' lodash modern Build tailored for newer environments with ES5 support', - ' lodash mobile Build without method compilation and most bug fixes for old browsers', - ' lodash strict Build with `_.assign`, `_.bindAll`, & `_.defaults` in strict mode', - ' lodash underscore Build tailored for projects already using Underscore', - ' lodash include=... Comma separated method/category names to include in the build', - ' lodash minus=... Comma separated method/category names to remove from those included in the build', - ' lodash plus=... Comma separated method/category names to add to those included in the build', - ' lodash category=... Comma separated categories of methods to include in the build (case-insensitive)', - ' (i.e. “arrays”, “chaining”, “collections”, “functions”, “objects”, and “utilities”)', - ' lodash exports=... Comma separated names of ways to export the `lodash` function', - ' (i.e. “amd”, “commonjs”, “global”, “node”, and “none”)', - ' lodash iife=... Code to replace the immediately-invoked function expression that wraps Lo-Dash', - ' (e.g. `lodash iife="!function(window,undefined){%output%}(this)"`)', - '', - ' lodash template=... File path pattern used to match template files to precompile', - ' (e.g. `lodash template=./*.jst`)', - ' lodash settings=... Template settings used when precompiling templates', - ' (e.g. `lodash settings="{interpolate:/{{([\\s\\S]+?)}}/g}"`)', - ' lodash moduleId=... The AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates', - '', - ' All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.', - ' Unless specified by `-o` or `--output`, all files created are saved to the current working directory.', - '', - ' Options:', - '', - ' -c, --stdout Write output to standard output', - ' -d, --debug Write only the non-minified development output', - ' -h, --help Display help information', - ' -m, --minify Write only the minified production output', - ' -o, --output Write output to a given path/filename', - ' -p, --source-map Generate a source map for the minified output, using an optional source map URL', - ' -s, --silent Skip status updates normally logged to the console', - ' -V, --version Output current version of Lo-Dash', - '' - ].join('\n')); - } - - /** - * Gets the aliases associated with a given function name. - * - * @private - * @param {String} methodName The name of the method to get aliases for. - * @returns {Array} Returns an array of aliases. - */ - function getAliases(methodName) { - return realToAliasMap[methodName] || []; - } - - /** - * Gets the category of the given method name. - * - * @private - * @param {String} source The source to inspect. - * @param {String} methodName The method name. - * @returns {String} Returns the method name's category. - */ - function getCategory(source, methodName) { - var result = /@category +(\w+)/.exec(matchFunction(source, methodName)); - return result ? result[1] : ''; - } - - /** - * Gets an array of category dependencies for a given category. - * - * @private - * @param {String} source The source to inspect. - * @param {String} category The category. - * @returns {Array} Returns an array of cetegory dependants. - */ - function getCategoryDependencies(source, category) { - var methods = _.uniq(getMethodsByCategory(source, category).reduce(function(result, methodName) { - push.apply(result, getDependencies(methodName)); - return result; - }, [])); - - var categories = _.uniq(methods.map(function(methodName) { - return getCategory(source, methodName); - })); - - return categories.filter(function(other) { - return other != category; - }); - } - - /** - * Gets an array of depenants for a method by a given name. - * - * @private - * @param {String} methodName The method name. - * @returns {Array} Returns an array of method dependants. - */ - function getDependants(methodName) { - // iterate over the `dependencyMap`, adding the names of methods that - // have `methodName` as a dependency - return _.reduce(dependencyMap, function(result, dependencies, otherName) { - if (_.contains(dependencies, methodName)) { - result.push(otherName); - } - return result; - }, []); - } - - /** - * Gets an array of dependencies for a given method name. If passed an array - * of dependencies it will return an array containing the given dependencies - * plus any additional detected sub-dependencies. - * - * @private - * @param {Array|String} methodName A single method name or array of - * dependencies to query. - * @returns {Array} Returns an array of method dependencies. - */ - function getDependencies(methodName) { - var dependencies = Array.isArray(methodName) ? methodName : dependencyMap[methodName]; - if (!dependencies) { - return []; - } - // recursively accumulate the dependencies of the `methodName` function, and - // the dependencies of its dependencies, and so on - return _.uniq(dependencies.reduce(function(result, otherName) { - result.push.apply(result, getDependencies(otherName).concat(otherName)); - return result; - }, [])); - } - - /** - * Gets the formatted source of the given function. - * - * @private - * @param {Function} func The function to process. - * @returns {String} Returns the formatted source. - */ - function getFunctionSource(func) { - var source = func.source || (func + ''); - - // format leading whitespace - return source.replace(/\n(?:.*)/g, function(match, index) { - match = match.slice(1); - return ( - match == '}' && source.indexOf('}', index + 2) < 0 ? '\n ' : '\n ' - ) + match; - }); - } - - /** - * Gets the `_.isArguments` fallback from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the `isArguments` fallback. - */ - function getIsArgumentsFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:noArgsClass|!isArguments)[\s\S]+?};\n\1}/) || [''])[0]; - } - - /** - * Gets the `_.isFunction` fallback from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the `isFunction` fallback. - */ - function getIsFunctionFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(isFunction\(\/x\/[\s\S]+?};\n\1}/) || [''])[0]; - } - - /** - * Gets the `iteratorTemplate` from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the `iteratorTemplate`. - */ - function getIteratorTemplate(source) { - return (source.match(/^( *)var iteratorTemplate *= *[\s\S]+?\n\1.+?;\n/m) || [''])[0]; - } - - /** - * Gets the Lo-Dash method assignments snippet from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the method assignments snippet. - */ - function getMethodAssignments(source) { - return (source.match(/\/\*-+\*\/\n(?:\s*\/\/.*)*\s*lodash\.\w+ *=[\s\S]+?lodash\.VERSION *=.+/) || [''])[0]; - } - - /** - * Gets the names of methods in `source` belonging to the given `category`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} category The category to filter by. - * @returns {Array} Returns a new array of method names belonging to the given category. - */ - function getMethodsByCategory(source, category) { - return allMethods.filter(function(methodName) { - return getCategory(source, methodName) == category; - }); - } - - /** - * Gets the real name, not alias, of a given method name. - * - * @private - * @param {String} methodName The name of the method to resolve. - * @returns {String} Returns the real method name. - */ - function getRealName(methodName) { - return aliasToRealMap[methodName] || methodName; - } - - /** - * Determines if all functions of the given names have been removed from `source`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} [funcName1, funcName2, ...] The names of functions to check. - * @returns {Boolean} Returns `true` if all functions have been removed, else `false`. - */ - function isRemoved(source) { - return slice.call(arguments, 1).every(function(funcName) { - return !matchFunction(source, funcName); - }); - } - - /** - * Searches `source` for a `funcName` function declaration, expression, or - * assignment and returns the matched snippet. - * - * @private - * @param {String} source The source to inspect. - * @param {String} funcName The name of the function to match. - * @returns {String} Returns the matched function snippet. - */ - function matchFunction(source, funcName) { - var result = source.match(RegExp( - // match multi-line comment block (could be on a single line) - '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/\\n)?' + - // begin non-capturing group - '( *)(?:' + - // match a function declaration - 'function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' + - // match a variable declaration with function expression - 'var ' + funcName + ' *=.*?function[\\s\\S]+?\\n\\1};' + - // end non-capturing group - ')\\n' - )); - - // match variables that are explicitly defined as functions - result || (result = source.match(RegExp( - // match multi-line comment block - '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' + - // match simple variable declarations and those with `createIterator` - ' *var ' + funcName + ' *=(?:.+?|.*?createIterator\\([\\s\\S]+?\\));\\n' - ))); - - return /@type +Function|function\s*\w*\(/.test(result) ? result[0] : ''; - } - - /** - * Converts a comma separated options string into an array. - * - * @private - * @param {String} value The option to convert. - * @returns {Array} Returns the new converted array. - */ - function optionToArray(value) { - return value.match(/\w+=(.*)$/)[1].split(/, */); - } - - /** - * Converts a comma separated options string into an array containing - * only real method names. - * - * @private - * @param {String} source The source to inspect. - * @param {String} value The option to convert. - * @returns {Array} Returns the new converted array. - */ - function optionToMethodsArray(source, value) { - var methodNames = optionToArray(value); - - // convert categories to method names - methodNames.forEach(function(category) { - push.apply(methodNames, getMethodsByCategory(source, category)); - }); - - // convert aliases to real method names - methodNames = methodNames.map(getRealName); - - // remove nonexistent and duplicate method names - return _.uniq(_.intersection(allMethods, methodNames)); - } - - /** - * Removes all `argsAreObjects` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeArgsAreObjects(source) { - source = removeVar(source, 'argsAreObjects'); - - // remove `argsAreObjects` from `_.isArray` - source = source.replace(matchFunction(source, 'isArray'), function(match) { - return match.replace(/\(argsAreObjects && *([^)]+)\)/g, '$1'); - }); - - // remove `argsAreObjects` from `_.isEqual` - source = source.replace(matchFunction(source, 'isEqual'), function(match) { - return match.replace(/!argsAreObjects[^:]+:\s*/g, ''); - }); - - return source; - } - - /** - * Removes the all references to `varName` from `createIterator` in `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} varName The name of the variable to remove. - * @returns {String} Returns the modified source. - */ - function removeFromCreateIterator(source, varName) { - var snippet = matchFunction(source, 'createIterator'); - if ( snippet) { - // remove data object property assignment - var modified = snippet.replace(RegExp("^ *'" + varName + "': *" + varName + '.+\\n', 'm'), ''); - source = source.replace(snippet, modified); - - // clip at the `factory` assignment - snippet = modified.match(/Function\([\s\S]+$/)[0]; - - modified = snippet - .replace(RegExp('\\b' + varName + '\\b,? *', 'g'), '') - .replace(/, *',/, "',") - .replace(/,\s*\)/, ')') - - source = source.replace(snippet, modified); - } - return source; - } - - /** - * Removes the `funcName` function declaration, expression, or assignment and - * associated code from `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} funcName The name of the function to remove. - * @returns {String} Returns the modified source. - */ - function removeFunction(source, funcName) { - // remove function - var snippet = matchFunction(source, funcName); - if (snippet) { - source = source.replace(snippet, ''); - } - // grab the method assignments snippet - snippet = getMethodAssignments(source); - - // remove assignment and aliases - var modified = getAliases(funcName).concat(funcName).reduce(function(result, otherName) { - return result.replace(RegExp('(?:\\n *//.*\\s*)* *lodash\\.' + otherName + ' *= *.+\\n'), ''); - }, snippet); - - // replace with the modified snippet - source = source.replace(snippet, modified); - - return removeFromCreateIterator(source, funcName); - } - - /** - * Removes all `hasDontEnumBug` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeHasDontEnumBug(source) { - source = removeFromCreateIterator(source, 'hasDontEnumBug'); - source = removeFromCreateIterator(source, 'shadowed'); - - // remove `hasDontEnumBug` declaration and assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var hasDontEnumBug\b.*|.+?hasDontEnumBug *=.+/g, ''); - - // remove `shadowed` variable - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var shadowed[\s\S]+?;\n/, ''); - - // remove `hasDontEnumBug` from `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match.replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(hasDontEnumBug[\s\S]+?["']\1<% *} *%>.+/, ''); - }); - - return source; - } - - /** - * Removes all `hasEnumPrototype` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeHasEnumPrototype(source) { - source = removeFromCreateIterator(source, 'hasEnumPrototype'); - - // remove `hasEnumPrototype` declaration and assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var hasEnumPrototype\b.*|.+?hasEnumPrototype *=.+/g, ''); - - // remove `hasEnumPrototype` from `_.keys` - source = source.replace(matchFunction(source, 'keys'), function(match) { - return match - .replace(/\(hasEnumPrototype[^)]+\)(?:\s*\|\|\s*)?/, '') - .replace(/\s*if *\(\s*\)[^}]+}/, ''); - }); - - // remove `hasEnumPrototype` from `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match - .replace(/(?: *\/\/.*\n)* *["'] *(?:<% *)?if *\(hasEnumPrototype *(?:&&|\))[\s\S]+?<% *} *(?:%>|["']).+/g, '') - .replace(/hasEnumPrototype *\|\|\s*/g, ''); - }); - - return source; - } - - /** - * Removes the `_.isArguments` fallback from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeIsArgumentsFallback(source) { - return source.replace(getIsArgumentsFallback(source), ''); - } - - /** - * Removes the `_.isFunction` fallback from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeIsFunctionFallback(source) { - return source.replace(getIsFunctionFallback(source), ''); - } - - /** - * Removes all `iteratesOwnLast` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeIteratesOwnLast(source) { - // remove `iteratesOwnLast` declaration and assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var iteratesOwnLast\b.*|.+?iteratesOwnLast *=.+/g, ''); - - // remove `iteratesOwnLast` from `shimIsPlainObject` - source = source.replace(matchFunction(source, 'shimIsPlainObject'), function(match) { - return match.replace(/(?:\s*\/\/.*)*\n( *)if *\(iteratesOwnLast[\s\S]+?\n\1}/, ''); - }); - - return source; - } - - /** - * Removes the `Object.keys` object iteration optimization from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeKeysOptimization(source) { - source = removeVar(source, 'isKeysFast'); - - // remove optimized branch in `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match.replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(isKeysFast[\s\S]+?["']\1<% *} *else *{ *%>.+\n([\s\S]+?) *["']\1<% *} *%>.+/, "'\\n' +\n$2"); - }); - - return source; - } - - /** - * Removes all `noArgsClass` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNoArgsClass(source) { - source = removeVar(source, 'noArgsClass'); - - // replace `noArgsClass` in the `_.isArguments` fallback - source = source.replace(getIsArgumentsFallback(source), function(match) { - return match.replace(/noArgsClass/g, '!isArguments(arguments)'); - }); - - // remove `noArgsClass` from `_.isEmpty` - source = source.replace(matchFunction(source, 'isEmpty'), function(match) { - return match.replace(/ *\|\|\s*\(noArgsClass *&&[^)]+?\)\)/g, ''); - }); - - return source; - } - - /** - * Removes all `noCharByIndex` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNoCharByIndex(source) { - source = removeVar(source, 'noCharByIndex'); - - // remove `noCharByIndex` from `_.at` - source = source.replace(matchFunction(source, 'at'), function(match) { - return match.replace(/^ *if *\(noCharByIndex[^}]+}\n/m, ''); - }); - - // remove `noCharByIndex` from `_.reduceRight` - source = source.replace(matchFunction(source, 'reduceRight'), function(match) { - return match.replace(/}\s*else if *\(noCharByIndex[^}]+/, ''); - }); - - // remove `noCharByIndex` from `_.toArray` - source = source.replace(matchFunction(source, 'toArray'), function(match) { - return match.replace(/noCharByIndex[^:]+:/, ''); - }); - - // `noCharByIndex` from `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match - .replace(/'if *\(<%= *arrays *%>[^']*/, '$&\\n') - .replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(noCharByIndex[\s\S]+?["']\1<% *} *%>.+/, ''); - }); - - return source; - } - - /** - * Removes all `nonEnumArgs` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNonEnumArgs(source) { - source = removeFromCreateIterator(source, 'nonEnumArgs'); - - // remove `nonEnumArgs` declaration and assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var nonEnumArgs\b.*|.+?nonEnumArgs *=.+/g, ''); - - // remove `nonEnumArgs` from `_.keys` - source = source.replace(matchFunction(source, 'keys'), function(match) { - return match - .replace(/(?:\s*\|\|\s*)?\(nonEnumArgs[^)]+\)\)/, '') - .replace(/\s*if *\(\s*\)[^}]+}/, ''); - }); - - // remove `nonEnumArgs` from `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match - .replace(/(?: *\/\/.*\n)*( *["'] *)<% *} *else *if *\(nonEnumArgs[\s\S]+?(\1<% *} *%>.+)/, '$2') - .replace(/ *\|\|\s*nonEnumArgs/, ''); - }); - - return source; - } - - /** - * Removes all `noNodeClass` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNoNodeClass(source) { - // remove `noNodeClass` assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *try *{(?:\s*\/\/.*)*\n *var noNodeClass[\s\S]+?catch[^}]+}\n/, ''); - - // remove `noNodeClass` from `shimIsPlainObject` - source = source.replace(matchFunction(source, 'shimIsPlainObject'), function(match) { - return match.replace(/ *&& *\(!noNodeClass[\s\S]+?\)\)/, ''); - }); - - // remove `noNodeClass` from `_.clone` - source = source.replace(matchFunction(source, 'clone'), function(match) { - return match.replace(/ *\|\|\s*\(noNodeClass[\s\S]+?\)\)/, ''); - }); - - // remove `noNodeClass` from `_.isEqual` - source = source.replace(matchFunction(source, 'isEqual'), function(match) { - return match.replace(/ *\|\|\s*\(noNodeClass[\s\S]+?\)\)\)/, ''); - }); - - return source; - } - - /** - * Removes all `hasObjectSpliceByg` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeHasObjectSpliceBug(source) { - return removeVar(source, 'hasObjectSpliceBug') - // remove `hasObjectSpliceBug` fix from the `Array` function mixins - .replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?(?:{\s*}|\n\1})/, ''); - } - - /** - * Removes the `setImmediate` fork of `_.defer`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeSetImmediate(source) { - return source.replace(/(?:\s*\/\/.*)*\n( *)if *\(isV8 *&& *freeModule[\s\S]+?\n\1}/, ''); - } - - /** - * Removes a given variable from `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} varName The name of the variable to remove. - * @returns {String} Returns the modified source. - */ - function removeVar(source, varName) { - // simplify `cloneableClasses`, `ctorByClass`, or `hasObjectSpliceBug` - if (/^(?:cloneableClasses|ctorByClass|hasObjectSpliceBug)$/.test(varName)) { - source = source.replace(RegExp('(var ' + varName + ' *=)[\\s\\S]+?\\n\\n'), '$1=null;\n\n'); - } - source = source.replace(RegExp( - // match multi-line comment block - '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' + - // match a variable declaration that's not part of a declaration list - '( *)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' + - // match a variable in a declaration list - '\\n +' + varName + ' *=.+?,' - ), ''); - - // remove a varaible at the start of a variable declaration list - source = source.replace(RegExp('(var +)' + varName + ' *=.+?,\\s+'), '$1'); - - // remove a variable at the end of a variable declaration list - source = source.replace(RegExp(',\\s*' + varName + ' *=.+?;'), ';'); - - return removeFromCreateIterator(source, varName); - } - - /** - * Replaces the `funcName` function body in `source` with `funcValue`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} varName The name of the function to replace. - * @returns {String} Returns the modified source. - */ - function replaceFunction(source, funcName, funcValue) { - var match = matchFunction(source, funcName); - if (match) { - // clip snippet after the JSDoc comment block - match = match.replace(/^\s*(?:\/\/.*|\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)\n/, ''); - source = source.replace(match, function() { - return funcValue.trimRight() + '\n'; - }); - } - return source; - } - - /** - * Replaces the `varName` variable declaration value in `source` with `varValue`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} varName The name of the variable to replace. - * @returns {String} Returns the modified source. - */ - function replaceVar(source, varName, varValue) { - // replace a variable that's not part of a declaration list - var result = source.replace(RegExp( - '(( *)var ' + varName + ' *= *)' + - '(?:.+?;|(?:Function\\(.+?|.*?[^,])\\n[\\s\\S]+?\\n\\2.+?;)\\n' - ), function(match, captured) { - return captured + varValue + ';\n'; - }); - - if (source == result) { - // replace a varaible at the start or middle of a declaration list - result = source.replace(RegExp('((?:var|\\n) +' + varName + ' *=).+?,'), function(match, captured) { - return captured + ' ' + varValue + ','; - }); - } - if (source == result) { - // replace a variable at the end of a variable declaration list - result = source.replace(RegExp('(,\\s*' + varName + ' *=).+?;'), function(match, captured) { - return captured + ' ' + varValue + ';'; - }); - } - return result; - } - - /** - * Hard-codes the `strict` template option value for `iteratorTemplate`. - * - * @private - * @param {String} source The source to process. - * @param {Boolean} value The value to set. - * @returns {String} Returns the modified source. - */ - function setUseStrictOption(source, value) { - // inject or remove the "use strict" directive - source = source.replace(/^([\s\S]*?function[^{]+{)(?:\s*'use strict';)?/, '$1' + (value ? "\n 'use strict';" : '')); - - // replace `strict` branch in `iteratorTemplate` with hard-coded option - source = source.replace(getIteratorTemplate(source), function(match) { - return match.replace(/(template\()(?:\s*"'use strict.+)?/, '$1' + (value ? '\n "\'use strict\';\\n" +' : '')); - }); - - return source; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a debug and/or minified build, executing the `callback` for each. - * The `callback` is invoked with two arguments; (filePath, outputSource). - * - * Note: For a list of commands see `displayHelp()` or run `lodash --help`. - * - * @param {Array} [options=[]] An array of commands. - * @param {Function} callback The function called per build. - */ - function build(options, callback) { - options || (options = []); - - // the debug version of `source` - var debugSource; - - // used to specify the source map URL - var sourceMapURL; - - // used to report invalid command-line arguments - var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) { - if (/^(?:-o|--output)$/.test(options[index - 1]) || - /^(?:category|exclude|exports|iife|include|moduleId|minus|plus|settings|template)=.*$/.test(value)) { - return true; - } - var result = [ - 'backbone', - 'csp', - 'legacy', - 'mobile', - 'modern', - 'modularize', - 'strict', - 'underscore', - '-c', '--stdout', - '-d', '--debug', - '-h', '--help', - '-m', '--minify', - '-o', '--output', - '-p', '--source-map', - '-s', '--silent', - '-V', '--version' - ].indexOf(value) > -1; - - if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) { - result = true; - sourceMapURL = value; - } - return result; - }); - - // report invalid arguments - if (invalidArgs.length) { - console.log( - '\n' + - 'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') + - ' passed: ' + invalidArgs.join(', ') - ); - displayHelp(); - return; - } - - // display help message - if (_.find(options, function(arg) { - return /^(?:-h|--help)$/.test(arg); - })) { - displayHelp(); - return; - } - - // display `lodash.VERSION` - if (_.find(options, function(arg) { - return /^(?:-V|--version)$/.test(arg); - })) { - console.log(_.VERSION); - return; - } - - /*------------------------------------------------------------------------*/ - - // backup `dependencyMap` to restore later - var dependencyBackup = _.cloneDeep(dependencyMap); - - // used to specify a custom IIFE to wrap Lo-Dash - var iife = options.reduce(function(result, value) { - var match = value.match(/iife=(.*)/); - return match ? match[1] : result; - }, null); - - // the path to the source file - var filePath = path.join(__dirname, 'lodash.js'); - - // flag to specify a Backbone build - var isBackbone = options.indexOf('backbone') > -1; - - // flag to specify a Content Security Policy build - var isCSP = options.indexOf('csp') > -1 || options.indexOf('CSP') > -1; - - // flag to specify only creating the debug build - var isDebug = options.indexOf('-d') > -1 || options.indexOf('--debug') > -1; - - // flag to indicate that a custom IIFE was specified - var isIIFE = typeof iife == 'string'; - - // flag to specify creating a source map for the minified source - var isMapped = options.indexOf('-p') > -1 || options.indexOf('--source-map') > -1; - - // flag to specify only creating the minified build - var isMinify = options.indexOf('-m') > -1 || options.indexOf('--minify') > -1; - - // flag to specify a mobile build - var isMobile = isCSP || options.indexOf('mobile') > -1; - - // flag to specify a modern build - var isModern = isMobile || options.indexOf('modern') > -1; - - // flag to specify a modularize build - var isModularize = options.indexOf('modularize') > -1; - - // flag to specify writing output to standard output - var isStdOut = options.indexOf('-c') > -1 || options.indexOf('--stdout') > -1; - - // flag to specify skipping status updates normally logged to the console - var isSilent = isStdOut || options.indexOf('-s') > -1 || options.indexOf('--silent') > -1; - - // flag to specify `_.assign`, `_.bindAll`, and `_.defaults` are - // constructed using the "use strict" directive - var isStrict = options.indexOf('strict') > -1; - - // flag to specify an Underscore build - var isUnderscore = isBackbone || options.indexOf('underscore') > -1; - - // flag to specify a legacy build - var isLegacy = !(isModern || isUnderscore) && options.indexOf('legacy') > -1; - - // used to specify methods of specific categories - var categories = options.reduce(function(result, value) { - return /category/.test(value) ? optionToArray(value) : result; - }, []); - - // used to specify the ways to export the `lodash` function - var exportsOptions = options.reduce(function(result, value) { - return /exports/.test(value) ? optionToArray(value).sort() : result; - }, isUnderscore - ? ['commonjs', 'global', 'node'] - : exportsAll.slice() - ); - - // used to specify the AMD module ID of Lo-Dash used by precompiled templates - var moduleId = options.reduce(function(result, value) { - var match = value.match(/moduleId=(.*)/); - return match ? match[1] : result; - }, 'lodash'); - - // used to specify the output path for builds - var outputPath = options.reduce(function(result, value, index) { - if (/-o|--output/.test(value)) { - result = options[index + 1]; - result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result)); - } - return result; - }, ''); - - // used to match external template files to precompile - var templatePattern = options.reduce(function(result, value) { - var match = value.match(/template=(.+)$/); - return match - ? path.join(fs.realpathSync(path.dirname(match[1])), path.basename(match[1])) - : result; - }, ''); - - // used when precompiling template files - var templateSettings = options.reduce(function(result, value) { - var match = value.match(/settings=(.+)$/); - return match - ? _.assign(result, Function('return {' + match[1].replace(/^{|}$/g, '') + '}')()) - : result; - }, _.assign(_.clone(_.templateSettings), { - 'moduleId': moduleId - })); - - // flag to specify a template build - var isTemplate = !!templatePattern; - - // the lodash.js source - var source = fs.readFileSync(filePath, 'utf8'); - - // flag to specify replacing Lo-Dash's `_.clone` with Underscore's - var useUnderscoreClone = isUnderscore; - - // flags to specify exposing Lo-Dash methods in an Underscore build - var exposeAssign = !isUnderscore, - exposeForIn = !isUnderscore, - exposeForOwn = !isUnderscore, - exposeIsPlainObject = !isUnderscore; - - // flags to specify export options - var isAMD = exportsOptions.indexOf('amd') > -1, - isCommonJS = exportsOptions.indexOf('commonjs') > -1, - isGlobal = exportsOptions.indexOf('global') > -1, - isNode = exportsOptions.indexOf('node') > -1; - - /*------------------------------------------------------------------------*/ - - // names of methods to include in the build - var buildMethods = !isTemplate && (function() { - var result; - - var includeMethods = options.reduce(function(accumulator, value) { - return /include/.test(value) - ? _.union(accumulator, optionToMethodsArray(source, value)) - : accumulator; - }, []); - - var minusMethods = options.reduce(function(accumulator, value) { - return /exclude|minus/.test(value) - ? _.union(accumulator, optionToMethodsArray(source, value)) - : accumulator; - }, []); - - var plusMethods = options.reduce(function(accumulator, value) { - return /plus/.test(value) - ? _.union(accumulator, optionToMethodsArray(source, value)) - : accumulator; - }, []); - - // set flags to include Lo-Dash's methods if explicitly requested - if (isUnderscore) { - var methods = _.without.apply(_, [_.union(includeMethods, plusMethods)].concat(minusMethods)); - exposeAssign = methods.indexOf('assign') > -1; - exposeForIn = methods.indexOf('forIn') > -1; - exposeForOwn = methods.indexOf('forOwn') > -1; - exposeIsPlainObject = methods.indexOf('isPlainObject') > -1; - - methods = _.without.apply(_, [plusMethods].concat(minusMethods)); - useUnderscoreClone = methods.indexOf('clone') < 0; - } - // update dependencies - if (isLegacy) { - dependencyMap.defer = _.without(dependencyMap.defer, 'bind'); - } - if (isUnderscore) { - dependencyMap.contains = _.without(dependencyMap.contains, 'isString'); - dependencyMap.countBy = _.without(dependencyMap.countBy, 'isEqual', 'keys'); - dependencyMap.every = _.without(dependencyMap.every, 'isEqual', 'keys'); - dependencyMap.filter = _.without(dependencyMap.filter, 'isEqual'); - dependencyMap.find = _.without(dependencyMap.find, 'isEqual', 'keys'); - dependencyMap.groupBy = _.without(dependencyMap.groupBy, 'isEqual', 'keys'); - dependencyMap.isEqual = _.without(dependencyMap.isEqual, 'forIn', 'isArguments'); - dependencyMap.isEmpty = ['isArray', 'isString']; - dependencyMap.map = _.without(dependencyMap.map, 'isEqual', 'keys'); - dependencyMap.max = _.without(dependencyMap.max, 'isEqual', 'isString', 'keys'); - dependencyMap.min = _.without(dependencyMap.min, 'isEqual', 'isString', 'keys'); - dependencyMap.pick = _.without(dependencyMap.pick, 'forIn', 'isObject'); - dependencyMap.reduce = _.without(dependencyMap.reduce, 'isEqual', 'keys'); - dependencyMap.reject = _.without(dependencyMap.reject, 'isEqual', 'keys'); - dependencyMap.some = _.without(dependencyMap.some, 'isEqual', 'keys'); - dependencyMap.sortBy = _.without(dependencyMap.sortBy, 'isEqual', 'keys'); - dependencyMap.sortedIndex = _.without(dependencyMap.sortedIndex, 'isEqual', 'keys'); - dependencyMap.template = _.without(dependencyMap.template, 'keys', 'values'); - dependencyMap.uniq = _.without(dependencyMap.uniq, 'isEqual', 'keys'); - dependencyMap.where.push('find', 'isEmpty'); - - if (useUnderscoreClone) { - dependencyMap.clone = _.without(dependencyMap.clone, 'forEach', 'forOwn'); - } - } - if (isModern || isUnderscore) { - dependencyMap.reduceRight = _.without(dependencyMap.reduceRight, 'isEqual', 'isString'); - } - - // add method names explicitly - if (includeMethods.length) { - result = getDependencies(includeMethods); - } - // add method names required by Backbone and Underscore builds - if (isBackbone && !result) { - result = getDependencies(backboneDependencies); - } - else if (isUnderscore && !result) { - result = getDependencies(underscoreMethods); - } - // add method names by category - if (categories.length) { - result = _.union(result || [], getDependencies(categories.reduce(function(accumulator, category) { - // resolve method names belonging to each category (case-insensitive) - return accumulator.concat(getMethodsByCategory(source, capitalize(category))); - }, []))); - } - if (!result) { - result = allMethods.slice(); - } - if (plusMethods.length) { - result = _.union(result, getDependencies(plusMethods)); - } - if (minusMethods.length) { - result = _.without.apply(_, [result].concat(minusMethods, getDependants(minusMethods))); - } - return result; - }()); - - /*------------------------------------------------------------------------*/ - - // load customized Lo-Dash module - var lodash = !isTemplate && (function() { - var context = vm.createContext({ - 'clearTimeout': clearTimeout, - 'console': console, - 'setTimeout': setTimeout - }); - - source = setUseStrictOption(source, isStrict); - - if (isLegacy) { - _.each(['getPrototypeOf', 'isBindFast', 'isKeysFast', 'nativeBind', 'nativeIsArray', 'nativeKeys'], function(varName) { - source = replaceVar(source, varName, 'false'); - }); - - source = replaceVar(source, 'noArgsClass', 'true'); - source = removeKeysOptimization(source); - } - if (isMobile || isUnderscore) { - source = removeKeysOptimization(source); - } - if (isModern || isUnderscore) { - source = removeHasDontEnumBug(source); - source = removeHasEnumPrototype(source); - source = removeIteratesOwnLast(source); - source = removeNoCharByIndex(source); - source = removeNoNodeClass(source); - - if (!isMobile) { - source = removeNonEnumArgs(source); - } - } - if (isModern) { - // remove `_.isPlainObject` fallback - source = source.replace(matchFunction(source, 'isPlainObject'), function(match) { - return match.replace(/!getPrototypeOf.+?: */, ''); - }); - } - if (isUnderscore) { - // replace `_.assign` - source = replaceFunction(source, 'assign', [ - ' function assign(object) {', - ' if (!object) {', - ' return object;', - ' }', - ' for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {', - ' var iterable = arguments[argsIndex];', - ' if (iterable) {', - ' for (var key in iterable) {', - ' object[key] = iterable[key];', - ' }', - ' }', - ' }', - ' return object;', - ' }' - ].join('\n')); - - // replace `_.clone` - if (useUnderscoreClone) { - source = replaceFunction(source, 'clone', [ - ' function clone(value) {', - ' return isObject(value)', - ' ? (isArray(value) ? slice(value) : assign({}, value))', - ' : value', - ' }' - ].join('\n')); - } - - // replace `_.contains` - source = replaceFunction(source, 'contains', [ - ' function contains(collection, target) {', - ' var length = collection ? collection.length : 0,', - ' result = false;', - " if (typeof length == 'number') {", - ' result = indexOf(collection, target) > -1;', - ' } else {', - ' each(collection, function(value) {', - ' return (result = value === target) && indicatorObject;', - ' });', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.defaults` - source = replaceFunction(source, 'defaults', [ - ' function defaults(object) {', - ' if (!object) {', - ' return object;', - ' }', - ' for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {', - ' var iterable = arguments[argsIndex];', - ' if (iterable) {', - ' for (var key in iterable) {', - ' if (object[key] == null) {', - ' object[key] = iterable[key];', - ' }', - ' }', - ' }', - ' }', - ' return object;', - ' }' - ].join('\n')); - - // replace `_.difference` - source = replaceFunction(source, 'difference', [ - ' function difference(array) {', - ' var index = -1,', - ' length = array.length,', - ' flattened = concat.apply(arrayRef, arguments),', - ' result = [];', - '', - ' while (++index < length) {', - ' var value = array[index]', - ' if (indexOf(flattened, value, length) < 0) {', - ' result.push(value);', - ' }', - ' }', - ' return result', - ' }' - ].join('\n')); - - // replace `_.intersection` - source = replaceFunction(source, 'intersection', [ - ' function intersection(array) {', - ' var args = arguments,', - ' argsLength = args.length,', - ' index = -1,', - ' length = array ? array.length : 0,', - ' result = [];', - '', - ' outer:', - ' while (++index < length) {', - ' var value = array[index];', - ' if (indexOf(result, value) < 0) {', - ' var argsIndex = argsLength;', - ' while (--argsIndex) {', - ' if (indexOf(args[argsIndex], value) < 0) {', - ' continue outer;', - ' }', - ' }', - ' result.push(value);', - ' }', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.isEmpty` - source = replaceFunction(source, 'isEmpty', [ - ' function isEmpty(value) {', - ' if (!value) {', - ' return true;', - ' }', - ' if (isArray(value) || isString(value)) {', - ' return !value.length;', - ' }', - ' for (var key in value) {', - ' if (hasOwnProperty.call(value, key)) {', - ' return false;', - ' }', - ' }', - ' return true;', - ' }' - ].join('\n')); - - // replace `_.isEqual` - source = replaceFunction(source, 'isEqual', [ - ' function isEqual(a, b, stackA, stackB) {', - ' if (a === b) {', - ' return a !== 0 || (1 / a == 1 / b);', - ' }', - ' var type = typeof a,', - ' otherType = typeof b;', - '', - ' if (a === a &&', - " (!a || (type != 'function' && type != 'object')) &&", - " (!b || (otherType != 'function' && otherType != 'object'))) {", - ' return false;', - ' }', - ' if (a == null || b == null) {', - ' return a === b;', - ' }', - ' var className = toString.call(a),', - ' otherClass = toString.call(b);', - '', - ' if (className != otherClass) {', - ' return false;', - ' }', - ' switch (className) {', - ' case boolClass:', - ' case dateClass:', - ' return +a == +b;', - '', - ' case numberClass:', - ' return a != +a', - ' ? b != +b', - ' : (a == 0 ? (1 / a == 1 / b) : a == +b);', - '', - ' case regexpClass:', - ' case stringClass:', - " return a == b + '';", - ' }', - ' var isArr = className == arrayClass;', - ' if (!isArr) {', - ' if (a.__wrapped__ || b.__wrapped__) {', - ' return isEqual(a.__wrapped__ || a, b.__wrapped__ || b, stackA, stackB);', - ' }', - ' if (className != objectClass) {', - ' return false;', - ' }', - ' var ctorA = a.constructor,', - ' ctorB = b.constructor;', - '', - ' if (ctorA != ctorB && !(', - ' isFunction(ctorA) && ctorA instanceof ctorA &&', - ' isFunction(ctorB) && ctorB instanceof ctorB', - ' )) {', - ' return false;', - ' }', - ' }', - ' stackA || (stackA = []);', - ' stackB || (stackB = []);', - '', - ' var length = stackA.length;', - ' while (length--) {', - ' if (stackA[length] == a) {', - ' return stackB[length] == b;', - ' }', - ' }', - ' var result = true,', - ' size = 0;', - '', - ' stackA.push(a);', - ' stackB.push(b);', - '', - ' if (isArr) {', - ' size = b.length;', - ' result = size == a.length;', - '', - ' if (result) {', - ' while (size--) {', - ' if (!(result = isEqual(a[size], b[size], stackA, stackB))) {', - ' break;', - ' }', - ' }', - ' }', - ' return result;', - ' }', - ' forIn(b, function(value, key, b) {', - ' if (hasOwnProperty.call(b, key)) {', - ' size++;', - ' return !(result = hasOwnProperty.call(a, key) && isEqual(a[key], value, stackA, stackB)) && indicatorObject;', - ' }', - ' });', - '', - ' if (result) {', - ' forIn(a, function(value, key, a) {', - ' if (hasOwnProperty.call(a, key)) {', - ' return !(result = --size > -1) && indicatorObject;', - ' }', - ' });', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.omit` - source = replaceFunction(source, 'omit', [ - ' function omit(object) {', - ' var props = concat.apply(arrayRef, arguments),', - ' result = {};', - '', - ' forIn(object, function(value, key) {', - ' if (indexOf(props, key, 1) < 0) {', - ' result[key] = value;', - ' }', - ' });', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.pick` - source = replaceFunction(source, 'pick', [ - ' function pick(object) {', - ' var index = 0,', - ' props = concat.apply(arrayRef, arguments),', - ' length = props.length,', - ' result = {};', - '', - ' while (++index < length) {', - ' var prop = props[index];', - ' if (prop in object) {', - ' result[prop] = object[prop];', - ' }', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.result` - source = replaceFunction(source, 'result', [ - ' function result(object, property) {', - ' var value = object ? object[property] : null;', - ' return isFunction(value) ? object[property]() : value;', - ' }' - ].join('\n')); - - // replace `_.template` - source = replaceFunction(source, 'template', [ - ' function template(text, data, options) {', - " text || (text = '');", - ' options = defaults({}, options, lodash.templateSettings);', - '', - ' var index = 0,', - ' source = "__p += \'",', - ' variable = options.variable;', - '', - ' var reDelimiters = RegExp(', - " (options.escape || reNoMatch).source + '|' +", - " (options.interpolate || reNoMatch).source + '|' +", - " (options.evaluate || reNoMatch).source + '|$'", - " , 'g');", - '', - ' text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {', - ' source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);', - ' if (escapeValue) {', - ' source += "\' +\\n_.escape(" + escapeValue + ") +\\n\'";', - ' }', - ' if (evaluateValue) {', - ' source += "\';\\n" + evaluateValue + ";\\n__p += \'";', - ' }', - ' if (interpolateValue) {', - ' source += "\' +\\n((__t = (" + interpolateValue + ")) == null ? \'\' : __t) +\\n\'";', - ' }', - ' index = offset + match.length;', - ' return match;', - ' });', - '', - ' source += "\';\\n";', - ' if (!variable) {', - " variable = 'obj';", - " source = 'with (' + variable + ' || {}) {\\n' + source + '\\n}\\n';", - ' }', - " source = 'function(' + variable + ') {\\n' +", - ' "var __t, __p = \'\', __j = Array.prototype.join;\\n" +', - ' "function print() { __p += __j.call(arguments, \'\') }\\n" +', - ' source +', - " 'return __p\\n}';", - '', - ' try {', - " var result = Function('_', 'return ' + source)(lodash);", - ' } catch(e) {', - ' e.source = source;', - ' throw e;', - ' }', - ' if (data) {', - ' return result(data);', - ' }', - ' result.source = source;', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.uniq` - source = replaceFunction(source, 'uniq', [ - ' function uniq(array, isSorted, callback, thisArg) {', - ' var index = -1,', - ' length = array ? array.length : 0,', - ' result = [],', - ' seen = result;', - '', - " if (typeof isSorted == 'function') {", - ' thisArg = callback;', - ' callback = isSorted;', - ' isSorted = false;', - ' }', - ' if (callback) {', - ' seen = [];', - ' callback = createCallback(callback, thisArg);', - ' }', - ' 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) {', - ' seen.push(computed);', - ' }', - ' result.push(value);', - ' }', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.uniqueId` - source = replaceFunction(source, 'uniqueId', [ - ' function uniqueId(prefix) {', - " var id = ++idCounter + '';", - ' return prefix ? prefix + id : id;', - ' }' - ].join('\n')); - - // replace `_.where` - source = replaceFunction(source, 'where', [ - ' function where(collection, properties, first) {', - ' return (first && isEmpty(properties))', - ' ? null', - ' : (first ? find : filter)(collection, properties);', - ' }' - ].join('\n')); - - // replace `_.without` - source = replaceFunction(source, 'without', [ - ' function without(array) {', - ' var index = -1,', - ' length = array.length,', - ' result = [];', - '', - ' while (++index < length) {', - ' var value = array[index]', - ' if (indexOf(arguments, value, 1) < 0) {', - ' result.push(value);', - ' }', - ' }', - ' return result', - ' }' - ].join('\n')); - - // add `_.findWhere` - source = source.replace(matchFunction(source, 'find'), function (match) { - return match + [ - '', - ' function findWhere(object, properties) {', - ' return where(object, properties, true);', - ' }', - '' - ].join('\n') - }); - - source = source.replace(getMethodAssignments(source), function(match) { - return match.replace(/^( *)lodash.find *=.+/m, '$&\n$1lodash.findWhere = findWhere;'); - }); - - // add Underscore style chaining - source = addChainMethods(source); - - // remove `_.templateSettings.imports assignment - source = source.replace(/,[^']*'imports':[^}]+}/, ''); - - // remove large array optimizations - source = removeFunction(source, 'cachedContains'); - source = removeVar(source, 'largeArraySize'); - - // remove `_.isEqual` use from `createCallback` - source = source.replace(matchFunction(source, 'createCallback'), function(match) { - return match.replace(/isEqual\(([^,]+), *([^,]+)[^)]+\)/, '$1 === $2'); - }); - - // remove conditional `charCodeCallback` use from `_.max` and `_.min` - _.each(['max', 'min'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/!callback *&& *isString\(collection\)[\s\S]+?: */g, ''); - }); - }); - - // remove unneeded variables - if (useUnderscoreClone) { - source = removeVar(source, 'cloneableClasses'); - source = removeVar(source, 'ctorByClass'); - } - // remove unused features from `createBound` - if (buildMethods.indexOf('partial') < 0 && buildMethods.indexOf('partialRight') < 0) { - source = source.replace(matchFunction(source, 'createBound'), function(match) { - return match - .replace(/, *right[^)]*/, '') - .replace(/(function createBound\([^{]+{)[\s\S]+?(\n *function bound)/, '$1$2') - .replace(/thisBinding *=[^}]+}/, 'thisBinding = thisArg;\n') - .replace(/\(args *=.+/, 'partialArgs.concat(slice(args))'); - }); - } - } - vm.runInContext(source, context); - return context._; - }()); - - /*------------------------------------------------------------------------*/ - - if (isTemplate) { - source = buildTemplate(templatePattern, templateSettings); - } - else { - // remove methods from the build - allMethods.forEach(function(otherName) { - if (!_.contains(buildMethods, otherName)) { - source = removeFunction(source, otherName); - } - }); - - // remove `isArguments` fallback before `isArguments` is transformed by - // other parts of the build process - if (isRemoved(source, 'isArguments')) { - source = removeIsArgumentsFallback(source); - } - - // remove `iteratorTemplate` dependency checks from `_.template` - source = source.replace(matchFunction(source, 'template'), function(match) { - return match - .replace(/iteratorTemplate *&& */g, '') - .replace(/iteratorTemplate *\? *([^:]+?) *:[^,;]+/g, '$1'); - }); - - /*----------------------------------------------------------------------*/ - - if (isLegacy) { - source = removeSetImmediate(source); - - _.each(['isBindFast', 'isV8', 'nativeBind', 'nativeIsArray', 'nativeKeys', 'reNative'], function(varName) { - source = removeVar(source, varName); - }); - - // remove native `Function#bind` branch in `_.bind` - source = source.replace(matchFunction(source, 'bind'), function(match) { - return match.replace(/(?:\s*\/\/.*)*\s*return isBindFast[^:]+:\s*/, 'return '); - }); - - // remove native `Array.isArray` branch in `_.isArray` - source = source.replace(matchFunction(source, 'isArray'), function(match) { - return match.replace(/nativeIsArray * \|\|\s*/, ''); - }); - - // replace `_.keys` with `shimKeys` - if (!isRemoved(source, 'keys')) { - source = source.replace( - matchFunction(source, 'keys').replace(/[\s\S]+?var keys *= */, ''), - matchFunction(source, 'shimKeys').replace(/[\s\S]+?function shimKeys/, 'function').replace(/}\n$/, '};\n') - ); - - source = removeFunction(source, 'shimKeys'); - } - // replace `_.isArguments` with fallback - if (!isRemoved(source, 'isArguments')) { - source = source.replace( - matchFunction(source, 'isArguments').replace(/[\s\S]+?function isArguments/, ''), - getIsArgumentsFallback(source).match(/isArguments *= *function([\s\S]+?) *};/)[1] + ' }\n' - ); - - source = removeIsArgumentsFallback(source); - } - } - if (isModern) { - source = removeArgsAreObjects(source); - source = removeHasObjectSpliceBug(source); - source = removeIsArgumentsFallback(source); - } - if (isModern || isUnderscore) { - source = removeNoArgsClass(source); - source = removeNoNodeClass(source); - } - if (isMobile || isUnderscore) { - source = removeVar(source, 'iteratorTemplate'); - - // inline all functions defined with `createIterator` - _.functions(lodash).forEach(function(methodName) { - // strip leading underscores to match pseudo private functions - var reFunc = RegExp('(\\bvar ' + methodName.replace(/^_/, '') + ' *= *)createIterator\\(((?:{|[a-zA-Z])[\\s\\S]+?)\\);\\n'); - if (reFunc.test(source)) { - // extract, format, and inject the compiled function's source code - source = source.replace(reFunc, function(match, captured) { - return captured + getFunctionSource(lodash[methodName]) + ';\n'; - }); - } - }); - } - if (isUnderscore) { - // remove `_.assign`, `_.forIn`, `_.forOwn`, and `_.isPlainObject` assignments - (function() { - var snippet = getMethodAssignments(source), - modified = snippet; - - if (!exposeAssign) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.assign *= *.+\n/m, ''); - } - if (!exposeForIn) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forIn *= *.+\n/m, ''); - } - if (!exposeForOwn) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forOwn *= *.+\n/m, ''); - } - if (!exposeIsPlainObject) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.isPlainObject *= *.+\n/m, ''); - } - source = source.replace(snippet, modified); - }()); - - // remove `thisArg` from unexposed `forIn` and `forOwn` - _.each([ - { 'methodName': 'forIn', 'flag': exposeForIn }, - { 'methodName': 'forOwn', 'flag': exposeForOwn } - ], function(data) { - if (!data.flag) { - source = source.replace(matchFunction(source, data.methodName), function(match) { - return match - .replace(/(callback), *thisArg/g, '$1') - .replace(/^( *)callback *=.+/m, '$1callback || (callback = identity);') - }); - } - }); - - // remove chainability from `each` and `_.forEach` - _.each(['each', 'forEach'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/\n *return .+?([};\s]+)$/, '$1'); - }); - }); - - // unexpose "exit early" feature of `each`, `_.forEach`, `_.forIn`, and `_.forOwn` - _.each(['each', 'forEach', 'forIn', 'forOwn'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/=== *false\)/g, '=== indicatorObject)'); - }); - }); - - // modify `_.every`, `_.find`, `_.isEqual`, and `_.some` to use the private `indicatorObject` - _.each(['every', 'isEqual'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/\(result *= *(.+?)\);/g, '!(result = $1) && indicatorObject;'); - }); - }); - - source = source.replace(matchFunction(source, 'find'), function(match) { - return match.replace(/return false/, 'return indicatorObject'); - }); - - source = source.replace(matchFunction(source, 'some'), function(match) { - return match.replace(/!\(result *= *(.+?)\);/, '(result = $1) && indicatorObject;'); - }); - } - if (!(isMobile || isUnderscore)) { - // inline `iteratorTemplate` template - source = source.replace(getIteratorTemplate(source), function() { - var snippet = getFunctionSource(lodash._iteratorTemplate); - - // prepend data object references to property names to avoid having to - // use a with-statement - iteratorOptions.forEach(function(property) { - snippet = snippet.replace(RegExp('([^\\w.])\\b' + property + '\\b', 'g'), '$1obj.' + property); - }); - - // remove unnecessary code - snippet = snippet - .replace(/var __t.+/, "var __p = '';") - .replace(/function print[^}]+}/, '') - .replace(/'(?:\\n|\s)+'/g, "''") - .replace(/__p *\+= *' *';/g, '') - .replace(/(__p *\+= *)' *' *\+/g, '$1') - .replace(/({) *;|; *(})/g, '$1$2') - .replace(/\(\(__t *= *\( *([^)]+) *\)\) *== *null *\? *'' *: *__t\)/g, '($1)'); - - // remove the with-statement - snippet = snippet.replace(/ *with *\(.+?\) *{/, '\n').replace(/}([^}]*}[^}]*$)/, '$1'); - - // minor cleanup - snippet = snippet - .replace(/obj *\|\|\s*\(obj *= *{}\);/, '') - .replace(/var __p = '';\s*__p \+=/, 'var __p ='); - - // remove comments, including sourceURLs - snippet = snippet.replace(/\s*\/\/.*(?:\n|$)/g, ''); - - return ' var iteratorTemplate = ' + snippet + ';\n'; - }); - } - } - - /*------------------------------------------------------------------------*/ - - // customize Lo-Dash's IIFE - (function() { - if (isIIFE) { - var token = '%output%', - index = iife.indexOf(token); - - source = source.match(/^\/\**[\s\S]+?\*\/\n/) + - iife.slice(0, index) + - source.replace(/^[\s\S]+?\(function[^{]+?{|}\(this\)\)[;\s]*$/g, '') + - iife.slice(index + token.length); - } - }()); - - /*------------------------------------------------------------------------*/ - - // customize Lo-Dash's export bootstrap - (function() { - if (!isAMD) { - source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +define[\s\S]+?else /, '$1'); - } - if (!isNode) { - source = source.replace(/(?: *\/\/.*\n)*( *)if *\(freeModule[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2'); - } - if (!isCommonJS) { - source = source.replace(/(?: *\/\/.*\n)*(?:( *)else *{)?\s*freeExports\.\w+ *=[\s\S]+?(?:\n\1})?\n/, ''); - } - if (!isGlobal) { - source = source.replace(/(?:( *)(})? *else(?: *if *\(_\))? *{)?(?:\s*\/\/.*)*\s*(?:window\._|_\.templates) *=[\s\S]+?(?:\n\1})?\n/g, '$1$2\n'); - } - // remove `if (freeExports) {...}` if it's empty - if (isAMD && isGlobal) { - source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}\n/, ''); - } else { - source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}(?:\s*else *{([\s\S]+?) *})?\n/, '$1\n'); - } - }()); - - /*------------------------------------------------------------------------*/ - - if (!isTemplate) { - // modify/remove references to removed methods/variables - if (isRemoved(source, 'invert')) { - source = replaceVar(source, 'htmlUnescapes', "{'&':'&','<':'<','>':'>','"':'\"',''':\"'\"}"); - } - if (isRemoved(source, 'isArguments')) { - source = replaceVar(source, 'noArgsClass', 'false'); - } - if (isRemoved(source, 'isFunction')) { - source = removeIsFunctionFallback(source); - } - if (isRemoved(source, 'mixin')) { - source = removeHasObjectSpliceBug(source); - - // simplify the `lodash` function - source = replaceFunction(source, 'lodash', [ - ' function lodash() {', - ' // no operation performed', - ' }' - ].join('\n')); - - // remove all `lodash.prototype` additions - source = source - .replace(/(?:\s*\/\/.*)*\n( *)forOwn\(lodash, *function\(func, *methodName\)[\s\S]+?\n\1}.+/g, '') - .replace(/(?:\s*\/\/.*)*\n( *)each\(\['[\s\S]+?\n\1}.+/g, '') - .replace(/(?:\s*\/\/.*)*\s*lodash\.prototype.+\n/g, '') - .replace(/(?:\s*\/\/.*)*\s*mixin\(lodash\).+\n/, ''); - } - // remove functions, variables, and snippets that the minifier may miss - if (isRemoved(source, 'clone')) { - source = removeVar(source, 'cloneableClasses'); - source = removeVar(source, 'ctorByClass'); - } - if (isRemoved(source, 'isArray')) { - source = removeVar(source, 'nativeIsArray'); - } - if (isRemoved(source, 'isPlainObject')) { - source = removeVar(source, 'getPrototypeOf'); - source = removeIteratesOwnLast(source); - } - if (isRemoved(source, 'keys')) { - source = removeFunction(source, 'shimKeys'); - } - if (isRemoved(source, 'template')) { - // remove `templateSettings` assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *lodash\.templateSettings[\s\S]+?};\n/, ''); - } - if (isRemoved(source, 'isArguments', 'isEmpty')) { - source = removeNoArgsClass(source); - } - if (isRemoved(source, 'clone', 'isEqual', 'isPlainObject')) { - source = removeNoNodeClass(source); - } - if ((source.match(/\bcreateIterator\b/g) || []).length < 2) { - source = removeFunction(source, 'createIterator'); - source = removeVar(source, 'defaultsIteratorOptions'); - source = removeVar(source, 'eachIteratorOptions'); - source = removeVar(source, 'forOwnIteratorOptions'); - source = removeVar(source, 'templateIterator'); - source = removeHasDontEnumBug(source); - source = removeHasEnumPrototype(source); - } - if (isRemoved(source, 'createIterator', 'bind', 'keys')) { - source = removeSetImmediate(source); - source = removeVar(source, 'isBindFast'); - source = removeVar(source, 'isV8'); - source = removeVar(source, 'nativeBind'); - } - if (isRemoved(source, 'createIterator', 'keys')) { - source = removeVar(source, 'nativeKeys'); - source = removeKeysOptimization(source); - source = removeNonEnumArgs(source); - } - if (!source.match(/var (?:hasDontEnumBug|hasEnumPrototype|iteratesOwnLast|nonEnumArgs)\b/g)) { - // remove IIFE used to assign `hasDontEnumBug`, `hasEnumPrototype`, `iteratesOwnLast`, and `nonEnumArgs` - source = source.replace(/^ *\(function\(\) *{[\s\S]+?}\(1\)\);\n/m, ''); - } - } - if ((source.match(/\bfreeModule\b/g) || []).length < 2) { - source = removeVar(source, 'freeModule'); - } - if ((source.match(/\bfreeExports\b/g) || []).length < 2) { - source = removeVar(source, 'freeExports'); - } - - debugSource = cleanupSource(source); - source = cleanupSource(source); - - /*------------------------------------------------------------------------*/ - - // flag to track if `outputPath` has been used by `callback` - var outputUsed = false; - - // flag to specify creating a custom build - var isCustom = ( - isLegacy || isMapped || isModern || isStrict || isUnderscore || outputPath || - /(?:category|exclude|exports|iife|include|minus|plus)=/.test(options) || - !_.isEqual(exportsOptions, exportsAll) - ); - - // used as the basename of the output path - var basename = outputPath - ? path.basename(outputPath, '.js') - : 'lodash' + (isTemplate ? '.template' : isCustom ? '.custom' : ''); - - // restore `dependencyMap` - dependencyMap = dependencyBackup; - - // output debug build - if (!isMinify && (isCustom || isDebug || isTemplate)) { - if (isCustom) { - debugSource = addCommandsToHeader(debugSource, options); - } - if (isDebug && isStdOut) { - stdout.write(debugSource); - callback({ - 'source': debugSource - }); - } - else if (!isStdOut) { - filePath = outputPath || path.join(cwd, basename + '.js'); - outputUsed = true; - callback({ - 'source': debugSource, - 'outputPath': filePath - }); - } - } - // begin the minification process - if (!isDebug) { - if (outputPath && outputUsed) { - outputPath = path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.min.js'); - } else if (!outputPath) { - outputPath = path.join(cwd, basename + '.min.js'); - } - minify(source, { - 'filePath': filePath, - 'isMapped': isMapped, - 'isSilent': isSilent, - 'isTemplate': isTemplate, - 'modes': isIIFE && ['simple', 'hybrid'], - 'outputPath': outputPath, - 'sourceMapURL': sourceMapURL, - 'onComplete': function(data) { - if (isCustom) { - data.source = addCommandsToHeader(data.source, options); - } - if (isStdOut) { - stdout.write(data.source); - callback(data); - } else { - callback(data); - } - } - }); - } - } - - /*--------------------------------------------------------------------------*/ - - // expose `build` - if (module != require.main) { - module.exports = build; - } - else { - // or invoked directly - build(process.argv, function(data) { - var outputPath = data.outputPath, - sourceMap = data.sourceMap; - - if (outputPath) { - fs.writeFileSync(outputPath, data.source, 'utf8'); - if (sourceMap) { - fs.writeFileSync(path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.map'), sourceMap, 'utf8'); - } - } - }); - } -}()); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/minify.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/minify.js deleted file mode 100755 index 2250669..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/minify.js +++ /dev/null @@ -1,753 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** Load Node modules */ - var fs = require('fs'), - https = require('https'), - path = require('path'), - spawn = require('child_process').spawn, - zlib = require('zlib'), - tar = require('../vendor/tar/tar.js'), - _ = require('../lodash.js'); - - /** Load other modules */ - var preprocess = require('./pre-compile.js'), - postprocess = require('./post-compile.js'); - - /** The Git object ID of `closure-compiler.tar.gz` */ - var closureId = '23cf67d0f0b979d97631fc108a2a43bb82225994'; - - /** The Git object ID of `uglifyjs.tar.gz` */ - var uglifyId = 'a934fb18f8fa2768c6a68de44b6e035fe96a268b'; - - /** The path of the directory that is the base of the repository */ - var basePath = fs.realpathSync(path.join(__dirname, '..')); - - /** The path of the `vendor` directory */ - var vendorPath = path.join(basePath, 'vendor'); - - /** The path to the Closure Compiler `.jar` */ - var closurePath = path.join(vendorPath, 'closure-compiler', 'compiler.jar'); - - /** The path to the UglifyJS module */ - var uglifyPath = path.join(vendorPath, 'uglifyjs', 'tools', 'node.js'); - - /** The Closure Compiler command-line options */ - var closureOptions = ['--warning_level=QUIET']; - - /** The media type for raw blob data */ - var mediaType = 'application/vnd.github.v3.raw'; - - /** Used to reference parts of the blob href */ - var location = (function() { - var host = 'api.github.com', - origin = 'https://api.github.com', - pathname = '/repos/bestiejs/lodash/git/blobs'; - - return { - 'host': host, - 'href': origin + pathname, - 'origin': origin, - 'pathname': pathname - }; - }()); - - /** The Closure Compiler optimization modes */ - var optimizationModes = { - 'simple': 'SIMPLE_OPTIMIZATIONS', - 'advanced': 'ADVANCED_OPTIMIZATIONS' - }; - - /** Reassign `existsSync` for older versions of Node */ - fs.existsSync || (fs.existsSync = path.existsSync); - - /*--------------------------------------------------------------------------*/ - - /** - * Minifies a given Lo-Dash `source` and invokes the `options.onComplete` - * callback when finished. The `onComplete` callback is invoked with one - * argument; (outputSource). - * - * @param {Array|String} [source=''] The source to minify or array of commands. - * -o, --output - Write output to a given path/filename. - * -s, --silent - Skip status updates normally logged to the console. - * -t, --template - Applies template specific minifier options. - * - * @param {Object} [options={}] The options object. - * outputPath - Write output to a given path/filename. - * isSilent - Skip status updates normally logged to the console. - * isTemplate - Applies template specific minifier options. - * onComplete - The function called once minification has finished. - */ - function minify(source, options) { - // used to specify the source map URL - var sourceMapURL; - - // used to specify the default minifer modes - var modes = ['simple', 'advanced', 'hybrid']; - - source || (source = ''); - options || (options = {}); - - // juggle arguments - if (Array.isArray(source)) { - // convert commands to an options object - options = source; - - // used to report invalid command-line arguments - var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) { - if (/^(?:-o|--output)$/.test(options[index - 1]) || - /^modes=.*$/.test(value)) { - return true; - } - var result = [ - '-o', '--output', - '-p', '--source-map', - '-s', '--silent', - '-t', '--template' - ].indexOf(value) > -1; - - if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) { - result = true; - sourceMapURL = value; - } - return result; - }); - - // report invalid arguments - if (invalidArgs.length) { - console.log( - '\n' + - 'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') + - ' passed: ' + invalidArgs.join(', ') - ); - return; - } - var filePath = options[options.length - 1], - isMapped = options.indexOf('-p') > -1 || options.indexOf('--source-map') > -1, - isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1, - isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1, - outputPath = path.join(path.dirname(filePath), path.basename(filePath, '.js') + '.min.js'); - - modes = options.reduce(function(result, value) { - var match = value.match(/modes=(.*)$/); - return match ? match[1].split(/, */) : result; - }, modes); - - outputPath = options.reduce(function(result, value, index) { - if (/-o|--output/.test(value)) { - result = options[index + 1]; - result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result)); - } - return result; - }, outputPath); - - options = { - 'filePath': filePath, - 'isMapped': isMapped, - 'isSilent': isSilent, - 'isTemplate': isTemplate, - 'modes': modes, - 'outputPath': outputPath, - 'sourceMapURL': sourceMapURL - }; - - source = fs.readFileSync(filePath, 'utf8'); - } - - modes = options.modes || modes; - if (options.isMapped) { - modes = modes.filter(function(mode) { - return mode != 'hybrid'; - }); - } - if (options.isTemplate) { - modes = modes.filter(function(mode) { - return mode != 'advanced'; - }); - } - options.modes = modes; - - // fetch the Closure Compiler - getDependency({ - 'id': 'closure-compiler', - 'hashId': closureId, - 'path': vendorPath, - 'title': 'the Closure Compiler', - 'onComplete': function(exception) { - var error = exception; - - // fetch UglifyJS - getDependency({ - 'id': 'uglifyjs', - 'hashId': uglifyId, - 'title': 'UglifyJS', - 'path': vendorPath, - 'onComplete': function(exception) { - error || (error = exception); - if (!error) { - new Minify(source, options); - } - } - }); - } - }); - } - - /** - * The Minify constructor used to keep state of each `minify` invocation. - * - * @private - * @constructor - * @param {String} source The source to minify. - * @param {Object} options The options object. - * outputPath - Write output to a given path/filename. - * isSilent - Skip status updates normally logged to the console. - * isTemplate - Applies template specific minifier options. - * onComplete - The function called once minification has finished. - */ - function Minify(source, options) { - // juggle arguments - if (typeof source == 'object' && source) { - options = source || options; - source = options.source || ''; - } - this.compiled = { 'simple': {}, 'advanced': {} }; - this.hybrid = { 'simple': {}, 'advanced': {} }; - this.uglified = {}; - - this.filePath = options.filePath; - this.isMapped = !!options.isMapped; - this.isSilent = !!options.isSilent; - this.isTemplate = !!options.isTemplate; - this.outputPath = options.outputPath; - this.sourceMapURL = options.sourceMapURL; - - var modes = this.modes = options.modes; - source = this.source = preprocess(source, options); - - this.onComplete = options.onComplete || function(data) { - var outputPath = this.outputPath, - sourceMap = data.sourceMap; - - fs.writeFileSync(outputPath, data.source, 'utf8'); - if (sourceMap) { - fs.writeFileSync(getMapPath(outputPath), sourceMap, 'utf8'); - } - }; - - // begin the minification process - if (modes.indexOf('simple') > -1) { - closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this)); - } else if (modes.indexOf('advanced') > -1) { - onClosureSimpleGzip.call(this); - } else { - onClosureAdvancedGzip.call(this); - } - } - - /*--------------------------------------------------------------------------*/ - - /** - * Fetches a required `.tar.gz` dependency with the given Git object ID from - * the Lo-Dash repo on GitHub. The object ID may be obtained by running - * `git hash-object path/to/dependency.tar.gz`. - * - * @private - * @param {Object} options The options object. - * id - The Git object ID of the `.tar.gz` file. - * onComplete - The function called once the extraction has finished. - * path - The path of the extraction directory. - * title - The dependency's title used in status updates logged to the console. - */ - function getDependency(options) { - options || (options = {}); - - var ran, - destPath = options.path, - hashId = options.hashId, - id = options.id, - onComplete = options.onComplete, - title = options.title; - - // exit early if dependency exists - if (fs.existsSync(path.join(destPath, id))) { - onComplete(); - return; - } - var callback = function(exception) { - if (ran) { - return; - } - if (exception) { - console.error([ - 'There was a problem installing ' + title + '.', - 'Try running the command as root, via `sudo`, or manually install by running:', - '', - "curl -H 'Accept: " + mediaType + "' " + location.href + '/' + hashId + " | tar xvz -C '" + destPath + "'", - '' - ].join('\n')); - } - ran = true; - process.removeListener('uncaughtException', callback); - onComplete(exception); - }; - - console.log('Downloading ' + title + '...'); - process.on('uncaughtException', callback); - - https.get({ - 'host': location.host, - 'path': location.pathname + '/' + hashId, - 'headers': { - // By default, all GitHub blob API endpoints return a JSON document - // containing Base64-encoded blob data. Overriding the `Accept` header - // with the GitHub raw media type returns the blob data directly. - // See http://developer.github.com/v3/media/. - 'Accept': mediaType - } - }, function(response) { - var decompressor = zlib.createUnzip(), - parser = new tar.Extract({ 'path': destPath }); - - parser.on('end', callback); - response.pipe(decompressor).pipe(parser); - }); - } - - /** - * Resolves the source map path from the given output path. - * - * @private - * @param {String} outputPath The output path. - * @returns {String} Returns the source map path. - */ - function getMapPath(outputPath) { - return path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.map'); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Compresses a `source` string using the Closure Compiler. Yields the - * minified result, and any exceptions encountered, to a `callback` function. - * - * @private - * @param {String} source The JavaScript source to minify. - * @param {String} mode The optimization mode. - * @param {Function} callback The function called once the process has completed. - */ - function closureCompile(source, mode, callback) { - var filePath = this.filePath, - isAdvanced = mode == 'advanced', - isMapped = this.isMapped, - options = closureOptions.slice(), - outputPath = this.outputPath, - mapPath = getMapPath(outputPath), - sourceMapURL = this.sourceMapURL || path.basename(mapPath); - - // remove copyright header to make other modifications easier - var license = (/^(?:\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*/.exec(source) || [''])[0]; - if (license) { - source = source.replace(license, ''); - } - - var hasIIFE = /^;?\(function[^{]+{\s*/.test(source), - isStrict = hasIIFE && /^;?\(function[^{]+{\s*["']use strict["']/.test(source); - - // to avoid stripping the IIFE, convert it to a function call - if (hasIIFE && isAdvanced) { - source = source - .replace(/\(function/, '__iife__$&') - .replace(/\(this\)\)([\s;]*(\n\/\/.+)?)$/, ', this)$1'); - } - - options.push('--compilation_level=' + optimizationModes[mode]); - if (isMapped) { - options.push('--create_source_map=' + mapPath, '--source_map_format=V3'); - } - - var compiler = spawn('java', ['-jar', closurePath].concat(options)); - if (!this.isSilent) { - console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...'); - } - - var error = ''; - compiler.stderr.on('data', function(data) { - error += data; - }); - - var output = ''; - compiler.stdout.on('data', function(data) { - output += data; - }); - - compiler.on('exit', function(status) { - // `status` contains the process exit code - if (status) { - var exception = new Error(error); - exception.status = status; - } - // restore IIFE and move exposed vars inside the IIFE - if (hasIIFE && isAdvanced) { - output = output - .replace(/__iife__\(/, '(') - .replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1') - .replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1'); - } - // inject "use strict" directive - if (isStrict) { - output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";'); - } - // restore copyright header - if (license) { - output = license + output; - } - if (isMapped) { - var mapOutput = fs.readFileSync(mapPath, 'utf8'); - fs.unlinkSync(mapPath); - output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/'; - - mapOutput = JSON.parse(mapOutput); - mapOutput.file = path.basename(outputPath); - mapOutput.sources = [path.basename(filePath)]; - mapOutput = JSON.stringify(mapOutput, null, 2); - } - callback(exception, output, mapOutput); - }); - - // proxy the standard input to the Closure Compiler - compiler.stdin.end(source); - } - - /** - * Compresses a `source` string using UglifyJS. Yields the result to a - * `callback` function. This function is synchronous; the `callback` is used - * for symmetry. - * - * @private - * @param {String} source The JavaScript source to minify. - * @param {String} label The label to log. - * @param {Function} callback The function called once the process has completed. - */ - function uglify(source, label, callback) { - if (!this.isSilent) { - console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...'); - } - try { - var uglifyJS = require(uglifyPath); - - // 1. parse - var toplevel = uglifyJS.parse(source); - - // 2. compress - // enable unsafe comparisons - toplevel.figure_out_scope(); - toplevel = toplevel.transform(uglifyJS.Compressor({ - 'comparisons': false, - 'unsafe_comps': true, - 'warnings': false - })); - - // 3. mangle - // excluding the `define` function exposed by AMD loaders - toplevel.figure_out_scope(); - toplevel.compute_char_frequency(); - toplevel.mangle_names({ - 'except': ['define'] - }); - - // 4. output - // restrict lines to 500 characters for consistency with the Closure Compiler - var stream = uglifyJS.OutputStream({ - 'ascii_only': true, - 'comments': /@cc_on|@license|@preserve/i, - 'max_line_len': 500, - }); - - toplevel.print(stream); - } - catch(e) { - var exception = e; - } - callback(exception, stream && String(stream)); - } - - /*--------------------------------------------------------------------------*/ - - /** - * The Closure Compiler callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - * @param {String} map The source map output. - */ - function onClosureSimpleCompile(exception, result, map) { - if (exception) { - throw exception; - } - result = postprocess(result); - - var simple = this.compiled.simple; - simple.source = result; - simple.sourceMap = map; - zlib.gzip(result, onClosureSimpleGzip.bind(this)); - } - - /** - * The Closure Compiler `gzip` callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onClosureSimpleGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.compiled.simple.gzip = result; - } - // compile the source using advanced optimizations - if (this.modes.indexOf('advanced') > -1) { - closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this)); - } else { - onClosureAdvancedGzip.call(this); - } - } - - /** - * The Closure Compiler callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - * @param {String} map The source map output. - */ - function onClosureAdvancedCompile(exception, result, map) { - if (exception) { - throw exception; - } - result = postprocess(result); - - var advanced = this.compiled.advanced; - advanced.source = result; - advanced.sourceMap = map; - zlib.gzip(result, onClosureAdvancedGzip.bind(this)); - } - - /** - * The Closure Compiler `gzip` callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onClosureAdvancedGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.compiled.advanced.gzip = result; - } - // minify the source using UglifyJS - if (!this.isMapped) { - uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this)); - } else { - onComplete.call(this); - } - } - - /** - * The UglifyJS callback. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onUglify(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.uglified.source = result; - zlib.gzip(result, onUglifyGzip.bind(this)); - } - - /** - * The UglifyJS `gzip` callback. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onUglifyGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.uglified.gzip = result; - } - // minify the already Closure Compiler simple optimized source using UglifyJS - var modes = this.modes; - if (modes.indexOf('hybrid') > -1) { - if (modes.indexOf('simple') > -1) { - uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this)); - } else if (modes.indexOf('advanced') > -1) { - onSimpleHybridGzip.call(this); - } - } else { - onComplete.call(this); - } - } - - /** - * The hybrid callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onSimpleHybrid(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.hybrid.simple.source = result; - zlib.gzip(result, onSimpleHybridGzip.bind(this)); - } - - /** - * The hybrid `gzip` callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onSimpleHybridGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.hybrid.simple.gzip = result; - } - // minify the already Closure Compiler advance optimized source using UglifyJS - if (this.modes.indexOf('advanced') > -1) { - uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this)); - } else { - onComplete.call(this); - } - } - - /** - * The hybrid callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onAdvancedHybrid(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.hybrid.advanced.source = result; - zlib.gzip(result, onAdvancedHybridGzip.bind(this)); - } - - /** - * The hybrid `gzip` callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onAdvancedHybridGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.hybrid.advanced.gzip = result; - } - // finish by choosing the smallest compressed file - onComplete.call(this); - } - - /** - * The callback executed after the source is minified and gzipped. - * - * @private - */ - function onComplete() { - var compiledSimple = this.compiled.simple, - compiledAdvanced = this.compiled.advanced, - uglified = this.uglified, - hybridSimple = this.hybrid.simple, - hybridAdvanced = this.hybrid.advanced; - - var objects = [ - compiledSimple, - compiledAdvanced, - uglified, - hybridSimple, - hybridAdvanced - ]; - - var gzips = objects - .map(function(data) { return data.gzip; }) - .filter(Boolean); - - // select the smallest gzipped file and use its minified counterpart as the - // official minified release (ties go to the Closure Compiler) - var min = gzips.reduce(function(min, gzip) { - var length = gzip.length; - return min > length ? length : min; - }, Infinity); - - // pass the minified source to the "onComplete" callback - objects.some(function(data) { - var gzip = data.gzip; - if (gzip && gzip.length == min) { - data.outputPath = this.outputPath; - this.onComplete(data); - return true; - } - }, this); - } - - /*--------------------------------------------------------------------------*/ - - // expose `minify` - if (module != require.main) { - module.exports = minify; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node minify.js source.js`) and write to - // `.min.js` - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - minify(options); - }()); - } -}()); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/post-compile.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/post-compile.js deleted file mode 100644 index db56866..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/post-compile.js +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** The Node filesystem module */ - var fs = require('fs'); - - /** The minimal license/copyright template */ - var licenseTemplate = [ - '/**', - ' * @license', - ' * Lo-Dash <%= VERSION %> lodash.com/license', - ' * Underscore.js 1.4.4 underscorejs.org/LICENSE', - ' */' - ].join('\n'); - - /*--------------------------------------------------------------------------*/ - - /** - * Post-process a given minified Lo-Dash `source`, preparing it for - * deployment. - * - * @param {String} source The source to process. - * @returns {String} Returns the processed source. - */ - function postprocess(source) { - // remove copyright header - source = source.replace(/^\/\**[\s\S]+?\*\/\n/, ''); - - // correct overly aggressive Closure Compiler advanced optimizations - source = source - .replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}') - .replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")'); - - // flip `typeof` expressions to help optimize Safari and - // correct the AMD module definition for AMD build optimizers - // (e.g. from `"number" == typeof x` to `typeof x == "number") - source = source.replace(/(\w)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[.\w]+(?!\[)))/g, function(match, other, type, equality, expression) { - return (other ? other + ' ' : '') + expression + equality + type; - }); - - // add trailing semicolon - if (source) { - source = source.replace(/[\s;]*?(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*$/, ';$1'); - } - // exit early if version snippet isn't found - var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source); - if (!snippet) { - return source; - } - // add new copyright header - var version = snippet[2]; - source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source; - - return source; - } - - /*--------------------------------------------------------------------------*/ - - // expose `postprocess` - if (module != require.main) { - module.exports = postprocess; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node post-compile.js source.js`) and write to - // the same file - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - var filePath = options[options.length - 1], - source = fs.readFileSync(filePath, 'utf8'); - - fs.writeFileSync(filePath, postprocess(source), 'utf8'); - }()); - } -}()); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/pre-compile.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/pre-compile.js deleted file mode 100644 index 94e1011..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/build/pre-compile.js +++ /dev/null @@ -1,382 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** The Node filesystem module */ - var fs = require('fs'); - - /** Used to minify variables embedded in compiled strings */ - var compiledVars = [ - 'args', - 'argsIndex', - 'argsLength', - 'callback', - 'collection', - 'createCallback', - 'ctor', - 'guard', - 'hasOwnProperty', - 'index', - 'isArguments', - 'isArray', - 'isString', - 'iterable', - 'length', - 'nativeKeys', - 'object', - 'objectTypes', - 'ownIndex', - 'ownProps', - 'result', - 'skipProto', - 'source', - 'thisArg' - ]; - - /** Used to minify `compileIterator` option properties */ - var iteratorOptions = [ - 'args', - 'arrays', - 'bottom', - 'firstArg', - 'hasDontEnumBug', - 'hasEnumPrototype', - 'isKeysFast', - 'loop', - 'nonEnumArgs', - 'noCharByIndex', - 'shadowed', - 'top', - 'useHas' - ]; - - /** Used to minify variables and string values to a single character */ - var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); - minNames.push.apply(minNames, minNames.map(function(value) { - return value + value; - })); - - /** Used to protect the specified properties from getting minified */ - var propWhitelist = [ - '_', - '__wrapped__', - 'after', - 'all', - 'amd', - 'any', - 'assign', - 'at', - 'attachEvent', - 'bind', - 'bindAll', - 'bindKey', - 'clearTimeout', - 'clone', - 'cloneDeep', - 'collect', - 'compact', - 'compose', - 'contains', - 'countBy', - 'criteria', - 'debounce', - 'defaults', - 'defer', - 'delay', - 'detect', - 'difference', - 'drop', - 'each', - 'environment', - 'escape', - 'evaluate', - 'every', - 'exports', - 'extend', - 'filter', - 'find', - 'first', - 'flatten', - 'foldl', - 'foldr', - 'forEach', - 'forIn', - 'forOwn', - 'functions', - 'global', - 'groupBy', - 'has', - 'head', - 'imports', - 'identity', - 'include', - 'index', - 'indexOf', - 'initial', - 'inject', - 'interpolate', - 'intersection', - 'invert', - 'invoke', - 'isArguments', - 'isArray', - 'isBoolean', - 'isDate', - 'isElement', - 'isEmpty', - 'isEqual', - 'isEqual', - 'isFinite', - 'isFinite', - 'isFunction', - 'isNaN', - 'isNull', - 'isNumber', - 'isObject', - 'isPlainObject', - 'isRegExp', - 'isString', - 'isUndefined', - 'keys', - 'last', - 'lastIndexOf', - 'map', - 'max', - 'memoize', - 'merge', - 'methods', - 'min', - 'mixin', - 'noConflict', - 'object', - 'omit', - 'once', - 'opera', - 'pairs', - 'partial', - 'partialRight', - 'pick', - 'pluck', - 'random', - 'range', - 'reduce', - 'reduceRight', - 'reject', - 'rest', - 'result', - 'select', - 'setImmediate', - 'setTimeout', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'sortedIndex', - 'source', - 'tail', - 'take', - 'tap', - 'template', - 'templateSettings', - 'throttle', - 'times', - 'toArray', - 'unescape', - 'union', - 'uniq', - 'unique', - 'uniqueId', - 'value', - 'values', - 'variable', - 'VERSION', - 'where', - 'without', - 'wrap', - 'zip', - - // properties used by the `backbone` and `underscore` builds - '__chain__', - 'chain', - 'findWhere' - ]; - - /*--------------------------------------------------------------------------*/ - - /** - * Pre-process a given Lo-Dash `source`, preparing it for minification. - * - * @param {String} [source=''] The source to process. - * @param {Object} [options={}] The options object. - * @returns {String} Returns the processed source. - */ - function preprocess(source, options) { - source || (source = ''); - options || (options = {}); - - // remove unrecognized JSDoc tags so the Closure Compiler won't complain - source = source.replace(/@(?:alias|category)\b.*/g, ''); - - if (options.isTemplate) { - return source; - } - // add brackets to whitelisted properties so the Closure Compiler won't mung them - // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export - source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), function(match, prop) { - return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']"; - }); - - // remove brackets from `_.escape()` in `_.template` - source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape'); - - // remove brackets from `collection.indexOf` in `_.contains` - source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)'); - - // remove brackets from `result[length].value` in `_.sortBy` - source = source.replace("result[length]['value']", 'result[length].value'); - - // remove whitespace from string literals - source = source.replace(/^([ "'\w]+:)? *"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, captured) { - // remove object literal property name - if (/:$/.test(captured)) { - string = string.slice(captured.length); - } - // avoids removing the '\n' of the `stringEscapes` object - string = string.replace(/\[object |delete |else (?!{)|function | in |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) { - return match == false || match == '\\n' ? '' : match; - }); - // prepend object literal property name - return (captured || '') + string; - }); - - // remove whitespace from `_.template` related regexes - source = source.replace(/reEmptyString\w+ *=.+/g, function(match) { - return match.replace(/ |\\n/g, ''); - }); - - // remove newline from double-quoted strings in `_.template` - source = source - .replace('"__p += \'"', '"__p+=\'"') - .replace('"\';\n"', '"\';"') - - // remove debug sourceURL use in `_.template` - source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, ''); - - // minify internal properties used by 'compareAscending' and `_.sortBy` - (function() { - var properties = ['criteria', 'index', 'value'], - snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g); - - if (!snippets) { - return; - } - snippets.forEach(function(snippet) { - var modified = snippet; - - // minify properties - properties.forEach(function(property, index) { - var minName = minNames[index], - reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'), - reDotProp = RegExp('\\.' + property + '\\b', 'g'), - rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g'); - - modified = modified - .replace(reBracketProp, "['" + minName + "']") - .replace(reDotProp, "['" + minName + "']") - .replace(rePropColon, "$1'" + minName + "':"); - }); - - // replace with modified snippet - source = source.replace(snippet, modified); - }); - }()); - - // minify all compilable snippets - var snippets = source.match( - RegExp([ - // match the `iteratorTemplate` - '( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}', - // match methods created by `createIterator` calls - 'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n', - // match variables storing `createIterator` options - '( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}', - // match the the `createIterator` function - '( +)function createIterator\\b[\\s\\S]+?\\n\\3}' - ].join('|'), 'g') - ); - - // exit early if no compilable snippets - if (!snippets) { - return source; - } - - snippets.forEach(function(snippet, index) { - var isCreateIterator = /function createIterator\b/.test(snippet), - isIteratorTemplate = /var iteratorTemplate\b/.test(snippet), - modified = snippet; - - // add brackets to iterator option properties so the Closure Compiler won't mung them - modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), function(match, prop) { - return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']"; - }); - - if (isCreateIterator) { - // clip before the `factory` call to avoid minifying its arguments - source = source.replace(snippet, modified); - snippet = modified = modified.replace(/return factory\([\s\S]+$/, ''); - } - // minify `createIterator` option property names - iteratorOptions.forEach(function(property, index) { - var minName = minNames[index]; - - // minify variables in `iteratorTemplate` or property names in everything else - modified = isIteratorTemplate - ? modified.replace(RegExp('\\b' + property + '\\b', 'g'), minName) - : modified.replace(RegExp("'" + property + "'", 'g'), "'" + minName + "'"); - }); - - // minify snippet variables / arguments - compiledVars.forEach(function(variable, index) { - var minName = minNames[index]; - - // ensure properties in compiled strings aren't minified - modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName); - - // correct `typeof` values - if (/^(?:boolean|function|object|number|string|undefined)$/.test(variable)) { - modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + variable + "'"); - } - }); - - // replace with modified snippet - source = source.replace(snippet, modified); - }); - - return source; - } - - /*--------------------------------------------------------------------------*/ - - // expose `preprocess` - if (module != require.main) { - module.exports = preprocess; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node pre-compile.js source.js`) and write to - // the same file - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - var filePath = options[options.length - 1], - isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1, - source = fs.readFileSync(filePath, 'utf8'); - - fs.writeFileSync(filePath, preprocess(source, { - 'isTemplate': isTemplate - }), 'utf8'); - }()); - } -}()); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/dist/lodash.compat.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/dist/lodash.compat.js deleted file mode 100644 index 37ebc92..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/dist/lodash.compat.js +++ /dev/null @@ -1,5152 +0,0 @@ -/** - * @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/bestiejs/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n* [John-David Dalton](http://allyoucanleet.com/)\n [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\")\n\n## Contributors\n\n* [Kit Cambridge](http://kitcambridge.github.com/)\n [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\")\n* [Mathias Bynens](http://mathiasbynens.be/)\n [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\")\n", - "readmeFilename": "README.md", - "_id": "lodash@1.0.1", - "_from": "lodash@~1.0.1" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/perf/perf.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/perf/perf.js deleted file mode 100644 index 4ff9cf5..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/perf/perf.js +++ /dev/null @@ -1,1724 +0,0 @@ -(function(window) { - - /** Use a single "load" function */ - var load = typeof require == 'function' ? require : window.load; - - /** The file path of the Lo-Dash file to test */ - var filePath = (function() { - var min = 0; - var result = window.phantom - ? phantom.args - : (window.system - ? (min = 1, system.args) - : (window.process ? (min = 2, process.argv) : (window.arguments || [])) - ); - - var last = result[result.length - 1]; - result = (result.length > min && last != 'test.js') ? last : '../lodash.js'; - - try { - result = require('fs').realpathSync(result); - } catch(e) { } - - return result; - }()); - - /** Load Benchmark.js */ - var Benchmark = - window.Benchmark || ( - Benchmark = load('../vendor/benchmark.js/benchmark.js') || window.Benchmark, - Benchmark.Benchmark || Benchmark - ); - - /** Load Lo-Dash */ - var lodash = - window.lodash || ( - lodash = load(filePath) || window._, - lodash = lodash._ || lodash, - lodash.noConflict() - ); - - /** Load Underscore */ - var _ = - window._ || ( - _ = load('../vendor/underscore/underscore.js') || window._, - _._ || _ - ); - - /** Used to access the Firebug Lite panel (set by `run`) */ - var fbPanel; - - /** Used to score performance */ - var score = { 'a': 0, 'b': 0 }; - - /** Used to queue benchmark suites */ - var suites = []; - - /** The `ui` object */ - var ui = window.ui || { - 'buildPath': basename(filePath, '.js'), - 'otherPath': 'underscore' - }; - - /** The Lo-Dash build basename */ - var buildName = basename(ui.buildPath, '.js'); - - /** The other library basename */ - var otherName = basename(ui.otherPath, '.js'); - - /** Expose functions to the global object */ - window._ = _; - window.Benchmark = Benchmark; - window.lodash = lodash; - - /** Add `console.log()` support for Narwhal and RingoJS */ - if (!window.console && window.print) { - window.console = { 'log': window.print }; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Gets the basename of the given `filePath`. If the file `extension` is passed, - * it will be removed from the basename. - * - * @private - * @param {String} path The file path to inspect. - * @param {String} extension The extension to remove. - * @returns {String} Returns the basename. - */ - function basename(filePath, extension) { - var result = (filePath || '').split(/[\\/]/).pop(); - return arguments.length < 2 - ? result - : result.replace(RegExp(extension.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&') + '$'), ''); - } - - /** - * Gets the Hz, i.e. operations per second, of `bench` adjusted for the - * margin of error. - * - * @private - * @param {Object} bench The benchmark object. - * @returns {Number} Returns the adjusted Hz. - */ - function getHz(bench) { - var result = 1 / (bench.stats.mean + bench.stats.moe); - return isFinite(result) ? result : 0; - } - - /** - * Logs text to the console. - * - * @private - * @param {String} text The text to log. - */ - function log(text) { - console.log(text + ''); - if (fbPanel) { - // scroll the Firebug Lite panel down - fbPanel.scrollTop = fbPanel.scrollHeight; - } - } - - /** - * Runs all benchmark suites. - * - * @private (@public in the browser) - */ - function run() { - fbPanel = (fbPanel = window.document && document.getElementById('FirebugUI')) && - (fbPanel = (fbPanel = fbPanel.contentWindow || fbPanel.contentDocument).document || fbPanel) && - fbPanel.getElementById('fbPanel1'); - - log('\nSit back and relax, this may take a while.'); - suites[0].run(); - } - - /*--------------------------------------------------------------------------*/ - - lodash.extend(Benchmark.Suite.options, { - 'onStart': function() { - log('\n' + this.name + ':'); - }, - 'onCycle': function(event) { - log(event.target); - }, - 'onComplete': function() { - var formatNumber = Benchmark.formatNumber, - fastest = this.filter('fastest'), - fastestHz = getHz(fastest[0]), - slowest = this.filter('slowest'), - slowestHz = getHz(slowest[0]), - aHz = getHz(this[0]), - bHz = getHz(this[1]); - - if (fastest.length > 1) { - log('It\'s too close to call.'); - aHz = bHz = slowestHz; - } - else { - var percent = ((fastestHz / slowestHz) - 1) * 100; - - log( - fastest[0].name + ' is ' + - formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) + - '% faster.' - ); - } - // add score adjusted for margin of error - score.a += aHz; - score.b += bHz; - - // remove current suite from queue - suites.shift(); - - if (suites.length) { - // run next suite - suites[0].run(); - } - else { - var fastestTotalHz = Math.max(score.a, score.b), - slowestTotalHz = Math.min(score.a, score.b), - totalPercent = formatNumber(Math.round(((fastestTotalHz / slowestTotalHz) - 1) * 100)), - totalX = fastestTotalHz / slowestTotalHz, - message = 'is ' + totalPercent + '% ' + (totalX == 1 ? '' : '(' + formatNumber(totalX.toFixed(2)) + 'x) ') + 'faster than'; - - // report results - if (score.a >= score.b) { - log('\n' + buildName + ' ' + message + ' ' + otherName + '.'); - } else { - log('\n' + otherName + ' ' + message + ' ' + buildName + '.'); - } - } - } - }); - - /*--------------------------------------------------------------------------*/ - - lodash.extend(Benchmark.options, { - 'async': true, - 'setup': '\ - var window = Function("return this || global")(),\ - _ = window._,\ - lodash = window.lodash,\ - belt = this.name == "Lo-Dash" ? lodash : _;\ - \ - var index,\ - date = new Date,\ - limit = 20,\ - regexp = /x/,\ - object = {},\ - objects = Array(limit),\ - numbers = Array(limit),\ - fourNumbers = [5, 25, 10, 30],\ - nestedNumbers = [1, [2], [3, [[4]]]],\ - twoNumbers = [12, 23];\ - \ - for (index = 0; index < limit; index++) {\ - numbers[index] = index;\ - object["key" + index] = index;\ - objects[index] = { "num": index };\ - }\ - \ - if (typeof bind != "undefined") {\ - var contextObject = { "name": "moe" },\ - ctor = function() {};\ - \ - var func = function(greeting, punctuation) {\ - return greeting + ", " + this.name + (punctuation || ".");\ - };\ - \ - var lodashBoundNormal = lodash.bind(func, contextObject),\ - lodashBoundPartial = lodash.bind(func, contextObject, "hi");\ - \ - var _boundNormal = _.bind(func, contextObject),\ - _boundPartial = _.bind(func, contextObject, "hi");\ - }\ - \ - if (typeof bindAll != "undefined") {\ - var bindAllObjects = Array(this.count),\ - funcNames = belt.functions(lodash);\ - \ - // potentially expensive\n\ - for (index = 0; index < this.count; index++) {\ - bindAllObjects[index] = belt.reduce(funcNames, function(object, funcName) {\ - object[funcName] = lodash[funcName];\ - return object;\ - }, {});\ - }\ - }\ - if (typeof compact != "undefined") {\ - var uncompacted = numbers.slice();\ - uncompacted[2] = false;\ - uncompacted[6] = null;\ - uncompacted[18] = "";\ - }\ - \ - if (typeof countBy != "undefined" || typeof omit != "undefined") {\ - var wordToNumber = {\ - "one": 1,\ - "two": 2,\ - "three": 3,\ - "four": 4,\ - "five": 5,\ - "six": 6,\ - "seven": 7,\ - "eight": 8,\ - "nine": 9,\ - "ten": 10,\ - "eleven": 11,\ - "twelve": 12,\ - "thirteen": 13,\ - "fourteen": 14,\ - "fifteen": 15,\ - "sixteen": 16,\ - "seventeen": 17,\ - "eighteen": 18,\ - "nineteen": 19,\ - "twenty": 20,\ - "twenty-one": 21,\ - "twenty-two": 22,\ - "twenty-three": 23,\ - "twenty-four": 24,\ - "twenty-five": 25,\ - "twenty-six": 26,\ - "twenty-seven": 27,\ - "twenty-eight": 28,\ - "twenty-nine": 29,\ - "thirty": 30,\ - "thirty-one": 31,\ - "thirty-two": 32,\ - "thirty-three": 33,\ - "thirty-four": 34,\ - "thirty-five": 35,\ - "thirty-six": 36,\ - "thirty-seven": 37,\ - "thirty-eight": 38,\ - "thirty-nine": 39,\ - "forty": 40\ - };\ - \ - var words = belt.keys(wordToNumber).slice(0, limit);\ - }\ - \ - if (typeof isEqual != "undefined") {\ - var objectOfPrimitives = {\ - "boolean": true,\ - "number": 1,\ - "string": "a"\ - };\ - \ - var objectOfObjects = {\ - "boolean": new Boolean(true),\ - "number": new Number(1),\ - "string": new String("a")\ - };\ - \ - var object2 = {},\ - objects2 = Array(limit),\ - numbers2 = Array(limit),\ - nestedNumbers2 = [1, [2], [3, [[4]]]],\ - nestedNumbers3 = [1, [2], [5, [[6]]]],\ - simpleObject = { "a": 1 },\ - simpleObject2 = { "a": 2 },\ - simpleObjects = [simpleObject],\ - simpleObjects2 = [simpleObject2],\ - twoNumbers2 = [18, 27];\ - \ - for (index = 0; index < limit; index++) {\ - object2["key" + index] = index;\ - objects2[index] = { "num": index };\ - numbers2[index] = index;\ - }\ - }\ - \ - if (typeof multiArrays != "undefined") {\ - var twentyValues = Array(20),\ - twentyValues2 = Array(20),\ - twentyFiveValues = Array(25),\ - twentyFiveValues2 = Array(25),\ - thirtyValues = Array(30),\ - thirtyValues2 = Array(30),\ - fortyValues = Array(40),\ - fortyValues2 = Array(40),\ - fiftyValues = Array(50),\ - fiftyValues2 = Array(50),\ - seventyFiveValues = Array(75),\ - seventyFiveValues2 = Array(75),\ - hundredValues = Array(100),\ - hundredValues2 = Array(100),\ - lowerChars = "abcdefghijklmnopqrstuvwxyz".split(""),\ - upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");\ - \ - for (index = 0; index < 100; index++) {\ - if (index < 15) {\ - twentyValues[index] = lowerChars[index];\ - twentyValues2[index] = upperChars[index];\ - }\ - if (index < 20) {\ - twentyValues[index] =\ - twentyValues2[index] = index;\ - \ - twentyFiveValues[index] = lowerChars[index];\ - twentyFiveValues2[index] = upperChars[index];\ - }\ - if (index < 25) {\ - twentyFiveValues[index] =\ - twentyFiveValues2[index] = index;\ - \ - thirtyValues[index] =\ - fortyValues[index] =\ - fiftyValues[index] =\ - seventyFiveValues[index] =\ - hundredValues[index] = lowerChars[index];\ - \ - thirtyValues2[index] =\ - fortyValues2[index] =\ - fiftyValues2[index] =\ - seventyFiveValues2[index] =\ - hundredValues2[index] = upperChars[index];\ - }\ - else {\ - if (index < 30) {\ - thirtyValues[index] =\ - thirtyValues2[index] = index;\ - }\ - if (index < 40) {\ - fortyValues[index] =\ - fortyValues2[index] = index;\ - }\ - if (index < 50) {\ - fiftyValues[index] =\ - fiftyValues2[index] = index;\ - }\ - if (index < 75) {\ - seventyFiveValues[index] =\ - seventyFiveValues2[index] = index;\ - }\ - hundredValues[index] =\ - hundredValues2[index] = index;\ - }\ - }\ - }\ - \ - if (typeof template != "undefined") {\ - var tplData = {\ - "header1": "Header1",\ - "header2": "Header2",\ - "header3": "Header3",\ - "header4": "Header4",\ - "header5": "Header5",\ - "header6": "Header6",\ - "list": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]\ - };\ - \ - var tpl =\ - "
        " +\ - "

        <%= header1 %>

        " +\ - "

        <%= header2 %>

        " +\ - "

        <%= header3 %>

        " +\ - "

        <%= header4 %>

        " +\ - "
        <%= header5 %>
        " +\ - "
        <%= header6 %>
        " +\ - "
          " +\ - "<% for (var index = 0, length = list.length; index < length; index++) { %>" +\ - "
        • <%= list[index] %>
        • " +\ - "<% } %>" +\ - "
        " +\ - "
        ";\ - \ - var tplVerbose =\ - "
        " +\ - "

        <%= data.header1 %>

        " +\ - "

        <%= data.header2 %>

        " +\ - "

        <%= data.header3 %>

        " +\ - "

        <%= data.header4 %>

        " +\ - "
        <%= data.header5 %>
        " +\ - "
        <%= data.header6 %>
        " +\ - "
          " +\ - "<% for (var index = 0, length = data.list.length; index < length; index++) { %>" +\ - "
        • <%= data.list[index] %>
        • " +\ - "<% } %>" +\ - "
        " +\ - "
        ";\ - \ - var settingsObject = { "variable": "data" };\ - \ - var lodashTpl = lodash.template(tpl),\ - lodashTplVerbose = lodash.template(tplVerbose, null, settingsObject);\ - \ - var _tpl = _.template(tpl),\ - _tplVerbose = _.template(tplVerbose, null, settingsObject);\ - }' - }); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.bind` (uses native `Function#bind` if available and inferred fast)') - .add(buildName, { - 'fn': 'lodash.bind(func, { "name": "moe" }, "hi")', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_.bind(func, { "name": "moe" }, "hi")', - 'teardown': 'function bind(){}' - }) - ); - - suites.push( - Benchmark.Suite('bound call') - .add(buildName, { - 'fn': 'lodashBoundNormal()', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_boundNormal()', - 'teardown': 'function bind(){}' - }) - ); - - suites.push( - Benchmark.Suite('bound call with arguments') - .add(buildName, { - 'fn': 'lodashBoundNormal("hi", "!")', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_boundNormal("hi", "!")', - 'teardown': 'function bind(){}' - }) - ); - - suites.push( - Benchmark.Suite('bound and partially applied call (uses native `Function#bind` if available)') - .add(buildName, { - 'fn': 'lodashBoundPartial()', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_boundPartial()', - 'teardown': 'function bind(){}' - }) - ); - - suites.push( - Benchmark.Suite('bound and partially applied call with arguments (uses native `Function#bind` if available)') - .add(buildName, { - 'fn': 'lodashBoundPartial("!")', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_boundPartial("!")', - 'teardown': 'function bind(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.bindAll` iterating arguments') - .add(buildName, { - 'fn': 'lodash.bindAll.apply(lodash, [bindAllObjects.pop()].concat(funcNames))', - 'teardown': 'function bindAll(){}' - }) - .add(otherName, { - 'fn': '_.bindAll.apply(_, [bindAllObjects.pop()].concat(funcNames))', - 'teardown': 'function bindAll(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.bindAll` iterating the `object`') - .add(buildName, { - 'fn': 'lodash.bindAll(bindAllObjects.pop())', - 'teardown': 'function bindAll(){}' - }) - .add(otherName, { - 'fn': '_.bindAll(bindAllObjects.pop())', - 'teardown': 'function bindAll(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.clone` with an object') - .add(buildName, '\ - lodash.clone(object)' - ) - .add(otherName, '\ - _.clone(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.compact`') - .add(buildName, { - 'fn': 'lodash.compact(uncompacted)', - 'teardown': 'function compact(){}' - }) - .add(otherName, { - 'fn': '_.compact(uncompacted)', - 'teardown': 'function compact(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.contains` iterating an array') - .add(buildName, '\ - lodash.contains(numbers, 19)' - ) - .add(otherName, '\ - _.contains(numbers, 19)' - ) - ); - - suites.push( - Benchmark.Suite('`_.contains` iterating an object') - .add(buildName, '\ - lodash.contains(object, 19)' - ) - .add(otherName, '\ - _.contains(object, 19)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.countBy` with `callback` iterating an array') - .add(buildName, '\ - lodash.countBy(numbers, function(num) { return num >> 1; })' - ) - .add(otherName, '\ - _.countBy(numbers, function(num) { return num >> 1; })' - ) - ); - - suites.push( - Benchmark.Suite('`_.countBy` with `property` name iterating an array') - .add(buildName, { - 'fn': 'lodash.countBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.countBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.countBy` with `callback` iterating an object') - .add(buildName, { - 'fn': 'lodash.countBy(wordToNumber, function(num) { return num >> 1; })', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.countBy(wordToNumber, function(num) { return num >> 1; })', - 'teardown': 'function countBy(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.defaults`') - .add(buildName, '\ - lodash.defaults({ "key2": 2, "key6": 6, "key18": 18 }, object)' - ) - .add(otherName, '\ - _.defaults({ "key2": 2, "key6": 6, "key18": 18 }, object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.difference`') - .add(buildName, '\ - lodash.difference(numbers, twoNumbers, fourNumbers)' - ) - .add(otherName, '\ - _.difference(numbers, twoNumbers, fourNumbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.difference` iterating 30 elements') - .add(buildName, { - 'fn': 'lodash.difference(thirtyValues, thirtyValues2)', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.difference(thirtyValues, thirtyValues2)', - 'teardown': 'function multiArrays(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.difference` iterating 20 and 40 elements') - .add(buildName, { - 'fn': 'lodash.difference(twentyValues, fortyValues2)', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.difference(twentyValues, fortyValues2)', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.each` iterating an array') - .add(buildName, '\ - var result = [];\ - lodash.each(numbers, function(num) {\ - result.push(num * 2);\ - })' - ) - .add(otherName, '\ - var result = [];\ - _.each(numbers, function(num) {\ - result.push(num * 2);\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.each` iterating an array with `thisArg` (slow path)') - .add(buildName, '\ - var result = [];\ - lodash.each(numbers, function(num, index) {\ - result.push(num + this["key" + index]);\ - }, object)' - ) - .add(otherName, '\ - var result = [];\ - _.each(numbers, function(num, index) {\ - result.push(num + this["key" + index]);\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.each` iterating an object') - .add(buildName, '\ - var result = [];\ - lodash.each(object, function(num) {\ - result.push(num * 2);\ - })' - ) - .add(otherName, '\ - var result = [];\ - _.each(object, function(num) {\ - result.push(num * 2);\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.every` iterating an array') - .add(buildName, '\ - lodash.every(numbers, function(num) {\ - return num + "";\ - })' - ) - .add(otherName, '\ - _.every(numbers, function(num) {\ - return num + "";\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.every` iterating an object') - .add(buildName, '\ - lodash.every(object, function(num) {\ - return num + "";\ - })' - ) - .add(otherName, '\ - _.every(object, function(num) {\ - return num + "";\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.extend`') - .add(buildName, '\ - lodash.extend({}, object)' - ) - .add(otherName, '\ - _.extend({}, object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.filter` iterating an array') - .add(buildName, '\ - lodash.filter(numbers, function(num) {\ - return num % 2;\ - })' - ) - .add(otherName, '\ - _.filter(numbers, function(num) {\ - return num % 2;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.filter` iterating an array with `thisArg` (slow path)') - .add(buildName, '\ - lodash.filter(numbers, function(num, index) {\ - return this["key" + index] % 2;\ - }, object)' - ) - .add(otherName, '\ - _.filter(numbers, function(num, index) {\ - return this["key" + index] % 2;\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.filter` iterating an object') - .add(buildName, '\ - lodash.filter(object, function(num) {\ - return num % 2\ - })' - ) - .add(otherName, '\ - _.filter(object, function(num) {\ - return num % 2\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.find` iterating an array') - .add(buildName, '\ - lodash.find(numbers, function(num) {\ - return num === 19;\ - })' - ) - .add(otherName, '\ - _.find(numbers, function(num) {\ - return num === 19;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.find` iterating an object') - .add(buildName, '\ - lodash.find(object, function(value, key) {\ - return /\D9$/.test(key);\ - })' - ) - .add(otherName, '\ - _.find(object, function(value, key) {\ - return /\D9$/.test(key);\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.find` with `properties`') - .add(buildName, '\ - lodash.find(objects, { "num": 9 });' - ) - .add(otherName, '\ - _.findWhere(objects, { "num": 9 });' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.flatten`') - .add(buildName, '\ - lodash.flatten(nestedNumbers)' - ) - .add(otherName, '\ - _.flatten(nestedNumbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.flatten` with `shallow`') - .add(buildName, '\ - lodash.flatten(nestedNumbers, true)' - ) - .add(otherName, '\ - _.flatten(nestedNumbers, true)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.functions`') - .add(buildName, '\ - lodash.functions(lodash)' - ) - .add(otherName, '\ - _.functions(lodash)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.groupBy` with `callback` iterating an array') - .add(buildName, '\ - lodash.groupBy(numbers, function(num) { return num >> 1; })' - ) - .add(otherName, '\ - _.groupBy(numbers, function(num) { return num >> 1; })' - ) - ); - - suites.push( - Benchmark.Suite('`_.groupBy` with `property` name iterating an array') - .add(buildName, { - 'fn': 'lodash.groupBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.groupBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.groupBy` with `callback` iterating an object') - .add(buildName, { - 'fn': 'lodash.groupBy(wordToNumber, function(num) { return num >> 1; })', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.groupBy(wordToNumber, function(num) { return num >> 1; })', - 'teardown': 'function countBy(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.indexOf`') - .add(buildName, '\ - lodash.indexOf(numbers, 9)' - ) - .add(otherName, '\ - _.indexOf(numbers, 9)' - ) - ); - - suites.push( - Benchmark.Suite('`_.indexOf` with `isSorted`') - .add(buildName, '\ - lodash.indexOf(numbers, 19, true)' - ) - .add(otherName, '\ - _.indexOf(numbers, 19, true)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.intersection`') - .add(buildName, '\ - lodash.intersection(numbers, twoNumbers, fourNumbers)' - ) - .add(otherName, '\ - _.intersection(numbers, twoNumbers, fourNumbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.intersection` iterating 100 elements') - .add(buildName, { - 'fn': 'lodash.intersection(hundredValues, hundredValues2)', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.intersection(hundredValues, hundredValues2)', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.invert`') - .add(buildName, '\ - lodash.invert(object)' - ) - .add(otherName, '\ - _.invert(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.invoke` iterating an array') - .add(buildName, '\ - lodash.invoke(numbers, "toFixed", "2")' - ) - .add(otherName, '\ - _.invoke(numbers, "toFixed", "2")' - ) - ); - - suites.push( - Benchmark.Suite('`_.invoke` with a function for `methodName` iterating an array') - .add(buildName, '\ - lodash.invoke(numbers, String.prototype.split, "")' - ) - .add(otherName, '\ - _.invoke(numbers, String.prototype.split, "")' - ) - ); - - suites.push( - Benchmark.Suite('`_.invoke` iterating an object') - .add(buildName, '\ - lodash.invoke(object, "toFixed", "2")' - ) - .add(otherName, '\ - _.invoke(object, "toFixed", "2")' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.isEqual` comparing primitives and objects (edge case)') - .add(buildName, { - 'fn': 'lodash.isEqual(objectOfPrimitives, objectOfObjects)', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '_.isEqual(objectOfPrimitives, objectOfObjects)', - 'teardown': 'function isEqual(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.isEqual` comparing arrays') - .add(buildName, { - 'fn': '\ - lodash.isEqual(numbers, numbers2);\ - lodash.isEqual(twoNumbers, twoNumbers2);', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '\ - _.isEqual(numbers, numbers2);\ - _.isEqual(twoNumbers, twoNumbers2);', - 'teardown': 'function isEqual(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.isEqual` comparing nested arrays') - .add(buildName, { - 'fn': '\ - lodash.isEqual(nestedNumbers, nestedNumbers2);\ - lodash.isEqual(nestedNumbers2, nestedNumbers3);', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '\ - _.isEqual(nestedNumbers, nestedNumbers2);\ - _.isEqual(nestedNumbers2, nestedNumbers3);', - 'teardown': 'function isEqual(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.isEqual` comparing arrays of objects') - .add(buildName, { - 'fn': '\ - lodash.isEqual(objects, objects2);\ - lodash.isEqual(simpleObjects, simpleObjects2);', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '\ - _.isEqual(objects, objects2);\ - _.isEqual(simpleObjects, simpleObjects2);', - 'teardown': 'function isEqual(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.isEqual` comparing objects') - .add(buildName, { - 'fn': '\ - lodash.isEqual(object, object2);\ - lodash.isEqual(simpleObject, simpleObject2);', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '\ - _.isEqual(object, object2);\ - _.isEqual(simpleObject, simpleObject2);', - 'teardown': 'function isEqual(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.isArguments`, `_.isDate`, `_.isFunction`, `_.isNumber`, `_.isRegExp`') - .add(buildName, '\ - lodash.isArguments(arguments);\ - lodash.isArguments(object);\ - lodash.isDate(date);\ - lodash.isDate(object);\ - lodash.isFunction(lodash);\ - lodash.isFunction(object);\ - lodash.isNumber(1);\ - lodash.isNumber(object);\ - lodash.isRegExp(regexp);\ - lodash.isRegExp(object);' - ) - .add(otherName, '\ - _.isArguments(arguments);\ - _.isArguments(object);\ - _.isDate(date);\ - _.isDate(object);\ - _.isFunction(_);\ - _.isFunction(object);\ - _.isNumber(1);\ - _.isNumber(object);\ - _.isRegExp(regexp);\ - _.isRegExp(object);' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.keys` (uses native `Object.keys` if available)') - .add(buildName, '\ - lodash.keys(object)' - ) - .add(otherName, '\ - _.keys(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.lastIndexOf`') - .add(buildName, '\ - lodash.lastIndexOf(numbers, 9)' - ) - .add(otherName, '\ - _.lastIndexOf(numbers, 9)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.map` iterating an array') - .add(buildName, '\ - lodash.map(objects, function(value) {\ - return value.num;\ - })' - ) - .add(otherName, '\ - _.map(objects, function(value) {\ - return value.num;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.map` with `thisArg` iterating an array (slow path)') - .add(buildName, '\ - lodash.map(objects, function(value, index) {\ - return this["key" + index] + value.num;\ - }, object)' - ) - .add(otherName, '\ - _.map(objects, function(value, index) {\ - return this["key" + index] + value.num;\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.map` iterating an object') - .add(buildName, '\ - lodash.map(object, function(value) {\ - return value;\ - })' - ) - .add(otherName, '\ - _.map(object, function(value) {\ - return value;\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.max`') - .add(buildName, '\ - lodash.max(numbers)' - ) - .add(otherName, '\ - _.max(numbers)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.min`') - .add(buildName, '\ - lodash.min(numbers)' - ) - .add(otherName, '\ - _.min(numbers)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.omit` iterating 20 properties, omitting 2 keys') - .add(buildName, '\ - lodash.omit(object, "key6", "key13")' - ) - .add(otherName, '\ - _.omit(object, "key6", "key13")' - ) - ); - - suites.push( - Benchmark.Suite('`_.omit` iterating 40 properties, omitting 20 keys') - .add(buildName, { - 'fn': 'lodash.omit(wordToNumber, words)', - 'teardown': 'function omit(){}' - }) - .add(otherName, { - 'fn': 'result = _.omit(wordToNumber, words)', - 'teardown': 'function omit(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.pairs`') - .add(buildName, '\ - lodash.pairs(object)' - ) - .add(otherName, '\ - _.pairs(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.pick`') - .add(buildName, '\ - lodash.pick(object, "key6", "key13")' - ) - .add(otherName, '\ - _.pick(object, "key6", "key13")' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.pluck`') - .add(buildName, '\ - lodash.pluck(objects, "num")' - ) - .add(otherName, '\ - _.pluck(objects, "num")' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.reduce` iterating an array') - .add(buildName, '\ - lodash.reduce(numbers, function(result, value, index) {\ - result[index] = value;\ - return result;\ - }, {});' - ) - .add(otherName, '\ - _.reduce(numbers, function(result, value, index) {\ - result[index] = value;\ - return result;\ - }, {});' - ) - ); - - suites.push( - Benchmark.Suite('`_.reduce` iterating an object') - .add(buildName, '\ - lodash.reduce(object, function(result, value, key) {\ - result.push([key, value]);\ - return result;\ - }, []);' - ) - .add(otherName, '\ - _.reduce(object, function(result, value, key) {\ - result.push([key, value]);\ - return result;\ - }, []);' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.reduceRight` iterating an array') - .add(buildName, '\ - lodash.reduceRight(numbers, function(result, value, index) {\ - result[index] = value;\ - return result;\ - }, {});' - ) - .add(otherName, '\ - _.reduceRight(numbers, function(result, value, index) {\ - result[index] = value;\ - return result;\ - }, {});' - ) - ); - - suites.push( - Benchmark.Suite('`_.reduceRight` iterating an object') - .add(buildName, '\ - lodash.reduceRight(object, function(result, value, key) {\ - result.push([key, value]);\ - return result;\ - }, []);' - ) - .add(otherName, '\ - _.reduceRight(object, function(result, value, key) {\ - result.push([key, value]);\ - return result;\ - }, []);' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.reject` iterating an array') - .add(buildName, '\ - lodash.reject(numbers, function(num) {\ - return num % 2;\ - })' - ) - .add(otherName, '\ - _.reject(numbers, function(num) {\ - return num % 2;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.reject` iterating an array with `thisArg` (slow path)') - .add(buildName, '\ - lodash.reject(numbers, function(num, index) {\ - return this["key" + index] % 2;\ - }, object)' - ) - .add(otherName, '\ - _.reject(numbers, function(num, index) {\ - return this["key" + index] % 2;\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.reject` iterating an object') - .add(buildName, '\ - lodash.reject(object, function(num) {\ - return num % 2\ - })' - ) - .add(otherName, '\ - _.reject(object, function(num) {\ - return num % 2\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.shuffle`') - .add(buildName, '\ - lodash.shuffle(numbers)' - ) - .add(otherName, '\ - _.shuffle(numbers)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.size` with an object') - .add(buildName, '\ - lodash.size(object)' - ) - .add(otherName, '\ - _.size(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.some` iterating an array') - .add(buildName, '\ - lodash.some(numbers, function(num) {\ - return num == 19;\ - })' - ) - .add(otherName, '\ - _.some(numbers, function(num) {\ - return num == 19;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.some` with `thisArg` iterating an array (slow path)') - .add(buildName, '\ - lodash.some(objects, function(value, index) {\ - return this["key" + index] == 19;\ - }, object)' - ) - .add(otherName, '\ - _.some(objects, function(value, index) {\ - return this["key" + index] == 19;\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.some` iterating an object') - .add(buildName, '\ - lodash.some(object, function(num) {\ - return num == 19;\ - })' - ) - .add(otherName, '\ - _.some(object, function(num) {\ - return num == 19;\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.sortBy` with `callback`') - .add(buildName, '\ - lodash.sortBy(numbers, function(num) { return Math.sin(num); })' - ) - .add(otherName, '\ - _.sortBy(numbers, function(num) { return Math.sin(num); })' - ) - ); - - suites.push( - Benchmark.Suite('`_.sortBy` with `callback` and `thisArg` (slow path)') - .add(buildName, '\ - lodash.sortBy(numbers, function(num) { return this.sin(num); }, Math)' - ) - .add(otherName, '\ - _.sortBy(numbers, function(num) { return this.sin(num); }, Math)' - ) - ); - - suites.push( - Benchmark.Suite('`_.sortBy` with `property` name') - .add(buildName, { - 'fn': 'lodash.sortBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.sortBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.sortedIndex`') - .add(buildName, '\ - lodash.sortedIndex(numbers, 25)' - ) - .add(otherName, '\ - _.sortedIndex(numbers, 25)' - ) - ); - - suites.push( - Benchmark.Suite('`_.sortedIndex` with `callback`') - .add(buildName, { - 'fn': '\ - lodash.sortedIndex(words, "twenty-five", function(value) {\ - return wordToNumber[value];\ - })', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '\ - _.sortedIndex(words, "twenty-five", function(value) {\ - return wordToNumber[value];\ - })', - 'teardown': 'function countBy(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.template` (slow path)') - .add(buildName, { - 'fn': 'lodash.template(tpl, tplData)', - 'teardown': 'function template(){}' - }) - .add(otherName, { - 'fn': '_.template(tpl, tplData)', - 'teardown': 'function template(){}' - }) - ); - - suites.push( - Benchmark.Suite('compiled template') - .add(buildName, { - 'fn': 'lodashTpl(tplData)', - 'teardown': 'function template(){}' - }) - .add(otherName, { - 'fn': '_tpl(tplData)', - 'teardown': 'function template(){}' - }) - ); - - suites.push( - Benchmark.Suite('compiled template without a with-statement') - .add(buildName, { - 'fn': 'lodashTplVerbose(tplData)', - 'teardown': 'function template(){}' - }) - .add(otherName, { - 'fn': '_tplVerbose(tplData)', - 'teardown': 'function template(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.times`') - .add(buildName, '\ - var result = [];\ - lodash.times(limit, function(n) { result.push(n); })' - ) - .add(otherName, '\ - var result = [];\ - _.times(limit, function(n) { result.push(n); })' - ) - ); - - suites.push( - Benchmark.Suite('`_.times` with `thisArg`') - .add(buildName, '\ - var result = [];\ - lodash.times(limit, function(n) { result.push(this.sin(n)); }, Math)' - ) - .add(otherName, '\ - var result = [];\ - _.times(limit, function(n) { result.push(this.sin(n)); }, Math)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.toArray` with an array (edge case)') - .add(buildName, '\ - lodash.toArray(numbers)' - ) - .add(otherName, '\ - _.toArray(numbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.toArray` with an object') - .add(buildName, '\ - lodash.toArray(object)' - ) - .add(otherName, '\ - _.toArray(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.union`') - .add(buildName, '\ - lodash.union(numbers, twoNumbers, fourNumbers)' - ) - .add(otherName, '\ - _.union(numbers, twoNumbers, fourNumbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.union` iterating an array of 75 elements') - .add(buildName, { - 'fn': 'lodash.union(fiftyValues, twentyFiveValues2);', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.union(fiftyValues, twentyFiveValues2);', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.uniq`') - .add(buildName, '\ - lodash.uniq(numbers.concat(twoNumbers, fourNumbers))' - ) - .add(otherName, '\ - _.uniq(numbers.concat(twoNumbers, fourNumbers))' - ) - ); - - suites.push( - Benchmark.Suite('`_.uniq` with `callback`') - .add(buildName, '\ - lodash.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\ - return num % 2;\ - });' - ) - .add(otherName, '\ - _.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\ - return num % 2;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.uniq` iterating an array of 75 elements') - .add(buildName, { - 'fn': 'lodash.uniq(fiftyValues.concat(twentyFiveValues2));', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.uniq(fiftyValues.concat(twentyFiveValues2));', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.values`') - .add(buildName, '\ - lodash.values(object)' - ) - .add(otherName, '\ - _.values(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.where`') - .add(buildName, '\ - lodash.where(objects, { "num": 9 });' - ) - .add(otherName, '\ - _.where(objects, { "num": 9 });' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.without`') - .add(buildName, '\ - lodash.without(numbers, 9, 12, 14, 15)' - ) - .add(otherName, '\ - _.without(numbers, 9, 12, 14, 15)' - ) - ); - - suites.push( - Benchmark.Suite('`_.without` iterating an array of 30 elements') - .add(buildName, { - 'fn': 'lodash.without.apply(lodash, [thirtyValues].concat(thirtyValues2));', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.without.apply(_, [thirtyValues].concat(thirtyValues2));', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - if (Benchmark.platform + '') { - log(Benchmark.platform); - } - - // in the browser, expose `run` to be called later - if (window.document && !window.phantom) { - window.run = run; - } else { - run(); - } -}(typeof global == 'object' && global || this)); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/a.jst b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/a.jst deleted file mode 100644 index cca541d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/a.jst +++ /dev/null @@ -1,3 +0,0 @@ -
          -<% _.forEach(people, function(name) { %>
        • <%- name %>
        • <% }); %> -
        \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/b.jst b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/b.jst deleted file mode 100644 index cad081d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/b.jst +++ /dev/null @@ -1 +0,0 @@ -<% print("Hello " + epithet); %>. \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/c.jst b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/c.jst deleted file mode 100644 index f926799..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/c.jst +++ /dev/null @@ -1 +0,0 @@ -Hello ${ name }! \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/d.tpl b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/d.tpl deleted file mode 100644 index c7a43bc..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/template/d.tpl +++ /dev/null @@ -1 +0,0 @@ -Hello {{ name }}! \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/test-build.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/test-build.js deleted file mode 100644 index 759d98e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/test-build.js +++ /dev/null @@ -1,1324 +0,0 @@ -#!/usr/bin/env node -;(function(undefined) { - 'use strict'; - - /** Load modules */ - var fs = require('fs'), - path = require('path'), - vm = require('vm'), - build = require('../build.js'), - minify = require('../build/minify'), - _ = require('../lodash.js'); - - /** The unit testing framework */ - var QUnit = ( - global.addEventListener || (global.addEventListener = Function.prototype), - global.QUnit = require('../vendor/qunit/qunit/qunit.js'), - require('../vendor/qunit-clib/qunit-clib.js'), - global.addEventListener === Function.prototype && delete global.addEventListener, - global.QUnit - ); - - /** The time limit for the tests to run (milliseconds) */ - var timeLimit = process.argv.reduce(function(result, value, index) { - if (/--time-limit/.test(value)) { - return parseInt(process.argv[index + 1].replace(/(\d+h)?(\d+m)?(\d+s)?/, function(match, h, m, s) { - return ((parseInt(h) || 0) * 3600000) + - ((parseInt(m) || 0) * 60000) + - ((parseInt(s) || 0) * 1000); - })) || result; - } - return result; - }, 0); - - /** Used to associate aliases with their real names */ - var aliasToRealMap = { - 'all': 'every', - 'any': 'some', - 'collect': 'map', - 'detect': 'find', - 'drop': 'rest', - 'each': 'forEach', - 'extend': 'assign', - 'foldl': 'reduce', - 'foldr': 'reduceRight', - 'head': 'first', - 'include': 'contains', - 'inject': 'reduce', - 'methods': 'functions', - 'select': 'filter', - 'tail': 'rest', - 'take': 'first', - 'unique': 'uniq' - }; - - /** Used to associate real names with their aliases */ - var realToAliasMap = { - 'assign': ['extend'], - 'contains': ['include'], - 'every': ['all'], - 'filter': ['select'], - 'find': ['detect'], - 'first': ['head', 'take'], - 'forEach': ['each'], - 'functions': ['methods'], - 'map': ['collect'], - 'reduce': ['foldl', 'inject'], - 'reduceRight': ['foldr'], - 'rest': ['drop', 'tail'], - 'some': ['any'], - 'uniq': ['unique'] - }; - - /** List of all Lo-Dash methods */ - var allMethods = _.functions(_) - .filter(function(methodName) { return !/^_/.test(methodName); }) - .concat('chain') - .sort(); - - /** List of "Arrays" category methods */ - var arraysMethods = [ - 'compact', - 'difference', - 'drop', - 'first', - 'flatten', - 'head', - 'indexOf', - 'initial', - 'intersection', - 'last', - 'lastIndexOf', - 'object', - 'range', - 'rest', - 'sortedIndex', - 'tail', - 'take', - 'union', - 'uniq', - 'unique', - 'without', - 'zip' - ]; - - /** List of "Chaining" category methods */ - var chainingMethods = [ - 'mixin', - 'tap', - 'value' - ]; - - /** List of "Collections" category methods */ - var collectionsMethods = [ - 'all', - 'any', - 'at', - 'collect', - 'contains', - 'countBy', - 'detect', - 'each', - 'every', - 'filter', - 'find', - 'foldl', - 'foldr', - 'forEach', - 'groupBy', - 'include', - 'inject', - 'invoke', - 'map', - 'max', - 'min', - 'pluck', - 'reduce', - 'reduceRight', - 'reject', - 'select', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'toArray', - 'where' - ]; - - /** List of "Functions" category methods */ - var functionsMethods = [ - 'after', - 'bind', - 'bindAll', - 'bindKey', - 'compose', - 'debounce', - 'defer', - 'delay', - 'memoize', - 'once', - 'partial', - 'partialRight', - 'throttle', - 'wrap' - ]; - - /** List of "Objects" category methods */ - var objectsMethods = [ - 'assign', - 'clone', - 'cloneDeep', - 'defaults', - 'extend', - 'forIn', - 'forOwn', - 'functions', - 'has', - 'invert', - 'isArguments', - 'isArray', - 'isBoolean', - 'isDate', - 'isElement', - 'isEmpty', - 'isEqual', - 'isFinite', - 'isFunction', - 'isNaN', - 'isNull', - 'isNumber', - 'isObject', - 'isPlainObject', - 'isRegExp', - 'isString', - 'isUndefined', - 'keys', - 'methods', - 'merge', - 'omit', - 'pairs', - 'pick', - 'values' - ]; - - /** List of "Utilities" category methods */ - var utilityMethods = [ - 'escape', - 'identity', - 'noConflict', - 'random', - 'result', - 'template', - 'times', - 'unescape', - 'uniqueId' - ]; - - /** List of Backbone's Lo-Dash dependencies */ - var backboneDependencies = [ - 'bind', - 'bindAll', - 'chain', - 'clone', - 'contains', - 'countBy', - 'defaults', - 'escape', - 'every', - 'extend', - 'filter', - 'find', - 'first', - 'forEach', - 'groupBy', - 'has', - 'indexOf', - 'initial', - 'invoke', - 'isArray', - 'isEmpty', - 'isEqual', - 'isFunction', - 'isObject', - 'isRegExp', - 'isString', - 'keys', - 'last', - 'lastIndexOf', - 'map', - 'max', - 'min', - 'mixin', - 'once', - 'pick', - 'reduce', - 'reduceRight', - 'reject', - 'rest', - 'result', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'sortedIndex', - 'toArray', - 'uniqueId', - 'value', - 'without' - ]; - - /** List of methods used by Underscore */ - var underscoreMethods = _.without.apply(_, [allMethods].concat([ - 'at', - 'bindKey', - 'cloneDeep', - 'forIn', - 'forOwn', - 'isPlainObject', - 'merge', - 'partialRight' - ])); - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a context object to use with `vm.runInContext`. - * - * @private - * @returns {Object} Returns a new context object. - */ - function createContext() { - return vm.createContext({ - 'clearTimeout': clearTimeout, - 'setTimeout': setTimeout - }); - } - - /** - * Expands a list of method names to include real and alias names. - * - * @private - * @param {Array} methodNames The array of method names to expand. - * @returns {Array} Returns a new array of expanded method names. - */ - function expandMethodNames(methodNames) { - return methodNames.reduce(function(result, methodName) { - var realName = getRealName(methodName); - result.push.apply(result, [realName].concat(getAliases(realName))); - return result; - }, []); - } - - /** - * Gets the aliases associated with a given function name. - * - * @private - * @param {String} funcName The name of the function to get aliases for. - * @returns {Array} Returns an array of aliases. - */ - function getAliases(funcName) { - return realToAliasMap[funcName] || []; - } - - /** - * Gets the names of methods belonging to the given `category`. - * - * @private - * @param {String} category The category to filter by. - * @returns {Array} Returns a new array of method names belonging to the given category. - */ - function getMethodsByCategory(category) { - switch (category) { - case 'Arrays': - return arraysMethods.slice(); - case 'Chaining': - return chainingMethods.slice(); - case 'Collections': - return collectionsMethods.slice(); - case 'Functions': - return functionsMethods.slice(); - case 'Objects': - return objectsMethods.slice(); - case 'Utilities': - return utilityMethods.slice(); - } - return []; - } - - /** - * Gets the real name, not alias, of a given function name. - * - * @private - * @param {String} funcName The name of the function to resolve. - * @returns {String} Returns the real name. - */ - function getRealName(funcName) { - return aliasToRealMap[funcName] || funcName; - } - - /** - * Tests if a given method on the `lodash` object can be called successfully. - * - * @private - * @param {Object} lodash The built Lo-Dash object. - * @param {String} methodName The name of the Lo-Dash method to test. - * @param {String} message The unit test message. - */ - function testMethod(lodash, methodName, message) { - var pass = true, - array = [['a', 1], ['b', 2], ['c', 3]], - object = { 'a': 1, 'b': 2, 'c': 3 }, - noop = function() {}, - string = 'abc', - template = '<%= a %>', - func = lodash[methodName]; - - try { - if (arraysMethods.indexOf(methodName) > -1) { - if (/(?:indexOf|sortedIndex|without)$/i.test(methodName)) { - func(array, string); - } else if (/^(?:difference|intersection|union|uniq|zip)/.test(methodName)) { - func(array, array); - } else if (methodName == 'range') { - func(2, 4); - } else { - func(array); - } - } - else if (chainingMethods.indexOf(methodName) > -1) { - if (methodName == 'chain') { - lodash.chain(array); - lodash(array).chain(); - } - else if (methodName == 'mixin') { - lodash.mixin({}); - } - else { - lodash(array)[methodName](noop); - } - } - else if (collectionsMethods.indexOf(methodName) > -1) { - if (/^(?:count|group|sort)By$/.test(methodName)) { - func(array, noop); - func(array, string); - func(object, noop); - func(object, string); - } - else if (/^(?:size|toArray)$/.test(methodName)) { - func(array); - func(object); - } - else if (methodName == 'at') { - func(array, 0, 2); - func(object, 'a', 'c'); - } - else if (methodName == 'invoke') { - func(array, 'slice'); - func(object, 'toFixed'); - } - else if (methodName == 'where') { - func(array, object); - func(object, object); - } - else { - func(array, noop, object); - func(object, noop, object); - } - } - else if (functionsMethods.indexOf(methodName) > -1) { - if (methodName == 'after') { - func(1, noop); - } else if (methodName == 'bindAll') { - func({ 'noop': noop }); - } else if (methodName == 'bindKey') { - func(lodash, 'identity', array, string); - } else if (/^(?:bind|partial(?:Right)?)$/.test(methodName)) { - func(noop, object, array, string); - } else if (/^(?:compose|memoize|wrap)$/.test(methodName)) { - func(noop, noop); - } else if (/^(?:debounce|throttle)$/.test(methodName)) { - func(noop, 100); - } else { - func(noop); - } - } - else if (objectsMethods.indexOf(methodName) > -1) { - if (methodName == 'clone') { - func(object); - func(object, true); - } - else if (/^(?:defaults|extend|merge)$/.test(methodName)) { - func({}, object); - } else if (/^(?:forIn|forOwn)$/.test(methodName)) { - func(object, noop); - } else if (/^(?:omit|pick)$/.test(methodName)) { - func(object, 'b'); - } else if (methodName == 'has') { - func(object, string); - } else { - func(object); - } - } - else if (utilityMethods.indexOf(methodName) > -1) { - if (methodName == 'result') { - func(object, 'b'); - } else if (methodName == 'template') { - func(template, object); - func(template, null, { 'imports': object })(object); - } else if (methodName == 'times') { - func(2, noop, object); - } else { - func(string, object); - } - } - } - catch(e) { - console.log(e); - pass = false; - } - ok(pass, '_.' + methodName + ': ' + message); - } - - /*--------------------------------------------------------------------------*/ - - QUnit.module('minified AMD snippet'); - - (function() { - var start = _.once(QUnit.start); - - asyncTest('`lodash`', function() { - build(['-s'], function(data) { - // used by r.js build optimizer - var defineHasRegExp = /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g, - basename = path.basename(data.outputPath, '.js'); - - ok(!!defineHasRegExp.exec(data.source), basename); - start(); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('template builds'); - - (function() { - var templatePath = __dirname + '/template'; - - asyncTest('`lodash template=*.jst`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'template=' + templatePath + '/*.jst'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - var object = { - 'a': { 'people': ['moe', 'larry', 'curly'] }, - 'b': { 'epithet': 'stooge' }, - 'c': { 'name': 'ES6' } - }; - - context._ = _; - vm.runInContext(data.source, context); - - equal(_.templates.a(object.a).replace(/[\r\n]+/g, ''), '
        • moe
        • larry
        • curly
        ', basename); - equal(_.templates.b(object.b), 'Hello stooge.', basename); - equal(_.templates.c(object.c), 'Hello ES6!', basename); - delete _.templates; - start(); - }); - }); - - var commands = [ - '', - 'moduleId=underscore' - ]; - - commands.forEach(function(command) { - var expectedId = /underscore/.test(command) ? 'underscore' : 'lodash'; - - asyncTest('`lodash template=*.jst exports=amd' + (command ? ' ' + command : '') + '`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'template=' + templatePath + '/*.jst', 'exports=amd'].concat(command || []), function(data) { - var moduleId, - basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - context.define = function(requires, factory) { - factory(_); - moduleId = requires[0]; - }; - - context.define.amd = {}; - vm.runInContext(data.source, context); - - equal(moduleId, expectedId, basename); - ok('a' in _.templates && 'b' in _.templates, basename); - equal(_.templates.a({ 'people': ['moe', 'larry'] }), '
          \n
        • moe
        • larry
        • \n
        ', basename); - - delete _.templates; - start(); - }); - }); - - asyncTest('`lodash settings=...' + (command ? ' ' + command : '') + '`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'template=' + templatePath + '/*.tpl', 'settings={interpolate:/{{([\\s\\S]+?)}}/}'].concat(command || []), function(data) { - var moduleId, - basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - var object = { - 'd': { 'name': 'Mustache' } - }; - - context.define = function(requires, factory) { - factory(_); - moduleId = requires[0]; - }; - - context.define.amd = {}; - vm.runInContext(data.source, context); - - equal(moduleId, expectedId, basename); - equal(_.templates.d(object.d), 'Hello Mustache!', basename); - delete _.templates; - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('independent builds'); - - (function() { - var reCustom = /Custom Build/, - reLicense = /^\/\**\s+\* @license[\s\S]+?\*\/\n/; - - asyncTest('debug only', function() { - var start = _.once(QUnit.start); - build(['-d', '-s'], function(data) { - equal(path.basename(data.outputPath, '.js'), 'lodash'); - start(); - }); - }); - - asyncTest('debug custom', function() { - var start = _.once(QUnit.start); - build(['-d', '-s', 'backbone'], function(data) { - equal(path.basename(data.outputPath, '.js'), 'lodash.custom'); - - var comment = data.source.match(reLicense); - ok(reCustom.test(comment)); - start(); - }); - }); - - asyncTest('minified only', function() { - var start = _.once(QUnit.start); - build(['-m', '-s'], function(data) { - equal(path.basename(data.outputPath, '.js'), 'lodash.min'); - start(); - }); - }); - - asyncTest('minified custom', function() { - var start = _.once(QUnit.start); - build(['-m', '-s', 'backbone'], function(data) { - equal(path.basename(data.outputPath, '.js'), 'lodash.custom.min'); - - var comment = data.source.match(reLicense); - ok(reCustom.test(comment)); - start(); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('source maps'); - - (function() { - var mapCommands = [ - '-p', - '-p custom.map', - '--source-map', - '--source-map custom.map' - ]; - - var outputCommands = [ - '', - '-o foo.js', - '-m -o bar.js' - ]; - - mapCommands.forEach(function(mapCommand) { - outputCommands.forEach(function(outputCommand) { - asyncTest('`lodash ' + mapCommand + (outputCommand ? ' ' + outputCommand : '') + '`', function() { - var callback = _.once(function(data) { - var basename = path.basename(data.outputPath, '.js'), - comment = (/(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)$/.exec(data.source) || [])[0], - sources = /foo.js/.test(outputCommand) ? ['foo.js'] : ['lodash' + (outputCommand.length ? '' : '.custom') + '.js'], - sourceMap = JSON.parse(data.sourceMap), - sourceMapURL = (/\w+(?=\.map$)/.exec(mapCommand) || [basename])[0]; - - ok(RegExp('/\\*\\n//@ sourceMappingURL=' + sourceMapURL + '.map\\n\\*/').test(comment), basename); - equal(sourceMap.file, basename + '.js', basename); - deepEqual(sourceMap.sources, sources, basename); - - QUnit.start(); - }); - - outputCommand = outputCommand ? outputCommand.split(' ') : []; - if (outputCommand.indexOf('-m') < 0) { - callback = _.after(2, callback); - } - build(['-s'].concat(mapCommand.split(' '), outputCommand), callback); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('strict modifier'); - - (function() { - var object = Object.freeze({ - 'a': _.identity, - 'b': undefined - }); - - var modes = [ - 'non-strict', - 'strict' - ]; - - modes.forEach(function(strictMode, index) { - asyncTest(strictMode + ' should ' + (index ? 'error': 'silently fail') + ' attempting to overwrite read-only properties', function() { - var commands = ['-s', 'include=bindAll,defaults,extend'], - start = _.after(2, _.once(QUnit.start)); - - if (index) { - commands.push('strict'); - } - build(commands, function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - var actual = _.every([ - function() { lodash.bindAll(object); }, - function() { lodash.extend(object, { 'a': 1 }); }, - function() { lodash.defaults(object, { 'b': 2 }); } - ], function(fn) { - var pass = !index; - try { - fn(); - } catch(e) { - pass = !!index; - } - return pass; - }); - - ok(actual, basename); - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('underscore chaining methods'); - - (function() { - var commands = [ - 'backbone', - 'underscore' - ]; - - commands.forEach(function(command) { - asyncTest('`lodash ' + command +'`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', command], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - ok(lodash.chain(1) instanceof lodash, '_.chain: ' + basename); - ok(lodash(1).chain() instanceof lodash, '_#chain: ' + basename); - - var wrapped = lodash(1); - strictEqual(wrapped.identity(), 1, '_(...) wrapped values are not chainable by default: ' + basename); - equal(String(wrapped) === '1', false, '_#toString should not be implemented: ' + basename); - equal(Number(wrapped) === 1 , false, '_#valueOf should not be implemented: ' + basename); - - wrapped.chain(); - ok(wrapped.has('x') instanceof lodash, '_#has returns wrapped values when chaining: ' + basename); - ok(wrapped.join() instanceof lodash, '_#join returns wrapped values when chaining: ' + basename); - - wrapped = lodash([1, 2, 3]); - ok(wrapped.pop() instanceof lodash, '_#pop returns wrapped values: ' + basename); - ok(wrapped.shift() instanceof lodash, '_#shift returns wrapped values: ' + basename); - deepEqual(wrapped.splice(0, 0).value(), [2], '_#splice returns wrapper: ' + basename); - - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('underscore modifier'); - - (function() { - asyncTest('modified methods should work correctly', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore'], function(data) { - var last, - array = [{ 'a': 1, 'b': 2 }, { 'a': 2, 'b': 2 }], - basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - var object = { - 'fn': lodash.bind(function(foo) { - return foo + this.bar; - }, { 'bar': 1 }, 1) - }; - - equal(object.fn(), 2, '_.bind: ' + basename); - - var actual = lodash.clone('a', function() { - return this.a; - }, { 'a': 'A' }); - - equal(actual, 'a', '_.clone should ignore `callback` and `thisArg`: ' + basename); - strictEqual(lodash.clone(array, true)[0], array[0], '_.clone should ignore `deep`: ' + basename); - - strictEqual(lodash.contains({ 'a': 1, 'b': 2 }, 1), true, '_.contains should work with objects: ' + basename); - strictEqual(lodash.contains([1, 2, 3], 1, 2), true, '_.contains should ignore `fromIndex`: ' + basename); - strictEqual(lodash.every([true, false, true]), false, '_.every: ' + basename); - - function Foo() {} - Foo.prototype = { 'a': 1 }; - - actual = lodash.defaults({ 'a': null }, { 'a': 1 }); - strictEqual(actual.a, 1, '_.defaults should overwrite `null` values: ' + basename); - - deepEqual(lodash.defaults({}, new Foo), Foo.prototype, '_.defaults should assign inherited `source` properties: ' + basename); - deepEqual(lodash.extend({}, new Foo), Foo.prototype, '_.extend should assign inherited `source` properties: ' + basename); - - actual = lodash.extend({}, { 'a': 0 }, function(a, b) { - return this[b]; - }, [2]); - - strictEqual(actual.a, 0, '_.extend should ignore `callback` and `thisArg`: ' + basename); - - actual = lodash.find(array, function(value) { - return 'a' in value; - }); - - equal(actual, _.first(array), '_.find: ' + basename); - - actual = lodash.forEach(array, function(value) { - last = value; - return false; - }); - - equal(last, _.last(array), '_.forEach should not exit early: ' + basename); - equal(actual, undefined, '_.forEach should return `undefined`: ' + basename); - - object = { 'length': 0, 'splice': Array.prototype.splice }; - equal(lodash.isEmpty(object), false, '_.isEmpty should return `false` for jQuery/MooTools DOM query collections: ' + basename); - - object = { 'a': 1, 'b': 2, 'c': 3 }; - equal(lodash.isEqual(object, { 'a': 1, 'b': 0, 'c': 3 }), false, '_.isEqual: ' + basename); - - actual = lodash.isEqual('a', 'b', function(a, b) { - return this[a] == this[b]; - }, { 'a': 1, 'b': 1 }); - - strictEqual(actual, false, '_.isEqual should ignore `callback` and `thisArg`: ' + basename); - - equal(lodash.max('abc'), -Infinity, '_.max should return `-Infinity` for strings: ' + basename); - equal(lodash.min('abc'), Infinity, '_.min should return `Infinity` for strings: ' + basename); - - // avoid issues comparing objects with `deepEqual` - object = { 'a': 1, 'b': 2, 'c': 3 }; - actual = lodash.omit(object, function(value) { return value == 3; }); - deepEqual(_.keys(actual).sort(), ['a', 'b', 'c'], '_.omit should not accept a `callback`: ' + basename); - - actual = lodash.pick(object, function(value) { return value != 3; }); - deepEqual(_.keys(actual), [], '_.pick should not accept a `callback`: ' + basename); - - strictEqual(lodash.result(), null, '_.result should return `null` for falsey `object` arguments: ' + basename); - strictEqual(lodash.some([false, true, false]), true, '_.some: ' + basename); - equal(lodash.template('${a}', object), '${a}', '_.template should ignore ES6 delimiters: ' + basename); - equal('imports' in lodash.templateSettings, false, '_.templateSettings should not have an "imports" property: ' + basename); - strictEqual(lodash.uniqueId(0), '1', '_.uniqueId should ignore a prefix of `0`: ' + basename); - - var collection = [{ 'a': { 'b': 1, 'c': 2 } }]; - deepEqual(lodash.where(collection, { 'a': { 'b': 1 } }), [], '_.where performs shallow comparisons: ' + basename); - - collection = [{ 'a': 1 }, { 'a': 1 }]; - deepEqual(lodash.where(collection, { 'a': 1 }, true), collection[0], '_.where supports a `first` argument: ' + basename); - deepEqual(lodash.where(collection, {}, true), null, '_.where should return `null` when passed `first` and falsey `properties`: ' + basename); - - deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename); - strictEqual(lodash.findWhere(collection, {}), null, '_.findWhere should return `null` for falsey `properties`: ' + basename); - - start(); - }); - }); - - asyncTest('should not have any Lo-Dash-only methods', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - _.each([ - 'assign', - 'at', - 'bindKey', - 'forIn', - 'forOwn', - 'isPlainObject', - 'merge', - 'partialRight' - ], function(methodName) { - equal(lodash[methodName], undefined, '_.' + methodName + ' should not exist: ' + basename); - }); - - start(); - }); - }); - - asyncTest('`lodash underscore include=findWhere`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore', 'include=findWhere'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - var collection = [{ 'a': 1 }, { 'a': 1 }]; - deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename); - - start(); - }); - }); - - asyncTest('`lodash underscore include=partial`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore', 'include=partial'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - equal(lodash.partial(_.identity, 2)(), 2, '_.partial: ' + basename); - start(); - }); - }); - - asyncTest('`lodash underscore plus=clone`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore', 'plus=clone'], function(data) { - var array = [{ 'value': 1 }], - basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._, - clone = lodash.clone(array, true); - - ok(_.isEqual(array, clone), basename); - notEqual(array[0], clone[0], basename); - start(); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('exports command'); - - (function() { - var commands = [ - 'exports=amd', - 'exports=commonjs', - 'exports=global', - 'exports=node', - 'exports=none' - ]; - - commands.forEach(function(command, index) { - asyncTest('`lodash ' + command +'`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', command], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(), - pass = false, - source = data.source; - - switch(index) { - case 0: - context.define = function(fn) { - pass = true; - context._ = fn(); - }; - context.define.amd = {}; - vm.runInContext(source, context); - ok(pass, basename); - break; - - case 1: - context.exports = {}; - vm.runInContext(source, context); - ok(_.isFunction(context.exports._), basename); - strictEqual(context._, undefined, basename); - break; - - case 2: - vm.runInContext(source, context); - ok(_.isFunction(context._), basename); - break; - - case 3: - context.exports = {}; - context.module = { 'exports': context.exports }; - vm.runInContext(source, context); - ok(_.isFunction(context.module.exports), basename); - strictEqual(context._, undefined, basename); - break; - - case 4: - vm.runInContext(source, context); - strictEqual(context._, undefined, basename); - } - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('iife command'); - - (function() { - var commands = [ - 'iife=this["lodash"]=(function(window,undefined){%output%;return lodash}(this))', - 'iife=define(function(window,undefined){return function(){%output%;return lodash}}(this));' - ]; - - commands.forEach(function(command) { - asyncTest('`lodash ' + command +'`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'exports=none', command], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - context.define = function(func) { - context.lodash = func(); - }; - - try { - vm.runInContext(data.source, context); - } catch(e) { - console.log(e); - } - - var lodash = context.lodash || {}; - ok(_.isString(lodash.VERSION), basename); - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('output options'); - - (function() { - var commands = [ - '-o a.js', - '--output a.js' - ]; - - commands.forEach(function(command, index) { - asyncTest('`lodash ' + command +'`', function() { - var counter = -1, - start = _.after(2, _.once(QUnit.start)); - - build(['-s'].concat(command.split(' ')), function(data) { - equal(path.basename(data.outputPath, '.js'), (++counter ? 'a.min' : 'a'), command); - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('stdout options'); - - (function() { - var commands = [ - '-c', - '-c -d', - '--stdout', - ]; - - commands.forEach(function(command, index) { - asyncTest('`lodash ' + command +'`', function() { - var written, - start = _.once(QUnit.start), - write = process.stdout.write; - - process.stdout.write = function(string) { - written = string; - }; - - build(['exports=', 'include='].concat(command.split(' ')), function(data) { - process.stdout.write = write; - equal(written, data.source); - equal(arguments.length, 1); - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('mobile build'); - - (function() { - asyncTest('`lodash mobile`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'mobile'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - try { - vm.runInContext(data.source, context); - } catch(e) { - console.log(e); - } - - var array = [1, 2, 3], - object1 = [{ 'a': 1 }], - object2 = [{ 'b': 2 }], - object3 = [{ 'a': 1, 'b': 2 }], - circular1 = { 'a': 1 }, - circular2 = { 'a': 1 }, - lodash = context._; - - circular1.b = circular1; - circular2.b = circular2; - - deepEqual(lodash.merge(object1, object2), object3, basename); - deepEqual(lodash.sortBy([3, 2, 1], _.identity), array, basename); - strictEqual(lodash.isEqual(circular1, circular2), true, basename); - - var actual = lodash.cloneDeep(circular1); - ok(actual != circular1 && actual.b == actual, basename); - start(); - }); - }); - - asyncTest('`lodash csp`', function() { - var sources = []; - - var check = _.after(2, _.once(function() { - equal(sources[0], sources[1]); - QUnit.start(); - })); - - var callback = function(data) { - // remove copyright header and append source - sources.push(data.source.replace(/^\/\**[\s\S]+?\*\/\n/, '')); - check(); - }; - - build(['-s', '-d', 'csp'], callback); - build(['-s', '-d', 'mobile'], callback); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('lodash build'); - - (function() { - var commands = [ - 'backbone', - 'csp', - 'legacy', - 'mobile', - 'modern', - 'strict', - 'underscore', - 'category=arrays', - 'category=chaining', - 'category=collections', - 'category=functions', - 'category=objects', - 'category=utilities', - 'exclude=union,uniq,zip', - 'include=each,filter,map', - 'include=once plus=bind,Chaining', - 'category=collections,functions', - 'backbone legacy category=utilities minus=first,last', - 'legacy include=defer', - 'legacy underscore', - 'underscore include=debounce,throttle plus=after minus=throttle', - 'underscore mobile strict category=functions exports=amd,global plus=pick,uniq', - ] - .concat( - allMethods.map(function(methodName) { - return 'include=' + methodName; - }) - ); - - commands.forEach(function(origCommand) { - _.times(4, function(index) { - var command = origCommand; - - if (index == 1) { - if (/legacy|mobile/.test(command)) { - return; - } - command = 'mobile ' + command; - } - if (index == 2) { - if (/legacy|modern/.test(command)) { - return; - } - command = 'modern ' + command; - } - if (index == 3) { - if (/category|legacy|underscore/.test(command)) { - return; - } - command = 'underscore ' + command; - } - asyncTest('`lodash ' + command +'`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['--silent'].concat(command.split(' ')), function(data) { - var methodNames, - basename = path.basename(data.outputPath, '.js'), - context = createContext(), - isUnderscore = /backbone|underscore/.test(command), - exposeAssign = !isUnderscore; - - try { - vm.runInContext(data.source, context); - } catch(e) { - console.log(e); - } - // add method names explicitly - if (/include/.test(command)) { - methodNames = command.match(/include=(\S*)/)[1].split(/, */); - } - // add method names required by Backbone and Underscore builds - if (/backbone/.test(command) && !methodNames) { - methodNames = backboneDependencies.slice(); - } - if (isUnderscore) { - if (methodNames) { - exposeAssign = methodNames.indexOf('assign') > -1; - } else { - methodNames = underscoreMethods.slice(); - } - } - // add method names explicitly by category - if (/category/.test(command)) { - // resolve method names belonging to each category (case-insensitive) - methodNames = command.match(/category=(\S*)/)[1].split(/, */).reduce(function(result, category) { - var capitalized = category[0].toUpperCase() + category.toLowerCase().slice(1); - return result.concat(getMethodsByCategory(capitalized)); - }, methodNames || []); - } - // init `methodNames` if it hasn't been inited - if (!methodNames) { - methodNames = allMethods.slice(); - } - if (/plus/.test(command)) { - methodNames = methodNames.concat(command.match(/plus=(\S*)/)[1].split(/, */)); - } - if (/minus/.test(command)) { - methodNames = _.without.apply(_, [methodNames] - .concat(expandMethodNames(command.match(/minus=(\S*)/)[1].split(/, */)))); - } - if (/exclude/.test(command)) { - methodNames = _.without.apply(_, [methodNames] - .concat(expandMethodNames(command.match(/exclude=(\S*)/)[1].split(/, */)))); - } - - // expand aliases and categories to real method names - methodNames = expandMethodNames(methodNames).reduce(function(result, methodName) { - return result.concat(methodName, getMethodsByCategory(methodName)); - }, []); - - // remove nonexistent and duplicate method names - methodNames = _.uniq(_.intersection(allMethods, expandMethodNames(methodNames))); - - if (!exposeAssign) { - methodNames = _.without(methodNames, 'assign'); - } - var lodash = context._ || {}; - methodNames.forEach(function(methodName) { - testMethod(lodash, methodName, basename); - }); - - start(); - }); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - if (timeLimit > 0) { - setTimeout(function() { - process.exit(QUnit.config.stats.bad ? 1 : 0); - }, timeLimit); - } - // explicitly call `QUnit.start()` for Narwhal, Node.js, Rhino, and RingoJS - if (!global.document) { - QUnit.start(); - } -}()); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/test.js deleted file mode 100644 index 632af43..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/test/test.js +++ /dev/null @@ -1,2920 +0,0 @@ -;(function(window, undefined) { - 'use strict'; - - /** Use a single "load" function */ - var load = typeof require == 'function' ? require : window.load; - - /** The file path of the Lo-Dash file to test */ - var filePath = (function() { - var min = 0; - var result = window.phantom - ? phantom.args - : (window.system - ? (min = 1, system.args) - : (window.process ? (min = 2, process.argv) : (window.arguments || [])) - ); - - var last = result[result.length - 1]; - result = (result.length > min && last != 'test.js') ? last : '../lodash.js'; - - try { - result = require('fs').realpathSync(result); - } catch(e) { } - - return result; - }()); - - /** The basename of the Lo-Dash file to test */ - var basename = /[\w.-]+$/.exec(filePath)[0]; - - /** The `platform` object to check */ - var platform = - window.platform || - load('../vendor/platform.js/platform.js') || - window.platform; - - /** The unit testing framework */ - var QUnit = - window.QUnit || ( - window.addEventListener || (window.addEventListener = Function.prototype), - window.setTimeout || (window.setTimeout = Function.prototype), - window.QUnit = load('../vendor/qunit/qunit/qunit.js') || window.QUnit, - load('../vendor/qunit-clib/qunit-clib.js'), - window.addEventListener === Function.prototype && delete window.addEventListener, - window.QUnit - ); - - /** The `lodash` function to test */ - var _ = window._ || ( - _ = load(filePath) || window._, - _._ || _ - ); - - /** Used to pass falsey values to methods */ - var falsey = [ - , - '', - 0, - false, - NaN, - null, - undefined - ]; - - /** Shortcut used to make object properties immutable */ - var freeze = Object.freeze; - - /** Used to set property descriptors */ - var setDescriptor = (function(fn) { - try { - var o = {}; - return fn(o, o, o) && fn; - } catch(e) { } - }(Object.defineProperty)); - - /** Shortcut used to convert array-like objects to arrays */ - var slice = [].slice; - - /** Used to check problem JScript properties (a.k.a. the [[DontEnum]] bug) */ - var shadowed = { - 'constructor': 1, - 'hasOwnProperty': 2, - 'isPrototypeOf': 3, - 'propertyIsEnumerable': 4, - 'toLocaleString': 5, - 'toString': 6, - 'valueOf': 7 - }; - - /** Used to check problem JScript properties too */ - var shadowedKeys = [ - 'constructor', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'toLocaleString', - 'toString', - 'valueOf' - ]; - - /*--------------------------------------------------------------------------*/ - - /** - * Skips a given number of tests with a passing result. - * - * @private - * @param {Number} [count=1] The number of tests to skip. - */ - function skipTest(count) { - count || (count = 1); - while (count--) { - ok(true, 'test skipped'); - } - } - - /*--------------------------------------------------------------------------*/ - - // add object from iframe - (function() { - if (!window.document || window.phantom) { - return; - } - var body = document.body, - iframe = document.createElement('iframe'); - - iframe.frameBorder = iframe.height = iframe.width = 0; - body.appendChild(iframe); - var idoc = (idoc = iframe.contentDocument || iframe.contentWindow).document || idoc; - idoc.write(" -``` - -Optionally, expose Java’s nanosecond timer by adding the `nano` applet to the ``: - -```html - -``` - -Or enable Chrome’s microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking): - - --enable-benchmarking - -Via [npm](http://npmjs.org/): - -```bash -npm install benchmark -``` - -In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): - -```js -var Benchmark = require('benchmark'); -``` - -Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons: - -```bash -npm install microtime -``` - -In [RingoJS v0.7.0-](http://ringojs.org/): - -```js -var Benchmark = require('benchmark').Benchmark; -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('benchmark.js'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({ - 'paths': { - 'benchmark': 'path/to/benchmark' - } -}, -['benchmark'], function(Benchmark) { - console.log(Benchmark.version); -}); - -// or with platform.js -// https://github.com/bestiejs/platform.js -require({ - 'paths': { - 'benchmark': 'path/to/benchmark', - 'platform': 'path/to/platform' - } -}, -['benchmark', 'platform'], function(Benchmark, platform) { - Benchmark.platform = platform; - console.log(Benchmark.platform.name); -}); -``` - -Usage example: - -```js -var suite = new Benchmark.Suite; - -// add tests -suite.add('RegExp#test', function() { - /o/.test('Hello World!'); -}) -.add('String#indexOf', function() { - 'Hello World!'.indexOf('o') > -1; -}) -// add listeners -.on('cycle', function(event) { - console.log(String(event.target)); -}) -.on('complete', function() { - console.log('Fastest is ' + this.filter('fastest').pluck('name')); -}) -// run async -.run({ 'async': true }); - -// logs: -// > RegExp#test x 4,161,532 +-0.99% (59 cycles) -// > String#indexOf x 6,139,623 +-1.00% (131 cycles) -// > Fastest is String#indexOf -``` - -## BestieJS - -Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Authors - -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Kit Cambridge](http://kitcambridge.github.com/) - [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/benchmark.js/benchmark.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/benchmark.js/benchmark.js deleted file mode 100644 index 6adf726..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/benchmark.js/benchmark.js +++ /dev/null @@ -1,3960 +0,0 @@ -/*! - * Benchmark.js v1.0.0 - * Copyright 2010-2013 Mathias Bynens - * Based on JSLitmus.js, copyright Robert Kieffer - * Modified by John-David Dalton - * Available under MIT license - */ -;(function(window, undefined) { - 'use strict'; - - /** Used to assign each benchmark an incrimented id */ - var counter = 0; - - /** Detect DOM document object */ - var doc = isHostType(window, 'document') && document; - - /** Detect free variable `define` */ - var freeDefine = typeof define == 'function' && - typeof define.amd == 'object' && define.amd && define; - - /** Detect free variable `exports` */ - var freeExports = typeof exports == 'object' && exports && - (typeof global == 'object' && global && global == global.global && (window = global), exports); - - /** Detect free variable `require` */ - var freeRequire = typeof require == 'function' && require; - - /** Used to store the `Object` built-in in case it's overwritten later */ - var Object = window.Object; - - /** Used to crawl all properties regardless of enumerability */ - var getAllKeys = Object.getOwnPropertyNames; - - /** Used to get property descriptors */ - var getDescriptor = Object.getOwnPropertyDescriptor; - - /** Used in case an object doesn't have its own method */ - var hasOwnProperty = {}.hasOwnProperty; - - /** Used to check if an object is extensible */ - var isExtensible = Object.isExtensible || function() { return true; }; - - /** Used to access Wade Simmons' Node microtime module */ - var microtimeObject = req('microtime'); - - /** Used to access the browser's high resolution timer */ - var perfObject = isHostType(window, 'performance') && performance; - - /** Used to call the browser's high resolution timer */ - var perfName = perfObject && ( - perfObject.now && 'now' || - perfObject.webkitNow && 'webkitNow' - ); - - /** Used to access Node's high resolution timer */ - var processObject = isHostType(window, 'process') && process; - - /** Used to check if an own property is enumerable */ - var propertyIsEnumerable = {}.propertyIsEnumerable; - - /** Used to set property descriptors */ - var setDescriptor = Object.defineProperty; - - /** Used to resolve a value's internal [[Class]] */ - var toString = {}.toString; - - /** Used to prevent a `removeChild` memory leak in IE < 9 */ - var trash = doc && doc.createElement('div'); - - /** Used to integrity check compiled tests */ - var uid = 'uid' + (+new Date); - - /** Used to avoid infinite recursion when methods call each other */ - var calledBy = {}; - - /** Used to avoid hz of Infinity */ - var divisors = { - '1': 4096, - '2': 512, - '3': 64, - '4': 8, - '5': 0 - }; - - /** - * T-Distribution two-tailed critical values for 95% confidence - * http://www.itl.nist.gov/div898/handbook/eda/section3/eda3672.htm - */ - var tTable = { - '1': 12.706,'2': 4.303, '3': 3.182, '4': 2.776, '5': 2.571, '6': 2.447, - '7': 2.365, '8': 2.306, '9': 2.262, '10': 2.228, '11': 2.201, '12': 2.179, - '13': 2.16, '14': 2.145, '15': 2.131, '16': 2.12, '17': 2.11, '18': 2.101, - '19': 2.093, '20': 2.086, '21': 2.08, '22': 2.074, '23': 2.069, '24': 2.064, - '25': 2.06, '26': 2.056, '27': 2.052, '28': 2.048, '29': 2.045, '30': 2.042, - 'infinity': 1.96 - }; - - /** - * Critical Mann-Whitney U-values for 95% confidence - * http://www.saburchill.com/IBbiology/stats/003.html - */ - var uTable = { - '5': [0, 1, 2], - '6': [1, 2, 3, 5], - '7': [1, 3, 5, 6, 8], - '8': [2, 4, 6, 8, 10, 13], - '9': [2, 4, 7, 10, 12, 15, 17], - '10': [3, 5, 8, 11, 14, 17, 20, 23], - '11': [3, 6, 9, 13, 16, 19, 23, 26, 30], - '12': [4, 7, 11, 14, 18, 22, 26, 29, 33, 37], - '13': [4, 8, 12, 16, 20, 24, 28, 33, 37, 41, 45], - '14': [5, 9, 13, 17, 22, 26, 31, 36, 40, 45, 50, 55], - '15': [5, 10, 14, 19, 24, 29, 34, 39, 44, 49, 54, 59, 64], - '16': [6, 11, 15, 21, 26, 31, 37, 42, 47, 53, 59, 64, 70, 75], - '17': [6, 11, 17, 22, 28, 34, 39, 45, 51, 57, 63, 67, 75, 81, 87], - '18': [7, 12, 18, 24, 30, 36, 42, 48, 55, 61, 67, 74, 80, 86, 93, 99], - '19': [7, 13, 19, 25, 32, 38, 45, 52, 58, 65, 72, 78, 85, 92, 99, 106, 113], - '20': [8, 14, 20, 27, 34, 41, 48, 55, 62, 69, 76, 83, 90, 98, 105, 112, 119, 127], - '21': [8, 15, 22, 29, 36, 43, 50, 58, 65, 73, 80, 88, 96, 103, 111, 119, 126, 134, 142], - '22': [9, 16, 23, 30, 38, 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, 133, 141, 150, 158], - '23': [9, 17, 24, 32, 40, 48, 56, 64, 73, 81, 89, 98, 106, 115, 123, 132, 140, 149, 157, 166, 175], - '24': [10, 17, 25, 33, 42, 50, 59, 67, 76, 85, 94, 102, 111, 120, 129, 138, 147, 156, 165, 174, 183, 192], - '25': [10, 18, 27, 35, 44, 53, 62, 71, 80, 89, 98, 107, 117, 126, 135, 145, 154, 163, 173, 182, 192, 201, 211], - '26': [11, 19, 28, 37, 46, 55, 64, 74, 83, 93, 102, 112, 122, 132, 141, 151, 161, 171, 181, 191, 200, 210, 220, 230], - '27': [11, 20, 29, 38, 48, 57, 67, 77, 87, 97, 107, 118, 125, 138, 147, 158, 168, 178, 188, 199, 209, 219, 230, 240, 250], - '28': [12, 21, 30, 40, 50, 60, 70, 80, 90, 101, 111, 122, 132, 143, 154, 164, 175, 186, 196, 207, 218, 228, 239, 250, 261, 272], - '29': [13, 22, 32, 42, 52, 62, 73, 83, 94, 105, 116, 127, 138, 149, 160, 171, 182, 193, 204, 215, 226, 238, 249, 260, 271, 282, 294], - '30': [13, 23, 33, 43, 54, 65, 76, 87, 98, 109, 120, 131, 143, 154, 166, 177, 189, 200, 212, 223, 235, 247, 258, 270, 282, 293, 305, 317] - }; - - /** - * An object used to flag environments/features. - * - * @static - * @memberOf Benchmark - * @type Object - */ - var support = {}; - - (function() { - - /** - * Detect Adobe AIR. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.air = isClassOf(window.runtime, 'ScriptBridgingProxyObject'); - - /** - * Detect if `arguments` objects have the correct internal [[Class]] value. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.argumentsClass = isClassOf(arguments, 'Arguments'); - - /** - * Detect if in a browser environment. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.browser = doc && isHostType(window, 'navigator'); - - /** - * Detect if strings support accessing characters by index. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.charByIndex = - // IE 8 supports indexes on string literals but not string objects - ('x'[0] + Object('x')[0]) == 'xx'; - - /** - * Detect if strings have indexes as own properties. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.charByOwnIndex = - // Narwhal, Rhino, RingoJS, IE 8, and Opera < 10.52 support indexes on - // strings but don't detect them as own properties - support.charByIndex && hasKey('x', '0'); - - /** - * Detect if Java is enabled/exposed. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.java = isClassOf(window.java, 'JavaPackage'); - - /** - * Detect if the Timers API exists. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.timeout = isHostType(window, 'setTimeout') && isHostType(window, 'clearTimeout'); - - /** - * Detect if functions support decompilation. - * - * @name decompilation - * @memberOf Benchmark.support - * @type Boolean - */ - try { - // Safari 2.x removes commas in object literals - // from Function#toString results - // http://webk.it/11609 - // Firefox 3.6 and Opera 9.25 strip grouping - // parentheses from Function#toString results - // http://bugzil.la/559438 - support.decompilation = Function( - 'return (' + (function(x) { return { 'x': '' + (1 + x) + '', 'y': 0 }; }) + ')' - )()(0).x === '1'; - } catch(e) { - support.decompilation = false; - } - - /** - * Detect ES5+ property descriptor API. - * - * @name descriptors - * @memberOf Benchmark.support - * @type Boolean - */ - try { - var o = {}; - support.descriptors = (setDescriptor(o, o, o), 'value' in getDescriptor(o, o)); - } catch(e) { - support.descriptors = false; - } - - /** - * Detect ES5+ Object.getOwnPropertyNames(). - * - * @name getAllKeys - * @memberOf Benchmark.support - * @type Boolean - */ - try { - support.getAllKeys = /\bvalueOf\b/.test(getAllKeys(Object.prototype)); - } catch(e) { - support.getAllKeys = false; - } - - /** - * Detect if own properties are iterated before inherited properties (all but IE < 9). - * - * @name iteratesOwnLast - * @memberOf Benchmark.support - * @type Boolean - */ - support.iteratesOwnFirst = (function() { - var props = []; - function ctor() { this.x = 1; } - ctor.prototype = { 'y': 1 }; - for (var prop in new ctor) { props.push(prop); } - return props[0] == 'x'; - }()); - - /** - * Detect if a 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` property value of `typeof` "function". - * - * @name nodeClass - * @memberOf Benchmark.support - * @type Boolean - */ - try { - support.nodeClass = ({ 'toString': 0 } + '', toString.call(doc || 0) != '[object Object]'); - } catch(e) { - support.nodeClass = true; - } - }()); - - /** - * Timer object used by `clock()` and `Deferred#resolve`. - * - * @private - * @type Object - */ - var timer = { - - /** - * The timer namespace object or constructor. - * - * @private - * @memberOf timer - * @type Function|Object - */ - 'ns': Date, - - /** - * Starts the deferred timer. - * - * @private - * @memberOf timer - * @param {Object} deferred The deferred instance. - */ - 'start': null, // lazy defined in `clock()` - - /** - * Stops the deferred timer. - * - * @private - * @memberOf timer - * @param {Object} deferred The deferred instance. - */ - 'stop': null // lazy defined in `clock()` - }; - - /** Shortcut for inverse results */ - var noArgumentsClass = !support.argumentsClass, - noCharByIndex = !support.charByIndex, - noCharByOwnIndex = !support.charByOwnIndex; - - /** Math shortcuts */ - var abs = Math.abs, - floor = Math.floor, - log = Math.log, - max = Math.max, - min = Math.min, - pow = Math.pow, - sqrt = Math.sqrt; - - /*--------------------------------------------------------------------------*/ - - /** - * The Benchmark constructor. - * - * @constructor - * @param {String} name A name to identify the benchmark. - * @param {Function|String} fn The test to benchmark. - * @param {Object} [options={}] Options object. - * @example - * - * // basic usage (the `new` operator is optional) - * var bench = new Benchmark(fn); - * - * // or using a name first - * var bench = new Benchmark('foo', fn); - * - * // or with options - * var bench = new Benchmark('foo', fn, { - * - * // displayed by Benchmark#toString if `name` is not available - * 'id': 'xyz', - * - * // called when the benchmark starts running - * 'onStart': onStart, - * - * // called after each run cycle - * 'onCycle': onCycle, - * - * // called when aborted - * 'onAbort': onAbort, - * - * // called when a test errors - * 'onError': onError, - * - * // called when reset - * 'onReset': onReset, - * - * // called when the benchmark completes running - * 'onComplete': onComplete, - * - * // compiled/called before the test loop - * 'setup': setup, - * - * // compiled/called after the test loop - * 'teardown': teardown - * }); - * - * // or name and options - * var bench = new Benchmark('foo', { - * - * // a flag to indicate the benchmark is deferred - * 'defer': true, - * - * // benchmark test function - * 'fn': function(deferred) { - * // call resolve() when the deferred test is finished - * deferred.resolve(); - * } - * }); - * - * // or options only - * var bench = new Benchmark({ - * - * // benchmark name - * 'name': 'foo', - * - * // benchmark test as a string - * 'fn': '[1,2,3,4].sort()' - * }); - * - * // a test's `this` binding is set to the benchmark instance - * var bench = new Benchmark('foo', function() { - * 'My name is '.concat(this.name); // My name is foo - * }); - */ - function Benchmark(name, fn, options) { - var me = this; - - // allow instance creation without the `new` operator - if (me == null || me.constructor != Benchmark) { - return new Benchmark(name, fn, options); - } - // juggle arguments - if (isClassOf(name, 'Object')) { - // 1 argument (options) - options = name; - } - else if (isClassOf(name, 'Function')) { - // 2 arguments (fn, options) - options = fn; - fn = name; - } - else if (isClassOf(fn, 'Object')) { - // 2 arguments (name, options) - options = fn; - fn = null; - me.name = name; - } - else { - // 3 arguments (name, fn [, options]) - me.name = name; - } - setOptions(me, options); - me.id || (me.id = ++counter); - me.fn == null && (me.fn = fn); - me.stats = deepClone(me.stats); - me.times = deepClone(me.times); - } - - /** - * The Deferred constructor. - * - * @constructor - * @memberOf Benchmark - * @param {Object} clone The cloned benchmark instance. - */ - function Deferred(clone) { - var me = this; - if (me == null || me.constructor != Deferred) { - return new Deferred(clone); - } - me.benchmark = clone; - clock(me); - } - - /** - * The Event constructor. - * - * @constructor - * @memberOf Benchmark - * @param {String|Object} type The event type. - */ - function Event(type) { - var me = this; - return (me == null || me.constructor != Event) - ? new Event(type) - : (type instanceof Event) - ? type - : extend(me, { 'timeStamp': +new Date }, typeof type == 'string' ? { 'type': type } : type); - } - - /** - * The Suite constructor. - * - * @constructor - * @memberOf Benchmark - * @param {String} name A name to identify the suite. - * @param {Object} [options={}] Options object. - * @example - * - * // basic usage (the `new` operator is optional) - * var suite = new Benchmark.Suite; - * - * // or using a name first - * var suite = new Benchmark.Suite('foo'); - * - * // or with options - * var suite = new Benchmark.Suite('foo', { - * - * // called when the suite starts running - * 'onStart': onStart, - * - * // called between running benchmarks - * 'onCycle': onCycle, - * - * // called when aborted - * 'onAbort': onAbort, - * - * // called when a test errors - * 'onError': onError, - * - * // called when reset - * 'onReset': onReset, - * - * // called when the suite completes running - * 'onComplete': onComplete - * }); - */ - function Suite(name, options) { - var me = this; - - // allow instance creation without the `new` operator - if (me == null || me.constructor != Suite) { - return new Suite(name, options); - } - // juggle arguments - if (isClassOf(name, 'Object')) { - // 1 argument (options) - options = name; - } else { - // 2 arguments (name [, options]) - me.name = name; - } - setOptions(me, options); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Note: Some array methods have been implemented in plain JavaScript to avoid - * bugs in IE, Opera, Rhino, and Mobile Safari. - * - * IE compatibility mode and IE < 9 have buggy Array `shift()` and `splice()` - * functions that fail to remove the last element, `object[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. - * - * In Opera < 9.50 and some older/beta Mobile Safari versions using `unshift()` - * generically to augment the `arguments` object will pave the value at index 0 - * without incrimenting the other values's indexes. - * https://github.com/documentcloud/underscore/issues/9 - * - * Rhino and environments it powers, like Narwhal and RingoJS, may have - * buggy Array `concat()`, `reverse()`, `shift()`, `slice()`, `splice()` and - * `unshift()` functions that make sparse arrays non-sparse by assigning the - * undefined indexes a value of undefined. - * https://github.com/mozilla/rhino/commit/702abfed3f8ca043b2636efd31c14ba7552603dd - */ - - /** - * Creates an array containing the elements of the host array followed by the - * elements of each argument in order. - * - * @memberOf Benchmark.Suite - * @returns {Array} The new array. - */ - function concat() { - var value, - j = -1, - length = arguments.length, - result = slice.call(this), - index = result.length; - - while (++j < length) { - value = arguments[j]; - if (isClassOf(value, 'Array')) { - for (var k = 0, l = value.length; k < l; k++, index++) { - if (k in value) { - result[index] = value[k]; - } - } - } else { - result[index++] = value; - } - } - return result; - } - - /** - * Utility function used by `shift()`, `splice()`, and `unshift()`. - * - * @private - * @param {Number} start The index to start inserting elements. - * @param {Number} deleteCount The number of elements to delete from the insert point. - * @param {Array} elements The elements to insert. - * @returns {Array} An array of deleted elements. - */ - function insert(start, deleteCount, elements) { - // `result` should have its length set to the `deleteCount` - // see https://bugs.ecmascript.org/show_bug.cgi?id=332 - var deleteEnd = start + deleteCount, - elementCount = elements ? elements.length : 0, - index = start - 1, - length = start + elementCount, - object = this, - result = Array(deleteCount), - tail = slice.call(object, deleteEnd); - - // delete elements from the array - while (++index < deleteEnd) { - if (index in object) { - result[index - start] = object[index]; - delete object[index]; - } - } - // insert elements - index = start - 1; - while (++index < length) { - object[index] = elements[index - start]; - } - // append tail elements - start = index--; - length = max(0, (object.length >>> 0) - deleteCount + elementCount); - while (++index < length) { - if ((index - start) in tail) { - object[index] = tail[index - start]; - } else if (index in object) { - delete object[index]; - } - } - // delete excess elements - deleteCount = deleteCount > elementCount ? deleteCount - elementCount : 0; - while (deleteCount--) { - index = length + deleteCount; - if (index in object) { - delete object[index]; - } - } - object.length = length; - return result; - } - - /** - * Rearrange the host array's elements in reverse order. - * - * @memberOf Benchmark.Suite - * @returns {Array} The reversed array. - */ - function reverse() { - var upperIndex, - value, - index = -1, - object = Object(this), - length = object.length >>> 0, - middle = floor(length / 2); - - if (length > 1) { - while (++index < middle) { - upperIndex = length - index - 1; - value = upperIndex in object ? object[upperIndex] : uid; - if (index in object) { - object[upperIndex] = object[index]; - } else { - delete object[upperIndex]; - } - if (value != uid) { - object[index] = value; - } else { - delete object[index]; - } - } - } - return object; - } - - /** - * Removes the first element of the host array and returns it. - * - * @memberOf Benchmark.Suite - * @returns {Mixed} The first element of the array. - */ - function shift() { - return insert.call(this, 0, 1)[0]; - } - - /** - * Creates an array of the host array's elements from the start index up to, - * but not including, the end index. - * - * @memberOf Benchmark.Suite - * @param {Number} start The starting index. - * @param {Number} end The end index. - * @returns {Array} The new array. - */ - function slice(start, end) { - var index = -1, - object = Object(this), - length = object.length >>> 0, - result = []; - - start = toInteger(start); - start = start < 0 ? max(length + start, 0) : min(start, length); - start--; - end = end == null ? length : toInteger(end); - end = end < 0 ? max(length + end, 0) : min(end, length); - - while ((++index, ++start) < end) { - if (start in object) { - result[index] = object[start]; - } - } - return result; - } - - /** - * Allows removing a range of elements and/or inserting elements into the - * host array. - * - * @memberOf Benchmark.Suite - * @param {Number} start The start index. - * @param {Number} deleteCount The number of elements to delete. - * @param {Mixed} [val1, val2, ...] values to insert at the `start` index. - * @returns {Array} An array of removed elements. - */ - function splice(start, deleteCount) { - var object = Object(this), - length = object.length >>> 0; - - start = toInteger(start); - start = start < 0 ? max(length + start, 0) : min(start, length); - - // support the de-facto SpiderMonkey extension - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice#Parameters - // https://bugs.ecmascript.org/show_bug.cgi?id=429 - deleteCount = arguments.length == 1 - ? length - start - : min(max(toInteger(deleteCount), 0), length - start); - - return insert.call(object, start, deleteCount, slice.call(arguments, 2)); - } - - /** - * Converts the specified `value` to an integer. - * - * @private - * @param {Mixed} value The value to convert. - * @returns {Number} The resulting integer. - */ - function toInteger(value) { - value = +value; - return value === 0 || !isFinite(value) ? value || 0 : value - (value % 1); - } - - /** - * Appends arguments to the host array. - * - * @memberOf Benchmark.Suite - * @returns {Number} The new length. - */ - function unshift() { - var object = Object(this); - insert.call(object, 0, 0, arguments); - return object.length; - } - - /*--------------------------------------------------------------------------*/ - - /** - * A generic `Function#bind` like method. - * - * @private - * @param {Function} fn The function to be bound to `thisArg`. - * @param {Mixed} thisArg The `this` binding for the given function. - * @returns {Function} The bound function. - */ - function bind(fn, thisArg) { - return function() { fn.apply(thisArg, arguments); }; - } - - /** - * Creates a function from the given arguments string and body. - * - * @private - * @param {String} args The comma separated function arguments. - * @param {String} body The function body. - * @returns {Function} The new function. - */ - function createFunction() { - // lazy define - createFunction = function(args, body) { - var result, - anchor = freeDefine ? define.amd : Benchmark, - prop = uid + 'createFunction'; - - runScript((freeDefine ? 'define.amd.' : 'Benchmark.') + prop + '=function(' + args + '){' + body + '}'); - result = anchor[prop]; - delete anchor[prop]; - return result; - }; - // fix JaegerMonkey bug - // http://bugzil.la/639720 - createFunction = support.browser && (createFunction('', 'return"' + uid + '"') || noop)() == uid ? createFunction : Function; - return createFunction.apply(null, arguments); - } - - /** - * Delay the execution of a function based on the benchmark's `delay` property. - * - * @private - * @param {Object} bench The benchmark instance. - * @param {Object} fn The function to execute. - */ - function delay(bench, fn) { - bench._timerId = setTimeout(fn, bench.delay * 1e3); - } - - /** - * Destroys the given element. - * - * @private - * @param {Element} element The element to destroy. - */ - function destroyElement(element) { - trash.appendChild(element); - trash.innerHTML = ''; - } - - /** - * Iterates over an object's properties, executing the `callback` for each. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} callback The function executed per own property. - * @param {Object} options The options object. - * @returns {Object} Returns the object iterated over. - */ - function forProps() { - var forShadowed, - skipSeen, - forArgs = true, - shadowed = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']; - - (function(enumFlag, key) { - // must use a non-native constructor to catch the Safari 2 issue - function Klass() { this.valueOf = 0; }; - Klass.prototype.valueOf = 0; - // check various for-in bugs - for (key in new Klass) { - enumFlag += key == 'valueOf' ? 1 : 0; - } - // check if `arguments` objects have non-enumerable indexes - for (key in arguments) { - key == '0' && (forArgs = false); - } - // Safari 2 iterates over shadowed properties twice - // http://replay.waybackmachine.org/20090428222941/http://tobielangel.com/2007/1/29/for-in-loop-broken-in-safari/ - skipSeen = enumFlag == 2; - // IE < 9 incorrectly makes an object's properties non-enumerable if they have - // the same name as other non-enumerable properties in its prototype chain. - forShadowed = !enumFlag; - }(0)); - - // lazy define - forProps = function(object, callback, options) { - options || (options = {}); - - var result = object; - object = Object(object); - - var ctor, - key, - keys, - skipCtor, - done = !result, - which = options.which, - allFlag = which == 'all', - index = -1, - iteratee = object, - length = object.length, - ownFlag = allFlag || which == 'own', - seen = {}, - skipProto = isClassOf(object, 'Function'), - thisArg = options.bind; - - if (thisArg !== undefined) { - callback = bind(callback, thisArg); - } - // iterate all properties - if (allFlag && support.getAllKeys) { - for (index = 0, keys = getAllKeys(object), length = keys.length; index < length; index++) { - key = keys[index]; - if (callback(object[key], key, object) === false) { - break; - } - } - } - // else iterate only enumerable properties - else { - for (key in object) { - // 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 set a function's `prototype` property [[Enumerable]] value - // to `true`. Because of this we standardize on skipping the `prototype` - // property of functions regardless of their [[Enumerable]] value. - if ((done = - !(skipProto && key == 'prototype') && - !(skipSeen && (hasKey(seen, key) || !(seen[key] = true))) && - (!ownFlag || ownFlag && hasKey(object, key)) && - callback(object[key], key, object) === false)) { - break; - } - } - // in IE < 9 strings don't support accessing characters by index - if (!done && (forArgs && isArguments(object) || - ((noCharByIndex || noCharByOwnIndex) && isClassOf(object, 'String') && - (iteratee = noCharByIndex ? object.split('') : object)))) { - while (++index < length) { - if ((done = - callback(iteratee[index], String(index), object) === false)) { - break; - } - } - } - if (!done && forShadowed) { - // Because IE < 9 can't set the `[[Enumerable]]` attribute of an existing - // property and the `constructor` property of a prototype defaults to - // non-enumerable, we manually skip the `constructor` property when we - // think we are iterating over a `prototype` object. - ctor = object.constructor; - skipCtor = ctor && ctor.prototype && ctor.prototype.constructor === ctor; - for (index = 0; index < 7; index++) { - key = shadowed[index]; - if (!(skipCtor && key == 'constructor') && - hasKey(object, key) && - callback(object[key], key, object) === false) { - break; - } - } - } - } - return result; - }; - return forProps.apply(null, arguments); - } - - /** - * Gets the name of the first argument from a function's source. - * - * @private - * @param {Function} fn The function. - * @returns {String} The argument name. - */ - function getFirstArgument(fn) { - return (!hasKey(fn, 'toString') && - (/^[\s(]*function[^(]*\(([^\s,)]+)/.exec(fn) || 0)[1]) || ''; - } - - /** - * Computes the geometric mean (log-average) of a sample. - * See http://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_arithmetic_mean_of_logarithms. - * - * @private - * @param {Array} sample The sample. - * @returns {Number} The geometric mean. - */ - function getGeometricMean(sample) { - return pow(Math.E, reduce(sample, function(sum, x) { - return sum + log(x); - }) / sample.length) || 0; - } - - /** - * Computes the arithmetic mean of a sample. - * - * @private - * @param {Array} sample The sample. - * @returns {Number} The mean. - */ - function getMean(sample) { - return (reduce(sample, function(sum, x) { - return sum + x; - }) / sample.length) || 0; - } - - /** - * Gets the source code of a function. - * - * @private - * @param {Function} fn The function. - * @param {String} altSource A string used when a function's source code is unretrievable. - * @returns {String} The function's source code. - */ - function getSource(fn, altSource) { - var result = altSource; - if (isStringable(fn)) { - result = String(fn); - } else if (support.decompilation) { - // escape the `{` for Firefox 1 - result = (/^[^{]+\{([\s\S]*)\}\s*$/.exec(fn) || 0)[1]; - } - // trim string - result = (result || '').replace(/^\s+|\s+$/g, ''); - - // detect strings containing only the "use strict" directive - return /^(?:\/\*+[\w|\W]*?\*\/|\/\/.*?[\n\r\u2028\u2029]|\s)*(["'])use strict\1;?$/.test(result) - ? '' - : result; - } - - /** - * Checks if a value is an `arguments` object. - * - * @private - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the value is an `arguments` object, else `false`. - */ - function isArguments() { - // lazy define - isArguments = function(value) { - return toString.call(value) == '[object Arguments]'; - }; - if (noArgumentsClass) { - isArguments = function(value) { - return hasKey(value, 'callee') && - !(propertyIsEnumerable && propertyIsEnumerable.call(value, 'callee')); - }; - } - return isArguments(arguments[0]); - } - - /** - * Checks if an object is of the specified class. - * - * @private - * @param {Mixed} value The value to check. - * @param {String} name The name of the class. - * @returns {Boolean} Returns `true` if the value is of the specified class, else `false`. - */ - function isClassOf(value, name) { - return value != null && toString.call(value) == '[object ' + name + ']'; - } - - /** - * Host objects can return type values that are different from their actual - * data type. The objects we are concerned with usually return non-primitive - * types of object, function, or unknown. - * - * @private - * @param {Mixed} object The owner of the property. - * @param {String} property The property to check. - * @returns {Boolean} Returns `true` if the property value is a non-primitive, else `false`. - */ - function isHostType(object, property) { - var type = object != null ? typeof object[property] : 'number'; - return !/^(?:boolean|number|string|undefined)$/.test(type) && - (type == 'object' ? !!object[property] : true); - } - - /** - * 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 the `value` is a plain `Object` object, else `false`. - */ - function isPlainObject(value) { - // avoid non-objects and false positives for `arguments` objects in IE < 9 - var result = false; - if (!(value && typeof value == 'object') || isArguments(value)) { - return result; - } - // IE < 9 presents DOM nodes as `Object` objects except they have `toString` - // methods that are `typeof` "string" and still can coerce nodes to strings. - // Also check that the constructor is `Object` (i.e. `Object instanceof Object`) - var ctor = value.constructor; - if ((support.nodeClass || !(typeof value.toString != 'function' && typeof (value + '') == 'string')) && - (!isClassOf(ctor, 'Function') || ctor instanceof ctor)) { - // 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. - if (support.iteratesOwnFirst) { - forProps(value, function(subValue, subKey) { - result = subKey; - }); - return result === false || hasKey(value, result); - } - // 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. - forProps(value, function(subValue, subKey) { - result = !hasKey(value, subKey); - return false; - }); - return result === false; - } - return result; - } - - /** - * Checks if a value can be safely coerced to a string. - * - * @private - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the value can be coerced, else `false`. - */ - function isStringable(value) { - return hasKey(value, 'toString') || isClassOf(value, 'String'); - } - - /** - * Wraps a function and passes `this` to the original function as the - * first argument. - * - * @private - * @param {Function} fn The function to be wrapped. - * @returns {Function} The new function. - */ - function methodize(fn) { - return function() { - var args = [this]; - args.push.apply(args, arguments); - return fn.apply(null, args); - }; - } - - /** - * A no-operation function. - * - * @private - */ - function noop() { - // no operation performed - } - - /** - * A wrapper around require() to suppress `module missing` errors. - * - * @private - * @param {String} id The module id. - * @returns {Mixed} The exported module or `null`. - */ - function req(id) { - try { - var result = freeExports && freeRequire(id); - } catch(e) { } - return result || null; - } - - /** - * Runs a snippet of JavaScript via script injection. - * - * @private - * @param {String} code The code to run. - */ - function runScript(code) { - var anchor = freeDefine ? define.amd : Benchmark, - script = doc.createElement('script'), - sibling = doc.getElementsByTagName('script')[0], - parent = sibling.parentNode, - prop = uid + 'runScript', - prefix = '(' + (freeDefine ? 'define.amd.' : 'Benchmark.') + prop + '||function(){})();'; - - // Firefox 2.0.0.2 cannot use script injection as intended because it executes - // asynchronously, but that's OK because script injection is only used to avoid - // the previously commented JaegerMonkey bug. - try { - // remove the inserted script *before* running the code to avoid differences - // in the expected script element count/order of the document. - script.appendChild(doc.createTextNode(prefix + code)); - anchor[prop] = function() { destroyElement(script); }; - } catch(e) { - parent = parent.cloneNode(false); - sibling = null; - script.text = code; - } - parent.insertBefore(script, sibling); - delete anchor[prop]; - } - - /** - * A helper function for setting options/event handlers. - * - * @private - * @param {Object} bench The benchmark instance. - * @param {Object} [options={}] Options object. - */ - function setOptions(bench, options) { - options = extend({}, bench.constructor.options, options); - bench.options = forOwn(options, function(value, key) { - if (value != null) { - // add event listeners - if (/^on[A-Z]/.test(key)) { - forEach(key.split(' '), function(key) { - bench.on(key.slice(2).toLowerCase(), value); - }); - } else if (!hasKey(bench, key)) { - bench[key] = deepClone(value); - } - } - }); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Handles cycling/completing the deferred benchmark. - * - * @memberOf Benchmark.Deferred - */ - function resolve() { - var me = this, - clone = me.benchmark, - bench = clone._original; - - if (bench.aborted) { - // cycle() -> clone cycle/complete event -> compute()'s invoked bench.run() cycle/complete - me.teardown(); - clone.running = false; - cycle(me); - } - else if (++me.cycles < clone.count) { - // continue the test loop - if (support.timeout) { - // use setTimeout to avoid a call stack overflow if called recursively - setTimeout(function() { clone.compiled.call(me, timer); }, 0); - } else { - clone.compiled.call(me, timer); - } - } - else { - timer.stop(me); - me.teardown(); - delay(clone, function() { cycle(me); }); - } - } - - /*--------------------------------------------------------------------------*/ - - /** - * A deep clone utility. - * - * @static - * @memberOf Benchmark - * @param {Mixed} value The value to clone. - * @returns {Mixed} The cloned value. - */ - function deepClone(value) { - var accessor, - circular, - clone, - ctor, - descriptor, - extensible, - key, - length, - markerKey, - parent, - result, - source, - subIndex, - data = { 'value': value }, - index = 0, - marked = [], - queue = { 'length': 0 }, - unmarked = []; - - /** - * An easily detectable decorator for cloned values. - */ - function Marker(object) { - this.raw = object; - } - - /** - * The callback used by `forProps()`. - */ - function forPropsCallback(subValue, subKey) { - // exit early to avoid cloning the marker - if (subValue && subValue.constructor == Marker) { - return; - } - // add objects to the queue - if (subValue === Object(subValue)) { - queue[queue.length++] = { 'key': subKey, 'parent': clone, 'source': value }; - } - // assign non-objects - else { - try { - // will throw an error in strict mode if the property is read-only - clone[subKey] = subValue; - } catch(e) { } - } - } - - /** - * Gets an available marker key for the given object. - */ - function getMarkerKey(object) { - // avoid collisions with existing keys - var result = uid; - while (object[result] && object[result].constructor != Marker) { - result += 1; - } - return result; - } - - do { - key = data.key; - parent = data.parent; - source = data.source; - clone = value = source ? source[key] : data.value; - accessor = circular = descriptor = false; - - // create a basic clone to filter out functions, DOM elements, and - // other non `Object` objects - if (value === Object(value)) { - // use custom deep clone function if available - if (isClassOf(value.deepClone, 'Function')) { - clone = value.deepClone(); - } else { - ctor = value.constructor; - switch (toString.call(value)) { - case '[object Array]': - clone = new ctor(value.length); - break; - - case '[object Boolean]': - clone = new ctor(value == true); - break; - - case '[object Date]': - clone = new ctor(+value); - break; - - case '[object Object]': - isPlainObject(value) && (clone = {}); - break; - - case '[object Number]': - case '[object String]': - clone = new ctor(value); - break; - - case '[object RegExp]': - clone = ctor(value.source, - (value.global ? 'g' : '') + - (value.ignoreCase ? 'i' : '') + - (value.multiline ? 'm' : '')); - } - } - // continue clone if `value` doesn't have an accessor descriptor - // http://es5.github.com/#x8.10.1 - if (clone && clone != value && - !(descriptor = source && support.descriptors && getDescriptor(source, key), - accessor = descriptor && (descriptor.get || descriptor.set))) { - // use an existing clone (circular reference) - if ((extensible = isExtensible(value))) { - markerKey = getMarkerKey(value); - if (value[markerKey]) { - circular = clone = value[markerKey].raw; - } - } else { - // for frozen/sealed objects - for (subIndex = 0, length = unmarked.length; subIndex < length; subIndex++) { - data = unmarked[subIndex]; - if (data.object === value) { - circular = clone = data.clone; - break; - } - } - } - if (!circular) { - // mark object to allow quickly detecting circular references and tie it to its clone - if (extensible) { - value[markerKey] = new Marker(clone); - marked.push({ 'key': markerKey, 'object': value }); - } else { - // for frozen/sealed objects - unmarked.push({ 'clone': clone, 'object': value }); - } - // iterate over object properties - forProps(value, forPropsCallback, { 'which': 'all' }); - } - } - } - if (parent) { - // for custom property descriptors - if (accessor || (descriptor && !(descriptor.configurable && descriptor.enumerable && descriptor.writable))) { - if ('value' in descriptor) { - descriptor.value = clone; - } - setDescriptor(parent, key, descriptor); - } - // for default property descriptors - else { - parent[key] = clone; - } - } else { - result = clone; - } - } while ((data = queue[index++])); - - // remove markers - for (index = 0, length = marked.length; index < length; index++) { - data = marked[index]; - delete data.object[data.key]; - } - return result; - } - - /** - * An iteration utility for arrays and objects. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @static - * @memberOf Benchmark - * @param {Array|Object} object The object to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Array|Object} Returns the object iterated over. - */ - function each(object, callback, thisArg) { - var result = object; - object = Object(object); - - var fn = callback, - index = -1, - length = object.length, - isSnapshot = !!(object.snapshotItem && (length = object.snapshotLength)), - isSplittable = (noCharByIndex || noCharByOwnIndex) && isClassOf(object, 'String'), - isConvertable = isSnapshot || isSplittable || 'item' in object, - origObject = object; - - // in Opera < 10.5 `hasKey(object, 'length')` returns `false` for NodeLists - if (length === length >>> 0) { - if (isConvertable) { - // the third argument of the callback is the original non-array object - callback = function(value, index) { - return fn.call(this, value, index, origObject); - }; - // in IE < 9 strings don't support accessing characters by index - if (isSplittable) { - object = object.split(''); - } else { - object = []; - while (++index < length) { - // in Safari 2 `index in object` is always `false` for NodeLists - object[index] = isSnapshot ? result.snapshotItem(index) : result[index]; - } - } - } - forEach(object, callback, thisArg); - } else { - forOwn(object, callback, thisArg); - } - return result; - } - - /** - * Copies enumerable properties from the source(s) object to the destination object. - * - * @static - * @memberOf Benchmark - * @param {Object} destination The destination object. - * @param {Object} [source={}] The source object. - * @returns {Object} The destination object. - */ - function extend(destination, source) { - // Chrome < 14 incorrectly sets `destination` to `undefined` when we `delete arguments[0]` - // http://code.google.com/p/v8/issues/detail?id=839 - var result = destination; - delete arguments[0]; - - forEach(arguments, function(source) { - forProps(source, function(value, key) { - result[key] = value; - }); - }); - return result; - } - - /** - * A generic `Array#filter` like method. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Function|String} callback The function/alias called per iteration. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Array} A new array of values that passed callback filter. - * @example - * - * // get odd numbers - * Benchmark.filter([1, 2, 3, 4, 5], function(n) { - * return n % 2; - * }); // -> [1, 3, 5]; - * - * // get fastest benchmarks - * Benchmark.filter(benches, 'fastest'); - * - * // get slowest benchmarks - * Benchmark.filter(benches, 'slowest'); - * - * // get benchmarks that completed without erroring - * Benchmark.filter(benches, 'successful'); - */ - function filter(array, callback, thisArg) { - var result; - - if (callback == 'successful') { - // callback to exclude those that are errored, unrun, or have hz of Infinity - callback = function(bench) { return bench.cycles && isFinite(bench.hz); }; - } - else if (callback == 'fastest' || callback == 'slowest') { - // get successful, sort by period + margin of error, and filter fastest/slowest - result = filter(array, 'successful').sort(function(a, b) { - a = a.stats; b = b.stats; - return (a.mean + a.moe > b.mean + b.moe ? 1 : -1) * (callback == 'fastest' ? 1 : -1); - }); - result = filter(result, function(bench) { - return result[0].compare(bench) == 0; - }); - } - return result || reduce(array, function(result, value, index) { - return callback.call(thisArg, value, index, array) ? (result.push(value), result) : result; - }, []); - } - - /** - * A generic `Array#forEach` like method. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Array} Returns the array iterated over. - */ - function forEach(array, callback, thisArg) { - var index = -1, - length = (array = Object(array)).length >>> 0; - - if (thisArg !== undefined) { - callback = bind(callback, thisArg); - } - while (++index < length) { - if (index in array && - callback(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * Iterates over an object's own properties, executing the `callback` for each. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @static - * @memberOf Benchmark - * @param {Object} object The object to iterate over. - * @param {Function} callback The function executed per own property. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Object} Returns the object iterated over. - */ - function forOwn(object, callback, thisArg) { - return forProps(object, callback, { 'bind': thisArg, 'which': 'own' }); - } - - /** - * Converts a number to a more readable comma-separated string representation. - * - * @static - * @memberOf Benchmark - * @param {Number} number The number to convert. - * @returns {String} The more readable string representation. - */ - function formatNumber(number) { - number = String(number).split('.'); - return number[0].replace(/(?=(?:\d{3})+$)(?!\b)/g, ',') + - (number[1] ? '.' + number[1] : ''); - } - - /** - * Checks if an object has the specified key as a direct property. - * - * @static - * @memberOf Benchmark - * @param {Object} object The object to check. - * @param {String} key The key to check for. - * @returns {Boolean} Returns `true` if key is a direct property, else `false`. - */ - function hasKey() { - // lazy define for worst case fallback (not as accurate) - hasKey = function(object, key) { - var parent = object != null && (object.constructor || Object).prototype; - return !!parent && key in Object(object) && !(key in parent && object[key] === parent[key]); - }; - // for modern browsers - if (isClassOf(hasOwnProperty, 'Function')) { - hasKey = function(object, key) { - return object != null && hasOwnProperty.call(object, key); - }; - } - // for Safari 2 - else if ({}.__proto__ == Object.prototype) { - hasKey = function(object, key) { - var result = false; - if (object != null) { - object = Object(object); - object.__proto__ = [object.__proto__, object.__proto__ = null, result = key in object][0]; - } - return result; - }; - } - return hasKey.apply(this, arguments); - } - - /** - * A generic `Array#indexOf` like method. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=0] The index to start searching from. - * @returns {Number} The index of the matched value or `-1`. - */ - function indexOf(array, value, fromIndex) { - var index = toInteger(fromIndex), - length = (array = Object(array)).length >>> 0; - - index = (index < 0 ? max(0, length + index) : index) - 1; - while (++index < length) { - if (index in array && value === array[index]) { - return index; - } - } - return -1; - } - - /** - * Modify a string by replacing named tokens with matching object property values. - * - * @static - * @memberOf Benchmark - * @param {String} string The string to modify. - * @param {Object} object The template object. - * @returns {String} The modified string. - */ - function interpolate(string, object) { - forOwn(object, function(value, key) { - // escape regexp special characters in `key` - string = string.replace( - RegExp('#\\{' + key.replace(/([.*+?^${}()|[\]\\])/g, '\\$1') + '\\}', 'g'), - value.replace(/\$/g, '$$$$') - ); - }); - return string; - } - - /** - * Invokes a method on all items in an array. - * - * @static - * @memberOf Benchmark - * @param {Array} benches Array of benchmarks to iterate over. - * @param {String|Object} name The name of the method to invoke OR options object. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. - * @returns {Array} A new array of values returned from each method invoked. - * @example - * - * // invoke `reset` on all benchmarks - * Benchmark.invoke(benches, 'reset'); - * - * // invoke `emit` with arguments - * Benchmark.invoke(benches, 'emit', 'complete', listener); - * - * // invoke `run(true)`, treat benchmarks as a queue, and register invoke callbacks - * Benchmark.invoke(benches, { - * - * // invoke the `run` method - * 'name': 'run', - * - * // pass a single argument - * 'args': true, - * - * // treat as queue, removing benchmarks from front of `benches` until empty - * 'queued': true, - * - * // called before any benchmarks have been invoked. - * 'onStart': onStart, - * - * // called between invoking benchmarks - * 'onCycle': onCycle, - * - * // called after all benchmarks have been invoked. - * 'onComplete': onComplete - * }); - */ - function invoke(benches, name) { - var args, - bench, - queued, - index = -1, - eventProps = { 'currentTarget': benches }, - options = { 'onStart': noop, 'onCycle': noop, 'onComplete': noop }, - result = map(benches, function(bench) { return bench; }); - - /** - * Invokes the method of the current object and if synchronous, fetches the next. - */ - function execute() { - var listeners, - async = isAsync(bench); - - if (async) { - // use `getNext` as the first listener - bench.on('complete', getNext); - listeners = bench.events.complete; - listeners.splice(0, 0, listeners.pop()); - } - // execute method - result[index] = isClassOf(bench && bench[name], 'Function') ? bench[name].apply(bench, args) : undefined; - // if synchronous return true until finished - return !async && getNext(); - } - - /** - * Fetches the next bench or executes `onComplete` callback. - */ - function getNext(event) { - var cycleEvent, - last = bench, - async = isAsync(last); - - if (async) { - last.off('complete', getNext); - last.emit('complete'); - } - // emit "cycle" event - eventProps.type = 'cycle'; - eventProps.target = last; - cycleEvent = Event(eventProps); - options.onCycle.call(benches, cycleEvent); - - // choose next benchmark if not exiting early - if (!cycleEvent.aborted && raiseIndex() !== false) { - bench = queued ? benches[0] : result[index]; - if (isAsync(bench)) { - delay(bench, execute); - } - else if (async) { - // resume execution if previously asynchronous but now synchronous - while (execute()) { } - } - else { - // continue synchronous execution - return true; - } - } else { - // emit "complete" event - eventProps.type = 'complete'; - options.onComplete.call(benches, Event(eventProps)); - } - // When used as a listener `event.aborted = true` will cancel the rest of - // the "complete" listeners because they were already called above and when - // used as part of `getNext` the `return false` will exit the execution while-loop. - if (event) { - event.aborted = true; - } else { - return false; - } - } - - /** - * Checks if invoking `Benchmark#run` with asynchronous cycles. - */ - function isAsync(object) { - // avoid using `instanceof` here because of IE memory leak issues with host objects - var async = args[0] && args[0].async; - return Object(object).constructor == Benchmark && name == 'run' && - ((async == null ? object.options.async : async) && support.timeout || object.defer); - } - - /** - * Raises `index` to the next defined index or returns `false`. - */ - function raiseIndex() { - var length = result.length; - if (queued) { - // if queued remove the previous bench and subsequent skipped non-entries - do { - ++index > 0 && shift.call(benches); - } while ((length = benches.length) && !('0' in benches)); - } - else { - while (++index < length && !(index in result)) { } - } - // if we reached the last index then return `false` - return (queued ? length : index < length) ? index : (index = false); - } - - // juggle arguments - if (isClassOf(name, 'String')) { - // 2 arguments (array, name) - args = slice.call(arguments, 2); - } else { - // 2 arguments (array, options) - options = extend(options, name); - name = options.name; - args = isClassOf(args = 'args' in options ? options.args : [], 'Array') ? args : [args]; - queued = options.queued; - } - - // start iterating over the array - if (raiseIndex() !== false) { - // emit "start" event - bench = result[index]; - eventProps.type = 'start'; - eventProps.target = bench; - options.onStart.call(benches, Event(eventProps)); - - // end early if the suite was aborted in an "onStart" listener - if (benches.aborted && benches.constructor == Suite && name == 'run') { - // emit "cycle" event - eventProps.type = 'cycle'; - options.onCycle.call(benches, Event(eventProps)); - // emit "complete" event - eventProps.type = 'complete'; - options.onComplete.call(benches, Event(eventProps)); - } - // else start - else { - if (isAsync(bench)) { - delay(bench, execute); - } else { - while (execute()) { } - } - } - } - return result; - } - - /** - * Creates a string of joined array values or object key-value pairs. - * - * @static - * @memberOf Benchmark - * @param {Array|Object} object The object to operate on. - * @param {String} [separator1=','] The separator used between key-value pairs. - * @param {String} [separator2=': '] The separator used between keys and values. - * @returns {String} The joined result. - */ - function join(object, separator1, separator2) { - var result = [], - length = (object = Object(object)).length, - arrayLike = length === length >>> 0; - - separator2 || (separator2 = ': '); - each(object, function(value, key) { - result.push(arrayLike ? value : key + separator2 + value); - }); - return result.join(separator1 || ','); - } - - /** - * A generic `Array#map` like method. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Array} A new array of values returned by the callback. - */ - function map(array, callback, thisArg) { - return reduce(array, function(result, value, index) { - result[index] = callback.call(thisArg, value, index, array); - return result; - }, Array(Object(array).length >>> 0)); - } - - /** - * Retrieves the value of a specified property from all items in an array. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {String} property The property to pluck. - * @returns {Array} A new array of property values. - */ - function pluck(array, property) { - return map(array, function(object) { - return object == null ? undefined : object[property]; - }); - } - - /** - * A generic `Array#reduce` like method. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} accumulator Initial value of the accumulator. - * @returns {Mixed} The accumulator. - */ - function reduce(array, callback, accumulator) { - var noaccum = arguments.length < 3; - forEach(array, function(value, index) { - accumulator = noaccum ? (noaccum = false, value) : callback(accumulator, value, index, array); - }); - return accumulator; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Aborts all benchmarks in the suite. - * - * @name abort - * @memberOf Benchmark.Suite - * @returns {Object} The suite instance. - */ - function abortSuite() { - var event, - me = this, - resetting = calledBy.resetSuite; - - if (me.running) { - event = Event('abort'); - me.emit(event); - if (!event.cancelled || resetting) { - // avoid infinite recursion - calledBy.abortSuite = true; - me.reset(); - delete calledBy.abortSuite; - - if (!resetting) { - me.aborted = true; - invoke(me, 'abort'); - } - } - } - return me; - } - - /** - * Adds a test to the benchmark suite. - * - * @memberOf Benchmark.Suite - * @param {String} name A name to identify the benchmark. - * @param {Function|String} fn The test to benchmark. - * @param {Object} [options={}] Options object. - * @returns {Object} The benchmark instance. - * @example - * - * // basic usage - * suite.add(fn); - * - * // or using a name first - * suite.add('foo', fn); - * - * // or with options - * suite.add('foo', fn, { - * 'onCycle': onCycle, - * 'onComplete': onComplete - * }); - * - * // or name and options - * suite.add('foo', { - * 'fn': fn, - * 'onCycle': onCycle, - * 'onComplete': onComplete - * }); - * - * // or options only - * suite.add({ - * 'name': 'foo', - * 'fn': fn, - * 'onCycle': onCycle, - * 'onComplete': onComplete - * }); - */ - function add(name, fn, options) { - var me = this, - bench = Benchmark(name, fn, options), - event = Event({ 'type': 'add', 'target': bench }); - - if (me.emit(event), !event.cancelled) { - me.push(bench); - } - return me; - } - - /** - * Creates a new suite with cloned benchmarks. - * - * @name clone - * @memberOf Benchmark.Suite - * @param {Object} options Options object to overwrite cloned options. - * @returns {Object} The new suite instance. - */ - function cloneSuite(options) { - var me = this, - result = new me.constructor(extend({}, me.options, options)); - - // copy own properties - forOwn(me, function(value, key) { - if (!hasKey(result, key)) { - result[key] = value && isClassOf(value.clone, 'Function') - ? value.clone() - : deepClone(value); - } - }); - return result; - } - - /** - * An `Array#filter` like method. - * - * @name filter - * @memberOf Benchmark.Suite - * @param {Function|String} callback The function/alias called per iteration. - * @returns {Object} A new suite of benchmarks that passed callback filter. - */ - function filterSuite(callback) { - var me = this, - result = new me.constructor; - - result.push.apply(result, filter(me, callback)); - return result; - } - - /** - * Resets all benchmarks in the suite. - * - * @name reset - * @memberOf Benchmark.Suite - * @returns {Object} The suite instance. - */ - function resetSuite() { - var event, - me = this, - aborting = calledBy.abortSuite; - - if (me.running && !aborting) { - // no worries, `resetSuite()` is called within `abortSuite()` - calledBy.resetSuite = true; - me.abort(); - delete calledBy.resetSuite; - } - // reset if the state has changed - else if ((me.aborted || me.running) && - (me.emit(event = Event('reset')), !event.cancelled)) { - me.running = false; - if (!aborting) { - invoke(me, 'reset'); - } - } - return me; - } - - /** - * Runs the suite. - * - * @name run - * @memberOf Benchmark.Suite - * @param {Object} [options={}] Options object. - * @returns {Object} The suite instance. - * @example - * - * // basic usage - * suite.run(); - * - * // or with options - * suite.run({ 'async': true, 'queued': true }); - */ - function runSuite(options) { - var me = this; - - me.reset(); - me.running = true; - options || (options = {}); - - invoke(me, { - 'name': 'run', - 'args': options, - 'queued': options.queued, - 'onStart': function(event) { - me.emit(event); - }, - 'onCycle': function(event) { - var bench = event.target; - if (bench.error) { - me.emit({ 'type': 'error', 'target': bench }); - } - me.emit(event); - event.aborted = me.aborted; - }, - 'onComplete': function(event) { - me.score = getGeometricMean(map(me, function(bench) { - return bench.reference / (bench.times.period * 1e6); - })) || 0; - - me.running = false; - me.emit(event); - } - }); - return me; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Executes all registered listeners of the specified event type. - * - * @memberOf Benchmark, Benchmark.Suite - * @param {String|Object} type The event type or object. - * @returns {Mixed} Returns the return value of the last listener executed. - */ - function emit(type) { - var listeners, - me = this, - event = Event(type), - events = me.events, - args = (arguments[0] = event, arguments); - - event.currentTarget || (event.currentTarget = me); - event.target || (event.target = me); - delete event.result; - - if (events && (listeners = hasKey(events, event.type) && events[event.type])) { - forEach(listeners.slice(), function(listener) { - if ((event.result = listener.apply(me, args)) === false) { - event.cancelled = true; - } - return !event.aborted; - }); - } - return event.result; - } - - /** - * Returns an array of event listeners for a given type that can be manipulated - * to add or remove listeners. - * - * @memberOf Benchmark, Benchmark.Suite - * @param {String} type The event type. - * @returns {Array} The listeners array. - */ - function listeners(type) { - var me = this, - events = me.events || (me.events = {}); - - return hasKey(events, type) ? events[type] : (events[type] = []); - } - - /** - * Unregisters a listener for the specified event type(s), - * or unregisters all listeners for the specified event type(s), - * or unregisters all listeners for all event types. - * - * @memberOf Benchmark, Benchmark.Suite - * @param {String} [type] The event type. - * @param {Function} [listener] The function to unregister. - * @returns {Object} The benchmark instance. - * @example - * - * // unregister a listener for an event type - * bench.off('cycle', listener); - * - * // unregister a listener for multiple event types - * bench.off('start cycle', listener); - * - * // unregister all listeners for an event type - * bench.off('cycle'); - * - * // unregister all listeners for multiple event types - * bench.off('start cycle complete'); - * - * // unregister all listeners for all event types - * bench.off(); - */ - function off(type, listener) { - var me = this, - events = me.events; - - events && each(type ? type.split(' ') : events, function(listeners, type) { - var index; - if (typeof listeners == 'string') { - type = listeners; - listeners = hasKey(events, type) && events[type]; - } - if (listeners) { - if (listener) { - index = indexOf(listeners, listener); - if (index > -1) { - listeners.splice(index, 1); - } - } else { - listeners.length = 0; - } - } - }); - return me; - } - - /** - * Registers a listener for the specified event type(s). - * - * @memberOf Benchmark, Benchmark.Suite - * @param {String} type The event type. - * @param {Function} listener The function to register. - * @returns {Object} The benchmark instance. - * @example - * - * // register a listener for an event type - * bench.on('cycle', listener); - * - * // register a listener for multiple event types - * bench.on('start cycle', listener); - */ - function on(type, listener) { - var me = this, - events = me.events || (me.events = {}); - - forEach(type.split(' '), function(type) { - (hasKey(events, type) - ? events[type] - : (events[type] = []) - ).push(listener); - }); - return me; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Aborts the benchmark without recording times. - * - * @memberOf Benchmark - * @returns {Object} The benchmark instance. - */ - function abort() { - var event, - me = this, - resetting = calledBy.reset; - - if (me.running) { - event = Event('abort'); - me.emit(event); - if (!event.cancelled || resetting) { - // avoid infinite recursion - calledBy.abort = true; - me.reset(); - delete calledBy.abort; - - if (support.timeout) { - clearTimeout(me._timerId); - delete me._timerId; - } - if (!resetting) { - me.aborted = true; - me.running = false; - } - } - } - return me; - } - - /** - * Creates a new benchmark using the same test and options. - * - * @memberOf Benchmark - * @param {Object} options Options object to overwrite cloned options. - * @returns {Object} The new benchmark instance. - * @example - * - * var bizarro = bench.clone({ - * 'name': 'doppelganger' - * }); - */ - function clone(options) { - var me = this, - result = new me.constructor(extend({}, me, options)); - - // correct the `options` object - result.options = extend({}, me.options, options); - - // copy own custom properties - forOwn(me, function(value, key) { - if (!hasKey(result, key)) { - result[key] = deepClone(value); - } - }); - return result; - } - - /** - * Determines if a benchmark is faster than another. - * - * @memberOf Benchmark - * @param {Object} other The benchmark to compare. - * @returns {Number} Returns `-1` if slower, `1` if faster, and `0` if indeterminate. - */ - function compare(other) { - var critical, - zStat, - me = this, - sample1 = me.stats.sample, - sample2 = other.stats.sample, - size1 = sample1.length, - size2 = sample2.length, - maxSize = max(size1, size2), - minSize = min(size1, size2), - u1 = getU(sample1, sample2), - u2 = getU(sample2, sample1), - u = min(u1, u2); - - function getScore(xA, sampleB) { - return reduce(sampleB, function(total, xB) { - return total + (xB > xA ? 0 : xB < xA ? 1 : 0.5); - }, 0); - } - - function getU(sampleA, sampleB) { - return reduce(sampleA, function(total, xA) { - return total + getScore(xA, sampleB); - }, 0); - } - - function getZ(u) { - return (u - ((size1 * size2) / 2)) / sqrt((size1 * size2 * (size1 + size2 + 1)) / 12); - } - - // exit early if comparing the same benchmark - if (me == other) { - return 0; - } - // reject the null hyphothesis the two samples come from the - // same population (i.e. have the same median) if... - if (size1 + size2 > 30) { - // ...the z-stat is greater than 1.96 or less than -1.96 - // http://www.statisticslectures.com/topics/mannwhitneyu/ - zStat = getZ(u); - return abs(zStat) > 1.96 ? (zStat > 0 ? -1 : 1) : 0; - } - // ...the U value is less than or equal the critical U value - // http://www.geoib.com/mann-whitney-u-test.html - critical = maxSize < 5 || minSize < 3 ? 0 : uTable[maxSize][minSize - 3]; - return u <= critical ? (u == u1 ? 1 : -1) : 0; - } - - /** - * Reset properties and abort if running. - * - * @memberOf Benchmark - * @returns {Object} The benchmark instance. - */ - function reset() { - var data, - event, - me = this, - index = 0, - changes = { 'length': 0 }, - queue = { 'length': 0 }; - - if (me.running && !calledBy.abort) { - // no worries, `reset()` is called within `abort()` - calledBy.reset = true; - me.abort(); - delete calledBy.reset; - } - else { - // a non-recursive solution to check if properties have changed - // http://www.jslab.dk/articles/non.recursive.preorder.traversal.part4 - data = { 'destination': me, 'source': extend({}, me.constructor.prototype, me.options) }; - do { - forOwn(data.source, function(value, key) { - var changed, - destination = data.destination, - currValue = destination[key]; - - if (value && typeof value == 'object') { - if (isClassOf(value, 'Array')) { - // check if an array value has changed to a non-array value - if (!isClassOf(currValue, 'Array')) { - changed = currValue = []; - } - // or has changed its length - if (currValue.length != value.length) { - changed = currValue = currValue.slice(0, value.length); - currValue.length = value.length; - } - } - // check if an object has changed to a non-object value - else if (!currValue || typeof currValue != 'object') { - changed = currValue = {}; - } - // register a changed object - if (changed) { - changes[changes.length++] = { 'destination': destination, 'key': key, 'value': currValue }; - } - queue[queue.length++] = { 'destination': currValue, 'source': value }; - } - // register a changed primitive - else if (value !== currValue && !(value == null || isClassOf(value, 'Function'))) { - changes[changes.length++] = { 'destination': destination, 'key': key, 'value': value }; - } - }); - } - while ((data = queue[index++])); - - // if changed emit the `reset` event and if it isn't cancelled reset the benchmark - if (changes.length && (me.emit(event = Event('reset')), !event.cancelled)) { - forEach(changes, function(data) { - data.destination[data.key] = data.value; - }); - } - } - return me; - } - - /** - * Displays relevant benchmark information when coerced to a string. - * - * @name toString - * @memberOf Benchmark - * @returns {String} A string representation of the benchmark instance. - */ - function toStringBench() { - var me = this, - error = me.error, - hz = me.hz, - id = me.id, - stats = me.stats, - size = stats.sample.length, - pm = support.java ? '+/-' : '\xb1', - result = me.name || (isNaN(id) ? id : ''); - - if (error) { - result += ': ' + join(error); - } else { - result += ' x ' + formatNumber(hz.toFixed(hz < 100 ? 2 : 0)) + ' ops/sec ' + pm + - stats.rme.toFixed(2) + '% (' + size + ' run' + (size == 1 ? '' : 's') + ' sampled)'; - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Clocks the time taken to execute a test per cycle (secs). - * - * @private - * @param {Object} bench The benchmark instance. - * @returns {Number} The time taken. - */ - function clock() { - var applet, - options = Benchmark.options, - template = { 'begin': 's$=new n$', 'end': 'r$=(new n$-s$)/1e3', 'uid': uid }, - timers = [{ 'ns': timer.ns, 'res': max(0.0015, getRes('ms')), 'unit': 'ms' }]; - - // lazy define for hi-res timers - clock = function(clone) { - var deferred; - if (clone instanceof Deferred) { - deferred = clone; - clone = deferred.benchmark; - } - - var bench = clone._original, - fn = bench.fn, - fnArg = deferred ? getFirstArgument(fn) || 'deferred' : '', - stringable = isStringable(fn); - - var source = { - 'setup': getSource(bench.setup, preprocess('m$.setup()')), - 'fn': getSource(fn, preprocess('m$.fn(' + fnArg + ')')), - 'fnArg': fnArg, - 'teardown': getSource(bench.teardown, preprocess('m$.teardown()')) - }; - - var count = bench.count = clone.count, - decompilable = support.decompilation || stringable, - id = bench.id, - isEmpty = !(source.fn || stringable), - name = bench.name || (typeof id == 'number' ? '' : id), - ns = timer.ns, - result = 0; - - // init `minTime` if needed - clone.minTime = bench.minTime || (bench.minTime = bench.options.minTime = options.minTime); - - // repair nanosecond timer - // (some Chrome builds erase the `ns` variable after millions of executions) - if (applet) { - try { - ns.nanoTime(); - } catch(e) { - // use non-element to avoid issues with libs that augment them - ns = timer.ns = new applet.Packages.nano; - } - } - - // Compile in setup/teardown functions and the test loop. - // Create a new compiled test, instead of using the cached `bench.compiled`, - // to avoid potential engine optimizations enabled over the life of the test. - var compiled = bench.compiled = createFunction(preprocess('t$'), interpolate( - preprocess(deferred - ? 'var d$=this,#{fnArg}=d$,m$=d$.benchmark._original,f$=m$.fn,su$=m$.setup,td$=m$.teardown;' + - // when `deferred.cycles` is `0` then... - 'if(!d$.cycles){' + - // set `deferred.fn` - 'd$.fn=function(){var #{fnArg}=d$;if(typeof f$=="function"){try{#{fn}\n}catch(e$){f$(d$)}}else{#{fn}\n}};' + - // set `deferred.teardown` - 'd$.teardown=function(){d$.cycles=0;if(typeof td$=="function"){try{#{teardown}\n}catch(e$){td$()}}else{#{teardown}\n}};' + - // execute the benchmark's `setup` - 'if(typeof su$=="function"){try{#{setup}\n}catch(e$){su$()}}else{#{setup}\n};' + - // start timer - 't$.start(d$);' + - // execute `deferred.fn` and return a dummy object - '}d$.fn();return{}' - - : 'var r$,s$,m$=this,f$=m$.fn,i$=m$.count,n$=t$.ns;#{setup}\n#{begin};' + - 'while(i$--){#{fn}\n}#{end};#{teardown}\nreturn{elapsed:r$,uid:"#{uid}"}'), - source - )); - - try { - if (isEmpty) { - // Firefox may remove dead code from Function#toString results - // http://bugzil.la/536085 - throw new Error('The test "' + name + '" is empty. This may be the result of dead code removal.'); - } - else if (!deferred) { - // pretest to determine if compiled code is exits early, usually by a - // rogue `return` statement, by checking for a return object with the uid - bench.count = 1; - compiled = (compiled.call(bench, timer) || {}).uid == uid && compiled; - bench.count = count; - } - } catch(e) { - compiled = null; - clone.error = e || new Error(String(e)); - bench.count = count; - } - // fallback when a test exits early or errors during pretest - if (decompilable && !compiled && !deferred && !isEmpty) { - compiled = createFunction(preprocess('t$'), interpolate( - preprocess( - (clone.error && !stringable - ? 'var r$,s$,m$=this,f$=m$.fn,i$=m$.count' - : 'function f$(){#{fn}\n}var r$,s$,m$=this,i$=m$.count' - ) + - ',n$=t$.ns;#{setup}\n#{begin};m$.f$=f$;while(i$--){m$.f$()}#{end};' + - 'delete m$.f$;#{teardown}\nreturn{elapsed:r$}' - ), - source - )); - - try { - // pretest one more time to check for errors - bench.count = 1; - compiled.call(bench, timer); - bench.compiled = compiled; - bench.count = count; - delete clone.error; - } - catch(e) { - bench.count = count; - if (clone.error) { - compiled = null; - } else { - bench.compiled = compiled; - clone.error = e || new Error(String(e)); - } - } - } - // assign `compiled` to `clone` before calling in case a deferred benchmark - // immediately calls `deferred.resolve()` - clone.compiled = compiled; - // if no errors run the full test loop - if (!clone.error) { - result = compiled.call(deferred || bench, timer).elapsed; - } - return result; - }; - - /*------------------------------------------------------------------------*/ - - /** - * Gets the current timer's minimum resolution (secs). - */ - function getRes(unit) { - var measured, - begin, - count = 30, - divisor = 1e3, - ns = timer.ns, - sample = []; - - // get average smallest measurable time - while (count--) { - if (unit == 'us') { - divisor = 1e6; - if (ns.stop) { - ns.start(); - while (!(measured = ns.microseconds())) { } - } else if (ns[perfName]) { - divisor = 1e3; - measured = Function('n', 'var r,s=n.' + perfName + '();while(!(r=n.' + perfName + '()-s)){};return r')(ns); - } else { - begin = ns(); - while (!(measured = ns() - begin)) { } - } - } - else if (unit == 'ns') { - divisor = 1e9; - if (ns.nanoTime) { - begin = ns.nanoTime(); - while (!(measured = ns.nanoTime() - begin)) { } - } else { - begin = (begin = ns())[0] + (begin[1] / divisor); - while (!(measured = ((measured = ns())[0] + (measured[1] / divisor)) - begin)) { } - divisor = 1; - } - } - else { - begin = new ns; - while (!(measured = new ns - begin)) { } - } - // check for broken timers (nanoTime may have issues) - // http://alivebutsleepy.srnet.cz/unreliable-system-nanotime/ - if (measured > 0) { - sample.push(measured); - } else { - sample.push(Infinity); - break; - } - } - // convert to seconds - return getMean(sample) / divisor; - } - - /** - * Replaces all occurrences of `$` with a unique number and - * template tokens with content. - */ - function preprocess(code) { - return interpolate(code, template).replace(/\$/g, /\d+/.exec(uid)); - } - - /*------------------------------------------------------------------------*/ - - // detect nanosecond support from a Java applet - each(doc && doc.applets || [], function(element) { - return !(timer.ns = applet = 'nanoTime' in element && element); - }); - - // check type in case Safari returns an object instead of a number - try { - if (typeof timer.ns.nanoTime() == 'number') { - timers.push({ 'ns': timer.ns, 'res': getRes('ns'), 'unit': 'ns' }); - } - } catch(e) { } - - // detect Chrome's microsecond timer: - // enable benchmarking via the --enable-benchmarking command - // line switch in at least Chrome 7 to use chrome.Interval - try { - if ((timer.ns = new (window.chrome || window.chromium).Interval)) { - timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' }); - } - } catch(e) { } - - // detect `performance.now` microsecond resolution timer - if ((timer.ns = perfName && perfObject)) { - timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' }); - } - - // detect Node's nanosecond resolution timer available in Node >= 0.8 - if (processObject && typeof (timer.ns = processObject.hrtime) == 'function') { - timers.push({ 'ns': timer.ns, 'res': getRes('ns'), 'unit': 'ns' }); - } - - // detect Wade Simmons' Node microtime module - if (microtimeObject && typeof (timer.ns = microtimeObject.now) == 'function') { - timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' }); - } - - // pick timer with highest resolution - timer = reduce(timers, function(timer, other) { - return other.res < timer.res ? other : timer; - }); - - // remove unused applet - if (timer.unit != 'ns' && applet) { - applet = destroyElement(applet); - } - // error if there are no working timers - if (timer.res == Infinity) { - throw new Error('Benchmark.js was unable to find a working timer.'); - } - // use API of chosen timer - if (timer.unit == 'ns') { - if (timer.ns.nanoTime) { - extend(template, { - 'begin': 's$=n$.nanoTime()', - 'end': 'r$=(n$.nanoTime()-s$)/1e9' - }); - } else { - extend(template, { - 'begin': 's$=n$()', - 'end': 'r$=n$(s$);r$=r$[0]+(r$[1]/1e9)' - }); - } - } - else if (timer.unit == 'us') { - if (timer.ns.stop) { - extend(template, { - 'begin': 's$=n$.start()', - 'end': 'r$=n$.microseconds()/1e6' - }); - } else if (perfName) { - extend(template, { - 'begin': 's$=n$.' + perfName + '()', - 'end': 'r$=(n$.' + perfName + '()-s$)/1e3' - }); - } else { - extend(template, { - 'begin': 's$=n$()', - 'end': 'r$=(n$()-s$)/1e6' - }); - } - } - - // define `timer` methods - timer.start = createFunction(preprocess('o$'), - preprocess('var n$=this.ns,#{begin};o$.elapsed=0;o$.timeStamp=s$')); - - timer.stop = createFunction(preprocess('o$'), - preprocess('var n$=this.ns,s$=o$.timeStamp,#{end};o$.elapsed=r$')); - - // resolve time span required to achieve a percent uncertainty of at most 1% - // http://spiff.rit.edu/classes/phys273/uncert/uncert.html - options.minTime || (options.minTime = max(timer.res / 2 / 0.01, 0.05)); - return clock.apply(null, arguments); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Computes stats on benchmark results. - * - * @private - * @param {Object} bench The benchmark instance. - * @param {Object} options The options object. - */ - function compute(bench, options) { - options || (options = {}); - - var async = options.async, - elapsed = 0, - initCount = bench.initCount, - minSamples = bench.minSamples, - queue = [], - sample = bench.stats.sample; - - /** - * Adds a clone to the queue. - */ - function enqueue() { - queue.push(bench.clone({ - '_original': bench, - 'events': { - 'abort': [update], - 'cycle': [update], - 'error': [update], - 'start': [update] - } - })); - } - - /** - * Updates the clone/original benchmarks to keep their data in sync. - */ - function update(event) { - var clone = this, - type = event.type; - - if (bench.running) { - if (type == 'start') { - // Note: `clone.minTime` prop is inited in `clock()` - clone.count = bench.initCount; - } - else { - if (type == 'error') { - bench.error = clone.error; - } - if (type == 'abort') { - bench.abort(); - bench.emit('cycle'); - } else { - event.currentTarget = event.target = bench; - bench.emit(event); - } - } - } else if (bench.aborted) { - // clear abort listeners to avoid triggering bench's abort/cycle again - clone.events.abort.length = 0; - clone.abort(); - } - } - - /** - * Determines if more clones should be queued or if cycling should stop. - */ - function evaluate(event) { - var critical, - df, - mean, - moe, - rme, - sd, - sem, - variance, - clone = event.target, - done = bench.aborted, - now = +new Date, - size = sample.push(clone.times.period), - maxedOut = size >= minSamples && (elapsed += now - clone.times.timeStamp) / 1e3 > bench.maxTime, - times = bench.times, - varOf = function(sum, x) { return sum + pow(x - mean, 2); }; - - // exit early for aborted or unclockable tests - if (done || clone.hz == Infinity) { - maxedOut = !(size = sample.length = queue.length = 0); - } - - if (!done) { - // sample mean (estimate of the population mean) - mean = getMean(sample); - // sample variance (estimate of the population variance) - variance = reduce(sample, varOf, 0) / (size - 1) || 0; - // sample standard deviation (estimate of the population standard deviation) - sd = sqrt(variance); - // standard error of the mean (a.k.a. the standard deviation of the sampling distribution of the sample mean) - sem = sd / sqrt(size); - // degrees of freedom - df = size - 1; - // critical value - critical = tTable[Math.round(df) || 1] || tTable.infinity; - // margin of error - moe = sem * critical; - // relative margin of error - rme = (moe / mean) * 100 || 0; - - extend(bench.stats, { - 'deviation': sd, - 'mean': mean, - 'moe': moe, - 'rme': rme, - 'sem': sem, - 'variance': variance - }); - - // Abort the cycle loop when the minimum sample size has been collected - // and the elapsed time exceeds the maximum time allowed per benchmark. - // We don't count cycle delays toward the max time because delays may be - // increased by browsers that clamp timeouts for inactive tabs. - // https://developer.mozilla.org/en/window.setTimeout#Inactive_tabs - if (maxedOut) { - // reset the `initCount` in case the benchmark is rerun - bench.initCount = initCount; - bench.running = false; - done = true; - times.elapsed = (now - times.timeStamp) / 1e3; - } - if (bench.hz != Infinity) { - bench.hz = 1 / mean; - times.cycle = mean * bench.count; - times.period = mean; - } - } - // if time permits, increase sample size to reduce the margin of error - if (queue.length < 2 && !maxedOut) { - enqueue(); - } - // abort the invoke cycle when done - event.aborted = done; - } - - // init queue and begin - enqueue(); - invoke(queue, { - 'name': 'run', - 'args': { 'async': async }, - 'queued': true, - 'onCycle': evaluate, - 'onComplete': function() { bench.emit('complete'); } - }); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Cycles a benchmark until a run `count` can be established. - * - * @private - * @param {Object} clone The cloned benchmark instance. - * @param {Object} options The options object. - */ - function cycle(clone, options) { - options || (options = {}); - - var deferred; - if (clone instanceof Deferred) { - deferred = clone; - clone = clone.benchmark; - } - - var clocked, - cycles, - divisor, - event, - minTime, - period, - async = options.async, - bench = clone._original, - count = clone.count, - times = clone.times; - - // continue, if not aborted between cycles - if (clone.running) { - // `minTime` is set to `Benchmark.options.minTime` in `clock()` - cycles = ++clone.cycles; - clocked = deferred ? deferred.elapsed : clock(clone); - minTime = clone.minTime; - - if (cycles > bench.cycles) { - bench.cycles = cycles; - } - if (clone.error) { - event = Event('error'); - event.message = clone.error; - clone.emit(event); - if (!event.cancelled) { - clone.abort(); - } - } - } - - // continue, if not errored - if (clone.running) { - // time taken to complete last test cycle - bench.times.cycle = times.cycle = clocked; - // seconds per operation - period = bench.times.period = times.period = clocked / count; - // ops per second - bench.hz = clone.hz = 1 / period; - // avoid working our way up to this next time - bench.initCount = clone.initCount = count; - // do we need to do another cycle? - clone.running = clocked < minTime; - - if (clone.running) { - // tests may clock at `0` when `initCount` is a small number, - // to avoid that we set its count to something a bit higher - if (!clocked && (divisor = divisors[clone.cycles]) != null) { - count = floor(4e6 / divisor); - } - // calculate how many more iterations it will take to achive the `minTime` - if (count <= clone.count) { - count += Math.ceil((minTime - clocked) / period); - } - clone.running = count != Infinity; - } - } - // should we exit early? - event = Event('cycle'); - clone.emit(event); - if (event.aborted) { - clone.abort(); - } - // figure out what to do next - if (clone.running) { - // start a new cycle - clone.count = count; - if (deferred) { - clone.compiled.call(deferred, timer); - } else if (async) { - delay(clone, function() { cycle(clone, options); }); - } else { - cycle(clone); - } - } - else { - // fix TraceMonkey bug associated with clock fallbacks - // http://bugzil.la/509069 - if (support.browser) { - runScript(uid + '=1;delete ' + uid); - } - // done - clone.emit('complete'); - } - } - - /*--------------------------------------------------------------------------*/ - - /** - * Runs the benchmark. - * - * @memberOf Benchmark - * @param {Object} [options={}] Options object. - * @returns {Object} The benchmark instance. - * @example - * - * // basic usage - * bench.run(); - * - * // or with options - * bench.run({ 'async': true }); - */ - function run(options) { - var me = this, - event = Event('start'); - - // set `running` to `false` so `reset()` won't call `abort()` - me.running = false; - me.reset(); - me.running = true; - - me.count = me.initCount; - me.times.timeStamp = +new Date; - me.emit(event); - - if (!event.cancelled) { - options = { 'async': ((options = options && options.async) == null ? me.async : options) && support.timeout }; - - // for clones created within `compute()` - if (me._original) { - if (me.defer) { - Deferred(me); - } else { - cycle(me, options); - } - } - // for original benchmarks - else { - compute(me, options); - } - } - return me; - } - - /*--------------------------------------------------------------------------*/ - - // Firefox 1 erroneously defines variable and argument names of functions on - // the function itself as non-configurable properties with `undefined` values. - // The bugginess continues as the `Benchmark` constructor has an argument - // named `options` and Firefox 1 will not assign a value to `Benchmark.options`, - // making it non-writable in the process, unless it is the first property - // assigned by for-in loop of `extend()`. - extend(Benchmark, { - - /** - * The default options copied by benchmark instances. - * - * @static - * @memberOf Benchmark - * @type Object - */ - 'options': { - - /** - * A flag to indicate that benchmark cycles will execute asynchronously - * by default. - * - * @memberOf Benchmark.options - * @type Boolean - */ - 'async': false, - - /** - * A flag to indicate that the benchmark clock is deferred. - * - * @memberOf Benchmark.options - * @type Boolean - */ - 'defer': false, - - /** - * The delay between test cycles (secs). - * @memberOf Benchmark.options - * @type Number - */ - 'delay': 0.005, - - /** - * Displayed by Benchmark#toString when a `name` is not available - * (auto-generated if absent). - * - * @memberOf Benchmark.options - * @type String - */ - 'id': undefined, - - /** - * The default number of times to execute a test on a benchmark's first cycle. - * - * @memberOf Benchmark.options - * @type Number - */ - 'initCount': 1, - - /** - * The maximum time a benchmark is allowed to run before finishing (secs). - * - * Note: Cycle delays aren't counted toward the maximum time. - * - * @memberOf Benchmark.options - * @type Number - */ - 'maxTime': 5, - - /** - * The minimum sample size required to perform statistical analysis. - * - * @memberOf Benchmark.options - * @type Number - */ - 'minSamples': 5, - - /** - * The time needed to reduce the percent uncertainty of measurement to 1% (secs). - * - * @memberOf Benchmark.options - * @type Number - */ - 'minTime': 0, - - /** - * The name of the benchmark. - * - * @memberOf Benchmark.options - * @type String - */ - 'name': undefined, - - /** - * An event listener called when the benchmark is aborted. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onAbort': undefined, - - /** - * An event listener called when the benchmark completes running. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onComplete': undefined, - - /** - * An event listener called after each run cycle. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onCycle': undefined, - - /** - * An event listener called when a test errors. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onError': undefined, - - /** - * An event listener called when the benchmark is reset. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onReset': undefined, - - /** - * An event listener called when the benchmark starts running. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onStart': undefined, - - /** - * The reference time taken to execute the test once (usecs). - * - * @memberOf Benchmark.options - * @type Number - */ - 'reference': 0 - }, - - /** - * Platform object with properties describing things like browser name, - * version, and operating system. - * - * @static - * @memberOf Benchmark - * @type Object - */ - 'platform': req('platform') || window.platform || { - - /** - * The platform description. - * - * @memberOf Benchmark.platform - * @type String - */ - 'description': window.navigator && navigator.userAgent || null, - - /** - * The name of the browser layout engine. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'layout': null, - - /** - * The name of the product hosting the browser. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'product': null, - - /** - * The name of the browser/environment. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'name': null, - - /** - * The name of the product's manufacturer. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'manufacturer': null, - - /** - * The name of the operating system. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'os': null, - - /** - * The alpha/beta release indicator. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'prerelease': null, - - /** - * The browser/environment version. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'version': null, - - /** - * Return platform description when the platform object is coerced to a string. - * - * @memberOf Benchmark.platform - * @type Function - * @returns {String} The platform description. - */ - 'toString': function() { - return this.description || ''; - } - }, - - /** - * The semantic version number. - * - * @static - * @memberOf Benchmark - * @type String - */ - 'version': '1.0.0', - - // an object of environment/feature detection flags - 'support': support, - - // clone objects - 'deepClone': deepClone, - - // iteration utility - 'each': each, - - // augment objects - 'extend': extend, - - // generic Array#filter - 'filter': filter, - - // generic Array#forEach - 'forEach': forEach, - - // generic own property iteration utility - 'forOwn': forOwn, - - // converts a number to a comma-separated string - 'formatNumber': formatNumber, - - // generic Object#hasOwnProperty - // (trigger hasKey's lazy define before assigning it to Benchmark) - 'hasKey': (hasKey(Benchmark, ''), hasKey), - - // generic Array#indexOf - 'indexOf': indexOf, - - // template utility - 'interpolate': interpolate, - - // invokes a method on each item in an array - 'invoke': invoke, - - // generic Array#join for arrays and objects - 'join': join, - - // generic Array#map - 'map': map, - - // retrieves a property value from each item in an array - 'pluck': pluck, - - // generic Array#reduce - 'reduce': reduce - }); - - /*--------------------------------------------------------------------------*/ - - extend(Benchmark.prototype, { - - /** - * The number of times a test was executed. - * - * @memberOf Benchmark - * @type Number - */ - 'count': 0, - - /** - * The number of cycles performed while benchmarking. - * - * @memberOf Benchmark - * @type Number - */ - 'cycles': 0, - - /** - * The number of executions per second. - * - * @memberOf Benchmark - * @type Number - */ - 'hz': 0, - - /** - * The compiled test function. - * - * @memberOf Benchmark - * @type Function|String - */ - 'compiled': undefined, - - /** - * The error object if the test failed. - * - * @memberOf Benchmark - * @type Object - */ - 'error': undefined, - - /** - * The test to benchmark. - * - * @memberOf Benchmark - * @type Function|String - */ - 'fn': undefined, - - /** - * A flag to indicate if the benchmark is aborted. - * - * @memberOf Benchmark - * @type Boolean - */ - 'aborted': false, - - /** - * A flag to indicate if the benchmark is running. - * - * @memberOf Benchmark - * @type Boolean - */ - 'running': false, - - /** - * Compiled into the test and executed immediately **before** the test loop. - * - * @memberOf Benchmark - * @type Function|String - * @example - * - * // basic usage - * var bench = Benchmark({ - * 'setup': function() { - * var c = this.count, - * element = document.getElementById('container'); - * while (c--) { - * element.appendChild(document.createElement('div')); - * } - * }, - * 'fn': function() { - * element.removeChild(element.lastChild); - * } - * }); - * - * // compiles to something like: - * var c = this.count, - * element = document.getElementById('container'); - * while (c--) { - * element.appendChild(document.createElement('div')); - * } - * var start = new Date; - * while (count--) { - * element.removeChild(element.lastChild); - * } - * var end = new Date - start; - * - * // or using strings - * var bench = Benchmark({ - * 'setup': '\ - * var a = 0;\n\ - * (function() {\n\ - * (function() {\n\ - * (function() {', - * 'fn': 'a += 1;', - * 'teardown': '\ - * }())\n\ - * }())\n\ - * }())' - * }); - * - * // compiles to something like: - * var a = 0; - * (function() { - * (function() { - * (function() { - * var start = new Date; - * while (count--) { - * a += 1; - * } - * var end = new Date - start; - * }()) - * }()) - * }()) - */ - 'setup': noop, - - /** - * Compiled into the test and executed immediately **after** the test loop. - * - * @memberOf Benchmark - * @type Function|String - */ - 'teardown': noop, - - /** - * An object of stats including mean, margin or error, and standard deviation. - * - * @memberOf Benchmark - * @type Object - */ - 'stats': { - - /** - * The margin of error. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'moe': 0, - - /** - * The relative margin of error (expressed as a percentage of the mean). - * - * @memberOf Benchmark#stats - * @type Number - */ - 'rme': 0, - - /** - * The standard error of the mean. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'sem': 0, - - /** - * The sample standard deviation. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'deviation': 0, - - /** - * The sample arithmetic mean. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'mean': 0, - - /** - * The array of sampled periods. - * - * @memberOf Benchmark#stats - * @type Array - */ - 'sample': [], - - /** - * The sample variance. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'variance': 0 - }, - - /** - * An object of timing data including cycle, elapsed, period, start, and stop. - * - * @memberOf Benchmark - * @type Object - */ - 'times': { - - /** - * The time taken to complete the last cycle (secs). - * - * @memberOf Benchmark#times - * @type Number - */ - 'cycle': 0, - - /** - * The time taken to complete the benchmark (secs). - * - * @memberOf Benchmark#times - * @type Number - */ - 'elapsed': 0, - - /** - * The time taken to execute the test once (secs). - * - * @memberOf Benchmark#times - * @type Number - */ - 'period': 0, - - /** - * A timestamp of when the benchmark started (ms). - * - * @memberOf Benchmark#times - * @type Number - */ - 'timeStamp': 0 - }, - - // aborts benchmark (does not record times) - 'abort': abort, - - // creates a new benchmark using the same test and options - 'clone': clone, - - // compares benchmark's hertz with another - 'compare': compare, - - // executes listeners - 'emit': emit, - - // get listeners - 'listeners': listeners, - - // unregister listeners - 'off': off, - - // register listeners - 'on': on, - - // reset benchmark properties - 'reset': reset, - - // runs the benchmark - 'run': run, - - // pretty print benchmark info - 'toString': toStringBench - }); - - /*--------------------------------------------------------------------------*/ - - extend(Deferred.prototype, { - - /** - * The deferred benchmark instance. - * - * @memberOf Benchmark.Deferred - * @type Object - */ - 'benchmark': null, - - /** - * The number of deferred cycles performed while benchmarking. - * - * @memberOf Benchmark.Deferred - * @type Number - */ - 'cycles': 0, - - /** - * The time taken to complete the deferred benchmark (secs). - * - * @memberOf Benchmark.Deferred - * @type Number - */ - 'elapsed': 0, - - /** - * A timestamp of when the deferred benchmark started (ms). - * - * @memberOf Benchmark.Deferred - * @type Number - */ - 'timeStamp': 0, - - // cycles/completes the deferred benchmark - 'resolve': resolve - }); - - /*--------------------------------------------------------------------------*/ - - extend(Event.prototype, { - - /** - * A flag to indicate if the emitters listener iteration is aborted. - * - * @memberOf Benchmark.Event - * @type Boolean - */ - 'aborted': false, - - /** - * A flag to indicate if the default action is cancelled. - * - * @memberOf Benchmark.Event - * @type Boolean - */ - 'cancelled': false, - - /** - * The object whose listeners are currently being processed. - * - * @memberOf Benchmark.Event - * @type Object - */ - 'currentTarget': undefined, - - /** - * The return value of the last executed listener. - * - * @memberOf Benchmark.Event - * @type Mixed - */ - 'result': undefined, - - /** - * The object to which the event was originally emitted. - * - * @memberOf Benchmark.Event - * @type Object - */ - 'target': undefined, - - /** - * A timestamp of when the event was created (ms). - * - * @memberOf Benchmark.Event - * @type Number - */ - 'timeStamp': 0, - - /** - * The event type. - * - * @memberOf Benchmark.Event - * @type String - */ - 'type': '' - }); - - /*--------------------------------------------------------------------------*/ - - /** - * The default options copied by suite instances. - * - * @static - * @memberOf Benchmark.Suite - * @type Object - */ - Suite.options = { - - /** - * The name of the suite. - * - * @memberOf Benchmark.Suite.options - * @type String - */ - 'name': undefined - }; - - /*--------------------------------------------------------------------------*/ - - extend(Suite.prototype, { - - /** - * The number of benchmarks in the suite. - * - * @memberOf Benchmark.Suite - * @type Number - */ - 'length': 0, - - /** - * A score computed using the normalized result of each benchmark in the suite. - * - * @memberOf Benchmark.Suite - * @type Number - */ - 'score': 0, - - /** - * A flag to indicate if the suite is aborted. - * - * @memberOf Benchmark.Suite - * @type Boolean - */ - 'aborted': false, - - /** - * A flag to indicate if the suite is running. - * - * @memberOf Benchmark.Suite - * @type Boolean - */ - 'running': false, - - /** - * An `Array#forEach` like method. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @memberOf Benchmark.Suite - * @param {Function} callback The function called per iteration. - * @returns {Object} The suite iterated over. - */ - 'forEach': methodize(forEach), - - /** - * An `Array#indexOf` like method. - * - * @memberOf Benchmark.Suite - * @param {Mixed} value The value to search for. - * @returns {Number} The index of the matched value or `-1`. - */ - 'indexOf': methodize(indexOf), - - /** - * Invokes a method on all benchmarks in the suite. - * - * @memberOf Benchmark.Suite - * @param {String|Object} name The name of the method to invoke OR options object. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. - * @returns {Array} A new array of values returned from each method invoked. - */ - 'invoke': methodize(invoke), - - /** - * Converts the suite of benchmarks to a string. - * - * @memberOf Benchmark.Suite - * @param {String} [separator=','] A string to separate each element of the array. - * @returns {String} The string. - */ - 'join': [].join, - - /** - * An `Array#map` like method. - * - * @memberOf Benchmark.Suite - * @param {Function} callback The function called per iteration. - * @returns {Array} A new array of values returned by the callback. - */ - 'map': methodize(map), - - /** - * Retrieves the value of a specified property from all benchmarks in the suite. - * - * @memberOf Benchmark.Suite - * @param {String} property The property to pluck. - * @returns {Array} A new array of property values. - */ - 'pluck': methodize(pluck), - - /** - * Removes the last benchmark from the suite and returns it. - * - * @memberOf Benchmark.Suite - * @returns {Mixed} The removed benchmark. - */ - 'pop': [].pop, - - /** - * Appends benchmarks to the suite. - * - * @memberOf Benchmark.Suite - * @returns {Number} The suite's new length. - */ - 'push': [].push, - - /** - * Sorts the benchmarks of the suite. - * - * @memberOf Benchmark.Suite - * @param {Function} [compareFn=null] A function that defines the sort order. - * @returns {Object} The sorted suite. - */ - 'sort': [].sort, - - /** - * An `Array#reduce` like method. - * - * @memberOf Benchmark.Suite - * @param {Function} callback The function called per iteration. - * @param {Mixed} accumulator Initial value of the accumulator. - * @returns {Mixed} The accumulator. - */ - 'reduce': methodize(reduce), - - // aborts all benchmarks in the suite - 'abort': abortSuite, - - // adds a benchmark to the suite - 'add': add, - - // creates a new suite with cloned benchmarks - 'clone': cloneSuite, - - // executes listeners of a specified type - 'emit': emit, - - // creates a new suite of filtered benchmarks - 'filter': filterSuite, - - // get listeners - 'listeners': listeners, - - // unregister listeners - 'off': off, - - // register listeners - 'on': on, - - // resets all benchmarks in the suite - 'reset': resetSuite, - - // runs all benchmarks in the suite - 'run': runSuite, - - // array methods - 'concat': concat, - - 'reverse': reverse, - - 'shift': shift, - - 'slice': slice, - - 'splice': splice, - - 'unshift': unshift - }); - - /*--------------------------------------------------------------------------*/ - - // expose Deferred, Event and Suite - extend(Benchmark, { - 'Deferred': Deferred, - 'Event': Event, - 'Suite': Suite - }); - - // expose Benchmark - // some AMD build optimizers, like r.js, check for specific condition patterns like the following: - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // define as an anonymous module so, through path mapping, it can be aliased - define(function() { - return Benchmark; - }); - } - // check for `exports` after `define` in case a build optimizer adds an `exports` object - else if (freeExports) { - // in Node.js or RingoJS v0.8.0+ - if (typeof module == 'object' && module && module.exports == freeExports) { - (module.exports = Benchmark).Benchmark = Benchmark; - } - // in Narwhal or RingoJS v0.7.0- - else { - freeExports.Benchmark = Benchmark; - } - } - // in a browser or Rhino - else { - // use square bracket notation so Closure Compiler won't munge `Benchmark` - // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export - window['Benchmark'] = Benchmark; - } - - // trigger clock's lazy define early to avoid a security error - if (support.air) { - clock({ '_original': { 'fn': noop, 'count': 1, 'options': {} } }); - } -}(this)); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/LICENSE.txt b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/LICENSE.txt deleted file mode 100644 index a7501f9..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2011-2013 John-David Dalton - -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/README.md deleted file mode 100644 index c2f1cb6..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# Platform.js v1.0.0 - -A platform detection library that works on nearly all JavaScript platforms1. - -## Disclaimer - -Platform.js is for informational purposes only and **not** intended as a substitution for [feature detection/inference](http://allyoucanleet.com/post/18087210413/feature-testing-costs#screencast2) checks. - -## BestieJS - -Platform.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Documentation - -The documentation for Platform.js can be viewed here: [/doc/README.md](https://github.com/bestiejs/platform.js/blob/master/doc/README.md#readme) - -For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/platform.js/wiki/Roadmap). - -## Support - -Platform.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1-14, IE 6-9, Opera 9.25-12, Safari 3-6, Node.js 0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. - -## Installation and usage - -In a browser or Adobe AIR: - -```html - -``` - -Via [npm](http://npmjs.org/): - -```bash -npm install platform -``` - -In [Node.js](http://nodejs.org/) and [RingoJS](http://ringojs.org/): - -```js -var platform = require('platform'); -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('platform.js'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({ - 'paths': { - 'platform': 'path/to/platform' - } -}, -['platform'], function(platform) { - console.log(platform.name); -}); -``` - -Usage example: - -```js -// on IE10 x86 platform preview running in IE7 compatibility mode on Windows 7 64 bit edition -platform.name; // 'IE' -platform.version; // '10.0' -platform.layout; // 'Trident' -platform.os; // 'Windows Server 2008 R2 / 7 x64' -platform.description; // 'IE 10.0 x86 (platform preview; running in IE 7 mode) on Windows Server 2008 R2 / 7 x64' - -// or on an iPad -platform.name; // 'Safari' -platform.version; // '5.1' -platform.product; // 'iPad' -platform.manufacturer; // 'Apple' -platform.layout; // 'WebKit' -platform.os; // 'iOS 5.0' -platform.description; // 'Safari 5.1 on Apple iPad (iOS 5.0)' - -// or parsing a given UA string -var info = platform.parse('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7.2; en; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 11.52'); -info.name; // 'Opera' -info.version; // '11.52' -info.layout; // 'Presto' -info.os; // 'Mac OS X 10.7.2' -info.description; // 'Opera 11.52 (identifying as Firefox 4.0) on Mac OS X 10.7.2' -``` - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/platform.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/platform.js deleted file mode 100644 index d643c18..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/platform.js/platform.js +++ /dev/null @@ -1,996 +0,0 @@ -/*! - * Platform.js v1.0.0 - * Copyright 2010-2013 John-David Dalton - * Available under MIT license - */ -;(function(window) { - 'use strict'; - - /** Backup possible window/global object */ - var oldWin = window; - - /** Detect free variable `exports` */ - var freeExports = typeof exports == 'object' && exports; - - /** Detect free variable `global` */ - var freeGlobal = typeof global == 'object' && global && - (global == global.global ? (window = global) : global); - - /** Opera regexp */ - var reOpera = /Opera/; - - /** Used to resolve a value's internal [[Class]] */ - var toString = {}.toString; - - /** Detect Java environment */ - var java = /Java/.test(getClassOf(window.java)) && window.java; - - /** A character to represent alpha */ - var alpha = java ? 'a' : '\u03b1'; - - /** A character to represent beta */ - var beta = java ? 'b' : '\u03b2'; - - /** Browser document object */ - var doc = window.document || {}; - - /** Used to check for own properties of an object */ - var hasOwnProperty = {}.hasOwnProperty; - - /** Browser navigator object */ - var nav = window.navigator || {}; - - /** - * Detect Opera browser - * http://www.howtocreate.co.uk/operaStuff/operaObject.html - * http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini - */ - var opera = window.operamini || window.opera; - - /** Opera [[Class]] */ - var operaClass = reOpera.test(operaClass = getClassOf(opera)) ? operaClass : (opera = null); - - /** Possible global object */ - var thisBinding = this; - - /** Browser user agent string */ - var userAgent = nav.userAgent || ''; - - /*--------------------------------------------------------------------------*/ - - /** - * Capitalizes a string value. - * - * @private - * @param {String} string The string to capitalize. - * @returns {String} The capitalized string. - */ - function capitalize(string) { - string = String(string); - return string.charAt(0).toUpperCase() + string.slice(1); - } - - /** - * An iteration utility for arrays and objects. - * - * @private - * @param {Array|Object} object The object to iterate over. - * @param {Function} callback The function called per iteration. - */ - function each(object, callback) { - var index = -1, - length = object.length; - - if (length == length >>> 0) { - while (++index < length) { - callback(object[index], index, object); - } - } else { - forOwn(object, callback); - } - } - - /** - * Trim and conditionally capitalize string values. - * - * @private - * @param {String} string The string to format. - * @returns {String} The formatted string. - */ - function format(string) { - string = trim(string); - return /^(?:webOS|i(?:OS|P))/.test(string) - ? string - : capitalize(string); - } - - /** - * Iterates over an object's own properties, executing the `callback` for each. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} callback The function executed per own property. - */ - function forOwn(object, callback) { - for (var key in object) { - hasKey(object, key) && callback(object[key], key, object); - } - } - - /** - * Gets the internal [[Class]] of a value. - * - * @private - * @param {Mixed} value The value. - * @returns {String} The [[Class]]. - */ - function getClassOf(value) { - return value == null - ? capitalize(value) - : toString.call(value).slice(8, -1); - } - - /** - * Checks if an object has the specified key as a direct property. - * - * @private - * @param {Object} object The object to check. - * @param {String} key The key to check for. - * @returns {Boolean} Returns `true` if key is a direct property, else `false`. - */ - function hasKey() { - // lazy define for others (not as accurate) - hasKey = function(object, key) { - var parent = object != null && (object.constructor || Object).prototype; - return !!parent && key in Object(object) && !(key in parent && object[key] === parent[key]); - }; - // for modern browsers - if (getClassOf(hasOwnProperty) == 'Function') { - hasKey = function(object, key) { - return object != null && hasOwnProperty.call(object, key); - }; - } - // for Safari 2 - else if ({}.__proto__ == Object.prototype) { - hasKey = function(object, key) { - var result = false; - if (object != null) { - object = Object(object); - object.__proto__ = [object.__proto__, object.__proto__ = null, result = key in object][0]; - } - return result; - }; - } - return hasKey.apply(this, arguments); - } - - /** - * Host objects can return type values that are different from their actual - * data type. The objects we are concerned with usually return non-primitive - * types of object, function, or unknown. - * - * @private - * @param {Mixed} object The owner of the property. - * @param {String} property The property to check. - * @returns {Boolean} Returns `true` if the property value is a non-primitive, else `false`. - */ - function isHostType(object, property) { - var type = object != null ? typeof object[property] : 'number'; - return !/^(?:boolean|number|string|undefined)$/.test(type) && - (type == 'object' ? !!object[property] : true); - } - - /** - * Prepares a string for use in a RegExp constructor by making hyphens and - * spaces optional. - * - * @private - * @param {String} string The string to qualify. - * @returns {String} The qualified string. - */ - function qualify(string) { - return String(string).replace(/([ -])(?!$)/g, '$1?'); - } - - /** - * A bare-bones` Array#reduce` like utility function. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} accumulator Initial value of the accumulator. - * @returns {Mixed} The accumulator. - */ - function reduce(array, callback) { - var accumulator = null; - each(array, function(value, index) { - accumulator = callback(accumulator, value, index, array); - }); - return accumulator; - } - - /** - * Removes leading and trailing whitespace from a string. - * - * @private - * @param {String} string The string to trim. - * @returns {String} The trimmed string. - */ - function trim(string) { - return String(string).replace(/^ +| +$/g, ''); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a new platform object. - * - * @memberOf platform - * @param {String} [ua = navigator.userAgent] The user agent string. - * @returns {Object} A platform object. - */ - function parse(ua) { - - ua || (ua = userAgent); - - /** Temporary variable used over the script's lifetime */ - var data; - - /** The CPU architecture */ - var arch = ua; - - /** Platform description array */ - var description = []; - - /** Platform alpha/beta indicator */ - var prerelease = null; - - /** A flag to indicate that environment features should be used to resolve the platform */ - var useFeatures = ua == userAgent; - - /** The browser/environment version */ - var version = useFeatures && opera && typeof opera.version == 'function' && opera.version(); - - /* Detectable layout engines (order is important) */ - var layout = getLayout([ - { 'label': 'WebKit', 'pattern': 'AppleWebKit' }, - 'iCab', - 'Presto', - 'NetFront', - 'Tasman', - 'Trident', - 'KHTML', - 'Gecko' - ]); - - /* Detectable browser names (order is important) */ - var name = getName([ - 'Adobe AIR', - 'Arora', - 'Avant Browser', - 'Camino', - 'Epiphany', - 'Fennec', - 'Flock', - 'Galeon', - 'GreenBrowser', - 'iCab', - 'Iceweasel', - 'Iron', - 'K-Meleon', - 'Konqueror', - 'Lunascape', - 'Maxthon', - 'Midori', - 'Nook Browser', - 'PhantomJS', - 'Raven', - 'Rekonq', - 'RockMelt', - 'SeaMonkey', - { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, - 'Sleipnir', - 'SlimBrowser', - 'Sunrise', - 'Swiftfox', - 'WebPositive', - 'Opera Mini', - 'Opera', - 'Chrome', - { 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' }, - { 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' }, - { 'label': 'IE', 'pattern': 'MSIE' }, - 'Safari' - ]); - - /* Detectable products (order is important) */ - var product = getProduct([ - 'BlackBerry', - { 'label': 'Galaxy S', 'pattern': 'GT-I9000' }, - { 'label': 'Galaxy S2', 'pattern': 'GT-I9100' }, - 'Google TV', - 'iPad', - 'iPod', - 'iPhone', - 'Kindle', - { 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, - 'Nook', - 'PlayBook', - 'PlayStation Vita', - 'TouchPad', - 'Transformer', - 'Xoom' - ]); - - /* Detectable manufacturers */ - var manufacturer = getManufacturer({ - 'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 }, - 'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 }, - 'Asus': { 'Transformer': 1 }, - 'Barnes & Noble': { 'Nook': 1 }, - 'BlackBerry': { 'PlayBook': 1 }, - 'Google': { 'Google TV': 1 }, - 'HP': { 'TouchPad': 1 }, - 'LG': { }, - 'Motorola': { 'Xoom': 1 }, - 'Nokia': { }, - 'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1 }, - 'Sony': { 'PlayStation Vita': 1 } - }); - - /* Detectable OSes (order is important) */ - var os = getOS([ - 'Android', - 'CentOS', - 'Debian', - 'Fedora', - 'FreeBSD', - 'Gentoo', - 'Haiku', - 'Kubuntu', - 'Linux Mint', - 'Red Hat', - 'SuSE', - 'Ubuntu', - 'Xubuntu', - 'Cygwin', - 'Symbian OS', - 'hpwOS', - 'webOS ', - 'webOS', - 'Tablet OS', - 'Linux', - 'Mac OS X', - 'Macintosh', - 'Mac', - 'Windows 98;', - 'Windows ' - ]); - - /*------------------------------------------------------------------------*/ - - /** - * Picks the layout engine from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected layout engine. - */ - function getLayout(guesses) { - return reduce(guesses, function(result, guess) { - return result || RegExp('\\b' + ( - guess.pattern || qualify(guess) - ) + '\\b', 'i').exec(ua) && (guess.label || guess); - }); - } - - /** - * Picks the manufacturer from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected manufacturer. - */ - function getManufacturer(guesses) { - return reduce(guesses, function(result, value, key) { - // lookup the manufacturer by product or scan the UA for the manufacturer - return result || ( - value[product] || - value[0/*Opera 9.25 fix*/, /^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || - RegExp('\\b' + (key.pattern || qualify(key)) + '(?:\\b|\\w*\\d)', 'i').exec(ua) - ) && (key.label || key); - }); - } - - /** - * Picks the browser name from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected browser name. - */ - function getName(guesses) { - return reduce(guesses, function(result, guess) { - return result || RegExp('\\b' + ( - guess.pattern || qualify(guess) - ) + '\\b', 'i').exec(ua) && (guess.label || guess); - }); - } - - /** - * Picks the OS name from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected OS name. - */ - function getOS(guesses) { - return reduce(guesses, function(result, guess) { - var pattern = guess.pattern || qualify(guess); - if (!result && (result = - RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua))) { - // platform tokens defined at - // http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx - // http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx - data = { - '6.2': '8', - '6.1': 'Server 2008 R2 / 7', - '6.0': 'Server 2008 / Vista', - '5.2': 'Server 2003 / XP 64-bit', - '5.1': 'XP', - '5.01': '2000 SP1', - '5.0': '2000', - '4.0': 'NT', - '4.90': 'ME' - }; - // detect Windows version from platform tokens - if (/^Win/i.test(result) && - (data = data[0/*Opera 9.25 fix*/, /[\d.]+$/.exec(result)])) { - result = 'Windows ' + data; - } - // correct character case and cleanup - result = format(String(result) - .replace(RegExp(pattern, 'i'), guess.label || guess) - .replace(/ ce$/i, ' CE') - .replace(/hpw/i, 'web') - .replace(/Macintosh/, 'Mac OS') - .replace(/_PowerPC/i, ' OS') - .replace(/(OS X) [^ \d]+/i, '$1') - .replace(/\/(\d)/, ' $1') - .replace(/_/g, '.') - .replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '') - .replace(/x86\.64/gi, 'x86_64') - .split(' on ')[0]); - } - return result; - }); - } - - /** - * Picks the product name from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected product name. - */ - function getProduct(guesses) { - return reduce(guesses, function(result, guess) { - var pattern = guess.pattern || qualify(guess); - if (!result && (result = - RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) || - RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua) - )) { - // split by forward slash and append product version if needed - if ((result = String(guess.label || result).split('/'))[1] && !/[\d.]+/.test(result[0])) { - result[0] += ' ' + result[1]; - } - // correct character case and cleanup - guess = guess.label || guess; - result = format(result[0] - .replace(RegExp(pattern, 'i'), guess) - .replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ') - .replace(RegExp('(' + guess + ')(\\w)', 'i'), '$1 $2')); - } - return result; - }); - } - - /** - * Resolves the version using an array of UA patterns. - * - * @private - * @param {Array} patterns An array of UA patterns. - * @returns {String|Null} The detected version. - */ - function getVersion(patterns) { - return reduce(patterns, function(result, pattern) { - return result || (RegExp(pattern + - '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null; - }); - } - - /*------------------------------------------------------------------------*/ - - /** - * Returns `platform.description` when the platform object is coerced to a string. - * - * @name toString - * @memberOf platform - * @returns {String} Returns `platform.description` if available, else an empty string. - */ - function toStringPlatform() { - return this.description || ''; - } - - /*------------------------------------------------------------------------*/ - - // convert layout to an array so we can add extra details - layout && (layout = [layout]); - - // detect product names that contain their manufacturer's name - if (manufacturer && !product) { - product = getProduct([manufacturer]); - } - // clean up Google TV - if ((data = /Google TV/.exec(product))) { - product = data[0]; - } - // detect simulators - if (/\bSimulator\b/i.test(ua)) { - product = (product ? product + ' ' : '') + 'Simulator'; - } - // detect iOS - if (/^iP/.test(product)) { - name || (name = 'Safari'); - os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua)) - ? ' ' + data[1].replace(/_/g, '.') - : ''); - } - // detect Kubuntu - else if (name == 'Konqueror' && !/buntu/i.test(os)) { - os = 'Kubuntu'; - } - // detect Android browsers - else if (manufacturer && manufacturer != 'Google' && - /Chrome|Vita/.test(name + ';' + product)) { - name = 'Android Browser'; - os = /Android/.test(os) ? os : 'Android'; - } - // detect false positives for Firefox/Safari - else if (!name || (data = !/\bMinefield\b/i.test(ua) && /Firefox|Safari/.exec(name))) { - // escape the `/` for Firefox 1 - if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) { - // clear name of false positives - name = null; - } - // reassign a generic name - if ((data = product || manufacturer || os) && - (product || manufacturer || /Android|Symbian OS|Tablet OS|webOS/.test(os))) { - name = /[a-z]+(?: Hat)?/i.exec(/Android/.test(os) ? os : data) + ' Browser'; - } - } - // detect non-Opera versions (order is important) - if (!version) { - version = getVersion([ - '(?:Cloud9|CriOS|CrMo|Opera ?Mini|Raven|Silk(?!/[\\d.]+$))', - 'Version', - qualify(name), - '(?:Firefox|Minefield|NetFront)' - ]); - } - // detect stubborn layout engines - if (layout == 'iCab' && parseFloat(version) > 3) { - layout = ['WebKit']; - } else if (data = - /Opera/.test(name) && 'Presto' || - /\b(?:Midori|Nook|Safari)\b/i.test(ua) && 'WebKit' || - !layout && /\bMSIE\b/i.test(ua) && (/^Mac/.test(os) ? 'Tasman' : 'Trident')) { - layout = [data]; - } - // leverage environment features - if (useFeatures) { - // detect server-side environments - // Rhino has a global function while others have a global object - if (isHostType(window, 'global')) { - if (java) { - data = java.lang.System; - arch = data.getProperty('os.arch'); - os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version'); - } - if (typeof exports == 'object' && exports) { - // if `thisBinding` is the [ModuleScope] - if (thisBinding == oldWin && typeof system == 'object' && (data = [system])[0]) { - os || (os = data[0].os || null); - try { - data[1] = require('ringo/engine').version; - version = data[1].join('.'); - name = 'RingoJS'; - } catch(e) { - if (data[0].global == freeGlobal) { - name = 'Narwhal'; - } - } - } else if (typeof process == 'object' && (data = process)) { - name = 'Node.js'; - arch = data.arch; - os = data.platform; - version = /[\d.]+/.exec(data.version)[0]; - } - } else if (getClassOf(window.environment) == 'Environment') { - name = 'Rhino'; - } - } - // detect Adobe AIR - else if (getClassOf(data = window.runtime) == 'ScriptBridgingProxyObject') { - name = 'Adobe AIR'; - os = data.flash.system.Capabilities.os; - } - // detect PhantomJS - else if (getClassOf(data = window.phantom) == 'RuntimeObject') { - name = 'PhantomJS'; - version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch); - } - // detect IE compatibility modes - else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) { - // we're in compatibility mode when the Trident version + 4 doesn't - // equal the document mode - version = [version, doc.documentMode]; - if ((data = +data[1] + 4) != version[1]) { - description.push('IE ' + version[1] + ' mode'); - layout[1] = ''; - version[1] = data; - } - version = name == 'IE' ? String(version[1].toFixed(1)) : version[0]; - } - os = os && format(os); - } - // detect prerelease phases - if (version && (data = - /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || - /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) || - /\bMinefield\b/i.test(ua) && 'a')) { - prerelease = /b/i.test(data) ? 'beta' : 'alpha'; - version = version.replace(RegExp(data + '\\+?$'), '') + - (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || ''); - } - // rename code name "Fennec" - if (name == 'Fennec') { - name = 'Firefox Mobile'; - } - // obscure Maxthon's unreliable version - else if (name == 'Maxthon' && version) { - version = version.replace(/\.[\d.]+/, '.x'); - } - // detect Silk desktop/accelerated modes - else if (name == 'Silk') { - if (!/Mobi/i.test(ua)) { - os = 'Android'; - description.unshift('desktop mode'); - } - if (/Accelerated *= *true/i.test(ua)) { - description.unshift('accelerated'); - } - } - // detect Windows Phone desktop mode - else if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) { - name += ' Mobile'; - os = 'Windows Phone OS ' + data + '.x'; - description.unshift('desktop mode'); - } - // add mobile postfix - else if ((name == 'IE' || name && !product && !/Browser|Mobi/.test(name)) && - (os == 'Windows CE' || /Mobi/i.test(ua))) { - name += ' Mobile'; - } - // detect IE platform preview - else if (name == 'IE' && useFeatures && typeof external == 'object' && !external) { - description.unshift('platform preview'); - } - // detect BlackBerry OS version - // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp - else if (/BlackBerry/.test(product) && (data = - (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] || - version)) { - os = 'Device Software ' + data; - version = null; - } - // detect Opera identifying/masking itself as another browser - // http://www.opera.com/support/kb/view/843/ - else if (this != forOwn && ( - (useFeatures && opera) || - (/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) || - (name == 'Firefox' && /OS X (?:\d+\.){2,}/.test(os)) || - (name == 'IE' && ( - (os && !/^Win/.test(os) && version > 5.5) || - /Windows XP/.test(os) && version > 8 || - version == 8 && !/Trident/.test(ua) - )) - ) && !reOpera.test(data = parse.call(forOwn, ua.replace(reOpera, '') + ';')) && data.name) { - - // when "indentifying", the UA contains both Opera and the other browser's name - data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : ''); - if (reOpera.test(name)) { - if (/IE/.test(data) && os == 'Mac OS') { - os = null; - } - data = 'identify' + data; - } - // when "masking", the UA contains only the other browser's name - else { - data = 'mask' + data; - if (operaClass) { - name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2')); - } else { - name = 'Opera'; - } - if (/IE/.test(data)) { - os = null; - } - if (!useFeatures) { - version = null; - } - } - layout = ['Presto']; - description.push(data); - } - // detect WebKit Nightly and approximate Chrome/Safari versions - if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { - // correct build for numeric comparison - // (e.g. "532.5" becomes "532.05") - data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data]; - // nightly builds are postfixed with a `+` - if (name == 'Safari' && data[1].slice(-1) == '+') { - name = 'WebKit Nightly'; - prerelease = 'alpha'; - version = data[1].slice(0, -1); - } - // clear incorrect browser versions - else if (version == data[1] || - version == (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1]) { - version = null; - } - // use the full Chrome version when available - data = [data[0], (/\bChrome\/([\d.]+)/i.exec(ua) || 0)[1]]; - - // detect JavaScriptCore - // http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi - if (!useFeatures || (/internal|\n/i.test(toString.toString()) && !data[1])) { - layout[1] = 'like Safari'; - data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : '5'); - } else { - layout[1] = 'like Chrome'; - data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : '21'); - } - // add the postfix of ".x" or "+" for approximate versions - layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'); - // obscure version for some Safari 1-2 releases - if (name == 'Safari' && (!version || parseInt(version) > 45)) { - version = data; - } - } - // detect Opera desktop modes - if (name == 'Opera' && (data = /(?:zbov|zvav)$/.exec(os))) { - name += ' '; - description.unshift('desktop mode'); - if (data == 'zvav') { - name += 'Mini'; - version = null; - } else { - name += 'Mobile'; - } - } - // detect Chrome desktop mode - else if (name == 'Safari' && /Chrome/.exec(layout[1])) { - description.unshift('desktop mode'); - name = 'Chrome Mobile'; - version = null; - - if (/Mac OS X/.test(os)) { - manufacturer = 'Apple'; - os = 'iOS 4.3+'; - } else { - os = null; - } - } - // strip incorrect OS versions - if (version && version.indexOf(data = /[\d.]+$/.exec(os)) == 0 && - ua.indexOf('/' + data + '-') > -1) { - os = trim(os.replace(data, '')); - } - // add layout engine - if (layout && !/Avant|Nook/.test(name) && ( - /Browser|Lunascape|Maxthon/.test(name) || - /^(?:Adobe|Arora|Midori|Phantom|Rekonq|Rock|Sleipnir|Web)/.test(name) && layout[1])) { - // don't add layout details to description if they are falsey - (data = layout[layout.length - 1]) && description.push(data); - } - // combine contextual information - if (description.length) { - description = ['(' + description.join('; ') + ')']; - } - // append manufacturer - if (manufacturer && product && product.indexOf(manufacturer) < 0) { - description.push('on ' + manufacturer); - } - // append product - if (product) { - description.push((/^on /.test(description[description.length -1]) ? '' : 'on ') + product); - } - // parse OS into an object - if (os) { - data = / ([\d.+]+)$/.exec(os); - os = { - 'architecture': 32, - 'family': data ? os.replace(data[0], '') : os, - 'version': data ? data[1] : null, - 'toString': function() { - var version = this.version; - return this.family + (version ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : ''); - } - }; - } - // add browser/OS architecture - if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) { - if (os) { - os.architecture = 64; - os.family = os.family.replace(RegExp(' *' + data), ''); - } - if (name && (/WOW64/i.test(ua) || - (useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform)))) { - description.unshift('32-bit'); - } - } - - ua || (ua = null); - - /*------------------------------------------------------------------------*/ - - /** - * The platform object. - * - * @name platform - * @type Object - */ - return { - - /** - * The browser/environment version. - * - * @memberOf platform - * @type String|Null - */ - 'version': name && version && (description.unshift(version), version), - - /** - * The name of the browser/environment. - * - * @memberOf platform - * @type String|Null - */ - 'name': name && (description.unshift(name), name), - - /** - * The name of the operating system. - * - * @memberOf platform - * @type Object - */ - 'os': os - ? (name && - !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product)) && - description.push(product ? '(' + os + ')' : 'on ' + os), os) - : { - - /** - * The CPU architecture the OS is built for. - * - * @memberOf platform.os - * @type Number|Null - */ - 'architecture': null, - - /** - * The family of the OS. - * - * @memberOf platform.os - * @type String|Null - */ - 'family': null, - - /** - * The version of the OS. - * - * @memberOf platform.os - * @type String|Null - */ - 'version': null, - - /** - * Returns the OS string. - * - * @memberOf platform.os - * @returns {String} The OS string. - */ - 'toString': function() { return 'null'; } - }, - - /** - * The platform description. - * - * @memberOf platform - * @type String|Null - */ - 'description': description.length ? description.join(' ') : ua, - - /** - * The name of the browser layout engine. - * - * @memberOf platform - * @type String|Null - */ - 'layout': layout && layout[0], - - /** - * The name of the product's manufacturer. - * - * @memberOf platform - * @type String|Null - */ - 'manufacturer': manufacturer, - - /** - * The alpha/beta release indicator. - * - * @memberOf platform - * @type String|Null - */ - 'prerelease': prerelease, - - /** - * The name of the product hosting the browser. - * - * @memberOf platform - * @type String|Null - */ - 'product': product, - - /** - * The browser's user agent string. - * - * @memberOf platform - * @type String|Null - */ - 'ua': ua, - - // parses a user agent string into a platform object - 'parse': parse, - - // returns the platform description - 'toString': toStringPlatform - }; - } - - /*--------------------------------------------------------------------------*/ - - // expose platform - // some AMD build optimizers, like r.js, check for specific condition patterns like the following: - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // define as an anonymous module so, through path mapping, it can be aliased - define(function() { - return parse(); - }); - } - // check for `exports` after `define` in case a build optimizer adds an `exports` object - else if (freeExports) { - // in Narwhal, Node.js, or RingoJS - forOwn(parse(), function(value, key) { - freeExports[key] = value; - }); - } - // in a browser or Rhino - else { - // use square bracket notation so Closure Compiler won't munge `platform` - // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export - window['platform'] = parse(); - } -}(this)); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/LICENSE.txt b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/LICENSE.txt deleted file mode 100644 index a7501f9..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2011-2013 John-David Dalton - -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/README.md deleted file mode 100644 index 7c2edfa..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# QUnit CLIB v1.2.0 -## command-line interface boilerplate - -QUnit CLIB helps extend QUnit's CLI support to many common CLI environments. - -## Screenshot - -![QUnit CLIB brings QUnit to your favorite shell.](http://i.imgur.com/jpu9l.png) - -## Support - -QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.19, Narwhal v0.3.2, PhantomJS 1.8.1, RingoJS v0.9, and Rhino v1.7RC5. - -## Usage - -```js -(function(window) { - - // use a single "load" function - var load = typeof require == 'function' ? require : window.load; - - // load QUnit and CLIB if needed - var QUnit = - window.QUnit || ( - window.addEventListener || (window.addEventListener = Function.prototype), - window.setTimeout || (window.setTimeout = Function.prototype), - window.QUnit = load('path/to/qunit.js') || window.QUnit, - load('path/to/qunit-clib.js'), - window.addEventListener === Function.prototype && delete window.addEventListener, - window.QUnit - ); - - // explicitly call `QUnit.module()` instead of `module()` - // in case we are in a CLI environment - QUnit.module('A Test Module'); - - test('A Test', function() { - // ... - }); - - // must call `QUnit.start()` if using QUnit < 1.3.0 with Node.js or any - // version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS - if (!window.document) { - QUnit.start(); - } -}(typeof global == 'object' && global || this)); -``` - -## Footnotes - - 1. QUnit v1.3.0 does not work with Narwhal or Ringo < v0.8.0 - - 2. Rhino v1.7RC4 does not support timeout fallbacks `clearTimeout` and `setTimeout` - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/qunit-clib.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/qunit-clib.js deleted file mode 100644 index 7174feb..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit-clib/qunit-clib.js +++ /dev/null @@ -1,269 +0,0 @@ -/*! - * QUnit CLI Boilerplate v1.2.0 - * Copyright 2011-2012 John-David Dalton - * Based on a gist by Jörn Zaefferer - * Available under MIT license - */ -;(function(window) { - 'use strict'; - - /** - * Timeout fallbacks based on the work of Andrea Giammarchi and Weston C. - * https://github.com/WebReflection/wru/blob/master/src/rhinoTimers.js - * http://stackoverflow.com/questions/2261705/how-to-run-a-javascript-function-asynchronously-without-using-settimeout - */ - (function() { - - /** - * Schedules timer-based callbacks. - * - * @private - * @param {Function|String} fn The function to call. - * @oaram {Number} delay The number of milliseconds to delay the `fn` call. - * @param [arg1, arg2, ...] Arguments to invoke `fn` with. - * @param {Boolean} repeated A flag to specify whether `fn` is called repeatedly. - * @returns {Number} The the ID of the timeout. - */ - function schedule(fn, delay, args, repeated) { - // Rhino 1.7RC4 will error assigning `task` below - // https://bugzilla.mozilla.org/show_bug.cgi?id=775566 - var task = ids[++counter] = new JavaAdapter(java.util.TimerTask, { - 'run': function() { - fn.apply(window, args); - } - }); - // support non-functions - if (typeof fn != 'function') { - fn = (function(code) { - code = String(code); - return function() { eval(code); }; - }(fn)); - } - // used by setInterval - if (repeated) { - timer.schedule(task, delay, delay); - } - // used by setTimeout - else { - timer.schedule(task, delay); - } - return counter; - } - - /** - * Clears the delay set by `setInterval` or `setTimeout`. - * - * @memberOf window - * @param {Number} id The ID of the timeout to be cleared. - */ - function clearTimer(id) { - if (ids[id]) { - ids[id].cancel(); - timer.purge(); - delete ids[id]; - } - } - - /** - * Executes a code snippet or function repeatedly, with a delay between each call. - * - * @memberOf window - * @param {Function|String} fn The function to call or string to evaluate. - * @oaram {Number} delay The number of milliseconds to delay each `fn` call. - * @param [arg1, arg2, ...] Arguments to invoke `fn` with. - * @returns {Number} The the ID of the timeout. - */ - function setInterval(fn, delay) { - return schedule(fn, delay, slice.call(arguments, 2), true); - } - - /** - * Executes a code snippet or a function after specified delay. - * - * @memberOf window - * @param {Function|String} fn The function to call or string to evaluate. - * @oaram {Number} delay The number of milliseconds to delay the `fn` call. - * @param [arg1, arg2, ...] Arguments to invoke `fn` with. - * @returns {Number} The the ID of the timeout. - */ - function setTimeout(fn, delay) { - return schedule(fn, delay, slice.call(arguments, 2)); - } - - try { - var counter = 0, - ids = {}, - slice = Array.prototype.slice, - timer = new java.util.Timer; - - window.clearInterval = - window.clearTimeout = clearTimer; - window.setInterval = setInterval; - window.setTimeout = setTimeout; - } catch(e) { } - }()); - - /*--------------------------------------------------------------------------*/ - - (function() { - - /** Used as a horizontal rule in console output */ - var hr = '----------------------------------------'; - - /** Shorten `window.QUnit.QUnit` to `window.QUnit` */ - window.QUnit && (QUnit = QUnit.QUnit || QUnit); - - /** - * A logging callback triggered when all testing is completed. - * - * @memberOf QUnit - * @param {Object} details An object with properties `failed`, `passed`, `runtime`, and `total`. - */ - QUnit.done(function() { - var ran; - return function(details) { - // stop `asyncTest()` from erroneously calling `done()` twice in - // environments w/o timeouts - if (ran) { - return; - } - ran = true; - - console.log(hr); - console.log(' PASS: ' + details.passed + ' FAIL: ' + details.failed + ' TOTAL: ' + details.total); - console.log(' Finished in ' + details.runtime + ' milliseconds.'); - console.log(hr); - - // exit out of Rhino - try { - quit(); - } catch(e) { } - - // exit out of Node.js or PhantomJS - try { - var process = window.process || window.phantom; - if (details.failed) { - console.error('Error: ' + details.failed + ' of ' + details.total + ' tests failed.'); - process.exit(1); - } else { - process.exit(0); - } - } catch(e) { } - }; - }()); - - /** - * A logging callback triggered after every assertion. - * - * @memberOf QUnit - * @param {Object} details An object with properties `actual`, `expected`, `message`, and `result`. - */ - QUnit.log(function(details) { - var expected = details.expected, - result = details.result, - type = typeof expected != 'undefined' ? 'EQ' : 'OK'; - - var assertion = [ - result ? 'PASS' : 'FAIL', - type, - details.message || 'ok' - ]; - - if (!result && type == 'EQ') { - assertion.push('Expected: ' + expected + ', Actual: ' + details.actual); - } - QUnit.config.testStats.assertions.push(assertion.join(' | ')); - }); - - /** - * A logging callback triggered at the start of every test module. - * - * @memberOf QUnit - * @param {Object} details An object with property `name`. - */ - QUnit.moduleStart(function(details) { - console.log(hr); - console.log(details.name); - console.log(hr); - }); - - /** - * Converts an object into a string representation. - * - * @memberOf QUnit - * @type Function - * @param {Object} object The object to stringify. - * @returns {String} The result string. - */ - QUnit.jsDump.parsers.object = (function() { - var func = QUnit.jsDump.parsers.object; - return function(object) { - // fork to support Rhino's error objects - if (typeof object.rhinoException == 'object') { - return object.name + - ' { message: "' + object.message + - '", fileName: "' + object.fileName + - '", lineNumber: ' + object.lineNumber + ' }'; - } - return func(object); - }; - }()); - - /** - * A logging callback triggered after a test is completed. - * - * @memberOf QUnit - * @param {Object} details An object with properties `failed`, `name`, `passed`, and `total`. - */ - QUnit.testDone(function(details) { - var assertions = QUnit.config.testStats.assertions, - testName = details.name; - - if (details.failed > 0) { - console.log(' FAIL - '+ testName); - assertions.forEach(function(value) { - console.log(' ' + value); - }); - } - else { - console.log(' PASS - ' + testName); - } - assertions.length = 0; - }); - - /** - * An object used to hold information about the current running test. - * - * @memberOf QUnit.config - * @type Object - */ - QUnit.config.testStats = { - - /** - * An array of test summaries (pipe separated). - * - * @memberOf QUnit.config.testStats - * @type Array - */ - 'assertions': [] - }; - }()); - - /*--------------------------------------------------------------------------*/ - - // expose shortcuts - // exclude `module` because some environments have it as a built-in object - ('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' + - 'ok raises same start stop strictEqual test throws').replace(/\S+/g, function(methodName) { - window[methodName] = QUnit[methodName]; - }); - - // add `console.log()` support for Narwhal, Rhino, and RingoJS - if (!window.console && window.print) { - window.console = { 'log': window.print }; - } - // must call `QUnit.start()` in the test file if using QUnit < 1.3.0 with - // Node.js or any version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS - QUnit.init(); - -}(typeof global == 'object' && global || this)); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit/README.md deleted file mode 100644 index 6ab73f5..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit/README.md +++ /dev/null @@ -1,62 +0,0 @@ -[QUnit](http://qunitjs.com) - A JavaScript Unit Testing framework. -================================ - -QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery -project to test its code and plugins but is capable of testing any generic -JavaScript code (and even capable of testing JavaScript code on the server-side). - -QUnit is especially useful for regression testing: Whenever a bug is reported, -write a test that asserts the existence of that particular bug. Then fix it and -commit both. Every time you work on the code again, run the tests. If the bug -comes up again - a regression - you'll spot it immediately and know how to fix -it, because you know what code you just changed. - -Having good unit test coverage makes safe refactoring easy and cheap. You can -run the tests after each small refactoring step and always know what change -broke something. - -QUnit is similar to other unit testing frameworks like JUnit, but makes use of -the features JavaScript provides and helps with testing code in the browser, e.g. -with its stop/start facilities for testing asynchronous code. - -If you are interested in helping developing QUnit, you are in the right place. -For related discussions, visit the -[QUnit and Testing forum](http://forum.jquery.com/qunit-and-testing). - -Development ------------ - -To submit patches, fork the repository, create a branch for the change. Then implement -the change, run `grunt` to lint and test it, then commit, push and create a pull request. - -Include some background for the change in the commit message and `Fixes #nnn`, referring -to the issue number you're addressing. - -To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`. That gives you a global -grunt binary. For additional grunt tasks, also run `npm install`. - -Releases --------- - -Install git-extras and run `git changelog` to update History.md. -Update qunit/qunit.js|css and package.json to the release version, commit and -tag, update them again to the next version, commit and push commits and tags -(`git push --tags origin master`). - -Put the 'v' in front of the tag, e.g. `v1.8.0`. Clean up the changelog, removing merge commits -or whitespace cleanups. - -To upload to code.jquery.com (replace $version accordingly), ssh to code.origin.jquery.com: - - cp qunit/qunit.js /var/www/html/code.jquery.com/qunit/qunit-$version.js - cp qunit/qunit.css /var/www/html/code.jquery.com/qunit/qunit-$version.css - -Then update /var/www/html/code.jquery.com/index.html and purge it with: - - curl -s http://code.origin.jquery.com/?reload - -Update web-base-template to link to those files for qunitjs.com. - -Publish to npm via - - npm publish diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit/qunit/qunit.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit/qunit/qunit.js deleted file mode 100644 index 302545f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/qunit/qunit/qunit.js +++ /dev/null @@ -1,2152 +0,0 @@ -/** - * QUnit v1.11.0 - A JavaScript Unit Testing Framework - * - * http://qunitjs.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -(function( window ) { - -var QUnit, - assert, - config, - onErrorFnPrev, - testId = 0, - fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - // Keep a local reference to Date (GH-283) - Date = window.Date, - defined = { - setTimeout: typeof window.setTimeout !== "undefined", - sessionStorage: (function() { - var x = "qunit-test-string"; - try { - sessionStorage.setItem( x, x ); - sessionStorage.removeItem( x ); - return true; - } catch( e ) { - return false; - } - }()) - }, - /** - * Provides a normalized error string, correcting an issue - * with IE 7 (and prior) where Error.prototype.toString is - * not properly implemented - * - * Based on http://es5.github.com/#x15.11.4.4 - * - * @param {String|Error} error - * @return {String} error message - */ - errorString = function( error ) { - var name, message, - errorString = error.toString(); - if ( errorString.substring( 0, 7 ) === "[object" ) { - name = error.name ? error.name.toString() : "Error"; - message = error.message ? error.message.toString() : ""; - if ( name && message ) { - return name + ": " + message; - } else if ( name ) { - return name; - } else if ( message ) { - return message; - } else { - return "Error"; - } - } else { - return errorString; - } - }, - /** - * Makes a clone of an object using only Array or Object as base, - * and copies over the own enumerable properties. - * - * @param {Object} obj - * @return {Object} New object with only the own properties (recursively). - */ - objectValues = function( obj ) { - // Grunt 0.3.x uses an older version of jshint that still has jshint/jshint#392. - /*jshint newcap: false */ - var key, val, - vals = QUnit.is( "array", obj ) ? [] : {}; - for ( key in obj ) { - if ( hasOwn.call( obj, key ) ) { - val = obj[key]; - vals[key] = val === Object(val) ? objectValues(val) : val; - } - } - return vals; - }; - -function Test( settings ) { - extend( this, settings ); - this.assertions = []; - this.testNumber = ++Test.count; -} - -Test.count = 0; - -Test.prototype = { - init: function() { - var a, b, li, - tests = id( "qunit-tests" ); - - if ( tests ) { - b = document.createElement( "strong" ); - b.innerHTML = this.nameHtml; - - // `a` initialized at top of scope - a = document.createElement( "a" ); - a.innerHTML = "Rerun"; - a.href = QUnit.url({ testNumber: this.testNumber }); - - li = document.createElement( "li" ); - li.appendChild( b ); - li.appendChild( a ); - li.className = "running"; - li.id = this.id = "qunit-test-output" + testId++; - - tests.appendChild( li ); - } - }, - setup: function() { - if ( this.module !== config.previousModule ) { - if ( config.previousModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.previousModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - config.previousModule = this.module; - config.moduleStats = { all: 0, bad: 0 }; - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } else if ( config.autorun ) { - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } - - config.current = this; - - this.testEnvironment = extend({ - setup: function() {}, - teardown: function() {} - }, this.moduleTestEnvironment ); - - this.started = +new Date(); - runLoggingCallbacks( "testStart", QUnit, { - name: this.testName, - module: this.module - }); - - // allow utility functions to access the current test environment - // TODO why?? - QUnit.current_testEnvironment = this.testEnvironment; - - if ( !config.pollution ) { - saveGlobal(); - } - if ( config.notrycatch ) { - this.testEnvironment.setup.call( this.testEnvironment ); - return; - } - try { - this.testEnvironment.setup.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); - } - }, - run: function() { - config.current = this; - - var running = id( "qunit-testresult" ); - - if ( running ) { - running.innerHTML = "Running:
        " + this.nameHtml; - } - - if ( this.async ) { - QUnit.stop(); - } - - this.callbackStarted = +new Date(); - - if ( config.notrycatch ) { - this.callback.call( this.testEnvironment, QUnit.assert ); - this.callbackRuntime = +new Date() - this.callbackStarted; - return; - } - - try { - this.callback.call( this.testEnvironment, QUnit.assert ); - this.callbackRuntime = +new Date() - this.callbackStarted; - } catch( e ) { - this.callbackRuntime = +new Date() - this.callbackStarted; - - QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) ); - // else next test will carry the responsibility - saveGlobal(); - - // Restart the tests if they're blocking - if ( config.blocking ) { - QUnit.start(); - } - } - }, - teardown: function() { - config.current = this; - if ( config.notrycatch ) { - if ( typeof this.callbackRuntime === "undefined" ) { - this.callbackRuntime = +new Date() - this.callbackStarted; - } - this.testEnvironment.teardown.call( this.testEnvironment ); - return; - } else { - try { - this.testEnvironment.teardown.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); - } - } - checkPollution(); - }, - finish: function() { - config.current = this; - if ( config.requireExpects && this.expected === null ) { - QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); - } else if ( this.expected !== null && this.expected !== this.assertions.length ) { - QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); - } else if ( this.expected === null && !this.assertions.length ) { - QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); - } - - var i, assertion, a, b, time, li, ol, - test = this, - good = 0, - bad = 0, - tests = id( "qunit-tests" ); - - this.runtime = +new Date() - this.started; - config.stats.all += this.assertions.length; - config.moduleStats.all += this.assertions.length; - - if ( tests ) { - ol = document.createElement( "ol" ); - ol.className = "qunit-assert-list"; - - for ( i = 0; i < this.assertions.length; i++ ) { - assertion = this.assertions[i]; - - li = document.createElement( "li" ); - li.className = assertion.result ? "pass" : "fail"; - li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); - ol.appendChild( li ); - - if ( assertion.result ) { - good++; - } else { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - - // store result when possible - if ( QUnit.config.reorder && defined.sessionStorage ) { - if ( bad ) { - sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); - } else { - sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); - } - } - - if ( bad === 0 ) { - addClass( ol, "qunit-collapsed" ); - } - - // `b` initialized at top of scope - b = document.createElement( "strong" ); - b.innerHTML = this.nameHtml + " (" + bad + ", " + good + ", " + this.assertions.length + ")"; - - addEvent(b, "click", function() { - var next = b.parentNode.lastChild, - collapsed = hasClass( next, "qunit-collapsed" ); - ( collapsed ? removeClass : addClass )( next, "qunit-collapsed" ); - }); - - addEvent(b, "dblclick", function( e ) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) { - target = target.parentNode; - } - if ( window.location && target.nodeName.toLowerCase() === "strong" ) { - window.location = QUnit.url({ testNumber: test.testNumber }); - } - }); - - // `time` initialized at top of scope - time = document.createElement( "span" ); - time.className = "runtime"; - time.innerHTML = this.runtime + " ms"; - - // `li` initialized at top of scope - li = id( this.id ); - li.className = bad ? "fail" : "pass"; - li.removeChild( li.firstChild ); - a = li.firstChild; - li.appendChild( b ); - li.appendChild( a ); - li.appendChild( time ); - li.appendChild( ol ); - - } else { - for ( i = 0; i < this.assertions.length; i++ ) { - if ( !this.assertions[i].result ) { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - } - - runLoggingCallbacks( "testDone", QUnit, { - name: this.testName, - module: this.module, - failed: bad, - passed: this.assertions.length - bad, - total: this.assertions.length, - duration: this.runtime - }); - - QUnit.reset(); - - config.current = undefined; - }, - - queue: function() { - var bad, - test = this; - - synchronize(function() { - test.init(); - }); - function run() { - // each of these can by async - synchronize(function() { - test.setup(); - }); - synchronize(function() { - test.run(); - }); - synchronize(function() { - test.teardown(); - }); - synchronize(function() { - test.finish(); - }); - } - - // `bad` initialized at top of scope - // defer when previous test run passed, if storage is available - bad = QUnit.config.reorder && defined.sessionStorage && - +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); - - if ( bad ) { - run(); - } else { - synchronize( run, true ); - } - } -}; - -// Root QUnit object. -// `QUnit` initialized at top of scope -QUnit = { - - // call on start of module test to prepend name to all tests - module: function( name, testEnvironment ) { - config.currentModule = name; - config.currentModuleTestEnvironment = testEnvironment; - config.modules[name] = true; - }, - - asyncTest: function( testName, expected, callback ) { - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - QUnit.test( testName, expected, callback, true ); - }, - - test: function( testName, expected, callback, async ) { - var test, - nameHtml = "" + escapeText( testName ) + ""; - - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - if ( config.currentModule ) { - nameHtml = "" + escapeText( config.currentModule ) + ": " + nameHtml; - } - - test = new Test({ - nameHtml: nameHtml, - testName: testName, - expected: expected, - async: async, - callback: callback, - module: config.currentModule, - moduleTestEnvironment: config.currentModuleTestEnvironment, - stack: sourceFromStacktrace( 2 ) - }); - - if ( !validTest( test ) ) { - return; - } - - test.queue(); - }, - - // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. - expect: function( asserts ) { - if (arguments.length === 1) { - config.current.expected = asserts; - } else { - return config.current.expected; - } - }, - - start: function( count ) { - // QUnit hasn't been initialized yet. - // Note: RequireJS (et al) may delay onLoad - if ( config.semaphore === undefined ) { - QUnit.begin(function() { - // This is triggered at the top of QUnit.load, push start() to the event loop, to allow QUnit.load to finish first - setTimeout(function() { - QUnit.start( count ); - }); - }); - return; - } - - config.semaphore -= count || 1; - // don't start until equal number of stop-calls - if ( config.semaphore > 0 ) { - return; - } - // ignore if start is called more often then stop - if ( config.semaphore < 0 ) { - config.semaphore = 0; - QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)", null, sourceFromStacktrace(2) ); - return; - } - // A slight delay, to avoid any current callbacks - if ( defined.setTimeout ) { - window.setTimeout(function() { - if ( config.semaphore > 0 ) { - return; - } - if ( config.timeout ) { - clearTimeout( config.timeout ); - } - - config.blocking = false; - process( true ); - }, 13); - } else { - config.blocking = false; - process( true ); - } - }, - - stop: function( count ) { - config.semaphore += count || 1; - config.blocking = true; - - if ( config.testTimeout && defined.setTimeout ) { - clearTimeout( config.timeout ); - config.timeout = window.setTimeout(function() { - QUnit.ok( false, "Test timed out" ); - config.semaphore = 1; - QUnit.start(); - }, config.testTimeout ); - } - } -}; - -// `assert` initialized at top of scope -// Asssert helpers -// All of these must either call QUnit.push() or manually do: -// - runLoggingCallbacks( "log", .. ); -// - config.current.assertions.push({ .. }); -// We attach it to the QUnit object *after* we expose the public API, -// otherwise `assert` will become a global variable in browsers (#341). -assert = { - /** - * Asserts rough true-ish result. - * @name ok - * @function - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); - */ - ok: function( result, msg ) { - if ( !config.current ) { - throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - result = !!result; - - var source, - details = { - module: config.current.module, - name: config.current.testName, - result: result, - message: msg - }; - - msg = escapeText( msg || (result ? "okay" : "failed" ) ); - msg = "" + msg + ""; - - if ( !result ) { - source = sourceFromStacktrace( 2 ); - if ( source ) { - details.source = source; - msg += "
        Source:
        " + escapeText( source ) + "
        "; - } - } - runLoggingCallbacks( "log", QUnit, details ); - config.current.assertions.push({ - result: result, - message: msg - }); - }, - - /** - * Assert that the first two arguments are equal, with an optional message. - * Prints out both actual and expected values. - * @name equal - * @function - * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); - */ - equal: function( actual, expected, message ) { - /*jshint eqeqeq:false */ - QUnit.push( expected == actual, actual, expected, message ); - }, - - /** - * @name notEqual - * @function - */ - notEqual: function( actual, expected, message ) { - /*jshint eqeqeq:false */ - QUnit.push( expected != actual, actual, expected, message ); - }, - - /** - * @name propEqual - * @function - */ - propEqual: function( actual, expected, message ) { - actual = objectValues(actual); - expected = objectValues(expected); - QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name notPropEqual - * @function - */ - notPropEqual: function( actual, expected, message ) { - actual = objectValues(actual); - expected = objectValues(expected); - QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name deepEqual - * @function - */ - deepEqual: function( actual, expected, message ) { - QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name notDeepEqual - * @function - */ - notDeepEqual: function( actual, expected, message ) { - QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name strictEqual - * @function - */ - strictEqual: function( actual, expected, message ) { - QUnit.push( expected === actual, actual, expected, message ); - }, - - /** - * @name notStrictEqual - * @function - */ - notStrictEqual: function( actual, expected, message ) { - QUnit.push( expected !== actual, actual, expected, message ); - }, - - "throws": function( block, expected, message ) { - var actual, - expectedOutput = expected, - ok = false; - - // 'expected' is optional - if ( typeof expected === "string" ) { - message = expected; - expected = null; - } - - config.current.ignoreGlobalErrors = true; - try { - block.call( config.current.testEnvironment ); - } catch (e) { - actual = e; - } - config.current.ignoreGlobalErrors = false; - - if ( actual ) { - // we don't want to validate thrown error - if ( !expected ) { - ok = true; - expectedOutput = null; - // expected is a regexp - } else if ( QUnit.objectType( expected ) === "regexp" ) { - ok = expected.test( errorString( actual ) ); - // expected is a constructor - } else if ( actual instanceof expected ) { - ok = true; - // expected is a validation function which returns true is validation passed - } else if ( expected.call( {}, actual ) === true ) { - expectedOutput = null; - ok = true; - } - - QUnit.push( ok, actual, expectedOutput, message ); - } else { - QUnit.pushFailure( message, null, 'No exception was thrown.' ); - } - } -}; - -/** - * @deprecate since 1.8.0 - * Kept assertion helpers in root for backwards compatibility. - */ -extend( QUnit, assert ); - -/** - * @deprecated since 1.9.0 - * Kept root "raises()" for backwards compatibility. - * (Note that we don't introduce assert.raises). - */ -QUnit.raises = assert[ "throws" ]; - -/** - * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 - * Kept to avoid TypeErrors for undefined methods. - */ -QUnit.equals = function() { - QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); -}; -QUnit.same = function() { - QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); -}; - -// We want access to the constructor's prototype -(function() { - function F() {} - F.prototype = QUnit; - QUnit = new F(); - // Make F QUnit's constructor so that we can add to the prototype later - QUnit.constructor = F; -}()); - -/** - * Config object: Maintain internal state - * Later exposed as QUnit.config - * `config` initialized at top of scope - */ -config = { - // The queue of tests to run - queue: [], - - // block until document ready - blocking: true, - - // when enabled, show only failing tests - // gets persisted through sessionStorage and can be changed in UI via checkbox - hidepassed: false, - - // by default, run previously failed tests first - // very useful in combination with "Hide passed tests" checked - reorder: true, - - // by default, modify document.title when suite is done - altertitle: true, - - // when enabled, all tests must call expect() - requireExpects: false, - - // add checkboxes that are persisted in the query-string - // when enabled, the id is set to `true` as a `QUnit.config` property - urlConfig: [ - { - id: "noglobals", - label: "Check for Globals", - tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." - }, - { - id: "notrycatch", - label: "No try-catch", - tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." - } - ], - - // Set of all modules. - modules: {}, - - // logging callback queues - begin: [], - done: [], - log: [], - testStart: [], - testDone: [], - moduleStart: [], - moduleDone: [] -}; - -// Export global variables, unless an 'exports' object exists, -// in that case we assume we're in CommonJS (dealt with on the bottom of the script) -if ( typeof exports === "undefined" ) { - extend( window, QUnit ); - - // Expose QUnit object - window.QUnit = QUnit; -} - -// Initialize more QUnit.config and QUnit.urlParams -(function() { - var i, - location = window.location || { search: "", protocol: "file:" }, - params = location.search.slice( 1 ).split( "&" ), - length = params.length, - urlParams = {}, - current; - - if ( params[ 0 ] ) { - for ( i = 0; i < length; i++ ) { - current = params[ i ].split( "=" ); - current[ 0 ] = decodeURIComponent( current[ 0 ] ); - // allow just a key to turn on a flag, e.g., test.html?noglobals - current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; - urlParams[ current[ 0 ] ] = current[ 1 ]; - } - } - - QUnit.urlParams = urlParams; - - // String search anywhere in moduleName+testName - config.filter = urlParams.filter; - - // Exact match of the module name - config.module = urlParams.module; - - config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; - - // Figure out if we're running the tests from a server or not - QUnit.isLocal = location.protocol === "file:"; -}()); - -// Extend QUnit object, -// these after set here because they should not be exposed as global functions -extend( QUnit, { - assert: assert, - - config: config, - - // Initialize the configuration options - init: function() { - extend( config, { - stats: { all: 0, bad: 0 }, - moduleStats: { all: 0, bad: 0 }, - started: +new Date(), - updateRate: 1000, - blocking: false, - autostart: true, - autorun: false, - filter: "", - queue: [], - semaphore: 1 - }); - - var tests, banner, result, - qunit = id( "qunit" ); - - if ( qunit ) { - qunit.innerHTML = - "

        " + escapeText( document.title ) + "

        " + - "

        " + - "
        " + - "

        " + - "
          "; - } - - tests = id( "qunit-tests" ); - banner = id( "qunit-banner" ); - result = id( "qunit-testresult" ); - - if ( tests ) { - tests.innerHTML = ""; - } - - if ( banner ) { - banner.className = ""; - } - - if ( result ) { - result.parentNode.removeChild( result ); - } - - if ( tests ) { - result = document.createElement( "p" ); - result.id = "qunit-testresult"; - result.className = "result"; - tests.parentNode.insertBefore( result, tests ); - result.innerHTML = "Running...
           "; - } - }, - - // Resets the test setup. Useful for tests that modify the DOM. - reset: function() { - var fixture = id( "qunit-fixture" ); - if ( fixture ) { - fixture.innerHTML = config.fixture; - } - }, - - // Trigger an event on an element. - // @example triggerEvent( document.body, "click" ); - triggerEvent: function( elem, type, event ) { - if ( document.createEvent ) { - event = document.createEvent( "MouseEvents" ); - event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, - 0, 0, 0, 0, 0, false, false, false, false, 0, null); - - elem.dispatchEvent( event ); - } else if ( elem.fireEvent ) { - elem.fireEvent( "on" + type ); - } - }, - - // Safe object type checking - is: function( type, obj ) { - return QUnit.objectType( obj ) === type; - }, - - objectType: function( obj ) { - if ( typeof obj === "undefined" ) { - return "undefined"; - // consider: typeof null === object - } - if ( obj === null ) { - return "null"; - } - - var match = toString.call( obj ).match(/^\[object\s(.*)\]$/), - type = match && match[1] || ""; - - switch ( type ) { - case "Number": - if ( isNaN(obj) ) { - return "nan"; - } - return "number"; - case "String": - case "Boolean": - case "Array": - case "Date": - case "RegExp": - case "Function": - return type.toLowerCase(); - } - if ( typeof obj === "object" ) { - return "object"; - } - return undefined; - }, - - push: function( result, actual, expected, message ) { - if ( !config.current ) { - throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); - } - - var output, source, - details = { - module: config.current.module, - name: config.current.testName, - result: result, - message: message, - actual: actual, - expected: expected - }; - - message = escapeText( message ) || ( result ? "okay" : "failed" ); - message = "" + message + ""; - output = message; - - if ( !result ) { - expected = escapeText( QUnit.jsDump.parse(expected) ); - actual = escapeText( QUnit.jsDump.parse(actual) ); - output += ""; - - if ( actual !== expected ) { - output += ""; - output += ""; - } - - source = sourceFromStacktrace(); - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
          Expected:
          " + expected + "
          Result:
          " + actual + "
          Diff:
          " + QUnit.diff( expected, actual ) + "
          Source:
          " + escapeText( source ) + "
          "; - } - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: !!result, - message: output - }); - }, - - pushFailure: function( message, source, actual ) { - if ( !config.current ) { - throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - - var output, - details = { - module: config.current.module, - name: config.current.testName, - result: false, - message: message - }; - - message = escapeText( message ) || "error"; - message = "" + message + ""; - output = message; - - output += ""; - - if ( actual ) { - output += ""; - } - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
          Result:
          " + escapeText( actual ) + "
          Source:
          " + escapeText( source ) + "
          "; - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: false, - message: output - }); - }, - - url: function( params ) { - params = extend( extend( {}, QUnit.urlParams ), params ); - var key, - querystring = "?"; - - for ( key in params ) { - if ( !hasOwn.call( params, key ) ) { - continue; - } - querystring += encodeURIComponent( key ) + "=" + - encodeURIComponent( params[ key ] ) + "&"; - } - return window.location.protocol + "//" + window.location.host + - window.location.pathname + querystring.slice( 0, -1 ); - }, - - extend: extend, - id: id, - addEvent: addEvent - // load, equiv, jsDump, diff: Attached later -}); - -/** - * @deprecated: Created for backwards compatibility with test runner that set the hook function - * into QUnit.{hook}, instead of invoking it and passing the hook function. - * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. - * Doing this allows us to tell if the following methods have been overwritten on the actual - * QUnit object. - */ -extend( QUnit.constructor.prototype, { - - // Logging callbacks; all receive a single argument with the listed properties - // run test/logs.html for any related changes - begin: registerLoggingCallback( "begin" ), - - // done: { failed, passed, total, runtime } - done: registerLoggingCallback( "done" ), - - // log: { result, actual, expected, message } - log: registerLoggingCallback( "log" ), - - // testStart: { name } - testStart: registerLoggingCallback( "testStart" ), - - // testDone: { name, failed, passed, total, duration } - testDone: registerLoggingCallback( "testDone" ), - - // moduleStart: { name } - moduleStart: registerLoggingCallback( "moduleStart" ), - - // moduleDone: { name, failed, passed, total } - moduleDone: registerLoggingCallback( "moduleDone" ) -}); - -if ( typeof document === "undefined" || document.readyState === "complete" ) { - config.autorun = true; -} - -QUnit.load = function() { - runLoggingCallbacks( "begin", QUnit, {} ); - - // Initialize the config, saving the execution queue - var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, - urlConfigCheckboxesContainer, urlConfigCheckboxes, moduleFilter, - numModules = 0, - moduleFilterHtml = "", - urlConfigHtml = "", - oldconfig = extend( {}, config ); - - QUnit.init(); - extend(config, oldconfig); - - config.blocking = false; - - len = config.urlConfig.length; - - for ( i = 0; i < len; i++ ) { - val = config.urlConfig[i]; - if ( typeof val === "string" ) { - val = { - id: val, - label: val, - tooltip: "[no tooltip available]" - }; - } - config[ val.id ] = QUnit.urlParams[ val.id ]; - urlConfigHtml += ""; - } - - moduleFilterHtml += ""; - - // `userAgent` initialized at top of scope - userAgent = id( "qunit-userAgent" ); - if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; - } - - // `banner` initialized at top of scope - banner = id( "qunit-header" ); - if ( banner ) { - banner.innerHTML = "" + banner.innerHTML + " "; - } - - // `toolbar` initialized at top of scope - toolbar = id( "qunit-testrunner-toolbar" ); - if ( toolbar ) { - // `filter` initialized at top of scope - filter = document.createElement( "input" ); - filter.type = "checkbox"; - filter.id = "qunit-filter-pass"; - - addEvent( filter, "click", function() { - var tmp, - ol = document.getElementById( "qunit-tests" ); - - if ( filter.checked ) { - ol.className = ol.className + " hidepass"; - } else { - tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; - ol.className = tmp.replace( / hidepass /, " " ); - } - if ( defined.sessionStorage ) { - if (filter.checked) { - sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); - } else { - sessionStorage.removeItem( "qunit-filter-passed-tests" ); - } - } - }); - - if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { - filter.checked = true; - // `ol` initialized at top of scope - ol = document.getElementById( "qunit-tests" ); - ol.className = ol.className + " hidepass"; - } - toolbar.appendChild( filter ); - - // `label` initialized at top of scope - label = document.createElement( "label" ); - label.setAttribute( "for", "qunit-filter-pass" ); - label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." ); - label.innerHTML = "Hide passed tests"; - toolbar.appendChild( label ); - - urlConfigCheckboxesContainer = document.createElement("span"); - urlConfigCheckboxesContainer.innerHTML = urlConfigHtml; - urlConfigCheckboxes = urlConfigCheckboxesContainer.getElementsByTagName("input"); - // For oldIE support: - // * Add handlers to the individual elements instead of the container - // * Use "click" instead of "change" - // * Fallback from event.target to event.srcElement - addEvents( urlConfigCheckboxes, "click", function( event ) { - var params = {}, - target = event.target || event.srcElement; - params[ target.name ] = target.checked ? true : undefined; - window.location = QUnit.url( params ); - }); - toolbar.appendChild( urlConfigCheckboxesContainer ); - - if (numModules > 1) { - moduleFilter = document.createElement( 'span' ); - moduleFilter.setAttribute( 'id', 'qunit-modulefilter-container' ); - moduleFilter.innerHTML = moduleFilterHtml; - addEvent( moduleFilter.lastChild, "change", function() { - var selectBox = moduleFilter.getElementsByTagName("select")[0], - selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value); - - window.location = QUnit.url( { module: ( selectedModule === "" ) ? undefined : selectedModule } ); - }); - toolbar.appendChild(moduleFilter); - } - } - - // `main` initialized at top of scope - main = id( "qunit-fixture" ); - if ( main ) { - config.fixture = main.innerHTML; - } - - if ( config.autostart ) { - QUnit.start(); - } -}; - -addEvent( window, "load", QUnit.load ); - -// `onErrorFnPrev` initialized at top of scope -// Preserve other handlers -onErrorFnPrev = window.onerror; - -// Cover uncaught exceptions -// Returning true will surpress the default browser handler, -// returning false will let it run. -window.onerror = function ( error, filePath, linerNr ) { - var ret = false; - if ( onErrorFnPrev ) { - ret = onErrorFnPrev( error, filePath, linerNr ); - } - - // Treat return value as window.onerror itself does, - // Only do our handling if not surpressed. - if ( ret !== true ) { - if ( QUnit.config.current ) { - if ( QUnit.config.current.ignoreGlobalErrors ) { - return true; - } - QUnit.pushFailure( error, filePath + ":" + linerNr ); - } else { - QUnit.test( "global failure", extend( function() { - QUnit.pushFailure( error, filePath + ":" + linerNr ); - }, { validTest: validTest } ) ); - } - return false; - } - - return ret; -}; - -function done() { - config.autorun = true; - - // Log the last module results - if ( config.currentModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.currentModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - - var i, key, - banner = id( "qunit-banner" ), - tests = id( "qunit-tests" ), - runtime = +new Date() - config.started, - passed = config.stats.all - config.stats.bad, - html = [ - "Tests completed in ", - runtime, - " milliseconds.
          ", - "", - passed, - " assertions of ", - config.stats.all, - " passed, ", - config.stats.bad, - " failed." - ].join( "" ); - - if ( banner ) { - banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); - } - - if ( tests ) { - id( "qunit-testresult" ).innerHTML = html; - } - - if ( config.altertitle && typeof document !== "undefined" && document.title ) { - // show ✖ for good, ✔ for bad suite result in title - // use escape sequences in case file gets loaded with non-utf-8-charset - document.title = [ - ( config.stats.bad ? "\u2716" : "\u2714" ), - document.title.replace( /^[\u2714\u2716] /i, "" ) - ].join( " " ); - } - - // clear own sessionStorage items if all tests passed - if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { - // `key` & `i` initialized at top of scope - for ( i = 0; i < sessionStorage.length; i++ ) { - key = sessionStorage.key( i++ ); - if ( key.indexOf( "qunit-test-" ) === 0 ) { - sessionStorage.removeItem( key ); - } - } - } - - // scroll back to top to show results - if ( window.scrollTo ) { - window.scrollTo(0, 0); - } - - runLoggingCallbacks( "done", QUnit, { - failed: config.stats.bad, - passed: passed, - total: config.stats.all, - runtime: runtime - }); -} - -/** @return Boolean: true if this test should be ran */ -function validTest( test ) { - var include, - filter = config.filter && config.filter.toLowerCase(), - module = config.module && config.module.toLowerCase(), - fullName = (test.module + ": " + test.testName).toLowerCase(); - - // Internally-generated tests are always valid - if ( test.callback && test.callback.validTest === validTest ) { - delete test.callback.validTest; - return true; - } - - if ( config.testNumber ) { - return test.testNumber === config.testNumber; - } - - if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { - return false; - } - - if ( !filter ) { - return true; - } - - include = filter.charAt( 0 ) !== "!"; - if ( !include ) { - filter = filter.slice( 1 ); - } - - // If the filter matches, we need to honour include - if ( fullName.indexOf( filter ) !== -1 ) { - return include; - } - - // Otherwise, do the opposite - return !include; -} - -// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) -// Later Safari and IE10 are supposed to support error.stack as well -// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack -function extractStacktrace( e, offset ) { - offset = offset === undefined ? 3 : offset; - - var stack, include, i; - - if ( e.stacktrace ) { - // Opera - return e.stacktrace.split( "\n" )[ offset + 3 ]; - } else if ( e.stack ) { - // Firefox, Chrome - stack = e.stack.split( "\n" ); - if (/^error$/i.test( stack[0] ) ) { - stack.shift(); - } - if ( fileName ) { - include = []; - for ( i = offset; i < stack.length; i++ ) { - if ( stack[ i ].indexOf( fileName ) !== -1 ) { - break; - } - include.push( stack[ i ] ); - } - if ( include.length ) { - return include.join( "\n" ); - } - } - return stack[ offset ]; - } else if ( e.sourceURL ) { - // Safari, PhantomJS - // hopefully one day Safari provides actual stacktraces - // exclude useless self-reference for generated Error objects - if ( /qunit.js$/.test( e.sourceURL ) ) { - return; - } - // for actual exceptions, this is useful - return e.sourceURL + ":" + e.line; - } -} -function sourceFromStacktrace( offset ) { - try { - throw new Error(); - } catch ( e ) { - return extractStacktrace( e, offset ); - } -} - -/** - * Escape text for attribute or text content. - */ -function escapeText( s ) { - if ( !s ) { - return ""; - } - s = s + ""; - // Both single quotes and double quotes (for attributes) - return s.replace( /['"<>&]/g, function( s ) { - switch( s ) { - case '\'': - return '''; - case '"': - return '"'; - case '<': - return '<'; - case '>': - return '>'; - case '&': - return '&'; - } - }); -} - -function synchronize( callback, last ) { - config.queue.push( callback ); - - if ( config.autorun && !config.blocking ) { - process( last ); - } -} - -function process( last ) { - function next() { - process( last ); - } - var start = new Date().getTime(); - config.depth = config.depth ? config.depth + 1 : 1; - - while ( config.queue.length && !config.blocking ) { - if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { - config.queue.shift()(); - } else { - window.setTimeout( next, 13 ); - break; - } - } - config.depth--; - if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { - done(); - } -} - -function saveGlobal() { - config.pollution = []; - - if ( config.noglobals ) { - for ( var key in window ) { - // in Opera sometimes DOM element ids show up here, ignore them - if ( !hasOwn.call( window, key ) || /^qunit-test-output/.test( key ) ) { - continue; - } - config.pollution.push( key ); - } - } -} - -function checkPollution() { - var newGlobals, - deletedGlobals, - old = config.pollution; - - saveGlobal(); - - newGlobals = diff( config.pollution, old ); - if ( newGlobals.length > 0 ) { - QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); - } - - deletedGlobals = diff( old, config.pollution ); - if ( deletedGlobals.length > 0 ) { - QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); - } -} - -// returns a new Array with the elements that are in a but not in b -function diff( a, b ) { - var i, j, - result = a.slice(); - - for ( i = 0; i < result.length; i++ ) { - for ( j = 0; j < b.length; j++ ) { - if ( result[i] === b[j] ) { - result.splice( i, 1 ); - i--; - break; - } - } - } - return result; -} - -function extend( a, b ) { - for ( var prop in b ) { - if ( b[ prop ] === undefined ) { - delete a[ prop ]; - - // Avoid "Member not found" error in IE8 caused by setting window.constructor - } else if ( prop !== "constructor" || a !== window ) { - a[ prop ] = b[ prop ]; - } - } - - return a; -} - -/** - * @param {HTMLElement} elem - * @param {string} type - * @param {Function} fn - */ -function addEvent( elem, type, fn ) { - // Standards-based browsers - if ( elem.addEventListener ) { - elem.addEventListener( type, fn, false ); - // IE - } else { - elem.attachEvent( "on" + type, fn ); - } -} - -/** - * @param {Array|NodeList} elems - * @param {string} type - * @param {Function} fn - */ -function addEvents( elems, type, fn ) { - var i = elems.length; - while ( i-- ) { - addEvent( elems[i], type, fn ); - } -} - -function hasClass( elem, name ) { - return (" " + elem.className + " ").indexOf(" " + name + " ") > -1; -} - -function addClass( elem, name ) { - if ( !hasClass( elem, name ) ) { - elem.className += (elem.className ? " " : "") + name; - } -} - -function removeClass( elem, name ) { - var set = " " + elem.className + " "; - // Class name may appear multiple times - while ( set.indexOf(" " + name + " ") > -1 ) { - set = set.replace(" " + name + " " , " "); - } - // If possible, trim it for prettiness, but not neccecarily - elem.className = window.jQuery ? jQuery.trim( set ) : ( set.trim ? set.trim() : set ); -} - -function id( name ) { - return !!( typeof document !== "undefined" && document && document.getElementById ) && - document.getElementById( name ); -} - -function registerLoggingCallback( key ) { - return function( callback ) { - config[key].push( callback ); - }; -} - -// Supports deprecated method of completely overwriting logging callbacks -function runLoggingCallbacks( key, scope, args ) { - var i, callbacks; - if ( QUnit.hasOwnProperty( key ) ) { - QUnit[ key ].call(scope, args ); - } else { - callbacks = config[ key ]; - for ( i = 0; i < callbacks.length; i++ ) { - callbacks[ i ].call( scope, args ); - } - } -} - -// Test for equality any JavaScript type. -// Author: Philippe Rathé -QUnit.equiv = (function() { - - // Call the o related callback with the given arguments. - function bindCallbacks( o, callbacks, args ) { - var prop = QUnit.objectType( o ); - if ( prop ) { - if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { - return callbacks[ prop ].apply( callbacks, args ); - } else { - return callbacks[ prop ]; // or undefined - } - } - } - - // the real equiv function - var innerEquiv, - // stack to decide between skip/abort functions - callers = [], - // stack to avoiding loops from circular referencing - parents = [], - - getProto = Object.getPrototypeOf || function ( obj ) { - return obj.__proto__; - }, - callbacks = (function () { - - // for string, boolean, number and null - function useStrictEquality( b, a ) { - /*jshint eqeqeq:false */ - if ( b instanceof a.constructor || a instanceof b.constructor ) { - // to catch short annotaion VS 'new' annotation of a - // declaration - // e.g. var i = 1; - // var j = new Number(1); - return a == b; - } else { - return a === b; - } - } - - return { - "string": useStrictEquality, - "boolean": useStrictEquality, - "number": useStrictEquality, - "null": useStrictEquality, - "undefined": useStrictEquality, - - "nan": function( b ) { - return isNaN( b ); - }, - - "date": function( b, a ) { - return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); - }, - - "regexp": function( b, a ) { - return QUnit.objectType( b ) === "regexp" && - // the regex itself - a.source === b.source && - // and its modifers - a.global === b.global && - // (gmi) ... - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline && - a.sticky === b.sticky; - }, - - // - skip when the property is a method of an instance (OOP) - // - abort otherwise, - // initial === would have catch identical references anyway - "function": function() { - var caller = callers[callers.length - 1]; - return caller !== Object && typeof caller !== "undefined"; - }, - - "array": function( b, a ) { - var i, j, len, loop; - - // b could be an object literal here - if ( QUnit.objectType( b ) !== "array" ) { - return false; - } - - len = a.length; - if ( len !== b.length ) { - // safe and faster - return false; - } - - // track reference to avoid circular references - parents.push( a ); - for ( i = 0; i < len; i++ ) { - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - loop = true;// dont rewalk array - } - } - if ( !loop && !innerEquiv(a[i], b[i]) ) { - parents.pop(); - return false; - } - } - parents.pop(); - return true; - }, - - "object": function( b, a ) { - var i, j, loop, - // Default to true - eq = true, - aProperties = [], - bProperties = []; - - // comparing constructors is more strict than using - // instanceof - if ( a.constructor !== b.constructor ) { - // Allow objects with no prototype to be equivalent to - // objects with Object as their constructor. - if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || - ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { - return false; - } - } - - // stack constructor before traversing properties - callers.push( a.constructor ); - // track reference to avoid circular references - parents.push( a ); - - for ( i in a ) { // be strict: don't ensures hasOwnProperty - // and go deep - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - // don't go down the same path twice - loop = true; - } - } - aProperties.push(i); // collect a's properties - - if (!loop && !innerEquiv( a[i], b[i] ) ) { - eq = false; - break; - } - } - - callers.pop(); // unstack, we are done - parents.pop(); - - for ( i in b ) { - bProperties.push( i ); // collect b's properties - } - - // Ensures identical properties name - return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); - } - }; - }()); - - innerEquiv = function() { // can take multiple arguments - var args = [].slice.apply( arguments ); - if ( args.length < 2 ) { - return true; // end transition - } - - return (function( a, b ) { - if ( a === b ) { - return true; // catch the most you can - } else if ( a === null || b === null || typeof a === "undefined" || - typeof b === "undefined" || - QUnit.objectType(a) !== QUnit.objectType(b) ) { - return false; // don't lose time with error prone cases - } else { - return bindCallbacks(a, callbacks, [ b, a ]); - } - - // apply transition with (1..n) arguments - }( args[0], args[1] ) && arguments.callee.apply( this, args.splice(1, args.length - 1 )) ); - }; - - return innerEquiv; -}()); - -/** - * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | - * http://flesler.blogspot.com Licensed under BSD - * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 - * - * @projectDescription Advanced and extensible data dumping for Javascript. - * @version 1.0.0 - * @author Ariel Flesler - * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} - */ -QUnit.jsDump = (function() { - function quote( str ) { - return '"' + str.toString().replace( /"/g, '\\"' ) + '"'; - } - function literal( o ) { - return o + ""; - } - function join( pre, arr, post ) { - var s = jsDump.separator(), - base = jsDump.indent(), - inner = jsDump.indent(1); - if ( arr.join ) { - arr = arr.join( "," + s + inner ); - } - if ( !arr ) { - return pre + post; - } - return [ pre, inner + arr, base + post ].join(s); - } - function array( arr, stack ) { - var i = arr.length, ret = new Array(i); - this.up(); - while ( i-- ) { - ret[i] = this.parse( arr[i] , undefined , stack); - } - this.down(); - return join( "[", ret, "]" ); - } - - var reName = /^function (\w+)/, - jsDump = { - // type is used mostly internally, you can fix a (custom)type in advance - parse: function( obj, type, stack ) { - stack = stack || [ ]; - var inStack, res, - parser = this.parsers[ type || this.typeOf(obj) ]; - - type = typeof parser; - inStack = inArray( obj, stack ); - - if ( inStack !== -1 ) { - return "recursion(" + (inStack - stack.length) + ")"; - } - if ( type === "function" ) { - stack.push( obj ); - res = parser.call( this, obj, stack ); - stack.pop(); - return res; - } - return ( type === "string" ) ? parser : this.parsers.error; - }, - typeOf: function( obj ) { - var type; - if ( obj === null ) { - type = "null"; - } else if ( typeof obj === "undefined" ) { - type = "undefined"; - } else if ( QUnit.is( "regexp", obj) ) { - type = "regexp"; - } else if ( QUnit.is( "date", obj) ) { - type = "date"; - } else if ( QUnit.is( "function", obj) ) { - type = "function"; - } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { - type = "window"; - } else if ( obj.nodeType === 9 ) { - type = "document"; - } else if ( obj.nodeType ) { - type = "node"; - } else if ( - // native arrays - toString.call( obj ) === "[object Array]" || - // NodeList objects - ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) - ) { - type = "array"; - } else if ( obj.constructor === Error.prototype.constructor ) { - type = "error"; - } else { - type = typeof obj; - } - return type; - }, - separator: function() { - return this.multiline ? this.HTML ? "
          " : "\n" : this.HTML ? " " : " "; - }, - // extra can be a number, shortcut for increasing-calling-decreasing - indent: function( extra ) { - if ( !this.multiline ) { - return ""; - } - var chr = this.indentChar; - if ( this.HTML ) { - chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); - } - return new Array( this._depth_ + (extra||0) ).join(chr); - }, - up: function( a ) { - this._depth_ += a || 1; - }, - down: function( a ) { - this._depth_ -= a || 1; - }, - setParser: function( name, parser ) { - this.parsers[name] = parser; - }, - // The next 3 are exposed so you can use them - quote: quote, - literal: literal, - join: join, - // - _depth_: 1, - // This is the list of parsers, to modify them, use jsDump.setParser - parsers: { - window: "[Window]", - document: "[Document]", - error: function(error) { - return "Error(\"" + error.message + "\")"; - }, - unknown: "[Unknown]", - "null": "null", - "undefined": "undefined", - "function": function( fn ) { - var ret = "function", - // functions never have name in IE - name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1]; - - if ( name ) { - ret += " " + name; - } - ret += "( "; - - ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); - return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); - }, - array: array, - nodelist: array, - "arguments": array, - object: function( map, stack ) { - var ret = [ ], keys, key, val, i; - QUnit.jsDump.up(); - keys = []; - for ( key in map ) { - keys.push( key ); - } - keys.sort(); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - val = map[ key ]; - ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); - } - QUnit.jsDump.down(); - return join( "{", ret, "}" ); - }, - node: function( node ) { - var len, i, val, - open = QUnit.jsDump.HTML ? "<" : "<", - close = QUnit.jsDump.HTML ? ">" : ">", - tag = node.nodeName.toLowerCase(), - ret = open + tag, - attrs = node.attributes; - - if ( attrs ) { - for ( i = 0, len = attrs.length; i < len; i++ ) { - val = attrs[i].nodeValue; - // IE6 includes all attributes in .attributes, even ones not explicitly set. - // Those have values like undefined, null, 0, false, "" or "inherit". - if ( val && val !== "inherit" ) { - ret += " " + attrs[i].nodeName + "=" + QUnit.jsDump.parse( val, "attribute" ); - } - } - } - ret += close; - - // Show content of TextNode or CDATASection - if ( node.nodeType === 3 || node.nodeType === 4 ) { - ret += node.nodeValue; - } - - return ret + open + "/" + tag + close; - }, - // function calls it internally, it's the arguments part of the function - functionArgs: function( fn ) { - var args, - l = fn.length; - - if ( !l ) { - return ""; - } - - args = new Array(l); - while ( l-- ) { - // 97 is 'a' - args[l] = String.fromCharCode(97+l); - } - return " " + args.join( ", " ) + " "; - }, - // object calls it internally, the key part of an item in a map - key: quote, - // function calls it internally, it's the content of the function - functionCode: "[code]", - // node calls it internally, it's an html attribute value - attribute: quote, - string: quote, - date: quote, - regexp: literal, - number: literal, - "boolean": literal - }, - // if true, entities are escaped ( <, >, \t, space and \n ) - HTML: false, - // indentation unit - indentChar: " ", - // if true, items in a collection, are separated by a \n, else just a space. - multiline: true - }; - - return jsDump; -}()); - -// from jquery.js -function inArray( elem, array ) { - if ( array.indexOf ) { - return array.indexOf( elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; -} - -/* - * Javascript Diff Algorithm - * By John Resig (http://ejohn.org/) - * Modified by Chu Alan "sprite" - * - * Released under the MIT license. - * - * More Info: - * http://ejohn.org/projects/javascript-diff-algorithm/ - * - * Usage: QUnit.diff(expected, actual) - * - * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick brown fox jumped jumps over" - */ -QUnit.diff = (function() { - /*jshint eqeqeq:false, eqnull:true */ - function diff( o, n ) { - var i, - ns = {}, - os = {}; - - for ( i = 0; i < n.length; i++ ) { - if ( !hasOwn.call( ns, n[i] ) ) { - ns[ n[i] ] = { - rows: [], - o: null - }; - } - ns[ n[i] ].rows.push( i ); - } - - for ( i = 0; i < o.length; i++ ) { - if ( !hasOwn.call( os, o[i] ) ) { - os[ o[i] ] = { - rows: [], - n: null - }; - } - os[ o[i] ].rows.push( i ); - } - - for ( i in ns ) { - if ( !hasOwn.call( ns, i ) ) { - continue; - } - if ( ns[i].rows.length === 1 && hasOwn.call( os, i ) && os[i].rows.length === 1 ) { - n[ ns[i].rows[0] ] = { - text: n[ ns[i].rows[0] ], - row: os[i].rows[0] - }; - o[ os[i].rows[0] ] = { - text: o[ os[i].rows[0] ], - row: ns[i].rows[0] - }; - } - } - - for ( i = 0; i < n.length - 1; i++ ) { - if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && - n[ i + 1 ] == o[ n[i].row + 1 ] ) { - - n[ i + 1 ] = { - text: n[ i + 1 ], - row: n[i].row + 1 - }; - o[ n[i].row + 1 ] = { - text: o[ n[i].row + 1 ], - row: i + 1 - }; - } - } - - for ( i = n.length - 1; i > 0; i-- ) { - if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && - n[ i - 1 ] == o[ n[i].row - 1 ]) { - - n[ i - 1 ] = { - text: n[ i - 1 ], - row: n[i].row - 1 - }; - o[ n[i].row - 1 ] = { - text: o[ n[i].row - 1 ], - row: i - 1 - }; - } - } - - return { - o: o, - n: n - }; - } - - return function( o, n ) { - o = o.replace( /\s+$/, "" ); - n = n.replace( /\s+$/, "" ); - - var i, pre, - str = "", - out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), - oSpace = o.match(/\s+/g), - nSpace = n.match(/\s+/g); - - if ( oSpace == null ) { - oSpace = [ " " ]; - } - else { - oSpace.push( " " ); - } - - if ( nSpace == null ) { - nSpace = [ " " ]; - } - else { - nSpace.push( " " ); - } - - if ( out.n.length === 0 ) { - for ( i = 0; i < out.o.length; i++ ) { - str += "" + out.o[i] + oSpace[i] + ""; - } - } - else { - if ( out.n[0].text == null ) { - for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { - str += "" + out.o[n] + oSpace[n] + ""; - } - } - - for ( i = 0; i < out.n.length; i++ ) { - if (out.n[i].text == null) { - str += "" + out.n[i] + nSpace[i] + ""; - } - else { - // `pre` initialized at top of scope - pre = ""; - - for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { - pre += "" + out.o[n] + oSpace[n] + ""; - } - str += " " + out.n[i].text + nSpace[i] + pre; - } - } - } - - return str; - }; -}()); - -// for CommonJS enviroments, export everything -if ( typeof exports !== "undefined" ) { - extend( exports, QUnit ); -} - -// get at whatever the global object is, like window in browsers -}( (function() {return this;}.call()) )); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/README.md deleted file mode 100644 index 7cfe3bb..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar - programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly - more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a - JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/buffer-entry.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/buffer-entry.js deleted file mode 100644 index c7b5a6e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/buffer-entry.js +++ /dev/null @@ -1,30 +0,0 @@ -// just like the Entry class, but it buffers the contents -// -// XXX It would be good to set a maximum BufferEntry filesize, -// since it eats up memory. In normal operation, -// these are only for long filenames or link names, which are -// rarely very big. - -module.exports = BufferEntry - -var inherits = require("../vendor/inherits/inherits.js") - , Entry = require("./entry.js") - -function BufferEntry () { - Entry.apply(this, arguments) - this._buffer = new Buffer(this.props.size) - this._offset = 0 - this.body = "" - this.on("end", function () { - this.body = this._buffer.toString().slice(0, -1) - }) -} - -// collect the bytes as they come in. -BufferEntry.prototype.write = function (c) { - c.copy(this._buffer, this._offset) - this._offset += c.length - Entry.prototype.write.call(this, c) -} - -inherits(BufferEntry, Entry) diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/entry-writer.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/entry-writer.js deleted file mode 100644 index 9d6a9b7..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/entry-writer.js +++ /dev/null @@ -1,169 +0,0 @@ -module.exports = EntryWriter - -var tar = require("../tar.js") - , TarHeader = require("./header.js") - , Entry = require("./entry.js") - , inherits = require("../vendor/inherits/inherits.js") - , BlockStream = require("../vendor/block-stream/block-stream.js") - , ExtendedHeaderWriter - , Stream = require("stream").Stream - , EOF = {} - -inherits(EntryWriter, Stream) - -function EntryWriter (props) { - var me = this - - if (!(me instanceof EntryWriter)) { - return new EntryWriter(props) - } - - Stream.apply(this) - - me.writable = true - me.readable = true - - me._stream = new BlockStream(512) - - me._stream.on("data", function (c) { - me.emit("data", c) - }) - - me._stream.on("drain", function () { - me.emit("drain") - }) - - me._stream.on("end", function () { - me.emit("end") - me.emit("close") - }) - - me.props = props - if (props.type === "Directory") { - props.size = 0 - } - props.ustar = "ustar\0" - props.ustarver = "00" - me.path = props.path - - me._buffer = [] - me._didHeader = false - me._meta = false - - me.on("pipe", function () { - me._process() - }) -} - -EntryWriter.prototype.write = function (c) { - // console.error(".. ew write") - if (this._ended) return this.emit("error", new Error("write after end")) - this._buffer.push(c) - this._process() - this._needDrain = this._buffer.length > 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/entry.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/entry.js deleted file mode 100644 index 9d5b8bc..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/entry.js +++ /dev/null @@ -1,212 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , fstream = require("../vendor/fstream/fstream.js").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, -{ 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 - } - -, end: function (c) { - if (c) this.write(c) - this._ending = true - this._read() - } - -, pause: function () { - this._paused = true - this.emit("pause") - } - -, 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 -, _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? - if (this._index < this._queueLen) { - 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 - } - -, _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 - } -, warn: fstream.warn -, error: fstream.error -}) diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extended-header-writer.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extended-header-writer.js deleted file mode 100644 index 10a7d8f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extended-header-writer.js +++ /dev/null @@ -1,192 +0,0 @@ - -module.exports = ExtendedHeaderWriter - -var inherits = require("../vendor/inherits/inherits.js") - , EntryWriter = require("./entry-writer.js") - -inherits(ExtendedHeaderWriter, EntryWriter) - -var tar = require("../tar.js") - , path = require("path") - , inherits = require("../vendor/inherits/inherits.js") - , 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extended-header.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extended-header.js deleted file mode 100644 index 63b79ec..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extended-header.js +++ /dev/null @@ -1,139 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , 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, { _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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extract.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extract.js deleted file mode 100644 index bffc033..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/extract.js +++ /dev/null @@ -1,78 +0,0 @@ -// give it a tarball and a path, and it'll dump the contents - -module.exports = Extract - -var tar = require("../tar.js") - , fstream = require("../vendor/fstream/fstream.js") - , inherits = require("../vendor/inherits/inherits.js") - , 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/global-header-writer.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/global-header-writer.js deleted file mode 100644 index 99ff257..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/global-header-writer.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = GlobalHeaderWriter - -var ExtendedHeaderWriter = require("./extended-header-writer.js") - , inherits = require("../vendor/inherits/inherits.js") - -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/header.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/header.js deleted file mode 100644 index 05b237c..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/header.js +++ /dev/null @@ -1,385 +0,0 @@ -// 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/pack.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/pack.js deleted file mode 100644 index 11b11fb..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/pack.js +++ /dev/null @@ -1,226 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , GlobalHeaderWriter = require("./global-header-writer.js") - , collect = require("../vendor/fstream/fstream.js").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, "/") - } - - 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/parse.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/parse.js deleted file mode 100644 index 3f71a92..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/lib/parse.js +++ /dev/null @@ -1,270 +0,0 @@ - -// 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("../vendor/block-stream/block-stream.js") - , 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("../vendor/inherits/inherits.js") - , fstream = require("../vendor/fstream/fstream.js") - -// 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/tar.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/tar.js deleted file mode 100644 index b9dbca4..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/tar.js +++ /dev/null @@ -1,172 +0,0 @@ -// 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 - , 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/README.md deleted file mode 100644 index c16e9c4..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js deleted file mode 100644 index af63e5f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js +++ /dev/null @@ -1,209 +0,0 @@ -// 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/inherits.js") - , 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/README.md deleted file mode 100644 index 9d8cb77..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js deleted file mode 100644 index c66d26f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.Abstract = require("./lib/abstract.js") -exports.Reader = require("./lib/reader.js") -exports.Writer = require("./lib/writer.js") - -exports.File = - { Reader: require("./lib/file-reader.js") - , Writer: require("./lib/file-writer.js") } - -exports.Dir = - { Reader : require("./lib/dir-reader.js") - , Writer : require("./lib/dir-writer.js") } - -exports.Link = - { Reader : require("./lib/link-reader.js") - , Writer : require("./lib/link-writer.js") } - -exports.Proxy = - { Reader : require("./lib/proxy-reader.js") - , Writer : require("./lib/proxy-writer.js") } - -exports.Reader.Dir = exports.DirReader = exports.Dir.Reader -exports.Reader.File = exports.FileReader = exports.File.Reader -exports.Reader.Link = exports.LinkReader = exports.Link.Reader -exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader - -exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer -exports.Writer.File = exports.FileWriter = exports.File.Writer -exports.Writer.Link = exports.LinkWriter = exports.Link.Writer -exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer - -exports.collect = require("./lib/collect.js") diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js deleted file mode 100644 index 6161f3b..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js +++ /dev/null @@ -1,85 +0,0 @@ -// the parent class for all fstreams. - -module.exports = Abstract - -var Stream = require("stream").Stream - , inherits = require("../../inherits/inherits.js") - -function Abstract () { - Stream.call(this) -} - -inherits(Abstract, Stream) - -Abstract.prototype.on = function (ev, fn) { - if (ev === "ready" && this.ready) { - process.nextTick(fn.bind(this)) - } else { - Stream.prototype.on.call(this, ev, fn) - } - return this -} - -Abstract.prototype.abort = function () { - this._aborted = true - this.emit("abort") -} - -Abstract.prototype.destroy = function () {} - -Abstract.prototype.warn = function (msg, code) { - var me = this - , er = decorate(msg, code, me) - if (!me.listeners("warn")) { - console.error("%s %s\n" + - "path = %s\n" + - "syscall = %s\n" + - "fstream_type = %s\n" + - "fstream_path = %s\n" + - "fstream_unc_path = %s\n" + - "fstream_class = %s\n" + - "fstream_stack =\n%s\n", - code || "UNKNOWN", - er.stack, - er.path, - er.syscall, - er.fstream_type, - er.fstream_path, - er.fstream_unc_path, - er.fstream_class, - er.fstream_stack.join("\n")) - } else { - me.emit("warn", er) - } -} - -Abstract.prototype.info = function (msg, code) { - this.emit("info", msg, code) -} - -Abstract.prototype.error = function (msg, code, th) { - var er = decorate(msg, code, this) - if (th) throw er - else this.emit("error", er) -} - -function decorate (er, code, me) { - if (!(er instanceof Error)) er = new Error(er) - er.code = er.code || code - er.path = er.path || me.path - er.fstream_type = er.fstream_type || me.type - er.fstream_path = er.fstream_path || me.path - if (me._path !== me.path) { - er.fstream_unc_path = er.fstream_unc_path || me._path - } - if (me.linkpath) { - er.fstream_linkpath = er.fstream_linkpath || me.linkpath - } - er.fstream_class = er.fstream_class || me.constructor.name - er.fstream_stack = er.fstream_stack || - new Error().stack.split(/\n/).slice(3).map(function (s) { - return s.replace(/^ at /, "") - }) - - return er -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js deleted file mode 100644 index a36f780..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = collect - -function collect (stream) { - if (stream._collected) return - - stream._collected = true - stream.pause() - - stream.on("data", save) - stream.on("end", save) - var buf = [] - function save (b) { - if (typeof b === "string") b = new Buffer(b) - if (Buffer.isBuffer(b) && !b.length) return - buf.push(b) - } - - stream.on("entry", saveEntry) - var entryBuffer = [] - function saveEntry (e) { - collect(e) - entryBuffer.push(e) - } - - stream.on("proxy", proxyPause) - function proxyPause (p) { - p.pause() - } - - - // replace the pipe method with a new version that will - // unlock the buffered stuff. if you just call .pipe() - // without a destination, then it'll re-play the events. - stream.pipe = (function (orig) { return function (dest) { - // console.error(" === open the pipes", dest && dest.path) - - // let the entries flow through one at a time. - // Once they're all done, then we can resume completely. - var e = 0 - ;(function unblockEntry () { - var entry = entryBuffer[e++] - // console.error(" ==== unblock entry", entry && entry.path) - if (!entry) return resume() - entry.on("end", unblockEntry) - if (dest) dest.add(entry) - else stream.emit("entry", entry) - })() - - function resume () { - stream.removeListener("entry", saveEntry) - stream.removeListener("data", save) - stream.removeListener("end", save) - - stream.pipe = orig - if (dest) stream.pipe(dest) - - buf.forEach(function (b) { - if (b) stream.emit("data", b) - else stream.emit("end") - }) - - stream.resume() - } - - return dest - }})(stream.pipe) -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js deleted file mode 100644 index e655b0d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js +++ /dev/null @@ -1,250 +0,0 @@ -// A thing that emits "entry" events with Reader objects -// Pausing it causes it to stop emitting entry events, and also -// pauses the current entry if there is one. - -module.exports = DirReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , Reader = require("./reader.js") - , assert = require("assert").ok - -inherits(DirReader, Reader) - -function DirReader (props) { - var me = this - if (!(me instanceof DirReader)) throw new Error( - "DirReader must be called as constructor.") - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - throw new Error("Non-directory type "+ props.type) - } - - me.entries = null - me._index = -1 - me._paused = false - me._length = -1 - - if (props.sort) { - this.sort = props.sort - } - - Reader.call(this, props) -} - -DirReader.prototype._getEntries = function () { - var me = this - - // race condition. might pause() before calling _getEntries, - // and then resume, and try to get them a second time. - if (me._gotEntries) return - me._gotEntries = true - - fs.readdir(me._path, function (er, entries) { - if (er) return me.error(er) - - me.entries = entries - - me.emit("entries", entries) - if (me._paused) me.once("resume", processEntries) - else processEntries() - - function processEntries () { - me._length = me.entries.length - if (typeof me.sort === "function") { - me.entries = me.entries.sort(me.sort.bind(me)) - } - me._read() - } - }) -} - -// start walking the dir, and emit an "entry" event for each one. -DirReader.prototype._read = function () { - var me = this - - if (!me.entries) return me._getEntries() - - if (me._paused || me._currentEntry || me._aborted) { - // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted) - return - } - - me._index ++ - if (me._index >= me.entries.length) { - if (!me._ended) { - me._ended = true - me.emit("end") - me.emit("close") - } - return - } - - // ok, handle this one, then. - - // save creating a proxy, by stat'ing the thing now. - var p = path.resolve(me._path, me.entries[me._index]) - assert(p !== me._path) - assert(me.entries[me._index]) - - // set this to prevent trying to _read() again in the stat time. - me._currentEntry = p - fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) { - if (er) return me.error(er) - - var who = me._proxy || me - - stat.path = p - stat.basename = path.basename(p) - stat.dirname = path.dirname(p) - var childProps = me.getChildProps.call(who, stat) - childProps.path = p - childProps.basename = path.basename(p) - childProps.dirname = path.dirname(p) - - var entry = Reader(childProps, stat) - - // console.error("DR Entry", p, stat.size) - - me._currentEntry = entry - - // "entry" events are for direct entries in a specific dir. - // "child" events are for any and all children at all levels. - // This nomenclature is not completely final. - - entry.on("pause", function (who) { - if (!me._paused && !entry._disowned) { - me.pause(who) - } - }) - - entry.on("resume", function (who) { - if (me._paused && !entry._disowned) { - me.resume(who) - } - }) - - entry.on("stat", function (props) { - me.emit("_entryStat", entry, props) - if (entry._aborted) return - if (entry._paused) entry.once("resume", function () { - me.emit("entryStat", entry, props) - }) - else me.emit("entryStat", entry, props) - }) - - entry.on("ready", function EMITCHILD () { - // console.error("DR emit child", entry._path) - if (me._paused) { - // console.error(" DR emit child - try again later") - // pause the child, and emit the "entry" event once we drain. - // console.error("DR pausing child entry") - entry.pause(me) - return me.once("resume", EMITCHILD) - } - - // skip over sockets. they can't be piped around properly, - // so there's really no sense even acknowledging them. - // if someone really wants to see them, they can listen to - // the "socket" events. - if (entry.type === "Socket") { - me.emit("socket", entry) - } else { - me.emitEntry(entry) - } - }) - - var ended = false - entry.on("close", onend) - entry.on("disown", onend) - function onend () { - if (ended) return - ended = true - me.emit("childEnd", entry) - me.emit("entryEnd", entry) - me._currentEntry = null - if (!me._paused) { - me._read() - } - } - - // XXX Remove this. Works in node as of 0.6.2 or so. - // Long filenames should not break stuff. - entry.on("error", function (er) { - if (entry._swallowErrors) { - me.warn(er) - entry.emit("end") - entry.emit("close") - } else { - me.emit("error", er) - } - }) - - // proxy up some events. - ; [ "child" - , "childEnd" - , "warn" - ].forEach(function (ev) { - entry.on(ev, me.emit.bind(me, ev)) - }) - }) -} - -DirReader.prototype.disown = function (entry) { - entry.emit("beforeDisown") - entry._disowned = true - entry.parent = entry.root = null - if (entry === this._currentEntry) { - this._currentEntry = null - } - entry.emit("disown") -} - -DirReader.prototype.getChildProps = function (stat) { - return { depth: this.depth + 1 - , root: this.root || this - , parent: this - , follow: this.follow - , filter: this.filter - , sort: this.props.sort - } -} - -DirReader.prototype.pause = function (who) { - var me = this - if (me._paused) return - who = who || me - me._paused = true - if (me._currentEntry && me._currentEntry.pause) { - me._currentEntry.pause(who) - } - me.emit("pause", who) -} - -DirReader.prototype.resume = function (who) { - var me = this - if (!me._paused) return - who = who || me - - me._paused = false - // console.error("DR Emit Resume", me._path) - me.emit("resume", who) - if (me._paused) { - // console.error("DR Re-paused", me._path) - return - } - - if (me._currentEntry) { - if (me._currentEntry.resume) me._currentEntry.resume(who) - } else me._read() -} - -DirReader.prototype.emitEntry = function (entry) { - this.emit("entry", entry) - this.emit("child", entry) -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js deleted file mode 100644 index 71eb358..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js +++ /dev/null @@ -1,171 +0,0 @@ -// It is expected that, when .add() returns false, the consumer -// of the DirWriter will pause until a "drain" event occurs. Note -// that this is *almost always going to be the case*, unless the -// thing being written is some sort of unsupported type, and thus -// skipped over. - -module.exports = DirWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , collect = require("./collect.js") - -inherits(DirWriter, Writer) - -function DirWriter (props) { - var me = this - if (!(me instanceof DirWriter)) me.error( - "DirWriter must be called as constructor.", null, true) - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - me.error("Non-directory type "+ props.type + " " + - JSON.stringify(props), null, true) - } - - Writer.call(this, props) -} - -DirWriter.prototype._create = function () { - var me = this - mkdir(me._path, Writer.dirmode, function (er) { - if (er) return me.error(er) - // ready to start getting entries! - me.ready = true - me.emit("ready") - me._process() - }) -} - -// a DirWriter has an add(entry) method, but its .write() doesn't -// do anything. Why a no-op rather than a throw? Because this -// leaves open the door for writing directory metadata for -// gnu/solaris style dumpdirs. -DirWriter.prototype.write = function () { - return true -} - -DirWriter.prototype.end = function () { - this._ended = true - this._process() -} - -DirWriter.prototype.add = function (entry) { - var me = this - - // console.error("\tadd", entry._path, "->", me._path) - collect(entry) - if (!me.ready || me._currentEntry) { - me._buffer.push(entry) - return false - } - - // create a new writer, and pipe the incoming entry into it. - if (me._ended) { - return me.error("add after end") - } - - me._buffer.push(entry) - me._process() - - return 0 === this._buffer.length -} - -DirWriter.prototype._process = function () { - var me = this - - // console.error("DW Process p=%j", me._processing, me.basename) - - if (me._processing) return - - var entry = me._buffer.shift() - if (!entry) { - // console.error("DW Drain") - me.emit("drain") - if (me._ended) me._finish() - return - } - - me._processing = true - // console.error("DW Entry", entry._path) - - me.emit("entry", entry) - - // ok, add this entry - // - // don't allow recursive copying - var p = entry - do { - var pp = p._path || p.path - if (pp === me.root._path || pp === me._path || - (pp && pp.indexOf(me._path) === 0)) { - // console.error("DW Exit (recursive)", entry.basename, me._path) - me._processing = false - if (entry._collected) entry.pipe() - return me._process() - } - } while (p = p.parent) - - // console.error("DW not recursive") - - // chop off the entry's root dir, replace with ours - var props = { parent: me - , root: me.root || me - , type: entry.type - , depth: me.depth + 1 } - - var p = entry._path || entry.path || entry.props.path - if (entry.parent) { - p = p.substr(entry.parent._path.length + 1) - } - // get rid of any ../../ shenanigans - props.path = path.join(me.path, path.join("/", p)) - - // if i have a filter, the child should inherit it. - props.filter = me.filter - - // all the rest of the stuff, copy over from the source. - Object.keys(entry.props).forEach(function (k) { - if (!props.hasOwnProperty(k)) { - props[k] = entry.props[k] - } - }) - - // not sure at this point what kind of writer this is. - var child = me._currentChild = new Writer(props) - child.on("ready", function () { - // console.error("DW Child Ready", child.type, child._path) - // console.error(" resuming", entry._path) - entry.pipe(child) - entry.resume() - }) - - // XXX Make this work in node. - // Long filenames should not break stuff. - child.on("error", function (er) { - if (child._swallowErrors) { - me.warn(er) - child.emit("end") - child.emit("close") - } else { - me.emit("error", er) - } - }) - - // we fire _end internally *after* end, so that we don't move on - // until any "end" listeners have had their chance to do stuff. - child.on("close", onend) - var ended = false - function onend () { - if (ended) return - ended = true - // console.error("* DW Child end", child.basename) - me._currentChild = null - me._processing = false - me._process() - } -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js deleted file mode 100644 index e53718a..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js +++ /dev/null @@ -1,147 +0,0 @@ -// Basically just a wrapper around an fs.ReadStream - -module.exports = FileReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - , EOF = {EOF: true} - , CLOSE = {CLOSE: true} - -inherits(FileReader, Reader) - -function FileReader (props) { - // console.error(" FR create", props.path, props.size, new Error().stack) - var me = this - if (!(me instanceof FileReader)) throw new Error( - "FileReader must be called as constructor.") - - // should already be established as a File type - // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, - // with a HardLinkReader class. - if (!((props.type === "Link" && props.Link) || - (props.type === "File" && props.File))) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesEmitted = 0 - Reader.call(me, props) -} - -FileReader.prototype._getStream = function () { - var me = this - , stream = me._stream = fs.createReadStream(me._path, me.props) - - if (me.props.blksize) { - stream.bufferSize = me.props.blksize - } - - stream.on("open", me.emit.bind(me, "open")) - - stream.on("data", function (c) { - // console.error("\t\t%d %s", c.length, me.basename) - me._bytesEmitted += c.length - // no point saving empty chunks - if (!c.length) return - else if (me._paused || me._buffer.length) { - me._buffer.push(c) - me._read() - } else me.emit("data", c) - }) - - stream.on("end", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering End", me._path) - me._buffer.push(EOF) - me._read() - } else { - me.emit("end") - } - - if (me._bytesEmitted !== me.props.size) { - me.error("Didn't get expected byte count\n"+ - "expect: "+me.props.size + "\n" + - "actual: "+me._bytesEmitted) - } - }) - - stream.on("close", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering Close", me._path) - me._buffer.push(CLOSE) - me._read() - } else { - // console.error("FR close 1", me._path) - me.emit("close") - } - }) - - me._read() -} - -FileReader.prototype._read = function () { - var me = this - // console.error("FR _read", me._path) - if (me._paused) { - // console.error("FR _read paused", me._path) - return - } - - if (!me._stream) { - // console.error("FR _getStream calling", me._path) - return me._getStream() - } - - // clear out the buffer, if there is one. - if (me._buffer.length) { - // console.error("FR _read has buffer", me._buffer.length, me._path) - var buf = me._buffer - for (var i = 0, l = buf.length; i < l; i ++) { - var c = buf[i] - if (c === EOF) { - // console.error("FR Read emitting buffered end", me._path) - me.emit("end") - } else if (c === CLOSE) { - // console.error("FR Read emitting buffered close", me._path) - me.emit("close") - } else { - // console.error("FR Read emitting buffered data", me._path) - me.emit("data", c) - } - - if (me._paused) { - // console.error("FR Read Re-pausing at "+i, me._path) - me._buffer = buf.slice(i) - return - } - } - me._buffer.length = 0 - } - // console.error("FR _read done") - // that's about all there is to it. -} - -FileReader.prototype.pause = function (who) { - var me = this - // console.error("FR Pause", me._path) - if (me._paused) return - who = who || me - me._paused = true - if (me._stream) me._stream.pause() - me.emit("pause", who) -} - -FileReader.prototype.resume = function (who) { - var me = this - // console.error("FR Resume", me._path) - if (!me._paused) return - who = who || me - me.emit("resume", who) - me._paused = false - if (me._stream) me._stream.resume() - me._read() -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js deleted file mode 100644 index 70bb86d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js +++ /dev/null @@ -1,95 +0,0 @@ -module.exports = FileWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , mkdir = require("../../mkdirp") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , EOF = {} - -inherits(FileWriter, Writer) - -function FileWriter (props) { - var me = this - if (!(me instanceof FileWriter)) throw new Error( - "FileWriter must be called as constructor.") - - // should already be established as a File type - if (props.type !== "File" || !props.File) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesWritten = 0 - - Writer.call(this, props) -} - -FileWriter.prototype._create = function () { - var me = this - if (me._stream) return - - var so = {} - if (me.props.flags) so.flags = me.props.flags - so.mode = Writer.filemode - if (me._old && me._old.blksize) so.bufferSize = me._old.blksize - - me._stream = fs.createWriteStream(me._path, so) - - me._stream.on("open", function (fd) { - me.ready = true - me._buffer.forEach(function (c) { - if (c === EOF) me._stream.end() - else me._stream.write(c) - }) - me.emit("ready") - }) - - me._stream.on("drain", function () { me.emit("drain") }) - - me._stream.on("close", function () { - // console.error("\n\nFW Stream Close", me._path, me.size) - me._finish() - }) -} - -FileWriter.prototype.write = function (c) { - var me = this - - me._bytesWritten += c.length - - if (!me.ready) { - me._buffer.push(c) - return false - } - - var ret = me._stream.write(c) - // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length) - - // allow 2 buffered writes, because otherwise there's just too - // much stop and go bs. - return ret || (me._stream._queue && me._stream._queue.length <= 2) -} - -FileWriter.prototype.end = function (c) { - var me = this - - if (c) me.write(c) - - if (!me.ready) { - me._buffer.push(EOF) - return false - } - - return me._stream.end() -} - -FileWriter.prototype._finish = function () { - var me = this - if (typeof me.size === "number" && me._bytesWritten != me.size) { - me.error( - "Did not get expected byte count.\n" + - "expect: " + me.size + "\n" + - "actual: " + me._bytesWritten) - } - Writer.prototype._finish.call(me) -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js deleted file mode 100644 index cd65c41..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = getType - -function getType (st) { - var types = - [ "Directory" - , "File" - , "SymbolicLink" - , "Link" // special for hardlinks from tarballs - , "BlockDevice" - , "CharacterDevice" - , "FIFO" - , "Socket" ] - , type - - if (st.type && -1 !== types.indexOf(st.type)) { - st[st.type] = true - return st.type - } - - for (var i = 0, l = types.length; i < l; i ++) { - type = types[i] - var is = st[type] || st["is" + type] - if (typeof is === "function") is = is.call(st) - if (is) { - st[type] = true - st.type = type - return type - } - } - - return null -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js deleted file mode 100644 index 1d07e2f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js +++ /dev/null @@ -1,54 +0,0 @@ -// Basically just a wrapper around an fs.readlink -// -// XXX: Enhance this to support the Link type, by keeping -// a lookup table of {:}, so that hardlinks -// can be preserved in tarballs. - -module.exports = LinkReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - -inherits(LinkReader, Reader) - -function LinkReader (props) { - var me = this - if (!(me instanceof LinkReader)) throw new Error( - "LinkReader must be called as constructor.") - - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - Reader.call(me, props) -} - -// When piping a LinkReader into a LinkWriter, we have to -// already have the linkpath property set, so that has to -// happen *before* the "ready" event, which means we need to -// override the _stat method. -LinkReader.prototype._stat = function (currentStat) { - var me = this - fs.readlink(me._path, function (er, linkpath) { - if (er) return me.error(er) - me.linkpath = me.props.linkpath = linkpath - me.emit("linkpath", linkpath) - Reader.prototype._stat.call(me, currentStat) - }) -} - -LinkReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we need - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js deleted file mode 100644 index c652eb3..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js +++ /dev/null @@ -1,95 +0,0 @@ - -module.exports = LinkWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , path = require("path") - , rimraf = require("../../rimraf/rimraf.js") - -inherits(LinkWriter, Writer) - -function LinkWriter (props) { - var me = this - if (!(me instanceof LinkWriter)) throw new Error( - "LinkWriter must be called as constructor.") - - // should already be established as a Link type - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - if (props.linkpath === "") props.linkpath = "." - if (!props.linkpath) { - me.error("Need linkpath property to create " + props.type) - } - - Writer.call(this, props) -} - -LinkWriter.prototype._create = function () { - // console.error(" LW _create") - var me = this - , hard = me.type === "Link" || process.platform === "win32" - , link = hard ? "link" : "symlink" - , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath - - // can only change the link path by clobbering - // For hard links, let's just assume that's always the case, since - // there's no good way to read them if we don't already know. - if (hard) return clobber(me, lp, link) - - fs.readlink(me._path, function (er, p) { - // only skip creation if it's exactly the same link - if (p && p === lp) return finish(me) - clobber(me, lp, link) - }) -} - -function clobber (me, lp, link) { - rimraf(me._path, function (er) { - if (er) return me.error(er) - create(me, lp, link) - }) -} - -function create (me, lp, link) { - fs[link](lp, me._path, function (er) { - // if this is a hard link, and we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier in. - // Additionally, an EPERM or EACCES can happen on win32 if it's trying - // to make a link to a directory. Again, just skip it. - // A better solution would be to have fs.symlink be supported on - // windows in some nice fashion. - if (er) { - if ((er.code === "ENOENT" || - er.code === "EACCES" || - er.code === "EPERM" ) && process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - } else return me.error(er) - } - finish(me) - }) -} - -function finish (me) { - me.ready = true - me.emit("ready") - if (me._ended && !me._finished) me._finish() -} - -LinkWriter.prototype.end = function () { - // console.error("LW finish in end") - this._ended = true - if (this.ready) { - this._finished = true - this._finish() - } -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js deleted file mode 100644 index a51ebdf..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js +++ /dev/null @@ -1,93 +0,0 @@ -// A reader for when we don't yet know what kind of thing -// the thing is. - -module.exports = ProxyReader - -var Reader = require("./reader.js") - , getType = require("./get-type.js") - , inherits = require("../../inherits/inherits.js") - , fs = require("../../graceful-fs/graceful-fs.js") - -inherits(ProxyReader, Reader) - -function ProxyReader (props) { - var me = this - if (!(me instanceof ProxyReader)) throw new Error( - "ProxyReader must be called as constructor.") - - me.props = props - me._buffer = [] - me.ready = false - - Reader.call(me, props) -} - -ProxyReader.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Reader(props, current)) - }) -} - -ProxyReader.prototype._addProxy = function (proxy) { - var me = this - if (me._proxyTarget) { - return me.error("proxy already set") - } - - me._proxyTarget = proxy - proxy._proxy = me - - ; [ "error" - , "data" - , "end" - , "close" - , "linkpath" - , "entry" - , "entryEnd" - , "child" - , "childEnd" - , "warn" - , "stat" - ].forEach(function (ev) { - // console.error("~~ proxy event", ev, me.path) - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - proxy.on("ready", function () { - // console.error("~~ proxy is ready!", me.path) - me.ready = true - me.emit("ready") - }) - - var calls = me._buffer - me._buffer.length = 0 - calls.forEach(function (c) { - proxy[c[0]].apply(proxy, c[1]) - }) -} - -ProxyReader.prototype.pause = function () { - return this._proxyTarget ? this._proxyTarget.pause() : false -} - -ProxyReader.prototype.resume = function () { - return this._proxyTarget ? this._proxyTarget.resume() : false -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js deleted file mode 100644 index 2e6bae4..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js +++ /dev/null @@ -1,109 +0,0 @@ -// A writer for when we don't know what kind of thing -// the thing is. That is, it's not explicitly set, -// so we're going to make it whatever the thing already -// is, or "File" -// -// Until then, collect all events. - -module.exports = ProxyWriter - -var Writer = require("./writer.js") - , getType = require("./get-type.js") - , inherits = require("../../inherits/inherits.js") - , collect = require("./collect.js") - , fs = require("fs") - -inherits(ProxyWriter, Writer) - -function ProxyWriter (props) { - var me = this - if (!(me instanceof ProxyWriter)) throw new Error( - "ProxyWriter must be called as constructor.") - - me.props = props - me._needDrain = false - - Writer.call(me, props) -} - -ProxyWriter.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Writer(props, current)) - }) -} - -ProxyWriter.prototype._addProxy = function (proxy) { - // console.error("~~ set proxy", this.path) - var me = this - if (me._proxy) { - return me.error("proxy already set") - } - - me._proxy = proxy - ; [ "ready" - , "error" - , "close" - , "pipe" - , "drain" - , "warn" - ].forEach(function (ev) { - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - var calls = me._buffer - calls.forEach(function (c) { - // console.error("~~ ~~ proxy buffered call", c[0], c[1]) - proxy[c[0]].call(proxy, c[1]) - }) - me._buffer.length = 0 - if (me._needsDrain) me.emit("drain") -} - -ProxyWriter.prototype.add = function (entry) { - // console.error("~~ proxy add") - collect(entry) - - if (!this._proxy) { - this._buffer.push(["add", [entry]]) - this._needDrain = true - return false - } - return this._proxy.add(entry) -} - -ProxyWriter.prototype.write = function (c) { - // console.error("~~ proxy write") - if (!this._proxy) { - this._buffer.push(["write", [c]]) - this._needDrain = true - return false - } - return this._proxy.write(c) -} - -ProxyWriter.prototype.end = function (c) { - // console.error("~~ proxy end") - if (!this._proxy) { - this._buffer.push(["end", c]) - return false - } - return this._proxy.end(c) -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js deleted file mode 100644 index 42a8701..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js +++ /dev/null @@ -1,258 +0,0 @@ - -module.exports = Reader - -var fs = require("../../graceful-fs/graceful-fs.js") - , Stream = require("stream").Stream - , inherits = require("../../inherits/inherits.js") - , path = require("path") - , getType = require("./get-type.js") - , hardLinks = Reader.hardLinks = {} - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Reader, Abstract) - -var DirReader = require("./dir-reader.js") - , FileReader = require("./file-reader.js") - , LinkReader = require("./link-reader.js") - , SocketReader = require("./socket-reader.js") - , ProxyReader = require("./proxy-reader.js") - -function Reader (props, currentStat) { - var me = this - if (!(me instanceof Reader)) return new Reader(props, currentStat) - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) { - me.error("Must provide a path", null, true) - } - - // polymorphism. - // call fstream.Reader(dir) to get a DirReader object, etc. - // Note that, unlike in the Writer case, ProxyReader is going - // to be the *normal* state of affairs, since we rarely know - // the type of a file prior to reading it. - - - var type - , ClassType - - if (props.type && typeof props.type === "function") { - type = props.type - ClassType = type - } else { - type = getType(props) - ClassType = Reader - } - - if (currentStat && !type) { - type = getType(currentStat) - props[type] = true - props.type = type - } - - switch (type) { - case "Directory": - ClassType = DirReader - break - - case "Link": - // XXX hard links are just files. - // However, it would be good to keep track of files' dev+inode - // and nlink values, and create a HardLinkReader that emits - // a linkpath value of the original copy, so that the tar - // writer can preserve them. - // ClassType = HardLinkReader - // break - - case "File": - ClassType = FileReader - break - - case "SymbolicLink": - ClassType = LinkReader - break - - case "Socket": - ClassType = SocketReader - break - - case null: - ClassType = ProxyReader - break - } - - if (!(me instanceof ClassType)) { - return new ClassType(props) - } - - Abstract.call(me) - - me.readable = true - me.writable = false - - me.type = type - me.props = props - me.depth = props.depth = props.depth || 0 - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - // how DOES one create files on the moon? - // if the path has spaces in it, then UNC will fail. - me._swallowErrors = true - //if (me._path.indexOf(" ") === -1) { - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - //} - } - } - me.basename = props.basename = path.basename(me.path) - me.dirname = props.dirname = path.dirname(me.path) - - // these have served their purpose, and are now just noisy clutter - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - me.filter = typeof props.filter === "function" ? props.filter : null - if (props.sort === "alpha") props.sort = alphasort - - // start the ball rolling. - // this will stat the thing, and then call me._read() - // to start reading whatever it is. - // console.error("calling stat", props.path, currentStat) - me._stat(currentStat) -} - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - -Reader.prototype._stat = function (currentStat) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - - // console.error("Reader._stat", me._path, currentStat) - if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) - else fs[stat](me._path, statCb) - - - function statCb (er, props_) { - // console.error("Reader._stat, statCb", me._path, props_, props_.nlink) - if (er) return me.error(er) - - Object.keys(props_).forEach(function (k) { - props[k] = props_[k] - }) - - // if it's not the expected size, then abort here. - if (undefined !== me.size && props.size !== me.size) { - return me.error("incorrect size") - } - me.size = props.size - - var type = getType(props) - // special little thing for handling hardlinks. - if (type !== "Directory" && props.nlink && props.nlink > 1) { - var k = props.dev + ":" + props.ino - // console.error("Reader has nlink", me._path, k) - if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path - else { - // switch into hardlink mode. - type = me.type = me.props.type = "Link" - me.Link = me.props.Link = true - me.linkpath = me.props.linkpath = hardLinks[k] - // console.error("Hardlink detected, switching mode", me._path, me.linkpath) - // Setting __proto__ would arguably be the "correct" - // approach here, but that just seems too wrong. - me._stat = me._read = LinkReader.prototype._read - } - } - - if (me.type && me.type !== type) { - me.error("Unexpected type: " + type) - } - - // if the filter doesn't pass, then just skip over this one. - // still have to emit end so that dir-walking can move on. - if (me.filter) { - var who = me._proxy || me - // special handling for ProxyReaders - if (!me.filter.call(who, who, props)) { - if (!me._disowned) { - me.abort() - me.emit("end") - me.emit("close") - } - return - } - } - - // last chance to abort or disown before the flow starts! - var events = ["_stat", "stat", "ready"] - var e = 0 - ;(function go () { - if (me._aborted) { - me.emit("end") - me.emit("close") - return - } - - if (me._paused) { - me.once("resume", go) - return - } - - var ev = events[e ++] - if (!ev) return me._read() - me.emit(ev, props) - go() - })() - } -} - -Reader.prototype.pipe = function (dest, opts) { - var me = this - if (typeof dest.add === "function") { - // piping to a multi-compatible, and we've got directory entries. - me.on("entry", function (entry) { - var ret = dest.add(entry) - if (false === ret) { - me.pause() - } - }) - } - - // console.error("R Pipe apply Stream Pipe") - return Stream.prototype.pipe.apply(this, arguments) -} - -Reader.prototype.pause = function (who) { - this._paused = true - who = who || this - this.emit("pause", who) - if (this._stream) this._stream.pause(who) -} - -Reader.prototype.resume = function (who) { - this._paused = false - who = who || this - this.emit("resume", who) - if (this._stream) this._stream.resume(who) - this._read() -} - -Reader.prototype._read = function () { - this.error("Cannot read unknown type: "+this.type) -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js deleted file mode 100644 index 1de8ce9..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js +++ /dev/null @@ -1,38 +0,0 @@ -// Just get the stats, and then don't do anything. -// You can't really "read" from a socket. You "connect" to it. -// Mostly, this is here so that reading a dir with a socket in it -// doesn't blow up. - -module.exports = SocketReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - -inherits(SocketReader, Reader) - -function SocketReader (props) { - var me = this - if (!(me instanceof SocketReader)) throw new Error( - "SocketReader must be called as constructor.") - - if (!(props.type === "Socket" && props.Socket)) { - throw new Error("Non-socket type "+ props.type) - } - - Reader.call(me, props) -} - -SocketReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we have - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js deleted file mode 100644 index decc20e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js +++ /dev/null @@ -1,389 +0,0 @@ - -module.exports = Writer - -var fs = require("../../graceful-fs/graceful-fs.js") - , inherits = require("../../inherits/inherits.js") - , rimraf = require("../../rimraf/rimraf.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , umask = process.platform === "win32" ? 0 : process.umask() - , getType = require("./get-type.js") - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Writer, Abstract) - -Writer.dirmode = 0777 & (~umask) -Writer.filemode = 0666 & (~umask) - -var DirWriter = require("./dir-writer.js") - , LinkWriter = require("./link-writer.js") - , FileWriter = require("./file-writer.js") - , ProxyWriter = require("./proxy-writer.js") - -// props is the desired state. current is optionally the current stat, -// provided here so that subclasses can avoid statting the target -// more than necessary. -function Writer (props, current) { - var me = this - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) me.error("Must provide a path", null, true) - - // polymorphism. - // call fstream.Writer(dir) to get a DirWriter object, etc. - var type = getType(props) - , ClassType = Writer - - switch (type) { - case "Directory": - ClassType = DirWriter - break - case "File": - ClassType = FileWriter - break - case "Link": - case "SymbolicLink": - ClassType = LinkWriter - break - case null: - // Don't know yet what type to create, so we wrap in a proxy. - ClassType = ProxyWriter - break - } - - if (!(me instanceof ClassType)) return new ClassType(props) - - // now get down to business. - - Abstract.call(me) - - // props is what we want to set. - // set some convenience properties as well. - me.type = props.type - me.props = props - me.depth = props.depth || 0 - me.clobber = false === props.clobber ? props.clobber : true - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - me._swallowErrors = true - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - } - } - me.basename = path.basename(props.path) - me.dirname = path.dirname(props.path) - me.linkpath = props.linkpath || null - - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - - if (typeof props.mode === "string") { - props.mode = parseInt(props.mode, 8) - } - - me.readable = false - me.writable = true - - // buffer until ready, or while handling another entry - me._buffer = [] - me.ready = false - - me.filter = typeof props.filter === "function" ? props.filter: null - - // start the ball rolling. - // this checks what's there already, and then calls - // me._create() to call the impl-specific creation stuff. - me._stat(current) -} - -// Calling this means that it's something we can't create. -// Just assert that it's already there, otherwise raise a warning. -Writer.prototype._create = function () { - var me = this - fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) { - if (er) { - return me.warn("Cannot create " + me._path + "\n" + - "Unsupported type: "+me.type, "ENOTSUP") - } - me._finish() - }) -} - -Writer.prototype._stat = function (current) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - , who = me._proxy || me - - if (current) statCb(null, current) - else fs[stat](me._path, statCb) - - function statCb (er, current) { - if (me.filter && !me.filter.call(who, who, current)) { - me._aborted = true - me.emit("end") - me.emit("close") - return - } - - // if it's not there, great. We'll just create it. - // if it is there, then we'll need to change whatever differs - if (er || !current) { - return create(me) - } - - me._old = current - var currentType = getType(current) - - // if it's a type change, then we need to clobber or error. - // if it's not a type change, then let the impl take care of it. - if (currentType !== me.type) { - return rimraf(me._path, function (er) { - if (er) return me.error(er) - me._old = null - create(me) - }) - } - - // otherwise, just handle in the app-specific way - // this creates a fs.WriteStream, or mkdir's, or whatever - create(me) - } -} - -function create (me) { - // console.error("W create", me._path, Writer.dirmode) - - // XXX Need to clobber non-dirs that are in the way, - // unless { clobber: false } in the props. - mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) { - // console.error("W created", path.dirname(me._path), er) - if (er) return me.error(er) - - // later on, we have to set the mode and owner for these - me._madeDir = made - return me._create() - }) -} - -function endChmod (me, want, current, path, cb) { - var wantMode = want.mode - , chmod = want.follow || me.type !== "SymbolicLink" - ? "chmod" : "lchmod" - - if (!fs[chmod]) return cb() - if (typeof wantMode !== "number") return cb() - - var curMode = current.mode & 0777 - wantMode = wantMode & 0777 - if (wantMode === curMode) return cb() - - fs[chmod](path, wantMode, cb) -} - - -function endChown (me, want, current, path, cb) { - // Don't even try it unless root. Too easy to EPERM. - if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() - if (typeof want.uid !== "number" && - typeof want.gid !== "number" ) return cb() - - if (current.uid === want.uid && - current.gid === want.gid) return cb() - - var chown = (me.props.follow || me.type !== "SymbolicLink") - ? "chown" : "lchown" - if (!fs[chown]) return cb() - - if (typeof want.uid !== "number") want.uid = current.uid - if (typeof want.gid !== "number") want.gid = current.gid - - fs[chown](path, want.uid, want.gid, cb) -} - -function endUtimes (me, want, current, path, cb) { - if (!fs.utimes || process.platform === "win32") return cb() - - var utimes = (want.follow || me.type !== "SymbolicLink") - ? "utimes" : "lutimes" - - if (utimes === "lutimes" && !fs[utimes]) { - utimes = "utimes" - } - - if (!fs[utimes]) return cb() - - var curA = current.atime - , curM = current.mtime - , meA = want.atime - , meM = want.mtime - - if (meA === undefined) meA = curA - if (meM === undefined) meM = curM - - if (!isDate(meA)) meA = new Date(meA) - if (!isDate(meM)) meA = new Date(meM) - - if (meA.getTime() === curA.getTime() && - meM.getTime() === curM.getTime()) return cb() - - fs[utimes](path, meA, meM, cb) -} - - -// XXX This function is beastly. Break it up! -Writer.prototype._finish = function () { - var me = this - - // console.error(" W Finish", me._path, me.size) - - // set up all the things. - // At this point, we're already done writing whatever we've gotta write, - // adding files to the dir, etc. - var todo = 0 - var errState = null - var done = false - - if (me._old) { - // the times will almost *certainly* have changed. - // adds the utimes syscall, but remove another stat. - me._old.atime = new Date(0) - me._old.mtime = new Date(0) - // console.error(" W Finish Stale Stat", me._path, me.size) - setProps(me._old) - } else { - var stat = me.props.follow ? "stat" : "lstat" - // console.error(" W Finish Stating", me._path, me.size) - fs[stat](me._path, function (er, current) { - // console.error(" W Finish Stated", me._path, me.size, current) - if (er) { - // if we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier on. - if (er.code === "ENOENT" && - (me.type === "Link" || me.type === "SymbolicLink") && - process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - return - } else return me.error(er) - } - setProps(me._old = current) - }) - } - - return - - function setProps (current) { - endChmod(me, me.props, current, me._path, next("chmod")) - endChown(me, me.props, current, me._path, next("chown")) - endUtimes(me, me.props, current, me._path, next("chown")) - } - - function next (what) { - todo ++ - return function (er) { - // console.error(" W Finish", what, todo) - if (errState) return - if (er) { - er.fstream_finish_call = what - return me.error(errState = er) - } - if (--todo > 0) return - if (done) return - done = true - - // we may still need to set the mode/etc. on some parent dirs - // that were created previously. delay end/close until then. - if (!me._madeDir) return end() - else endMadeDir(me, me._path, end) - - function end (er) { - if (er) { - er.fstream_finish_call = "setupMadeDir" - return me.error(er) - } - // all the props have been set, so we're completely done. - me.emit("end") - me.emit("close") - } - } - } -} - -function endMadeDir (me, p, cb) { - var made = me._madeDir - // everything *between* made and path.dirname(me._path) - // needs to be set up. Note that this may just be one dir. - var d = path.dirname(p) - - endMadeDir_(me, d, function (er) { - if (er) return cb(er) - if (d === made) { - return cb() - } - endMadeDir(me, d, cb) - }) -} - -function endMadeDir_ (me, p, cb) { - var dirProps = {} - Object.keys(me.props).forEach(function (k) { - dirProps[k] = me.props[k] - - // only make non-readable dirs if explicitly requested. - if (k === "mode" && me.type !== "Directory") { - dirProps[k] = dirProps[k] | 0111 - } - }) - - var todo = 3 - , errState = null - fs.stat(p, function (er, current) { - if (er) return cb(errState = er) - endChmod(me, dirProps, current, p, next) - endChown(me, dirProps, current, p, next) - endUtimes(me, dirProps, current, p, next) - }) - - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- todo === 0) return cb() - } -} - -Writer.prototype.pipe = function () { - this.error("Can't pipe from writable stream") -} - -Writer.prototype.add = function () { - this.error("Cannot add to non-Directory type") -} - -Writer.prototype.write = function () { - return true -} - -function objectToString (d) { - return Object.prototype.toString.call(d) -} - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md deleted file mode 100644 index 7d2e681..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js deleted file mode 100644 index be9951e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,312 +0,0 @@ -// 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 = require("fs") - -// there is such a thing as TOO graceful. -if (fs.open === gracefulOpen) return - -var queue = [] - , constants = require("constants") - -exports = module.exports = fs -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync - - -// 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 ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.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 - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) -} - - -// (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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/inherits/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/inherits/README.md deleted file mode 100644 index b2beaed..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js deleted file mode 100644 index 061b396..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown deleted file mode 100644 index 40de04f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown +++ /dev/null @@ -1,61 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js deleted file mode 100644 index bef2e06..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js +++ /dev/null @@ -1,161 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("../../graceful-fs/graceful-fs.js") -} catch (er) { - fs = require("fs") -} - -var lstat = "lstat" -if (process.platform === "win32") { - // not reliable on windows prior to 0.7.9 - var v = process.version.replace(/^v/, '').split(/\.|-/).map(Number) - if (v[0] === 0 && (v[1] < 7 || v[1] == 7 && v[2] < 9)) { - lstat = "stat" - } -} -if (!fs[lstat]) lstat = "stat" -var lstatSync = lstat + "Sync" - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -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 (er.code === "EBUSY" && 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) - }) -} - -function rimraf_ (p, cb) { - fs[lstat](p, function (er, s) { - if (er) { - // already gone - if (er.code === "ENOENT") return cb() - // some other kind of error, permissions, etc. - return cb(er) - } - - return rm_(p, s, false, cb) - }) -} - - -var myGid = function myGid () { - var g = process.getuid && process.getgid() - myGid = function myGid () { return g } - return g -} - -var myUid = function myUid () { - var u = process.getuid && process.getuid() - myUid = function myUid () { return u } - return u -} - - -function writable (s) { - var mode = s.mode || 0777 - , uid = myUid() - , gid = myGid() - return (mode & 0002) - || (gid === s.gid && (mode & 0020)) - || (uid === s.uid && (mode & 0200)) -} - -function rm_ (p, s, didWritableCheck, cb) { - if (!didWritableCheck && !writable(s)) { - // make file writable - // user/group/world, doesn't matter at this point - // since it's about to get nuked. - return fs.chmod(p, s.mode | 0222, function (er) { - if (er) return cb(er) - rm_(p, s, true, cb) - }) - } - - if (!s.isDirectory()) { - return fs.unlink(p, cb) - } - - // directory - fs.readdir(p, function (er, files) { - if (er) return cb(er) - asyncForEach(files.map(function (f) { - return path.join(p, f) - }), function (file, cb) { - rimraf(file, cb) - }, function (er) { - if (er) return cb(er) - fs.rmdir(p, cb) - }) - }) -} - -function asyncForEach (list, fn, cb) { - if (!list.length) cb() - var c = list.length - , errState = null - list.forEach(function (item, i, list) { - fn(item, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- c === 0) return cb() - }) - }) -} - -// this looks simpler, but it will fail with big directory trees, -// or on slow stupid awful cygwin filesystems -function rimrafSync (p) { - try { - var s = fs[lstatSync](p) - } catch (er) { - if (er.code === "ENOENT") return - throw er - } - - if (!writable(s)) { - fs.chmodSync(p, s.mode | 0222) - } - - if (!s.isDirectory()) return fs.unlinkSync(p) - - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/LICENSE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/LICENSE deleted file mode 100644 index 0d8dbe4..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud - -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/README.md deleted file mode 100644 index b1f3e50..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/underscore.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/underscore.js deleted file mode 100644 index a12f0d9..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/lodash/vendor/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/LICENSE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/README.md deleted file mode 100644 index 6fd07d2..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -### 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. **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 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. - - -## 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.) diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/minimatch.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/minimatch.js deleted file mode 100644 index 405746b..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1079 +0,0 @@ -;(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.monkeyPatch = monkeyPatch -function monkeyPatch () { - var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") - var orig = desc.value - desc.value = function (p) { - if (p instanceof Minimatch) return p.match(this) - return orig.call(this, p) - } - Object.defineProperty(String.prototype, desc) -} - -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.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) console.error(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) - }) - - if (options.debug) console.error(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - if (options.debug) console.error(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - if (options.debug) console.error(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) !== "{") { - // console.error(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error(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) { - // console.error("no sets") - return [pattern] - } - - var tail = braceExpand(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) { - // console.error("numset", numset[1], numset[2]) - var suf = braceExpand(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 = "" - } - - // console.error("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error("", 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) { - // console.error("didn't close", pattern) - return braceExpand("\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - // console.error("set", set) - // console.error("suffix", pattern.substr(i)) - var suf = braceExpand(pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - // console.error("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand(p, options) - }) - // console.error("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}(?:$|\\\/))" - : "(?!\\.)" - - 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 - } - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - if (options.debug) { - console.error("%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 "!": - if (options.debug) { - console.error("%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) { - 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. - 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 === "!" ? "(?:(?!" : "(?:" - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - 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 - } - - 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 + "|" - }) - - // console.error("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) { - // console.error("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) - if (options.debug) { - console.error(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 - // console.error(this.pattern, "set", set) - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i] - var hit = this.matchOne(f, 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 - - if (options.debug) { - console.error("matchOne", - { "this": this - , file: file - , pattern: pattern }) - } - - if (options.matchBase && pattern.length === 1) { - file = path.basename(file.join("/")).split("/") - } - - if (options.debug) { - console.error("matchOne", file.length, pattern.length) - } - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - if (options.debug) { - console.error("matchOne loop") - } - var p = pattern[pi] - , f = file[fi] - - if (options.debug) { - console.error(pattern, p, f) - } - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - if (options.debug) - console.error('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) { - if (options.debug) - console.error('** 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] - - if (options.debug) { - console.error('\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)) { - if (options.debug) - console.error('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) === ".")) { - if (options.debug) - console.error("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - if (options.debug) - console.error('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 - // console.error("\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 - } - if (options.debug) { - console.error("string match", p, f, hit) - } - } else { - hit = f.match(p) - if (options.debug) { - console.error("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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/AUTHORS deleted file mode 100644 index 016d7fb..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Carlos Brito Lage -Marko Mikulicic -Trent Mick -Kevin O'Hara -Marco Rogers -Jesse Dailey diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f9..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/bench.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/bench.js deleted file mode 100644 index 9111540..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/bench.js +++ /dev/null @@ -1,25 +0,0 @@ -var LRU = require('lru-cache'); - -var max = +process.argv[2] || 10240; -var more = 102400; - -var cache = LRU({ - max: max, maxAge: 86400e3 -}); - -// fill cache -for (var i = 0; i < max; ++i) { - cache.set(i, {}); -} - -var start = process.hrtime(); - -// adding more items -for ( ; i < max+more; ++i) { - cache.set(i, {}); -} - -var end = process.hrtime(start); -var msecs = end[0] * 1E3 + end[1] / 1E6; - -console.log('adding %d items took %d ms', more, msecs.toPrecision(5)); diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 49c1dc6..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,263 +0,0 @@ -;(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) - } - - var max - if (typeof options === 'number') { - max = options - options = { max: max } - } - - if (!options) options = {} - - max = options.max - - var lengthCalculator = options.length || naiveLength - - if (typeof lengthCalculator !== "function") { - lengthCalculator = naiveLength - } - - if (!max || !(typeof max === "number") || max <= 0 ) { - // a little bit silly. maybe this should throw? - max = Infinity - } - - var allowStale = options.stale || false - - var maxAge = options.maxAge || null - - var dispose = options.dispose - - var cache = Object.create(null) // hash of items by key - , lruList = Object.create(null) // list of items in order of use recency - , mru = 0 // most recently used - , lru = 0 // least recently used - , length = 0 // number of items in the list - , itemCount = 0 - - - // resize the cache when the max changes. - Object.defineProperty(this, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - max = mL - // if it gets above double max, trim right away. - // otherwise, do it whenever it's convenient. - if (length > max) trim() - } - , get : function () { return max } - , enumerable : true - }) - - // resize the cache when the lengthCalculator changes. - Object.defineProperty(this, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - lengthCalculator = naiveLength - length = itemCount - for (var key in cache) { - cache[key].length = 1 - } - } else { - lengthCalculator = lC - length = 0 - for (var key in cache) { - cache[key].length = lengthCalculator(cache[key].value) - length += cache[key].length - } - } - - if (length > max) trim() - } - , get : function () { return lengthCalculator } - , enumerable : true - }) - - Object.defineProperty(this, "length", - { get : function () { return length } - , enumerable : true - }) - - - Object.defineProperty(this, "itemCount", - { get : function () { return itemCount } - , enumerable : true - }) - - this.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - i++ - var hit = lruList[k] - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } - } - - this.keys = function () { - var keys = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - keys[i++] = hit.key - } - return keys - } - - this.values = function () { - var values = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - values[i++] = hit.value - } - return values - } - - this.reset = function () { - if (dispose) { - for (var k in cache) { - dispose(k, cache[k].value) - } - } - cache = {} - lruList = {} - lru = 0 - mru = 0 - length = 0 - itemCount = 0 - } - - // Provided for debugging/dev purposes only. No promises whatsoever that - // this API stays stable. - this.dump = function () { - return cache - } - - this.dumpLru = function () { - return lruList - } - - this.set = function (key, value) { - if (hOP(cache, key)) { - // dispose of the old one before overwriting - if (dispose) dispose(key, cache[key].value) - if (maxAge) cache[key].now = Date.now() - cache[key].value = value - this.get(key) - return true - } - - var len = lengthCalculator(value) - var age = maxAge ? Date.now() : 0 - var hit = new Entry(key, value, mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > max) { - if (dispose) dispose(key, value) - return false - } - - length += hit.length - lruList[hit.lu] = cache[key] = hit - itemCount ++ - - if (length > max) trim() - return true - } - - this.has = function (key) { - if (!hOP(cache, key)) return false - var hit = cache[key] - if (maxAge && (Date.now() - hit.now > maxAge)) { - return false - } - return true - } - - this.get = function (key) { - return get(key, true) - } - - this.peek = function (key) { - return get(key, false) - } - - function get (key, doUse) { - var hit = cache[key] - if (hit) { - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } else { - if (doUse) use(hit) - } - if (hit) hit = hit.value - } - return hit - } - - function use (hit) { - shiftLU(hit) - hit.lu = mru ++ - lruList[hit.lu] = hit - } - - this.del = function (key) { - del(cache[key]) - } - - function trim () { - while (lru < mru && length > max) - del(lruList[lru]) - } - - function shiftLU(hit) { - delete lruList[ hit.lu ] - while (lru < mru && !lruList[lru]) lru ++ - } - - function del(hit) { - if (hit) { - if (dispose) dispose(hit.key, hit.value) - length -= hit.length - itemCount -- - delete cache[ hit.key ] - shiftLU(hit) - } - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, mru, len, age) { - this.key = key - this.value = value - this.lu = mru - this.length = len - this.now = age -} - -})() diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 411acad..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.3.1", - "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" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Carlos Brito Lage", - "email": "carlos@carloslage.net" - }, - { - "name": "Marko Mikulicic", - "email": "marko.mikulicic@isti.cnr.it" - }, - { - "name": "Trent Mick", - "email": "trentm@gmail.com" - }, - { - "name": "Kevin O'Hara", - "email": "kevinohara80@gmail.com" - }, - { - "name": "Marco Rogers", - "email": "marco.rogers@gmail.com" - }, - { - "name": "Jesse Dailey", - "email": "jesse.dailey@gmail.com" - } - ], - "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" - }, - "_id": "lru-cache@2.3.1", - "_from": "lru-cache@2" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index 70f3f8b..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,329 +0,0 @@ -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() -}) diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b0..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index ec8e2eb..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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" - }, - "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/package.json b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/package.json deleted file mode 100644 index a347405..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "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.12", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "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!\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### 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. **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 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\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "_id": "minimatch@0.2.12", - "_from": "minimatch@~0.2.11" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/basic.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/brace-expand.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index 7ee278a..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/caching.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/defaults.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 25f1f60..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// 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/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/package.json b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/package.json deleted file mode 100644 index b529099..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "globule", - "description": "An easy-to-use wildcard globbing library.", - "version": "0.1.0", - "homepage": "https://github.com/cowboy/node-globule", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/node-globule.git" - }, - "bugs": { - "url": "https://github.com/cowboy/node-globule/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cowboy/node-globule/blob/master/LICENSE-MIT" - } - ], - "main": "lib/globule", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt nodeunit" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-watch": "~0.2.0", - "grunt": "~0.4.1" - }, - "keywords": [ - "glob", - "file", - "match", - "mapping", - "expand", - "wildcard", - "pattern", - "sync", - "awesome" - ], - "dependencies": { - "lodash": "~1.0.1", - "glob": "~3.1.21", - "minimatch": "~0.2.11" - }, - "readme": "# globule [![Build Status](https://secure.travis-ci.org/cowboy/node-globule.png?branch=master)](http://travis-ci.org/cowboy/node-globule)\n\nAn easy-to-use wildcard globbing library.\n\n## Getting Started\nInstall the module with: `npm install globule`\n\n```javascript\nvar globule = require('globule');\nvar filepaths = globule.find('**/*.js');\n```\n\n## Documentation\n\n### globule.find\nReturns a unique array of all file or directory paths that match the given globbing pattern(s). This method accepts either comma separated globbing patterns or an array of globbing patterns. Paths matching patterns that begin with `!` will be excluded from the returned array. Patterns are processed in order, so inclusion and exclusion order is significant.\n\n```js\nglobule.find(patterns [, options])\n```\n\nThe `options` object supports all [glob][] library options, along with a few extras. These are the most commonly used:\n\n* `filter` Either a valid [fs.Stats method name](http://nodejs.org/docs/latest/api/fs.html#fs_class_fs_stats) or a function that will be passed the matched `src` filepath and `options` object as arguments. This function should return a `Boolean` value.\n* `nonull` Retain globbing patterns in result set even if they fail to match files.\n* `matchBase` Patterns without slashes will match just the basename part. Eg. this makes `*.js` work like `**/*.js`.\n* `srcBase` Patterns will be matched relative to the specified path instead of the current working directory. This is a synonym for `cwd`.\n* `prefixBase` Any specified `srcBase` will be prefixed to all returned filepaths.\n\n[glob]: https://github.com/isaacs/node-glob\n\n### globule.match\nMatch one or more globbing patterns against one or more file paths. Returns a uniqued array of all file paths that match any of the specified globbing patterns. Both the `patterns` and `filepaths` arguments can be a single string or array of strings. Paths matching patterns that begin with `!` will be excluded from the returned array. Patterns are processed in order, so inclusion and exclusion order is significant.\n\n```js\ngrunt.file.match(patterns, filepaths [, options])\n```\n\n### globule.isMatch\nThis method contains the same signature and logic as the `globule.match` method, but returns `true` if any files were matched, otherwise `false`.\n\n```js\ngrunt.file.isMatch(patterns, filepaths [, options])\n```\n\n### globule.mapping\nGiven a set of source file paths, returns an array of src-dest file mapping objects. Both src and dest paths may be renamed, depending on the options specified.\n\n```js\nglobule.mapping(filepaths [, options])\n```\n\nIn addition to the options the `globule.find` method supports, the options object also supports these properties:\n\n* `srcBase` The directory from which patterns are matched. Any string specified as `srcBase` is effectively stripped from the beginning of all matched paths.\n* `destBase` The specified path is prefixed to all `dest` filepaths.\n* `ext` Remove anything after (and including) the first `.` in the destination path, then append this value.\n* `extDot` Change the behavior of `ext`, `\"first\"` and `\"last\"` will remove anything after the first or last `.` in the destination filename, respectively. Defaults to `\"first\"`.\n* `flatten` Remove the path component from all matched src files. The src file path is still joined to the specified destBase.\n* `rename` If specified, this function will be responsible for returning the final `dest` filepath. By default, it flattens paths (if specified), changes extensions (if specified) and joins the matched path to the `destBase`.\n\n### globule.findMapping\nThis method is a convenience wrapper around the `globule.find` and `globule.mapping` methods.\n\n```js\nglobule.findMapping(patterns [, options])\n```\n\n\n## Examples\n\nGiven the files `foo/a.js` and `foo/b.js`:\n\n### srcBase and destBase\n\n```js\nglobule.find(\"foo/*.js\")\n// [\"foo/a.js\", \"foo/b.js\"]\n\nglobule.find(\"*.js\", {srcBase: \"foo\"})\n// [\"a.js\", \"b.js\"]\n\nglobule.find(\"*.js\", {srcBase: \"foo\", prefixBase: true})\n// [\"foo/a.js\", \"foo/b.js\"]\n```\n\n```js\nglobule.findMapping(\"foo/*.js\")\n// [{src: \"foo/a.js\", dest: \"foo/a.js\"}, {src: \"foo/b.js\", dest: \"foo/b.js\"}]\n\nglobule.findMapping(\"foo/*.js\", {destBase: \"bar\"})\n// [{src: \"foo/a.js\", dest: \"bar/foo/a.js\"}, {src: \"foo/b.js\", dest: \"bar/foo/b.js\"}]\n\nglobule.findMapping(\"*.js\", {srcBase: \"foo\", destBase: \"bar\"})\n// [{src: \"foo/a.js\", dest: \"bar/a.js\"}, {src: \"foo/b.js\", dest: \"bar/b.js\"}]\n```\n\n```js\nglobule.mapping([\"foo/a.js\", \"foo/b.js\"])\n// [{src: \"foo/a.js\", dest: \"foo/a.js\"}, {src: \"foo/b.js\", dest: \"foo/b.js\"}]\n\nglobule.mapping([\"foo/a.js\", \"foo/b.js\"], {destBase: \"bar\"})\n// [{src: \"foo/a.js\", dest: \"bar/foo/a.js\"}, {src: \"foo/b.js\", dest: \"bar/foo/b.js\"}]\n\nglobule.mapping([\"a.js\", \"b.js\"], {srcBase: \"foo\", destBase: \"bar\"})\n// [{src: \"foo/a.js\", dest: \"bar/a.js\"}, {src: \"foo/b.js\", dest: \"bar/b.js\"}]\n```\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\n_(Nothing yet)_\n\n## License\nCopyright (c) 2013 \"Cowboy\" Ben Alman \nLicensed under the MIT license.\n", - "readmeFilename": "README.md", - "_id": "globule@0.1.0", - "dist": { - "shasum": "fb62afcc20d4e236ab829ba24e12d129910a3ff2" - }, - "_from": "globule@~0.1.0", - "_resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/README.md b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/css/baz.css b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/css/baz.css deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/css/qux.css b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/css/qux.css deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/deep/deep.txt b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/deep/deep.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/deep/deeper/deeper.txt b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/deep/deeper/deeper.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/deep/deeper/deepest/deepest.txt b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/deep/deeper/deepest/deepest.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/js/bar.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/js/bar.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/js/foo.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/fixtures/expand/js/foo.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/globule_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/globule_test.js deleted file mode 100644 index 9b55b6b..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/test/globule_test.js +++ /dev/null @@ -1,486 +0,0 @@ -'use strict'; - -var path = require('path'); - -var globule = require('../lib/globule.js'); - -/* - ======== 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['match'] = { - 'empty set': function(test) { - test.expect(6); - // Should return empty set if a required argument is missing or an empty set. - test.deepEqual(globule.match(null, 'foo.js'), [], 'should return empty set.'); - test.deepEqual(globule.match('*.js', null), [], 'should return empty set.'); - test.deepEqual(globule.match([], 'foo.js'), [], 'should return empty set.'); - test.deepEqual(globule.match('*.js', []), [], 'should return empty set.'); - test.deepEqual(globule.match(null, ['foo.js']), [], 'should return empty set.'); - test.deepEqual(globule.match(['*.js'], null), [], 'should return empty set.'); - test.done(); - }, - 'basic matching': function(test) { - test.expect(6); - test.deepEqual(globule.match('*.js', 'foo.js'), ['foo.js'], 'should match correctly.'); - test.deepEqual(globule.match('*.js', ['foo.js']), ['foo.js'], 'should match correctly.'); - test.deepEqual(globule.match('*.js', ['foo.js', 'bar.css']), ['foo.js'], 'should match correctly.'); - test.deepEqual(globule.match(['*.js', '*.css'], 'foo.js'), ['foo.js'], 'should match correctly.'); - test.deepEqual(globule.match(['*.js', '*.css'], ['foo.js']), ['foo.js'], 'should match correctly.'); - test.deepEqual(globule.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(globule.match('*.js', 'foo.css'), [], 'should fail to match.'); - test.deepEqual(globule.match('*.js', ['foo.css', 'bar.css']), [], 'should fail to match.'); - test.done(); - }, - 'unique': function(test) { - test.expect(2); - test.deepEqual(globule.match('*.js', ['foo.js', 'foo.js']), ['foo.js'], 'should return a uniqued set.'); - test.deepEqual(globule.match(['*.js', '*.*'], ['foo.js', 'foo.js']), ['foo.js'], 'should return a uniqued set.'); - test.done(); - }, - 'flatten': function(test) { - test.expect(1); - test.deepEqual(globule.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(globule.match(['!*.js'], ['foo.js', 'bar.js']), [], 'solitary exclusion should match nothing'); - test.deepEqual(globule.match(['*.js', '!*.js'], ['foo.js', 'bar.js']), [], 'exclusion should cancel match'); - test.deepEqual(globule.match(['*.js', '!f*.js'], ['foo.js', 'bar.js', 'baz.js']), - ['bar.js', 'baz.js'], - 'partial exclusion should partially cancel match'); - test.deepEqual(globule.match(['*.js', '!*.js', 'b*.js'], ['foo.js', 'bar.js', 'baz.js']), - ['bar.js', 'baz.js'], - 'inclusion / exclusion order matters'); - test.deepEqual(globule.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(globule.match('*.js', ['foo.js', 'bar', 'baz/xyz.js'], {matchBase: true}), - ['foo.js', 'baz/xyz.js'], - 'should matchBase (minimatch) when specified.'); - test.deepEqual(globule.match('*.js', ['foo.js', 'bar', 'baz/xyz.js']), - ['foo.js'], - 'should not matchBase (minimatch) by default.'); - test.done(); - }, -}; - -exports['isMatch'] = { - 'basic matching': function(test) { - test.expect(6); - test.ok(globule.isMatch('*.js', 'foo.js'), 'should match correctly.'); - test.ok(globule.isMatch('*.js', ['foo.js']), 'should match correctly.'); - test.ok(globule.isMatch('*.js', ['foo.js', 'bar.css']), 'should match correctly.'); - test.ok(globule.isMatch(['*.js', '*.css'], 'foo.js'), 'should match correctly.'); - test.ok(globule.isMatch(['*.js', '*.css'], ['foo.js']), 'should match correctly.'); - test.ok(globule.isMatch(['*.js', '*.css'], ['foo.js', 'bar.css']), 'should match correctly.'); - test.done(); - }, - 'no matches': function(test) { - test.expect(6); - test.ok(!globule.isMatch('*.js', 'foo.css'), 'should fail to match.'); - test.ok(!globule.isMatch('*.js', ['foo.css', 'bar.css']), 'should fail to match.'); - test.ok(!globule.isMatch(null, 'foo.css'), 'should fail to match.'); - test.ok(!globule.isMatch('*.js', null), 'should fail to match.'); - test.ok(!globule.isMatch([], 'foo.css'), 'should fail to match.'); - test.ok(!globule.isMatch('*.js', []), 'should fail to match.'); - test.done(); - }, - 'options.matchBase': function(test) { - test.expect(2); - test.ok(globule.isMatch('*.js', ['baz/xyz.js'], {matchBase: true}), 'should matchBase (minimatch) when specified.'); - test.ok(!globule.isMatch('*.js', ['baz/xyz.js']), 'should not matchBase (minimatch) by default.'); - test.done(); - }, -}; - -exports['find'] = { - setUp: function(done) { - this.cwd = process.cwd(); - process.chdir('test/fixtures/expand'); - done(); - }, - tearDown: function(done) { - process.chdir(this.cwd); - done(); - }, - 'basic matching': function(test) { - test.expect(5); - test.deepEqual(globule.find('**/*.js'), ['js/bar.js', 'js/foo.js'], 'single pattern argument should match.'); - test.deepEqual(globule.find('**/*.js', '**/*.css'), - ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], - 'multiple pattern arguments should match.'); - test.deepEqual(globule.find(['**/*.js', '**/*.css']), - ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], - 'array of patterns should match.'); - test.deepEqual(globule.find([['**/*.js'], [['**/*.css', 'js/*.js']]]), - ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], - 'array of arrays of patterns should be flattened.'); - test.deepEqual(globule.find('*.xyz'), [], 'bad pattern should fail to match.'); - test.done(); - }, - 'unique': function(test) { - test.expect(4); - test.deepEqual(globule.find('**/*.js', 'js/*.js'), - ['js/bar.js', 'js/foo.js'], - 'file list should be uniqed.'); - test.deepEqual(globule.find('**/*.js', '**/*.css', 'js/*.js'), ['js/bar.js', 'js/foo.js', - 'css/baz.css', 'css/qux.css'], - 'file list should be uniqed.'); - test.deepEqual(globule.find('js', 'js/'), - ['js', 'js/'], - 'mixed non-ending-/ and ending-/ dirs will not be uniqed by default.'); - test.deepEqual(globule.find('js', 'js/', {mark: true}), - ['js/'], - 'mixed non-ending-/ and ending-/ dirs will be uniqed when "mark" is specified.'); - test.done(); - }, - 'file order': function(test) { - test.expect(5); - var actual = globule.find('**/*.{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 = globule.find('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 = globule.find('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 = globule.find('**/*.{js,css}', '!css/qux.css', 'css/qux.css'); - expected = ['css/baz.css', 'js/bar.js', 'js/foo.js', 'css/qux.css']; - test.deepEqual(actual, expected, 'if a file is excluded and then re-added, it should be added at the end.'); - - actual = globule.find('js/foo.js', '**/*.{js,css}', '!css/qux.css', 'css/qux.css'); - expected = ['js/foo.js', 'css/baz.css', 'js/bar.js', 'css/qux.css']; - test.deepEqual(actual, expected, 'should be able to combine specified-up-front and excluded/added-at-end.'); - test.done(); - }, - 'exclusion': function(test) { - test.expect(8); - test.deepEqual(globule.find(['!js/*.js']), [], 'solitary exclusion should match nothing'); - test.deepEqual(globule.find(['js/bar.js','!js/bar.js']), [], 'exclusion should negate match'); - test.deepEqual(globule.find(['**/*.js', '!js/foo.js']), - ['js/bar.js'], - 'should omit single file from matched set'); - test.deepEqual(globule.find(['!js/foo.js', '**/*.js']), - ['js/bar.js', 'js/foo.js'], - 'inclusion / exclusion order matters'); - test.deepEqual(globule.find(['**/*.js', '**/*.css', '!js/bar.js', '!css/baz.css']), - ['js/foo.js','css/qux.css'], - 'multiple exclusions should be removed from the set'); - test.deepEqual(globule.find(['**/*.js', '**/*.css', '!**/*.css']), - ['js/bar.js', 'js/foo.js'], - 'excluded wildcards should be removed from the matched set'); - test.deepEqual(globule.find(['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(globule.find(['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.mark': function(test) { - test.expect(4); - test.deepEqual(globule.find('**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(globule.find('**d*/**/'), [ - 'deep/', - 'deep/deeper/', - 'deep/deeper/deepest/'], 'trailing / in pattern should match directories only, matches end in /.'); - test.deepEqual(globule.find('**d*/**', {mark: true}), [ - '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(globule.find('**d*/**/', {mark: true}), [ - 'deep/', - 'deep/deeper/', - 'deep/deeper/deepest/'], 'the minimatch "mark" option should not remove trailing / from matched paths.'); - test.done(); - }, - 'options.filter': function(test) { - test.expect(5); - test.deepEqual(globule.find('**d*/**', {filter: 'isFile'}), [ - 'deep/deep.txt', - 'deep/deeper/deeper.txt', - 'deep/deeper/deepest/deepest.txt' - ], 'should match files only.'); - test.deepEqual(globule.find('**d*/**', {filter: 'isDirectory'}), [ - 'deep', - 'deep/deeper', - 'deep/deeper/deepest' - ], 'should match directories only.'); - test.deepEqual(globule.find('**', { - arbitraryProp: /deepest/, - filter: function(filepath, options) { - return options.arbitraryProp.test(filepath); - } - }), [ - 'deep/deeper/deepest', - 'deep/deeper/deepest/deepest.txt', - ], 'should filter arbitrarily.'); - test.deepEqual(globule.find('js', 'css', {filter: 'isFile'}), [], 'should fail to match.'); - test.deepEqual(globule.find('**/*.js', {filter: 'isDirectory'}), [], 'should fail to match.'); - test.done(); - }, - 'options.matchBase': function(test) { - test.expect(3); - test.deepEqual(globule.find('*.js'), [], 'should not matchBase (minimatch) by default.'); - test.deepEqual(globule.find('*.js', {matchBase: true}), - ['js/bar.js', 'js/foo.js'], - 'matchBase option should be passed through to minimatch.'); - test.deepEqual(globule.find('*.js', '*.css', {matchBase: true}), - ['js/bar.js', 'js/foo.js', 'css/baz.css', 'css/qux.css'], - 'matchBase option should be passed through to minimatch.'); - test.done(); - }, - 'options.srcBase': function(test) { - test.expect(5); - test.deepEqual(globule.find(['**/deep*.txt'], {srcBase: 'deep'}), - ['deep.txt', 'deeper/deeper.txt', 'deeper/deepest/deepest.txt'], - 'should find paths matching pattern relative to srcBase.'); - test.deepEqual(globule.find(['**/deep*.txt'], {cwd: 'deep'}), - ['deep.txt', 'deeper/deeper.txt', 'deeper/deepest/deepest.txt'], - 'cwd and srcBase should do the same thing.'); - test.deepEqual(globule.find(['**/deep*'], {srcBase: 'deep', filter: 'isFile'}), - ['deep.txt', 'deeper/deeper.txt', 'deeper/deepest/deepest.txt'], - 'srcBase should not prevent filtering.'); - test.deepEqual(globule.find(['**/deep*'], {srcBase: 'deep', filter: 'isDirectory'}), - ['deeper', 'deeper/deepest'], - 'srcBase should not prevent filtering.'); - test.deepEqual(globule.find(['**/deep*.txt', '!**/deeper**'], {srcBase: 'deep'}), - ['deep.txt', 'deeper/deepest/deepest.txt'], - 'srcBase should not prevent exclusions.'); - test.done(); - }, - 'options.prefixBase': function(test) { - test.expect(2); - test.deepEqual(globule.find(['**/deep*.txt'], {srcBase: 'deep', prefixBase: false}), - ['deep.txt', 'deeper/deeper.txt', 'deeper/deepest/deepest.txt'], - 'should not prefix srcBase to returned paths.'); - test.deepEqual(globule.find(['**/deep*.txt'], {srcBase: 'deep', prefixBase: true}), - ['deep/deep.txt', 'deep/deeper/deeper.txt', 'deep/deeper/deepest/deepest.txt'], - 'should prefix srcBase to returned paths.'); - test.done(); - }, - 'options.nonull': function(test) { - test.expect(3); - test.deepEqual(globule.find(['*omg*'], {nonull: true}), - ['*omg*'], - 'non-matching patterns should be returned in result set.'); - test.deepEqual(globule.find(['js/a*', 'js/b*', 'js/c*'], {nonull: true}), - ['js/a*', 'js/bar.js', 'js/c*'], - 'non-matching patterns should be returned in result set.'); - test.deepEqual(globule.find(['js/foo.js', 'js/bar.js', 'js/nonexistent.js'], {nonull: true}), - ['js/foo.js', 'js/bar.js', 'js/nonexistent.js'], - 'non-matching filenames should be returned in result set.'); - test.done(); - }, -}; - -exports['mapping'] = { - 'basic mapping': function(test) { - test.expect(1); - - var actual = globule.mapping(['a.txt', 'b.txt', 'c.txt']); - var expected = [ - {dest: 'a.txt', src: ['a.txt']}, - {dest: 'b.txt', src: ['b.txt']}, - {dest: 'c.txt', src: ['c.txt']}, - ]; - test.deepEqual(actual, expected, 'default options should create same-to-same src-dest mappings.'); - - test.done(); - }, - 'options.srcBase': function(test) { - test.expect(2); - var actual, expected; - actual = globule.mapping(['a.txt', 'bar/b.txt', 'bar/baz/c.txt'], {srcBase: 'foo'}); - expected = [ - {dest: 'a.txt', src: ['foo/a.txt']}, - {dest: 'bar/b.txt', src: ['foo/bar/b.txt']}, - {dest: 'bar/baz/c.txt', src: ['foo/bar/baz/c.txt']}, - ]; - test.deepEqual(actual, expected, 'srcBase should be prefixed to src paths (no trailing /).'); - - actual = globule.mapping(['a.txt', 'bar/b.txt', 'bar/baz/c.txt'], {srcBase: 'foo/'}); - test.deepEqual(actual, expected, 'srcBase should be prefixed to src paths (trailing /).'); - - test.done(); - }, - 'options.destBase': function(test) { - test.expect(2); - var actual, expected; - - actual = globule.mapping(['a.txt', 'bar/b.txt', 'bar/baz/c.txt'], {destBase: 'dest'}); - expected = [ - {dest: 'dest/a.txt', src: ['a.txt']}, - {dest: 'dest/bar/b.txt', src: ['bar/b.txt']}, - {dest: 'dest/bar/baz/c.txt', src: ['bar/baz/c.txt']}, - ]; - test.deepEqual(actual, expected, 'destBase should be prefixed to dest paths (no trailing /).'); - - actual = globule.mapping(['a.txt', 'bar/b.txt', 'bar/baz/c.txt'], {destBase: 'dest/'}); - test.deepEqual(actual, expected, 'destBase should be prefixed to dest paths (trailing /).'); - - test.done(); - }, - 'options.flatten': function(test) { - test.expect(1); - var actual, expected; - - actual = globule.mapping(['a.txt', 'bar/b.txt', 'bar/baz/c.txt'], {flatten: true}); - expected = [ - {dest: 'a.txt', src: ['a.txt']}, - {dest: 'b.txt', src: ['bar/b.txt']}, - {dest: 'c.txt', src: ['bar/baz/c.txt']}, - ]; - test.deepEqual(actual, expected, 'flatten should remove all src path parts from dest.'); - - test.done(); - }, - 'options.flatten + options.destBase': function(test) { - test.expect(1); - var actual, expected; - - actual = globule.mapping(['a.txt', 'bar/b.txt', 'bar/baz/c.txt'], {destBase: 'dest', flatten: true}); - expected = [ - {dest: 'dest/a.txt', src: ['a.txt']}, - {dest: 'dest/b.txt', src: ['bar/b.txt']}, - {dest: 'dest/c.txt', src: ['bar/baz/c.txt']}, - ]; - test.deepEqual(actual, expected, 'flatten and destBase should work together.'); - - test.done(); - }, - 'options.ext': function(test) { - test.expect(1); - var actual, expected; - - actual = globule.mapping(['x/a.js', 'x.y/b.min.js', 'x.y/z.z/c'], {ext: '.foo'}); - expected = [ - {dest: 'x/a.foo', src: ['x/a.js']}, - {dest: 'x.y/b.foo', src: ['x.y/b.min.js']}, - {dest: 'x.y/z.z/c.foo', src: ['x.y/z.z/c']}, - ]; - test.deepEqual(actual, expected, 'by default, ext should replace everything after the first dot in the filename.'); - - test.done(); - }, - 'options.extDot': function(test) { - test.expect(2); - var actual, expected; - - actual = globule.mapping(['x/a.js', 'x.y/b.bbb.min.js', 'x.y/z.z/c'], {ext: '.foo', extDot: 'first'}); - expected = [ - {dest: 'x/a.foo', src: ['x/a.js']}, - {dest: 'x.y/b.foo', src: ['x.y/b.bbb.min.js']}, - {dest: 'x.y/z.z/c.foo', src: ['x.y/z.z/c']}, - ]; - test.deepEqual(actual, expected, 'extDot of "first" should replace everything after the first dot in the filename.'); - - actual = globule.mapping(['x/a.js', 'x.y/b.bbb.min.js', 'x.y/z.z/c'], {ext: '.foo', extDot: 'last'}); - expected = [ - {dest: 'x/a.foo', src: ['x/a.js']}, - {dest: 'x.y/b.bbb.min.foo', src: ['x.y/b.bbb.min.js']}, - {dest: 'x.y/z.z/c.foo', src: ['x.y/z.z/c']}, - ]; - test.deepEqual(actual, expected, 'extDot of "last" should replace everything after the last dot in the filename.'); - - test.done(); - }, - 'options.rename': function(test) { - test.expect(1); - var actual, expected; - actual = globule.mapping(['a.txt', 'bar/b.txt', 'bar/baz/c.txt'], { - arbitraryProp: 'FOO', - rename: function(dest, options) { - return path.join(options.arbitraryProp, dest.toUpperCase()); - } - }); - expected = [ - {dest: 'FOO/A.TXT', src: ['a.txt']}, - {dest: 'FOO/BAR/B.TXT', src: ['bar/b.txt']}, - {dest: 'FOO/BAR/BAZ/C.TXT', src: ['bar/baz/c.txt']}, - ]; - test.deepEqual(actual, expected, 'allow arbitrary renaming of files.'); - - test.done(); - }, -}; - -exports['findMapping'] = { - setUp: function(done) { - this.cwd = process.cwd(); - process.chdir('test/fixtures'); - done(); - }, - tearDown: function(done) { - process.chdir(this.cwd); - done(); - }, - 'basic matching': function(test) { - test.expect(2); - - var actual = globule.findMapping(['expand/**/*.txt']); - var expected = [ - {dest: 'expand/deep/deep.txt', src: ['expand/deep/deep.txt']}, - {dest: 'expand/deep/deeper/deeper.txt', src: ['expand/deep/deeper/deeper.txt']}, - {dest: 'expand/deep/deeper/deepest/deepest.txt', src: ['expand/deep/deeper/deepest/deepest.txt']}, - ]; - test.deepEqual(actual, expected, 'default options'); - - expected = globule.mapping(globule.find(['expand/**/*.txt'])); - test.deepEqual(actual, expected, 'this is what it\'s doing under the hood, anwyays.'); - - test.done(); - }, - 'options.srcBase': function(test) { - test.expect(1); - var actual = globule.findMapping(['**/*.txt'], {destBase: 'dest', srcBase: 'expand/deep'}); - var expected = [ - {dest: 'dest/deep.txt', src: ['expand/deep/deep.txt']}, - {dest: 'dest/deeper/deeper.txt', src: ['expand/deep/deeper/deeper.txt']}, - {dest: 'dest/deeper/deepest/deepest.txt', src: ['expand/deep/deeper/deepest/deepest.txt']}, - ]; - test.deepEqual(actual, expected, 'srcBase should be stripped from front of destPath, pre-destBase+destPath join'); - test.done(); - }, -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/package.json b/node_modules/grunt-contrib-watch/node_modules/gaze/package.json deleted file mode 100644 index 3c9aa54..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "name": "gaze", - "description": "A globbing fs.watch wrapper built from the best parts of other fine watch libs.", - "version": "0.4.3", - "homepage": "https://github.com/shama/gaze", - "author": { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/shama/gaze.git" - }, - "bugs": { - "url": "https://github.com/shama/gaze/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/shama/gaze/blob/master/LICENSE-MIT" - } - ], - "main": "lib/gaze", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt nodeunit -v" - }, - "dependencies": { - "globule": "~0.1.0" - }, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-nodeunit": "~0.2.0", - "grunt-contrib-jshint": "~0.6.0", - "grunt-benchmark": "~0.2.0" - }, - "keywords": [ - "watch", - "glob" - ], - "contributors": [ - { - "name": "Kyle Robinson Young", - "url": "http://dontkry.com" - }, - { - "name": "Sam Day", - "url": "http://sam.is-super-awesome.com" - }, - { - "name": "Roarke Gaskill", - "url": "http://starkinvestments.com" - }, - { - "name": "Lance Pollard", - "url": "http://lancepollard.com/" - }, - { - "name": "Daniel Fagnan", - "url": "http://hydrocodedesign.com/" - }, - { - "name": "Jonas", - "url": "http://jpommerening.github.io/" - }, - { - "name": "Chris Chua", - "url": "http://sirh.cc/" - }, - { - "name": "Kael Zhang", - "url": "http://kael.me" - }, - { - "name": "Krasimir Tsonev", - "url": "http://krasimirtsonev.com/blog" - }, - { - "name": "brett-shwom" - } - ], - "readme": "# gaze [![Build Status](https://secure.travis-ci.org/shama/gaze.png?branch=master)](http://travis-ci.org/shama/gaze)\n\nA globbing fs.watch wrapper built from the best parts of other fine watch libs. \nCompatible with Node.js 0.10/0.8, Windows, OSX and Linux.\n\n![gaze](http://dontkry.com/images/repos/gaze.png)\n\n## Usage\nInstall the module with: `npm install gaze` or place into your `package.json`\nand run `npm install`.\n\n```javascript\nvar gaze = require('gaze');\n\n// Watch all .js files/dirs in process.cwd()\ngaze('**/*.js', function(err, watcher) {\n // Files have all started watching\n // watcher === this\n\n // Get all watched files\n console.log(this.watched());\n\n // On file changed\n this.on('changed', function(filepath) {\n console.log(filepath + ' was changed');\n });\n\n // On file added\n this.on('added', function(filepath) {\n console.log(filepath + ' was added');\n });\n\n // On file deleted\n this.on('deleted', function(filepath) {\n console.log(filepath + ' was deleted');\n });\n\n // On changed/added/deleted\n this.on('all', function(event, filepath) {\n console.log(filepath + ' was ' + event);\n });\n\n // Get watched files with relative paths\n console.log(this.relative());\n});\n\n// Also accepts an array of patterns\ngaze(['stylesheets/*.css', 'images/**/*.png'], function() {\n // Add more patterns later to be watched\n this.add(['js/*.js']);\n});\n```\n\n### Alternate Interface\n\n```javascript\nvar Gaze = require('gaze').Gaze;\n\nvar gaze = new Gaze('**/*');\n\n// Files have all started watching\ngaze.on('ready', function(watcher) { });\n\n// A file has been added/changed/deleted has occurred\ngaze.on('all', function(event, filepath) { });\n```\n\n### Errors\n\n```javascript\ngaze('**/*', function() {\n this.on('error', function(err) {\n // Handle error here\n });\n});\n```\n\n### Minimatch / Glob\n\nSee [isaacs's minimatch](https://github.com/isaacs/minimatch) for more\ninformation on glob patterns.\n\n## Documentation\n\n### gaze(patterns, [options], callback)\n\n* `patterns` {String|Array} File patterns to be matched\n* `options` {Object}\n* `callback` {Function}\n * `err` {Error | null}\n * `watcher` {Object} Instance of the Gaze watcher\n\n### Class: gaze.Gaze\n\nCreate a Gaze object by instanting the `gaze.Gaze` class.\n\n```javascript\nvar Gaze = require('gaze').Gaze;\nvar gaze = new Gaze(pattern, options, callback);\n```\n\n#### Properties\n\n* `options` The options object passed in.\n * `interval` {integer} Interval to pass to fs.watchFile\n * `debounceDelay` {integer} Delay for events called in succession for the same\n file/event\n\n#### Events\n\n* `ready(watcher)` When files have been globbed and watching has begun.\n* `all(event, filepath)` When an `added`, `changed` or `deleted` event occurs.\n* `added(filepath)` When a file has been added to a watch directory.\n* `changed(filepath)` When a file has been changed.\n* `deleted(filepath)` When a file has been deleted.\n* `renamed(newPath, oldPath)` When a file has been renamed.\n* `end()` When the watcher is closed and watches have been removed.\n* `error(err)` When an error occurs.\n\n#### Methods\n\n* `emit(event, [...])` Wrapper for the EventEmitter.emit.\n `added`|`changed`|`deleted` events will also trigger the `all` event.\n* `close()` Unwatch all files and reset the watch instance.\n* `add(patterns, callback)` Adds file(s) patterns to be watched.\n* `remove(filepath)` removes a file or directory from being watched. Does not\n recurse directories.\n* `watched()` Returns the currently watched files.\n* `relative([dir, unixify])` Returns the currently watched files with relative paths.\n * `dir` {string} Only return relative files for this directory.\n * `unixify` {boolean} Return paths with `/` instead of `\\\\` if on Windows.\n\n## FAQs\n\n### Why Another `fs.watch` Wrapper?\nI liked parts of other `fs.watch` wrappers but none had all the features I\nneeded. This lib combines the features I needed from other fine watch libs:\nSpeedy data behavior from\n[paulmillr's chokidar](https://github.com/paulmillr/chokidar), API interface\nfrom [mikeal's watch](https://github.com/mikeal/watch) and file globbing using\n[isaacs's glob](https://github.com/isaacs/node-glob) which is also used by\n[cowboy's Grunt](https://github.com/gruntjs/grunt).\n\n### How do I fix the error `EMFILE: Too many opened files.`?\nThis is because of your system's max opened file limit. For OSX the default is\nvery low (256). Increase your limit temporarily with `ulimit -n 10480`, the\nnumber being the new max limit.\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style.\nAdd unit tests for any new or changed functionality. Lint and test your code\nusing [grunt](http://gruntjs.com/).\n\n## Release History\n* 0.4.3 - Track file additions in newly created folders (@brett-shwom).\n* 0.4.2 - Fix .remove() method to remove a single file in a directory (@kaelzhang). Fixing Cannot call method 'call' of undefined (@krasimir). Track new file additions within folders (@brett-shwom).\n* 0.4.1 - Fix watchDir not respecting close in race condition (@chrisirhc).\n* 0.4.0 - Drop support for node v0.6. Use globule for file matching. Avoid node v0.10 path.resolve/join errors. Register new files when added to non-existent folder. Multiple instances can now poll the same files (@jpommerening).\n* 0.3.4 - Code clean up. Fix path must be strings errors (@groner). Fix incorrect added events (@groner).\n* 0.3.3 - Fix for multiple patterns with negate.\n* 0.3.2 - Emit `end` before removeAllListeners.\n* 0.3.1 - Fix added events within subfolder patterns.\n* 0.3.0 - Handle safewrite events, `forceWatchMethod` option removed, bug fixes and watch optimizations (@rgaskill).\n* 0.2.2 - Fix issue where subsequent add calls dont get watched (@samcday). removeAllListeners on close.\n* 0.2.1 - Fix issue with invalid `added` events in current working dir.\n* 0.2.0 - Support and mark folders with `path.sep`. Add `forceWatchMethod` option. Support `renamed` events.\n* 0.1.6 - Recognize the `cwd` option properly\n* 0.1.5 - Catch too many open file errors\n* 0.1.4 - Really fix the race condition with 2 watches\n* 0.1.3 - Fix race condition with 2 watches\n* 0.1.2 - Read triggering changed event fix\n* 0.1.1 - Minor fixes\n* 0.1.0 - Initial release\n\n## License\nCopyright (c) 2013 Kyle Robinson Young \nLicensed under the MIT license.\n", - "readmeFilename": "README.md", - "_id": "gaze@0.4.3", - "dist": { - "shasum": "1053c5bb162da046604ce100855cf6e19e81336b" - }, - "_from": "gaze@~0.4.0", - "_resolved": "https://registry.npmjs.org/gaze/-/gaze-0.4.3.tgz" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/add_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/add_test.js deleted file mode 100644 index cfb1e89..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/add_test.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -var Gaze = require('../lib/gaze.js').Gaze; -var path = require('path'); -var fs = require('fs'); -var helper = require('./helper'); - -var fixtures = path.resolve(__dirname, 'fixtures'); -var sortobj = helper.sortobj; - -exports.add = { - setUp: function(done) { - process.chdir(fixtures); - done(); - }, - addToWatched: function(test) { - test.expect(1); - var files = [ - 'Project (LO)/', - 'Project (LO)/one.js', - 'nested/', - 'nested/one.js', - 'nested/three.js', - 'nested/sub/', - 'nested/sub/two.js', - 'one.js', - ]; - var expected = { - 'Project (LO)/': ['one.js'], - '.': ['Project (LO)/', 'nested/', 'one.js', 'sub/'], - 'nested/': ['sub/', 'sub2/', 'one.js', 'three.js'], - 'nested/sub/': ['two.js'], - }; - var gaze = new Gaze('addnothingtowatch'); - gaze._addToWatched(files); - var result = gaze.relative(null, true); - test.deepEqual(sortobj(result), sortobj(expected)); - test.done(); - }, - addLater: function(test) { - test.expect(3); - new Gaze('sub/one.js', function(err, watcher) { - test.deepEqual(watcher.relative('sub'), ['one.js']); - watcher.add('sub/*.js', function() { - test.deepEqual(watcher.relative('sub'), ['one.js', 'two.js']); - watcher.on('changed', function(filepath) { - test.equal('two.js', path.basename(filepath)); - watcher.close(); - test.done(); - }); - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'two.js'), 'var two = true;'); - }); - }); - }, - addNoCallback: function(test) { - test.expect(1); - new Gaze('sub/one.js', function(err, watcher) { - this.add('sub/two.js'); - this.on('changed', function(filepath) { - test.equal('two.js', path.basename(filepath)); - watcher.close(); - test.done(); - }); - setTimeout(function() { - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'two.js'), 'var two = true;'); - }, 500); - }); - }, -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/api_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/api_test.js deleted file mode 100644 index 42d258e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/api_test.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -var gaze = require('../lib/gaze.js'); -var path = require('path'); - -exports.api = { - setUp: function(done) { - process.chdir(path.resolve(__dirname, 'fixtures')); - done(); - }, - newGaze: function(test) { - test.expect(2); - new gaze.Gaze('**/*', {}, function() { - var result = this.relative(null, true); - test.deepEqual(result['.'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']); - test.deepEqual(result['sub/'], ['one.js', 'two.js']); - this.close(); - test.done(); - }); - }, - func: function(test) { - test.expect(1); - var g = gaze('**/*', function(err, watcher) { - test.deepEqual(watcher.relative('sub', true), ['one.js', 'two.js']); - g.close(); - test.done(); - }); - }, - ready: function(test) { - test.expect(1); - var g = new gaze.Gaze('**/*'); - g.on('ready', function(watcher) { - test.deepEqual(watcher.relative('sub', true), ['one.js', 'two.js']); - this.close(); - test.done(); - }); - } -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/file_poller.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/file_poller.js deleted file mode 100644 index 6e96937..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/file_poller.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var path = require('path'); -var fs = require('fs'); - -var timeout = +process.argv[2]; -if (!timeout || isNaN(timeout)) { - throw 'No specified timeout'; -} -setTimeout(function () { - process.exit(); -}, timeout); - -var pathArg = process.argv.slice(3); -if (!pathArg.length) { - throw 'No path arguments'; -} -var filepath = path.resolve.apply(path, [ __dirname ].concat(pathArg)); - -function writeToFile() { - setTimeout(function () { - fs.writeFile(filepath, ''); - return writeToFile(); - }, 0); -} - -writeToFile(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/Project (LO)/one.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/Project (LO)/one.js deleted file mode 100644 index fefeeea..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/Project (LO)/one.js +++ /dev/null @@ -1 +0,0 @@ -var one = true; \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/one.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/one.js deleted file mode 100644 index fefeeea..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/one.js +++ /dev/null @@ -1 +0,0 @@ -var one = true; \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/sub/two.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/sub/two.js deleted file mode 100644 index 24ad8a3..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/sub/two.js +++ /dev/null @@ -1 +0,0 @@ -var two = true; \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/sub2/two.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/sub2/two.js deleted file mode 100644 index 24ad8a3..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/sub2/two.js +++ /dev/null @@ -1 +0,0 @@ -var two = true; \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/three.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/three.js deleted file mode 100644 index 3392956..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/nested/three.js +++ /dev/null @@ -1 +0,0 @@ -var three = true; \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/one.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/one.js deleted file mode 100644 index 7a4b5f6..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/one.js +++ /dev/null @@ -1 +0,0 @@ -var test = true; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/sub/one.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/sub/one.js deleted file mode 100644 index fefeeea..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/sub/one.js +++ /dev/null @@ -1 +0,0 @@ -var one = true; \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/sub/two.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/sub/two.js deleted file mode 100644 index 24ad8a3..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/fixtures/sub/two.js +++ /dev/null @@ -1 +0,0 @@ -var two = true; \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/helper.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/helper.js deleted file mode 100644 index 5452e3e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/helper.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -var helper = module.exports = {}; - -helper.sortobj = function sortobj(obj) { - if (Array.isArray(obj)) { - obj.sort(); - return obj; - } - var out = Object.create(null); - var keys = Object.keys(obj); - keys.sort(); - keys.forEach(function(key) { - var val = obj[key]; - if (Array.isArray(val)) { - val.sort(); - } - out[key] = val; - }); - return out; -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/matching_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/matching_test.js deleted file mode 100644 index 8261f2b..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/matching_test.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict'; - -var gaze = require('../lib/gaze.js'); -var grunt = require('grunt'); -var path = require('path'); -var helper = require('./helper'); - -var fixtures = path.resolve(__dirname, 'fixtures'); -var sortobj = helper.sortobj; - -function cleanUp(done) { - [ - 'newfolder', - ].forEach(function(d) { - var p = path.join(fixtures, d); - if (grunt.file.exists(p)) { - grunt.file.delete(p); - } - }); - done(); -} - -exports.matching = { - setUp: function(done) { - process.chdir(fixtures); - cleanUp(done); - }, - tearDown: cleanUp, - globAll: function(test) { - test.expect(2); - gaze('**/*', function() { - var result = this.relative(null, true); - test.deepEqual(result['.'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']); - test.deepEqual(result['sub/'], ['one.js', 'two.js']); - this.close(); - test.done(); - }); - }, - relativeDir: function(test) { - test.expect(1); - gaze('**/*', function() { - test.deepEqual(this.relative('sub', true), ['one.js', 'two.js']); - this.close(); - test.done(); - }); - }, - globArray: function(test) { - test.expect(2); - gaze(['*.js', 'sub/*.js'], function() { - var result = this.relative(null, true); - test.deepEqual(sortobj(result['.']), sortobj(['one.js', 'Project (LO)/', 'nested/', 'sub/'])); - test.deepEqual(sortobj(result['sub/']), sortobj(['one.js', 'two.js'])); - this.close(); - test.done(); - }); - }, - globArrayDot: function(test) { - test.expect(1); - gaze(['./sub/*.js'], function() { - var result = this.relative(null, true); - test.deepEqual(result['sub/'], ['one.js', 'two.js']); - this.close(); - test.done(); - }); - }, - oddName: function(test) { - test.expect(1); - gaze(['Project (LO)/*.js'], function() { - var result = this.relative(null, true); - test.deepEqual(result['Project (LO)/'], ['one.js']); - this.close(); - test.done(); - }); - }, - addedLater: function(test) { - test.expect(2); - var times = 0; - gaze('**/*.js', function(err, watcher) { - watcher.on('all', function(status, filepath) { - times++; - var result = watcher.relative(null, true); - test.deepEqual(result['newfolder/'], ['added.js']); - if (times > 1) { watcher.close(); } - }); - grunt.file.write(path.join(fixtures, 'newfolder', 'added.js'), 'var added = true;'); - setTimeout(function() { - grunt.file.write(path.join(fixtures, 'newfolder', 'added.js'), 'var added = true;'); - }, 1000); - watcher.on('end', function() { - // TODO: Figure out why this test is finicky leaking it's newfolder into the other tests - setTimeout(test.done, 2000); - }); - }); - }, -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/patterns_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/patterns_test.js deleted file mode 100644 index 46b94e4..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/patterns_test.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -var gaze = require('../lib/gaze.js'); -var path = require('path'); -var fs = require('fs'); - -// Clean up helper to call in setUp and tearDown -function cleanUp(done) { - [ - 'added.js', - 'nested/added.js', - ].forEach(function(d) { - var p = path.resolve(__dirname, 'fixtures', d); - if (fs.existsSync(p)) { fs.unlinkSync(p); } - }); - done(); -} - -exports.patterns = { - setUp: function(done) { - process.chdir(path.resolve(__dirname, 'fixtures')); - cleanUp(done); - }, - tearDown: cleanUp, - negate: function(test) { - test.expect(1); - gaze(['**/*.js', '!nested/**/*.js'], function(err, watcher) { - watcher.on('added', function(filepath) { - var expected = path.relative(process.cwd(), filepath); - test.equal(path.join('added.js'), expected); - watcher.close(); - }); - // dont add - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'nested', 'added.js'), 'var added = true;'); - setTimeout(function() { - // should add - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'added.js'), 'var added = true;'); - }, 1000); - watcher.on('end', test.done); - }); - } -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/relative_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/relative_test.js deleted file mode 100644 index 492d8e5..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/relative_test.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var Gaze = require('../lib/gaze.js').Gaze; -var path = require('path'); - -exports.relative = { - setUp: function(done) { - process.chdir(path.resolve(__dirname, 'fixtures')); - done(); - }, - relative: function(test) { - test.expect(1); - var files = [ - 'Project (LO)/', - 'Project (LO)/one.js', - 'nested/', - 'nested/one.js', - 'nested/three.js', - 'nested/sub/', - 'nested/sub/two.js', - 'one.js' - ]; - var gaze = new Gaze('addnothingtowatch'); - gaze._addToWatched(files); - test.deepEqual(gaze.relative('.', true), ['Project (LO)/', 'nested/', 'one.js', 'sub/']); - test.done(); - } -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/rename_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/rename_test.js deleted file mode 100644 index 5d2d496..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/rename_test.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -var gaze = require('../lib/gaze.js'); -var path = require('path'); -var fs = require('fs'); - -// Clean up helper to call in setUp and tearDown -function cleanUp(done) { - [ - 'sub/rename.js', - 'sub/renamed.js' - ].forEach(function(d) { - var p = path.resolve(__dirname, 'fixtures', d); - if (fs.existsSync(p)) { fs.unlinkSync(p); } - }); - done(); -} - -exports.watch = { - setUp: function(done) { - process.chdir(path.resolve(__dirname, 'fixtures')); - cleanUp(done); - }, - tearDown: cleanUp, - rename: function(test) { - test.expect(2); - var oldPath = path.join(__dirname, 'fixtures', 'sub', 'rename.js'); - var newPath = path.join(__dirname, 'fixtures', 'sub', 'renamed.js'); - fs.writeFileSync(oldPath, 'var rename = true;'); - gaze('**/*', function(err, watcher) { - watcher.on('renamed', function(newFile, oldFile) { - test.equal(newFile, newPath); - test.equal(oldFile, oldPath); - watcher.close(); - test.done(); - }); - fs.renameSync(oldPath, newPath); - }); - } -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/safewrite_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/safewrite_test.js deleted file mode 100644 index ac76b93..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/safewrite_test.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -var gaze = require('../lib/gaze.js'); -var path = require('path'); -var fs = require('fs'); - -// Clean up helper to call in setUp and tearDown -function cleanUp(done) { - [ - 'safewrite.js' - ].forEach(function(d) { - var p = path.resolve(__dirname, 'fixtures', d); - if (fs.existsSync(p)) { fs.unlinkSync(p); } - }); - done(); -} - -exports.safewrite = { - setUp: function(done) { - process.chdir(path.resolve(__dirname, 'fixtures')); - cleanUp(done); - }, - tearDown: cleanUp, - safewrite: function(test) { - test.expect(4); - - var times = 0; - var file = path.resolve(__dirname, 'fixtures', 'safewrite.js'); - var backup = path.resolve(__dirname, 'fixtures', 'safewrite.ext~'); - fs.writeFileSync(file, 'var safe = true;'); - - function simSafewrite() { - fs.writeFileSync(backup, fs.readFileSync(file)); - fs.unlinkSync(file); - fs.renameSync(backup, file); - times++; - } - - gaze('**/*', function() { - this.on('all', function(action, filepath) { - test.equal(action, 'changed'); - test.equal(path.basename(filepath), 'safewrite.js'); - - if (times < 2) { - setTimeout(simSafewrite, 1000); - } else { - this.close(); - test.done(); - } - }); - - setTimeout(function() { - simSafewrite(); - }, 1000); - - }); - } -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/watch_race_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/watch_race_test.js deleted file mode 100644 index e524692..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/watch_race_test.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -var gaze = require('../lib/gaze.js'); -var grunt = require('grunt'); -var path = require('path'); -var fs = require('fs'); -var cp = require('child_process'); - -// Clean up helper to call in setUp and tearDown -function cleanUp(done) { - [ - 'nested/sub/poller.js' - ].forEach(function(d) { - var p = path.resolve(__dirname, 'fixtures', d); - if (fs.existsSync(p)) { fs.unlinkSync(p); } - }); - done(); -} - -exports.watch_race = { - setUp: function(done) { - process.chdir(path.resolve(__dirname, 'fixtures')); - cleanUp(done); - }, - tearDown: cleanUp, - initWatchDirOnClose: function(test) { - var times = 5, - TIMEOUT = 5000, - firedWhenClosed = 0, - watchers = [], - watcherIdxes = [], - polled_file = ['fixtures', 'nested', 'sub', 'poller.js'], - expected_path = path.join.apply(path, polled_file.slice(1)); - test.expect(times); - for (var i = times; i--;) { - watcherIdxes.unshift(i); - } - // Create the file so that it can be watched - fs.writeFileSync(path.resolve.apply(path, [__dirname].concat(polled_file)), ''); - // Create a poller that keeps making changes to the file until timeout - var child_poller = cp.fork( - '../file_poller.js', - [times * TIMEOUT].concat(polled_file) - ); - grunt.util.async.forEachSeries(watcherIdxes, function(idx, next) { - var watcher = new gaze.Gaze('**/poller.js', function(err, watcher) { - var timeout = setTimeout(function () { - test.ok(false, 'watcher ' + idx + ' did not fire event on polled file.'); - watcher.close(); - }, TIMEOUT); - watcher.on('all', function (status, filepath) { - if (!filepath) { return; } - var expected = path.relative(process.cwd(), filepath); - test.equal(expected_path, expected, 'watcher ' + idx + - ' emitted unexpected event.'); - clearTimeout(timeout); - watcher.close(); - }); - watcher.on('end', function () { - // After watcher is closed and all event listeners have been removed, - // re-add a listener to see if anything is going on on this watcher. - process.nextTick(function () { - watcher.once('added', function () { - test.ok(false, 'watcher ' + idx + ' should not fire added' + - ' event on polled file after being closed.'); - }); - }); - next(); - }); - }); - watchers.push(watcher); - }, function () { - child_poller.kill(); - watchers.forEach(function (watcher) { - try { - watcher.close(); - } catch (e) { - // Ignore if this fails - } - }); - test.done(); - }); - }, -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/gaze/test/watch_test.js b/node_modules/grunt-contrib-watch/node_modules/gaze/test/watch_test.js deleted file mode 100644 index 0f3d368..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/gaze/test/watch_test.js +++ /dev/null @@ -1,314 +0,0 @@ -'use strict'; - -var gaze = require('../lib/gaze.js'); -var grunt = require('grunt'); -var path = require('path'); -var fs = require('fs'); - -// Clean up helper to call in setUp and tearDown -function cleanUp(done) { - [ - 'sub/tmp.js', - 'sub/tmp', - 'sub/renamed.js', - 'added.js', - 'nested/added.js', - 'nested/.tmp', - 'nested/sub/added.js', - ].forEach(function(d) { - var p = path.resolve(__dirname, 'fixtures', d); - if (fs.existsSync(p)) { fs.unlinkSync(p); } - }); - - grunt.file.delete(path.resolve(__dirname, 'fixtures', 'new_dir')); - - done(); -} - -exports.watch = { - setUp: function(done) { - process.chdir(path.resolve(__dirname, 'fixtures')); - cleanUp(done); - }, - tearDown: cleanUp, - remove: function(test) { - test.expect(2); - gaze('**/*', function() { - this.remove(path.resolve(__dirname, 'fixtures', 'sub', 'two.js')); - this.remove(path.resolve(__dirname, 'fixtures')); - var result = this.relative(null, true); - test.deepEqual(result['sub/'], ['one.js']); - test.notDeepEqual(result['.'], ['one.js']); - this.close(); - test.done(); - }); - }, - changed: function(test) { - test.expect(1); - gaze('**/*', function(err, watcher) { - watcher.on('changed', function(filepath) { - var expected = path.relative(process.cwd(), filepath); - test.equal(path.join('sub', 'one.js'), expected); - watcher.close(); - }); - this.on('added', function() { test.ok(false, 'added event should not have emitted.'); }); - this.on('deleted', function() { test.ok(false, 'deleted event should not have emitted.'); }); - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'), 'var one = true;'); - watcher.on('end', test.done); - }); - }, - added: function(test) { - test.expect(1); - gaze('**/*', function(err, watcher) { - watcher.on('added', function(filepath) { - var expected = path.relative(process.cwd(), filepath); - test.equal(path.join('sub', 'tmp.js'), expected); - watcher.close(); - }); - this.on('changed', function() { test.ok(false, 'changed event should not have emitted.'); }); - this.on('deleted', function() { test.ok(false, 'deleted event should not have emitted.'); }); - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'tmp.js'), 'var tmp = true;'); - watcher.on('end', test.done); - }); - }, - dontAddUnmatchedFiles: function(test) { - test.expect(2); - gaze('**/*.js', function(err, watcher) { - setTimeout(function() { - test.ok(true, 'Ended without adding a file.'); - watcher.close(); - }, 1000); - this.on('added', function(filepath) { - test.equal(path.relative(process.cwd(), filepath), path.join('sub', 'tmp.js')); - }); - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'tmp'), 'Dont add me!'); - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'tmp.js'), 'add me!'); - watcher.on('end', test.done); - }); - }, - dontAddMatchedDirectoriesThatArentReallyAdded: function(test) { - // This is a regression test for a bug I ran into where a matching directory would be reported - // added when a non-matching file was created along side it. This only happens if the - // directory name doesn't occur in $PWD. - test.expect(1); - gaze('**/*', function(err, watcher) { - setTimeout(function() { - test.ok(true, 'Ended without adding a file.'); - watcher.close(); - }, 1000); - this.on('added', function(filepath) { - test.notEqual(path.relative(process.cwd(), filepath), path.join('nested', 'sub2')); - }); - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'nested', '.tmp'), 'Wake up!'); - watcher.on('end', test.done); - }); - }, - deleted: function(test) { - test.expect(1); - var tmpfile = path.resolve(__dirname, 'fixtures', 'sub', 'deleted.js'); - fs.writeFileSync(tmpfile, 'var tmp = true;'); - gaze('**/*', function(err, watcher) { - watcher.on('deleted', function(filepath) { - test.equal(path.join('sub', 'deleted.js'), path.relative(process.cwd(), filepath)); - watcher.close(); - }); - this.on('changed', function() { test.ok(false, 'changed event should not have emitted.'); }); - this.on('added', function() { test.ok(false, 'added event should not have emitted.'); }); - fs.unlinkSync(tmpfile); - watcher.on('end', test.done); - }); - }, - dontEmitTwice: function(test) { - test.expect(2); - gaze('**/*', function(err, watcher) { - watcher.on('all', function(status, filepath) { - var expected = path.relative(process.cwd(), filepath); - test.equal(path.join('sub', 'one.js'), expected); - test.equal(status, 'changed'); - fs.readFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js')); - setTimeout(function() { - fs.readFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js')); - }, 1000); - // Give some time to accidentally emit before we close - setTimeout(function() { watcher.close(); }, 5000); - }); - setTimeout(function() { - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'), 'var one = true;'); - }, 1000); - watcher.on('end', test.done); - }); - }, - emitTwice: function(test) { - test.expect(2); - var times = 0; - gaze('**/*', function(err, watcher) { - watcher.on('all', function(status, filepath) { - test.equal(status, 'changed'); - times++; - setTimeout(function() { - if (times < 2) { - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'), 'var one = true;'); - } else { - watcher.close(); - } - }, 1000); - }); - setTimeout(function() { - fs.writeFileSync(path.resolve(__dirname, 'fixtures', 'sub', 'one.js'), 'var one = true;'); - }, 1000); - watcher.on('end', test.done); - }); - }, - nonExistent: function(test) { - test.expect(1); - gaze('non/existent/**/*', function(err, watcher) { - test.ok(true); - test.done(); - }); - }, - differentCWD: function(test) { - test.expect(1); - var cwd = path.resolve(__dirname, 'fixtures', 'sub'); - gaze('two.js', { - cwd: cwd - }, function(err, watcher) { - watcher.on('changed', function(filepath) { - test.deepEqual(this.relative(), {'.':['two.js']}); - watcher.close(); - }); - fs.writeFileSync(path.resolve(cwd, 'two.js'), 'var two = true;'); - watcher.on('end', test.done); - }); - }, - addedEmitInSubFolders: function(test) { - test.expect(4); - var adds = [ - { pattern: '**/*', file: path.resolve(__dirname, 'fixtures', 'nested', 'sub', 'added.js') }, - { pattern: '**/*', file: path.resolve(__dirname, 'fixtures', 'added.js') }, - { pattern: 'nested/**/*', file: path.resolve(__dirname, 'fixtures', 'nested', 'added.js') }, - { pattern: 'nested/sub/*.js', file: path.resolve(__dirname, 'fixtures', 'nested', 'sub', 'added.js') }, - ]; - grunt.util.async.forEachSeries(adds, function(add, next) { - new gaze.Gaze(add.pattern, function(err, watcher) { - watcher.on('added', function(filepath) { - test.equal('added.js', path.basename(filepath)); - fs.unlinkSync(filepath); - watcher.close(); - next(); - }); - watcher.on('changed', function() { test.ok(false, 'changed event should not have emitted.'); }); - watcher.on('deleted', function() { test.ok(false, 'deleted event should not have emitted.'); }); - fs.writeFileSync(add.file, 'var added = true;'); - }); - }, function() { - test.done(); - }); - }, - multipleWatchersSimultaneously: function(test) { - test.expect(2); - var did = 0; - var ready = 0; - var cwd = path.resolve(__dirname, 'fixtures', 'sub'); - var watchers = []; - var timeout = setTimeout(function() { - test.ok(false, "Only " + did + " of " + ready + " watchers fired."); - test.done(); - watchers.forEach(function(watcher) { - watcher.close(); - }); - }, 1000); - - function isReady() { - ready++; - if (ready > 1) { - fs.writeFileSync(path.resolve(cwd, 'one.js'), 'var one = true;'); - } - } - function isDone() { - did++; - if (did > 1) { - clearTimeout(timeout); - watchers.forEach(function(watcher) { - watcher.close(); - }); - test.done(); - } - } - function changed(filepath) { - test.equal(path.join('sub', 'one.js'), path.relative(process.cwd(), filepath)); - isDone(); - } - for (var i = 0; i < 2; i++) { - watchers[i] = new gaze.Gaze('sub/one.js'); - watchers[i].on('changed', changed); - watchers[i].on('ready', isReady); - } - }, - mkdirThenAddFile: function(test) { - test.expect(2); - - var expected = [ - 'new_dir', - 'new_dir/other.js', - ]; - - gaze('**/*.js', function(err, watcher) { - watcher.on('all', function(status, filepath) { - - var expect = expected.shift(); - test.equal(path.relative(process.cwd(), filepath), expect); - - if (expected.length === 1) { - // Ensure the new folder is being watched correctly after initial add - setTimeout(function() { - fs.writeFileSync('new_dir/dontmatch.txt', ''); - setTimeout(function() { - fs.writeFileSync('new_dir/other.js', ''); - }, 1000); - }, 1000); - } - - if (expected.length < 1) { watcher.close(); } - }); - - - fs.mkdirSync('new_dir'); //fs.mkdirSync([folder]) seems to behave differently than grunt.file.write('[folder]/[file]') - - - watcher.on('end', test.done); - }); - }, - mkdirThenAddFileWithGruntFileWrite: function(test) { - test.expect(3); - - var expected = [ - 'new_dir', - 'new_dir/tmp.js', - 'new_dir/other.js', - ]; - - gaze('**/*.js', function(err, watcher) { - watcher.on('all', function(status, filepath) { - - var expect = expected.shift(); - test.equal(path.relative(process.cwd(), filepath), expect); - - if (expected.length === 1) { - // Ensure the new folder is being watched correctly after initial add - setTimeout(function() { - fs.writeFileSync('new_dir/dontmatch.txt', ''); - setTimeout(function() { - fs.writeFileSync('new_dir/other.js', ''); - }, 1000); - }, 1000); - } - - if (expected.length < 1) { watcher.close(); } - }); - - grunt.file.write('new_dir/tmp.js', ''); - - watcher.on('end', test.done); - }); - }, -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/.npmignore b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/.npmignore deleted file mode 100644 index 1e107f5..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/.npmignore +++ /dev/null @@ -1 +0,0 @@ -examples diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/.travis.yml b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/.travis.yml deleted file mode 100644 index baa0031..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/bin/tiny-lr b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/bin/tiny-lr deleted file mode 100755 index 2663446..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/bin/tiny-lr +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env node - -var fs = require('fs'); -var path = require('path'); - -// default DEBUG if not set already -process.env.DEBUG = process.env.DEBUG || 'tinylr tinylr:*'; - -var Server = require('..').Server; -var noptify = require('noptify'); - -var program = noptify(process.argv, { program: 'tiny-lr' }) - .version('0.0.1') - .option('port', '-p', 'Port to listen on (default: 35729)', Number) - .option('pid', 'Path to the generated PID file (default: ./tiny-lr.pid)', String); - -var opts = program.parse(); -opts.port = opts.port || 35729; -opts.pid = opts.pid || path.resolve('tiny-lr.pid'); - -// if it was required, don't start the server and expose the Server object. -if (module.parent) { - module.exports = Server; - return; -} - -// Server - -// Thanks to @FGRibreau for his very simple and very handy gist: -// https://gist.github.com/1846952 - -process.title = 'tiny-lr'; - -process.on('exit', function() { - console.log('... Closing server ...'); - console.log('... Removing pid file (%s) ...', opts.pid); - fs.unlinkSync(opts.pid); -}); - -process.on('SIGTERM', function() { - return process.exit(0); -}); - -process.on('SIGINT', function() { - return process.exit(0); -}); - - -var srv = new Server(opts); - -srv.on('close', function() { - process.nextTick(function() { - process.exit(); - }); -}); - -console.log(); -srv.listen(opts.port, function(err) { - fs.writeFile(opts.pid, process.pid, function(err) { - if(err) { - console.log('... Cannot write pid file: %s', opts.pid); - process.exit(1) - } - - console.log('... Listening on %s (pid: %s) ...', opts.port, process.pid); - console.log('... pid file: %s', opts.pid); - }); -}); diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/bin/update-livereload b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/bin/update-livereload deleted file mode 100755 index b0d6c85..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/bin/update-livereload +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env node - -var fs = require('fs'); -var path = require('path'); -var request = require('request'); - -var file = path.join(__dirname, '..', 'lib/public/livereload.js'); -var url = process.argv.slice(2)[0] || 'https://raw.github.com/livereload/livereload-js/master/dist/livereload.js'; - -console.error('Updating livereload.js %s from %s', file, url); -request(url) - .pipe(fs.createWriteStream(file)) - .on('close', console.log.bind(console, 'Done')); diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/client.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/client.js deleted file mode 100644 index f484d30..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/client.js +++ /dev/null @@ -1,81 +0,0 @@ - -var util = require('util'); -var events = require('events'); -var WebSocket = require('faye-websocket'); - -module.exports = Client; - -function Client(req, socket, head) { - this.ws = new WebSocket(req, socket, head); - this.ws.onmessage = this.message.bind(this); - this.ws.onclose = this.close.bind(this); - this.id = this.uniqueId('ws'); -} - -util.inherits(Client, events.EventEmitter); - -Client.prototype.message = function message(event) { - // console.log('... Incoming %s ...', event.type); - var data = this.data(event); - if(this[data.command]) return this[data.command](data); -}; - -Client.prototype.close = function close(event) { - if(this.ws) { - this.ws.close(); - this.ws = null; - } - - this.emit('end', event); -}; - -// Commands - -Client.prototype.hello = function hello() { - this.send({ - command: 'hello', - protocols: [ - 'http://livereload.com/protocols/official-7' - ], - serverName: 'tiny-lr' - }); -}; - -Client.prototype.info = function info(data) { - this.plugins = data.plugins; - this.url = data.url; -}; - -// Server commands - -Client.prototype.reload = function reload(files) { - files.forEach(function(file) { - console.log('... Reload %s ...', file); - this.send({ - command: 'reload', - path: file, - liveCss: true, - liveJs: true - }); - }, this); -}; - -// Utilities - -Client.prototype.data = function _data(event) { - var data = {}; - try { - data = JSON.parse(event.data); - } catch (e) {} - return data; -}; - -Client.prototype.send = function send(data) { - this.ws.send(JSON.stringify(data)); -}; - -var idCounter = 0; -Client.prototype.uniqueId = function uniqueId(prefix) { - var id = idCounter++; - return prefix ? prefix + id : id; -}; diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/index.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/index.js deleted file mode 100644 index 1420629..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/index.js +++ /dev/null @@ -1,22 +0,0 @@ - -var Server = require('./server'); -var Client = require('./client'); - -module.exports = tinylr; -tinylr.Server = Server; -tinylr.Client = Client; - -tinylr.middleware = middleware; - -function tinylr(opts) { - return new Server(opts); -} - -var util = require('util'); - -function middleware(opts) { - var srv = new Server(opts); - return function tinylr(req, res, next) { - srv.handler(req, res, next); - }; -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/public/livereload.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/public/livereload.js deleted file mode 100644 index edb2802..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/lib/public/livereload.js +++ /dev/null @@ -1,1055 +0,0 @@ -(function() { -var __customevents = {}, __protocol = {}, __connector = {}, __timer = {}, __options = {}, __reloader = {}, __livereload = {}, __less = {}, __startup = {}; - -// customevents -var CustomEvents; -CustomEvents = { - bind: function(element, eventName, handler) { - if (element.addEventListener) { - return element.addEventListener(eventName, handler, false); - } else if (element.attachEvent) { - element[eventName] = 1; - return element.attachEvent('onpropertychange', function(event) { - if (event.propertyName === eventName) { - return handler(); - } - }); - } else { - throw new Error("Attempt to attach custom event " + eventName + " to something which isn't a DOMElement"); - } - }, - fire: function(element, eventName) { - var event; - if (element.addEventListener) { - event = document.createEvent('HTMLEvents'); - event.initEvent(eventName, true, true); - return document.dispatchEvent(event); - } else if (element.attachEvent) { - if (element[eventName]) { - return element[eventName]++; - } - } else { - throw new Error("Attempt to fire custom event " + eventName + " on something which isn't a DOMElement"); - } - } -}; -__customevents.bind = CustomEvents.bind; -__customevents.fire = CustomEvents.fire; - -// protocol -var PROTOCOL_6, PROTOCOL_7, Parser, ProtocolError; -var __indexOf = Array.prototype.indexOf || function(item) { - for (var i = 0, l = this.length; i < l; i++) { - if (this[i] === item) return i; - } - return -1; -}; -__protocol.PROTOCOL_6 = PROTOCOL_6 = 'http://livereload.com/protocols/official-6'; -__protocol.PROTOCOL_7 = PROTOCOL_7 = 'http://livereload.com/protocols/official-7'; -__protocol.ProtocolError = ProtocolError = (function() { - function ProtocolError(reason, data) { - this.message = "LiveReload protocol error (" + reason + ") after receiving data: \"" + data + "\"."; - } - return ProtocolError; -})(); -__protocol.Parser = Parser = (function() { - function Parser(handlers) { - this.handlers = handlers; - this.reset(); - } - Parser.prototype.reset = function() { - return this.protocol = null; - }; - Parser.prototype.process = function(data) { - var command, message, options, _ref; - try { - if (!(this.protocol != null)) { - if (data.match(/^!!ver:([\d.]+)$/)) { - this.protocol = 6; - } else if (message = this._parseMessage(data, ['hello'])) { - if (!message.protocols.length) { - throw new ProtocolError("no protocols specified in handshake message"); - } else if (__indexOf.call(message.protocols, PROTOCOL_7) >= 0) { - this.protocol = 7; - } else if (__indexOf.call(message.protocols, PROTOCOL_6) >= 0) { - this.protocol = 6; - } else { - throw new ProtocolError("no supported protocols found"); - } - } - return this.handlers.connected(this.protocol); - } else if (this.protocol === 6) { - message = JSON.parse(data); - if (!message.length) { - throw new ProtocolError("protocol 6 messages must be arrays"); - } - command = message[0], options = message[1]; - if (command !== 'refresh') { - throw new ProtocolError("unknown protocol 6 command"); - } - return this.handlers.message({ - command: 'reload', - path: options.path, - liveCSS: (_ref = options.apply_css_live) != null ? _ref : true - }); - } else { - message = this._parseMessage(data, ['reload', 'alert']); - return this.handlers.message(message); - } - } catch (e) { - if (e instanceof ProtocolError) { - return this.handlers.error(e); - } else { - throw e; - } - } - }; - Parser.prototype._parseMessage = function(data, validCommands) { - var message, _ref; - try { - message = JSON.parse(data); - } catch (e) { - throw new ProtocolError('unparsable JSON', data); - } - if (!message.command) { - throw new ProtocolError('missing "command" key', data); - } - if (_ref = message.command, __indexOf.call(validCommands, _ref) < 0) { - throw new ProtocolError("invalid command '" + message.command + "', only valid commands are: " + (validCommands.join(', ')) + ")", data); - } - return message; - }; - return Parser; -})(); - -// connector -// Generated by CoffeeScript 1.3.3 -var Connector, PROTOCOL_6, PROTOCOL_7, Parser, Version, _ref; - -_ref = __protocol, Parser = _ref.Parser, PROTOCOL_6 = _ref.PROTOCOL_6, PROTOCOL_7 = _ref.PROTOCOL_7; - -Version = '2.0.8'; - -__connector.Connector = Connector = (function() { - - function Connector(options, WebSocket, Timer, handlers) { - var _this = this; - this.options = options; - this.WebSocket = WebSocket; - this.Timer = Timer; - this.handlers = handlers; - this._uri = "ws://" + this.options.host + ":" + this.options.port + "/livereload"; - this._nextDelay = this.options.mindelay; - this._connectionDesired = false; - this.protocol = 0; - this.protocolParser = new Parser({ - connected: function(protocol) { - _this.protocol = protocol; - _this._handshakeTimeout.stop(); - _this._nextDelay = _this.options.mindelay; - _this._disconnectionReason = 'broken'; - return _this.handlers.connected(protocol); - }, - error: function(e) { - _this.handlers.error(e); - return _this._closeOnError(); - }, - message: function(message) { - return _this.handlers.message(message); - } - }); - this._handshakeTimeout = new Timer(function() { - if (!_this._isSocketConnected()) { - return; - } - _this._disconnectionReason = 'handshake-timeout'; - return _this.socket.close(); - }); - this._reconnectTimer = new Timer(function() { - if (!_this._connectionDesired) { - return; - } - return _this.connect(); - }); - this.connect(); - } - - Connector.prototype._isSocketConnected = function() { - return this.socket && this.socket.readyState === this.WebSocket.OPEN; - }; - - Connector.prototype.connect = function() { - var _this = this; - this._connectionDesired = true; - if (this._isSocketConnected()) { - return; - } - this._reconnectTimer.stop(); - this._disconnectionReason = 'cannot-connect'; - this.protocolParser.reset(); - this.handlers.connecting(); - this.socket = new this.WebSocket(this._uri); - this.socket.onopen = function(e) { - return _this._onopen(e); - }; - this.socket.onclose = function(e) { - return _this._onclose(e); - }; - this.socket.onmessage = function(e) { - return _this._onmessage(e); - }; - return this.socket.onerror = function(e) { - return _this._onerror(e); - }; - }; - - Connector.prototype.disconnect = function() { - this._connectionDesired = false; - this._reconnectTimer.stop(); - if (!this._isSocketConnected()) { - return; - } - this._disconnectionReason = 'manual'; - return this.socket.close(); - }; - - Connector.prototype._scheduleReconnection = function() { - if (!this._connectionDesired) { - return; - } - if (!this._reconnectTimer.running) { - this._reconnectTimer.start(this._nextDelay); - return this._nextDelay = Math.min(this.options.maxdelay, this._nextDelay * 2); - } - }; - - Connector.prototype.sendCommand = function(command) { - if (this.protocol == null) { - return; - } - return this._sendCommand(command); - }; - - Connector.prototype._sendCommand = function(command) { - return this.socket.send(JSON.stringify(command)); - }; - - Connector.prototype._closeOnError = function() { - this._handshakeTimeout.stop(); - this._disconnectionReason = 'error'; - return this.socket.close(); - }; - - Connector.prototype._onopen = function(e) { - var hello; - this.handlers.socketConnected(); - this._disconnectionReason = 'handshake-failed'; - hello = { - command: 'hello', - protocols: [PROTOCOL_6, PROTOCOL_7] - }; - hello.ver = Version; - if (this.options.ext) { - hello.ext = this.options.ext; - } - if (this.options.extver) { - hello.extver = this.options.extver; - } - if (this.options.snipver) { - hello.snipver = this.options.snipver; - } - this._sendCommand(hello); - return this._handshakeTimeout.start(this.options.handshake_timeout); - }; - - Connector.prototype._onclose = function(e) { - this.protocol = 0; - this.handlers.disconnected(this._disconnectionReason, this._nextDelay); - return this._scheduleReconnection(); - }; - - Connector.prototype._onerror = function(e) {}; - - Connector.prototype._onmessage = function(e) { - return this.protocolParser.process(e.data); - }; - - return Connector; - -})(); - -// timer -var Timer; -var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; -__timer.Timer = Timer = (function() { - function Timer(func) { - this.func = func; - this.running = false; - this.id = null; - this._handler = __bind(function() { - this.running = false; - this.id = null; - return this.func(); - }, this); - } - Timer.prototype.start = function(timeout) { - if (this.running) { - clearTimeout(this.id); - } - this.id = setTimeout(this._handler, timeout); - return this.running = true; - }; - Timer.prototype.stop = function() { - if (this.running) { - clearTimeout(this.id); - this.running = false; - return this.id = null; - } - }; - return Timer; -})(); -Timer.start = function(timeout, func) { - return setTimeout(func, timeout); -}; - -// options -var Options; -__options.Options = Options = (function() { - function Options() { - this.host = null; - this.port = 35729; - this.snipver = null; - this.ext = null; - this.extver = null; - this.mindelay = 1000; - this.maxdelay = 60000; - this.handshake_timeout = 5000; - } - Options.prototype.set = function(name, value) { - switch (typeof this[name]) { - case 'undefined': - break; - case 'number': - return this[name] = +value; - default: - return this[name] = value; - } - }; - return Options; -})(); -Options.extract = function(document) { - var element, keyAndValue, m, mm, options, pair, src, _i, _j, _len, _len2, _ref, _ref2; - _ref = document.getElementsByTagName('script'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - element = _ref[_i]; - if ((src = element.src) && (m = src.match(/^[^:]+:\/\/(.*)\/z?livereload\.js(?:\?(.*))?$/))) { - options = new Options(); - if (mm = m[1].match(/^([^\/:]+)(?::(\d+))?$/)) { - options.host = mm[1]; - if (mm[2]) { - options.port = parseInt(mm[2], 10); - } - } - if (m[2]) { - _ref2 = m[2].split('&'); - for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { - pair = _ref2[_j]; - if ((keyAndValue = pair.split('=')).length > 1) { - options.set(keyAndValue[0].replace(/-/g, '_'), keyAndValue.slice(1).join('=')); - } - } - } - return options; - } - } - return null; -}; - -// reloader -// Generated by CoffeeScript 1.3.1 -(function() { - var IMAGE_STYLES, Reloader, numberOfMatchingSegments, pathFromUrl, pathsMatch, pickBestMatch, splitUrl; - - splitUrl = function(url) { - var hash, index, params; - if ((index = url.indexOf('#')) >= 0) { - hash = url.slice(index); - url = url.slice(0, index); - } else { - hash = ''; - } - if ((index = url.indexOf('?')) >= 0) { - params = url.slice(index); - url = url.slice(0, index); - } else { - params = ''; - } - return { - url: url, - params: params, - hash: hash - }; - }; - - pathFromUrl = function(url) { - var path; - url = splitUrl(url).url; - if (url.indexOf('file://') === 0) { - path = url.replace(/^file:\/\/(localhost)?/, ''); - } else { - path = url.replace(/^([^:]+:)?\/\/([^:\/]+)(:\d*)?\//, '/'); - } - return decodeURIComponent(path); - }; - - pickBestMatch = function(path, objects, pathFunc) { - var bestMatch, object, score, _i, _len; - bestMatch = { - score: 0 - }; - for (_i = 0, _len = objects.length; _i < _len; _i++) { - object = objects[_i]; - score = numberOfMatchingSegments(path, pathFunc(object)); - if (score > bestMatch.score) { - bestMatch = { - object: object, - score: score - }; - } - } - if (bestMatch.score > 0) { - return bestMatch; - } else { - return null; - } - }; - - numberOfMatchingSegments = function(path1, path2) { - var comps1, comps2, eqCount, len; - path1 = path1.replace(/^\/+/, '').toLowerCase(); - path2 = path2.replace(/^\/+/, '').toLowerCase(); - if (path1 === path2) { - return 10000; - } - comps1 = path1.split('/').reverse(); - comps2 = path2.split('/').reverse(); - len = Math.min(comps1.length, comps2.length); - eqCount = 0; - while (eqCount < len && comps1[eqCount] === comps2[eqCount]) { - ++eqCount; - } - return eqCount; - }; - - pathsMatch = function(path1, path2) { - return numberOfMatchingSegments(path1, path2) > 0; - }; - - IMAGE_STYLES = [ - { - selector: 'background', - styleNames: ['backgroundImage'] - }, { - selector: 'border', - styleNames: ['borderImage', 'webkitBorderImage', 'MozBorderImage'] - } - ]; - - __reloader.Reloader = Reloader = (function() { - - Reloader.name = 'Reloader'; - - function Reloader(window, console, Timer) { - this.window = window; - this.console = console; - this.Timer = Timer; - this.document = this.window.document; - this.importCacheWaitPeriod = 200; - this.plugins = []; - } - - Reloader.prototype.addPlugin = function(plugin) { - return this.plugins.push(plugin); - }; - - Reloader.prototype.analyze = function(callback) { - return results; - }; - - Reloader.prototype.reload = function(path, options) { - var plugin, _base, _i, _len, _ref; - this.options = options; - if ((_base = this.options).stylesheetReloadTimeout == null) { - _base.stylesheetReloadTimeout = 15000; - } - _ref = this.plugins; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - plugin = _ref[_i]; - if (plugin.reload && plugin.reload(path, options)) { - return; - } - } - if (options.liveCSS) { - if (path.match(/\.css$/i)) { - if (this.reloadStylesheet(path)) { - return; - } - } - } - if (options.liveImg) { - if (path.match(/\.(jpe?g|png|gif)$/i)) { - this.reloadImages(path); - return; - } - } - return this.reloadPage(); - }; - - Reloader.prototype.reloadPage = function() { - return this.window.document.location.reload(); - }; - - Reloader.prototype.reloadImages = function(path) { - var expando, img, selector, styleNames, styleSheet, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _results; - expando = this.generateUniqueString(); - _ref = this.document.images; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - img = _ref[_i]; - if (pathsMatch(path, pathFromUrl(img.src))) { - img.src = this.generateCacheBustUrl(img.src, expando); - } - } - if (this.document.querySelectorAll) { - for (_j = 0, _len1 = IMAGE_STYLES.length; _j < _len1; _j++) { - _ref1 = IMAGE_STYLES[_j], selector = _ref1.selector, styleNames = _ref1.styleNames; - _ref2 = this.document.querySelectorAll("[style*=" + selector + "]"); - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - img = _ref2[_k]; - this.reloadStyleImages(img.style, styleNames, path, expando); - } - } - } - if (this.document.styleSheets) { - _ref3 = this.document.styleSheets; - _results = []; - for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { - styleSheet = _ref3[_l]; - _results.push(this.reloadStylesheetImages(styleSheet, path, expando)); - } - return _results; - } - }; - - Reloader.prototype.reloadStylesheetImages = function(styleSheet, path, expando) { - var rule, rules, styleNames, _i, _j, _len, _len1; - try { - rules = styleSheet != null ? styleSheet.cssRules : void 0; - } catch (e) { - - } - if (!rules) { - return; - } - for (_i = 0, _len = rules.length; _i < _len; _i++) { - rule = rules[_i]; - switch (rule.type) { - case CSSRule.IMPORT_RULE: - this.reloadStylesheetImages(rule.styleSheet, path, expando); - break; - case CSSRule.STYLE_RULE: - for (_j = 0, _len1 = IMAGE_STYLES.length; _j < _len1; _j++) { - styleNames = IMAGE_STYLES[_j].styleNames; - this.reloadStyleImages(rule.style, styleNames, path, expando); - } - break; - case CSSRule.MEDIA_RULE: - this.reloadStylesheetImages(rule, path, expando); - } - } - }; - - Reloader.prototype.reloadStyleImages = function(style, styleNames, path, expando) { - var newValue, styleName, value, _i, _len, - _this = this; - for (_i = 0, _len = styleNames.length; _i < _len; _i++) { - styleName = styleNames[_i]; - value = style[styleName]; - if (typeof value === 'string') { - newValue = value.replace(/\burl\s*\(([^)]*)\)/, function(match, src) { - if (pathsMatch(path, pathFromUrl(src))) { - return "url(" + (_this.generateCacheBustUrl(src, expando)) + ")"; - } else { - return match; - } - }); - if (newValue !== value) { - style[styleName] = newValue; - } - } - } - }; - - Reloader.prototype.reloadStylesheet = function(path) { - var imported, link, links, match, style, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, - _this = this; - links = (function() { - var _i, _len, _ref, _results; - _ref = this.document.getElementsByTagName('link'); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - if (link.rel === 'stylesheet' && !link.__LiveReload_pendingRemoval) { - _results.push(link); - } - } - return _results; - }).call(this); - imported = []; - _ref = this.document.getElementsByTagName('style'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - style = _ref[_i]; - if (style.sheet) { - this.collectImportedStylesheets(style, style.sheet, imported); - } - } - for (_j = 0, _len1 = links.length; _j < _len1; _j++) { - link = links[_j]; - this.collectImportedStylesheets(link, link.sheet, imported); - } - if (this.window.StyleFix && this.document.querySelectorAll) { - _ref1 = this.document.querySelectorAll('style[data-href]'); - for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { - style = _ref1[_k]; - links.push(style); - } - } - this.console.log("LiveReload found " + links.length + " LINKed stylesheets, " + imported.length + " @imported stylesheets"); - match = pickBestMatch(path, links.concat(imported), function(l) { - return pathFromUrl(_this.linkHref(l)); - }); - if (match) { - if (match.object.rule) { - this.console.log("LiveReload is reloading imported stylesheet: " + match.object.href); - this.reattachImportedRule(match.object); - } else { - this.console.log("LiveReload is reloading stylesheet: " + (this.linkHref(match.object))); - this.reattachStylesheetLink(match.object); - } - } else { - this.console.log("LiveReload will reload all stylesheets because path '" + path + "' did not match any specific one"); - for (_l = 0, _len3 = links.length; _l < _len3; _l++) { - link = links[_l]; - this.reattachStylesheetLink(link); - } - } - return true; - }; - - Reloader.prototype.collectImportedStylesheets = function(link, styleSheet, result) { - var index, rule, rules, _i, _len; - try { - rules = styleSheet != null ? styleSheet.cssRules : void 0; - } catch (e) { - - } - if (rules && rules.length) { - for (index = _i = 0, _len = rules.length; _i < _len; index = ++_i) { - rule = rules[index]; - switch (rule.type) { - case CSSRule.CHARSET_RULE: - continue; - case CSSRule.IMPORT_RULE: - result.push({ - link: link, - rule: rule, - index: index, - href: rule.href - }); - this.collectImportedStylesheets(link, rule.styleSheet, result); - break; - default: - break; - } - } - } - }; - - Reloader.prototype.waitUntilCssLoads = function(clone, func) { - var callbackExecuted, executeCallback, poll, - _this = this; - callbackExecuted = false; - executeCallback = function() { - if (callbackExecuted) { - return; - } - callbackExecuted = true; - return func(); - }; - clone.onload = function() { - console.log("onload!"); - _this.knownToSupportCssOnLoad = true; - return executeCallback(); - }; - if (!this.knownToSupportCssOnLoad) { - (poll = function() { - if (clone.sheet) { - console.log("polling!"); - return executeCallback(); - } else { - return _this.Timer.start(50, poll); - } - })(); - } - return this.Timer.start(this.options.stylesheetReloadTimeout, executeCallback); - }; - - Reloader.prototype.linkHref = function(link) { - return link.href || link.getAttribute('data-href'); - }; - - Reloader.prototype.reattachStylesheetLink = function(link) { - var clone, parent, - _this = this; - if (link.__LiveReload_pendingRemoval) { - return; - } - link.__LiveReload_pendingRemoval = true; - if (link.tagName === 'STYLE') { - clone = this.document.createElement('link'); - clone.rel = 'stylesheet'; - clone.media = link.media; - clone.disabled = link.disabled; - } else { - clone = link.cloneNode(false); - } - clone.href = this.generateCacheBustUrl(this.linkHref(link)); - parent = link.parentNode; - if (parent.lastChild === link) { - parent.appendChild(clone); - } else { - parent.insertBefore(clone, link.nextSibling); - } - return this.waitUntilCssLoads(clone, function() { - var additionalWaitingTime; - if (/AppleWebKit/.test(navigator.userAgent)) { - additionalWaitingTime = 5; - } else { - additionalWaitingTime = 200; - } - return _this.Timer.start(additionalWaitingTime, function() { - var _ref; - if (!link.parentNode) { - return; - } - link.parentNode.removeChild(link); - clone.onreadystatechange = null; - return (_ref = _this.window.StyleFix) != null ? _ref.link(clone) : void 0; - }); - }); - }; - - Reloader.prototype.reattachImportedRule = function(_arg) { - var href, index, link, media, newRule, parent, rule, tempLink, - _this = this; - rule = _arg.rule, index = _arg.index, link = _arg.link; - parent = rule.parentStyleSheet; - href = this.generateCacheBustUrl(rule.href); - media = rule.media.length ? [].join.call(rule.media, ', ') : ''; - newRule = "@import url(\"" + href + "\") " + media + ";"; - rule.__LiveReload_newHref = href; - tempLink = this.document.createElement("link"); - tempLink.rel = 'stylesheet'; - tempLink.href = href; - tempLink.__LiveReload_pendingRemoval = true; - if (link.parentNode) { - link.parentNode.insertBefore(tempLink, link); - } - return this.Timer.start(this.importCacheWaitPeriod, function() { - if (tempLink.parentNode) { - tempLink.parentNode.removeChild(tempLink); - } - if (rule.__LiveReload_newHref !== href) { - return; - } - parent.insertRule(newRule, index); - parent.deleteRule(index + 1); - rule = parent.cssRules[index]; - rule.__LiveReload_newHref = href; - return _this.Timer.start(_this.importCacheWaitPeriod, function() { - if (rule.__LiveReload_newHref !== href) { - return; - } - parent.insertRule(newRule, index); - return parent.deleteRule(index + 1); - }); - }); - }; - - Reloader.prototype.generateUniqueString = function() { - return 'livereload=' + Date.now(); - }; - - Reloader.prototype.generateCacheBustUrl = function(url, expando) { - var hash, oldParams, params, _ref; - if (expando == null) { - expando = this.generateUniqueString(); - } - _ref = splitUrl(url), url = _ref.url, hash = _ref.hash, oldParams = _ref.params; - if (this.options.overrideURL) { - if (url.indexOf(this.options.serverURL) < 0) { - url = this.options.serverURL + this.options.overrideURL + "?url=" + encodeURIComponent(url); - } - } - params = oldParams.replace(/(\?|&)livereload=(\d+)/, function(match, sep) { - return "" + sep + expando; - }); - if (params === oldParams) { - if (oldParams.length === 0) { - params = "?" + expando; - } else { - params = "" + oldParams + "&" + expando; - } - } - return url + params + hash; - }; - - return Reloader; - - })(); - -}).call(this); - -// livereload -var Connector, LiveReload, Options, Reloader, Timer; - -Connector = __connector.Connector; - -Timer = __timer.Timer; - -Options = __options.Options; - -Reloader = __reloader.Reloader; - -__livereload.LiveReload = LiveReload = (function() { - - function LiveReload(window) { - var _this = this; - this.window = window; - this.listeners = {}; - this.plugins = []; - this.pluginIdentifiers = {}; - this.console = this.window.location.href.match(/LR-verbose/) && this.window.console && this.window.console.log && this.window.console.error ? this.window.console : { - log: function() {}, - error: function() {} - }; - if (!(this.WebSocket = this.window.WebSocket || this.window.MozWebSocket)) { - console.error("LiveReload disabled because the browser does not seem to support web sockets"); - return; - } - if (!(this.options = Options.extract(this.window.document))) { - console.error("LiveReload disabled because it could not find its own - - - - - - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/example/wildcards.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/example/wildcards.js deleted file mode 100644 index 1fdac20..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/example/wildcards.js +++ /dev/null @@ -1,10 +0,0 @@ - -var debug = { - foo: require('../')('test:foo'), - bar: require('../')('test:bar'), - baz: require('../')('test:baz') -}; - -debug.foo('foo') -debug.bar('bar') -debug.baz('baz') \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/example/worker.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/example/worker.js deleted file mode 100644 index 7f6d288..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/example/worker.js +++ /dev/null @@ -1,22 +0,0 @@ - -// DEBUG=* node example/worker -// DEBUG=worker:* node example/worker -// DEBUG=worker:a node example/worker -// DEBUG=worker:b node example/worker - -var a = require('../')('worker:a') - , b = require('../')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/index.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/index.js deleted file mode 100644 index e02c13b..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/index.js +++ /dev/null @@ -1,5 +0,0 @@ -if ('undefined' == typeof window) { - module.exports = require('./lib/debug'); -} else { - module.exports = require('./debug'); -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/lib/debug.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/lib/debug.js deleted file mode 100644 index 0b07aa1..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/lib/debug.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Module dependencies. - */ - -var tty = require('tty'); - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Enabled debuggers. - */ - -var names = [] - , skips = []; - -(process.env.DEBUG || '') - .split(/[\s,]+/) - .forEach(function(name){ - name = name.replace('*', '.*?'); - if (name[0] === '-') { - skips.push(new RegExp('^' + name.substr(1) + '$')); - } else { - names.push(new RegExp('^' + name + '$')); - } - }); - -/** - * Colors. - */ - -var colors = [6, 2, 3, 4, 5, 1]; - -/** - * Previous debug() call. - */ - -var prev = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Is stdout a TTY? Colored output is disabled when `true`. - */ - -var isatty = tty.isatty(2); - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function color() { - return colors[prevColor++ % colors.length]; -} - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -function humanize(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -} - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - function disabled(){} - disabled.enabled = false; - - var match = skips.some(function(re){ - return re.test(name); - }); - - if (match) return disabled; - - match = names.some(function(re){ - return re.test(name); - }); - - if (!match) return disabled; - var c = color(); - - function colored(fmt) { - var curr = new Date; - var ms = curr - (prev[name] || curr); - prev[name] = curr; - - fmt = ' \u001b[9' + c + 'm' + name + ' ' - + '\u001b[3' + c + 'm\u001b[90m' - + fmt + '\u001b[3' + c + 'm' - + ' +' + humanize(ms) + '\u001b[0m'; - - console.error.apply(this, arguments); - } - - function plain(fmt) { - fmt = new Date().toUTCString() - + ' ' + name + ' ' + fmt; - console.error.apply(this, arguments); - } - - colored.enabled = plain.enabled = true; - - return isatty || process.env.DEBUG_COLORS - ? colored - : plain; -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/package.json deleted file mode 100644 index 4365e36..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/debug/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "debug", - "version": "0.7.2", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*" - }, - "main": "lib/debug.js", - "browserify": "debug.js", - "engines": { - "node": "*" - }, - "component": { - "scripts": { - "debug/index.js": "index.js", - "debug/debug.js": "debug.js" - } - }, - "readme": "\n# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n \nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n \n ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\". \n\n## Wildcards\n\n The \"*\" character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. \n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n a('doing some work');\n}, 1200);\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 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/debug/issues" - }, - "_id": "debug@0.7.2", - "_from": "debug@~0.7.0" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/CHANGELOG.txt b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/CHANGELOG.txt deleted file mode 100644 index a7320cd..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/CHANGELOG.txt +++ /dev/null @@ -1,62 +0,0 @@ -=== 0.4.4 / 2013-02-14 - -* Emit the 'close' event if TCP is closed before CLOSE frame is acked - - -=== 0.4.3 / 2012-07-09 - -* Add 'Connection: close' to EventSource response -* Handle situations where request.socket is undefined - - -=== 0.4.2 / 2012-04-06 - -* Add WebSocket error code 1011. -* Handle URLs with no path correctly by sending 'GET /' - - -=== 0.4.1 / 2012-02-26 - -* Treat anything other than a Buffer as a string when calling send() - - -=== 0.4.0 / 2012-02-13 - -* Add ping() method to server-side WebSocket and EventSource -* Buffer send() calls until the draft-76 handshake is complete -* Fix HTTPS problems on Node 0.7 - - -=== 0.3.1 / 2012-01-16 - -* Call setNoDelay(true) on net.Socket objects to reduce latency - - -=== 0.3.0 / 2012-01-13 - -* Add support for EventSource connections - - -=== 0.2.0 / 2011-12-21 - -* Add support for Sec-WebSocket-Protocol negotiation -* Support hixie-76 close frames and 75/76 ignored segments -* Improve performance of HyBi parsing/framing functions -* Decouple parsers from TCP and reduce write volume - - -=== 0.1.2 / 2011-12-05 - -* Detect closed sockets on the server side when TCP connection breaks -* Make hixie-76 sockets work through HAProxy - - -=== 0.1.1 / 2011-11-30 - -* Fix addEventListener() interface methods - - -=== 0.1.0 / 2011-11-27 - -* Initial release, based on WebSocket components from Faye - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/README.markdown b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/README.markdown deleted file mode 100644 index 61bd73a..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/README.markdown +++ /dev/null @@ -1,248 +0,0 @@ -# faye-websocket - -* Travis CI build: [](http://travis-ci.org/faye/faye-websocket-node) -* Autobahn tests: [server](http://faye.jcoglan.com/autobahn/servers/), [client](http://faye.jcoglan.com/autobahn/clients/) - -This is a robust, general-purpose WebSocket implementation extracted from the -[Faye](http://faye.jcoglan.com) project. It provides classes for easily building -WebSocket servers and clients in Node. It does not provide a server itself, but -rather makes it easy to handle WebSocket connections within an existing -[Node](http://nodejs.org/) application. It does not provide any abstraction -other than the standard [WebSocket API](http://dev.w3.org/html5/websockets/). - -It also provides an abstraction for handling [EventSource](http://dev.w3.org/html5/eventsource/) -connections, which are one-way connections that allow the server to push data to -the client. They are based on streaming HTTP responses and can be easier to -access via proxies than WebSockets. - -The server-side socket can process [draft-75](http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75), -[draft-76](http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76), -[hybi-07](http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07) -and later versions of the protocol. It selects protocol versions automatically, -supports both `text` and `binary` messages, and transparently handles `ping`, -`pong`, `close` and fragmented messages. - - -## Handling WebSocket connections in Node - -You can handle WebSockets on the server side by listening for HTTP Upgrade -requests, and creating a new socket for the request. This socket object exposes -the usual WebSocket methods for receiving and sending messages. For example this -is how you'd implement an echo server: - -```js -var WebSocket = require('faye-websocket'), - http = require('http'); - -var server = http.createServer(); - -server.addListener('upgrade', function(request, socket, head) { - var ws = new WebSocket(request, socket, head); - - ws.onmessage = function(event) { - ws.send(event.data); - }; - - ws.onclose = function(event) { - console.log('close', event.code, event.reason); - ws = null; - }; -}); - -server.listen(8000); -``` - -Note that under certain circumstances (notably a draft-76 client connecting -through an HTTP proxy), the WebSocket handshake will not be complete after you -call `new WebSocket()` because the server will not have received the entire -handshake from the client yet. In this case, calls to `ws.send()` will buffer -the message in memory until the handshake is complete, at which point any -buffered messages will be sent to the client. - -If you need to detect when the WebSocket handshake is complete, you can use the -`onopen` event. - -If the connection's protocol version supports it, you can call `ws.ping()` to -send a ping message and wait for the client's response. This method takes a -message string, and an optional callback that fires when a matching pong message -is received. It returns `true` iff a ping message was sent. If the client does -not support ping/pong, this method sends no data and returns `false`. - -```js -ws.ping('Mic check, one, two', function() { - // fires when pong is received -}); -``` - - -## Using the WebSocket client - -The client supports both the plain-text `ws` protocol and the encrypted `wss` -protocol, and has exactly the same interface as a socket you would use in a web -browser. On the wire it identifies itself as hybi-13. - -```js -var WebSocket = require('faye-websocket'), - ws = new WebSocket.Client('ws://www.example.com/'); - -ws.onopen = function(event) { - console.log('open'); - ws.send('Hello, world!'); -}; - -ws.onmessage = function(event) { - console.log('message', event.data); -}; - -ws.onclose = function(event) { - console.log('close', event.code, event.reason); - ws = null; -}; -``` - - -## Subprotocol negotiation - -The WebSocket protocol allows peers to select and identify the application -protocol to use over the connection. On the client side, you can set which -protocols the client accepts by passing a list of protocol names when you -construct the socket: - -```js -var ws = new WebSocket.Client('ws://www.example.com/', ['irc', 'amqp']); -``` - -On the server side, you can likewise pass in the list of protocols the server -supports after the other constructor arguments: - -```js -var ws = new WebSocket(request, socket, head, ['irc', 'amqp']); -``` - -If the client and server agree on a protocol, both the client- and server-side -socket objects expose the selected protocol through the `ws.protocol` property. -If they cannot agree on a protocol to use, the client closes the connection. - - -## WebSocket API - -The WebSocket API consists of several event handlers and a method for sending -messages. - -* onopen fires when the socket connection is established. Event - has no attributes. -* onerror fires when the connection attempt fails. Event has no - attributes. -* onmessage fires when the socket receives a message. Event has - one attribute, data, which is either a `String` (for text - frames) or a `Buffer` (for binary frames). -* onclose fires when either the client or the server closes the - connection. Event has two optional attributes, code and - reason, that expose the status code and message sent by the - peer that closed the connection. -* send(message) accepts either a `String` or a `Buffer` and - sends a text or binary message over the connection to the other peer. -* close(code, reason) closes the connection, sending the given - status code and reason text, both of which are optional. -* protocol is a string (which may be empty) identifying the - subprotocol the socket is using. - - -## Handling EventSource connections in Node - -EventSource connections provide a very similar interface, although because they -only allow the server to send data to the client, there is no `onmessage` API. -EventSource allows the server to push text messages to the client, where each -message has an optional event-type and ID. - -```js -var WebSocket = require('faye-websocket'), - EventSource = WebSocket.EventSource, - http = require('http'); - -var server = http.createServer(); - -server.addListener('request', function(request, response) { - if (EventSource.isEventSource(request)) { - var es = new EventSource(request, response); - console.log('open', es.url, es.lastEventId); - - // Periodically send messages - var loop = setInterval(function() { es.send('Hello') }, 1000); - - es.onclose = function() { - clearInterval(loop); - es = null; - }; - - } else { - // Normal HTTP request - response.writeHead(200, {'Content-Type': 'text/plain'}); - response.write('Hello'); - response.end(); - } -}); - -server.listen(8000); -``` - -The `send` method takes two optional parameters, `event` and `id`. The default -event-type is `'message'` with no ID. For example, to send a `notification` -event with ID `99`: - -```js -es.send('Breaking News!', {event: 'notification', id: '99'}); -``` - -The `EventSource` object exposes the following properties: - -* url is a string containing the URL the client used to create - the EventSource. -* lastEventId is a string containing the last event ID - received by the client. You can use this when the client reconnects after a - dropped connection to determine which messages need resending. - -When you initialize an EventSource with ` new EventSource()`, you can pass -configuration options after the `response` parameter. Available options are: - -* retry is a number that tells the client how long (in seconds) - it should wait after a dropped connection before attempting to reconnect. -* ping is a number that tells the server how often (in seconds) - to send 'ping' packets to the client to keep the connection open, to defeat - timeouts set by proxies. The client will ignore these messages. - -For example, this creates a connection that pings every 15 seconds and is -retryable every 10 seconds if the connection is broken: - -```js -var es = new EventSource(request, response, {ping: 15, retry: 10}); -``` - -You can send a ping message at any time by calling `es.ping()`. Unlike WebSocket, -the client does not send a response to this; it is merely to send some data over -the wire to keep the connection alive. - - -## License - -(The MIT License) - -Copyright (c) 2009-2013 James Coglan - -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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/autobahn_client.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/autobahn_client.js deleted file mode 100644 index 3eb1384..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/autobahn_client.js +++ /dev/null @@ -1,44 +0,0 @@ -var WebSocket = require('../lib/faye/websocket'), - pace = require('pace'); - -var host = 'ws://localhost:9001', - agent = 'Node ' + process.version, - cases = 0, - skip = []; - -var socket = new WebSocket.Client(host + '/getCaseCount'), - progress; - -socket.onmessage = function(event) { - console.log('Total cases to run: ' + event.data); - cases = parseInt(event.data); - progress = pace(cases); -}; - -socket.onclose = function() { - var runCase = function(n) { - progress.op(); - - if (n > cases) { - socket = new WebSocket.Client(host + '/updateReports?agent=' + encodeURIComponent(agent)); - socket.onclose = process.exit; - - } else if (skip.indexOf(n) >= 0) { - runCase(n + 1); - - } else { - socket = new WebSocket.Client(host + '/runCase?case=' + n + '&agent=' + encodeURIComponent(agent)); - - socket.onmessage = function(event) { - socket.send(event.data); - }; - - socket.onclose = function() { - runCase(n + 1); - }; - } - }; - - runCase(1); -}; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/client.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/client.js deleted file mode 100644 index ad3cbfb..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/client.js +++ /dev/null @@ -1,22 +0,0 @@ -var WebSocket = require('../lib/faye/websocket'), - port = process.argv[2] || 7000, - secure = process.argv[3] === 'ssl', - scheme = secure ? 'wss' : 'ws', - ws = new WebSocket.Client(scheme + '://localhost:' + port + '/'); - -console.log('Connecting to ' + ws.url); - -ws.onopen = function(event) { - console.log('open'); - ws.send('Hello, WebSocket!'); -}; - -ws.onmessage = function(event) { - console.log('message', event.data); - // ws.close(1002, 'Going away'); -}; - -ws.onclose = function(event) { - console.log('close', event.code, event.reason); -}; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/haproxy.conf b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/haproxy.conf deleted file mode 100644 index 9bfc57f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/haproxy.conf +++ /dev/null @@ -1,21 +0,0 @@ -defaults - mode http - timeout client 5s - timeout connect 5s - timeout server 5s - -frontend all 0.0.0.0:3000 - mode http - timeout client 120s - - option forwardfor - option http-server-close - option http-pretend-keepalive - - default_backend sockets - -backend sockets - balance uri depth 2 - timeout server 120s - server socket1 127.0.0.1:7000 - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/server.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/server.js deleted file mode 100644 index cb54715..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/server.js +++ /dev/null @@ -1,70 +0,0 @@ -var WebSocket = require('../lib/faye/websocket'), - fs = require('fs'), - http = require('http'), - https = require('https'); - -var port = process.argv[2] || 7000, - secure = process.argv[3] === 'ssl'; - -var upgradeHandler = function(request, socket, head) { - var ws = new WebSocket(request, socket, head, ['irc', 'xmpp'], {ping: 5}); - console.log('open', ws.url, ws.version, ws.protocol); - - ws.onmessage = function(event) { - ws.send(event.data); - }; - - ws.onclose = function(event) { - console.log('close', event.code, event.reason); - ws = null; - }; -}; - -var requestHandler = function(request, response) { - if (!WebSocket.EventSource.isEventSource(request)) - return staticHandler(request, response); - - var es = new WebSocket.EventSource(request, response), - time = parseInt(es.lastEventId, 10) || 0; - - console.log('open', es.url, es.lastEventId); - - var loop = setInterval(function() { - time += 1; - es.send('Time: ' + time); - setTimeout(function() { - if (es) es.send('Update!!', {event: 'update', id: time}); - }, 1000); - }, 2000); - - es.send('Welcome!\n\nThis is an EventSource server.'); - - es.onclose = function() { - clearInterval(loop); - console.log('close', es.url); - es = null; - }; -}; - -var staticHandler = function(request, response) { - var path = request.url; - - fs.readFile(__dirname + path, function(err, content) { - var status = err ? 404 : 200; - response.writeHead(status, {'Content-Type': 'text/html'}); - response.write(content || 'Not found'); - response.end(); - }); -}; - -var server = secure - ? https.createServer({ - key: fs.readFileSync(__dirname + '/../spec/server.key'), - cert: fs.readFileSync(__dirname + '/../spec/server.crt') - }) - : http.createServer(); - -server.addListener('request', requestHandler); -server.addListener('upgrade', upgradeHandler); -server.listen(port); - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/sse.html b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/sse.html deleted file mode 100644 index 2afa273..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/sse.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - EventSource test - - - -

          EventSource test

          -
            - - - - - - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/ws.html b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/ws.html deleted file mode 100644 index e322f2a..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/examples/ws.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - WebSocket test - - - -

            WebSocket test

            -
              - - - - - - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/eventsource.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/eventsource.js deleted file mode 100644 index eab3a46..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/eventsource.js +++ /dev/null @@ -1,110 +0,0 @@ -var API = require('./websocket/api'), - Event = require('./websocket/api/event'); - -var isSecureConnection = function(request) { - if (request.headers['x-forwarded-proto']) { - return request.headers['x-forwarded-proto'] === 'https'; - } else { - return (request.connection && request.connection.authorized !== undefined) || - (request.socket && request.socket.secure); - } -}; - -var EventSource = function(request, response, options) { - options = options || {}; - - this._request = request; - this._response = response; - this._stream = response.socket; - this._ping = options.ping || this.DEFAULT_PING; - this._retry = options.retry || this.DEFAULT_RETRY; - - var scheme = isSecureConnection(request) ? 'https:' : 'http:'; - this.url = scheme + '//' + request.headers.host + request.url; - - this.lastEventId = request.headers['last-event-id'] || ''; - - var self = this; - this.readyState = API.CONNECTING; - this._sendBuffer = []; - process.nextTick(function() { self._open() }); - - var handshake = 'HTTP/1.1 200 OK\r\n' + - 'Content-Type: text/event-stream\r\n' + - 'Cache-Control: no-cache, no-store\r\n' + - 'Connection: close\r\n' + - '\r\n\r\n' + - 'retry: ' + Math.floor(this._retry * 1000) + '\r\n\r\n'; - - this.readyState = API.OPEN; - - if (this._ping) - this._pingLoop = setInterval(function() { self.ping() }, this._ping * 1000); - - if (!this._stream || !this._stream.writable) return; - - this._stream.setTimeout(0); - this._stream.setNoDelay(true); - - try { this._stream.write(handshake, 'utf8') } catch (e) {} - - ['close', 'end', 'error'].forEach(function(event) { - self._stream.addListener(event, function() { self.close() }); - }); -}; - -EventSource.isEventSource = function(request) { - var accept = (request.headers.accept || '').split(/\s*,\s*/); - return accept.indexOf('text/event-stream') >= 0; -}; - -var instance = { - DEFAULT_PING: 10, - DEFAULT_RETRY: 5, - - send: function(message, options) { - if (this.readyState !== API.OPEN) return false; - - message = String(message).replace(/(\r\n|\r|\n)/g, '$1data: '); - options = options || {}; - - var frame = ''; - if (options.event) frame += 'event: ' + options.event + '\r\n'; - if (options.id) frame += 'id: ' + options.id + '\r\n'; - frame += 'data: ' + message + '\r\n\r\n'; - - try { - this._stream.write(frame, 'utf8'); - return true; - } catch (e) { - return false; - } - }, - - ping: function() { - try { - this._stream.write(':\r\n\r\n', 'utf8'); - return true; - } catch (e) { - return false; - } - }, - - close: function() { - if (this.readyState === API.CLOSING || this.readyState === API.CLOSED) - return; - - this.readyState = API.CLOSED; - clearInterval(this._pingLoop); - this._response.end(); - - var event = new Event('close'); - event.initEvent('close', false, false); - this.dispatchEvent(event); - } -}; - -for (var key in API) EventSource.prototype[key] = API[key]; -for (var key in instance) EventSource.prototype[key] = instance[key]; -module.exports = EventSource; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket.js deleted file mode 100644 index bbf9d29..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket.js +++ /dev/null @@ -1,93 +0,0 @@ -// API and protocol references: -// -// * http://dev.w3.org/html5/websockets/ -// * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget -// * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-event -// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 -// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76 -// * http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17 - -var Draft75Parser = require('./websocket/draft75_parser'), - Draft76Parser = require('./websocket/draft76_parser'), - HybiParser = require('./websocket/hybi_parser'), - API = require('./websocket/api'), - Event = require('./websocket/api/event'); - -var getParser = function(request) { - var headers = request.headers; - return headers['sec-websocket-version'] - ? HybiParser - : (headers['sec-websocket-key1'] && headers['sec-websocket-key2']) - ? Draft76Parser - : Draft75Parser; -}; - -var isSecureConnection = function(request) { - if (request.headers['x-forwarded-proto']) { - return request.headers['x-forwarded-proto'] === 'https'; - } else { - return (request.connection && request.connection.authorized !== undefined) || - (request.socket && request.socket.secure); - } -}; - -var WebSocket = function(request, socket, head, supportedProtos, options) { - this.request = request; - this._stream = request.socket; - this._ping = options && options.ping; - this._pingId = 0; - - var scheme = isSecureConnection(request) ? 'wss:' : 'ws:'; - this.url = scheme + '//' + request.headers.host + request.url; - this.readyState = API.CONNECTING; - this.bufferedAmount = 0; - - var Parser = getParser(request); - this._parser = new Parser(this, {protocols: supportedProtos}); - - var self = this; - this._sendBuffer = []; - process.nextTick(function() { self._open() }); - - var handshake = this._parser.handshakeResponse(head); - if (this._parser.isOpen()) this.readyState = API.OPEN; - - if (this._ping) - this._pingLoop = setInterval(function() { - self._pingId += 1; - self.ping(self._pingId.toString()); - }, this._ping * 1000); - - this.protocol = this._parser.protocol || ''; - this.version = this._parser.getVersion(); - - if (!this._stream || !this._stream.writable) return; - - this._stream.setTimeout(0); - this._stream.setNoDelay(true); - - try { this._stream.write(handshake, 'binary') } catch (e) {} - - this._stream.addListener('data', function(data) { - var response = self._parser.parse(data); - if (!response) return; - try { self._stream.write(response, 'binary') } catch (e) {} - self._open(); - }); - ['close', 'end', 'error'].forEach(function(event) { - self._stream.addListener(event, function() { self.close(1006, '', false) }); - }); -}; - -WebSocket.prototype.ping = function(message, callback, context) { - if (!this._parser.ping) return false; - return this._parser.ping(message, callback, context); -}; - -for (var key in API) WebSocket.prototype[key] = API[key]; - -WebSocket.WebSocket = WebSocket; -WebSocket.Client = require('./websocket/client'); -WebSocket.EventSource = require('./eventsource'); -module.exports = WebSocket; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api.js deleted file mode 100644 index 6c37e27..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api.js +++ /dev/null @@ -1,88 +0,0 @@ -var EventTarget = require('./api/event_target'), - Event = require('./api/event'); - -var API = { - CONNECTING: 0, - OPEN: 1, - CLOSING: 2, - CLOSED: 3, - - _open: function() { - if (this._parser && !this._parser.isOpen()) return; - this.readyState = API.OPEN; - - var buffer = this._sendBuffer || [], - message; - - while (message = buffer.shift()) - this.send.apply(this, message); - - var event = new Event('open'); - event.initEvent('open', false, false); - this.dispatchEvent(event); - }, - - receive: function(data) { - if (this.readyState !== API.OPEN) return false; - var event = new Event('message'); - event.initEvent('message', false, false); - event.data = data; - this.dispatchEvent(event); - }, - - send: function(data, type, errorType) { - if (this.readyState === API.CONNECTING) { - if (this._sendBuffer) { - this._sendBuffer.push(arguments); - return true; - } else { - throw new Error('Cannot call send(), socket is not open yet'); - } - } - - if (this.readyState === API.CLOSED) - return false; - - if (!(data instanceof Buffer)) data = String(data); - - var frame = this._parser.frame(data, type, errorType); - try { - this._stream.write(frame, 'binary'); - return true; - } catch (e) { - return false; - } - }, - - close: function(code, reason, ack) { - if (this.readyState === API.CLOSED) return; - if (this.readyState === API.CLOSING && ack !== false) return; - - var finalize = function() { - this.readyState = API.CLOSED; - if (this._pingLoop) clearInterval(this._pingLoop); - if (this._stream) this._stream.end(); - var event = new Event('close', {code: code || 1000, reason: reason || ''}); - event.initEvent('close', false, false); - this.dispatchEvent(event); - }; - - if (this.readyState === API.CONNECTING) - return finalize.call(this); - - this.readyState = API.CLOSING; - - if (ack === false) { - if (this._parser.close) this._parser.close(code, reason); - finalize.call(this); - } else { - if (this._parser.close) this._parser.close(code, reason, finalize, this); - else finalize.call(this); - } - } -}; - -for (var key in EventTarget) API[key] = EventTarget[key]; - -module.exports = API; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api/event.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api/event.js deleted file mode 100644 index 2f707d8..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api/event.js +++ /dev/null @@ -1,21 +0,0 @@ -var Event = function(eventType, options) { - this.type = eventType; - for (var key in options) - this[key] = options[key]; -}; - -Event.prototype.initEvent = function(eventType, canBubble, cancelable) { - this.type = eventType; - this.bubbles = canBubble; - this.cancelable = cancelable; -}; - -Event.prototype.stopPropagation = function() {}; -Event.prototype.preventDefault = function() {}; - -Event.CAPTURING_PHASE = 1; -Event.AT_TARGET = 2; -Event.BUBBLING_PHASE = 3; - -module.exports = Event; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js deleted file mode 100644 index 056a8f4..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js +++ /dev/null @@ -1,47 +0,0 @@ -var Event = require('./event'); - -var EventTarget = { - onopen: null, - onmessage: null, - onerror: null, - onclose: null, - - addEventListener: function(eventType, listener, useCapture) { - this._listeners = this._listeners || {}; - var list = this._listeners[eventType] = this._listeners[eventType] || []; - list.push(listener); - }, - - removeEventListener: function(eventType, listener, useCapture) { - if (!this._listeners || !this._listeners[eventType]) return; - - if (!listener) { - delete this._listeners[eventType]; - return; - } - var list = this._listeners[eventType], - i = list.length; - - while (i--) { - if (listener !== list[i]) continue; - list.splice(i,1); - } - }, - - dispatchEvent: function(event) { - event.target = event.currentTarget = this; - event.eventPhase = Event.AT_TARGET; - - if (this['on' + event.type]) - this['on' + event.type](event); - - if (!this._listeners || !this._listeners[event.type]) return; - - this._listeners[event.type].forEach(function(listener) { - listener(event); - }, this); - } -}; - -module.exports = EventTarget; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/client.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/client.js deleted file mode 100644 index cde0002..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/client.js +++ /dev/null @@ -1,86 +0,0 @@ -var net = require('net'), - tls = require('tls'); - -var HybiParser = require('./hybi_parser'), - API = require('./api'), - Event = require('./api/event'); - -var Client = function(url, protocols, options) { - this.url = url; - this._uri = require('url').parse(url); - - this.protocol = ''; - this.readyState = API.CONNECTING; - this.bufferedAmount = 0; - - var secure = (this._uri.protocol === 'wss:'), - self = this, - onConnect = function() { self._onConnect() }, - tlsOptions = {}; - - if (options && options.verify === false) tlsOptions.rejectUnauthorized = false; - - var connection = secure - ? tls.connect(this._uri.port || 443, this._uri.hostname, tlsOptions, onConnect) - : net.createConnection(this._uri.port || 80, this._uri.hostname); - - this._parser = new HybiParser(this, {masking: true, protocols: protocols}); - this._stream = connection; - - this._stream.setTimeout(0); - this._stream.setNoDelay(true); - - if (!secure) connection.addListener('connect', onConnect); - - connection.addListener('data', function(data) { - self._onData(data); - }); - ['close', 'end', 'error'].forEach(function(event) { - connection.addListener(event, function() { self.close(1006, '', false) }); - }); -}; - -Client.prototype._onConnect = function() { - this._handshake = this._parser.createHandshake(this._uri, this._stream); - this._message = []; - try { - this._stream.write(this._handshake.requestData(), 'binary'); - } catch (e) {} -}; - -Client.prototype._onData = function(data) { - switch (this.readyState) { - case API.CONNECTING: - var bytes = this._handshake.parse(data); - for (var i = 0, n = bytes.length; i < n; i++) - this._message.push(bytes[i]); - - if (!this._handshake.isComplete()) return; - - if (this._handshake.isValid()) { - this.protocol = this._handshake.protocol || ''; - this.readyState = API.OPEN; - var event = new Event('open'); - event.initEvent('open', false, false); - this.dispatchEvent(event); - - this._parser.parse(this._message); - - } else { - this.readyState = API.CLOSED; - var event = new Event('close', {code: 1006, reason: ''}); - event.initEvent('close', false, false); - this.dispatchEvent(event); - } - break; - - case API.OPEN: - case API.CLOSING: - this._parser.parse(data); - } -}; - -for (var key in API) Client.prototype[key] = API[key]; - -module.exports = Client; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/draft75_parser.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/draft75_parser.js deleted file mode 100644 index b4e00aa..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/draft75_parser.js +++ /dev/null @@ -1,98 +0,0 @@ -var Draft75Parser = function(webSocket) { - this._socket = webSocket; - this._stage = 0; -}; - -var instance = { - getVersion: function() { - return 'hixie-75'; - }, - - handshakeResponse: function() { - return new Buffer('HTTP/1.1 101 Web Socket Protocol Handshake\r\n' + - 'Upgrade: WebSocket\r\n' + - 'Connection: Upgrade\r\n' + - 'WebSocket-Origin: ' + this._socket.request.headers.origin + '\r\n' + - 'WebSocket-Location: ' + this._socket.url + '\r\n\r\n', - 'utf8'); - }, - - isOpen: function() { - return true; - }, - - parse: function(buffer) { - var data, message, value; - for (var i = 0, n = buffer.length; i < n; i++) { - data = buffer[i]; - - switch (this._stage) { - case 0: - this._parseLeadingByte(data); - break; - - case 1: - value = (data & 0x7F); - this._length = value + 128 * this._length; - - if (this._closing && this._length === 0) { - this._socket.close(null, null, false); - } - else if ((0x80 & data) !== 0x80) { - if (this._length === 0) { - this._socket.receive(''); - this._stage = 0; - } - else { - this._buffer = []; - this._stage = 2; - } - } - break; - - case 2: - if (data === 0xFF) { - message = new Buffer(this._buffer); - this._socket.receive(message.toString('utf8', 0, this._buffer.length)); - this._stage = 0; - } - else { - this._buffer.push(data); - if (this._length && this._buffer.length === this._length) - this._stage = 0; - } - break; - } - } - }, - - _parseLeadingByte: function(data) { - if ((0x80 & data) === 0x80) { - this._length = 0; - this._stage = 1; - } else { - delete this._length; - this._buffer = []; - this._stage = 2; - } - }, - - frame: function(data) { - if (Buffer.isBuffer(data)) return data; - - var buffer = new Buffer(data, 'utf8'), - frame = new Buffer(buffer.length + 2); - - frame[0] = 0x00; - frame[buffer.length + 1] = 0xFF; - buffer.copy(frame, 1); - - return frame; - } -}; - -for (var key in instance) - Draft75Parser.prototype[key] = instance[key]; - -module.exports = Draft75Parser; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/draft76_parser.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/draft76_parser.js deleted file mode 100644 index 82da1a0..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/draft76_parser.js +++ /dev/null @@ -1,99 +0,0 @@ -var crypto = require('crypto'), - Draft75Parser = require('./draft75_parser'), - Draft76Parser = function() { Draft75Parser.apply(this, arguments) }; - -var bridge = function() {}; -bridge.prototype = Draft75Parser.prototype; -Draft76Parser.prototype = new bridge(); - -var numberFromKey = function(key) { - return parseInt(key.match(/[0-9]/g).join(''), 10); -}; - -var spacesInKey = function(key) { - return key.match(/ /g).length; -}; - -var bigEndian = function(number) { - var string = ''; - [24,16,8,0].forEach(function(offset) { - string += String.fromCharCode(number >> offset & 0xFF); - }); - return string; -}; - -Draft76Parser.prototype.getVersion = function() { - return 'hixie-76'; -}; - -Draft76Parser.prototype.handshakeResponse = function(head) { - var request = this._socket.request, tmp; - - var response = new Buffer('HTTP/1.1 101 Web Socket Protocol Handshake\r\n' + - 'Upgrade: WebSocket\r\n' + - 'Connection: Upgrade\r\n' + - 'Sec-WebSocket-Origin: ' + request.headers.origin + '\r\n' + - 'Sec-WebSocket-Location: ' + this._socket.url + '\r\n\r\n', - 'binary'); - - var signature = this.handshakeSignature(head); - if (signature) { - tmp = new Buffer(response.length + signature.length); - response.copy(tmp, 0); - signature.copy(tmp, response.length); - response = tmp; - } - - return response; -}; - -Draft76Parser.prototype.isOpen = function() { - return !!this._handshakeComplete; -}; - -Draft76Parser.prototype.handshakeSignature = function(head) { - if (head.length === 0) return null; - - var request = this._socket.request, - - key1 = request.headers['sec-websocket-key1'], - value1 = numberFromKey(key1) / spacesInKey(key1), - - key2 = request.headers['sec-websocket-key2'], - value2 = numberFromKey(key2) / spacesInKey(key2), - - MD5 = crypto.createHash('md5'); - - MD5.update(bigEndian(value1)); - MD5.update(bigEndian(value2)); - MD5.update(head.toString('binary')); - - this._handshakeComplete = true; - return new Buffer(MD5.digest('binary'), 'binary'); -}; - -Draft76Parser.prototype.parse = function(data) { - if (this._handshakeComplete) - return Draft75Parser.prototype.parse.call(this, data); - - return this.handshakeSignature(data); -}; - -Draft76Parser.prototype._parseLeadingByte = function(data) { - if (data !== 0xFF) - return Draft75Parser.prototype._parseLeadingByte.call(this, data); - - this._closing = true; - this._length = 0; - this._stage = 1; -}; - -Draft76Parser.prototype.close = function(code, reason, callback, context) { - if (this._closed) return; - if (this._closing) this._socket.send(new Buffer([0xFF, 0x00])); - this._closed = true; - if (callback) callback.call(context); -}; - -module.exports = Draft76Parser; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser.js deleted file mode 100644 index 57464da..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser.js +++ /dev/null @@ -1,355 +0,0 @@ -var crypto = require('crypto'), - Handshake = require('./hybi_parser/handshake'), - Reader = require('./hybi_parser/stream_reader'); - -var HybiParser = function(webSocket, options) { - this._reset(); - this._socket = webSocket; - this._reader = new Reader(); - this._stage = 0; - this._masking = options && options.masking; - this._protocols = options && options.protocols; - - this._pingCallbacks = {}; - - if (typeof this._protocols === 'string') - this._protocols = this._protocols.split(/\s*,\s*/); -}; - -HybiParser.mask = function(payload, mask, offset) { - if (mask.length === 0) return payload; - offset = offset || 0; - - for (var i = 0, n = payload.length - offset; i < n; i++) { - payload[offset + i] = payload[offset + i] ^ mask[i % 4]; - } - return payload; -}; - -var instance = { - BYTE: 255, - FIN: 128, - MASK: 128, - RSV1: 64, - RSV2: 32, - RSV3: 16, - OPCODE: 15, - LENGTH: 127, - - OPCODES: { - continuation: 0, - text: 1, - binary: 2, - close: 8, - ping: 9, - pong: 10 - }, - - ERRORS: { - normal_closure: 1000, - going_away: 1001, - protocol_error: 1002, - unacceptable: 1003, - encoding_error: 1007, - policy_violation: 1008, - too_large: 1009, - extension_error: 1010, - unexpected_condition: 1011 - }, - - FRAGMENTED_OPCODES: [0,1,2], - OPENING_OPCODES: [1,2], - - ERROR_CODES: [1000,1001,1002,1003,1007,1008,1009,1010,1011], - - UTF8_MATCH: /^([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$/, - - getVersion: function() { - var version = this._socket.request.headers['sec-websocket-version']; - return 'hybi-' + version; - }, - - handshakeResponse: function() { - var secKey = this._socket.request.headers['sec-websocket-key']; - if (!secKey) return null; - - var SHA1 = crypto.createHash('sha1'); - SHA1.update(secKey + Handshake.GUID); - - var accept = SHA1.digest('base64'), - protos = this._socket.request.headers['sec-websocket-protocol'], - supported = this._protocols, - proto, - - headers = [ - 'HTTP/1.1 101 Switching Protocols', - 'Upgrade: websocket', - 'Connection: Upgrade', - 'Sec-WebSocket-Accept: ' + accept - ]; - - if (protos !== undefined && supported !== undefined) { - if (typeof protos === 'string') protos = protos.split(/\s*,\s*/); - proto = protos.filter(function(p) { return supported.indexOf(p) >= 0 })[0]; - if (proto) { - this.protocol = proto; - headers.push('Sec-WebSocket-Protocol: ' + proto); - } - } - - return new Buffer(headers.concat('','').join('\r\n'), 'utf8'); - }, - - isOpen: function() { - return true; - }, - - createHandshake: function(uri) { - return new Handshake(uri, this._protocols); - }, - - parse: function(data) { - this._reader.put(data); - var buffer = true; - while (buffer) { - switch (this._stage) { - case 0: - buffer = this._reader.read(1); - if (buffer) this._parseOpcode(buffer[0]); - break; - - case 1: - buffer = this._reader.read(1); - if (buffer) this._parseLength(buffer[0]); - break; - - case 2: - buffer = this._reader.read(this._lengthSize); - if (buffer) this._parseExtendedLength(buffer); - break; - - case 3: - buffer = this._reader.read(4); - if (buffer) { - this._mask = buffer; - this._stage = 4; - } - break; - - case 4: - buffer = this._reader.read(this._length); - if (buffer) { - this._payload = buffer; - this._emitFrame(); - this._stage = 0; - } - break; - } - } - }, - - _parseOpcode: function(data) { - var rsvs = [this.RSV1, this.RSV2, this.RSV3].filter(function(rsv) { - return (data & rsv) === rsv; - }, this); - - if (rsvs.length > 0) return this._socket.close(this.ERRORS.protocol_error, null, false); - - this._final = (data & this.FIN) === this.FIN; - this._opcode = (data & this.OPCODE); - this._mask = []; - this._payload = []; - - var valid = false; - - for (var key in this.OPCODES) { - if (this.OPCODES[key] === this._opcode) - valid = true; - } - if (!valid) return this._socket.close(this.ERRORS.protocol_error, null, false); - - if (this.FRAGMENTED_OPCODES.indexOf(this._opcode) < 0 && !this._final) - return this._socket.close(this.ERRORS.protocol_error, null, false); - - if (this._mode && this.OPENING_OPCODES.indexOf(this._opcode) >= 0) - return this._socket.close(this.ERRORS.protocol_error, null, false); - - this._stage = 1; - }, - - _parseLength: function(data) { - this._masked = (data & this.MASK) === this.MASK; - this._length = (data & this.LENGTH); - - if (this._length >= 0 && this._length <= 125) { - this._stage = this._masked ? 3 : 4; - } else { - this._lengthBuffer = []; - this._lengthSize = (this._length === 126 ? 2 : 8); - this._stage = 2; - } - }, - - _parseExtendedLength: function(buffer) { - this._length = this._getInteger(buffer); - this._stage = this._masked ? 3 : 4; - }, - - frame: function(data, type, code) { - if (this._closed) return null; - - var isText = (typeof data === 'string'), - opcode = this.OPCODES[type || (isText ? 'text' : 'binary')], - buffer = isText ? new Buffer(data, 'utf8') : data, - insert = code ? 2 : 0, - length = buffer.length + insert, - header = (length <= 125) ? 2 : (length <= 65535 ? 4 : 10), - offset = header + (this._masking ? 4 : 0), - masked = this._masking ? this.MASK : 0, - frame = new Buffer(length + offset), - BYTE = this.BYTE, - mask, i; - - frame[0] = this.FIN | opcode; - - if (length <= 125) { - frame[1] = masked | length; - } else if (length <= 65535) { - frame[1] = masked | 126; - frame[2] = Math.floor(length / 256); - frame[3] = length & BYTE; - } else { - frame[1] = masked | 127; - frame[2] = Math.floor(length / Math.pow(2,56)) & BYTE; - frame[3] = Math.floor(length / Math.pow(2,48)) & BYTE; - frame[4] = Math.floor(length / Math.pow(2,40)) & BYTE; - frame[5] = Math.floor(length / Math.pow(2,32)) & BYTE; - frame[6] = Math.floor(length / Math.pow(2,24)) & BYTE; - frame[7] = Math.floor(length / Math.pow(2,16)) & BYTE; - frame[8] = Math.floor(length / Math.pow(2,8)) & BYTE; - frame[9] = length & BYTE; - } - - if (code) { - frame[offset] = Math.floor(code / 256) & BYTE; - frame[offset+1] = code & BYTE; - } - buffer.copy(frame, offset + insert); - - if (this._masking) { - mask = [Math.floor(Math.random() * 256), Math.floor(Math.random() * 256), - Math.floor(Math.random() * 256), Math.floor(Math.random() * 256)]; - new Buffer(mask).copy(frame, header); - HybiParser.mask(frame, mask, offset); - } - - return frame; - }, - - ping: function(message, callback, context) { - message = message || ''; - if (callback) this._pingCallbacks[message] = [callback, context]; - return this._socket.send(message, 'ping'); - }, - - close: function(code, reason, callback, context) { - if (this._closed) return; - if (callback) this._closingCallback = [callback, context]; - this._socket.send(reason || '', 'close', code || this.ERRORS.normal_closure); - this._closed = true; - }, - - buffer: function(fragment) { - for (var i = 0, n = fragment.length; i < n; i++) - this._buffer.push(fragment[i]); - }, - - _emitFrame: function() { - var payload = HybiParser.mask(this._payload, this._mask), - opcode = this._opcode; - - if (opcode === this.OPCODES.continuation) { - if (!this._mode) return this._socket.close(this.ERRORS.protocol_error, null, false); - this.buffer(payload); - if (this._final) { - var message = new Buffer(this._buffer); - if (this._mode === 'text') message = this._encode(message); - this._reset(); - if (message !== null) this._socket.receive(message); - else this._socket.close(this.ERRORS.encoding_error, null, false); - } - } - else if (opcode === this.OPCODES.text) { - if (this._final) { - var message = this._encode(payload); - if (message !== null) this._socket.receive(message); - else this._socket.close(this.ERRORS.encoding_error, null, false); - } else { - this._mode = 'text'; - this.buffer(payload); - } - } - else if (opcode === this.OPCODES.binary) { - if (this._final) { - this._socket.receive(payload); - } else { - this._mode = 'binary'; - this.buffer(payload); - } - } - else if (opcode === this.OPCODES.close) { - var code = (payload.length >= 2) ? 256 * payload[0] + payload[1] : null, - reason = (payload.length > 2) ? this._encode(payload.slice(2)) : null; - - if (!(payload.length === 0) && - !(code !== null && code >= 3000 && code < 5000) && - this.ERROR_CODES.indexOf(code) < 0) - code = this.ERRORS.protocol_error; - - if (payload.length > 125 || (payload.length > 2 && !reason)) - code = this.ERRORS.protocol_error; - - this._socket.close(code, (payload.length > 2) ? reason : null, false); - if (this._closingCallback) - this._closingCallback[0].call(this._closingCallback[1]); - } - else if (opcode === this.OPCODES.ping) { - if (payload.length > 125) return this._socket.close(this.ERRORS.protocol_error, null, false); - this._socket.send(payload, 'pong'); - } - else if (opcode === this.OPCODES.pong) { - var callbacks = this._pingCallbacks, - message = this._encode(payload), - callback = callbacks[message]; - - delete callbacks[message]; - if (callback) callback[0].call(callback[1]); - } - }, - - _reset: function() { - this._mode = null; - this._buffer = []; - }, - - _encode: function(buffer) { - try { - var string = buffer.toString('binary', 0, buffer.length); - if (!this.UTF8_MATCH.test(string)) return null; - } catch (e) {} - return buffer.toString('utf8', 0, buffer.length); - }, - - _getInteger: function(bytes) { - var number = 0; - for (var i = 0, n = bytes.length; i < n; i++) - number += bytes[i] << (8 * (n - 1 - i)); - return number; - } -}; - -for (var key in instance) - HybiParser.prototype[key] = instance[key]; - -module.exports = HybiParser; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser/handshake.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser/handshake.js deleted file mode 100644 index 0a75191..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser/handshake.js +++ /dev/null @@ -1,91 +0,0 @@ -var crypto = require('crypto'); - -var Handshake = function(uri, protocols) { - this._uri = uri; - this._protocols = protocols; - - var buffer = new Buffer(16), i = 16; - while (i--) buffer[i] = Math.floor(Math.random() * 256); - this._key = buffer.toString('base64'); - - var SHA1 = crypto.createHash('sha1'); - SHA1.update(this._key + Handshake.GUID); - this._accept = SHA1.digest('base64'); - - var HTTPParser = process.binding('http_parser').HTTPParser, - parser = new HTTPParser(HTTPParser.RESPONSE || 'response'), - current = null, - self = this; - - this._nodeVersion = HTTPParser.RESPONSE ? 6 : 4; - this._complete = false; - this._headers = {}; - this._parser = parser; - - parser.onHeaderField = function(b, start, length) { - current = b.toString('utf8', start, start + length); - }; - parser.onHeaderValue = function(b, start, length) { - self._headers[current] = b.toString('utf8', start, start + length); - }; - parser.onHeadersComplete = function(info) { - self._status = info.statusCode; - var headers = info.headers; - if (!headers) return; - for (var i = 0, n = headers.length; i < n; i += 2) - self._headers[headers[i]] = headers[i+1]; - }; - parser.onMessageComplete = function() { - self._complete = true; - }; -}; - -Handshake.GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; - -Handshake.prototype.requestData = function() { - var u = this._uri; - - var headers = [ - 'GET ' + (u.pathname || '/') + (u.search || '') + ' HTTP/1.1', - 'Host: ' + u.hostname + (u.port ? ':' + u.port : ''), - 'Upgrade: websocket', - 'Connection: Upgrade', - 'Sec-WebSocket-Key: ' + this._key, - 'Sec-WebSocket-Version: 13' - ]; - - if (this._protocols) - headers.push('Sec-WebSocket-Protocol: ' + this._protocols.join(', ')); - - return new Buffer(headers.concat('','').join('\r\n'), 'utf8'); -}; - -Handshake.prototype.parse = function(data) { - var consumed = this._parser.execute(data, 0, data.length), - offset = (this._nodeVersion < 6) ? 1 : 0; - - return (consumed === data.length) ? [] : data.slice(consumed + offset); -}; - -Handshake.prototype.isComplete = function() { - return this._complete; -}; - -Handshake.prototype.isValid = function() { - if (this._status !== 101) return false; - - var upgrade = this._headers.Upgrade, - connection = this._headers.Connection, - protocol = this._headers['Sec-WebSocket-Protocol']; - - this.protocol = this._protocols && this._protocols.indexOf(protocol) >= 0 - ? protocol - : null; - - return upgrade && /^websocket$/i.test(upgrade) && - connection && connection.split(/\s*,\s*/).indexOf('Upgrade') >= 0 && - ((!this._protocols && !protocol) || this.protocol) && - this._headers['Sec-WebSocket-Accept'] === this._accept; -}; - -module.exports = Handshake; diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser/stream_reader.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser/stream_reader.js deleted file mode 100644 index 01e607f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/lib/faye/websocket/hybi_parser/stream_reader.js +++ /dev/null @@ -1,43 +0,0 @@ -var StreamReader = function() { - this._queue = []; - this._cursor = 0; -}; - -StreamReader.prototype.read = function(bytes) { - return this._readBuffer(bytes); -}; - -StreamReader.prototype.put = function(buffer) { - if (!buffer || buffer.length === 0) return; - if (!buffer.copy) buffer = new Buffer(buffer); - this._queue.push(buffer); -}; - -StreamReader.prototype._readBuffer = function(length) { - var buffer = new Buffer(length), - queue = this._queue, - remain = length, - n = queue.length, - i = 0, - chunk, offset, size; - - if (remain === 0) return buffer; - - while (remain > 0 && i < n) { - chunk = queue[i]; - offset = (i === 0) ? this._cursor : 0; - size = Math.min(remain, chunk.length - offset); - chunk.copy(buffer, length - remain, offset, offset + size); - remain -= size; - i += 1; - } - - if (remain > 0) return null; - - queue.splice(0, i-1); - this._cursor = (i === 1 ? this._cursor : 0) + size; - - return buffer; -}; - -module.exports = StreamReader; diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/package.json deleted file mode 100644 index 921b0e9..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "faye-websocket", - "description": "Standards-compliant WebSocket server and client", - "homepage": "http://github.com/faye/faye-websocket-node", - "author": { - "name": "James Coglan", - "email": "jcoglan@gmail.com", - "url": "http://jcoglan.com/" - }, - "keywords": [ - "websocket", - "eventsource" - ], - "version": "0.4.4", - "engines": { - "node": ">=0.4.0" - }, - "main": "./lib/faye/websocket", - "devDependencies": { - "jsclass": "", - "pace": "" - }, - "scripts": { - "test": "node spec/runner.js" - }, - "bugs": { - "url": "http://github.com/faye/faye-websocket-node/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://www.opensource.org/licenses/mit-license.php" - } - ], - "repositories": [ - { - "type": "git", - "url": "git://github.com/faye/faye-websocket-node.git" - } - ], - "readme": "# faye-websocket\n\n* Travis CI build: [](http://travis-ci.org/faye/faye-websocket-node)\n* Autobahn tests: [server](http://faye.jcoglan.com/autobahn/servers/), [client](http://faye.jcoglan.com/autobahn/clients/)\n\nThis is a robust, general-purpose WebSocket implementation extracted from the\n[Faye](http://faye.jcoglan.com) project. It provides classes for easily building\nWebSocket servers and clients in Node. It does not provide a server itself, but\nrather makes it easy to handle WebSocket connections within an existing\n[Node](http://nodejs.org/) application. It does not provide any abstraction\nother than the standard [WebSocket API](http://dev.w3.org/html5/websockets/).\n\nIt also provides an abstraction for handling [EventSource](http://dev.w3.org/html5/eventsource/)\nconnections, which are one-way connections that allow the server to push data to\nthe client. They are based on streaming HTTP responses and can be easier to\naccess via proxies than WebSockets.\n\nThe server-side socket can process [draft-75](http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75),\n[draft-76](http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76),\n[hybi-07](http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07)\nand later versions of the protocol. It selects protocol versions automatically,\nsupports both `text` and `binary` messages, and transparently handles `ping`,\n`pong`, `close` and fragmented messages.\n\n\n## Handling WebSocket connections in Node\n\nYou can handle WebSockets on the server side by listening for HTTP Upgrade\nrequests, and creating a new socket for the request. This socket object exposes\nthe usual WebSocket methods for receiving and sending messages. For example this\nis how you'd implement an echo server:\n\n```js\nvar WebSocket = require('faye-websocket'),\n http = require('http');\n\nvar server = http.createServer();\n\nserver.addListener('upgrade', function(request, socket, head) {\n var ws = new WebSocket(request, socket, head);\n \n ws.onmessage = function(event) {\n ws.send(event.data);\n };\n \n ws.onclose = function(event) {\n console.log('close', event.code, event.reason);\n ws = null;\n };\n});\n\nserver.listen(8000);\n```\n\nNote that under certain circumstances (notably a draft-76 client connecting\nthrough an HTTP proxy), the WebSocket handshake will not be complete after you\ncall `new WebSocket()` because the server will not have received the entire\nhandshake from the client yet. In this case, calls to `ws.send()` will buffer\nthe message in memory until the handshake is complete, at which point any\nbuffered messages will be sent to the client.\n\nIf you need to detect when the WebSocket handshake is complete, you can use the\n`onopen` event.\n\nIf the connection's protocol version supports it, you can call `ws.ping()` to\nsend a ping message and wait for the client's response. This method takes a\nmessage string, and an optional callback that fires when a matching pong message\nis received. It returns `true` iff a ping message was sent. If the client does\nnot support ping/pong, this method sends no data and returns `false`.\n\n```js\nws.ping('Mic check, one, two', function() {\n // fires when pong is received\n});\n```\n\n\n## Using the WebSocket client\n\nThe client supports both the plain-text `ws` protocol and the encrypted `wss`\nprotocol, and has exactly the same interface as a socket you would use in a web\nbrowser. On the wire it identifies itself as hybi-13.\n\n```js\nvar WebSocket = require('faye-websocket'),\n ws = new WebSocket.Client('ws://www.example.com/');\n\nws.onopen = function(event) {\n console.log('open');\n ws.send('Hello, world!');\n};\n\nws.onmessage = function(event) {\n console.log('message', event.data);\n};\n\nws.onclose = function(event) {\n console.log('close', event.code, event.reason);\n ws = null;\n};\n```\n\n\n## Subprotocol negotiation\n\nThe WebSocket protocol allows peers to select and identify the application\nprotocol to use over the connection. On the client side, you can set which\nprotocols the client accepts by passing a list of protocol names when you\nconstruct the socket:\n\n```js\nvar ws = new WebSocket.Client('ws://www.example.com/', ['irc', 'amqp']);\n```\n\nOn the server side, you can likewise pass in the list of protocols the server\nsupports after the other constructor arguments:\n\n```js\nvar ws = new WebSocket(request, socket, head, ['irc', 'amqp']);\n```\n\nIf the client and server agree on a protocol, both the client- and server-side\nsocket objects expose the selected protocol through the `ws.protocol` property.\nIf they cannot agree on a protocol to use, the client closes the connection.\n\n\n## WebSocket API\n\nThe WebSocket API consists of several event handlers and a method for sending\nmessages.\n\n* onopen fires when the socket connection is established. Event\n has no attributes.\n* onerror fires when the connection attempt fails. Event has no\n attributes.\n* onmessage fires when the socket receives a message. Event has\n one attribute, data, which is either a `String` (for text\n frames) or a `Buffer` (for binary frames).\n* onclose fires when either the client or the server closes the\n connection. Event has two optional attributes, code and\n reason, that expose the status code and message sent by the\n peer that closed the connection.\n* send(message) accepts either a `String` or a `Buffer` and\n sends a text or binary message over the connection to the other peer.\n* close(code, reason) closes the connection, sending the given\n status code and reason text, both of which are optional.\n* protocol is a string (which may be empty) identifying the\n subprotocol the socket is using.\n\n\n## Handling EventSource connections in Node\n\nEventSource connections provide a very similar interface, although because they\nonly allow the server to send data to the client, there is no `onmessage` API.\nEventSource allows the server to push text messages to the client, where each\nmessage has an optional event-type and ID.\n\n```js\nvar WebSocket = require('faye-websocket'),\n EventSource = WebSocket.EventSource,\n http = require('http');\n\nvar server = http.createServer();\n\nserver.addListener('request', function(request, response) {\n if (EventSource.isEventSource(request)) {\n var es = new EventSource(request, response);\n console.log('open', es.url, es.lastEventId);\n \n // Periodically send messages\n var loop = setInterval(function() { es.send('Hello') }, 1000);\n \n es.onclose = function() {\n clearInterval(loop);\n es = null;\n };\n \n } else {\n // Normal HTTP request\n response.writeHead(200, {'Content-Type': 'text/plain'});\n response.write('Hello');\n response.end();\n }\n});\n\nserver.listen(8000);\n```\n\nThe `send` method takes two optional parameters, `event` and `id`. The default\nevent-type is `'message'` with no ID. For example, to send a `notification`\nevent with ID `99`:\n\n```js\nes.send('Breaking News!', {event: 'notification', id: '99'});\n```\n\nThe `EventSource` object exposes the following properties:\n\n* url is a string containing the URL the client used to create\n the EventSource.\n* lastEventId is a string containing the last event ID\n received by the client. You can use this when the client reconnects after a\n dropped connection to determine which messages need resending.\n\nWhen you initialize an EventSource with ` new EventSource()`, you can pass\nconfiguration options after the `response` parameter. Available options are:\n\n* retry is a number that tells the client how long (in seconds)\n it should wait after a dropped connection before attempting to reconnect.\n* ping is a number that tells the server how often (in seconds)\n to send 'ping' packets to the client to keep the connection open, to defeat\n timeouts set by proxies. The client will ignore these messages.\n\nFor example, this creates a connection that pings every 15 seconds and is\nretryable every 10 seconds if the connection is broken:\n\n```js\nvar es = new EventSource(request, response, {ping: 15, retry: 10});\n```\n\nYou can send a ping message at any time by calling `es.ping()`. Unlike WebSocket,\nthe client does not send a response to this; it is merely to send some data over\nthe wire to keep the connection alive.\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2009-2013 James Coglan\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 use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\nSoftware, and to permit persons to whom the Software is furnished to do so,\nsubject 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, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n", - "readmeFilename": "README.markdown", - "repository": { - "type": "git", - "url": "git://github.com/faye/faye-websocket-node.git" - }, - "_id": "faye-websocket@0.4.4", - "_from": "faye-websocket@~0.4.3" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/client_spec.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/client_spec.js deleted file mode 100644 index e9aa6bc..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/client_spec.js +++ /dev/null @@ -1,175 +0,0 @@ -var Client = require('../../../lib/faye/websocket/client') - -JS.ENV.WebSocketSteps = JS.Test.asyncSteps({ - server: function(port, secure, callback) { - this._adapter = new EchoServer() - this._adapter.listen(port, secure) - this._port = port - setTimeout(callback, 100) - }, - - stop: function(callback) { - this._adapter.stop() - setTimeout(callback, 100) - }, - - open_socket: function(url, protocols, callback) { - var done = false, - self = this, - - resume = function(open) { - if (done) return - done = true - self._open = open - callback() - } - - this._ws = new Client(url, protocols, {verify: false}) - - this._ws.onopen = function() { resume(true) } - this._ws.onclose = function() { resume(false) } - }, - - close_socket: function(callback) { - var self = this - this._ws.onclose = function() { - self._open = false - callback() - } - this._ws.close() - }, - - check_open: function(callback) { - this.assert( this._open ) - callback() - }, - - check_closed: function(callback) { - this.assert( !this._open ) - callback() - }, - - check_protocol: function(protocol, callback) { - this.assertEqual( protocol, this._ws.protocol ) - callback() - }, - - listen_for_message: function(callback) { - var self = this - this._ws.addEventListener('message', function(message) { self._message = message.data }) - callback() - }, - - send_message: function(message, callback) { - this._ws.send(message) - setTimeout(callback, 100) - }, - - check_response: function(message, callback) { - this.assertEqual( message, this._message ) - callback() - }, - - check_no_response: function(callback) { - this.assert( !this._message ) - callback() - } -}) - - -JS.ENV.ClientSpec = JS.Test.describe("Client", function() { with(this) { - include(WebSocketSteps) - - before(function() { - this.protocols = ["foo", "echo"] - this.plain_text_url = "ws://localhost:8000/bayeux" - this.secure_url = "wss://localhost:8000/bayeux" - }) - - sharedBehavior("socket client", function() { with(this) { - it("can open a connection", function() { with(this) { - open_socket(socket_url, protocols) - check_open() - check_protocol("echo") - }}) - - it("cannot open a connection with unacceptable protocols", function() { with(this) { - open_socket(socket_url, ["foo"]) - check_closed() - }}) - - it("can close the connection", function() { with(this) { - open_socket(socket_url, protocols) - close_socket() - check_closed() - }}) - - describe("in the OPEN state", function() { with(this) { - before(function() { with(this) { - open_socket(socket_url, protocols) - }}) - - it("can send and receive messages", function() { with(this) { - listen_for_message() - send_message("I expect this to be echoed") - check_response("I expect this to be echoed") - }}) - - it("sends numbers as strings", function() { with(this) { - listen_for_message() - send_message(13) - check_response("13") - }}) - - it("sends booleans as strings", function() { with(this) { - listen_for_message() - send_message(false) - check_response("false") - }}) - - it("sends arrays as strings", function() { with(this) { - listen_for_message() - send_message([13,14,15]) - check_response("13,14,15") - }}) - }}) - - describe("in the CLOSED state", function() { with(this) { - before(function() { with(this) { - open_socket(socket_url, protocols) - close_socket() - }}) - - it("cannot send and receive messages", function() { with(this) { - listen_for_message() - send_message("I expect this to be echoed") - check_no_response() - }}) - }}) - }}) - - describe("with a plain-text server", function() { with(this) { - before(function() { - this.socket_url = this.plain_text_url - this.blocked_url = this.secure_url - }) - - before(function() { this.server(8000, false) }) - after (function() { this.stop() }) - - behavesLike("socket client") - }}) - - describe("with a secure server", function() { with(this) { - before(function() { - this.socket_url = this.secure_url - this.blocked_url = this.plain_text_url - }) - - before(function() { this.server(8000, true) }) - after (function() { this.stop() }) - - behavesLike("socket client") - }}) -}}) - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/draft75parser_spec.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/draft75parser_spec.js deleted file mode 100644 index 6197193..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/draft75parser_spec.js +++ /dev/null @@ -1,72 +0,0 @@ -var Draft75Parser = require('../../../lib/faye/websocket/draft75_parser') - -JS.ENV.Draft75ParserSpec = JS.Test.describe("Draft75Parser", function() { with(this) { - before(function() { with(this) { - this.webSocket = {dispatchEvent: function() {}} - this.parser = new Draft75Parser(webSocket) - }}) - - describe("parse", function() { with(this) { - sharedBehavior("draft-75 parser", function() { with(this) { - it("parses text frames", function() { with(this) { - expect(webSocket, "receive").given("Hello") - parser.parse([0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xff]) - }}) - - it("parses multiple frames from the same packet", function() { with(this) { - expect(webSocket, "receive").given("Hello").exactly(2) - parser.parse([0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xff, 0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xff]) - }}) - - it("parses text frames beginning 0x00-0x7F", function() { with(this) { - expect(webSocket, "receive").given("Hello") - parser.parse([0x66, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xff]) - }}) - - it("ignores frames with a length header", function() { with(this) { - expect(webSocket, "receive").exactly(0) - parser.parse([0x80, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f]) - }}) - - it("parses text following an ignored block", function() { with(this) { - expect(webSocket, "receive").given("Hello") - parser.parse([0x80, 0x02, 0x48, 0x65, 0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xff]) - }}) - - it("parses multibyte text frames", function() { with(this) { - expect(webSocket, "receive").given("Apple = ") - parser.parse([0x00, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3, 0xbf, 0xff]) - }}) - - it("parses frames received in several packets", function() { with(this) { - expect(webSocket, "receive").given("Apple = ") - parser.parse([0x00, 0x41, 0x70, 0x70, 0x6c, 0x65]) - parser.parse([0x20, 0x3d, 0x20, 0xef, 0xa3, 0xbf, 0xff]) - }}) - - it("parses fragmented frames", function() { with(this) { - expect(webSocket, "receive").given("Hello") - parser.parse([0x00, 0x48, 0x65, 0x6c]) - parser.parse([0x6c, 0x6f, 0xff]) - }}) - }}) - - behavesLike("draft-75 parser") - - it("does not close the socket if a 76 close frame is received", function() { with(this) { - expect(webSocket, "close").exactly(0) - expect(webSocket, "receive").given("") - parser.parse([0xFF, 0x00]) - }}) - }}) - - describe("frame", function() { with(this) { - it("returns the given string formatted as a WebSocket frame", function() { with(this) { - assertBufferEqual( [0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xff], parser.frame("Hello") ) - }}) - - it("encodes multibyte characters correctly", function() { with(this) { - assertBufferEqual( [0x00, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3, 0xbf, 0xff], parser.frame("Apple = ") ) - }}) - }}) -}}) diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/draft76parser_spec.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/draft76parser_spec.js deleted file mode 100644 index 775c1e3..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/draft76parser_spec.js +++ /dev/null @@ -1,28 +0,0 @@ -var Draft76Parser = require('../../../lib/faye/websocket/draft76_parser') - -JS.ENV.Draft76ParserSpec = JS.Test.describe("Draft76Parser", function() { with(this) { - before(function() { with(this) { - this.webSocket = {dispatchEvent: function() {}} - this.parser = new Draft76Parser(webSocket) - parser._handshakeComplete = true - }}) - - describe("parse", function() { with(this) { - behavesLike("draft-75 parser") - - it("closes the socket if a close frame is received", function() { with(this) { - expect(webSocket, "close") - parser.parse([0xFF, 0x00]) - }}) - }}) - - describe("frame", function() { with(this) { - it("returns the given string formatted as a WebSocket frame", function() { with(this) { - assertBufferEqual( [0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xff], parser.frame("Hello") ) - }}) - - it("encodes multibyte characters correctly", function() { with(this) { - assertBufferEqual( [0x00, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3, 0xbf, 0xff], parser.frame("Apple = ") ) - }}) - }}) -}}) diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/hybi_parser_spec.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/hybi_parser_spec.js deleted file mode 100644 index 5531b9d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/faye/websocket/hybi_parser_spec.js +++ /dev/null @@ -1,148 +0,0 @@ -var HybiParser = require('../../../lib/faye/websocket/hybi_parser') - -JS.ENV.HybiParserSpec = JS.Test.describe("HybiParser", function() { with(this) { - before(function() { with(this) { - this.webSocket = {dispatchEvent: function() {}} - this.parser = new HybiParser(webSocket) - }}) - - define("parse", function() { - var bytes = []; - for (var i = 0, n = arguments.length; i < n; i++) bytes = bytes.concat(arguments[i]) - this.parser.parse(new Buffer(bytes)) - }) - - define("buffer", function(string) { - return { - equals: function(buffer) { - return buffer.toString('utf8', 0, buffer.length) === string - } - } - }) - - describe("parse", function() { with(this) { - define("mask", function() { - return this._mask = this._mask || [1,2,3,4].map(function() { return Math.floor(Math.random() * 255) }) - }) - - define("maskMessage", function(bytes) { - var output = [] - Array.prototype.forEach.call(bytes, function(b, i) { - output[i] = bytes[i] ^ this.mask()[i % 4] - }, this) - return output - }) - - it("parses unmasked text frames", function() { with(this) { - expect(webSocket, "receive").given("Hello") - parse([0x81, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f]) - }}) - - it("parses multiple frames from the same packet", function() { with(this) { - expect(webSocket, "receive").given("Hello").exactly(2) - parse([0x81, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x81, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f]) - }}) - - it("parses empty text frames", function() { with(this) { - expect(webSocket, "receive").given("") - parse([0x81, 0x00]) - }}) - - it("parses fragmented text frames", function() { with(this) { - expect(webSocket, "receive").given("Hello") - parse([0x01, 0x03, 0x48, 0x65, 0x6c]) - parse([0x80, 0x02, 0x6c, 0x6f]) - }}) - - it("parses masked text frames", function() { with(this) { - expect(webSocket, "receive").given("Hello") - parse([0x81, 0x85], mask(), maskMessage([0x48, 0x65, 0x6c, 0x6c, 0x6f])) - }}) - - it("parses masked empty text frames", function() { with(this) { - expect(webSocket, "receive").given("") - parse([0x81, 0x80], mask(), maskMessage([])) - }}) - - it("parses masked fragmented text frames", function() { with(this) { - expect(webSocket, "receive").given("Hello") - parse([0x01, 0x81], mask(), maskMessage([0x48])) - parse([0x80, 0x84], mask(), maskMessage([0x65, 0x6c, 0x6c, 0x6f])) - }}) - - it("closes the socket if the frame has an unrecognized opcode", function() { with(this) { - expect(webSocket, "close").given(1002, null, false) - parse([0x83, 0x00]) - }}) - - it("closes the socket if a close frame is received", function() { with(this) { - expect(webSocket, "close").given(1000, "Hello", false) - parse([0x88, 0x07, 0x03, 0xe8, 0x48, 0x65, 0x6c, 0x6c, 0x6f]) - }}) - - it("parses unmasked multibyte text frames", function() { with(this) { - expect(webSocket, "receive").given("Apple = ") - parse([0x81, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3, 0xbf]) - }}) - - it("parses frames received in several packets", function() { with(this) { - expect(webSocket, "receive").given("Apple = ") - parse([0x81, 0x0b, 0x41, 0x70, 0x70, 0x6c]) - parse([0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3, 0xbf]) - }}) - - it("parses fragmented multibyte text frames", function() { with(this) { - expect(webSocket, "receive").given("Apple = ") - parse([0x01, 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3]) - parse([0x80, 0x01, 0xbf]) - }}) - - it("parses masked multibyte text frames", function() { with(this) { - expect(webSocket, "receive").given("Apple = ") - parse([0x81, 0x8b], mask(), maskMessage([0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3, 0xbf])) - }}) - - it("parses masked fragmented multibyte text frames", function() { with(this) { - expect(webSocket, "receive").given("Apple = ") - parse([0x01, 0x8a], mask(), maskMessage([0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3])) - parse([0x80, 0x81], mask(), maskMessage([0xbf])) - }}) - - it("parses unmasked medium-length text frames", function() { with(this) { - expect(webSocket, "receive").given("HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello") - parse([129, 126, 0, 200, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111]) - }}) - - it("parses masked medium-length text frames", function() { with(this) { - expect(webSocket, "receive").given("HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello") - parse([129, 254, 0, 200], mask(), maskMessage([72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111])) - }}) - - it("replies to pings with a pong", function() { with(this) { - expect(webSocket, "send").given(buffer("OHAI"), "pong") - parse([0x89, 0x04, 0x4f, 0x48, 0x41, 0x49]) - }}) - }}) - - describe("frame", function() { with(this) { - it("returns the given string formatted as a WebSocket frame", function() { with(this) { - assertBufferEqual( [0x81, 0x05, 0x48, 0x65, 0x6c, 0x6c, 0x6f], parser.frame("Hello") ) - }}) - - it("encodes multibyte characters correctly", function() { with(this) { - assertBufferEqual( [0x81, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0xef, 0xa3, 0xbf], parser.frame("Apple = ") ) - }}) - - it("encodes medium-length strings using extra length bytes", function() { with(this) { - assertBufferEqual( [129, 126, 0, 200, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111, 72, 101, 108, 108, 111], parser.frame("HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHello") ) - }}) - - it("encodes close frames with an error code", function() { with(this) { - assertBufferEqual( [0x88, 0x07, 0x03, 0xea, 0x48, 0x65, 0x6c, 0x6c, 0x6f], parser.frame("Hello", "close", 1002) ) - }}) - - it("encodes pong frames", function() { with(this) { - assertBufferEqual( [0x8a, 0x00], parser.frame("", "pong") ) - }}) - }}) -}}) diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/runner.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/runner.js deleted file mode 100644 index 68ad93e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/runner.js +++ /dev/null @@ -1,54 +0,0 @@ -require('jsclass') - -var WebSocket = require('../lib/faye/websocket'), - fs = require('fs'), - http = require('http'), - https = require('https') - - -JS.ENV.EchoServer = function() {} -EchoServer.prototype.listen = function(port, ssl) { - var server = ssl - ? https.createServer({ - key: fs.readFileSync(__dirname + '/server.key'), - cert: fs.readFileSync(__dirname + '/server.crt') - }) - : http.createServer() - - server.addListener('upgrade', function(request, socket, head) { - var ws = new WebSocket(request, socket, head, ["echo"]) - ws.onmessage = function(event) { - ws.send(event.data) - } - }) - this._httpServer = server - server.listen(port) -} -EchoServer.prototype.stop = function(callback, scope) { - this._httpServer.addListener('close', function() { - if (callback) callback.call(scope); - }); - this._httpServer.close(); -} - - -JS.Packages(function() { with(this) { - autoload(/.*Spec/, {from: 'spec/faye/websocket'}) -}}) - - -JS.require('JS.Test', function() { - JS.Test.Unit.Assertions.define("assertBufferEqual", function(array, buffer) { - this.assertEqual(array.length, buffer.length); - var ary = [], n = buffer.length; - while (n--) ary[n] = buffer[n]; - this.assertEqual(array, ary); - }) - - JS.require( 'ClientSpec', - 'Draft75ParserSpec', - 'Draft76ParserSpec', - 'HybiParserSpec', - JS.Test.method('autorun')) -}) - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/server.crt b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/server.crt deleted file mode 100644 index ade70de..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/server.crt +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICZTCCAc4CCQDxyrJZrFA0vjANBgkqhkiG9w0BAQUFADB3MQswCQYDVQQGEwJV -SzEPMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDTALBgNVBAoTBEZh -eWUxFTATBgNVBAMTDEphbWVzIENvZ2xhbjEgMB4GCSqGSIb3DQEJARYRamNvZ2xh -bkBnbWFpbC5jb20wHhcNMTEwODMwMTIzOTM2WhcNMTIwODI5MTIzOTM2WjB3MQsw -CQYDVQQGEwJVSzEPMA0GA1UECBMGTG9uZG9uMQ8wDQYDVQQHEwZMb25kb24xDTAL -BgNVBAoTBEZheWUxFTATBgNVBAMTDEphbWVzIENvZ2xhbjEgMB4GCSqGSIb3DQEJ -ARYRamNvZ2xhbkBnbWFpbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB -AMDjU5fAK7fvUCZIYHcGXDZD/m9bY+B/UcwGcowk0hMQGYNlLKrpiK7xXBmZpDb6 -r8n+7L/epBeSumbRIm4TDzeNHhuQGYLIeGQy7JNLoPBr6GxubjuJhKOOBnCqcupR -CLGG7Zw5oL4UvtZVH6kL9XnjyokQQbxxeoV9DqtqOaHHAgMBAAEwDQYJKoZIhvcN -AQEFBQADgYEAvQjSpzE1ahaeH1CmbLwckTxvWMZfxcZOrxTruK1po3cNnDOjGqFQ -KEkNj3K5WfwTBD4QgUdYDykhDX2m6HaMz4JEbgrwQv8M8FiswIA3dyGsbOifOk8H -r3GPNKMzm4o6vrn6RGOpt9q6bsWUBUHfNpP93uU2C9QEwDua3cFjDA0= ------END CERTIFICATE----- diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/server.key b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/server.key deleted file mode 100644 index 85aba2d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/faye-websocket/spec/server.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQDA41OXwCu371AmSGB3Blw2Q/5vW2Pgf1HMBnKMJNITEBmDZSyq -6Yiu8VwZmaQ2+q/J/uy/3qQXkrpm0SJuEw83jR4bkBmCyHhkMuyTS6Dwa+hsbm47 -iYSjjgZwqnLqUQixhu2cOaC+FL7WVR+pC/V548qJEEG8cXqFfQ6rajmhxwIDAQAB -AoGABlk1DiCQD8y7mZb2PdSiwlJ4lFewsNnf6lQn/v7TPzdfb5ir4LAxBHkDLACH -jBuyH3bZefMs+W2l3u5xMKhF7uJqYcUlJdH2UwRfNG54Hn4SGAjQOK3ONer99sUf -USlsWSX1HjAAFMCBwUfKxMZA3VNQfYKTPdm0jSVf85kHO1ECQQD3s6ksm3QpfD0L -eG9EoDrqmwnEfpKoWPpz1O0i5tY9VcmhmLwS5Zpd7lB1qjTqzZk4RygU73T/BseJ -azehIHK5AkEAx1mSXt+ec8RfzVi/io6oqi2vOcACXRbOG4NQmqUWPnumdwsJjsjR -RzEoDFC2lu6448p9sgEq+CkbmgVeiyp4fwJAQnmgySve/NMuvslPcyddKGD7OhSN -30ghzrwx98/jZwqC1i9bKeccimDOjwVitjD/Ea9m/ldVGqwDGMoBX+iJYQJAEIOO -CYfyw1pQKV2huGOq+zX/nwQV7go2lrbhFX55gkGR/6iNaSOfmosq6yJAje5GqLAc -i4NnQNl+7NpnA5ZIFwJBAI1+OsZyjbRI99pYkTdOpa5IPlIb3j3JbSfjAWHLxlRY -0HLvN3Q1mE9kbB+uKH6syF/S7nALgsLgq7eHYvIaE/A= ------END RSA PRIVATE KEY----- diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/.npmignore b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/.npmignore deleted file mode 100644 index 2e84c13..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/.npmignore +++ /dev/null @@ -1 +0,0 @@ -.travis.yml diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/actions/collectable.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/actions/collectable.js deleted file mode 100644 index f8fe9ee..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/actions/collectable.js +++ /dev/null @@ -1,94 +0,0 @@ - -var fs = require('fs'); - -// Collectable Mixin -// -// Provides utility methods to read from stdin and remaining arguments. -var collectable = module.exports; - -// XXX: tomdocify, generate in readme - -collectable.stdin = function stdin(force, done) { - if(!done) done = force, force = false; - var argv = this.nopt.argv; - var self = this; - done = done || function(err) { err && self.emit('error', err); }; - - this._readFromStdin = true; - - // not parsed, register done to be read when parse is called - if(!argv) { - this.once('stdin', done); - return this; - } - - // only read from stdin when no reamining args and not forced - if(!argv.remain.length || force) { - this.readStdin(done); - } - - return this; -}; - -// Read files from remaining args, concat the result and call back the `done` -// function with the concatanated result and the list of files. -collectable.files = function files(done) { - var argv = this.nopt.argv; - var self = this; - done = done || function(err) { err && self.emit('error', err); }; - - // not parsed, register done to be read when parse is called - if(!argv) { - this.once('files', done); - return this; - } - - // only read files when we actually have files to read from - if(argv.remain.length) { - this.readFiles(argv.remain, done); - } - - return this; -}; - -collectable.readStdin = function readStdin(done) { - var data = ''; - var self = this; - process.stdin.setEncoding('utf8'); - process.stdin.on('error', done); - process.stdin.on('data', function(chunk){ - data += chunk; - self.emit('stdin:data', chunk); - }).on('end', function(){ - self.emit('stdin', null, data); - done(null, data); - }).resume(); - return this; -}; - -// Asynchronous walk of the remaining args, reading the content and returns -// the concatanated result. -collectable.readFiles = function readFiles(filepaths, done) { - var data = ''; - var self = this; - var files = filepaths.slice(0); - (function read(file) { - if(!file) { - self.emit('files', null, data, filepaths); - return done(null, data, filepaths); - } - fs.readFile(file, 'utf8', function(err, body) { - if(err) return done(err); - data += body; - self.emit('files:data', body); - read(files.shift()); - }); - })(files.shift()); - return this; -}; - -// Collect data either from stdin or the list of remaining args -collectable.collect = function collect(done) { - return this.stdin(done).files(done); -}; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/actions/commandable.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/actions/commandable.js deleted file mode 100644 index 60d3e5c..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/actions/commandable.js +++ /dev/null @@ -1,68 +0,0 @@ -var nopt = require('nopt'); - -// Commandable Mixin -// -// Provides API to route arbitrary routes or register command / sub commands / -// sub programs. -var commandable = module.exports; - -// XXX: tomdocify, generate in readme - -commandable.cmd = -commandable.command = function command(name, fn) { - this._commands[name] = fn; - var commandable = fn && fn.command && fn.route && fn.parse; - this.on(name, commandable ? function(args, opts, position) { - fn.parse(args, position); - } : fn); - return this; -}; - -commandable.route = function route(pattern, fn) { - pattern = pattern instanceof RegExp ? pattern : new RegExp('^' + pattern + '$'); - this._routes.push({ - pattern: pattern, - fn: fn - }); - return this; -}; - -commandable.routeCommand = function routeCommand(opts) { - opts = opts || this.nopt; - var args = opts.argv.remain; - var commands = Object.keys(this._commands); - - // firt try to find a route, then fallback to command - var route = this._routes.filter(function(route) { - return route.pattern.test(args.join(' ')); - }); - - if(route.length) return route[0].fn(); - - var first = 0 - var registered = args.filter(function(arg, i) { - var match = ~commands.indexOf(arg); - if(match) first = first || i; - return match; - }); - - if(!registered[0]) return this.run(); - - opts.argv.remain = args.slice(0, first); - registered.forEach(function(command) { - var position = opts.argv.original.indexOf(command) + 1; - var options = nopt({}, {}, opts.argv.original, position); - this.emit(command, options.argv.original, options, position); - }, this); -}; - - -commandable.registered = function(args) { - var commands = Object.keys(this._commands); - var registered = args.filter(function(arg, i) { - return ~commands.indexOf(arg); - }); - - return registered.length ? this._commands[registered] : false; -}; - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/index.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/index.js deleted file mode 100644 index 0469cf8..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/index.js +++ /dev/null @@ -1,253 +0,0 @@ - -var fs = require('fs'); -var path = require('path'); -var nopt = require('nopt'); -var util = require('./util'); -var events = require('events'); - -var collectable = require('./actions/collectable'); -var commandable = require('./actions/commandable'); - -module.exports = noptify; -noptify.Noptify = Noptify; - -// noptify is a little wrapper around `nopt` module adding a more expressive, -// commander-like, API and few helpers. -// -// Examples -// -// var program = noptify(process.argv, { program: 'name' }) -// .version('0.0.1') -// .option('port', '-p', 'Port to listen on (default: 35729)', Number) -// .option('pid', 'Path to the generated PID file', String) -// -// var opts = program.parse(); -// -// Returns an instance of `Noptify` -function noptify(args, options) { - return new Noptify(args, options); -} - -// Noptify provides the API to parse out option, shorthands and generate the -// proper generic help output. -// -// - args - The Array of arguments to parse (default: `process.argv`); -// - options - An hash of options with the following properties -// - program - The program name to use in usage output -// -// Every noptify instance is created with two options, `-h, --help` and `-v, -// --version`. -function Noptify(args, options) { - events.EventEmitter.call(this); - options = this.options = options || {}; - this.args = args || process.argv; - this._program = options.program || (path.basename(this.args[this.args[0] === 'node' ? 1 : 0])); - - this._shorthands = {}; - this._commands = {}; - this._routes = []; - this._steps = []; - this.nopt = {}; - - this.option('help', '-h', 'Show help usage'); - this.option('version', '-v', 'Show package version'); -} - -util.inherits(Noptify, events.EventEmitter); - -// Inherits from each actions' mixins -// -// XXX: consider making it optional? with a `.use()` method? -util.extend(Noptify.prototype, collectable); -util.extend(Noptify.prototype, commandable); - - -// Parse the provided options and shorthands, pass them through `nopt` and -// return the result. -// -// When `opts.help` is set, the help output is displayed and `help` -// event is emitted. The process exists with `0` status, the help output is -// automatically displayed and the `help` event is emitted. -// -// Examples -// -// var program = noptify(['foo', '--help']) -// .on('help', function() { -// console.log('Examples'); -// console.log(''); -// console.log(' foo bar --baz > foo.txt'); -// }); -// -// var opts = program.parse(); -// // ... Help output ... -// // ... Custom help output ... -// // ... Exit ... -// -// -Noptify.prototype.parse = function parse(argv, position) { - argv = argv || this.args; - var options = this._options.reduce(function(opts, opt) { - opts[opt.name] = opt.type; - return opts; - }, {}); - - this._options.forEach(function(opt) { - if(!opt.shorthand) return; - this.shorthand(opt.shorthand, '--' + opt.name); - }, this); - - var opts = nopt(options, this._shorthands, argv, position); - if(opts.version) { - console.log(this._version); - process.exit(0); - } - - var registered = this.registered(opts.argv.remain); - if(opts.help) { - if(registered && registered.help) { - registered.help().emit('help'); - } else { - this.help().emit('help'); - } - - process.exit(0); - } - - this.nopt = opts; - - // check remaining args and registered command, for each match, remove the - // argument from remaining args and trigger the handler, ideally the handler - // can be another subprogram, for now simple functions - - if(this.routeCommand) process.nextTick(this.routeCommand.bind(this)); - if(this.stdin && this._readFromStdin) process.nextTick(this.stdin.bind(this)); - return opts; -}; - -// Define the program version. -Noptify.prototype.version = function version(ver) { - this._version = ver; - return this; -}; - -// Define the program property. -Noptify.prototype.program = function program(value) { - this._program = value || ''; - return this; -}; - -// Define `name` option with optional shorthands, optional description and optional type. -Noptify.prototype.option = function option(name, shorthand, description, type) { - this._options = this._options || []; - if(!description) { - description = shorthand; - shorthand = ''; - } - - if(!type) { - if(typeof description === 'function') { - type = description; - description = shorthand; - shorthand = ''; - } else { - type = String; - } - } - - shorthand = shorthand.replace(/^-*/, ''), - - this._options.push({ - name: name, - shorthand: shorthand.replace(/^-*/, ''), - description: description || (name + ': ' + type.name), - usage: (shorthand ? '-' + shorthand + ', ': '' ) + '--' + name, - type: type - }); - - return this; -}; - -// Stores the given `shorthands` Hash of options to be `parse()`-d by nopt -// later on. - -Noptify.prototype.shorthand = -Noptify.prototype.shorthands = function shorthands(options, value) { - if(typeof options === 'string' && value) { - this._shorthands[options] = value; - return this; - } - - Object.keys(options).forEach(function(shorthand) { - this._shorthands[shorthand] = options[shorthand]; - }, this); - return this; -}; - -// Simply output to stdout the Usage and Help output. -Noptify.prototype.help = function help() { - var buf = ''; - buf += '\n Usage: ' + this._program + ' [options]'; - buf += '\n'; - buf += '\n Options:\n'; - - var maxln = Math.max.apply(Math, this._options.map(function(opts) { - return opts.usage.length; - })); - - var options = this._options.map(function(opts) { - return ' ' + pad(opts.usage, maxln + 5) + '\t- ' + opts.description; - }); - - buf += options.join('\n'); - - // part of help input ? --list-shorthands ? - var shorthands = Object.keys(this._shorthands); - if(shorthands.length) { - buf += '\n\n Shorthands:\n'; - maxln = Math.max.apply(Math, Object.keys(this._shorthands).map(function(key) { - return key.length; - })); - buf += Object.keys(this._shorthands).map(function(shorthand) { - return ' --' + pad(shorthand, maxln + 1) + '\t\t' + this._shorthands[shorthand]; - }, this).join('\n'); - } - - buf += '\n'; - - console.log(buf); - return this; -}; - -// Helpers - -// command API - -Noptify.prototype.run = function run(fn) { - if(fn) { - this._steps.push(fn); - return this; - } - - if(!this.nopt.argv) return this.parse(); - - var steps = this._steps; - var self = this; - (function next(step) { - if(!step) return; - var async = /function\s*\(\w+/.test(step + ''); - if(!async) { - step(); - return next(steps.shift()); - } - - step(function(err) { - if(err) return self.emit('error', err); - next(steps.shift()); - }); - })(steps.shift()); -}; - -function pad(str, max) { - var ln = max - str.length; - return ln > 0 ? str + new Array(ln).join(' ') : str; -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/.bin/nopt b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/.bin/nopt deleted file mode 120000 index 6b6566e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/.npmignore b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/LICENSE b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/README.md b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/README.md deleted file mode 100644 index f290da8..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/README.md +++ /dev/null @@ -1,210 +0,0 @@ -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. When types are ordered, this implies a -preference, and the first type that can be used to properly interpret -the value will be used. - -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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/bin/nopt.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/bin/nopt.js deleted file mode 100755 index df90c72..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/bin/nopt.js +++ /dev/null @@ -1,44 +0,0 @@ -#!/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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/examples/my-program.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/examples/my-program.js deleted file mode 100755 index 142447e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/examples/my-program.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/lib/nopt.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/lib/nopt.js deleted file mode 100644 index 5763860..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/lib/nopt.js +++ /dev/null @@ -1,555 +0,0 @@ -// 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} - Object.defineProperty(data.argv, 'toString', { value: function () { - return this.original.map(JSON.stringify).join(" ") - }, enumerable: false }) - 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 - } - var hadEq = false - if (arg.charAt(0) === "-") { - if (arg.indexOf("=") !== -1) { - hadEq = true - 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 = null - 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 = typeof no === 'boolean' || - types[arg] === Boolean || - Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || - (typeof types[arg] === 'undefined' && !hadEq) || - (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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/LICENSE b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/README.md b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/lib/abbrev.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/lib/abbrev.js deleted file mode 100644 index bee4132..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/lib/abbrev.js +++ /dev/null @@ -1,111 +0,0 @@ - -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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/package.json deleted file mode 100644 index 55ed011..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/node_modules/abbrev/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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" - }, - "_id": "abbrev@1.0.4", - "_from": "abbrev@1" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/package.json deleted file mode 100644 index d4bf475..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/node_modules/nopt/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "nopt", - "version": "2.0.0", - "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. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\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" - }, - "_id": "nopt@2.0.0", - "_from": "nopt@~2.0.0" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/package.json deleted file mode 100644 index 93e3b7a..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "mklabs" - }, - "name": "noptify", - "description": "nopt wrapper with commander-like API", - "version": "0.0.3", - "repository": { - "type": "git", - "url": "git://github.com/mklabs/noptify.git" - }, - "dependencies": { - "nopt": "~2.0.0" - }, - "devDependencies": { - "mocha": "~1.8.1" - }, - "scripts": { - "test": "mocha --reporter spec" - }, - "readme": "### noptify\n\nnoptify is a little wrapper around `nopt` module adding a more expressive,\ncommander-like, API and few helpers.\n\nExamples\n\n var program = noptify(process.argv, { program: 'name' })\n .version('0.0.1')\n .option('port', '-p', 'Port to listen on (default: 35729)', Number)\n .option('pid', 'Path to the generated PID file', String)\n\n var opts = program.parse();\n\nReturns an instance of `Noptify`\n\n### Noptify\n\nNoptify provides the API to parse out option, shorthands and generate the\nproper generic help output.\n\n- args - The Array of arguments to parse (default: `process.argv`);\n- options - An hash of options with the following properties\n - program - The program name to use in usage output\n\nEvery noptify instance is created with two options, `-h, --help` and `-v,\n--version`.\n\n### Noptify#parse\n\nParse the provided options and shorthands, pass them through `nopt` and\nreturn the result.\n\nWhen `opts.help` is set, the help output is displayed and `help`\nevent is emitted. The process exists with `0` status, the help output is\nautomatically displayed and the `help` event is emitted.\n\nExamples\n\n var program = noptify(['foo', '--help'])\n .on('help', function() {\n console.log('Examples');\n console.log('');\n console.log(' foo bar --baz > foo.txt');\n });\n\n var opts = program.parse();\n // ... Help output ...\n // ... Custom help output ...\n // ... Exit ...\n\n\n\n### Noptify#version\n\nDefine the program version.\n\n### Noptify#option\n\nDefine `name` option with optional shorthands, optional description and optional type.\n\n### Noptify#help\n\nSimply output to stdout the Usage and Help output.\n\n---\n\n*Mocha generated documentation*\n\n- [API](#api)\n- [Collectable](#collectable)\n- [Commandable](#commandable)\n - [Parses remaining arguments and route to the appropriate command](#commandable-parses-remaining-arguments-and-route-to-the-appropriate-command)\n\n\n\n\n## API\nreturns an instanceof Noptify.\n\n```js\nassert.ok(noptify() instanceof noptify.Noptify);\n```\n\nis typically used like so.\n\n```js\nvar program = noptify(['node', 'file.js', '-d', '--dirname', './', '-p', '3000', 'app.js', 'base.js'])\n .option('debug', '-d', 'Enabled debug output', Boolean)\n .option('dirname', 'The path to the output directory')\n .option('port', '-p', 'The port you wish to listen on', Number)\n\n// opts => nopt result\nvar opts = program.parse();\n\nassert.deepEqual(opts, {\n port: 3000,\n debug: true,\n dirname: './',\n argv: {\n remain: ['app.js', 'base.js'],\n cooked: ['--debug', '--dirname', './', '--port', '3000', 'app.js', 'base.js'],\n original: ['-d', '--dirname', './', '-p', '3000', 'app.js', 'base.js']\n }\n});\n```\n\nallows definitiion of shorthands separately.\n\n```js\nvar opts = noptify(['node', 'file.js', '-lc'])\n .option('line-comment', 'Ouputs with debugging information', Boolean)\n .shorthand('lc', '--line-comment')\n .parse();\n\nassert.equal(opts['line-comment'], true);\n```\n\n\n## Collectable\nprovides the helper method to read from stdin.\n\n```js\nvar program = noptify();\nassert.ok(typeof program.stdin === 'function', 'stdin defined');\n```\n\nis invoked only when .parse() is called.\n\n```js\nvar program = noptify(['', '']);\nvar str = 'testing out stdin helper';\nprogram.stdin(function(err, res) {\n assert.equal(res, str);\n done();\n});\n\nprogram.parse();\n\nprocess.nextTick(function() {\n process.stdin.emit('data', str);\n process.stdin.emit('end');\n});\n```\n\n\n## Commandable\nprovides the .command() utility.\n\n```js\nassert.ok(typeof noptify().command === 'function');\n```\n\n\n## Parses remaining arguments and route to the appropriate command\ncan be a simple function.\n\n```js\nvar program = noptify(['', '', 'init', '--debug', 'foo']).option('debug', 'an option');\n\nprogram.command('init', function(args, opts) {\n // args ==> sliced args at command position\n // opts ==> nopt parsed object\n assert.deepEqual(args, ['--debug', 'foo']);\n assert.equal(opts.debug, true);\n assert.equal(opts.argv.remain[0], 'foo');\n done();\n});\n\nprogram.parse();\n```\n\nor another program, an Noptify instance.\n\n```js\nvar args = ['', '', 'init', '--debug', 'myapp', 'foo'];\n\nvar init = noptify(args)\n .option('debug', 'Debug output')\n .command('myapp', done.bind(null, null));\n\nnoptify(args).command('init', init).parse();\n```\n\n", - "readmeFilename": "readme.md", - "bugs": { - "url": "https://github.com/mklabs/noptify/issues" - }, - "_id": "noptify@0.0.3", - "_from": "noptify@latest" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/readme.md b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/readme.md deleted file mode 100644 index 6e41adb..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/readme.md +++ /dev/null @@ -1,184 +0,0 @@ -### noptify - -noptify is a little wrapper around `nopt` module adding a more expressive, -commander-like, API and few helpers. - -Examples - - var program = noptify(process.argv, { program: 'name' }) - .version('0.0.1') - .option('port', '-p', 'Port to listen on (default: 35729)', Number) - .option('pid', 'Path to the generated PID file', String) - - var opts = program.parse(); - -Returns an instance of `Noptify` - -### Noptify - -Noptify provides the API to parse out option, shorthands and generate the -proper generic help output. - -- args - The Array of arguments to parse (default: `process.argv`); -- options - An hash of options with the following properties - - program - The program name to use in usage output - -Every noptify instance is created with two options, `-h, --help` and `-v, ---version`. - -### Noptify#parse - -Parse the provided options and shorthands, pass them through `nopt` and -return the result. - -When `opts.help` is set, the help output is displayed and `help` -event is emitted. The process exists with `0` status, the help output is -automatically displayed and the `help` event is emitted. - -Examples - - var program = noptify(['foo', '--help']) - .on('help', function() { - console.log('Examples'); - console.log(''); - console.log(' foo bar --baz > foo.txt'); - }); - - var opts = program.parse(); - // ... Help output ... - // ... Custom help output ... - // ... Exit ... - - - -### Noptify#version - -Define the program version. - -### Noptify#option - -Define `name` option with optional shorthands, optional description and optional type. - -### Noptify#help - -Simply output to stdout the Usage and Help output. - ---- - -*Mocha generated documentation* - -- [API](#api) -- [Collectable](#collectable) -- [Commandable](#commandable) - - [Parses remaining arguments and route to the appropriate command](#commandable-parses-remaining-arguments-and-route-to-the-appropriate-command) - - - - -## API -returns an instanceof Noptify. - -```js -assert.ok(noptify() instanceof noptify.Noptify); -``` - -is typically used like so. - -```js -var program = noptify(['node', 'file.js', '-d', '--dirname', './', '-p', '3000', 'app.js', 'base.js']) - .option('debug', '-d', 'Enabled debug output', Boolean) - .option('dirname', 'The path to the output directory') - .option('port', '-p', 'The port you wish to listen on', Number) - -// opts => nopt result -var opts = program.parse(); - -assert.deepEqual(opts, { - port: 3000, - debug: true, - dirname: './', - argv: { - remain: ['app.js', 'base.js'], - cooked: ['--debug', '--dirname', './', '--port', '3000', 'app.js', 'base.js'], - original: ['-d', '--dirname', './', '-p', '3000', 'app.js', 'base.js'] - } -}); -``` - -allows definitiion of shorthands separately. - -```js -var opts = noptify(['node', 'file.js', '-lc']) - .option('line-comment', 'Ouputs with debugging information', Boolean) - .shorthand('lc', '--line-comment') - .parse(); - -assert.equal(opts['line-comment'], true); -``` - - -## Collectable -provides the helper method to read from stdin. - -```js -var program = noptify(); -assert.ok(typeof program.stdin === 'function', 'stdin defined'); -``` - -is invoked only when .parse() is called. - -```js -var program = noptify(['', '']); -var str = 'testing out stdin helper'; -program.stdin(function(err, res) { - assert.equal(res, str); - done(); -}); - -program.parse(); - -process.nextTick(function() { - process.stdin.emit('data', str); - process.stdin.emit('end'); -}); -``` - - -## Commandable -provides the .command() utility. - -```js -assert.ok(typeof noptify().command === 'function'); -``` - - -## Parses remaining arguments and route to the appropriate command -can be a simple function. - -```js -var program = noptify(['', '', 'init', '--debug', 'foo']).option('debug', 'an option'); - -program.command('init', function(args, opts) { - // args ==> sliced args at command position - // opts ==> nopt parsed object - assert.deepEqual(args, ['--debug', 'foo']); - assert.equal(opts.debug, true); - assert.equal(opts.argv.remain[0], 'foo'); - done(); -}); - -program.parse(); -``` - -or another program, an Noptify instance. - -```js -var args = ['', '', 'init', '--debug', 'myapp', 'foo']; - -var init = noptify(args) - .option('debug', 'Debug output') - .command('myapp', done.bind(null, null)); - -noptify(args).command('init', init).parse(); -``` - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/api.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/api.js deleted file mode 100644 index e022850..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/api.js +++ /dev/null @@ -1,53 +0,0 @@ -var noptify = require('..'); -var assert = require('assert'); - -describe('API', function() { - - it('returns an instanceof Noptify', function() { - assert.ok(noptify() instanceof noptify.Noptify); - }); - - - it('is typically used like so', function() { - var program = noptify(['node', 'file.js', '-d', '--dirname', './', '-p', '3000', 'app.js', 'base.js']) - .option('debug', '-d', 'Enabled debug output', Boolean) - .option('dirname', 'The path to the output directory') - .option('port', '-p', 'The port you wish to listen on', Number) - - // opts => nopt result - var opts = program.parse(); - - assert.deepEqual(opts, { - port: 3000, - debug: true, - dirname: './', - argv: { - remain: ['app.js', 'base.js'], - cooked: ['--debug', '--dirname', './', '--port', '3000', 'app.js', 'base.js'], - original: ['-d', '--dirname', './', '-p', '3000', 'app.js', 'base.js'] - } - }); - }); - - it('allows definitiion of shorthands separately', function() { - var opts = noptify(['node', 'file.js', '-lc']) - .option('line-comment', 'Ouputs with debugging information', Boolean) - .shorthand('lc', '--line-comment') - .parse(); - - assert.equal(opts['line-comment'], true); - }); - - // hmm, keep this one for the very last, or do another way, process exit - // prevent other tests from running - it.skip('outputs help and exit the process with --help', function() { - var program = noptify(['', '', '--help']) - assert.throws(function() { - throw new Error('parse() must be called for this to happen'); - }); - - program.parse(); - throw new Error('I\'m sad, I\'ll never throw :('); - }); - -}); diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/collectable.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/collectable.js deleted file mode 100644 index 02d578a..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/collectable.js +++ /dev/null @@ -1,40 +0,0 @@ -var noptify = require('..'); -var assert = require('assert'); - - -describe('Collectable', function() { - - it('provides the helper method to read from stdin', function() { - var program = noptify(); - assert.ok(typeof program.stdin === 'function', 'stdin defined'); - }); - - it('is invoked only when .parse() is called', function(done) { - var program = noptify(['', '']); - var str = 'testing out stdin helper'; - program.stdin(function(err, res) { - assert.equal(res, str); - done(); - }); - - program.parse(); - - process.nextTick(function() { - process.stdin.emit('data', str); - process.stdin.emit('end'); - }); - }); - - - it('.files()', function(done) { - var program = noptify(['', '', 'test/fixtures/a.js', 'test/fixtures/b.js']); - program.parse(); - - program.files(function(err, data) { - assert.equal(data, 'a\nb\n'); - done(); - }); - - }); - -}); diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/commandable.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/commandable.js deleted file mode 100644 index 39610f7..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/commandable.js +++ /dev/null @@ -1,40 +0,0 @@ -var noptify = require('..'); -var assert = require('assert'); - -describe('Commandable', function() { - - it('provides the .command() utility', function() { - assert.ok(typeof noptify().command === 'function'); - }); - - - describe('Parses remaining arguments and route to the appropriate command', function() { - - it('can be a simple function', function(done) { - var program = noptify(['', '', 'init', '--debug', 'foo']).option('debug', 'an option'); - - program.command('init', function(args, opts) { - // args ==> sliced args at command position - // opts ==> nopt parsed object - assert.deepEqual(args, ['--debug', 'foo']); - assert.equal(opts.debug, true); - assert.equal(opts.argv.remain[0], 'foo'); - done(); - }); - - program.parse(); - }); - - it('or another program, an Noptify instance', function(done) { - var args = ['', '', 'init', '--debug', 'myapp', 'foo']; - - var init = noptify(args) - .option('debug', 'Debug output') - .command('myapp', done.bind(null, null)); - - noptify(args).command('init', init).parse(); - }); - }); - - -}); diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/fixtures/a.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/fixtures/a.js deleted file mode 100644 index 7898192..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/fixtures/a.js +++ /dev/null @@ -1 +0,0 @@ -a diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/fixtures/b.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/fixtures/b.js deleted file mode 100644 index 6178079..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/test/fixtures/b.js +++ /dev/null @@ -1 +0,0 @@ -b diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/util/extend.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/util/extend.js deleted file mode 100644 index d7e717c..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/util/extend.js +++ /dev/null @@ -1,15 +0,0 @@ - - -// Simple extend utility method - -module.exports = function extend(obj) { - var args = Array.prototype.slice.call(arguments, 1); - - args.forEach(function(o) { - Object.keys(o).forEach(function(prop) { - obj[prop] = o[prop]; - }); - }); - - return obj; -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/util/index.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/util/index.js deleted file mode 100644 index 115ead5..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/noptify/util/index.js +++ /dev/null @@ -1,6 +0,0 @@ - -// Common interface to utility methods, exposing the standard `util` core module -var util = module.exports = require('util'); - -// and augmenting it -util.extend = require('./extend'); diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.gitmodules b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.npmignore b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.travis.yml b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.travis.yml deleted file mode 100644 index 2c0a8f6..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.4 \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/History.md b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/History.md deleted file mode 100644 index c9a0e3c..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/History.md +++ /dev/null @@ -1,109 +0,0 @@ - -0.5.6 / 2013-04-09 -================== - - * fix empty key productions in parser - -0.5.5 / 2013-03-20 -================== - - * output key= for null or undefined values. Closes #52 - -0.5.4 / 2013-03-15 -================== - - * fix ignoring of null / undefined. Closes #44 - -0.5.3 2012-12-09 -================== - - * add info to component.json - * remove regular client-side ./querystring.js, fix component.json support - -0.5.2 / 2012-11-14 -================== - - * fix uri encoding of non-plain object string values - -0.5.1 / 2012-09-18 -================== - - * fix encoded `=`. Closes #43 - -0.5.0 / 2012-05-04 -================== - - * Added component support - -0.4.2 / 2012-02-08 -================== - - * Fixed: ensure objects are created when appropriate not arrays [aheckmann] - -0.4.1 / 2012-01-26 -================== - - * Fixed stringify()ing numbers. Closes #23 - -0.4.0 / 2011-11-21 -================== - - * Allow parsing of an existing object (for `bodyParser()`) [jackyz] - * Replaced expresso with mocha - -0.3.2 / 2011-11-08 -================== - - * Fixed global variable leak - -0.3.1 / 2011-08-17 -================== - - * Added `try/catch` around malformed uri components - * Add test coverage for Array native method bleed-though - -0.3.0 / 2011-07-19 -================== - - * Allow `array[index]` and `object[property]` syntaxes [Aria Stewart] - -0.2.0 / 2011-06-29 -================== - - * Added `qs.stringify()` [Cory Forsyth] - -0.1.0 / 2011-04-13 -================== - - * Added jQuery-ish array support - -0.0.7 / 2011-03-13 -================== - - * Fixed; handle empty string and `== null` in `qs.parse()` [dmit] - allows for convenient `qs.parse(url.parse(str).query)` - -0.0.6 / 2011-02-14 -================== - - * Fixed; support for implicit arrays - -0.0.4 / 2011-02-09 -================== - - * Fixed `+` as a space - -0.0.3 / 2011-02-08 -================== - - * Fixed case when right-hand value contains "]" - -0.0.2 / 2011-02-07 -================== - - * Fixed "=" presence in key - -0.0.1 / 2011-02-07 -================== - - * Initial release diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/Makefile b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/Makefile deleted file mode 100644 index 84a78ec..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --ui bdd - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/Readme.md b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/Readme.md deleted file mode 100644 index 27e54a4..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/Readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# 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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/benchmark.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/benchmark.js deleted file mode 100644 index 97e2c93..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/benchmark.js +++ /dev/null @@ -1,17 +0,0 @@ - -var qs = require('./'); - -var times = 100000 - , start = new Date - , n = times; - -console.log('times: %d', times); - -while (n--) qs.parse('foo=bar'); -console.log('simple: %dms', new Date - start); - -var start = new Date - , n = times; - -while (n--) qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); -console.log('nested: %dms', new Date - start); \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/component.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/component.json deleted file mode 100644 index 0a46c2d..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/component.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "querystring", - "repo": "visionmedia/node-querystring", - "description": "query-string parser / stringifier with nesting support", - "version": "0.5.6", - "keywords": ["querystring", "query", "parser"], - "scripts": ["index.js"], - "license": "MIT" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/examples.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/examples.js deleted file mode 100644 index ebe3a97..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/examples.js +++ /dev/null @@ -1,51 +0,0 @@ - -/** - * Module dependencies. - */ - -var qs = require('./'); - -var obj = qs.parse('foo'); -console.log(obj) - -var obj = qs.parse('foo=bar=baz'); -console.log(obj) - -var obj = qs.parse('users[]'); -console.log(obj) - -var obj = qs.parse('name=tj&email=tj@vision-media.ca'); -console.log(obj) - -var obj = qs.parse('users[]=tj&users[]=tobi&users[]=jane'); -console.log(obj) - -var obj = qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); -console.log(obj) - -var obj = qs.parse('users[][name][first]=tj&users[][name][last]=holowaychuk'); -console.log(obj) - -var obj = qs.parse('a=a&a=b&a=c'); -console.log(obj) - -var obj = qs.parse('user[tj]=tj&user[tj]=TJ'); -console.log(obj) - -var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler'); -console.log(obj) - -var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[1]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[foo]=TJ'); -console.log(obj) - -var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}); -console.log(str); diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/index.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/index.js deleted file mode 100644 index 8b27b23..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/index.js +++ /dev/null @@ -1,268 +0,0 @@ - -/** - * Object#toString() ref for stringify(). - */ - -var toString = Object.prototype.toString; - -/** - * 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]) t[i] = parent[key][i]; - parent[key] = t; - return t; -} - -function parse(parts, parent, key, val) { - var part = parts.shift(); - // end - if (!part) { - if (Array.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 (Array.isArray(obj)) { - if ('' != val) obj.push(val); - } else if ('object' == typeof obj) { - obj[Object.keys(obj).length] = val; - } else { - obj = parent[key] = [parent[key], val]; - } - // prop - } else if (~part.indexOf(']')) { - part = part.substr(0, part.length - 1); - if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - // key - } else { - if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - } - } -} - -/** - * Merge parent key/val pair. - */ - -function merge(parent, key, val){ - if (~key.indexOf(']')) { - var parts = key.split('[') - , len = parts.length - , last = len - 1; - parse(parts, parent, 'base', val); - // optimize - } else { - if (!isint.test(key) && Array.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; -} - -/** - * Parse the given obj. - */ - -function parseObject(obj){ - var ret = { base: {} }; - Object.keys(obj).forEach(function(name){ - merge(ret, name, obj[name]); - }); - return ret.base; -} - -/** - * Parse the given str. - */ - -function parseString(str){ - return String(str) - .split('&') - .reduce(function(ret, pair){ - var eql = pair.indexOf('=') - , brace = lastBraceInKey(pair) - , key = pair.substr(0, brace || eql) - , val = pair.substr(brace || eql, pair.length) - , val = val.substr(val.indexOf('=') + 1, val.length); - - // ?foo - if ('' == key) key = pair, val = ''; - if ('' == key) return ret; - - return merge(ret, decode(key), decode(val)); - }, { base: {} }).base; -} - -/** - * 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 (Array.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 = Object.keys(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 (undefined === v) { - obj[key] = val; - } else if (Array.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/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/package.json b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/package.json deleted file mode 100644 index 8a44d6f..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.5.6", - "keywords": [ - "query string", - "parser", - "component" - ], - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-querystring.git" - }, - "devDependencies": { - "mocha": "*", - "expect.js": "*" - }, - "component": { - "scripts": { - "querystring": "querystring.js" - } - }, - "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" - }, - "_id": "qs@0.5.6", - "_from": "qs@~0.5.2" -} diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/expect.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/expect.js deleted file mode 100644 index 76aa4e8..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/expect.js +++ /dev/null @@ -1,1202 +0,0 @@ - -(function (global, module) { - - if ('undefined' == typeof module) { - var module = { exports: {} } - , exports = module.exports - } - - /** - * Exports. - */ - - module.exports = expect; - expect.Assertion = Assertion; - - /** - * Exports version. - */ - - expect.version = '0.1.2'; - - /** - * Possible assertion flags. - */ - - var flags = { - not: ['to', 'be', 'have', 'include', 'only'] - , to: ['be', 'have', 'include', 'only', 'not'] - , only: ['have'] - , have: ['own'] - , be: ['an'] - }; - - function expect (obj) { - return new Assertion(obj); - } - - /** - * Constructor - * - * @api private - */ - - function Assertion (obj, flag, parent) { - this.obj = obj; - this.flags = {}; - - if (undefined != parent) { - this.flags[flag] = true; - - for (var i in parent.flags) { - if (parent.flags.hasOwnProperty(i)) { - this.flags[i] = true; - } - } - } - - var $flags = flag ? flags[flag] : keys(flags) - , self = this - - if ($flags) { - for (var i = 0, l = $flags.length; i < l; i++) { - // avoid recursion - if (this.flags[$flags[i]]) continue; - - var name = $flags[i] - , assertion = new Assertion(this.obj, name, this) - - if ('function' == typeof Assertion.prototype[name]) { - // clone the function, make sure we dont touch the prot reference - var old = this[name]; - this[name] = function () { - return old.apply(self, arguments); - } - - for (var fn in Assertion.prototype) { - if (Assertion.prototype.hasOwnProperty(fn) && fn != name) { - this[name][fn] = bind(assertion[fn], assertion); - } - } - } else { - this[name] = assertion; - } - } - } - }; - - /** - * Performs an assertion - * - * @api private - */ - - Assertion.prototype.assert = function (truth, msg, error) { - var msg = this.flags.not ? error : msg - , ok = this.flags.not ? !truth : truth; - - if (!ok) { - throw new Error(msg); - } - - this.and = new Assertion(this.obj); - }; - - /** - * Check if the value is truthy - * - * @api public - */ - - Assertion.prototype.ok = function () { - this.assert( - !!this.obj - , 'expected ' + i(this.obj) + ' to be truthy' - , 'expected ' + i(this.obj) + ' to be falsy'); - }; - - /** - * Assert that the function throws. - * - * @param {Function|RegExp} callback, or regexp to match error string against - * @api public - */ - - Assertion.prototype.throwError = - Assertion.prototype.throwException = function (fn) { - expect(this.obj).to.be.a('function'); - - var thrown = false - , not = this.flags.not - - try { - this.obj(); - } catch (e) { - if ('function' == typeof fn) { - fn(e); - } else if ('object' == typeof fn) { - var subject = 'string' == typeof e ? e : e.message; - if (not) { - expect(subject).to.not.match(fn); - } else { - expect(subject).to.match(fn); - } - } - thrown = true; - } - - if ('object' == typeof fn && not) { - // in the presence of a matcher, ensure the `not` only applies to - // the matching. - this.flags.not = false; - } - - var name = this.obj.name || 'fn'; - this.assert( - thrown - , 'expected ' + name + ' to throw an exception' - , 'expected ' + name + ' not to throw an exception'); - }; - - /** - * Checks if the array is empty. - * - * @api public - */ - - Assertion.prototype.empty = function () { - var expectation; - - if ('object' == typeof this.obj && null !== this.obj && !isArray(this.obj)) { - if ('number' == typeof this.obj.length) { - expectation = !this.obj.length; - } else { - expectation = !keys(this.obj).length; - } - } else { - if ('string' != typeof this.obj) { - expect(this.obj).to.be.an('object'); - } - - expect(this.obj).to.have.property('length'); - expectation = !this.obj.length; - } - - this.assert( - expectation - , 'expected ' + i(this.obj) + ' to be empty' - , 'expected ' + i(this.obj) + ' to not be empty'); - return this; - }; - - /** - * Checks if the obj exactly equals another. - * - * @api public - */ - - Assertion.prototype.be = - Assertion.prototype.equal = function (obj) { - this.assert( - obj === this.obj - , 'expected ' + i(this.obj) + ' to equal ' + i(obj) - , 'expected ' + i(this.obj) + ' to not equal ' + i(obj)); - return this; - }; - - /** - * Checks if the obj sortof equals another. - * - * @api public - */ - - Assertion.prototype.eql = function (obj) { - this.assert( - expect.eql(obj, this.obj) - , 'expected ' + i(this.obj) + ' to sort of equal ' + i(obj) - , 'expected ' + i(this.obj) + ' to sort of not equal ' + i(obj)); - return this; - }; - - /** - * Assert within start to finish (inclusive). - * - * @param {Number} start - * @param {Number} finish - * @api public - */ - - Assertion.prototype.within = function (start, finish) { - var range = start + '..' + finish; - this.assert( - this.obj >= start && this.obj <= finish - , 'expected ' + i(this.obj) + ' to be within ' + range - , 'expected ' + i(this.obj) + ' to not be within ' + range); - return this; - }; - - /** - * Assert typeof / instance of - * - * @api public - */ - - Assertion.prototype.a = - Assertion.prototype.an = function (type) { - if ('string' == typeof type) { - // proper english in error msg - var n = /^[aeiou]/.test(type) ? 'n' : ''; - - // typeof with support for 'array' - this.assert( - 'array' == type ? isArray(this.obj) : - 'object' == type - ? 'object' == typeof this.obj && null !== this.obj - : type == typeof this.obj - , 'expected ' + i(this.obj) + ' to be a' + n + ' ' + type - , 'expected ' + i(this.obj) + ' not to be a' + n + ' ' + type); - } else { - // instanceof - var name = type.name || 'supplied constructor'; - this.assert( - this.obj instanceof type - , 'expected ' + i(this.obj) + ' to be an instance of ' + name - , 'expected ' + i(this.obj) + ' not to be an instance of ' + name); - } - - return this; - }; - - /** - * Assert numeric value above _n_. - * - * @param {Number} n - * @api public - */ - - Assertion.prototype.greaterThan = - Assertion.prototype.above = function (n) { - this.assert( - this.obj > n - , 'expected ' + i(this.obj) + ' to be above ' + n - , 'expected ' + i(this.obj) + ' to be below ' + n); - return this; - }; - - /** - * Assert numeric value below _n_. - * - * @param {Number} n - * @api public - */ - - Assertion.prototype.lessThan = - Assertion.prototype.below = function (n) { - this.assert( - this.obj < n - , 'expected ' + i(this.obj) + ' to be below ' + n - , 'expected ' + i(this.obj) + ' to be above ' + n); - return this; - }; - - /** - * Assert string value matches _regexp_. - * - * @param {RegExp} regexp - * @api public - */ - - Assertion.prototype.match = function (regexp) { - this.assert( - regexp.exec(this.obj) - , 'expected ' + i(this.obj) + ' to match ' + regexp - , 'expected ' + i(this.obj) + ' not to match ' + regexp); - return this; - }; - - /** - * Assert property "length" exists and has value of _n_. - * - * @param {Number} n - * @api public - */ - - Assertion.prototype.length = function (n) { - expect(this.obj).to.have.property('length'); - var len = this.obj.length; - this.assert( - n == len - , 'expected ' + i(this.obj) + ' to have a length of ' + n + ' but got ' + len - , 'expected ' + i(this.obj) + ' to not have a length of ' + len); - return this; - }; - - /** - * Assert property _name_ exists, with optional _val_. - * - * @param {String} name - * @param {Mixed} val - * @api public - */ - - Assertion.prototype.property = function (name, val) { - if (this.flags.own) { - this.assert( - Object.prototype.hasOwnProperty.call(this.obj, name) - , 'expected ' + i(this.obj) + ' to have own property ' + i(name) - , 'expected ' + i(this.obj) + ' to not have own property ' + i(name)); - return this; - } - - if (this.flags.not && undefined !== val) { - if (undefined === this.obj[name]) { - throw new Error(i(this.obj) + ' has no property ' + i(name)); - } - } else { - var hasProp; - try { - hasProp = name in this.obj - } catch (e) { - hasProp = undefined !== this.obj[name] - } - - this.assert( - hasProp - , 'expected ' + i(this.obj) + ' to have a property ' + i(name) - , 'expected ' + i(this.obj) + ' to not have a property ' + i(name)); - } - - if (undefined !== val) { - this.assert( - val === this.obj[name] - , 'expected ' + i(this.obj) + ' to have a property ' + i(name) - + ' of ' + i(val) + ', but got ' + i(this.obj[name]) - , 'expected ' + i(this.obj) + ' to not have a property ' + i(name) - + ' of ' + i(val)); - } - - this.obj = this.obj[name]; - return this; - }; - - /** - * Assert that the array contains _obj_ or string contains _obj_. - * - * @param {Mixed} obj|string - * @api public - */ - - Assertion.prototype.string = - Assertion.prototype.contain = function (obj) { - if ('string' == typeof this.obj) { - this.assert( - ~this.obj.indexOf(obj) - , 'expected ' + i(this.obj) + ' to contain ' + i(obj) - , 'expected ' + i(this.obj) + ' to not contain ' + i(obj)); - } else { - this.assert( - ~indexOf(this.obj, obj) - , 'expected ' + i(this.obj) + ' to contain ' + i(obj) - , 'expected ' + i(this.obj) + ' to not contain ' + i(obj)); - } - return this; - }; - - /** - * Assert exact keys or inclusion of keys by using - * the `.own` modifier. - * - * @param {Array|String ...} keys - * @api public - */ - - Assertion.prototype.key = - Assertion.prototype.keys = function ($keys) { - var str - , ok = true; - - $keys = isArray($keys) - ? $keys - : Array.prototype.slice.call(arguments); - - if (!$keys.length) throw new Error('keys required'); - - var actual = keys(this.obj) - , len = $keys.length; - - // Inclusion - ok = every($keys, function (key) { - return ~indexOf(actual, key); - }); - - // Strict - if (!this.flags.not && this.flags.only) { - ok = ok && $keys.length == actual.length; - } - - // Key string - if (len > 1) { - $keys = map($keys, function (key) { - return i(key); - }); - var last = $keys.pop(); - str = $keys.join(', ') + ', and ' + last; - } else { - str = i($keys[0]); - } - - // Form - str = (len > 1 ? 'keys ' : 'key ') + str; - - // Have / include - str = (!this.flags.only ? 'include ' : 'only have ') + str; - - // Assertion - this.assert( - ok - , 'expected ' + i(this.obj) + ' to ' + str - , 'expected ' + i(this.obj) + ' to not ' + str); - - return this; - }; - - /** - * Function bind implementation. - */ - - function bind (fn, scope) { - return function () { - return fn.apply(scope, arguments); - } - } - - /** - * Array every compatibility - * - * @see bit.ly/5Fq1N2 - * @api public - */ - - function every (arr, fn, thisObj) { - var scope = thisObj || global; - for (var i = 0, j = arr.length; i < j; ++i) { - if (!fn.call(scope, arr[i], i, arr)) { - return false; - } - } - return true; - }; - - /** - * Array indexOf compatibility. - * - * @see bit.ly/a5Dxa2 - * @api public - */ - - function indexOf (arr, o, i) { - if (Array.prototype.indexOf) { - return Array.prototype.indexOf.call(arr, o, i); - } - - if (arr.length === undefined) { - return -1; - } - - for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0 - ; i < j && arr[i] !== o; i++); - - return j <= i ? -1 : i; - }; - - /** - * Inspects an object. - * - * @see taken from node.js `util` module (copyright Joyent, MIT license) - * @api private - */ - - function i (obj, showHidden, depth) { - var seen = []; - - function stylize (str) { - return str; - }; - - function format (value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (value && typeof value.inspect === 'function' && - // Filter out the util module, it's inspect function is special - value !== exports && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - return value.inspect(recurseTimes); - } - - // Primitive types cannot have properties - switch (typeof value) { - case 'undefined': - return stylize('undefined', 'undefined'); - - case 'string': - var simple = '\'' + json.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return stylize(simple, 'string'); - - case 'number': - return stylize('' + value, 'number'); - - case 'boolean': - return stylize('' + value, 'boolean'); - } - // For some reason typeof null is "object", so special case here. - if (value === null) { - return stylize('null', 'null'); - } - - // Look up the keys of the object. - var visible_keys = keys(value); - var $keys = showHidden ? Object.getOwnPropertyNames(value) : visible_keys; - - // Functions without properties can be shortcutted. - if (typeof value === 'function' && $keys.length === 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - var name = value.name ? ': ' + value.name : ''; - return stylize('[Function' + name + ']', 'special'); - } - } - - // Dates without properties can be shortcutted - if (isDate(value) && $keys.length === 0) { - return stylize(value.toUTCString(), 'date'); - } - - var base, type, braces; - // Determine the object type - if (isArray(value)) { - type = 'Array'; - braces = ['[', ']']; - } else { - type = 'Object'; - braces = ['{', '}']; - } - - // Make functions say that they are functions - if (typeof value === 'function') { - var n = value.name ? ': ' + value.name : ''; - base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']'; - } else { - base = ''; - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + value.toUTCString(); - } - - if ($keys.length === 0) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - return stylize('[Object]', 'special'); - } - } - - seen.push(value); - - var output = map($keys, function (key) { - var name, str; - if (value.__lookupGetter__) { - if (value.__lookupGetter__(key)) { - if (value.__lookupSetter__(key)) { - str = stylize('[Getter/Setter]', 'special'); - } else { - str = stylize('[Getter]', 'special'); - } - } else { - if (value.__lookupSetter__(key)) { - str = stylize('[Setter]', 'special'); - } - } - } - if (indexOf(visible_keys, key) < 0) { - name = '[' + key + ']'; - } - if (!str) { - if (indexOf(seen, value[key]) < 0) { - if (recurseTimes === null) { - str = format(value[key]); - } else { - str = format(value[key], recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (isArray(value)) { - str = map(str.split('\n'), function (line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + map(str.split('\n'), function (line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = stylize('[Circular]', 'special'); - } - } - if (typeof name === 'undefined') { - if (type === 'Array' && key.match(/^\d+$/)) { - return str; - } - name = json.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = stylize(name, 'string'); - } - } - - return name + ': ' + str; - }); - - seen.pop(); - - var numLinesEst = 0; - var length = reduce(output, function (prev, cur) { - numLinesEst++; - if (indexOf(cur, '\n') >= 0) numLinesEst++; - return prev + cur.length + 1; - }, 0); - - if (length > 50) { - output = braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - - } else { - output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; - } - - return output; - } - return format(obj, (typeof depth === 'undefined' ? 2 : depth)); - }; - - function isArray (ar) { - return Object.prototype.toString.call(ar) == '[object Array]'; - }; - - function isRegExp(re) { - var s = '' + re; - return re instanceof RegExp || // easy case - // duck-type for context-switching evalcx case - typeof(re) === 'function' && - re.constructor.name === 'RegExp' && - re.compile && - re.test && - re.exec && - s.match(/^\/.*\/[gim]{0,3}$/); - }; - - function isDate(d) { - if (d instanceof Date) return true; - return false; - }; - - function keys (obj) { - if (Object.keys) { - return Object.keys(obj); - } - - var keys = []; - - for (var i in obj) { - if (Object.prototype.hasOwnProperty.call(obj, i)) { - keys.push(i); - } - } - - return keys; - } - - function map (arr, mapper, that) { - if (Array.prototype.map) { - return Array.prototype.map.call(arr, mapper, that); - } - - var other= new Array(arr.length); - - for (var i= 0, n = arr.length; i= 2) { - var rv = arguments[1]; - } else { - do { - if (i in this) { - rv = this[i++]; - break; - } - - // if array contains no values, no initial value to return - if (++i >= len) - throw new TypeError(); - } while (true); - } - - for (; i < len; i++) { - if (i in this) - rv = fun.call(null, rv, this[i], i, this); - } - - return rv; - }; - - /** - * Asserts deep equality - * - * @see taken from node.js `assert` module (copyright Joyent, MIT license) - * @api private - */ - - expect.eql = function eql (actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - } else if ('undefined' != typeof Buffer - && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == "object", - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical "prototype" property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } - } - - function isUndefinedOrNull (value) { - return value === null || value === undefined; - } - - function isArguments (object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; - } - - function objEquiv (a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical "prototype" property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return expect.eql(a, b); - } - try{ - var ka = keys(a), - kb = keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!expect.eql(a[key], b[key])) - return false; - } - return true; - } - - var json = (function () { - "use strict"; - - if ('object' == typeof JSON && JSON.parse && JSON.stringify) { - return { - parse: nativeJSON.parse - , stringify: nativeJSON.stringify - } - } - - var JSON = {}; - - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - function date(d, key) { - return isFinite(d.valueOf()) ? - d.getUTCFullYear() + '-' + - f(d.getUTCMonth() + 1) + '-' + - f(d.getUTCDate()) + 'T' + - f(d.getUTCHours()) + ':' + - f(d.getUTCMinutes()) + ':' + - f(d.getUTCSeconds()) + 'Z' : null; - }; - - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - - - function quote(string) { - - // If the string contains no control characters, no quote characters, and no - // backslash characters, then we can safely slap some quotes around it. - // Otherwise we must also replace the offending characters with safe escape - // sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string + '"'; - } - - - function str(key, holder) { - - // Produce a string from holder[key]. - - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - - // If the value has a toJSON method, call it to obtain a replacement value. - - if (value instanceof Date) { - value = date(key); - } - - // If we were called with a replacer function, then call the replacer to - // obtain a replacement value. - - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - - // What happens next depends on the value's type. - - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - - // JSON numbers must be finite. Encode non-finite numbers as null. - - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - - // If the value is a boolean or null, convert it to a string. Note: - // typeof null does not produce 'null'. The case is included here in - // the remote chance that this gets fixed someday. - - return String(value); - - // If the type is 'object', we might be dealing with an object or an array or - // null. - - case 'object': - - // Due to a specification blunder in ECMAScript, typeof null is 'object', - // so watch out for that case. - - if (!value) { - return 'null'; - } - - // Make an array to hold the partial results of stringifying this object value. - - gap += indent; - partial = []; - - // Is the value an array? - - if (Object.prototype.toString.apply(value) === '[object Array]') { - - // The value is an array. Stringify every element. Use null as a placeholder - // for non-JSON values. - - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - - // Join all of the elements together, separated with commas, and wrap them in - // brackets. - - v = partial.length === 0 ? '[]' : gap ? - '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - - // If the replacer is an array, use it to select the members to be stringified. - - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - if (typeof rep[i] === 'string') { - k = rep[i]; - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } else { - - // Otherwise, iterate through all of the keys in the object. - - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - - // Join all of the member texts together, separated with commas, - // and wrap them in braces. - - v = partial.length === 0 ? '{}' : gap ? - '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : - '{' + partial.join(',') + '}'; - gap = mind; - return v; - } - } - - // If the JSON object does not yet have a stringify method, give it one. - - JSON.stringify = function (value, replacer, space) { - - // The stringify method takes a value and an optional replacer, and an optional - // space parameter, and returns a JSON text. The replacer can be a function - // that can replace values, or an array of strings that will select the keys. - // A default replacer method can be provided. Use of the space parameter can - // produce text that is more easily readable. - - var i; - gap = ''; - indent = ''; - - // If the space parameter is a number, make an indent string containing that - // many spaces. - - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - - // If the space parameter is a string, it will be used as the indent string. - - } else if (typeof space === 'string') { - indent = space; - } - - // If there is a replacer, it must be a function or an array. - // Otherwise, throw an error. - - rep = replacer; - if (replacer && typeof replacer !== 'function' && - (typeof replacer !== 'object' || - typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - - // Make a fake root object containing our value under the key of ''. - // Return the result of stringifying the value. - - return str('', {'': value}); - }; - - // If the JSON object does not yet have a parse method, give it one. - - JSON.parse = function (text, reviver) { - // The parse method takes a text and an optional reviver function, and returns - // a JavaScript value if the text is a valid JSON text. - - var j; - - function walk(holder, key) { - - // The walk method is used to recursively walk the resulting structure so - // that modifications can be made. - - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - } - - - // Parsing happens in four stages. In the first stage, we replace certain - // Unicode characters with escape sequences. JavaScript handles many characters - // incorrectly, either silently deleting them, or treating them as line endings. - - text = String(text); - cx.lastIndex = 0; - if (cx.test(text)) { - text = text.replace(cx, function (a) { - return '\\u' + - ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }); - } - - // In the second stage, we run the text against regular expressions that look - // for non-JSON patterns. We are especially concerned with '()' and 'new' - // because they can cause invocation, and '=' because it can cause mutation. - // But just to be safe, we want to reject all unexpected forms. - - // We split the second stage into 4 regexp operations in order to work around - // crippling inefficiencies in IE's and Safari's regexp engines. First we - // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we - // replace all simple value tokens with ']' characters. Third, we delete all - // open brackets that follow a colon or comma or that begin the text. Finally, - // we look to see that the remaining characters are only whitespace or ']' or - // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. - - if (/^[\],:{}\s]*$/ - .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') - .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') - .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { - - // In the third stage we use the eval function to compile the text into a - // JavaScript structure. The '{' operator is subject to a syntactic ambiguity - // in JavaScript: it can begin a block or an object literal. We wrap the text - // in parens to eliminate the ambiguity. - - j = eval('(' + text + ')'); - - // In the optional fourth stage, we recursively walk the new structure, passing - // each name/value pair to a reviver function for possible transformation. - - return typeof reviver === 'function' ? - walk({'': j}, '') : j; - } - - // If the text is not JSON parseable, then a SyntaxError is thrown. - - throw new SyntaxError('JSON.parse'); - }; - - return JSON; - })(); - - if ('undefined' != typeof window) { - window.expect = module.exports; - } - -})( - this - , 'undefined' != typeof module ? module : {} - , 'undefined' != typeof exports ? exports : {} -); \ No newline at end of file diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/index.html b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/index.html deleted file mode 100644 index c73147a..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - Mocha - - - - - - - - - - - - -
              - - diff --git a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/jquery.js b/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/jquery.js deleted file mode 100644 index f3201aa..0000000 --- a/node_modules/grunt-contrib-watch/node_modules/tiny-lr/node_modules/qs/test/browser/jquery.js +++ /dev/null @@ -1,8981 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Jun 30 14:16:56 2011 -0400 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Check for digits - rdigit = /\d/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Matches dashed string for camelizing - rdashAlpha = /-([a-z])/ig, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = quickExpr.exec( selector ); - } - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = (context ? context.ownerDocument || context : document); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return (context || rootjQuery).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if (selector.selector !== undefined) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.6.2", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + (this.selector ? " " : "") + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // Add the callback - readyList.done( fn ); - - return this; - }, - - eq: function( i ) { - return i === -1 ? - this.slice( i ) : - this.slice( i, +i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).unbind( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { - return; - } - - readyList = jQuery._Deferred(); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - // A crude way of determining if an object is a window - isWindow: function( obj ) { - return obj && typeof obj === "object" && "setInterval" in obj; - }, - - isNaN: function( obj ) { - return obj == null || !rdigit.test( obj ) || isNaN( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw msg; - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return (new Function( "return " + data ))(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - // (xml & tmp used internally) - parseXML: function( data , xml , tmp ) { - - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - - tmp = xml.documentElement; - - if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) { - jQuery.error( "Invalid XML: " + data ); - } - - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Converts a dashed string to camelCased string; - // Used by both the css and data modules - camelCase: function( string ) { - return string.replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { - break; - } - } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // The extra typeof function check is to prevent crashes - // in Safari 2 (See: #3039) - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array ) { - - if ( indexOf ) { - return indexOf.call( array, elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - if ( typeof context === "string" ) { - var tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can optionally be executed if it's a function - access: function( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - jQuery.access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : undefined; - }, - - now: function() { - return (new Date()).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -return jQuery; - -})(); - - -var // Promise methods - promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ), - // Static reference to slice - sliceDeferred = [].slice; - -jQuery.extend({ - // Create a simple deferred (one callbacks list) - _Deferred: function() { - var // callbacks list - callbacks = [], - // stored [ context , args ] - fired, - // to avoid firing when already doing so - firing, - // flag to know if the deferred has been cancelled - cancelled, - // the deferred itself - deferred = { - - // done( f1, f2, ...) - done: function() { - if ( !cancelled ) { - var args = arguments, - i, - length, - elem, - type, - _fired; - if ( fired ) { - _fired = fired; - fired = 0; - } - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - deferred.done.apply( deferred, elem ); - } else if ( type === "function" ) { - callbacks.push( elem ); - } - } - if ( _fired ) { - deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); - } - } - return this; - }, - - // resolve with given context and args - resolveWith: function( context, args ) { - if ( !cancelled && !fired && !firing ) { - // make sure args are available (#8421) - args = args || []; - firing = 1; - try { - while( callbacks[ 0 ] ) { - callbacks.shift().apply( context, args ); - } - } - finally { - fired = [ context, args ]; - firing = 0; - } - } - return this; - }, - - // resolve with this as context and given arguments - resolve: function() { - deferred.resolveWith( this, arguments ); - return this; - }, - - // Has this deferred been resolved? - isResolved: function() { - return !!( firing || fired ); - }, - - // Cancel - cancel: function() { - cancelled = 1; - callbacks = []; - return this; - } - }; - - return deferred; - }, - - // Full fledged deferred (two callbacks list) - Deferred: function( func ) { - var deferred = jQuery._Deferred(), - failDeferred = jQuery._Deferred(), - promise; - // Add errorDeferred methods, then and promise - jQuery.extend( deferred, { - then: function( doneCallbacks, failCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ); - return this; - }, - always: function() { - return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments ); - }, - fail: failDeferred.done, - rejectWith: failDeferred.resolveWith, - reject: failDeferred.resolve, - isRejected: failDeferred.isResolved, - pipe: function( fnDone, fnFail ) { - return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject ); - } else { - newDefer[ action ]( returned ); - } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } - }); - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - if ( obj == null ) { - if ( promise ) { - return promise; - } - promise = obj = {}; - } - var i = promiseMethods.length; - while( i-- ) { - obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; - } - return obj; - } - }); - // Make sure only one callback list will be used - deferred.done( failDeferred.cancel ).fail( deferred.cancel ); - // Unexpose cancel - delete deferred.cancel; - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - return deferred; - }, - - // Deferred helper - when: function( firstParam ) { - var args = arguments, - i = 0, - length = args.length, - count = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - // Strange bug in FF4: - // Values changed onto the arguments object sometimes end up as undefined values - // outside the $.when method. Cloning the object into a fresh array solves the issue - deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) ); - } - }; - } - if ( length > 1 ) { - for( ; i < length; i++ ) { - if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject ); - } else { - --count; - } - } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); - } - return deferred.promise(); - } -}); - - - -jQuery.support = (function() { - - var div = document.createElement( "div" ), - documentElement = document.documentElement, - all, - a, - select, - opt, - input, - marginDiv, - support, - fragment, - body, - testElementParent, - testElement, - testElementStyle, - tds, - events, - eventName, - i, - isSupported; - - // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = "
              a"; - - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return {}; - } - - // First batch of supports tests - select = document.createElement( "select" ); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; - - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName( "tbody" ).length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName( "link" ).length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55$/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent( "onclick" ); - } - - // Check if a radio maintains it's value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute("type", "radio"); - support.radioValue = input.value === "t"; - - input.setAttribute("checked", "checked"); - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.firstChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - div.innerHTML = ""; - - // Figure out if the W3C box model works as expected - div.style.width = div.style.paddingLeft = "1px"; - - body = document.getElementsByTagName( "body" )[ 0 ]; - // We use our own, invisible, body unless the body is already present - // in which case we use a div (#9239) - testElement = document.createElement( body ? "div" : "body" ); - testElementStyle = { - visibility: "hidden", - width: 0, - height: 0, - border: 0, - margin: 0 - }; - if ( body ) { - jQuery.extend( testElementStyle, { - position: "absolute", - left: -1000, - top: -1000 - }); - } - for ( i in testElementStyle ) { - testElement.style[ i ] = testElementStyle[ i ]; - } - testElement.appendChild( div ); - testElementParent = body || documentElement; - testElementParent.insertBefore( testElement, testElementParent.firstChild ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - support.boxModel = div.offsetWidth === 2; - - if ( "zoom" in div.style ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.style.display = "inline"; - div.style.zoom = 1; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = ""; - div.innerHTML = "
              "; - support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); - } - - div.innerHTML = "
              t
              "; - tds = div.getElementsByTagName( "td" ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE < 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - div.innerHTML = ""; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - if ( document.defaultView && document.defaultView.getComputedStyle ) { - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; - } - - // Remove the body element we added - testElement.innerHTML = ""; - testElementParent.removeChild( testElement ); - - // Technique from Juriy Zaytsev - // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for( i in { - submit: 1, - change: 1, - focusin: 1 - } ) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - // Null connected elements to avoid leaks in IE - testElement = fragment = select = opt = body = marginDiv = div = input = null; - - return support; -})(); - -// Keep track of boxModel -jQuery.boxModel = jQuery.support.boxModel; - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, - rmultiDash = /([a-z])([A-Z])/g; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ jQuery.expando ] = id = ++jQuery.uuid; - } else { - id = jQuery.expando; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery - // metadata on plain JS objects when the object is serialized using - // JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); - } else { - cache[ id ] = jQuery.extend(cache[ id ], name); - } - } - - thisCache = cache[ id ]; - - // Internal jQuery data is stored in a separate object inside the object's data - // cache in order to avoid key collisions between internal data and user-defined - // data - if ( pvt ) { - if ( !thisCache[ internalKey ] ) { - thisCache[ internalKey ] = {}; - } - - thisCache = thisCache[ internalKey ]; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should - // not attempt to inspect the internal events object using jQuery.data, as this - // internal data object is undocumented and subject to change. - if ( name === "events" && !thisCache[name] ) { - return thisCache[ internalKey ] && thisCache[ internalKey ].events; - } - - return getByName ? - // Check for both converted-to-camel and non-converted data property names - thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] : - thisCache; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var internalKey = jQuery.expando, isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; - - if ( thisCache ) { - delete thisCache[ name ]; - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !isEmptyDataObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( pvt ) { - delete cache[ id ][ internalKey ]; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { - return; - } - } - - var internalCache = cache[ id ][ internalKey ]; - - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - if ( jQuery.support.deleteExpando || cache != window ) { - delete cache[ id ]; - } else { - cache[ id ] = null; - } - - // We destroyed the entire user cache at once because it's faster than - // iterating through each key, but we need to continue to persist internal - // data if it existed - if ( internalCache ) { - cache[ id ] = {}; - // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery - // metadata on plain JS objects when the object is serialized using - // JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - - cache[ id ][ internalKey ] = internalCache; - - // Otherwise, we need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - } else if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ jQuery.expando ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( jQuery.expando ); - } else { - elem[ jQuery.expando ] = null; - } - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var data = null; - - if ( typeof key === "undefined" ) { - if ( this.length ) { - data = jQuery.data( this[0] ); - - if ( this[0].nodeType === 1 ) { - var attr = this[0].attributes, name; - for ( var i = 0, l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( this[0], name, data[ name ] ); - } - } - } - } - - return data; - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - // Try to fetch any internally stored data first - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - data = dataAttr( this[0], key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - - } else { - return this.each(function() { - var $this = jQuery( this ), - args = [ parts[0], value ]; - - $this.triggerHandler( "setData" + parts[1] + "!", args ); - jQuery.data( this, key, value ); - $this.triggerHandler( "changeData" + parts[1] + "!", args ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - !jQuery.isNaN( data ) ? parseFloat( data ) : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON -// property to be considered empty objects; this property always exists in -// order to make sure JSON.stringify does not expose internal metadata -function isEmptyDataObject( obj ) { - for ( var name in obj ) { - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery.data( elem, deferDataKey, undefined, true ); - if ( defer && - ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) && - ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery.data( elem, queueDataKey, undefined, true ) && - !jQuery.data( elem, markDataKey, undefined, true ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.resolve(); - } - }, 0 ); - } -} - -jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = (type || "fx") + "mark"; - jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 ); - if ( count ) { - jQuery.data( elem, key, count, true ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - - queue: function( elem, type, data ) { - if ( elem ) { - type = (type || "fx") + "queue"; - var q = jQuery.data( elem, type, undefined, true ); - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery.data( elem, type, jQuery.makeArray(data), true ); - } else { - q.push( data ); - } - } - return q || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(), - defer; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift("inprogress"); - } - - fn.call(elem, function() { - jQuery.dequeue(elem, type); - }); - } - - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue", true ); - handleQueueMarkDefer( elem, type, "queue" ); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function() { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; - type = type || "fx"; - - return this.queue( type, function() { - var elem = this; - setTimeout(function() { - jQuery.dequeue( elem, type ); - }, time ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, object ) { - if ( typeof type !== "string" ) { - object = type; - type = undefined; - } - type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } - while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) { - count++; - tmp.done( resolve ); - } - } - resolve(); - return defer.promise(); - } -}); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - rinvalidChar = /\:|^on/, - formHook, boolHook; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.prop ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classNames, i, l, elem, - setClass, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setClass = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { - setClass += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call(this, j, this.className) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - classNames = (value || "").split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " "; - for ( var i = 0, l = this.length; i < l; i++ ) { - if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return undefined; - } - - var isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var self = jQuery(this), val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, - index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - // Fixes Bug #2551 -- select.val() broken in IE after form.reset() - if ( one && !values.length && options.length ) { - return jQuery( options[ index ] ).val(); - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attrFix: { - // Always normalize to ensure hook usage - tabindex: "tabIndex" - }, - - attr: function( elem, name, value, pass ) { - var nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return undefined; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( !("getAttribute" in elem) ) { - return jQuery.prop( elem, name, value ); - } - - var ret, hooks, - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // Normalize the name if needed - if ( notxml ) { - name = jQuery.attrFix[ name ] || name; - - hooks = jQuery.attrHooks[ name ]; - - if ( !hooks ) { - // Use boolHook for boolean attributes - if ( rboolean.test( name ) ) { - - hooks = boolHook; - - // Use formHook for forms and if the name contains certain characters - } else if ( formHook && name !== "className" && - (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) { - - hooks = formHook; - } - } - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return undefined; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, "" + value ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, name ) { - var propName; - if ( elem.nodeType === 1 ) { - name = jQuery.attrFix[ name ] || name; - - if ( jQuery.support.getSetAttribute ) { - // Use removeAttribute in browsers that support it - elem.removeAttribute( name ); - } else { - jQuery.attr( elem, name, "" ); - elem.removeAttributeNode( elem.getAttributeNode( name ) ); - } - - // Set corresponding property to false for boolean attributes - if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) { - elem[ propName ] = false; - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabIndex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - }, - // Use the value property for back compat - // Use the formHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( formHook && jQuery.nodeName( elem, "button" ) ) { - return formHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( formHook && jQuery.nodeName( elem, "button" ) ) { - return formHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return undefined; - } - - var ret, hooks, - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return (elem[ name ] = value); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: {} -}); - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - return jQuery.prop( elem, name ) ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !jQuery.support.getSetAttribute ) { - - // propFix is more comprehensive and contains all fixes - jQuery.attrFix = jQuery.propFix; - - // Use this for any attribute on a form in IE6/7 - formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - // Return undefined if nodeValue is empty string - return ret && ret.nodeValue !== "" ? - ret.nodeValue : - undefined; - }, - set: function( elem, value, name ) { - // Check form objects in IE (multiple bugs related) - // Only use nodeValue if the attribute node exists on the form - var ret = elem.getAttributeNode( name ); - if ( ret ) { - ret.nodeValue = value; - return value; - } - } - }; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return (elem.style.cssText = "" + value); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }); -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); - } - } - }); -}); - - - - -var rnamespaces = /\.(.*)$/, - rformElems = /^(?:textarea|input|select)$/i, - rperiod = /\./g, - rspaces = / /g, - rescape = /[^\w\s.|`]/g, - fcleanup = function( nm ) { - return nm.replace(rescape, "\\$&"); - }; - -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function( elem, types, handler, data ) { - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - if ( handler === false ) { - handler = returnFalse; - } else if ( !handler ) { - // Fixes bug #7229. Fix recommended by jdalton - return; - } - - var handleObjIn, handleObj; - - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - } - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure - var elemData = jQuery._data( elem ); - - // If no elemData is found then we must be trying to bind to one of the - // banned noData elements - if ( !elemData ) { - return; - } - - var events = elemData.events, - eventHandle = elemData.handle; - - if ( !events ) { - elemData.events = events = {}; - } - - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.handle.apply( eventHandle.elem, arguments ) : - undefined; - }; - } - - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native events in IE. - eventHandle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = types.split(" "); - - var type, i = 0, namespaces; - - while ( (type = types[ i++ ]) ) { - handleObj = handleObjIn ? - jQuery.extend({}, handleObjIn) : - { handler: handler, data: data }; - - // Namespaced event handlers - if ( type.indexOf(".") > -1 ) { - namespaces = type.split("."); - type = namespaces.shift(); - handleObj.namespace = namespaces.slice(0).sort().join("."); - - } else { - namespaces = []; - handleObj.namespace = ""; - } - - handleObj.type = type; - if ( !handleObj.guid ) { - handleObj.guid = handler.guid; - } - - // Get the current list of functions bound to this event - var handlers = events[ type ], - special = jQuery.event.special[ type ] || {}; - - // Init the event handler queue - if ( !handlers ) { - handlers = events[ type ] = []; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add the function to the element's handler list - handlers.push( handleObj ); - - // Keep track of which events have been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, pos ) { - // don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - if ( handler === false ) { - handler = returnFalse; - } - - var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - events = elemData && elemData.events; - - if ( !elemData || !events ) { - return; - } - - // types is actually an event object here - if ( types && types.type ) { - handler = types.handler; - types = types.type; - } - - // Unbind all events for the element - if ( !types || typeof types === "string" && types.charAt(0) === "." ) { - types = types || ""; - - for ( type in events ) { - jQuery.event.remove( elem, type + types ); - } - - return; - } - - // Handle multiple events separated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - types = types.split(" "); - - while ( (type = types[ i++ ]) ) { - origType = type; - handleObj = null; - all = type.indexOf(".") < 0; - namespaces = []; - - if ( !all ) { - // Namespaced event handlers - namespaces = type.split("."); - type = namespaces.shift(); - - namespace = new RegExp("(^|\\.)" + - jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - eventType = events[ type ]; - - if ( !eventType ) { - continue; - } - - if ( !handler ) { - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( all || namespace.test( handleObj.namespace ) ) { - jQuery.event.remove( elem, origType, handleObj.handler, j ); - eventType.splice( j--, 1 ); - } - } - - continue; - } - - special = jQuery.event.special[ type ] || {}; - - for ( j = pos || 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( handler.guid === handleObj.guid ) { - // remove the given handler for the given type - if ( all || namespace.test( handleObj.namespace ) ) { - if ( pos == null ) { - eventType.splice( j--, 1 ); - } - - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - - if ( pos != null ) { - break; - } - } - } - - // remove generic event handler if no more handlers exist - if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - ret = null; - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - var handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - delete elemData.events; - delete elemData.handle; - - if ( jQuery.isEmptyObject( elemData ) ) { - jQuery.removeData( elem, undefined, true ); - } - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Event object or event type - var type = event.type || event, - namespaces = [], - exclusive; - - if ( type.indexOf("!") >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.exclusive = exclusive; - event.namespace = namespaces.join("."); - event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); - - // triggerHandler() and global events don't bubble or run the default action - if ( onlyHandlers || !elem ) { - event.preventDefault(); - event.stopPropagation(); - } - - // Handle a global trigger - if ( !elem ) { - // TODO: Stop taunting the data cache; remove global events and always attach to document - jQuery.each( jQuery.cache, function() { - // internalKey variable is just used to make it easier to find - // and potentially change this stuff later; currently it just - // points to jQuery.expando - var internalKey = jQuery.expando, - internalCache = this[ internalKey ]; - if ( internalCache && internalCache.events && internalCache.events[ type ] ) { - jQuery.event.trigger( event, data, internalCache.handle.elem ); - } - }); - return; - } - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - event.target = elem; - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - var cur = elem, - // IE doesn't like method names with a colon (#3533, #8272) - ontype = type.indexOf(":") < 0 ? "on" + type : ""; - - // Fire event on the current element, then bubble up the DOM tree - do { - var handle = jQuery._data( cur, "handle" ); - - event.currentTarget = cur; - if ( handle ) { - handle.apply( cur, data ); - } - - // Trigger an inline bound script - if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) { - event.result = false; - event.preventDefault(); - } - - // Bubble up to document, then to window - cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window; - } while ( cur && !event.isPropagationStopped() ); - - // If nobody prevented the default action, do it now - if ( !event.isDefaultPrevented() ) { - var old, - special = jQuery.event.special[ type ] || {}; - - if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction)() check here because IE6/7 fails that test. - // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch. - try { - if ( ontype && elem[ type ] ) { - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - jQuery.event.triggered = type; - elem[ type ](); - } - } catch ( ieError ) {} - - if ( old ) { - elem[ ontype ] = old; - } - - jQuery.event.triggered = undefined; - } - } - - return event.result; - }, - - handle: function( event ) { - event = jQuery.event.fix( event || window.event ); - // Snapshot the handlers list since a called handler may add/remove events. - var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0), - run_all = !event.exclusive && !event.namespace, - args = Array.prototype.slice.call( arguments, 0 ); - - // Use the fix-ed Event rather than the (read-only) native event - args[0] = event; - event.currentTarget = this; - - for ( var j = 0, l = handlers.length; j < l; j++ ) { - var handleObj = handlers[ j ]; - - // Triggered event must 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event. - if ( run_all || event.namespace_re.test( handleObj.namespace ) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handleObj.handler; - event.data = handleObj.data; - event.handleObj = handleObj; - - var ret = handleObj.handler.apply( this, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if ( event.isImmediatePropagationStopped() ) { - break; - } - } - } - return event.result; - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ) { - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) { - // Fixes #1925 where srcElement might not be defined either - event.target = event.srcElement || document; - } - - // check if target is a textnode (safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) { - event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; - } - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var eventDocument = event.target.ownerDocument || document, - doc = eventDocument.documentElement, - body = eventDocument.body; - - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add which for key events - if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { - event.which = event.charCode != null ? event.charCode : event.keyCode; - } - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) { - event.metaKey = event.ctrlKey; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button !== undefined ) { - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - } - - return event; - }, - - // Deprecated, use jQuery.guid instead - guid: 1E8, - - // Deprecated, use jQuery.proxy instead - proxy: jQuery.proxy, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady, - teardown: jQuery.noop - }, - - live: { - add: function( handleObj ) { - jQuery.event.add( this, - liveConvert( handleObj.origType, handleObj.selector ), - jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); - }, - - remove: function( handleObj ) { - jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); - } - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !this.preventDefault ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function( event ) { - - // Check if mouse(over|out) are still within the same parent element - var related = event.relatedTarget, - inside = false, - eventType = event.type; - - event.type = event.data; - - if ( related !== this ) { - - if ( related ) { - inside = jQuery.contains( this, related ); - } - - if ( !inside ) { - - jQuery.event.handle.apply( this, arguments ); - - event.type = eventType; - } - } -}, - -// In case of event delegation, we only need to rename the event.type, -// liveHandler will take care of the rest. -delegate = function( event ) { - event.type = event.data; - jQuery.event.handle.apply( this, arguments ); -}; - -// Create mouseenter and mouseleave events -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - setup: function( data ) { - jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); - }, - teardown: function( data ) { - jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); - } - }; -}); - -// submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function( data, namespaces ) { - if ( !jQuery.nodeName( this, "form" ) ) { - jQuery.event.add(this, "click.specialSubmit", function( e ) { - var elem = e.target, - type = elem.type; - - if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { - trigger( "submit", this, arguments ); - } - }); - - jQuery.event.add(this, "keypress.specialSubmit", function( e ) { - var elem = e.target, - type = elem.type; - - if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { - trigger( "submit", this, arguments ); - } - }); - - } else { - return false; - } - }, - - teardown: function( namespaces ) { - jQuery.event.remove( this, ".specialSubmit" ); - } - }; - -} - -// change delegation, happens here so we have bind. -if ( !jQuery.support.changeBubbles ) { - - var changeFilters, - - getVal = function( elem ) { - var type = elem.type, val = elem.value; - - if ( type === "radio" || type === "checkbox" ) { - val = elem.checked; - - } else if ( type === "select-multiple" ) { - val = elem.selectedIndex > -1 ? - jQuery.map( elem.options, function( elem ) { - return elem.selected; - }).join("-") : - ""; - - } else if ( jQuery.nodeName( elem, "select" ) ) { - val = elem.selectedIndex; - } - - return val; - }, - - testChange = function testChange( e ) { - var elem = e.target, data, val; - - if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { - return; - } - - data = jQuery._data( elem, "_change_data" ); - val = getVal(elem); - - // the current data will be also retrieved by beforeactivate - if ( e.type !== "focusout" || elem.type !== "radio" ) { - jQuery._data( elem, "_change_data", val ); - } - - if ( data === undefined || val === data ) { - return; - } - - if ( data != null || val ) { - e.type = "change"; - e.liveFired = undefined; - jQuery.event.trigger( e, arguments[1], elem ); - } - }; - - jQuery.event.special.change = { - filters: { - focusout: testChange, - - beforedeactivate: testChange, - - click: function( e ) { - var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; - - if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) { - testChange.call( this, e ); - } - }, - - // Change has to be called before submit - // Keydown will be called before keypress, which is used in submit-event delegation - keydown: function( e ) { - var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; - - if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) || - (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || - type === "select-multiple" ) { - testChange.call( this, e ); - } - }, - - // Beforeactivate happens also before the previous element is blurred - // with this event you can't trigger a change event, but you can store - // information - beforeactivate: function( e ) { - var elem = e.target; - jQuery._data( elem, "_change_data", getVal(elem) ); - } - }, - - setup: function( data, namespaces ) { - if ( this.type === "file" ) { - return false; - } - - for ( var type in changeFilters ) { - jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); - } - - return rformElems.test( this.nodeName ); - }, - - teardown: function( namespaces ) { - jQuery.event.remove( this, ".specialChange" ); - - return rformElems.test( this.nodeName ); - } - }; - - changeFilters = jQuery.event.special.change.filters; - - // Handle when the input is .focus()'d - changeFilters.focus = changeFilters.beforeactivate; -} - -function trigger( type, elem, args ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - // Don't pass args or remember liveFired; they apply to the donor event. - var event = jQuery.extend( {}, args[ 0 ] ); - event.type = type; - event.originalEvent = {}; - event.liveFired = undefined; - jQuery.event.handle.call( elem, event ); - if ( event.isDefaultPrevented() ) { - args[ 0 ].preventDefault(); - } -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - - function handler( donor ) { - // Donor event is always a native one; fix it and switch its type. - // Let focusin/out handler cancel the donor focus/blur event. - var e = jQuery.event.fix( donor ); - e.type = fix; - e.originalEvent = {}; - jQuery.event.trigger( e, null, e.target ); - if ( e.isDefaultPrevented() ) { - donor.preventDefault(); - } - } - }); -} - -jQuery.each(["bind", "one"], function( i, name ) { - jQuery.fn[ name ] = function( type, data, fn ) { - var handler; - - // Handle object literals - if ( typeof type === "object" ) { - for ( var key in type ) { - this[ name ](key, data, type[key], fn); - } - return this; - } - - if ( arguments.length === 2 || data === false ) { - fn = data; - data = undefined; - } - - if ( name === "one" ) { - handler = function( event ) { - jQuery( this ).unbind( event, handler ); - return fn.apply( this, arguments ); - }; - handler.guid = fn.guid || jQuery.guid++; - } else { - handler = fn; - } - - if ( type === "unload" && name !== "one" ) { - this.one( type, data, fn ); - - } else { - for ( var i = 0, l = this.length; i < l; i++ ) { - jQuery.event.add( this[i], type, handler, data ); - } - } - - return this; - }; -}); - -jQuery.fn.extend({ - unbind: function( type, fn ) { - // Handle object literals - if ( typeof type === "object" && !type.preventDefault ) { - for ( var key in type ) { - this.unbind(key, type[key]); - } - - } else { - for ( var i = 0, l = this.length; i < l; i++ ) { - jQuery.event.remove( this[i], type, fn ); - } - } - - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.live( types, data, fn, selector ); - }, - - undelegate: function( selector, types, fn ) { - if ( arguments.length === 0 ) { - return this.unbind( "live" ); - - } else { - return this.die( types, null, fn, selector ); - } - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -var liveMap = { - focus: "focusin", - blur: "focusout", - mouseenter: "mouseover", - mouseleave: "mouseout" -}; - -jQuery.each(["live", "die"], function( i, name ) { - jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { - var type, i = 0, match, namespaces, preType, - selector = origSelector || this.selector, - context = origSelector ? this : jQuery( this.context ); - - if ( typeof types === "object" && !types.preventDefault ) { - for ( var key in types ) { - context[ name ]( key, data, types[key], selector ); - } - - return this; - } - - if ( name === "die" && !types && - origSelector && origSelector.charAt(0) === "." ) { - - context.unbind( origSelector ); - - return this; - } - - if ( data === false || jQuery.isFunction( data ) ) { - fn = data || returnFalse; - data = undefined; - } - - types = (types || "").split(" "); - - while ( (type = types[ i++ ]) != null ) { - match = rnamespaces.exec( type ); - namespaces = ""; - - if ( match ) { - namespaces = match[0]; - type = type.replace( rnamespaces, "" ); - } - - if ( type === "hover" ) { - types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); - continue; - } - - preType = type; - - if ( liveMap[ type ] ) { - types.push( liveMap[ type ] + namespaces ); - type = type + namespaces; - - } else { - type = (liveMap[ type ] || type) + namespaces; - } - - if ( name === "live" ) { - // bind live handler - for ( var j = 0, l = context.length; j < l; j++ ) { - jQuery.event.add( context[j], "live." + liveConvert( type, selector ), - { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); - } - - } else { - // unbind live handler - context.unbind( "live." + liveConvert( type, selector ), fn ); - } - } - - return this; - }; -}); - -function liveHandler( event ) { - var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, - elems = [], - selectors = [], - events = jQuery._data( this, "events" ); - - // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) - if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { - return; - } - - if ( event.namespace ) { - namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - event.liveFired = this; - - var live = events.live.slice(0); - - for ( j = 0; j < live.length; j++ ) { - handleObj = live[j]; - - if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { - selectors.push( handleObj.selector ); - - } else { - live.splice( j--, 1 ); - } - } - - match = jQuery( event.target ).closest( selectors, event.currentTarget ); - - for ( i = 0, l = match.length; i < l; i++ ) { - close = match[i]; - - for ( j = 0; j < live.length; j++ ) { - handleObj = live[j]; - - if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { - elem = close.elem; - related = null; - - // Those two events require additional checking - if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { - event.type = handleObj.preType; - related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; - - // Make sure not to accidentally match a child element with the same selector - if ( related && jQuery.contains( elem, related ) ) { - related = elem; - } - } - - if ( !related || related !== elem ) { - elems.push({ elem: elem, handleObj: handleObj, level: close.level }); - } - } - } - } - - for ( i = 0, l = elems.length; i < l; i++ ) { - match = elems[i]; - - if ( maxLevel && match.level > maxLevel ) { - break; - } - - event.currentTarget = match.elem; - event.data = match.handleObj.data; - event.handleObj = match.handleObj; - - ret = match.handleObj.origHandler.apply( match.elem, arguments ); - - if ( ret === false || event.isPropagationStopped() ) { - maxLevel = match.level; - - if ( ret === false ) { - stop = false; - } - if ( event.isImmediatePropagationStopped() ) { - break; - } - } - } - - return stop; -} - -function liveConvert( type, selector ) { - return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&"); -} - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.bind( name, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } -}); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var match, - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - var left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - var found, item, - filter = Expr.filter[ type ], - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - var first = match[2], - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Utility function for retreiving the text value of an array of DOM nodes -Sizzle.getText = function( elems ) { - var ret = "", elem; - - for ( var i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += Sizzle.getText( elem.childNodes ); - } - } - - return ret; -}; - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

              "; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
              "; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.POS, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var self = this, - i, l; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - var ret = this.pushStack( "", "find", selector ), - length, n, r; - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( typeof selector === "string" ? - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array - if ( jQuery.isArray( selectors ) ) { - var match, selector, - matches = {}, - level = 1; - - if ( cur && selectors.length ) { - for ( i = 0, l = selectors.length; i < l; i++ ) { - selector = selectors[i]; - - if ( !matches[ selector ] ) { - matches[ selector ] = POS.test( selector ) ? - jQuery( selector, context || this.context ) : - selector; - } - } - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( selector in matches ) { - match = matches[ selector ]; - - if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) { - ret.push({ selector: selector, elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - if ( !elem || typeof elem === "string" ) { - return jQuery.inArray( this[0], - // If it receives a string, the selector is used - // If it receives nothing, the siblings are used - elem ? jQuery( elem ) : this.parent().children() ); - } - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ), - // The variable 'args' was introduced in - // https://github.com/jquery/jquery/commit/52a0238 - // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. - // http://code.google.com/p/v8/issues/detail?id=1050 - args = slice.call(arguments); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, args.join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return (elem === qualifier) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return (jQuery.inArray( elem, qualifier ) >= 0) === keep; - }); -} - - - - -var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /", "" ], - legend: [ 1, "
              ", "
              " ], - thead: [ 1, "", "
              " ], - tr: [ 2, "", "
              " ], - td: [ 3, "", "
              " ], - col: [ 2, "", "
              " ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and \n```\n\nFeel free to add this script to your template situation and toggle with some sort of `dev` flag.\n\n##### Using Live Reload with the Browser Extension\nInstead of adding a script tag to your page, you can live reload your page by installing a browser extension. Please visit [how do I install and use the browser extensions](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-) for help installing an extension for your browser.\n\nOnce installed please use the default live reload port `35729` and the browser extension will automatically reload your page without needing the ` - - - - -``` - -Then running Grunt would behave something like this: - -```shell -$ grunt mytask -Running "mytask" task -Something worked. ->> Something failed. -Warning: Task "mytask" failed. Use --force to continue. - -Aborted due to warnings. -``` - -## Release History - -* 2013-02-28 - v0.3.0 - Use PhantomJS 1.9.0-1. -* 2013-02-28 - v0.2.0 - Use PhantomJS 1.8.1. -* 2012-12-21 - v0.1.0 - Use PhantomJS 1.7.0. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/lib/phantomjs.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/lib/phantomjs.js deleted file mode 100644 index d3c235b..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/lib/phantomjs.js +++ /dev/null @@ -1,175 +0,0 @@ -/* - * grunt-lib-phantomjs - * http://gruntjs.com/ - * - * Copyright (c) 2012 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -exports.init = function(grunt) { - - // Nodejs libs. - var path = require('path'); - - // External libs. - var semver = require('semver'); - var Tempfile = require('temporary/lib/file'); - var EventEmitter2 = require('eventemitter2').EventEmitter2; - - // Get path to phantomjs binary - var binPath = require('phantomjs').path; - - // The module to be exported is an event emitter. - var exports = new EventEmitter2({wildcard: true}); - - // Get an asset file, local to the root of the project. - var asset = path.join.bind(null, __dirname, '..'); - - // Call this when everything has finished successfully... or when something - // horrible happens, and you need to clean up and abort. - var halted; - exports.halt = function() { - halted = true; - }; - - // Start PhantomJS process. - exports.spawn = function(pageUrl, options) { - // Create temporary file to be used for grunt-phantom communication. - var tempfile = new Tempfile(); - // Timeout ID. - var id; - // The number of tempfile lines already read. - var n = 0; - // Reset halted flag. - halted = null; - - // All done? Clean up! - var cleanup = function() { - clearTimeout(id); - tempfile.unlink(); - }; - - // Internal methods. - var privates = { - // Abort if PhantomJS version isn't adequate. - version: function(version) { - var current = [version.major, version.minor, version.patch].join('.'); - var required = '>= 1.6.0'; - if (!semver.satisfies(current, required)) { - exports.halt(); - grunt.log.writeln(); - grunt.log.errorlns( - 'In order for this task to work properly, PhantomJS version ' + - required + ' must be installed, but version ' + current + - ' was detected.' - ); - grunt.warn('The correct version of PhantomJS needs to be installed.', 127); - } - } - }; - - // It's simple. As the page running in PhantomJS alerts messages, they - // are written as JSON to a temporary file. This polling loop checks that - // file for new lines, and for each one parses its JSON and emits the - // corresponding event with the specified arguments. - (function loopy() { - // Disable logging temporarily. - grunt.log.muted = true; - // Read the file, splitting lines on \n, and removing a trailing line. - var lines = grunt.file.read(tempfile.path).split('\n').slice(0, -1); - // Re-enable logging. - grunt.log.muted = false; - // Iterate over all lines that haven't already been processed. - var done = lines.slice(n).some(function(line) { - // Get args and method. - var args = JSON.parse(line); - var eventName = args[0]; - // Debugging messages. - grunt.log.debug(JSON.stringify(['phantomjs'].concat(args)).magenta); - if (eventName === 'private') { - // If a private (internal) message is passed, execute the - // corresponding method. - privates[args[1]].apply(null, args.slice(2)); - } else { - // Otherwise, emit the event with its arguments. - exports.emit.apply(exports, args); - } - // If halted, return true. Because the Array#some method was used, - // this not only sets "done" to true, but stops further iteration - // from occurring. - return halted; - }); - - if (done) { - // All done. - cleanup(); - options.done(null); - } else { - // Update n so previously processed lines are ignored. - n = lines.length; - // Check back in a little bit. - id = setTimeout(loopy, 100); - } - }()); - - // Process options. - var failCode = options.failCode || 0; - - // An array of optional PhantomJS --args. - var args = []; - // Additional options for the PhantomJS main.js script. - var opts = {}; - - // Build args array / opts object. - Object.keys(options.options).forEach(function(key) { - if (/^\-\-/.test(key)) { - args.push(key + '=' + options.options[key]); - } else { - opts[key] = options.options[key]; - } - }); - - // Keep -- PhantomJS args first, followed by grunt-specific args. - args.push( - // The main PhantomJS script file. - opts.phantomScript || asset('phantomjs/main.js'), - // The temporary file used for communications. - tempfile.path, - // URL or path to the page .html test file to run. - pageUrl, - // Additional PhantomJS options. - JSON.stringify(opts) - ); - - grunt.log.debug(JSON.stringify(args)); - - // Actually spawn PhantomJS. - return grunt.util.spawn({ - cmd: binPath, - args: args - }, function(err, result, code) { - if (!err) { return; } - // Something went horribly wrong. - cleanup(); - grunt.verbose.or.writeln(); - grunt.log.write('Running PhantomJS...').error(); - if (code === 127) { - grunt.log.errorlns( - 'In order for this task to work properly, PhantomJS must be installed locally via NPM. ' + - 'If you\'re seeing this message, generally that means the NPM install has failed. ' + - 'Please submit an issue providing as much detail as possible at: ' + - 'https://github.com/gruntjs/grunt-lib-phantomjs/issues' - ); - grunt.warn('PhantomJS not found.', failCode); - } else { - String(result).split('\n').forEach(grunt.log.error, grunt.log); - grunt.warn('PhantomJS exited unexpectedly with exit code ' + code + '.', failCode); - } - options.done(code); - }); - }; - - return exports; -}; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/.bin/phantomjs b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/.bin/phantomjs deleted file mode 120000 index 849bbc7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/.bin/phantomjs +++ /dev/null @@ -1 +0,0 @@ -../phantomjs/bin/phantomjs \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/.bin/semver b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/.bin/semver deleted file mode 120000 index 317eb29..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/README.md deleted file mode 100644 index 9501fa3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/README.md +++ /dev/null @@ -1,212 +0,0 @@ -# EventEmitter2 - -EventEmitter2 is an implementation of the EventEmitter found in Node.js - -## Features - - - Namespaces/Wildcards. - - Times To Listen (TTL), extends the `once` concept with `many`. - - Browser environment compatibility. - - Demonstrates good performance in benchmarks - -``` -EventEmitterHeatUp x 3,728,965 ops/sec \302\2610.68% (60 runs sampled) -EventEmitter x 2,822,904 ops/sec \302\2610.74% (63 runs sampled) -EventEmitter2 x 7,251,227 ops/sec \302\2610.55% (58 runs sampled) -EventEmitter2 (wild) x 3,220,268 ops/sec \302\2610.44% (65 runs sampled) -Fastest is EventEmitter2 -``` - -## Differences (Non breaking, compatible with existing EventEmitter) - - - The constructor takes a configuration object. - -```javascript - var EventEmitter2 = require('eventemitter2').EventEmitter2; - var server = new EventEmitter2({ - wildcard: true, // should the event emitter use wildcards. - delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`. - newListener: false, // if you want to emit the newListener event set to true. - maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10. - }); -``` - - - Getting the actual event that fired. - -```javascript - server.on('foo.*', function(value1, value2) { - console.log(this.event, value1, value2); - }); -``` - - - Fire an event N times and then remove it, an extension of the `once` concept. - -```javascript - server.many('foo', 4, function() { - console.log('hello'); - }); -``` - - - Pass in a namespaced event as an array rather than a delimited string. - -```javascript - server.many(['foo', 'bar', 'bazz'], function() { - console.log('hello'); - }); -``` - - -## API - -When an `EventEmitter` instance experiences an error, the typical action is -to emit an `error` event. Error events are treated as a special case. -If there is no listener for it, then the default action is to print a stack -trace and exit the program. - -All EventEmitters emit the event `newListener` when new listeners are -added. - - -**Namespaces** with **Wildcards** -To use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor. -When namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated -by a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a -constructor option. - -An event name passed to any event emitter method can contain a wild card (the `*` character). -If the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, -the wildcard may appear as `['foo', '*']`. - -If either of the above described events were passed to the `on` method, subsequent emits such -as the following would be observed... - -```javascript - emitter.emit('foo.bazz'); - emitter.emit(['foo', 'bar']); -``` - - -#### emitter.addListener(event, listener) -#### emitter.on(event, listener) - -Adds a listener to the end of the listeners array for the specified event. - -```javascript - server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) { - console.log('The event was raised!'); - }); -``` - -```javascript - server.on('data', function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.onAny(listener) - -Adds a listener that will be fired when any event is emitted. - -```javascript - server.onAny(function(value) { - console.log('All events trigger this.'); - }); -``` - -#### emitter.offAny(listener) - -Removes the listener that will be fired when any event is emitted. - -```javascript - server.offAny(function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.once(event, listener) - -Adds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.once('get', function (value) { - console.log('Ah, we have our first value!'); - }); -``` - -#### emitter.many(event, timesToListen, listener) - -Adds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.many('get', 4, function (value) { - console.log('This event will be listened to exactly four times.'); - }); -``` - - -#### emitter.removeListener(event, listener) -#### emitter.off(event, listener) - -Remove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener. - -```javascript - var callback = function(value) { - console.log('someone connected!'); - }; - server.on('get', callback); - // ... - server.removeListener('get', callback); -``` - - -#### emitter.removeAllListeners([event]) - -Removes all listeners, or those of the specified event. - - -#### emitter.setMaxListeners(n) - -By default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited. - - -#### emitter.listeners(event) - -Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.on('get', function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listeners('get')); // [ [Function] ] -``` - -#### emitter.listenersAny() - -Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.onAny(function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected! -``` - -#### emitter.emit(event, [arg1], [arg2], [...]) - -Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. - -## Test coverage - -There is a test suite that tries to cover each use case, it can be found here. - -## Licence - -(The MIT License) - -Copyright (c) 2011 hij1nx - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/index.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/index.js deleted file mode 100644 index 6f583b5..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/eventemitter2'); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/lib/eventemitter2.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/lib/eventemitter2.js deleted file mode 100644 index dc9849e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/eventemitter2/lib/eventemitter2.js +++ /dev/null @@ -1,561 +0,0 @@ -;!function(exports, undefined) { - - var isArray = Array.isArray ? Array.isArray : function _isArray(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - var defaultMaxListeners = 10; - - function init() { - this._events = {}; - if (this._conf) { - configure.call(this, this._conf); - } - } - - function configure(conf) { - if (conf) { - - this._conf = conf; - - conf.delimiter && (this.delimiter = conf.delimiter); - conf.maxListeners && (this._events.maxListeners = conf.maxListeners); - conf.wildcard && (this.wildcard = conf.wildcard); - conf.newListener && (this.newListener = conf.newListener); - - if (this.wildcard) { - this.listenerTree = {}; - } - } - } - - function EventEmitter(conf) { - this._events = {}; - this.newListener = false; - configure.call(this, conf); - } - - // - // Attention, function return type now is array, always ! - // It has zero elements if no any matches found and one or more - // elements (leafs) if there are matches - // - function searchListenerTree(handlers, type, tree, i) { - if (!tree) { - return []; - } - var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached, - typeLength = type.length, currentType = type[i], nextType = type[i+1]; - if (i === typeLength && tree._listeners) { - // - // If at the end of the event(s) list and the tree has listeners - // invoke those listeners. - // - if (typeof tree._listeners === 'function') { - handlers && handlers.push(tree._listeners); - return [tree]; - } else { - for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) { - handlers && handlers.push(tree._listeners[leaf]); - } - return [tree]; - } - } - - if ((currentType === '*' || currentType === '**') || tree[currentType]) { - // - // If the event emitted is '*' at this part - // or there is a concrete match at this patch - // - if (currentType === '*') { - for (branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1)); - } - } - return listeners; - } else if(currentType === '**') { - endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*')); - if(endReached && tree._listeners) { - // The next element has a _listeners, add it to the handlers. - listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength)); - } - - for (branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - if(branch === '*' || branch === '**') { - if(tree[branch]._listeners && !endReached) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength)); - } - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i)); - } else if(branch === nextType) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2)); - } else { - // No match on this one, shift into the tree but not in the type array. - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i)); - } - } - } - return listeners; - } - - listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1)); - } - - xTree = tree['*']; - if (xTree) { - // - // If the listener tree will allow any match for this part, - // then recursively explore all branches of the tree - // - searchListenerTree(handlers, type, xTree, i+1); - } - - xxTree = tree['**']; - if(xxTree) { - if(i < typeLength) { - if(xxTree._listeners) { - // If we have a listener on a '**', it will catch all, so add its handler. - searchListenerTree(handlers, type, xxTree, typeLength); - } - - // Build arrays of matching next branches and others. - for(branch in xxTree) { - if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) { - if(branch === nextType) { - // We know the next element will match, so jump twice. - searchListenerTree(handlers, type, xxTree[branch], i+2); - } else if(branch === currentType) { - // Current node matches, move into the tree. - searchListenerTree(handlers, type, xxTree[branch], i+1); - } else { - isolatedBranch = {}; - isolatedBranch[branch] = xxTree[branch]; - searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1); - } - } - } - } else if(xxTree._listeners) { - // We have reached the end and still on a '**' - searchListenerTree(handlers, type, xxTree, typeLength); - } else if(xxTree['*'] && xxTree['*']._listeners) { - searchListenerTree(handlers, type, xxTree['*'], typeLength); - } - } - - return listeners; - } - - function growListenerTree(type, listener) { - - type = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - - // - // Looks for two consecutive '**', if so, don't add the event at all. - // - for(var i = 0, len = type.length; i+1 < len; i++) { - if(type[i] === '**' && type[i+1] === '**') { - return; - } - } - - var tree = this.listenerTree; - var name = type.shift(); - - while (name) { - - if (!tree[name]) { - tree[name] = {}; - } - - tree = tree[name]; - - if (type.length === 0) { - - if (!tree._listeners) { - tree._listeners = listener; - } - else if(typeof tree._listeners === 'function') { - tree._listeners = [tree._listeners, listener]; - } - else if (isArray(tree._listeners)) { - - tree._listeners.push(listener); - - if (!tree._listeners.warned) { - - var m = defaultMaxListeners; - - if (typeof this._events.maxListeners !== 'undefined') { - m = this._events.maxListeners; - } - - if (m > 0 && tree._listeners.length > m) { - - tree._listeners.warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - tree._listeners.length); - console.trace(); - } - } - } - return true; - } - name = type.shift(); - } - return true; - } - - // By default EventEmitters will print a warning if more than - // 10 listeners are added to it. This is a useful default which - // helps finding memory leaks. - // - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - - EventEmitter.prototype.delimiter = '.'; - - EventEmitter.prototype.setMaxListeners = function(n) { - this._events || init.call(this); - this._events.maxListeners = n; - if (!this._conf) this._conf = {}; - this._conf.maxListeners = n; - }; - - EventEmitter.prototype.event = ''; - - EventEmitter.prototype.once = function(event, fn) { - this.many(event, 1, fn); - return this; - }; - - EventEmitter.prototype.many = function(event, ttl, fn) { - var self = this; - - if (typeof fn !== 'function') { - throw new Error('many only accepts instances of Function'); - } - - function listener() { - if (--ttl === 0) { - self.off(event, listener); - } - fn.apply(this, arguments); - } - - listener._origin = fn; - - this.on(event, listener); - - return self; - }; - - EventEmitter.prototype.emit = function() { - - this._events || init.call(this); - - var type = arguments[0]; - - if (type === 'newListener' && !this.newListener) { - if (!this._events.newListener) { return false; } - } - - // Loop through the *_all* functions and invoke them. - if (this._all) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - for (i = 0, l = this._all.length; i < l; i++) { - this.event = type; - this._all[i].apply(this, args); - } - } - - // If there is no 'error' event listener then throw. - if (type === 'error') { - - if (!this._all && - !this._events.error && - !(this.wildcard && this.listenerTree.error)) { - - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - var handler; - - if(this.wildcard) { - handler = []; - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - searchListenerTree.call(this, handler, ns, this.listenerTree, 0); - } - else { - handler = this._events[type]; - } - - if (typeof handler === 'function') { - this.event = type; - if (arguments.length === 1) { - handler.call(this); - } - else if (arguments.length > 1) - switch (arguments.length) { - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - handler.apply(this, args); - } - return true; - } - else if (handler) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - this.event = type; - listeners[i].apply(this, args); - } - return (listeners.length > 0) || this._all; - } - else { - return this._all; - } - - }; - - EventEmitter.prototype.on = function(type, listener) { - - if (typeof type === 'function') { - this.onAny(type); - return this; - } - - if (typeof listener !== 'function') { - throw new Error('on only accepts instances of Function'); - } - this._events || init.call(this); - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if(this.wildcard) { - growListenerTree.call(this, type, listener); - return this; - } - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } - else if(typeof this._events[type] === 'function') { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - else if (isArray(this._events[type])) { - // If we've already got an array, just append. - this._events[type].push(listener); - - // Check for listener leak - if (!this._events[type].warned) { - - var m = defaultMaxListeners; - - if (typeof this._events.maxListeners !== 'undefined') { - m = this._events.maxListeners; - } - - if (m > 0 && this._events[type].length > m) { - - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - } - return this; - }; - - EventEmitter.prototype.onAny = function(fn) { - - if(!this._all) { - this._all = []; - } - - if (typeof fn !== 'function') { - throw new Error('onAny only accepts instances of Function'); - } - - // Add the function to the event listener collection. - this._all.push(fn); - return this; - }; - - EventEmitter.prototype.addListener = EventEmitter.prototype.on; - - EventEmitter.prototype.off = function(type, listener) { - if (typeof listener !== 'function') { - throw new Error('removeListener only takes instances of Function'); - } - - var handlers,leafs=[]; - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - } - else { - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events[type]) return this; - handlers = this._events[type]; - leafs.push({_listeners:handlers}); - } - - for (var iLeaf=0; iLeaf 0) { - fns = this._all; - for(i = 0, l = fns.length; i < l; i++) { - if(fn === fns[i]) { - fns.splice(i, 1); - return this; - } - } - } else { - this._all = []; - } - return this; - }; - - EventEmitter.prototype.removeListener = EventEmitter.prototype.off; - - EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - !this._events || init.call(this); - return this; - } - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - var leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - - for (var iLeaf=0; iLeaf= 0.2.2" - }, - "main": "./lib/eventemitter2.js", - "scripts": { - "test": "nodeunit test/simple/ && nodeunit test/wildcardEvents/", - "benchmark": "node test/perf/benchmark.js" - }, - "files": [ - "lib/eventemitter2.js", - "index.js" - ], - "readme": "# EventEmitter2\n\nEventEmitter2 is an implementation of the EventEmitter found in Node.js\n\n## Features\n\n - Namespaces/Wildcards.\n - Times To Listen (TTL), extends the `once` concept with `many`.\n - Browser environment compatibility.\n - Demonstrates good performance in benchmarks\n\n```\nEventEmitterHeatUp x 3,728,965 ops/sec \\302\\2610.68% (60 runs sampled)\nEventEmitter x 2,822,904 ops/sec \\302\\2610.74% (63 runs sampled)\nEventEmitter2 x 7,251,227 ops/sec \\302\\2610.55% (58 runs sampled)\nEventEmitter2 (wild) x 3,220,268 ops/sec \\302\\2610.44% (65 runs sampled)\nFastest is EventEmitter2\n```\n\n## Differences (Non breaking, compatible with existing EventEmitter)\n\n - The constructor takes a configuration object.\n \n```javascript\n var EventEmitter2 = require('eventemitter2').EventEmitter2;\n var server = new EventEmitter2({\n wildcard: true, // should the event emitter use wildcards.\n delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`.\n newListener: false, // if you want to emit the newListener event set to true.\n maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10.\n });\n```\n\n - Getting the actual event that fired.\n\n```javascript\n server.on('foo.*', function(value1, value2) {\n console.log(this.event, value1, value2);\n });\n```\n\n - Fire an event N times and then remove it, an extension of the `once` concept.\n\n```javascript\n server.many('foo', 4, function() {\n console.log('hello');\n });\n```\n\n - Pass in a namespaced event as an array rather than a delimited string.\n\n```javascript\n server.many(['foo', 'bar', 'bazz'], function() {\n console.log('hello');\n });\n```\n\n\n## API\n\nWhen an `EventEmitter` instance experiences an error, the typical action is\nto emit an `error` event. Error events are treated as a special case.\nIf there is no listener for it, then the default action is to print a stack\ntrace and exit the program.\n\nAll EventEmitters emit the event `newListener` when new listeners are\nadded.\n\n\n**Namespaces** with **Wildcards**\nTo use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor.\nWhen namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated\nby a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a \nconstructor option.\n\nAn event name passed to any event emitter method can contain a wild card (the `*` character).\nIf the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, \nthe wildcard may appear as `['foo', '*']`.\n\nIf either of the above described events were passed to the `on` method, subsequent emits such \nas the following would be observed...\n\n```javascript\n emitter.emit('foo.bazz');\n emitter.emit(['foo', 'bar']);\n```\n\n\n#### emitter.addListener(event, listener)\n#### emitter.on(event, listener)\n\nAdds a listener to the end of the listeners array for the specified event.\n\n```javascript\n server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) {\n console.log('The event was raised!');\n });\n```\n\n```javascript\n server.on('data', function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.onAny(listener)\n\nAdds a listener that will be fired when any event is emitted.\n\n```javascript\n server.onAny(function(value) {\n console.log('All events trigger this.');\n });\n```\n\n#### emitter.offAny(listener)\n\nRemoves the listener that will be fired when any event is emitted.\n\n```javascript\n server.offAny(function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.once(event, listener)\n\nAdds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.once('get', function (value) {\n console.log('Ah, we have our first value!');\n });\n```\n\n#### emitter.many(event, timesToListen, listener)\n\nAdds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.many('get', 4, function (value) {\n console.log('This event will be listened to exactly four times.');\n });\n```\n\n\n#### emitter.removeListener(event, listener)\n#### emitter.off(event, listener)\n\nRemove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener.\n\n```javascript\n var callback = function(value) {\n console.log('someone connected!');\n };\n server.on('get', callback);\n // ...\n server.removeListener('get', callback);\n```\n\n\n#### emitter.removeAllListeners([event])\n\nRemoves all listeners, or those of the specified event.\n\n\n#### emitter.setMaxListeners(n)\n\nBy default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited.\n\n\n#### emitter.listeners(event)\n\nReturns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.on('get', function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listeners('get')); // [ [Function] ]\n```\n\n#### emitter.listenersAny()\n\nReturns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.onAny(function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected!\n```\n\n#### emitter.emit(event, [arg1], [arg2], [...])\n\nExecute each of the listeners that may be listening for the specified event name in order with the list of arguments.\n\n## Test coverage\n\nThere is a test suite that tries to cover each use case, it can be found here.\n\n## Licence\n\n(The MIT License)\n\nCopyright (c) 2011 hij1nx \n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/hij1nx/EventEmitter2/issues" - }, - "_id": "eventemitter2@0.4.13", - "_from": "eventemitter2@~0.4.9" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.jshintrc b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.jshintrc deleted file mode 100644 index 1c2f5ea..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - asi: false -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.npmignore deleted file mode 100644 index 3a4f11c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -/node_modules -/lib/phantom -/lib/location.js -/tmp -npm-debug.log diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.travis.yml b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.travis.yml deleted file mode 100644 index 0175d82..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.6" - - "0.8" - - "0.10" diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/LICENSE.txt b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/LICENSE.txt deleted file mode 100644 index 55e332a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/LICENSE.txt +++ /dev/null @@ -1,194 +0,0 @@ -Copyright 2012 The Obvious Corporation. -http://obvious.com/ - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - -------------------------------------------------------------------------- - 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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/README.md deleted file mode 100644 index 73787a2..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/README.md +++ /dev/null @@ -1,122 +0,0 @@ -phantom -======= - -An NPM wrapper for [PhantomJS](http://phantomjs.org/), headless webkit with JS API. - -Building and Installing ------------------------ - -```shell -npm install phantomjs -``` - -Or grab the source and - -```shell -node ./install.js -``` - -What this is really doing is just grabbing a particular "blessed" (by -this module) version of Phantom. As new versions of Phantom are released -and vetted, this module will be updated accordingly. - -The package has been set up to fetch and run Phantom for MacOS (darwin), -Linux based platforms (as identified by nodejs), and -- as of version 0.2.0 -- -Windows (thanks to [Domenic Denicola](https://github.com/domenic)). If you -spot any platform weirdnesses, let us know or send a patch. - -Running -------- - -```shell -bin/phantom [phantom arguments] -``` - -And npm will install a link to the binary in `node_modules/.bin` as -it is wont to do. - -Running via node ----------------- - -The package exports a `path` string that contains the path to the -phantomjs binary/executable. - -Below is an example of using this package via node. - -```javascript -var childProcess = require('child_process') -var phantomjs = require('phantomjs') -var binPath = phantomjs.path - -var childArgs = [ - path.join(__dirname, 'phantomjs-script.js'), - 'some other argument (passed to phantomjs script)' -] - -childProcess.execFile(binPath, childArgs, function(err, stdout, stderr) { - // handle results -}) - -``` - -Versioning ----------- - -The NPM package version tracks the version of PhantomJS that will be installed, -with an additional build number that is used for revisions to the installer. - -As such `1.8.0-1` will `1.8.0-2` will both install PhantomJs 1.8 but the latter -has newer changes to the installer. - -A Note on PhantomJS -------------------- - -PhantomJS is not a library for NodeJS. It's a separate environment and code -written for node is unlikely to be compatible. In particular PhantomJS does -not expose a Common JS package loader. - -This is an _NPM wrapper_ and can be used to conveniently make Phantom available -It is not a Node JS wrapper. - -I have had reasonable experiences writing standalone Phantom scripts which I -then drive from within a node program by spawning phantom in a child process. - -Read the PhantomJS FAQ for more details: http://phantomjs.org/faq.html - -### Linux Note - -An extra note on Linux usage, from the PhantomJS download page: - - > This package is built on CentOS 5.8. It should run successfully on Lucid or - > more modern systems (including other distributions). There is no requirement - > to install Qt, WebKit, or any other libraries. It is however expected that - > some base libraries necessary for rendering (FreeType, Fontconfig) and the - > basic font files are available in the system. - -Contributing ------------- - -Questions, comments, bug reports, and pull requests are all welcome. Submit them at -[the project on GitHub](https://github.com/Obvious/phantomjs/). If you haven't contributed to an -[Obvious](http://github.com/Obvious/) project before please head over to the -[Open Source Project](https://github.com/Obvious/open-source#note-to-external-contributors) and fill -out an OCLA (it should be pretty painless). - -Bug reports that include steps-to-reproduce (including code) are the -best. Even better, make them in the form of pull requests. - -Author ------- - -[Dan Pupius](https://github.com/dpup) -([personal website](http://pupius.co.uk)), supported by -[The Obvious Corporation](http://obvious.com/). - -License -------- - -Copyright 2012 [The Obvious Corporation](http://obvious.com/). - -Licensed under the Apache License, Version 2.0. -See the top-level file `LICENSE.txt` and -(http://www.apache.org/licenses/LICENSE-2.0). diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/bin/phantomjs b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/bin/phantomjs deleted file mode 100755 index 7fe352a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/bin/phantomjs +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env node - -/** - * Script that will execute the downloaded phantomjs binary. stdio are - * forwarded to and from the child process. - * - * The following is for an ugly hack to avoid a problem where the installer - * finds the bin script npm creates during global installation. - * - * {NPM_INSTALL_MARKER} - */ - -var path = require('path') -var spawn = require('child_process').spawn - -var binPath = require(path.join(__dirname, '..', 'lib', 'phantomjs')).path - -var args = process.argv.slice(2) - -// For Node 0.6 compatibility, pipe the streams manually, instead of using -// `{ stdio: 'inherit' }`. -var cp = spawn(binPath, args) -cp.stdout.pipe(process.stdout) -cp.stderr.pipe(process.stderr) -process.stdin.pipe(cp.stdin) - -cp.on('error', function (err) { - console.error('Error executing phantom at', binPath) - console.error(err.stack) -}) -cp.on('exit', process.exit) - -process.on('SIGTERM', function() { - cp.kill('SIGTERM') - process.exit(1) -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/install.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/install.js deleted file mode 100644 index 499c8da..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/install.js +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright 2012 The Obvious Corporation. - -/* - * This simply fetches the right version of phantom for the current platform. - */ - -'use strict' - -var AdmZip = require('adm-zip') -var cp = require('child_process') -var fs = require('fs') -var helper = require('./lib/phantomjs') -var http = require('http') -var kew = require('kew') -var ncp = require('ncp') -var npmconf = require('npmconf') -var mkdirp = require('mkdirp') -var path = require('path') -var rimraf = require('rimraf').sync -var url = require('url') -var util = require('util') -var which = require('which') - -var downloadUrl = 'http://phantomjs.googlecode.com/files/phantomjs-' + helper.version + '-' - -var originalPath = process.env.PATH - -// NPM adds bin directories to the path, which will cause `which` to find the -// bin for this package not the actual phantomjs bin. Also help out people who -// put ./bin on their path -process.env.PATH = helper.cleanPath(originalPath) - -var libPath = path.join(__dirname, 'lib') -var pkgPath = path.join(libPath, 'phantom') -var phantomPath = null -var tmpPath = null - -var whichDeferred = kew.defer() -which('phantomjs', whichDeferred.makeNodeResolver()) -whichDeferred.promise - .then(function (path) { - phantomPath = path - - // Horrible hack to avoid problems during global install. We check to see if - // the file `which` found is our own bin script. - // See: https://github.com/Obvious/phantomjs/issues/85 - if (/NPM_INSTALL_MARKER/.test(fs.readFileSync(phantomPath, 'utf8'))) { - console.log('Looks like an `npm install -g`; unable to check for already installed version.') - throw new Error('Global install') - - } else { - var checkVersionDeferred = kew.defer() - cp.execFile(phantomPath, ['--version'], checkVersionDeferred.makeNodeResolver()) - return checkVersionDeferred.promise - } - }) - .then(function (stdout) { - var version = stdout.trim() - if (helper.version == version) { - writeLocationFile(phantomPath) - console.log('PhantomJS is already installed at', phantomPath + '.') - exit(0) - - } else { - console.log('PhantomJS detected, but wrong version', stdout.trim(), '@', phantomPath + '.') - throw new Error('Wrong version') - } - }) - .fail(function (err) { - // Trying to use a local file failed, so initiate download and install - // steps instead. - var npmconfDeferred = kew.defer() - npmconf.load(npmconfDeferred.makeNodeResolver()) - return npmconfDeferred.promise - }) - .then(function (conf) { - tmpPath = findSuitableTempDirectory(conf) - - // Can't use a global version so start a download. - if (process.platform === 'linux' && process.arch === 'x64') { - downloadUrl += 'linux-x86_64.tar.bz2' - } else if (process.platform === 'linux') { - downloadUrl += 'linux-i686.tar.bz2' - } else if (process.platform === 'darwin') { - downloadUrl += 'macosx.zip' - } else if (process.platform === 'win32') { - downloadUrl += 'windows.zip' - } else { - console.log('Unexpected platform or architecture:', process.platform, process.arch) - exit(1) - } - - var fileName = downloadUrl.split('/').pop() - var downloadedFile = path.join(tmpPath, fileName) - - // Start the install. - if (!fs.existsSync(downloadedFile)) { - console.log('Downloading', downloadUrl) - console.log('Saving to', downloadedFile) - return requestBinary(getRequestOptions(conf.get('proxy')), downloadedFile) - } else { - console.log('Download already available at', downloadedFile) - return downloadedFile - } - }) - .then(function (downloadedFile) { - return extractDownload(downloadedFile) - }) - .then(function (extractedPath) { - return copyIntoPlace(extractedPath, pkgPath) - }) - .then(function () { - var location = process.platform === 'win32' ? - path.join(pkgPath, 'phantomjs.exe') : - path.join(pkgPath, 'bin' ,'phantomjs') - var relativeLocation = path.relative(libPath, location) - writeLocationFile(relativeLocation) - console.log('Done. Phantomjs binary available at', location) - exit(0) - }) - .fail(function (err) { - console.error('Phantom installation failed', err, err.stack) - exit(1) - }) - - -function writeLocationFile(location) { - console.log('Writing location.js file') - if (process.platform === 'win32') { - location = location.replace(/\\/g, '\\\\') - } - fs.writeFileSync(path.join(libPath, 'location.js'), - 'module.exports.location = "' + location + '"') -} - - -function exit(code) { - process.env.PATH = originalPath - process.exit(code || 0) -} - - -function findSuitableTempDirectory(npmConf) { - var now = Date.now() - var candidateTmpDirs = [ - process.env.TMPDIR || '/tmp', - npmConf.get('tmp'), - path.join(process.cwd(), 'tmp') - ] - - for (var i = 0; i < candidateTmpDirs.length; i++) { - var candidatePath = path.join(candidateTmpDirs[i], 'phantomjs') - - try { - mkdirp.sync(candidatePath, '0777') - // Make double sure we have 0777 permissions; some operating systems - // default umask does not allow write by default. - fs.chmodSync(candidatePath, '0777') - var testFile = path.join(candidatePath, now + '.tmp') - fs.writeFileSync(testFile, 'test') - fs.unlinkSync(testFile) - return candidatePath - } catch (e) { - console.log(candidatePath, 'is not writable:', e.message) - } - } - - console.error('Can not find a writable tmp directory, please report issue ' + - 'on https://github.com/Obvious/phantomjs/issues/59 with as much ' + - 'information as possible.') - exit(1) -} - - -function getRequestOptions(proxyUrl) { - if (proxyUrl) { - var options = url.parse(proxyUrl) - options.path = downloadUrl - options.headers = { Host: url.parse(downloadUrl).host } - // If going through proxy, spoof the User-Agent, since may commerical proxies block blank or unknown agents in headers - options.headers['User-Agent'] = 'curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5' - // Turn basic authorization into proxy-authorization. - if (options.auth) { - options.headers['Proxy-Authorization'] = 'Basic ' + new Buffer(options.auth).toString('base64') - delete options.auth - } - - return options - } else { - return url.parse(downloadUrl) - } -} - - -function requestBinary(requestOptions, filePath) { - var deferred = kew.defer() - - var count = 0 - var notifiedCount = 0 - var writePath = filePath + '-download-' + Date.now() - var outFile = fs.openSync(writePath, 'w') - - var client = http.get(requestOptions, function (response) { - var status = response.statusCode - console.log('Receiving...') - - if (status === 200) { - response.addListener('data', function (data) { - fs.writeSync(outFile, data, 0, data.length, null) - count += data.length - if ((count - notifiedCount) > 800000) { - console.log('Received ' + Math.floor(count / 1024) + 'K...') - notifiedCount = count - } - }) - - response.addListener('end', function () { - console.log('Received ' + Math.floor(count / 1024) + 'K total.') - fs.closeSync(outFile) - fs.renameSync(writePath, filePath) - deferred.resolve(filePath) - }) - - } else { - client.abort() - console.error('Error requesting archive') - deferred.reject(new Error('Error with http request: ' + util.inspect(response.headers))) - } - }) - - return deferred.promise -} - - -function extractDownload(filePath) { - var deferred = kew.defer() - // extract to a unique directory in case multiple processes are - // installing and extracting at once - var extractedPath = filePath + '-extract-' + Date.now() - var options = {cwd: extractedPath} - - mkdirp.sync(extractedPath, '0777') - // Make double sure we have 0777 permissions; some operating systems - // default umask does not allow write by default. - fs.chmodSync(extractedPath, '0777') - - if (filePath.substr(-4) === '.zip') { - console.log('Extracting zip contents') - - try { - var zip = new AdmZip(filePath) - zip.extractAllTo(extractedPath, true) - deferred.resolve(extractedPath) - } catch (err) { - console.error('Error extracting archive') - deferred.reject(err) - } - - } else { - console.log('Extracting tar contents (via spawned process)') - cp.execFile('tar', ['jxf', filePath], options, function (err, stdout, stderr) { - if (err) { - console.error('Error extracting archive') - deferred.reject(err) - } else { - deferred.resolve(extractedPath) - } - }) - } - return deferred.promise -} - - -function copyIntoPlace(extractedPath, targetPath) { - rimraf(targetPath) - - var deferred = kew.defer() - // Look for the extracted directory, so we can rename it. - var files = fs.readdirSync(extractedPath) - for (var i = 0; i < files.length; i++) { - var file = path.join(extractedPath, files[i]) - if (fs.statSync(file).isDirectory() && file.indexOf(helper.version) != -1) { - console.log('Renaming extracted folder', file, '->', targetPath) - ncp(file, targetPath, deferred.makeNodeResolver()) - break - } - } - - // Cleanup extracted directory after it's been copied - return deferred.promise.then(function() { - return rimraf(extractedPath) - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/location.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/location.js deleted file mode 100644 index 420cdfc..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/location.js +++ /dev/null @@ -1 +0,0 @@ -module.exports.location = "phantom/bin/phantomjs" \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/ChangeLog b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/ChangeLog deleted file mode 100644 index 603f5eb..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/ChangeLog +++ /dev/null @@ -1,346 +0,0 @@ -Please see also http://phantomjs.org/releases.html. - -2013-09-06: Version 1.9.2 - - * Fixed graphical artifacts with transparent background on Windows (issue 11276, 11007, 11366) - * Updated GhostDriver to version 1.0.4 (issue 11452) - -2013-06-04: Version 1.9.1 - - Critical bug fixes: - - * Fixed problems with specifying proxy server (issue 10811, 11117) - * Fixed UTF-8 encoding with system.stdout and system.stderr (issue 11162) - * Ensured that onResourceReceived will be always invoked (issue 11163) - * Fixed module loading from an absolute path on Windows (issue 11165) - * Fixed typo in the command-line option for setting the cache size (11219) - * Fixed possible crash when handling network requests (issue 11252, 11388) - -2013-03-20: Version 1.9.0 "Sakura" - - New features - - * Added spawn and execFile to execute external programs (issue 10219) - * Added the ability to abort network requests (issue 10230) - * Added system access to stdin, stdout, and stderr (issue 10333) - * Added support for custom CA certificates location (issue 10916) - * Added seek function to the File stream (issue 10937) - * Implemented file read for a specified number of bytes (issue 10938) - * Added a callback to handle network error (issue 10954, 10997) - * Added custom encoding support when opening a page (issue 11043) - * Implemented require.stub() support for a factory function (issue 11044) - * Added page loading indicator and progress (issue 11091) - * Added a timeout option for network requests (issue 11129) - - Improvements - - * Fixed the build on FreeBSD (issue 10597) - * Ensured a consistent 72 dpi for Linux headless rendering (issue 10659) - * Fixed possible PDF error due to invalid CreationDate field (issue 10663) - * Fixed crash when uploading non existing files (issue 10941) - * Improved the autocomplete internal of the interactive/REPL mode (issue 10943) - * Fixed possible crash when accessing inline frames (issue 10947) - * Changed Linux binary package setup to be built on CentOS 5 (issue 10963) - * Extended SSL ignore setting to synchronous XHR (issue 10985) - * Added convenient constants for modifier keys (issue 11056) - * Fixed incorrect date handling in the cookies (issue 11068) - * Updated GhostDriver to version 1.0.3 (issue 11146) - - Examples - - * Fixed invalid data URI in the netsniff example (issue 10740) - * Implemented a new weather example (issue 10794) - * Fixed rendering issues in render_multi_url (issue 11021) - * Fixed proper event sequence in page_events example (issue 11028) - * Miscellanous tweaks (issue 11082) - -2013-03-02: Version 1.8.2 - - Critical bug fixes: - - * Fixed possible PDF error due to invalid CreationDate field (issue 663) - * Fixed crash when uploading non existing files (issue 941) - * Fixed possible crash when accessing inline frames (issue 947) - * Extended SSL ignore setting to synchronous XHR (issue 985) - * Fixed incorrect date handling in the cookies (issue 1068) - -2013-01-06: Version 1.8.1 - - Critical bug fix: - - * Mac OS X: Fix possible crash when using some TrueType fonts (issue 690) - -2012-12-21: Version 1.8.0 "Blue Winter Rose" - - New features - - * Integrated GhostDriver as the WebDriver implementation (issue 49) - * Added an option to specify the SSL protocol (issue 174) - * Added encoding support for WebServer's response (issue 505) - * Added process ID (PID) to the System module (issue 769) - * Added properties to obtain page and frame title (issue 799) - * Added page navigation methods (issue 808) - * Added support for modifier keys in keyboard events (issue 835) - * Added onFilePicker callback for more generic file upload API (issue 843) - * Added the ability to set the page content and location (issue 909) - - Improvements - - * Fixed date parsing in ISO8601 format (issue 187, 267) - * Fixed window.location (issue 530, 632) - * Deregistered multiple callback handler (issue 807) - * Fixed sending of double-click events (issue 848) - * Increases maximum number of redirects (issue 849) - * Fixed keycodes sent for lowercase characters (issue 852) - * Fixed a regression in table row page break (issue 880) - * Completed the CoffeeScript version of the examples (issue 907) - * Updated Qt to version 4.8.4 (issue 918) - * Fixed potential hang in some example scripts (issue 922) - -2012-09-22: Version 1.7.0 "Blazing Star" - - New features - - * Added a module system modelled after CommonJS/Node.js (issue 47) - * Added support for window pop-up (issue 151) - * Static build on Linux (issue 413) - * Added run-time detection of SSL support (issue 484) - * Added more events support (issue 492, 712) - * Added support for disabling automatic proxy detection (issue 580) - * Provided page closing callback (issue 678) - * Added methods to access URL, frames URL, frame Content (issue 758) - * Added more cookies-related API (issue 761) - - Improvements - - * Refactored command-line options handling (issue 55) - * Improved the workflow for producing release builds (issue 599) - * Improved cookies API and implementation (issue 603, 761) - * Improved frame switching API (issue 654) - * Fixed iframe handling regression (issue 683) - * Fixed OS version number with Windows 8 and Mountain Lion (issue 684, 688) - * Fixed HAR navigation info in the netsniff example (issue 733) - * Fixed compile warnings with Visual Studio (issue 744) - * Removed hacks for static linking on Windows (issue 753) - * Added ICO image handling on Windows (issue 779) - * Fixed font antialiasing on Windows (issue 785) - * Improved Jasmine test runner for Jasmine 1.2 (issue 792) - -2012-07-22: Version 1.6.1 - - Bug fixes - - * Don't build the deploy in debug mode (issue 599) - * Fixed building on Windows (issue 424) - * Fixed remote inspector when building statically (issue 430) - -2012-06-20: Version 1.6.0 "Lavender" - - New features - - * Added support for passing arguments to WebPage's evaluate (issue 132) - * Added callbacks for JavaScript onConfirm and onPrompt (issue 133) - * Added stack trace when error occurs (issue 166) - * Added support for local storage path and quota (issue 300) - * Added initial support for cookies handling (issue 354) - * Added support for header footer when printing the page (issue 410, 512) - * Added headers support in the loading request (issue 452) - * Added support to render the web page as base64-encoded string (issue 547) - * Added hooks for navigation event (issue 562) - * Added command-line option to show debug messages (issue 575) - * Added support for the zoom factor for web page rendering (issue 579) - * Added crash reporter for Mac OS X and Linux, based on Google Breakpad (issue 576) - * Added 'os' object to the system module (issue 585) - * Added support for asynchronous evaluation (issue 593) - - Improvements - - * Fixed remote debugging to work on Mac OS X and Windows (issue 430) - * Fixed web server getting the dropped connection for empty response (issue 451) - * Fixed text rendered as boxes (squares) on headless Linux (issue 460) - * Updated Qt to version 4.8.2 (issue 495) - * Updated CoffeeScript compiler to version 1.3.3 (issue 496) - * Fixed the build script to detect and use MAKEFLAGS (issue 503) - * Fixed the build script to properly pass Qt config flags (issue 507) - * Changed Info.plist to be embedded in Mac OS X executable (issue 528) - * Fixed wrong module require in the imagebin example (issue 536) - * Fixed example scripts to exit with the right exit code (issue 544) - * Fixed build failure with glib 2.31.0+ (issue 559) - * Fixed error handler failures in some cases (issue 589) - * Fixed Twitter-related examples to work with the new site (issue 609) - -2012-03-20: Version 1.5.0 "Ghost Flower" - - New features - - * Added interactive mode, also known as REPL (issue 252) - * Added setting for web security, to allow cross domain XHR (issue 28) - * Added error handler for WebPage object (issue 166) - * Added support for custom HTTP header in the network request (issue 77) - * Added support for read write encoding in the file system module (issue 367) - * Added remote debugging support on Linux (issue 6) - * Added support for proxy authentication (issue 105) - * Added System module, to retrieve environment variables (issue 271) and arguments (issue 276) - * Added fs.readLink function (issue 329) - * Added support for reading and writing binary data (issue 400) - * Added support to retrieve request data in the WebServer? module (issue 340) - * Added support for individual top/bottom/left/right print margins (issue 388) - * Added command-line option --help (issue 347) - * Added short command-line options -v and -h (issue 408) - * Removed support for Flash and other plugins (issue 418) - - Bug fixes - - * Fixed multiple console.log arguments (issue 36) - * Fixed file upload (issue 307) - * Fixed the web server instance to be asynchronous (issue 326) and still support Keep Alive (issue 416) - * Workaround Qt 4.8.0 crash due to empty URL scheme (issue 365) - * Fixed a Content-Type problem where POST does not work (issue 337) - * Fixed reading body request in the web server even without specific Content-Type (issue 439) - * Fixed Jasmine test runner with Jasmine 1.1 (issue 402) - * Fixed request URL formatting in the web server (issue 437) - * Don't display debugging and warning messages (issue 323) - -2011-12-31: Version 1.4.1 - - Bug fixes - - * Fix setting the proxy type (issue 266) - * Workaround for file upload regression (issue 307) - * Fix extraneous messsages in non-debug mode (issue 323) - -2011-12-22: Version 1.4.0 "Glory of the Snow" - - New features - - * Added embedded HTTP server (issue 115) - * Added convenient build script for Linux (issue 197) - * Added support for SOCKS5 proxy (issue 266) - * Updated CoffeeScript compiler to version 1.2 (issue 312) - - Bug fixes - - * Fix potential crash in QUrl with Qt 4.8 (issue 304) - * Fix bug in CookieJar with QSettings and string (PyPhantomJS issue 10) - * Prevent showing the icon on Mac OS X Dock (issue 281) - - Examples - - * Added a new example to detect browsers sniffing (issue 263) - * Added HTTP server example (issue 115) - -2011-09-23: Version 1.3.0 "Water Lily" - - Bug fixes - - * Fixed open() and POST method, without specifying the finished handler - * Fixed script execution warning dialog (issue 165) - * Added WebPage.release() to free the web page from memory (issue 154) - * Added special handling of about:blank (issue 235) - * Made a separate network access manager for each page (issue 190) - - New features - - * Introduced file system API based on CommonJS Filesystem proposal (issue 129) - * Added support for persistent cookies (issue 91) - * Added event handling, currently only for mouse events (issue 234) - * Added page scroll position (issue 162) - * Added HTTP authentication support (issue 45) - * Added callback for page initialization (issue 143) - * Added support to specify script and output encoding (issue 186) - * Added option to allow local content to do cross-domain access (issue 28) - * Added support to apply configurations from a JSON file (issue 180) - * Added a convenient WebPage initialization construction (issue 206) - * Added option to limit the size of disk cache (issue 220) - - Examples - - * Added a new example on using Modernizr to detect features (issue 144) - * Fixed pizza.js example to use Mobile Yelp (issue 200) - * Fixed netsniff.coffee example due to wrong indentation (issue 225) - * Added an example to show live network traffic (issue 227) - * Added an example demonstrating different output encodings (issue 186) - -2011-06-21: Version 1.2.0 "Birds of Paradise" - - Version 1.2.0 is a major update. It introduces a whole set of new API. - - Bug fixes - - * Fixed rendering a very large web page (issue 54) - * Fixed reporting of CoffeeScript compile error (issue 125) - - New features - - * Added callback for console message (issue 12) - * Improved security model via WebPage object (issue 41) - * Added support for POST, HEAD, PUT, and DELETE (issue 88) - * Scripts filename is now passed as phantom.scriptName - * Added callback to capture resource requests and responses (issue 2) - * Added the ability to load external JavaScript (issue 32) - - Examples - - * Ported examples to use WebPage object - * Added a new example to upload an image to imagebin.org - * Added a new example to show HTTP POST feature - * Added a new example to sniff network traffic and save it in HAR format - - -2011-04-27: Version 1.1.0 "Cherry Blossom" - - Fixed the script loading to use UTF-8 encoding (Yasuhiro Matsumoto). - - Added check for system proxy setting (Yasuhiro Matsumoto). - - Fixed building with Cygwin and Qt 4.5 (John Dalton). - - Added a new example: driver for QUnit tests (Łukasz Korecki). - - Fixed issue #20: problem with JPG transparent color (Alessandro Portale). - - Fixed issue #9: ignore first line starting with #! (Matthias, aka fourplusone). - - Fixed issue #7: support for file upload for form submission (Matthias, aka fourplusone). - - Fixed issue #35: support for disabling images loading (Ariya Hidayat). - - Fixed issue #14: enable or disable plugins (Ariya Hidayat). - - Added a new example: using Canvas to produce the color wheel (Ariya Hidayat). - - Added support for rasterizing as GIF image (Ariya Hidayat). - - Added support for CoffeeScript (Ariya Hidayat). - - Fixed issue #19: option for setting the proxy (Clint Berry, Ariya Hidayat). - - Python implementation using PyQt (James Roe). - - Fixed issue #17: Specify paper size for PDF export (Alessandro Portale). - - Fixed issue #60: Win32 and OS/2 icon files (Salvador Parra Camacho). - - Added clipping rectangle to the render function (Wouter de Bie). - - Added an example on sychronous waiting (Gabor Torok). - - Added command line option to use disk cache (Jon Turner). - - Added text extracting example (Weston Ruter). - - Fixed issue #93: Build with Qt < 4.7 (Ariya Hidayat). - - Ported all examples to CoffeeScript (Robert Gieseke). - -2011-01-17: Version 1.0.0 - - Initial launch. - - The API is centralized at the 'phantom' object (as child of - window object) which has the properties: args, content, - loadStatus, state, userAgent, version, viewportSize, and - the following functions: exit, open, render, sleep. - - Several examples are included, among others: web page rasterizer, - weather service, headless test framework driver, and many others. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/LICENSE.BSD b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/LICENSE.BSD deleted file mode 100644 index d5dfdd1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/LICENSE.BSD +++ /dev/null @@ -1,22 +0,0 @@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL 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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/README.md deleted file mode 100644 index 752d6fc..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# [PhantomJS](http://phantomjs.org) - Scriptable Headless WebKit - -PhantomJS ([www.phantomjs.org](http://phantomjs.org)) is a headless WebKit scriptable with JavaScript or CoffeeScript. It is used by hundreds of [developers](https://github.com/ariya/phantomjs/wiki/Buzz) and dozens of [organizations](https://github.com/ariya/phantomjs/wiki/Users) for web-related development workflow. - -The latest [stable release](http://phantomjs.org/release-1.9.html) is version 1.9 (codenamed "Sakura"). Follow the official Twitter stream [@PhantomJS](http://twitter.com/PhantomJS) to get the frequent development updates. - -**Note**: Please **do not** create a GitHub pull request **without** reading the [Contribution Guide](https://github.com/ariya/phantomjs/blob/master/CONTRIBUTING.md) first. Failure to do so may result in the rejection of the pull request. - -## Use Cases - -- **Headless web testing**. Lightning-fast testing without the browser is now possible! Various [test frameworks](https://github.com/ariya/phantomjs/wiki/Headless-Testing) such as Jasmine, Capybara, QUnit, Mocha, WebDriver, YUI Test, BusterJS, FuncUnit, Robot Framework, and many others are supported. -- **Page automation**. [Access and manipulate](https://github.com/ariya/phantomjs/wiki/Page-Automation) web pages with the standard DOM API, or with usual libraries like jQuery. -- **Screen capture**. Programmatically [capture web contents](https://github.com/ariya/phantomjs/wiki/Screen-Capture), including CSs, SVG and Canvas. Build server-side web graphics apps, from a screenshot service to a vector chart rasterizer. -- **Network monitoring**. Automate performance analysis, track [page loading](https://github.com/ariya/phantomjs/wiki/Network-Monitoring) and export as standard HAR format. - -## Features - -- **Multiplatform**, available on major operating systems: Windows, Mac OS X, Linux, other Unices. -- **Fast and native implementation** of web standards: DOM, CSS, JavaScript, Canvas, SVG. No emulation! -- **Pure headless (no X11) on Linux**, ideal for continuous integration systems. Also runs on Amazon EC2, Heroku, Iron.io. -- **Easy to install**: [Download](http://phantomjs.org/download.html), unpack, and start having fun in just 5 minutes. - -## Ecosystem - -PhantomJS needs not be used only as a stand-alone tool. Check also some excellent related projects: - -- [CasperJS](http://casperjs.org) enables easy navigation scripting and common high-level testing. -- [Poltergeist](https://github.com/jonleighton/poltergeist) allows running Capybara tests headlessly. -- [Guard::Jasmine](https://github.com/netzpirat/guard-jasmine) automatically tests Jasmine specs on Rails when files are modified. -- [GhostDriver](http://github.com/detro/ghostdriver/) complements Selenium tests with a PhantomJS WebDriver implementation. -- [PhantomRobot](https://github.com/datakurre/phantomrobot) runs Robot Framework acceptance tests in the background via PhantomJS. -- [Mocha-PhantomJS](https://github.com/metaskills/mocha-phantomjs) run Mocha tests using PhantomJS. - -and many others [related projects](https://github.com/ariya/phantomjs/wiki/Related-Projects). - -## Questions? - -- Explore the complete [documentation](https://github.com/ariya/phantomjs/wiki) -- Read tons of [user articles](https://github.com/ariya/phantomjs/wiki/Buzz) on using PhantomJS. -- Join the [mailing-list](http://groups.google.com/group/phantomjs) and discuss with other PhantomJS fans. - -PhantomJS is free software/open source, and is distributed under the [BSD license](http://opensource.org/licenses/BSD-3-Clause). It contains third-party code, see the included `third-party.txt` file for the license information on third-party code. - -PhantomJS is created and maintained by [Ariya Hidayat](http://ariya.ofilabs.com/about) (Twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)), with the help of [many contributors](https://github.com/ariya/phantomjs/contributors). - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs deleted file mode 100755 index 8f3991d..0000000 Binary files a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs and /dev/null differ diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/arguments.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/arguments.coffee deleted file mode 100644 index 9502439..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/arguments.coffee +++ /dev/null @@ -1,7 +0,0 @@ -system = require 'system' -if system.args.length is 1 - console.log 'Try to pass some args when invoking this script!' -else - for arg, i in system.args - console.log i + ': ' + arg -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/arguments.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/arguments.js deleted file mode 100644 index c6d1ee4..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/arguments.js +++ /dev/null @@ -1,9 +0,0 @@ -var system = require('system'); -if (system.args.length === 1) { - console.log('Try to pass some args when invoking this script!'); -} else { - system.args.forEach(function (arg, i) { - console.log(i + ': ' + arg); - }); -} -phantom.exit(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/child_process-examples.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/child_process-examples.coffee deleted file mode 100644 index 47e9b50..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/child_process-examples.coffee +++ /dev/null @@ -1,20 +0,0 @@ -{spawn, execFile} = require "child_process" - -child = spawn "ls", ["-lF", "/rooot"] - -child.stdout.on "data", (data) -> - console.log "spawnSTDOUT:", JSON.stringify data - -child.stderr.on "data", (data) -> - console.log "spawnSTDERR:", JSON.stringify data - -child.on "exit", (code) -> - console.log "spawnEXIT:", code - -#child.kill "SIGKILL" - -execFile "ls", ["-lF", "/usr"], null, (err, stdout, stderr) -> - console.log "execFileSTDOUT:", JSON.stringify stdout - console.log "execFileSTDERR:", JSON.stringify stderr - -setTimeout (-> phantom.exit 0), 2000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/child_process-examples.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/child_process-examples.js deleted file mode 100644 index a4970d1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/child_process-examples.js +++ /dev/null @@ -1,27 +0,0 @@ -var spawn = require("child_process").spawn -var execFile = require("child_process").execFile - -var child = spawn("ls", ["-lF", "/rooot"]) - -child.stdout.on("data", function (data) { - console.log("spawnSTDOUT:", JSON.stringify(data)) -}) - -child.stderr.on("data", function (data) { - console.log("spawnSTDERR:", JSON.stringify(data)) -}) - -child.on("exit", function (code) { - console.log("spawnEXIT:", code) -}) - -//child.kill("SIGKILL") - -execFile("ls", ["-lF", "/usr"], null, function (err, stdout, stderr) { - console.log("execFileSTDOUT:", JSON.stringify(stdout)) - console.log("execFileSTDERR:", JSON.stringify(stderr)) -}) - -setTimeout(function () { - phantom.exit(0) -}, 2000) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/colorwheel.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/colorwheel.coffee deleted file mode 100644 index 74866e1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/colorwheel.coffee +++ /dev/null @@ -1,46 +0,0 @@ -page = require('webpage').create() - -page.viewportSize = { width: 400, height : 400 } -page.content = '' - -page.evaluate -> - el = document.getElementById 'surface' - context = el.getContext '2d' - width = window.innerWidth - height = window.innerHeight - cx = width / 2 - cy = height / 2 - radius = width / 2.3 - i = 0 - - el.width = width - el.height = height - imageData = context.createImageData(width, height) - pixels = imageData.data - - for y in [0...height] - for x in [0...width] - i = i + 4 - rx = x - cx - ry = y - cy - d = rx * rx + ry * ry - if d < radius * radius - hue = 6 * (Math.atan2(ry, rx) + Math.PI) / (2 * Math.PI) - sat = Math.sqrt(d) / radius - g = Math.floor(hue) - f = hue - g - u = 255 * (1 - sat) - v = 255 * (1 - sat * f) - w = 255 * (1 - sat * (1 - f)) - pixels[i] = [255, v, u, u, w, 255, 255][g] - pixels[i + 1] = [w, 255, 255, v, u, u, w][g] - pixels[i + 2] = [u, u, w, 255, 255, v, u][g] - pixels[i + 3] = 255 - - context.putImageData imageData, 0, 0 - document.body.style.backgroundColor = 'white' - document.body.style.margin = '0px' - -page.render('colorwheel.png') - -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/colorwheel.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/colorwheel.js deleted file mode 100644 index 44fb7bf..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/colorwheel.js +++ /dev/null @@ -1,51 +0,0 @@ -var page = require('webpage').create(); -page.viewportSize = { width: 400, height : 400 }; -page.content = ''; -page.evaluate(function() { - var el = document.getElementById('surface'), - context = el.getContext('2d'), - width = window.innerWidth, - height = window.innerHeight, - cx = width / 2, - cy = height / 2, - radius = width / 2.3, - imageData, - pixels, - hue, sat, value, - i = 0, x, y, rx, ry, d, - f, g, p, u, v, w, rgb; - - el.width = width; - el.height = height; - imageData = context.createImageData(width, height); - pixels = imageData.data; - - for (y = 0; y < height; y = y + 1) { - for (x = 0; x < width; x = x + 1, i = i + 4) { - rx = x - cx; - ry = y - cy; - d = rx * rx + ry * ry; - if (d < radius * radius) { - hue = 6 * (Math.atan2(ry, rx) + Math.PI) / (2 * Math.PI); - sat = Math.sqrt(d) / radius; - g = Math.floor(hue); - f = hue - g; - u = 255 * (1 - sat); - v = 255 * (1 - sat * f); - w = 255 * (1 - sat * (1 - f)); - pixels[i] = [255, v, u, u, w, 255, 255][g]; - pixels[i + 1] = [w, 255, 255, v, u, u, w][g]; - pixels[i + 2] = [u, u, w, 255, 255, v, u][g]; - pixels[i + 3] = 255; - } - } - } - - context.putImageData(imageData, 0, 0); - document.body.style.backgroundColor = 'white'; - document.body.style.margin = '0px'; -}); - -page.render('colorwheel.png'); - -phantom.exit(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/countdown.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/countdown.coffee deleted file mode 100644 index 821fc9f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/countdown.coffee +++ /dev/null @@ -1,8 +0,0 @@ -t = 10 -interval = setInterval -> - if t > 0 - console.log t-- - else - console.log 'BLAST OFF!' - phantom.exit() -, 1000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/countdown.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/countdown.js deleted file mode 100644 index 7f5e156..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/countdown.js +++ /dev/null @@ -1,9 +0,0 @@ -var t = 10, - interval = setInterval(function(){ - if ( t > 0 ) { - console.log(t--); - } else { - console.log("BLAST OFF!"); - phantom.exit(); - } - }, 1000); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/detectsniff.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/detectsniff.coffee deleted file mode 100644 index b8d2719..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/detectsniff.coffee +++ /dev/null @@ -1,42 +0,0 @@ -page = require('webpage').create() -system = require 'system' - -page.onInitialized = -> - page.evaluate -> - userAgent = window.navigator.userAgent - platform = window.navigator.platform - window.navigator = - appCodeName: 'Mozilla' - appName: 'Netscape' - cookieEnabled: false - sniffed: false - - window.navigator.__defineGetter__ 'userAgent', -> - window.navigator.sniffed = true - userAgent - - window.navigator.__defineGetter__ 'platform', -> - window.navigator.sniffed = true - platform - -if system.args.length is 1 - console.log 'Usage: detectsniff.coffee ' - phantom.exit 1 -else - address = system.args[1] - console.log 'Checking ' + address + '...' - page.open address, (status) -> - if status isnt 'success' - console.log 'FAIL to load the address' - phantom.exit() - else - window.setTimeout -> - sniffed = page.evaluate(-> - navigator.sniffed - ) - if sniffed - console.log 'The page tried to sniff the user agent.' - else - console.log 'The page did not try to sniff the user agent.' - phantom.exit() - , 1500 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/detectsniff.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/detectsniff.js deleted file mode 100644 index e23c410..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/detectsniff.js +++ /dev/null @@ -1,59 +0,0 @@ -// Detect if a web page sniffs the user agent or not. - -var page = require('webpage').create(), - system = require('system'), - sniffed, - address; - -page.onInitialized = function () { - page.evaluate(function () { - - (function () { - var userAgent = window.navigator.userAgent, - platform = window.navigator.platform; - - window.navigator = { - appCodeName: 'Mozilla', - appName: 'Netscape', - cookieEnabled: false, - sniffed: false - }; - - window.navigator.__defineGetter__('userAgent', function () { - window.navigator.sniffed = true; - return userAgent; - }); - - window.navigator.__defineGetter__('platform', function () { - window.navigator.sniffed = true; - return platform; - }); - })(); - }); -}; - -if (system.args.length === 1) { - console.log('Usage: detectsniff.js '); - phantom.exit(1); -} else { - address = system.args[1]; - console.log('Checking ' + address + '...'); - page.open(address, function (status) { - if (status !== 'success') { - console.log('FAIL to load the address'); - phantom.exit(); - } else { - window.setTimeout(function () { - sniffed = page.evaluate(function () { - return navigator.sniffed; - }); - if (sniffed) { - console.log('The page tried to sniff the user agent.'); - } else { - console.log('The page did not try to sniff the user agent.'); - } - phantom.exit(); - }, 1500); - } - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/direction.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/direction.coffee deleted file mode 100644 index 85a1cff..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/direction.coffee +++ /dev/null @@ -1,30 +0,0 @@ -# Get driving direction using Google Directions API. - -page = require('webpage').create() -system = require 'system' - -if system.args.length < 3 - console.log 'Usage: direction.coffee origin destination' - console.log 'Example: direction.coffee "San Diego" "Palo Alto"' - phantom.exit 1 -else - origin = system.args[1] - dest = system.args[2] - page.open encodeURI('http://maps.googleapis.com/maps/api/directions/xml?origin=' + origin + - '&destination=' + dest + '&units=imperial&mode=driving&sensor=false'), - (status) -> - if status isnt 'success' - console.log 'Unable to access network' - else - steps = page.content.match(/(.*)<\/html_instructions>/ig) - if not steps - console.log 'No data available for ' + origin + ' to ' + dest - else - for ins in steps - ins = ins.replace(/\</ig, '<').replace(/\>/ig, '>') - ins = ins.replace(/\
              /g, '') - console.log(ins) - console.log '' - console.log page.content.match(/.*<\/copyrights>/ig).join('').replace(/<.*?>/g, '') - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/direction.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/direction.js deleted file mode 100644 index 77044e3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/direction.js +++ /dev/null @@ -1,35 +0,0 @@ -// Get driving direction using Google Directions API. - -var page = require('webpage').create(), - system = require('system'), - origin, dest, steps; - -if (system.args.length < 3) { - console.log('Usage: direction.js origin destination'); - console.log('Example: direction.js "San Diego" "Palo Alto"'); - phantom.exit(1); -} else { - origin = system.args[1]; - dest = system.args[2]; - page.open(encodeURI('http://maps.googleapis.com/maps/api/directions/xml?origin=' + origin + - '&destination=' + dest + '&units=imperial&mode=driving&sensor=false'), function (status) { - if (status !== 'success') { - console.log('Unable to access network'); - } else { - steps = page.content.match(/(.*)<\/html_instructions>/ig); - if (steps == null) { - console.log('No data available for ' + origin + ' to ' + dest); - } else { - steps.forEach(function (ins) { - ins = ins.replace(/\</ig, '<').replace(/\>/ig, '>'); - ins = ins.replace(/\
              /g, ''); - console.log(ins); - }); - console.log(''); - console.log(page.content.match(/.*<\/copyrights>/ig).join('').replace(/<.*?>/g, '')); - } - } - phantom.exit(); - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee deleted file mode 100644 index e886f93..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee +++ /dev/null @@ -1,19 +0,0 @@ -# echoToFile.coffee - Write in a given file all the parameters passed on the CLI -fs = require 'fs' -system = require 'system' - -if system.args.length < 3 - console.log "Usage: echoToFile.coffee DESTINATION_FILE " - phantom.exit 1 -else - content = "" - f = null - i = 2 - while i < system.args.length - content += system.args[i] + (if i == system.args.length - 1 then "" else " ") - ++i - try - fs.write system.args[1], content, "w" - catch e - console.log e - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/echoToFile.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/echoToFile.js deleted file mode 100644 index 924a703..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/echoToFile.js +++ /dev/null @@ -1,23 +0,0 @@ -// echoToFile.js - Write in a given file all the parameters passed on the CLI -var fs = require('fs'), - system = require('system'); - -if (system.args.length < 3) { - console.log("Usage: echoToFile.js DESTINATION_FILE "); - phantom.exit(1); -} else { - var content = '', - f = null, - i; - for ( i= 2; i < system.args.length; ++i ) { - content += system.args[i] + (i === system.args.length-1 ? '' : ' '); - } - - try { - fs.write(system.args[1], content, 'w'); - } catch(e) { - console.log(e); - } - - phantom.exit(); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/features.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/features.coffee deleted file mode 100644 index 829beeb..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/features.coffee +++ /dev/null @@ -1,23 +0,0 @@ -feature = undefined -supported = [] -unsupported = [] -phantom.injectJs "modernizr.js" -console.log "Detected features (using Modernizr " + Modernizr._version + "):" -for feature of Modernizr - if Modernizr.hasOwnProperty(feature) - if feature[0] isnt "_" and typeof Modernizr[feature] isnt "function" and feature isnt "input" and feature isnt "inputtypes" - if Modernizr[feature] - supported.push feature - else - unsupported.push feature -console.log "" -console.log "Supported:" -supported.forEach (e) -> - console.log " " + e - -console.log "" -console.log "Not supported:" -unsupported.forEach (e) -> - console.log " " + e - -phantom.exit() \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/features.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/features.js deleted file mode 100644 index a60643c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/features.js +++ /dev/null @@ -1,30 +0,0 @@ -var feature, supported = [], unsupported = []; - -phantom.injectJs('modernizr.js'); -console.log('Detected features (using Modernizr ' + Modernizr._version + '):'); -for (feature in Modernizr) { - if (Modernizr.hasOwnProperty(feature)) { - if (feature[0] !== '_' && typeof Modernizr[feature] !== 'function' && - feature !== 'input' && feature !== 'inputtypes') { - if (Modernizr[feature]) { - supported.push(feature); - } else { - unsupported.push(feature); - } - } - } -} - -console.log(''); -console.log('Supported:'); -supported.forEach(function (e) { - console.log(' ' + e); -}); - -console.log(''); -console.log('Not supported:'); -unsupported.forEach(function (e) { - console.log(' ' + e); -}); -phantom.exit(); - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/fibo.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/fibo.coffee deleted file mode 100644 index d9f9178..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/fibo.coffee +++ /dev/null @@ -1,8 +0,0 @@ -fibs = [0, 1] -f = -> - console.log fibs[fibs.length - 1] - fibs.push fibs[fibs.length - 1] + fibs[fibs.length - 2] - if fibs.length > 10 - window.clearInterval ticker - phantom.exit() -ticker = window.setInterval(f, 300) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/fibo.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/fibo.js deleted file mode 100644 index aa5d7ea..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/fibo.js +++ /dev/null @@ -1,9 +0,0 @@ -var fibs = [0, 1]; -var ticker = window.setInterval(function () { - console.log(fibs[fibs.length - 1]); - fibs.push(fibs[fibs.length - 1] + fibs[fibs.length - 2]); - if (fibs.length > 10) { - window.clearInterval(ticker); - phantom.exit(); - } -}, 300); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/follow.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/follow.coffee deleted file mode 100644 index 4a7fbd4..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/follow.coffee +++ /dev/null @@ -1,33 +0,0 @@ -# List following and followers from several accounts - -users = [ - 'PhantomJS' - 'ariyahidayat' - 'detronizator' - 'KDABQt' - 'lfranchi' - 'jonleighton' - '_jamesmgreene' - 'Vitalliumm' - ] - -follow = (user, callback) -> - page = require('webpage').create() - page.open 'http://mobile.twitter.com/' + user, (status) -> - if status is 'fail' - console.log user + ': ?' - else - data = page.evaluate -> document.querySelector('div.profile td.stat.stat-last div.statnum').innerText; - console.log user + ': ' + data - page.close() - callback.apply() - -process = () -> - if (users.length > 0) - user = users[0] - users.splice(0, 1) - follow(user, process) - else - phantom.exit() - -process() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/follow.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/follow.js deleted file mode 100644 index 7d826f7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/follow.js +++ /dev/null @@ -1,38 +0,0 @@ -// List following and followers from several accounts - -var users = ['PhantomJS', - 'ariyahidayat', - 'detronizator', - 'KDABQt', - 'lfranchi', - 'jonleighton', - '_jamesmgreene', - 'Vitalliumm']; - -function follow(user, callback) { - var page = require('webpage').create(); - page.open('http://mobile.twitter.com/' + user, function (status) { - if (status === 'fail') { - console.log(user + ': ?'); - } else { - var data = page.evaluate(function () { - return document.querySelector('div.profile td.stat.stat-last div.statnum').innerText; - }); - console.log(user + ': ' + data); - } - page.close(); - callback.apply(); - }); -} - -function process() { - if (users.length > 0) { - var user = users[0]; - users.splice(0, 1); - follow(user, process); - } else { - phantom.exit(); - } -} - -process(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/hello.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/hello.coffee deleted file mode 100644 index 1776a06..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/hello.coffee +++ /dev/null @@ -1,2 +0,0 @@ -console.log 'Hello, world!' -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/hello.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/hello.js deleted file mode 100644 index e273a97..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/hello.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('Hello, world!'); -phantom.exit(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/imagebin.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/imagebin.coffee deleted file mode 100644 index fdd8455..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/imagebin.coffee +++ /dev/null @@ -1,20 +0,0 @@ -# Upload an image to imagebin.org - -page = require('webpage').create() -system = require 'system' - -if system.args.length isnt 2 - console.log 'Usage: imagebin.coffee filename' - phantom.exit 1 -else - fname = system.args[1] - page.open 'http://imagebin.org/index.php?page=add', -> - page.uploadFile 'input[name=image]', fname - page.evaluate -> - document.querySelector('input[name=nickname]').value = 'phantom' - document.querySelector('input[name=disclaimer_agree]').click() - document.querySelector('form').submit() - - window.setTimeout -> - phantom.exit() - , 3000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/imagebin.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/imagebin.js deleted file mode 100644 index 5446b92..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/imagebin.js +++ /dev/null @@ -1,23 +0,0 @@ -// Upload an image to imagebin.org - -var page = require('webpage').create(), - system = require('system'), - fname; - -if (system.args.length !== 2) { - console.log('Usage: imagebin.js filename'); - phantom.exit(1); -} else { - fname = system.args[1]; - page.open("http://imagebin.org/index.php?page=add", function () { - page.uploadFile('input[name=image]', fname); - page.evaluate(function () { - document.querySelector('input[name=nickname]').value = 'phantom'; - document.querySelector('input[name=disclaimer_agree]').click() - document.querySelector('form').submit(); - }); - window.setTimeout(function () { - phantom.exit(); - }, 3000); - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/injectme.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/injectme.coffee deleted file mode 100644 index ae4927d..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/injectme.coffee +++ /dev/null @@ -1,23 +0,0 @@ -# Use 'page.injectJs()' to load the script itself in the Page context - -if phantom? - page = require('webpage').create() - - # Route "console.log()" calls from within the Page context to the main - # Phantom context (i.e. current "this") - page.onConsoleMessage = (msg) -> console.log(msg) - - page.onAlert = (msg) -> console.log(msg) - - console.log "* Script running in the Phantom context." - console.log "* Script will 'inject' itself in a page..." - page.open "about:blank", (status) -> - if status is "success" - if page.injectJs("injectme.coffee") - console.log "... done injecting itself!" - else - console.log "... fail! Check the $PWD?!" - phantom.exit() -else - alert "* Script running in the Page context." - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/injectme.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/injectme.js deleted file mode 100644 index d1f21b9..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/injectme.js +++ /dev/null @@ -1,25 +0,0 @@ -// Use 'page.injectJs()' to load the script itself in the Page context - -if ( typeof(phantom) !== "undefined" ) { - var page = require('webpage').create(); - - // Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") - page.onConsoleMessage = function(msg) { - console.log(msg); - }; - - page.onAlert = function(msg) { - console.log(msg); - }; - - console.log("* Script running in the Phantom context."); - console.log("* Script will 'inject' itself in a page..."); - page.open("about:blank", function(status) { - if ( status === "success" ) { - console.log(page.injectJs("injectme.js") ? "... done injecting itself!" : "... fail! Check the $PWD?!"); - } - phantom.exit(); - }); -} else { - alert("* Script running in the Page context."); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/ipgeocode.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/ipgeocode.coffee deleted file mode 100644 index d36d6aa..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/ipgeocode.coffee +++ /dev/null @@ -1,13 +0,0 @@ -# Give the estimated location based on the IP address. - -window.cb = (data) -> - loc = data.city - if data.region_name.length > 0 - loc = loc + ', ' + data.region_name - console.log 'IP address: ' + data.ip - console.log 'Estimated location: ' + loc - phantom.exit() - -el = document.createElement 'script' -el.src = 'http://freegeoip.net/json/?callback=window.cb' -document.body.appendChild el diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/ipgeocode.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/ipgeocode.js deleted file mode 100644 index aff5a20..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/ipgeocode.js +++ /dev/null @@ -1,14 +0,0 @@ -// Give the estimated location based on the IP address. - -cb = function (data) { - var loc = data.city; - if (data.region_name.length > 0) - loc = loc + ', ' + data.region_name; - console.log('IP address: ' + data.ip); - console.log('Estimated location: ' + loc); - phantom.exit(); -}; - -var el = document.createElement('script'); -el.src = 'http://freegeoip.net/json/?callback=cb'; -document.body.appendChild(el); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadspeed.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadspeed.coffee deleted file mode 100644 index a4c6aa7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadspeed.coffee +++ /dev/null @@ -1,18 +0,0 @@ -page = require('webpage').create() -system = require 'system' - -if system.args.length is 1 - console.log 'Usage: loadspeed.coffee ' - phantom.exit 1 -else - t = Date.now() - address = system.args[1] - page.open address, (status) -> - if status isnt 'success' - console.log('FAIL to load the address') - else - t = Date.now() - t - console.log('Page title is ' + page.evaluate( (-> document.title) )) - console.log('Loading time ' + t + ' msec') - phantom.exit() - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadspeed.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadspeed.js deleted file mode 100644 index a775e77..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadspeed.js +++ /dev/null @@ -1,23 +0,0 @@ -var page = require('webpage').create(), - system = require('system'), - t, address; - -if (system.args.length === 1) { - console.log('Usage: loadspeed.js '); - phantom.exit(1); -} else { - t = Date.now(); - address = system.args[1]; - page.open(address, function (status) { - if (status !== 'success') { - console.log('FAIL to load the address'); - } else { - t = Date.now() - t; - console.log('Page title is ' + page.evaluate(function () { - return document.title; - })); - console.log('Loading time ' + t + ' msec'); - } - phantom.exit(); - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadurlwithoutcss.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadurlwithoutcss.coffee deleted file mode 100644 index 36143c8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadurlwithoutcss.coffee +++ /dev/null @@ -1,20 +0,0 @@ -page = require("webpage").create() -system = require("system") - -if system.args.length < 2 - console.log "Usage: loadurlwithoutcss.js URL" - phantom.exit() - -address = system.args[1] - -page.onResourceRequested = (requestData, request) -> - if (/http:\/\/.+?\.css/g).test(requestData["url"]) or requestData["Content-Type"] is "text/css" - console.log "The url of the request is matching. Aborting: " + requestData["url"] - request.abort() - -page.open address, (status) -> - if status is "success" - phantom.exit() - else - console.log "Unable to load the address!" - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadurlwithoutcss.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadurlwithoutcss.js deleted file mode 100644 index c7a4733..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/loadurlwithoutcss.js +++ /dev/null @@ -1,25 +0,0 @@ -var page = require('webpage').create(), - system = require('system'); - -if (system.args.length < 2) { - console.log('Usage: loadurlwithoutcss.js URL'); - phantom.exit(); -} - -var address = system.args[1]; - -page.onResourceRequested = function(requestData, request) { - if ((/http:\/\/.+?\.css/gi).test(requestData['url']) || requestData['Content-Type'] == 'text/css') { - console.log('The url of the request is matching. Aborting: ' + requestData['url']); - request.abort(); - } -}; - -page.open(address, function(status) { - if (status === 'success') { - phantom.exit(); - } else { - console.log('Unable to load the address!'); - phantom.exit(); - } -}); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/modernizr.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/modernizr.js deleted file mode 100644 index f9e57c8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/modernizr.js +++ /dev/null @@ -1,1116 +0,0 @@ -/*! - * Modernizr v2.0.6 - * http://www.modernizr.com - * - * Copyright (c) 2009-2011 Faruk Ates, Paul Irish, Alex Sexton - * Dual-licensed under the BSD or MIT licenses: www.modernizr.com/license/ - */ - -/* - * Modernizr tests which native CSS3 and HTML5 features are available in - * the current UA and makes the results available to you in two ways: - * as properties on a global Modernizr object, and as classes on the - * element. This information allows you to progressively enhance - * your pages with a granular level of control over the experience. - * - * Modernizr has an optional (not included) conditional resource loader - * called Modernizr.load(), based on Yepnope.js (yepnopejs.com). - * To get a build that includes Modernizr.load(), as well as choosing - * which tests to include, go to www.modernizr.com/download/ - * - * Authors Faruk Ates, Paul Irish, Alex Sexton, - * Contributors Ryan Seddon, Ben Alman - */ - -window.Modernizr = (function( window, document, undefined ) { - - var version = '2.0.6', - - Modernizr = {}, - - // option for enabling the HTML classes to be added - enableClasses = true, - - docElement = document.documentElement, - docHead = document.head || document.getElementsByTagName('head')[0], - - /** - * Create our "modernizr" element that we do most feature tests on. - */ - mod = 'modernizr', - modElem = document.createElement(mod), - mStyle = modElem.style, - - /** - * Create the input element for various Web Forms feature tests. - */ - inputElem = document.createElement('input'), - - smile = ':)', - - toString = Object.prototype.toString, - - // List of property values to set for css tests. See ticket #21 - prefixes = ' -webkit- -moz- -o- -ms- -khtml- '.split(' '), - - // Following spec is to expose vendor-specific style properties as: - // elem.style.WebkitBorderRadius - // and the following would be incorrect: - // elem.style.webkitBorderRadius - - // Webkit ghosts their properties in lowercase but Opera & Moz do not. - // Microsoft foregoes prefixes entirely <= IE8, but appears to - // use a lowercase `ms` instead of the correct `Ms` in IE9 - - // More here: http://github.com/Modernizr/Modernizr/issues/issue/21 - domPrefixes = 'Webkit Moz O ms Khtml'.split(' '), - - ns = {'svg': 'http://www.w3.org/2000/svg'}, - - tests = {}, - inputs = {}, - attrs = {}, - - classes = [], - - featureName, // used in testing loop - - - // Inject element with style element and some CSS rules - injectElementWithStyles = function( rule, callback, nodes, testnames ) { - - var style, ret, node, - div = document.createElement('div'); - - if ( parseInt(nodes, 10) ) { - // In order not to give false positives we create a node for each test - // This also allows the method to scale for unspecified uses - while ( nodes-- ) { - node = document.createElement('div'); - node.id = testnames ? testnames[nodes] : mod + (nodes + 1); - div.appendChild(node); - } - } - - // '].join(''); - div.id = mod; - div.innerHTML += style; - docElement.appendChild(div); - - ret = callback(div, rule); - div.parentNode.removeChild(div); - - return !!ret; - - }, - - - // adapted from matchMedia polyfill - // by Scott Jehl and Paul Irish - // gist.github.com/786768 - testMediaQuery = function( mq ) { - - if ( window.matchMedia ) { - return matchMedia(mq).matches; - } - - var bool; - - injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) { - bool = (window.getComputedStyle ? - getComputedStyle(node, null) : - node.currentStyle)['position'] == 'absolute'; - }); - - return bool; - - }, - - - /** - * isEventSupported determines if a given element supports the given event - * function from http://yura.thinkweb2.com/isEventSupported/ - */ - isEventSupported = (function() { - - var TAGNAMES = { - 'select': 'input', 'change': 'input', - 'submit': 'form', 'reset': 'form', - 'error': 'img', 'load': 'img', 'abort': 'img' - }; - - function isEventSupported( eventName, element ) { - - element = element || document.createElement(TAGNAMES[eventName] || 'div'); - eventName = 'on' + eventName; - - // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those - var isSupported = eventName in element; - - if ( !isSupported ) { - // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element - if ( !element.setAttribute ) { - element = document.createElement('div'); - } - if ( element.setAttribute && element.removeAttribute ) { - element.setAttribute(eventName, ''); - isSupported = is(element[eventName], 'function'); - - // If property was created, "remove it" (by setting value to `undefined`) - if ( !is(element[eventName], undefined) ) { - element[eventName] = undefined; - } - element.removeAttribute(eventName); - } - } - - element = null; - return isSupported; - } - return isEventSupported; - })(); - - // hasOwnProperty shim by kangax needed for Safari 2.0 support - var _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty; - if ( !is(_hasOwnProperty, undefined) && !is(_hasOwnProperty.call, undefined) ) { - hasOwnProperty = function (object, property) { - return _hasOwnProperty.call(object, property); - }; - } - else { - hasOwnProperty = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ - return ((property in object) && is(object.constructor.prototype[property], undefined)); - }; - } - - /** - * setCss applies given styles to the Modernizr DOM node. - */ - function setCss( str ) { - mStyle.cssText = str; - } - - /** - * setCssAll extrapolates all vendor-specific css strings. - */ - function setCssAll( str1, str2 ) { - return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); - } - - /** - * is returns a boolean for if typeof obj is exactly type. - */ - function is( obj, type ) { - return typeof obj === type; - } - - /** - * contains returns a boolean for if substr is found within str. - */ - function contains( str, substr ) { - return !!~('' + str).indexOf(substr); - } - - /** - * testProps is a generic CSS / DOM property test; if a browser supports - * a certain property, it won't return undefined for it. - * A supported CSS property returns empty string when its not yet set. - */ - function testProps( props, prefixed ) { - for ( var i in props ) { - if ( mStyle[ props[i] ] !== undefined ) { - return prefixed == 'pfx' ? props[i] : true; - } - } - return false; - } - - /** - * testPropsAll tests a list of DOM properties we want to check against. - * We specify literally ALL possible (known and/or likely) properties on - * the element including the non-vendor prefixed one, for forward- - * compatibility. - */ - function testPropsAll( prop, prefixed ) { - - var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1), - props = (prop + ' ' + domPrefixes.join(ucProp + ' ') + ucProp).split(' '); - - return testProps(props, prefixed); - } - - /** - * testBundle tests a list of CSS features that require element and style injection. - * By bundling them together we can reduce the need to touch the DOM multiple times. - */ - /*>>testBundle*/ - var testBundle = (function( styles, tests ) { - var style = styles.join(''), - len = tests.length; - - injectElementWithStyles(style, function( node, rule ) { - var style = document.styleSheets[document.styleSheets.length - 1], - // IE8 will bork if you create a custom build that excludes both fontface and generatedcontent tests. - // So we check for cssRules and that there is a rule available - // More here: https://github.com/Modernizr/Modernizr/issues/288 & https://github.com/Modernizr/Modernizr/issues/293 - cssText = style.cssRules && style.cssRules[0] ? style.cssRules[0].cssText : style.cssText || "", - children = node.childNodes, hash = {}; - - while ( len-- ) { - hash[children[len].id] = children[len]; - } - - /*>>touch*/ Modernizr['touch'] = ('ontouchstart' in window) || hash['touch'].offsetTop === 9; /*>>touch*/ - /*>>csstransforms3d*/ Modernizr['csstransforms3d'] = hash['csstransforms3d'].offsetLeft === 9; /*>>csstransforms3d*/ - /*>>generatedcontent*/Modernizr['generatedcontent'] = hash['generatedcontent'].offsetHeight >= 1; /*>>generatedcontent*/ - /*>>fontface*/ Modernizr['fontface'] = /src/i.test(cssText) && - cssText.indexOf(rule.split(' ')[0]) === 0; /*>>fontface*/ - }, len, tests); - - })([ - // Pass in styles to be injected into document - /*>>fontface*/ '@font-face {font-family:"font";src:url("https://")}' /*>>fontface*/ - - /*>>touch*/ ,['@media (',prefixes.join('touch-enabled),('),mod,')', - '{#touch{top:9px;position:absolute}}'].join('') /*>>touch*/ - - /*>>csstransforms3d*/ ,['@media (',prefixes.join('transform-3d),('),mod,')', - '{#csstransforms3d{left:9px;position:absolute}}'].join('')/*>>csstransforms3d*/ - - /*>>generatedcontent*/,['#generatedcontent:after{content:"',smile,'";visibility:hidden}'].join('') /*>>generatedcontent*/ - ], - [ - /*>>fontface*/ 'fontface' /*>>fontface*/ - /*>>touch*/ ,'touch' /*>>touch*/ - /*>>csstransforms3d*/ ,'csstransforms3d' /*>>csstransforms3d*/ - /*>>generatedcontent*/,'generatedcontent' /*>>generatedcontent*/ - - ]);/*>>testBundle*/ - - - /** - * Tests - * ----- - */ - - tests['flexbox'] = function() { - /** - * setPrefixedValueCSS sets the property of a specified element - * adding vendor prefixes to the VALUE of the property. - * @param {Element} element - * @param {string} property The property name. This will not be prefixed. - * @param {string} value The value of the property. This WILL be prefixed. - * @param {string=} extra Additional CSS to append unmodified to the end of - * the CSS string. - */ - function setPrefixedValueCSS( element, property, value, extra ) { - property += ':'; - element.style.cssText = (property + prefixes.join(value + ';' + property)).slice(0, -property.length) + (extra || ''); - } - - /** - * setPrefixedPropertyCSS sets the property of a specified element - * adding vendor prefixes to the NAME of the property. - * @param {Element} element - * @param {string} property The property name. This WILL be prefixed. - * @param {string} value The value of the property. This will not be prefixed. - * @param {string=} extra Additional CSS to append unmodified to the end of - * the CSS string. - */ - function setPrefixedPropertyCSS( element, property, value, extra ) { - element.style.cssText = prefixes.join(property + ':' + value + ';') + (extra || ''); - } - - var c = document.createElement('div'), - elem = document.createElement('div'); - - setPrefixedValueCSS(c, 'display', 'box', 'width:42px;padding:0;'); - setPrefixedPropertyCSS(elem, 'box-flex', '1', 'width:10px;'); - - c.appendChild(elem); - docElement.appendChild(c); - - var ret = elem.offsetWidth === 42; - - c.removeChild(elem); - docElement.removeChild(c); - - return ret; - }; - - // On the S60 and BB Storm, getContext exists, but always returns undefined - // http://github.com/Modernizr/Modernizr/issues/issue/97/ - - tests['canvas'] = function() { - var elem = document.createElement('canvas'); - return !!(elem.getContext && elem.getContext('2d')); - }; - - tests['canvastext'] = function() { - return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); - }; - - // This WebGL test may false positive. - // But really it's quite impossible to know whether webgl will succeed until after you create the context. - // You might have hardware that can support a 100x100 webgl canvas, but will not support a 1000x1000 webgl - // canvas. So this feature inference is weak, but intentionally so. - - // It is known to false positive in FF4 with certain hardware and the iPad 2. - - tests['webgl'] = function() { - return !!window.WebGLRenderingContext; - }; - - /* - * The Modernizr.touch test only indicates if the browser supports - * touch events, which does not necessarily reflect a touchscreen - * device, as evidenced by tablets running Windows 7 or, alas, - * the Palm Pre / WebOS (touch) phones. - * - * Additionally, Chrome (desktop) used to lie about its support on this, - * but that has since been rectified: http://crbug.com/36415 - * - * We also test for Firefox 4 Multitouch Support. - * - * For more info, see: http://modernizr.github.com/Modernizr/touch.html - */ - - tests['touch'] = function() { - return Modernizr['touch']; - }; - - /** - * geolocation tests for the new Geolocation API specification. - * This test is a standards compliant-only test; for more complete - * testing, including a Google Gears fallback, please see: - * http://code.google.com/p/geo-location-javascript/ - * or view a fallback solution using google's geo API: - * http://gist.github.com/366184 - */ - tests['geolocation'] = function() { - return !!navigator.geolocation; - }; - - // Per 1.6: - // This used to be Modernizr.crosswindowmessaging but the longer - // name has been deprecated in favor of a shorter and property-matching one. - // The old API is still available in 1.6, but as of 2.0 will throw a warning, - // and in the first release thereafter disappear entirely. - tests['postmessage'] = function() { - return !!window.postMessage; - }; - - // Web SQL database detection is tricky: - - // In chrome incognito mode, openDatabase is truthy, but using it will - // throw an exception: http://crbug.com/42380 - // We can create a dummy database, but there is no way to delete it afterwards. - - // Meanwhile, Safari users can get prompted on any database creation. - // If they do, any page with Modernizr will give them a prompt: - // http://github.com/Modernizr/Modernizr/issues/closed#issue/113 - - // We have chosen to allow the Chrome incognito false positive, so that Modernizr - // doesn't litter the web with these test databases. As a developer, you'll have - // to account for this gotcha yourself. - tests['websqldatabase'] = function() { - var result = !!window.openDatabase; - /* if (result){ - try { - result = !!openDatabase( mod + "testdb", "1.0", mod + "testdb", 2e4); - } catch(e) { - } - } */ - return result; - }; - - // Vendors had inconsistent prefixing with the experimental Indexed DB: - // - Webkit's implementation is accessible through webkitIndexedDB - // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB - // For speed, we don't test the legacy (and beta-only) indexedDB - tests['indexedDB'] = function() { - for ( var i = -1, len = domPrefixes.length; ++i < len; ){ - if ( window[domPrefixes[i].toLowerCase() + 'IndexedDB'] ){ - return true; - } - } - return !!window.indexedDB; - }; - - // documentMode logic from YUI to filter out IE8 Compat Mode - // which false positives. - tests['hashchange'] = function() { - return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); - }; - - // Per 1.6: - // This used to be Modernizr.historymanagement but the longer - // name has been deprecated in favor of a shorter and property-matching one. - // The old API is still available in 1.6, but as of 2.0 will throw a warning, - // and in the first release thereafter disappear entirely. - tests['history'] = function() { - return !!(window.history && history.pushState); - }; - - tests['draganddrop'] = function() { - return isEventSupported('dragstart') && isEventSupported('drop'); - }; - - // Mozilla is targeting to land MozWebSocket for FF6 - // bugzil.la/659324 - tests['websockets'] = function() { - for ( var i = -1, len = domPrefixes.length; ++i < len; ){ - if ( window[domPrefixes[i] + 'WebSocket'] ){ - return true; - } - } - return 'WebSocket' in window; - }; - - - // http://css-tricks.com/rgba-browser-support/ - tests['rgba'] = function() { - // Set an rgba() color and check the returned value - - setCss('background-color:rgba(150,255,150,.5)'); - - return contains(mStyle.backgroundColor, 'rgba'); - }; - - tests['hsla'] = function() { - // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, - // except IE9 who retains it as hsla - - setCss('background-color:hsla(120,40%,100%,.5)'); - - return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); - }; - - tests['multiplebgs'] = function() { - // Setting multiple images AND a color on the background shorthand property - // and then querying the style.background property value for the number of - // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! - - setCss('background:url(https://),url(https://),red url(https://)'); - - // If the UA supports multiple backgrounds, there should be three occurrences - // of the string "url(" in the return value for elemStyle.background - - return /(url\s*\(.*?){3}/.test(mStyle.background); - }; - - - // In testing support for a given CSS property, it's legit to test: - // `elem.style[styleName] !== undefined` - // If the property is supported it will return an empty string, - // if unsupported it will return undefined. - - // We'll take advantage of this quick test and skip setting a style - // on our modernizr element, but instead just testing undefined vs - // empty string. - - - tests['backgroundsize'] = function() { - return testPropsAll('backgroundSize'); - }; - - tests['borderimage'] = function() { - return testPropsAll('borderImage'); - }; - - - // Super comprehensive table about all the unique implementations of - // border-radius: http://muddledramblings.com/table-of-css3-border-radius-compliance - - tests['borderradius'] = function() { - return testPropsAll('borderRadius'); - }; - - // WebOS unfortunately false positives on this test. - tests['boxshadow'] = function() { - return testPropsAll('boxShadow'); - }; - - // FF3.0 will false positive on this test - tests['textshadow'] = function() { - return document.createElement('div').style.textShadow === ''; - }; - - - tests['opacity'] = function() { - // Browsers that actually have CSS Opacity implemented have done so - // according to spec, which means their return values are within the - // range of [0.0,1.0] - including the leading zero. - - setCssAll('opacity:.55'); - - // The non-literal . in this regex is intentional: - // German Chrome returns this value as 0,55 - // https://github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632 - return /^0.55$/.test(mStyle.opacity); - }; - - - tests['cssanimations'] = function() { - return testPropsAll('animationName'); - }; - - - tests['csscolumns'] = function() { - return testPropsAll('columnCount'); - }; - - - tests['cssgradients'] = function() { - /** - * For CSS Gradients syntax, please see: - * http://webkit.org/blog/175/introducing-css-gradients/ - * https://developer.mozilla.org/en/CSS/-moz-linear-gradient - * https://developer.mozilla.org/en/CSS/-moz-radial-gradient - * http://dev.w3.org/csswg/css3-images/#gradients- - */ - - var str1 = 'background-image:', - str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', - str3 = 'linear-gradient(left top,#9f9, white);'; - - setCss( - (str1 + prefixes.join(str2 + str1) + prefixes.join(str3 + str1)).slice(0, -str1.length) - ); - - return contains(mStyle.backgroundImage, 'gradient'); - }; - - - tests['cssreflections'] = function() { - return testPropsAll('boxReflect'); - }; - - - tests['csstransforms'] = function() { - return !!testProps(['transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform']); - }; - - - tests['csstransforms3d'] = function() { - - var ret = !!testProps(['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']); - - // Webkit’s 3D transforms are passed off to the browser's own graphics renderer. - // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in - // some conditions. As a result, Webkit typically recognizes the syntax but - // will sometimes throw a false positive, thus we must do a more thorough check: - if ( ret && 'webkitPerspective' in docElement.style ) { - - // Webkit allows this media query to succeed only if the feature is enabled. - // `@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){ ... }` - ret = Modernizr['csstransforms3d']; - } - return ret; - }; - - - tests['csstransitions'] = function() { - return testPropsAll('transitionProperty'); - }; - - - /*>>fontface*/ - // @font-face detection routine by Diego Perini - // http://javascript.nwbox.com/CSSSupport/ - tests['fontface'] = function() { - return Modernizr['fontface']; - }; - /*>>fontface*/ - - // CSS generated content detection - tests['generatedcontent'] = function() { - return Modernizr['generatedcontent']; - }; - - - - // These tests evaluate support of the video/audio elements, as well as - // testing what types of content they support. - // - // We're using the Boolean constructor here, so that we can extend the value - // e.g. Modernizr.video // true - // Modernizr.video.ogg // 'probably' - // - // Codec values from : http://github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 - // thx to NielsLeenheer and zcorpan - - // Note: in FF 3.5.1 and 3.5.0, "no" was a return value instead of empty string. - // Modernizr does not normalize for that. - - tests['video'] = function() { - var elem = document.createElement('video'), - bool = false; - - // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224 - try { - if ( bool = !!elem.canPlayType ) { - bool = new Boolean(bool); - bool.ogg = elem.canPlayType('video/ogg; codecs="theora"'); - - // Workaround required for IE9, which doesn't report video support without audio codec specified. - // bug 599718 @ msft connect - var h264 = 'video/mp4; codecs="avc1.42E01E'; - bool.h264 = elem.canPlayType(h264 + '"') || elem.canPlayType(h264 + ', mp4a.40.2"'); - - bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"'); - } - - } catch(e) { } - - return bool; - }; - - tests['audio'] = function() { - var elem = document.createElement('audio'), - bool = false; - - try { - if ( bool = !!elem.canPlayType ) { - bool = new Boolean(bool); - bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"'); - bool.mp3 = elem.canPlayType('audio/mpeg;'); - - // Mimetypes accepted: - // https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - // http://bit.ly/iphoneoscodecs - bool.wav = elem.canPlayType('audio/wav; codecs="1"'); - bool.m4a = elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;'); - } - } catch(e) { } - - return bool; - }; - - - // Firefox has made these tests rather unfun. - - // In FF4, if disabled, window.localStorage should === null. - - // Normally, we could not test that directly and need to do a - // `('localStorage' in window) && ` test first because otherwise Firefox will - // throw http://bugzil.la/365772 if cookies are disabled - - // However, in Firefox 4 betas, if dom.storage.enabled == false, just mentioning - // the property will throw an exception. http://bugzil.la/599479 - // This looks to be fixed for FF4 Final. - - // Because we are forced to try/catch this, we'll go aggressive. - - // FWIW: IE8 Compat mode supports these features completely: - // http://www.quirksmode.org/dom/html5.html - // But IE8 doesn't support either with local files - - tests['localstorage'] = function() { - try { - return !!localStorage.getItem; - } catch(e) { - return false; - } - }; - - tests['sessionstorage'] = function() { - try { - return !!sessionStorage.getItem; - } catch(e){ - return false; - } - }; - - - tests['webworkers'] = function() { - return !!window.Worker; - }; - - - tests['applicationcache'] = function() { - return !!window.applicationCache; - }; - - - // Thanks to Erik Dahlstrom - tests['svg'] = function() { - return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; - }; - - // specifically for SVG inline in HTML, not within XHTML - // test page: paulirish.com/demo/inline-svg - tests['inlinesvg'] = function() { - var div = document.createElement('div'); - div.innerHTML = ''; - return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; - }; - - // Thanks to F1lt3r and lucideer, ticket #35 - tests['smil'] = function() { - return !!document.createElementNS && /SVG/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); - }; - - tests['svgclippaths'] = function() { - // Possibly returns a false positive in Safari 3.2? - return !!document.createElementNS && /SVG/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); - }; - - // input features and input types go directly onto the ret object, bypassing the tests loop. - // Hold this guy to execute in a moment. - function webforms() { - // Run through HTML5's new input attributes to see if the UA understands any. - // We're using f which is the element created early on - // Mike Taylr has created a comprehensive resource for testing these attributes - // when applied to all input types: - // http://miketaylr.com/code/input-type-attr.html - // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary - - // Only input placeholder is tested while textarea's placeholder is not. - // Currently Safari 4 and Opera 11 have support only for the input placeholder - // Both tests are available in feature-detects/forms-placeholder.js - Modernizr['input'] = (function( props ) { - for ( var i = 0, len = props.length; i < len; i++ ) { - attrs[ props[i] ] = !!(props[i] in inputElem); - } - return attrs; - })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); - - // Run through HTML5's new input types to see if the UA understands any. - // This is put behind the tests runloop because it doesn't return a - // true/false like all the other tests; instead, it returns an object - // containing each input type with its corresponding true/false value - - // Big thanks to @miketaylr for the html5 forms expertise. http://miketaylr.com/ - Modernizr['inputtypes'] = (function(props) { - - for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) { - - inputElem.setAttribute('type', inputElemType = props[i]); - bool = inputElem.type !== 'text'; - - // We first check to see if the type we give it sticks.. - // If the type does, we feed it a textual value, which shouldn't be valid. - // If the value doesn't stick, we know there's input sanitization which infers a custom UI - if ( bool ) { - - inputElem.value = smile; - inputElem.style.cssText = 'position:absolute;visibility:hidden;'; - - if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) { - - docElement.appendChild(inputElem); - defaultView = document.defaultView; - - // Safari 2-4 allows the smiley as a value, despite making a slider - bool = defaultView.getComputedStyle && - defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && - // Mobile android web browser has false positive, so must - // check the height to see if the widget is actually there. - (inputElem.offsetHeight !== 0); - - docElement.removeChild(inputElem); - - } else if ( /^(search|tel)$/.test(inputElemType) ){ - // Spec doesnt define any special parsing or detectable UI - // behaviors so we pass these through as true - - // Interestingly, opera fails the earlier test, so it doesn't - // even make it here. - - } else if ( /^(url|email)$/.test(inputElemType) ) { - // Real url and email support comes with prebaked validation. - bool = inputElem.checkValidity && inputElem.checkValidity() === false; - - } else if ( /^color$/.test(inputElemType) ) { - // chuck into DOM and force reflow for Opera bug in 11.00 - // github.com/Modernizr/Modernizr/issues#issue/159 - docElement.appendChild(inputElem); - docElement.offsetWidth; - bool = inputElem.value != smile; - docElement.removeChild(inputElem); - - } else { - // If the upgraded input compontent rejects the :) text, we got a winner - bool = inputElem.value != smile; - } - } - - inputs[ props[i] ] = !!bool; - } - return inputs; - })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); - } - - - // End of test definitions - // ----------------------- - - - - // Run through all tests and detect their support in the current UA. - // todo: hypothetically we could be doing an array of tests and use a basic loop here. - for ( var feature in tests ) { - if ( hasOwnProperty(tests, feature) ) { - // run the test, throw the return value into the Modernizr, - // then based on that boolean, define an appropriate className - // and push it into an array of classes we'll join later. - featureName = feature.toLowerCase(); - Modernizr[featureName] = tests[feature](); - - classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); - } - } - - // input tests need to run. - Modernizr.input || webforms(); - - - /** - * addTest allows the user to define their own feature tests - * the result will be added onto the Modernizr object, - * as well as an appropriate className set on the html element - * - * @param feature - String naming the feature - * @param test - Function returning true if feature is supported, false if not - */ - Modernizr.addTest = function ( feature, test ) { - if ( typeof feature == "object" ) { - for ( var key in feature ) { - if ( hasOwnProperty( feature, key ) ) { - Modernizr.addTest( key, feature[ key ] ); - } - } - } else { - - feature = feature.toLowerCase(); - - if ( Modernizr[feature] !== undefined ) { - // we're going to quit if you're trying to overwrite an existing test - // if we were to allow it, we'd do this: - // var re = new RegExp("\\b(no-)?" + feature + "\\b"); - // docElement.className = docElement.className.replace( re, '' ); - // but, no rly, stuff 'em. - return; - } - - test = typeof test == "boolean" ? test : !!test(); - - docElement.className += ' ' + (test ? '' : 'no-') + feature; - Modernizr[feature] = test; - - } - - return Modernizr; // allow chaining. - }; - - - // Reset modElem.cssText to nothing to reduce memory footprint. - setCss(''); - modElem = inputElem = null; - - //>>BEGIN IEPP - // Enable HTML 5 elements for styling (and printing) in IE. - if ( window.attachEvent && (function(){ var elem = document.createElement('div'); - elem.innerHTML = ''; - return elem.childNodes.length !== 1; })() ) { - - // iepp v2 by @jon_neal & afarkas : github.com/aFarkas/iepp/ - (function(win, doc) { - win.iepp = win.iepp || {}; - var iepp = win.iepp, - elems = iepp.html5elements || 'abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video', - elemsArr = elems.split('|'), - elemsArrLen = elemsArr.length, - elemRegExp = new RegExp('(^|\\s)('+elems+')', 'gi'), - tagRegExp = new RegExp('<(\/*)('+elems+')', 'gi'), - filterReg = /^\s*[\{\}]\s*$/, - ruleRegExp = new RegExp('(^|[^\\n]*?\\s)('+elems+')([^\\n]*)({[\\n\\w\\W]*?})', 'gi'), - docFrag = doc.createDocumentFragment(), - html = doc.documentElement, - head = html.firstChild, - bodyElem = doc.createElement('body'), - styleElem = doc.createElement('style'), - printMedias = /print|all/, - body; - function shim(doc) { - var a = -1; - while (++a < elemsArrLen) - // Use createElement so IE allows HTML5-named elements in a document - doc.createElement(elemsArr[a]); - } - - iepp.getCSS = function(styleSheetList, mediaType) { - if(styleSheetList+'' === undefined){return '';} - var a = -1, - len = styleSheetList.length, - styleSheet, - cssTextArr = []; - while (++a < len) { - styleSheet = styleSheetList[a]; - //currently no test for disabled/alternate stylesheets - if(styleSheet.disabled){continue;} - mediaType = styleSheet.media || mediaType; - // Get css from all non-screen stylesheets and their imports - if (printMedias.test(mediaType)) cssTextArr.push(iepp.getCSS(styleSheet.imports, mediaType), styleSheet.cssText); - //reset mediaType to all with every new *not imported* stylesheet - mediaType = 'all'; - } - return cssTextArr.join(''); - }; - - iepp.parseCSS = function(cssText) { - var cssTextArr = [], - rule; - while ((rule = ruleRegExp.exec(cssText)) != null){ - // Replace all html5 element references with iepp substitute classnames - cssTextArr.push(( (filterReg.exec(rule[1]) ? '\n' : rule[1]) +rule[2]+rule[3]).replace(elemRegExp, '$1.iepp_$2')+rule[4]); - } - return cssTextArr.join('\n'); - }; - - iepp.writeHTML = function() { - var a = -1; - body = body || doc.body; - while (++a < elemsArrLen) { - var nodeList = doc.getElementsByTagName(elemsArr[a]), - nodeListLen = nodeList.length, - b = -1; - while (++b < nodeListLen) - if (nodeList[b].className.indexOf('iepp_') < 0) - // Append iepp substitute classnames to all html5 elements - nodeList[b].className += ' iepp_'+elemsArr[a]; - } - docFrag.appendChild(body); - html.appendChild(bodyElem); - // Write iepp substitute print-safe document - bodyElem.className = body.className; - bodyElem.id = body.id; - // Replace HTML5 elements with which is print-safe and shouldn't conflict since it isn't part of html5 - bodyElem.innerHTML = body.innerHTML.replace(tagRegExp, '<$1font'); - }; - - - iepp._beforePrint = function() { - // Write iepp custom print CSS - styleElem.styleSheet.cssText = iepp.parseCSS(iepp.getCSS(doc.styleSheets, 'all')); - iepp.writeHTML(); - }; - - iepp.restoreHTML = function(){ - // Undo everything done in onbeforeprint - bodyElem.innerHTML = ''; - html.removeChild(bodyElem); - html.appendChild(body); - }; - - iepp._afterPrint = function(){ - // Undo everything done in onbeforeprint - iepp.restoreHTML(); - styleElem.styleSheet.cssText = ''; - }; - - - - // Shim the document and iepp fragment - shim(doc); - shim(docFrag); - - // - if(iepp.disablePP){return;} - - // Add iepp custom print style element - head.insertBefore(styleElem, head.firstChild); - styleElem.media = 'print'; - styleElem.className = 'iepp-printshim'; - win.attachEvent( - 'onbeforeprint', - iepp._beforePrint - ); - win.attachEvent( - 'onafterprint', - iepp._afterPrint - ); - })(window, document); - } - //>>END IEPP - - // Assign private properties to the return object with prefix - Modernizr._version = version; - - // expose these for the plugin API. Look in the source for how to join() them against your input - Modernizr._prefixes = prefixes; - Modernizr._domPrefixes = domPrefixes; - - // Modernizr.mq tests a given media query, live against the current state of the window - // A few important notes: - // * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false - // * A max-width or orientation query will be evaluated against the current state, which may change later. - // * You must specify values. Eg. If you are testing support for the min-width media query use: - // Modernizr.mq('(min-width:0)') - // usage: - // Modernizr.mq('only screen and (max-width:768)') - Modernizr.mq = testMediaQuery; - - // Modernizr.hasEvent() detects support for a given event, with an optional element to test on - // Modernizr.hasEvent('gesturestart', elem) - Modernizr.hasEvent = isEventSupported; - - // Modernizr.testProp() investigates whether a given style property is recognized - // Note that the property names must be provided in the camelCase variant. - // Modernizr.testProp('pointerEvents') - Modernizr.testProp = function(prop){ - return testProps([prop]); - }; - - // Modernizr.testAllProps() investigates whether a given style property, - // or any of its vendor-prefixed variants, is recognized - // Note that the property names must be provided in the camelCase variant. - // Modernizr.testAllProps('boxSizing') - Modernizr.testAllProps = testPropsAll; - - - - // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards - // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... }) - Modernizr.testStyles = injectElementWithStyles; - - - // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input - // Modernizr.prefixed('boxSizing') // 'MozBoxSizing' - - // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style. - // Return values will also be the camelCase variant, if you need to translate that to hypenated style use: - // - // str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-'); - - // If you're trying to ascertain which transition end event to bind to, you might do something like... - // - // var transEndEventNames = { - // 'WebkitTransition' : 'webkitTransitionEnd', - // 'MozTransition' : 'transitionend', - // 'OTransition' : 'oTransitionEnd', - // 'msTransition' : 'msTransitionEnd', // maybe? - // 'transition' : 'transitionEnd' - // }, - // transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; - - Modernizr.prefixed = function(prop){ - return testPropsAll(prop, 'pfx'); - }; - - - - // Remove "no-js" class from element, if it exists: - docElement.className = docElement.className.replace(/\bno-js\b/, '') - - // Add the new classes to the element. - + (enableClasses ? ' js ' + classes.join(' ') : ''); - - return Modernizr; - -})(this, this.document); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/module.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/module.coffee deleted file mode 100644 index 5278b51..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/module.coffee +++ /dev/null @@ -1,4 +0,0 @@ -universe = require './universe' -universe.start() -console.log 'The answer is' + universe.answer -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/module.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/module.js deleted file mode 100644 index 82e1c64..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/module.js +++ /dev/null @@ -1,4 +0,0 @@ -var universe = require('./universe'); -universe.start(); -console.log('The answer is' + universe.answer); -phantom.exit(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/movies.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/movies.coffee deleted file mode 100644 index 86fb5b0..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/movies.coffee +++ /dev/null @@ -1,13 +0,0 @@ -# List movies from kids-in-mind.com - -window.cbfunc = (data) -> - globaldata = data - list = data.query.results.movie - for item in list - console.log item.title + ' [' + item.rating.MPAA.content + ']' - phantom.exit() - -el = document.createElement 'script' -el.src = -"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20movies.kids-in-mind&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=window.cbfunc" -document.body.appendChild el diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/movies.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/movies.js deleted file mode 100644 index 73c61a7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/movies.js +++ /dev/null @@ -1,14 +0,0 @@ -// List movies from kids-in-mind.com - -var cbfunc = function (data) { - globaldata= data; - var list = data.query.results.movie; - list.forEach(function (item) { - console.log(item.title + ' [' + item.rating.MPAA.content + ']'); - }); - phantom.exit(); -}; - -var el = document.createElement('script'); -el.src = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20movies.kids-in-mind&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=cbfunc'; -document.body.appendChild(el); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netlog.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netlog.coffee deleted file mode 100644 index d6e5c35..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netlog.coffee +++ /dev/null @@ -1,18 +0,0 @@ -page = require('webpage').create() -system = require 'system' - -if system.args.length is 1 - console.log 'Usage: netlog.coffee ' - phantom.exit 1 -else - address = system.args[1] - page.onResourceRequested = (req) -> - console.log 'requested ' + JSON.stringify(req, undefined, 4) - - page.onResourceReceived = (res) -> - console.log 'received ' + JSON.stringify(res, undefined, 4) - - page.open address, (status) -> - if status isnt 'success' - console.log 'FAIL to load the address' - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netlog.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netlog.js deleted file mode 100644 index 4f83f4d..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netlog.js +++ /dev/null @@ -1,25 +0,0 @@ -var page = require('webpage').create(), - system = require('system'), - address; - -if (system.args.length === 1) { - console.log('Usage: netlog.js '); - phantom.exit(1); -} else { - address = system.args[1]; - - page.onResourceRequested = function (req) { - console.log('requested: ' + JSON.stringify(req, undefined, 4)); - }; - - page.onResourceReceived = function (res) { - console.log('received: ' + JSON.stringify(res, undefined, 4)); - }; - - page.open(address, function (status) { - if (status !== 'success') { - console.log('FAIL to load the address'); - } - phantom.exit(); - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netsniff.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netsniff.coffee deleted file mode 100644 index 092f2d2..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netsniff.coffee +++ /dev/null @@ -1,114 +0,0 @@ -if not Date::toISOString - Date::toISOString = -> - pad = (n) -> - if n < 10 then '0' + n else n - ms = (n) -> - if n < 10 then '00' + n else (if n < 100 then '0' + n else n) - @getFullYear() + '-' + - pad(@getMonth() + 1) + '-' + - pad(@getDate()) + 'T' + - pad(@getHours()) + ':' + - pad(@getMinutes()) + ':' + - pad(@getSeconds()) + '.' + - ms(@getMilliseconds()) + 'Z' - -createHAR = (address, title, startTime, resources) -> - entries = [] - - resources.forEach (resource) -> - request = resource.request - startReply = resource.startReply - endReply = resource.endReply - - if not request or not startReply or not endReply - return - - entries.push - startedDateTime: request.time.toISOString() - time: endReply.time - request.time - request: - method: request.method - url: request.url - httpVersion: 'HTTP/1.1' - cookies: [] - headers: request.headers - queryString: [] - headersSize: -1 - bodySize: -1 - - response: - status: endReply.status - statusText: endReply.statusText - httpVersion: 'HTTP/1.1' - cookies: [] - headers: endReply.headers - redirectURL: '' - headersSize: -1 - bodySize: startReply.bodySize - content: - size: startReply.bodySize - mimeType: endReply.contentType - - cache: {} - timings: - blocked: 0 - dns: -1 - connect: -1 - send: 0 - wait: startReply.time - request.time - receive: endReply.time - startReply.time - ssl: -1 - pageref: address - - log: - version: '1.2' - creator: - name: 'PhantomJS' - version: phantom.version.major + '.' + phantom.version.minor + '.' + phantom.version.patch - - pages: [ - startedDateTime: startTime.toISOString() - id: address - title: title - pageTimings: - onLoad: page.endTime - page.startTime - ] - entries: entries - -page = require('webpage').create() -system = require 'system' - -if system.args.length is 1 - console.log 'Usage: netsniff.coffee ' - phantom.exit 1 -else - page.address = system.args[1] - page.resources = [] - - page.onLoadStarted = -> - page.startTime = new Date() - - page.onResourceRequested = (req) -> - page.resources[req.id] = - request: req - startReply: null - endReply: null - - page.onResourceReceived = (res) -> - if res.stage is 'start' - page.resources[res.id].startReply = res - if res.stage is 'end' - page.resources[res.id].endReply = res - - page.open page.address, (status) -> - if status isnt 'success' - console.log 'FAIL to load the address' - phantom.exit(1) - else - page.endTime = new Date() - page.title = page.evaluate -> - document.title - - har = createHAR page.address, page.title, page.startTime, page.resources - console.log JSON.stringify har, undefined, 4 - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netsniff.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netsniff.js deleted file mode 100644 index b702543..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/netsniff.js +++ /dev/null @@ -1,143 +0,0 @@ -if (!Date.prototype.toISOString) { - Date.prototype.toISOString = function () { - function pad(n) { return n < 10 ? '0' + n : n; } - function ms(n) { return n < 10 ? '00'+ n : n < 100 ? '0' + n : n } - return this.getFullYear() + '-' + - pad(this.getMonth() + 1) + '-' + - pad(this.getDate()) + 'T' + - pad(this.getHours()) + ':' + - pad(this.getMinutes()) + ':' + - pad(this.getSeconds()) + '.' + - ms(this.getMilliseconds()) + 'Z'; - } -} - -function createHAR(address, title, startTime, resources) -{ - var entries = []; - - resources.forEach(function (resource) { - var request = resource.request, - startReply = resource.startReply, - endReply = resource.endReply; - - if (!request || !startReply || !endReply) { - return; - } - - // Exclude Data URI from HAR file because - // they aren't included in specification - if (request.url.match(/(^data:image\/.*)/i)) { - return; - } - - entries.push({ - startedDateTime: request.time.toISOString(), - time: endReply.time - request.time, - request: { - method: request.method, - url: request.url, - httpVersion: "HTTP/1.1", - cookies: [], - headers: request.headers, - queryString: [], - headersSize: -1, - bodySize: -1 - }, - response: { - status: endReply.status, - statusText: endReply.statusText, - httpVersion: "HTTP/1.1", - cookies: [], - headers: endReply.headers, - redirectURL: "", - headersSize: -1, - bodySize: startReply.bodySize, - content: { - size: startReply.bodySize, - mimeType: endReply.contentType - } - }, - cache: {}, - timings: { - blocked: 0, - dns: -1, - connect: -1, - send: 0, - wait: startReply.time - request.time, - receive: endReply.time - startReply.time, - ssl: -1 - }, - pageref: address - }); - }); - - return { - log: { - version: '1.2', - creator: { - name: "PhantomJS", - version: phantom.version.major + '.' + phantom.version.minor + - '.' + phantom.version.patch - }, - pages: [{ - startedDateTime: startTime.toISOString(), - id: address, - title: title, - pageTimings: { - onLoad: page.endTime - page.startTime - } - }], - entries: entries - } - }; -} - -var page = require('webpage').create(), - system = require('system'); - -if (system.args.length === 1) { - console.log('Usage: netsniff.js '); - phantom.exit(1); -} else { - - page.address = system.args[1]; - page.resources = []; - - page.onLoadStarted = function () { - page.startTime = new Date(); - }; - - page.onResourceRequested = function (req) { - page.resources[req.id] = { - request: req, - startReply: null, - endReply: null - }; - }; - - page.onResourceReceived = function (res) { - if (res.stage === 'start') { - page.resources[res.id].startReply = res; - } - if (res.stage === 'end') { - page.resources[res.id].endReply = res; - } - }; - - page.open(page.address, function (status) { - var har; - if (status !== 'success') { - console.log('FAIL to load the address'); - phantom.exit(1); - } else { - page.endTime = new Date(); - page.title = page.evaluate(function () { - return document.title; - }); - har = createHAR(page.address, page.title, page.startTime, page.resources); - console.log(JSON.stringify(har, undefined, 4)); - phantom.exit(); - } - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/outputEncoding.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/outputEncoding.coffee deleted file mode 100644 index 9d212ca..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/outputEncoding.coffee +++ /dev/null @@ -1,12 +0,0 @@ -helloWorld = () -> console.log phantom.outputEncoding + ": こんにちは、世界!" - -console.log "Using default encoding..." -helloWorld() - -console.log "\nUsing other encodings..." -for enc in ["euc-jp", "sjis", "utf8", "System"] - do (enc) -> - phantom.outputEncoding = enc - helloWorld() - -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/outputEncoding.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/outputEncoding.js deleted file mode 100644 index 968a6ee..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/outputEncoding.js +++ /dev/null @@ -1,16 +0,0 @@ -function helloWorld() { - console.log(phantom.outputEncoding + ": こんにちは、世界!"); -} - -console.log("Using default encoding..."); -helloWorld(); - -console.log("\nUsing other encodings..."); - -var encodings = ["euc-jp", "sjis", "utf8", "System"]; -for (var i = 0; i < encodings.length; i++) { - phantom.outputEncoding = encodings[i]; - helloWorld(); -} - -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/page_events.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/page_events.coffee deleted file mode 100644 index 87e433b..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/page_events.coffee +++ /dev/null @@ -1,132 +0,0 @@ -# The purpose of this is to show how and when events fire, considering 5 steps -# happening as follows: -# -# 1. Load URL -# 2. Load same URL, but adding an internal FRAGMENT to it -# 3. Click on an internal Link, that points to another internal FRAGMENT -# 4. Click on an external Link, that will send the page somewhere else -# 5. Close page -# -# Take particular care when going through the output, to understand when -# things happen (and in which order). Particularly, notice what DOESN'T -# happen during step 3. -# -# If invoked with "-v" it will print out the Page Resources as they are -# Requested and Received. -# -# NOTE.1: The "onConsoleMessage/onAlert/onPrompt/onConfirm" events are -# registered but not used here. This is left for you to have fun with. -# NOTE.2: This script is not here to teach you ANY JavaScript. It's aweful! -# NOTE.3: Main audience for this are people new to PhantomJS. -printArgs = -> - i = undefined - ilen = undefined - i = 0 - ilen = arguments_.length - - while i < ilen - console.log " arguments[" + i + "] = " + JSON.stringify(arguments_[i]) - ++i - console.log "" -sys = require("system") -page = require("webpage").create() -logResources = false -step1url = "http://en.wikipedia.org/wiki/DOM_events" -step2url = "http://en.wikipedia.org/wiki/DOM_events#Event_flow" -logResources = true if sys.args.length > 1 and sys.args[1] is "-v" - -#////////////////////////////////////////////////////////////////////////////// -page.onInitialized = -> - console.log "page.onInitialized" - printArgs.apply this, arguments_ - -page.onLoadStarted = -> - console.log "page.onLoadStarted" - printArgs.apply this, arguments_ - -page.onLoadFinished = -> - console.log "page.onLoadFinished" - printArgs.apply this, arguments_ - -page.onUrlChanged = -> - console.log "page.onUrlChanged" - printArgs.apply this, arguments_ - -page.onNavigationRequested = -> - console.log "page.onNavigationRequested" - printArgs.apply this, arguments_ - -if logResources is true - page.onResourceRequested = -> - console.log "page.onResourceRequested" - printArgs.apply this, arguments_ - - page.onResourceReceived = -> - console.log "page.onResourceReceived" - printArgs.apply this, arguments_ -page.onClosing = -> - console.log "page.onClosing" - printArgs.apply this, arguments_ - - -# window.console.log(msg); -page.onConsoleMessage = -> - console.log "page.onConsoleMessage" - printArgs.apply this, arguments_ - - -# window.alert(msg); -page.onAlert = -> - console.log "page.onAlert" - printArgs.apply this, arguments_ - - -# var confirmed = window.confirm(msg); -page.onConfirm = -> - console.log "page.onConfirm" - printArgs.apply this, arguments_ - - -# var user_value = window.prompt(msg, default_value); -page.onPrompt = -> - console.log "page.onPrompt" - printArgs.apply this, arguments_ - - -#////////////////////////////////////////////////////////////////////////////// -setTimeout (-> - console.log "" - console.log "### STEP 1: Load '" + step1url + "'" - page.open step1url -), 0 -setTimeout (-> - console.log "" - console.log "### STEP 2: Load '" + step2url + "' (load same URL plus FRAGMENT)" - page.open step2url -), 5000 -setTimeout (-> - console.log "" - console.log "### STEP 3: Click on page internal link (aka FRAGMENT)" - page.evaluate -> - ev = document.createEvent("MouseEvents") - ev.initEvent "click", true, true - document.querySelector("a[href='#Event_object']").dispatchEvent ev - -), 10000 -setTimeout (-> - console.log "" - console.log "### STEP 4: Click on page external link" - page.evaluate -> - ev = document.createEvent("MouseEvents") - ev.initEvent "click", true, true - document.querySelector("a[title='JavaScript']").dispatchEvent ev - -), 15000 -setTimeout (-> - console.log "" - console.log "### STEP 5: Close page and shutdown (with a delay)" - page.close() - setTimeout (-> - phantom.exit() - ), 100 -), 20000 \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/page_events.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/page_events.js deleted file mode 100644 index 266b404..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/page_events.js +++ /dev/null @@ -1,142 +0,0 @@ -// The purpose of this is to show how and when events fire, considering 5 steps -// happening as follows: -// -// 1. Load URL -// 2. Load same URL, but adding an internal FRAGMENT to it -// 3. Click on an internal Link, that points to another internal FRAGMENT -// 4. Click on an external Link, that will send the page somewhere else -// 5. Close page -// -// Take particular care when going through the output, to understand when -// things happen (and in which order). Particularly, notice what DOESN'T -// happen during step 3. -// -// If invoked with "-v" it will print out the Page Resources as they are -// Requested and Received. -// -// NOTE.1: The "onConsoleMessage/onAlert/onPrompt/onConfirm" events are -// registered but not used here. This is left for you to have fun with. -// NOTE.2: This script is not here to teach you ANY JavaScript. It's aweful! -// NOTE.3: Main audience for this are people new to PhantomJS. - -var sys = require("system"), - page = require("webpage").create(), - logResources = false, - step1url = "http://en.wikipedia.org/wiki/DOM_events", - step2url = "http://en.wikipedia.org/wiki/DOM_events#Event_flow"; - -if (sys.args.length > 1 && sys.args[1] === "-v") { - logResources = true; -} - -function printArgs() { - var i, ilen; - for (i = 0, ilen = arguments.length; i < ilen; ++i) { - console.log(" arguments[" + i + "] = " + JSON.stringify(arguments[i])); - } - console.log(""); -} - -//////////////////////////////////////////////////////////////////////////////// - -page.onInitialized = function() { - console.log("page.onInitialized"); - printArgs.apply(this, arguments); -}; -page.onLoadStarted = function() { - console.log("page.onLoadStarted"); - printArgs.apply(this, arguments); -}; -page.onLoadFinished = function() { - console.log("page.onLoadFinished"); - printArgs.apply(this, arguments); -}; -page.onUrlChanged = function() { - console.log("page.onUrlChanged"); - printArgs.apply(this, arguments); -}; -page.onNavigationRequested = function() { - console.log("page.onNavigationRequested"); - printArgs.apply(this, arguments); -}; - -if (logResources === true) { - page.onResourceRequested = function() { - console.log("page.onResourceRequested"); - printArgs.apply(this, arguments); - }; - page.onResourceReceived = function() { - console.log("page.onResourceReceived"); - printArgs.apply(this, arguments); - }; -} - -page.onClosing = function() { - console.log("page.onClosing"); - printArgs.apply(this, arguments); -}; - -// window.console.log(msg); -page.onConsoleMessage = function() { - console.log("page.onConsoleMessage"); - printArgs.apply(this, arguments); -}; - -// window.alert(msg); -page.onAlert = function() { - console.log("page.onAlert"); - printArgs.apply(this, arguments); -}; -// var confirmed = window.confirm(msg); -page.onConfirm = function() { - console.log("page.onConfirm"); - printArgs.apply(this, arguments); -}; -// var user_value = window.prompt(msg, default_value); -page.onPrompt = function() { - console.log("page.onPrompt"); - printArgs.apply(this, arguments); -}; - -//////////////////////////////////////////////////////////////////////////////// - -setTimeout(function() { - console.log(""); - console.log("### STEP 1: Load '" + step1url + "'"); - page.open(step1url); -}, 0); - -setTimeout(function() { - console.log(""); - console.log("### STEP 2: Load '" + step2url + "' (load same URL plus FRAGMENT)"); - page.open(step2url); -}, 5000); - -setTimeout(function() { - console.log(""); - console.log("### STEP 3: Click on page internal link (aka FRAGMENT)"); - page.evaluate(function() { - var ev = document.createEvent("MouseEvents"); - ev.initEvent("click", true, true); - document.querySelector("a[href='#Event_object']").dispatchEvent(ev); - }); -}, 10000); - -setTimeout(function() { - console.log(""); - console.log("### STEP 4: Click on page external link"); - page.evaluate(function() { - var ev = document.createEvent("MouseEvents"); - ev.initEvent("click", true, true); - document.querySelector("a[title='JavaScript']").dispatchEvent(ev); - }); -}, 15000); - -setTimeout(function() { - console.log(""); - console.log("### STEP 5: Close page and shutdown (with a delay)"); - page.close(); - setTimeout(function(){ - phantom.exit(); - }, 100); -}, 20000); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee deleted file mode 100644 index 1af7a79..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee +++ /dev/null @@ -1,16 +0,0 @@ -p = require("webpage").create() - -p.onConsoleMessage = (msg) -> - console.log msg - -# Calls to "callPhantom" within the page 'p' arrive here -p.onCallback = (msg) -> - console.log "Received by the 'phantom' main context: " + msg - "Hello there, I'm coming to you from the 'phantom' context instead" - -p.evaluate -> - # Return-value of the "onCallback" handler arrive here - callbackResponse = window.callPhantom "Hello, I'm coming to you from the 'page' context" - console.log "Received by the 'page' context: " + callbackResponse - -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pagecallback.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pagecallback.js deleted file mode 100644 index 20c13b6..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pagecallback.js +++ /dev/null @@ -1,17 +0,0 @@ -var p = require("webpage").create(); - -p.onConsoleMessage = function(msg) { console.log(msg); }; - -// Calls to "callPhantom" within the page 'p' arrive here -p.onCallback = function(msg) { - console.log("Received by the 'phantom' main context: "+msg); - return "Hello there, I'm coming to you from the 'phantom' context instead"; -}; - -p.evaluate(function() { - // Return-value of the "onCallback" handler arrive here - var callbackResponse = window.callPhantom("Hello, I'm coming to you from the 'page' context"); - console.log("Received by the 'page' context: "+callbackResponse); -}); - -phantom.exit(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.coffee deleted file mode 100644 index 0c89ca7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.coffee +++ /dev/null @@ -1,13 +0,0 @@ -# Read the Phantom webpage '#intro' element text using jQuery and "includeJs" - -page = require('webpage').create() - -page.onConsoleMessage = (msg) -> console.log msg - -page.open "http://www.phantomjs.org", (status) -> - if status is "success" - page.includeJs "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", -> - page.evaluate -> - console.log "$(\"#intro\").text() -> " + $("#intro").text() - phantom.exit() - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js deleted file mode 100644 index 6bf5a9f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/phantomwebintro.js +++ /dev/null @@ -1,19 +0,0 @@ -// Read the Phantom webpage '#intro' element text using jQuery and "includeJs" - -var page = require('webpage').create(); - -page.onConsoleMessage = function(msg) { - console.log(msg); -}; - -page.open("http://www.phantomjs.org", function(status) { - if ( status === "success" ) { - page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() { - page.evaluate(function() { - console.log("$(\"#intro\").text() -> " + $("#intro").text()); - }); - phantom.exit(); - }); - } -}); - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pizza.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pizza.coffee deleted file mode 100644 index 6e97db7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pizza.coffee +++ /dev/null @@ -1,18 +0,0 @@ -# Find pizza in Mountain View using Yelp - -page = require('webpage').create() -url = 'http://lite.yelp.com/search?find_desc=pizza&find_loc=94040&find_submit=Search' - -page.open url, - (status) -> - if status isnt 'success' - console.log 'Unable to access network' - else - results = page.evaluate -> - pizza = [] - list = document.querySelectorAll 'address' - for item in list - pizza.push(item.innerText) - return pizza - console.log results.join('\n') - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pizza.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pizza.js deleted file mode 100644 index 3e1af15..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/pizza.js +++ /dev/null @@ -1,20 +0,0 @@ -// Find pizza in Mountain View using Yelp - -var page = require('webpage').create(), - url = 'http://lite.yelp.com/search?find_desc=pizza&find_loc=94040&find_submit=Search'; - -page.open(url, function (status) { - if (status !== 'success') { - console.log('Unable to access network'); - } else { - var results = page.evaluate(function() { - var list = document.querySelectorAll('address'), pizza = [], i; - for (i = 0; i < list.length; i++) { - pizza.push(list[i].innerText); - } - return pizza; - }); - console.log(results.join('\n')); - } - phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/post.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/post.coffee deleted file mode 100644 index c3c5787..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/post.coffee +++ /dev/null @@ -1,12 +0,0 @@ -# Example using HTTP POST operation - -page = require('webpage').create() -server = 'http://posttestserver.com/post.php?dump' -data = 'universe=expanding&answer=42' - -page.open server, 'post', data, (status) -> - if status isnt 'success' - console.log 'Unable to post!' - else - console.log page.content - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/post.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/post.js deleted file mode 100644 index 3868915..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/post.js +++ /dev/null @@ -1,14 +0,0 @@ -// Example using HTTP POST operation - -var page = require('webpage').create(), - server = 'http://posttestserver.com/post.php?dump', - data = 'universe=expanding&answer=42'; - -page.open(server, 'post', data, function (status) { - if (status !== 'success') { - console.log('Unable to post!'); - } else { - console.log(page.content); - } - phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/postserver.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/postserver.coffee deleted file mode 100644 index 2dcd507..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/postserver.coffee +++ /dev/null @@ -1,25 +0,0 @@ -# Example using HTTP POST operation -page = require("webpage").create() -server = require("webserver").create() -system = require("system") -data = "universe=expanding&answer=42" -if system.args.length isnt 2 - console.log "Usage: postserver.js " - phantom.exit 1 -port = system.args[1] -service = server.listen(port, (request, response) -> - console.log "Request received at " + new Date() - response.statusCode = 200 - response.headers = - Cache: "no-cache" - "Content-Type": "text/plain;charset=utf-8" - - response.write JSON.stringify(request, null, 4) - response.close() -) -page.open "http://localhost:" + port + "/", "post", data, (status) -> - if status isnt "success" - console.log "Unable to post!" - else - console.log page.plainText - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/postserver.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/postserver.js deleted file mode 100644 index e3dd19f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/postserver.js +++ /dev/null @@ -1,34 +0,0 @@ -// Example using HTTP POST operation - -var page = require('webpage').create(), - server = require('webserver').create(), - system = require('system'), - data = 'universe=expanding&answer=42'; - -if (system.args.length !== 2) { - console.log('Usage: postserver.js '); - phantom.exit(1); -} - -var port = system.args[1]; - -service = server.listen(port, function (request, response) { - console.log('Request received at ' + new Date()); - - response.statusCode = 200; - response.headers = { - 'Cache': 'no-cache', - 'Content-Type': 'text/plain;charset=utf-8' - }; - response.write(JSON.stringify(request, null, 4)); - response.close(); -}); - -page.open('http://localhost:' + port + '/', 'post', data, function (status) { - if (status !== 'success') { - console.log('Unable to post!'); - } else { - console.log(page.plainText); - } - phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printenv.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printenv.coffee deleted file mode 100644 index 80ec5f0..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printenv.coffee +++ /dev/null @@ -1,6 +0,0 @@ -system = require("system") -env = system.env -key = undefined -for key of env - console.log key + "=" + env[key] if env.hasOwnProperty(key) -phantom.exit() \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printenv.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printenv.js deleted file mode 100644 index 6baea03..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printenv.js +++ /dev/null @@ -1,10 +0,0 @@ -var system = require('system'), - env = system.env, - key; - -for (key in env) { - if (env.hasOwnProperty(key)) { - console.log(key + '=' + env[key]); - } -} -phantom.exit(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printheaderfooter.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printheaderfooter.coffee deleted file mode 100644 index fd82b34..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printheaderfooter.coffee +++ /dev/null @@ -1,88 +0,0 @@ -someCallback = (pageNum, numPages) -> - "

              someCallback: " + pageNum + " / " + numPages + "

              " -page = require("webpage").create() -system = require("system") -if system.args.length < 3 - console.log "Usage: printheaderfooter.js URL filename" - phantom.exit 1 -else - address = system.args[1] - output = system.args[2] - page.viewportSize = - width: 600 - height: 600 - - page.paperSize = - format: "A4" - margin: "1cm" - - # default header/footer for pages that don't have custom overwrites (see below) - header: - height: "1cm" - contents: phantom.callback((pageNum, numPages) -> - return "" if pageNum is 1 - "

              Header " + pageNum + " / " + numPages + "

              " - ) - - footer: - height: "1cm" - contents: phantom.callback((pageNum, numPages) -> - return "" if pageNum is numPages - "

              Footer " + pageNum + " / " + numPages + "

              " - ) - - page.open address, (status) -> - if status isnt "success" - console.log "Unable to load the address!" - else - - # check whether the loaded page overwrites the header/footer setting, - # i.e. whether a PhantomJSPriting object exists. Use that then instead - # of our defaults above. - # - # example: - # - # - # - # - #

              asdfadsf

              asdfadsfycvx

              - # - # - if page.evaluate(-> - typeof PhantomJSPrinting is "object" - ) - paperSize = page.paperSize - paperSize.header.height = page.evaluate(-> - PhantomJSPrinting.header.height - ) - paperSize.header.contents = phantom.callback((pageNum, numPages) -> - page.evaluate ((pageNum, numPages) -> - PhantomJSPrinting.header.contents pageNum, numPages - ), pageNum, numPages - ) - paperSize.footer.height = page.evaluate(-> - PhantomJSPrinting.footer.height - ) - paperSize.footer.contents = phantom.callback((pageNum, numPages) -> - page.evaluate ((pageNum, numPages) -> - PhantomJSPrinting.footer.contents pageNum, numPages - ), pageNum, numPages - ) - page.paperSize = paperSize - console.log page.paperSize.header.height - console.log page.paperSize.footer.height - window.setTimeout (-> - page.render output - phantom.exit() - ), 200 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printheaderfooter.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printheaderfooter.js deleted file mode 100644 index 01f8a01..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printheaderfooter.js +++ /dev/null @@ -1,89 +0,0 @@ -var page = require('webpage').create(), - system = require('system'); - -function someCallback(pageNum, numPages) { - return "

              someCallback: " + pageNum + " / " + numPages + "

              "; -} - -if (system.args.length < 3) { - console.log('Usage: printheaderfooter.js URL filename'); - phantom.exit(1); -} else { - var address = system.args[1]; - var output = system.args[2]; - page.viewportSize = { width: 600, height: 600 }; - page.paperSize = { - format: 'A4', - margin: "1cm", - /* default header/footer for pages that don't have custom overwrites (see below) */ - header: { - height: "1cm", - contents: phantom.callback(function(pageNum, numPages) { - if (pageNum == 1) { - return ""; - } - return "

              Header " + pageNum + " / " + numPages + "

              "; - }) - }, - footer: { - height: "1cm", - contents: phantom.callback(function(pageNum, numPages) { - if (pageNum == numPages) { - return ""; - } - return "

              Footer " + pageNum + " / " + numPages + "

              "; - }) - } - }; - page.open(address, function (status) { - if (status !== 'success') { - console.log('Unable to load the address!'); - } else { - /* check whether the loaded page overwrites the header/footer setting, - i.e. whether a PhantomJSPriting object exists. Use that then instead - of our defaults above. - - example: - - - - -

              asdfadsf

              asdfadsfycvx

              - - */ - if (page.evaluate(function(){return typeof PhantomJSPrinting == "object";})) { - paperSize = page.paperSize; - paperSize.header.height = page.evaluate(function() { - return PhantomJSPrinting.header.height; - }); - paperSize.header.contents = phantom.callback(function(pageNum, numPages) { - return page.evaluate(function(pageNum, numPages){return PhantomJSPrinting.header.contents(pageNum, numPages);}, pageNum, numPages); - }); - paperSize.footer.height = page.evaluate(function() { - return PhantomJSPrinting.footer.height; - }); - paperSize.footer.contents = phantom.callback(function(pageNum, numPages) { - return page.evaluate(function(pageNum, numPages){return PhantomJSPrinting.footer.contents(pageNum, numPages);}, pageNum, numPages); - }); - page.paperSize = paperSize; - console.log(page.paperSize.header.height); - console.log(page.paperSize.footer.height); - } - window.setTimeout(function () { - page.render(output); - phantom.exit(); - }, 200); - } - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printmargins.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printmargins.coffee deleted file mode 100644 index 5be7ced..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printmargins.coffee +++ /dev/null @@ -1,33 +0,0 @@ -page = require("webpage").create() -system = require("system") -if system.args.length < 7 - console.log "Usage: printmargins.js URL filename LEFT TOP RIGHT BOTTOM" - console.log " margin examples: \"1cm\", \"10px\", \"7mm\", \"5in\"" - phantom.exit 1 -else - address = system.args[1] - output = system.args[2] - marginLeft = system.args[3] - marginTop = system.args[4] - marginRight = system.args[5] - marginBottom = system.args[6] - page.viewportSize = - width: 600 - height: 600 - - page.paperSize = - format: "A4" - margin: - left: marginLeft - top: marginTop - right: marginRight - bottom: marginBottom - - page.open address, (status) -> - if status isnt "success" - console.log "Unable to load the address!" - else - window.setTimeout (-> - page.render output - phantom.exit() - ), 200 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printmargins.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printmargins.js deleted file mode 100644 index 89b48b4..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/printmargins.js +++ /dev/null @@ -1,35 +0,0 @@ -var page = require('webpage').create(), - system = require('system'); - -if (system.args.length < 7) { - console.log('Usage: printmargins.js URL filename LEFT TOP RIGHT BOTTOM'); - console.log(' margin examples: "1cm", "10px", "7mm", "5in"'); - phantom.exit(1); -} else { - var address = system.args[1]; - var output = system.args[2]; - var marginLeft = system.args[3]; - var marginTop = system.args[4]; - var marginRight = system.args[5]; - var marginBottom = system.args[6]; - page.viewportSize = { width: 600, height: 600 }; - page.paperSize = { - format: 'A4', - margin: { - left: marginLeft, - top: marginTop, - right: marginRight, - bottom: marginBottom - } - }; - page.open(address, function (status) { - if (status !== 'success') { - console.log('Unable to load the address!'); - } else { - window.setTimeout(function () { - page.render(output); - phantom.exit(); - }, 200); - } - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/rasterize.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/rasterize.coffee deleted file mode 100644 index aa06dbd..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/rasterize.coffee +++ /dev/null @@ -1,23 +0,0 @@ -page = require('webpage').create() -system = require 'system' - -if system.args.length < 3 or system.args.length > 4 - console.log 'Usage: rasterize.coffee URL filename [paperwidth*paperheight|paperformat]' - console.log ' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"' - phantom.exit 1 -else - address = system.args[1] - output = system.args[2] - page.viewportSize = { width: 600, height: 600 } - if system.args.length is 4 and system.args[2].substr(-4) is ".pdf" - size = system.args[3].split '*' - if size.length is 2 - page.paperSize = { width: size[0], height: size[1], border: '0px' } - else - page.paperSize = { format: system.args[3], orientation: 'portrait', border: '1cm' } - page.open address, (status) -> - if status isnt 'success' - console.log 'Unable to load the address!' - phantom.exit() - else - window.setTimeout (-> page.render output; phantom.exit()), 200 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/rasterize.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/rasterize.js deleted file mode 100644 index 165bcfa..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/rasterize.js +++ /dev/null @@ -1,32 +0,0 @@ -var page = require('webpage').create(), - system = require('system'), - address, output, size; - -if (system.args.length < 3 || system.args.length > 5) { - console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]'); - console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); - phantom.exit(1); -} else { - address = system.args[1]; - output = system.args[2]; - page.viewportSize = { width: 600, height: 600 }; - if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") { - size = system.args[3].split('*'); - page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' } - : { format: system.args[3], orientation: 'portrait', margin: '1cm' }; - } - if (system.args.length > 4) { - page.zoomFactor = system.args[4]; - } - page.open(address, function (status) { - if (status !== 'success') { - console.log('Unable to load the address!'); - phantom.exit(); - } else { - window.setTimeout(function () { - page.render(output); - phantom.exit(); - }, 200); - } - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/render_multi_url.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/render_multi_url.coffee deleted file mode 100644 index 29afa48..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/render_multi_url.coffee +++ /dev/null @@ -1,60 +0,0 @@ -# Render Multiple URLs to file - -system = require("system") - -# Render given urls -# @param array of URLs to render -# @param callbackPerUrl Function called after finishing each URL, including the last URL -# @param callbackFinal Function called after finishing everything -RenderUrlsToFile = (urls, callbackPerUrl, callbackFinal) -> - urlIndex = 0 # only for easy file naming - webpage = require("webpage") - page = null - getFilename = -> - "rendermulti-" + urlIndex + ".png" - - next = (status, url, file) -> - page.close() - callbackPerUrl status, url, file - retrieve() - - retrieve = -> - if urls.length > 0 - url = urls.shift() - urlIndex++ - page = webpage.create() - page.viewportSize = - width: 800 - height: 600 - - page.settings.userAgent = "Phantom.js bot" - page.open "http://" + url, (status) -> - file = getFilename() - if status is "success" - window.setTimeout (-> - page.render file - next status, url, file - ), 200 - else - next status, url, file - - else - callbackFinal() - - retrieve() -arrayOfUrls = null -if system.args.length > 1 - arrayOfUrls = Array::slice.call(system.args, 1) -else - # Default (no args passed) - console.log "Usage: phantomjs render_multi_url.js [domain.name1, domain.name2, ...]" - arrayOfUrls = ["www.google.com", "www.bbc.co.uk", "www.phantomjs.org"] - -RenderUrlsToFile arrayOfUrls, ((status, url, file) -> - if status isnt "success" - console.log "Unable to render '" + url + "'" - else - console.log "Rendered '" + url + "' at '" + file + "'" -), -> - phantom.exit() - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/render_multi_url.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/render_multi_url.js deleted file mode 100644 index df09813..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/render_multi_url.js +++ /dev/null @@ -1,73 +0,0 @@ -// Render Multiple URLs to file - -var RenderUrlsToFile, arrayOfUrls, system; - -system = require("system"); - -/* -Render given urls -@param array of URLs to render -@param callbackPerUrl Function called after finishing each URL, including the last URL -@param callbackFinal Function called after finishing everything -*/ -RenderUrlsToFile = function(urls, callbackPerUrl, callbackFinal) { - var getFilename, next, page, retrieve, urlIndex, webpage; - urlIndex = 0; - webpage = require("webpage"); - page = null; - getFilename = function() { - return "rendermulti-" + urlIndex + ".png"; - }; - next = function(status, url, file) { - page.close(); - callbackPerUrl(status, url, file); - return retrieve(); - }; - retrieve = function() { - var url; - if (urls.length > 0) { - url = urls.shift(); - urlIndex++; - page = webpage.create(); - page.viewportSize = { - width: 800, - height: 600 - }; - page.settings.userAgent = "Phantom.js bot"; - return page.open("http://" + url, function(status) { - var file; - file = getFilename(); - if (status === "success") { - return window.setTimeout((function() { - page.render(file); - return next(status, url, file); - }), 200); - } else { - return next(status, url, file); - } - }); - } else { - return callbackFinal(); - } - }; - return retrieve(); -}; - -arrayOfUrls = null; - -if (system.args.length > 1) { - arrayOfUrls = Array.prototype.slice.call(system.args, 1); -} else { - console.log("Usage: phantomjs render_multi_url.js [domain.name1, domain.name2, ...]"); - arrayOfUrls = ["www.google.com", "www.bbc.co.uk", "www.phantomjs.org"]; -} - -RenderUrlsToFile(arrayOfUrls, (function(status, url, file) { - if (status !== "success") { - return console.log("Unable to render '" + url + "'"); - } else { - return console.log("Rendered '" + url + "' at '" + file + "'"); - } -}), function() { - return phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-jasmine.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-jasmine.coffee deleted file mode 100644 index 22fb932..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-jasmine.coffee +++ /dev/null @@ -1,61 +0,0 @@ -system = require 'system' - -## -# Wait until the test condition is true or a timeout occurs. Useful for waiting -# on a server response or for a ui change (fadeIn, etc.) to occur. -# -# @param testFx javascript condition that evaluates to a boolean, -# it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or -# as a callback function. -# @param onReady what to do when testFx condition is fulfilled, -# it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or -# as a callback function. -# @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. -## -waitFor = (testFx, onReady, timeOutMillis=3000) -> - start = new Date().getTime() - condition = false - f = -> - if (new Date().getTime() - start < timeOutMillis) and not condition - # If not time-out yet and condition not yet fulfilled - condition = (if typeof testFx is 'string' then eval testFx else testFx()) #< defensive code - else - if not condition - # If condition still not fulfilled (timeout but condition is 'false') - console.log "'waitFor()' timeout" - phantom.exit 1 - else - # Condition fulfilled (timeout and/or condition is 'true') - console.log "'waitFor()' finished in #{new Date().getTime() - start}ms." - if typeof onReady is 'string' then eval onReady else onReady() #< Do what it's supposed to do once the condition is fulfilled - clearInterval interval #< Stop this interval - interval = setInterval f, 100 #< repeat check every 100ms - -if system.args.length isnt 2 - console.log 'Usage: run-jasmine.coffee URL' - phantom.exit 1 - -page = require('webpage').create() - -# Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") -page.onConsoleMessage = (msg) -> - console.log msg - -page.open system.args[1], (status) -> - if status isnt 'success' - console.log 'Unable to access network' - phantom.exit() - else - waitFor -> - page.evaluate -> - if document.body.querySelector '.finished-at' - return true - return false - , -> - page.evaluate -> - console.log document.body.querySelector('.description').innerText - list = document.body.querySelectorAll('.failed > .description, .failed > .messages > .resultMessage') - for el in list - console.log el.innerText - - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-jasmine.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-jasmine.js deleted file mode 100644 index 3872824..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-jasmine.js +++ /dev/null @@ -1,86 +0,0 @@ -var system = require('system'); - -/** - * Wait until the test condition is true or a timeout occurs. Useful for waiting - * on a server response or for a ui change (fadeIn, etc.) to occur. - * - * @param testFx javascript condition that evaluates to a boolean, - * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or - * as a callback function. - * @param onReady what to do when testFx condition is fulfilled, - * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or - * as a callback function. - * @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. - */ -function waitFor(testFx, onReady, timeOutMillis) { - var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3001, //< Default Max Timeout is 3s - start = new Date().getTime(), - condition = false, - interval = setInterval(function() { - if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) { - // If not time-out yet and condition not yet fulfilled - condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code - } else { - if(!condition) { - // If condition still not fulfilled (timeout but condition is 'false') - console.log("'waitFor()' timeout"); - phantom.exit(1); - } else { - // Condition fulfilled (timeout and/or condition is 'true') - console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms."); - typeof(onReady) === "string" ? eval(onReady) : onReady(); //< Do what it's supposed to do once the condition is fulfilled - clearInterval(interval); //< Stop this interval - } - } - }, 100); //< repeat check every 100ms -}; - - -if (system.args.length !== 2) { - console.log('Usage: run-jasmine.js URL'); - phantom.exit(1); -} - -var page = require('webpage').create(); - -// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") -page.onConsoleMessage = function(msg) { - console.log(msg); -}; - -page.open(system.args[1], function(status){ - if (status !== "success") { - console.log("Unable to access network"); - phantom.exit(); - } else { - waitFor(function(){ - return page.evaluate(function(){ - return document.body.querySelector('.symbolSummary .pending') === null - }); - }, function(){ - var exitCode = page.evaluate(function(){ - console.log(''); - console.log(document.body.querySelector('.description').innerText); - var list = document.body.querySelectorAll('.results > #details > .specDetail.failed'); - if (list && list.length > 0) { - console.log(''); - console.log(list.length + ' test(s) FAILED:'); - for (i = 0; i < list.length; ++i) { - var el = list[i], - desc = el.querySelector('.description'), - msg = el.querySelector('.resultMessage.fail'); - console.log(''); - console.log(desc.innerText); - console.log(msg.innerText); - console.log(''); - } - return 1; - } else { - console.log(document.body.querySelector('.alert > .passingAlert.bar').innerText); - return 0; - } - }); - phantom.exit(exitCode); - }); - } -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-qunit.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-qunit.coffee deleted file mode 100644 index dcb24b9..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-qunit.coffee +++ /dev/null @@ -1,64 +0,0 @@ -system = require 'system' - -## -# Wait until the test condition is true or a timeout occurs. Useful for waiting -# on a server response or for a ui change (fadeIn, etc.) to occur. -# -# @param testFx javascript condition that evaluates to a boolean, -# it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or -# as a callback function. -# @param onReady what to do when testFx condition is fulfilled, -# it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or -# as a callback function. -# @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. -## -waitFor = (testFx, onReady, timeOutMillis=3000) -> - start = new Date().getTime() - condition = false - f = -> - if (new Date().getTime() - start < timeOutMillis) and not condition - # If not time-out yet and condition not yet fulfilled - condition = (if typeof testFx is 'string' then eval testFx else testFx()) #< defensive code - else - if not condition - # If condition still not fulfilled (timeout but condition is 'false') - console.log "'waitFor()' timeout" - phantom.exit 1 - else - # Condition fulfilled (timeout and/or condition is 'true') - console.log "'waitFor()' finished in #{new Date().getTime() - start}ms." - if typeof onReady is 'string' then eval onReady else onReady() #< Do what it's supposed to do once the condition is fulfilled - clearInterval interval #< Stop this interval - interval = setInterval f, 100 #< repeat check every 100ms - -if system.args.length isnt 2 - console.log 'Usage: run-qunit.coffee URL' - phantom.exit 1 - -page = require('webpage').create() - -# Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") -page.onConsoleMessage = (msg) -> - console.log msg - -page.open system.args[1], (status) -> - if status isnt 'success' - console.log 'Unable to access network' - phantom.exit 1 - else - waitFor -> - page.evaluate -> - el = document.getElementById 'qunit-testresult' - if el and el.innerText.match 'completed' - return true - return false - , -> - failedNum = page.evaluate -> - el = document.getElementById 'qunit-testresult' - console.log el.innerText - try - return el.getElementsByClassName('failed')[0].innerHTML - catch e - return 10000 - - phantom.exit if parseInt(failedNum, 10) > 0 then 1 else 0 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-qunit.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-qunit.js deleted file mode 100644 index d7df0c3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/run-qunit.js +++ /dev/null @@ -1,76 +0,0 @@ -var system = require('system'); - -/** - * Wait until the test condition is true or a timeout occurs. Useful for waiting - * on a server response or for a ui change (fadeIn, etc.) to occur. - * - * @param testFx javascript condition that evaluates to a boolean, - * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or - * as a callback function. - * @param onReady what to do when testFx condition is fulfilled, - * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or - * as a callback function. - * @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. - */ -function waitFor(testFx, onReady, timeOutMillis) { - var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3001, //< Default Max Timout is 3s - start = new Date().getTime(), - condition = false, - interval = setInterval(function() { - if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) { - // If not time-out yet and condition not yet fulfilled - condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code - } else { - if(!condition) { - // If condition still not fulfilled (timeout but condition is 'false') - console.log("'waitFor()' timeout"); - phantom.exit(1); - } else { - // Condition fulfilled (timeout and/or condition is 'true') - console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms."); - typeof(onReady) === "string" ? eval(onReady) : onReady(); //< Do what it's supposed to do once the condition is fulfilled - clearInterval(interval); //< Stop this interval - } - } - }, 100); //< repeat check every 250ms -}; - - -if (system.args.length !== 2) { - console.log('Usage: run-qunit.js URL'); - phantom.exit(1); -} - -var page = require('webpage').create(); - -// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") -page.onConsoleMessage = function(msg) { - console.log(msg); -}; - -page.open(system.args[1], function(status){ - if (status !== "success") { - console.log("Unable to access network"); - phantom.exit(1); - } else { - waitFor(function(){ - return page.evaluate(function(){ - var el = document.getElementById('qunit-testresult'); - if (el && el.innerText.match('completed')) { - return true; - } - return false; - }); - }, function(){ - var failedNum = page.evaluate(function(){ - var el = document.getElementById('qunit-testresult'); - console.log(el.innerText); - try { - return el.getElementsByClassName('failed')[0].innerHTML; - } catch (e) { } - return 10000; - }); - phantom.exit((parseInt(failedNum, 10) > 0) ? 1 : 0); - }); - } -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/scandir.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/scandir.coffee deleted file mode 100644 index 0ee4ffc..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/scandir.coffee +++ /dev/null @@ -1,16 +0,0 @@ -# List all the files in a Tree of Directories -system = require 'system' - -if system.args.length != 2 - console.log "Usage: phantomjs scandir.coffee DIRECTORY_TO_SCAN" - phantom.exit 1 -scanDirectory = (path) -> - fs = require 'fs' - if fs.exists(path) and fs.isFile(path) - console.log path - else if fs.isDirectory(path) - fs.list(path).forEach (e) -> - scanDirectory path + "/" + e if e != "." and e != ".." - -scanDirectory system.args[1] -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/scandir.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/scandir.js deleted file mode 100644 index 0b9f9e1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/scandir.js +++ /dev/null @@ -1,22 +0,0 @@ -// List all the files in a Tree of Directories -var system = require('system'); - -if (system.args.length !== 2) { - console.log("Usage: phantomjs scandir.js DIRECTORY_TO_SCAN"); - phantom.exit(1); -} - -var scanDirectory = function (path) { - var fs = require('fs'); - if (fs.exists(path) && fs.isFile(path)) { - console.log(path); - } else if (fs.isDirectory(path)) { - fs.list(path).forEach(function (e) { - if ( e !== "." && e !== ".." ) { //< Avoid loops - scanDirectory(path + '/' + e); - } - }); - } -}; -scanDirectory(system.args[1]); -phantom.exit(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/seasonfood.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/seasonfood.coffee deleted file mode 100644 index 5228c26..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/seasonfood.coffee +++ /dev/null @@ -1,17 +0,0 @@ -# Show BBC seasonal food list. - -window.cbfunc = (data) -> - list = data.query.results.results.result - names = ['January', 'February', 'March', - 'April', 'May', 'June', - 'July', 'August', 'September', - 'October', 'November', 'December'] - for item in list - console.log [item.name.replace(/\s/ig, ' '), ':', - names[item.atItsBestUntil], 'to', - names[item.atItsBestFrom]].join(' ') - phantom.exit() - -el = document.createElement 'script' -el.src = 'http://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20bbc.goodfood.seasonal%3B&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=window.cbfunc' -document.body.appendChild el diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/seasonfood.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/seasonfood.js deleted file mode 100644 index f827d46..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/seasonfood.js +++ /dev/null @@ -1,19 +0,0 @@ -// Show BBC seasonal food list. - -var cbfunc = function (data) { - var list = data.query.results.results.result, - names = ['January', 'February', 'March', - 'April', 'May', 'June', - 'July', 'August', 'September', - 'October', 'November', 'December']; - list.forEach(function (item) { - console.log([item.name.replace(/\s/ig, ' '), ':', - names[item.atItsBestUntil], 'to', - names[item.atItsBestFrom]].join(' ')); - }); - phantom.exit(); -}; - -var el = document.createElement('script'); -el.src = 'http://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20bbc.goodfood.seasonal%3B&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=cbfunc'; -document.body.appendChild(el); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/server.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/server.coffee deleted file mode 100644 index 96abdb9..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/server.coffee +++ /dev/null @@ -1,45 +0,0 @@ -page = require("webpage").create() -server = require("webserver").create() -system = require("system") -host = undefined -port = undefined -if system.args.length isnt 2 - console.log "Usage: server.js " - phantom.exit 1 -else - port = system.args[1] - listening = server.listen(port, (request, response) -> - console.log "GOT HTTP REQUEST" - console.log JSON.stringify(request, null, 4) - - # we set the headers here - response.statusCode = 200 - response.headers = - Cache: "no-cache" - "Content-Type": "text/html" - - - # this is also possible: - response.setHeader "foo", "bar" - - # now we write the body - # note: the headers above will now be sent implictly - response.write "YES!" - - # note: writeBody can be called multiple times - response.write "

              pretty cool :)" - response.close() - ) - unless listening - console.log "could not create web server listening on port " + port - phantom.exit() - url = "http://localhost:" + port + "/foo/bar.php?asdf=true" - console.log "SENDING REQUEST TO:" - console.log url - page.open url, (status) -> - if status isnt "success" - console.log "FAIL to load the address" - else - console.log "GOT REPLY FROM SERVER:" - console.log page.content - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/server.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/server.js deleted file mode 100644 index fd725d7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/server.js +++ /dev/null @@ -1,43 +0,0 @@ -var page = require('webpage').create(); -var server = require('webserver').create(); -var system = require('system'); -var host, port; - -if (system.args.length !== 2) { - console.log('Usage: server.js '); - phantom.exit(1); -} else { - port = system.args[1]; - var listening = server.listen(port, function (request, response) { - console.log("GOT HTTP REQUEST"); - console.log(JSON.stringify(request, null, 4)); - - // we set the headers here - response.statusCode = 200; - response.headers = {"Cache": "no-cache", "Content-Type": "text/html"}; - // this is also possible: - response.setHeader("foo", "bar"); - // now we write the body - // note: the headers above will now be sent implictly - response.write("YES!"); - // note: writeBody can be called multiple times - response.write("

              pretty cool :)"); - response.close(); - }); - if (!listening) { - console.log("could not create web server listening on port " + port); - phantom.exit(); - } - var url = "http://localhost:" + port + "/foo/bar.php?asdf=true"; - console.log("SENDING REQUEST TO:"); - console.log(url); - page.open(url, function (status) { - if (status !== 'success') { - console.log('FAIL to load the address'); - } else { - console.log("GOT REPLY FROM SERVER:"); - console.log(page.content); - } - phantom.exit(); - }); -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/serverkeepalive.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/serverkeepalive.coffee deleted file mode 100644 index ed33224..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/serverkeepalive.coffee +++ /dev/null @@ -1,32 +0,0 @@ -port = undefined -server = undefined -service = undefined -system = require("system") -if system.args.length isnt 2 - console.log "Usage: serverkeepalive.js " - phantom.exit 1 -else - port = system.args[1] - server = require("webserver").create() - service = server.listen(port, - keepAlive: true - , (request, response) -> - console.log "Request at " + new Date() - console.log JSON.stringify(request, null, 4) - body = JSON.stringify(request, null, 4) - response.statusCode = 200 - response.headers = - Cache: "no-cache" - "Content-Type": "text/plain" - Connection: "Keep-Alive" - "Keep-Alive": "timeout=5, max=100" - "Content-Length": body.length - - response.write body - response.close() - ) - if service - console.log "Web server running on port " + port - else - console.log "Error: Could not create web server listening on port " + port - phantom.exit() \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/serverkeepalive.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/serverkeepalive.js deleted file mode 100644 index ed474d8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/serverkeepalive.js +++ /dev/null @@ -1,34 +0,0 @@ -var port, server, service, - system = require('system'); - -if (system.args.length !== 2) { - console.log('Usage: serverkeepalive.js '); - phantom.exit(1); -} else { - port = system.args[1]; - server = require('webserver').create(); - - service = server.listen(port, { keepAlive: true }, function (request, response) { - console.log('Request at ' + new Date()); - console.log(JSON.stringify(request, null, 4)); - - var body = JSON.stringify(request, null, 4); - response.statusCode = 200; - response.headers = { - 'Cache': 'no-cache', - 'Content-Type': 'text/plain', - 'Connection': 'Keep-Alive', - 'Keep-Alive': 'timeout=5, max=100', - 'Content-Length': body.length - }; - response.write(body); - response.close(); - }); - - if (service) { - console.log('Web server running on port ' + port); - } else { - console.log('Error: Could not create web server listening on port ' + port); - phantom.exit(); - } -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/simpleserver.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/simpleserver.coffee deleted file mode 100644 index 9b4cf7a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/simpleserver.coffee +++ /dev/null @@ -1,38 +0,0 @@ -system = require 'system' - -if system.args.length is 1 - console.log "Usage: simpleserver.coffee " - phantom.exit 1 -else - port = system.args[1] - server = require("webserver").create() - - service = server.listen(port, (request, response) -> - - console.log "Request at " + new Date() - console.log JSON.stringify(request, null, 4) - - response.statusCode = 200 - response.headers = - Cache: "no-cache" - "Content-Type": "text/html" - - response.write "" - response.write "" - response.write "Hello, world!" - response.write "" - response.write "" - response.write "

              This is from PhantomJS web server.

              " - response.write "

              Request data:

              " - response.write "
              "
              -    response.write JSON.stringify(request, null, 4)
              -    response.write "
              " - response.write "" - response.write "" - response.close() - ) - if service - console.log "Web server running on port " + port - else - console.log "Error: Could not create web server listening on port " + port - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/simpleserver.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/simpleserver.js deleted file mode 100644 index d1eb845..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/simpleserver.js +++ /dev/null @@ -1,42 +0,0 @@ -var port, server, service, - system = require('system'); - -if (system.args.length !== 2) { - console.log('Usage: simpleserver.js '); - phantom.exit(1); -} else { - port = system.args[1]; - server = require('webserver').create(); - - service = server.listen(port, function (request, response) { - - console.log('Request at ' + new Date()); - console.log(JSON.stringify(request, null, 4)); - - response.statusCode = 200; - response.headers = { - 'Cache': 'no-cache', - 'Content-Type': 'text/html' - }; - response.write(''); - response.write(''); - response.write('Hello, world!'); - response.write(''); - response.write(''); - response.write('

              This is from PhantomJS web server.

              '); - response.write('

              Request data:

              '); - response.write('
              ');
              -        response.write(JSON.stringify(request, null, 4));
              -        response.write('
              '); - response.write(''); - response.write(''); - response.close(); - }); - - if (service) { - console.log('Web server running on port ' + port); - } else { - console.log('Error: Could not create web server listening on port ' + port); - phantom.exit(); - } -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/sleepsort.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/sleepsort.coffee deleted file mode 100644 index 863ad14..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/sleepsort.coffee +++ /dev/null @@ -1,20 +0,0 @@ -### -Sort integers from the command line in a very ridiculous way: leveraging timeouts :P -### - -system = require 'system' - -if system.args.length < 2 - console.log "Usage: phantomjs sleepsort.coffee PUT YOUR INTEGERS HERE SEPARATED BY SPACES" - phantom.exit 1 -else - sortedCount = 0 - args = Array.prototype.slice.call(system.args, 1) - for int in args - setTimeout (do (int) -> - -> - console.log int - ++sortedCount - phantom.exit() if sortedCount is args.length), - int - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/sleepsort.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/sleepsort.js deleted file mode 100644 index 6f0f9a3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/sleepsort.js +++ /dev/null @@ -1,25 +0,0 @@ -// sleepsort.js - Sort integers from the commandline in a very ridiculous way: leveraging timeouts :P -var system = require('system'); - -function sleepSort(array, callback) { - var sortedCount = 0, - i, len; - for ( i = 0, len = array.length; i < len; ++i ) { - setTimeout((function(j){ - return function() { - console.log(array[j]); - ++sortedCount; - (len === sortedCount) && callback(); - }; - }(i)), array[i]); - } -} - -if ( system.args < 2 ) { - console.log("Usage: phantomjs sleepsort.js PUT YOUR INTEGERS HERE SEPARATED BY SPACES"); - phantom.exit(1); -} else { - sleepSort(Array.prototype.slice.call(system.args, 1), function() { - phantom.exit(); - }); -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/stdin-stdout-stderr.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/stdin-stdout-stderr.coffee deleted file mode 100644 index 60723e0..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/stdin-stdout-stderr.coffee +++ /dev/null @@ -1,18 +0,0 @@ -system = require 'system' - -system.stdout.write 'Hello, system.stdout.write!' -system.stdout.writeLine '\nHello, system.stdout.writeLine!' - -system.stderr.write 'Hello, system.stderr.write!' -system.stderr.writeLine '\nHello, system.stderr.writeLine!' - -system.stdout.writeLine 'system.stdin.readLine(): ' -line = system.stdin.readLine() -system.stdout.writeLine JSON.stringify line - -# This is essentially a `readAll` -system.stdout.writeLine 'system.stdin.read(5): (ctrl+D to end)' -input = system.stdin.read 5 -system.stdout.writeLine JSON.stringify input - -phantom.exit 0 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/stdin-stdout-stderr.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/stdin-stdout-stderr.js deleted file mode 100644 index 80a43d3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/stdin-stdout-stderr.js +++ /dev/null @@ -1,18 +0,0 @@ -var system = require('system'); - -system.stdout.write('Hello, system.stdout.write!'); -system.stdout.writeLine('\nHello, system.stdout.writeLine!'); - -system.stderr.write('Hello, system.stderr.write!'); -system.stderr.writeLine('\nHello, system.stderr.writeLine!'); - -system.stdout.writeLine('system.stdin.readLine(): '); -var line = system.stdin.readLine(); -system.stdout.writeLine(JSON.stringify(line)); - -// This is essentially a `readAll` -system.stdout.writeLine('system.stdin.read(5): (ctrl+D to end)'); -var input = system.stdin.read(5); -system.stdout.writeLine(JSON.stringify(input)); - -phantom.exit(0); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/technews.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/technews.coffee deleted file mode 100644 index 7a9807e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/technews.coffee +++ /dev/null @@ -1,17 +0,0 @@ -page = require('webpage').create() - -page.viewportSize = { width: 320, height: 480 } - -page.open 'http://news.google.com/news/i/section?&topic=t', - (status) -> - if status isnt 'success' - console.log 'Unable to access the network!' - else - page.evaluate -> - body = document.body - body.style.backgroundColor = '#fff' - body.querySelector('div#title-block').style.display = 'none' - body.querySelector('form#edition-picker-form') - .parentElement.parentElement.style.display = 'none' - page.render 'technews.png' - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/technews.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/technews.js deleted file mode 100644 index ba7cd94..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/technews.js +++ /dev/null @@ -1,16 +0,0 @@ -var page = require('webpage').create(); -page.viewportSize = { width: 320, height: 480 }; -page.open('http://news.google.com/news/i/section?&topic=t', function (status) { - if (status !== 'success') { - console.log('Unable to access the network!'); - } else { - page.evaluate(function () { - var body = document.body; - body.style.backgroundColor = '#fff'; - body.querySelector('div#title-block').style.display = 'none'; - body.querySelector('form#edition-picker-form').parentElement.parentElement.style.display = 'none'; - }); - page.render('technews.png'); - } - phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/tweets.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/tweets.coffee deleted file mode 100644 index a6c064c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/tweets.coffee +++ /dev/null @@ -1,31 +0,0 @@ -# Get twitter status for given account (or for the default one, "PhantomJS") - -page = require('webpage').create() -system = require 'system' -twitterId = 'PhantomJS' #< default value - -# Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") -page.onConsoleMessage = (msg) -> - console.log msg - -# Print usage message, if no twitter ID is passed -if system.args.length < 2 - console.log 'Usage: tweets.coffee [twitter ID]' -else - twitterId = system.args[1] - -# Heading -console.log "*** Latest tweets from @#{twitterId} ***\n" - -# Open Twitter Mobile and, onPageLoad, do... -page.open encodeURI("http://mobile.twitter.com/#{twitterId}"), (status) -> - # Check for page load success - if status isnt 'success' - console.log 'Unable to access network' - else - # Execute some DOM inspection within the page context - page.evaluate -> - list = document.querySelectorAll 'div.tweet-text' - for i, j in list - console.log "#{j + 1}: #{i.innerText}" - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/tweets.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/tweets.js deleted file mode 100644 index d3f18c5..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/tweets.js +++ /dev/null @@ -1,37 +0,0 @@ -// Get twitter status for given account (or for the default one, "PhantomJS") - -var page = require('webpage').create(), - system = require('system'), - twitterId = "PhantomJS"; //< default value - -// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") -page.onConsoleMessage = function(msg) { - console.log(msg); -}; - -// Print usage message, if no twitter ID is passed -if (system.args.length < 2) { - console.log("Usage: tweets.js [twitter ID]"); -} else { - twitterId = system.args[1]; -} - -// Heading -console.log("*** Latest tweets from @" + twitterId + " ***\n"); - -// Open Twitter Mobile and, onPageLoad, do... -page.open(encodeURI("http://mobile.twitter.com/" + twitterId), function (status) { - // Check for page load success - if (status !== "success") { - console.log("Unable to access network"); - } else { - // Execute some DOM inspection within the page context - page.evaluate(function() { - var list = document.querySelectorAll('div.tweet-text'); - for (var i = 0; i < list.length; ++i) { - console.log((i + 1) + ": " + list[i].innerText); - } - }); - } - phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/universe.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/universe.js deleted file mode 100644 index 214dbc9..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/universe.js +++ /dev/null @@ -1,10 +0,0 @@ -// This is to be used by "module.js" (and "module.coffee") example(s). -// There should NOT be a "universe.coffee" as only 1 of the 2 would -// ever be loaded unless the file extension was specified. - -exports.answer = 42; - -exports.start = function () { - console.log('Starting the universe....'); -} - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/unrandomize.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/unrandomize.coffee deleted file mode 100644 index 841ffc7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/unrandomize.coffee +++ /dev/null @@ -1,18 +0,0 @@ -# Modify global object at the page initialization. -# In this example, effectively Math.random() always returns 0.42. - -page = require('webpage').create() -page.onInitialized = -> - page.evaluate -> - Math.random = -> - 42 / 100 - -page.open "http://ariya.github.com/js/random/", (status) -> - if status != "success" - console.log "Network error." - else - console.log page.evaluate(-> - document.getElementById("numbers").textContent - ) - phantom.exit() - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/unrandomize.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/unrandomize.js deleted file mode 100644 index 2aa2f81..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/unrandomize.js +++ /dev/null @@ -1,24 +0,0 @@ -// Modify global object at the page initialization. -// In this example, effectively Math.random() always returns 0.42. - -var page = require('webpage').create(); - -page.onInitialized = function () { - page.evaluate(function () { - Math.random = function() { - return 42 / 100; - }; - }); -}; - -page.open('http://ariya.github.com/js/random/', function (status) { - var result; - if (status !== 'success') { - console.log('Network error.'); - } else { - console.log(page.evaluate(function () { - return document.getElementById('numbers').textContent; - })); - } - phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/useragent.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/useragent.coffee deleted file mode 100644 index d401c7f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/useragent.coffee +++ /dev/null @@ -1,11 +0,0 @@ -page = require('webpage').create() - -console.log 'The default user agent is ' + page.settings.userAgent - -page.settings.userAgent = 'SpecialAgent' -page.open 'http://www.httpuseragent.org', (status) -> - if status isnt 'success' - console.log 'Unable to access network' - else - console.log page.evaluate -> document.getElementById('myagent').innerText - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/useragent.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/useragent.js deleted file mode 100644 index 60f537e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/useragent.js +++ /dev/null @@ -1,14 +0,0 @@ -var page = require('webpage').create(); -console.log('The default user agent is ' + page.settings.userAgent); -page.settings.userAgent = 'SpecialAgent'; -page.open('http://www.httpuseragent.org', function (status) { - if (status !== 'success') { - console.log('Unable to access network'); - } else { - var ua = page.evaluate(function () { - return document.getElementById('myagent').innerText; - }); - console.log(ua); - } - phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/version.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/version.coffee deleted file mode 100644 index ce20269..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/version.coffee +++ /dev/null @@ -1,5 +0,0 @@ -console.log 'using PhantomJS version ' + - phantom.version.major + '.' + - phantom.version.minor + '.' + - phantom.version.patch -phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/version.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/version.js deleted file mode 100644 index 49e41ed..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/version.js +++ /dev/null @@ -1,5 +0,0 @@ -console.log('using PhantomJS version ' + - phantom.version.major + '.' + - phantom.version.minor + '.' + - phantom.version.patch); -phantom.exit(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/waitfor.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/waitfor.coffee deleted file mode 100644 index 90773c6..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/waitfor.coffee +++ /dev/null @@ -1,48 +0,0 @@ -## -# Wait until the test condition is true or a timeout occurs. Useful for waiting -# on a server response or for a ui change (fadeIn, etc.) to occur. -# -# @param testFx javascript condition that evaluates to a boolean, -# it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or -# as a callback function. -# @param onReady what to do when testFx condition is fulfilled, -# it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or -# as a callback function. -# @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. -## -waitFor = (testFx, onReady, timeOutMillis=3000) -> - start = new Date().getTime() - condition = false - f = -> - if (new Date().getTime() - start < timeOutMillis) and not condition - # If not time-out yet and condition not yet fulfilled - condition = (if typeof testFx is 'string' then eval testFx else testFx()) #< defensive code - else - if not condition - # If condition still not fulfilled (timeout but condition is 'false') - console.log "'waitFor()' timeout" - phantom.exit 1 - else - # Condition fulfilled (timeout and/or condition is 'true') - console.log "'waitFor()' finished in #{new Date().getTime() - start}ms." - if typeof onReady is 'string' then eval onReady else onReady() #< Do what it's supposed to do once the condition is fulfilled - clearInterval interval #< Stop this interval - interval = setInterval f, 250 #< repeat check every 250ms - - -page = require('webpage').create() - -# Open Twitter on 'sencha' profile and, onPageLoad, do... -page.open 'http://twitter.com/#!/sencha', (status) -> - # Check for page load success - if status isnt 'success' - console.log 'Unable to access network' - else - # Wait for 'signin-dropdown' to be visible - waitFor -> - # Check in the page if a specific element is now visible - page.evaluate -> - $('#signin-dropdown').is ':visible' - , -> - console.log 'The sign-in dialog should be visible now.' - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/waitfor.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/waitfor.js deleted file mode 100644 index 6c5ecb8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/waitfor.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Wait until the test condition is true or a timeout occurs. Useful for waiting - * on a server response or for a ui change (fadeIn, etc.) to occur. - * - * @param testFx javascript condition that evaluates to a boolean, - * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or - * as a callback function. - * @param onReady what to do when testFx condition is fulfilled, - * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or - * as a callback function. - * @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used. - */ -function waitFor(testFx, onReady, timeOutMillis) { - var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3000, //< Default Max Timout is 3s - start = new Date().getTime(), - condition = false, - interval = setInterval(function() { - if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) { - // If not time-out yet and condition not yet fulfilled - condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code - } else { - if(!condition) { - // If condition still not fulfilled (timeout but condition is 'false') - console.log("'waitFor()' timeout"); - phantom.exit(1); - } else { - // Condition fulfilled (timeout and/or condition is 'true') - console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms."); - typeof(onReady) === "string" ? eval(onReady) : onReady(); //< Do what it's supposed to do once the condition is fulfilled - clearInterval(interval); //< Stop this interval - } - } - }, 250); //< repeat check every 250ms -}; - - -var page = require('webpage').create(); - -// Open Twitter on 'sencha' profile and, onPageLoad, do... -page.open("http://twitter.com/#!/sencha", function (status) { - // Check for page load success - if (status !== "success") { - console.log("Unable to access network"); - } else { - // Wait for 'signin-dropdown' to be visible - waitFor(function() { - // Check in the page if a specific element is now visible - return page.evaluate(function() { - return $("#signin-dropdown").is(":visible"); - }); - }, function() { - console.log("The sign-in dialog should be visible now."); - phantom.exit(); - }); - } -}); - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.coffee deleted file mode 100644 index 1838fa2..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.coffee +++ /dev/null @@ -1,66 +0,0 @@ -pageTitle = (page) -> - page.evaluate -> - window.document.title -setPageTitle = (page, newTitle) -> - page.evaluate ((newTitle) -> - window.document.title = newTitle - ), newTitle -p = require("webpage").create() -p.open "../test/webpage-spec-frames/index.html", (status) -> - console.log "pageTitle(): " + pageTitle(p) - console.log "currentFrameName(): " + p.currentFrameName() - console.log "childFramesCount(): " + p.childFramesCount() - console.log "childFramesName(): " + p.childFramesName() - console.log "setPageTitle(CURRENT TITLE+'-visited')" - setPageTitle p, pageTitle(p) + "-visited" - console.log "" - console.log "p.switchToChildFrame(\"frame1\"): " + p.switchToChildFrame("frame1") - console.log "pageTitle(): " + pageTitle(p) - console.log "currentFrameName(): " + p.currentFrameName() - console.log "childFramesCount(): " + p.childFramesCount() - console.log "childFramesName(): " + p.childFramesName() - console.log "setPageTitle(CURRENT TITLE+'-visited')" - setPageTitle p, pageTitle(p) + "-visited" - console.log "" - console.log "p.switchToChildFrame(\"frame1-2\"): " + p.switchToChildFrame("frame1-2") - console.log "pageTitle(): " + pageTitle(p) - console.log "currentFrameName(): " + p.currentFrameName() - console.log "childFramesCount(): " + p.childFramesCount() - console.log "childFramesName(): " + p.childFramesName() - console.log "setPageTitle(CURRENT TITLE+'-visited')" - setPageTitle p, pageTitle(p) + "-visited" - console.log "" - console.log "p.switchToParentFrame(): " + p.switchToParentFrame() - console.log "pageTitle(): " + pageTitle(p) - console.log "currentFrameName(): " + p.currentFrameName() - console.log "childFramesCount(): " + p.childFramesCount() - console.log "childFramesName(): " + p.childFramesName() - console.log "setPageTitle(CURRENT TITLE+'-visited')" - setPageTitle p, pageTitle(p) + "-visited" - console.log "" - console.log "p.switchToChildFrame(0): " + p.switchToChildFrame(0) - console.log "pageTitle(): " + pageTitle(p) - console.log "currentFrameName(): " + p.currentFrameName() - console.log "childFramesCount(): " + p.childFramesCount() - console.log "childFramesName(): " + p.childFramesName() - console.log "setPageTitle(CURRENT TITLE+'-visited')" - setPageTitle p, pageTitle(p) + "-visited" - console.log "" - console.log "p.switchToMainFrame()" - p.switchToMainFrame() - console.log "pageTitle(): " + pageTitle(p) - console.log "currentFrameName(): " + p.currentFrameName() - console.log "childFramesCount(): " + p.childFramesCount() - console.log "childFramesName(): " + p.childFramesName() - console.log "setPageTitle(CURRENT TITLE+'-visited')" - setPageTitle p, pageTitle(p) + "-visited" - console.log "" - console.log "p.switchToChildFrame(\"frame2\"): " + p.switchToChildFrame("frame2") - console.log "pageTitle(): " + pageTitle(p) - console.log "currentFrameName(): " + p.currentFrameName() - console.log "childFramesCount(): " + p.childFramesCount() - console.log "childFramesName(): " + p.childFramesName() - console.log "setPageTitle(CURRENT TITLE+'-visited')" - setPageTitle p, pageTitle(p) + "-visited" - console.log "" - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.js deleted file mode 100644 index 35c2bb9..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/walk_through_frames.js +++ /dev/null @@ -1,73 +0,0 @@ -var p = require("webpage").create(); - -function pageTitle(page) { - return page.evaluate(function(){ - return window.document.title; - }); -} - -function setPageTitle(page, newTitle) { - page.evaluate(function(newTitle){ - window.document.title = newTitle; - }, newTitle); -} - -p.open("../test/webpage-spec-frames/index.html", function(status) { - console.log("pageTitle(): " + pageTitle(p)); - console.log("currentFrameName(): "+p.currentFrameName()); - console.log("childFramesCount(): "+p.childFramesCount()); - console.log("childFramesName(): "+p.childFramesName()); - console.log("setPageTitle(CURRENT TITLE+'-visited')"); setPageTitle(p, pageTitle(p) + "-visited"); - console.log(""); - - console.log("p.switchToChildFrame(\"frame1\"): "+p.switchToChildFrame("frame1")); - console.log("pageTitle(): " + pageTitle(p)); - console.log("currentFrameName(): "+p.currentFrameName()); - console.log("childFramesCount(): "+p.childFramesCount()); - console.log("childFramesName(): "+p.childFramesName()); - console.log("setPageTitle(CURRENT TITLE+'-visited')"); setPageTitle(p, pageTitle(p) + "-visited"); - console.log(""); - - console.log("p.switchToChildFrame(\"frame1-2\"): "+p.switchToChildFrame("frame1-2")); - console.log("pageTitle(): " + pageTitle(p)); - console.log("currentFrameName(): "+p.currentFrameName()); - console.log("childFramesCount(): "+p.childFramesCount()); - console.log("childFramesName(): "+p.childFramesName()); - console.log("setPageTitle(CURRENT TITLE+'-visited')"); setPageTitle(p, pageTitle(p) + "-visited"); - console.log(""); - - console.log("p.switchToParentFrame(): "+p.switchToParentFrame()); - console.log("pageTitle(): " + pageTitle(p)); - console.log("currentFrameName(): "+p.currentFrameName()); - console.log("childFramesCount(): "+p.childFramesCount()); - console.log("childFramesName(): "+p.childFramesName()); - console.log("setPageTitle(CURRENT TITLE+'-visited')"); setPageTitle(p, pageTitle(p) + "-visited"); - console.log(""); - - console.log("p.switchToChildFrame(0): "+p.switchToChildFrame(0)); - console.log("pageTitle(): " + pageTitle(p)); - console.log("currentFrameName(): "+p.currentFrameName()); - console.log("childFramesCount(): "+p.childFramesCount()); - console.log("childFramesName(): "+p.childFramesName()); - console.log("setPageTitle(CURRENT TITLE+'-visited')"); setPageTitle(p, pageTitle(p) + "-visited"); - console.log(""); - - console.log("p.switchToMainFrame()"); p.switchToMainFrame(); - console.log("pageTitle(): " + pageTitle(p)); - console.log("currentFrameName(): "+p.currentFrameName()); - console.log("childFramesCount(): "+p.childFramesCount()); - console.log("childFramesName(): "+p.childFramesName()); - console.log("setPageTitle(CURRENT TITLE+'-visited')"); setPageTitle(p, pageTitle(p) + "-visited"); - console.log(""); - - console.log("p.switchToChildFrame(\"frame2\"): "+p.switchToChildFrame("frame2")); - console.log("pageTitle(): " + pageTitle(p)); - console.log("currentFrameName(): "+p.currentFrameName()); - console.log("childFramesCount(): "+p.childFramesCount()); - console.log("childFramesName(): "+p.childFramesName()); - console.log("setPageTitle(CURRENT TITLE+'-visited')"); setPageTitle(p, pageTitle(p) + "-visited"); - console.log(""); - - phantom.exit(); -}); - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/weather.coffee b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/weather.coffee deleted file mode 100644 index d8da90d..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/weather.coffee +++ /dev/null @@ -1,29 +0,0 @@ -page = require('webpage').create() -system = require 'system' - -city = 'Mountain View, California'; # default -if system.args.length > 1 - city = Array.prototype.slice.call(system.args, 1).join(' ') -url = encodeURI 'http://api.openweathermap.org/data/2.1/find/name?q=' + city - -console.log 'Checking weather condition for', city, '...' - -page.open url, (status) -> - if status isnt 'success' - console.log 'Error: Unable to access network!' - else - result = page.evaluate -> - return document.body.innerText - try - data = JSON.parse result - data = data.list[0] - console.log '' - console.log 'City:', data.name - console.log 'Condition:', data.weather.map (entry) -> - return entry.main - console.log 'Temperature:', Math.round(data.main.temp - 273.15), 'C' - console.log 'Humidity:', Math.round(data.main.humidity), '%' - catch e - console.log 'Error:', e.toString() - - phantom.exit() diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/weather.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/weather.js deleted file mode 100644 index 2b4e611..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/examples/weather.js +++ /dev/null @@ -1,37 +0,0 @@ -var page = require('webpage').create(), - system = require('system'), - city, - url; - -city = 'Mountain View, California'; // default -if (system.args.length > 1) { - city = Array.prototype.slice.call(system.args, 1).join(' '); -} -url = encodeURI('http://api.openweathermap.org/data/2.1/find/name?q=' + city); - -console.log('Checking weather condition for', city, '...'); - -page.open(url, function(status) { - var result, data; - if (status !== 'success') { - console.log('Error: Unable to access network!'); - } else { - result = page.evaluate(function () { - return document.body.innerText; - }); - try { - data = JSON.parse(result); - data = data.list[0]; - console.log(''); - console.log('City:', data.name); - console.log('Condition:', data.weather.map(function(entry) { - return entry.main; - }).join(', ')); - console.log('Temperature:', Math.round(data.main.temp - 273.15), 'C'); - console.log('Humidity:', Math.round(data.main.humidity), '%'); - } catch (e) { - console.log('Error:', e.toString()); - } - } - phantom.exit(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/third-party.txt b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/third-party.txt deleted file mode 100644 index 3b377f3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/third-party.txt +++ /dev/null @@ -1,48 +0,0 @@ -This document contains the list of Third Party Software included with -PhantomJS, along with the license information. - -Third Party Software may impose additional restrictions and it is the -user's responsibility to ensure that they have met the licensing -requirements of PhantomJS and the relevant license of the Third Party -Software they are using. - -Qt - http://qt-project.org/ -License: GNU Lesser General Public License (LGPL) version 2.1. -Reference: http://qt-project.org/doc/qt-4.8/lgpl.html. - -WebKit - http://www.webkit.org/ -License: GNU Lesser General Public License (LGPL) version 2.1 and BSD. -Reference: http://www.webkit.org/coding/lgpl-license.html and -http://www.webkit.org/coding/bsd-license.html. - -Mongoose - https://github.com/valenok/mongoose -License: MIT -Reference: https://github.com/valenok/mongoose/blob/master/LICENSE - -Breakpad - http://code.google.com/p/google-breakpad/ -License: BSD. -Reference: http://code.google.com/p/google-breakpad/source/browse/trunk/COPYING. - -OpenSSL - http://www.openssl.org/ -License: OpenSSL License, SSLeay License. -Reference: http://www.openssl.org/source/license.html. - -Linenoise - https://github.com/tadmarshall/linenoise -License: BSD. -Reference: https://github.com/tadmarshall/linenoise/blob/master/linenoise.h. - -QCommandLine - http://xf.iksaif.net/dev/qcommandline.html -License: GNU Lesser General Public License (LGPL) version 2.1. -Reference: http://dev.iksaif.net/projects/qcommandline/repository/revisions/master/entry/COPYING - -CoffeeScript - http://coffeescript.org/ -License: MIT. -Reference: https://github.com/jashkenas/coffee-script/blob/master/README. - -GIFLIB - http://giflib.sourceforge.net/ -License: MIT -Reference: http://giflib.cvs.sourceforge.net/viewvc/giflib/giflib/COPYING - -wkhtmlpdf - http://code.google.com/p/wkhtmltopdf/ -License: GNU Lesser General Public License (LGPL) -Reference: http://code.google.com/p/wkhtmltopdf/ diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantomjs.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantomjs.js deleted file mode 100644 index 19382ca..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantomjs.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2013 The Obvious Corporation. - -/** - * @fileoverview Helpers made available via require('phantomjs') once package is - * installed. - */ - -var fs = require('fs') -var path = require('path') -var which = require('which') - - -/** - * Where the phantom binary can be found. - * @type {string} - */ -try { - exports.path = path.resolve(__dirname, require('./location').location) -} catch(e) { - // Must be running inside install script. - exports.path = null -} - - -/** - * The version of phantomjs installed by this package. - * @type {number} - */ -exports.version = '1.9.2' - - -/** - * Returns a clean path that helps avoid `which` finding bin files installed - * by NPM for this repo. - * @param {string} path - * @return {string} - */ -exports.cleanPath = function (path) { - return path - .replace(/:[^:]*node_modules[^:]*/g, '') - .replace(/(^|:)\.\/bin(\:|$)/g, ':') - .replace(/^:+/, '') - .replace(/:+$/, '') -} - - -// Make sure the binary is executable. For some reason doing this inside -// install does not work correctly, likely due to some NPM step. -if (exports.path) { - try { - fs.chmodSync(exports.path, '755') - } catch (e) { - // Just ignore error if we don't have permission. - // We did our best. Likely because phantomjs was already installed. - } -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/.bin/ncp b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/.bin/ncp deleted file mode 120000 index 1c02648..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/.bin/ncp +++ /dev/null @@ -1 +0,0 @@ -../ncp/bin/ncp \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/.bin/which b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/.bin/which deleted file mode 120000 index f62471c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/.travis.yml b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/.travis.yml deleted file mode 100644 index 90afc1e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/MIT-LICENSE.txt b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/MIT-LICENSE.txt deleted file mode 100644 index 14c3ee5..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/MIT-LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2012 Another-D-Mention Software and other contributors, -http://www.another-d-mention.ro/ - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/README.md deleted file mode 100644 index 84296fb..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# ADM-ZIP for NodeJS - -ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/). - -# Installation - -With [npm](http://npmjs.org) do: - - $ npm install adm-zip - -## What is it good for? -The library allows you to: - -* decompress zip files directly to disk or in memory buffers -* compress files and store them to disk in .zip format or in compressed buffers -* update content of/add new/delete files from an existing .zip - -# Dependencies -There are no other nodeJS libraries that ADM-ZIP is dependent of - -# Examples - -## Basic usage -```javascript - - var AdmZip = require('adm-zip'); - - // reading archives - var zip = new AdmZip("./my_file.zip"); - var zipEntries = zip.getEntries(); // an array of ZipEntry records - - zipEntries.forEach(function(zipEntry) { - console.log(zipEntry.toString()); // outputs zip entries information - if (zipEntry.entryName == "my_file.txt") { - console.log(zipEntry.data.toString('utf8')); - } - }); - // outputs the content of some_folder/my_file.txt - console.log(zip.readAsText("some_folder/my_file.txt")); - // extracts the specified file to the specified location - zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*overwrite*/true) - // extracts everything - zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); - - - // creating archives - var zip = new AdmZip(); - - // add file directly - zip.addFile("test.txt", new Buffer("inner content of the file"), "entry comment goes here"); - // add local file - zip.addLocalFile("/home/me/some_picture.png"); - // get everything as a buffer - var willSendthis = zip.toBuffer(); - // or write everything to disk - zip.writeZip(/*target file name*/"/home/me/files.zip"); - - - // ... more examples in the wiki -``` - -For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki). - -[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip) \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/adm-zip.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/adm-zip.js deleted file mode 100644 index 5d962b5..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/adm-zip.js +++ /dev/null @@ -1,405 +0,0 @@ -var fs = require("fs"), - buffer = require("buffer"), - pth = require("path"); - -fs.existsSync = fs.existsSync || pth.existsSync; - -var ZipEntry = require("./zipEntry"), - ZipFile = require("./zipFile"), - Utils = require("./util"); - -module.exports = function(/*String*/inPath) { - var _zip = undefined, - _filename = ""; - - if (inPath && typeof inPath === "string") { // load zip file - if (fs.existsSync(inPath)) { - _filename = inPath; - _zip = new ZipFile(fs.readFileSync(inPath)); - } else { - throw Utils.Errors.INVALID_FILENAME; - } - } else if(inPath && Buffer.isBuffer(inPath)) { // load buffer - _zip = new ZipFile(inPath); - } else { // create new zip file - _zip = new ZipFile(); - } - - function getEntry(/*Object*/entry) { - if (entry && _zip) { - var item; - // If entry was given as a file name - if (typeof entry === "string") - item = _zip.getEntry(entry); - // if entry was given as a ZipEntry object - if (typeof entry === "object" && entry.entryName != undefined && entry.header != undefined) - item = _zip.getEntry(entry.entryName); - - if (item) { - return item; - } - } - return null; - } - - //process.on('uncaughtException', function (err) { - // console.log('Caught exception: ' + err); - //}); - - return { - /** - * Extracts the given entry from the archive and returns the content as a Buffer object - * @param entry ZipEntry object or String with the full path of the entry - * - * @return Buffer or Null in case of error - */ - readFile : function(/*Object*/entry) { - var item = getEntry(entry); - return item && item.getData() || null; - }, - /** - * Asynchronous readFile - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * - * @return Buffer or Null in case of error - */ - readFileAsync : function(/*Object*/entry, /*Function*/callback) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(callback); - } else { - callback(null,"getEntry failed for:" + entry) - } - }, - /** - * Extracts the given entry from the archive and returns the content as plain text in the given encoding - * @param entry ZipEntry object or String with the full path of the entry - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsText : function(/*Object*/entry, /*String - Optional*/encoding) { - var item = getEntry(entry); - if (item) { - var data = item.getData(); - if (data && data.length) { - return data.toString(encoding || "utf8"); - } - } - return ""; - }, - /** - * Asynchronous readAsText - * @param entry ZipEntry object or String with the full path of the entry - * @param callback - * @param encoding Optional. If no encoding is specified utf8 is used - * - * @return String - */ - readAsTextAsync : function(/*Object*/entry, /*Function*/callback, /*String - Optional*/encoding) { - var item = getEntry(entry); - if (item) { - item.getDataAsync(function(data) { - if (data && data.length) { - callback(data.toString(encoding || "utf8")); - } else { - callback(""); - } - }) - } else { - callback(""); - } - }, - - /** - * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory - * - * @param entry - */ - deleteFile : function(/*Object*/entry) { // @TODO: test deleteFile - var item = getEntry(entry); - if (item) { - _zip.deleteEntry(item.entryName); - } - }, - - /** - * Adds a comment to the zip. The zip must be rewritten after adding the comment. - * - * @param comment - */ - addZipComment : function(/*String*/comment) { // @TODO: test addZipComment - _zip.comment = comment; - }, - - /** - * Returns the zip comment - * - * @return String - */ - getZipComment : function() { - return _zip.comment || ''; - }, - - /** - * Adds a comment to a specified zipEntry. The zip must be rewritten after adding the comment - * The comment cannot exceed 65535 characters in length - * - * @param entry - * @param comment - */ - addZipEntryComment : function(/*Object*/entry,/*String*/comment) { - var item = getEntry(entry); - if (item) { - item.comment = comment; - } - }, - - /** - * Returns the comment of the specified entry - * - * @param entry - * @return String - */ - getZipEntryComment : function(/*Object*/entry) { - var item = getEntry(entry); - if (item) { - return item.comment || ''; - } - return '' - }, - - /** - * Updates the content of an existing entry inside the archive. The zip must be rewritten after updating the content - * - * @param entry - * @param content - */ - updateFile : function(/*Object*/entry, /*Buffer*/content) { - var item = getEntry(entry); - if (item) { - item.setData(content); - } - }, - - /** - * Adds a file from the disk to the archive - * - * @param localPath - */ - addLocalFile : function(/*String*/localPath) { - if (fs.existsSync(localPath)) { - var entry = new ZipEntry(); - entry.entryName = localPath.split("\\").join("/"); //windows fix - var stats = fs.statSync(localPath); - entry.setData(fs.readFileSync(localPath)); - entry.header.inAttr = stats.mode; - entry.header.attr = stats.mode; - entry.attr = stats.mode; - entry.header.time = stats.mtime; - _zip.setEntry(entry); - } else { - throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath); - } - }, - - /** - * Adds a local directory and all its nested files and directories to the archive - * - * @param localPath - */ - addLocalFolder : function(/*String*/localPath) { - localPath = localPath.split("\\").join("/"); //windows fix - if (localPath.charAt(localPath.length - 1) != "/") - localPath += "/"; - - if (fs.existsSync(localPath)) { - var items = Utils.findFiles(localPath); - if (items.length) { - items.forEach(function(path) { - var entry = new ZipEntry(); - entry.entryName = path.split("\\").join("/").replace(localPath, ""); //windows fix - var stats = fs.statSync(path); - if (stats.isDirectory()) { - entry.setData(""); - entry.header.inAttr = stats.mode; - entry.header.attr = stats.mode - } else { - entry.setData(fs.readFileSync(path)); - entry.header.inAttr = stats.mode; - entry.header.attr = stats.mode - } - entry.attr = stats.mode; - entry.header.time = stats.mtime; - _zip.setEntry(entry); - }); - } - } else { - throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath); - } - }, - - /** - * Allows you to create a entry (file or directory) in the zip file. - * If you want to create a directory the entryName must end in / and a null buffer should be provided. - * Comment and attributes are optional - * - * @param entryName - * @param content - * @param comment - * @param attr - */ - addFile : function(/*String*/entryName, /*Buffer*/content, /*String*/comment, /*Number*/attr) { - var entry = new ZipEntry(); - entry.entryName = entryName; - entry.comment = comment || ""; - entry.attr = attr || 0666; - if (entry.isDirectory && content.length) { - throw Utils.Errors.DIRECTORY_CONTENT_ERROR; - } - entry.setData(content); - entry.header.time = new Date(); - _zip.setEntry(entry); - }, - - /** - * Returns an array of ZipEntry objects representing the files and folders inside the archive - * - * @return Array - */ - getEntries : function() { - if (_zip) { - return _zip.entries; - } else { - return []; - } - }, - - /** - * Returns a ZipEntry object representing the file or folder specified by ``name``. - * - * @param name - * @return ZipEntry - */ - getEntry : function(/*String*/name) { - return getEntry(name); - }, - - /** - * Extracts the given entry to the given targetPath - * If the entry is a directory inside the archive, the entire directory and it's subdirectories will be extracted - * - * @param entry ZipEntry object or String with the full path of the entry - * @param targetPath Target folder where to write the file - * @param maintainEntryPath If maintainEntryPath is true and the entry is inside a folder, the entry folder - * will be created in targetPath as well. Default is TRUE - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - * - * @return Boolean - */ - extractEntryTo : function(/*Object*/entry, /*String*/targetPath, /*Boolean*/maintainEntryPath, /*Boolean*/overwrite) { - overwrite = overwrite || false; - maintainEntryPath = typeof maintainEntryPath == "undefined" ? true : maintainEntryPath; - - var item = getEntry(entry); - if (!item) { - throw Utils.Errors.NO_ENTRY; - } - - var target = pth.resolve(targetPath, maintainEntryPath ? item.entryName : pth.basename(item.entryName)); - - if (item.isDirectory) { - target = pth.resolve(target, ".."); - var children = _zip.getEntryChildren(item); - children.forEach(function(child) { - if (child.isDirectory) return; - var content = child.getData(); - if (!content) { - throw Utils.Errors.CANT_EXTRACT_FILE; - } - Utils.writeFileTo(pth.resolve(targetPath, maintainEntryPath ? child.entryName : child.entryName.substr(item.entryName.length)), content, overwrite); - }); - return true; - } - - var content = item.getData(); - if (!content) throw Utils.Errors.CANT_EXTRACT_FILE; - - if (fs.existsSync(targetPath) && !overwrite) { - throw Utils.Errors.CANT_OVERRIDE; - } - Utils.writeFileTo(target, content, overwrite); - - return true; - }, - - /** - * Extracts the entire archive to the given location - * - * @param targetPath Target location - * @param overwrite If the file already exists at the target path, the file will be overwriten if this is true. - * Default is FALSE - */ - extractAllTo : function(/*String*/targetPath, /*Boolean*/overwrite) { - overwrite = overwrite || false; - if (!_zip) { - throw Utils.Errors.NO_ZIP; - } - - _zip.entries.forEach(function(entry) { - if (entry.isDirectory) return; - var content = entry.getData(); - if (!content) { - throw Utils.Errors.CANT_EXTRACT_FILE + "2"; - } - Utils.writeFileTo(pth.resolve(targetPath, entry.entryName), content, overwrite); - }) - }, - - /** - * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip - * - * @param targetFileName - */ - writeZip : function(/*String*/targetFileName, /*Function*/callback) { - if (arguments.length == 1) { - if (typeof targetFileName == "function") { - callback = targetFileName; - targetFileName = ""; - } - } - - if (!targetFileName && _filename) { - targetFileName = _filename; - } - if (!targetFileName) return; - - var zipData = _zip.toBuffer(); - if (zipData) { - Utils.writeFileTo(targetFileName, zipData, true); - } - }, - - /** - * Returns the content of the entire zip file as a Buffer object - * - * @return Buffer - */ - toBuffer : function(/*Function*/callback) { - this.valueOf = 2; - if (typeof callback == "function") { - _zip.toAsyncBuffer(callback); - return null; - } - return _zip.toBuffer() - } - - /*get lastError () { - var x = function() { console.log("2", arguments); }; - x.prototype = 2 - return x; // - } */ - } -}; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/dataHeader.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/dataHeader.js deleted file mode 100644 index 9203611..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/dataHeader.js +++ /dev/null @@ -1,133 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The local file header */ -module.exports = function () { - var _version = 0x0A, - _flags = 0, - _method = 0, - _time = 0, - _crc = 0, - _compressedSize = 0, - _size = 0, - _fnameLen = 0, - _extraLen = 0; - - return { - get version () { return _version; }, - set version (val) { _version = 0x0A }, - - get flags () { return _flags }, - set flags (val) { _flags = val; }, - - get method () { return _method; }, - set method (val) { _method = val; }, - - get time () { - return new Date( - ((_time >> 25) & 0x7f) + 1980, - ((_time >> 21) & 0x0f) - 1, - (_time >> 16) & 0x1f, - (_time >> 11) & 0x1f, - (_time >> 5) & 0x3f, - (_time & 0x1f) << 1 - ); - }, - set time (val) { - val = new Date(val); - _time = (val.getFullYear() - 1980 & 0x7f) << 25 - | (val.getMonth() + 1) << 21 - | val.getDay() << 16 - | val.getHours() << 11 - | val.getMinutes() << 5 - | val.getSeconds() >> 1; - }, - - get crc () { return _crc; }, - set crc (val) { _crc = val; }, - - get compressedSize () { return _compressedSize; }, - set compressedSize (val) { _compressedSize = val; }, - - get size () { return _size; }, - set size (val) { _size = val; }, - - get fileNameLength () { return _fnameLen; }, - set fileNameLenght (val) { _fnameLen = val; }, - - get extraLength () { return _extraLen }, - set extraLength (val) { _extraLen = val; }, - - get encripted () { return (_flags & 1) == 1 }, - - get fileHeaderSize () { - return Constants.LOCHDR + _fnameLen + _extraLen; - }, - - loadFromBinary : function(/*Buffer*/data) { - // 30 bytes and should start with "PK\003\004" - if (data.length != Constants.LOCHDR || data.readUInt32LE(0) != Constants.LOCSIG) { - throw Utils.Errors.INVALID_LOC; - } - // version needed to extract - _version = data.readUInt16LE(Constants.LOCVER); - // general purpose bit flag - _flags = data.readUInt16LE(Constants.LOCFLG); - // compression method - _method = data.readUInt16LE(Constants.LOCHOW); - // modification time (2 bytes time, 2 bytes date) - _time = data.readUInt32LE(Constants.LOCTIM); - // uncompressed file crc-32 value - _crc = data.readUInt32LE(Constants.LOCCRC); - // compressed size - _compressedSize = data.readUInt32LE(Constants.LOCSIZ); - // uncompressed size - _size = data.readUInt32LE(Constants.LOCLEN); - // filename length - _fnameLen = data.readUInt16LE(Constants.LOCNAM); - // extra field length - _extraLen = data.readUInt16LE(Constants.LOCEXT); - }, - - toBinary : function() { - // LOC header size (30 bytes) - var data = new Buffer(Constants.LOCHDR); - // "PK\003\004" - data.writeUInt32LE(Constants.LOCSIG, 0); - // version needed to extract - data.writeUInt16LE(_version, Constants.LOCVER); - // general purpose bit flag - data.writeUInt16LE(_flags, Constants.LOCFLG); - // compression method - data.writeUInt16LE(_method, Constants.LOCHOW); - // modification time (2 bytes time, 2 bytes date) - data.writeUInt32LE(_time, Constants.LOCTIM); - // uncompressed file crc-32 value - data.writeUInt32LE(_crc, Constants.LOCCRC); - // compressed size - data.writeUInt32LE(_compressedSize, Constants.LOCSIZ); - // uncompressed size - data.writeUInt32LE(_size, Constants.LOCLEN); - // filename length - data.writeUInt16LE(_fnameLen, Constants.LOCNAM); - // extra field length - data.writeUInt16LE(_extraLen, Constants.LOCEXT); - return data; - }, - - toString : function() { - return '{\n' + - '\t"version" : ' + _version + ",\n" + - '\t"flags" : ' + _flags + ",\n" + - '\t"method" : ' + Utils.methodToString(_method) + ",\n" + - '\t"time" : ' + _time + ",\n" + - '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" + - '\t"compressedSize" : ' + _compressedSize + " bytes,\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"fnameLen" : ' + _fnameLen + ",\n" + - '\t"extraLen" : ' + _extraLen + " bytes,\n" + - '\t"fileHeaderSize" : ' + (Constants.LOCHDR + _fnameLen + _extraLen) + " bytes\n" + - '}'; - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/entryHeader.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/entryHeader.js deleted file mode 100644 index 56fee20..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/entryHeader.js +++ /dev/null @@ -1,187 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The central directory file header */ -module.exports = function () { - var _verMade = 0x0A, - _version = 10, - _flags = 0, - _method = 0, - _time = 0, - _crc = 0, - _compressedSize = 0, - _size = 0, - _fnameLen = 0, - _extraLen = 0, - _comLen = 0, - _diskStart = 0, - _inattr = 438, - _attr = 438, - _offset = 0; - - return { - get made () { return _verMade; }, - set made (val) { _verMade = val; }, - - get version () { return _version; }, - set version (val) { _version = val }, - - get flags () { return _flags }, - set flags (val) { _flags = val; }, - - get method () { return _method; }, - set method (val) { _method = val; }, - - get time () { return new Date( - ((_time >> 25) & 0x7f) + 1980, - ((_time >> 21) & 0x0f) - 1, - (_time >> 16) & 0x1f, - (_time >> 11) & 0x1f, - (_time >> 5) & 0x3f, - (_time & 0x1f) << 1 - ); - }, - set time (val) { val = new Date(val); - _time = (val.getFullYear() - 1980 & 0x7f) << 25 - | (val.getMonth() + 1) << 21 - | val.getDay() << 16 - | val.getHours() << 11 - | val.getMinutes() << 5 - | val.getSeconds() >> 1; - }, - - get crc () { return _crc; }, - set crc (val) { _crc = val; }, - - get compressedSize () { return _compressedSize; }, - set compressedSize (val) { _compressedSize = val; }, - - get size () { return _size; }, - set size (val) { _size = val; }, - - get fileNameLength () { return _fnameLen; }, - set fileNameLength (val) { _fnameLen = val; }, - - get extraLength () { return _extraLen }, - set extraLength (val) { _extraLen = val; }, - - get commentLength () { return _comLen }, - set commentLength (val) { _comLen = val }, - - get diskNumStart () { return _diskStart }, - set diskNumStart (val) { _diskStart = val }, - - get inAttr () { return _inattr }, - set inAttr (val) { _inattr = val }, - - get attr () { return _attr }, - set attr (val) { _attr = val }, - - get offset () { return _offset }, - set offset (val) { _offset = val }, - - get encripted () { return (_flags & 1) == 1 }, - - get entryHeaderSize () { - return Constants.CENHDR + _fnameLen + _extraLen + _comLen; - }, - - loadFromBinary : function(/*Buffer*/data) { - // data should be 46 bytes and start with "PK 01 02" - if (data.length != Constants.CENHDR || data.readUInt32LE(0) != Constants.CENSIG) { - throw Utils.Errors.INVALID_CEN; - } - // version made by - _verMade = data.readUInt16LE(Constants.CENVEM); - // version needed to extract - _version = data.readUInt16LE(Constants.CENVER); - // encrypt, decrypt flags - _flags = data.readUInt16LE(Constants.CENFLG); - // compression method - _method = data.readUInt16LE(Constants.CENHOW); - // modification time (2 bytes time, 2 bytes date) - _time = data.readUInt32LE(Constants.CENTIM); - // uncompressed file crc-32 value - _crc = data.readUInt32LE(Constants.CENCRC); - // compressed size - _compressedSize = data.readUInt32LE(Constants.CENSIZ); - // uncompressed size - _size = data.readUInt32LE(Constants.CENLEN); - // filename length - _fnameLen = data.readUInt16LE(Constants.CENNAM); - // extra field length - _extraLen = data.readUInt16LE(Constants.CENEXT); - // file comment length - _comLen = data.readUInt16LE(Constants.CENCOM); - // volume number start - _diskStart = data.readUInt16LE(Constants.CENDSK); - // internal file attributes - _inattr = data.readUInt16LE(Constants.CENATT); - // external file attributes - _attr = data.readUInt32LE(Constants.CENATX); - // LOC header offset - _offset = data.readUInt32LE(Constants.CENOFF); - }, - - toBinary : function() { - // CEN header size (46 bytes) - var data = new Buffer(Constants.CENHDR + _fnameLen + _extraLen + _comLen); - // "PK\001\002" - data.writeUInt32LE(Constants.CENSIG, 0); - // version made by - data.writeUInt16LE(_verMade, Constants.CENVEM); - // version needed to extract - data.writeUInt16LE(_version, Constants.CENVER); - // encrypt, decrypt flags - data.writeUInt16LE(_flags, Constants.CENFLG); - // compression method - data.writeUInt16LE(_method, Constants.CENHOW); - // modification time (2 bytes time, 2 bytes date) - data.writeUInt32LE(_time, Constants.CENTIM); - // uncompressed file crc-32 value - data.writeInt32LE(_crc, Constants.CENCRC, true); - // compressed size - data.writeUInt32LE(_compressedSize, Constants.CENSIZ); - // uncompressed size - data.writeUInt32LE(_size, Constants.CENLEN); - // filename length - data.writeUInt16LE(_fnameLen, Constants.CENNAM); - // extra field length - data.writeUInt16LE(_extraLen, Constants.CENEXT); - // file comment length - data.writeUInt16LE(_comLen, Constants.CENCOM); - // volume number start - data.writeUInt16LE(_diskStart, Constants.CENDSK); - // internal file attributes - data.writeUInt16LE(_inattr, Constants.CENATT); - // external file attributes - data.writeUInt32LE(_attr, Constants.CENATX); - // LOC header offset - data.writeUInt32LE(_offset, Constants.CENOFF); - // fill all with - data.fill(0x00, Constants.CENHDR); - return data; - }, - - toString : function() { - return '{\n' + - '\t"made" : ' + _verMade + ",\n" + - '\t"version" : ' + _version + ",\n" + - '\t"flags" : ' + _flags + ",\n" + - '\t"method" : ' + Utils.methodToString(_method) + ",\n" + - '\t"time" : ' + _time + ",\n" + - '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" + - '\t"compressedSize" : ' + _compressedSize + " bytes,\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"fileNameLength" : ' + _fnameLen + ",\n" + - '\t"extraLength" : ' + _extraLen + " bytes,\n" + - '\t"commentLength" : ' + _comLen + " bytes,\n" + - '\t"diskNumStart" : ' + _diskStart + ",\n" + - '\t"inAttr" : ' + _inattr + ",\n" + - '\t"attr" : ' + _attr + ",\n" + - '\t"offset" : ' + _offset + ",\n" + - '\t"entryHeaderSize" : ' + (Constants.CENHDR + _fnameLen + _extraLen + _comLen) + " bytes\n" + - '}'; - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/index.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/index.js deleted file mode 100644 index 932a98c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/index.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.EntryHeader = require("./entryHeader"); -exports.DataHeader = require("./dataHeader"); -exports.MainHeader = require("./mainHeader"); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/mainHeader.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/mainHeader.js deleted file mode 100644 index de8ae1a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/headers/mainHeader.js +++ /dev/null @@ -1,80 +0,0 @@ -var Utils = require("../util"), - Constants = Utils.Constants; - -/* The entries in the end of central directory */ -module.exports = function () { - var _volumeEntries = 0, - _totalEntries = 0, - _size = 0, - _offset = 0, - _commentLength = 0; - - return { - get diskEntries () { return _volumeEntries }, - set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; }, - - get totalEntries () { return _totalEntries }, - set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; }, - - get size () { return _size }, - set size (/*Number*/val) { _size = val; }, - - get offset () { return _offset }, - set offset (/*Number*/val) { _offset = val; }, - - get commentLength () { return _commentLength }, - set commentLength (/*Number*/val) { _commentLength = val; }, - - get mainHeaderSize () { - return Constants.ENDHDR + _commentLength; - }, - - loadFromBinary : function(/*Buffer*/data) { - // data should be 22 bytes and start with "PK 05 06" - if (data.length != Constants.ENDHDR || data.readUInt32LE(0) != Constants.ENDSIG) - throw Utils.Errors.INVALID_END; - - // number of entries on this volume - _volumeEntries = data.readUInt16LE(Constants.ENDSUB); - // total number of entries - _totalEntries = data.readUInt16LE(Constants.ENDTOT); - // central directory size in bytes - _size = data.readUInt32LE(Constants.ENDSIZ); - // offset of first CEN header - _offset = data.readUInt32LE(Constants.ENDOFF); - // zip file comment length - _commentLength = data.readUInt16LE(Constants.ENDCOM); - }, - - toBinary : function() { - var b = new Buffer(Constants.ENDHDR + _commentLength); - // "PK 05 06" signature - b.writeUInt32LE(Constants.ENDSIG, 0); - b.writeUInt32LE(0, 4); - // number of entries on this volume - b.writeUInt16LE(_volumeEntries, Constants.ENDSUB); - // total number of entries - b.writeUInt16LE(_totalEntries, Constants.ENDTOT); - // central directory size in bytes - b.writeUInt32LE(_size, Constants.ENDSIZ); - // offset of first CEN header - b.writeUInt32LE(_offset, Constants.ENDOFF); - // zip file comment length - b.writeUInt16LE(_commentLength, Constants.ENDCOM); - // fill comment memory with spaces so no garbage is left there - b.fill(" ", Constants.ENDHDR); - - return b; - }, - - toString : function() { - return '{\n' + - '\t"diskEntries" : ' + _volumeEntries + ",\n" + - '\t"totalEntries" : ' + _totalEntries + ",\n" + - '\t"size" : ' + _size + " bytes,\n" + - '\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" + - '\t"commentLength" : 0x' + _commentLength + "\n" + - '}'; - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/deflater.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/deflater.js deleted file mode 100644 index b126d46..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/deflater.js +++ /dev/null @@ -1,1051 +0,0 @@ -function JSDeflater(/*inbuff*/inbuf) { - - var WSIZE = 0x8000, // Sliding Window size - WINDOW_SIZE = 0x10000, - - /* for deflate */ - MIN_MATCH = 0x03, - MAX_MATCH = 0x102, - LIT_BUFSIZE = 0x2000, - MAX_DIST = 0x7EFA, - MAX_BITS = 0x0F, - MAX_BL_BITS = 0x07, - L_CODES = 0x11E, - D_CODES = 0x1E, - BL_CODES = 0x13, - REP_3_6 = 0x10, - REPZ_3_10 = 0x11, - REPZ_11_138 = 0x12, - HEAP_SIZE = 2 * L_CODES + 1, - H_SHIFT = parseInt((0x10 + MIN_MATCH - 1) / MIN_MATCH), - - /* variables */ - freeQueue, - qHead, qTail, - initFlag, - outbuf = null, - outcnt, outoff, - complete, - window, - dBuf, - lBuf, - prev, - biBuf, - biValid, - blockStart, - zip_ins_h, - hashHead, - prevMatch, - matchAvailable, - matchLength, - matchStart, - prevLength, - dataStart, - eofile, - lookahead, - maxChainLength, - maxLazyMatch, - compression_level, - goodMatch, - dynLTree = [], - dynDTree = [], - staticLTree = [], - staticDTree = [], - blTree = [], - lDesc, - dDesc, - blDesc, - blCount, - zip_heap, - heapLen, - heapMax, - depth, - lengthCode, - distCode, - baseLength, - baseDist, - flagBuf, - lastLit, - lastDist, - lastFlags, - flags, - flagBit, - optLen, - staticLen, - deflateData, - deflatePos, - - elbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], - edbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], - eblbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], - blorder = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - - function deflateTreeDesc() { - return { - dyn_tree : null, // the dynamic tree - static_tree : null, // corresponding static tree or NULL - extra_bits : null, // extra bits for each code or NULL - extra_base : 0, // base index for extra_bits - elems : 0, // max number of elements in the tree - max_length : 0, // max bit length for the codes - max_code : 0 - } - } - - function deflateStart(level) { - var i; - compression_level = !level && 9 || level > 9 && 9 || level; - initFlag = false; - eofile = false; - - if(outbuf != null) - return; - - freeQueue = qHead = qTail = null; - outbuf = new Buffer(LIT_BUFSIZE); - window = new Buffer(WINDOW_SIZE); - - dBuf = new Array(LIT_BUFSIZE); - lBuf = new Array(inbuf.length + 0x64); // 0x64 extra buffer length - prev = new Array(0x10000); - - for(i = 0; i < HEAP_SIZE; i++) dynLTree[i] = {fc:0, dl:0}; - for(i = 0; i < 2 * D_CODES + 1; i++) dynDTree[i] = {fc:0, dl:0}; - for(i = 0; i < L_CODES + 2; i++) staticLTree[i] = {fc:0, dl:0}; - for(i = 0; i < D_CODES; i++) staticDTree[i] = {fc:0, dl:0}; - for(i = 0; i < 2 * BL_CODES + 1; i++) blTree[i] = {fc:0, dl:0}; - - lDesc = deflateTreeDesc(); - dDesc = deflateTreeDesc(); - blDesc = deflateTreeDesc(); - - blCount = new Buffer(MAX_BITS + 1); - zip_heap = new Array(2 * L_CODES + 1); - depth = new Buffer(2 * L_CODES + 1); - lengthCode = new Buffer(MAX_MATCH - MIN_MATCH + 1); - distCode = new Buffer(0x200); - baseLength = new Buffer(0x1D); - baseDist = new Buffer(D_CODES); - flagBuf = new Buffer(parseInt(LIT_BUFSIZE / 8)); - } - - function cleanup() { - freeQueue = qHead = qTail = null; - outbuf = null; - window = null; - dBuf = null; - lBuf = null; - prev = null; - dynLTree = null; - dynDTree = null; - staticLTree = null; - staticDTree = null; - blTree = null; - lDesc = null; - dDesc = null; - blDesc = null; - blCount = null; - zip_heap = null; - depth = null; - lengthCode = null; - distCode = null; - baseLength = null; - baseDist = null; - flagBuf = null; - } - - function writeByte(c) { - outbuf[outoff + outcnt++] = c; - if(outoff + outcnt == LIT_BUFSIZE) { - if(outcnt != 0) { - var q, i; - if (freeQueue != null) { - q = freeQueue; - freeQueue = freeQueue.next; - } else { - q = { - "next" : null, - "len" : 0, - "ptr" : new Buffer(LIT_BUFSIZE), - "off" : 0 - } - } - q.next = null; - q.len = q.off = 0; - - if(qHead == null) - qHead = qTail = q; - else - qTail = qTail.next = q; - - q.len = outcnt - outoff; - for(i = 0; i < q.len; i++) - q.ptr[i] = outbuf[outoff + i]; - outcnt = outoff = 0; - } - } - } - - function writeShort(w) { - w &= 0xffff; - if(outoff + outcnt < LIT_BUFSIZE - 2) { - outbuf[outoff + outcnt++] = (w & 0xff); - outbuf[outoff + outcnt++] = (w >>> 8); - } else { - writeByte(w & 0xff); - writeByte(w >>> 8); - } - return true; - } - - function insertString() { - zip_ins_h = ((zip_ins_h << H_SHIFT) ^ (window[dataStart + MIN_MATCH - 1] & 0xff)) & 0x1FFF; - hashHead = prev[WSIZE + zip_ins_h]; - prev[dataStart & 0x7FFF] = hashHead; - prev[WSIZE + zip_ins_h] = dataStart; - } - - function sendCode(c, tree) { - sendBits(tree[c].fc, tree[c].dl); - } - - function zip_D_CODE(dist) { - return (dist < 256 ? distCode[dist] - : distCode[256 + (dist>>7)]) & 0xff; - } - - function smaller(tree, n, m) { - return tree[n].fc < tree[m].fc || - (tree[n].fc == tree[m].fc && depth[n] <= depth[m]); - } - - function readBuff(buff, offset, n) { - var i, len = deflateData.length; - for(i = 0; i < n && deflatePos < len; i++) { - buff[offset + i] = deflateData[deflatePos++]; - } - return i; - } - - function lmInit() { - var j; - - for(j = 0; j < 0x2000; j++) prev[WSIZE + j] = 0; - - goodMatch = [0x0, 0x4, 0x4, 0x4, 0x4, 0x8, 0x8, 0x8, 0x20, 0x20][compression_level]; - maxLazyMatch = [0x0, 0x4, 0x5, 0x6, 0x4, 0x10, 0x10, 0x20, 0x80, 0x102][compression_level]; - maxChainLength = [0x0, 0x4, 0x8, 0x20, 0x10, 0x20, 0x80, 0x100, 0x400, 0x1000][compression_level]; - - dataStart = 0; - blockStart = 0; - - lookahead = readBuff(window, 0, 2 * WSIZE); - if(lookahead <= 0) { - eofile = true; - lookahead = 0; - return; - } - eofile = false; - - while(lookahead < 0x106 && !eofile) - fillWindow(); - - zip_ins_h = 0; - for(j = 0; j < MIN_MATCH - 1; j++) { - zip_ins_h = ((zip_ins_h << H_SHIFT) ^ (window[j] & 0xFF)) & 0x1FFF; - } - } - - function longestMatch(cur_match) { - var chain_length = maxChainLength, // max hash chain length - scanp = dataStart, // current string - matchp, // matched string - len, // length of current match - best_len = prevLength, // best match length so far - limit = (dataStart > MAX_DIST ? dataStart - MAX_DIST : 0), - strendp = dataStart + MAX_MATCH, - scan_end1 = window[scanp + best_len - 1], - scan_end = window[scanp + best_len]; - - prevLength >= goodMatch && (chain_length >>= 2); - do { - matchp = cur_match; - if(window[matchp + best_len] != scan_end || - window[matchp + best_len - 1] != scan_end1 || - window[matchp] != window[scanp] || - window[++matchp] != window[scanp + 1]) { - continue; - } - - scanp += 2; - matchp++; - - do {} while(window[++scanp] == window[++matchp] && - window[++scanp] == window[++matchp] && - window[++scanp] == window[++matchp] && - window[++scanp] == window[++matchp] && - window[++scanp] == window[++matchp] && - window[++scanp] == window[++matchp] && - window[++scanp] == window[++matchp] && - window[++scanp] == window[++matchp] && - scanp < strendp); - - len = MAX_MATCH - (strendp - scanp); - scanp = strendp - MAX_MATCH; - - if(len > best_len) { - matchStart = cur_match; - best_len = len; - if(len >= MAX_MATCH) break; - - scan_end1 = window[scanp + best_len-1]; - scan_end = window[scanp + best_len]; - } - } while((cur_match = prev[cur_match & 0x7FFF]) > limit && --chain_length != 0); - - return best_len; - } - - function fillWindow() { - var n, m, - more = WINDOW_SIZE - lookahead - dataStart; - - if(more == -1) { - more--; - } else if(dataStart >= WSIZE + MAX_DIST) { - - for(n = 0; n < WSIZE; n++) - window[n] = window[n + WSIZE]; - - matchStart -= WSIZE; - dataStart -= WSIZE; - blockStart -= WSIZE; - - for(n = 0; n < 0x2000; n++) { - m = prev[WSIZE + n]; - prev[WSIZE + n] = m >= WSIZE ? m - WSIZE : 0; - } - for(n = 0; n < WSIZE; n++) { - m = prev[n]; - prev[n] = (m >= WSIZE ? m - WSIZE : 0); - } - more += WSIZE; - } - if(!eofile) { - n = readBuff(window, dataStart + lookahead, more); - n <= 0 && (eofile = true) || (lookahead += n); - } - } - - function deflateFast() { - while(lookahead != 0 && qHead == null) { - var flush; // set if current block must be flushed - - insertString(); - - if(hashHead != 0 && dataStart - hashHead <= MAX_DIST) { - matchLength = longestMatch(hashHead); - matchLength > lookahead && (matchLength = lookahead); - } - if(matchLength >= MIN_MATCH) { - flush = ctTally(dataStart - matchStart, matchLength - MIN_MATCH); - lookahead -= matchLength; - - if(matchLength <= maxLazyMatch) { - matchLength--; - do { - dataStart++; - insertString(); - } while(--matchLength != 0); - dataStart++; - } else { - dataStart += matchLength; - matchLength = 0; - zip_ins_h = (((window[dataStart] & 0xFF) << H_SHIFT) ^ (window[dataStart + 1] & 0xFF)) & 0x1FFF; - } - } else { - flush = ctTally(0, window[dataStart] & 0xFF); - lookahead--; - dataStart++; - } - if(flush) { - flushBlock(0); - blockStart = dataStart; - } - - while(lookahead < 0x106 && !eofile) - fillWindow(); - } - } - - function deflateBetter() { - while(lookahead != 0 && qHead == null) { - insertString(); - prevLength = matchLength; - prevMatch = matchStart; - matchLength = MIN_MATCH - 1; - - if(hashHead != 0 && prevLength < maxLazyMatch && dataStart - hashHead <= MAX_DIST) { - matchLength = longestMatch(hashHead); - matchLength > lookahead && (matchLength = lookahead); - (matchLength == MIN_MATCH && dataStart - matchStart > 0x1000) && matchLength--; - } - if(prevLength >= MIN_MATCH && matchLength <= prevLength) { - var flush; // set if current block must be flushed - flush = ctTally(dataStart - 1 - prevMatch, prevLength - MIN_MATCH); - lookahead -= prevLength - 1; - prevLength -= 2; - do { - dataStart++; - insertString(); - } while(--prevLength != 0); - matchAvailable = 0; - matchLength = MIN_MATCH - 1; - dataStart++; - if(flush) { - flushBlock(0); - blockStart = dataStart; - } - } else if( matchAvailable != 0) { - if(ctTally(0, window[dataStart - 1] & 0xff)) { - flushBlock(0); - blockStart = dataStart; - } - dataStart++; - lookahead--; - } else { - matchAvailable = 1; - dataStart++; - lookahead--; - } - - while(lookahead < 0x106 && !eofile) - fillWindow(); - } - } - - function initDeflate() { - if(eofile) return; - - biBuf = 0; - biValid = 0; - ctInit(); - lmInit(); - - qHead = null; - outcnt = 0; - outoff = 0; - - if(compression_level <= 3) { - prevLength = MIN_MATCH - 1; - matchLength = 0; - } else { - matchLength = MIN_MATCH - 1; - matchAvailable = 0; - } - - complete = false; - } - - function internalDeflate(buff, off, buff_size) { - var n; - if(!initFlag) { - initDeflate(); - initFlag = true; - if(lookahead == 0) { // empty - complete = true; - return 0; - } - } - if((n = qCopy(buff, off, buff_size)) == buff_size) return buff_size; - if(complete) return n; - if(compression_level <= 3) // optimized for speed - deflateFast(); - else - deflateBetter(); - if(lookahead == 0) { - matchAvailable != 0 && ctTally(0, window[dataStart - 1] & 0xff); - flushBlock(1); - complete = true; - } - return n + qCopy(buff, n + off, buff_size - n); - } - - function qCopy(buff, off, buff_size) { - var n = 0, i, j; - - while(qHead != null && n < buff_size) { - i = buff_size - n; - i > qHead.len && (i = qHead.len); - for(j = 0; j < i; j++) buff[off + n + j] = qHead.ptr[qHead.off + j]; - qHead.off += i; - qHead.len -= i; - n += i; - if(qHead.len == 0) { - var p; - p = qHead; - qHead = qHead.next; - p.next = freeQueue; - freeQueue = p; - } - } - - if(n == buff_size) return n; - - if(outoff < outcnt) { - i = buff_size - n; - if(i > outcnt - outoff) - i = outcnt - outoff; - for(j = 0; j < i; j++) - buff[off + n + j] = outbuf[outoff + j]; - outoff += i; - n += i; - if(outcnt == outoff) - outcnt = outoff = 0; - } - return n; - } - - function ctInit() { - var n, // iterates over tree elements - bits, // bit counter - length, // length value - code, // code value - dist; // distance index - - if(staticDTree[0].dl != 0) return; // ct_init already called - - lDesc.dyn_tree = dynLTree; - lDesc.static_tree = staticLTree; - lDesc.extra_bits = elbits; - lDesc.extra_base = 0x101; - lDesc.elems = L_CODES; - lDesc.max_length = MAX_BITS; - lDesc.max_code = 0; - - dDesc.dyn_tree = dynDTree; - dDesc.static_tree = staticDTree; - dDesc.extra_bits = edbits; - dDesc.extra_base = 0; - dDesc.elems = D_CODES; - dDesc.max_length = MAX_BITS; - dDesc.max_code = 0; - - blDesc.dyn_tree = blTree; - blDesc.static_tree = null; - blDesc.extra_bits = eblbits; - blDesc.extra_base = 0; - blDesc.elems = BL_CODES; - blDesc.max_length = MAX_BL_BITS; - blDesc.max_code = 0; - - // Initialize the mapping length (0..255) -> length code (0..28) - length = 0; - for(code = 0; code < 0x1E; code++) { - baseLength[code] = length; - for(n = 0; n < (1 << elbits[code]); n++) - lengthCode[length++] = code; - } - lengthCode[length - 1] = code; - dist = 0; - for(code = 0 ; code < 16; code++) { - baseDist[code] = dist; - for(n = 0; n < (1 << edbits[code]); n++) - distCode[dist++] = code; - } - dist >>= 7; // from now on, all distances are divided by 128 - for( ; code < D_CODES; code++) { - baseDist[code] = dist << 7; - for(n = 0; n < (1<<(edbits[code]-7)); n++) - distCode[256 + dist++] = code; - } - for(bits = 0; bits <= MAX_BITS; bits++) blCount[bits] = 0; - - n = 0; - while(n <= 143) { staticLTree[n++].dl = 8; blCount[8]++; } - while(n <= 255) { staticLTree[n++].dl = 9; blCount[9]++; } - while(n <= 279) { staticLTree[n++].dl = 7; blCount[7]++; } - while(n <= 287) { staticLTree[n++].dl = 8; blCount[8]++; } - - genCodes(staticLTree, L_CODES + 1); - - for(n = 0; n < D_CODES; n++) { - staticDTree[n].dl = 5; - staticDTree[n].fc = reverse(n, 5); - } - initBlock(); - } - - function initBlock() { - var n; - - for(n = 0; n < L_CODES; n++) dynLTree[n].fc = 0; - for(n = 0; n < D_CODES; n++) dynDTree[n].fc = 0; - for(n = 0; n < BL_CODES; n++) blTree[n].fc = 0; - - dynLTree[0x100].fc = flagBit = 1; // end block - flags = optLen = staticLen = lastLit = lastDist = lastFlags = 0; - } - - function pqDownHeap(tree, k) { - var v = zip_heap[k], - j = k << 1; - - while(j <= heapLen) { - (j < heapLen && smaller(tree, zip_heap[j + 1], zip_heap[j])) && j++; - if(smaller(tree, v, zip_heap[j])) break; - zip_heap[k] = zip_heap[j]; - k = j; - j <<= 1; - } - zip_heap[k] = v; - } - - - function genBitLen(desc) { - var tree = desc.dyn_tree, - extra = desc.extra_bits, - base = desc.extra_base, - max_code = desc.max_code, - max_length = desc.max_length, - stree = desc.static_tree, - h, // heap index - n, m, // iterate over the tree elements - bits, // bit length - xbits, // extra bits - f, // frequency - overflow = 0; // number of elements with bit length too large - - for(bits = 0; bits <= MAX_BITS; bits++) - blCount[bits] = 0; - - tree[zip_heap[heapMax]].dl = 0; // root of the heap - - for(h = heapMax + 1; h < HEAP_SIZE; h++) { - n = zip_heap[h]; - bits = tree[tree[n].dl].dl + 1; - if(bits > max_length) { - bits = max_length; - overflow++; - } - tree[n].dl = bits; - - if(n > max_code) continue; // not a leaf node - - blCount[bits]++; - xbits = 0; - n >= base && (xbits = extra[n - base]); - f = tree[n].fc; - optLen += f * (bits + xbits); - stree != null && (staticLen += f * (stree[n].dl + xbits)); - } - if (!overflow) return; - do { - bits = max_length - 1; - while(blCount[bits] == 0) bits--; - blCount[bits]--; // move one leaf down the tree - blCount[bits + 1] += 2; // move one overflow item as its brother - blCount[max_length]--; - overflow -= 2; - } while(overflow > 0); - - for(bits = max_length; bits != 0; bits--) { - n = blCount[bits]; - while(n != 0) { - m = zip_heap[--h]; - if(m > max_code) continue; - if(tree[m].dl != bits) { - optLen += (bits - tree[m].dl) * tree[m].fc; - tree[m].fc = bits; - } - n--; - } - } - } - - function genCodes(tree, max_code) { - var next_code = new Array(MAX_BITS + 1), // next code value for each bit length - code = 0, // running code value - bits, // bit index - n; // code index - - for(bits = 1; bits <= MAX_BITS; bits++) { - code = ((code + blCount[bits-1]) << 1); - next_code[bits] = code; - } - - for(n = 0; n <= max_code; n++) { - var len = tree[n].dl; - if (len == 0) - continue; - tree[n].fc = reverse(next_code[len]++, len); - } - } - - function buildTree(desc) { // the tree descriptor - var tree = desc.dyn_tree, - stree = desc.static_tree, - elems = desc.elems, - n, m, // iterate over heap elements - max_code = -1, // largest code with non zero frequency - node = elems; // next internal node of the tree - heapLen = 0; - heapMax = HEAP_SIZE; - - for(n = 0; n < elems; n++) { - if(tree[n].fc != 0) { - zip_heap[++heapLen] = max_code = n; - depth[n] = 0; - } else - tree[n].dl = 0; - } - - while(heapLen < 2) { - var xnew = zip_heap[++heapLen] = (max_code < 2 ? ++max_code : 0); - tree[xnew].fc = 1; - depth[xnew] = 0; - optLen--; - stree != null && (staticLen -= stree[xnew].dl); - } - desc.max_code = max_code; - - for(n = heapLen >> 1; n >= 1; n--) pqDownHeap(tree, n); - - do { - n = zip_heap[1]; - zip_heap[1] = zip_heap[heapLen--]; - pqDownHeap(tree, 1); - - m = zip_heap[1]; // m = node of next least frequency - - // keep the nodes sorted by frequency - zip_heap[--heapMax] = n; - zip_heap[--heapMax] = m; - - // Create a new node father of n and m - tree[node].fc = tree[n].fc + tree[m].fc; - - if(depth[n] > depth[m] + 1) - depth[node] = depth[n]; - else - depth[node] = depth[m] + 1; - - tree[n].dl = tree[m].dl = node; - - // and insert the new node in the heap - zip_heap[1] = node++; - pqDownHeap(tree, 1); - - } while(heapLen >= 2); - - zip_heap[--heapMax] = zip_heap[1]; - - genBitLen(desc); - genCodes(tree, max_code); - } - - function scanTree(tree, max_code) { - var n, // iterates over all tree elements - prevlen = -1, // last emitted length - curlen, // length of current code - nextlen = tree[0].dl, // length of next code - count = 0, // repeat count of the current code - max_count = 7, // max repeat count - min_count = 4; // min repeat count - - if(nextlen == 0) { - max_count = 138; - min_count = 3; - } - tree[max_code + 1].dl = 0xffff; // guard - - for(n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n + 1].dl; - if(++count < max_count && curlen == nextlen) - continue; - else if(count < min_count) - blTree[curlen].fc += count; - else if(curlen != 0) { - if(curlen != prevlen) - blTree[curlen].fc++; - blTree[REP_3_6].fc++; - } else if(count <= 10) - blTree[REPZ_3_10].fc++; - else - blTree[REPZ_11_138].fc++; - count = 0; prevlen = curlen; - if(nextlen == 0) { - max_count = 138; - min_count = 3; - } else if(curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - } - - function sendTree(tree, max_code) { - var n, // iterates over all tree elements - prevlen = -1, // last emitted length - curlen, // length of current code - nextlen = tree[0].dl, // length of next code - count = 0, // repeat count of the current code - max_count = 7, // max repeat count - min_count = 4; // min repeat count - - if(nextlen == 0) { - max_count = 138; - min_count = 3; - } - - for(n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[n+1].dl; - if(++count < max_count && curlen == nextlen) { - continue; - } else if(count < min_count) { - do { sendCode(curlen, blTree); } while(--count != 0); - } else if(curlen != 0) { - if(curlen != prevlen) { - sendCode(curlen, blTree); - count--; - } - sendCode(REP_3_6, blTree); - sendBits(count - 3, 2); - } else if(count <= 10) { - sendCode(REPZ_3_10, blTree); - sendBits(count-3, 3); - } else { - sendCode(REPZ_11_138, blTree); - sendBits(count-11, 7); - } - count = 0; - prevlen = curlen; - if(nextlen == 0) { - max_count = 138; - min_count = 3; - } else if(curlen == nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - } - - function buildBLTree() { - var max_blindex; // index of last bit length code of non zero freq - scanTree(dynLTree, lDesc.max_code); - scanTree(dynDTree, dDesc.max_code); - buildTree(blDesc); - for(max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { - if(blTree[blorder[max_blindex]].dl != 0) break; - } - /* Update opt_len to include the bit length tree and counts */ - optLen += 3 * (max_blindex + 1) + 0xE; - - return max_blindex; - } - - function sendTrees(lcodes, dcodes, blcodes) { - var rank; // index in bl_order - sendBits(lcodes - 0x101, 5); - sendBits(dcodes - 1, 5); - sendBits(blcodes - 4, 4); - for(rank = 0; rank < blcodes; rank++) - sendBits(blTree[blorder[rank]].dl, 3); - - sendTree(dynLTree, lcodes - 1); - sendTree(dynDTree, dcodes - 1); - } - - function flushBlock(eof) { // true if this is the last block for a file - var opt_lenb, static_lenb, // opt_len and static_len in bytes - max_blindex, // index of last bit length code of non zero freq - stored_len = dataStart - blockStart; // length of input block - - flagBuf[lastFlags] = flags; // Save the flags for the last 8 items - - buildTree(lDesc); - buildTree(dDesc); - - max_blindex = buildBLTree(); - - // Determine the best encoding. Compute first the block length in bytes - opt_lenb = (optLen + 3 + 7) >> 3; - static_lenb = (staticLen + 3 + 7) >> 3; - - static_lenb <= opt_lenb && (opt_lenb = static_lenb); - - if(stored_len + 4 <= opt_lenb && blockStart >= 0) { - var i; - sendBits(eof, 3); /* send block type */ - biValid && writeShort(biBuf) && (biBuf = biValid = 0); /* align on byte boundary */ - writeShort(stored_len); - writeShort(~stored_len); - for(i = 0; i < stored_len; i++) writeByte(window[blockStart + i]); - - } else if(static_lenb == opt_lenb) { - sendBits(eof + 2, 3); - compress(staticLTree, staticDTree); - } else { - sendBits(eof + 4, 3); - sendTrees(lDesc.max_code + 1, dDesc.max_code + 1, max_blindex + 1); - compress(dynLTree, dynDTree); - } - - initBlock(); - - (eof != 0) && (biValid && writeShort(biBuf) && (biBuf = biValid = 0)); - } - - function ctTally(dist, lc) { - lBuf[lastLit++] = lc; - if(dist == 0) { - dynLTree[lc].fc++; - } else { - dist--; - dynLTree[lengthCode[lc] + 0x101].fc++; - dynDTree[zip_D_CODE(dist)].fc++; - dBuf[lastDist++] = dist; - flags |= flagBit; - } - flagBit <<= 1; - if((lastLit & 7) == 0) { - flagBuf[lastFlags++] = flags; - flags = 0; - flagBit = 1; - } - if(compression_level > 2 && (lastLit & 0xfff) == 0) { - var out_length = lastLit * 8, - in_length = dataStart - blockStart, - dcode; - - for(dcode = 0; dcode < D_CODES; dcode++) { - out_length += dynDTree[dcode].fc * (5 + edbits[dcode]); - } - out_length >>= 3; - if(lastDist < parseInt(lastLit / 2) && out_length < parseInt(in_length / 2)) - return true; - } - return (lastLit == LIT_BUFSIZE - 1 || lastDist == LIT_BUFSIZE); - } - - function compress(ltree, dtree) { - var dist, // distance of matched string - lc, // match length or unmatched char (if dist == 0) - lx = 0, // running index in l_buf - dx = 0, // running index in d_buf - fx = 0, // running index in flag_buf - flag = 0, // current flags - code, // the code to send - extra; // number of extra bits to send - - if (lastLit != 0) do { - (lx & 7) == 0 && (flag = flagBuf[fx++]); - lc = lBuf[lx++] & 0xff; - if ((flag & 1) == 0) { - sendCode(lc, ltree); /* send a literal byte */ - } else { - code = lengthCode[lc]; - sendCode(code + 0x101, ltree); // send the length code - extra = elbits[code]; - if(extra != 0) { - lc -= baseLength[code]; - sendBits(lc, extra); // send the extra length bits - } - dist = dBuf[dx++]; - code = zip_D_CODE(dist); - sendCode(code, dtree); // send the distance code - extra = edbits[code]; - if(extra != 0) { - dist -= baseDist[code]; - sendBits(dist, extra); // send the extra distance bits - } - } // literal or match pair ? - flag >>= 1; - } while(lx < lastLit); - - sendCode(0x100, ltree); // end block - } - - function sendBits(value, length) { - if(biValid > 0x10 - length) { - biBuf |= (value << biValid); - writeShort(biBuf); - biBuf = (value >> (0x10 - biValid)); - biValid += length - 0x10; - } else { - biBuf |= value << biValid; - biValid += length; - } - } - - function reverse(code, len) { - var res = 0; - do { - res |= code & 1; - code >>= 1; - res <<= 1; - } while(--len > 0); - return res >> 1; - } - - function deflate(buffData, level) { - deflateData = buffData; - deflatePos = 0; - deflateStart(level); - - var buff = new Array(1024), - pages = [], - totalSize = 0, - i; - - for (i = 0; i < 1024; i++) buff[i] = 0; - - while((i = internalDeflate(buff, 0, buff.length)) > 0) { - var buf = new Buffer(buff.slice(0, i)); - pages.push(buf); - totalSize += buf.length; - } - var result = new Buffer(totalSize), - index = 0; - - for (i = 0; i < pages.length; i++) { - pages[i].copy(result, index); - index = index + pages[i].length - } - - return result; - } - - return { - deflate : function() { - return deflate(inbuf, 8); - } - } -} - -module.exports = function(/*Buffer*/inbuf) { - - var zlib = require("zlib"); - - return { - deflate : function() { - return new JSDeflater(inbuf).deflate(); - }, - - deflateAsync : function(/*Function*/callback) { - var tmp = zlib.createDeflateRaw(); - tmp.on('data', function(data) { - callback(data); - }); - tmp.end(inbuf) - } - } -}; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/index.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/index.js deleted file mode 100644 index ddcbba6..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.Deflater = require("./deflater"); -exports.Inflater = require("./inflater"); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/inflater.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/inflater.js deleted file mode 100644 index 075e09a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/methods/inflater.js +++ /dev/null @@ -1,446 +0,0 @@ -var Buffer = require("buffer").Buffer; - -function JSInflater(/*Buffer*/input) { - - var WSIZE = 0x8000, - slide = new Buffer(0x10000), - windowPos = 0, - fixedTableList = null, - fixedTableDist, - fixedLookup, - bitBuf = 0, - bitLen = 0, - method = -1, - eof = false, - copyLen = 0, - copyDist = 0, - tblList, tblDist, bitList, bitdist, - - inputPosition = 0, - - MASK_BITS = [0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff], - LENS = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], - LEXT = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99], - DISTS = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577], - DEXT = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], - BITORDER = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - - function HuffTable(clen, cnum, cval, blist, elist, lookupm) { - - this.status = 0; - this.root = null; - this.maxbit = 0; - - var el, f, tail, - offsets = [], - countTbl = [], - sTbl = [], - values = [], - tentry = {extra: 0, bitcnt: 0, lbase: 0, next: null}; - - tail = this.root = null; - for(var i = 0; i < 0x11; i++) { countTbl[i] = 0; sTbl[i] = 0; offsets[i] = 0; } - for(i = 0; i < 0x120; i++) values[i] = 0; - - el = cnum > 256 ? clen[256] : 16; - - var pidx = -1; - while (++pidx < cnum) countTbl[clen[pidx]]++; - - if(countTbl[0] == cnum) return; - - for(var j = 1; j <= 16; j++) if(countTbl[j] != 0) break; - var bitLen = j; - for(i = 16; i != 0; i--) if(countTbl[i] != 0) break; - var maxLen = i; - - lookupm < j && (lookupm = j); - - var dCodes = 1 << j; - for(; j < i; j++, dCodes <<= 1) - if((dCodes -= countTbl[j]) < 0) { - this.status = 2; - this.maxbit = lookupm; - return; - } - - if((dCodes -= countTbl[i]) < 0) { - this.status = 2; - this.maxbit = lookupm; - return; - } - - countTbl[i] += dCodes; - offsets[1] = j = 0; - pidx = 1; - var xp = 2; - while(--i > 0) offsets[xp++] = (j += countTbl[pidx++]); - pidx = 0; - i = 0; - do { - (j = clen[pidx++]) && (values[offsets[j]++] = i); - } while(++i < cnum); - cnum = offsets[maxLen]; - offsets[0] = i = 0; - pidx = 0; - - var level = -1, - w = sTbl[0] = 0, - cnode = null, - tblCnt = 0, - tblStack = []; - - for(; bitLen <= maxLen; bitLen++) { - var kccnt = countTbl[bitLen]; - while(kccnt-- > 0) { - while(bitLen > w + sTbl[1 + level]) { - w += sTbl[1 + level]; - level++; - tblCnt = (tblCnt = maxLen - w) > lookupm ? lookupm : tblCnt; - if((f = 1 << (j = bitLen - w)) > kccnt + 1) { - f -= kccnt + 1; - xp = bitLen; - while(++j < tblCnt) { - if((f <<= 1) <= countTbl[++xp]) break; - f -= countTbl[xp]; - } - } - if(w + j > el && w < el) j = el - w; - tblCnt = 1 << j; - sTbl[1 + level] = j; - cnode = []; - while (cnode.length < tblCnt) cnode.push({extra: 0, bitcnt: 0, lbase: 0, next: null}); - if (tail == null) { - tail = this.root = {next:null, list:null}; - } else { - tail = tail.next = {next:null, list:null} - } - tail.next = null; - tail.list = cnode; - - tblStack[level] = cnode; - - if(level > 0) { - offsets[level] = i; - tentry.bitcnt = sTbl[level]; - tentry.extra = 16 + j; - tentry.next = cnode; - j = (i & ((1 << w) - 1)) >> (w - sTbl[level]); - - tblStack[level-1][j].extra = tentry.extra; - tblStack[level-1][j].bitcnt = tentry.bitcnt; - tblStack[level-1][j].lbase = tentry.lbase; - tblStack[level-1][j].next = tentry.next; - } - } - tentry.bitcnt = bitLen - w; - if(pidx >= cnum) - tentry.extra = 99; - else if(values[pidx] < cval) { - tentry.extra = (values[pidx] < 256 ? 16 : 15); - tentry.lbase = values[pidx++]; - } else { - tentry.extra = elist[values[pidx] - cval]; - tentry.lbase = blist[values[pidx++] - cval]; - } - - f = 1 << (bitLen - w); - for(j = i >> w; j < tblCnt; j += f) { - cnode[j].extra = tentry.extra; - cnode[j].bitcnt = tentry.bitcnt; - cnode[j].lbase = tentry.lbase; - cnode[j].next = tentry.next; - } - for(j = 1 << (bitLen - 1); (i & j) != 0; j >>= 1) - i ^= j; - i ^= j; - while((i & ((1 << w) - 1)) != offsets[level]) { - w -= sTbl[level]; - level--; - } - } - } - - this.maxbit = sTbl[1]; - this.status = ((dCodes != 0 && maxLen != 1) ? 1 : 0); - } - - function addBits(n) { - while(bitLen < n) { - bitBuf |= input[inputPosition++] << bitLen; - bitLen += 8; - } - return bitBuf; - } - - function cutBits(n) { - bitLen -= n; - return bitBuf >>= n; - } - - function maskBits(n) { - while(bitLen < n) { - bitBuf |= input[inputPosition++] << bitLen; - bitLen += 8; - } - var res = bitBuf & MASK_BITS[n]; - bitBuf >>= n; - bitLen -= n; - return res; - } - - function codes(buff, off, size) { - var e, t; - if(size == 0) return 0; - - var n = 0; - for(;;) { - t = tblList.list[addBits(bitList) & MASK_BITS[bitList]]; - e = t.extra; - while(e > 16) { - if(e == 99) return -1; - cutBits(t.bitcnt); - e -= 16; - t = t.next[addBits(e) & MASK_BITS[e]]; - e = t.extra; - } - cutBits(t.bitcnt); - if(e == 16) { - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = t.lbase; - if(n == size) return size; - continue; - } - if(e == 15) break; - - copyLen = t.lbase + maskBits(e); - t = tblDist.list[addBits(bitdist) & MASK_BITS[bitdist]]; - e = t.extra; - - while(e > 16) { - if(e == 99) return -1; - cutBits(t.bitcnt); - e -= 16; - t = t.next[addBits(e) & MASK_BITS[e]]; - e = t.extra - } - cutBits(t.bitcnt); - copyDist = windowPos - t.lbase - maskBits(e); - - while(copyLen > 0 && n < size) { - copyLen--; - copyDist &= WSIZE - 1; - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = slide[copyDist++]; - } - - if(n == size) return size; - } - - method = -1; // done - return n; - } - - function stored(buff, off, size) { - cutBits(bitLen & 7); - var n = maskBits(0x10); - if(n != ((~maskBits(0x10)) & 0xffff)) return -1; - copyLen = n; - - n = 0; - while(copyLen > 0 && n < size) { - copyLen--; - windowPos &= WSIZE - 1; - buff[off + n++] = slide[windowPos++] = maskBits(8); - } - - if(copyLen == 0) method = -1; - return n; - } - - function fixed(buff, off, size) { - var fixed_bd = 0; - if(fixedTableList == null) { - var lengths = []; - - for(var symbol = 0; symbol < 144; symbol++) lengths[symbol] = 8; - for(; symbol < 256; symbol++) lengths[symbol] = 9; - for(; symbol < 280; symbol++) lengths[symbol] = 7; - for(; symbol < 288; symbol++) lengths[symbol] = 8; - - fixedLookup = 7; - - var htbl = new HuffTable(lengths, 288, 257, LENS, LEXT, fixedLookup); - - if(htbl.status != 0) return -1; - - fixedTableList = htbl.root; - fixedLookup = htbl.maxbit; - - for(symbol = 0; symbol < 30; symbol++) lengths[symbol] = 5; - fixed_bd = 5; - - htbl = new HuffTable(lengths, 30, 0, DISTS, DEXT, fixed_bd); - if(htbl.status > 1) { - fixedTableList = null; - return -1; - } - fixedTableDist = htbl.root; - fixed_bd = htbl.maxbit; - } - - tblList = fixedTableList; - tblDist = fixedTableDist; - bitList = fixedLookup; - bitdist = fixed_bd; - return codes(buff, off, size); - } - - function dynamic(buff, off, size) { - var ll = new Array(0x023C); - - for (var m = 0; m < 0x023C; m++) ll[m] = 0; - - var llencnt = 257 + maskBits(5), - dcodescnt = 1 + maskBits(5), - bitlencnt = 4 + maskBits(4); - - if(llencnt > 286 || dcodescnt > 30) return -1; - - for(var j = 0; j < bitlencnt; j++) ll[BITORDER[j]] = maskBits(3); - for(; j < 19; j++) ll[BITORDER[j]] = 0; - - // build decoding table for trees--single level, 7 bit lookup - bitList = 7; - var hufTable = new HuffTable(ll, 19, 19, null, null, bitList); - if(hufTable.status != 0) - return -1; // incomplete code set - - tblList = hufTable.root; - bitList = hufTable.maxbit; - var lencnt = llencnt + dcodescnt, - i = 0, - lastLen = 0; - while(i < lencnt) { - var hufLcode = tblList.list[addBits(bitList) & MASK_BITS[bitList]]; - j = hufLcode.bitcnt; - cutBits(j); - j = hufLcode.lbase; - if(j < 16) - ll[i++] = lastLen = j; - else if(j == 16) { - j = 3 + maskBits(2); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = lastLen; - } else if(j == 17) { - j = 3 + maskBits(3); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = 0; - lastLen = 0; - } else { - j = 11 + maskBits(7); - if(i + j > lencnt) return -1; - while(j-- > 0) ll[i++] = 0; - lastLen = 0; - } - } - bitList = 9; - hufTable = new HuffTable(ll, llencnt, 257, LENS, LEXT, bitList); - bitList == 0 && (hufTable.status = 1); - - if (hufTable.status != 0) return -1; - - tblList = hufTable.root; - bitList = hufTable.maxbit; - - for(i = 0; i < dcodescnt; i++) ll[i] = ll[i + llencnt]; - bitdist = 6; - hufTable = new HuffTable(ll, dcodescnt, 0, DISTS, DEXT, bitdist); - tblDist = hufTable.root; - bitdist = hufTable.maxbit; - - if((bitdist == 0 && llencnt > 257) || hufTable.status != 0) return -1; - - return codes(buff, off, size); - } - - return { - inflate : function(/*Buffer*/outputBuffer) { - tblList = null; - - var size = outputBuffer.length, - offset = 0, i; - - while(offset < size) { - if(eof && method == -1) return; - if(copyLen > 0) { - if(method != 0) { - while(copyLen > 0 && offset < size) { - copyLen--; - copyDist &= WSIZE - 1; - windowPos &= WSIZE - 1; - outputBuffer[offset++] = slide[windowPos++] = slide[copyDist++]; - } - } else { - while(copyLen > 0 && offset < size) { - copyLen--; - windowPos &= WSIZE - 1; - outputBuffer[offset++] = slide[windowPos++] = maskBits(8); - } - copyLen == 0 && (method = -1); // done - } - if (offset == size) return; - } - - if(method == -1) { - if(eof) break; - eof = maskBits(1) != 0; - method = maskBits(2); - tblList = null; - copyLen = 0; - } - switch(method) { - case 0: i = stored(outputBuffer, offset, size - offset); break; - case 1: i = tblList != null ? codes(outputBuffer, offset, size - offset) : fixed(outputBuffer, offset, size - offset); break; - case 2: i = tblList != null ? codes(outputBuffer, offset, size - offset) : dynamic(outputBuffer, offset, size - offset); break; - default: i = -1; break; - } - - if(i == -1) return; - offset += i; - } - } - }; -} - -module.exports = function(/*Buffer*/inbuf) { - var zlib = require("zlib"); - return { - inflateAsync : function(/*Function*/callback) { - var tmp = zlib.createInflateRaw(), - parts = [], total = 0; - tmp.on('data', function(data) { - parts.push(data); - total += data.length; - }); - tmp.on('end', function() { - var buf = new Buffer(total), written = 0; - buf.fill(0); - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - part.copy(buf, written); - written += part.length; - } - callback && callback(buf); - }); - tmp.end(inbuf) - }, - - inflate : function(/*Buffer*/outputBuffer) { - var x = new JSInflater(inbuf); - x.inflate(outputBuffer); - delete(x); - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/package.json deleted file mode 100644 index 26a1aa1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "adm-zip", - "version": "0.2.1", - "description": "A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk", - "keywords": [ - "zip", - "methods", - "archive", - "unzip" - ], - "homepage": "http://github.com/cthackers/adm-zip", - "author": { - "name": "Nasca Iacob", - "email": "sy@another-d-mention.ro", - "url": "https://github.com/cthackers" - }, - "bugs": { - "url": "https://github.com/cthackers/adm-zip/issues", - "email": "sy@another-d-mention.ro" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/kriskowal/zip/raw/master/LICENSE" - } - ], - "main": "adm-zip.js", - "repository": { - "type": "git", - "url": "git://github.com/git@github.com:cthackers/adm-zip.git" - }, - "engines": { - "node": ">=0.3.0" - }, - "readme": "# ADM-ZIP for NodeJS\r\n\r\nADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/). \r\n\r\n# Installation\r\n\r\nWith [npm](http://npmjs.org) do:\r\n\r\n $ npm install adm-zip\r\n\t\r\n## What is it good for?\r\nThe library allows you to:\r\n\r\n* decompress zip files directly to disk or in memory buffers\r\n* compress files and store them to disk in .zip format or in compressed buffers\r\n* update content of/add new/delete files from an existing .zip\r\n\r\n# Dependencies\r\nThere are no other nodeJS libraries that ADM-ZIP is dependent of\r\n\r\n# Examples\r\n\r\n## Basic usage\r\n```javascript\r\n\r\n\tvar AdmZip = require('adm-zip');\r\n\r\n\t// reading archives\r\n\tvar zip = new AdmZip(\"./my_file.zip\");\r\n\tvar zipEntries = zip.getEntries(); // an array of ZipEntry records\r\n\r\n\tzipEntries.forEach(function(zipEntry) {\r\n\t console.log(zipEntry.toString()); // outputs zip entries information\r\n\t\tif (zipEntry.entryName == \"my_file.txt\") {\r\n\t\t console.log(zipEntry.data.toString('utf8')); \r\n\t\t}\r\n\t});\r\n\t// outputs the content of some_folder/my_file.txt\r\n\tconsole.log(zip.readAsText(\"some_folder/my_file.txt\")); \r\n\t// extracts the specified file to the specified location\r\n\tzip.extractEntryTo(/*entry name*/\"some_folder/my_file.txt\", /*target path*/\"/home/me/tempfolder\", /*overwrite*/true)\r\n\t// extracts everything\r\n\tzip.extractAllTo(/*target path*/\"/home/me/zipcontent/\", /*overwrite*/true);\r\n\t\r\n\t\r\n\t// creating archives\r\n\tvar zip = new AdmZip();\r\n\t\r\n\t// add file directly\r\n\tzip.addFile(\"test.txt\", new Buffer(\"inner content of the file\"), \"entry comment goes here\");\r\n\t// add local file\r\n\tzip.addLocalFile(\"/home/me/some_picture.png\");\r\n\t// get everything as a buffer\r\n\tvar willSendthis = zip.toBuffer();\r\n\t// or write everything to disk\r\n\tzip.writeZip(/*target file name*/\"/home/me/files.zip\");\r\n\t\r\n\t\r\n\t// ... more examples in the wiki\r\n```\r\n\r\nFor more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).\n\n[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip)", - "readmeFilename": "README.md", - "_id": "adm-zip@0.2.1", - "_from": "adm-zip@0.2.1" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/sandbox.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/sandbox.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/constants.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/constants.js deleted file mode 100644 index ecd226c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/constants.js +++ /dev/null @@ -1,53 +0,0 @@ -module.exports = { - /* The local file header */ - LOCHDR : 30, // LOC header size - LOCSIG : 0x04034b50, // "PK\003\004" - LOCVER : 4, // version needed to extract - LOCFLG : 6, // general purpose bit flag - LOCHOW : 8, // compression method - LOCTIM : 10, // modification time (2 bytes time, 2 bytes date) - LOCCRC : 14, // uncompressed file crc-32 value - LOCSIZ : 18, // compressed size - LOCLEN : 22, // uncompressed size - LOCNAM : 26, // filename length - LOCEXT : 28, // extra field length - - /* The Data descriptor */ - EXTSIG : 0x08074b50, // "PK\007\008" - EXTHDR : 16, // EXT header size - EXTCRC : 4, // uncompressed file crc-32 value - EXTSIZ : 8, // compressed size - EXTLEN : 12, // uncompressed size - - /* The central directory file header */ - CENHDR : 46, // CEN header size - CENSIG : 0x02014b50, // "PK\001\002" - CENVEM : 4, // version made by - CENVER : 6, // version needed to extract - CENFLG : 8, // encrypt, decrypt flags - CENHOW : 10, // compression method - CENTIM : 12, // modification time (2 bytes time, 2 bytes date) - CENCRC : 16, // uncompressed file crc-32 value - CENSIZ : 20, // compressed size - CENLEN : 24, // uncompressed size - CENNAM : 28, // filename length - CENEXT : 30, // extra field length - CENCOM : 32, // file comment length - CENDSK : 34, // volume number start - CENATT : 36, // internal file attributes - CENATX : 38, // external file attributes - CENOFF : 42, // LOC header offset - - /* The entries in the end of central directory */ - ENDHDR : 22, // END header size - ENDSIG : 0x06054b50, // "PK\005\006" - ENDSUB : 8, // number of entries on this disk - ENDTOT : 10, // total number of entries - ENDSIZ : 12, // central directory size in bytes - ENDOFF : 16, // offset of first CEN header - ENDCOM : 20, // zip file comment length - - /* Compression methods */ - STORED : 0, - DEFLATED : 8 -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/errors.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/errors.js deleted file mode 100644 index db5d69e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/errors.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - /* Header error messages */ - "INVALID_LOC" : "Invalid LOC header (bad signature)", - "INVALID_CEN" : "Invalid CEN header (bad signature)", - "INVALID_END" : "Invalid END header (bad signature)", - - /* ZipEntry error messages*/ - "NO_DATA" : "Nothing to decompress", - "BAD_CRC" : "CRC32 checksum failed", - "FILE_IN_THE_WAY" : "There is a file in the way: %s", - "UNKNOWN_METHOD" : "Invalid/unsupported compression method", - - /* Inflater error messages */ - "AVAIL_DATA" : "inflate::Available inflate data did not terminate", - "INVALID_DISTANCE" : "inflate::Invalid literal/length or distance code in fixed or dynamic block", - "TO_MANY_CODES" : "inflate::Dynamic block code description: too many length or distance codes", - "INVALID_REPEAT_LEN" : "inflate::Dynamic block code description: repeat more than specified lengths", - "INVALID_REPEAT_FIRST" : "inflate::Dynamic block code description: repeat lengths with no first length", - "INCOMPLETE_CODES" : "inflate::Dynamic block code description: code lengths codes incomplete", - "INVALID_DYN_DISTANCE": "inflate::Dynamic block code description: invalid distance code lengths", - "INVALID_CODES_LEN": "inflate::Dynamic block code description: invalid literal/length code lengths", - "INVALID_STORE_BLOCK" : "inflate::Stored block length did not match one's complement", - "INVALID_BLOCK_TYPE" : "inflate::Invalid block type (type == 3)", - - /* ADM-ZIP error messages */ - "CANT_EXTRACT_FILE" : "Could not extract the file", - "CANT_OVERRIDE" : "Target file already exists", - "NO_ZIP" : "No zip file was loaded", - "NO_ENTRY" : "Entry doesn't exist", - "DIRECTORY_CONTENT_ERROR" : "A directory cannot have content", - "FILE_NOT_FOUND" : "File not found: %s", - "NOT_IMPLEMENTED" : "Not implemented", - "INVALID_FILENAME" : "Invalid filename", - "INVALID_FORMAT" : "Invalid or unsupported zip format. No END header found" -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/fattr.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/fattr.js deleted file mode 100644 index 2191ec1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/fattr.js +++ /dev/null @@ -1,84 +0,0 @@ -var fs = require("fs"), - pth = require("path"); - -fs.existsSync = fs.existsSync || pth.existsSync; - -module.exports = function(/*String*/path) { - - var _path = path || "", - _permissions = 0, - _obj = newAttr(), - _stat = null; - - function newAttr() { - return { - directory : false, - readonly : false, - hidden : false, - executable : false, - mtime : 0, - atime : 0 - } - } - - if (_path && fs.existsSync(_path)) { - _stat = fs.statSync(_path); - _obj.directory = _stat.isDirectory(); - _obj.mtime = _stat.mtime; - _obj.atime = _stat.atime; - _obj.executable = !!(1 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.readonly = !!(2 & parseInt ((_stat.mode & parseInt ("777", 8)).toString (8)[0])); - _obj.hidden = pth.basename(_path)[0] === "."; - } else { - console.warn("Invalid path: " + _path) - } - - return { - - get directory () { - return _obj.directory; - }, - - get readOnly () { - return _obj.readonly; - }, - - get hidden () { - return _obj.hidden; - }, - - get mtime () { - return _obj.mtime; - }, - - get atime () { - return _obj.atime; - }, - - - get executable () { - return _obj.executable; - }, - - decodeAttributes : function(val) { - - }, - - encodeAttributes : function (val) { - - }, - - toString : function() { - return '{\n' + - '\t"path" : "' + _path + ",\n" + - '\t"isDirectory" : ' + _obj.directory + ",\n" + - '\t"isReadOnly" : ' + _obj.readonly + ",\n" + - '\t"isHidden" : ' + _obj.hidden + ",\n" + - '\t"isExecutable" : ' + _obj.executable + ",\n" + - '\t"mTime" : ' + _obj.mtime + "\n" + - '\t"aTime" : ' + _obj.atime + "\n" + - '}'; - } - } - -}; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/index.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/index.js deleted file mode 100644 index 935fc1a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = require("./utils"); -module.exports.Constants = require("./constants"); -module.exports.Errors = require("./errors"); -module.exports.FileAttr = require("./fattr"); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/utils.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/utils.js deleted file mode 100644 index 1a4b19e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/util/utils.js +++ /dev/null @@ -1,134 +0,0 @@ -var fs = require("fs"), - pth = require('path'); - -fs.existsSync = fs.existsSync || pth.existsSync; - -module.exports = (function() { - - var crcTable = [], - Constants = require('./constants'), - Errors = require('./errors'), - - PATH_SEPARATOR = pth.normalize("/"); - - - function mkdirSync(/*String*/path) { - var resolvedPath = path.split(PATH_SEPARATOR)[0]; - path.split(PATH_SEPARATOR).forEach(function(name) { - if (!name || name.substr(-1,1) == ":") return; - resolvedPath += PATH_SEPARATOR + name; - var stat; - try { - stat = fs.statSync(resolvedPath); - } catch (e) { - fs.mkdirSync(resolvedPath); - } - if (stat && stat.isFile()) - throw Errors.FILE_IN_THE_WAY.replace("%s", resolvedPath); - }); - } - - function findSync(/*String*/root, /*RegExp*/pattern, /*Boolean*/recoursive) { - if (typeof pattern === 'boolean') { - recoursive = pattern; - pattern = undefined; - } - var files = []; - fs.readdirSync(root).forEach(function(file) { - var path = pth.join(root, file); - - if (fs.statSync(path).isDirectory() && recoursive) - files = files.concat(findSync(path, pattern, recoursive)); - - if (!pattern || pattern.test(path)) { - files.push(pth.normalize(path) + (fs.statSync(path).isDirectory() ? PATH_SEPARATOR : "")); - } - - }); - return files; - } - - return { - makeDir : function(/*String*/path) { - mkdirSync(path); - }, - - crc32 : function(buf) { - var b = new Buffer(4); - if (!crcTable.length) { - for (var n = 0; n < 256; n++) { - var c = n; - for (var k = 8; --k >= 0;) // - if ((c & 1) != 0) { c = 0xedb88320 ^ (c >>> 1); } else { c = c >>> 1; } - if (c < 0) { - b.writeInt32LE(c, 0); - c = b.readUInt32LE(0); - } - crcTable[n] = c; - } - } - var crc = 0, off = 0, len = buf.length, c1 = ~crc; - while(--len >= 0) c1 = crcTable[(c1 ^ buf[off++]) & 0xff] ^ (c1 >>> 8); - crc = ~c1; - b.writeInt32LE(crc & 0xffffffff, 0); - return b.readUInt32LE(0); - }, - - methodToString : function(/*Number*/method) { - switch (method) { - case Constants.STORED: - return 'STORED (' + method + ')'; - case Constants.DEFLATED: - return 'DEFLATED (' + method + ')'; - default: - return 'UNSUPPORTED (' + method + ')' - } - - }, - - writeFileTo : function(/*String*/path, /*Buffer*/content, /*Boolean*/overwrite, /*Number*/attr) { - if (fs.existsSync(path)) { - if (!overwrite) - return false; // cannot overwite - - var stat = fs.statSync(path); - if (stat.isDirectory()) { - return false; - } - } - var folder = pth.dirname(path); - if (!fs.existsSync(folder)) { - mkdirSync(folder); - } - - var fd; - try { - fd = fs.openSync(path, 'w', 0666); - } catch(e) { - fs.chmodSync(path, 0666); - fd = fs.openSync(path, 'w', 0666); - } - if (fd) { - fs.writeSync(fd, content, 0, content.length, 0); - fs.closeSync(fd); - } - fs.chmodSync(path, attr || 0666); - return true; - }, - - findFiles : function(/*String*/path) { - return findSync(path, true); - }, - - getAttributes : function(/*String*/path) { - - }, - - setAttributes : function(/*String*/path) { - - }, - - Constants : Constants, - Errors : Errors - } -})(); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/zipEntry.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/zipEntry.js deleted file mode 100644 index 3b7eeaf..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/zipEntry.js +++ /dev/null @@ -1,245 +0,0 @@ -var Utils = require("./util"), - Headers = require("./headers"), - Methods = require("./methods"); - -module.exports = function () { - - var _entryHeader = new Headers.EntryHeader(), - _dataHeader = new Headers.DataHeader(), - - _entryName = "", - _isDirectory = false, - _extra = null, - _compressedData = null, - _data = null, - _comment = "", - _needDeflate = false; - - function decompress(/*Boolean*/async, /*Function*/callback) { - // if (_data == null) { - if (true) { - if (_compressedData == null) { - if (_isDirectory) { - if (async && callback) { - callback(new Buffer(), "directory"); //si added error. - } - return; - } - //throw 'Noting to decompress'; - callback(new Buffer(), "Nothing to decompress");//si added error. - } - switch (_dataHeader.method) { - case Utils.Constants.STORED: - _data = new Buffer(_dataHeader.size); - _compressedData.copy(_data, 0, _dataHeader.fileHeaderSize); - if (Utils.crc32(_data) != _dataHeader.crc) { - //throw Utils.Errors.BAD_CRC - callback(_data, Utils.Errors.BAD_CRC);//si added error - return Utils.Errors.BAD_CRC; - } else {//si added otherwise did not seem to return data. - if (callback) callback(_data); - return 'ok'; - } - break; - case Utils.Constants.DEFLATED: - var inflater = new Methods.Inflater(_compressedData.slice(_dataHeader.fileHeaderSize)); - if (!async) { - _data = new Buffer(_entryHeader.size); - _data.fill(0); - inflater.inflate(_data); - if (Utils.crc32(_data) != _dataHeader.crc) { - console.warn( Utils.Errors.BAD_CRC + " " + _entryName) - } - } else { - inflater.inflateAsync(function(data) { - _data = new Buffer(_entryHeader.size); - _data.fill(0); - data.copy(_data, 0); - if (Utils.crc32(_data) != _dataHeader.crc) { - //throw Utils.Errors.BAD_CRC - callback(_data,Utils.Errors.BAD_CRC); //avoid throw it would bring down node. - return Utils.Errors.BAD_CRC - } else { - callback(_data); - return 'ok'; - } - }) - } - break; - default: - // throw Utils.Errors.UNKNOWN_METHOD; - callback(new Buffer(),Utils.Errors.BAD_CRC); //avoid throw it would bring down node. - return Utils.Errors.UNKNOWN_METHOD; - } - } else { - if (async && callback) { - callback(_data); - } - } - } - - function compress(/*Boolean*/async, /*Function*/callback) { - if ( _needDeflate) { - _compressedData = null; - } - if (_compressedData == null) { - if (_isDirectory || !_data) { - _data = new Buffer(0); - _compressedData = new Buffer(0); - return; - } - // Local file header - _dataHeader.version = 10; - _dataHeader.flags = 0; - _dataHeader.time = _entryHeader.time; - _dataHeader.compressedSize = _data.length; - _dataHeader.fileNameLength = _entryName.length; - _dataHeader.method = 8; - switch (_dataHeader.method) { - case Utils.Constants.STORED: - _dataHeader.method = Utils.Constants.STORED; - _compressedData = new Buffer(Utils.Constants.LOCHDR + _entryName.length + _data.length); - _dataHeader.toBinary().copy(_compressedData); - _compressedData.write(_entryName, Utils.Constants.LOCHDR); - _data.copy(_compressedData, Utils.Constants.LOCHDR + _entryName.length); - break; - default: - case Utils.Constants.DEFLATED: - _dataHeader.method = Utils.Constants.DEFLATED; - _entryHeader.method = Utils.Constants.DEFLATED; - - var deflater = new Methods.Deflater(_data); - if (!async) { - var deflated = deflater.deflate(); - _compressedData = new Buffer(deflated.length + Utils.Constants.LOCHDR + _entryName.length); - _compressedData.fill(0); - - _dataHeader.toBinary().copy(_compressedData); - _compressedData.write(_entryName, Utils.Constants.LOCHDR); - deflated.copy(_compressedData, Utils.Constants.LOCHDR + _entryName.length); - - deflated = null; - } else { - deflater.deflateAsync(function(data) { - _compressedData = new Buffer(data.length + Utils.Constants.LOCHDR + _entryName.length); - _dataHeader.toBinary().copy(_compressedData); - _compressedData.write(_entryName, Utils.Constants.LOCHDR); - data.copy(_compressedData, Utils.Constants.LOCHDR + _entryName.length); - callback(_compressedData); - }) - } - deflater = null; - break; - } - _needDeflate = false; - } else { - if (async && callback) { - callback(_compressedData); - } - } - } - - return { - get entryName () { return _entryName; }, - set entryName (val) { - _compressedData && (_needDeflate = true); - _entryName = val; - _isDirectory = val.charAt(_entryName.length - 1) == "/"; - _entryHeader.fileNameLength = val.length; - _dataHeader.fileNameLenght = val.length; - }, - - get extra () { return _extra; }, - set extra (val) { - _extra = val; - _entryHeader.extraLength = val.length; - }, - - get comment () { return _comment; }, - set comment (val) { - _comment = val; - _entryHeader.commentLength = val.length; - }, - - get name () { return _entryName.split("/").pop(); }, - get isDirectory () { return _isDirectory }, - - setCompressedData : function(value) { - _compressedData = value; - _dataHeader.loadFromBinary(_compressedData.slice(0, Utils.Constants.LOCHDR)); - _data = null; - _needDeflate = false; - }, - - getCompressedData : function() { - compress(false, null); - return _compressedData - }, - getCompressedDataAsync : function(/*Function*/callback) { - compress(true, callback) - }, - - setData : function(value) { - if (typeof value == "string") { - value = new Buffer(value); - } - _needDeflate = true; - _compressedData = null; - _dataHeader.time = +new Date(); - _entryHeader.size = _dataHeader.size; - - if (value && value.length) { - _dataHeader.compressedSize = value.length; - _entryHeader.compressedSize = _dataHeader.compressedSize; - _dataHeader.size = value.length; - _entryHeader.size = value.length; - _dataHeader.crc = Utils.crc32(value); - _entryHeader.crc = _dataHeader.crc; - } - //_entryHeader.method = _dataHeader.method; - - _data = value; - }, - - getData : function() { - decompress(false, null); - return _data - }, - - getDataAsync : function(/*Function*/callback) { - decompress(true, callback) - }, - - set header(/*Buffer*/data) { - _entryHeader.loadFromBinary(data); - }, - - get header() { - return _entryHeader; - }, - - packHeader : function() { - var header = _entryHeader.toBinary(); - header.write(_entryName, Utils.Constants.CENHDR); - if (_entryHeader.extraLength) { - _extra.copy(header, Utils.Constants.CENHDR + _entryName.length) - } - if (_entryHeader.commentLength) { - header.write(_comment, Utils.Constants.CENHDR + _entryName.length + _entryHeader.extraLength, _comment.length, 'utf8'); - } - return header; - }, - - toString : function() { - return '{\n' + - '\t"entryName" : "' + _entryName + "\",\n" + - '\t"name" : "' + _entryName.split("/").pop() + "\",\n" + - '\t"comment" : "' + _comment + "\",\n" + - '\t"isDirectory" : ' + _isDirectory + ",\n" + - '\t"header" : ' + _entryHeader.toString().replace(/\t/mg, "\t\t") + ",\n" + - '\t"compressedData" : <' + (_compressedData && _compressedData.length + " bytes buffer" || "null") + ">\n" + - '\t"data" : <' + (_data && _data.length + " bytes buffer" || "null") + ">\n" + - '}'; - } - } -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/zipFile.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/zipFile.js deleted file mode 100644 index eda7f8b..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/adm-zip/zipFile.js +++ /dev/null @@ -1,214 +0,0 @@ -var ZipEntry = require("./zipEntry"), - Headers = require("./headers"); - Utils = require("./util"); - -module.exports = function(/*Buffer*/buf) { - var entryList = [], - entryTable = {}, - _comment = '', - endHeader = new Headers.MainHeader(); - - if (buf) { - readMainHeader(); - } - - function readEntries() { - entryTable = {}; - entryList = new Array(endHeader.diskEntries); // total number of entries - var index = endHeader.offset; // offset of first CEN header - for(var i = 0; i < entryList.length; i++) { - - var tmp = index, - entry = new ZipEntry(); - - entry.header = buf.slice(tmp, tmp += Utils.Constants.CENHDR); - entry.entryName = buf.toString('utf8', tmp, tmp += entry.header.fileNameLength); - - if (entry.header.extraLength) - entry.extra = buf.slice(tmp, tmp += entry.header.extraLength); - - if (entry.header.commentLength) - entry.comment = buf.toString('utf8', tmp, tmp + entry.header.commentLength); - - index += entry.header.entryHeaderSize; - - if (!entry.isDirectory) { - // read data - //entry.setCompressedData(buf.slice(entry.header.offset, entry.header.offset + Utils.Constants.LOCHDR + entry.header.compressedSize + entry.entryName.length)); - entry.setCompressedData(buf.slice(entry.header.offset, entry.header.offset + Utils.Constants.LOCHDR + entry.header.compressedSize + entry.entryName.length + buf.readUInt16LE(entry.header.offset + Utils.Constants.LOCEXT))); - } - - entryList[i] = entry; - entryTable[entry.entryName] = entry; - } - } - - function readMainHeader() { - var i = buf.length - Utils.Constants.ENDHDR, // END header size - n = Math.max(0, i - 0xFFFF), // 0xFFFF is the max zip file comment length - endOffset = 0; // Start offset of the END header - - for (i; i >= n; i--) { - if (buf[i] != 0x50) continue; // quick check that the byte is 'P' - if (buf.readUInt32LE(i) == Utils.Constants.ENDSIG) { // "PK\005\006" - endOffset = i; - break; - } - } - if (!endOffset) - throw Utils.Errors.INVALID_FORMAT; - - endHeader.loadFromBinary(buf.slice(endOffset, endOffset + Utils.Constants.ENDHDR)); - if (endHeader.commentLength) { - _comment = buf.toString('utf8', endOffset + Utils.Constants.ENDHDR); - } - readEntries(); - } - - return { - /** - * Returns an array of ZipEntry objects existent in the current opened archive - * @return Array - */ - get entries () { - return entryList; - }, - - /** - * Archive comment - * @return {String} - */ - get comment () { return _comment; }, - set comment(val) { - endHeader.commentLength = val.length; - _comment = val; - }, - - /** - * Returns a reference to the entry with the given name or null if entry is inexistent - * - * @param entryName - * @return ZipEntry - */ - getEntry : function(/*String*/entryName) { - return entryTable[entryName] || null; - }, - - /** - * Adds the given entry to the entry list - * - * @param entry - */ - setEntry : function(/*ZipEntry*/entry) { - entryList.push(entry); - entryTable[entry.entryName] = entry; - endHeader.totalEntries = entryList.length; - }, - - /** - * Removes the entry with the given name from the entry list. - * - * If the entry is a directory, then all nested files and directories will be removed - * @param entryName - */ - deleteEntry : function(/*String*/entryName) { - var entry = entryTable[entryName]; - if (entry && entry.isDirectory) { - var _self = this; - this.getEntryChildren(entry).forEach(function(child) { - if (child.entryName != entryName) { - _self.deleteEntry(child.entryName) - } - }) - } - entryList.slice(entryList.indexOf(entry), 1); - delete(entryTable[entryName]); - endHeader.totalEntries = entryList.length; - }, - - /** - * Iterates and returns all nested files and directories of the given entry - * - * @param entry - * @return Array - */ - getEntryChildren : function(/*ZipEntry*/entry) { - if (entry.isDirectory) { - var list = [], - name = entry.entryName, - len = name.length; - - entryList.forEach(function(zipEntry) { - if (zipEntry.entryName.substr(0, len) == name) { - list.push(zipEntry); - } - }); - return list; - } - return [] - }, - - /** - * Returns the zip file - * - * @return Buffer - */ - toBuffer : function() { - entryList.sort(function(a, b) { - var nameA = a.entryName.toLowerCase( ); - var nameB = b.entryName.toLowerCase( ); - if (nameA < nameB) {return -1} - if (nameA > nameB) {return 1} - return 0; - }); - - var totalSize = 0, - data = [], - header = [], - dindex = 0; - - endHeader.size = 0; - endHeader.offset = 0; - - entryList.forEach(function(entry) { - entry.header.offset = dindex; - var compressedData = entry.getCompressedData(); - dindex += compressedData.length; - data.push(compressedData); - - var headerData = entry.packHeader(); - header.push(headerData); - endHeader.size += headerData.length; - totalSize += compressedData.length + headerData.length; - }); - - totalSize += endHeader.mainHeaderSize; - // point to end of data and begining of central directory first record - endHeader.offset = dindex; - - dindex = 0; - var outBuffer = new Buffer(totalSize); - data.forEach(function(content) { - content.copy(outBuffer, dindex); // write data - dindex += content.length; - }); - header.forEach(function(content) { - content.copy(outBuffer, dindex); // write data - dindex += content.length; - }); - - var mainHeader = endHeader.toBinary(); - if (_comment) { - mainHeader.write(_comment, Utils.Constants.ENDHDR); - } - - mainHeader.copy(outBuffer, dindex); - - return outBuffer - }, - - toAsyncBuffer : function(/*Function*/callback) { - - } - } -}; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/.npmignore deleted file mode 100644 index 7dccd97..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/LICENSE.TXT b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/LICENSE.TXT deleted file mode 100644 index 55e332a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/LICENSE.TXT +++ /dev/null @@ -1,194 +0,0 @@ -Copyright 2012 The Obvious Corporation. -http://obvious.com/ - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - -------------------------------------------------------------------------- - 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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/README.md deleted file mode 100644 index 254a355..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/README.md +++ /dev/null @@ -1,249 +0,0 @@ -kew: a lightweight (and super fast) promise/deferred framework for node.js -================================== - -**kew** is a lightweight promise framework with an aim of providing a base set of functionality similar to that provided by the [Q library](https://github.com/kriskowal/q "Q"). - -A few answers (for a few questions) -------- - -*Why'd we write it?* - -During our initial usage of **Q** we found that it was consuming 80% of the cpu under load (primarily in chained database callbacks). We spent some time looking at patching **Q** and ultimately found that creating our own lightweight library for server-usage would suit our needs better than figuring out how to make a large cross-platform library more performant on one very specific platform. - -*So this does everything Q does?* - -Nope! **Q** is still an awesome library and does *way* more than **kew**. We support a tiny subset of the **Q** functionality (the subset that we happen to use in our actual use cases). - -What are Promises? -------- - -At its core, a *Promise* is a promise to return a value at some point in the future. A *Promise* represents a value that will be (or may return an error if something goes wrong). *Promises* heavily reduce the complexity of asynchronous coding in node.js-like environments. Example: - -```javascript -// assuming the getUrlContent() function exists and retrieves the content of a url -var htmlPromise = getUrlContent(myUrl) - -// we can then filter that through an http parser (our imaginary parseHtml() function) asynchronously (or maybe synchronously, who knows) -var tagsPromise = htmlPromise.then(parseHtml) - -// and then filter it through another function (getLinks()) which retrieves only the link tags -var linksPromise = tagsPromise.then(getLinks) - -// and then parses the actual urls from the links (using parseUrlsFromLinks()) -var urlsPromise = linksPromise.then(linksPromise) - -// finally, we have a promise that should only provide us with the urls and will run once all the previous steps have ran -urlsPromise.then(function (urls) { - // do something with the urls -}) -``` - -How do I use **kew**? -------- - -As a precursor to all the examples, the following code must be at the top of your page: - -```javascript -var Q = require('kew') -``` - -### Convert a literal into a promise - -The easiest way to start a promise chain is by creating a new promise with a specified literal using Q.resolve() or Q.reject() - -```javascript -// create a promise which passes a value to the next then() call -var successPromise = Q.resolve(val) - -// create a promise which throws an error to be caught by the next fail() call -var failPromise = Q.reject(err) -``` - -In addition, you can create deferreds which can be used if you need to create a promise but resolve it later: - -```javascript -// create the deferreds -var successDefer = Q.defer() -var failDefer = Q.defer() - -// resolve or reject the defers in 1 second -setTimeout(function () { - successDefer.resolve("ok") - failDefer.reject(new Error("this failed")) -}, 1000) - -// extract promises from the deferreds -var successPromise = successDefer.promise -var failPromise = failDefer.promise -``` - -If you have a node-style callback (taking an **Error** as the first parameter and a response as the second), you can call the magic `makeNodeResolver()` function on a defer to allow the defer to handle the callbacks: - -```javascript -// create the deferred -var defer = Q.defer() - -// some node-style function -getObjectFromDatabase(myObjectId, defer.makeNodeResolver()) - -// grab the output -defer.promise - .then(function (obj) { - // successfully retrieved the object - }) - .fail(function (e) { - // failed retrieving the object - }) -``` - -### Handling successful results with `.then()` - -When a promise is resolved, you may call the `.then()` method to retrieve the value of the promise: - -```javascript -promise.then(function (result) { - // do something with the result here -}) -``` - -`.then()` will in turn return a promise which will return the results of whatever it returns (asynchronously or not), allowing it to be chained indefinitely: - -```javascript -Q.resolve('a') - .then(function (result) { - return result + 'b' - }) - .then(function (result) { - return result + 'c' - }) - .then(function (result) { - // result should be 'abc' - }) -``` - -In addition, `.then()` calls may return promises themselves, allowing for complex nesting of asynchronous calls in a flat manner: - -```javascript -var htmlPromise = getUrlContent(myUrl) - -var tagsPromise = htmlPromise.then(function (html) { - if (!validHtml(html)) throw new Error("Invalid HTML") - - // pretend that parseHtml() returns a promise and is asynchronous - return parseHtml(html) -}) -``` - -### Handling errors with `.fail()` - -If a promise is rejected for some reason, you may handle the failure case with the `.fail()` function: - -```javascript -getObjectPromise - .fail(function (e) { - console.error("Failed to retrieve object", e) - }) -``` - -Like `.then()`, `.fail()` also returns a promise. If the `.fail()` call does not throw an error, it will pass the return value of the `.fail()` handler to any `.then()` calls chained to it: - -```javascript -getObjectPromise - .fail(function (e) { - return retryGetObject(objId) - }) - .then(function (obj) { - // yay, we received an object - }) - .fail(function (e) { - // the retry failed :( - console.error("Retrieving the object '" + objId + "' failed") - }) -}) -``` - -If you've reached the end of your promise chain, you may call `.end()` which signifies that the promise chain is ended and any errors should be thrown in whatever scope the code is currently in: - -```javascript -getObjectPromise - // this will throw an error to the uncaught exception handler if the getObjectPromise call is asynchronous - .end() -``` - -### `.fin()` when things are finished - -You may attach a handler to a promise which will be ran regardless of whether the promise was resolved or rejected (but will only run upon completion). This is useful in the cases where you may have set up resources to run a request and wish to tear them down afterwards. `.fin()` will return the promise it is called upon: - -```javascript -var connection = db.connect() - -var itemPromise = db.getItem(itemId) - .fin(function () { - db.close() - }) -``` - -Other utility methods -------- - -There's only one utility method as of now: - -### `.all()` for many things - -If you're waiting for multiple promises to return, you may pass them (mixed in with literals if you desire) into `.all()` which will create a promise that resolves successfully with an array of the results of the promises: - -```javascript -var promises = [] -promises.push(getUrlContent(url1)) -promises.push(getUrlContent(url2)) -promises.push(getUrlContent(url3)) - -Q.all(promises) - .then(function (content) { - // content[0] === content for url 1 - // content[1] === content for url 2 - // content[2] === content for url 3 - }) -``` - -If any of the promises fail, Q.all will fail as well (so make sure to guard your promises with a `.fail()` call beforehand if you don't care whether they succeed or not): - -```javascript -var promises = [] -promises.push(getUrlContent(url1)) -promises.push(getUrlContent(url2)) -promises.push(getUrlContent(url3)) - -Q.all(promises) - .fail(function (e) { - console.log("Failed retrieving a url", e) - }) -``` - -Contributing ------------- - -Questions, comments, bug reports, and pull requests are all welcome. -Submit them at [the project on GitHub](https://github.com/Obvious/kew/). - -Bug reports that include steps-to-reproduce (including code) are the -best. Even better, make them in the form of pull requests that update -the test suite. Thanks! - - -Author ------- - -[Jeremy Stanley](https://github.com/azulus) -supported by -[The Obvious Corporation](http://obvious.com/). - - -License -------- - -Copyright 2013 [The Obvious Corporation](http://obvious.com/). - -Licensed under the Apache License, Version 2.0. -See the top-level file `LICENSE.TXT` and -(http://www.apache.org/licenses/LICENSE-2.0). diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/kew.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/kew.js deleted file mode 100644 index de7ab02..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/kew.js +++ /dev/null @@ -1,426 +0,0 @@ -/** - * An object representing a "promise" for a future value - * - * @param {function(Object)} onSuccess a function to handle successful - * resolution of this promise - * @param {function(Error)} onFail a function to handle failed - * resolution of this promise - * @constructor - */ -function Promise(onSuccess, onFail) { - this.promise = this - this._isPromise = true - this._successFn = onSuccess - this._failFn = onFail - this._hasContext = false - this._nextContext = undefined - this._currentContext = undefined -} - -/** - * Specify that the current promise should have a specified context - * @param {Object} context context - */ -Promise.prototype._useContext = function (context) { - this._nextContext = this._currentContext = context - this._hasContext = true - return this -} - -Promise.prototype.clearContext = function () { - this._hasContext = false - this._nextContext = undefined - return this -} - -/** - * Set the context for all promise handlers to follow - * @param {context} context An arbitrary context - */ -Promise.prototype.setContext = function (context) { - this._nextContext = context - this._hasContext = true - return this -} - -/** - * Get the context for a promise - * @return {Object} the context set by setContext - */ -Promise.prototype.getContext = function () { - return this._nextContext -} - -/** - * Resolve this promise with a specified value - * - * @param {Object} data - */ -Promise.prototype.resolve = function (data) { - if (this._error || this._hasData) throw new Error("Unable to resolve or reject the same promise twice") - - var i - if (data && data._isPromise) { - this._child = data - if (this._promises) { - for (var i = 0; i < this._promises.length; i += 1) { - data._chainPromise(this._promises[i]) - } - delete this._promises - } - - if (this._onComplete) { - for (var i = 0; i < this._onComplete.length; i+= 1) { - data.fin(this._onComplete[i]) - } - delete this._onComplete - } - return - } - - this._hasData = true - this._data = data - - if (this._onComplete) { - for (i = 0; i < this._onComplete.length; i++) { - this._onComplete[i]() - } - } - - if (this._promises) { - for (i = 0; i < this._promises.length; i += 1) { - this._promises[i]._withInput(data) - } - delete this._promises - } -} - -/** - * Reject this promise with an error - * - * @param {Error} e - */ -Promise.prototype.reject = function (e) { - if (this._error || this._hasData) throw new Error("Unable to resolve or reject the same promise twice") - - var i - this._error = e - - if (this._ended) { - process.nextTick(function onPromiseThrow() { - throw e - }) - } - - if (this._onComplete) { - for (i = 0; i < this._onComplete.length; i++) { - this._onComplete[i]() - } - } - - if (this._promises) { - for (i = 0; i < this._promises.length; i += 1) { - this._promises[i]._withError(e) - } - delete this._promises - } -} - -/** - * Provide a callback to be called whenever this promise successfully - * resolves. Allows for an optional second callback to handle the failure - * case. - * - * @param {function(Object)} onSuccess - * @param {?function(Error)} onFail - * @return {Promise} returns a new promise with the output of the onSuccess or - * onFail handler - */ -Promise.prototype.then = function (onSuccess, onFail) { - var promise = new Promise(onSuccess, onFail) - if (this._nextContext) promise._useContext(this._nextContext) - - if (this._child) this._child._chainPromise(promise) - else this._chainPromise(promise) - - return promise -} - -/** - * Provide a callback to be called whenever this promise is rejected - * - * @param {function(Error)} onFail - * @return {Promise} returns a new promise with the output of the onFail handler - */ -Promise.prototype.fail = function (onFail) { - return this.then(null, onFail) -} - -/** - * Provide a callback to be called whenever this promise is either resolved - * or rejected. - * - * @param {function()} onComplete - * @return {Promise} returns the current promise - */ -Promise.prototype.fin = function (onComplete) { - if (this._hasData || this._error) { - onComplete() - return this - } - - if (this._child) { - this._child.fin(onComplete) - } else { - if (!this._onComplete) this._onComplete = [onComplete] - else this._onComplete.push(onComplete) - } - - return this -} - -/** - * Mark this promise as "ended". If the promise is rejected, this will throw an - * error in whatever scope it happens to be in - * - * @return {Promise} returns the current promise - */ -Promise.prototype.end = function () { - if (this._error) { - throw this._error - } - this._ended = true - return this -} - -/** - * Attempt to resolve this promise with the specified input - * - * @param {Object} data the input - */ -Promise.prototype._withInput = function (data) { - if (this._successFn) { - try { - this.resolve(this._successFn(data, this._currentContext)) - } catch (e) { - this.reject(e) - } - } else this.resolve(data) - - // context is no longer needed - delete this._currentContext -} - -/** - * Attempt to reject this promise with the specified error - * - * @param {Error} e - */ -Promise.prototype._withError = function (e) { - if (this._failFn) { - try { - this.resolve(this._failFn(e, this._currentContext)) - } catch (e) { - this.reject(e) - } - } else this.reject(e) - - // context is no longer needed - delete this._currentContext -} - -/** - * Chain a promise to the current promise - * - * @param {Promise} the promise to chain - */ -Promise.prototype._chainPromise = function (promise) { - var i - if (this._hasContext) promise._useContext(this._nextContext) - - if (this._child) { - this._child._chainPromise(promise) - } else if (this._hasData) { - promise._withInput(this._data) - } else if (this._error) { - promise._withError(this._error) - } else if (!this._promises) { - this._promises = [promise] - } else { - this._promises.push(promise) - } -} - -/** - * Utility function used for creating a node-style resolver - * for deferreds - * - * @param {Promise} deferred a promise that looks like a deferred - * @param {Error} err an optional error - * @param {Object} data optional data - */ -function resolver(deferred, err, data) { - if (err) deferred.reject(err) - else deferred.resolve(data) -} - -/** - * Creates a node-style resolver for a deferred by wrapping - * resolver() - * - * @return {function(Error, Object)} node-style callback - */ -Promise.prototype.makeNodeResolver = function () { - return resolver.bind(null, this) -} - -/** - * Static function which creates and resolves a promise immediately - * - * @param {Object} data data to resolve the promise with - * @return {Promise} - */ -function resolve(data) { - var promise = new Promise() - promise.resolve(data) - return promise -} - -/** - * Static function which creates and rejects a promise immediately - * - * @param {Error} e error to reject the promise with - * @return {Promise} - */ -function reject(e) { - var promise = new Promise() - promise.reject(e) - return promise -} - -/** - * Replace an element in an array with a new value. Used by .all() to - * call from .then() - * - * @param {Array.} arr - * @param {number} idx - * @param {Object} val - * @return {Object} the val that's being injected into the array - */ -function replaceEl(arr, idx, val) { - arr[idx] = val - return val -} - -/** - * Takes in an array of promises or literals and returns a promise which returns - * an array of values when all have resolved. If any fail, the promise fails. - * - * @param {Array.} promises - * @return {Promise.>} - */ -function all(promises) { - if (arguments.length != 1 || !Array.isArray(promises)) { - promises = Array.prototype.slice.call(arguments, 0) - } - if (!promises.length) return resolve([]) - - var outputs = [] - var counter = 0 - var finished = false - var promise = new Promise() - var counter = promises.length - - for (var i = 0; i < promises.length; i += 1) { - if (!promises[i] || !promises[i]._isPromise) { - outputs[i] = promises[i] - counter -= 1 - } else { - promises[i].then(replaceEl.bind(null, outputs, i)) - .then(function decrementAllCounter() { - counter-- - if (!finished && counter === 0) { - finished = true - promise.resolve(outputs) - } - }, function onAllError(e) { - if (!finished) { - finished = true - promise.reject(e) - } - }) - } - } - - if (counter === 0 && !finished) { - finished = true - promise.resolve(outputs) - } - - return promise -} - -/** - * Create a new Promise which looks like a deferred - * - * @return {Promise} - */ -function defer() { - return new Promise() -} - -/** - * Return a promise which will wait a specified number of ms to resolve - * - * @param {number} delayMs - * @param {Object} returnVal - * @return {Promise.} returns returnVal - */ -function delay(delayMs, returnVal) { - var defer = new Promise() - setTimeout(function onDelay() { - defer.resolve(returnVal) - }, delayMs) - return defer -} - -/** - * Return a promise which will evaluate the function fn with the provided args - * - * @param {function} fn - * @param {Object} var_args a variable number of arguments - * @return {Promise} - */ -function fcall(fn, var_args) { - var defer = new Promise() - defer.resolve(fn.apply(null, Array.prototype.slice.call(arguments, 1))) - return defer -} - -/** - * Binds a function to a scope with an optional number of curried arguments. Attaches - * a node style callback as the last argument and returns a promise - * - * @param {function} fn - * @param {Object} scope - * @param {Object} var_args a variable number of arguments - * @return {Promise} - */ -function bindPromise(fn, scope, var_args) { - var rootArgs = Array.prototype.slice.call(arguments, 2) - return function onBoundPromise(var_args) { - var defer = new Promise() - fn.apply(scope, rootArgs.concat(Array.prototype.slice.call(arguments, 0), defer.makeNodeResolver())) - return defer - } -} - -module.exports = { - all: all - , bindPromise: bindPromise - , defer: defer - , delay: delay - , fcall: fcall - , resolve: resolve - , reject: reject -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/package.json deleted file mode 100644 index 6842dcd..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "kew", - "description": "a lightweight promise library for node", - "version": "0.1.7", - "homepage": "https://github.com/Obvious/kew", - "authors": [ - "Jeremy Stanley (https://github.com/azulus)" - ], - "contributors": [], - "keywords": [ - "kew", - "promises" - ], - "main": "./kew.js", - "repository": { - "type": "git", - "url": "https://github.com/Obvious/kew.git" - }, - "dependencies": {}, - "devDependencies": { - "nodeunit": "0.7.4" - }, - "scripts": { - "test": "./node_modules/nodeunit/bin/nodeunit test" - }, - "readme": "kew: a lightweight (and super fast) promise/deferred framework for node.js\n==================================\n\n**kew** is a lightweight promise framework with an aim of providing a base set of functionality similar to that provided by the [Q library](https://github.com/kriskowal/q \"Q\").\n\nA few answers (for a few questions)\n-------\n\n*Why'd we write it?*\n\nDuring our initial usage of **Q** we found that it was consuming 80% of the cpu under load (primarily in chained database callbacks). We spent some time looking at patching **Q** and ultimately found that creating our own lightweight library for server-usage would suit our needs better than figuring out how to make a large cross-platform library more performant on one very specific platform.\n\n*So this does everything Q does?*\n\nNope! **Q** is still an awesome library and does *way* more than **kew**. We support a tiny subset of the **Q** functionality (the subset that we happen to use in our actual use cases).\n\nWhat are Promises?\n-------\n\nAt its core, a *Promise* is a promise to return a value at some point in the future. A *Promise* represents a value that will be (or may return an error if something goes wrong). *Promises* heavily reduce the complexity of asynchronous coding in node.js-like environments. Example:\n\n```javascript\n// assuming the getUrlContent() function exists and retrieves the content of a url\nvar htmlPromise = getUrlContent(myUrl)\n\n// we can then filter that through an http parser (our imaginary parseHtml() function) asynchronously (or maybe synchronously, who knows)\nvar tagsPromise = htmlPromise.then(parseHtml)\n\n// and then filter it through another function (getLinks()) which retrieves only the link tags\nvar linksPromise = tagsPromise.then(getLinks)\n\n// and then parses the actual urls from the links (using parseUrlsFromLinks())\nvar urlsPromise = linksPromise.then(linksPromise)\n\n// finally, we have a promise that should only provide us with the urls and will run once all the previous steps have ran\nurlsPromise.then(function (urls) {\n // do something with the urls\n})\n```\n\nHow do I use **kew**?\n-------\n\nAs a precursor to all the examples, the following code must be at the top of your page:\n\n```javascript\nvar Q = require('kew')\n```\n\n### Convert a literal into a promise\n\nThe easiest way to start a promise chain is by creating a new promise with a specified literal using Q.resolve() or Q.reject()\n\n```javascript\n// create a promise which passes a value to the next then() call\nvar successPromise = Q.resolve(val)\n\n// create a promise which throws an error to be caught by the next fail() call\nvar failPromise = Q.reject(err)\n```\n\nIn addition, you can create deferreds which can be used if you need to create a promise but resolve it later:\n\n```javascript\n// create the deferreds\nvar successDefer = Q.defer()\nvar failDefer = Q.defer()\n\n// resolve or reject the defers in 1 second\nsetTimeout(function () {\n successDefer.resolve(\"ok\")\n failDefer.reject(new Error(\"this failed\"))\n}, 1000)\n\n// extract promises from the deferreds\nvar successPromise = successDefer.promise\nvar failPromise = failDefer.promise\n```\n\nIf you have a node-style callback (taking an **Error** as the first parameter and a response as the second), you can call the magic `makeNodeResolver()` function on a defer to allow the defer to handle the callbacks:\n\n```javascript\n// create the deferred\nvar defer = Q.defer()\n\n// some node-style function\ngetObjectFromDatabase(myObjectId, defer.makeNodeResolver())\n\n// grab the output\ndefer.promise\n .then(function (obj) {\n // successfully retrieved the object\n })\n .fail(function (e) {\n // failed retrieving the object\n })\n```\n\n### Handling successful results with `.then()`\n\nWhen a promise is resolved, you may call the `.then()` method to retrieve the value of the promise:\n\n```javascript\npromise.then(function (result) {\n // do something with the result here\n})\n```\n\n`.then()` will in turn return a promise which will return the results of whatever it returns (asynchronously or not), allowing it to be chained indefinitely:\n\n```javascript\nQ.resolve('a')\n .then(function (result) {\n return result + 'b'\n })\n .then(function (result) {\n return result + 'c'\n })\n .then(function (result) {\n // result should be 'abc'\n })\n```\n\nIn addition, `.then()` calls may return promises themselves, allowing for complex nesting of asynchronous calls in a flat manner:\n\n```javascript\nvar htmlPromise = getUrlContent(myUrl)\n\nvar tagsPromise = htmlPromise.then(function (html) {\n if (!validHtml(html)) throw new Error(\"Invalid HTML\")\n\n // pretend that parseHtml() returns a promise and is asynchronous\n return parseHtml(html)\n})\n```\n\n### Handling errors with `.fail()`\n\nIf a promise is rejected for some reason, you may handle the failure case with the `.fail()` function:\n\n```javascript\ngetObjectPromise\n .fail(function (e) {\n console.error(\"Failed to retrieve object\", e)\n })\n```\n\nLike `.then()`, `.fail()` also returns a promise. If the `.fail()` call does not throw an error, it will pass the return value of the `.fail()` handler to any `.then()` calls chained to it:\n\n```javascript\ngetObjectPromise\n .fail(function (e) {\n return retryGetObject(objId)\n })\n .then(function (obj) {\n // yay, we received an object\n })\n .fail(function (e) {\n // the retry failed :(\n console.error(\"Retrieving the object '\" + objId + \"' failed\")\n })\n})\n```\n\nIf you've reached the end of your promise chain, you may call `.end()` which signifies that the promise chain is ended and any errors should be thrown in whatever scope the code is currently in:\n\n```javascript\ngetObjectPromise\n // this will throw an error to the uncaught exception handler if the getObjectPromise call is asynchronous\n .end()\n```\n\n### `.fin()` when things are finished\n\nYou may attach a handler to a promise which will be ran regardless of whether the promise was resolved or rejected (but will only run upon completion). This is useful in the cases where you may have set up resources to run a request and wish to tear them down afterwards. `.fin()` will return the promise it is called upon:\n\n```javascript\nvar connection = db.connect()\n\nvar itemPromise = db.getItem(itemId)\n .fin(function () {\n db.close()\n })\n```\n\nOther utility methods\n-------\n\nThere's only one utility method as of now:\n\n### `.all()` for many things\n\nIf you're waiting for multiple promises to return, you may pass them (mixed in with literals if you desire) into `.all()` which will create a promise that resolves successfully with an array of the results of the promises:\n\n```javascript\nvar promises = []\npromises.push(getUrlContent(url1))\npromises.push(getUrlContent(url2))\npromises.push(getUrlContent(url3))\n\nQ.all(promises)\n .then(function (content) {\n // content[0] === content for url 1\n // content[1] === content for url 2\n // content[2] === content for url 3\n })\n```\n\nIf any of the promises fail, Q.all will fail as well (so make sure to guard your promises with a `.fail()` call beforehand if you don't care whether they succeed or not):\n\n```javascript\nvar promises = []\npromises.push(getUrlContent(url1))\npromises.push(getUrlContent(url2))\npromises.push(getUrlContent(url3))\n\nQ.all(promises)\n .fail(function (e) {\n console.log(\"Failed retrieving a url\", e)\n })\n```\n\nContributing\n------------\n\nQuestions, comments, bug reports, and pull requests are all welcome.\nSubmit them at [the project on GitHub](https://github.com/Obvious/kew/).\n\nBug reports that include steps-to-reproduce (including code) are the\nbest. Even better, make them in the form of pull requests that update\nthe test suite. Thanks!\n\n\nAuthor\n------\n\n[Jeremy Stanley](https://github.com/azulus)\nsupported by\n[The Obvious Corporation](http://obvious.com/).\n\n\nLicense\n-------\n\nCopyright 2013 [The Obvious Corporation](http://obvious.com/).\n\nLicensed under the Apache License, Version 2.0.\nSee the top-level file `LICENSE.TXT` and\n(http://www.apache.org/licenses/LICENSE-2.0).\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/Obvious/kew/issues" - }, - "_id": "kew@0.1.7", - "_from": "kew@~0.1.7" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/chain.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/chain.js deleted file mode 100644 index 985b597..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/chain.js +++ /dev/null @@ -1,337 +0,0 @@ -var Q = require('../kew') - -// test that fin() works with a synchronous resolve -exports.testSynchronousThenAndFin = function (test) { - var vals = ['a', 'b'] - var counter = 0 - - var promise1 = Q.resolve(vals[0]) - var promise2 = promise1.fin(function () { - counter++ - }) - var promise3 = promise2.then(function (data) { - if (data === vals[0]) return vals[1] - }) - var promise4 = promise3.fin(function () { - counter++ - }) - - Q.all([promise2, promise4]) - .then(function (data) { - test.equal(counter, 2, "fin() should have been called twice") - test.equal(data[0], vals[0], "first fin() should return the first val") - test.equal(data[1], vals[1], "second fin() should return the second val") - test.done() - }) -} - -// test that fin() works with a synchronous reject -exports.testSynchronousFailAndFin = function (test) { - var errs = [] - errs.push(new Error('nope 1')) - errs.push(new Error('nope 2')) - var counter = 0 - - var promise1 = Q.reject(errs[0]) - var promise2 = promise1.fin(function () { - counter++ - }) - var promise3 = promise2.fail(function (e) { - if (e === errs[0]) throw errs[1] - }) - var promise4 = promise3.fin(function () { - counter++ - }) - - Q.all([ - promise2.fail(function (e) { - return e === errs[0] - }), - promise4.fail(function (e) { - return e === errs[1] - }) - ]) - .then(function (data) { - test.equal(counter, 2, "fin() should have been called twice") - test.equal(data[0] && data[1], true, "all promises should return true") - test.done() - }) -} - -// test that fin() works with an asynchrnous resolve -exports.testAsynchronousThenAndFin = function (test) { - var vals = ['a', 'b'] - var counter = 0 - - var defer = Q.defer() - setTimeout(function () { - defer.resolve(vals[0]) - }) - var promise1 = defer.promise - var promise2 = promise1.fin(function () { - counter++ - }) - var promise3 = promise2.then(function (data) { - if (data !== vals[0]) return - - var defer = Q.defer() - setTimeout(function () { - defer.resolve(vals[1]) - }) - return defer.promise - }) - var promise4 = promise3.fin(function () { - counter++ - }) - - Q.all([promise2, promise4]) - .then(function (data) { - test.equal(counter, 2, "fin() should have been called twice") - test.equal(data[0], vals[0], "first fin() should return the first val") - test.equal(data[1], vals[1], "second fin() should return the second val") - test.done() - }) -} - -// test that fin() works with an asynchronous reject -exports.testAsynchronousFailAndFin = function (test) { - var errs = [] - errs.push(new Error('nope 1')) - errs.push(new Error('nope 2')) - var counter = 0 - - var defer = Q.defer() - setTimeout(function () { - defer.reject(errs[0]) - }, 10) - var promise1 = defer.promise - var promise2 = promise1.fin(function () { - counter++ - }) - var promise3 = promise2.fail(function (e) { - if (e !== errs[0]) return - - var defer = Q.defer() - setTimeout(function () { - defer.reject(errs[1]) - }, 10) - - return defer.promise - }) - var promise4 = promise3.fin(function () { - counter++ - }) - - Q.all([ - promise2.fail(function (e) { - return e === errs[0] - }), - promise4.fail(function (e) { - return e === errs[1] - }) - ]) - .then(function (data) { - test.equal(counter, 2, "fin() should have been called twice") - test.equal(data[0] && data[1], true, "all promises should return true") - test.done() - }) -} - -// test several thens chaining -exports.testChainedThens = function (test) { - var promise1 = Q.resolve('a') - var promise2 = promise1.then(function(data) { - return data + 'b' - }) - var promise3 = promise2.then(function (data) { - return data + 'c' - }) - // testing the same promise again to make sure they can run side by side - var promise4 = promise2.then(function (data) { - return data + 'c' - }) - - Q.all([promise1, promise2, promise3, promise4]) - .then(function (data) { - test.equal(data[0], 'a') - test.equal(data[1], 'ab') - test.equal(data[2], 'abc') - test.equal(data[3], 'abc') - test.done() - }) -} - -// test several fails chaining -exports.testChainedFails = function (test) { - var errs = [] - errs.push(new Error("first err")) - errs.push(new Error("second err")) - errs.push(new Error("third err")) - - var promise1 = Q.reject(errs[0]) - var promise2 = promise1.fail(function (e) { - if (e === errs[0]) throw errs[1] - }) - var promise3 = promise2.fail(function (e) { - if (e === errs[1]) throw errs[2] - }) - var promise4 = promise2.fail(function (e) { - if (e === errs[1]) throw errs[2] - }) - - Q.all([ - promise1.fail(function (e) { - return e === errs[0] - }), - promise2.fail(function (e) { - return e === errs[1] - }), - promise3.fail(function (e) { - return e === errs[2] - }), - promise4.fail(function (e) { - return e === errs[2] - }) - ]) - .then(function (data) { - test.equal(data[0] && data[1] && data[2] && data[3], true) - test.done() - }) -} - -// test that we can call end without callbacks and not fail -exports.testEndNoCallbacks = function (test) { - Q.resolve(true).end() - test.ok("Ended successfully") - test.done() -} - -// test that we can call end with callbacks and fail -exports.testEndNoCallbacksThrows = function (test) { - var testError = new Error('Testing') - try { - Q.reject(testError).end() - test.fail("Should throw an error") - } catch (e) { - test.equal(e, testError, "Should throw the correct error") - } - test.done() -} - -// test chaining when a promise returns a promise -exports.testChainedPromises = function (test) { - var err = new Error('nope') - var val = 'ok' - - var shouldFail = Q.reject(err) - var shouldSucceed = Q.resolve(val) - - Q.resolve("start") - .then(function () { - return shouldFail - }) - .fail(function (e) { - if (e === err) return shouldSucceed - else throw e - }) - .then(function (data) { - test.equal(data, val, "val should be returned") - test.done() - }) -} - -// test .end() is called with no parent scope (causing an uncaught exception) -exports.testChainedEndUncaught = function (test) { - var errs = [] - errs.push(new Error('nope 1')) - errs.push(new Error('nope 2')) - errs.push(new Error('nope 3')) - - process.on('uncaughtException', function (e) { - test.equal(e, errs.shift(), "Error should be uncaught") - if (errs.length === 0) test.done() - }) - - var defer = Q.defer() - defer.promise.end() - - var promise1 = defer.promise - var promise2 = promise1.fail(function (e) { - if (e === errs[0]) throw errs[1] - }) - var promise3 = promise2.fail(function (e) { - if (e === errs[1]) throw errs[2] - }) - - promise1.end() - promise2.end() - promise3.end() - - setTimeout(function () { - defer.reject(errs[0]) - }, 10) -} - -// test .end() is called with a parent scope and is caught -exports.testChainedCaught = function (test) { - var err = new Error('nope') - - try { - Q.reject(err).end() - } catch (e) { - test.equal(e, err, "Error should be caught") - test.done() - } -} - -// test a mix of fails and thens -exports.testChainedMixed = function (test) { - var errs = [] - errs.push(new Error('nope 1')) - errs.push(new Error('nope 2')) - errs.push(new Error('nope 3')) - - var vals = [3, 2, 1] - - var promise1 = Q.reject(errs[0]) - var promise2 = promise1.fail(function (e) { - if (e === errs[0]) return vals[0] - }) - var promise3 = promise2.then(function (data) { - if (data === vals[0]) throw errs[1] - }) - var promise4 = promise3.fail(function (e) { - if (e === errs[1]) return vals[1] - }) - var promise5 = promise4.then(function (data) { - if (data === vals[1]) throw errs[2] - }) - var promise6 = promise5.fail(function (e) { - if (e === errs[2]) return vals[2] - }) - - Q.all([ - promise1.fail(function (e) { - return e === errs[0] - }), - promise2.then(function (data) { - return data === vals[0] - }), - promise3.fail(function (e) { - return e === errs[1] - }), - promise4.then(function (data) { - return data === vals[1] - }), - promise5.fail(function (e) { - return e === errs[2] - }), - promise6.then(function (data) { - return data === vals[2] - }) - ]) - .then(function (data) { - test.equal(data[0] && data[1] && data[2] && data[3] && data[4] && data[5], true, "All values should return true") - test.done() - }) -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/context.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/context.js deleted file mode 100644 index b416681..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/context.js +++ /dev/null @@ -1,89 +0,0 @@ -var Q = require('../kew') - -// test that contexts are propogated based on position -exports.testContextWithDelay = function (test) { - - Q.resolve(true) - .setContext({id: 1}) - .then(function (val, context) { - test.equal(context.id, 1, 'Should return the first context') - return Q.delay(500) - }) - .setContext({id: 2}) - .then(function (val, context) { - test.equal(context.id, 2, 'Should return the second context') - return Q.delay(500) - }) - .clearContext() - .then(function (val, context) { - test.equal(typeof context, 'undefined', 'Should return an undefined context') - return Q.delay(500) - }) - .setContext({id: 3}) - .fin(test.done) -} - -// test adding and removing contexts -exports.testGeneralContextFlow = function (test) { - Q.resolve(true) - // test no context exists - .then(function (val, context) { - test.equal(typeof context, 'undefined', 'Context should be undefined') - throw new Error() - }) - .fail(function (e, context) { - test.equal(typeof context, 'undefined', 'Context should be undefined') - }) - - // set the context and mutate it - .setContext({counter: 1}) - .then(function (val, context) { - test.equal(context.counter, 1, 'Counter should be 1') - context.counter++ - }) - .then(function (val, context) { - test.equal(context.counter, 2, 'Counter should be 2') - context.counter++ - throw new Error() - }) - .fail(function (e, context) { - test.equal(context.counter, 3, 'Counter should be 3') - }) - - // return a context - .then(function (val, context) { - return Q.resolve(false) - .setContext({counter: 0}) - }) - .then(function (val, context) { - test.equal(context.counter, 0, 'Counter should be 0') - throw new Error() - }) - .fail(function (e, context) { - test.equal(context.counter, 0, 'Counter should be 0') - }) - - // returning a promise with a cleared context won't clear the parent context - .then(function (val, context) { - return Q.resolve(false).clearContext() - }) - .then(function (val, context) { - test.equal(context.counter, 0, 'Counter should be 0') - throw new Error() - }) - .fail(function (e, context) { - test.equal(context.counter, 0, 'Counter should be 0') - }) - - // test that clearing the context works - .clearContext() - .then(function (val, context) { - test.equal(typeof context, 'undefined', 'Context should be undefined') - throw new Error() - }) - .fail(function (e, context) { - test.equal(typeof context, 'undefined', 'Context should be undefined') - }) - - .fin(test.done) -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/defer.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/defer.js deleted file mode 100644 index 3684f79..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/defer.js +++ /dev/null @@ -1,120 +0,0 @@ -var Q = require('../kew') - -// create a deferred which returns a promise -exports.testDeferredResolve = function (test) { - var val = "ok" - var defer = Q.defer() - - defer.promise - .then(function (data) { - test.equal(data, val, "Promise successfully returned") - test.done() - }) - - setTimeout(function () { - defer.resolve(val) - }, 50) -} - -// make sure a deferred can only resolve once -exports.testDeferredResolveOnce = function (test) { - var defer = Q.defer() - - try { - defer.resolve(true) - defer.resolve(true) - test.fail("Unable to resolve the same deferred twice") - } catch (e) { - } - - test.done() -} - -// create a deferred which returns a failed promise -exports.testDeferredReject = function (test) { - var err = new Error("hello") - var defer = Q.defer() - - defer.promise - .fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.done() - }) - - setTimeout(function () { - defer.reject(err) - }, 50) -} - -// make sure a deferred can only reject once -exports.testDeferredRejectOnce = function (test) { - var defer = Q.defer() - - try { - defer.reject(new Error("nope 1")) - defer.reject(new Error("nope 2")) - test.fail("Unable to reject the same deferred twice") - } catch (e) { - } - - test.done() -} - -// make sure a deferred can only reject once -exports.testDeferAndRejectFail = function (test) { - var defer - - try { - defer = Q.defer() - defer.reject(new Error("nope 1")) - defer.resolve(true) - test.fail("Unable to reject and resolve the same deferred") - } catch (e) { - test.ok(true, "Unable to reject and resolve same deferred") - } - - try { - defer = Q.defer() - defer.resolve(true) - defer.reject(new Error("nope 1")) - test.fail("Unable to reject and resolve the same deferred") - } catch (e) { - test.ok(true, "Unable to reject and resolve same deferred") - } - - test.done() -} - -// create a deferred which resolves with a node-standard callback -exports.testDeferredResolverSuccess = function (test) { - var val = "ok" - var defer = Q.defer() - var callback = defer.makeNodeResolver() - - defer.promise - .then(function (data) { - test.equal(data, val, "Promise successfully returned") - test.done() - }) - - setTimeout(function () { - callback(null, val) - }, 50) -} - -// create a deferred which rejects with a node-standard callback -exports.testDeferredResolverSuccess = function (test) { - var err = new Error("hello") - var defer = Q.defer() - var callback = defer.makeNodeResolver() - - defer.promise - .fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.done() - }) - - setTimeout(function () { - callback(err) - }, 50) -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/static.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/static.js deleted file mode 100644 index e4b4b0d..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/kew/test/static.js +++ /dev/null @@ -1,187 +0,0 @@ -var Q = require('../kew') - -// create a promise from a literal -exports.testQResolve = function (test) { - var val = "ok" - - Q.resolve(val) - .then(function (data) { - test.equal(data, val, "Promise successfully returned") - test.done() - }) -} - -// create a failed promise from an error literal -exports.testQReject = function (test) { - var err = new Error("hello") - - Q.reject(err) - .fail(function (e) { - test.equal(e, err, "Promise successfully failed") - test.done() - }) -} - -// test Q.all with an empty array -exports.testQEmptySuccess = function (test) { - var promises = [] - - // make sure all results come back - Q.all(promises) - .then(function (data) { - test.equal(data.length, 0, "No records should be returned") - test.done() - }) -} - -// test Q.all with only literals -exports.testQAllLiteralsSuccess = function (test) { - var vals = [3, 2, 1] - var promises = [] - - promises.push(vals[0]) - promises.push(vals[1]) - promises.push(vals[2]) - - // make sure all results come back - Q.all(promises) - .then(function (data) { - test.equal(data[0], vals[0], "First val should be returned") - test.equal(data[1], vals[1], "Second val should be returned") - test.equal(data[2], vals[2], "Third val should be returned") - test.done() - }) -} - -// test Q.all with only promises -exports.testQAllPromisesSuccess = function (test) { - var vals = [3, 2, 1] - var promises = [] - - promises.push(Q.resolve(vals[0])) - promises.push(Q.resolve(vals[1])) - promises.push(Q.resolve(vals[2])) - - // make sure all results come back - Q.all(promises) - .then(function (data) { - test.equal(data[0], vals[0], "First val should be returned") - test.equal(data[1], vals[1], "Second val should be returned") - test.equal(data[2], vals[2], "Third val should be returned") - test.done() - }) -} - -// create a promise which waits for other promises -exports.testQAllAssortedSuccess = function (test) { - var vals = [3, 2, 1] - var promises = [] - - // a promise that returns the value immediately - promises.push(Q.resolve(vals[0])) - - // the value itself - promises.push(vals[1]) - - // a promise which returns in 10ms - var defer = Q.defer() - promises.push(defer.promise) - setTimeout(function () { - defer.resolve(vals[2]) - }, 10) - - // make sure all results come back - Q.all(promises) - .then(function (data) { - test.equal(data[0], vals[0], "First val should be returned") - test.equal(data[1], vals[1], "Second val should be returned") - test.equal(data[2], vals[2], "Third val should be returned") - test.done() - }) -} - -// test Q.all with a failing promise -exports.testQAllError = function (test) { - var vals = [3, 2, 1] - var err = new Error("hello") - var promises = [] - - promises.push(vals[0]) - promises.push(vals[1]) - - var defer = Q.defer() - promises.push(defer.promise) - defer.reject(err) - - // make sure all results come back - Q.all(promises) - .fail(function (e) { - test.equal(e, err) - test.done() - }) -} - -// test all var_args -exports.testAllVarArgs = function (test) { - var promises = ['a', 'b'] - - Q.all.apply(Q, promises) - .then(function (results) { - test.equal(promises[0], results[0], "First element should be returned") - test.equal(promises[1], results[1], "Second element should be returned") - test.done() - }) -} - -// test all array -exports.testAllArray = function (test) { - var promises = ['a', 'b'] - - Q.all(promises) - .then(function (results) { - test.equal(promises[0], results[0], "First element should be returned") - test.equal(promises[1], results[1], "Second element should be returned") - test.done() - }) -} - -// test delay -exports.testDelay = function (test) { - var val = "Hello, there" - var startTime = Date.now() - - Q.resolve(val) - .then(Q.delay.bind(Q, 1000)) - .then(function (returnVal) { - test.equal(returnVal, val, "Val should be passed through") - test.equal(Date.now() - startTime >= 1000, true, "Should have waited a second") - test.done() - }) -} - -// test fcall -exports.testFcall = function (test) { - var adder = function (a, b) { - return a + b - } - - Q.fcall(adder, 2, 3) - .then(function (val) { - test.equal(val, 5, "Val should be 2 + 3") - test.done() - }) -} - -// test binding a callback function with a promise -exports.testBindPromise = function (test) { - var adder = function (a, b, callback) { - callback(null, a + b) - } - - var boundAdder = Q.bindPromise(adder, null, 2) - boundAdder(3) - .then(function (val) { - test.equal(val, 5, "Val should be 2 + 3") - test.done() - }) -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/.travis.yml b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 84fd7ca..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/examples/pow.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/index.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/package.json deleted file mode 100644 index 50ba940..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.5", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.4.0" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "_id": "mkdirp@0.3.5", - "_from": "mkdirp@0.3.5" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/readme.markdown b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 83b0216..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/chmod.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/clobber.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/mkdirp.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/perm.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/perm_sync.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/race.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/rel.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/return.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/return_sync.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/root.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/sync.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cad..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/umask.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/umask_sync.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 35bd5cb..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/.npmignore deleted file mode 100644 index 9ecd205..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -.*.sw[op] -.DS_Store -test/fixtures/out diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/.travis.yml b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/.travis.yml deleted file mode 100644 index f686c49..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js - -node_js: - - 0.4 - - 0.6 - - 0.7 - - 0.8 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/LICENSE.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/LICENSE.md deleted file mode 100644 index e2b9b41..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# MIT License - -###Copyright (C) 2011 by Charlie McConnell - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/README.md deleted file mode 100644 index 79ad086..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# ncp - Asynchronous recursive file & directory copying - -[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp) - -Think `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI tool and programmatically. - -## Command Line usage - -Usage is simple: `ncp [source] [dest] [--limit=concurrency limit] -[--filter=filter] --stopOnErr` - -The 'filter' is a Regular Expression - matched files will be copied. - -The 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time. - -'stopOnErr' is a boolean flag that will tell `ncp` to stop immediately if any -errors arise, rather than attempting to continue while logging errors. - -If there are no errors, `ncp` will output `done.` when complete. If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue. - -## Programmatic usage - -Programmatic usage of `ncp` is just as simple. The only argument to the completion callback is a possible error. - -```javascript -var ncp = require('ncp').ncp; - -ncp.limit = 16; - -ncp(source, destination, function (err) { - if (err) { - return console.error(err); - } - console.log('done!'); -}); -``` - -You can also call ncp like `ncp(source, destination, options, callback)`. -`options` should be a dictionary. Currently, such options are available: - - * `options.filter` - a `RegExp` instance, against which each file name is - tested to determine whether to copy it or not, or a function taking single - parameter: copied file name, returning `true` or `false`, determining - whether to copy file or not. - - * `options.transform` - a function: `function (read, write) { read.pipe(write) }` - used to apply streaming transforms while copying. - - * `options.clobber` - boolean=true. if set to false, `ncp` will not overwrite - destination files that already exist. - -Please open an issue if any bugs arise. As always, I accept (working) pull requests, and refunds are available at `/dev/null`. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/bin/ncp b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/bin/ncp deleted file mode 100755 index 388eaba..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/bin/ncp +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env node - - - - -var ncp = require('../lib/ncp'), - args = process.argv.slice(2), - source, dest; - -if (args.length < 2) { - console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]'); - process.exit(1); -} - -// parse arguments the hard way -function startsWith(str, prefix) { - return str.substr(0, prefix.length) == prefix; -} - -var options = {}; -args.forEach(function (arg) { - if (startsWith(arg, "--limit=")) { - options.limit = parseInt(arg.split('=', 2)[1], 10); - } - if (startsWith(arg, "--filter=")) { - options.filter = new RegExp(arg.split('=', 2)[1]); - } - if (startsWith(arg, "--stoponerr")) { - options.stopOnErr = true; - } -}); - -ncp.ncp(args[0], args[1], options, function (err) { - if (Array.isArray(err)) { - console.error('There were errors during the copy.'); - err.forEach(function (err) { - console.error(err.stack || err.message); - }); - process.exit(1); - } - else if (err) { - console.error('An error has occurred.'); - console.error(err.stack || err.message); - process.exit(1); - } -}); - - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/lib/ncp.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/lib/ncp.js deleted file mode 100644 index d871e00..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/lib/ncp.js +++ /dev/null @@ -1,222 +0,0 @@ -var fs = require('fs'), - path = require('path'); - -module.exports = ncp -ncp.ncp = ncp - -function ncp (source, dest, options, callback) { - if (!callback) { - callback = options; - options = {}; - } - - var basePath = process.cwd(), - currentPath = path.resolve(basePath, source), - targetPath = path.resolve(basePath, dest), - filter = options.filter, - transform = options.transform, - clobber = options.clobber !== false, - errs = null, - started = 0, - finished = 0, - running = 0, - limit = options.limit || ncp.limit || 16; - - limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit; - - startCopy(currentPath); - - function startCopy(source) { - started++; - if (filter) { - if (filter instanceof RegExp) { - if (!filter.test(source)) { - return cb(true); - } - } - else if (typeof filter === 'function') { - if (!filter(source)) { - return cb(true); - } - } - } - return getStats(source); - } - - function defer(fn) { - if (typeof(setImmediate) === 'function') - return setImmediate(fn); - return process.nextTick(fn); - } - - function getStats(source) { - if (running >= limit) { - return defer(function () { - getStats(source); - }); - } - running++; - fs.lstat(source, function (err, stats) { - var item = {}; - if (err) { - return onError(err); - } - - // We need to get the mode from the stats object and preserve it. - item.name = source; - item.mode = stats.mode; - - if (stats.isDirectory()) { - return onDir(item); - } - else if (stats.isFile()) { - return onFile(item); - } - else if (stats.isSymbolicLink()) { - // Symlinks don't really need to know about the mode. - return onLink(source); - } - }); - } - - function onFile(file) { - var target = file.name.replace(currentPath, targetPath); - isWritable(target, function (writable) { - if (writable) { - return copyFile(file, target); - } - if(clobber) - rmFile(target, function () { - copyFile(file, target); - }); - }); - } - - function copyFile(file, target) { - var readStream = fs.createReadStream(file.name), - writeStream = fs.createWriteStream(target, { mode: file.mode }); - if(transform) { - transform(readStream, writeStream,file); - } else { - readStream.pipe(writeStream); - } - readStream.once('end', cb); - } - - function rmFile(file, done) { - fs.unlink(file, function (err) { - if (err) { - return onError(err); - } - return done(); - }); - } - - function onDir(dir) { - var target = dir.name.replace(currentPath, targetPath); - isWritable(target, function (writable) { - if (writable) { - return mkDir(dir, target); - } - copyDir(dir.name); - }); - } - - function mkDir(dir, target) { - fs.mkdir(target, dir.mode, function (err) { - if (err) { - return onError(err); - } - copyDir(dir.name); - }); - } - - function copyDir(dir) { - fs.readdir(dir, function (err, items) { - if (err) { - return onError(err); - } - items.forEach(function (item) { - startCopy(dir + '/' + item); - }); - return cb(); - }); - } - - function onLink(link) { - var target = link.replace(currentPath, targetPath); - fs.readlink(link, function (err, resolvedPath) { - if (err) { - return onError(err); - } - checkLink(resolvedPath, target); - }); - } - - function checkLink(resolvedPath, target) { - isWritable(target, function (writable) { - if (writable) { - return makeLink(resolvedPath, target); - } - fs.readlink(target, function (err, targetDest) { - if (err) { - return onError(err); - } - if (targetDest === resolvedPath) { - return cb(); - } - return rmFile(target, function () { - makeLink(resolvedPath, target); - }); - }); - }); - } - - function makeLink(linkPath, target) { - fs.symlink(linkPath, target, function (err) { - if (err) { - return onError(err); - } - return cb(); - }); - } - - function isWritable(path, done) { - fs.lstat(path, function (err, stats) { - if (err) { - if (err.code === 'ENOENT') return done(true); - return done(false); - } - return done(false); - }); - } - - function onError(err) { - if (options.stopOnError) { - return callback(err); - } - else if (!errs && options.errs) { - errs = fs.createWriteStream(options.errs); - } - else if (!errs) { - errs = []; - } - if (typeof errs.write === 'undefined') { - errs.push(err); - } - else { - errs.write(err.stack + '\n\n'); - } - return cb(); - } - - function cb(skipped) { - if (!skipped) running--; - finished++; - if ((started === finished) && (running === 0)) { - return errs ? callback(errs) : callback(null); - } - } -}; - - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/package.json deleted file mode 100644 index 4c2d958..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "ncp", - "version": "0.4.2", - "author": { - "name": "AvianFlu", - "email": "charlie@charlieistheman.com" - }, - "description": "Asynchronous recursive file copy utility.", - "bin": { - "ncp": "./bin/ncp" - }, - "devDependencies": { - "vows": "0.6.x", - "rimraf": "1.0.x", - "read-dir-files": "0.0.x" - }, - "main": "./lib/ncp.js", - "repository": { - "type": "git", - "url": "https://github.com/AvianFlu/ncp.git" - }, - "keywords": [ - "cli", - "copy" - ], - "license": "MIT", - "engine": { - "node": ">=0.4" - }, - "scripts": { - "test": "vows --isolate --spec" - }, - "readme": "# ncp - Asynchronous recursive file & directory copying\n\n[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp)\n\nThink `cp -r`, but pure node, and asynchronous. `ncp` can be used both as a CLI tool and programmatically.\n\n## Command Line usage\n\nUsage is simple: `ncp [source] [dest] [--limit=concurrency limit]\n[--filter=filter] --stopOnErr`\n\nThe 'filter' is a Regular Expression - matched files will be copied.\n\nThe 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time.\n\n'stopOnErr' is a boolean flag that will tell `ncp` to stop immediately if any\nerrors arise, rather than attempting to continue while logging errors.\n\nIf there are no errors, `ncp` will output `done.` when complete. If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue.\n\n## Programmatic usage\n\nProgrammatic usage of `ncp` is just as simple. The only argument to the completion callback is a possible error. \n\n```javascript\nvar ncp = require('ncp').ncp;\n\nncp.limit = 16;\n\nncp(source, destination, function (err) {\n if (err) {\n return console.error(err);\n }\n console.log('done!');\n});\n```\n\nYou can also call ncp like `ncp(source, destination, options, callback)`. \n`options` should be a dictionary. Currently, such options are available:\n\n * `options.filter` - a `RegExp` instance, against which each file name is\n tested to determine whether to copy it or not, or a function taking single\n parameter: copied file name, returning `true` or `false`, determining\n whether to copy file or not.\n\n * `options.transform` - a function: `function (read, write) { read.pipe(write) }`\n used to apply streaming transforms while copying.\n\n * `options.clobber` - boolean=true. if set to false, `ncp` will not overwrite \n destination files that already exist.\n\nPlease open an issue if any bugs arise. As always, I accept (working) pull requests, and refunds are available at `/dev/null`.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/AvianFlu/ncp/issues" - }, - "_id": "ncp@0.4.2", - "_from": "ncp@0.4.2" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/a b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/a deleted file mode 100644 index 802992c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/a +++ /dev/null @@ -1 +0,0 @@ -Hello world diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/b b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/b deleted file mode 100644 index 9f6bb18..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/b +++ /dev/null @@ -1 +0,0 @@ -Hello ncp diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/c b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/c deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/d b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/d deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/e b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/e deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/f b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/f deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/sub/a b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/sub/a deleted file mode 100644 index cf291b5..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/sub/a +++ /dev/null @@ -1 +0,0 @@ -Hello nodejitsu diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/sub/b b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/fixtures/src/sub/b deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/ncp-test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/ncp-test.js deleted file mode 100644 index 3c613f7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/ncp/test/ncp-test.js +++ /dev/null @@ -1,86 +0,0 @@ -var assert = require('assert'), - path = require('path'), - rimraf = require('rimraf'), - vows = require('vows'), - readDirFiles = require('read-dir-files'), - ncp = require('../').ncp; - -var fixtures = path.join(__dirname, 'fixtures'), - src = path.join(fixtures, 'src'), - out = path.join(fixtures, 'out'); - -vows.describe('ncp').addBatch({ - 'When copying a directory of files': { - topic: function () { - var cb = this.callback; - rimraf(out, function () { - ncp(src, out, cb); - }); - }, - 'files should be copied': { - topic: function () { - var cb = this.callback; - - readDirFiles(src, 'utf8', function (srcErr, srcFiles) { - readDirFiles(out, 'utf8', function (outErr, outFiles) { - cb(outErr, srcFiles, outFiles); - }); - }); - }, - 'and the destination should match the source': function (err, srcFiles, outFiles) { - assert.isNull(err); - assert.deepEqual(srcFiles, outFiles); - } - } - } -}).addBatch({ - 'When copying files using filter': { - topic: function() { - var cb = this.callback; - var filter = function(name) { - return name.substr(name.length - 1) != 'a' - } - rimraf(out, function () { - ncp(src, out, {filter: filter}, cb); - }); - }, - 'it should copy files': { - topic: function () { - var cb = this.callback; - - readDirFiles(src, 'utf8', function (srcErr, srcFiles) { - function filter(files) { - for (var fileName in files) { - var curFile = files[fileName]; - if (curFile instanceof Object) - return filter(curFile); - if (fileName.substr(fileName.length - 1) == 'a') - delete files[fileName]; - } - } - filter(srcFiles); - readDirFiles(out, 'utf8', function (outErr, outFiles) { - cb(outErr, srcFiles, outFiles); - }); - }); - }, - 'and destination files should match source files that pass filter': function (err, srcFiles, outFiles) { - assert.isNull(err); - assert.deepEqual(srcFiles, outFiles); - } - } - } -}).addBatch({ - 'When copying files using transform': { - 'it should pass file descriptors along to transform functions': function() { - ncp(src, out, { - transform: function(read,write,file) { - assert.notEqual(file.name, undefined); - assert.strictEqual(typeof file.mode,'number'); - read.pipe(write); - } - }, function(){}); - } - } -}).export(module); - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/.npmignore deleted file mode 100644 index baa471c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/test/fixtures/userconfig-with-gc diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/README.md deleted file mode 100644 index afc995d..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# npmconf - -The config thing npm uses - -If you are interested in interacting with the config settings that npm -uses, then use this module. - -However, if you are writing a new Node.js program, and want -configuration functionality similar to what npm has, but for your -own thing, then I'd recommend using [rc](https://github.com/dominictarr/rc), -which is probably what you want. - -If I were to do it all over again, that's what I'd do for npm. But, -alas, there are many systems depending on many of the particulars of -npm's configuration setup, so it's not worth the cost of changing. - -## USAGE - -```javascript -var npmconf = require('npmconf') - -// pass in the cli options that you read from the cli -// or whatever top-level configs you want npm to use for now. -npmconf.load({some:'configs'}, function (er, conf) { - // do stuff with conf - conf.get('some', 'cli') // 'configs' - conf.get('username') // 'joebobwhatevers' - conf.set('foo', 'bar', 'user') - conf.save('user', function (er) { - // foo = bar is now saved to ~/.npmrc or wherever - }) -}) -``` diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/config-defs.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/config-defs.js deleted file mode 100644 index bbada56..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/config-defs.js +++ /dev/null @@ -1,396 +0,0 @@ -// defaults, types, and shorthands. - - -var path = require("path") - , url = require("url") - , Stream = require("stream").Stream - , semver = require("semver") - , stableFamily = semver.parse(process.version) - , nopt = require("nopt") - , osenv = require("osenv") - -try { - var log = require("npmlog") -} catch (er) { - var util = require('util') - var log = { warn: function (m) { - console.warn(m + util.format.apply(util, [].slice.call(arguments, 1))) - } } -} - -exports.Octal = Octal -function Octal () {} -function validateOctal (data, k, val) { - // must be either an integer or an octal string. - if (typeof val === "number") { - data[k] = val - return true - } - - if (typeof val === "string") { - if (val.charAt(0) !== "0" || isNaN(val)) return false - data[k] = parseInt(val, 8).toString(8) - } -} - -function validateSemver (data, k, val) { - if (!semver.valid(val)) return false - data[k] = semver.valid(val) -} - -function validateStream (data, k, val) { - if (!(val instanceof Stream)) return false - data[k] = val -} - -nopt.typeDefs.semver = { type: semver, validate: validateSemver } -nopt.typeDefs.Octal = { type: Octal, validate: validateOctal } -nopt.typeDefs.Stream = { type: Stream, validate: validateStream } - -nopt.invalidHandler = function (k, val, type, data) { - log.warn("invalid config", k + "=" + JSON.stringify(val)) - - if (Array.isArray(type)) { - if (type.indexOf(url) !== -1) type = url - else if (type.indexOf(path) !== -1) type = path - } - - switch (type) { - case Octal: - log.warn("invalid config", "Must be octal number, starting with 0") - break - case url: - log.warn("invalid config", "Must be a full url with 'http://'") - break - case path: - log.warn("invalid config", "Must be a valid filesystem path") - break - case Number: - log.warn("invalid config", "Must be a numeric value") - break - case Stream: - log.warn("invalid config", "Must be an instance of the Stream class") - break - } -} - -if (!stableFamily || (+stableFamily[2] % 2)) stableFamily = null -else stableFamily = stableFamily[1] + "." + stableFamily[2] - -var defaults - -var temp = osenv.tmpdir() -var home = osenv.home() - -var uidOrPid = process.getuid ? process.getuid() : process.pid - -if (home) process.env.HOME = home -else home = path.resolve(temp, "npm-" + uidOrPid) - -var cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm" -var cacheRoot = process.platform === "win32" && process.env.APPDATA || home -var cache = path.resolve(cacheRoot, cacheExtra) - - -var globalPrefix -Object.defineProperty(exports, "defaults", {get: function () { - if (defaults) return defaults - - if (process.env.PREFIX) { - globalPrefix = process.env.PREFIX - } else if (process.platform === "win32") { - // c:\node\node.exe --> prefix=c:\node\ - globalPrefix = path.dirname(process.execPath) - } else { - // /usr/local/bin/node --> prefix=/usr/local - globalPrefix = path.dirname(path.dirname(process.execPath)) - - // destdir only is respected on Unix - if (process.env.DESTDIR) { - globalPrefix = path.join(process.env.DESTDIR, globalPrefix) - } - } - - return defaults = - { "always-auth" : false - , "bin-links" : true - , browser : null - - , ca : // the npm CA certificate. - [ "-----BEGIN CERTIFICATE-----\n"+ - "MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC\n"+ - "VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x\n"+ - "IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w\n"+ - "bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y\n"+ - "MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV\n"+ - "BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj\n"+ - "YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA\n"+ - "aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE\n"+ - "OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz\n"+ - "Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl\n"+ - "y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC\n"+ - "l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv\n"+ - "yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl\n"+ - "ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op\n"+ - "-----END CERTIFICATE-----\n", - - // "GlobalSign Root CA" - "-----BEGIN CERTIFICATE-----\n"+ - "MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx\n"+ - "GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds\n"+ - "b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV\n"+ - "BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD\n"+ - "VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa\n"+ - "DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc\n"+ - "THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb\n"+ - "Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP\n"+ - "c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX\n"+ - "gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV\n"+ - "HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF\n"+ - "AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj\n"+ - "Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG\n"+ - "j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH\n"+ - "hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC\n"+ - "X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n"+ - "-----END CERTIFICATE-----\n", - - // "GlobalSign Root CA - R2" - "-----BEGIN CERTIFICATE-----\n"+ - "MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv\n"+ - "YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh\n"+ - "bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT\n"+ - "aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln\n"+ - "bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6\n"+ - "ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp\n"+ - "s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN\n"+ - "S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL\n"+ - "TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C\n"+ - "ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E\n"+ - "FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i\n"+ - "YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN\n"+ - "BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp\n"+ - "9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu\n"+ - "01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7\n"+ - "9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7\n"+ - "TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==\n"+ - "-----END CERTIFICATE-----\n" ] - - - , cache : cache - - , "cache-lock-stale": 60000 - , "cache-lock-retries": 10 - , "cache-lock-wait": 10000 - - , "cache-max": Infinity - , "cache-min": 10 - - , color : true - , coverage: false - , depth: Infinity - , description : true - , dev : false - , editor : osenv.editor() - , "engine-strict": false - , force : false - - , "fetch-retries": 2 - , "fetch-retry-factor": 10 - , "fetch-retry-mintimeout": 10000 - , "fetch-retry-maxtimeout": 60000 - - , git: "git" - - , global : false - , globalconfig : path.resolve(globalPrefix, "etc", "npmrc") - , globalignorefile : path.resolve( globalPrefix, "etc", "npmignore") - , group : process.platform === "win32" ? 0 - : process.env.SUDO_GID || (process.getgid && process.getgid()) - , ignore: "" - , "init-module": path.resolve(home, '.npm-init.js') - , "init.version" : "0.0.0" - , "init.author.name" : "" - , "init.author.email" : "" - , "init.author.url" : "" - , json: false - , link: false - , loglevel : "http" - , logstream : process.stderr - , long : false - , message : "%s" - , "node-version" : process.version - , npaturl : "http://npat.npmjs.org/" - , npat : false - , "onload-script" : false - , optional: true - , parseable : false - , pre: false - , prefix : globalPrefix - , production: process.env.NODE_ENV === "production" - , "proprietary-attribs": true - , proxy : process.env.HTTP_PROXY || process.env.http_proxy || null - , "https-proxy" : process.env.HTTPS_PROXY || process.env.https_proxy || - process.env.HTTP_PROXY || process.env.http_proxy || null - , "user-agent" : "node/" + process.version - + ' ' + process.platform - + ' ' + process.arch - , "rebuild-bundle" : true - , registry : "https://registry.npmjs.org/" - , rollback : true - , save : false - , "save-bundle": false - , "save-dev" : false - , "save-optional" : false - , searchopts: "" - , searchexclude: null - , searchsort: "name" - , shell : osenv.shell() - , "sign-git-tag": false - , "strict-ssl": true - , tag : "latest" - , tmp : temp - , unicode : true - , "unsafe-perm" : process.platform === "win32" - || process.platform === "cygwin" - || !( process.getuid && process.setuid - && process.getgid && process.setgid ) - || process.getuid() !== 0 - , usage : false - , user : process.platform === "win32" ? 0 : "nobody" - , username : "" - , userconfig : path.resolve(home, ".npmrc") - , userignorefile : path.resolve(home, ".npmignore") - , umask: 022 - , version : false - , versions : false - , viewer: process.platform === "win32" ? "browser" : "man" - , yes: null - - , _exit : true - } -}}) - -exports.types = - { "always-auth" : Boolean - , "bin-links": Boolean - , browser : [null, String] - , ca: [null, String, Array] - , cache : path - , "cache-lock-stale": Number - , "cache-lock-retries": Number - , "cache-lock-wait": Number - , "cache-max": Number - , "cache-min": Number - , color : ["always", Boolean] - , coverage: Boolean - , depth : Number - , description : Boolean - , dev : Boolean - , editor : String - , "engine-strict": Boolean - , force : Boolean - , "fetch-retries": Number - , "fetch-retry-factor": Number - , "fetch-retry-mintimeout": Number - , "fetch-retry-maxtimeout": Number - , git: String - , global : Boolean - , globalconfig : path - , globalignorefile: path - , group : [Number, String] - , "https-proxy" : [null, url] - , "user-agent" : String - , ignore : String - , "init-module": path - , "init.version" : [null, semver] - , "init.author.name" : String - , "init.author.email" : String - , "init.author.url" : ["", url] - , json: Boolean - , link: Boolean - , loglevel : ["silent","win","error","warn","http","info","verbose","silly"] - , logstream : Stream - , long : Boolean - , message: String - , "node-version" : [null, semver] - , npaturl : url - , npat : Boolean - , "onload-script" : [null, String] - , optional: Boolean - , parseable : Boolean - , pre: Boolean - , prefix: path - , production: Boolean - , "proprietary-attribs": Boolean - , proxy : [null, url] - , "rebuild-bundle" : Boolean - , registry : [null, url] - , rollback : Boolean - , save : Boolean - , "save-bundle": Boolean - , "save-dev" : Boolean - , "save-optional" : Boolean - , searchopts : String - , searchexclude: [null, String] - , searchsort: [ "name", "-name" - , "description", "-description" - , "author", "-author" - , "date", "-date" - , "keywords", "-keywords" ] - , shell : String - , "sign-git-tag": Boolean - , "strict-ssl": Boolean - , tag : String - , tmp : path - , unicode : Boolean - , "unsafe-perm" : Boolean - , usage : Boolean - , user : [Number, String] - , username : String - , userconfig : path - , userignorefile : path - , umask: Octal - , version : Boolean - , versions : Boolean - , viewer: String - , yes: [false, null, Boolean] - , _exit : Boolean - , _password: String - } - -exports.shorthands = - { s : ["--loglevel", "silent"] - , d : ["--loglevel", "info"] - , dd : ["--loglevel", "verbose"] - , ddd : ["--loglevel", "silly"] - , noreg : ["--no-registry"] - , N : ["--no-registry"] - , reg : ["--registry"] - , "no-reg" : ["--no-registry"] - , silent : ["--loglevel", "silent"] - , verbose : ["--loglevel", "verbose"] - , quiet: ["--loglevel", "warn"] - , q: ["--loglevel", "warn"] - , h : ["--usage"] - , H : ["--usage"] - , "?" : ["--usage"] - , help : ["--usage"] - , v : ["--version"] - , f : ["--force"] - , gangster : ["--force"] - , gangsta : ["--force"] - , desc : ["--description"] - , "no-desc" : ["--no-description"] - , "local" : ["--no-global"] - , l : ["--long"] - , m : ["--message"] - , p : ["--parseable"] - , porcelain : ["--parseable"] - , g : ["--global"] - , S : ["--save"] - , D : ["--save-dev"] - , O : ["--save-optional"] - , y : ["--yes"] - , n : ["--no-yes"] - , B : ["--save-bundle"] - } diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/.bin/nopt b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/.bin/nopt deleted file mode 120000 index 6b6566e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/.bin/semver b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/.bin/semver deleted file mode 120000 index 317eb29..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/.npmignore deleted file mode 100644 index 13abef4..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -node_modules/* -npm_debug.log diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/LICENCE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/LICENCE deleted file mode 100644 index 171dd97..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/LICENCE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2011 Dominic Tarr - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/index.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/index.js deleted file mode 100755 index 0ef3a91..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/index.js +++ /dev/null @@ -1,282 +0,0 @@ -var ProtoList = require('proto-list') - , path = require('path') - , fs = require('fs') - , ini = require('ini') - , EE = require('events').EventEmitter - , url = require('url') - , http = require('http') - -var exports = module.exports = function () { - var args = [].slice.call(arguments) - , conf = new ConfigChain() - - while(args.length) { - var a = args.shift() - if(a) conf.push - ( 'string' === typeof a - ? json(a) - : a ) - } - - return conf -} - -//recursively find a file... - -var find = exports.find = function () { - var rel = path.join.apply(null, [].slice.call(arguments)) - - function find(start, rel) { - var file = path.join(start, rel) - try { - fs.statSync(file) - return file - } catch (err) { - if(path.dirname(start) !== start) // root - return find(path.dirname(start), rel) - } - } - return find(__dirname, rel) -} - -var parse = exports.parse = function (content, file, type) { - content = '' + content - // if we don't know what it is, try json and fall back to ini - // if we know what it is, then it must be that. - if (!type) { - try { return JSON.parse(content) } - catch (er) { return ini.parse(content) } - } else if (type === 'json') { - if (this.emit) { - try { return JSON.parse(content) } - catch (er) { this.emit('error', er) } - } else { - return JSON.parse(content) - } - } else { - return ini.parse(content) - } -} - -var json = exports.json = function () { - var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) - var file = path.join.apply(null, args) - var content - try { - content = fs.readFileSync(file,'utf-8') - } catch (err) { - return - } - return parse(content, file, 'json') -} - -var env = exports.env = function (prefix, env) { - env = env || process.env - var obj = {} - var l = prefix.length - for(var k in env) { - if(k.indexOf(prefix) === 0) - obj[k.substring(l)] = env[k] - } - - return obj -} - -exports.ConfigChain = ConfigChain -function ConfigChain () { - EE.apply(this) - ProtoList.apply(this, arguments) - this._awaiting = 0 - this._saving = 0 - this.sources = {} -} - -// multi-inheritance-ish -var extras = { - constructor: { value: ConfigChain } -} -Object.keys(EE.prototype).forEach(function (k) { - extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k) -}) -ConfigChain.prototype = Object.create(ProtoList.prototype, extras) - -ConfigChain.prototype.del = function (key, where) { - // if not specified where, then delete from the whole chain, scorched - // earth style - if (where) { - var target = this.sources[where] - target = target && target.data - if (!target) { - return this.emit('error', new Error('not found '+where)) - } - delete target[key] - } else { - for (var i = 0, l = this.list.length; i < l; i ++) { - delete this.list[i][key] - } - } - return this -} - -ConfigChain.prototype.set = function (key, value, where) { - var target - - if (where) { - target = this.sources[where] - target = target && target.data - if (!target) { - return this.emit('error', new Error('not found '+where)) - } - } else { - target = this.list[0] - if (!target) { - return this.emit('error', new Error('cannot set, no confs!')) - } - } - target[key] = value - return this -} - -ConfigChain.prototype.get = function (key, where) { - if (where) { - where = this.sources[where] - if (where) where = where.data - if (where && Object.hasOwnProperty.call(where, key)) return where[key] - return undefined - } - return this.list[0][key] -} - -ConfigChain.prototype.save = function (where, type, cb) { - if (typeof type === 'function') cb = type, type = null - var target = this.sources[where] - if (!target || !(target.path || target.source) || !target.data) { - // TODO: maybe save() to a url target could be a PUT or something? - // would be easy to swap out with a reddis type thing, too - return this.emit('error', new Error('bad save target: '+where)) - } - - if (target.source) { - var pref = target.prefix || '' - Object.keys(target.data).forEach(function (k) { - target.source[pref + k] = target.data[k] - }) - return this - } - - var type = type || target.type - var data = target.data - if (target.type === 'json') { - data = JSON.stringify(data) - } else { - data = ini.stringify(data) - } - - this._saving ++ - fs.writeFile(target.path, data, 'utf8', function (er) { - this._saving -- - if (er) { - if (cb) return cb(er) - else return this.emit('error', er) - } - if (this._saving === 0) { - if (cb) cb() - this.emit('save') - } - }.bind(this)) - return this -} - -ConfigChain.prototype.addFile = function (file, type, name) { - name = name || file - var marker = {__source__:name} - this.sources[name] = { path: file, type: type } - this.push(marker) - this._await() - fs.readFile(file, 'utf8', function (er, data) { - if (er) this.emit('error', er) - this.addString(data, file, type, marker) - }.bind(this)) - return this -} - -ConfigChain.prototype.addEnv = function (prefix, env, name) { - name = name || 'env' - var data = exports.env(prefix, env) - this.sources[name] = { data: data, source: env, prefix: prefix } - return this.add(data, name) -} - -ConfigChain.prototype.addUrl = function (req, type, name) { - this._await() - var href = url.format(req) - name = name || href - var marker = {__source__:name} - this.sources[name] = { href: href, type: type } - this.push(marker) - http.request(req, function (res) { - var c = [] - var ct = res.headers['content-type'] - if (!type) { - type = ct.indexOf('json') !== -1 ? 'json' - : ct.indexOf('ini') !== -1 ? 'ini' - : href.match(/\.json$/) ? 'json' - : href.match(/\.ini$/) ? 'ini' - : null - marker.type = type - } - - res.on('data', c.push.bind(c)) - .on('end', function () { - this.addString(Buffer.concat(c), href, type, marker) - }.bind(this)) - .on('error', this.emit.bind(this, 'error')) - - }.bind(this)) - .on('error', this.emit.bind(this, 'error')) - .end() - - return this -} - -ConfigChain.prototype.addString = function (data, file, type, marker) { - data = this.parse(data, file, type) - this.add(data, marker) - return this -} - -ConfigChain.prototype.add = function (data, marker) { - if (marker && typeof marker === 'object') { - var i = this.list.indexOf(marker) - if (i === -1) { - return this.emit('error', new Error('bad marker')) - } - this.splice(i, 1, data) - marker = marker.__source__ - this.sources[marker] = this.sources[marker] || {} - this.sources[marker].data = data - // we were waiting for this. maybe emit 'load' - this._resolve() - } else { - if (typeof marker === 'string') { - this.sources[marker] = this.sources[marker] || {} - this.sources[marker].data = data - } - // trigger the load event if nothing was already going to do so. - this._await() - this.push(data) - process.nextTick(this._resolve.bind(this)) - } - return this -} - -ConfigChain.prototype.parse = exports.parse - -ConfigChain.prototype._await = function () { - this._awaiting++ -} - -ConfigChain.prototype._resolve = function () { - this._awaiting-- - if (this._awaiting === 0) this.emit('load', this) -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/README.md deleted file mode 100644 index 43cfa35..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/README.md +++ /dev/null @@ -1,3 +0,0 @@ -A list of objects, bound by their prototype chain. - -Used in npm's config stuff. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json deleted file mode 100644 index 9b9d3d7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "proto-list", - "version": "1.2.2", - "description": "A utility for managing a prototype chain", - "main": "./proto-list.js", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/isaacs/proto-list" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/proto-list/blob/master/LICENSE" - }, - "devDependencies": { - "tap": "0" - }, - "readme": "A list of objects, bound by their prototype chain.\n\nUsed in npm's config stuff.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/proto-list/issues" - }, - "_id": "proto-list@1.2.2", - "_from": "proto-list@~1.2.1" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js deleted file mode 100644 index 67d2503..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js +++ /dev/null @@ -1,81 +0,0 @@ - -module.exports = ProtoList - -function ProtoList () { - this.list = [] - var root = null - Object.defineProperty(this, 'root', { - get: function () { return root }, - set: function (r) { - root = r - if (this.list.length) { - this.list[this.list.length - 1].__proto__ = r - } - }, - enumerable: true, - configurable: true - }) -} - -ProtoList.prototype = - { get length () { return this.list.length } - , get keys () { - var k = [] - for (var i in this.list[0]) k.push(i) - return k - } - , get snapshot () { - var o = {} - this.keys.forEach(function (k) { o[k] = this.get(k) }, this) - return o - } - , get store () { - return this.list[0] - } - , push : function (obj) { - if (typeof obj !== "object") obj = {valueOf:obj} - if (this.list.length >= 1) { - this.list[this.list.length - 1].__proto__ = obj - } - obj.__proto__ = this.root - return this.list.push(obj) - } - , pop : function () { - if (this.list.length >= 2) { - this.list[this.list.length - 2].__proto__ = this.root - } - return this.list.pop() - } - , unshift : function (obj) { - obj.__proto__ = this.list[0] || this.root - return this.list.unshift(obj) - } - , shift : function () { - if (this.list.length === 1) { - this.list[0].__proto__ = this.root - } - return this.list.shift() - } - , get : function (key) { - return this.list[0][key] - } - , set : function (key, val, save) { - if (!this.length) this.push({}) - if (save && this.list[0].hasOwnProperty(key)) this.push({}) - return this.list[0][key] = val - } - , forEach : function (fn, thisp) { - for (var key in this.list[0]) fn.call(thisp, key, this.list[0][key]) - } - , slice : function () { - return this.list.slice.apply(this.list, arguments) - } - , splice : function () { - // handle injections - var ret = this.list.splice.apply(this.list, arguments) - for (var i = 0, l = this.list.length; i < l; i++) { - this.list[i].__proto__ = this.list[i + 1] || this.root - } - return ret - } - } diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/test/basic.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/test/basic.js deleted file mode 100644 index 5cd66be..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/test/basic.js +++ /dev/null @@ -1,61 +0,0 @@ -var tap = require("tap") - , test = tap.test - , ProtoList = require("../proto-list.js") - -tap.plan(1) - -tap.test("protoList tests", function (t) { - var p = new ProtoList - p.push({foo:"bar"}) - p.push({}) - p.set("foo", "baz") - t.equal(p.get("foo"), "baz") - - var p = new ProtoList - p.push({foo:"bar"}) - p.set("foo", "baz") - t.equal(p.get("foo"), "baz") - t.equal(p.length, 1) - p.pop() - t.equal(p.length, 0) - p.set("foo", "asdf") - t.equal(p.length, 1) - t.equal(p.get("foo"), "asdf") - p.push({bar:"baz"}) - t.equal(p.length, 2) - t.equal(p.get("foo"), "asdf") - p.shift() - t.equal(p.length, 1) - t.equal(p.get("foo"), undefined) - - - p.unshift({foo:"blo", bar:"rab"}) - p.unshift({foo:"boo"}) - t.equal(p.length, 3) - t.equal(p.get("foo"), "boo") - t.equal(p.get("bar"), "rab") - - var ret = p.splice(1, 1, {bar:"bar"}) - t.same(ret, [{foo:"blo", bar:"rab"}]) - t.equal(p.get("bar"), "bar") - - // should not inherit default object properties - t.equal(p.get('hasOwnProperty'), undefined) - - // unless we give it those. - p.root = {} - t.equal(p.get('hasOwnProperty'), {}.hasOwnProperty) - - p.root = {default:'monkey'} - t.equal(p.get('default'), 'monkey') - - p.push({red:'blue'}) - p.push({red:'blue'}) - p.push({red:'blue'}) - while (p.length) { - t.equal(p.get('default'), 'monkey') - p.shift() - } - - t.end() -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/package.json deleted file mode 100644 index ad68251..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "config-chain", - "version": "1.1.8", - "description": "HANDLE CONFIGURATION ONCE AND FOR ALL", - "homepage": "http://github.com/dominictarr/config-chain", - "repository": { - "type": "git", - "url": "https://github.com/dominictarr/config-chain.git" - }, - "dependencies": { - "proto-list": "~1.2.1", - "ini": "1" - }, - "devDependencies": { - "tap": "0.3.0" - }, - "author": { - "name": "Dominic Tarr", - "email": "dominic.tarr@gmail.com", - "url": "http://dominictarr.com" - }, - "scripts": { - "test": "tap test/" - }, - "readme": "#config-chain\n\nUSE THIS MODULE TO LOAD ALL YOUR CONFIGURATIONS\n\n``` js\n\n //npm install config-chain\n\n var cc = require('config-chain')\n , opts = require('optimist').argv //ALWAYS USE OPTIMIST FOR COMMAND LINE OPTIONS.\n , env = opts.env || process.env.YOUR_APP_ENV || 'dev' //SET YOUR ENV LIKE THIS.\n\n // EACH ARG TO CONFIGURATOR IS LOADED INTO CONFIGURATION CHAIN\n // EARLIER ITEMS OVERIDE LATER ITEMS\n // PUTS COMMAND LINE OPTS FIRST, AND DEFAULTS LAST!\n\n //strings are interpereted as filenames.\n //will be loaded synchronously\n\n var conf =\n cc(\n //OVERRIDE SETTINGS WITH COMMAND LINE OPTS\n opts,\n\n //ENV VARS IF PREFIXED WITH 'myApp_'\n\n cc.env('myApp_'), //myApp_foo = 'like this'\n\n //FILE NAMED BY ENV\n path.join(__dirname, 'config.' + env + '.json'),\n\n //IF `env` is PRODUCTION\n env === 'prod'\n ? path.join(__dirname, 'special.json') //load a special file\n : null //NULL IS IGNORED!\n\n //SUBDIR FOR ENV CONFIG\n path.join(__dirname, 'config', env, 'config.json'),\n\n //SEARCH PARENT DIRECTORIES FROM CURRENT DIR FOR FILE\n cc.find('config.json'),\n\n //PUT DEFAULTS LAST\n {\n host: 'localhost'\n port: 8000\n })\n\n var host = conf.get('host')\n\n // or\n\n var host = conf.store.host\n\n```\n\nFINALLY, EASY FLEXIBLE CONFIGURATIONS!\n\n##see also: [proto-list](https://github.com/isaacs/proto-list/)\n\nWHATS THAT YOU SAY?\n\nYOU WANT A \"CLASS\" SO THAT YOU CAN DO CRAYCRAY JQUERY CRAPS?\n\nEXTEND WITH YOUR OWN FUNCTIONALTY!?\n\n## CONFIGCHAIN LIVES TO SERVE ONLY YOU!\n\n```javascript\nvar cc = require('config-chain')\n\n// all the stuff you did before\nvar config = cc({\n some: 'object'\n },\n cc.find('config.json'),\n cc.env('myApp_')\n )\n // CONFIGS AS A SERVICE, aka \"CaaS\", aka EVERY DEVOPS DREAM OMG!\n .addUrl('http://configurator:1234/my-configs')\n // ASYNC FTW!\n .addFile('/path/to/file.json')\n\n // OBJECTS ARE OK TOO, they're SYNC but they still ORDER RIGHT\n // BECAUSE PROMISES ARE USED BUT NO, NOT *THOSE* PROMISES, JUST\n // ACTUAL PROMISES LIKE YOU MAKE TO YOUR MOM, KEPT OUT OF LOVE\n .add({ another: 'object' })\n\n // DIE A THOUSAND DEATHS IF THIS EVER HAPPENS!!\n .on('error', function (er) {\n // IF ONLY THERE WAS SOMETHIGN HARDER THAN THROW\n // MY SORROW COULD BE ADEQUATELY EXPRESSED. /o\\\n throw er\n })\n\n // THROW A PARTY IN YOUR FACE WHEN ITS ALL LOADED!!\n .on('load', function (config) {\n console.awesome('HOLY SHIT!')\n })\n```\n\n# BORING API DOCS\n\n## cc(...args)\n\nMAKE A CHAIN AND ADD ALL THE ARGS.\n\nIf the arg is a STRING, then it shall be a JSON FILENAME.\n\nSYNC I/O!\n\nRETURN THE CHAIN!\n\n## cc.json(...args)\n\nJoin the args INTO A JSON FILENAME!\n\nSYNC I/O!\n\n## cc.find(relativePath)\n\nSEEK the RELATIVE PATH by climbing the TREE OF DIRECTORIES.\n\nRETURN THE FOUND PATH!\n\nSYNC I/O!\n\n## cc.parse(content, file, type)\n\nParse the content string, and guess the type from either the\nspecified type or the filename.\n\nRETURN THE RESULTING OBJECT!\n\nNO I/O!\n\n## cc.env(prefix, env=process.env)\n\nGet all the keys on the provided env object (or process.env) which are\nprefixed by the specified prefix, and put the values on a new object.\n\nRETURN THE RESULTING OBJECT!\n\nNO I/O!\n\n## cc.ConfigChain()\n\nThe ConfigChain class for CRAY CRAY JQUERY STYLE METHOD CHAINING!\n\nOne of these is returned by the main exported function, as well.\n\nIt inherits (prototypically) from\n[ProtoList](https://github.com/isaacs/proto-list/), and also inherits\n(parasitically) from\n[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter)\n\nIt has all the methods from both, and except where noted, they are\nunchanged.\n\n### LET IT BE KNOWN THAT chain IS AN INSTANCE OF ConfigChain.\n\n## chain.sources\n\nA list of all the places where it got stuff. The keys are the names\npassed to addFile or addUrl etc, and the value is an object with some\ninfo about the data source.\n\n## chain.addFile(filename, type, [name=filename])\n\nFilename is the name of the file. Name is an arbitrary string to be\nused later if you desire. Type is either 'ini' or 'json', and will\ntry to guess intelligently if omitted.\n\nLoaded files can be saved later.\n\n## chain.addUrl(url, type, [name=url])\n\nSame as the filename thing, but with a url.\n\nCan't be saved later.\n\n## chain.addEnv(prefix, env, [name='env'])\n\nAdd all the keys from the env object that start with the prefix.\n\n## chain.addString(data, file, type, [name])\n\nParse the string and add it to the set. (Mainly used internally.)\n\n## chain.add(object, [name])\n\nAdd the object to the set.\n\n## chain.root {Object}\n\nThe root from which all the other config objects in the set descend\nprototypically.\n\nPut your defaults here.\n\n## chain.set(key, value, name)\n\nSet the key to the value on the named config object. If name is\nunset, then set it on the first config object in the set. (That is,\nthe one with the highest priority, which was added first.)\n\n## chain.get(key, [name])\n\nGet the key from the named config object explicitly, or from the\nresolved configs if not specified.\n\n## chain.save(name, type)\n\nWrite the named config object back to its origin.\n\nCurrently only supported for env and file config types.\n\nFor files, encode the data according to the type.\n\n## chain.on('save', function () {})\n\nWhen one or more files are saved, emits `save` event when they're all\nsaved.\n\n## chain.on('load', function (chain) {})\n\nWhen the config chain has loaded all the specified files and urls and\nsuch, the 'load' event fires.\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/dominictarr/config-chain/issues" - }, - "_id": "config-chain@1.1.8", - "_from": "config-chain@~1.1.1" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/readme.markdown b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/readme.markdown deleted file mode 100644 index c83a430..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/readme.markdown +++ /dev/null @@ -1,228 +0,0 @@ -#config-chain - -USE THIS MODULE TO LOAD ALL YOUR CONFIGURATIONS - -``` js - - //npm install config-chain - - var cc = require('config-chain') - , opts = require('optimist').argv //ALWAYS USE OPTIMIST FOR COMMAND LINE OPTIONS. - , env = opts.env || process.env.YOUR_APP_ENV || 'dev' //SET YOUR ENV LIKE THIS. - - // EACH ARG TO CONFIGURATOR IS LOADED INTO CONFIGURATION CHAIN - // EARLIER ITEMS OVERIDE LATER ITEMS - // PUTS COMMAND LINE OPTS FIRST, AND DEFAULTS LAST! - - //strings are interpereted as filenames. - //will be loaded synchronously - - var conf = - cc( - //OVERRIDE SETTINGS WITH COMMAND LINE OPTS - opts, - - //ENV VARS IF PREFIXED WITH 'myApp_' - - cc.env('myApp_'), //myApp_foo = 'like this' - - //FILE NAMED BY ENV - path.join(__dirname, 'config.' + env + '.json'), - - //IF `env` is PRODUCTION - env === 'prod' - ? path.join(__dirname, 'special.json') //load a special file - : null //NULL IS IGNORED! - - //SUBDIR FOR ENV CONFIG - path.join(__dirname, 'config', env, 'config.json'), - - //SEARCH PARENT DIRECTORIES FROM CURRENT DIR FOR FILE - cc.find('config.json'), - - //PUT DEFAULTS LAST - { - host: 'localhost' - port: 8000 - }) - - var host = conf.get('host') - - // or - - var host = conf.store.host - -``` - -FINALLY, EASY FLEXIBLE CONFIGURATIONS! - -##see also: [proto-list](https://github.com/isaacs/proto-list/) - -WHATS THAT YOU SAY? - -YOU WANT A "CLASS" SO THAT YOU CAN DO CRAYCRAY JQUERY CRAPS? - -EXTEND WITH YOUR OWN FUNCTIONALTY!? - -## CONFIGCHAIN LIVES TO SERVE ONLY YOU! - -```javascript -var cc = require('config-chain') - -// all the stuff you did before -var config = cc({ - some: 'object' - }, - cc.find('config.json'), - cc.env('myApp_') - ) - // CONFIGS AS A SERVICE, aka "CaaS", aka EVERY DEVOPS DREAM OMG! - .addUrl('http://configurator:1234/my-configs') - // ASYNC FTW! - .addFile('/path/to/file.json') - - // OBJECTS ARE OK TOO, they're SYNC but they still ORDER RIGHT - // BECAUSE PROMISES ARE USED BUT NO, NOT *THOSE* PROMISES, JUST - // ACTUAL PROMISES LIKE YOU MAKE TO YOUR MOM, KEPT OUT OF LOVE - .add({ another: 'object' }) - - // DIE A THOUSAND DEATHS IF THIS EVER HAPPENS!! - .on('error', function (er) { - // IF ONLY THERE WAS SOMETHIGN HARDER THAN THROW - // MY SORROW COULD BE ADEQUATELY EXPRESSED. /o\ - throw er - }) - - // THROW A PARTY IN YOUR FACE WHEN ITS ALL LOADED!! - .on('load', function (config) { - console.awesome('HOLY SHIT!') - }) -``` - -# BORING API DOCS - -## cc(...args) - -MAKE A CHAIN AND ADD ALL THE ARGS. - -If the arg is a STRING, then it shall be a JSON FILENAME. - -SYNC I/O! - -RETURN THE CHAIN! - -## cc.json(...args) - -Join the args INTO A JSON FILENAME! - -SYNC I/O! - -## cc.find(relativePath) - -SEEK the RELATIVE PATH by climbing the TREE OF DIRECTORIES. - -RETURN THE FOUND PATH! - -SYNC I/O! - -## cc.parse(content, file, type) - -Parse the content string, and guess the type from either the -specified type or the filename. - -RETURN THE RESULTING OBJECT! - -NO I/O! - -## cc.env(prefix, env=process.env) - -Get all the keys on the provided env object (or process.env) which are -prefixed by the specified prefix, and put the values on a new object. - -RETURN THE RESULTING OBJECT! - -NO I/O! - -## cc.ConfigChain() - -The ConfigChain class for CRAY CRAY JQUERY STYLE METHOD CHAINING! - -One of these is returned by the main exported function, as well. - -It inherits (prototypically) from -[ProtoList](https://github.com/isaacs/proto-list/), and also inherits -(parasitically) from -[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter) - -It has all the methods from both, and except where noted, they are -unchanged. - -### LET IT BE KNOWN THAT chain IS AN INSTANCE OF ConfigChain. - -## chain.sources - -A list of all the places where it got stuff. The keys are the names -passed to addFile or addUrl etc, and the value is an object with some -info about the data source. - -## chain.addFile(filename, type, [name=filename]) - -Filename is the name of the file. Name is an arbitrary string to be -used later if you desire. Type is either 'ini' or 'json', and will -try to guess intelligently if omitted. - -Loaded files can be saved later. - -## chain.addUrl(url, type, [name=url]) - -Same as the filename thing, but with a url. - -Can't be saved later. - -## chain.addEnv(prefix, env, [name='env']) - -Add all the keys from the env object that start with the prefix. - -## chain.addString(data, file, type, [name]) - -Parse the string and add it to the set. (Mainly used internally.) - -## chain.add(object, [name]) - -Add the object to the set. - -## chain.root {Object} - -The root from which all the other config objects in the set descend -prototypically. - -Put your defaults here. - -## chain.set(key, value, name) - -Set the key to the value on the named config object. If name is -unset, then set it on the first config object in the set. (That is, -the one with the highest priority, which was added first.) - -## chain.get(key, [name]) - -Get the key from the named config object explicitly, or from the -resolved configs if not specified. - -## chain.save(name, type) - -Write the named config object back to its origin. - -Currently only supported for env and file config types. - -For files, encode the data according to the type. - -## chain.on('save', function () {}) - -When one or more files are saved, emits `save` event when they're all -saved. - -## chain.on('load', function (chain) {}) - -When the config chain has loaded all the specified files and urls and -such, the 'load' event fires. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/broken.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/broken.js deleted file mode 100644 index 101a3e4..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/broken.js +++ /dev/null @@ -1,10 +0,0 @@ - - -var cc = require('..') -var assert = require('assert') - - -//throw on invalid json -assert.throws(function () { - cc(__dirname + '/broken.json') -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/broken.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/broken.json deleted file mode 100644 index 2107ac1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/broken.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "config-chain", - "version": "0.3.0", - "description": "HANDLE CONFIGURATION ONCE AND FOR ALL", - "homepage": "http://github.com/dominictarr/config-chain", - "repository": { - "type": "git", - "url": "https://github.com/dominictarr/config-chain.git" - } - //missing , and then this comment. this json is intensionally invalid - "dependencies": { - "proto-list": "1", - "ini": "~1.0.2" - }, - "bundleDependencies": ["ini"], - "REM": "REMEMBER TO REMOVE BUNDLING WHEN/IF ISAACS MERGES ini#7", - "author": "Dominic Tarr (http://dominictarr.com)", - "scripts": { - "test": "node test/find-file.js && node test/ini.js && node test/env.js" - } -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/chain-class.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/chain-class.js deleted file mode 100644 index bbc0d4c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/chain-class.js +++ /dev/null @@ -1,100 +0,0 @@ -var test = require('tap').test -var CC = require('../index.js').ConfigChain - -var env = { foo_blaz : 'blzaa', foo_env : 'myenv' } -var jsonObj = { blaz: 'json', json: true } -var iniObj = { 'x.y.z': 'xyz', blaz: 'ini' } - -var fs = require('fs') -var ini = require('ini') - -fs.writeFileSync('/tmp/config-chain-class.json', JSON.stringify(jsonObj)) -fs.writeFileSync('/tmp/config-chain-class.ini', ini.stringify(iniObj)) - -var http = require('http') -var reqs = 0 -http.createServer(function (q, s) { - if (++reqs === 2) this.close() - if (q.url === '/json') { - // make sure that the requests come back from the server - // out of order. they should still be ordered properly - // in the resulting config object set. - setTimeout(function () { - s.setHeader('content-type', 'application/json') - s.end(JSON.stringify({ - blaz: 'http', - http: true, - json: true - })) - }, 200) - } else { - s.setHeader('content-type', 'application/ini') - s.end(ini.stringify({ - blaz: 'http', - http: true, - ini: true, - json: false - })) - } -}).listen(1337) - -test('basic class test', function (t) { - var cc = new CC() - var expectlist = - [ { blaz: 'json', json: true }, - { 'x.y.z': 'xyz', blaz: 'ini' }, - { blaz: 'blzaa', env: 'myenv' }, - { blaz: 'http', http: true, json: true }, - { blaz: 'http', http: true, ini: true, json: false } ] - - cc.addFile('/tmp/config-chain-class.json') - .addFile('/tmp/config-chain-class.ini') - .addEnv('foo_', env) - .addUrl('http://localhost:1337/json') - .addUrl('http://localhost:1337/ini') - .on('load', function () { - t.same(cc.list, expectlist) - t.same(cc.snapshot, { blaz: 'json', - json: true, - 'x.y.z': 'xyz', - env: 'myenv', - http: true, - ini: true }) - - cc.del('blaz', '/tmp/config-chain-class.json') - t.same(cc.snapshot, { blaz: 'ini', - json: true, - 'x.y.z': 'xyz', - env: 'myenv', - http: true, - ini: true }) - cc.del('blaz') - t.same(cc.snapshot, { json: true, - 'x.y.z': 'xyz', - env: 'myenv', - http: true, - ini: true }) - cc.shift() - t.same(cc.snapshot, { 'x.y.z': 'xyz', - env: 'myenv', - http: true, - json: true, - ini: true }) - cc.shift() - t.same(cc.snapshot, { env: 'myenv', - http: true, - json: true, - ini: true }) - cc.shift() - t.same(cc.snapshot, { http: true, - json: true, - ini: true }) - cc.shift() - t.same(cc.snapshot, { http: true, - ini: true, - json: false }) - cc.shift() - t.same(cc.snapshot, {}) - t.end() - }) -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/env.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/env.js deleted file mode 100644 index fb718f3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/env.js +++ /dev/null @@ -1,10 +0,0 @@ -var cc = require('..') -var assert = require('assert') - -assert.deepEqual({ - hello: true -}, cc.env('test_', { - 'test_hello': true, - 'ignore_this': 4, - 'ignore_test_this_too': [] -})) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/find-file.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/find-file.js deleted file mode 100644 index 23cde52..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/find-file.js +++ /dev/null @@ -1,13 +0,0 @@ - -var fs = require('fs') - , assert = require('assert') - , objx = { - rand: Math.random() - } - -fs.writeFileSync('/tmp/random-test-config.json', JSON.stringify(objx)) - -var cc = require('../') -var path = cc.find('tmp/random-test-config.json') - -assert.equal(path, '/tmp/random-test-config.json') \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/get.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/get.js deleted file mode 100644 index d6fd79f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/get.js +++ /dev/null @@ -1,15 +0,0 @@ -var cc = require("../"); - -var chain = cc() - , name = "forFun"; - -chain - .add({ - __sample:"for fun only" - }, name) - .on("load", function() { - //It throw exception here - console.log(chain.get("__sample", name)); - //But if I drop the name param, it run normally and return as expected: "for fun only" - //console.log(chain.get("__sample")); - }); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/ignore-unfound-file.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/ignore-unfound-file.js deleted file mode 100644 index d742b82..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/ignore-unfound-file.js +++ /dev/null @@ -1,5 +0,0 @@ - -var cc = require('..') - -//should not throw -cc(__dirname, 'non_existing_file') diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/ini.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/ini.js deleted file mode 100644 index 5572a6e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/ini.js +++ /dev/null @@ -1,18 +0,0 @@ - - -var cc =require('..') -var INI = require('ini') -var assert = require('assert') - -function test(obj) { - - var _json, _ini - var json = cc.parse (_json = JSON.stringify(obj)) - var ini = cc.parse (_ini = INI.stringify(obj)) -console.log(_ini, _json) - assert.deepEqual(json, ini) -} - - -test({hello: true}) - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/save.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/save.js deleted file mode 100644 index 7834613..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/config-chain/test/save.js +++ /dev/null @@ -1,59 +0,0 @@ -var CC = require('../index.js').ConfigChain -var test = require('tap').test - -var f1 = '/tmp/f1.ini' -var f2 = '/tmp/f2.json' - -var ini = require('ini') - -var f1data = {foo: {bar: 'baz'}, bloo: 'jaus'} -var f2data = {oof: {rab: 'zab'}, oolb: 'suaj'} - -var fs = require('fs') - -fs.writeFileSync(f1, ini.stringify(f1data), 'utf8') -fs.writeFileSync(f2, JSON.stringify(f2data), 'utf8') - -test('test saving and loading ini files', function (t) { - new CC() - .add({grelb:'blerg'}, 'opt') - .addFile(f1, 'ini', 'inifile') - .addFile(f2, 'json', 'jsonfile') - .on('load', function (cc) { - - t.same(cc.snapshot, { grelb: 'blerg', - bloo: 'jaus', - foo: { bar: 'baz' }, - oof: { rab: 'zab' }, - oolb: 'suaj' }) - - t.same(cc.list, [ { grelb: 'blerg' }, - { bloo: 'jaus', foo: { bar: 'baz' } }, - { oof: { rab: 'zab' }, oolb: 'suaj' } ]) - - cc.set('grelb', 'brelg', 'opt') - .set('foo', 'zoo', 'inifile') - .set('oof', 'ooz', 'jsonfile') - .save('inifile') - .save('jsonfile') - .on('save', function () { - t.equal(fs.readFileSync(f1, 'utf8'), - "bloo = jaus\nfoo = zoo\n") - t.equal(fs.readFileSync(f2, 'utf8'), - "{\"oof\":\"ooz\",\"oolb\":\"suaj\"}") - - t.same(cc.snapshot, { grelb: 'brelg', - bloo: 'jaus', - foo: 'zoo', - oof: 'ooz', - oolb: 'suaj' }) - - t.same(cc.list, [ { grelb: 'brelg' }, - { bloo: 'jaus', foo: 'zoo' }, - { oof: 'ooz', oolb: 'suaj' } ]) - - t.pass('ok') - t.end() - }) - }) -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/README.md deleted file mode 100644 index b2beaed..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/inherits.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/inherits.js deleted file mode 100644 index 061b396..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/package.json deleted file mode 100644 index 902a19d..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/inherits/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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" - }, - "_id": "inherits@1.0.0", - "_from": "inherits@~1.0.0", - "scripts": {} -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/README.md deleted file mode 100644 index acbe8ec..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/README.md +++ /dev/null @@ -1,79 +0,0 @@ -An ini format parser and serializer for node. - -Sections are treated as nested objects. Items before the first heading -are saved on the object directly. - -## Usage - -Consider an ini-file `config.ini` that looks like this: - - ; this comment is being ignored - scope = global - - [database] - user = dbuser - password = dbpassword - database = use_this_database - - [paths.default] - datadir = /var/lib/data - array[] = first value - array[] = second value - array[] = third value - -You can read, manipulate and write the ini-file like so: - - var fs = require('fs') - , ini = require('ini') - - var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8')) - - config.scope = 'local' - config.database.database = 'use_another_database' - config.paths.default.tmpdir = '/tmp' - delete config.paths.default.datadir - config.paths.default.array.push('fourth value') - - fs.writeFileSync('./config_modified.ini', ini.stringify(config, 'section')) - -This will result in a file called `config_modified.ini` being written to the filesystem with the following content: - - [section] - scope = local - [section.database] - user = dbuser - password = dbpassword - database = use_another_database - [section.paths.default] - tmpdir = /tmp - array[] = first value - array[] = second value - array[] = third value - array[] = fourth value - - -## API - -### decode(inistring) -Decode the ini-style formatted `inistring` into a nested object. - -### parse(inistring) -Alias for `decode(inistring)` - -### encode(object, [section]) -Encode the object `object` into an ini-style formatted string. If the optional parameter `section` is given, then all top-level properties of the object are put into this section and the `section`-string is prepended to all sub-sections, see the usage example above. - -### stringify(object, [section]) -Alias for `encode(object, [section])` - -### safe(val) -Escapes the string `val` such that it is safe to be used as a key or value in an ini-file. Basically escapes quotes. For example - - ini.safe('"unsafe string"') - -would result in - - "\"unsafe string\"" - -### unsafe(val) -Unescapes the string `val` diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/ini.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/ini.js deleted file mode 100644 index eaf3209..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/ini.js +++ /dev/null @@ -1,166 +0,0 @@ - -exports.parse = exports.decode = decode -exports.stringify = exports.encode = encode - -exports.safe = safe -exports.unsafe = unsafe - -var eol = process.platform === "win32" ? "\r\n" : "\n" - -function encode (obj, section) { - var children = [] - , out = "" - - Object.keys(obj).forEach(function (k, _, __) { - var val = obj[k] - if (val && Array.isArray(val)) { - val.forEach(function(item) { - out += safe(k + "[]") + " = " + safe(item) + "\n" - }) - } - else if (val && typeof val === "object") { - children.push(k) - } else { - out += safe(k) + " = " + safe(val) + eol - } - }) - - if (section && out.length) { - out = "[" + safe(section) + "]" + eol + out - } - - children.forEach(function (k, _, __) { - var nk = dotSplit(k).join('\\.') - var child = encode(obj[k], (section ? section + "." : "") + nk) - if (out.length && child.length) { - out += eol - } - out += child - }) - - return out -} - -function dotSplit (str) { - return str.replace(/\1/g, '\2LITERAL\\1LITERAL\2') - .replace(/\\\./g, '\1') - .split(/\./).map(function (part) { - return part.replace(/\1/g, '\\.') - .replace(/\2LITERAL\\1LITERAL\2/g, '\1') - }) -} - -function decode (str) { - var out = {} - , p = out - , section = null - , state = "START" - // section |key = value - , re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i - , lines = str.split(/[\r\n]+/g) - , section = null - - lines.forEach(function (line, _, __) { - if (!line || line.match(/^\s*;/)) return - var match = line.match(re) - if (!match) return - if (match[1] !== undefined) { - section = unsafe(match[1]) - p = out[section] = out[section] || {} - return - } - var key = unsafe(match[2]) - , value = match[3] ? unsafe((match[4] || "")) : true - switch (value) { - case 'true': - case 'false': - case 'null': value = JSON.parse(value) - } - - // Convert keys with '[]' suffix to an array - if (key.length > 2 && key.slice(-2) === "[]") { - key = key.substring(0, key.length - 2) - if (!p[key]) { - p[key] = [] - } - else if (!Array.isArray(p[key])) { - p[key] = [p[key]] - } - } - - // safeguard against resetting a previously defined - // array by accidentally forgetting the brackets - if (Array.isArray(p[key])) { - p[key].push(value) - } - else { - p[key] = value - } - }) - - // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} - // use a filter to return the keys that have to be deleted. - Object.keys(out).filter(function (k, _, __) { - if (!out[k] || typeof out[k] !== "object" || Array.isArray(out[k])) return false - // see if the parent section is also an object. - // if so, add it to that, and mark this one for deletion - var parts = dotSplit(k) - , p = out - , l = parts.pop() - , nl = l.replace(/\\\./g, '.') - parts.forEach(function (part, _, __) { - if (!p[part] || typeof p[part] !== "object") p[part] = {} - p = p[part] - }) - if (p === out && nl === l) return false - p[nl] = out[k] - return true - }).forEach(function (del, _, __) { - delete out[del] - }) - - return out -} - -function safe (val) { - return ( typeof val !== "string" - || val.match(/[\r\n]/) - || val.match(/^\[/) - || (val.length > 1 - && val.charAt(0) === "\"" - && val.slice(-1) === "\"") - || val !== val.trim() ) - ? JSON.stringify(val) - : val.replace(/;/g, '\\;') -} - -function unsafe (val, doUnesc) { - val = (val || "").trim() - if (val.charAt(0) === "\"" && val.slice(-1) === "\"") { - try { val = JSON.parse(val) } catch (_) {} - } else { - // walk the val to find the first not-escaped ; character - var esc = false - var unesc = ""; - for (var i = 0, l = val.length; i < l; i++) { - var c = val.charAt(i) - if (esc) { - if (c === "\\" || c === ";") - unesc += c - else - unesc += "\\" + c - esc = false - } else if (c === ";") { - break - } else if (c === "\\") { - esc = true - } else { - unesc += c - } - } - if (esc) - unesc += "\\" - return unesc - } - return val -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/package.json deleted file mode 100644 index 4c51dad..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "ini", - "description": "An ini encoder/decoder for node", - "version": "1.1.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/ini.git" - }, - "main": "ini.js", - "scripts": { - "test": "tap test/*.js" - }, - "engines": { - "node": "*" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.0.9" - }, - "readme": "An ini format parser and serializer for node.\n\nSections are treated as nested objects. Items before the first heading\nare saved on the object directly.\n\n## Usage\n\nConsider an ini-file `config.ini` that looks like this:\n\n ; this comment is being ignored\n scope = global\n\n [database]\n user = dbuser\n password = dbpassword\n database = use_this_database\n\n [paths.default]\n datadir = /var/lib/data\n array[] = first value\n array[] = second value\n array[] = third value\n\nYou can read, manipulate and write the ini-file like so:\n\n var fs = require('fs')\n , ini = require('ini')\n\n var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))\n\n config.scope = 'local'\n config.database.database = 'use_another_database'\n config.paths.default.tmpdir = '/tmp'\n delete config.paths.default.datadir\n config.paths.default.array.push('fourth value')\n\n fs.writeFileSync('./config_modified.ini', ini.stringify(config, 'section'))\n\nThis will result in a file called `config_modified.ini` being written to the filesystem with the following content:\n\n [section]\n scope = local\n [section.database]\n user = dbuser\n password = dbpassword\n database = use_another_database\n [section.paths.default]\n tmpdir = /tmp\n array[] = first value\n array[] = second value\n array[] = third value\n array[] = fourth value\n\n\n## API\n\n### decode(inistring)\nDecode the ini-style formatted `inistring` into a nested object.\n\n### parse(inistring)\nAlias for `decode(inistring)`\n\n### encode(object, [section])\nEncode the object `object` into an ini-style formatted string. If the optional parameter `section` is given, then all top-level properties of the object are put into this section and the `section`-string is prepended to all sub-sections, see the usage example above.\n\n### stringify(object, [section])\nAlias for `encode(object, [section])`\n\n### safe(val)\nEscapes the string `val` such that it is safe to be used as a key or value in an ini-file. Basically escapes quotes. For example\n\n ini.safe('\"unsafe string\"')\n\nwould result in\n\n \"\\\"unsafe string\\\"\"\n\n### unsafe(val)\nUnescapes the string `val`\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/ini/issues" - }, - "_id": "ini@1.1.0", - "_from": "ini@~1.1.0" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/bar.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/bar.js deleted file mode 100644 index cb16176..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/bar.js +++ /dev/null @@ -1,23 +0,0 @@ -//test that parse(stringify(obj) deepEqu - -var ini = require('../') -var test = require('tap').test - -var data = { - 'number': {count: 10}, - 'string': {drink: 'white russian'}, - 'boolean': {isTrue: true}, - 'nested boolean': {theDude: {abides: true, rugCount: 1}} -} - - -test('parse(stringify(x)) deepEqual x', function (t) { - - for (var k in data) { - var s = ini.stringify(data[k]) - console.log(s, data[k]) - t.deepEqual(ini.parse(s), data[k]) - } - - t.end() -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/fixtures/foo.ini b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/fixtures/foo.ini deleted file mode 100644 index 1d81378..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/fixtures/foo.ini +++ /dev/null @@ -1,47 +0,0 @@ -o = p - - a with spaces = b c - -; wrap in quotes to JSON-decode and preserve spaces -" xa n p " = "\"\r\nyoyoyo\r\r\n" - -; wrap in quotes to get a key with a bracket, not a section. -"[disturbing]" = hey you never know - -; Test arrays -zr[] = deedee -ar[] = one -ar[] = three -; This should be included in the array -ar = this is included - -; Test resetting of a value (and not turn it into an array) -br = cold -br = warm - -; a section -[a] -av = a val -e = { o: p, a: { av: a val, b: { c: { e: "this [value]" } } } } -j = "{ o: "p", a: { av: "a val", b: { c: { e: "this [value]" } } } }" -"[]" = a square? - -; Nested array -cr[] = four -cr[] = eight - -; nested child without middle parent -; should create otherwise-empty a.b -[a.b.c] -e = 1 -j = 2 - -; dots in the section name should be literally interpreted -[x\.y\.z] -x.y.z = xyz - -[x\.y\.z.a\.b\.c] -a.b.c = abc - -; this next one is not a comment! it's escaped! -nocomment = this\; this is not a comment diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/foo.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/foo.js deleted file mode 100644 index 3a05eaf..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/ini/test/foo.js +++ /dev/null @@ -1,71 +0,0 @@ -var i = require("../") - , tap = require("tap") - , test = tap.test - , fs = require("fs") - , path = require("path") - , fixture = path.resolve(__dirname, "./fixtures/foo.ini") - , data = fs.readFileSync(fixture, "utf8") - , d - , expectE = 'o = p\n' - + 'a with spaces = b c\n' - + '" xa n p " = "\\"\\r\\nyoyoyo\\r\\r\\n"\n' - + '"[disturbing]" = hey you never know\n' - + 'zr[] = deedee\n' - + 'ar[] = one\n' - + 'ar[] = three\n' - + 'ar[] = this is included\n' - + 'br = warm\n' - + '\n' - + '[a]\n' - + 'av = a val\n' - + 'e = { o: p, a: ' - + '{ av: a val, b: { c: { e: "this [value]" ' - + '} } } }\nj = "\\"{ o: \\"p\\", a: { av:' - + ' \\"a val\\", b: { c: { e: \\"this [value]' - + '\\" } } } }\\""\n"[]" = a square?\n' - + 'cr[] = four\ncr[] = eight\n\n' - +'[a.b.c]\ne = 1\n' - + 'j = 2\n\n[x\\.y\\.z]\nx.y.z = xyz\n\n' - + '[x\\.y\\.z.a\\.b\\.c]\na.b.c = abc\n' - + 'nocomment = this\\; this is not a comment\n' - , expectD = - { o: 'p', - 'a with spaces': 'b c', - " xa n p ":'"\r\nyoyoyo\r\r\n', - '[disturbing]': 'hey you never know', - 'zr': ['deedee'], - 'ar': ['one', 'three', 'this is included'], - 'br': 'warm', - a: - { av: 'a val', - e: '{ o: p, a: { av: a val, b: { c: { e: "this [value]" } } } }', - j: '"{ o: "p", a: { av: "a val", b: { c: { e: "this [value]" } } } }"', - "[]": "a square?", - cr: ['four', 'eight'], - b: { c: { e: '1', j: '2' } } }, - 'x.y.z': { - 'x.y.z': 'xyz', - 'a.b.c': { - 'a.b.c': 'abc', - 'nocomment': 'this\; this is not a comment' - } - } - } - -test("decode from file", function (t) { - var d = i.decode(data) - t.deepEqual(d, expectD) - t.end() -}) - -test("encode from data", function (t) { - var e = i.encode(expectD) - t.deepEqual(e, expectE) - - var obj = {log: { type:'file', level: {label:'debug', value:10} } } - e = i.encode(obj) - t.notEqual(e.slice(0, 1), '\n', 'Never a blank first line') - t.notEqual(e.slice(-2), '\n\n', 'Never a blank final line') - - t.end() -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/README.md deleted file mode 100644 index f290da8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/README.md +++ /dev/null @@ -1,210 +0,0 @@ -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. When types are ordered, this implies a -preference, and the first type that can be used to properly interpret -the value will be used. - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/bin/nopt.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/bin/nopt.js deleted file mode 100755 index 30e9fdb..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/bin/nopt.js +++ /dev/null @@ -1,51 +0,0 @@ -#!/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 - , clear: Boolean - , config: Boolean - , length: Number - } - , 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" ] - , c: ["--config"] - , l: ["--length"] - } - , 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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/examples/my-program.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/examples/my-program.js deleted file mode 100755 index 142447e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/examples/my-program.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/lib/nopt.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/lib/nopt.js deleted file mode 100644 index 20f3b5b..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/lib/nopt.js +++ /dev/null @@ -1,612 +0,0 @@ -// 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} - Object.defineProperty(data.argv, 'toString', { value: function () { - return this.original.map(JSON.stringify).join(" ") - }, enumerable: false }) - return data -} - -function clean (data, types, typeDefs) { - typeDefs = typeDefs || exports.typeDefs - var remove = {} - , typeDefault = [false, true, null, String, Number, Array] - - 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 - } - var hadEq = false - if (arg.charAt(0) === "-" && arg.length > 1) { - if (arg.indexOf("=") !== -1) { - hadEq = true - 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 = null - 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 - - // allow unknown things to be arrays if specified multiple times. - if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { - if (!Array.isArray(data[arg])) - data[arg] = [data[arg]] - isArray = true - } - - var val - , la = args[i + 1] - - var isBool = typeof no === 'boolean' || - types[arg] === Boolean || - Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || - (typeof types[arg] === 'undefined' && !hadEq) || - (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 it's an exact known option, then don't go any further - if (abbrevs[arg] === arg) - return null - - // if it's an exact known shortopt, same deal - if (shorthands[arg]) { - // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) - shorthands[arg] = shorthands[arg].split(/\s+/) - - return shorthands[arg] - } - - // first check to see if this arg is a set of single-char shorthands - 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 - debug('shorthand 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 it's an arg abbrev, and not a literal shorthand, then prefer the arg - if (abbrevs[arg] && !shorthands[arg]) - return null - - // if it's an abbr for a shorthand, then use that - if (shortAbbr[arg]) - arg = shortAbbr[arg] - - // make it an array, if it's a list of words - 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")} - ,[]] - ,["-cl 1" - ,{config: true, length: 1} - ,[] - ,{config: Boolean, length: Number, clear: Boolean} - ,{c: "--config", l: "--length"}] - ,["--acount bla" - ,{"acount":true} - ,["bla"] - ,{account: Boolean, credentials: Boolean, options: String} - ,{a:"--account", c:"--credentials",o:"--options"}] - ,["--clear" - ,{clear:true} - ,[] - ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean} - ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}] - ,["--file -" - ,{"file":"-"} - ,[] - ,{file:String} - ,{}] - ,["--file -" - ,{"file":true} - ,["-"] - ,{file:Boolean} - ,{}] - ].forEach(function (test) { - var argv = test[0].split(/\s+/) - , opts = test[1] - , rem = test[2] - , actual = nopt(test[3] || types, test[4] || 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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/lib/abbrev.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/lib/abbrev.js deleted file mode 100644 index bee4132..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/lib/abbrev.js +++ /dev/null @@ -1,111 +0,0 @@ - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/package.json deleted file mode 100644 index 55ed011..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/node_modules/abbrev/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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" - }, - "_id": "abbrev@1.0.4", - "_from": "abbrev@1" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/package.json deleted file mode 100644 index 4ca69ce..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/nopt/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "nopt", - "version": "2.1.2", - "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. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\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" - }, - "_id": "nopt@2.1.2", - "_from": "nopt@2" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/README.md deleted file mode 100644 index e833b83..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/once.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/once.js deleted file mode 100644 index effc50a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/once.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = once - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) -}) - -function once (fn) { - var called = false - return function () { - if (called) return - called = true - return fn.apply(this, arguments) - } -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/package.json deleted file mode 100644 index dc36d13..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "once", - "version": "1.1.1", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "readme": "# once\n\nOnly call a function once.\n\n## usage\n\n```javascript\nvar once = require('once')\n\nfunction load (file, cb) {\n cb = once(cb)\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nOr add to the Function.prototype in a responsible way:\n\n```javascript\n// only has to be done once\nrequire('once').proto()\n\nfunction load (file, cb) {\n cb = cb.once()\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nIronically, the prototype feature makes this module twice as\ncomplicated as necessary.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/once/issues" - }, - "_id": "once@1.1.1", - "_from": "once@~1.1.1" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/test/once.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/test/once.js deleted file mode 100644 index f0291a4..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/once/test/once.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tap').test -var once = require('../once.js') - -test('once', function (t) { - var f = 0 - var foo = once(function (g) { - t.equal(f, 0) - f ++ - return f + g + this - }) - for (var i = 0; i < 1E3; i++) { - t.same(f, i === 0 ? 0 : 1) - var g = foo.call(1, 1) - t.same(g, i === 0 ? 3 : undefined) - t.same(f, 1) - } - t.end() -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/LICENSE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/README.md deleted file mode 100644 index 08fd900..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# osenv - -Look up environment settings specific to different operating systems. - -## Usage - -```javascript -var osenv = require('osenv') -var path = osenv.path() -var user = osenv.user() -// etc. - -// Some things are not reliably in the env, and have a fallback command: -var h = osenv.hostname(function (er, hostname) { - h = hostname -}) -// This will still cause it to be memoized, so calling osenv.hostname() -// is now an immediate operation. - -// You can always send a cb, which will get called in the nextTick -// if it's been memoized, or wait for the fallback data if it wasn't -// found in the environment. -osenv.hostname(function (er, hostname) { - if (er) console.error('error looking up hostname') - else console.log('this machine calls itself %s', hostname) -}) -``` - -## osenv.hostname() - -The machine name. Calls `hostname` if not found. - -## osenv.user() - -The currently logged-in user. Calls `whoami` if not found. - -## osenv.prompt() - -Either PS1 on unix, or PROMPT on Windows. - -## osenv.tmpdir() - -The place where temporary files should be created. - -## osenv.home() - -No place like it. - -## osenv.path() - -An array of the places that the operating system will search for -executables. - -## osenv.editor() - -Return the executable name of the editor program. This uses the EDITOR -and VISUAL environment variables, and falls back to `vi` on Unix, or -`notepad.exe` on Windows. - -## osenv.shell() - -The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash' -or 'cmd'. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/osenv.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/osenv.js deleted file mode 100644 index e3367a7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/osenv.js +++ /dev/null @@ -1,80 +0,0 @@ -var isWindows = process.platform === 'win32' -var windir = isWindows ? process.env.windir || 'C:\\Windows' : null -var path = require('path') -var exec = require('child_process').exec - -// looking up envs is a bit costly. -// Also, sometimes we want to have a fallback -// Pass in a callback to wait for the fallback on failures -// After the first lookup, always returns the same thing. -function memo (key, lookup, fallback) { - var fell = false - var falling = false - exports[key] = function (cb) { - var val = lookup() - if (!val && !fell && !falling && fallback) { - fell = true - falling = true - exec(fallback, function (er, output, stderr) { - falling = false - if (er) return // oh well, we tried - val = output.trim() - }) - } - exports[key] = function (cb) { - if (cb) process.nextTick(cb.bind(null, null, val)) - return val - } - if (cb && !falling) process.nextTick(cb.bind(null, null, val)) - return val - } -} - -memo('user', function () { - return ( isWindows - ? process.env.USERDOMAIN + '\\' + process.env.USERNAME - : process.env.USER - ) -}, 'whoami') - -memo('prompt', function () { - return isWindows ? process.env.PROMPT : process.env.PS1 -}) - -memo('hostname', function () { - return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME -}, 'hostname') - -memo('tmpdir', function () { - var t = isWindows ? 'temp' : 'tmp' - return process.env.TMPDIR || - process.env.TMP || - process.env.TEMP || - ( exports.home() ? path.resolve(exports.home(), t) - : isWindows ? path.resolve(windir, t) - : '/tmp' - ) -}) - -memo('home', function () { - return ( isWindows ? process.env.USERPROFILE - : process.env.HOME - ) -}) - -memo('path', function () { - return (process.env.PATH || - process.env.Path || - process.env.path).split(isWindows ? ';' : ':') -}) - -memo('editor', function () { - return process.env.EDITOR || - process.env.VISUAL || - (isWindows ? 'notepad.exe' : 'vi') -}) - -memo('shell', function () { - return isWindows ? process.env.ComSpec || 'cmd' - : process.env.SHELL || 'bash' -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/package.json deleted file mode 100644 index 721c45f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "osenv", - "version": "0.0.3", - "main": "osenv.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.2.5" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/osenv" - }, - "keywords": [ - "environment", - "variable", - "home", - "tmpdir", - "path", - "prompt", - "ps1" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "description": "Look up environment settings specific to different operating systems", - "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/osenv/issues" - }, - "_id": "osenv@0.0.3", - "_from": "osenv@0.0.3" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/test/unix.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/test/unix.js deleted file mode 100644 index b72eb0b..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/test/unix.js +++ /dev/null @@ -1,76 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform === 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip unix tests, this is not unix\n') - return -} -var tap = require('tap') - -// like unix, but funny -process.env.USER = 'sirUser' -process.env.HOME = '/home/sirUser' -process.env.HOSTNAME = 'my-machine' -process.env.TMPDIR = '/tmpdir' -process.env.TMP = '/tmp' -process.env.TEMP = '/temp' -process.env.PATH = '/opt/local/bin:/usr/local/bin:/usr/bin/:bin' -process.env.PS1 = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.SHELL = 'zsh' - - -tap.test('basic unix sanity test', function (t) { - var osenv = require('../osenv.js') - - t.equal(osenv.user(), process.env.USER) - t.equal(osenv.home(), process.env.HOME) - t.equal(osenv.hostname(), process.env.HOSTNAME) - t.same(osenv.path(), process.env.PATH.split(':')) - t.equal(osenv.prompt(), process.env.PS1) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), '/home/sirUser/tmp') - - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), '/tmp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'vi') - - t.equal(osenv.shell(), 'zsh') - process.env.SHELL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'bash') - - t.end() -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/test/windows.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/test/windows.js deleted file mode 100644 index dd3fe80..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/osenv/test/windows.js +++ /dev/null @@ -1,82 +0,0 @@ -// only run this test on windows -// pretending to be another platform is too hacky, since it breaks -// how the underlying system looks up module paths and runs -// child processes, and all that stuff is cached. -if (process.platform !== 'win32') { - console.log('TAP Version 13\n' + - '1..0\n' + - '# Skip windows tests, this is not windows\n') - return -} - -// load this before clubbing the platform name. -var tap = require('tap') - -process.env.windir = 'C:\\windows' -process.env.USERDOMAIN = 'some-domain' -process.env.USERNAME = 'sirUser' -process.env.USERPROFILE = 'C:\\Users\\sirUser' -process.env.COMPUTERNAME = 'my-machine' -process.env.TMPDIR = 'C:\\tmpdir' -process.env.TMP = 'C:\\tmp' -process.env.TEMP = 'C:\\temp' -process.env.Path = 'C:\\Program Files\\;C:\\Binary Stuff\\bin' -process.env.PROMPT = '(o_o) $ ' -process.env.EDITOR = 'edit' -process.env.VISUAL = 'visualedit' -process.env.ComSpec = 'some-com' - -tap.test('basic windows sanity test', function (t) { - var osenv = require('../osenv.js') - - var osenv = require('../osenv.js') - - t.equal(osenv.user(), - process.env.USERDOMAIN + '\\' + process.env.USERNAME) - t.equal(osenv.home(), process.env.USERPROFILE) - t.equal(osenv.hostname(), process.env.COMPUTERNAME) - t.same(osenv.path(), process.env.Path.split(';')) - t.equal(osenv.prompt(), process.env.PROMPT) - t.equal(osenv.tmpdir(), process.env.TMPDIR) - - // mildly evil, but it's for a test. - process.env.TMPDIR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TMP) - - process.env.TMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), process.env.TEMP) - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), 'C:\\Users\\sirUser\\temp') - - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - osenv.home = function () { return null } - t.equal(osenv.tmpdir(), 'C:\\windows\\temp') - - t.equal(osenv.editor(), 'edit') - process.env.EDITOR = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'visualedit') - - process.env.VISUAL = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.editor(), 'notepad.exe') - - t.equal(osenv.shell(), 'some-com') - process.env.ComSpec = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.shell(), 'cmd') - - t.end() -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/README.md deleted file mode 100644 index 2193009..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/README.md +++ /dev/null @@ -1,119 +0,0 @@ -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 -v [-r ] - Test if version(s) satisfy the supplied range(s), - and sort them. - - Multiple versions or ranges may be supplied. - - 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 the following things, in this order: - -* a number (Major) -* a period -* a number (minor) -* a period -* a number (patch) -* OPTIONAL: a hyphen, followed by a number (build) -* OPTIONAL: a collection of pretty much any non-whitespace characters - (tag) - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Comparisons - -The ordering of versions is done using the following algorithm, given -two versions and asked to find the greater of the two: - -* If the majors are numerically different, then take the one - with a bigger major number. `2.3.4 > 1.3.4` -* If the minors are numerically different, then take the one - with the bigger minor number. `2.3.4 > 2.2.4` -* If the patches are numerically different, then take the one with the - bigger patch number. `2.3.4 > 2.3.3` -* If only one of them has a build number, then take the one with the - build number. `2.3.4-0 > 2.3.4` -* If they both have build numbers, and the build numbers are numerically - different, then take the one with the bigger build number. - `2.3.4-10 > 2.3.4-9` -* If only one of them has a tag, then take the one without the tag. - `2.3.4 > 2.3.4-beta` -* If they both have tags, then take the one with the lexicographically - larger tag. `2.3.4-beta > 2.3.4-alpha` -* At this point, they're equal. - -## Ranges - -The following range styles are supported: - -* `>1.2.3` Greater than a specific version. -* `<1.2.3` Less than -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` -* `~1.2.3` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.3.0` -* `~1` := `>=1.0.0 <2.0.0` -* `1.2.x` := `>=1.2.0 <1.3.0` -* `1.x` := `>=1.0.0 <2.0.0` - -Ranges can be joined with either a space (which implies "and") or a -`||` (which implies "or"). - -## Functions - -* 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 build), 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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/bin/semver b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/bin/semver deleted file mode 100755 index d4e637e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/bin/semver +++ /dev/null @@ -1,72 +0,0 @@ -#!/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 = [] - , semver = require("../semver") - -main() - -function main () { - if (!argv.length) return help() - while (argv.length) { - var a - switch (a = argv.shift()) { - case "-v": case "--version": - versions.push(argv.shift()) - 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(semver.valid) - if (!versions.length) return fail() - for (var i = 0, l = range.length; i < l ; i ++) { - versions = versions.filter(function (v) { - return semver.satisfies(v, range[i]) - }) - if (!versions.length) return fail() - } - return success(versions) -} - -function fail () { process.exit(1) } - -function success () { - versions.sort(semver.compare) - .map(semver.clean) - .forEach(function (v,i,_) { console.log(v) }) -} - -function help () { - console.log(["Usage: semver -v [-r ]" - ,"Test if version(s) satisfy the supplied range(s)," - ,"and sort them." - ,"" - ,"Multiple versions or ranges may be supplied." - ,"" - ,"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." - ].join("\n")) -} - - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/package.json deleted file mode 100644 index 1b56568..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "semver", - "version": "1.1.4", - "description": "The semantic version parser used by npm.", - "main": "semver.js", - "scripts": { - "test": "tap test.js" - }, - "devDependencies": { - "tap": "0.x >=0.0.4" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/semver/raw/master/LICENSE" - }, - "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 -v [-r ]\n Test if version(s) satisfy the supplied range(s),\n and sort them.\n\n Multiple versions or ranges may be supplied.\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 the following things, in this order:\n\n* a number (Major)\n* a period\n* a number (minor)\n* a period\n* a number (patch)\n* OPTIONAL: a hyphen, followed by a number (build)\n* OPTIONAL: a collection of pretty much any non-whitespace characters\n (tag)\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Comparisons\n\nThe ordering of versions is done using the following algorithm, given\ntwo versions and asked to find the greater of the two:\n\n* If the majors are numerically different, then take the one\n with a bigger major number. `2.3.4 > 1.3.4`\n* If the minors are numerically different, then take the one\n with the bigger minor number. `2.3.4 > 2.2.4`\n* If the patches are numerically different, then take the one with the\n bigger patch number. `2.3.4 > 2.3.3`\n* If only one of them has a build number, then take the one with the\n build number. `2.3.4-0 > 2.3.4`\n* If they both have build numbers, and the build numbers are numerically\n different, then take the one with the bigger build number.\n `2.3.4-10 > 2.3.4-9`\n* If only one of them has a tag, then take the one without the tag.\n `2.3.4 > 2.3.4-beta`\n* If they both have tags, then take the one with the lexicographically\n larger tag. `2.3.4-beta > 2.3.4-alpha`\n* At this point, they're equal.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3 <1.3.0`\n* `~1.2` := `>=1.2.0 <1.3.0`\n* `~1` := `>=1.0.0 <2.0.0`\n* `1.2.x` := `>=1.2.0 <1.3.0`\n* `1.x` := `>=1.0.0 <2.0.0`\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\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 build), 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" - }, - "_id": "semver@1.1.4", - "_from": "semver@~1.1.0" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/semver.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/semver.js deleted file mode 100644 index cebfe6f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/semver.js +++ /dev/null @@ -1,306 +0,0 @@ -;(function (exports) { // nothing in here is node-specific. - -// See http://semver.org/ -// This implementation is a *hair* less strict in that it allows -// v1.2.3 things, and also tags that don't begin with a char. - -var semver = "\\s*[v=]*\\s*([0-9]+)" // major - + "\\.([0-9]+)" // minor - + "\\.([0-9]+)" // patch - + "(-[0-9]+-?)?" // build - + "([a-zA-Z-+][a-zA-Z0-9-\.:]*)?" // tag - , exprComparator = "^((<|>)?=?)\s*("+semver+")$|^$" - , xRangePlain = "[v=]*([0-9]+|x|X|\\*)" - + "(?:\\.([0-9]+|x|X|\\*)" - + "(?:\\.([0-9]+|x|X|\\*)" - + "([a-zA-Z-][a-zA-Z0-9-\.:]*)?)?)?" - , xRange = "((?:<|>)=?)?\\s*" + xRangePlain - , exprLoneSpermy = "(?:~>?)" - , exprSpermy = exprLoneSpermy + xRange - , expressions = exports.expressions = - { parse : new RegExp("^\\s*"+semver+"\\s*$") - , parsePackage : new RegExp("^\\s*([^\/]+)[-@](" +semver+")\\s*$") - , parseRange : new RegExp( - "^\\s*(" + semver + ")\\s+-\\s+(" + semver + ")\\s*$") - , validComparator : new RegExp("^"+exprComparator+"$") - , parseXRange : new RegExp("^"+xRange+"$") - , parseSpermy : new RegExp("^"+exprSpermy+"$") - } - - -Object.getOwnPropertyNames(expressions).forEach(function (i) { - exports[i] = function (str) { - return ("" + (str || "")).match(expressions[i]) - } -}) - -exports.rangeReplace = ">=$1 <=$7" -exports.clean = clean -exports.compare = compare -exports.rcompare = rcompare -exports.satisfies = satisfies -exports.gt = gt -exports.gte = gte -exports.lt = lt -exports.lte = lte -exports.eq = eq -exports.neq = neq -exports.cmp = cmp -exports.inc = inc - -exports.valid = valid -exports.validPackage = validPackage -exports.validRange = validRange -exports.maxSatisfying = maxSatisfying - -exports.replaceStars = replaceStars -exports.toComparators = toComparators - -function stringify (version) { - var v = version - return [v[1]||'', v[2]||'', v[3]||''].join(".") + (v[4]||'') + (v[5]||'') -} - -function clean (version) { - version = exports.parse(version) - if (!version) return version - return stringify(version) -} - -function valid (version) { - if (typeof version !== "string") return null - return exports.parse(version) && version.trim().replace(/^[v=]+/, '') -} - -function validPackage (version) { - if (typeof version !== "string") return null - return version.match(expressions.parsePackage) && version.trim() -} - -// range can be one of: -// "1.0.3 - 2.0.0" range, inclusive, like ">=1.0.3 <=2.0.0" -// ">1.0.2" like 1.0.3 - 9999.9999.9999 -// ">=1.0.2" like 1.0.2 - 9999.9999.9999 -// "<2.0.0" like 0.0.0 - 1.9999.9999 -// ">1.0.2 <2.0.0" like 1.0.3 - 1.9999.9999 -var starExpression = /(<|>)?=?\s*\*/g - , starReplace = "" - , compTrimExpression = new RegExp("((<|>)?=|<|>)\\s*(" - +semver+"|"+xRangePlain+")", "g") - , compTrimReplace = "$1$3" - -function toComparators (range) { - var ret = (range || "").trim() - .replace(expressions.parseRange, exports.rangeReplace) - .replace(compTrimExpression, compTrimReplace) - .split(/\s+/) - .join(" ") - .split("||") - .map(function (orchunk) { - return orchunk - .replace(new RegExp("(" + exprLoneSpermy + ")\\s+"), "$1") - .split(" ") - .map(replaceXRanges) - .map(replaceSpermies) - .map(replaceStars) - .join(" ").trim() - }) - .map(function (orchunk) { - return orchunk - .trim() - .split(/\s+/) - .filter(function (c) { return c.match(expressions.validComparator) }) - }) - .filter(function (c) { return c.length }) - return ret -} - -function replaceStars (stars) { - return stars.trim().replace(starExpression, starReplace) -} - -// "2.x","2.x.x" --> ">=2.0.0- <2.1.0-" -// "2.3.x" --> ">=2.3.0- <2.4.0-" -function replaceXRanges (ranges) { - return ranges.split(/\s+/) - .map(replaceXRange) - .join(" ") -} - -function replaceXRange (version) { - return version.trim().replace(expressions.parseXRange, - function (v, gtlt, M, m, p, t) { - var anyX = !M || M.toLowerCase() === "x" || M === "*" - || !m || m.toLowerCase() === "x" || m === "*" - || !p || p.toLowerCase() === "x" || p === "*" - , ret = v - - if (gtlt && anyX) { - // just replace x'es with zeroes - ;(!M || M === "*" || M.toLowerCase() === "x") && (M = 0) - ;(!m || m === "*" || m.toLowerCase() === "x") && (m = 0) - ;(!p || p === "*" || p.toLowerCase() === "x") && (p = 0) - ret = gtlt + M+"."+m+"."+p+"-" - } else if (!M || M === "*" || M.toLowerCase() === "x") { - ret = "*" // allow any - } else if (!m || m === "*" || m.toLowerCase() === "x") { - // append "-" onto the version, otherwise - // "1.x.x" matches "2.0.0beta", since the tag - // *lowers* the version value - ret = ">="+M+".0.0- <"+(+M+1)+".0.0-" - } else if (!p || p === "*" || p.toLowerCase() === "x") { - ret = ">="+M+"."+m+".0- <"+M+"."+(+m+1)+".0-" - } - return ret - }) -} - -// ~, ~> --> * (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 replaceSpermies (version) { - return version.trim().replace(expressions.parseSpermy, - function (v, gtlt, M, m, p, t) { - if (gtlt) throw new Error( - "Using '"+gtlt+"' with ~ makes no sense. Don't do it.") - - if (!M || M.toLowerCase() === "x") { - return "" - } - // ~1 == >=1.0.0- <2.0.0- - if (!m || m.toLowerCase() === "x") { - return ">="+M+".0.0- <"+(+M+1)+".0.0-" - } - // ~1.2 == >=1.2.0- <1.3.0- - if (!p || p.toLowerCase() === "x") { - return ">="+M+"."+m+".0- <"+M+"."+(+m+1)+".0-" - } - // ~1.2.3 == >=1.2.3- <1.3.0- - t = t || "-" - return ">="+M+"."+m+"."+p+t+" <"+M+"."+(+m+1)+".0-" - }) -} - -function validRange (range) { - range = replaceStars(range) - var c = toComparators(range) - return (c.length === 0) - ? null - : c.map(function (c) { return c.join(" ") }).join("||") -} - -// returns the highest satisfying version in the list, or undefined -function maxSatisfying (versions, range) { - return versions - .filter(function (v) { return satisfies(v, range) }) - .sort(compare) - .pop() -} -function satisfies (version, range) { - version = valid(version) - if (!version) return false - range = toComparators(range) - for (var i = 0, l = range.length ; i < l ; i ++) { - var ok = false - for (var j = 0, ll = range[i].length ; j < ll ; j ++) { - var r = range[i][j] - , gtlt = r.charAt(0) === ">" ? gt - : r.charAt(0) === "<" ? lt - : false - , eq = r.charAt(!!gtlt) === "=" - , sub = (!!eq) + (!!gtlt) - if (!gtlt) eq = true - r = r.substr(sub) - r = (r === "") ? r : valid(r) - ok = (r === "") || (eq && r === version) || (gtlt && gtlt(version, r)) - if (!ok) break - } - if (ok) return true - } - return false -} - -// return v1 > v2 ? 1 : -1 -function compare (v1, v2) { - var g = gt(v1, v2) - return g === null ? 0 : g ? 1 : -1 -} - -function rcompare (v1, v2) { - return compare(v2, v1) -} - -function lt (v1, v2) { return gt(v2, v1) } -function gte (v1, v2) { return !lt(v1, v2) } -function lte (v1, v2) { return !gt(v1, v2) } -function eq (v1, v2) { return gt(v1, v2) === null } -function neq (v1, v2) { return gt(v1, v2) !== null } -function cmp (v1, c, v2) { - switch (c) { - case ">": return gt(v1, v2) - case "<": return lt(v1, v2) - case ">=": return gte(v1, v2) - case "<=": return lte(v1, v2) - case "==": return eq(v1, v2) - case "!=": return neq(v1, v2) - case "===": return v1 === v2 - case "!==": return v1 !== v2 - default: throw new Error("Y U NO USE VALID COMPARATOR!? "+c) - } -} - -// return v1 > v2 -function num (v) { - return v === undefined ? -1 : parseInt((v||"0").replace(/[^0-9]+/g, ''), 10) -} -function gt (v1, v2) { - v1 = exports.parse(v1) - v2 = exports.parse(v2) - if (!v1 || !v2) return false - - for (var i = 1; i < 5; i ++) { - v1[i] = num(v1[i]) - v2[i] = num(v2[i]) - if (v1[i] > v2[i]) return true - else if (v1[i] !== v2[i]) return false - } - // no tag is > than any tag, or use lexicographical order. - var tag1 = v1[5] || "" - , tag2 = v2[5] || "" - - // kludge: null means they were equal. falsey, and detectable. - // embarrassingly overclever, though, I know. - return tag1 === tag2 ? null - : !tag1 ? true - : !tag2 ? false - : tag1 > tag2 -} - -function inc (version, release) { - version = exports.parse(version) - if (!version) return null - - var parsedIndexLookup = - { 'major': 1 - , 'minor': 2 - , 'patch': 3 - , 'build': 4 } - var incIndex = parsedIndexLookup[release] - if (incIndex === undefined) return null - - var current = num(version[incIndex]) - version[incIndex] = current === -1 ? 1 : current + 1 - - for (var i = incIndex + 1; i < 5; i ++) { - if (num(version[i]) !== -1) version[i] = "0" - } - - if (version[4]) version[4] = "-" + version[4] - version[5] = "" - - return stringify(version) -} -})(typeof exports === "object" ? exports : semver = {}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/test.js deleted file mode 100644 index 475b77b..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/node_modules/semver/test.js +++ /dev/null @@ -1,436 +0,0 @@ -var tap = require("tap") - , test = tap.test - , semver = require("./semver.js") - , eq = semver.eq - , gt = semver.gt - , lt = semver.lt - , neq = semver.neq - , cmp = semver.cmp - , gte = semver.gte - , lte = semver.lte - , satisfies = semver.satisfies - , validRange = semver.validRange - , inc = semver.inc - , replaceStars = semver.replaceStars - , toComparators = semver.toComparators - -tap.plan(8) - -test("\ncomparison tests", function (t) { -// [version1, version2] -// version1 should be greater than version2 -; [ ["0.0.0", "0.0.0foo"] - , ["0.0.1", "0.0.0"] - , ["1.0.0", "0.9.9"] - , ["0.10.0", "0.9.0"] - , ["0.99.0", "0.10.0"] - , ["2.0.0", "1.2.3"] - , ["v0.0.0", "0.0.0foo"] - , ["v0.0.1", "0.0.0"] - , ["v1.0.0", "0.9.9"] - , ["v0.10.0", "0.9.0"] - , ["v0.99.0", "0.10.0"] - , ["v2.0.0", "1.2.3"] - , ["0.0.0", "v0.0.0foo"] - , ["0.0.1", "v0.0.0"] - , ["1.0.0", "v0.9.9"] - , ["0.10.0", "v0.9.0"] - , ["0.99.0", "v0.10.0"] - , ["2.0.0", "v1.2.3"] - , ["1.2.3", "1.2.3-asdf"] - , ["1.2.3-4", "1.2.3"] - , ["1.2.3-4-foo", "1.2.3"] - , ["1.2.3-5", "1.2.3-5-foo"] - , ["1.2.3-5", "1.2.3-4"] - , ["1.2.3-5-foo", "1.2.3-5-Foo"] - , ["3.0.0", "2.7.2+"] - ].forEach(function (v) { - var v0 = v[0] - , v1 = v[1] - t.ok(gt(v0, v1), "gt('"+v0+"', '"+v1+"')") - t.ok(lt(v1, v0), "lt('"+v1+"', '"+v0+"')") - t.ok(!gt(v1, v0), "!gt('"+v1+"', '"+v0+"')") - t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')") - t.ok(eq(v0, v0), "eq('"+v0+"', '"+v0+"')") - t.ok(eq(v1, v1), "eq('"+v1+"', '"+v1+"')") - t.ok(neq(v0, v1), "neq('"+v0+"', '"+v1+"')") - t.ok(cmp(v1, "==", v1), "cmp('"+v1+"' == '"+v1+"')") - t.ok(cmp(v0, ">=", v1), "cmp('"+v0+"' >= '"+v1+"')") - t.ok(cmp(v1, "<=", v0), "cmp('"+v1+"' <= '"+v0+"')") - t.ok(cmp(v0, "!=", v1), "cmp('"+v0+"' != '"+v1+"')") - }) - t.end() -}) - -test("\nequality tests", function (t) { -// [version1, version2] -// version1 should be equivalent to version2 -; [ ["1.2.3", "v1.2.3"] - , ["1.2.3", "=1.2.3"] - , ["1.2.3", "v 1.2.3"] - , ["1.2.3", "= 1.2.3"] - , ["1.2.3", " v1.2.3"] - , ["1.2.3", " =1.2.3"] - , ["1.2.3", " v 1.2.3"] - , ["1.2.3", " = 1.2.3"] - , ["1.2.3-0", "v1.2.3-0"] - , ["1.2.3-0", "=1.2.3-0"] - , ["1.2.3-0", "v 1.2.3-0"] - , ["1.2.3-0", "= 1.2.3-0"] - , ["1.2.3-0", " v1.2.3-0"] - , ["1.2.3-0", " =1.2.3-0"] - , ["1.2.3-0", " v 1.2.3-0"] - , ["1.2.3-0", " = 1.2.3-0"] - , ["1.2.3-01", "v1.2.3-1"] - , ["1.2.3-01", "=1.2.3-1"] - , ["1.2.3-01", "v 1.2.3-1"] - , ["1.2.3-01", "= 1.2.3-1"] - , ["1.2.3-01", " v1.2.3-1"] - , ["1.2.3-01", " =1.2.3-1"] - , ["1.2.3-01", " v 1.2.3-1"] - , ["1.2.3-01", " = 1.2.3-1"] - , ["1.2.3beta", "v1.2.3beta"] - , ["1.2.3beta", "=1.2.3beta"] - , ["1.2.3beta", "v 1.2.3beta"] - , ["1.2.3beta", "= 1.2.3beta"] - , ["1.2.3beta", " v1.2.3beta"] - , ["1.2.3beta", " =1.2.3beta"] - , ["1.2.3beta", " v 1.2.3beta"] - , ["1.2.3beta", " = 1.2.3beta"] - ].forEach(function (v) { - var v0 = v[0] - , v1 = v[1] - t.ok(eq(v0, v1), "eq('"+v0+"', '"+v1+"')") - t.ok(!neq(v0, v1), "!neq('"+v0+"', '"+v1+"')") - t.ok(cmp(v0, "==", v1), "cmp("+v0+"=="+v1+")") - t.ok(!cmp(v0, "!=", v1), "!cmp("+v0+"!="+v1+")") - t.ok(!cmp(v0, "===", v1), "!cmp("+v0+"==="+v1+")") - t.ok(cmp(v0, "!==", v1), "cmp("+v0+"!=="+v1+")") - t.ok(!gt(v0, v1), "!gt('"+v0+"', '"+v1+"')") - t.ok(gte(v0, v1), "gte('"+v0+"', '"+v1+"')") - t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')") - t.ok(lte(v0, v1), "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"] - , [">=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"] - , [">=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"] - , ["~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'] - ].forEach(function (v) { - t.ok(satisfies(v[1], v[0]), v[0]+" satisfied by "+v[1]) - }) - 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"] - , [">=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"] - , ["~v0.5.4-beta", "0.5.4-alpha"] - , ["<1", "1.0.0beta"] - , ["< 1", "1.0.0beta"] - , ["=0.7.x", "0.8.2"] - , [">=0.7.x", "0.6.2"] - , ["<=0.7.x", "0.7.2"] - ].forEach(function (v) { - t.ok(!satisfies(v[1], v[0]), v[0]+" not satisfied by "+v[1]) - }) - 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.3", "build", "1.2.3-1" ] - , [ "1.2.3-4", "build", "1.2.3-5" ] - , [ "1.2.3tag", "major", "2.0.0" ] - , [ "1.2.3-tag", "major", "2.0.0" ] - , [ "1.2.3tag", "build", "1.2.3-1" ] - , [ "1.2.3-tag", "build", "1.2.3-1" ] - , [ "1.2.3-4-tag", "build", "1.2.3-5" ] - , [ "1.2.3-4tag", "build", "1.2.3-5" ] - , [ "1.2.3", "fake", null ] - , [ "fake", "major", null ] - ].forEach(function (v) { - t.equal(inc(v[0], v[1]), v[2], "inc("+v[0]+", "+v[1]+") === "+v[2]) - }) - - t.end() -}) - -test("\nreplace stars test", function (t) { -// replace stars with "" -; [ [ "", "" ] - , [ "*", "" ] - , [ "> *", "" ] - , [ "<*", "" ] - , [ " >= *", "" ] - , [ "* || 1.2.3", " || 1.2.3" ] - ].forEach(function (v) { - t.equal(replaceStars(v[0]), v[1], "replaceStars("+v[0]+") === "+v[1]) - }) - - 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"] - , [">=*", ""] - , ["", ""] - , ["*", ""] - , ["*", ""] - , [">=1.0.0", ">=1.0.0"] - , [">1.0.0", ">1.0.0"] - , ["<=2.0.0", "<=2.0.0"] - , ["1", ">=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", "<2.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"] - , ["< 2.0.0", "<2.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.2.3 || <0.0.1", ">=0.2.3||<0.0.1"] - , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"] - , ["||", "||"] - , ["2.x.x", ">=2.0.0- <3.0.0-"] - , ["1.2.x", ">=1.2.0- <1.3.0-"] - , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"] - , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"] - , ["x", ""] - , ["2.*.*", null] - , ["1.2.*", null] - , ["1.2.* || 2.*", null] - , ["1.2.* || 2.*", null] - , ["*", ""] - , ["2", ">=2.0.0- <3.0.0-"] - , ["2.3", ">=2.3.0- <2.4.0-"] - , ["~2.4", ">=2.4.0- <2.5.0-"] - , ["~2.4", ">=2.4.0- <2.5.0-"] - , ["~>3.2.1", ">=3.2.1- <3.3.0-"] - , ["~1", ">=1.0.0- <2.0.0-"] - , ["~>1", ">=1.0.0- <2.0.0-"] - , ["~> 1", ">=1.0.0- <2.0.0-"] - , ["~1.0", ">=1.0.0- <1.1.0-"] - , ["~ 1.0", ">=1.0.0- <1.1.0-"] - , ["<1", "<1.0.0-"] - , ["< 1", "<1.0.0-"] - , [">=1", ">=1.0.0-"] - , [">= 1", ">=1.0.0-"] - , ["<1.2", "<1.2.0-"] - , ["< 1.2", "<1.2.0-"] - , ["1", ">=1.0.0- <2.0.0-"] - ].forEach(function (v) { - t.equal(validRange(v[0]), v[1], "validRange("+v[0]+") === "+v[1]) - }) - - 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-"]] ] - , ["", [[""]]] - , ["*", [[""]] ] - , ["*", [[""]] ] - , [">=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-", "<2.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"]] ] - , [">= 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"]] ] - , ["<\t2.0.0", [["<2.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.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ] - , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ] - , ["||", [[""], [""]] ] - , ["2.x.x", [[">=2.0.0-", "<3.0.0-"]] ] - , ["1.2.x", [[">=1.2.0-", "<1.3.0-"]] ] - , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ] - , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ] - , ["x", [[""]] ] - , ["2.*.*", [[">=2.0.0-", "<3.0.0-"]] ] - , ["1.2.*", [[">=1.2.0-", "<1.3.0-"]] ] - , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ] - , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ] - , ["*", [[""]] ] - , ["2", [[">=2.0.0-", "<3.0.0-"]] ] - , ["2.3", [[">=2.3.0-", "<2.4.0-"]] ] - , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ] - , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ] - , ["~>3.2.1", [[">=3.2.1-", "<3.3.0-"]] ] - , ["~1", [[">=1.0.0-", "<2.0.0-"]] ] - , ["~>1", [[">=1.0.0-", "<2.0.0-"]] ] - , ["~> 1", [[">=1.0.0-", "<2.0.0-"]] ] - , ["~1.0", [[">=1.0.0-", "<1.1.0-"]] ] - , ["~ 1.0", [[">=1.0.0-", "<1.1.0-"]] ] - , ["~ 1.0.3", [[">=1.0.3-", "<1.1.0-"]] ] - , ["~> 1.0.3", [[">=1.0.3-", "<1.1.0-"]] ] - , ["<1", [["<1.0.0-"]] ] - , ["< 1", [["<1.0.0-"]] ] - , [">=1", [[">=1.0.0-"]] ] - , [">= 1", [[">=1.0.0-"]] ] - , ["<1.2", [["<1.2.0-"]] ] - , ["< 1.2", [["<1.2.0-"]] ] - , ["1", [[">=1.0.0-", "<2.0.0-"]] ] - , ["1 2", [[">=1.0.0-", "<2.0.0-", ">=2.0.0-", "<3.0.0-"]] ] - ].forEach(function (v) { - t.equivalent(toComparators(v[0]), v[1], "toComparators("+v[0]+") === "+JSON.stringify(v[1])) - }) - - t.end() -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/npmconf.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/npmconf.js deleted file mode 100644 index 46ff2b8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/npmconf.js +++ /dev/null @@ -1,338 +0,0 @@ - -var CC = require('config-chain').ConfigChain -var inherits = require('inherits') -var configDefs = require('./config-defs.js') -var types = configDefs.types -var once = require('once') -var fs = require('fs') -var path = require('path') -var nopt = require('nopt') -var ini = require('ini') -var Octal = configDefs.Octal -var mkdirp = require('mkdirp') - -exports.load = load -exports.Conf = Conf -exports.loaded = false -exports.rootConf = null -exports.usingBuiltin = false -exports.defs = configDefs -Object.defineProperty(exports, 'defaults', { get: function () { - return configDefs.defaults -}, enumerable: true }) -Object.defineProperty(exports, 'types', { get: function () { - return configDefs.types -}, enumerable: true }) - -exports.validate = validate - -var myUid = process.env.SUDO_UID !== undefined - ? process.env.SUDO_UID : (process.getuid && process.getuid()) -var myGid = process.env.SUDO_GID !== undefined - ? process.env.SUDO_GID : (process.getgid && process.getgid()) - - -var loading = false -var loadCbs = [] -function load (cli_, builtin_, cb_) { - var cli, builtin, cb - for (var i = 0; i < arguments.length; i++) - switch (typeof arguments[i]) { - case 'string': builtin = arguments[i]; break - case 'object': cli = arguments[i]; break - case 'function': cb = arguments[i]; break - } - - if (!cb) - cb = function () {} - - if (exports.loaded) { - var ret = exports.loaded - if (cli) { - ret = new Conf(ret) - ret.unshift(cli) - } - return process.nextTick(cb.bind(null, null, ret)) - } - - // either a fresh object, or a clone of the passed in obj - if (!cli) - cli = {} - else - cli = Object.keys(cli).reduce(function (c, k) { - c[k] = cli[k] - return c - }, {}) - - loadCbs.push(cb) - if (loading) - return - loading = true - - cb = once(function (er, conf) { - if (!er) - exports.loaded = conf - loadCbs.forEach(function (fn) { - fn(er, conf) - }) - loadCbs.length = 0 - }) - - // check for a builtin if provided. - exports.usingBuiltin = !!builtin - var rc = exports.rootConf = new Conf() - var defaults = configDefs.defaults - if (builtin) - rc.addFile(builtin, 'builtin') - else - rc.add({}, 'builtin') - - rc.on('load', function () { - var conf = new Conf(rc) - conf.usingBuiltin = !!builtin - conf.add(cli, 'cli') - conf.addEnv() - conf.addFile(conf.get('userconfig'), 'user') - conf.once('error', cb) - conf.once('load', function () { - // globalconfig and globalignorefile defaults - // need to respond to the "prefix" setting up to this point. - // Eg, `npm config get globalconfig --prefix ~/local` should - // return `~/local/etc/npmrc` - // annoying humans and their expectations! - if (conf.get('prefix')) { - var etc = path.resolve(conf.get("prefix"), "etc") - defaults.globalconfig = path.resolve(etc, "npmrc") - defaults.globalignorefile = path.resolve(etc, "npmignore") - } - conf.addFile(conf.get('globalconfig'), 'global') - - // move the builtin into the conf stack now. - conf.root = defaults - conf.add(rc.shift(), 'builtin') - conf.once('load', function () { - // warn about invalid bits. - validate(conf) - exports.loaded = conf - cb(null, conf) - }) - }) - }) -} - - -// Basically the same as CC, but: -// 1. Always ini -// 2. Parses environment variable names in field values -// 3. Field values that start with ~/ are replaced with process.env.HOME -// 4. Can inherit from another Conf object, using it as the base. -inherits(Conf, CC) -function Conf (base) { - if (!(this instanceof Conf)) - return new Conf(base) - - CC.apply(this) - - if (base) - if (base instanceof Conf) - this.root = base.list[0] || base.root - else - this.root = base - else - this.root = configDefs.defaults -} - -Conf.prototype.save = function (where, cb) { - var target = this.sources[where] - if (!target || !(target.path || target.source) || !target.data) { - if (where !== 'builtin') - var er = new Error('bad save target: '+where) - if (cb) { - process.nextTick(cb.bind(null, er)) - return this - } - return this.emit('error', er) - } - - if (target.source) { - var pref = target.prefix || '' - Object.keys(target.data).forEach(function (k) { - target.source[pref + k] = target.data[k] - }) - if (cb) process.nextTick(cb) - return this - } - - var data = target.data - - if (typeof data._password === 'string' && - typeof data.username === 'string') { - var auth = data.username + ':' + data._password - data = Object.keys(data).reduce(function (c, k) { - if (k === 'username' || k === '_password') - return c - c[k] = data[k] - return c - }, { _auth: new Buffer(auth, 'utf8').toString('base64') }) - delete data.username - delete data._password - } - - data = ini.stringify(data) - - then = then.bind(this) - done = done.bind(this) - this._saving ++ - - var mode = where === 'user' ? 0600 : 0666 - if (!data.trim()) - fs.unlink(target.path, done) - else { - mkdirp(path.dirname(target.path), function (er) { - if (er) - return then(er) - fs.writeFile(target.path, data, 'utf8', function (er) { - if (er) - return then(er) - if (where === 'user' && myUid && myGid) - fs.chown(target.path, +myUid, +myGid, then) - else - then() - }) - }) - } - - function then (er) { - if (er) - return done(er) - fs.chmod(target.path, mode, done) - } - - function done (er) { - if (er) { - if (cb) return cb(er) - else return this.emit('error', er) - } - this._saving -- - if (this._saving === 0) { - if (cb) cb() - this.emit('save') - } - } - - return this -} - -Conf.prototype.addFile = function (file, name) { - name = name || file - var marker = {__source__:name} - this.sources[name] = { path: file, type: 'ini' } - this.push(marker) - this._await() - fs.readFile(file, 'utf8', function (er, data) { - if (er) // just ignore missing files. - return this.add({}, marker) - this.addString(data, file, 'ini', marker) - }.bind(this)) - return this -} - -// always ini files. -Conf.prototype.parse = function (content, file) { - return CC.prototype.parse.call(this, content, file, 'ini') -} - -Conf.prototype.add = function (data, marker) { - Object.keys(data).forEach(function (k) { - data[k] = parseField(data[k], k) - }) - if (Object.prototype.hasOwnProperty.call(data, '_auth')) { - var auth = new Buffer(data._auth, 'base64').toString('utf8').split(':') - var username = auth.shift() - var password = auth.join(':') - data.username = username - data._password = password - } - return CC.prototype.add.call(this, data, marker) -} - -Conf.prototype.addEnv = function (env) { - env = env || process.env - var conf = {} - Object.keys(env) - .filter(function (k) { return k.match(/^npm_config_[^_]/i) }) - .forEach(function (k) { - if (!env[k]) - return - - conf[k.replace(/^npm_config_/i, '') - .toLowerCase() - .replace(/_/g, '-')] = env[k] - }) - return CC.prototype.addEnv.call(this, '', conf, 'env') -} - -function parseField (f, k, emptyIsFalse) { - if (typeof f !== 'string' && !(f instanceof String)) - return f - - // type can be an array or single thing. - var typeList = [].concat(types[k]) - var isPath = -1 !== typeList.indexOf(path) - var isBool = -1 !== typeList.indexOf(Boolean) - var isString = -1 !== typeList.indexOf(String) - var isOctal = -1 !== typeList.indexOf(Octal) - var isNumber = isOctal || (-1 !== typeList.indexOf(Number)) - - f = (''+f).trim() - - if (f.match(/^".*"$/)) - f = JSON.parse(f) - - if (isBool && !isString && f === '') - return true - - switch (f) { - case 'true': return true - case 'false': return false - case 'null': return null - case 'undefined': return undefined - } - - f = envReplace(f) - - if (isPath) { - var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\// - if (f.match(homePattern) && process.env.HOME) { - f = path.resolve(process.env.HOME, f.substr(2)) - } - f = path.resolve(f) - } - - if (isNumber && !isNaN(f)) - f = isOctal ? parseInt(f, 8) : +f - - return f -} - -function envReplace (f) { - if (typeof f !== "string" || !f) return f - - // replace any ${ENV} values with the appropriate environ. - var envExpr = /(\\*)\$\{([^}]+)\}/g - return f.replace(envExpr, function (orig, esc, name, i, s) { - esc = esc.length && esc.length % 2 - if (esc) - return orig - if (undefined === process.env[name]) - throw new Error("Failed to replace env in config: "+orig) - return process.env[name] - }) -} - -function validate (cl) { - // warn about invalid configs at every level. - cl.list.forEach(function (conf, level) { - nopt.clean(conf, configDefs.types) - }) -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/package.json deleted file mode 100644 index 74bf860..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "npmconf", - "version": "0.0.24", - "description": "The config thing npm uses", - "main": "npmconf.js", - "directories": { - "test": "test" - }, - "dependencies": { - "config-chain": "~1.1.1", - "inherits": "~1.0.0", - "once": "~1.1.1", - "mkdirp": "~0.3.3", - "osenv": "0.0.3", - "nopt": "2", - "semver": "~1.1.0", - "ini": "~1.1.0" - }, - "devDependencies": {}, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/npmconf" - }, - "keywords": [ - "npm", - "config", - "config-chain", - "conf", - "ini" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "license": "BSD", - "readme": "# npmconf\n\nThe config thing npm uses\n\nIf you are interested in interacting with the config settings that npm\nuses, then use this module.\n\nHowever, if you are writing a new Node.js program, and want\nconfiguration functionality similar to what npm has, but for your\nown thing, then I'd recommend using [rc](https://github.com/dominictarr/rc),\nwhich is probably what you want.\n\nIf I were to do it all over again, that's what I'd do for npm. But,\nalas, there are many systems depending on many of the particulars of\nnpm's configuration setup, so it's not worth the cost of changing.\n\n## USAGE\n\n```javascript\nvar npmconf = require('npmconf')\n\n// pass in the cli options that you read from the cli\n// or whatever top-level configs you want npm to use for now.\nnpmconf.load({some:'configs'}, function (er, conf) {\n // do stuff with conf\n conf.get('some', 'cli') // 'configs'\n conf.get('username') // 'joebobwhatevers'\n conf.set('foo', 'bar', 'user')\n conf.save('user', function (er) {\n // foo = bar is now saved to ~/.npmrc or wherever\n })\n})\n```\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/npmconf/issues" - }, - "_id": "npmconf@0.0.24", - "_from": "npmconf@0.0.24" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/00-setup.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/00-setup.js deleted file mode 100644 index 79cbbb1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/00-setup.js +++ /dev/null @@ -1,27 +0,0 @@ -var path = require('path') -var userconfigSrc = path.resolve(__dirname, 'fixtures', 'userconfig') -exports.userconfig = userconfigSrc + '-with-gc' -exports.globalconfig = path.resolve(__dirname, 'fixtures', 'globalconfig') -exports.builtin = path.resolve(__dirname, 'fixtures', 'builtin') - -// set the userconfig in the env -// unset anything else that npm might be trying to foist on us -Object.keys(process.env).forEach(function (k) { - if (k.match(/^npm_config_/i)) { - delete process.env[k] - } -}) -process.env.npm_config_userconfig = exports.userconfig -process.env.npm_config_other_env_thing = 1000 -process.env.random_env_var = 'asdf' - -if (module === require.main) { - // set the globalconfig in the userconfig - var fs = require('fs') - var uc = fs.readFileSync(userconfigSrc) - var gcini = 'globalconfig = ' + exports.globalconfig + '\n' - fs.writeFileSync(exports.userconfig, gcini + uc) - - console.log('0..1') - console.log('ok 1 setup done') -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/basic.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/basic.js deleted file mode 100644 index 5f276f1..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/basic.js +++ /dev/null @@ -1,73 +0,0 @@ -var test = require('tap').test -var npmconf = require('../npmconf.js') -var common = require('./00-setup.js') - -var ucData = - { globalconfig: common.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'proprietary-attribs': false, - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': process.env.HOME + '/.tmp', - username : "username", - _password : "password", - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - -var envData = { userconfig: common.userconfig, 'other-env-thing': '1000' } - -var gcData = { 'package-config:foo': 'boo' } - -var biData = {} - -var cli = { foo: 'bar', umask: 022 } - -var expectList = -[ cli, - envData, - ucData, - gcData, - biData ] - -var expectSources = -{ cli: { data: cli }, - env: - { data: envData, - source: envData, - prefix: '' }, - user: - { path: common.userconfig, - type: 'ini', - data: ucData }, - global: - { path: common.globalconfig, - type: 'ini', - data: gcData }, - builtin: { data: biData } } - -test('no builtin', function (t) { - npmconf.load(cli, function (er, conf) { - if (er) throw er - t.same(conf.list, expectList) - t.same(conf.sources, expectSources) - t.same(npmconf.rootConf.list, []) - t.equal(npmconf.rootConf.root, npmconf.defs.defaults) - t.equal(conf.root, npmconf.defs.defaults) - t.equal(conf.get('umask'), 022) - t.end() - }) -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/builtin.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/builtin.js deleted file mode 100644 index 8142594..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/builtin.js +++ /dev/null @@ -1,72 +0,0 @@ -var test = require('tap').test -var npmconf = require('../npmconf.js') -var common = require('./00-setup.js') - -var ucData = - { globalconfig: common.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'proprietary-attribs': false, - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': process.env.HOME + '/.tmp', - username : "username", - _password : "password", - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - -var envData = { userconfig: common.userconfig, 'other-env-thing': '1000' } - -var gcData = { 'package-config:foo': 'boo' } - -var biData = { 'builtin-config': true } - -var cli = { foo: 'bar' } - -var expectList = -[ cli, - envData, - ucData, - gcData, - biData ] - -var expectSources = -{ cli: { data: cli }, - env: - { data: envData, - source: envData, - prefix: '' }, - user: - { path: common.userconfig, - type: 'ini', - data: ucData }, - global: - { path: common.globalconfig, - type: 'ini', - data: gcData }, - builtin: { data: biData } } - -test('with builtin', function (t) { - npmconf.load(cli, common.builtin, function (er, conf) { - if (er) throw er - t.same(conf.list, expectList) - t.same(conf.sources, expectSources) - t.same(npmconf.rootConf.list, []) - t.equal(npmconf.rootConf.root, npmconf.defs.defaults) - t.equal(conf.root, npmconf.defs.defaults) - t.end() - }) -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/builtin b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/builtin deleted file mode 100644 index dcd542c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/builtin +++ /dev/null @@ -1 +0,0 @@ -builtin-config = true diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/globalconfig b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/globalconfig deleted file mode 100644 index 41c0b70..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/globalconfig +++ /dev/null @@ -1 +0,0 @@ -package-config:foo = boo diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/userconfig b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/userconfig deleted file mode 100644 index bda1eb8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/fixtures/userconfig +++ /dev/null @@ -1,22 +0,0 @@ -email = i@izs.me -env-thing = ${random_env_var} -init.author.name = Isaac Z. Schlueter -init.author.email = i@izs.me -init.author.url = http://blog.izs.me/ -proprietary-attribs = false -npm:publishtest = true -_npmjs.org:couch = https://admin:password@localhost:5984/registry -_auth = dXNlcm5hbWU6cGFzc3dvcmQ= -npm-www:nocache = 1 -nodedir = /Users/isaacs/dev/js/node-v0.8 -sign-git-tag = true -message = v%s -strict-ssl = false -tmp = ~/.tmp - -[_token] -AuthSession = yabba-dabba-doodle -version = 1 -expires = 1345001053415 -path = / -httponly = true diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/save.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/save.js deleted file mode 100644 index 05230cd..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/npmconf/test/save.js +++ /dev/null @@ -1,74 +0,0 @@ -var test = require('tap').test -var npmconf = require('../npmconf.js') -var common = require('./00-setup.js') -var fs = require('fs') -var ini = require('ini') -var expectConf = - [ 'globalconfig = ' + common.globalconfig, - 'email = i@izs.me', - 'env-thing = asdf', - 'init.author.name = Isaac Z. Schlueter', - 'init.author.email = i@izs.me', - 'init.author.url = http://blog.izs.me/', - 'proprietary-attribs = false', - 'npm:publishtest = true', - '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache = 1', - 'sign-git-tag = false', - 'message = v%s', - 'strict-ssl = false', - 'username = username', - '_password = password', - '', - '[_token]', - 'AuthSession = yabba-dabba-doodle', - 'version = 1', - 'expires = 1345001053415', - 'path = /', - 'httponly = true', - '' ].join('\n') -var expectFile = - [ 'globalconfig = ' + common.globalconfig, - 'email = i@izs.me', - 'env-thing = asdf', - 'init.author.name = Isaac Z. Schlueter', - 'init.author.email = i@izs.me', - 'init.author.url = http://blog.izs.me/', - 'proprietary-attribs = false', - 'npm:publishtest = true', - '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache = 1', - 'sign-git-tag = false', - 'message = v%s', - 'strict-ssl = false', - '', - '[_token]', - 'AuthSession = yabba-dabba-doodle', - 'version = 1', - 'expires = 1345001053415', - 'path = /', - 'httponly = true', - '' ].join('\n') - -test('saving configs', function (t) { - npmconf.load(function (er, conf) { - if (er) - throw er - conf.set('sign-git-tag', false, 'user') - conf.del('nodedir') - conf.del('tmp') - var foundConf = ini.stringify(conf.sources.user.data) - t.same(ini.parse(foundConf), ini.parse(expectConf)) - fs.unlinkSync(common.userconfig) - conf.save('user', function (er) { - if (er) - throw er - var uc = fs.readFileSync(conf.get('userconfig'), 'utf8') - t.same(ini.parse(uc), ini.parse(expectFile)) - t.end() - }) - }) -}) - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/AUTHORS b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 7d2e681..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index be9951e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,312 +0,0 @@ -// 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 = require("fs") - -// there is such a thing as TOO graceful. -if (fs.open === gracefulOpen) return - -var queue = [] - , constants = require("constants") - -exports = module.exports = fs -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync - - -// 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 ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.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 - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) -} - - -// (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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index c539680..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "fs monkey-patching to avoid EMFILE and other problems", - "version": "1.1.14", - "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", - "EMFILE", - "error", - "handling", - "monkeypatch" - ], - "license": "BSD", - "readme": "Just like node's `fs` module, but it does an incremental back-off when\nEMFILE is encountered.\n\nUseful in asynchronous situations where one needs to try to open lots\nand lots of files.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@1.1.14", - "_from": "graceful-fs@~1.1" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index d05f880..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/package.json deleted file mode 100644 index e5441be..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "rimraf", - "version": "2.0.3", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~1.1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~1.1" - }, - "_id": "rimraf@2.0.3", - "_from": "rimraf@~2.0.2" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/rimraf.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/rimraf.js deleted file mode 100644 index 95b2de8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,161 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} - -var lstat = "lstat" -if (process.platform === "win32") { - // not reliable on windows prior to 0.7.9 - var v = process.version.replace(/^v/, '').split(/\.|-/).map(Number) - if (v[0] === 0 && (v[1] < 7 || v[1] == 7 && v[2] < 9)) { - lstat = "stat" - } -} -if (!fs[lstat]) lstat = "stat" -var lstatSync = lstat + "Sync" - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -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 (er.code === "EBUSY" && 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) - }) -} - -function rimraf_ (p, cb) { - fs[lstat](p, function (er, s) { - if (er) { - // already gone - if (er.code === "ENOENT") return cb() - // some other kind of error, permissions, etc. - return cb(er) - } - - return rm_(p, s, false, cb) - }) -} - - -var myGid = function myGid () { - var g = process.getgid && process.getgid() - myGid = function myGid () { return g } - return g -} - -var myUid = function myUid () { - var u = process.getuid && process.getuid() - myUid = function myUid () { return u } - return u -} - - -function writable (s) { - var mode = s.mode || 0777 - , uid = myUid() - , gid = myGid() - return (mode & 0002) - || (gid === s.gid && (mode & 0020)) - || (uid === s.uid && (mode & 0200)) -} - -function rm_ (p, s, didWritableCheck, cb) { - if (!didWritableCheck && !writable(s)) { - // make file writable - // user/group/world, doesn't matter at this point - // since it's about to get nuked. - return fs.chmod(p, s.mode | 0222, function (er) { - if (er) return cb(er) - rm_(p, s, true, cb) - }) - } - - if (!s.isDirectory()) { - return fs.unlink(p, cb) - } - - // directory - fs.readdir(p, function (er, files) { - if (er) return cb(er) - asyncForEach(files.map(function (f) { - return path.join(p, f) - }), function (file, cb) { - rimraf(file, cb) - }, function (er) { - if (er) return cb(er) - fs.rmdir(p, cb) - }) - }) -} - -function asyncForEach (list, fn, cb) { - if (!list.length) cb() - var c = list.length - , errState = null - list.forEach(function (item, i, list) { - fn(item, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- c === 0) return cb() - }) - }) -} - -// this looks simpler, but it will fail with big directory trees, -// or on slow stupid awful cygwin filesystems -function rimrafSync (p) { - try { - var s = fs[lstatSync](p) - } catch (er) { - if (er.code === "ENOENT") return - throw er - } - - if (!writable(s)) { - fs.chmodSync(p, s.mode | 0222) - } - - if (!s.isDirectory()) return fs.unlinkSync(p) - - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/run.sh b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/setup.sh b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/test-async.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/test-fiber.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/test-fiber.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/test-sync.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/README.md deleted file mode 100644 index ff1eb53..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/README.md +++ /dev/null @@ -1,5 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/bin/which b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/bin/which deleted file mode 100755 index 8432ce2..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/bin/which +++ /dev/null @@ -1,14 +0,0 @@ -#!/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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/package.json deleted file mode 100644 index 9458b87..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "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" - }, - "_id": "which@1.0.5", - "_from": "which@~1.0.5", - "scripts": {} -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/which.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/which.js deleted file mode 100644 index db7e8f7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/which/which.js +++ /dev/null @@ -1,104 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/package.json deleted file mode 100644 index 518f035..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "phantomjs", - "version": "1.9.2-2", - "keywords": [ - "phantomjs", - "headless", - "webkit" - ], - "description": "Headless WebKit with JS API", - "homepage": "https://github.com/Obvious/phantomjs", - "repository": { - "type": "git", - "url": "git://github.com/Obvious/phantomjs.git" - }, - "licenses": [ - { - "type": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - } - ], - "author": { - "name": "Dan Pupius", - "email": "dan@obvious.com", - "url": "http://pupius.co.uk" - }, - "maintainers": [ - { - "name": "Dan Pupius", - "email": "dan@obvious.com", - "url": "http://pupius.co.uk/" - } - ], - "main": "lib/phantomjs", - "bin": { - "phantomjs": "./bin/phantomjs" - }, - "scripts": { - "install": "node install.js", - "test": "nodeunit --reporter=minimal test/tests.js" - }, - "dependencies": { - "adm-zip": "0.2.1", - "kew": "~0.1.7", - "ncp": "0.4.2", - "npmconf": "0.0.24", - "mkdirp": "0.3.5", - "rimraf": "~2.0.2", - "which": "~1.0.5" - }, - "devDependencies": { - "nodeunit": "~0.7.4" - }, - "readme": "phantom\n=======\n\nAn NPM wrapper for [PhantomJS](http://phantomjs.org/), headless webkit with JS API.\n\nBuilding and Installing\n-----------------------\n\n```shell\nnpm install phantomjs\n```\n\nOr grab the source and\n\n```shell\nnode ./install.js\n```\n\nWhat this is really doing is just grabbing a particular \"blessed\" (by\nthis module) version of Phantom. As new versions of Phantom are released\nand vetted, this module will be updated accordingly.\n\nThe package has been set up to fetch and run Phantom for MacOS (darwin),\nLinux based platforms (as identified by nodejs), and -- as of version 0.2.0 --\nWindows (thanks to [Domenic Denicola](https://github.com/domenic)). If you\nspot any platform weirdnesses, let us know or send a patch.\n\nRunning\n-------\n\n```shell\nbin/phantom [phantom arguments]\n```\n\nAnd npm will install a link to the binary in `node_modules/.bin` as\nit is wont to do.\n\nRunning via node\n----------------\n\nThe package exports a `path` string that contains the path to the\nphantomjs binary/executable.\n\nBelow is an example of using this package via node.\n\n```javascript\nvar childProcess = require('child_process')\nvar phantomjs = require('phantomjs')\nvar binPath = phantomjs.path\n\nvar childArgs = [\n path.join(__dirname, 'phantomjs-script.js'),\n 'some other argument (passed to phantomjs script)'\n]\n\nchildProcess.execFile(binPath, childArgs, function(err, stdout, stderr) {\n // handle results\n})\n\n```\n\nVersioning\n----------\n\nThe NPM package version tracks the version of PhantomJS that will be installed,\nwith an additional build number that is used for revisions to the installer.\n\nAs such `1.8.0-1` will `1.8.0-2` will both install PhantomJs 1.8 but the latter\nhas newer changes to the installer.\n\nA Note on PhantomJS\n-------------------\n\nPhantomJS is not a library for NodeJS. It's a separate environment and code\nwritten for node is unlikely to be compatible. In particular PhantomJS does\nnot expose a Common JS package loader.\n\nThis is an _NPM wrapper_ and can be used to conveniently make Phantom available\nIt is not a Node JS wrapper.\n\nI have had reasonable experiences writing standalone Phantom scripts which I\nthen drive from within a node program by spawning phantom in a child process.\n\nRead the PhantomJS FAQ for more details: http://phantomjs.org/faq.html\n\n### Linux Note\n\nAn extra note on Linux usage, from the PhantomJS download page:\n\n > This package is built on CentOS 5.8. It should run successfully on Lucid or\n > more modern systems (including other distributions). There is no requirement\n > to install Qt, WebKit, or any other libraries. It is however expected that\n > some base libraries necessary for rendering (FreeType, Fontconfig) and the\n > basic font files are available in the system.\n\nContributing\n------------\n\nQuestions, comments, bug reports, and pull requests are all welcome. Submit them at\n[the project on GitHub](https://github.com/Obvious/phantomjs/). If you haven't contributed to an\n[Obvious](http://github.com/Obvious/) project before please head over to the\n[Open Source Project](https://github.com/Obvious/open-source#note-to-external-contributors) and fill\nout an OCLA (it should be pretty painless).\n\nBug reports that include steps-to-reproduce (including code) are the\nbest. Even better, make them in the form of pull requests.\n\nAuthor\n------\n\n[Dan Pupius](https://github.com/dpup)\n([personal website](http://pupius.co.uk)), supported by\n[The Obvious Corporation](http://obvious.com/).\n\nLicense\n-------\n\nCopyright 2012 [The Obvious Corporation](http://obvious.com/).\n\nLicensed under the Apache License, Version 2.0.\nSee the top-level file `LICENSE.txt` and\n(http://www.apache.org/licenses/LICENSE-2.0).\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/Obvious/phantomjs/issues" - }, - "_id": "phantomjs@1.9.2-2", - "_from": "phantomjs@~1.9.0-1" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/test/loadspeed.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/test/loadspeed.js deleted file mode 100644 index 8fc5436..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/test/loadspeed.js +++ /dev/null @@ -1,25 +0,0 @@ -// phantomjs test script -// opens url and reports time to load -// requires an active internet connection -var page = require('webpage').create() -var system = require('system') -var t -var address - -if (system.args.length === 1) { - console.log('Usage: loadspeed.js ') - phantom.exit() -} - -t = Date.now() -address = system.args[1] -page.open(address, function (status) { - if (status !== 'success') { - console.log('FAIL to load the address') - } else { - t = Date.now() - t - console.log('Loading time ' + t + ' msec') - } - - phantom.exit() -}) \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/test/tests.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/test/tests.js deleted file mode 100644 index bfba187..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/test/tests.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Nodeunit functional tests. Requires internet connection to validate phantom - * functions correctly. - */ - -var childProcess = require('child_process') -var fs = require('fs') -var path = require('path') -var phantomjs = require('../lib/phantomjs') - - -exports.testDownload = function (test) { - test.expect(1) - test.ok(fs.existsSync(phantomjs.path), 'Binary file should have been downloaded') - test.done() -} - - -exports.testPhantomExecutesTestScript = function (test) { - test.expect(1) - - var childArgs = [ - path.join(__dirname, 'loadspeed.js'), - 'http://www.google.com/' - ] - - childProcess.execFile(phantomjs.path, childArgs, function (err, stdout, stderr) { - var value = (stdout.indexOf('msec') !== -1) - test.ok(value, 'Test script should have executed and returned run time') - test.done() - }) -} - - -exports.testBinFile = function (test) { - test.expect(1) - - var binPath = process.platform === 'win32' ? - path.join(__dirname, '..', 'lib', 'phantom', 'phantomjs.exe') : - path.join(__dirname, '..', 'bin', 'phantomjs') - - childProcess.execFile(binPath, ['--version'], function (err, stdout, stderr) { - test.equal(phantomjs.version, stdout.trim(), 'Version should be match') - test.done() - }) -} - - -exports.testCleanPath = function (test) { - test.expect(5) - test.equal('/Users/dan/bin', phantomjs.cleanPath('/Users/dan/bin:./bin')) - test.equal('/Users/dan/bin:/usr/bin', phantomjs.cleanPath('/Users/dan/bin:./bin:/usr/bin')) - test.equal('/usr/bin', phantomjs.cleanPath('./bin:/usr/bin')) - test.equal('', phantomjs.cleanPath('./bin')) - test.equal('/Work/bin:/usr/bin', phantomjs.cleanPath('/Work/bin:/Work/phantomjs/node_modules/.bin:/usr/bin')) - test.done() -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/LICENSE b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/README.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/README.md deleted file mode 100644 index 6fa37a3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/README.md +++ /dev/null @@ -1,119 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Usage - - $ npm install semver - - semver.valid('1.2.3') // true - semver.valid('a.b.c') // false - 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 -v [-r ] - Test if version(s) satisfy the supplied range(s), - and sort them. - - Multiple versions or ranges may be supplied. - - 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 the following things, in this order: - -* a number (Major) -* a period -* a number (minor) -* a period -* a number (patch) -* OPTIONAL: a hyphen, followed by a number (build) -* OPTIONAL: a collection of pretty much any non-whitespace characters - (tag) - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Comparisons - -The ordering of versions is done using the following algorithm, given -two versions and asked to find the greater of the two: - -* If the majors are numerically different, then take the one - with a bigger major number. `2.3.4 > 1.3.4` -* If the minors are numerically different, then take the one - with the bigger minor number. `2.3.4 > 2.2.4` -* If the patches are numerically different, then take the one with the - bigger patch number. `2.3.4 > 2.3.3` -* If only one of them has a build number, then take the one with the - build number. `2.3.4-0 > 2.3.4` -* If they both have build numbers, and the build numbers are numerically - different, then take the one with the bigger build number. - `2.3.4-10 > 2.3.4-9` -* If only one of them has a tag, then take the one without the tag. - `2.3.4 > 2.3.4-beta` -* If they both have tags, then take the one with the lexicographically - larger tag. `2.3.4-beta > 2.3.4-alpha` -* At this point, they're equal. - -## Ranges - -The following range styles are supported: - -* `>1.2.3` Greater than a specific version. -* `<1.2.3` Less than -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` -* `~1.2.3` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <2.0.0` -* `~1` := `>=1.0.0 <2.0.0` -* `1.2.x` := `>=1.2.0 <1.3.0` -* `1.x` := `>=1.0.0 <2.0.0` - -Ranges can be joined with either a space (which implies "and") or a -`||` (which implies "or"). - -## Functions - -* 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 build), 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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/bin/semver b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/bin/semver deleted file mode 100755 index 3e6afb4..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/bin/semver +++ /dev/null @@ -1,71 +0,0 @@ -#!/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 = [] - , semver = require("../semver") - -main() - -function main () { - if (!argv.length) return help() - while (argv.length) { - var a - switch (a = argv.shift()) { - case "-v": case "--version": - versions.push(argv.shift()) - 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(semver.valid) - for (var i = 0, l = range.length; i < l ; i ++) { - versions = versions.filter(function (v) { - return semver.satisfies(v, range[i]) - }) - if (!versions.length) return fail() - } - return success(versions) -} - -function fail () { process.exit(1) } - -function success () { - versions.sort(semver.compare) - .map(semver.clean) - .forEach(function (v,i,_) { console.log(v) }) -} - -function help () { - console.log(["Usage: semver -v [-r ]" - ,"Test if version(s) satisfy the supplied range(s)," - ,"and sort them." - ,"" - ,"Multiple versions or ranges may be supplied." - ,"" - ,"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." - ].join("\n")) -} - - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/package.json deleted file mode 100644 index 6166a7a..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "semver", - "version": "1.0.14", - "description": "The semantic version parser used by npm.", - "main": "semver.js", - "scripts": { - "test": "tap test.js" - }, - "devDependencies": { - "tap": "0.x >=0.0.4" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/semver/raw/master/LICENSE" - }, - "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') // true\n semver.valid('a.b.c') // false\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 -v [-r ]\n Test if version(s) satisfy the supplied range(s),\n and sort them.\n\n Multiple versions or ranges may be supplied.\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 the following things, in this order:\n\n* a number (Major)\n* a period\n* a number (minor)\n* a period\n* a number (patch)\n* OPTIONAL: a hyphen, followed by a number (build)\n* OPTIONAL: a collection of pretty much any non-whitespace characters\n (tag)\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Comparisons\n\nThe ordering of versions is done using the following algorithm, given\ntwo versions and asked to find the greater of the two:\n\n* If the majors are numerically different, then take the one\n with a bigger major number. `2.3.4 > 1.3.4`\n* If the minors are numerically different, then take the one\n with the bigger minor number. `2.3.4 > 2.2.4`\n* If the patches are numerically different, then take the one with the\n bigger patch number. `2.3.4 > 2.3.3`\n* If only one of them has a build number, then take the one with the\n build number. `2.3.4-0 > 2.3.4`\n* If they both have build numbers, and the build numbers are numerically\n different, then take the one with the bigger build number.\n `2.3.4-10 > 2.3.4-9`\n* If only one of them has a tag, then take the one without the tag.\n `2.3.4 > 2.3.4-beta`\n* If they both have tags, then take the one with the lexicographically\n larger tag. `2.3.4-beta > 2.3.4-alpha`\n* At this point, they're equal.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3 <1.3.0`\n* `~1.2` := `>=1.2.0 <2.0.0`\n* `~1` := `>=1.0.0 <2.0.0`\n* `1.2.x` := `>=1.2.0 <1.3.0`\n* `1.x` := `>=1.0.0 <2.0.0`\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\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 build), 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" - }, - "_id": "semver@1.0.14", - "_from": "semver@~1.0.14" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/semver.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/semver.js deleted file mode 100644 index 8090e0c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/semver.js +++ /dev/null @@ -1,305 +0,0 @@ -;(function (exports) { // nothing in here is node-specific. - -// See http://semver.org/ -// This implementation is a *hair* less strict in that it allows -// v1.2.3 things, and also tags that don't begin with a char. - -var semver = "\\s*[v=]*\\s*([0-9]+)" // major - + "\\.([0-9]+)" // minor - + "\\.([0-9]+)" // patch - + "(-[0-9]+-?)?" // build - + "([a-zA-Z-][a-zA-Z0-9-\.:]*)?" // tag - , exprComparator = "^((<|>)?=?)\s*("+semver+")$|^$" - , xRangePlain = "[v=]*([0-9]+|x|X|\\*)" - + "(?:\\.([0-9]+|x|X|\\*)" - + "(?:\\.([0-9]+|x|X|\\*)" - + "([a-zA-Z-][a-zA-Z0-9-\.:]*)?)?)?" - , xRange = "((?:<|>)=?)?\\s*" + xRangePlain - , exprSpermy = "(?:~>?)"+xRange - , expressions = exports.expressions = - { parse : new RegExp("^\\s*"+semver+"\\s*$") - , parsePackage : new RegExp("^\\s*([^\/]+)[-@](" +semver+")\\s*$") - , parseRange : new RegExp( - "^\\s*(" + semver + ")\\s+-\\s+(" + semver + ")\\s*$") - , validComparator : new RegExp("^"+exprComparator+"$") - , parseXRange : new RegExp("^"+xRange+"$") - , parseSpermy : new RegExp("^"+exprSpermy+"$") - } - - -Object.getOwnPropertyNames(expressions).forEach(function (i) { - exports[i] = function (str) { - return ("" + (str || "")).match(expressions[i]) - } -}) - -exports.rangeReplace = ">=$1 <=$7" -exports.clean = clean -exports.compare = compare -exports.rcompare = rcompare -exports.satisfies = satisfies -exports.gt = gt -exports.gte = gte -exports.lt = lt -exports.lte = lte -exports.eq = eq -exports.neq = neq -exports.cmp = cmp -exports.inc = inc - -exports.valid = valid -exports.validPackage = validPackage -exports.validRange = validRange -exports.maxSatisfying = maxSatisfying - -exports.replaceStars = replaceStars -exports.toComparators = toComparators - -function stringify (version) { - var v = version - return [v[1]||'', v[2]||'', v[3]||''].join(".") + (v[4]||'') + (v[5]||'') -} - -function clean (version) { - version = exports.parse(version) - if (!version) return version - return stringify(version) -} - -function valid (version) { - if (typeof version !== "string") return null - return exports.parse(version) && version.trim().replace(/^[v=]+/, '') -} - -function validPackage (version) { - if (typeof version !== "string") return null - return version.match(expressions.parsePackage) && version.trim() -} - -// range can be one of: -// "1.0.3 - 2.0.0" range, inclusive, like ">=1.0.3 <=2.0.0" -// ">1.0.2" like 1.0.3 - 9999.9999.9999 -// ">=1.0.2" like 1.0.2 - 9999.9999.9999 -// "<2.0.0" like 0.0.0 - 1.9999.9999 -// ">1.0.2 <2.0.0" like 1.0.3 - 1.9999.9999 -var starExpression = /(<|>)?=?\s*\*/g - , starReplace = "" - , compTrimExpression = new RegExp("((<|>)?=?)\\s*(" - +semver+"|"+xRangePlain+")", "g") - , compTrimReplace = "$1$3" - -function toComparators (range) { - var ret = (range || "").trim() - .replace(expressions.parseRange, exports.rangeReplace) - .replace(compTrimExpression, compTrimReplace) - .split(/\s+/) - .join(" ") - .split("||") - .map(function (orchunk) { - return orchunk - .split(" ") - .map(replaceXRanges) - .map(replaceSpermies) - .map(replaceStars) - .join(" ").trim() - }) - .map(function (orchunk) { - return orchunk - .trim() - .split(/\s+/) - .filter(function (c) { return c.match(expressions.validComparator) }) - }) - .filter(function (c) { return c.length }) - return ret -} - -function replaceStars (stars) { - return stars.trim().replace(starExpression, starReplace) -} - -// "2.x","2.x.x" --> ">=2.0.0- <2.1.0-" -// "2.3.x" --> ">=2.3.0- <2.4.0-" -function replaceXRanges (ranges) { - return ranges.split(/\s+/) - .map(replaceXRange) - .join(" ") -} - -function replaceXRange (version) { - return version.trim().replace(expressions.parseXRange, - function (v, gtlt, M, m, p, t) { - var anyX = !M || M.toLowerCase() === "x" || M === "*" - || !m || m.toLowerCase() === "x" || m === "*" - || !p || p.toLowerCase() === "x" || p === "*" - , ret = v - - if (gtlt && anyX) { - // just replace x'es with zeroes - ;(!M || M === "*" || M.toLowerCase() === "x") && (M = 0) - ;(!m || m === "*" || m.toLowerCase() === "x") && (m = 0) - ;(!p || p === "*" || p.toLowerCase() === "x") && (p = 0) - ret = gtlt + M+"."+m+"."+p+"-" - } else if (!M || M === "*" || M.toLowerCase() === "x") { - ret = "*" // allow any - } else if (!m || m === "*" || m.toLowerCase() === "x") { - // append "-" onto the version, otherwise - // "1.x.x" matches "2.0.0beta", since the tag - // *lowers* the version value - ret = ">="+M+".0.0- <"+(+M+1)+".0.0-" - } else if (!p || p === "*" || p.toLowerCase() === "x") { - ret = ">="+M+"."+m+".0- <"+M+"."+(+m+1)+".0-" - } - //console.error("parseXRange", [].slice.call(arguments), ret) - return ret - }) -} - -// ~, ~> --> * (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 replaceSpermies (version) { - return version.trim().replace(expressions.parseSpermy, - function (v, gtlt, M, m, p, t) { - if (gtlt) throw new Error( - "Using '"+gtlt+"' with ~ makes no sense. Don't do it.") - - if (!M || M.toLowerCase() === "x") { - return "" - } - // ~1 == >=1.0.0- <2.0.0- - if (!m || m.toLowerCase() === "x") { - return ">="+M+".0.0- <"+(+M+1)+".0.0-" - } - // ~1.2 == >=1.2.0- <1.3.0- - if (!p || p.toLowerCase() === "x") { - return ">="+M+"."+m+".0- <"+M+"."+(+m+1)+".0-" - } - // ~1.2.3 == >=1.2.3- <1.3.0- - t = t || "-" - return ">="+M+"."+m+"."+p+t+" <"+M+"."+(+m+1)+".0-" - }) -} - -function validRange (range) { - range = replaceStars(range) - var c = toComparators(range) - return (c.length === 0) - ? null - : c.map(function (c) { return c.join(" ") }).join("||") -} - -// returns the highest satisfying version in the list, or undefined -function maxSatisfying (versions, range) { - return versions - .filter(function (v) { return satisfies(v, range) }) - .sort(compare) - .pop() -} -function satisfies (version, range) { - version = valid(version) - if (!version) return false - range = toComparators(range) - for (var i = 0, l = range.length ; i < l ; i ++) { - var ok = false - for (var j = 0, ll = range[i].length ; j < ll ; j ++) { - var r = range[i][j] - , gtlt = r.charAt(0) === ">" ? gt - : r.charAt(0) === "<" ? lt - : false - , eq = r.charAt(!!gtlt) === "=" - , sub = (!!eq) + (!!gtlt) - if (!gtlt) eq = true - r = r.substr(sub) - r = (r === "") ? r : valid(r) - ok = (r === "") || (eq && r === version) || (gtlt && gtlt(version, r)) - if (!ok) break - } - if (ok) return true - } - return false -} - -// return v1 > v2 ? 1 : -1 -function compare (v1, v2) { - var g = gt(v1, v2) - return g === null ? 0 : g ? 1 : -1 -} - -function rcompare (v1, v2) { - return compare(v2, v1) -} - -function lt (v1, v2) { return gt(v2, v1) } -function gte (v1, v2) { return !lt(v1, v2) } -function lte (v1, v2) { return !gt(v1, v2) } -function eq (v1, v2) { return gt(v1, v2) === null } -function neq (v1, v2) { return gt(v1, v2) !== null } -function cmp (v1, c, v2) { - switch (c) { - case ">": return gt(v1, v2) - case "<": return lt(v1, v2) - case ">=": return gte(v1, v2) - case "<=": return lte(v1, v2) - case "==": return eq(v1, v2) - case "!=": return neq(v1, v2) - case "===": return v1 === v2 - case "!==": return v1 !== v2 - default: throw new Error("Y U NO USE VALID COMPARATOR!? "+c) - } -} - -// return v1 > v2 -function num (v) { - return v === undefined ? -1 : parseInt((v||"0").replace(/[^0-9]+/g, ''), 10) -} -function gt (v1, v2) { - v1 = exports.parse(v1) - v2 = exports.parse(v2) - if (!v1 || !v2) return false - - for (var i = 1; i < 5; i ++) { - v1[i] = num(v1[i]) - v2[i] = num(v2[i]) - if (v1[i] > v2[i]) return true - else if (v1[i] !== v2[i]) return false - } - // no tag is > than any tag, or use lexicographical order. - var tag1 = v1[5] || "" - , tag2 = v2[5] || "" - - // kludge: null means they were equal. falsey, and detectable. - // embarrassingly overclever, though, I know. - return tag1 === tag2 ? null - : !tag1 ? true - : !tag2 ? false - : tag1 > tag2 -} - -function inc (version, release) { - version = exports.parse(version) - if (!version) return null - - var parsedIndexLookup = - { 'major': 1 - , 'minor': 2 - , 'patch': 3 - , 'build': 4 } - var incIndex = parsedIndexLookup[release] - if (incIndex === undefined) return null - - var current = num(version[incIndex]) - version[incIndex] = current === -1 ? 1 : current + 1 - - for (var i = incIndex + 1; i < 5; i ++) { - if (num(version[i]) !== -1) version[i] = "0" - } - - if (version[4]) version[4] = "-" + version[4] - version[5] = "" - - return stringify(version) -} -})(typeof exports === "object" ? exports : semver = {}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/test.js deleted file mode 100644 index 65ff8a9..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/semver/test.js +++ /dev/null @@ -1,405 +0,0 @@ -var tap = require("tap") - , test = tap.test - , semver = require("./semver.js") - , eq = semver.eq - , gt = semver.gt - , lt = semver.lt - , neq = semver.neq - , cmp = semver.cmp - , gte = semver.gte - , lte = semver.lte - , satisfies = semver.satisfies - , validRange = semver.validRange - , inc = semver.inc - , replaceStars = semver.replaceStars - , toComparators = semver.toComparators - -tap.plan(8) - -test("\ncomparison tests", function (t) { -; [ ["0.0.0", "0.0.0foo"] - , ["0.0.1", "0.0.0"] - , ["1.0.0", "0.9.9"] - , ["0.10.0", "0.9.0"] - , ["0.99.0", "0.10.0"] - , ["2.0.0", "1.2.3"] - , ["v0.0.0", "0.0.0foo"] - , ["v0.0.1", "0.0.0"] - , ["v1.0.0", "0.9.9"] - , ["v0.10.0", "0.9.0"] - , ["v0.99.0", "0.10.0"] - , ["v2.0.0", "1.2.3"] - , ["0.0.0", "v0.0.0foo"] - , ["0.0.1", "v0.0.0"] - , ["1.0.0", "v0.9.9"] - , ["0.10.0", "v0.9.0"] - , ["0.99.0", "v0.10.0"] - , ["2.0.0", "v1.2.3"] - , ["1.2.3", "1.2.3-asdf"] - , ["1.2.3-4", "1.2.3"] - , ["1.2.3-4-foo", "1.2.3"] - , ["1.2.3-5", "1.2.3-5-foo"] - , ["1.2.3-5", "1.2.3-4"] - , ["1.2.3-5-foo", "1.2.3-5-Foo"] - ].forEach(function (v) { - var v0 = v[0] - , v1 = v[1] - t.ok(gt(v0, v1), "gt('"+v0+"', '"+v1+"')") - t.ok(lt(v1, v0), "lt('"+v1+"', '"+v0+"')") - t.ok(!gt(v1, v0), "!gt('"+v1+"', '"+v0+"')") - t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')") - t.ok(eq(v0, v0), "eq('"+v0+"', '"+v0+"')") - t.ok(eq(v1, v1), "eq('"+v1+"', '"+v1+"')") - t.ok(neq(v0, v1), "neq('"+v0+"', '"+v1+"')") - t.ok(cmp(v1, "==", v1), "cmp('"+v1+"' == '"+v1+"')") - t.ok(cmp(v0, ">=", v1), "cmp('"+v0+"' >= '"+v1+"')") - t.ok(cmp(v1, "<=", v0), "cmp('"+v1+"' <= '"+v0+"')") - t.ok(cmp(v0, "!=", v1), "cmp('"+v0+"' != '"+v1+"')") - }) - t.end() -}) - -test("\nequality tests", function (t) { -; [ ["1.2.3", "v1.2.3"] - , ["1.2.3", "=1.2.3"] - , ["1.2.3", "v 1.2.3"] - , ["1.2.3", "= 1.2.3"] - , ["1.2.3", " v1.2.3"] - , ["1.2.3", " =1.2.3"] - , ["1.2.3", " v 1.2.3"] - , ["1.2.3", " = 1.2.3"] - , ["1.2.3-0", "v1.2.3-0"] - , ["1.2.3-0", "=1.2.3-0"] - , ["1.2.3-0", "v 1.2.3-0"] - , ["1.2.3-0", "= 1.2.3-0"] - , ["1.2.3-0", " v1.2.3-0"] - , ["1.2.3-0", " =1.2.3-0"] - , ["1.2.3-0", " v 1.2.3-0"] - , ["1.2.3-0", " = 1.2.3-0"] - , ["1.2.3-01", "v1.2.3-1"] - , ["1.2.3-01", "=1.2.3-1"] - , ["1.2.3-01", "v 1.2.3-1"] - , ["1.2.3-01", "= 1.2.3-1"] - , ["1.2.3-01", " v1.2.3-1"] - , ["1.2.3-01", " =1.2.3-1"] - , ["1.2.3-01", " v 1.2.3-1"] - , ["1.2.3-01", " = 1.2.3-1"] - , ["1.2.3beta", "v1.2.3beta"] - , ["1.2.3beta", "=1.2.3beta"] - , ["1.2.3beta", "v 1.2.3beta"] - , ["1.2.3beta", "= 1.2.3beta"] - , ["1.2.3beta", " v1.2.3beta"] - , ["1.2.3beta", " =1.2.3beta"] - , ["1.2.3beta", " v 1.2.3beta"] - , ["1.2.3beta", " = 1.2.3beta"] - ].forEach(function (v) { - var v0 = v[0] - , v1 = v[1] - t.ok(eq(v0, v1), "eq('"+v0+"', '"+v1+"')") - t.ok(!neq(v0, v1), "!neq('"+v0+"', '"+v1+"')") - t.ok(cmp(v0, "==", v1), "cmp("+v0+"=="+v1+")") - t.ok(!cmp(v0, "!=", v1), "!cmp("+v0+"!="+v1+")") - t.ok(!cmp(v0, "===", v1), "!cmp("+v0+"==="+v1+")") - t.ok(cmp(v0, "!==", v1), "cmp("+v0+"!=="+v1+")") - t.ok(!gt(v0, v1), "!gt('"+v0+"', '"+v1+"')") - t.ok(gte(v0, v1), "gte('"+v0+"', '"+v1+"')") - t.ok(!lt(v0, v1), "!lt('"+v0+"', '"+v1+"')") - t.ok(lte(v0, v1), "lte('"+v0+"', '"+v1+"')") - }) - t.end() -}) - - -test("\nrange tests", function (t) { -; [ ["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"] - , [">=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"] - , [">=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", "1.0.0"] - , [">= 1", "1.0.0"] - , ["<1.2", "1.1.1"] - , ["< 1.2", "1.1.1"] - , ["1", "1.0.0beta"] - , ["~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"] - ].forEach(function (v) { - t.ok(satisfies(v[1], v[0]), v[0]+" satisfied by "+v[1]) - }) - t.end() -}) - -test("\nnegative range tests", function (t) { -; [ ["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"] - , [">=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"] - , ["~v0.5.4-beta", "0.5.4-alpha"] - , ["<1", "1.0.0beta"] - , ["< 1", "1.0.0beta"] - , ["=0.7.x", "0.8.2"] - , [">=0.7.x", "0.6.2"] - , ["<=0.7.x", "0.7.2"] - ].forEach(function (v) { - t.ok(!satisfies(v[1], v[0]), v[0]+" not satisfied by "+v[1]) - }) - t.end() -}) - -test("\nincrement versions test", function (t) { -; [ [ "1.2.3", "major", "2.0.0" ] - , [ "1.2.3", "minor", "1.3.0" ] - , [ "1.2.3", "patch", "1.2.4" ] - , [ "1.2.3", "build", "1.2.3-1" ] - , [ "1.2.3-4", "build", "1.2.3-5" ] - , [ "1.2.3tag", "major", "2.0.0" ] - , [ "1.2.3-tag", "major", "2.0.0" ] - , [ "1.2.3tag", "build", "1.2.3-1" ] - , [ "1.2.3-tag", "build", "1.2.3-1" ] - , [ "1.2.3-4-tag", "build", "1.2.3-5" ] - , [ "1.2.3-4tag", "build", "1.2.3-5" ] - , [ "1.2.3", "fake", null ] - , [ "fake", "major", null ] - ].forEach(function (v) { - t.equal(inc(v[0], v[1]), v[2], "inc("+v[0]+", "+v[1]+") === "+v[2]) - }) - - t.end() -}) - -test("\nreplace stars test", function (t) { -; [ [ "", "" ] - , [ "*", "" ] - , [ "> *", "" ] - , [ "<*", "" ] - , [ " >= *", "" ] - , [ "* || 1.2.3", " || 1.2.3" ] - ].forEach(function (v) { - t.equal(replaceStars(v[0]), v[1], "replaceStars("+v[0]+") === "+v[1]) - }) - - t.end() -}) - -test("\nvalid range test", function (t) { -; [ ["1.0.0 - 2.0.0", ">=1.0.0 <=2.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- <2.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"] - , [">= 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"] - , ["< 2.0.0", "<2.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.2.3 || <0.0.1", ">=0.2.3||<0.0.1"] - , [">=0.2.3 || <0.0.1", ">=0.2.3||<0.0.1"] - , ["||", "||"] - , ["2.x.x", ">=2.0.0- <3.0.0-"] - , ["1.2.x", ">=1.2.0- <1.3.0-"] - , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"] - , ["1.2.x || 2.x", ">=1.2.0- <1.3.0-||>=2.0.0- <3.0.0-"] - , ["x", ""] - , ["2.*.*", null] - , ["1.2.*", null] - , ["1.2.* || 2.*", null] - , ["1.2.* || 2.*", null] - , ["*", ""] - , ["2", ">=2.0.0- <3.0.0-"] - , ["2.3", ">=2.3.0- <2.4.0-"] - , ["~2.4", ">=2.4.0- <2.5.0-"] - , ["~2.4", ">=2.4.0- <2.5.0-"] - , ["~>3.2.1", ">=3.2.1- <3.3.0-"] - , ["~1", ">=1.0.0- <2.0.0-"] - , ["~>1", ">=1.0.0- <2.0.0-"] - , ["~> 1", ">=1.0.0- <2.0.0-"] - , ["~1.0", ">=1.0.0- <1.1.0-"] - , ["~ 1.0", ">=1.0.0- <1.1.0-"] - , ["<1", "<1.0.0-"] - , ["< 1", "<1.0.0-"] - , [">=1", ">=1.0.0-"] - , [">= 1", ">=1.0.0-"] - , ["<1.2", "<1.2.0-"] - , ["< 1.2", "<1.2.0-"] - , ["1", ">=1.0.0- <2.0.0-"] - ].forEach(function (v) { - t.equal(validRange(v[0]), v[1], "validRange("+v[0]+") === "+v[1]) - }) - - t.end() -}) - -test("\ncomparators test", function (t) { -; [ ["1.0.0 - 2.0.0", [[">=1.0.0", "<=2.0.0"]] ] - , ["1.0.0", [["1.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-", "<2.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"]] ] - , [">= 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"]] ] - , ["<\t2.0.0", [["<2.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.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ] - , [">=0.2.3 || <0.0.1", [[">=0.2.3"], ["<0.0.1"]] ] - , ["||", [[""], [""]] ] - , ["2.x.x", [[">=2.0.0-", "<3.0.0-"]] ] - , ["1.2.x", [[">=1.2.0-", "<1.3.0-"]] ] - , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ] - , ["1.2.x || 2.x", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ] - , ["x", [[""]] ] - , ["2.*.*", [[">=2.0.0-", "<3.0.0-"]] ] - , ["1.2.*", [[">=1.2.0-", "<1.3.0-"]] ] - , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ] - , ["1.2.* || 2.*", [[">=1.2.0-", "<1.3.0-"], [">=2.0.0-", "<3.0.0-"]] ] - , ["*", [[""]] ] - , ["2", [[">=2.0.0-", "<3.0.0-"]] ] - , ["2.3", [[">=2.3.0-", "<2.4.0-"]] ] - , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ] - , ["~2.4", [[">=2.4.0-", "<2.5.0-"]] ] - , ["~>3.2.1", [[">=3.2.1-", "<3.3.0-"]] ] - , ["~1", [[">=1.0.0-", "<2.0.0-"]] ] - , ["~>1", [[">=1.0.0-", "<2.0.0-"]] ] - , ["~> 1", [[">=1.0.0-", "<2.0.0-"]] ] - , ["~1.0", [[">=1.0.0-", "<1.1.0-"]] ] - , ["~ 1.0", [[">=1.0.0-", "<1.1.0-"]] ] - , ["<1", [["<1.0.0-"]] ] - , ["< 1", [["<1.0.0-"]] ] - , [">=1", [[">=1.0.0-"]] ] - , [">= 1", [[">=1.0.0-"]] ] - , ["<1.2", [["<1.2.0-"]] ] - , ["< 1.2", [["<1.2.0-"]] ] - , ["1", [[">=1.0.0-", "<2.0.0-"]] ] - ].forEach(function (v) { - t.equivalent(toComparators(v[0]), v[1], "toComparators("+v[0]+") === "+JSON.stringify(v[1])) - }) - - t.end() -}) diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/.npmignore deleted file mode 100644 index 3b3a32f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/.npmignore +++ /dev/null @@ -1,22 +0,0 @@ -tmp -node_modules -*._ -*.tmp -.monitor -*.diff -*.err -*.orig -*.log -*.rej -*.swo -*.swp -*.vi -*~ -.DS_Store -Thumbs.db -.cache -.project -.settings -.tmproj -*.esproj -nbproject diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/.travis.yml b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/.travis.yml deleted file mode 100644 index 58f2371..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.10 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/History.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/History.md deleted file mode 100644 index 32b9665..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/History.md +++ /dev/null @@ -1,19 +0,0 @@ - -0.0.7 / 2013-09-25 -================== - - * Normalize windows paths correctly - * On Windows lib/detector.js not adding trailing slash when needed. - -0.0.6 / 2013-09-13 -================== - - * Export Dir and File in index - * Test on Node 0.10 as well - * Get tests passing on OSX - * Update Readme.md - -0.0.5 / 2012-11-12 -================== - - * Solved process.env issue in detector on certain version so linux. diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/Makefile b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/Makefile deleted file mode 100644 index 98957d6..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -TESTS = test/*.test.js - -test: - @NODE_ENV=test ./node_modules/.bin/mocha \ - --reporter spec \ - $(TESTS) - -clean: - rm -f examples/tmp/* - -.PHONY: test clean diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/Readme.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/Readme.md deleted file mode 100644 index b5c78f3..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/Readme.md +++ /dev/null @@ -1,81 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/vesln/temporary.png)](http://travis-ci.org/vesln/temporary) - -# temporary - The lord of tmp. - -## Intro - -Temporary provides an easy way to create temporary files and directories. -It will create a temporary file/directory with a unique name. - -## Features - -- Generates unique name. -- Auto-discovers tmp dir. - -## Installation - - $ npm install temporary - -## Usage - - var tmp = require('temporary'); - var file = new tmp.File(); - var dir = new tmp.Dir(); - - console.log(file.path); // path. - console.log(dir.path); // path. - - file.unlink(); - dir.rmdir(); - -## Methods - -### File - -- File.readFile -- File.readFileSync -- File.writeFile -- File.writeFileSync -- File.open -- File.openSync -- File.close -- File.closeSync -- File.unlink -- File.unlinkSync - -### Dir - -- Dir.rmdir -- Dir.rmdirSync - -## Tests - - $ make test - -## Contribution - -Bug fixes and features are welcomed. - -## License - -MIT License - -Copyright (C) 2012 Veselin Todorov - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/examples/dir.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/examples/dir.js deleted file mode 100644 index 5182b83..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/examples/dir.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -var Tempdir = require('../lib/dir'); -var dir = new Tempdir('foo') // name - optional - -console.log(dir.path); // path. - -/** - * You can also use: - * - * dir.rmdir - * dir.rmdirSync - */ \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/examples/file.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/examples/file.js deleted file mode 100644 index 6a3fe31..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/examples/file.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -var Tempfile = require('../lib/file'); -var file = new Tempfile('foo') // name - optional - -console.log(file.path); // file path. - -/** - * You can also use: - * - * file.readFile - * file.readFileSync - * file.writeFile - * file.writeFileSync - * file.open - * file.openSync - * file.close - * file.closeSync - * file.unlink - * file.unlinkSync - */ \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/index.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/index.js deleted file mode 100644 index a519266..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var package = require('package')(module); - -/** - * Version. - */ -module.exports.version = package.version; - -/** - * Exporting the temp file - */ -module.exports.File = require('./lib/file'); - -/** - * Exporting the temp directory. - */ -module.exports.Dir = require('./lib/dir'); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/base.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/base.js deleted file mode 100644 index a3e95c8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/base.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var fs = require('fs'); -var path = require('path'); -var generator = require('./generator'); -var detector = require('./detector'); - -/** - * Base constructor. - * - * @param {String|null} name - */ -function Base(name) { - this.init(name); -}; - -/** - * Initializes the class. - * - * @param {String|null} name - */ -Base.prototype.init = function(name) { - var filename = generator.build(name); - this.create(filename); - this.path = filename; -}; - -/** - * Converts the arguments object to array and - * append `this.path` as first element. - * - * @returns {Array} - */ -Base.prototype.prepareArgs = function(args) { - args = Array.prototype.slice.call(args); - args.unshift(this.path); - return args; -}; - -/** - * Renames the dir/file. - * - * @param {String} name - * @param {Function} cb Callback. - */ -Base.prototype.rename = function(name, cb) { - var self = this; - var args = arguments; - var tmp = path.normalize(path.dirname(self.path) + '/' + name); - - fs.rename(this.path, tmp, function(err) { - self.path = tmp; - if (args.length === 2) cb(err); - }); -}; - -/** - * Renames the dir/file sync. - * - * @param {String} name - */ -Base.prototype.renameSync = function(name) { - var tmp = path.normalize(path.dirname(this.path) + '/' + name); - var result = fs.renameSync(this.path, tmp); - this.path = tmp; - return result; -}; - -/** - * Exporting the lib. - */ -module.exports = Base; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/detector.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/detector.js deleted file mode 100644 index 503625b..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/detector.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Detection stolen from NPM (https://github.com/isaacs/npm/) - * - * Copyright 2009, 2010, 2011 Isaac Z. Schlueter (the "Author") - * MIT License (https://github.com/isaacs/npm/blob/master/LICENSE) - */ - -/** - * Detector namespace. - * - * @type {Object} - */ -var detector = module.exports; - -var normalize = function(path) { - var last = Array.prototype.pop.apply(path); - - if (process.platform !== "win32") { - if (last !== '/') { - path += '/'; - } - } else { - //This is fine b/c Windows will - //correctly resolve filepaths with additional slashes - //and it is not correct to assume that on Windows the value - //of path will be a string that terminates in '\'. - // - //See: http://stackoverflow.com/questions/4158597/extra-slashes-in-path-variable-of-file-copy-or-directory-createdirectory-met - // - path += '/'; - } - - return path; -} - -/** - * Returns tmp dir. Thank you npm. - * - * @returns {String} tmp dir. - */ -detector.tmp = function() { - var temp = process.env.TMPDIR - || process.env.TMP - || process.env.TEMP - || (process.platform === "win32" ? "c:\\windows\\temp\\" : "/tmp/") - - return normalize(temp); -}; - -detector._normalize = normalize; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/dir.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/dir.js deleted file mode 100644 index 73acecc..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/dir.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var fs = require('fs'); -var path = require('path'); -var generator = require('./generator'); -var detector = require('./detector'); -var Base = require('./base'); - -/** - * Dir constructor. - * - * @param {String|null} name - */ -function Dir(name) { - this.init(name); -}; - -/** - * Dir extends from tmp. - */ -Dir.prototype.__proto__ = Base.prototype; - -/** - * Creates new file. - * - * @param {String} dirname - */ -Dir.prototype.create = function(dirname) { - return fs.mkdirSync(path.normalize(dirname), 0777); -}; - -/** - * Asynchronous dir. - */ -Dir.prototype.rmdir = function() { - fs.rmdir.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Synchronous rmdir. - */ -Dir.prototype.rmdirSync = function() { - return fs.rmdirSync.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Exporting the lib. - */ -module.exports = Dir; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/file.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/file.js deleted file mode 100644 index 49de026..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/file.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var fs = require('fs'); -var path = require('path'); -var generator = require('./generator'); -var detector = require('./detector'); -var Base = require('./base'); - -/** - * File constructor. - * - * @param {String|null} name - */ -function File(name) { - this.init(name); -}; - -/** - * File extends from tmp. - */ -File.prototype.__proto__ = Base.prototype; - -/** - * Creates new file. - * - * @param {String} filename - */ -File.prototype.create = function(filename) { - return fs.writeFileSync(path.normalize(filename), ''); -}; - -/** - * Asynchronously reads the entire contents of a file. - */ -File.prototype.readFile = function() { - fs.readFile.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Synchronous read. - */ -File.prototype.readFileSync = function() { - return fs.readFileSync.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Asynchronously writes data to a file. - */ -File.prototype.writeFile = function() { - fs.writeFile.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Synchronous writes data to a file. - */ -File.prototype.writeFileSync = function() { - return fs.writeFileSync.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Asynchronous file open. - */ -File.prototype.open = function() { - fs.open.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Synchronous open. - */ -File.prototype.openSync = function() { - return fs.openSync.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Asynchronous close. - */ -File.prototype.close = function() { - fs.close.apply(fs, Array.prototype.slice.call(arguments)); -}; - -/** - * Synchronous close. - */ -File.prototype.closeSync = function() { - return fs.closeSync.apply(fs, Array.prototype.slice.call(arguments)); -}; - -/** - * Asynchronous unlink. - */ -File.prototype.unlink = function() { - fs.unlink.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Synchronous unlink. - */ -File.prototype.unlinkSync = function() { - return fs.unlinkSync.apply(fs, this.prepareArgs(arguments)); -}; - -/** - * Exporting the lib. - */ -module.exports = File; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/generator.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/generator.js deleted file mode 100644 index a68f0ba..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/lib/generator.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var fs = require('fs'); -var path = require('path'); -var detector = require('./detector'); -var existsSync = fs.existsSync || path.existsSync; - -/** - * Generator namespace. - * - * @type {Object} - */ -var generator = module.exports; - -/** - * Generates random name. - * - * @returns {String} - */ -generator.name = function() { - var id = null; - var tmp = detector.tmp(); - do { - id = Date.now() + Math.random(); - } while(existsSync(tmp + '/' + id)); - - return id + ''; -}; - -/** - * Buld a full name. (tmp dir + name). - * - * @param {String} name - * @returns {String} - */ -generator.build = function(name) { - var filename = detector.tmp(); - if (name) filename += name + '.'; - return filename + this.name(); -}; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/.npmignore b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/.npmignore deleted file mode 100644 index 3b3a32f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/.npmignore +++ /dev/null @@ -1,22 +0,0 @@ -tmp -node_modules -*._ -*.tmp -.monitor -*.diff -*.err -*.orig -*.log -*.rej -*.swo -*.swp -*.vi -*~ -.DS_Store -Thumbs.db -.cache -.project -.settings -.tmproj -*.esproj -nbproject diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/.travis.yml b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/.travis.yml deleted file mode 100644 index b8e1f17..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/History.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/History.md deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/Makefile b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/Makefile deleted file mode 100644 index 277485c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TESTS = $(shell find test -iname \*.test.js) - -test: - @NODE_ENV=test ./node_modules/.bin/mocha \ - --require should \ - --reporter spec \ - $(TESTS) - -clean: - rm -f examples/tmp/* - -.PHONY: test clean \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/Readme.md b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/Readme.md deleted file mode 100644 index c531965..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/Readme.md +++ /dev/null @@ -1,54 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/vesln/package.png)](http://travis-ci.org/vesln/package) - -# package - Easy package.json exports. - -## Intro - -This module provides an easy and simple way to export package.json data. - -## Installation - - $ npm install package - -## Usage - - var package = require('package')(module); // contains package.json data. - var yourAwesomeModule = {}; - yourAwesomeModule.version = package.version; - -## Tests - - $ make test - -## Contribution - -Bug fixes and features are welcomed. - -## Other similar modules - -- pkginfo (https://github.com/indexzero/node-pkginfo) by indexzero. -- JSON.parse + fs.readFile - -## License - -MIT License - -Copyright (C) 2012 Veselin Todorov - -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/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/examples/custom_path.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/examples/custom_path.js deleted file mode 100644 index a03c0cc..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/examples/custom_path.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * package - Easy package.json exports. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ - -var package = require('../')(__dirname + '/..'); // parent dir. - -console.log(package); // This will contain the package.json data. \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/examples/module.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/examples/module.js deleted file mode 100644 index c479069..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/examples/module.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * package - Easy package.json exports. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ - -var package = require('../')(module); - -console.log(package); // This will contain the package.json data. \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/lib/package.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/lib/package.js deleted file mode 100644 index 348db0c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/lib/package.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * package - Easy package.json exports. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var fs = require('fs'); -var path = require('path'); -var exists = fs.existsSync || path.existsSync; - -/** - * Package. - * - * @param {String|null} location - * @returns {Object} package.json data - */ -var package = function(location) { - if (location === Object(location)) { - location = package.discover(location); - } - return package.read(path.normalize(location + '/package.json')); -}; - -/** - * Reads and parses a package.json file. - * - * @param {String} file - * @returns {Object} package.json data - */ -package.read = function(file) { - var data = fs.readFileSync(file, 'utf8'); - return JSON.parse(data); -}; - -/** - * Makes an atempt to find package.json file. - * - * @returns {Object} package.json data - */ -package.discover = function(module) { - var location = path.dirname(module.filename); - var found = null; - - while (!found) { - if (exists(location + '/package.json')) { - found = location; - } else if (location !== '/') { - location = path.dirname(location); - } else { - throw new Error('package.json can not be located'); - } - } - - return found; -}; - -/** - * Exporting the lib. - */ -module.exports = package; diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/package.json deleted file mode 100644 index 10df33f..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "package", - "version": "1.0.1", - "description": "Easy package.json exports.", - "keywords": [ - "package.json" - ], - "author": { - "name": "Veselin Todorov", - "email": "hi@vesln.com" - }, - "devDependencies": { - "mocha": "0.3.3", - "should": "0.3.2" - }, - "repository": { - "type": "git", - "url": "http://github.com/vesln/package.git" - }, - "homepage": "http://github.com/vesln/package", - "scripts": { - "test": "make test" - }, - "main": "./lib/package", - "engines": { - "node": ">= 0.6.0" - }, - "readme": "[![Build Status](https://secure.travis-ci.org/vesln/package.png)](http://travis-ci.org/vesln/package)\n\n# package - Easy package.json exports.\n\n## Intro\n\nThis module provides an easy and simple way to export package.json data.\n\n## Installation\n\n\t$ npm install package\n\n## Usage\n\n\tvar package = require('package')(module); // contains package.json data.\n\tvar yourAwesomeModule = {};\n\tyourAwesomeModule.version = package.version;\n\n## Tests\n\n\t$ make test\n\n## Contribution\n\nBug fixes and features are welcomed.\n\n## Other similar modules\n\n- pkginfo (https://github.com/indexzero/node-pkginfo) by indexzero.\n- JSON.parse + fs.readFile\n\n## License\n\nMIT License\n\nCopyright (C) 2012 Veselin Todorov\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.", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/vesln/package/issues" - }, - "_id": "package@1.0.1", - "_from": "package@>= 1.0.0 < 1.2.0" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/index.test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/index.test.js deleted file mode 100644 index c43364b..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/index.test.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * package - Easy package.json exports. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var package = require('../'); - -describe('package', function() { - describe('read', function() { - it('should read and parse .json file', function() { - var result = package.read(__dirname + '/support/package.json'); - result.should.eql({ - name: 'test-package-json-file', - version: '0.0.1', - private: true - }); - }); - }); - - it('should read and parse given .json file', function() { - var result = package(__dirname + '/support'); - result.should.eql({ - name: 'test-package-json-file', - version: '0.0.1', - private: true - }); - }); - - it('should autodiscover, read and parse package.json', function() { - var result = package(module); - result.should.eql({ - name: 'test-package-json-file', - version: '0.0.1', - private: true - }); - }); -}); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/nested/two/nested.test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/nested/two/nested.test.js deleted file mode 100644 index 99c012e..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/nested/two/nested.test.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * package - Easy package.json exports. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var package = require('../../../'); - -describe('nested package json', function() { - it('should autodiscover, read and parse package.json', function() { - var result = package(module); - result.should.eql({ - name: 'test-package-json-file', - version: '0.0.1', - private: true - }); - }); -}); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/package.json deleted file mode 100644 index ed5e671..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "test-package-json-file" - , "version": "0.0.1" - , "private": true -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/support/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/support/package.json deleted file mode 100644 index ed5e671..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/node_modules/package/test/support/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "test-package-json-file" - , "version": "0.0.1" - , "private": true -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/package.json deleted file mode 100644 index 92f9d27..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "temporary", - "version": "0.0.7", - "description": "The lord of tmp.", - "keywords": [ - "tmp", - "temp", - "tempfile", - "tempdirectory" - ], - "author": { - "name": "Veselin Todorov", - "email": "hi@vesln.com" - }, - "dependencies": { - "package": ">= 1.0.0 < 1.2.0" - }, - "devDependencies": { - "mocha": "1.2.x", - "chai": "*", - "sinon": "1.2.0" - }, - "repository": { - "type": "git", - "url": "http://github.com/vesln/temporary.git" - }, - "homepage": "http://github.com/vesln/temporary", - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.6.0" - }, - "readme": "[![Build Status](https://secure.travis-ci.org/vesln/temporary.png)](http://travis-ci.org/vesln/temporary)\n\n# temporary - The lord of tmp.\n\n## Intro\n\nTemporary provides an easy way to create temporary files and directories.\nIt will create a temporary file/directory with a unique name.\n\n## Features\n\n- Generates unique name.\n- Auto-discovers tmp dir.\n\n## Installation\n\n\t$ npm install temporary\n\n## Usage\n\n\tvar tmp = require('temporary');\n\tvar file = new tmp.File();\n\tvar dir = new tmp.Dir();\n\t\n\tconsole.log(file.path); // path.\n\tconsole.log(dir.path); // path.\n\t\n\tfile.unlink();\n\tdir.rmdir();\n\n## Methods\n\n### File\n\n- File.readFile\n- File.readFileSync\n- File.writeFile\n- File.writeFileSync\n- File.open\n- File.openSync\n- File.close\n- File.closeSync\n- File.unlink\n- File.unlinkSync\n\n### Dir\n\n- Dir.rmdir\n- Dir.rmdirSync\n\n## Tests\n\n\t$ make test\n\n## Contribution\n\nBug fixes and features are welcomed.\n\n## License\n\nMIT License\n\nCopyright (C) 2012 Veselin Todorov\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/vesln/temporary/issues" - }, - "_id": "temporary@0.0.7", - "_from": "temporary@~0.0.4" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/base.test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/base.test.js deleted file mode 100644 index 2fdea28..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/base.test.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var path = require('path'); -var fs = require('fs'); -var existsSync = fs.existsSync || path.existsSync; - -var Base = require('../lib/base'); -var generator = require('../lib/generator'); -var should = require('chai').should(); - -Base.prototype.create = function() {}; - -describe('Base', function() { - describe('rename', function() { - it('should rename the directory', function(done) { - var tmp = new Base; - tmp.path = generator.build(); - fs.mkdirSync(path.normalize(tmp.path), 0777); - existsSync(tmp.path).should.be.ok; - tmp.rename('foo', function(err) { - existsSync(tmp.path).should.be.ok; - done(); - }); - }); - }); - - describe('renameSync', function() { - it('should rename the directory', function() { - var tmp = new Base('foo'); - tmp.path = generator.build(); - fs.mkdirSync(path.normalize(tmp.path), 0777); - var oldPath = tmp.path; - existsSync(tmp.path).should.be.ok; - tmp.renameSync('foo3'); - existsSync(tmp.path).should.be.ok; - path.should.not.eql(oldPath); - }); - }); - - describe('prepareArgs', function() { - it('should convert object to array and append path as first element', function() { - var tmp = new Base('foo'); - var args = { 0: 'foo' }; - args.length = 1; - tmp.path = generator.build(); - tmp.prepareArgs(args).should.eql([tmp.path, 'foo']); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/detector.test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/detector.test.js deleted file mode 100644 index 59d7754..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/detector.test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var detector = require('../lib/detector'); -var should = require('chai').should(); - -describe('detector', function() { - describe('tmp', function() { - it('should return the tmp dir of the system', function() { - var tmp = process.env.TMPDIR - || process.env.TMP - || process.env.TEMP - || (process.platform === "win32" ? "c:\\windows\\temp\\" : "/tmp/"); - detector.tmp().should.eql(tmp); - }); - it('should normalize windows paths correctly', function () { - var platform_noConflict = process.platform; - - process.platform = 'win32'; - detector._normalize('c:\\windows\\foo\\bar\\') - .should.eql('c:\\windows\\foo\\bar\\/'); - detector._normalize('c:/windows/foo/bar/') - .should.eql('c:/windows/foo/bar//'); - detector._normalize('c:/windows/foo/bar') - .should.eql('c:/windows/foo/bar/'); - detector._normalize('c:\\windows\\foo\\bar') - .should.eql('c:\\windows\\foo\\bar/'); - process.platform = platform_noConflict; - }); - - }); -}); - diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/dir.test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/dir.test.js deleted file mode 100644 index 8875a88..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/dir.test.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var fs = require('fs'); -var path = require('path'); -var existsSync = fs.existsSync || path.existsSync; - -var Tempdir = require('../lib/dir'); -var sinon = require('sinon'); -var should = require('chai').should(); - -describe('Tempdir', function() { - it('should create file', function() { - var tmp = new Tempdir('foo'); - existsSync(tmp.path).should.be.ok; - }); - - describe('rmdir', function() { - it('should remove the directory', function() { - var tmp = new Tempdir('foo'); - sinon.spy(fs, 'rmdir'); - tmp.rmdir(); - fs.rmdir.getCall(0).args[0].should.eql(tmp.path); - fs.rmdir.restore(); - }); - }); - - describe('rmdirSync', function() { - it('should remove the directory', function() { - var tmp = new Tempdir('foo'); - sinon.spy(fs, 'rmdirSync'); - tmp.rmdirSync(); - fs.rmdirSync.getCall(0).args[0].should.eql(tmp.path); - fs.rmdirSync.restore(); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/file.test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/file.test.js deleted file mode 100644 index 9927e31..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/file.test.js +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var path = require('path'); -var fs = require('fs'); -var existsSync = fs.existsSync || path.existsSync; - -var Tempfile = require('../lib/file'); -var sinon = require('sinon'); -var should = require('chai').should(); - -describe('Tempfile', function() { - it('should create file', function() { - var tmp = new Tempfile('foo'); - existsSync(tmp.path).should.be.ok; - }); - - describe('readFile', function() { - it('should call fs.readfile', function() { - sinon.spy(fs, 'readFile'); - var tmp = new Tempfile; - tmp.readFile(); - fs.readFile.getCall(0).args[0].should.eql(tmp.path); - fs.readFile.restore(); - }); - }); - - describe('readFileSync', function() { - it('should call fs.readfileSync', function() { - sinon.spy(fs, 'readFileSync'); - var tmp = new Tempfile; - tmp.readFileSync(); - fs.readFileSync.getCall(0).args[0].should.eql(tmp.path); - fs.readFileSync.restore(); - }); - }); - - describe('writeFile', function() { - it('should call fs.readfile', function() { - sinon.spy(fs, 'writeFile'); - var tmp = new Tempfile; - tmp.writeFile(); - fs.writeFile.getCall(0).args[0].should.eql(tmp.path); - fs.writeFile.restore(); - }); - }); - - describe('writeFileSync', function() { - it('should call fs.writeFileSync', function() { - sinon.spy(fs, 'writeFileSync'); - var tmp = new Tempfile; - tmp.writeFileSync(); - fs.writeFileSync.getCall(0).args[0].should.eql(tmp.path); - fs.writeFileSync.restore(); - }); - }); - - describe('open', function() { - it('should call fs.open', function() { - sinon.spy(fs, 'open'); - var tmp = new Tempfile; - tmp.open('r'); - fs.open.getCall(0).args[0].should.eql(tmp.path); - fs.open.restore(); - }); - }); - - describe('openSync', function() { - it('should call fs.openSync', function() { - sinon.spy(fs, 'openSync'); - var tmp = new Tempfile; - tmp.openSync('r'); - fs.openSync.getCall(0).args[0].should.eql(tmp.path); - fs.openSync.restore(); - }); - }); - - describe('close', function() { - it('should call fs.close', function() { - sinon.spy(fs, 'close'); - var tmp = new Tempfile; - var fd = tmp.openSync('r'); - tmp.close(fd); - fs.close.getCall(0).args[0].should.eql(fd); - fs.close.restore(); - }); - }); - - describe('closeSync', function() { - it('should call fs.closeSync', function() { - sinon.spy(fs, 'closeSync'); - var tmp = new Tempfile; - var fd = tmp.openSync('r'); - tmp.closeSync(fd); - fs.closeSync.getCall(0).args[0].should.eql(fd); - fs.closeSync.restore(); - }); - }); - - describe('unlink', function() { - it('should call fs.unlink', function() { - sinon.spy(fs, 'unlink'); - var tmp = new Tempfile; - tmp.unlink(); - fs.unlink.getCall(0).args[0].should.eql(tmp.path); - fs.unlink.restore(); - }); - }); - - describe('unlinkSync', function() { - it('should call fs.readfileSync', function() { - sinon.spy(fs, 'unlinkSync'); - var tmp = new Tempfile; - tmp.unlinkSync(); - fs.unlinkSync.getCall(0).args[0].should.eql(tmp.path); - fs.unlinkSync.restore(); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/generator.test.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/generator.test.js deleted file mode 100644 index a1024f7..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/node_modules/temporary/test/generator.test.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Temporary - The lord of tmp. - * - * Author: Veselin Todorov - * Licensed under the MIT License. - */ - -/** - * Dependencies. - */ -var generator = require('../lib/generator'); -var detector = require('../lib/detector'); -var should = require('chai').should(); - -describe('generator', function() { - describe('name', function() { - it('should unique generate name', function() { - generator.name().should.be.ok; - }); - }); - - describe('build', function() { - it('should build full names', function() { - var tmp = detector.tmp(); - generator.build().indexOf(tmp).should.equal(0); - generator.build('foo').indexOf(tmp + 'foo.').should.equal(0); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/package.json b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/package.json deleted file mode 100644 index be5281c..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "grunt-lib-phantomjs", - "description": "Grunt and PhantomJS, sitting in a tree.", - "version": "0.3.1", - "homepage": "http://github.com/gruntjs/grunt-lib-phantomjs", - "author": { - "name": "Grunt Team", - "url": "http://gruntjs.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/gruntjs/grunt-lib-phantomjs.git" - }, - "bugs": { - "url": "https://github.com/gruntjs/grunt-lib-phantomjs/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/gruntjs/grunt-lib-phantomjs/blob/master/LICENSE-MIT" - } - ], - "engines": { - "node": ">= 0.6.0" - }, - "scripts": { - "test": "grunt test" - }, - "dependencies": { - "eventemitter2": "~0.4.9", - "semver": "~1.0.14", - "temporary": "~0.0.4", - "phantomjs": "~1.9.0-1" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.1.1", - "grunt": "~0.4.0", - "difflet": "~0.2.3" - }, - "main": "lib/phantomjs", - "readme": "# grunt-lib-phantomjs\n\n> Grunt and PhantomJS, sitting in a tree.\n\n## Usage\n\nThe best way to understand how this lib should be used is by looking at the [grunt-contrib-qunit](https://github.com/gruntjs/grunt-contrib-qunit) plugin. Mainly, look at how [the lib is required](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/tasks/qunit.js#L17), how [event handlers are bound](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/tasks/qunit.js#L51-L128) and how [PhantomJS is actually spawned](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/tasks/qunit.js#L160-L173).\n\nAlso, in the case of the grunt-contrib-qunit plugin, it's important to know that the page being loaded into PhantomJS *doesn't* know it will be loaded into PhantomJS, and as such doesn't have any PhantomJS->Grunt code in it. That communication code, aka. the [\"bridge\"](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/phantomjs/bridge.js), is dynamically [injected into the html page](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/tasks/qunit.js#L136).\n\n## An inline example\n\nIf a Grunt task looked something like this:\n\n```js\ngrunt.registerTask('mytask', 'Integrate with phantomjs.', function() {\n var phantomjs = require('grunt-lib-phantomjs').init(grunt);\n var errorCount = 0;\n\n // Handle any number of namespaced events like so.\n phantomjs.on('mytask.ok', function(msg) {\n grunt.log.writeln(msg);\n });\n\n phantomjs.on('mytask.error', function(msg) {\n errorCount++;\n grunt.log.error(msg);\n });\n\n // Create some kind of \"all done\" event.\n phantomjs.on('mytask.done', function() {\n phantomjs.halt();\n });\n\n // Built-in error handlers.\n phantomjs.on('fail.load', function(url) {\n phantomjs.halt();\n grunt.warn('PhantomJS unable to load URL.');\n });\n\n phantomjs.on('fail.timeout', function() {\n phantomjs.halt();\n grunt.warn('PhantomJS timed out.');\n });\n\n // This task is async.\n var done = this.async();\n\n // Spawn phantomjs\n phantomjs.spawn('test.html', {\n // Additional PhantomJS options.\n options: {},\n // Complete the task when done.\n done: function(err) {\n done(err || errorCount === 0);\n }\n });\n\n});\n```\n\nAnd `test.html` looked something like this (note the \"bridge\" is hard-coded into this page and not injected):\n\n```html\n\n\n\n\n\n\n\n\n```\n\nThen running Grunt would behave something like this:\n\n```shell\n$ grunt mytask\nRunning \"mytask\" task\nSomething worked.\n>> Something failed.\nWarning: Task \"mytask\" failed. Use --force to continue.\n\nAborted due to warnings.\n```\n\n## Release History\n\n* 2013-02-28 - v0.3.0 - Use PhantomJS 1.9.0-1.\n* 2013-02-28 - v0.2.0 - Use PhantomJS 1.8.1.\n* 2012-12-21 - v0.1.0 - Use PhantomJS 1.7.0.\n", - "readmeFilename": "README.md", - "_id": "grunt-lib-phantomjs@0.3.1", - "dist": { - "shasum": "e5c9f07062cb654c153543f6b146e68a22186a74" - }, - "_from": "grunt-lib-phantomjs@~0.3", - "_resolved": "https://registry.npmjs.org/grunt-lib-phantomjs/-/grunt-lib-phantomjs-0.3.1.tgz" -} diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/phantomjs/main.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/phantomjs/main.js deleted file mode 100644 index c6efbd8..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/phantomjs/main.js +++ /dev/null @@ -1,131 +0,0 @@ -/* - * grunt-lib-phantomjs - * http://gruntjs.com/ - * - * Copyright (c) 2012 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -/*global phantom:true*/ - -'use strict'; - -var fs = require('fs'); - -// The temporary file used for communications. -var tmpfile = phantom.args[0]; -// The page .html file to load. -var url = phantom.args[1]; -// Extra, optionally overridable stuff. -var options = JSON.parse(phantom.args[2] || {}); - -// Default options. -if (!options.timeout) { options.timeout = 5000; } - -// Keep track of the last time a client message was sent. -var last = new Date(); - -// Messages are sent to the parent by appending them to the tempfile. -var sendMessage = function(arg) { - var args = Array.isArray(arg) ? arg : [].slice.call(arguments); - last = new Date(); - fs.write(tmpfile, JSON.stringify(args) + '\n', 'a'); -}; - -// This allows grunt to abort if the PhantomJS version isn't adequate. -sendMessage('private', 'version', phantom.version); - -// Abort if the page doesn't send any messages for a while. -setInterval(function() { - if (new Date() - last > options.timeout) { - sendMessage('fail.timeout'); - phantom.exit(); - } -}, 100); - -// Create a new page. -var page = require('webpage').create(); - -// Inject bridge script into client page. -var injected; -var inject = function() { - if (injected) { return; } - // Inject client-side helper script. - var scripts = Array.isArray(options.inject) ? options.inject : [options.inject]; - sendMessage('inject', options.inject); - scripts.forEach(page.injectJs); - injected = true; -}; - -// Keep track if the client-side helper script already has been injected. -page.onUrlChanged = function(newUrl) { - injected = false; - sendMessage('onUrlChanged', newUrl); -}; - -// The client page must send its messages via alert(jsonstring). -page.onAlert = function(str) { - // The only thing that should ever alert "inject" is the custom event - // handler this script adds to be executed on DOMContentLoaded. - if (str === 'inject') { - inject(); - return; - } - // Otherwise, parse the specified message string and send it back to grunt. - // Unless there's a parse error. Then, complain. - try { - sendMessage(JSON.parse(str)); - } catch(err) { - sendMessage('error.invalidJSON', str); - } -}; - -// Relay console logging messages. -page.onConsoleMessage = function(message) { - sendMessage('console', message); -}; - -// For debugging. -page.onResourceRequested = function(request) { - sendMessage('onResourceRequested', request.url); -}; - -page.onResourceReceived = function(request) { - if (request.stage === 'end') { - sendMessage('onResourceReceived', request.url); - } -}; - -page.onError = function(msg, trace) { - sendMessage('error.onError', msg, trace); -}; - -// Run before the page is loaded. -page.onInitialized = function() { - sendMessage('onInitialized'); - // Abort if there is no bridge to inject. - if (!options.inject) { return; } - // Tell the client that when DOMContentLoaded fires, it needs to tell this - // script to inject the bridge. This should ensure that the bridge gets - // injected before any other DOMContentLoaded or window.load event handler. - page.evaluate(function() { - /*jshint browser:true, devel:true */ - document.addEventListener('DOMContentLoaded', function() { - alert('inject'); - }, false); - }); -}; - -// Run when the page has finished loading. -page.onLoadFinished = function(status) { - // The window has loaded. - sendMessage('onLoadFinished', status); - if (status !== 'success') { - // File loading failure. - sendMessage('fail.load', url); - phantom.exit(); - } -}; - -// Actually load url. -page.open(url); diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/basic.html b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/basic.html deleted file mode 100644 index b08d2d9..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/basic.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/inject.html b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/inject.html deleted file mode 100644 index dc577cb..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/inject.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/inject.js b/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/inject.js deleted file mode 100644 index 9a9e800..0000000 --- a/node_modules/grunt-mocha/node_modules/grunt-lib-phantomjs/test/fixtures/inject.js +++ /dev/null @@ -1,8 +0,0 @@ -// Send messages to the parent PhantomJS process via alert! Good times!! -function sendMessage() { - var args = [].slice.call(arguments); - alert(JSON.stringify(args)); -} - -sendMessage('test', 'injected'); -sendMessage('done'); diff --git a/node_modules/grunt-mocha/node_modules/mocha/Readme.md b/node_modules/grunt-mocha/node_modules/mocha/Readme.md deleted file mode 100644 index ae0e8cc..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/Readme.md +++ /dev/null @@ -1,124 +0,0 @@ - [![Build Status](https://secure.travis-ci.org/visionmedia/mocha.png)](http://travis-ci.org/visionmedia/mocha) - - [![Mocha test framework](http://f.cl.ly/items/3l1k0n2A1U3M1I1L210p/Screen%20Shot%202012-02-24%20at%202.21.43%20PM.png)](http://visionmedia.github.io/mocha) - - Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://visionmedia.github.io/mocha). - -## Contributors - -``` - - project : mocha - repo age : 1 year, 7 months - active : 272 days - commits : 1116 - files : 123 - authors : - 504 TJ Holowaychuk 45.2% - 389 Tj Holowaychuk 34.9% - 31 Guillermo Rauch 2.8% - 13 Attila Domokos 1.2% - 9 John Firebaugh 0.8% - 8 Jo Liss 0.7% - 7 Nathan Rajlich 0.6% - 6 James Carr 0.5% - 6 Brendan Nee 0.5% - 5 Aaron Heckmann 0.4% - 4 hokaccha 0.4% - 4 Xavier Antoviaque 0.4% - 4 Joshua Krall 0.4% - 3 Wil Moore III 0.3% - 3 Jesse Dailey 0.3% - 3 Nathan Bowser 0.3% - 3 Tyson Tate 0.3% - 3 Cory Thomas 0.3% - 3 Ryunosuke SATO 0.3% - 3 Paul Miller 0.3% - 3 Ben Lindsey 0.3% - 2 Forbes Lindesay 0.2% - 2 Konstantin Käfer 0.2% - 2 Brian Beck 0.2% - 2 Merrick Christensen 0.2% - 2 Michael Riley 0.2% - 2 David Henderson 0.2% - 2 Nathan Alderson 0.2% - 2 Paul Armstrong 0.2% - 2 Pete Hawkins 0.2% - 2 Quang Van 0.2% - 2 Raynos 0.2% - 2 Jonas Westerlund 0.2% - 2 Domenic Denicola 0.2% - 2 Shawn Krisman 0.2% - 2 Simon Gaeremynck 0.2% - 2 FARKAS Máté 0.2% - 2 Timo Tijhof 0.2% - 2 Justin DuJardin 0.2% - 2 Juzer Ali 0.2% - 2 Ian Storm Taylor 0.2% - 2 Arian Stolwijk 0.2% - 2 domenic 0.2% - 1 Richard Dingwall 0.1% - 1 Russ Bradberry 0.1% - 1 Sasha Koss 0.1% - 1 Seiya Konno 0.1% - 1 Standa Opichal 0.1% - 1 Steve Mason 0.1% - 1 Will Langstroth 0.1% - 1 Yanis Wang 0.1% - 1 Yuest Wang 0.1% - 1 abrkn 0.1% - 1 airportyh 0.1% - 1 fengmk2 0.1% - 1 tgautier@yahoo.com 0.1% - 1 traleig1 0.1% - 1 vlad 0.1% - 1 yuitest 0.1% - 1 Adam Crabtree 0.1% - 1 Andreas Brekken 0.1% - 1 Atsuya Takagi 0.1% - 1 Austin Birch 0.1% - 1 Bjørge Næss 0.1% - 1 Brian Moore 0.1% - 1 Bryan Donovan 0.1% - 1 Casey Foster 0.1% - 1 Corey Butler 0.1% - 1 Dave McKenna 0.1% - 1 Fedor Indutny 0.1% - 1 Florian Margaine 0.1% - 1 Frederico Silva 0.1% - 1 Fredrik Lindin 0.1% - 1 Gareth Murphy 0.1% - 1 Gavin Mogan 0.1% - 1 Greg Perkins 0.1% - 1 Harry Brundage 0.1% - 1 Herman Junge 0.1% - 1 Ian Young 0.1% - 1 Ivan 0.1% - 1 Jaakko Salonen 0.1% - 1 Jakub Nešetřil 0.1% - 1 James Bowes 0.1% - 1 James Lal 0.1% - 1 Jason Barry 0.1% - 1 Javier Aranda 0.1% - 1 Jeff Kunkle 0.1% - 1 Jonathan Creamer 0.1% - 1 Jussi Virtanen 0.1% - 1 Katie Gengler 0.1% - 1 Kazuhito Hokamura 0.1% - 1 Koen Punt 0.1% - 1 Laszlo Bacsi 0.1% - 1 László Bácsi 0.1% - 1 Maciej Małecki 0.1% - 1 Matt Robenolt 0.1% - 1 Matt Smith 0.1% - 1 Matthew Shanley 0.1% - 1 Michael Schoonmaker 0.1% - 1 Phil Sung 0.1% - 1 R56 0.1% -``` - -## Links - - - [Google Group](http://groups.google.com/group/mochajs) - - [Wiki](https://github.com/visionmedia/mocha/wiki) - - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki) diff --git a/node_modules/grunt-mocha/node_modules/mocha/bin/_mocha b/node_modules/grunt-mocha/node_modules/mocha/bin/_mocha deleted file mode 100755 index ba1f80b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/bin/_mocha +++ /dev/null @@ -1,443 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander') - , sprintf = require('util').format - , path = require('path') - , fs = require('fs') - , glob = require('glob') - , resolve = path.resolve - , exists = fs.existsSync || path.existsSync - , Mocha = require('../') - , utils = Mocha.utils - , reporters = Mocha.reporters - , interfaces = Mocha.interfaces - , Base = reporters.Base - , join = path.join - , basename = path.basename - , cwd = process.cwd() - , mocha = new Mocha; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Files. - */ - -var files = []; - -/** - * Globals. - */ - -var globals = []; - -/** - * Requires. - */ - -var requires = []; - -/** - * Images. - */ - -var images = { - fail: __dirname + '/../images/error.png' - , pass: __dirname + '/../images/ok.png' -}; - -// options - -program - .version(JSON.parse(fs.readFileSync(__dirname + '/../package.json', 'utf8')).version) - .usage('[debug] [options] [files]') - .option('-r, --require ', 'require the given module') - .option('-R, --reporter ', 'specify the reporter to use', 'dot') - .option('-u, --ui ', 'specify user-interface (bdd|tdd|exports)', 'bdd') - .option('-g, --grep ', 'only run tests matching ') - .option('-i, --invert', 'inverts --grep matches') - .option('-t, --timeout ', 'set test-case timeout in milliseconds [2000]') - .option('-s, --slow ', '"slow" test threshold in milliseconds [75]') - .option('-w, --watch', 'watch files for changes') - .option('-c, --colors', 'force enabling of colors') - .option('-C, --no-colors', 'force disabling of colors') - .option('-G, --growl', 'enable growl notification support') - .option('-d, --debug', "enable node's debugger, synonym for node --debug") - .option('-b, --bail', "bail after first test failure") - .option('-A, --async-only', "force all tests to take a callback (async)") - .option('--recursive', 'include sub directories') - .option('--debug-brk', "enable node's debugger breaking on the first line") - .option('--globals ', 'allow the given comma-delimited global [names]', list, []) - .option('--check-leaks', 'check for global variable leaks') - .option('--interfaces', 'display available interfaces') - .option('--reporters', 'display available reporters') - .option('--compilers :,...', 'use the given module(s) to compile files', list, []) - -program.name = 'mocha'; - -// init command - -program - .command('init ') - .description('initialize a client-side mocha setup at ') - .action(function(path){ - var mkdir = require('mkdirp'); - mkdir.sync(path); - var css = fs.readFileSync(join(__dirname, '..', 'mocha.css')); - var js = fs.readFileSync(join(__dirname, '..', 'mocha.js')); - var tmpl = fs.readFileSync(join(__dirname, '..', 'lib/template.html')); - fs.writeFileSync(join(path, 'mocha.css'), css); - fs.writeFileSync(join(path, 'mocha.js'), js); - fs.writeFileSync(join(path, 'tests.js'), ''); - fs.writeFileSync(join(path, 'index.html'), tmpl); - process.exit(0); - }); - -// --globals - -program.on('globals', function(val){ - globals = globals.concat(list(val)); -}); - -// --reporters - -program.on('reporters', function(){ - console.log(); - console.log(' dot - dot matrix'); - console.log(' doc - html documentation'); - console.log(' spec - hierarchical spec list'); - console.log(' json - single json object'); - console.log(' progress - progress bar'); - console.log(' list - spec-style listing'); - console.log(' tap - test-anything-protocol'); - console.log(' landing - unicode landing strip'); - console.log(' xunit - xunit reporter'); - console.log(' teamcity - teamcity ci support'); - console.log(' html-cov - HTML test coverage'); - console.log(' json-cov - JSON test coverage'); - console.log(' min - minimal reporter (great with --watch)'); - console.log(' json-stream - newline delimited json events'); - console.log(' markdown - markdown documentation (github flavour)'); - console.log(' nyan - nyan cat!'); - console.log(); - process.exit(); -}); - -// --interfaces - -program.on('interfaces', function(){ - console.log(''); - console.log(' bdd'); - console.log(' tdd'); - console.log(' qunit'); - console.log(' exports'); - console.log(''); - process.exit(); -}); - -// -r, --require - -module.paths.push(cwd, join(cwd, 'node_modules')); - -program.on('require', function(mod){ - var abs = exists(mod) || exists(mod + '.js'); - if (abs) mod = resolve(mod); - requires.push(mod); -}); - -// mocha.opts support - -try { - var opts = fs.readFileSync('test/mocha.opts', 'utf8') - .trim() - .split(/\s+/); - - process.argv = process.argv - .slice(0, 2) - .concat(opts.concat(process.argv.slice(2))); -} catch (err) { - // ignore -} - -// parse args - -program.parse(process.argv); - -// infinite stack traces - -Error.stackTraceLimit = Infinity; // TODO: config - -// reporter - -mocha.reporter(program.reporter); - -// interface - -mocha.ui(program.ui); - -// load reporter - -try { - Reporter = require('../lib/reporters/' + program.reporter); -} catch (err) { - try { - Reporter = require(program.reporter); - } catch (err) { - throw new Error('reporter "' + program.reporter + '" does not exist'); - } -} - -// --no-colors - -if (!program.colors) Base.useColors = false; - -// --colors - -if (~process.argv.indexOf('--colors') || - ~process.argv.indexOf('-c')) { - Base.useColors = true; -} - -// --slow - -if (program.slow) mocha.suite.slow(program.slow); - -// --timeout - -if (program.timeout) mocha.suite.timeout(program.timeout); - -// --bail - -mocha.suite.bail(program.bail); - -// --grep - -if (program.grep) mocha.grep(new RegExp(program.grep)); - -// --invert - -if (program.invert) mocha.invert(); - -// --check-leaks - -if (program.checkLeaks) mocha.checkLeaks(); - -// --growl - -if (program.growl) mocha.growl(); - -// --async-only - -if (program.asyncOnly) mocha.asyncOnly(); - -// --globals - -mocha.globals(globals); - -// custom compiler support - -var extensions = ['js']; -program.compilers.forEach(function(c) { - var compiler = c.split(':') - , ext = compiler[0] - , mod = compiler[1]; - - if (mod[0] == '.') mod = join(process.cwd(), mod); - require(mod); - extensions.push(ext); -}); - -var re = new RegExp('\\.(' + extensions.join('|') + ')$'); - -// requires - -requires.forEach(function(mod) { - require(mod); -}); - -// files - -var files = [] - , args = program.args; - -// default files to test/*.{js,coffee} - -if (!args.length) args.push('test'); - -args.forEach(function(arg){ - files = files.concat(lookupFiles(arg, program.recursive)); -}); - -// resolve - -files = files.map(function(path){ - return resolve(path); -}); - -// --watch - -if (program.watch) { - console.log(); - hideCursor(); - process.on('SIGINT', function(){ - showCursor(); - console.log('\n'); - process.exit(); - }); - - var spinner = 'win32' == process.platform - ? ['|','/','-','\\'] - : ['◜','◠','◝','◞','◡','◟']; - - var frames = spinner.map(function(c) { - return sprintf(' \u001b[96m%s \u001b[90mwatching\u001b[0m', c); - }); - - var watchFiles = utils.files(cwd); - - function loadAndRun() { - try { - mocha.files = files; - mocha.run(function(){ - play(frames); - }); - } catch(e) { - console.log(e.stack); - } - } - - function purge() { - watchFiles.forEach(function(file){ - delete require.cache[file]; - }); - } - - loadAndRun(); - - utils.watch(watchFiles, function(){ - purge(); - stop() - mocha.suite = mocha.suite.clone(); - mocha.ui(program.ui); - loadAndRun(); - }); - - return; -} - -// load - -mocha.files = files; -mocha.run(process.exit); - -// enable growl notifications - -function growl(runner, reporter) { - var notify = require('growl'); - - runner.on('end', function(){ - var stats = reporter.stats; - if (stats.failures) { - var msg = stats.failures + ' of ' + runner.total + ' tests failed'; - notify(msg, { name: 'mocha', title: 'Failed', image: images.fail }); - } else { - notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', { - name: 'mocha' - , title: 'Passed' - , image: images.pass - }); - } - }); -} - -/** - * Parse list. - */ - -function list(str) { - return str.split(/ *, */); -} - -/** - * Hide the cursor. - */ - -function hideCursor(){ - process.stdout.write('\u001b[?25l'); -}; - -/** - * Show the cursor. - */ - -function showCursor(){ - process.stdout.write('\u001b[?25h'); -}; - -/** - * Stop play()ing. - */ - -function stop() { - process.stdout.write('\u001b[2K'); - clearInterval(play.timer); -} - -/** - * Lookup file names at the given `path`. - */ - -function lookupFiles(path, recursive) { - var files = []; - - if (!exists(path)) { - if (exists(path + '.js')) { - path += '.js' - } else { - return glob.sync(path); - } - } - - var stat = fs.statSync(path); - if (stat.isFile()) return path; - - fs.readdirSync(path).forEach(function(file){ - file = join(path, file); - var stat = fs.statSync(file); - if (stat.isDirectory()) { - if (recursive) files = files.concat(lookupFiles(file, recursive)); - return - } - if (!stat.isFile() || !re.test(file) || basename(file)[0] == '.') return; - files.push(file); - }); - - return files; -} - -/** - * Play the given array of strings. - */ - -function play(arr, interval) { - var len = arr.length - , interval = interval || 100 - , i = 0; - - play.timer = setInterval(function(){ - var str = arr[i++ % len]; - process.stdout.write('\u001b[0G' + str); - }, interval); -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/bin/mocha b/node_modules/grunt-mocha/node_modules/mocha/bin/mocha deleted file mode 100755 index 742d607..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/bin/mocha +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node - -/** - * This tiny wrapper file checks for known node flags and appends them - * when found, before invoking the "real" _mocha(1) executable. - */ - -var spawn = require('child_process').spawn - , args = [ __dirname + '/_mocha' ]; - -process.argv.slice(2).forEach(function(arg){ - var flag = arg.split('=')[0]; - - switch (flag) { - case '-d': - args.unshift('--debug'); - break; - case 'debug': - case '--debug': - case '--debug-brk': - args.unshift(arg); - break; - case '-gc': - case '--expose-gc': - args.unshift('--expose-gc'); - break; - case '--gc-global': - case '--harmony': - case '--harmony-proxies': - case '--harmony-collections': - case '--harmony-generators': - case '--prof': - args.unshift(arg); - break; - default: - if (0 == arg.indexOf('--trace')) args.unshift(arg); - else args.push(arg); - break; - } -}); - -var proc = spawn(process.argv[0], args, { customFds: [0,1,2] }); -proc.on('exit', function (code, signal) { - process.on('exit', function(){ - if (signal) { - process.kill(process.pid, signal); - } else { - process.exit(code); - } - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/images/error.png b/node_modules/grunt-mocha/node_modules/mocha/images/error.png deleted file mode 100644 index a07a1ba..0000000 Binary files a/node_modules/grunt-mocha/node_modules/mocha/images/error.png and /dev/null differ diff --git a/node_modules/grunt-mocha/node_modules/mocha/images/ok.png b/node_modules/grunt-mocha/node_modules/mocha/images/ok.png deleted file mode 100644 index b3623a5..0000000 Binary files a/node_modules/grunt-mocha/node_modules/mocha/images/ok.png and /dev/null differ diff --git a/node_modules/grunt-mocha/node_modules/mocha/index.js b/node_modules/grunt-mocha/node_modules/mocha/index.js deleted file mode 100644 index 507566f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = process.env.COV - ? require('./lib-cov/mocha') - : require('./lib/mocha'); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/debug.js b/node_modules/grunt-mocha/node_modules/mocha/lib/browser/debug.js deleted file mode 100644 index 03cf592..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/debug.js +++ /dev/null @@ -1,5 +0,0 @@ - -module.exports = function(type){ - return function(){ - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/diff.js b/node_modules/grunt-mocha/node_modules/mocha/lib/browser/diff.js deleted file mode 100644 index 6b7ce24..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/diff.js +++ /dev/null @@ -1,287 +0,0 @@ -/* See license.txt for terms of usage */ - -/* - * Text diff implementation. - * - * This library supports the following APIS: - * JsDiff.diffChars: Character by character diff - * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace - * JsDiff.diffLines: Line based diff - * - * JsDiff.diffCss: Diff targeted at CSS content - * - * These methods are based on the implementation proposed in - * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 - */ -var JsDiff = (function() { - function clonePath(path) { - return { newPos: path.newPos, components: path.components.slice(0) }; - } - function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - } - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, "&"); - n = n.replace(//g, ">"); - n = n.replace(/"/g, """); - - return n; - } - - - var fbDiff = function(ignoreWhitespace) { - this.ignoreWhitespace = ignoreWhitespace; - }; - fbDiff.prototype = { - diff: function(oldString, newString) { - // Handle the identity case (this is due to unrolling editLength == 0 - if (newString == oldString) { - return [{ value: newString }]; - } - if (!newString) { - return [{ value: oldString, removed: true }]; - } - if (!oldString) { - return [{ value: newString, added: true }]; - } - - newString = this.tokenize(newString); - oldString = this.tokenize(oldString); - - var newLen = newString.length, oldLen = oldString.length; - var maxEditLength = newLen + oldLen; - var bestPath = [{ newPos: -1, components: [] }]; - - // Seed editLength = 0 - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) { - return bestPath[0].components; - } - - for (var editLength = 1; editLength <= maxEditLength; editLength++) { - for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) { - var basePath; - var addPath = bestPath[diagonalPath-1], - removePath = bestPath[diagonalPath+1]; - oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath-1] = undefined; - } - - var canAdd = addPath && addPath.newPos+1 < newLen; - var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = undefined; - continue; - } - - // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { - basePath = clonePath(removePath); - this.pushComponent(basePath.components, oldString[oldPos], undefined, true); - } else { - basePath = clonePath(addPath); - basePath.newPos++; - this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined); - } - - var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath); - - if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) { - return basePath.components; - } else { - bestPath[diagonalPath] = basePath; - } - } - } - }, - - pushComponent: function(components, value, added, removed) { - var last = components[components.length-1]; - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length-1] = - {value: this.join(last.value, value), added: added, removed: removed }; - } else { - components.push({value: value, added: added, removed: removed }); - } - }, - extractCommon: function(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath; - while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) { - newPos++; - oldPos++; - - this.pushComponent(basePath.components, newString[newPos], undefined, undefined); - } - basePath.newPos = newPos; - return oldPos; - }, - - equals: function(left, right) { - var reWhitespace = /\S/; - if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) { - return true; - } else { - return left == right; - } - }, - join: function(left, right) { - return left + right; - }, - tokenize: function(value) { - return value; - } - }; - - var CharDiff = new fbDiff(); - - var WordDiff = new fbDiff(true); - WordDiff.tokenize = function(value) { - return removeEmpty(value.split(/(\s+|\b)/)); - }; - - var CssDiff = new fbDiff(true); - CssDiff.tokenize = function(value) { - return removeEmpty(value.split(/([{}:;,]|\s+)/)); - }; - - var LineDiff = new fbDiff(); - LineDiff.tokenize = function(value) { - return value.split(/^/m); - }; - - return { - diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); }, - diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); }, - diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); }, - - diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); }, - - createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) { - var ret = []; - - ret.push("Index: " + fileName); - ret.push("==================================================================="); - ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader)); - ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader)); - - var diff = LineDiff.diff(oldStr, newStr); - if (!diff[diff.length-1].value) { - diff.pop(); // Remove trailing newline add - } - diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function(entry) { return ' ' + entry; }); - } - function eofNL(curRange, i, current) { - var last = diff[diff.length-2], - isLast = i === diff.length-2, - isLastOfType = i === diff.length-3 && (current.added === !last.added || current.removed === !last.removed); - - // Figure out if this is the last line for the given file and missing NL - if (!/\n$/.test(current.value) && (isLast || isLastOfType)) { - curRange.push('\\ No newline at end of file'); - } - } - - var oldRangeStart = 0, newRangeStart = 0, curRange = [], - oldLine = 1, newLine = 1; - for (var i = 0; i < diff.length; i++) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - - if (current.added || current.removed) { - if (!oldRangeStart) { - var prev = diff[i-1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = contextLines(prev.lines.slice(-4)); - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?"+":"-") + entry; })); - eofNL(curRange, i, current); - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= 8 && i < diff.length-2) { - // Overlapping - curRange.push.apply(curRange, contextLines(lines)); - } else { - // end the range and output - var contextSize = Math.min(lines.length, 4); - ret.push( - "@@ -" + oldRangeStart + "," + (oldLine-oldRangeStart+contextSize) - + " +" + newRangeStart + "," + (newLine-newRangeStart+contextSize) - + " @@"); - ret.push.apply(ret, curRange); - ret.push.apply(ret, contextLines(lines.slice(0, contextSize))); - if (lines.length <= 4) { - eofNL(ret, i, current); - } - - oldRangeStart = 0; newRangeStart = 0; curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - } - - return ret.join('\n') + '\n'; - }, - - convertChangesToXML: function(changes){ - var ret = []; - for ( var i = 0; i < changes.length; i++) { - var change = changes[i]; - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - } - return ret.join(""); - } - }; -})(); - -if (typeof module !== "undefined") { - module.exports = JsDiff; -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/events.js b/node_modules/grunt-mocha/node_modules/mocha/lib/browser/events.js deleted file mode 100644 index cfbd072..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/events.js +++ /dev/null @@ -1,178 +0,0 @@ - -/** - * Module exports. - */ - -exports.EventEmitter = EventEmitter; - -/** - * Check if `obj` is an array. - */ - -function isArray(obj) { - return '[object Array]' == {}.toString.call(obj); -} - -/** - * Event emitter constructor. - * - * @api public - */ - -function EventEmitter(){}; - -/** - * Adds a listener. - * - * @api public - */ - -EventEmitter.prototype.on = function (name, fn) { - if (!this.$events) { - this.$events = {}; - } - - if (!this.$events[name]) { - this.$events[name] = fn; - } else if (isArray(this.$events[name])) { - this.$events[name].push(fn); - } else { - this.$events[name] = [this.$events[name], fn]; - } - - return this; -}; - -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -/** - * Adds a volatile listener. - * - * @api public - */ - -EventEmitter.prototype.once = function (name, fn) { - var self = this; - - function on () { - self.removeListener(name, on); - fn.apply(this, arguments); - }; - - on.listener = fn; - this.on(name, on); - - return this; -}; - -/** - * Removes a listener. - * - * @api public - */ - -EventEmitter.prototype.removeListener = function (name, fn) { - if (this.$events && this.$events[name]) { - var list = this.$events[name]; - - if (isArray(list)) { - var pos = -1; - - for (var i = 0, l = list.length; i < l; i++) { - if (list[i] === fn || (list[i].listener && list[i].listener === fn)) { - pos = i; - break; - } - } - - if (pos < 0) { - return this; - } - - list.splice(pos, 1); - - if (!list.length) { - delete this.$events[name]; - } - } else if (list === fn || (list.listener && list.listener === fn)) { - delete this.$events[name]; - } - } - - return this; -}; - -/** - * Removes all listeners for an event. - * - * @api public - */ - -EventEmitter.prototype.removeAllListeners = function (name) { - if (name === undefined) { - this.$events = {}; - return this; - } - - if (this.$events && this.$events[name]) { - this.$events[name] = null; - } - - return this; -}; - -/** - * Gets all listeners for a certain event. - * - * @api public - */ - -EventEmitter.prototype.listeners = function (name) { - if (!this.$events) { - this.$events = {}; - } - - if (!this.$events[name]) { - this.$events[name] = []; - } - - if (!isArray(this.$events[name])) { - this.$events[name] = [this.$events[name]]; - } - - return this.$events[name]; -}; - -/** - * Emits an event. - * - * @api public - */ - -EventEmitter.prototype.emit = function (name) { - if (!this.$events) { - return false; - } - - var handler = this.$events[name]; - - if (!handler) { - return false; - } - - var args = [].slice.call(arguments, 1); - - if ('function' == typeof handler) { - handler.apply(this, args); - } else if (isArray(handler)) { - var listeners = handler.slice(); - - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - } else { - return false; - } - - return true; -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/fs.js b/node_modules/grunt-mocha/node_modules/mocha/lib/browser/fs.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/path.js b/node_modules/grunt-mocha/node_modules/mocha/lib/browser/path.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/progress.js b/node_modules/grunt-mocha/node_modules/mocha/lib/browser/progress.js deleted file mode 100644 index 1d60cde..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/progress.js +++ /dev/null @@ -1,125 +0,0 @@ - -/** - * Expose `Progress`. - */ - -module.exports = Progress; - -/** - * Initialize a new `Progress` indicator. - */ - -function Progress() { - this.percent = 0; - this.size(0); - this.fontSize(11); - this.font('helvetica, arial, sans-serif'); -} - -/** - * Set progress size to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.size = function(n){ - this._size = n; - return this; -}; - -/** - * Set text to `str`. - * - * @param {String} str - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.text = function(str){ - this._text = str; - return this; -}; - -/** - * Set font size to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.fontSize = function(n){ - this._fontSize = n; - return this; -}; - -/** - * Set font `family`. - * - * @param {String} family - * @return {Progress} for chaining - */ - -Progress.prototype.font = function(family){ - this._font = family; - return this; -}; - -/** - * Update percentage to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - */ - -Progress.prototype.update = function(n){ - this.percent = n; - return this; -}; - -/** - * Draw on `ctx`. - * - * @param {CanvasRenderingContext2d} ctx - * @return {Progress} for chaining - */ - -Progress.prototype.draw = function(ctx){ - var percent = Math.min(this.percent, 100) - , size = this._size - , half = size / 2 - , x = half - , y = half - , rad = half - 1 - , fontSize = this._fontSize; - - ctx.font = fontSize + 'px ' + this._font; - - var angle = Math.PI * 2 * (percent / 100); - ctx.clearRect(0, 0, size, size); - - // outer circle - ctx.strokeStyle = '#9f9f9f'; - ctx.beginPath(); - ctx.arc(x, y, rad, 0, angle, false); - ctx.stroke(); - - // inner circle - ctx.strokeStyle = '#eee'; - ctx.beginPath(); - ctx.arc(x, y, rad - 1, 0, angle, true); - ctx.stroke(); - - // text - var text = this._text || (percent | 0) + '%' - , w = ctx.measureText(text).width; - - ctx.fillText( - text - , x - w / 2 + 1 - , y + fontSize / 2 - 1); - - return this; -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/tty.js b/node_modules/grunt-mocha/node_modules/mocha/lib/browser/tty.js deleted file mode 100644 index 6f5f079..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/browser/tty.js +++ /dev/null @@ -1,13 +0,0 @@ - -exports.isatty = function(){ - return true; -}; - -exports.getWindowSize = function(){ - if ('innerHeight' in global) { - return [global.innerHeight, global.innerWidth]; - } else { - // In a Web Worker, the DOM Window is not available. - return [640, 480]; - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/context.js b/node_modules/grunt-mocha/node_modules/mocha/lib/context.js deleted file mode 100644 index 6d6422a..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/context.js +++ /dev/null @@ -1,69 +0,0 @@ - -/** - * Expose `Context`. - */ - -module.exports = Context; - -/** - * Initialize a new `Context`. - * - * @api private - */ - -function Context(){} - -/** - * Set or get the context `Runnable` to `runnable`. - * - * @param {Runnable} runnable - * @return {Context} - * @api private - */ - -Context.prototype.runnable = function(runnable){ - if (0 == arguments.length) return this._runnable; - this.test = this._runnable = runnable; - return this; -}; - -/** - * Set test timeout `ms`. - * - * @param {Number} ms - * @return {Context} self - * @api private - */ - -Context.prototype.timeout = function(ms){ - this.runnable().timeout(ms); - return this; -}; - -/** - * Set test slowness threshold `ms`. - * - * @param {Number} ms - * @return {Context} self - * @api private - */ - -Context.prototype.slow = function(ms){ - this.runnable().slow(ms); - return this; -}; - -/** - * Inspect the context void of `._runnable`. - * - * @return {String} - * @api private - */ - -Context.prototype.inspect = function(){ - return JSON.stringify(this, function(key, val){ - if ('_runnable' == key) return; - if ('test' == key) return; - return val; - }, 2); -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/hook.js b/node_modules/grunt-mocha/node_modules/mocha/lib/hook.js deleted file mode 100644 index 814e7b6..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/hook.js +++ /dev/null @@ -1,49 +0,0 @@ - -/** - * Module dependencies. - */ - -var Runnable = require('./runnable'); - -/** - * Expose `Hook`. - */ - -module.exports = Hook; - -/** - * Initialize a new `Hook` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Hook(title, fn) { - Runnable.call(this, title, fn); - this.type = 'hook'; -} - -/** - * Inherit from `Runnable.prototype`. - */ - -Hook.prototype.__proto__ = Runnable.prototype; - -/** - * Get or set the test `err`. - * - * @param {Error} err - * @return {Error} - * @api public - */ - -Hook.prototype.error = function(err){ - if (0 == arguments.length) { - var err = this._error; - this._error = null; - return err; - } - - this._error = err; -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/bdd.js b/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/bdd.js deleted file mode 100644 index e838109..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/bdd.js +++ /dev/null @@ -1,135 +0,0 @@ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils'); - -/** - * BDD-style interface: - * - * describe('Array', function(){ - * describe('#indexOf()', function(){ - * it('should return -1 when not present', function(){ - * - * }); - * - * it('should return the index when present', function(){ - * - * }); - * }); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before running tests. - */ - - context.before = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after running tests. - */ - - context.after = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Execute before each test case. - */ - - context.beforeEach = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.afterEach = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Describe a "suite" with the given `title` - * and callback `fn` containing nested suites - * and/or tests. - */ - - context.describe = context.context = function(title, fn){ - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - fn.call(suite); - suites.shift(); - return suite; - }; - - /** - * Pending describe. - */ - - context.xdescribe = - context.xcontext = - context.describe.skip = function(title, fn){ - var suite = Suite.create(suites[0], title); - suite.pending = true; - suites.unshift(suite); - fn.call(suite); - suites.shift(); - }; - - /** - * Exclusive suite. - */ - - context.describe.only = function(title, fn){ - var suite = context.describe(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.it = context.specify = function(title, fn){ - var suite = suites[0]; - if (suite.pending) var fn = null; - var test = new Test(title, fn); - suite.addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.it.only = function(title, fn){ - var test = context.it(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.xit = - context.xspecify = - context.it.skip = function(title){ - context.it(title); - }; - }); -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/exports.js b/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/exports.js deleted file mode 100644 index 6b229c0..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/exports.js +++ /dev/null @@ -1,60 +0,0 @@ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test'); - -/** - * TDD-style interface: - * - * exports.Array = { - * '#indexOf()': { - * 'should return -1 when the value is not present': function(){ - * - * }, - * - * 'should return the correct index when the value is present': function(){ - * - * } - * } - * }; - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('require', visit); - - function visit(obj) { - var suite; - for (var key in obj) { - if ('function' == typeof obj[key]) { - var fn = obj[key]; - switch (key) { - case 'before': - suites[0].beforeAll(fn); - break; - case 'after': - suites[0].afterAll(fn); - break; - case 'beforeEach': - suites[0].beforeEach(fn); - break; - case 'afterEach': - suites[0].afterEach(fn); - break; - default: - suites[0].addTest(new Test(key, fn)); - } - } else { - var suite = Suite.create(suites[0], key); - suites.unshift(suite); - visit(obj[key]); - suites.shift(); - } - } - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/index.js b/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/index.js deleted file mode 100644 index f7b2655..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/index.js +++ /dev/null @@ -1,5 +0,0 @@ - -exports.bdd = require('./bdd'); -exports.tdd = require('./tdd'); -exports.qunit = require('./qunit'); -exports.exports = require('./exports'); diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/qunit.js b/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/qunit.js deleted file mode 100644 index 30f6748..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/qunit.js +++ /dev/null @@ -1,122 +0,0 @@ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils'); - -/** - * QUnit-style interface: - * - * suite('Array'); - * - * test('#length', function(){ - * var arr = [1,2,3]; - * ok(arr.length == 3); - * }); - * - * test('#indexOf()', function(){ - * var arr = [1,2,3]; - * ok(arr.indexOf(1) == 0); - * ok(arr.indexOf(2) == 1); - * ok(arr.indexOf(3) == 2); - * }); - * - * suite('String'); - * - * test('#length', function(){ - * ok('foo'.length == 3); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before running tests. - */ - - context.before = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after running tests. - */ - - context.after = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Execute before each test case. - */ - - context.beforeEach = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.afterEach = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Describe a "suite" with the given `title`. - */ - - context.suite = function(title){ - if (suites.length > 1) suites.shift(); - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - return suite; - }; - - /** - * Exclusive test-case. - */ - - context.suite.only = function(title, fn){ - var suite = context.suite(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.test = function(title, fn){ - var test = new Test(title, fn); - suites[0].addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.test.only = function(title, fn){ - var test = context.test(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.test.skip = function(title){ - context.test(title); - }; - }); -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/tdd.js b/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/tdd.js deleted file mode 100644 index da5ca2c..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/interfaces/tdd.js +++ /dev/null @@ -1,138 +0,0 @@ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils');; - -/** - * TDD-style interface: - * - * suite('Array', function(){ - * suite('#indexOf()', function(){ - * suiteSetup(function(){ - * - * }); - * - * test('should return -1 when not present', function(){ - * - * }); - * - * test('should return the index when present', function(){ - * - * }); - * - * suiteTeardown(function(){ - * - * }); - * }); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before each test case. - */ - - context.setup = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.teardown = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Execute before the suite. - */ - - context.suiteSetup = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after the suite. - */ - - context.suiteTeardown = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Describe a "suite" with the given `title` - * and callback `fn` containing nested suites - * and/or tests. - */ - - context.suite = function(title, fn){ - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - fn.call(suite); - suites.shift(); - return suite; - }; - - /** - * Pending suite. - */ - context.suite.skip = function(title, fn) { - var suite = Suite.create(suites[0], title); - suite.pending = true; - suites.unshift(suite); - fn.call(suite); - suites.shift(); - }; - - /** - * Exclusive test-case. - */ - - context.suite.only = function(title, fn){ - var suite = context.suite(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.test = function(title, fn){ - var suite = suites[0]; - if (suite.pending) var fn = null; - var test = new Test(title, fn); - suite.addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.test.only = function(title, fn){ - var test = context.test(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.test.skip = function(title){ - context.test(title); - }; - }); -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/mocha.js b/node_modules/grunt-mocha/node_modules/mocha/lib/mocha.js deleted file mode 100644 index 184b886..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/mocha.js +++ /dev/null @@ -1,317 +0,0 @@ -/*! - * mocha - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var path = require('path') - , utils = require('./utils'); - -/** - * Expose `Mocha`. - */ - -exports = module.exports = Mocha; - -/** - * Expose internals. - */ - -exports.utils = utils; -exports.interfaces = require('./interfaces'); -exports.reporters = require('./reporters'); -exports.Runnable = require('./runnable'); -exports.Context = require('./context'); -exports.Runner = require('./runner'); -exports.Suite = require('./suite'); -exports.Hook = require('./hook'); -exports.Test = require('./test'); - -/** - * Return image `name` path. - * - * @param {String} name - * @return {String} - * @api private - */ - -function image(name) { - return __dirname + '/../images/' + name + '.png'; -} - -/** - * Setup mocha with `options`. - * - * Options: - * - * - `ui` name "bdd", "tdd", "exports" etc - * - `reporter` reporter instance, defaults to `mocha.reporters.Dot` - * - `globals` array of accepted globals - * - `timeout` timeout in milliseconds - * - `bail` bail on the first test failure - * - `slow` milliseconds to wait before considering a test slow - * - `ignoreLeaks` ignore global leaks - * - `grep` string or regexp to filter tests with - * - * @param {Object} options - * @api public - */ - -function Mocha(options) { - options = options || {}; - this.files = []; - this.options = options; - this.grep(options.grep); - this.suite = new exports.Suite('', new exports.Context); - this.ui(options.ui); - this.bail(options.bail); - this.reporter(options.reporter); - if (typeof options.timeout === 'number') this.timeout(options.timeout); - if (options.slow) this.slow(options.slow); -} - -/** - * Enable or disable bailing on the first failure. - * - * @param {Boolean} [bail] - * @api public - */ - -Mocha.prototype.bail = function(bail){ - if (0 == arguments.length) bail = true; - this.suite.bail(bail); - return this; -}; - -/** - * Add test `file`. - * - * @param {String} file - * @api public - */ - -Mocha.prototype.addFile = function(file){ - this.files.push(file); - return this; -}; - -/** - * Set reporter to `reporter`, defaults to "dot". - * - * @param {String|Function} reporter name or constructor - * @api public - */ - -Mocha.prototype.reporter = function(reporter){ - if ('function' == typeof reporter) { - this._reporter = reporter; - } else { - reporter = reporter || 'dot'; - try { - this._reporter = require('./reporters/' + reporter); - } catch (err) { - this._reporter = require(reporter); - } - if (!this._reporter) throw new Error('invalid reporter "' + reporter + '"'); - } - return this; -}; - -/** - * Set test UI `name`, defaults to "bdd". - * - * @param {String} bdd - * @api public - */ - -Mocha.prototype.ui = function(name){ - name = name || 'bdd'; - this._ui = exports.interfaces[name]; - if (!this._ui) throw new Error('invalid interface "' + name + '"'); - this._ui = this._ui(this.suite); - return this; -}; - -/** - * Load registered files. - * - * @api private - */ - -Mocha.prototype.loadFiles = function(fn){ - var self = this; - var suite = this.suite; - var pending = this.files.length; - this.files.forEach(function(file){ - file = path.resolve(file); - suite.emit('pre-require', global, file, self); - suite.emit('require', require(file), file, self); - suite.emit('post-require', global, file, self); - --pending || (fn && fn()); - }); -}; - -/** - * Enable growl support. - * - * @api private - */ - -Mocha.prototype._growl = function(runner, reporter) { - var notify = require('growl'); - - runner.on('end', function(){ - var stats = reporter.stats; - if (stats.failures) { - var msg = stats.failures + ' of ' + runner.total + ' tests failed'; - notify(msg, { name: 'mocha', title: 'Failed', image: image('error') }); - } else { - notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', { - name: 'mocha' - , title: 'Passed' - , image: image('ok') - }); - } - }); -}; - -/** - * Add regexp to grep, if `re` is a string it is escaped. - * - * @param {RegExp|String} re - * @return {Mocha} - * @api public - */ - -Mocha.prototype.grep = function(re){ - this.options.grep = 'string' == typeof re - ? new RegExp(utils.escapeRegexp(re)) - : re; - return this; -}; - -/** - * Invert `.grep()` matches. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.invert = function(){ - this.options.invert = true; - return this; -}; - -/** - * Ignore global leaks. - * - * @param {Boolean} ignore - * @return {Mocha} - * @api public - */ - -Mocha.prototype.ignoreLeaks = function(ignore){ - this.options.ignoreLeaks = !!ignore; - return this; -}; - -/** - * Enable global leak checking. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.checkLeaks = function(){ - this.options.ignoreLeaks = false; - return this; -}; - -/** - * Enable growl support. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.growl = function(){ - this.options.growl = true; - return this; -}; - -/** - * Ignore `globals` array or string. - * - * @param {Array|String} globals - * @return {Mocha} - * @api public - */ - -Mocha.prototype.globals = function(globals){ - this.options.globals = (this.options.globals || []).concat(globals); - return this; -}; - -/** - * Set the timeout in milliseconds. - * - * @param {Number} timeout - * @return {Mocha} - * @api public - */ - -Mocha.prototype.timeout = function(timeout){ - this.suite.timeout(timeout); - return this; -}; - -/** - * Set slowness threshold in milliseconds. - * - * @param {Number} slow - * @return {Mocha} - * @api public - */ - -Mocha.prototype.slow = function(slow){ - this.suite.slow(slow); - return this; -}; - -/** - * Makes all tests async (accepting a callback) - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.asyncOnly = function(){ - this.options.asyncOnly = true; - return this; -}; - -/** - * Run tests and invoke `fn()` when complete. - * - * @param {Function} fn - * @return {Runner} - * @api public - */ - -Mocha.prototype.run = function(fn){ - if (this.files.length) this.loadFiles(); - var suite = this.suite; - var options = this.options; - var runner = new exports.Runner(suite); - var reporter = new this._reporter(runner); - runner.ignoreLeaks = false !== options.ignoreLeaks; - runner.asyncOnly = options.asyncOnly; - if (options.grep) runner.grep(options.grep, options.invert); - if (options.globals) runner.globals(options.globals); - if (options.growl) this._growl(runner, reporter); - return runner.run(fn); -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/ms.js b/node_modules/grunt-mocha/node_modules/mocha/lib/ms.js deleted file mode 100644 index c5847f8..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/ms.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 's': - return n * s; - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/base.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/base.js deleted file mode 100644 index 35c9091..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/base.js +++ /dev/null @@ -1,401 +0,0 @@ - -/** - * Module dependencies. - */ - -var tty = require('tty') - , diff = require('diff') - , ms = require('../ms'); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Check if both stdio streams are associated with a tty. - */ - -var isatty = tty.isatty(1) && tty.isatty(2); - -/** - * Expose `Base`. - */ - -exports = module.exports = Base; - -/** - * Enable coloring by default. - */ - -exports.useColors = isatty; - -/** - * Default color map. - */ - -exports.colors = { - 'pass': 90 - , 'fail': 31 - , 'bright pass': 92 - , 'bright fail': 91 - , 'bright yellow': 93 - , 'pending': 36 - , 'suite': 0 - , 'error title': 0 - , 'error message': 31 - , 'error stack': 90 - , 'checkmark': 32 - , 'fast': 90 - , 'medium': 33 - , 'slow': 31 - , 'green': 32 - , 'light': 90 - , 'diff gutter': 90 - , 'diff added': 42 - , 'diff removed': 41 -}; - -/** - * Default symbol map. - */ - -exports.symbols = { - ok: '✓', - err: '✖', - dot: '․' -}; - -// With node.js on Windows: use symbols available in terminal default fonts -if ('win32' == process.platform) { - exports.symbols.ok = '\u221A'; - exports.symbols.err = '\u00D7'; - exports.symbols.dot = '.'; -} - -/** - * Color `str` with the given `type`, - * allowing colors to be disabled, - * as well as user-defined color - * schemes. - * - * @param {String} type - * @param {String} str - * @return {String} - * @api private - */ - -var color = exports.color = function(type, str) { - if (!exports.useColors) return str; - return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m'; -}; - -/** - * Expose term window size, with some - * defaults for when stderr is not a tty. - */ - -exports.window = { - width: isatty - ? process.stdout.getWindowSize - ? process.stdout.getWindowSize(1)[0] - : tty.getWindowSize()[1] - : 75 -}; - -/** - * Expose some basic cursor interactions - * that are common among reporters. - */ - -exports.cursor = { - hide: function(){ - process.stdout.write('\u001b[?25l'); - }, - - show: function(){ - process.stdout.write('\u001b[?25h'); - }, - - deleteLine: function(){ - process.stdout.write('\u001b[2K'); - }, - - beginningOfLine: function(){ - process.stdout.write('\u001b[0G'); - }, - - CR: function(){ - exports.cursor.deleteLine(); - exports.cursor.beginningOfLine(); - } -}; - -/** - * Outut the given `failures` as a list. - * - * @param {Array} failures - * @api public - */ - -exports.list = function(failures){ - console.error(); - failures.forEach(function(test, i){ - // format - var fmt = color('error title', ' %s) %s:\n') - + color('error message', ' %s') - + color('error stack', '\n%s\n'); - - // msg - var err = test.err - , message = err.message || '' - , stack = err.stack || message - , index = stack.indexOf(message) + message.length - , msg = stack.slice(0, index) - , actual = err.actual - , expected = err.expected - , escape = true; - - // uncaught - if (err.uncaught) { - msg = 'Uncaught ' + msg; - } - - // explicitly show diff - if (err.showDiff && sameType(actual, expected)) { - escape = false; - err.actual = actual = stringify(actual); - err.expected = expected = stringify(expected); - } - - // actual / expected diff - if ('string' == typeof actual && 'string' == typeof expected) { - msg = errorDiff(err, 'Words', escape); - - // linenos - var lines = msg.split('\n'); - if (lines.length > 4) { - var width = String(lines.length).length; - msg = lines.map(function(str, i){ - return pad(++i, width) + ' |' + ' ' + str; - }).join('\n'); - } - - // legend - msg = '\n' - + color('diff removed', 'actual') - + ' ' - + color('diff added', 'expected') - + '\n\n' - + msg - + '\n'; - - // indent - msg = msg.replace(/^/gm, ' '); - - fmt = color('error title', ' %s) %s:\n%s') - + color('error stack', '\n%s\n'); - } - - // indent stack trace without msg - stack = stack.slice(index ? index + 1 : index) - .replace(/^/gm, ' '); - - console.error(fmt, (i + 1), test.fullTitle(), msg, stack); - }); -}; - -/** - * Initialize a new `Base` reporter. - * - * All other reporters generally - * inherit from this reporter, providing - * stats such as test duration, number - * of tests passed / failed etc. - * - * @param {Runner} runner - * @api public - */ - -function Base(runner) { - var self = this - , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 } - , failures = this.failures = []; - - if (!runner) return; - this.runner = runner; - - runner.stats = stats; - - runner.on('start', function(){ - stats.start = new Date; - }); - - runner.on('suite', function(suite){ - stats.suites = stats.suites || 0; - suite.root || stats.suites++; - }); - - runner.on('test end', function(test){ - stats.tests = stats.tests || 0; - stats.tests++; - }); - - runner.on('pass', function(test){ - stats.passes = stats.passes || 0; - - var medium = test.slow() / 2; - test.speed = test.duration > test.slow() - ? 'slow' - : test.duration > medium - ? 'medium' - : 'fast'; - - stats.passes++; - }); - - runner.on('fail', function(test, err){ - stats.failures = stats.failures || 0; - stats.failures++; - test.err = err; - failures.push(test); - }); - - runner.on('end', function(){ - stats.end = new Date; - stats.duration = new Date - stats.start; - }); - - runner.on('pending', function(){ - stats.pending++; - }); -} - -/** - * Output common epilogue used by many of - * the bundled reporters. - * - * @api public - */ - -Base.prototype.epilogue = function(){ - var stats = this.stats; - var tests; - var fmt; - - console.log(); - - // passes - fmt = color('bright pass', ' ') - + color('green', ' %d passing') - + color('light', ' (%s)'); - - console.log(fmt, - stats.passes || 0, - ms(stats.duration)); - - // pending - if (stats.pending) { - fmt = color('pending', ' ') - + color('pending', ' %d pending'); - - console.log(fmt, stats.pending); - } - - // failures - if (stats.failures) { - fmt = color('fail', ' %d failing'); - - console.error(fmt, - stats.failures); - - Base.list(this.failures); - console.error(); - } - - console.log(); -}; - -/** - * Pad the given `str` to `len`. - * - * @param {String} str - * @param {String} len - * @return {String} - * @api private - */ - -function pad(str, len) { - str = String(str); - return Array(len - str.length + 1).join(' ') + str; -} - -/** - * Return a character diff for `err`. - * - * @param {Error} err - * @return {String} - * @api private - */ - -function errorDiff(err, type, escape) { - return diff['diff' + type](err.actual, err.expected).map(function(str){ - if (escape) { - str.value = str.value - .replace(/\t/g, '') - .replace(/\r/g, '') - .replace(/\n/g, '\n'); - } - if (str.added) return colorLines('diff added', str.value); - if (str.removed) return colorLines('diff removed', str.value); - return str.value; - }).join(''); -} - -/** - * Color lines for `str`, using the color `name`. - * - * @param {String} name - * @param {String} str - * @return {String} - * @api private - */ - -function colorLines(name, str) { - return str.split('\n').map(function(str){ - return color(name, str); - }).join('\n'); -} - -/** - * Stringify `obj`. - * - * @param {Mixed} obj - * @return {String} - * @api private - */ - -function stringify(obj) { - if (obj instanceof RegExp) return obj.toString(); - return JSON.stringify(obj, null, 2); -} - -/** - * Check that a / b have the same type. - * - * @param {Object} a - * @param {Object} b - * @return {Boolean} - * @api private - */ - -function sameType(a, b) { - a = Object.prototype.toString.call(a); - b = Object.prototype.toString.call(b); - return a == b; -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/doc.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/doc.js deleted file mode 100644 index 2e5bf57..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/doc.js +++ /dev/null @@ -1,56 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils'); - -/** - * Expose `Doc`. - */ - -exports = module.exports = Doc; - -/** - * Initialize a new `Doc` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Doc(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total - , indents = 2; - - function indent() { - return Array(indents).join(' '); - } - - runner.on('suite', function(suite){ - if (suite.root) return; - ++indents; - console.log('%s
              ', indent()); - ++indents; - console.log('%s

              %s

              ', indent(), utils.escape(suite.title)); - console.log('%s
              ', indent()); - }); - - runner.on('suite end', function(suite){ - if (suite.root) return; - console.log('%s
              ', indent()); - --indents; - console.log('%s
              ', indent()); - --indents; - }); - - runner.on('pass', function(test){ - console.log('%s
              %s
              ', indent(), utils.escape(test.title)); - var code = utils.escape(utils.clean(test.fn.toString())); - console.log('%s
              %s
              ', indent(), code); - }); -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/dot.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/dot.js deleted file mode 100644 index 0c298ba..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/dot.js +++ /dev/null @@ -1,62 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `Dot`. - */ - -exports = module.exports = Dot; - -/** - * Initialize a new `Dot` matrix test reporter. - * - * @param {Runner} runner - * @api public - */ - -function Dot(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , n = 0; - - runner.on('start', function(){ - process.stdout.write('\n '); - }); - - runner.on('pending', function(test){ - process.stdout.write(color('pending', Base.symbols.dot)); - }); - - runner.on('pass', function(test){ - if (++n % width == 0) process.stdout.write('\n '); - if ('slow' == test.speed) { - process.stdout.write(color('bright yellow', Base.symbols.dot)); - } else { - process.stdout.write(color(test.speed, Base.symbols.dot)); - } - }); - - runner.on('fail', function(test, err){ - if (++n % width == 0) process.stdout.write('\n '); - process.stdout.write(color('fail', Base.symbols.dot)); - }); - - runner.on('end', function(){ - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -Dot.prototype.__proto__ = Base.prototype; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/html-cov.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/html-cov.js deleted file mode 100644 index bfb27ff..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/html-cov.js +++ /dev/null @@ -1,51 +0,0 @@ - -/** - * Module dependencies. - */ - -var JSONCov = require('./json-cov') - , fs = require('fs'); - -/** - * Expose `HTMLCov`. - */ - -exports = module.exports = HTMLCov; - -/** - * Initialize a new `JsCoverage` reporter. - * - * @param {Runner} runner - * @api public - */ - -function HTMLCov(runner) { - var jade = require('jade') - , file = __dirname + '/templates/coverage.jade' - , str = fs.readFileSync(file, 'utf8') - , fn = jade.compile(str, { filename: file }) - , self = this; - - JSONCov.call(this, runner, false); - - runner.on('end', function(){ - process.stdout.write(fn({ - cov: self.cov - , coverageClass: coverageClass - })); - }); -} - -/** - * Return coverage class for `n`. - * - * @return {String} - * @api private - */ - -function coverageClass(n) { - if (n >= 75) return 'high'; - if (n >= 50) return 'medium'; - if (n >= 25) return 'low'; - return 'terrible'; -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/html.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/html.js deleted file mode 100644 index f09279b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/html.js +++ /dev/null @@ -1,253 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils') - , Progress = require('../browser/progress') - , escape = utils.escape; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Expose `Doc`. - */ - -exports = module.exports = HTML; - -/** - * Stats template. - */ - -var statsTemplate = ''; - -/** - * Initialize a new `Doc` reporter. - * - * @param {Runner} runner - * @api public - */ - -function HTML(runner, root) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total - , stat = fragment(statsTemplate) - , items = stat.getElementsByTagName('li') - , passes = items[1].getElementsByTagName('em')[0] - , passesLink = items[1].getElementsByTagName('a')[0] - , failures = items[2].getElementsByTagName('em')[0] - , failuresLink = items[2].getElementsByTagName('a')[0] - , duration = items[3].getElementsByTagName('em')[0] - , canvas = stat.getElementsByTagName('canvas')[0] - , report = fragment('
                ') - , stack = [report] - , progress - , ctx - - root = root || document.getElementById('mocha'); - - if (canvas.getContext) { - var ratio = window.devicePixelRatio || 1; - canvas.style.width = canvas.width; - canvas.style.height = canvas.height; - canvas.width *= ratio; - canvas.height *= ratio; - ctx = canvas.getContext('2d'); - ctx.scale(ratio, ratio); - progress = new Progress; - } - - if (!root) return error('#mocha div missing, add it to your document'); - - // pass toggle - on(passesLink, 'click', function(){ - unhide(); - var name = /pass/.test(report.className) ? '' : ' pass'; - report.className = report.className.replace(/fail|pass/g, '') + name; - if (report.className.trim()) hideSuitesWithout('test pass'); - }); - - // failure toggle - on(failuresLink, 'click', function(){ - unhide(); - var name = /fail/.test(report.className) ? '' : ' fail'; - report.className = report.className.replace(/fail|pass/g, '') + name; - if (report.className.trim()) hideSuitesWithout('test fail'); - }); - - root.appendChild(stat); - root.appendChild(report); - - if (progress) progress.size(40); - - runner.on('suite', function(suite){ - if (suite.root) return; - - // suite - var url = '?grep=' + encodeURIComponent(suite.fullTitle()); - var el = fragment('
              • %s

              • ', url, escape(suite.title)); - - // container - stack[0].appendChild(el); - stack.unshift(document.createElement('ul')); - el.appendChild(stack[0]); - }); - - runner.on('suite end', function(suite){ - if (suite.root) return; - stack.shift(); - }); - - runner.on('fail', function(test, err){ - if ('hook' == test.type) runner.emit('test end', test); - }); - - runner.on('test end', function(test){ - // TODO: add to stats - var percent = stats.tests / this.total * 100 | 0; - if (progress) progress.update(percent).draw(ctx); - - // update stats - var ms = new Date - stats.start; - text(passes, stats.passes); - text(failures, stats.failures); - text(duration, (ms / 1000).toFixed(2)); - - // test - if ('passed' == test.state) { - var el = fragment('
              • %e%ems

              • ', test.speed, test.title, test.duration, encodeURIComponent(test.fullTitle())); - } else if (test.pending) { - var el = fragment('
              • %e

              • ', test.title); - } else { - var el = fragment('
              • %e

              • ', test.title, encodeURIComponent(test.fullTitle())); - var str = test.err.stack || test.err.toString(); - - // FF / Opera do not add the message - if (!~str.indexOf(test.err.message)) { - str = test.err.message + '\n' + str; - } - - // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we - // check for the result of the stringifying. - if ('[object Error]' == str) str = test.err.message; - - // Safari doesn't give you a stack. Let's at least provide a source line. - if (!test.err.stack && test.err.sourceURL && test.err.line !== undefined) { - str += "\n(" + test.err.sourceURL + ":" + test.err.line + ")"; - } - - el.appendChild(fragment('
                %e
                ', str)); - } - - // toggle code - // TODO: defer - if (!test.pending) { - var h2 = el.getElementsByTagName('h2')[0]; - - on(h2, 'click', function(){ - pre.style.display = 'none' == pre.style.display - ? 'block' - : 'none'; - }); - - var pre = fragment('
                %e
                ', utils.clean(test.fn.toString())); - el.appendChild(pre); - pre.style.display = 'none'; - } - - // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack. - if (stack[0]) stack[0].appendChild(el); - }); -} - -/** - * Display error `msg`. - */ - -function error(msg) { - document.body.appendChild(fragment('
                %s
                ', msg)); -} - -/** - * Return a DOM fragment from `html`. - */ - -function fragment(html) { - var args = arguments - , div = document.createElement('div') - , i = 1; - - div.innerHTML = html.replace(/%([se])/g, function(_, type){ - switch (type) { - case 's': return String(args[i++]); - case 'e': return escape(args[i++]); - } - }); - - return div.firstChild; -} - -/** - * Check for suites that do not have elements - * with `classname`, and hide them. - */ - -function hideSuitesWithout(classname) { - var suites = document.getElementsByClassName('suite'); - for (var i = 0; i < suites.length; i++) { - var els = suites[i].getElementsByClassName(classname); - if (0 == els.length) suites[i].className += ' hidden'; - } -} - -/** - * Unhide .hidden suites. - */ - -function unhide() { - var els = document.getElementsByClassName('suite hidden'); - for (var i = 0; i < els.length; ++i) { - els[i].className = els[i].className.replace('suite hidden', 'suite'); - } -} - -/** - * Set `el` text to `str`. - */ - -function text(el, str) { - if (el.textContent) { - el.textContent = str; - } else { - el.innerText = str; - } -} - -/** - * Listen on `event` with callback `fn`. - */ - -function on(el, event, fn) { - if (el.addEventListener) { - el.addEventListener(event, fn, false); - } else { - el.attachEvent('on' + event, fn); - } -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/index.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/index.js deleted file mode 100644 index 4750f26..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/index.js +++ /dev/null @@ -1,19 +0,0 @@ - -exports.Base = require('./base'); -exports.Dot = require('./dot'); -exports.Doc = require('./doc'); -exports.TAP = require('./tap'); -exports.JSON = require('./json'); -exports.HTML = require('./html'); -exports.List = require('./list'); -exports.Min = require('./min'); -exports.Spec = require('./spec'); -exports.Nyan = require('./nyan'); -exports.XUnit = require('./xunit'); -exports.Markdown = require('./markdown'); -exports.Progress = require('./progress'); -exports.Landing = require('./landing'); -exports.JSONCov = require('./json-cov'); -exports.HTMLCov = require('./html-cov'); -exports.JSONStream = require('./json-stream'); -exports.Teamcity = require('./teamcity'); diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json-cov.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json-cov.js deleted file mode 100644 index 73d0009..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json-cov.js +++ /dev/null @@ -1,153 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `JSONCov`. - */ - -exports = module.exports = JSONCov; - -/** - * Initialize a new `JsCoverage` reporter. - * - * @param {Runner} runner - * @param {Boolean} output - * @api public - */ - -function JSONCov(runner, output) { - var self = this - , output = 1 == arguments.length ? true : output; - - Base.call(this, runner); - - var tests = [] - , failures = [] - , passes = []; - - runner.on('test end', function(test){ - tests.push(test); - }); - - runner.on('pass', function(test){ - passes.push(test); - }); - - runner.on('fail', function(test){ - failures.push(test); - }); - - runner.on('end', function(){ - var cov = global._$jscoverage || {}; - var result = self.cov = map(cov); - result.stats = self.stats; - result.tests = tests.map(clean); - result.failures = failures.map(clean); - result.passes = passes.map(clean); - if (!output) return; - process.stdout.write(JSON.stringify(result, null, 2 )); - }); -} - -/** - * Map jscoverage data to a JSON structure - * suitable for reporting. - * - * @param {Object} cov - * @return {Object} - * @api private - */ - -function map(cov) { - var ret = { - instrumentation: 'node-jscoverage' - , sloc: 0 - , hits: 0 - , misses: 0 - , coverage: 0 - , files: [] - }; - - for (var filename in cov) { - var data = coverage(filename, cov[filename]); - ret.files.push(data); - ret.hits += data.hits; - ret.misses += data.misses; - ret.sloc += data.sloc; - } - - ret.files.sort(function(a, b) { - return a.filename.localeCompare(b.filename); - }); - - if (ret.sloc > 0) { - ret.coverage = (ret.hits / ret.sloc) * 100; - } - - return ret; -}; - -/** - * Map jscoverage data for a single source file - * to a JSON structure suitable for reporting. - * - * @param {String} filename name of the source file - * @param {Object} data jscoverage coverage data - * @return {Object} - * @api private - */ - -function coverage(filename, data) { - var ret = { - filename: filename, - coverage: 0, - hits: 0, - misses: 0, - sloc: 0, - source: {} - }; - - data.source.forEach(function(line, num){ - num++; - - if (data[num] === 0) { - ret.misses++; - ret.sloc++; - } else if (data[num] !== undefined) { - ret.hits++; - ret.sloc++; - } - - ret.source[num] = { - source: line - , coverage: data[num] === undefined - ? '' - : data[num] - }; - }); - - ret.coverage = ret.hits / ret.sloc * 100; - - return ret; -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json-stream.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json-stream.js deleted file mode 100644 index 7cb8fbe..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json-stream.js +++ /dev/null @@ -1,61 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `List`. - */ - -exports = module.exports = List; - -/** - * Initialize a new `List` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function List(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total; - - runner.on('start', function(){ - console.log(JSON.stringify(['start', { total: total }])); - }); - - runner.on('pass', function(test){ - console.log(JSON.stringify(['pass', clean(test)])); - }); - - runner.on('fail', function(test, err){ - console.log(JSON.stringify(['fail', clean(test)])); - }); - - runner.on('end', function(){ - process.stdout.write(JSON.stringify(['end', self.stats])); - }); -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json.js deleted file mode 100644 index a699f50..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/json.js +++ /dev/null @@ -1,70 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `JSON`. - */ - -exports = module.exports = JSONReporter; - -/** - * Initialize a new `JSON` reporter. - * - * @param {Runner} runner - * @api public - */ - -function JSONReporter(runner) { - var self = this; - Base.call(this, runner); - - var tests = [] - , failures = [] - , passes = []; - - runner.on('test end', function(test){ - tests.push(test); - }); - - runner.on('pass', function(test){ - passes.push(test); - }); - - runner.on('fail', function(test){ - failures.push(test); - }); - - runner.on('end', function(){ - var obj = { - stats: self.stats - , tests: tests.map(clean) - , failures: failures.map(clean) - , passes: passes.map(clean) - }; - - process.stdout.write(JSON.stringify(obj, null, 2)); - }); -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/landing.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/landing.js deleted file mode 100644 index bf064f6..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/landing.js +++ /dev/null @@ -1,97 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Landing`. - */ - -exports = module.exports = Landing; - -/** - * Airplane color. - */ - -Base.colors.plane = 0; - -/** - * Airplane crash color. - */ - -Base.colors['plane crash'] = 31; - -/** - * Runway color. - */ - -Base.colors.runway = 90; - -/** - * Initialize a new `Landing` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Landing(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , total = runner.total - , stream = process.stdout - , plane = color('plane', '✈') - , crashed = -1 - , n = 0; - - function runway() { - var buf = Array(width).join('-'); - return ' ' + color('runway', buf); - } - - runner.on('start', function(){ - stream.write('\n '); - cursor.hide(); - }); - - runner.on('test end', function(test){ - // check if the plane crashed - var col = -1 == crashed - ? width * ++n / total | 0 - : crashed; - - // show the crash - if ('failed' == test.state) { - plane = color('plane crash', '✈'); - crashed = col; - } - - // render landing strip - stream.write('\u001b[4F\n\n'); - stream.write(runway()); - stream.write('\n '); - stream.write(color('runway', Array(col).join('⋅'))); - stream.write(plane) - stream.write(color('runway', Array(width - col).join('⋅') + '\n')); - stream.write(runway()); - stream.write('\u001b[0m'); - }); - - runner.on('end', function(){ - cursor.show(); - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -Landing.prototype.__proto__ = Base.prototype; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/list.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/list.js deleted file mode 100644 index 3328e15..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/list.js +++ /dev/null @@ -1,64 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `List`. - */ - -exports = module.exports = List; - -/** - * Initialize a new `List` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function List(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , n = 0; - - runner.on('start', function(){ - console.log(); - }); - - runner.on('test', function(test){ - process.stdout.write(color('pass', ' ' + test.fullTitle() + ': ')); - }); - - runner.on('pending', function(test){ - var fmt = color('checkmark', ' -') - + color('pending', ' %s'); - console.log(fmt, test.fullTitle()); - }); - - runner.on('pass', function(test){ - var fmt = color('checkmark', ' '+Base.symbols.dot) - + color('pass', ' %s: ') - + color(test.speed, '%dms'); - cursor.CR(); - console.log(fmt, test.fullTitle(), test.duration); - }); - - runner.on('fail', function(test, err){ - cursor.CR(); - console.log(color('fail', ' %d) %s'), ++n, test.fullTitle()); - }); - - runner.on('end', self.epilogue.bind(self)); -} - -/** - * Inherit from `Base.prototype`. - */ - -List.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/markdown.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/markdown.js deleted file mode 100644 index 6383a64..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/markdown.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils'); - -/** - * Expose `Markdown`. - */ - -exports = module.exports = Markdown; - -/** - * Initialize a new `Markdown` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Markdown(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , level = 0 - , buf = ''; - - function title(str) { - return Array(level).join('#') + ' ' + str; - } - - function indent() { - return Array(level).join(' '); - } - - function mapTOC(suite, obj) { - var ret = obj; - obj = obj[suite.title] = obj[suite.title] || { suite: suite }; - suite.suites.forEach(function(suite){ - mapTOC(suite, obj); - }); - return ret; - } - - function stringifyTOC(obj, level) { - ++level; - var buf = ''; - var link; - for (var key in obj) { - if ('suite' == key) continue; - if (key) link = ' - [' + key + '](#' + utils.slug(obj[key].suite.fullTitle()) + ')\n'; - if (key) buf += Array(level).join(' ') + link; - buf += stringifyTOC(obj[key], level); - } - --level; - return buf; - } - - function generateTOC(suite) { - var obj = mapTOC(suite, {}); - return stringifyTOC(obj, 0); - } - - generateTOC(runner.suite); - - runner.on('suite', function(suite){ - ++level; - var slug = utils.slug(suite.fullTitle()); - buf += '' + '\n'; - buf += title(suite.title) + '\n'; - }); - - runner.on('suite end', function(suite){ - --level; - }); - - runner.on('pass', function(test){ - var code = utils.clean(test.fn.toString()); - buf += test.title + '.\n'; - buf += '\n```js\n'; - buf += code + '\n'; - buf += '```\n\n'; - }); - - runner.on('end', function(){ - process.stdout.write('# TOC\n'); - process.stdout.write(generateTOC(runner.suite)); - process.stdout.write(buf); - }); -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/min.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/min.js deleted file mode 100644 index 1b6117d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/min.js +++ /dev/null @@ -1,38 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `Min`. - */ - -exports = module.exports = Min; - -/** - * Initialize a new `Min` minimal test reporter (best used with --watch). - * - * @param {Runner} runner - * @api public - */ - -function Min(runner) { - Base.call(this, runner); - - runner.on('start', function(){ - // clear screen - process.stdout.write('\u001b[2J'); - // set cursor position - process.stdout.write('\u001b[1;3H'); - }); - - runner.on('end', this.epilogue.bind(this)); -} - -/** - * Inherit from `Base.prototype`. - */ - -Min.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/nyan.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/nyan.js deleted file mode 100644 index 4501f6b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/nyan.js +++ /dev/null @@ -1,260 +0,0 @@ -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `Dot`. - */ - -exports = module.exports = NyanCat; - -/** - * Initialize a new `Dot` matrix test reporter. - * - * @param {Runner} runner - * @api public - */ - -function NyanCat(runner) { - Base.call(this, runner); - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , rainbowColors = this.rainbowColors = self.generateColors() - , colorIndex = this.colorIndex = 0 - , numerOfLines = this.numberOfLines = 4 - , trajectories = this.trajectories = [[], [], [], []] - , nyanCatWidth = this.nyanCatWidth = 11 - , trajectoryWidthMax = this.trajectoryWidthMax = (width - nyanCatWidth) - , scoreboardWidth = this.scoreboardWidth = 5 - , tick = this.tick = 0 - , n = 0; - - runner.on('start', function(){ - Base.cursor.hide(); - self.draw(); - }); - - runner.on('pending', function(test){ - self.draw(); - }); - - runner.on('pass', function(test){ - self.draw(); - }); - - runner.on('fail', function(test, err){ - self.draw(); - }); - - runner.on('end', function(){ - Base.cursor.show(); - for (var i = 0; i < self.numberOfLines; i++) write('\n'); - self.epilogue(); - }); -} - -/** - * Draw the nyan cat - * - * @api private - */ - -NyanCat.prototype.draw = function(){ - this.appendRainbow(); - this.drawScoreboard(); - this.drawRainbow(); - this.drawNyanCat(); - this.tick = !this.tick; -}; - -/** - * Draw the "scoreboard" showing the number - * of passes, failures and pending tests. - * - * @api private - */ - -NyanCat.prototype.drawScoreboard = function(){ - var stats = this.stats; - var colors = Base.colors; - - function draw(color, n) { - write(' '); - write('\u001b[' + color + 'm' + n + '\u001b[0m'); - write('\n'); - } - - draw(colors.green, stats.passes); - draw(colors.fail, stats.failures); - draw(colors.pending, stats.pending); - write('\n'); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Append the rainbow. - * - * @api private - */ - -NyanCat.prototype.appendRainbow = function(){ - var segment = this.tick ? '_' : '-'; - var rainbowified = this.rainbowify(segment); - - for (var index = 0; index < this.numberOfLines; index++) { - var trajectory = this.trajectories[index]; - if (trajectory.length >= this.trajectoryWidthMax) trajectory.shift(); - trajectory.push(rainbowified); - } -}; - -/** - * Draw the rainbow. - * - * @api private - */ - -NyanCat.prototype.drawRainbow = function(){ - var self = this; - - this.trajectories.forEach(function(line, index) { - write('\u001b[' + self.scoreboardWidth + 'C'); - write(line.join('')); - write('\n'); - }); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Draw the nyan cat - * - * @api private - */ - -NyanCat.prototype.drawNyanCat = function() { - var self = this; - var startWidth = this.scoreboardWidth + this.trajectories[0].length; - var color = '\u001b[' + startWidth + 'C'; - var padding = ''; - - write(color); - write('_,------,'); - write('\n'); - - write(color); - padding = self.tick ? ' ' : ' '; - write('_|' + padding + '/\\_/\\ '); - write('\n'); - - write(color); - padding = self.tick ? '_' : '__'; - var tail = self.tick ? '~' : '^'; - var face; - write(tail + '|' + padding + this.face() + ' '); - write('\n'); - - write(color); - padding = self.tick ? ' ' : ' '; - write(padding + '"" "" '); - write('\n'); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Draw nyan cat face. - * - * @return {String} - * @api private - */ - -NyanCat.prototype.face = function() { - var stats = this.stats; - if (stats.failures) { - return '( x .x)'; - } else if (stats.pending) { - return '( o .o)'; - } else if(stats.passes) { - return '( ^ .^)'; - } else { - return '( - .-)'; - } -} - -/** - * Move cursor up `n`. - * - * @param {Number} n - * @api private - */ - -NyanCat.prototype.cursorUp = function(n) { - write('\u001b[' + n + 'A'); -}; - -/** - * Move cursor down `n`. - * - * @param {Number} n - * @api private - */ - -NyanCat.prototype.cursorDown = function(n) { - write('\u001b[' + n + 'B'); -}; - -/** - * Generate rainbow colors. - * - * @return {Array} - * @api private - */ - -NyanCat.prototype.generateColors = function(){ - var colors = []; - - for (var i = 0; i < (6 * 7); i++) { - var pi3 = Math.floor(Math.PI / 3); - var n = (i * (1.0 / 6)); - var r = Math.floor(3 * Math.sin(n) + 3); - var g = Math.floor(3 * Math.sin(n + 2 * pi3) + 3); - var b = Math.floor(3 * Math.sin(n + 4 * pi3) + 3); - colors.push(36 * r + 6 * g + b + 16); - } - - return colors; -}; - -/** - * Apply rainbow to the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -NyanCat.prototype.rainbowify = function(str){ - var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length]; - this.colorIndex += 1; - return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m'; -}; - -/** - * Stdout helper. - */ - -function write(string) { - process.stdout.write(string); -} - -/** - * Inherit from `Base.prototype`. - */ - -NyanCat.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/progress.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/progress.js deleted file mode 100644 index 5953638..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/progress.js +++ /dev/null @@ -1,86 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Progress`. - */ - -exports = module.exports = Progress; - -/** - * General progress bar color. - */ - -Base.colors.progress = 90; - -/** - * Initialize a new `Progress` bar test reporter. - * - * @param {Runner} runner - * @param {Object} options - * @api public - */ - -function Progress(runner, options) { - Base.call(this, runner); - - var self = this - , options = options || {} - , stats = this.stats - , width = Base.window.width * .50 | 0 - , total = runner.total - , complete = 0 - , max = Math.max; - - // default chars - options.open = options.open || '['; - options.complete = options.complete || '▬'; - options.incomplete = options.incomplete || Base.symbols.dot; - options.close = options.close || ']'; - options.verbose = false; - - // tests started - runner.on('start', function(){ - console.log(); - cursor.hide(); - }); - - // tests complete - runner.on('test end', function(){ - complete++; - var incomplete = total - complete - , percent = complete / total - , n = width * percent | 0 - , i = width - n; - - cursor.CR(); - process.stdout.write('\u001b[J'); - process.stdout.write(color('progress', ' ' + options.open)); - process.stdout.write(Array(n).join(options.complete)); - process.stdout.write(Array(i).join(options.incomplete)); - process.stdout.write(color('progress', options.close)); - if (options.verbose) { - process.stdout.write(color('progress', ' ' + complete + ' of ' + total)); - } - }); - - // tests are complete, output some stats - // and the failures if any - runner.on('end', function(){ - cursor.show(); - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -Progress.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/spec.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/spec.js deleted file mode 100644 index cd97261..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/spec.js +++ /dev/null @@ -1,87 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Spec`. - */ - -exports = module.exports = Spec; - -/** - * Initialize a new `Spec` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function Spec(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , indents = 0 - , n = 0; - - function indent() { - return Array(indents).join(' ') - } - - runner.on('start', function(){ - console.log(); - }); - - runner.on('suite', function(suite){ - ++indents; - console.log(color('suite', '%s%s'), indent(), suite.title); - }); - - runner.on('suite end', function(suite){ - --indents; - if (1 == indents) console.log(); - }); - - runner.on('test', function(test){ - process.stdout.write(indent() + color('pass', ' ◦ ' + test.title + ': ')); - }); - - runner.on('pending', function(test){ - var fmt = indent() + color('pending', ' - %s'); - console.log(fmt, test.title); - }); - - runner.on('pass', function(test){ - if ('fast' == test.speed) { - var fmt = indent() - + color('checkmark', ' ' + Base.symbols.ok) - + color('pass', ' %s '); - cursor.CR(); - console.log(fmt, test.title); - } else { - var fmt = indent() - + color('checkmark', ' ' + Base.symbols.ok) - + color('pass', ' %s ') - + color(test.speed, '(%dms)'); - cursor.CR(); - console.log(fmt, test.title, test.duration); - } - }); - - runner.on('fail', function(test, err){ - cursor.CR(); - console.log(indent() + color('fail', ' %d) %s'), ++n, test.title); - }); - - runner.on('end', self.epilogue.bind(self)); -} - -/** - * Inherit from `Base.prototype`. - */ - -Spec.prototype.__proto__ = Base.prototype; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/tap.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/tap.js deleted file mode 100644 index 2bcd995..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/tap.js +++ /dev/null @@ -1,73 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `TAP`. - */ - -exports = module.exports = TAP; - -/** - * Initialize a new `TAP` reporter. - * - * @param {Runner} runner - * @api public - */ - -function TAP(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , n = 1 - , passes = 0 - , failures = 0; - - runner.on('start', function(){ - var total = runner.grepTotal(runner.suite); - console.log('%d..%d', 1, total); - }); - - runner.on('test end', function(){ - ++n; - }); - - runner.on('pending', function(test){ - console.log('ok %d %s # SKIP -', n, title(test)); - }); - - runner.on('pass', function(test){ - passes++; - console.log('ok %d %s', n, title(test)); - }); - - runner.on('fail', function(test, err){ - failures++; - console.log('not ok %d %s', n, title(test)); - if (err.stack) console.log(err.stack.replace(/^/gm, ' ')); - }); - - runner.on('end', function(){ - console.log('# tests ' + (passes + failures)); - console.log('# pass ' + passes); - console.log('# fail ' + failures); - }); -} - -/** - * Return a TAP-safe title of `test` - * - * @param {Object} test - * @return {String} - * @api private - */ - -function title(test) { - return test.fullTitle().replace(/#/g, ''); -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/teamcity.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/teamcity.js deleted file mode 100644 index 032eea7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/teamcity.js +++ /dev/null @@ -1,65 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `Teamcity`. - */ - -exports = module.exports = Teamcity; - -/** - * Initialize a new `Teamcity` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Teamcity(runner) { - Base.call(this, runner); - var stats = this.stats; - - runner.on('start', function() { - console.log("##teamcity[testSuiteStarted name='mocha.suite']"); - }); - - runner.on('test', function(test) { - console.log("##teamcity[testStarted name='" + escape(test.fullTitle()) + "']"); - }); - - runner.on('fail', function(test, err) { - console.log("##teamcity[testFailed name='" + escape(test.fullTitle()) + "' message='" + escape(err.message) + "']"); - }); - - runner.on('pending', function(test) { - console.log("##teamcity[testIgnored name='" + escape(test.fullTitle()) + "' message='pending']"); - }); - - runner.on('test end', function(test) { - console.log("##teamcity[testFinished name='" + escape(test.fullTitle()) + "' duration='" + test.duration + "']"); - }); - - runner.on('end', function() { - console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='" + stats.duration + "']"); - }); -} - -/** - * Escape the given `str`. - */ - -function escape(str) { - return str - .replace(/\|/g, "||") - .replace(/\n/g, "|n") - .replace(/\r/g, "|r") - .replace(/\[/g, "|[") - .replace(/\]/g, "|]") - .replace(/\u0085/g, "|x") - .replace(/\u2028/g, "|l") - .replace(/\u2029/g, "|p") - .replace(/'/g, "|'"); -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/coverage.jade b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/coverage.jade deleted file mode 100644 index b78119f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/coverage.jade +++ /dev/null @@ -1,50 +0,0 @@ -!!! 5 -html - head - title Coverage - include script.html - include style.html - body - #coverage - h1#overview Coverage - include menu - - #stats(class=coverageClass(cov.coverage)) - .percentage #{cov.coverage | 0}% - .sloc= cov.sloc - .hits= cov.hits - .misses= cov.misses - - #files - for file in cov.files - .file - h2(id=file.filename)= file.filename - #stats(class=coverageClass(file.coverage)) - .percentage #{file.coverage | 0}% - .sloc= file.sloc - .hits= file.hits - .misses= file.misses - - table#source - thead - tr - th Line - th Hits - th Source - tbody - for line, number in file.source - if line.coverage > 0 - tr.hit - td.line= number - td.hits= line.coverage - td.source= line.source - else if 0 === line.coverage - tr.miss - td.line= number - td.hits 0 - td.source= line.source - else - tr - td.line= number - td.hits - td.source= line.source || ' ' diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/menu.jade b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/menu.jade deleted file mode 100644 index e9ba464..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/menu.jade +++ /dev/null @@ -1,13 +0,0 @@ -#menu - li - a(href='#overview') overview - for file in cov.files - li - span.cov(class=coverageClass(file.coverage)) #{file.coverage | 0} - a(href='##{file.filename}') - segments = file.filename.split('/') - basename = segments.pop() - if segments.length - span.dirname= segments.join('/') + '/' - span.basename= basename - a#logo(href='http://visionmedia.github.io/mocha/') m diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/script.html b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/script.html deleted file mode 100644 index 073cf79..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/script.html +++ /dev/null @@ -1,34 +0,0 @@ - diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/style.html b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/style.html deleted file mode 100644 index f374fbc..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/templates/style.html +++ /dev/null @@ -1,307 +0,0 @@ - \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/xunit.js b/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/xunit.js deleted file mode 100644 index 1ed5ee9..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/reporters/xunit.js +++ /dev/null @@ -1,115 +0,0 @@ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils') - , escape = utils.escape; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Expose `XUnit`. - */ - -exports = module.exports = XUnit; - -/** - * Initialize a new `XUnit` reporter. - * - * @param {Runner} runner - * @api public - */ - -function XUnit(runner) { - Base.call(this, runner); - var stats = this.stats - , tests = [] - , self = this; - - runner.on('pass', function(test){ - tests.push(test); - }); - - runner.on('fail', function(test){ - tests.push(test); - }); - - runner.on('end', function(){ - console.log(tag('testsuite', { - name: 'Mocha Tests' - , tests: stats.tests - , failures: stats.failures - , errors: stats.failures - , skipped: stats.tests - stats.failures - stats.passes - , timestamp: (new Date).toUTCString() - , time: (stats.duration / 1000) || 0 - }, false)); - - tests.forEach(test); - console.log(''); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -XUnit.prototype.__proto__ = Base.prototype; - -/** - * Output tag for the given `test.` - */ - -function test(test) { - var attrs = { - classname: test.parent.fullTitle() - , name: test.title - , time: test.duration / 1000 - }; - - if ('failed' == test.state) { - var err = test.err; - attrs.message = escape(err.message); - console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack)))); - } else if (test.pending) { - console.log(tag('testcase', attrs, false, tag('skipped', {}, true))); - } else { - console.log(tag('testcase', attrs, true) ); - } -} - -/** - * HTML tag helper. - */ - -function tag(name, attrs, close, content) { - var end = close ? '/>' : '>' - , pairs = [] - , tag; - - for (var key in attrs) { - pairs.push(key + '="' + escape(attrs[key]) + '"'); - } - - tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end; - if (content) tag += content + ''; -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/runnable.js b/node_modules/grunt-mocha/node_modules/mocha/lib/runnable.js deleted file mode 100644 index b34bf1e..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/runnable.js +++ /dev/null @@ -1,217 +0,0 @@ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , debug = require('debug')('mocha:runnable') - , milliseconds = require('./ms'); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Object#toString(). - */ - -var toString = Object.prototype.toString; - -/** - * Expose `Runnable`. - */ - -module.exports = Runnable; - -/** - * Initialize a new `Runnable` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Runnable(title, fn) { - this.title = title; - this.fn = fn; - this.async = fn && fn.length; - this.sync = ! this.async; - this._timeout = 2000; - this._slow = 75; - this.timedOut = false; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Runnable.prototype.__proto__ = EventEmitter.prototype; - -/** - * Set & get timeout `ms`. - * - * @param {Number|String} ms - * @return {Runnable|Number} ms or self - * @api private - */ - -Runnable.prototype.timeout = function(ms){ - if (0 == arguments.length) return this._timeout; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._timeout = ms; - if (this.timer) this.resetTimeout(); - return this; -}; - -/** - * Set & get slow `ms`. - * - * @param {Number|String} ms - * @return {Runnable|Number} ms or self - * @api private - */ - -Runnable.prototype.slow = function(ms){ - if (0 === arguments.length) return this._slow; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._slow = ms; - return this; -}; - -/** - * Return the full title generated by recursively - * concatenating the parent's full title. - * - * @return {String} - * @api public - */ - -Runnable.prototype.fullTitle = function(){ - return this.parent.fullTitle() + ' ' + this.title; -}; - -/** - * Clear the timeout. - * - * @api private - */ - -Runnable.prototype.clearTimeout = function(){ - clearTimeout(this.timer); -}; - -/** - * Inspect the runnable void of private properties. - * - * @return {String} - * @api private - */ - -Runnable.prototype.inspect = function(){ - return JSON.stringify(this, function(key, val){ - if ('_' == key[0]) return; - if ('parent' == key) return '#'; - if ('ctx' == key) return '#'; - return val; - }, 2); -}; - -/** - * Reset the timeout. - * - * @api private - */ - -Runnable.prototype.resetTimeout = function(){ - var self = this; - var ms = this.timeout() || 1e9; - - this.clearTimeout(); - this.timer = setTimeout(function(){ - self.callback(new Error('timeout of ' + ms + 'ms exceeded')); - self.timedOut = true; - }, ms); -}; - -/** - * Run the test and invoke `fn(err)`. - * - * @param {Function} fn - * @api private - */ - -Runnable.prototype.run = function(fn){ - var self = this - , ms = this.timeout() - , start = new Date - , ctx = this.ctx - , finished - , emitted; - - if (ctx) ctx.runnable(this); - - // timeout - if (this.async) { - if (ms) { - this.timer = setTimeout(function(){ - done(new Error('timeout of ' + ms + 'ms exceeded')); - self.timedOut = true; - }, ms); - } - } - - // called multiple times - function multiple(err) { - if (emitted) return; - emitted = true; - self.emit('error', err || new Error('done() called multiple times')); - } - - // finished - function done(err) { - if (self.timedOut) return; - if (finished) return multiple(err); - self.clearTimeout(); - self.duration = new Date - start; - finished = true; - fn(err); - } - - // for .resetTimeout() - this.callback = done; - - // async - if (this.async) { - try { - this.fn.call(ctx, function(err){ - if (err instanceof Error || toString.call(err) === "[object Error]") return done(err); - if (null != err) return done(new Error('done() invoked with non-Error: ' + err)); - done(); - }); - } catch (err) { - done(err); - } - return; - } - - if (this.asyncOnly) { - return done(new Error('--async-only option in use without declaring `done()`')); - } - - // sync - try { - if (!this.pending) this.fn.call(ctx); - this.duration = new Date - start; - fn(); - } catch (err) { - fn(err); - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/runner.js b/node_modules/grunt-mocha/node_modules/mocha/lib/runner.js deleted file mode 100644 index c42e449..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/runner.js +++ /dev/null @@ -1,547 +0,0 @@ -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , debug = require('debug')('mocha:runner') - , Test = require('./test') - , utils = require('./utils') - , filter = utils.filter - , keys = utils.keys; - -/** - * Non-enumerable globals. - */ - -var globals = [ - 'setTimeout', - 'clearTimeout', - 'setInterval', - 'clearInterval', - 'XMLHttpRequest', - 'Date' -]; - -/** - * Expose `Runner`. - */ - -module.exports = Runner; - -/** - * Initialize a `Runner` for the given `suite`. - * - * Events: - * - * - `start` execution started - * - `end` execution complete - * - `suite` (suite) test suite execution started - * - `suite end` (suite) all tests (and sub-suites) have finished - * - `test` (test) test execution started - * - `test end` (test) test completed - * - `hook` (hook) hook execution started - * - `hook end` (hook) hook complete - * - `pass` (test) test passed - * - `fail` (test, err) test failed - * - `pending` (test) test pending - * - * @api public - */ - -function Runner(suite) { - var self = this; - this._globals = []; - this.suite = suite; - this.total = suite.total(); - this.failures = 0; - this.on('test end', function(test){ self.checkGlobals(test); }); - this.on('hook end', function(hook){ self.checkGlobals(hook); }); - this.grep(/.*/); - this.globals(this.globalProps().concat(['errno'])); -} - -/** - * Wrapper for setImmediate, process.nextTick, or browser polyfill. - * - * @param {Function} fn - * @api private - */ - -Runner.immediately = global.setImmediate || process.nextTick; - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Runner.prototype.__proto__ = EventEmitter.prototype; - -/** - * Run tests with full titles matching `re`. Updates runner.total - * with number of tests matched. - * - * @param {RegExp} re - * @param {Boolean} invert - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.grep = function(re, invert){ - debug('grep %s', re); - this._grep = re; - this._invert = invert; - this.total = this.grepTotal(this.suite); - return this; -}; - -/** - * Returns the number of tests matching the grep search for the - * given suite. - * - * @param {Suite} suite - * @return {Number} - * @api public - */ - -Runner.prototype.grepTotal = function(suite) { - var self = this; - var total = 0; - - suite.eachTest(function(test){ - var match = self._grep.test(test.fullTitle()); - if (self._invert) match = !match; - if (match) total++; - }); - - return total; -}; - -/** - * Return a list of global properties. - * - * @return {Array} - * @api private - */ - -Runner.prototype.globalProps = function() { - var props = utils.keys(global); - - // non-enumerables - for (var i = 0; i < globals.length; ++i) { - if (~utils.indexOf(props, globals[i])) continue; - props.push(globals[i]); - } - - return props; -}; - -/** - * Allow the given `arr` of globals. - * - * @param {Array} arr - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.globals = function(arr){ - if (0 == arguments.length) return this._globals; - debug('globals %j', arr); - utils.forEach(arr, function(arr){ - this._globals.push(arr); - }, this); - return this; -}; - -/** - * Check for global variable leaks. - * - * @api private - */ - -Runner.prototype.checkGlobals = function(test){ - if (this.ignoreLeaks) return; - var ok = this._globals; - var globals = this.globalProps(); - var isNode = process.kill; - var leaks; - - // check length - 2 ('errno' and 'location' globals) - if (isNode && 1 == ok.length - globals.length) return - else if (2 == ok.length - globals.length) return; - - leaks = filterLeaks(ok, globals); - this._globals = this._globals.concat(leaks); - - if (leaks.length > 1) { - this.fail(test, new Error('global leaks detected: ' + leaks.join(', ') + '')); - } else if (leaks.length) { - this.fail(test, new Error('global leak detected: ' + leaks[0])); - } -}; - -/** - * Fail the given `test`. - * - * @param {Test} test - * @param {Error} err - * @api private - */ - -Runner.prototype.fail = function(test, err){ - ++this.failures; - test.state = 'failed'; - - if ('string' == typeof err) { - err = new Error('the string "' + err + '" was thrown, throw an Error :)'); - } - - this.emit('fail', test, err); -}; - -/** - * Fail the given `hook` with `err`. - * - * Hook failures (currently) hard-end due - * to that fact that a failing hook will - * surely cause subsequent tests to fail, - * causing jumbled reporting. - * - * @param {Hook} hook - * @param {Error} err - * @api private - */ - -Runner.prototype.failHook = function(hook, err){ - this.fail(hook, err); - this.emit('end'); -}; - -/** - * Run hook `name` callbacks and then invoke `fn()`. - * - * @param {String} name - * @param {Function} function - * @api private - */ - -Runner.prototype.hook = function(name, fn){ - var suite = this.suite - , hooks = suite['_' + name] - , self = this - , timer; - - function next(i) { - var hook = hooks[i]; - if (!hook) return fn(); - if (self.failures && suite.bail()) return fn(); - self.currentRunnable = hook; - - hook.ctx.currentTest = self.test; - - self.emit('hook', hook); - - hook.on('error', function(err){ - self.failHook(hook, err); - }); - - hook.run(function(err){ - hook.removeAllListeners('error'); - var testError = hook.error(); - if (testError) self.fail(self.test, testError); - if (err) return self.failHook(hook, err); - self.emit('hook end', hook); - delete hook.ctx.currentTest; - next(++i); - }); - } - - Runner.immediately(function(){ - next(0); - }); -}; - -/** - * Run hook `name` for the given array of `suites` - * in order, and callback `fn(err)`. - * - * @param {String} name - * @param {Array} suites - * @param {Function} fn - * @api private - */ - -Runner.prototype.hooks = function(name, suites, fn){ - var self = this - , orig = this.suite; - - function next(suite) { - self.suite = suite; - - if (!suite) { - self.suite = orig; - return fn(); - } - - self.hook(name, function(err){ - if (err) { - self.suite = orig; - return fn(err); - } - - next(suites.pop()); - }); - } - - next(suites.pop()); -}; - -/** - * Run hooks from the top level down. - * - * @param {String} name - * @param {Function} fn - * @api private - */ - -Runner.prototype.hookUp = function(name, fn){ - var suites = [this.suite].concat(this.parents()).reverse(); - this.hooks(name, suites, fn); -}; - -/** - * Run hooks from the bottom up. - * - * @param {String} name - * @param {Function} fn - * @api private - */ - -Runner.prototype.hookDown = function(name, fn){ - var suites = [this.suite].concat(this.parents()); - this.hooks(name, suites, fn); -}; - -/** - * Return an array of parent Suites from - * closest to furthest. - * - * @return {Array} - * @api private - */ - -Runner.prototype.parents = function(){ - var suite = this.suite - , suites = []; - while (suite = suite.parent) suites.push(suite); - return suites; -}; - -/** - * Run the current test and callback `fn(err)`. - * - * @param {Function} fn - * @api private - */ - -Runner.prototype.runTest = function(fn){ - var test = this.test - , self = this; - - if (this.asyncOnly) test.asyncOnly = true; - - try { - test.on('error', function(err){ - self.fail(test, err); - }); - test.run(fn); - } catch (err) { - fn(err); - } -}; - -/** - * Run tests in the given `suite` and invoke - * the callback `fn()` when complete. - * - * @param {Suite} suite - * @param {Function} fn - * @api private - */ - -Runner.prototype.runTests = function(suite, fn){ - var self = this - , tests = suite.tests.slice() - , test; - - function next(err) { - // if we bail after first err - if (self.failures && suite._bail) return fn(); - - // next test - test = tests.shift(); - - // all done - if (!test) return fn(); - - // grep - var match = self._grep.test(test.fullTitle()); - if (self._invert) match = !match; - if (!match) return next(); - - // pending - if (test.pending) { - self.emit('pending', test); - self.emit('test end', test); - return next(); - } - - // execute test and hook(s) - self.emit('test', self.test = test); - self.hookDown('beforeEach', function(){ - self.currentRunnable = self.test; - self.runTest(function(err){ - test = self.test; - - if (err) { - self.fail(test, err); - self.emit('test end', test); - return self.hookUp('afterEach', next); - } - - test.state = 'passed'; - self.emit('pass', test); - self.emit('test end', test); - self.hookUp('afterEach', next); - }); - }); - } - - this.next = next; - next(); -}; - -/** - * Run the given `suite` and invoke the - * callback `fn()` when complete. - * - * @param {Suite} suite - * @param {Function} fn - * @api private - */ - -Runner.prototype.runSuite = function(suite, fn){ - var total = this.grepTotal(suite) - , self = this - , i = 0; - - debug('run suite %s', suite.fullTitle()); - - if (!total) return fn(); - - this.emit('suite', this.suite = suite); - - function next() { - var curr = suite.suites[i++]; - if (!curr) return done(); - self.runSuite(curr, next); - } - - function done() { - self.suite = suite; - self.hook('afterAll', function(){ - self.emit('suite end', suite); - fn(); - }); - } - - this.hook('beforeAll', function(){ - self.runTests(suite, next); - }); -}; - -/** - * Handle uncaught exceptions. - * - * @param {Error} err - * @api private - */ - -Runner.prototype.uncaught = function(err){ - debug('uncaught exception %s', err.message); - var runnable = this.currentRunnable; - if (!runnable || 'failed' == runnable.state) return; - runnable.clearTimeout(); - err.uncaught = true; - this.fail(runnable, err); - - // recover from test - if ('test' == runnable.type) { - this.emit('test end', runnable); - this.hookUp('afterEach', this.next); - return; - } - - // bail on hooks - this.emit('end'); -}; - -/** - * Run the root suite and invoke `fn(failures)` - * on completion. - * - * @param {Function} fn - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.run = function(fn){ - var self = this - , fn = fn || function(){}; - - function uncaught(err){ - self.uncaught(err); - } - - debug('start'); - - // callback - this.on('end', function(){ - debug('end'); - process.removeListener('uncaughtException', uncaught); - fn(self.failures); - }); - - // run suites - this.emit('start'); - this.runSuite(this.suite, function(){ - debug('finished running'); - self.emit('end'); - }); - - // uncaught exception - process.on('uncaughtException', uncaught); - - return this; -}; - -/** - * Filter leaks with the given globals flagged as `ok`. - * - * @param {Array} ok - * @param {Array} globals - * @return {Array} - * @api private - */ - -function filterLeaks(ok, globals) { - return filter(globals, function(key){ - // Firefox and Chrome exposes iframes as index inside the window object - if (/^d+/.test(key)) return false; - var matched = filter(ok, function(ok){ - if (~ok.indexOf('*')) return 0 == key.indexOf(ok.split('*')[0]); - // Opera and IE expose global variables for HTML element IDs (issue #243) - if (/^mocha-/.test(key)) return true; - return key == ok; - }); - return matched.length == 0 && (!global.navigator || 'onerror' !== key); - }); -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/suite.js b/node_modules/grunt-mocha/node_modules/mocha/lib/suite.js deleted file mode 100644 index 869bb88..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/suite.js +++ /dev/null @@ -1,296 +0,0 @@ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , debug = require('debug')('mocha:suite') - , milliseconds = require('./ms') - , utils = require('./utils') - , Hook = require('./hook'); - -/** - * Expose `Suite`. - */ - -exports = module.exports = Suite; - -/** - * Create a new `Suite` with the given `title` - * and parent `Suite`. When a suite with the - * same title is already present, that suite - * is returned to provide nicer reporter - * and more flexible meta-testing. - * - * @param {Suite} parent - * @param {String} title - * @return {Suite} - * @api public - */ - -exports.create = function(parent, title){ - var suite = new Suite(title, parent.ctx); - suite.parent = parent; - if (parent.pending) suite.pending = true; - title = suite.fullTitle(); - parent.addSuite(suite); - return suite; -}; - -/** - * Initialize a new `Suite` with the given - * `title` and `ctx`. - * - * @param {String} title - * @param {Context} ctx - * @api private - */ - -function Suite(title, ctx) { - this.title = title; - this.ctx = ctx; - this.suites = []; - this.tests = []; - this.pending = false; - this._beforeEach = []; - this._beforeAll = []; - this._afterEach = []; - this._afterAll = []; - this.root = !title; - this._timeout = 2000; - this._slow = 75; - this._bail = false; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Suite.prototype.__proto__ = EventEmitter.prototype; - -/** - * Return a clone of this `Suite`. - * - * @return {Suite} - * @api private - */ - -Suite.prototype.clone = function(){ - var suite = new Suite(this.title); - debug('clone'); - suite.ctx = this.ctx; - suite.timeout(this.timeout()); - suite.slow(this.slow()); - suite.bail(this.bail()); - return suite; -}; - -/** - * Set timeout `ms` or short-hand such as "2s". - * - * @param {Number|String} ms - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.timeout = function(ms){ - if (0 == arguments.length) return this._timeout; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._timeout = parseInt(ms, 10); - return this; -}; - -/** - * Set slow `ms` or short-hand such as "2s". - * - * @param {Number|String} ms - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.slow = function(ms){ - if (0 === arguments.length) return this._slow; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('slow %d', ms); - this._slow = ms; - return this; -}; - -/** - * Sets whether to bail after first error. - * - * @parma {Boolean} bail - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.bail = function(bail){ - if (0 == arguments.length) return this._bail; - debug('bail %s', bail); - this._bail = bail; - return this; -}; - -/** - * Run `fn(test[, done])` before running tests. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.beforeAll = function(fn){ - if (this.pending) return this; - var hook = new Hook('"before all" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._beforeAll.push(hook); - this.emit('beforeAll', hook); - return this; -}; - -/** - * Run `fn(test[, done])` after running tests. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.afterAll = function(fn){ - if (this.pending) return this; - var hook = new Hook('"after all" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._afterAll.push(hook); - this.emit('afterAll', hook); - return this; -}; - -/** - * Run `fn(test[, done])` before each test case. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.beforeEach = function(fn){ - if (this.pending) return this; - var hook = new Hook('"before each" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._beforeEach.push(hook); - this.emit('beforeEach', hook); - return this; -}; - -/** - * Run `fn(test[, done])` after each test case. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.afterEach = function(fn){ - if (this.pending) return this; - var hook = new Hook('"after each" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._afterEach.push(hook); - this.emit('afterEach', hook); - return this; -}; - -/** - * Add a test `suite`. - * - * @param {Suite} suite - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.addSuite = function(suite){ - suite.parent = this; - suite.timeout(this.timeout()); - suite.slow(this.slow()); - suite.bail(this.bail()); - this.suites.push(suite); - this.emit('suite', suite); - return this; -}; - -/** - * Add a `test` to this suite. - * - * @param {Test} test - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.addTest = function(test){ - test.parent = this; - test.timeout(this.timeout()); - test.slow(this.slow()); - test.ctx = this.ctx; - this.tests.push(test); - this.emit('test', test); - return this; -}; - -/** - * Return the full title generated by recursively - * concatenating the parent's full title. - * - * @return {String} - * @api public - */ - -Suite.prototype.fullTitle = function(){ - if (this.parent) { - var full = this.parent.fullTitle(); - if (full) return full + ' ' + this.title; - } - return this.title; -}; - -/** - * Return the total number of tests. - * - * @return {Number} - * @api public - */ - -Suite.prototype.total = function(){ - return utils.reduce(this.suites, function(sum, suite){ - return sum + suite.total(); - }, 0) + this.tests.length; -}; - -/** - * Iterates through each suite recursively to find - * all tests. Applies a function in the format - * `fn(test)`. - * - * @param {Function} fn - * @return {Suite} - * @api private - */ - -Suite.prototype.eachTest = function(fn){ - utils.forEach(this.tests, fn); - utils.forEach(this.suites, function(suite){ - suite.eachTest(fn); - }); - return this; -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/template.html b/node_modules/grunt-mocha/node_modules/mocha/lib/template.html deleted file mode 100644 index 0590d4a..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/template.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Mocha - - - - - -
                - - - - - - diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/test.js b/node_modules/grunt-mocha/node_modules/mocha/lib/test.js deleted file mode 100644 index 11773e0..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/test.js +++ /dev/null @@ -1,32 +0,0 @@ - -/** - * Module dependencies. - */ - -var Runnable = require('./runnable'); - -/** - * Expose `Test`. - */ - -module.exports = Test; - -/** - * Initialize a new `Test` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Test(title, fn) { - Runnable.call(this, title, fn); - this.pending = !fn; - this.type = 'test'; -} - -/** - * Inherit from `Runnable.prototype`. - */ - -Test.prototype.__proto__ = Runnable.prototype; diff --git a/node_modules/grunt-mocha/node_modules/mocha/lib/utils.js b/node_modules/grunt-mocha/node_modules/mocha/lib/utils.js deleted file mode 100644 index 939a8aa..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/lib/utils.js +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Module dependencies. - */ - -var fs = require('fs') - , path = require('path') - , join = path.join - , debug = require('debug')('mocha:watch'); - -/** - * Ignored directories. - */ - -var ignore = ['node_modules', '.git']; - -/** - * Escape special characters in the given string of html. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html){ - return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>'); -}; - -/** - * Array#forEach (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @param {Object} scope - * @api private - */ - -exports.forEach = function(arr, fn, scope){ - for (var i = 0, l = arr.length; i < l; i++) - fn.call(scope, arr[i], i); -}; - -/** - * Array#indexOf (<=IE8) - * - * @parma {Array} arr - * @param {Object} obj to find index of - * @param {Number} start - * @api private - */ - -exports.indexOf = function(arr, obj, start){ - for (var i = start || 0, l = arr.length; i < l; i++) { - if (arr[i] === obj) - return i; - } - return -1; -}; - -/** - * Array#reduce (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @param {Object} initial value - * @api private - */ - -exports.reduce = function(arr, fn, val){ - var rval = val; - - for (var i = 0, l = arr.length; i < l; i++) { - rval = fn(rval, arr[i], i, arr); - } - - return rval; -}; - -/** - * Array#filter (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @api private - */ - -exports.filter = function(arr, fn){ - var ret = []; - - for (var i = 0, l = arr.length; i < l; i++) { - var val = arr[i]; - if (fn(val, i, arr)) ret.push(val); - } - - return ret; -}; - -/** - * Object.keys (<=IE8) - * - * @param {Object} obj - * @return {Array} keys - * @api private - */ - -exports.keys = Object.keys || function(obj) { - var keys = [] - , has = Object.prototype.hasOwnProperty // for `window` on <=IE8 - - for (var key in obj) { - if (has.call(obj, key)) { - keys.push(key); - } - } - - return keys; -}; - -/** - * Watch the given `files` for changes - * and invoke `fn(file)` on modification. - * - * @param {Array} files - * @param {Function} fn - * @api private - */ - -exports.watch = function(files, fn){ - var options = { interval: 100 }; - files.forEach(function(file){ - debug('file %s', file); - fs.watchFile(file, options, function(curr, prev){ - if (prev.mtime < curr.mtime) fn(file); - }); - }); -}; - -/** - * Ignored files. - */ - -function ignored(path){ - return !~ignore.indexOf(path); -} - -/** - * Lookup files in the given `dir`. - * - * @return {Array} - * @api private - */ - -exports.files = function(dir, ret){ - ret = ret || []; - - fs.readdirSync(dir) - .filter(ignored) - .forEach(function(path){ - path = join(dir, path); - if (fs.statSync(path).isDirectory()) { - exports.files(path, ret); - } else if (path.match(/\.(js|coffee|litcoffee|coffee.md)$/)) { - ret.push(path); - } - }); - - return ret; -}; - -/** - * Compute a slug from the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.slug = function(str){ - return str - .toLowerCase() - .replace(/ +/g, '-') - .replace(/[^-\w]/g, ''); -}; - -/** - * Strip the function definition from `str`, - * and re-indent for pre whitespace. - */ - -exports.clean = function(str) { - str = str - .replace(/^function *\(.*\) *{/, '') - .replace(/\s+\}$/, ''); - - var whitespace = str.match(/^\n?(\s*)/)[1] - , re = new RegExp('^' + whitespace, 'gm'); - - str = str.replace(re, ''); - - return exports.trim(str); -}; - -/** - * Escape regular expression characters in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.escapeRegexp = function(str){ - return str.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); -}; - -/** - * Trim the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.trim = function(str){ - return str.replace(/^\s+|\s+$/g, ''); -}; - -/** - * Parse the given `qs`. - * - * @param {String} qs - * @return {Object} - * @api private - */ - -exports.parseQuery = function(qs){ - return exports.reduce(qs.replace('?', '').split('&'), function(obj, pair){ - var i = pair.indexOf('=') - , key = pair.slice(0, i) - , val = pair.slice(++i); - - obj[key] = decodeURIComponent(val); - return obj; - }, {}); -}; - -/** - * Highlight the given string of `js`. - * - * @param {String} js - * @return {String} - * @api private - */ - -function highlight(js) { - return js - .replace(//g, '>') - .replace(/\/\/(.*)/gm, '//$1') - .replace(/('.*?')/gm, '$1') - .replace(/(\d+\.\d+)/gm, '$1') - .replace(/(\d+)/gm, '$1') - .replace(/\bnew *(\w+)/gm, 'new $1') - .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '$1') -} - -/** - * Highlight the contents of tag `name`. - * - * @param {String} name - * @api private - */ - -exports.highlightTags = function(name) { - var code = document.getElementsByTagName(name); - for (var i = 0, len = code.length; i < len; ++i) { - code[i].innerHTML = highlight(code[i].innerHTML); - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/mocha.css b/node_modules/grunt-mocha/node_modules/mocha/mocha.css deleted file mode 100644 index 24ce522..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/mocha.css +++ /dev/null @@ -1,259 +0,0 @@ -@charset "utf-8"; - -body { - margin:0; -} - -#mocha { - font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; - margin: 60px 50px; -} - -#mocha ul, #mocha li { - margin: 0; - padding: 0; -} - -#mocha ul { - list-style: none; -} - -#mocha h1, #mocha h2 { - margin: 0; -} - -#mocha h1 { - margin-top: 15px; - font-size: 1em; - font-weight: 200; -} - -#mocha h1 a { - text-decoration: none; - color: inherit; -} - -#mocha h1 a:hover { - text-decoration: underline; -} - -#mocha .suite .suite h1 { - margin-top: 0; - font-size: .8em; -} - -#mocha .hidden { - display: none; -} - -#mocha h2 { - font-size: 12px; - font-weight: normal; - cursor: pointer; -} - -#mocha .suite { - margin-left: 15px; -} - -#mocha .test { - margin-left: 15px; - overflow: hidden; -} - -#mocha .test.pending:hover h2::after { - content: '(pending)'; - font-family: arial, sans-serif; -} - -#mocha .test.pass.medium .duration { - background: #C09853; -} - -#mocha .test.pass.slow .duration { - background: #B94A48; -} - -#mocha .test.pass::before { - content: '✓'; - font-size: 12px; - display: block; - float: left; - margin-right: 5px; - color: #00d6b2; -} - -#mocha .test.pass .duration { - font-size: 9px; - margin-left: 5px; - padding: 2px 5px; - color: white; - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2); - -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2); - box-shadow: inset 0 1px 1px rgba(0,0,0,.2); - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - -ms-border-radius: 5px; - -o-border-radius: 5px; - border-radius: 5px; -} - -#mocha .test.pass.fast .duration { - display: none; -} - -#mocha .test.pending { - color: #0b97c4; -} - -#mocha .test.pending::before { - content: '◦'; - color: #0b97c4; -} - -#mocha .test.fail { - color: #c00; -} - -#mocha .test.fail pre { - color: black; -} - -#mocha .test.fail::before { - content: '✖'; - font-size: 12px; - display: block; - float: left; - margin-right: 5px; - color: #c00; -} - -#mocha .test pre.error { - color: #c00; - max-height: 300px; - overflow: auto; -} - -#mocha .test pre { - display: block; - float: left; - clear: left; - font: 12px/1.5 monaco, monospace; - margin: 5px; - padding: 15px; - border: 1px solid #eee; - border-bottom-color: #ddd; - -webkit-border-radius: 3px; - -webkit-box-shadow: 0 1px 3px #eee; - -moz-border-radius: 3px; - -moz-box-shadow: 0 1px 3px #eee; -} - -#mocha .test h2 { - position: relative; -} - -#mocha .test a.replay { - position: absolute; - top: 3px; - right: 0; - text-decoration: none; - vertical-align: middle; - display: block; - width: 15px; - height: 15px; - line-height: 15px; - text-align: center; - background: #eee; - font-size: 15px; - -moz-border-radius: 15px; - border-radius: 15px; - -webkit-transition: opacity 200ms; - -moz-transition: opacity 200ms; - transition: opacity 200ms; - opacity: 0.3; - color: #888; -} - -#mocha .test:hover a.replay { - opacity: 1; -} - -#mocha-report.pass .test.fail { - display: none; -} - -#mocha-report.fail .test.pass { - display: none; -} - -#mocha-report.pending .test.pass -#mocha-report.pending .test.fail, { - display: none; -} -#mocha-report.pending .test.pass.pending { - display: block; -} - -#mocha-error { - color: #c00; - font-size: 1.5em; - font-weight: 100; - letter-spacing: 1px; -} - -#mocha-stats { - position: fixed; - top: 15px; - right: 10px; - font-size: 12px; - margin: 0; - color: #888; - z-index: 1; -} - -#mocha-stats .progress { - float: right; - padding-top: 0; -} - -#mocha-stats em { - color: black; -} - -#mocha-stats a { - text-decoration: none; - color: inherit; -} - -#mocha-stats a:hover { - border-bottom: 1px solid #eee; -} - -#mocha-stats li { - display: inline-block; - margin: 0 5px; - list-style: none; - padding-top: 11px; -} - -#mocha-stats canvas { - width: 40px; - height: 40px; -} - -#mocha code .comment { color: #ddd } -#mocha code .init { color: #2F6FAD } -#mocha code .string { color: #5890AD } -#mocha code .keyword { color: #8A6343 } -#mocha code .number { color: #2F6FAD } - -@media screen and (max-device-width: 480px) { - #mocha { - margin: 60px 0px; - } - - #mocha #stats { - position: absolute; - } -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/mocha.js b/node_modules/grunt-mocha/node_modules/mocha/mocha.js deleted file mode 100644 index 1ca585d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/mocha.js +++ /dev/null @@ -1,5471 +0,0 @@ -;(function(){ - -// CommonJS require() - -function require(p){ - var path = require.resolve(p) - , mod = require.modules[path]; - if (!mod) throw new Error('failed to require "' + p + '"'); - if (!mod.exports) { - mod.exports = {}; - mod.call(mod.exports, mod, mod.exports, require.relative(path)); - } - return mod.exports; - } - -require.modules = {}; - -require.resolve = function (path){ - var orig = path - , reg = path + '.js' - , index = path + '/index.js'; - return require.modules[reg] && reg - || require.modules[index] && index - || orig; - }; - -require.register = function (path, fn){ - require.modules[path] = fn; - }; - -require.relative = function (parent) { - return function(p){ - if ('.' != p.charAt(0)) return require(p); - - var path = parent.split('/') - , segs = p.split('/'); - path.pop(); - - for (var i = 0; i < segs.length; i++) { - var seg = segs[i]; - if ('..' == seg) path.pop(); - else if ('.' != seg) path.push(seg); - } - - return require(path.join('/')); - }; - }; - - -require.register("browser/debug.js", function(module, exports, require){ - -module.exports = function(type){ - return function(){ - } -}; - -}); // module: browser/debug.js - -require.register("browser/diff.js", function(module, exports, require){ -/* See license.txt for terms of usage */ - -/* - * Text diff implementation. - * - * This library supports the following APIS: - * JsDiff.diffChars: Character by character diff - * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace - * JsDiff.diffLines: Line based diff - * - * JsDiff.diffCss: Diff targeted at CSS content - * - * These methods are based on the implementation proposed in - * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 - */ -var JsDiff = (function() { - function clonePath(path) { - return { newPos: path.newPos, components: path.components.slice(0) }; - } - function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - } - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, "&"); - n = n.replace(//g, ">"); - n = n.replace(/"/g, """); - - return n; - } - - - var fbDiff = function(ignoreWhitespace) { - this.ignoreWhitespace = ignoreWhitespace; - }; - fbDiff.prototype = { - diff: function(oldString, newString) { - // Handle the identity case (this is due to unrolling editLength == 0 - if (newString == oldString) { - return [{ value: newString }]; - } - if (!newString) { - return [{ value: oldString, removed: true }]; - } - if (!oldString) { - return [{ value: newString, added: true }]; - } - - newString = this.tokenize(newString); - oldString = this.tokenize(oldString); - - var newLen = newString.length, oldLen = oldString.length; - var maxEditLength = newLen + oldLen; - var bestPath = [{ newPos: -1, components: [] }]; - - // Seed editLength = 0 - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) { - return bestPath[0].components; - } - - for (var editLength = 1; editLength <= maxEditLength; editLength++) { - for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) { - var basePath; - var addPath = bestPath[diagonalPath-1], - removePath = bestPath[diagonalPath+1]; - oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath-1] = undefined; - } - - var canAdd = addPath && addPath.newPos+1 < newLen; - var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = undefined; - continue; - } - - // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { - basePath = clonePath(removePath); - this.pushComponent(basePath.components, oldString[oldPos], undefined, true); - } else { - basePath = clonePath(addPath); - basePath.newPos++; - this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined); - } - - var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath); - - if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) { - return basePath.components; - } else { - bestPath[diagonalPath] = basePath; - } - } - } - }, - - pushComponent: function(components, value, added, removed) { - var last = components[components.length-1]; - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length-1] = - {value: this.join(last.value, value), added: added, removed: removed }; - } else { - components.push({value: value, added: added, removed: removed }); - } - }, - extractCommon: function(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath; - while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) { - newPos++; - oldPos++; - - this.pushComponent(basePath.components, newString[newPos], undefined, undefined); - } - basePath.newPos = newPos; - return oldPos; - }, - - equals: function(left, right) { - var reWhitespace = /\S/; - if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) { - return true; - } else { - return left == right; - } - }, - join: function(left, right) { - return left + right; - }, - tokenize: function(value) { - return value; - } - }; - - var CharDiff = new fbDiff(); - - var WordDiff = new fbDiff(true); - WordDiff.tokenize = function(value) { - return removeEmpty(value.split(/(\s+|\b)/)); - }; - - var CssDiff = new fbDiff(true); - CssDiff.tokenize = function(value) { - return removeEmpty(value.split(/([{}:;,]|\s+)/)); - }; - - var LineDiff = new fbDiff(); - LineDiff.tokenize = function(value) { - return value.split(/^/m); - }; - - return { - diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); }, - diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); }, - diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); }, - - diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); }, - - createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) { - var ret = []; - - ret.push("Index: " + fileName); - ret.push("==================================================================="); - ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader)); - ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader)); - - var diff = LineDiff.diff(oldStr, newStr); - if (!diff[diff.length-1].value) { - diff.pop(); // Remove trailing newline add - } - diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function(entry) { return ' ' + entry; }); - } - function eofNL(curRange, i, current) { - var last = diff[diff.length-2], - isLast = i === diff.length-2, - isLastOfType = i === diff.length-3 && (current.added === !last.added || current.removed === !last.removed); - - // Figure out if this is the last line for the given file and missing NL - if (!/\n$/.test(current.value) && (isLast || isLastOfType)) { - curRange.push('\\ No newline at end of file'); - } - } - - var oldRangeStart = 0, newRangeStart = 0, curRange = [], - oldLine = 1, newLine = 1; - for (var i = 0; i < diff.length; i++) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - - if (current.added || current.removed) { - if (!oldRangeStart) { - var prev = diff[i-1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = contextLines(prev.lines.slice(-4)); - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?"+":"-") + entry; })); - eofNL(curRange, i, current); - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= 8 && i < diff.length-2) { - // Overlapping - curRange.push.apply(curRange, contextLines(lines)); - } else { - // end the range and output - var contextSize = Math.min(lines.length, 4); - ret.push( - "@@ -" + oldRangeStart + "," + (oldLine-oldRangeStart+contextSize) - + " +" + newRangeStart + "," + (newLine-newRangeStart+contextSize) - + " @@"); - ret.push.apply(ret, curRange); - ret.push.apply(ret, contextLines(lines.slice(0, contextSize))); - if (lines.length <= 4) { - eofNL(ret, i, current); - } - - oldRangeStart = 0; newRangeStart = 0; curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - } - - return ret.join('\n') + '\n'; - }, - - convertChangesToXML: function(changes){ - var ret = []; - for ( var i = 0; i < changes.length; i++) { - var change = changes[i]; - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - } - return ret.join(""); - } - }; -})(); - -if (typeof module !== "undefined") { - module.exports = JsDiff; -} - -}); // module: browser/diff.js - -require.register("browser/events.js", function(module, exports, require){ - -/** - * Module exports. - */ - -exports.EventEmitter = EventEmitter; - -/** - * Check if `obj` is an array. - */ - -function isArray(obj) { - return '[object Array]' == {}.toString.call(obj); -} - -/** - * Event emitter constructor. - * - * @api public - */ - -function EventEmitter(){}; - -/** - * Adds a listener. - * - * @api public - */ - -EventEmitter.prototype.on = function (name, fn) { - if (!this.$events) { - this.$events = {}; - } - - if (!this.$events[name]) { - this.$events[name] = fn; - } else if (isArray(this.$events[name])) { - this.$events[name].push(fn); - } else { - this.$events[name] = [this.$events[name], fn]; - } - - return this; -}; - -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -/** - * Adds a volatile listener. - * - * @api public - */ - -EventEmitter.prototype.once = function (name, fn) { - var self = this; - - function on () { - self.removeListener(name, on); - fn.apply(this, arguments); - }; - - on.listener = fn; - this.on(name, on); - - return this; -}; - -/** - * Removes a listener. - * - * @api public - */ - -EventEmitter.prototype.removeListener = function (name, fn) { - if (this.$events && this.$events[name]) { - var list = this.$events[name]; - - if (isArray(list)) { - var pos = -1; - - for (var i = 0, l = list.length; i < l; i++) { - if (list[i] === fn || (list[i].listener && list[i].listener === fn)) { - pos = i; - break; - } - } - - if (pos < 0) { - return this; - } - - list.splice(pos, 1); - - if (!list.length) { - delete this.$events[name]; - } - } else if (list === fn || (list.listener && list.listener === fn)) { - delete this.$events[name]; - } - } - - return this; -}; - -/** - * Removes all listeners for an event. - * - * @api public - */ - -EventEmitter.prototype.removeAllListeners = function (name) { - if (name === undefined) { - this.$events = {}; - return this; - } - - if (this.$events && this.$events[name]) { - this.$events[name] = null; - } - - return this; -}; - -/** - * Gets all listeners for a certain event. - * - * @api public - */ - -EventEmitter.prototype.listeners = function (name) { - if (!this.$events) { - this.$events = {}; - } - - if (!this.$events[name]) { - this.$events[name] = []; - } - - if (!isArray(this.$events[name])) { - this.$events[name] = [this.$events[name]]; - } - - return this.$events[name]; -}; - -/** - * Emits an event. - * - * @api public - */ - -EventEmitter.prototype.emit = function (name) { - if (!this.$events) { - return false; - } - - var handler = this.$events[name]; - - if (!handler) { - return false; - } - - var args = [].slice.call(arguments, 1); - - if ('function' == typeof handler) { - handler.apply(this, args); - } else if (isArray(handler)) { - var listeners = handler.slice(); - - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - } else { - return false; - } - - return true; -}; -}); // module: browser/events.js - -require.register("browser/fs.js", function(module, exports, require){ - -}); // module: browser/fs.js - -require.register("browser/path.js", function(module, exports, require){ - -}); // module: browser/path.js - -require.register("browser/progress.js", function(module, exports, require){ - -/** - * Expose `Progress`. - */ - -module.exports = Progress; - -/** - * Initialize a new `Progress` indicator. - */ - -function Progress() { - this.percent = 0; - this.size(0); - this.fontSize(11); - this.font('helvetica, arial, sans-serif'); -} - -/** - * Set progress size to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.size = function(n){ - this._size = n; - return this; -}; - -/** - * Set text to `str`. - * - * @param {String} str - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.text = function(str){ - this._text = str; - return this; -}; - -/** - * Set font size to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - * @api public - */ - -Progress.prototype.fontSize = function(n){ - this._fontSize = n; - return this; -}; - -/** - * Set font `family`. - * - * @param {String} family - * @return {Progress} for chaining - */ - -Progress.prototype.font = function(family){ - this._font = family; - return this; -}; - -/** - * Update percentage to `n`. - * - * @param {Number} n - * @return {Progress} for chaining - */ - -Progress.prototype.update = function(n){ - this.percent = n; - return this; -}; - -/** - * Draw on `ctx`. - * - * @param {CanvasRenderingContext2d} ctx - * @return {Progress} for chaining - */ - -Progress.prototype.draw = function(ctx){ - var percent = Math.min(this.percent, 100) - , size = this._size - , half = size / 2 - , x = half - , y = half - , rad = half - 1 - , fontSize = this._fontSize; - - ctx.font = fontSize + 'px ' + this._font; - - var angle = Math.PI * 2 * (percent / 100); - ctx.clearRect(0, 0, size, size); - - // outer circle - ctx.strokeStyle = '#9f9f9f'; - ctx.beginPath(); - ctx.arc(x, y, rad, 0, angle, false); - ctx.stroke(); - - // inner circle - ctx.strokeStyle = '#eee'; - ctx.beginPath(); - ctx.arc(x, y, rad - 1, 0, angle, true); - ctx.stroke(); - - // text - var text = this._text || (percent | 0) + '%' - , w = ctx.measureText(text).width; - - ctx.fillText( - text - , x - w / 2 + 1 - , y + fontSize / 2 - 1); - - return this; -}; - -}); // module: browser/progress.js - -require.register("browser/tty.js", function(module, exports, require){ - -exports.isatty = function(){ - return true; -}; - -exports.getWindowSize = function(){ - if ('innerHeight' in global) { - return [global.innerHeight, global.innerWidth]; - } else { - // In a Web Worker, the DOM Window is not available. - return [640, 480]; - } -}; - -}); // module: browser/tty.js - -require.register("context.js", function(module, exports, require){ - -/** - * Expose `Context`. - */ - -module.exports = Context; - -/** - * Initialize a new `Context`. - * - * @api private - */ - -function Context(){} - -/** - * Set or get the context `Runnable` to `runnable`. - * - * @param {Runnable} runnable - * @return {Context} - * @api private - */ - -Context.prototype.runnable = function(runnable){ - if (0 == arguments.length) return this._runnable; - this.test = this._runnable = runnable; - return this; -}; - -/** - * Set test timeout `ms`. - * - * @param {Number} ms - * @return {Context} self - * @api private - */ - -Context.prototype.timeout = function(ms){ - this.runnable().timeout(ms); - return this; -}; - -/** - * Set test slowness threshold `ms`. - * - * @param {Number} ms - * @return {Context} self - * @api private - */ - -Context.prototype.slow = function(ms){ - this.runnable().slow(ms); - return this; -}; - -/** - * Inspect the context void of `._runnable`. - * - * @return {String} - * @api private - */ - -Context.prototype.inspect = function(){ - return JSON.stringify(this, function(key, val){ - if ('_runnable' == key) return; - if ('test' == key) return; - return val; - }, 2); -}; - -}); // module: context.js - -require.register("hook.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Runnable = require('./runnable'); - -/** - * Expose `Hook`. - */ - -module.exports = Hook; - -/** - * Initialize a new `Hook` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Hook(title, fn) { - Runnable.call(this, title, fn); - this.type = 'hook'; -} - -/** - * Inherit from `Runnable.prototype`. - */ - -function F(){}; -F.prototype = Runnable.prototype; -Hook.prototype = new F; -Hook.prototype.constructor = Hook; - - -/** - * Get or set the test `err`. - * - * @param {Error} err - * @return {Error} - * @api public - */ - -Hook.prototype.error = function(err){ - if (0 == arguments.length) { - var err = this._error; - this._error = null; - return err; - } - - this._error = err; -}; - -}); // module: hook.js - -require.register("interfaces/bdd.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils'); - -/** - * BDD-style interface: - * - * describe('Array', function(){ - * describe('#indexOf()', function(){ - * it('should return -1 when not present', function(){ - * - * }); - * - * it('should return the index when present', function(){ - * - * }); - * }); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before running tests. - */ - - context.before = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after running tests. - */ - - context.after = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Execute before each test case. - */ - - context.beforeEach = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.afterEach = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Describe a "suite" with the given `title` - * and callback `fn` containing nested suites - * and/or tests. - */ - - context.describe = context.context = function(title, fn){ - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - fn.call(suite); - suites.shift(); - return suite; - }; - - /** - * Pending describe. - */ - - context.xdescribe = - context.xcontext = - context.describe.skip = function(title, fn){ - var suite = Suite.create(suites[0], title); - suite.pending = true; - suites.unshift(suite); - fn.call(suite); - suites.shift(); - }; - - /** - * Exclusive suite. - */ - - context.describe.only = function(title, fn){ - var suite = context.describe(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.it = context.specify = function(title, fn){ - var suite = suites[0]; - if (suite.pending) var fn = null; - var test = new Test(title, fn); - suite.addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.it.only = function(title, fn){ - var test = context.it(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.xit = - context.xspecify = - context.it.skip = function(title){ - context.it(title); - }; - }); -}; - -}); // module: interfaces/bdd.js - -require.register("interfaces/exports.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test'); - -/** - * TDD-style interface: - * - * exports.Array = { - * '#indexOf()': { - * 'should return -1 when the value is not present': function(){ - * - * }, - * - * 'should return the correct index when the value is present': function(){ - * - * } - * } - * }; - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('require', visit); - - function visit(obj) { - var suite; - for (var key in obj) { - if ('function' == typeof obj[key]) { - var fn = obj[key]; - switch (key) { - case 'before': - suites[0].beforeAll(fn); - break; - case 'after': - suites[0].afterAll(fn); - break; - case 'beforeEach': - suites[0].beforeEach(fn); - break; - case 'afterEach': - suites[0].afterEach(fn); - break; - default: - suites[0].addTest(new Test(key, fn)); - } - } else { - var suite = Suite.create(suites[0], key); - suites.unshift(suite); - visit(obj[key]); - suites.shift(); - } - } - } -}; - -}); // module: interfaces/exports.js - -require.register("interfaces/index.js", function(module, exports, require){ - -exports.bdd = require('./bdd'); -exports.tdd = require('./tdd'); -exports.qunit = require('./qunit'); -exports.exports = require('./exports'); - -}); // module: interfaces/index.js - -require.register("interfaces/qunit.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils'); - -/** - * QUnit-style interface: - * - * suite('Array'); - * - * test('#length', function(){ - * var arr = [1,2,3]; - * ok(arr.length == 3); - * }); - * - * test('#indexOf()', function(){ - * var arr = [1,2,3]; - * ok(arr.indexOf(1) == 0); - * ok(arr.indexOf(2) == 1); - * ok(arr.indexOf(3) == 2); - * }); - * - * suite('String'); - * - * test('#length', function(){ - * ok('foo'.length == 3); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before running tests. - */ - - context.before = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after running tests. - */ - - context.after = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Execute before each test case. - */ - - context.beforeEach = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.afterEach = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Describe a "suite" with the given `title`. - */ - - context.suite = function(title){ - if (suites.length > 1) suites.shift(); - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - return suite; - }; - - /** - * Exclusive test-case. - */ - - context.suite.only = function(title, fn){ - var suite = context.suite(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.test = function(title, fn){ - var test = new Test(title, fn); - suites[0].addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.test.only = function(title, fn){ - var test = context.test(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.test.skip = function(title){ - context.test(title); - }; - }); -}; - -}); // module: interfaces/qunit.js - -require.register("interfaces/tdd.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Suite = require('../suite') - , Test = require('../test') - , utils = require('../utils');; - -/** - * TDD-style interface: - * - * suite('Array', function(){ - * suite('#indexOf()', function(){ - * suiteSetup(function(){ - * - * }); - * - * test('should return -1 when not present', function(){ - * - * }); - * - * test('should return the index when present', function(){ - * - * }); - * - * suiteTeardown(function(){ - * - * }); - * }); - * }); - * - */ - -module.exports = function(suite){ - var suites = [suite]; - - suite.on('pre-require', function(context, file, mocha){ - - /** - * Execute before each test case. - */ - - context.setup = function(fn){ - suites[0].beforeEach(fn); - }; - - /** - * Execute after each test case. - */ - - context.teardown = function(fn){ - suites[0].afterEach(fn); - }; - - /** - * Execute before the suite. - */ - - context.suiteSetup = function(fn){ - suites[0].beforeAll(fn); - }; - - /** - * Execute after the suite. - */ - - context.suiteTeardown = function(fn){ - suites[0].afterAll(fn); - }; - - /** - * Describe a "suite" with the given `title` - * and callback `fn` containing nested suites - * and/or tests. - */ - - context.suite = function(title, fn){ - var suite = Suite.create(suites[0], title); - suites.unshift(suite); - fn.call(suite); - suites.shift(); - return suite; - }; - - /** - * Pending suite. - */ - context.suite.skip = function(title, fn) { - var suite = Suite.create(suites[0], title); - suite.pending = true; - suites.unshift(suite); - fn.call(suite); - suites.shift(); - }; - - /** - * Exclusive test-case. - */ - - context.suite.only = function(title, fn){ - var suite = context.suite(title, fn); - mocha.grep(suite.fullTitle()); - }; - - /** - * Describe a specification or test-case - * with the given `title` and callback `fn` - * acting as a thunk. - */ - - context.test = function(title, fn){ - var suite = suites[0]; - if (suite.pending) var fn = null; - var test = new Test(title, fn); - suite.addTest(test); - return test; - }; - - /** - * Exclusive test-case. - */ - - context.test.only = function(title, fn){ - var test = context.test(title, fn); - var reString = '^' + utils.escapeRegexp(test.fullTitle()) + '$'; - mocha.grep(new RegExp(reString)); - }; - - /** - * Pending test case. - */ - - context.test.skip = function(title){ - context.test(title); - }; - }); -}; - -}); // module: interfaces/tdd.js - -require.register("mocha.js", function(module, exports, require){ -/*! - * mocha - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var path = require('browser/path') - , utils = require('./utils'); - -/** - * Expose `Mocha`. - */ - -exports = module.exports = Mocha; - -/** - * Expose internals. - */ - -exports.utils = utils; -exports.interfaces = require('./interfaces'); -exports.reporters = require('./reporters'); -exports.Runnable = require('./runnable'); -exports.Context = require('./context'); -exports.Runner = require('./runner'); -exports.Suite = require('./suite'); -exports.Hook = require('./hook'); -exports.Test = require('./test'); - -/** - * Return image `name` path. - * - * @param {String} name - * @return {String} - * @api private - */ - -function image(name) { - return __dirname + '/../images/' + name + '.png'; -} - -/** - * Setup mocha with `options`. - * - * Options: - * - * - `ui` name "bdd", "tdd", "exports" etc - * - `reporter` reporter instance, defaults to `mocha.reporters.Dot` - * - `globals` array of accepted globals - * - `timeout` timeout in milliseconds - * - `bail` bail on the first test failure - * - `slow` milliseconds to wait before considering a test slow - * - `ignoreLeaks` ignore global leaks - * - `grep` string or regexp to filter tests with - * - * @param {Object} options - * @api public - */ - -function Mocha(options) { - options = options || {}; - this.files = []; - this.options = options; - this.grep(options.grep); - this.suite = new exports.Suite('', new exports.Context); - this.ui(options.ui); - this.bail(options.bail); - this.reporter(options.reporter); - if (typeof options.timeout === 'number') this.timeout(options.timeout); - if (options.slow) this.slow(options.slow); -} - -/** - * Enable or disable bailing on the first failure. - * - * @param {Boolean} [bail] - * @api public - */ - -Mocha.prototype.bail = function(bail){ - if (0 == arguments.length) bail = true; - this.suite.bail(bail); - return this; -}; - -/** - * Add test `file`. - * - * @param {String} file - * @api public - */ - -Mocha.prototype.addFile = function(file){ - this.files.push(file); - return this; -}; - -/** - * Set reporter to `reporter`, defaults to "dot". - * - * @param {String|Function} reporter name or constructor - * @api public - */ - -Mocha.prototype.reporter = function(reporter){ - if ('function' == typeof reporter) { - this._reporter = reporter; - } else { - reporter = reporter || 'dot'; - try { - this._reporter = require('./reporters/' + reporter); - } catch (err) { - this._reporter = require(reporter); - } - if (!this._reporter) throw new Error('invalid reporter "' + reporter + '"'); - } - return this; -}; - -/** - * Set test UI `name`, defaults to "bdd". - * - * @param {String} bdd - * @api public - */ - -Mocha.prototype.ui = function(name){ - name = name || 'bdd'; - this._ui = exports.interfaces[name]; - if (!this._ui) throw new Error('invalid interface "' + name + '"'); - this._ui = this._ui(this.suite); - return this; -}; - -/** - * Load registered files. - * - * @api private - */ - -Mocha.prototype.loadFiles = function(fn){ - var self = this; - var suite = this.suite; - var pending = this.files.length; - this.files.forEach(function(file){ - file = path.resolve(file); - suite.emit('pre-require', global, file, self); - suite.emit('require', require(file), file, self); - suite.emit('post-require', global, file, self); - --pending || (fn && fn()); - }); -}; - -/** - * Enable growl support. - * - * @api private - */ - -Mocha.prototype._growl = function(runner, reporter) { - var notify = require('growl'); - - runner.on('end', function(){ - var stats = reporter.stats; - if (stats.failures) { - var msg = stats.failures + ' of ' + runner.total + ' tests failed'; - notify(msg, { name: 'mocha', title: 'Failed', image: image('error') }); - } else { - notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', { - name: 'mocha' - , title: 'Passed' - , image: image('ok') - }); - } - }); -}; - -/** - * Add regexp to grep, if `re` is a string it is escaped. - * - * @param {RegExp|String} re - * @return {Mocha} - * @api public - */ - -Mocha.prototype.grep = function(re){ - this.options.grep = 'string' == typeof re - ? new RegExp(utils.escapeRegexp(re)) - : re; - return this; -}; - -/** - * Invert `.grep()` matches. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.invert = function(){ - this.options.invert = true; - return this; -}; - -/** - * Ignore global leaks. - * - * @param {Boolean} ignore - * @return {Mocha} - * @api public - */ - -Mocha.prototype.ignoreLeaks = function(ignore){ - this.options.ignoreLeaks = !!ignore; - return this; -}; - -/** - * Enable global leak checking. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.checkLeaks = function(){ - this.options.ignoreLeaks = false; - return this; -}; - -/** - * Enable growl support. - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.growl = function(){ - this.options.growl = true; - return this; -}; - -/** - * Ignore `globals` array or string. - * - * @param {Array|String} globals - * @return {Mocha} - * @api public - */ - -Mocha.prototype.globals = function(globals){ - this.options.globals = (this.options.globals || []).concat(globals); - return this; -}; - -/** - * Set the timeout in milliseconds. - * - * @param {Number} timeout - * @return {Mocha} - * @api public - */ - -Mocha.prototype.timeout = function(timeout){ - this.suite.timeout(timeout); - return this; -}; - -/** - * Set slowness threshold in milliseconds. - * - * @param {Number} slow - * @return {Mocha} - * @api public - */ - -Mocha.prototype.slow = function(slow){ - this.suite.slow(slow); - return this; -}; - -/** - * Makes all tests async (accepting a callback) - * - * @return {Mocha} - * @api public - */ - -Mocha.prototype.asyncOnly = function(){ - this.options.asyncOnly = true; - return this; -}; - -/** - * Run tests and invoke `fn()` when complete. - * - * @param {Function} fn - * @return {Runner} - * @api public - */ - -Mocha.prototype.run = function(fn){ - if (this.files.length) this.loadFiles(); - var suite = this.suite; - var options = this.options; - var runner = new exports.Runner(suite); - var reporter = new this._reporter(runner); - runner.ignoreLeaks = false !== options.ignoreLeaks; - runner.asyncOnly = options.asyncOnly; - if (options.grep) runner.grep(options.grep, options.invert); - if (options.globals) runner.globals(options.globals); - if (options.growl) this._growl(runner, reporter); - return runner.run(fn); -}; - -}); // module: mocha.js - -require.register("ms.js", function(module, exports, require){ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options){ - options = options || {}; - if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 's': - return n * s; - case 'ms': - return n; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function short(ms) { - if (ms >= d) return Math.round(ms / d) + 'd'; - if (ms >= h) return Math.round(ms / h) + 'h'; - if (ms >= m) return Math.round(ms / m) + 'm'; - if (ms >= s) return Math.round(ms / s) + 's'; - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function long(ms) { - return plural(ms, d, 'day') - || plural(ms, h, 'hour') - || plural(ms, m, 'minute') - || plural(ms, s, 'second') - || ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; -} - -}); // module: ms.js - -require.register("reporters/base.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var tty = require('browser/tty') - , diff = require('browser/diff') - , ms = require('../ms'); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Check if both stdio streams are associated with a tty. - */ - -var isatty = tty.isatty(1) && tty.isatty(2); - -/** - * Expose `Base`. - */ - -exports = module.exports = Base; - -/** - * Enable coloring by default. - */ - -exports.useColors = isatty; - -/** - * Default color map. - */ - -exports.colors = { - 'pass': 90 - , 'fail': 31 - , 'bright pass': 92 - , 'bright fail': 91 - , 'bright yellow': 93 - , 'pending': 36 - , 'suite': 0 - , 'error title': 0 - , 'error message': 31 - , 'error stack': 90 - , 'checkmark': 32 - , 'fast': 90 - , 'medium': 33 - , 'slow': 31 - , 'green': 32 - , 'light': 90 - , 'diff gutter': 90 - , 'diff added': 42 - , 'diff removed': 41 -}; - -/** - * Default symbol map. - */ - -exports.symbols = { - ok: '✓', - err: '✖', - dot: '․' -}; - -// With node.js on Windows: use symbols available in terminal default fonts -if ('win32' == process.platform) { - exports.symbols.ok = '\u221A'; - exports.symbols.err = '\u00D7'; - exports.symbols.dot = '.'; -} - -/** - * Color `str` with the given `type`, - * allowing colors to be disabled, - * as well as user-defined color - * schemes. - * - * @param {String} type - * @param {String} str - * @return {String} - * @api private - */ - -var color = exports.color = function(type, str) { - if (!exports.useColors) return str; - return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m'; -}; - -/** - * Expose term window size, with some - * defaults for when stderr is not a tty. - */ - -exports.window = { - width: isatty - ? process.stdout.getWindowSize - ? process.stdout.getWindowSize(1)[0] - : tty.getWindowSize()[1] - : 75 -}; - -/** - * Expose some basic cursor interactions - * that are common among reporters. - */ - -exports.cursor = { - hide: function(){ - process.stdout.write('\u001b[?25l'); - }, - - show: function(){ - process.stdout.write('\u001b[?25h'); - }, - - deleteLine: function(){ - process.stdout.write('\u001b[2K'); - }, - - beginningOfLine: function(){ - process.stdout.write('\u001b[0G'); - }, - - CR: function(){ - exports.cursor.deleteLine(); - exports.cursor.beginningOfLine(); - } -}; - -/** - * Outut the given `failures` as a list. - * - * @param {Array} failures - * @api public - */ - -exports.list = function(failures){ - console.error(); - failures.forEach(function(test, i){ - // format - var fmt = color('error title', ' %s) %s:\n') - + color('error message', ' %s') - + color('error stack', '\n%s\n'); - - // msg - var err = test.err - , message = err.message || '' - , stack = err.stack || message - , index = stack.indexOf(message) + message.length - , msg = stack.slice(0, index) - , actual = err.actual - , expected = err.expected - , escape = true; - - // uncaught - if (err.uncaught) { - msg = 'Uncaught ' + msg; - } - - // explicitly show diff - if (err.showDiff && sameType(actual, expected)) { - escape = false; - err.actual = actual = stringify(actual); - err.expected = expected = stringify(expected); - } - - // actual / expected diff - if ('string' == typeof actual && 'string' == typeof expected) { - msg = errorDiff(err, 'Words', escape); - - // linenos - var lines = msg.split('\n'); - if (lines.length > 4) { - var width = String(lines.length).length; - msg = lines.map(function(str, i){ - return pad(++i, width) + ' |' + ' ' + str; - }).join('\n'); - } - - // legend - msg = '\n' - + color('diff removed', 'actual') - + ' ' - + color('diff added', 'expected') - + '\n\n' - + msg - + '\n'; - - // indent - msg = msg.replace(/^/gm, ' '); - - fmt = color('error title', ' %s) %s:\n%s') - + color('error stack', '\n%s\n'); - } - - // indent stack trace without msg - stack = stack.slice(index ? index + 1 : index) - .replace(/^/gm, ' '); - - console.error(fmt, (i + 1), test.fullTitle(), msg, stack); - }); -}; - -/** - * Initialize a new `Base` reporter. - * - * All other reporters generally - * inherit from this reporter, providing - * stats such as test duration, number - * of tests passed / failed etc. - * - * @param {Runner} runner - * @api public - */ - -function Base(runner) { - var self = this - , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 } - , failures = this.failures = []; - - if (!runner) return; - this.runner = runner; - - runner.stats = stats; - - runner.on('start', function(){ - stats.start = new Date; - }); - - runner.on('suite', function(suite){ - stats.suites = stats.suites || 0; - suite.root || stats.suites++; - }); - - runner.on('test end', function(test){ - stats.tests = stats.tests || 0; - stats.tests++; - }); - - runner.on('pass', function(test){ - stats.passes = stats.passes || 0; - - var medium = test.slow() / 2; - test.speed = test.duration > test.slow() - ? 'slow' - : test.duration > medium - ? 'medium' - : 'fast'; - - stats.passes++; - }); - - runner.on('fail', function(test, err){ - stats.failures = stats.failures || 0; - stats.failures++; - test.err = err; - failures.push(test); - }); - - runner.on('end', function(){ - stats.end = new Date; - stats.duration = new Date - stats.start; - }); - - runner.on('pending', function(){ - stats.pending++; - }); -} - -/** - * Output common epilogue used by many of - * the bundled reporters. - * - * @api public - */ - -Base.prototype.epilogue = function(){ - var stats = this.stats; - var tests; - var fmt; - - console.log(); - - // passes - fmt = color('bright pass', ' ') - + color('green', ' %d passing') - + color('light', ' (%s)'); - - console.log(fmt, - stats.passes || 0, - ms(stats.duration)); - - // pending - if (stats.pending) { - fmt = color('pending', ' ') - + color('pending', ' %d pending'); - - console.log(fmt, stats.pending); - } - - // failures - if (stats.failures) { - fmt = color('fail', ' %d failing'); - - console.error(fmt, - stats.failures); - - Base.list(this.failures); - console.error(); - } - - console.log(); -}; - -/** - * Pad the given `str` to `len`. - * - * @param {String} str - * @param {String} len - * @return {String} - * @api private - */ - -function pad(str, len) { - str = String(str); - return Array(len - str.length + 1).join(' ') + str; -} - -/** - * Return a character diff for `err`. - * - * @param {Error} err - * @return {String} - * @api private - */ - -function errorDiff(err, type, escape) { - return diff['diff' + type](err.actual, err.expected).map(function(str){ - if (escape) { - str.value = str.value - .replace(/\t/g, '') - .replace(/\r/g, '') - .replace(/\n/g, '\n'); - } - if (str.added) return colorLines('diff added', str.value); - if (str.removed) return colorLines('diff removed', str.value); - return str.value; - }).join(''); -} - -/** - * Color lines for `str`, using the color `name`. - * - * @param {String} name - * @param {String} str - * @return {String} - * @api private - */ - -function colorLines(name, str) { - return str.split('\n').map(function(str){ - return color(name, str); - }).join('\n'); -} - -/** - * Stringify `obj`. - * - * @param {Mixed} obj - * @return {String} - * @api private - */ - -function stringify(obj) { - if (obj instanceof RegExp) return obj.toString(); - return JSON.stringify(obj, null, 2); -} - -/** - * Check that a / b have the same type. - * - * @param {Object} a - * @param {Object} b - * @return {Boolean} - * @api private - */ - -function sameType(a, b) { - a = Object.prototype.toString.call(a); - b = Object.prototype.toString.call(b); - return a == b; -} - -}); // module: reporters/base.js - -require.register("reporters/doc.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils'); - -/** - * Expose `Doc`. - */ - -exports = module.exports = Doc; - -/** - * Initialize a new `Doc` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Doc(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total - , indents = 2; - - function indent() { - return Array(indents).join(' '); - } - - runner.on('suite', function(suite){ - if (suite.root) return; - ++indents; - console.log('%s
                ', indent()); - ++indents; - console.log('%s

                %s

                ', indent(), utils.escape(suite.title)); - console.log('%s
                ', indent()); - }); - - runner.on('suite end', function(suite){ - if (suite.root) return; - console.log('%s
                ', indent()); - --indents; - console.log('%s
                ', indent()); - --indents; - }); - - runner.on('pass', function(test){ - console.log('%s
                %s
                ', indent(), utils.escape(test.title)); - var code = utils.escape(utils.clean(test.fn.toString())); - console.log('%s
                %s
                ', indent(), code); - }); -} - -}); // module: reporters/doc.js - -require.register("reporters/dot.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `Dot`. - */ - -exports = module.exports = Dot; - -/** - * Initialize a new `Dot` matrix test reporter. - * - * @param {Runner} runner - * @api public - */ - -function Dot(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , n = 0; - - runner.on('start', function(){ - process.stdout.write('\n '); - }); - - runner.on('pending', function(test){ - process.stdout.write(color('pending', Base.symbols.dot)); - }); - - runner.on('pass', function(test){ - if (++n % width == 0) process.stdout.write('\n '); - if ('slow' == test.speed) { - process.stdout.write(color('bright yellow', Base.symbols.dot)); - } else { - process.stdout.write(color(test.speed, Base.symbols.dot)); - } - }); - - runner.on('fail', function(test, err){ - if (++n % width == 0) process.stdout.write('\n '); - process.stdout.write(color('fail', Base.symbols.dot)); - }); - - runner.on('end', function(){ - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Dot.prototype = new F; -Dot.prototype.constructor = Dot; - -}); // module: reporters/dot.js - -require.register("reporters/html-cov.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var JSONCov = require('./json-cov') - , fs = require('browser/fs'); - -/** - * Expose `HTMLCov`. - */ - -exports = module.exports = HTMLCov; - -/** - * Initialize a new `JsCoverage` reporter. - * - * @param {Runner} runner - * @api public - */ - -function HTMLCov(runner) { - var jade = require('jade') - , file = __dirname + '/templates/coverage.jade' - , str = fs.readFileSync(file, 'utf8') - , fn = jade.compile(str, { filename: file }) - , self = this; - - JSONCov.call(this, runner, false); - - runner.on('end', function(){ - process.stdout.write(fn({ - cov: self.cov - , coverageClass: coverageClass - })); - }); -} - -/** - * Return coverage class for `n`. - * - * @return {String} - * @api private - */ - -function coverageClass(n) { - if (n >= 75) return 'high'; - if (n >= 50) return 'medium'; - if (n >= 25) return 'low'; - return 'terrible'; -} -}); // module: reporters/html-cov.js - -require.register("reporters/html.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils') - , Progress = require('../browser/progress') - , escape = utils.escape; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Expose `Doc`. - */ - -exports = module.exports = HTML; - -/** - * Stats template. - */ - -var statsTemplate = ''; - -/** - * Initialize a new `Doc` reporter. - * - * @param {Runner} runner - * @api public - */ - -function HTML(runner, root) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total - , stat = fragment(statsTemplate) - , items = stat.getElementsByTagName('li') - , passes = items[1].getElementsByTagName('em')[0] - , passesLink = items[1].getElementsByTagName('a')[0] - , failures = items[2].getElementsByTagName('em')[0] - , failuresLink = items[2].getElementsByTagName('a')[0] - , duration = items[3].getElementsByTagName('em')[0] - , canvas = stat.getElementsByTagName('canvas')[0] - , report = fragment('
                  ') - , stack = [report] - , progress - , ctx - - root = root || document.getElementById('mocha'); - - if (canvas.getContext) { - var ratio = window.devicePixelRatio || 1; - canvas.style.width = canvas.width; - canvas.style.height = canvas.height; - canvas.width *= ratio; - canvas.height *= ratio; - ctx = canvas.getContext('2d'); - ctx.scale(ratio, ratio); - progress = new Progress; - } - - if (!root) return error('#mocha div missing, add it to your document'); - - // pass toggle - on(passesLink, 'click', function(){ - unhide(); - var name = /pass/.test(report.className) ? '' : ' pass'; - report.className = report.className.replace(/fail|pass/g, '') + name; - if (report.className.trim()) hideSuitesWithout('test pass'); - }); - - // failure toggle - on(failuresLink, 'click', function(){ - unhide(); - var name = /fail/.test(report.className) ? '' : ' fail'; - report.className = report.className.replace(/fail|pass/g, '') + name; - if (report.className.trim()) hideSuitesWithout('test fail'); - }); - - root.appendChild(stat); - root.appendChild(report); - - if (progress) progress.size(40); - - runner.on('suite', function(suite){ - if (suite.root) return; - - // suite - var url = '?grep=' + encodeURIComponent(suite.fullTitle()); - var el = fragment('
                • %s

                • ', url, escape(suite.title)); - - // container - stack[0].appendChild(el); - stack.unshift(document.createElement('ul')); - el.appendChild(stack[0]); - }); - - runner.on('suite end', function(suite){ - if (suite.root) return; - stack.shift(); - }); - - runner.on('fail', function(test, err){ - if ('hook' == test.type) runner.emit('test end', test); - }); - - runner.on('test end', function(test){ - // TODO: add to stats - var percent = stats.tests / this.total * 100 | 0; - if (progress) progress.update(percent).draw(ctx); - - // update stats - var ms = new Date - stats.start; - text(passes, stats.passes); - text(failures, stats.failures); - text(duration, (ms / 1000).toFixed(2)); - - // test - if ('passed' == test.state) { - var el = fragment('
                • %e%ems

                • ', test.speed, test.title, test.duration, encodeURIComponent(test.fullTitle())); - } else if (test.pending) { - var el = fragment('
                • %e

                • ', test.title); - } else { - var el = fragment('
                • %e

                • ', test.title, encodeURIComponent(test.fullTitle())); - var str = test.err.stack || test.err.toString(); - - // FF / Opera do not add the message - if (!~str.indexOf(test.err.message)) { - str = test.err.message + '\n' + str; - } - - // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we - // check for the result of the stringifying. - if ('[object Error]' == str) str = test.err.message; - - // Safari doesn't give you a stack. Let's at least provide a source line. - if (!test.err.stack && test.err.sourceURL && test.err.line !== undefined) { - str += "\n(" + test.err.sourceURL + ":" + test.err.line + ")"; - } - - el.appendChild(fragment('
                  %e
                  ', str)); - } - - // toggle code - // TODO: defer - if (!test.pending) { - var h2 = el.getElementsByTagName('h2')[0]; - - on(h2, 'click', function(){ - pre.style.display = 'none' == pre.style.display - ? 'block' - : 'none'; - }); - - var pre = fragment('
                  %e
                  ', utils.clean(test.fn.toString())); - el.appendChild(pre); - pre.style.display = 'none'; - } - - // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack. - if (stack[0]) stack[0].appendChild(el); - }); -} - -/** - * Display error `msg`. - */ - -function error(msg) { - document.body.appendChild(fragment('
                  %s
                  ', msg)); -} - -/** - * Return a DOM fragment from `html`. - */ - -function fragment(html) { - var args = arguments - , div = document.createElement('div') - , i = 1; - - div.innerHTML = html.replace(/%([se])/g, function(_, type){ - switch (type) { - case 's': return String(args[i++]); - case 'e': return escape(args[i++]); - } - }); - - return div.firstChild; -} - -/** - * Check for suites that do not have elements - * with `classname`, and hide them. - */ - -function hideSuitesWithout(classname) { - var suites = document.getElementsByClassName('suite'); - for (var i = 0; i < suites.length; i++) { - var els = suites[i].getElementsByClassName(classname); - if (0 == els.length) suites[i].className += ' hidden'; - } -} - -/** - * Unhide .hidden suites. - */ - -function unhide() { - var els = document.getElementsByClassName('suite hidden'); - for (var i = 0; i < els.length; ++i) { - els[i].className = els[i].className.replace('suite hidden', 'suite'); - } -} - -/** - * Set `el` text to `str`. - */ - -function text(el, str) { - if (el.textContent) { - el.textContent = str; - } else { - el.innerText = str; - } -} - -/** - * Listen on `event` with callback `fn`. - */ - -function on(el, event, fn) { - if (el.addEventListener) { - el.addEventListener(event, fn, false); - } else { - el.attachEvent('on' + event, fn); - } -} - -}); // module: reporters/html.js - -require.register("reporters/index.js", function(module, exports, require){ - -exports.Base = require('./base'); -exports.Dot = require('./dot'); -exports.Doc = require('./doc'); -exports.TAP = require('./tap'); -exports.JSON = require('./json'); -exports.HTML = require('./html'); -exports.List = require('./list'); -exports.Min = require('./min'); -exports.Spec = require('./spec'); -exports.Nyan = require('./nyan'); -exports.XUnit = require('./xunit'); -exports.Markdown = require('./markdown'); -exports.Progress = require('./progress'); -exports.Landing = require('./landing'); -exports.JSONCov = require('./json-cov'); -exports.HTMLCov = require('./html-cov'); -exports.JSONStream = require('./json-stream'); -exports.Teamcity = require('./teamcity'); - -}); // module: reporters/index.js - -require.register("reporters/json-cov.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `JSONCov`. - */ - -exports = module.exports = JSONCov; - -/** - * Initialize a new `JsCoverage` reporter. - * - * @param {Runner} runner - * @param {Boolean} output - * @api public - */ - -function JSONCov(runner, output) { - var self = this - , output = 1 == arguments.length ? true : output; - - Base.call(this, runner); - - var tests = [] - , failures = [] - , passes = []; - - runner.on('test end', function(test){ - tests.push(test); - }); - - runner.on('pass', function(test){ - passes.push(test); - }); - - runner.on('fail', function(test){ - failures.push(test); - }); - - runner.on('end', function(){ - var cov = global._$jscoverage || {}; - var result = self.cov = map(cov); - result.stats = self.stats; - result.tests = tests.map(clean); - result.failures = failures.map(clean); - result.passes = passes.map(clean); - if (!output) return; - process.stdout.write(JSON.stringify(result, null, 2 )); - }); -} - -/** - * Map jscoverage data to a JSON structure - * suitable for reporting. - * - * @param {Object} cov - * @return {Object} - * @api private - */ - -function map(cov) { - var ret = { - instrumentation: 'node-jscoverage' - , sloc: 0 - , hits: 0 - , misses: 0 - , coverage: 0 - , files: [] - }; - - for (var filename in cov) { - var data = coverage(filename, cov[filename]); - ret.files.push(data); - ret.hits += data.hits; - ret.misses += data.misses; - ret.sloc += data.sloc; - } - - ret.files.sort(function(a, b) { - return a.filename.localeCompare(b.filename); - }); - - if (ret.sloc > 0) { - ret.coverage = (ret.hits / ret.sloc) * 100; - } - - return ret; -}; - -/** - * Map jscoverage data for a single source file - * to a JSON structure suitable for reporting. - * - * @param {String} filename name of the source file - * @param {Object} data jscoverage coverage data - * @return {Object} - * @api private - */ - -function coverage(filename, data) { - var ret = { - filename: filename, - coverage: 0, - hits: 0, - misses: 0, - sloc: 0, - source: {} - }; - - data.source.forEach(function(line, num){ - num++; - - if (data[num] === 0) { - ret.misses++; - ret.sloc++; - } else if (data[num] !== undefined) { - ret.hits++; - ret.sloc++; - } - - ret.source[num] = { - source: line - , coverage: data[num] === undefined - ? '' - : data[num] - }; - }); - - ret.coverage = ret.hits / ret.sloc * 100; - - return ret; -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} - -}); // module: reporters/json-cov.js - -require.register("reporters/json-stream.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `List`. - */ - -exports = module.exports = List; - -/** - * Initialize a new `List` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function List(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , total = runner.total; - - runner.on('start', function(){ - console.log(JSON.stringify(['start', { total: total }])); - }); - - runner.on('pass', function(test){ - console.log(JSON.stringify(['pass', clean(test)])); - }); - - runner.on('fail', function(test, err){ - console.log(JSON.stringify(['fail', clean(test)])); - }); - - runner.on('end', function(){ - process.stdout.write(JSON.stringify(['end', self.stats])); - }); -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} -}); // module: reporters/json-stream.js - -require.register("reporters/json.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `JSON`. - */ - -exports = module.exports = JSONReporter; - -/** - * Initialize a new `JSON` reporter. - * - * @param {Runner} runner - * @api public - */ - -function JSONReporter(runner) { - var self = this; - Base.call(this, runner); - - var tests = [] - , failures = [] - , passes = []; - - runner.on('test end', function(test){ - tests.push(test); - }); - - runner.on('pass', function(test){ - passes.push(test); - }); - - runner.on('fail', function(test){ - failures.push(test); - }); - - runner.on('end', function(){ - var obj = { - stats: self.stats - , tests: tests.map(clean) - , failures: failures.map(clean) - , passes: passes.map(clean) - }; - - process.stdout.write(JSON.stringify(obj, null, 2)); - }); -} - -/** - * Return a plain-object representation of `test` - * free of cyclic properties etc. - * - * @param {Object} test - * @return {Object} - * @api private - */ - -function clean(test) { - return { - title: test.title - , fullTitle: test.fullTitle() - , duration: test.duration - } -} -}); // module: reporters/json.js - -require.register("reporters/landing.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Landing`. - */ - -exports = module.exports = Landing; - -/** - * Airplane color. - */ - -Base.colors.plane = 0; - -/** - * Airplane crash color. - */ - -Base.colors['plane crash'] = 31; - -/** - * Runway color. - */ - -Base.colors.runway = 90; - -/** - * Initialize a new `Landing` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Landing(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , total = runner.total - , stream = process.stdout - , plane = color('plane', '✈') - , crashed = -1 - , n = 0; - - function runway() { - var buf = Array(width).join('-'); - return ' ' + color('runway', buf); - } - - runner.on('start', function(){ - stream.write('\n '); - cursor.hide(); - }); - - runner.on('test end', function(test){ - // check if the plane crashed - var col = -1 == crashed - ? width * ++n / total | 0 - : crashed; - - // show the crash - if ('failed' == test.state) { - plane = color('plane crash', '✈'); - crashed = col; - } - - // render landing strip - stream.write('\u001b[4F\n\n'); - stream.write(runway()); - stream.write('\n '); - stream.write(color('runway', Array(col).join('⋅'))); - stream.write(plane) - stream.write(color('runway', Array(width - col).join('⋅') + '\n')); - stream.write(runway()); - stream.write('\u001b[0m'); - }); - - runner.on('end', function(){ - cursor.show(); - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Landing.prototype = new F; -Landing.prototype.constructor = Landing; - -}); // module: reporters/landing.js - -require.register("reporters/list.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `List`. - */ - -exports = module.exports = List; - -/** - * Initialize a new `List` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function List(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , n = 0; - - runner.on('start', function(){ - console.log(); - }); - - runner.on('test', function(test){ - process.stdout.write(color('pass', ' ' + test.fullTitle() + ': ')); - }); - - runner.on('pending', function(test){ - var fmt = color('checkmark', ' -') - + color('pending', ' %s'); - console.log(fmt, test.fullTitle()); - }); - - runner.on('pass', function(test){ - var fmt = color('checkmark', ' '+Base.symbols.dot) - + color('pass', ' %s: ') - + color(test.speed, '%dms'); - cursor.CR(); - console.log(fmt, test.fullTitle(), test.duration); - }); - - runner.on('fail', function(test, err){ - cursor.CR(); - console.log(color('fail', ' %d) %s'), ++n, test.fullTitle()); - }); - - runner.on('end', self.epilogue.bind(self)); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -List.prototype = new F; -List.prototype.constructor = List; - - -}); // module: reporters/list.js - -require.register("reporters/markdown.js", function(module, exports, require){ -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils'); - -/** - * Expose `Markdown`. - */ - -exports = module.exports = Markdown; - -/** - * Initialize a new `Markdown` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Markdown(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , level = 0 - , buf = ''; - - function title(str) { - return Array(level).join('#') + ' ' + str; - } - - function indent() { - return Array(level).join(' '); - } - - function mapTOC(suite, obj) { - var ret = obj; - obj = obj[suite.title] = obj[suite.title] || { suite: suite }; - suite.suites.forEach(function(suite){ - mapTOC(suite, obj); - }); - return ret; - } - - function stringifyTOC(obj, level) { - ++level; - var buf = ''; - var link; - for (var key in obj) { - if ('suite' == key) continue; - if (key) link = ' - [' + key + '](#' + utils.slug(obj[key].suite.fullTitle()) + ')\n'; - if (key) buf += Array(level).join(' ') + link; - buf += stringifyTOC(obj[key], level); - } - --level; - return buf; - } - - function generateTOC(suite) { - var obj = mapTOC(suite, {}); - return stringifyTOC(obj, 0); - } - - generateTOC(runner.suite); - - runner.on('suite', function(suite){ - ++level; - var slug = utils.slug(suite.fullTitle()); - buf += '' + '\n'; - buf += title(suite.title) + '\n'; - }); - - runner.on('suite end', function(suite){ - --level; - }); - - runner.on('pass', function(test){ - var code = utils.clean(test.fn.toString()); - buf += test.title + '.\n'; - buf += '\n```js\n'; - buf += code + '\n'; - buf += '```\n\n'; - }); - - runner.on('end', function(){ - process.stdout.write('# TOC\n'); - process.stdout.write(generateTOC(runner.suite)); - process.stdout.write(buf); - }); -} -}); // module: reporters/markdown.js - -require.register("reporters/min.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `Min`. - */ - -exports = module.exports = Min; - -/** - * Initialize a new `Min` minimal test reporter (best used with --watch). - * - * @param {Runner} runner - * @api public - */ - -function Min(runner) { - Base.call(this, runner); - - runner.on('start', function(){ - // clear screen - process.stdout.write('\u001b[2J'); - // set cursor position - process.stdout.write('\u001b[1;3H'); - }); - - runner.on('end', this.epilogue.bind(this)); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Min.prototype = new F; -Min.prototype.constructor = Min; - - -}); // module: reporters/min.js - -require.register("reporters/nyan.js", function(module, exports, require){ -/** - * Module dependencies. - */ - -var Base = require('./base') - , color = Base.color; - -/** - * Expose `Dot`. - */ - -exports = module.exports = NyanCat; - -/** - * Initialize a new `Dot` matrix test reporter. - * - * @param {Runner} runner - * @api public - */ - -function NyanCat(runner) { - Base.call(this, runner); - var self = this - , stats = this.stats - , width = Base.window.width * .75 | 0 - , rainbowColors = this.rainbowColors = self.generateColors() - , colorIndex = this.colorIndex = 0 - , numerOfLines = this.numberOfLines = 4 - , trajectories = this.trajectories = [[], [], [], []] - , nyanCatWidth = this.nyanCatWidth = 11 - , trajectoryWidthMax = this.trajectoryWidthMax = (width - nyanCatWidth) - , scoreboardWidth = this.scoreboardWidth = 5 - , tick = this.tick = 0 - , n = 0; - - runner.on('start', function(){ - Base.cursor.hide(); - self.draw(); - }); - - runner.on('pending', function(test){ - self.draw(); - }); - - runner.on('pass', function(test){ - self.draw(); - }); - - runner.on('fail', function(test, err){ - self.draw(); - }); - - runner.on('end', function(){ - Base.cursor.show(); - for (var i = 0; i < self.numberOfLines; i++) write('\n'); - self.epilogue(); - }); -} - -/** - * Draw the nyan cat - * - * @api private - */ - -NyanCat.prototype.draw = function(){ - this.appendRainbow(); - this.drawScoreboard(); - this.drawRainbow(); - this.drawNyanCat(); - this.tick = !this.tick; -}; - -/** - * Draw the "scoreboard" showing the number - * of passes, failures and pending tests. - * - * @api private - */ - -NyanCat.prototype.drawScoreboard = function(){ - var stats = this.stats; - var colors = Base.colors; - - function draw(color, n) { - write(' '); - write('\u001b[' + color + 'm' + n + '\u001b[0m'); - write('\n'); - } - - draw(colors.green, stats.passes); - draw(colors.fail, stats.failures); - draw(colors.pending, stats.pending); - write('\n'); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Append the rainbow. - * - * @api private - */ - -NyanCat.prototype.appendRainbow = function(){ - var segment = this.tick ? '_' : '-'; - var rainbowified = this.rainbowify(segment); - - for (var index = 0; index < this.numberOfLines; index++) { - var trajectory = this.trajectories[index]; - if (trajectory.length >= this.trajectoryWidthMax) trajectory.shift(); - trajectory.push(rainbowified); - } -}; - -/** - * Draw the rainbow. - * - * @api private - */ - -NyanCat.prototype.drawRainbow = function(){ - var self = this; - - this.trajectories.forEach(function(line, index) { - write('\u001b[' + self.scoreboardWidth + 'C'); - write(line.join('')); - write('\n'); - }); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Draw the nyan cat - * - * @api private - */ - -NyanCat.prototype.drawNyanCat = function() { - var self = this; - var startWidth = this.scoreboardWidth + this.trajectories[0].length; - var color = '\u001b[' + startWidth + 'C'; - var padding = ''; - - write(color); - write('_,------,'); - write('\n'); - - write(color); - padding = self.tick ? ' ' : ' '; - write('_|' + padding + '/\\_/\\ '); - write('\n'); - - write(color); - padding = self.tick ? '_' : '__'; - var tail = self.tick ? '~' : '^'; - var face; - write(tail + '|' + padding + this.face() + ' '); - write('\n'); - - write(color); - padding = self.tick ? ' ' : ' '; - write(padding + '"" "" '); - write('\n'); - - this.cursorUp(this.numberOfLines); -}; - -/** - * Draw nyan cat face. - * - * @return {String} - * @api private - */ - -NyanCat.prototype.face = function() { - var stats = this.stats; - if (stats.failures) { - return '( x .x)'; - } else if (stats.pending) { - return '( o .o)'; - } else if(stats.passes) { - return '( ^ .^)'; - } else { - return '( - .-)'; - } -} - -/** - * Move cursor up `n`. - * - * @param {Number} n - * @api private - */ - -NyanCat.prototype.cursorUp = function(n) { - write('\u001b[' + n + 'A'); -}; - -/** - * Move cursor down `n`. - * - * @param {Number} n - * @api private - */ - -NyanCat.prototype.cursorDown = function(n) { - write('\u001b[' + n + 'B'); -}; - -/** - * Generate rainbow colors. - * - * @return {Array} - * @api private - */ - -NyanCat.prototype.generateColors = function(){ - var colors = []; - - for (var i = 0; i < (6 * 7); i++) { - var pi3 = Math.floor(Math.PI / 3); - var n = (i * (1.0 / 6)); - var r = Math.floor(3 * Math.sin(n) + 3); - var g = Math.floor(3 * Math.sin(n + 2 * pi3) + 3); - var b = Math.floor(3 * Math.sin(n + 4 * pi3) + 3); - colors.push(36 * r + 6 * g + b + 16); - } - - return colors; -}; - -/** - * Apply rainbow to the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -NyanCat.prototype.rainbowify = function(str){ - var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length]; - this.colorIndex += 1; - return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m'; -}; - -/** - * Stdout helper. - */ - -function write(string) { - process.stdout.write(string); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -NyanCat.prototype = new F; -NyanCat.prototype.constructor = NyanCat; - - -}); // module: reporters/nyan.js - -require.register("reporters/progress.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Progress`. - */ - -exports = module.exports = Progress; - -/** - * General progress bar color. - */ - -Base.colors.progress = 90; - -/** - * Initialize a new `Progress` bar test reporter. - * - * @param {Runner} runner - * @param {Object} options - * @api public - */ - -function Progress(runner, options) { - Base.call(this, runner); - - var self = this - , options = options || {} - , stats = this.stats - , width = Base.window.width * .50 | 0 - , total = runner.total - , complete = 0 - , max = Math.max; - - // default chars - options.open = options.open || '['; - options.complete = options.complete || '▬'; - options.incomplete = options.incomplete || Base.symbols.dot; - options.close = options.close || ']'; - options.verbose = false; - - // tests started - runner.on('start', function(){ - console.log(); - cursor.hide(); - }); - - // tests complete - runner.on('test end', function(){ - complete++; - var incomplete = total - complete - , percent = complete / total - , n = width * percent | 0 - , i = width - n; - - cursor.CR(); - process.stdout.write('\u001b[J'); - process.stdout.write(color('progress', ' ' + options.open)); - process.stdout.write(Array(n).join(options.complete)); - process.stdout.write(Array(i).join(options.incomplete)); - process.stdout.write(color('progress', options.close)); - if (options.verbose) { - process.stdout.write(color('progress', ' ' + complete + ' of ' + total)); - } - }); - - // tests are complete, output some stats - // and the failures if any - runner.on('end', function(){ - cursor.show(); - console.log(); - self.epilogue(); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Progress.prototype = new F; -Progress.prototype.constructor = Progress; - - -}); // module: reporters/progress.js - -require.register("reporters/spec.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `Spec`. - */ - -exports = module.exports = Spec; - -/** - * Initialize a new `Spec` test reporter. - * - * @param {Runner} runner - * @api public - */ - -function Spec(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , indents = 0 - , n = 0; - - function indent() { - return Array(indents).join(' ') - } - - runner.on('start', function(){ - console.log(); - }); - - runner.on('suite', function(suite){ - ++indents; - console.log(color('suite', '%s%s'), indent(), suite.title); - }); - - runner.on('suite end', function(suite){ - --indents; - if (1 == indents) console.log(); - }); - - runner.on('test', function(test){ - process.stdout.write(indent() + color('pass', ' ◦ ' + test.title + ': ')); - }); - - runner.on('pending', function(test){ - var fmt = indent() + color('pending', ' - %s'); - console.log(fmt, test.title); - }); - - runner.on('pass', function(test){ - if ('fast' == test.speed) { - var fmt = indent() - + color('checkmark', ' ' + Base.symbols.ok) - + color('pass', ' %s '); - cursor.CR(); - console.log(fmt, test.title); - } else { - var fmt = indent() - + color('checkmark', ' ' + Base.symbols.ok) - + color('pass', ' %s ') - + color(test.speed, '(%dms)'); - cursor.CR(); - console.log(fmt, test.title, test.duration); - } - }); - - runner.on('fail', function(test, err){ - cursor.CR(); - console.log(indent() + color('fail', ' %d) %s'), ++n, test.title); - }); - - runner.on('end', self.epilogue.bind(self)); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -Spec.prototype = new F; -Spec.prototype.constructor = Spec; - - -}); // module: reporters/spec.js - -require.register("reporters/tap.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , cursor = Base.cursor - , color = Base.color; - -/** - * Expose `TAP`. - */ - -exports = module.exports = TAP; - -/** - * Initialize a new `TAP` reporter. - * - * @param {Runner} runner - * @api public - */ - -function TAP(runner) { - Base.call(this, runner); - - var self = this - , stats = this.stats - , n = 1 - , passes = 0 - , failures = 0; - - runner.on('start', function(){ - var total = runner.grepTotal(runner.suite); - console.log('%d..%d', 1, total); - }); - - runner.on('test end', function(){ - ++n; - }); - - runner.on('pending', function(test){ - console.log('ok %d %s # SKIP -', n, title(test)); - }); - - runner.on('pass', function(test){ - passes++; - console.log('ok %d %s', n, title(test)); - }); - - runner.on('fail', function(test, err){ - failures++; - console.log('not ok %d %s', n, title(test)); - if (err.stack) console.log(err.stack.replace(/^/gm, ' ')); - }); - - runner.on('end', function(){ - console.log('# tests ' + (passes + failures)); - console.log('# pass ' + passes); - console.log('# fail ' + failures); - }); -} - -/** - * Return a TAP-safe title of `test` - * - * @param {Object} test - * @return {String} - * @api private - */ - -function title(test) { - return test.fullTitle().replace(/#/g, ''); -} - -}); // module: reporters/tap.js - -require.register("reporters/teamcity.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base'); - -/** - * Expose `Teamcity`. - */ - -exports = module.exports = Teamcity; - -/** - * Initialize a new `Teamcity` reporter. - * - * @param {Runner} runner - * @api public - */ - -function Teamcity(runner) { - Base.call(this, runner); - var stats = this.stats; - - runner.on('start', function() { - console.log("##teamcity[testSuiteStarted name='mocha.suite']"); - }); - - runner.on('test', function(test) { - console.log("##teamcity[testStarted name='" + escape(test.fullTitle()) + "']"); - }); - - runner.on('fail', function(test, err) { - console.log("##teamcity[testFailed name='" + escape(test.fullTitle()) + "' message='" + escape(err.message) + "']"); - }); - - runner.on('pending', function(test) { - console.log("##teamcity[testIgnored name='" + escape(test.fullTitle()) + "' message='pending']"); - }); - - runner.on('test end', function(test) { - console.log("##teamcity[testFinished name='" + escape(test.fullTitle()) + "' duration='" + test.duration + "']"); - }); - - runner.on('end', function() { - console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='" + stats.duration + "']"); - }); -} - -/** - * Escape the given `str`. - */ - -function escape(str) { - return str - .replace(/\|/g, "||") - .replace(/\n/g, "|n") - .replace(/\r/g, "|r") - .replace(/\[/g, "|[") - .replace(/\]/g, "|]") - .replace(/\u0085/g, "|x") - .replace(/\u2028/g, "|l") - .replace(/\u2029/g, "|p") - .replace(/'/g, "|'"); -} - -}); // module: reporters/teamcity.js - -require.register("reporters/xunit.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Base = require('./base') - , utils = require('../utils') - , escape = utils.escape; - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Expose `XUnit`. - */ - -exports = module.exports = XUnit; - -/** - * Initialize a new `XUnit` reporter. - * - * @param {Runner} runner - * @api public - */ - -function XUnit(runner) { - Base.call(this, runner); - var stats = this.stats - , tests = [] - , self = this; - - runner.on('pass', function(test){ - tests.push(test); - }); - - runner.on('fail', function(test){ - tests.push(test); - }); - - runner.on('end', function(){ - console.log(tag('testsuite', { - name: 'Mocha Tests' - , tests: stats.tests - , failures: stats.failures - , errors: stats.failures - , skipped: stats.tests - stats.failures - stats.passes - , timestamp: (new Date).toUTCString() - , time: (stats.duration / 1000) || 0 - }, false)); - - tests.forEach(test); - console.log(''); - }); -} - -/** - * Inherit from `Base.prototype`. - */ - -function F(){}; -F.prototype = Base.prototype; -XUnit.prototype = new F; -XUnit.prototype.constructor = XUnit; - - -/** - * Output tag for the given `test.` - */ - -function test(test) { - var attrs = { - classname: test.parent.fullTitle() - , name: test.title - , time: test.duration / 1000 - }; - - if ('failed' == test.state) { - var err = test.err; - attrs.message = escape(err.message); - console.log(tag('testcase', attrs, false, tag('failure', attrs, false, cdata(err.stack)))); - } else if (test.pending) { - console.log(tag('testcase', attrs, false, tag('skipped', {}, true))); - } else { - console.log(tag('testcase', attrs, true) ); - } -} - -/** - * HTML tag helper. - */ - -function tag(name, attrs, close, content) { - var end = close ? '/>' : '>' - , pairs = [] - , tag; - - for (var key in attrs) { - pairs.push(key + '="' + escape(attrs[key]) + '"'); - } - - tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end; - if (content) tag += content + ''; -} - -}); // module: reporters/xunit.js - -require.register("runnable.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var EventEmitter = require('browser/events').EventEmitter - , debug = require('browser/debug')('mocha:runnable') - , milliseconds = require('./ms'); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date - , setTimeout = global.setTimeout - , setInterval = global.setInterval - , clearTimeout = global.clearTimeout - , clearInterval = global.clearInterval; - -/** - * Object#toString(). - */ - -var toString = Object.prototype.toString; - -/** - * Expose `Runnable`. - */ - -module.exports = Runnable; - -/** - * Initialize a new `Runnable` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Runnable(title, fn) { - this.title = title; - this.fn = fn; - this.async = fn && fn.length; - this.sync = ! this.async; - this._timeout = 2000; - this._slow = 75; - this.timedOut = false; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -function F(){}; -F.prototype = EventEmitter.prototype; -Runnable.prototype = new F; -Runnable.prototype.constructor = Runnable; - - -/** - * Set & get timeout `ms`. - * - * @param {Number|String} ms - * @return {Runnable|Number} ms or self - * @api private - */ - -Runnable.prototype.timeout = function(ms){ - if (0 == arguments.length) return this._timeout; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._timeout = ms; - if (this.timer) this.resetTimeout(); - return this; -}; - -/** - * Set & get slow `ms`. - * - * @param {Number|String} ms - * @return {Runnable|Number} ms or self - * @api private - */ - -Runnable.prototype.slow = function(ms){ - if (0 === arguments.length) return this._slow; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._slow = ms; - return this; -}; - -/** - * Return the full title generated by recursively - * concatenating the parent's full title. - * - * @return {String} - * @api public - */ - -Runnable.prototype.fullTitle = function(){ - return this.parent.fullTitle() + ' ' + this.title; -}; - -/** - * Clear the timeout. - * - * @api private - */ - -Runnable.prototype.clearTimeout = function(){ - clearTimeout(this.timer); -}; - -/** - * Inspect the runnable void of private properties. - * - * @return {String} - * @api private - */ - -Runnable.prototype.inspect = function(){ - return JSON.stringify(this, function(key, val){ - if ('_' == key[0]) return; - if ('parent' == key) return '#'; - if ('ctx' == key) return '#'; - return val; - }, 2); -}; - -/** - * Reset the timeout. - * - * @api private - */ - -Runnable.prototype.resetTimeout = function(){ - var self = this; - var ms = this.timeout() || 1e9; - - this.clearTimeout(); - this.timer = setTimeout(function(){ - self.callback(new Error('timeout of ' + ms + 'ms exceeded')); - self.timedOut = true; - }, ms); -}; - -/** - * Run the test and invoke `fn(err)`. - * - * @param {Function} fn - * @api private - */ - -Runnable.prototype.run = function(fn){ - var self = this - , ms = this.timeout() - , start = new Date - , ctx = this.ctx - , finished - , emitted; - - if (ctx) ctx.runnable(this); - - // timeout - if (this.async) { - if (ms) { - this.timer = setTimeout(function(){ - done(new Error('timeout of ' + ms + 'ms exceeded')); - self.timedOut = true; - }, ms); - } - } - - // called multiple times - function multiple(err) { - if (emitted) return; - emitted = true; - self.emit('error', err || new Error('done() called multiple times')); - } - - // finished - function done(err) { - if (self.timedOut) return; - if (finished) return multiple(err); - self.clearTimeout(); - self.duration = new Date - start; - finished = true; - fn(err); - } - - // for .resetTimeout() - this.callback = done; - - // async - if (this.async) { - try { - this.fn.call(ctx, function(err){ - if (err instanceof Error || toString.call(err) === "[object Error]") return done(err); - if (null != err) return done(new Error('done() invoked with non-Error: ' + err)); - done(); - }); - } catch (err) { - done(err); - } - return; - } - - if (this.asyncOnly) { - return done(new Error('--async-only option in use without declaring `done()`')); - } - - // sync - try { - if (!this.pending) this.fn.call(ctx); - this.duration = new Date - start; - fn(); - } catch (err) { - fn(err); - } -}; - -}); // module: runnable.js - -require.register("runner.js", function(module, exports, require){ -/** - * Module dependencies. - */ - -var EventEmitter = require('browser/events').EventEmitter - , debug = require('browser/debug')('mocha:runner') - , Test = require('./test') - , utils = require('./utils') - , filter = utils.filter - , keys = utils.keys; - -/** - * Non-enumerable globals. - */ - -var globals = [ - 'setTimeout', - 'clearTimeout', - 'setInterval', - 'clearInterval', - 'XMLHttpRequest', - 'Date' -]; - -/** - * Expose `Runner`. - */ - -module.exports = Runner; - -/** - * Initialize a `Runner` for the given `suite`. - * - * Events: - * - * - `start` execution started - * - `end` execution complete - * - `suite` (suite) test suite execution started - * - `suite end` (suite) all tests (and sub-suites) have finished - * - `test` (test) test execution started - * - `test end` (test) test completed - * - `hook` (hook) hook execution started - * - `hook end` (hook) hook complete - * - `pass` (test) test passed - * - `fail` (test, err) test failed - * - `pending` (test) test pending - * - * @api public - */ - -function Runner(suite) { - var self = this; - this._globals = []; - this.suite = suite; - this.total = suite.total(); - this.failures = 0; - this.on('test end', function(test){ self.checkGlobals(test); }); - this.on('hook end', function(hook){ self.checkGlobals(hook); }); - this.grep(/.*/); - this.globals(this.globalProps().concat(['errno'])); -} - -/** - * Wrapper for setImmediate, process.nextTick, or browser polyfill. - * - * @param {Function} fn - * @api private - */ - -Runner.immediately = global.setImmediate || process.nextTick; - -/** - * Inherit from `EventEmitter.prototype`. - */ - -function F(){}; -F.prototype = EventEmitter.prototype; -Runner.prototype = new F; -Runner.prototype.constructor = Runner; - - -/** - * Run tests with full titles matching `re`. Updates runner.total - * with number of tests matched. - * - * @param {RegExp} re - * @param {Boolean} invert - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.grep = function(re, invert){ - debug('grep %s', re); - this._grep = re; - this._invert = invert; - this.total = this.grepTotal(this.suite); - return this; -}; - -/** - * Returns the number of tests matching the grep search for the - * given suite. - * - * @param {Suite} suite - * @return {Number} - * @api public - */ - -Runner.prototype.grepTotal = function(suite) { - var self = this; - var total = 0; - - suite.eachTest(function(test){ - var match = self._grep.test(test.fullTitle()); - if (self._invert) match = !match; - if (match) total++; - }); - - return total; -}; - -/** - * Return a list of global properties. - * - * @return {Array} - * @api private - */ - -Runner.prototype.globalProps = function() { - var props = utils.keys(global); - - // non-enumerables - for (var i = 0; i < globals.length; ++i) { - if (~utils.indexOf(props, globals[i])) continue; - props.push(globals[i]); - } - - return props; -}; - -/** - * Allow the given `arr` of globals. - * - * @param {Array} arr - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.globals = function(arr){ - if (0 == arguments.length) return this._globals; - debug('globals %j', arr); - utils.forEach(arr, function(arr){ - this._globals.push(arr); - }, this); - return this; -}; - -/** - * Check for global variable leaks. - * - * @api private - */ - -Runner.prototype.checkGlobals = function(test){ - if (this.ignoreLeaks) return; - var ok = this._globals; - var globals = this.globalProps(); - var isNode = process.kill; - var leaks; - - // check length - 2 ('errno' and 'location' globals) - if (isNode && 1 == ok.length - globals.length) return - else if (2 == ok.length - globals.length) return; - - leaks = filterLeaks(ok, globals); - this._globals = this._globals.concat(leaks); - - if (leaks.length > 1) { - this.fail(test, new Error('global leaks detected: ' + leaks.join(', ') + '')); - } else if (leaks.length) { - this.fail(test, new Error('global leak detected: ' + leaks[0])); - } -}; - -/** - * Fail the given `test`. - * - * @param {Test} test - * @param {Error} err - * @api private - */ - -Runner.prototype.fail = function(test, err){ - ++this.failures; - test.state = 'failed'; - - if ('string' == typeof err) { - err = new Error('the string "' + err + '" was thrown, throw an Error :)'); - } - - this.emit('fail', test, err); -}; - -/** - * Fail the given `hook` with `err`. - * - * Hook failures (currently) hard-end due - * to that fact that a failing hook will - * surely cause subsequent tests to fail, - * causing jumbled reporting. - * - * @param {Hook} hook - * @param {Error} err - * @api private - */ - -Runner.prototype.failHook = function(hook, err){ - this.fail(hook, err); - this.emit('end'); -}; - -/** - * Run hook `name` callbacks and then invoke `fn()`. - * - * @param {String} name - * @param {Function} function - * @api private - */ - -Runner.prototype.hook = function(name, fn){ - var suite = this.suite - , hooks = suite['_' + name] - , self = this - , timer; - - function next(i) { - var hook = hooks[i]; - if (!hook) return fn(); - if (self.failures && suite.bail()) return fn(); - self.currentRunnable = hook; - - hook.ctx.currentTest = self.test; - - self.emit('hook', hook); - - hook.on('error', function(err){ - self.failHook(hook, err); - }); - - hook.run(function(err){ - hook.removeAllListeners('error'); - var testError = hook.error(); - if (testError) self.fail(self.test, testError); - if (err) return self.failHook(hook, err); - self.emit('hook end', hook); - delete hook.ctx.currentTest; - next(++i); - }); - } - - Runner.immediately(function(){ - next(0); - }); -}; - -/** - * Run hook `name` for the given array of `suites` - * in order, and callback `fn(err)`. - * - * @param {String} name - * @param {Array} suites - * @param {Function} fn - * @api private - */ - -Runner.prototype.hooks = function(name, suites, fn){ - var self = this - , orig = this.suite; - - function next(suite) { - self.suite = suite; - - if (!suite) { - self.suite = orig; - return fn(); - } - - self.hook(name, function(err){ - if (err) { - self.suite = orig; - return fn(err); - } - - next(suites.pop()); - }); - } - - next(suites.pop()); -}; - -/** - * Run hooks from the top level down. - * - * @param {String} name - * @param {Function} fn - * @api private - */ - -Runner.prototype.hookUp = function(name, fn){ - var suites = [this.suite].concat(this.parents()).reverse(); - this.hooks(name, suites, fn); -}; - -/** - * Run hooks from the bottom up. - * - * @param {String} name - * @param {Function} fn - * @api private - */ - -Runner.prototype.hookDown = function(name, fn){ - var suites = [this.suite].concat(this.parents()); - this.hooks(name, suites, fn); -}; - -/** - * Return an array of parent Suites from - * closest to furthest. - * - * @return {Array} - * @api private - */ - -Runner.prototype.parents = function(){ - var suite = this.suite - , suites = []; - while (suite = suite.parent) suites.push(suite); - return suites; -}; - -/** - * Run the current test and callback `fn(err)`. - * - * @param {Function} fn - * @api private - */ - -Runner.prototype.runTest = function(fn){ - var test = this.test - , self = this; - - if (this.asyncOnly) test.asyncOnly = true; - - try { - test.on('error', function(err){ - self.fail(test, err); - }); - test.run(fn); - } catch (err) { - fn(err); - } -}; - -/** - * Run tests in the given `suite` and invoke - * the callback `fn()` when complete. - * - * @param {Suite} suite - * @param {Function} fn - * @api private - */ - -Runner.prototype.runTests = function(suite, fn){ - var self = this - , tests = suite.tests.slice() - , test; - - function next(err) { - // if we bail after first err - if (self.failures && suite._bail) return fn(); - - // next test - test = tests.shift(); - - // all done - if (!test) return fn(); - - // grep - var match = self._grep.test(test.fullTitle()); - if (self._invert) match = !match; - if (!match) return next(); - - // pending - if (test.pending) { - self.emit('pending', test); - self.emit('test end', test); - return next(); - } - - // execute test and hook(s) - self.emit('test', self.test = test); - self.hookDown('beforeEach', function(){ - self.currentRunnable = self.test; - self.runTest(function(err){ - test = self.test; - - if (err) { - self.fail(test, err); - self.emit('test end', test); - return self.hookUp('afterEach', next); - } - - test.state = 'passed'; - self.emit('pass', test); - self.emit('test end', test); - self.hookUp('afterEach', next); - }); - }); - } - - this.next = next; - next(); -}; - -/** - * Run the given `suite` and invoke the - * callback `fn()` when complete. - * - * @param {Suite} suite - * @param {Function} fn - * @api private - */ - -Runner.prototype.runSuite = function(suite, fn){ - var total = this.grepTotal(suite) - , self = this - , i = 0; - - debug('run suite %s', suite.fullTitle()); - - if (!total) return fn(); - - this.emit('suite', this.suite = suite); - - function next() { - var curr = suite.suites[i++]; - if (!curr) return done(); - self.runSuite(curr, next); - } - - function done() { - self.suite = suite; - self.hook('afterAll', function(){ - self.emit('suite end', suite); - fn(); - }); - } - - this.hook('beforeAll', function(){ - self.runTests(suite, next); - }); -}; - -/** - * Handle uncaught exceptions. - * - * @param {Error} err - * @api private - */ - -Runner.prototype.uncaught = function(err){ - debug('uncaught exception %s', err.message); - var runnable = this.currentRunnable; - if (!runnable || 'failed' == runnable.state) return; - runnable.clearTimeout(); - err.uncaught = true; - this.fail(runnable, err); - - // recover from test - if ('test' == runnable.type) { - this.emit('test end', runnable); - this.hookUp('afterEach', this.next); - return; - } - - // bail on hooks - this.emit('end'); -}; - -/** - * Run the root suite and invoke `fn(failures)` - * on completion. - * - * @param {Function} fn - * @return {Runner} for chaining - * @api public - */ - -Runner.prototype.run = function(fn){ - var self = this - , fn = fn || function(){}; - - function uncaught(err){ - self.uncaught(err); - } - - debug('start'); - - // callback - this.on('end', function(){ - debug('end'); - process.removeListener('uncaughtException', uncaught); - fn(self.failures); - }); - - // run suites - this.emit('start'); - this.runSuite(this.suite, function(){ - debug('finished running'); - self.emit('end'); - }); - - // uncaught exception - process.on('uncaughtException', uncaught); - - return this; -}; - -/** - * Filter leaks with the given globals flagged as `ok`. - * - * @param {Array} ok - * @param {Array} globals - * @return {Array} - * @api private - */ - -function filterLeaks(ok, globals) { - return filter(globals, function(key){ - // Firefox and Chrome exposes iframes as index inside the window object - if (/^d+/.test(key)) return false; - var matched = filter(ok, function(ok){ - if (~ok.indexOf('*')) return 0 == key.indexOf(ok.split('*')[0]); - // Opera and IE expose global variables for HTML element IDs (issue #243) - if (/^mocha-/.test(key)) return true; - return key == ok; - }); - return matched.length == 0 && (!global.navigator || 'onerror' !== key); - }); -} - -}); // module: runner.js - -require.register("suite.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var EventEmitter = require('browser/events').EventEmitter - , debug = require('browser/debug')('mocha:suite') - , milliseconds = require('./ms') - , utils = require('./utils') - , Hook = require('./hook'); - -/** - * Expose `Suite`. - */ - -exports = module.exports = Suite; - -/** - * Create a new `Suite` with the given `title` - * and parent `Suite`. When a suite with the - * same title is already present, that suite - * is returned to provide nicer reporter - * and more flexible meta-testing. - * - * @param {Suite} parent - * @param {String} title - * @return {Suite} - * @api public - */ - -exports.create = function(parent, title){ - var suite = new Suite(title, parent.ctx); - suite.parent = parent; - if (parent.pending) suite.pending = true; - title = suite.fullTitle(); - parent.addSuite(suite); - return suite; -}; - -/** - * Initialize a new `Suite` with the given - * `title` and `ctx`. - * - * @param {String} title - * @param {Context} ctx - * @api private - */ - -function Suite(title, ctx) { - this.title = title; - this.ctx = ctx; - this.suites = []; - this.tests = []; - this.pending = false; - this._beforeEach = []; - this._beforeAll = []; - this._afterEach = []; - this._afterAll = []; - this.root = !title; - this._timeout = 2000; - this._slow = 75; - this._bail = false; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -function F(){}; -F.prototype = EventEmitter.prototype; -Suite.prototype = new F; -Suite.prototype.constructor = Suite; - - -/** - * Return a clone of this `Suite`. - * - * @return {Suite} - * @api private - */ - -Suite.prototype.clone = function(){ - var suite = new Suite(this.title); - debug('clone'); - suite.ctx = this.ctx; - suite.timeout(this.timeout()); - suite.slow(this.slow()); - suite.bail(this.bail()); - return suite; -}; - -/** - * Set timeout `ms` or short-hand such as "2s". - * - * @param {Number|String} ms - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.timeout = function(ms){ - if (0 == arguments.length) return this._timeout; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('timeout %d', ms); - this._timeout = parseInt(ms, 10); - return this; -}; - -/** - * Set slow `ms` or short-hand such as "2s". - * - * @param {Number|String} ms - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.slow = function(ms){ - if (0 === arguments.length) return this._slow; - if ('string' == typeof ms) ms = milliseconds(ms); - debug('slow %d', ms); - this._slow = ms; - return this; -}; - -/** - * Sets whether to bail after first error. - * - * @parma {Boolean} bail - * @return {Suite|Number} for chaining - * @api private - */ - -Suite.prototype.bail = function(bail){ - if (0 == arguments.length) return this._bail; - debug('bail %s', bail); - this._bail = bail; - return this; -}; - -/** - * Run `fn(test[, done])` before running tests. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.beforeAll = function(fn){ - if (this.pending) return this; - var hook = new Hook('"before all" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._beforeAll.push(hook); - this.emit('beforeAll', hook); - return this; -}; - -/** - * Run `fn(test[, done])` after running tests. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.afterAll = function(fn){ - if (this.pending) return this; - var hook = new Hook('"after all" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._afterAll.push(hook); - this.emit('afterAll', hook); - return this; -}; - -/** - * Run `fn(test[, done])` before each test case. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.beforeEach = function(fn){ - if (this.pending) return this; - var hook = new Hook('"before each" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._beforeEach.push(hook); - this.emit('beforeEach', hook); - return this; -}; - -/** - * Run `fn(test[, done])` after each test case. - * - * @param {Function} fn - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.afterEach = function(fn){ - if (this.pending) return this; - var hook = new Hook('"after each" hook', fn); - hook.parent = this; - hook.timeout(this.timeout()); - hook.slow(this.slow()); - hook.ctx = this.ctx; - this._afterEach.push(hook); - this.emit('afterEach', hook); - return this; -}; - -/** - * Add a test `suite`. - * - * @param {Suite} suite - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.addSuite = function(suite){ - suite.parent = this; - suite.timeout(this.timeout()); - suite.slow(this.slow()); - suite.bail(this.bail()); - this.suites.push(suite); - this.emit('suite', suite); - return this; -}; - -/** - * Add a `test` to this suite. - * - * @param {Test} test - * @return {Suite} for chaining - * @api private - */ - -Suite.prototype.addTest = function(test){ - test.parent = this; - test.timeout(this.timeout()); - test.slow(this.slow()); - test.ctx = this.ctx; - this.tests.push(test); - this.emit('test', test); - return this; -}; - -/** - * Return the full title generated by recursively - * concatenating the parent's full title. - * - * @return {String} - * @api public - */ - -Suite.prototype.fullTitle = function(){ - if (this.parent) { - var full = this.parent.fullTitle(); - if (full) return full + ' ' + this.title; - } - return this.title; -}; - -/** - * Return the total number of tests. - * - * @return {Number} - * @api public - */ - -Suite.prototype.total = function(){ - return utils.reduce(this.suites, function(sum, suite){ - return sum + suite.total(); - }, 0) + this.tests.length; -}; - -/** - * Iterates through each suite recursively to find - * all tests. Applies a function in the format - * `fn(test)`. - * - * @param {Function} fn - * @return {Suite} - * @api private - */ - -Suite.prototype.eachTest = function(fn){ - utils.forEach(this.tests, fn); - utils.forEach(this.suites, function(suite){ - suite.eachTest(fn); - }); - return this; -}; - -}); // module: suite.js - -require.register("test.js", function(module, exports, require){ - -/** - * Module dependencies. - */ - -var Runnable = require('./runnable'); - -/** - * Expose `Test`. - */ - -module.exports = Test; - -/** - * Initialize a new `Test` with the given `title` and callback `fn`. - * - * @param {String} title - * @param {Function} fn - * @api private - */ - -function Test(title, fn) { - Runnable.call(this, title, fn); - this.pending = !fn; - this.type = 'test'; -} - -/** - * Inherit from `Runnable.prototype`. - */ - -function F(){}; -F.prototype = Runnable.prototype; -Test.prototype = new F; -Test.prototype.constructor = Test; - - -}); // module: test.js - -require.register("utils.js", function(module, exports, require){ -/** - * Module dependencies. - */ - -var fs = require('browser/fs') - , path = require('browser/path') - , join = path.join - , debug = require('browser/debug')('mocha:watch'); - -/** - * Ignored directories. - */ - -var ignore = ['node_modules', '.git']; - -/** - * Escape special characters in the given string of html. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html){ - return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>'); -}; - -/** - * Array#forEach (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @param {Object} scope - * @api private - */ - -exports.forEach = function(arr, fn, scope){ - for (var i = 0, l = arr.length; i < l; i++) - fn.call(scope, arr[i], i); -}; - -/** - * Array#indexOf (<=IE8) - * - * @parma {Array} arr - * @param {Object} obj to find index of - * @param {Number} start - * @api private - */ - -exports.indexOf = function(arr, obj, start){ - for (var i = start || 0, l = arr.length; i < l; i++) { - if (arr[i] === obj) - return i; - } - return -1; -}; - -/** - * Array#reduce (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @param {Object} initial value - * @api private - */ - -exports.reduce = function(arr, fn, val){ - var rval = val; - - for (var i = 0, l = arr.length; i < l; i++) { - rval = fn(rval, arr[i], i, arr); - } - - return rval; -}; - -/** - * Array#filter (<=IE8) - * - * @param {Array} array - * @param {Function} fn - * @api private - */ - -exports.filter = function(arr, fn){ - var ret = []; - - for (var i = 0, l = arr.length; i < l; i++) { - var val = arr[i]; - if (fn(val, i, arr)) ret.push(val); - } - - return ret; -}; - -/** - * Object.keys (<=IE8) - * - * @param {Object} obj - * @return {Array} keys - * @api private - */ - -exports.keys = Object.keys || function(obj) { - var keys = [] - , has = Object.prototype.hasOwnProperty // for `window` on <=IE8 - - for (var key in obj) { - if (has.call(obj, key)) { - keys.push(key); - } - } - - return keys; -}; - -/** - * Watch the given `files` for changes - * and invoke `fn(file)` on modification. - * - * @param {Array} files - * @param {Function} fn - * @api private - */ - -exports.watch = function(files, fn){ - var options = { interval: 100 }; - files.forEach(function(file){ - debug('file %s', file); - fs.watchFile(file, options, function(curr, prev){ - if (prev.mtime < curr.mtime) fn(file); - }); - }); -}; - -/** - * Ignored files. - */ - -function ignored(path){ - return !~ignore.indexOf(path); -} - -/** - * Lookup files in the given `dir`. - * - * @return {Array} - * @api private - */ - -exports.files = function(dir, ret){ - ret = ret || []; - - fs.readdirSync(dir) - .filter(ignored) - .forEach(function(path){ - path = join(dir, path); - if (fs.statSync(path).isDirectory()) { - exports.files(path, ret); - } else if (path.match(/\.(js|coffee|litcoffee|coffee.md)$/)) { - ret.push(path); - } - }); - - return ret; -}; - -/** - * Compute a slug from the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.slug = function(str){ - return str - .toLowerCase() - .replace(/ +/g, '-') - .replace(/[^-\w]/g, ''); -}; - -/** - * Strip the function definition from `str`, - * and re-indent for pre whitespace. - */ - -exports.clean = function(str) { - str = str - .replace(/^function *\(.*\) *{/, '') - .replace(/\s+\}$/, ''); - - var whitespace = str.match(/^\n?(\s*)/)[1] - , re = new RegExp('^' + whitespace, 'gm'); - - str = str.replace(re, ''); - - return exports.trim(str); -}; - -/** - * Escape regular expression characters in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.escapeRegexp = function(str){ - return str.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"); -}; - -/** - * Trim the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.trim = function(str){ - return str.replace(/^\s+|\s+$/g, ''); -}; - -/** - * Parse the given `qs`. - * - * @param {String} qs - * @return {Object} - * @api private - */ - -exports.parseQuery = function(qs){ - return exports.reduce(qs.replace('?', '').split('&'), function(obj, pair){ - var i = pair.indexOf('=') - , key = pair.slice(0, i) - , val = pair.slice(++i); - - obj[key] = decodeURIComponent(val); - return obj; - }, {}); -}; - -/** - * Highlight the given string of `js`. - * - * @param {String} js - * @return {String} - * @api private - */ - -function highlight(js) { - return js - .replace(//g, '>') - .replace(/\/\/(.*)/gm, '//$1') - .replace(/('.*?')/gm, '$1') - .replace(/(\d+\.\d+)/gm, '$1') - .replace(/(\d+)/gm, '$1') - .replace(/\bnew *(\w+)/gm, 'new $1') - .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '$1') -} - -/** - * Highlight the contents of tag `name`. - * - * @param {String} name - * @api private - */ - -exports.highlightTags = function(name) { - var code = document.getElementsByTagName(name); - for (var i = 0, len = code.length; i < len; ++i) { - code[i].innerHTML = highlight(code[i].innerHTML); - } -}; - -}); // module: utils.js -// The global object is "self" in Web Workers. -global = (function() { return this; })(); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date; -var setTimeout = global.setTimeout; -var setInterval = global.setInterval; -var clearTimeout = global.clearTimeout; -var clearInterval = global.clearInterval; - -/** - * Node shims. - * - * These are meant only to allow - * mocha.js to run untouched, not - * to allow running node code in - * the browser. - */ - -var process = {}; -process.exit = function(status){}; -process.stdout = {}; - -/** - * Remove uncaughtException listener. - */ - -process.removeListener = function(e){ - if ('uncaughtException' == e) { - global.onerror = function() {}; - } -}; - -/** - * Implements uncaughtException listener. - */ - -process.on = function(e, fn){ - if ('uncaughtException' == e) { - global.onerror = function(err, url, line){ - fn(new Error(err + ' (' + url + ':' + line + ')')); - }; - } -}; - -/** - * Expose mocha. - */ - -var Mocha = global.Mocha = require('mocha'), - mocha = global.mocha = new Mocha({ reporter: 'html' }); - -var immediateQueue = [] - , immediateTimeout; - -function timeslice() { - var immediateStart = new Date().getTime(); - while (immediateQueue.length && (new Date().getTime() - immediateStart) < 100) { - immediateQueue.shift()(); - } - if (immediateQueue.length) { - immediateTimeout = setTimeout(timeslice, 0); - } else { - immediateTimeout = null; - } -} - -/** - * High-performance override of Runner.immediately. - */ - -Mocha.Runner.immediately = function(callback) { - immediateQueue.push(callback); - if (!immediateTimeout) { - immediateTimeout = setTimeout(timeslice, 0); - } -}; - -/** - * Override ui to ensure that the ui functions are initialized. - * Normally this would happen in Mocha.prototype.loadFiles. - */ - -mocha.ui = function(ui){ - Mocha.prototype.ui.call(this, ui); - this.suite.emit('pre-require', global, null, this); - return this; -}; - -/** - * Setup mocha with the given setting options. - */ - -mocha.setup = function(opts){ - if ('string' == typeof opts) opts = { ui: opts }; - for (var opt in opts) this[opt](opts[opt]); - return this; -}; - -/** - * Run mocha, returning the Runner. - */ - -mocha.run = function(fn){ - var options = mocha.options; - mocha.globals('location'); - - var query = Mocha.utils.parseQuery(global.location.search || ''); - if (query.grep) mocha.grep(query.grep); - if (query.invert) mocha.invert(); - - return Mocha.prototype.run.call(mocha, function(){ - // The DOM Document is not available in Web Workers. - if (global.document) { - Mocha.utils.highlightTags('code'); - } - if (fn) fn(); - }); -}; - -/** - * Expose the process shim. - */ - -Mocha.process = process; -})(); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/.bin/jade b/node_modules/grunt-mocha/node_modules/mocha/node_modules/.bin/jade deleted file mode 120000 index 571fae7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/.bin/jade +++ /dev/null @@ -1 +0,0 @@ -../jade/bin/jade \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/.npmignore b/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/.travis.yml b/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/History.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/History.md deleted file mode 100644 index 4961d2e..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/History.md +++ /dev/null @@ -1,107 +0,0 @@ - -0.6.1 / 2012-06-01 -================== - - * Added: append (yes or no) on confirmation - * Added: allow node.js v0.7.x - -0.6.0 / 2012-04-10 -================== - - * Added `.prompt(obj, callback)` support. Closes #49 - * Added default support to .choose(). Closes #41 - * Fixed the choice example - -0.5.1 / 2011-12-20 -================== - - * Fixed `password()` for recent nodes. Closes #36 - -0.5.0 / 2011-12-04 -================== - - * Added sub-command option support [itay] - -0.4.3 / 2011-12-04 -================== - - * Fixed custom help ordering. Closes #32 - -0.4.2 / 2011-11-24 -================== - - * Added travis support - * Fixed: line-buffered input automatically trimmed. Closes #31 - -0.4.1 / 2011-11-18 -================== - - * Removed listening for "close" on --help - -0.4.0 / 2011-11-15 -================== - - * Added support for `--`. Closes #24 - -0.3.3 / 2011-11-14 -================== - - * Fixed: wait for close event when writing help info [Jerry Hamlet] - -0.3.2 / 2011-11-01 -================== - - * Fixed long flag definitions with values [felixge] - -0.3.1 / 2011-10-31 -================== - - * Changed `--version` short flag to `-V` from `-v` - * Changed `.version()` so it's configurable [felixge] - -0.3.0 / 2011-10-31 -================== - - * Added support for long flags only. Closes #18 - -0.2.1 / 2011-10-24 -================== - - * "node": ">= 0.4.x < 0.7.0". Closes #20 - -0.2.0 / 2011-09-26 -================== - - * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] - -0.1.0 / 2011-08-24 -================== - - * Added support for custom `--help` output - -0.0.5 / 2011-08-18 -================== - - * Changed: when the user enters nothing prompt for password again - * Fixed issue with passwords beginning with numbers [NuckChorris] - -0.0.4 / 2011-08-15 -================== - - * Fixed `Commander#args` - -0.0.3 / 2011-08-15 -================== - - * Added default option value support - -0.0.2 / 2011-08-15 -================== - - * Added mask support to `Command#password(str[, mask], fn)` - * Added `Command#password(str, fn)` - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/Makefile b/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/Makefile deleted file mode 100644 index 0074625..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -TESTS = $(shell find test/test.*.js) - -test: - @./test/run $(TESTS) - -.PHONY: test \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/Readme.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/Readme.md deleted file mode 100644 index b8328c3..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/Readme.md +++ /dev/null @@ -1,262 +0,0 @@ -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineappe'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -V, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineappe - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -V, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .prompt(msg, fn) - - Single-line prompt: - -```js -program.prompt('name: ', function(name){ - console.log('hi %s', name); -}); -``` - - Multi-line prompt: - -```js -program.prompt('description:', function(name){ - console.log('hi %s', name); -}); -``` - - Coercion: - -```js -program.prompt('Age: ', Number, function(age){ - console.log('age: %j', age); -}); -``` - -```js -program.prompt('Birthdate: ', Date, function(date){ - console.log('date: %s', date); -}); -``` - -## .password(msg[, mask], fn) - -Prompt for password without echoing: - -```js -program.password('Password: ', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -Prompt for password with mask char "*": - -```js -program.password('Password: ', '*', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -## .confirm(msg, fn) - - Confirm with the given `msg`: - -```js -program.confirm('continue? ', function(ok){ - console.log(' got %j', ok); -}); -``` - -## .choose(list, fn) - - Let the user choose from a `list`: - -```js -var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - -console.log('Choose the coolest pet:'); -program.choose(list, function(i){ - console.log('you chose %d "%s"', i, list[i]); -}); -``` - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/index.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/index.js deleted file mode 100644 index 06ec1e4..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/commander'); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/lib/commander.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/lib/commander.js deleted file mode 100644 index 5ba87eb..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/lib/commander.js +++ /dev/null @@ -1,1026 +0,0 @@ - -/*! - * commander - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , path = require('path') - , tty = require('tty') - , basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this.args = []; - this.name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - return cmd; -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self.args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self.args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this.name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - self.args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self.args.length) { - args[self.args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // store raw args - this.rawArgs = argv; - - // guess name - if (!this.name) this.name = basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - this.args = parsed.args; - return this.parseArgs(this.args, parsed.unknown); -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - if ('-' == arg[0]) return this.optionMissingArgument(option, arg); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || '-' == arg[0]) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this.args.length ? ' ' + args : ''); - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return cmd.name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args - + (cmd.description() - ? '\n' + cmd.description() - : ''); - }).join('\n\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this.name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Prompt for a `Number`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForNumber = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseNumber(val){ - val = Number(val); - if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber); - fn(val); - }); -}; - -/** - * Prompt for a `Date`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForDate = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseDate(val){ - val = new Date(val); - if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate); - fn(val); - }); -}; - -/** - * Single-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptSingleLine = function(str, fn){ - if ('function' == typeof arguments[2]) { - return this['promptFor' + (fn.name || fn)](str, arguments[2]); - } - - process.stdout.write(str); - process.stdin.setEncoding('utf8'); - process.stdin.once('data', function(val){ - fn(val.trim()); - }).resume(); -}; - -/** - * Multi-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptMultiLine = function(str, fn){ - var buf = []; - console.log(str); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(val){ - if ('\n' == val || '\r\n' == val) { - process.stdin.removeAllListeners('data'); - fn(buf.join('\n')); - } else { - buf.push(val.trimRight()); - } - }).resume(); -}; - -/** - * Prompt `str` and callback `fn(val)` - * - * Commander supports single-line and multi-line prompts. - * To issue a single-line prompt simply add white-space - * to the end of `str`, something like "name: ", whereas - * for a multi-line prompt omit this "description:". - * - * - * Examples: - * - * program.prompt('Username: ', function(name){ - * console.log('hi %s', name); - * }); - * - * program.prompt('Description:', function(desc){ - * console.log('description was "%s"', desc.trim()); - * }); - * - * @param {String|Object} str - * @param {Function} fn - * @api public - */ - -Command.prototype.prompt = function(str, fn){ - var self = this; - - if ('string' == typeof str) { - if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments); - this.promptMultiLine(str, fn); - } else { - var keys = Object.keys(str) - , obj = {}; - - function next() { - var key = keys.shift() - , label = str[key]; - - if (!key) return fn(obj); - self.prompt(label, function(val){ - obj[key] = val; - next(); - }); - } - - next(); - } -}; - -/** - * Prompt for password with `str`, `mask` char and callback `fn(val)`. - * - * The mask string defaults to '', aka no output is - * written while typing, you may want to use "*" etc. - * - * Examples: - * - * program.password('Password: ', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * program.password('Password: ', '*', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {String} mask - * @param {Function} fn - * @api public - */ - -Command.prototype.password = function(str, mask, fn){ - var self = this - , buf = ''; - - // default mask - if ('function' == typeof mask) { - fn = mask; - mask = ''; - } - - process.stdin.resume(); - tty.setRawMode(true); - process.stdout.write(str); - - // keypress - process.stdin.on('keypress', function(c, key){ - if (key && 'enter' == key.name) { - console.log(); - process.stdin.removeAllListeners('keypress'); - tty.setRawMode(false); - if (!buf.trim().length) return self.password(str, mask, fn); - fn(buf); - return; - } - - if (key && key.ctrl && 'c' == key.name) { - console.log('%s', buf); - process.exit(); - } - - process.stdout.write(mask); - buf += c; - }).resume(); -}; - -/** - * Confirmation prompt with `str` and callback `fn(bool)` - * - * Examples: - * - * program.confirm('continue? ', function(ok){ - * console.log(' got %j', ok); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - - -Command.prototype.confirm = function(str, fn, verbose){ - var self = this; - this.prompt(str, function(ok){ - if (!ok.trim()) { - if (!verbose) str += '(yes or no) '; - return self.confirm(str, fn, true); - } - fn(parseBool(ok)); - }); -}; - -/** - * Choice prompt with `list` of items and callback `fn(index, item)` - * - * Examples: - * - * var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - * - * console.log('Choose the coolest pet:'); - * program.choose(list, function(i){ - * console.log('you chose %d "%s"', i, list[i]); - * process.stdin.destroy(); - * }); - * - * @param {Array} list - * @param {Number|Function} index or fn - * @param {Function} fn - * @api public - */ - -Command.prototype.choose = function(list, index, fn){ - var self = this - , hasDefault = 'number' == typeof index; - - if (!hasDefault) { - fn = index; - index = null; - } - - list.forEach(function(item, i){ - if (hasDefault && i == index) { - console.log('* %d) %s', i + 1, item); - } else { - console.log(' %d) %s', i + 1, item); - } - }); - - function again() { - self.prompt(' : ', function(val){ - val = parseInt(val, 10) - 1; - if (hasDefault && isNaN(val)) val = index; - - if (null == list[val]) { - again(); - } else { - fn(val, list[val]); - } - }); - } - - again(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Parse a boolean `str`. - * - * @param {String} str - * @return {Boolean} - * @api private - */ - -function parseBool(str) { - return /^y|yes|ok|true$/i.test(str); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - process.stdout.write(cmd.helpInformation()); - cmd.emit('--help'); - process.exit(0); - } - } -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/package.json deleted file mode 100644 index 6f9d567..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/commander/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "commander", - "version": "0.6.1", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt", - "stdin" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/commander.js.git" - }, - "dependencies": {}, - "devDependencies": { - "should": ">= 0.0.1" - }, - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.4.x" - }, - "readme": "# Commander.js\n\n The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).\n\n [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js)\n\n## Installation\n\n $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n .version('0.0.1')\n .option('-p, --peppers', 'Add peppers')\n .option('-P, --pineapple', 'Add pineapple')\n .option('-b, --bbq', 'Add bbq sauce')\n .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log(' - peppers');\nif (program.pineapple) console.log(' - pineappe');\nif (program.bbq) console.log(' - bbq');\nconsole.log(' - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n``` \n $ ./examples/pizza --help\n\n Usage: pizza [options]\n\n Options:\n\n -V, --version output the version number\n -p, --peppers Add peppers\n -P, --pineapple Add pineappe\n -b, --bbq Add bbq sauce\n -c, --cheese Add the specified type of cheese [marble]\n -h, --help output usage information\n\n```\n\n## Coercion\n\n```js\nfunction range(val) {\n return val.split('..').map(Number);\n}\n\nfunction list(val) {\n return val.split(',');\n}\n\nprogram\n .version('0.0.1')\n .usage('[options] ')\n .option('-i, --integer ', 'An integer argument', parseInt)\n .option('-f, --float ', 'A float argument', parseFloat)\n .option('-r, --range ..', 'A range', range)\n .option('-l, --list ', 'A list', list)\n .option('-o, --optional [value]', 'An optional value')\n .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' args: %j', program.args);\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('../');\n\nfunction list(val) {\n return val.split(',').map(Number);\n}\n\nprogram\n .version('0.0.1')\n .option('-f, --foo', 'enable some foo')\n .option('-b, --bar', 'enable some bar')\n .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n console.log(' Examples:');\n console.log('');\n console.log(' $ custom-help --help');\n console.log(' $ custom-help -h');\n console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nyielding the following help output:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n -h, --help output usage information\n -V, --version output the version number\n -f, --foo enable some foo\n -b, --bar enable some bar\n -B, --baz enable some baz\n\nExamples:\n\n $ custom-help --help\n $ custom-help -h\n\n```\n\n## .prompt(msg, fn)\n\n Single-line prompt:\n\n```js\nprogram.prompt('name: ', function(name){\n console.log('hi %s', name);\n});\n```\n\n Multi-line prompt:\n\n```js\nprogram.prompt('description:', function(name){\n console.log('hi %s', name);\n});\n```\n\n Coercion:\n\n```js\nprogram.prompt('Age: ', Number, function(age){\n console.log('age: %j', age);\n});\n```\n\n```js\nprogram.prompt('Birthdate: ', Date, function(date){\n console.log('date: %s', date);\n});\n```\n\n## .password(msg[, mask], fn)\n\nPrompt for password without echoing:\n\n```js\nprogram.password('Password: ', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\nPrompt for password with mask char \"*\":\n\n```js\nprogram.password('Password: ', '*', function(pass){\n console.log('got \"%s\"', pass);\n process.stdin.destroy();\n});\n```\n\n## .confirm(msg, fn)\n\n Confirm with the given `msg`:\n\n```js\nprogram.confirm('continue? ', function(ok){\n console.log(' got %j', ok);\n});\n```\n\n## .choose(list, fn)\n\n Let the user choose from a `list`:\n\n```js\nvar list = ['tobi', 'loki', 'jane', 'manny', 'luna'];\n\nconsole.log('Choose the coolest pet:');\nprogram.choose(list, function(i){\n console.log('you chose %d \"%s\"', i, list[i]);\n});\n```\n\n## Links\n\n - [API documentation](http://visionmedia.github.com/commander.js/)\n - [ascii tables](https://github.com/LearnBoost/cli-table)\n - [progress bars](https://github.com/visionmedia/node-progress)\n - [more progress bars](https://github.com/substack/node-multimeter)\n - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 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/commander.js/issues" - }, - "_id": "commander@0.6.1", - "_from": "commander@0.6.1" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/.npmignore b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/History.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/History.md deleted file mode 100644 index f023269..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/History.md +++ /dev/null @@ -1,62 +0,0 @@ - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/Readme.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/Readme.md deleted file mode 100644 index 15ee501..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/Readme.md +++ /dev/null @@ -1,115 +0,0 @@ - -# debug - - tiny node.js debugging utility modelled after node core's debugging technique. - -## Installation - -``` -$ npm install debug -``` - -## Usage - - With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - a('doing some work'); -}, 1200); -``` - -## License - -(The MIT License) - -Copyright (c) 2011 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/component.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/component.json deleted file mode 100644 index 4ad0971..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/component.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "0.7.2", - "keywords": ["debug", "log", "debugger"], - "scripts": ["index.js", "debug.js"], - "dependencies": {} -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/debug.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/debug.js deleted file mode 100644 index e47ba5b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/debug.js +++ /dev/null @@ -1,124 +0,0 @@ - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - if (!debug.enabled(name)) return function(){}; - - return function(fmt){ - var curr = new Date; - var ms = curr - (debug[name] || curr); - debug[name] = curr; - - fmt = name - + ' ' - + fmt - + ' +' + debug.humanize(ms); - - // This hackery is required for IE8 - // where `console.log` doesn't have 'apply' - window.console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); - } -} - -/** - * The currently active debug mode names. - */ - -debug.names = []; -debug.skips = []; - -/** - * Enables a debug mode by name. This can include modes - * separated by a colon and wildcards. - * - * @param {String} name - * @api public - */ - -debug.enable = function(name) { - try { - localStorage.debug = name; - } catch(e){} - - var split = (name || '').split(/[\s,]+/) - , len = split.length; - - for (var i = 0; i < len; i++) { - name = split[i].replace('*', '.*?'); - if (name[0] === '-') { - debug.skips.push(new RegExp('^' + name.substr(1) + '$')); - } - else { - debug.names.push(new RegExp('^' + name + '$')); - } - } -}; - -/** - * Disable debug output. - * - * @api public - */ - -debug.disable = function(){ - debug.enable(''); -}; - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -debug.humanize = function(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -}; - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -debug.enabled = function(name) { - for (var i = 0, len = debug.skips.length; i < len; i++) { - if (debug.skips[i].test(name)) { - return false; - } - } - for (var i = 0, len = debug.names.length; i < len; i++) { - if (debug.names[i].test(name)) { - return true; - } - } - return false; -}; - -// persist - -if (window.localStorage) debug.enable(localStorage.debug); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/app.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/app.js deleted file mode 100644 index 05374d9..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/app.js +++ /dev/null @@ -1,19 +0,0 @@ - -var debug = require('../')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/browser.html b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/browser.html deleted file mode 100644 index 7510eee..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/browser.html +++ /dev/null @@ -1,24 +0,0 @@ - - - debug() - - - - - - - diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/wildcards.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/wildcards.js deleted file mode 100644 index 1fdac20..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/wildcards.js +++ /dev/null @@ -1,10 +0,0 @@ - -var debug = { - foo: require('../')('test:foo'), - bar: require('../')('test:bar'), - baz: require('../')('test:baz') -}; - -debug.foo('foo') -debug.bar('bar') -debug.baz('baz') \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/worker.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/worker.js deleted file mode 100644 index 7f6d288..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/example/worker.js +++ /dev/null @@ -1,22 +0,0 @@ - -// DEBUG=* node example/worker -// DEBUG=worker:* node example/worker -// DEBUG=worker:a node example/worker -// DEBUG=worker:b node example/worker - -var a = require('../')('worker:a') - , b = require('../')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/index.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/index.js deleted file mode 100644 index e02c13b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/index.js +++ /dev/null @@ -1,5 +0,0 @@ -if ('undefined' == typeof window) { - module.exports = require('./lib/debug'); -} else { - module.exports = require('./debug'); -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/lib/debug.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/lib/debug.js deleted file mode 100644 index 0b07aa1..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/lib/debug.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Module dependencies. - */ - -var tty = require('tty'); - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Enabled debuggers. - */ - -var names = [] - , skips = []; - -(process.env.DEBUG || '') - .split(/[\s,]+/) - .forEach(function(name){ - name = name.replace('*', '.*?'); - if (name[0] === '-') { - skips.push(new RegExp('^' + name.substr(1) + '$')); - } else { - names.push(new RegExp('^' + name + '$')); - } - }); - -/** - * Colors. - */ - -var colors = [6, 2, 3, 4, 5, 1]; - -/** - * Previous debug() call. - */ - -var prev = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Is stdout a TTY? Colored output is disabled when `true`. - */ - -var isatty = tty.isatty(2); - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function color() { - return colors[prevColor++ % colors.length]; -} - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -function humanize(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -} - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - function disabled(){} - disabled.enabled = false; - - var match = skips.some(function(re){ - return re.test(name); - }); - - if (match) return disabled; - - match = names.some(function(re){ - return re.test(name); - }); - - if (!match) return disabled; - var c = color(); - - function colored(fmt) { - var curr = new Date; - var ms = curr - (prev[name] || curr); - prev[name] = curr; - - fmt = ' \u001b[9' + c + 'm' + name + ' ' - + '\u001b[3' + c + 'm\u001b[90m' - + fmt + '\u001b[3' + c + 'm' - + ' +' + humanize(ms) + '\u001b[0m'; - - console.error.apply(this, arguments); - } - - function plain(fmt) { - fmt = new Date().toUTCString() - + ' ' + name + ' ' + fmt; - console.error.apply(this, arguments); - } - - colored.enabled = plain.enabled = true; - - return isatty || process.env.DEBUG_COLORS - ? colored - : plain; -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/package.json deleted file mode 100644 index 82a663f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/debug/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "debug", - "version": "0.7.2", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*" - }, - "main": "lib/debug.js", - "browserify": "debug.js", - "engines": { - "node": "*" - }, - "component": { - "scripts": { - "debug/index.js": "index.js", - "debug/debug.js": "debug.js" - } - }, - "readme": "\n# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n \nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n \n ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\". \n\n## Wildcards\n\n The \"*\" character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. \n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n a('doing some work');\n}, 1200);\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 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/debug/issues" - }, - "_id": "debug@0.7.2", - "_from": "debug@*", - "scripts": {} -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/LICENSE deleted file mode 100644 index c135dcf..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Software License Agreement (BSD License) - -Copyright (c) 2009-2011, Kevin Decker - -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of Kevin Decker nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/README.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/README.md deleted file mode 100644 index 2ed7ee1..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# jsdiff - -A javascript text differencing implementation. - -Based on the algorithm proposed in -["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927). - -## Installation - - npm install diff - -or - - git clone git://github.com/kpdecker/jsdiff.git - -## API - -* JsDiff.diffChars(oldStr, newStr) - Diffs two blocks of text, comparing character by character. - - Returns a list of change objects (See below). - -* JsDiff.diffWords(oldStr, newStr) - Diffs two blocks of text, comparing word by word. - - Returns a list of change objects (See below). - -* JsDiff.diffLines(oldStr, newStr) - Diffs two blocks of text, comparing line by line. - - Returns a list of change objects (See below). - -* JsDiff.diffCss(oldStr, newStr) - Diffs two blocks of text, comparing CSS tokens. - - Returns a list of change objects (See below). - -* JsDiff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader) - Creates a unified diff patch. - - Parameters: - * fileName : String to be output in the filename sections of the patch - * oldStr : Original string value - * newStr : New string value - * oldHeader : Additional information to include in the old file header - * newHeader : Additional information to include in thew new file header - -* convertChangesToXML(changes) - Converts a list of changes to a serialized XML format - -### Change Objects -Many of the methods above return change objects. These objects are consist of the following fields: - -* value: Text content -* added: True if the value was inserted into the new string -* removed: True of the value was removed from the old string - -Note that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner. - -## [Example](http://kpdecker.github.com/jsdiff) - -## License - -Software License Agreement (BSD License) - -Copyright (c) 2009-2011, Kevin Decker kpdecker@gmail.com - -All rights reserved. - -Redistribution and use of this software in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of Kevin Decker nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/diff.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/diff.js deleted file mode 100644 index 6b7ce24..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/diff.js +++ /dev/null @@ -1,287 +0,0 @@ -/* See license.txt for terms of usage */ - -/* - * Text diff implementation. - * - * This library supports the following APIS: - * JsDiff.diffChars: Character by character diff - * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace - * JsDiff.diffLines: Line based diff - * - * JsDiff.diffCss: Diff targeted at CSS content - * - * These methods are based on the implementation proposed in - * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). - * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 - */ -var JsDiff = (function() { - function clonePath(path) { - return { newPos: path.newPos, components: path.components.slice(0) }; - } - function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - } - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, "&"); - n = n.replace(//g, ">"); - n = n.replace(/"/g, """); - - return n; - } - - - var fbDiff = function(ignoreWhitespace) { - this.ignoreWhitespace = ignoreWhitespace; - }; - fbDiff.prototype = { - diff: function(oldString, newString) { - // Handle the identity case (this is due to unrolling editLength == 0 - if (newString == oldString) { - return [{ value: newString }]; - } - if (!newString) { - return [{ value: oldString, removed: true }]; - } - if (!oldString) { - return [{ value: newString, added: true }]; - } - - newString = this.tokenize(newString); - oldString = this.tokenize(oldString); - - var newLen = newString.length, oldLen = oldString.length; - var maxEditLength = newLen + oldLen; - var bestPath = [{ newPos: -1, components: [] }]; - - // Seed editLength = 0 - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) { - return bestPath[0].components; - } - - for (var editLength = 1; editLength <= maxEditLength; editLength++) { - for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) { - var basePath; - var addPath = bestPath[diagonalPath-1], - removePath = bestPath[diagonalPath+1]; - oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath-1] = undefined; - } - - var canAdd = addPath && addPath.newPos+1 < newLen; - var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = undefined; - continue; - } - - // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph - if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { - basePath = clonePath(removePath); - this.pushComponent(basePath.components, oldString[oldPos], undefined, true); - } else { - basePath = clonePath(addPath); - basePath.newPos++; - this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined); - } - - var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath); - - if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) { - return basePath.components; - } else { - bestPath[diagonalPath] = basePath; - } - } - } - }, - - pushComponent: function(components, value, added, removed) { - var last = components[components.length-1]; - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length-1] = - {value: this.join(last.value, value), added: added, removed: removed }; - } else { - components.push({value: value, added: added, removed: removed }); - } - }, - extractCommon: function(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath; - while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) { - newPos++; - oldPos++; - - this.pushComponent(basePath.components, newString[newPos], undefined, undefined); - } - basePath.newPos = newPos; - return oldPos; - }, - - equals: function(left, right) { - var reWhitespace = /\S/; - if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) { - return true; - } else { - return left == right; - } - }, - join: function(left, right) { - return left + right; - }, - tokenize: function(value) { - return value; - } - }; - - var CharDiff = new fbDiff(); - - var WordDiff = new fbDiff(true); - WordDiff.tokenize = function(value) { - return removeEmpty(value.split(/(\s+|\b)/)); - }; - - var CssDiff = new fbDiff(true); - CssDiff.tokenize = function(value) { - return removeEmpty(value.split(/([{}:;,]|\s+)/)); - }; - - var LineDiff = new fbDiff(); - LineDiff.tokenize = function(value) { - return value.split(/^/m); - }; - - return { - diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); }, - diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); }, - diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); }, - - diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); }, - - createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) { - var ret = []; - - ret.push("Index: " + fileName); - ret.push("==================================================================="); - ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader)); - ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader)); - - var diff = LineDiff.diff(oldStr, newStr); - if (!diff[diff.length-1].value) { - diff.pop(); // Remove trailing newline add - } - diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function(entry) { return ' ' + entry; }); - } - function eofNL(curRange, i, current) { - var last = diff[diff.length-2], - isLast = i === diff.length-2, - isLastOfType = i === diff.length-3 && (current.added === !last.added || current.removed === !last.removed); - - // Figure out if this is the last line for the given file and missing NL - if (!/\n$/.test(current.value) && (isLast || isLastOfType)) { - curRange.push('\\ No newline at end of file'); - } - } - - var oldRangeStart = 0, newRangeStart = 0, curRange = [], - oldLine = 1, newLine = 1; - for (var i = 0; i < diff.length; i++) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - - if (current.added || current.removed) { - if (!oldRangeStart) { - var prev = diff[i-1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - - if (prev) { - curRange = contextLines(prev.lines.slice(-4)); - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?"+":"-") + entry; })); - eofNL(curRange, i, current); - - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= 8 && i < diff.length-2) { - // Overlapping - curRange.push.apply(curRange, contextLines(lines)); - } else { - // end the range and output - var contextSize = Math.min(lines.length, 4); - ret.push( - "@@ -" + oldRangeStart + "," + (oldLine-oldRangeStart+contextSize) - + " +" + newRangeStart + "," + (newLine-newRangeStart+contextSize) - + " @@"); - ret.push.apply(ret, curRange); - ret.push.apply(ret, contextLines(lines.slice(0, contextSize))); - if (lines.length <= 4) { - eofNL(ret, i, current); - } - - oldRangeStart = 0; newRangeStart = 0; curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - } - - return ret.join('\n') + '\n'; - }, - - convertChangesToXML: function(changes){ - var ret = []; - for ( var i = 0; i < changes.length; i++) { - var change = changes[i]; - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - - ret.push(escapeHTML(change.value)); - - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - } - return ret.join(""); - } - }; -})(); - -if (typeof module !== "undefined") { - module.exports = JsDiff; -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/index.html b/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/index.html deleted file mode 100644 index ecb22fa..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Diff - - - - -
                  -

                  Diff

                  - - - -
                  - -
                  github.com/kpdecker/jsdiff - - - - - - - -
                  restaurantaura
                  - - - - - diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/package.json deleted file mode 100644 index dd9fc33..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "diff", - "version": "1.0.2", - "description": "A javascript text diff implementation.", - "keywords": [ - "diff", - "javascript" - ], - "maintainers": [ - { - "name": "Kevin Decker", - "email": "kpdecker@gmail.com", - "url": "http://incaseofstairs.com" - } - ], - "bugs": { - "url": "http://github.com/kpdecker/jsdiff/issues", - "email": "kpdecker@gmail.com" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/kpdecker/jsdiff/blob/master/LICENSE" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/kpdecker/jsdiff.git" - }, - "engines": { - "node": ">=0.3.1" - }, - "main": "./diff", - "scripts": { - "test": "expresso test/*" - }, - "dependencies": {}, - "devDependencies": {}, - "readme": "# jsdiff\n\nA javascript text differencing implementation.\n\nBased on the algorithm proposed in\n[\"An O(ND) Difference Algorithm and its Variations\" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927).\n\n## Installation\n\n npm install diff\n\nor\n\n git clone git://github.com/kpdecker/jsdiff.git\n\n## API\n\n* JsDiff.diffChars(oldStr, newStr)\n Diffs two blocks of text, comparing character by character.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffWords(oldStr, newStr)\n Diffs two blocks of text, comparing word by word.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffLines(oldStr, newStr)\n Diffs two blocks of text, comparing line by line.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffCss(oldStr, newStr)\n Diffs two blocks of text, comparing CSS tokens.\n\n Returns a list of change objects (See below).\n\n* JsDiff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)\n Creates a unified diff patch.\n\n Parameters:\n * fileName : String to be output in the filename sections of the patch\n * oldStr : Original string value\n * newStr : New string value\n * oldHeader : Additional information to include in the old file header\n * newHeader : Additional information to include in thew new file header\n\n* convertChangesToXML(changes)\n Converts a list of changes to a serialized XML format\n\n### Change Objects\nMany of the methods above return change objects. These objects are consist of the following fields:\n\n* value: Text content\n* added: True if the value was inserted into the new string\n* removed: True of the value was removed from the old string\n\nNote that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner.\n\n## [Example](http://kpdecker.github.com/jsdiff)\n\n## License\n\nSoftware License Agreement (BSD License)\n\nCopyright (c) 2009-2011, Kevin Decker kpdecker@gmail.com\n\nAll rights reserved.\n\nRedistribution and use of this software in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above\n copyright notice, this list of conditions and the\n following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the\n following disclaimer in the documentation and/or other\n materials provided with the distribution.\n\n* Neither the name of Kevin Decker nor the names of its\n contributors may be used to endorse or promote products\n derived from this software without specific prior\n written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\nIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\nOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n", - "readmeFilename": "README.md", - "_id": "diff@1.0.2", - "dist": { - "shasum": "a83d26247f6b41ddfb6cda3f77332af2ae8e4fba" - }, - "_from": "diff@1.0.2", - "_resolved": "https://registry.npmjs.org/diff/-/diff-1.0.2.tgz" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/style.css b/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/style.css deleted file mode 100644 index 2047e2d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/style.css +++ /dev/null @@ -1,81 +0,0 @@ -* { - margin: 0; - padding: 0; -} -html, body { - background: #EEE; - font: 12px sans-serif; -} -body { - padding-top: 1.8em; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -html, body, table, tbody, tr, td { - height: 100% -} -table { - table-layout: fixed; - width: 100%; -} -td { - width: 33%; - padding: 3px 4px; - border: 1px solid transparent; - vertical-align: top; - font: 1em monospace; - text-align: left; - white-space: pre-wrap; -} -h1 { - display: inline; - font-size: 100%; -} -del { - text-decoration: none; - color: #b30000; - background: #fadad7; -} -ins { - background: #eaf2c2; - color: #406619; - text-decoration: none; -} - -#settings { - position: absolute; - top: 0; - left: 5px; - right: 5px; - height: 2em; - line-height: 2em; -} -#settings label { - margin-left: 1em; -} - -.source { - position: absolute; - right: 1%; - top: .2em; -} - -[contentEditable] { - background: #F9F9F9; - border-color: #BBB #D9D9D9 #DDD; - border-radius: 4px; - -webkit-user-modify: read-write-plaintext-only; - outline: none; -} -[contentEditable]:focus { - background: #FFF; - border-color: #6699cc; - box-shadow: 0 0 4px #2175c9; -} - -@-moz-document url-prefix() { - body { - height: 99%; /* Hide scroll bar in Firefox */ - } -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/test/diffTest.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/test/diffTest.js deleted file mode 100644 index 311b48b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/diff/test/diffTest.js +++ /dev/null @@ -1,616 +0,0 @@ -const VERBOSE = false; - -var assert = require('assert'), - diff = require('../diff'); - -function log() { - VERBOSE && console.log.apply(console, arguments); -} - -exports['Whitespace diff'] = function() { - diffResult = diff.diffWords("New Value", "New ValueMoreData"); - assert.equal( - "New ValueMoreDataValue", - diff.convertChangesToXML(diffResult), - "Single whitespace diffResult Value"); - - diffResult = diff.diffWords("New Value ", "New ValueMoreData "); - assert.equal( - "New ValueMoreDataValue ", - diff.convertChangesToXML(diffResult), - "Multiple whitespace diffResult Value"); -}; - -// Diff on word boundary -exports['Word Diff'] = function() { - diffResult = diff.diffWords("New :Value:Test", "New ValueMoreData "); - assert.equal( - "New ValueMoreData :Value:Test", - diff.convertChangesToXML(diffResult), - "Nonmatching word boundary diffResult Value"); - diffResult = diff.diffWords("New Value:Test", "New Value:MoreData "); - assert.equal( - "New Value:MoreData Test", - diff.convertChangesToXML(diffResult), - "Word boundary diffResult Value"); - diffResult = diff.diffWords("New Value-Test", "New Value:MoreData "); - assert.equal( - "New Value:MoreData -Test", - diff.convertChangesToXML(diffResult), - "Uninque boundary diffResult Value"); - diffResult = diff.diffWords("New Value", "New Value:MoreData "); - assert.equal( - "New Value:MoreData ", - diff.convertChangesToXML(diffResult), - "Word boundary diffResult Value"); -}; - -// Diff without changes -exports['Diff without changes'] = function() { - diffResult = diff.diffWords("New Value", "New Value"); - assert.equal( - "New Value", - diff.convertChangesToXML(diffResult), - "No changes diffResult Value"); - diffResult = diff.diffWords("New Value", "New Value"); - assert.equal( - "New Value", - diff.convertChangesToXML(diffResult), - "No changes whitespace diffResult Value"); - diffResult = diff.diffWords("", ""); - assert.equal( - "", - diff.convertChangesToXML(diffResult), - "Empty no changes diffResult Value"); -}; - -// Empty diffs -exports['Empty diffs'] = function() { - diffResult = diff.diffWords("New Value", ""); - assert.equal(1, diffResult.length, "Empty diff result length"); - assert.equal( - "New Value", - diff.convertChangesToXML(diffResult), - "Empty diffResult Value"); - diffResult = diff.diffWords("", "New Value"); - assert.equal( - "New Value", - diff.convertChangesToXML(diffResult), - "Empty diffResult Value"); -}; - -// With without anchor (the Heckel algorithm error case) -exports['No anchor'] = function() { - diffResult = diff.diffWords("New Value New Value", "Value Value New New"); - assert.eql( - "ValueNew Value New NewValue", - diff.convertChangesToXML(diffResult), - "No anchor diffResult Value"); -}; - -// CSS Diff -exports['CSS diffs'] = function() { - diffResult = diff.diffCss( - ".test,#value .test{margin-left:50px;margin-right:-40px}", - ".test2, #value2 .test {\nmargin-top:50px;\nmargin-right:-400px;\n}"); - assert.equal( - ".test2.test,#value #value2 .test {\n" - + "margin-topmargin-left:50px;\n" - + "margin-right:-400px;\n-40px}", - diff.convertChangesToXML(diffResult), - "CSS diffResult Value"); -}; - -// Line Diff -exports['Line diffs'] = function() { - diffResult = diff.diffLines( - "line\nold value\nline", - "line\nnew value\nline"); - assert.equal( - "line\nnew value\nold value\nline", - diff.convertChangesToXML(diffResult), - "Line diffResult Value"); - diffResult = diff.diffLines( - "line\nvalue\nline", - "line\nvalue\nline"); - assert.equal( - "line\nvalue\nline", - diff.convertChangesToXML(diffResult), - "Line same diffResult Value"); - diffResult = diff.diffLines( - "line\nvalue \nline", - "line\nvalue\nline"); - log("diffResult", diffResult); - log("diffResult", diff.convertChangesToXML(diffResult)); - assert.equal( - "line\nvalue\nvalue \nline", - diff.convertChangesToXML(diffResult), - "Line whitespace diffResult Value"); -}; - -// Patch creation with diff at EOF -exports['lastLineChanged'] = function() { - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,3 +1,4 @@\n' - + ' line2\n' - + ' line3\n' - + '+line4\n' - + ' line5\n', - diff.createPatch('test', 'line2\nline3\nline5\n', 'line2\nline3\nline4\nline5\n', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,3 +1,4 @@\n' - + ' line2\n' - + ' line3\n' - + ' line4\n' - + '+line5\n', - diff.createPatch('test', 'line2\nline3\nline4\n', 'line2\nline3\nline4\nline5\n', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,4 @@\n' - + ' line1\n' - + ' line2\n' - + ' line3\n' - + '+line44\n' - + '-line4\n', - diff.createPatch('test', 'line1\nline2\nline3\nline4\n', 'line1\nline2\nline3\nline44\n', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,5 @@\n' - + ' line1\n' - + ' line2\n' - + ' line3\n' - + '+line44\n' - + '+line5\n' - + '-line4\n', - diff.createPatch('test', 'line1\nline2\nline3\nline4\n', 'line1\nline2\nline3\nline44\nline5\n', 'header1', 'header2')); -}; - -exports['EOFNL'] = function() { - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,4 @@\n' - + ' line1\n' - + ' line2\n' - + ' line3\n' - + '+line4\n' - + '\\ No newline at end of file\n' - + '-line4\n', - diff.createPatch('test', 'line1\nline2\nline3\nline4\n', 'line1\nline2\nline3\nline4', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,4 @@\n' - + ' line1\n' - + ' line2\n' - + ' line3\n' - + '+line4\n' - + '-line4\n' - + '\\ No newline at end of file\n', - diff.createPatch('test', 'line1\nline2\nline3\nline4', 'line1\nline2\nline3\nline4\n', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,4 +1,4 @@\n' - + '+line1\n' - + '-line11\n' - + ' line2\n' - + ' line3\n' - + ' line4\n' - + '\\ No newline at end of file\n', - diff.createPatch('test', 'line11\nline2\nline3\nline4', 'line1\nline2\nline3\nline4', 'header1', 'header2')); - - assert.eql( - 'Index: test\n' - + '===================================================================\n' - + '--- test\theader1\n' - + '+++ test\theader2\n' - + '@@ -1,5 +1,5 @@\n' - + '+line1\n' - + '-line11\n' - + ' line2\n' - + ' line3\n' - + ' line4\n' - + ' line4\n', - diff.createPatch('test', 'line11\nline2\nline3\nline4\nline4\nline4\nline4', 'line1\nline2\nline3\nline4\nline4\nline4\nline4', 'header1', 'header2')); -}; - -exports['Large Test'] = function() { - var random = 42; - var mult = 134775813, range = Math.pow(2, 32); - function nextRandom() { - random = ((random * mult) + 1) % range; - return random; - } - var largeTest = ".hbh9asgiidc {ehaahc9:ses;bhg9hc:ses;idgaag-hi9aa:cdca;ihgd9gdgca-gdadg:ighchehgaci;ggghdg:edhciag;daagsada:ahhhiaa;ahai7:hgid;}.hbh9asgiidc.hchgihaa {ggghdg:hgid;}.igiidchbh9ah {ihgd9gdgca-hbh9a:gga(" - + "hbh9ah/igiidcfhbh9ah.9hs);ihgd9gdgca-gaeahi:cd-gaeahi;7ah97i:7des;bhg9hc-gh97i:ses;ahai7:7des;ihgd9gdgca-edhhihdc:ses ses;}.igiidcfgde9 {ihgd9gdgca-edhhihdc:ses ses;}.bdghadaag .igiidcfgde9 {ihgd9gdgc" - + "a-edhhihdc:-7des ses;}.hchgihaa .igiidcfgde9 {ihgd9gdgca-edhhihdc:-dses ses;}.igiidcfaaaaia {ihgd9gdgca-edhhihdc:-bdes ses;}.bdghadaag .igiidcfaaaaia {ihgd9gdgca-edhhihdc:-9sses ses;}.hchgihaa .igiidc" - + "faaaaia {ihgd9gdgca-edhhihdc:-97des ses;}.igiidcfadacadha {ihgd9gdgca-edhhihdc:-9dses ses;}.bdghadaag .igiidcfadacadha {ihgd9gdgca-edhhihdc:-9bdes ses;}.hchgihaa .igiidcfadacadha {ihgd9gdgca-edhhihdc:" - + "-7sses ses;}.igiidcfabhha {ihgd9gdgca-edhhihdc:-77des ses;}.bdghadaag .igiidcfabhha {ihgd9gdgca-edhhihdc:-7dses ses;}.hchgihaa .igiidcfabhha {ihgd9gdgca-edhhihdc:-7bdes ses;}.igiidcfbdaa {ihgd9gdgca-e" - + "dhhihdc:-d7des ses;}.bdghadaag .igiidcfbdaa {ihgd9gdgca-edhhihdc:-ddses ses;}.hchgihaa .igiidcfbdaa {ihgd9gdgca-edhhihdc:-dbdes ses;}.igiidcfcaasdaaag {ihgd9gdgca-edhhihdc:-abdes ses;}.bdghadaag .igii" - + "dcfcaasdaaag {ihgd9gdgca-edhhihdc:-bsses ses;}.hchgihaa .igiidcfcaasdaaag {ihgd9gdgca-edhhihdc:-b7des ses;}.igiidcfgachba {ihgd9gdgca-edhhihdc:-dbdes ses;}.bdghadaag .igiidcfgachba {ihgd9gdgca-edhhihd" - + "c:-9ssses ses;}.hchgihaa .igiidcfgachba {ihgd9gdgca-edhhihdc:-9s7des ses;}.igiidcfghh {ihgd9gdgca-edhhihdc:-9sdses ses;}.bdghadaag .igiidcfghh {ihgd9gdgca-edhhihdc:-9sbdes ses;}.hchgihaa .igiidcfghh {" - + "ihgd9gdgca-edhhihdc:-99sses ses;}.igiidcfh7hga {ihgd9gdgca-edhhihdc:-97bdes ses;}.bdghadaag .igiidcfh7hga {ihgd9gdgca-edhhihdc:-9hsses ses;}.hchgihaa .igiidcfh7hga {ihgd9gdgca-edhhihdc:-9h7des ses;}.i" - + "giidcfgeadha {ihgd9gdgca-edhhihdc:-9hdses ses;}.bdghadaag .igiidcfgeadha {ihgd9gdgca-edhhihdc:-9hbdes ses;}.hchgihaa .igiidcfgeadha {ihgd9gdgca-edhhihdc:-9gsses ses;}.igiidcfaaisdaaag {ihgd9gdgca-edhh" - + "ihdc:-9dsses ses;}.bdghadaag .igiidcfaaisdaaag {ihgd9gdgca-edhhihdc:-9d7des ses;}.hchgihaa .igiidcfaaisdaaag {ihgd9gdgca-edhhihdc:-9ddses ses;}.igiidcfabei9ighh7 {ihgd9gdgca-edhhihdc:-hsses ses;}.bdgh" - + "adaag .igiidcfabei9ighh7 {ihgd9gdgca-edhhihdc:-h7des ses;}.hchgihaa .igiidcfabei9ighh7 {ihgd9gdgca-edhhihdc:-hdses ses;}.igiidcfadgd {ihgd9gdgca-edhhihdc:-hbdes ses;}.bdghadaag .igiidcfadgd {ihgd9gdgc" - + "a-edhhihdc:-gsses ses;}.hchgihaa .igiidcfadgd {ihgd9gdgca-edhhihdc:-g7des ses;}.igiidcfbhch9a {ihgd9gdgca-edhhihdc:-gdses ses;}.bdghadaag .igiidcfbhch9a {ihgd9gdgca-edhhihdc:-gbdes ses;}.hchgihaa .igi" - + "idcfbhch9a {ihgd9gdgca-edhhihdc:-dsses ses;}.igiidcfcaaahdh {ihgd9gdgca-edhhihdc:-bdses ses;}.bdghadaag .igiidcfcaaahdh {ihgd9gdgca-edhhihdc:-bbdes ses;}.hchgihaa .igiidcfcaaahdh {ihgd9gdgca-edhhihdc:" - + "-csses ses;}.igiidcfhhaahahgg7gahgaih {ihgd9gdgca-edhhihdc:-97sses ses;}.bdghadaag .igiidcfhhaahahgg7gahgaih {ihgd9gdgca-edhhihdc:-977des ses;}.hchgihaa .igiidcfhhaahahgg7gahgaih {ihgd9gdgca-edhhihdc:" - + "-97dses ses;}.igiidcfhhaahahgg7 {ihgd9gdgca-edhhihdc:-997des ses;}.bdghadaag .igiidcfhhaahahgg7 {ihgd9gdgca-edhhihdc:-99dses ses;}.hchgihaa .igiidcfhhaahahgg7 {ihgd9gdgca-edhhihdc:-99bdes ses;}.igiidc" - + "fcaaidddbhgd {ihgd9gdgca-edhhihdc:-asses ses;}.bdghadaag .igiidcfcaaidddbhgd {ihgd9gdgca-edhhihdc:-a7des ses;}.hchgihaa .igiidcfcaaidddbhgd {ihgd9gdgca-edhhihdc:-adses ses;}.igiidcfdeac {ihgd9gdgca-ed" - + "hhihdc:-c7des ses;}.bdghadaag .igiidcfdeac {ihgd9gdgca-edhhihdc:-cdses ses;}.hchgihaa .igiidcfdeac {ihgd9gdgca-edhhihdc:-cbdes ses;}.igiidcfdaagaghia {ihgd9gdgca-edhhihdc:-9hdses ses;}.bdghadaag .igii" - + "dcfdaagaghia {ihgd9gdgca-edhhihdc:-9hbdes ses;}.hchgihaa .igiidcfdaagaghia {ihgd9gdgca-edhhihdc:-9gsses ses;}.igiidcfahaa {ihgd9gdgca-edhhihdc:-9g7des ses;}.bdghadaag .igiidcfahaa {ihgd9gdgca-edhhihdc" - + ":-9gdses ses;}.hchgihaa .igiidcfahaa {ihgd9gdgca-edhhihdc:-9gbdes ses;}.igiidcfih9 {ihgd9gdgca-edhhihdc:-9dbdes ses;}.bdghadaag .igiidcfih9 {ihgd9gdgca-edhhihdc:-9asses ses;}.hchgihaa .igiidcfih9 {ihg" - + "d9gdgca-edhhihdc:-9a7des ses;}.igiidcfhgihgghia {ihgd9gdgca-edhhihdc:-9b7des ses;}.bdghadaag .igiidcfhgihgghia {ihgd9gdgca-edhhihdc:-9bdses ses;}.hchgihaa .igiidcfhgihgghia {ihgd9gdgca-edhhihdc:-9bbde" - + "s ses;}.igiidcfhgeaggaaa {ihgd9gdgca-edhhihdc:-9csses ses;}.bdghadaag .igiidcfhgeaggaaa {ihgd9gdgca-edhhihdc:-9c7des ses;}.hchgihaa .igiidcfhgeaggaaa {ihgd9gdgca-edhhihdc:-9cdses ses;}.igiidcfggahiaha" - + "ghah {ihgd9gdgca-edhhihdc:-9csses ses;}.bdghadaag .igiidcfggahiahaghah {ihgd9gdgca-edhhihdc:-9c7des ses;}.hchgihaa .igiidcfggahiahaghah {ihgd9gdgca-edhhihdc:-9cdses ses;}.igiidcfggahiagagdgaghia9dg9 {" - + "ihgd9gdgca-edhhihdc:-9cbdes ses;}.bdghadaag .igiidcfggahiagagdgaghia9dg9 {ihgd9gdgca-edhhihdc:-9dsses ses;}.hchgihaa .igiidcfggahiagagdgaghia9dg9 {ihgd9gdgca-edhhihdc:-9d7des ses;}.igiidcfggahiagagdga" - + "sdaaag {ihgd9gdgca-edhhihdc:-9ddses ses;}.bdghadaag .igiidcfggahiagagdgasdaaag {ihgd9gdgca-edhhihdc:-9dbdes ses;}.hchgihaa .igiidcfggahiagagdgasdaaag {ihgd9gdgca-edhhihdc:-7ssses ses;}.igiidcfggahiaga" - + "gdga {ihgd9gdgca-edhhihdc:-7s7des ses;}.bdghadaag .igiidcfggahiagagdga {ihgd9gdgca-edhhihdc:-7sdses ses;}.hchgihaa .igiidcfggahiagagdga {ihgd9gdgca-edhhihdc:-7sbdes ses;}.igiidcfggahiae79hhghagagdga {" - + "ihgd9gdgca-edhhihdc:-79bdes ses;}.bdghadaag .igiidcfggahiae79hhghagagdga {ihgd9gdgca-edhhihdc:-77sses ses;}.hchgihaa .igiidcfggahiae79hhghagagdga {ihgd9gdgca-edhhihdc:-777des ses;}.igiidcfbhdagagdga {" - + "ihgd9gdgca-edhhihdc:-77dses ses;}.bdghadaag .igiidcfbhdagagdga {ihgd9gdgca-edhhihdc:-77bdes ses;}.hchgihaa .igiidcfbhdagagdga {ihgd9gdgca-edhhihdc:-7hsses ses;}.igiidcfggahiagagdgaaaghhdc {ihgd9gdgca-" - + "edhhihdc:-79sses ses;}.bdghadaag .igiidcfggahiagagdgaaaghhdc {ihgd9gdgca-edhhihdc:-797des ses;}.hchgihaa .igiidcfggahiagagdgaaaghhdc {ihgd9gdgca-edhhihdc:-79dses ses;}.igiidcfgaea9abhha {ihgd9gdgca-ed" - + "hhihdc:-7h7des ses;}.bdghadaag .igiidcfgaea9abhha {ihgd9gdgca-edhhihdc:-7hdses ses;}.hchgihaa .igiidcfgaea9abhha {ihgd9gdgca-edhhihdc:-7hbdes ses;}.igiidcfsdgahgaabhha {ihgd9gdgca-edhhihdc:-9b7des ses" - + ";}.bdghadaag .igiidcfsdgahgaabhha {ihgd9gdgca-edhhihdc:-9bdses ses;}.hchgihaa .igiidcfsdgahgaabhha {ihgd9gdgca-edhhihdc:-9bbdes ses;}.igiidcfegiihgdabhha {ihgd9gdgca-edhhihdc:-7d7des ses;}.bdghadaag ." - + "igiidcfegiihgdabhha {ihgd9gdgca-edhhihdc:-7ddses ses;}.hchgihaa .igiidcfegiihgdabhha {ihgd9gdgca-edhhihdc:-7dbdes ses;}.igiidcfhhaa {ihgd9gdgca-edhhihdc:-7a7des ses;}.bdghadaag .igiidcfhhaa {ihgd9gdgc" - + "a-edhhihdc:-7adses ses;}.hchgihaa .igiidcfhhaa {ihgd9gdgca-edhhihdc:-7abdes ses;}.igiidcfhhaa {ihgd9gdgca-edhhihdc:-7a7des ses;}.bdghadaag .igiidcfhhaa {ihgd9gdgca-edhhihdc:-7adses ses;}.hchgihaa .igi" - + "idcfhhaa {ihgd9gdgca-edhhihdc:-7abdes ses;}.igiidcfaahi {ihgd9gdgca-edhhihdc:-h9shes ses;}.bdghadaag .igiidcfaahi {ihgd9gdgca-edhhihdc:-h97ces ses;}.hchgihaa .igiidcfaahi {ihgd9gdgca-edhhihdc:-h9dhes " - + "ses;}.igiidcfhaagdaa {ihgd9gdgca-edhhihdc:-h9bces ses;}.bdghadaag .igiidcfhaagdaa {ihgd9gdgca-edhhihdc:-h7shes ses;}.hchgihaa .igiidcfhaagdaa {ihgd9gdgca-edhhihdc:-h77ces ses;}.igiidcfcaagdcihgi {ihgd" - + "9gdgca-edhhihdc:-h7dhes ses;}.bdghadaag .igiidcfcaagdcihgi {ihgd9gdgca-edhhihdc:-h7bces ses;}.hchgihaa .igiidcfcaagdcihgi {ihgd9gdgca-edhhihdc:-hhshes ses;}.igiidcfcaa9gdge {ihgd9gdgca-edhhihdc:-hh7ce" - + "s ses;}.bdghadaag .igiidcfcaa9gdge {ihgd9gdgca-edhhihdc:-hhdhes ses;}.hchgihaa .igiidcfcaa9gdge {ihgd9gdgca-edhhihdc:-hhbces ses;}.igiidcf7aae {ihgd9gdgca-edhhihdc:-hgshes ses;}.bdghadaag .igiidcf7aae" - + " {ihgd9gdgca-edhhihdc:-hg7ces ses;}.igiidcfagdebacg {ihgd9gdgca-edhhihdc:-hscces ses;ahai7:9ges;}.bdghadaag .igiidcfagdebacg {ihgd9gdgca-edhhihdc:-hsbges ses;}.hchgihaa .igiidcfagdebacg {ihgd9gdgca-ed" - + "hhihdc:-hscces ses;}.igiidcfighchsaghc {ihgd9gdgca-edhhihdc:-7bbdes ses;}.bdghadaag .igiidcfighchsaghc {ihgd9gdgca-edhhihdc:-7csses ses;}.hchgihaa .igiidcfighchsaghc {ihgd9gdgca-edhhihdc:-7c7des ses;}" - + ".igiidcfhihgiadgdsada {ihgd9gdgca-edhhihdc:-hgdhes ses;}.bdghadaag .igiidcfhihgiadgdsada {ihgd9gdgca-edhhihdc:-hgbces ses;}.hchgihaa .igiidcfhihgiadgdsada {ihgd9gdgca-edhhihdc:-hdshes ses;}.igiidcfgas" - + "gah7 {ihgd9gdgca-edhhihdc:-hd7ces ses;}.bdghadaag .igiidcfgasgah7 {ihgd9gdgca-edhhihdc:-hddhes ses;}.hchgihaa .igiidcfgasgah7 {ihgd9gdgca-edhhihdc:-hdbces ses;}.igiidcfgadhaagdeids {ihgd9gdgca-edhhihd" - + "c:-hashes ses;}.bdghadaag .igiidcfgadhaagdeids {ihgd9gdgca-edhhihdc:-ha7ces ses;}.hchgihaa .igiidcfgadhaagdeids {ihgd9gdgca-edhhihdc:-hadhes ses;}.igiidcfdeacagdeids {ihgd9gdgca-edhhihdc:-habces ses;}" - + ".bdghadaag .igiidcfdeacagdeids {ihgd9gdgca-edhhihdc:-hbshes ses;}.hchgihaa .igiidcfdeacagdeids {ihgd9gdgca-edhhihdc:-hb7ces ses;}.igiidcfcaaagdeids {ihgd9gdgca-edhhihdc:-hbdges ses;}.bdghadaag .igiidc" - + "fcaaagdeids {ihgd9gdgca-edhhihdc:-hbbdes ses;}.hchgihaa .igiidcfcaaagdeids {ihgd9gdgca-edhhihdc:-hcsges ses;}.igiidcfighh7gahidga {ihgd9gdgca-edhhihdc:-hc7des ses;}.bdghadaag .igiidcfighh7gahidga {ihg" - + "d9gdgca-edhhihdc:-hcdges ses;}.hchgihaa .igiidcfighh7gahidga {ihgd9gdgca-edhhihdc:-hcbdes ses;}.hgdchbh9ah {ihgd9gdgca-hbh9a:gga(hbh9ah/hgdcfhbh9ah.9hs);ihgd9gdgca-gaeahi:cd-gaeahi;7ah97i:77es;ahca-7a" - + "h97i:77es;bhg9hc-gh97i:ses;ahai7:7des;ihgd9gdgca-edhhihdc:ses ses;}.hgdcfidddbhgdggggaci {ihgd9gdgca-edhhihdc:-ses ses;}.hgdcfidddbhgdggggacif7daag {ihgd9gdgca-edhhihdc:-7des ses;}.hgdcfidddbhgdggggac" - + "ifhchgihaa {ihgd9gdgca-edhhihdc:-dses ses;}.hgdcfasehca {ihgd9gdgca-edhhihdc:-bdes ses;}.hgdcfasehcaf7daag {ihgd9gdgca-edhhihdc:-9sses ses;}.hgdcfbhch9aggggaci {ihgd9gdgca-edhhihdc:-97des ses;}.hgdcfb" - + "hch9aggggacif7daag {ihgd9gdgca-edhhihdc:-9dses ses;}.hgdcfbhch9aggggacifhchgihaa {ihgd9gdgca-edhhihdc:-9bges ses;}.hgdcfgasgah7ggggaci {ihgd9gdgca-edhhihdc:-7sses ses;}.hgdcfgasgah7ggggacifhchgihaa {i" - + "hgd9gdgca-edhhihdc:-ah9es ses;}.hgdcfgasgah7ggggacif7daag {ihgd9gdgca-edhhihdc:-77des ses;}.hgdcfidddbhgdh {ahai7:7ses;ihgd9gdgca-edhhihdc:-7dses ses;}.hgdcfidddbhgdhf7daag {ahai7:7ses;ihgd9gdgca-edhh" - + "ihdc:-7bses ses;}.hgdcfge {ahai7:7ses;ihgd9gdgca-edhhihdc:-7cdes ses;}.hgdcfgef7daag {ahai7:7ses;ihgd9gdgca-edhhihdc:-hsdes ses;}.hgdcfgefhchgihaa {ahai7:7ses;ihgd9gdgca-edhhihdc:-h7des ses;}.hgdcfhah" - + "gg7 {ihgd9gdgca-edhhihdc:-hgdes ses;}.hgdcfhahgg7fhchgihaa {ihgd9gdgca-edhhihdc:-asaes ses;}.hgdcfhahgg7f7daag {ihgd9gdgca-edhhihdc:-hbges ses;}.hgdcfgdaaheha {ihgd9gdgca-edhhihdc:-gaaes ses;}.hgdcfgd" - + "aahehaf7daag {ihgd9gdgca-edhhihdc:-gd9es ses;}.hgdcfaggdg {ihgd9gdgca-edhhihdc:-g9hes ses;7ah97i:9ges;}.hgdcf7aae {ihgd9gdgca-edhhihdc:-gh9es ses;7ah97i:9ces;}.hgdcfhcsd {ihgd9gdgca-edhhihdc:-ggdes se" - + "s;7ah97i:9ges;}.hgdcfgddisdaaag {ihgd9gdgca-edhhihdc:-gades ses;7ah97i:7ses;}.hgdcfihgd {ihgd9gdgca-edhhihdc:-d9aes ses;ahai7 :7ses;}.hgdcfihgdf7daag {ihgd9gdgca-edhhihdc:-dhaes ses;ahai7 :7ses;}.hgdc" - + "fgadhafhahgg7 {ihgd9gdgca-edhhihdc:-ddaes ses;ahai7 :7des;}.hgdcfgadhafhahgg7f7daag {ihgd9gdgca-edhhihdc:-dc9es ses;ahai7:7des;}.gbhgdc {ihgd9gdgca-hbh9a:gga(hbh9ah/hgdchfaf.9hs);ihgd9gdgca-gaeahi:cd-" - + "gaeahi;7ah97i:7ses;bhg9hc-gh97i:ses;aagihgha-hah9c:bhaaaa;ahai7:7ses;ihgd9gdgca-edhhihdc:ses ses;}.haghah {ihgd9gdgca-edhhihdc:-ses ses;}.gagfghia9dg9 {ihgd9gdgca-edhhihdc:-7ses ses;}.gagfsdaaag {ihgd" - + "9gdgca-edhhihdc:-gses ses;}.gagfsdaaagfhahhifsa {ihgd9gdgca-edhhihdc:-9gses ses;}.gagfsdaaagfahhedhaa {ihgd9gdgca-edhhihdc:-9ases ses;}.gagfsdaaagfsgd7ac {ihgd9gdgca-edhhihdc:-97ses ses;}.gagdgafe79hh" - + "gha {ihgd9gdgca-edhhihdc:-9sses ses;}.gagdgafabhha {ihgd9gdgca-edhhihdc:-cses ses;}.gagdga {ihgd9gdgca-edhhihdc:-ases ses;}.gagdgafhahhifsa {ihgd9gdgca-edhhihdc:-7sses ses;}.gagdgafahhedhaa {ihgd9gdgc" - + "a-edhhihdc:-77ses ses;}.gagdgafsgd7ac {ihgd9gdgca-edhhihdc:-9cses ses;}.gbhgdc {ihgd9gdgca-hbh9a:gga(hbh9ah/hgdchfaf.9hs);ihgd9gdgca-gaeahi:cd-gaeahi;7ah97i:7ses;bhg9hc-gh97i:ses;aagihgha-hah9c:bhaaaa" - + ";ahai7:7ses;ihgd9gdgca-edhhihdc:ses ses;}.haghah {ihgd9gdgca-edhhihdc:-ses ses;}.gagfghia9dg9 {ihgd9gdgca-edhhihdc:-7ses ses;}.gagfsdaaag {ihgd9gdgca-edhhihdc:-gses ses;}.gagfsdaaagfhahhifsa {ihgd9gdg" - + "ca-edhhihdc:-9gses ses;}.gagfsdaaagfahhedhaa {ihgd9gdgca-edhhihdc:-9ases ses;}.gagfsdaaagfsgd7ac {ihgd9gdgca-edhhihdc:-97ses ses;}.gagdgafe79hhgha {ihgd9gdgca-edhhihdc:-9sses ses;}.gagdgafabhha {ihgd9" - + "gdgca-edhhihdc:-cses ses;}.gagdga {ihgd9gdgca-edhhihdc:-ases ses;}.gagdgafhahhifsa {ihgd9gdgca-edhhihdc:-7sses ses;}.gagdgafahhedhaa {ihgd9gdgca-edhhihdc:-77ses ses;}.gagdgafsgd7ac {ihgd9gdgca-edhhihd" - + "c:-9cses ses;}.shaahgdc {ihgd9gdgca-hbh9a:gga(hbh9ah/gdcghiachihdc.9hs);ihgd9gdgca-gaeahi:cd-gaeahi;7ah97i:7ses;bhg9hc-gh97i:ses;aagihgha-hah9c:bhaaaa;ahai7:7ses;ihgd9gdgca-edhhihdc:ses ses;}.shaa{ihg" - + "d9gdgca-edhhihdc:ses ses;}.shaafhggdihi{ihgd9gdgca-edhhihdc:-7ses ses;}.shaafheeaa{ihgd9gdgca-edhhihdc:-gses ses;}.shaafheeahghihdc{ihgd9gdgca-edhhihdc:-ases ses;}.shaafhgahd{ihgd9gdgca-edhhihdc:-cses" - + " ses;}.shaafasgaa{ihgd9gdgca-edhhihdc:-9sses ses;}.shaaf7iba{ihgd9gdgca-edhhihdc:-97ses ses;}.shaafhbh9a{ihgd9gdgca-edhhihdc:-9gses ses;}.shaafghah{ihgd9gdgca-edhhihdc:-9ases ses;}.shaafghahhgghei{ihg" - + "d9gdgca-edhhihdc:-9cses ses;}.shaafbhadga{ihgd9gdgca-edhhihdc:-7sses ses;}.shaafeei{ihgd9gdgca-edhhihdc:-77ses ses;}.shaafegdgagi{ihgd9gdgca-edhhihdc:-7gses ses;}.shaaffghgdihba{ihgd9gdgca-edhhihdc:-7" - + "ases ses;}.shaafiasi{ihgd9gdgca-edhhihdc:-7cses ses;}.shaafahaad{ihgd9gdgca-edhhihdc:-hsses ses;}.ahdh{ihgd9gdgca-edhhihdc:-hcses ses;}.shaafsba{ihgd9gdgca-edhhihdc:-h7ses ses;}.shaaf7he{ihgd9gdgca-ed" - + "hhihdc:-hgses ses;}.sdaaag{ihgd9gdgca-edhhihdc:-hases ses;}.shaafagdeids {ihgd9gdgca-edhhihdc:-gsses ses;}.aaaaiafhbhaa{ihgd9gdgca-edhhihdc:-ggses ses;ggghdg:edhciag;}.egiahgfh7hga{ihgd9gdgca-edhhihdc" - + ":-gases ses;}.h7hga{ihgd9gdgca-edhhihdc:-gcses ses;}.eghahia{ihgd9gdgca-edhhihdc:-dsses ses;}.gddisdaaag{ihgd9gdgca-edhhihdc:-dcses ses;}.adacfhggda{ihgd9gdgca-edhhihdc:-a77es ses;ahai7:9ces;}.7aae{ih" - + "gd9gdgca-edhhihdc:-agses ses;}.ighh7 {ihgd9gdgca-edhhihdc:-acses ses;}.hggdafgh97i {ihgd9gdgca-edhhihdc:-bs7es ses;ahai7:9ces;}.igahagggbih {a7hia-hehga:cdaghe;}.igahagggbih .igahagggbihfgddi {aagihgh" - + "a-hah9c:bhaaaa;ehaahc9:s;}.igahagggbih .igahagggbihfhggda {aagihgha-hah9c:bhaaaa;ehaahc9-aasi:7es;}.igahagggbih .igahagggbihfahgchba {aagihgha-hah9c:bhaaaa;ehaahc9-aasi:7es;sdci-shbha9:aghha,aaaaaihgh" - + ",hhch-haghs;sdci-hh7a:9ab;}.igahagggbih .igahagggbihfahgchba hcegi {ihgd9gdgca:ighchehgaci;idgaag:cdca;ehaahc9:ses;bhg9hc:ses;ahai7:9ss%;}a {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;}a:ahcd {iasi" - + "-aagdghihdc:cdca;gdadg:#ssssss;}a:ahhhiaa {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:hgihaa {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:ahcd.iddaihgfigiidcfahcd {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:ahhhiaa.i" - + "ddaihgfigiidcfahcd {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:hgihaa.iddaihgfigiidcfahcd {iasi-aagdghihdc:cdca;gdadg:#ssssss;}a:7daag.iddaihgfigiidcfahcd {iasi-aagdghihdc:cdca;gdadg:#ggbggg;ggghdg:edhc" - + "iag;}a:ahcd.aaaaa9fiasi {iasi-aagdghihdc:cdca;gdadg:#gggggg;sdci-hh7a:dd%;}a:ahhhiaa.aaaaa9fiasi {iasi-aagdghihdc:cdca;gdadg:#gggggg;sdci-hh7a:dd%;}a:hgihaa.aaaaa9fiasi {iasi-aagdghihdc:gcaagahca;gdad" - + "g:#ssssss;sdci-hh7a:dd%;}a:7daag.aaaaa9fiasi {iasi-aagdghihdc:cdca;gdadg:#ggbggg;sdci-hh7a:dd%;ggghdg:edhciag;}a:ahcd.aaaaa9fhgihaafhagihdc {iasi-aagdghihdc:cdca;gdadg:#gggggg;sdci-aah97i:idaa;sdci-hh" - + "7a:dd%;}a:ahhhiaa.aaaaa9fhgihaafhagihdc {iasi-aagdghihdc:cdca;gdadg:#gggggg;sdci-aah97i:idaa;sdci-hh7a:dd%;}a:hgihaa.aaaaa9fhgihaafhagihdc {iasi-aagdghihdc:gcaagahca;gdadg:#ssssss;sdci-aah97i:idaa;sdc" - + "i-hh7a:dd%;}a:7daag.aaaaa9fhgihaafhagihdc {iasi-aagdghihdc:cdca;gdadg:#ggbggg;sdci-hh7a:dd%;sdci-aah97i:idaa;ggghdg:edhciag;}a:ahcd.aaaaa7fiasi {iasi-aagdghihdc:cdca;gdadg:#cdcdcd;}a:ahhhiaa.aaaaa7fia" - + "si {iasi-aagdghihdc:cdca;gdadg:#cdcdcd;}a:hgihaa.aaaaa7fiasi {iasi-aagdghihdc:gcaagahca;gdadg:#cdcdcd;}a:7daag.aaaaa7fiasi {iasi-aagdghihdc:gcaagahca;gdadg:#ggbggg;ggghdg:edhciag;}a:ahcd.aaaaahfiasi {" - + "iasi-aagdghihdc:cdca;gdadg:#cdcdcd;ahca-7ah97i:7ses;}a:ahhhiaa.aaaaahfiasi {iasi-aagdghihdc:cdca;gdadg:#cdcdcd;ahca-7ah97i:7ses;}a:hgihaa.aaaaahfiasi {iasi-aagdghihdc:gcaagahca;gdadg:#cdcdcd;ahca-7ah9" - + "7i:7ses;}a:7daag.aaaaahfiasi {iasi-aagdghihdc:cdca;gdadg:#ggbggg;ggghdg:edhciag;ahca-7ah97i:7ses;}a:ahcd.gcaagahca {gdadg:#ssssss;iasi-aagdghihdc:gcaagahca;ggghdg:edhciag;}a:ahhhiaa.gcaagahca {gdadg:#" - + "ssssss;iasi-aagdghihdc:gcaagahca;}a:hgihaa.gcaagahca {iasi-aagdghihdc:gcaagahca;gdadg:#ssssss;}a:7daag.gcaagahca {iasi-aagdghihdc:gcaagahca;gdadg:#ggbggg;}.igahagggbih hcegi {ggghdg:edhciag;}.igahaggg" - + "bih hcegi:7daag.hchgihaa {ggghdg:aashgai;gdadg:#adadad;}a:7daag,a.sdggh,a:ahcd.sdggh,a:ahhhiaa.sdggh,a:7daag.sdggh,a:hgihaa.sdggh,.ihiehhi igiidc:7daag,.igahagggbih hcegi:7daag {iasi-aagdghihdc:cdca;g" - + "dadg:#ggbggg;ggghdg:edhciag;}h hb9 {idgaag:cdca;}ida9 {ehaahc9-gh97i:ses;ehaahc9-aasi:ses;ehaahc9-idiidb:ses;ehaahc9-ide:ses;bhg9hc-gh97i:ses;bhg9hc-aasi:ses;bhg9hc-ide:ses;bhg9hc-idiidb:ses;ihgd9gdgc" - + "a-gdadg:#gggggg;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:bg%;}ihiaa {sdci-hh7a:9ab;}ihiaa ihiaa {sdci-hh7a:9ss%;}.aasigadhi {sadhi:aasi;}i {sdci-aah97i:idaa;}.igiidc {sdci-shbha9:sh7d" - + "bh,aghha,aaaaaihgh,hhch-haghs;ehaahc9:des;iasi-hah9c:gaciag;sadhi:aasi;}.ihhhgsgiidc {ehaahc9:ses;bhg9hc:ses;idgaag-hi9aa:cdca;ihgd9gdgca-gdadg:ighchehgaci;ggghdg:edhciag;}.ihhhgsgiidc .igiidcfiasi {a" - + "hca-7ah97i:7ses;sdci-hh7a:9ab;}.ihhhgsgiidc.bdghadaag .igiidcfiasi {gdadg:#ggbggg;}.ihhhgsgiidc.hchgihaa .igiidcfiasi {gdadg:#sgsgsg;ggghdg:aashgai;}.aasifigiidc {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hh" - + "ch-haghs;sdci-hh7a:s.dab;ehaahc9-ide:des;ehaahc9-aasi:des;ehaahc9-gh97i:des;iasi-hah9c:gaciag;sadhi:aasi;bhc-ahai7:dses;}.gh97ifigiidc {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:s.dab;eh" - + "aahc9:des;iasi-hah9c:gaciag;sadhi:gh97i;}.gdagbcf7ahaag {sdci-aah97i:idaa;sdci-hh7a:dd%;ahca-7ah97i:9des;gdadg:#ssssss;ehaahc9-ide:7es;ehaahc9-aasi:7es;ehaahc9-gh97i:7es;a7hia-hehga:cdaghe;iasi-hah9c:" - + "aasi;}.hgdcfgdagbcf7ahaag {ehaahc9-aasi:7des;}.ahihfgda i7 {iasi-hah9c:aasi;sdci-aah97i:cdgbha;}.ahihfgda .cd7hih {iasi-hah9c:gaciag;}#idddbhgdfihiaa i7 h {ehaahc9-aasi:9ses;}.ahihfgda {7ah97i:7des;ih" - + "gd9gdgca-gdadg:#gggggg;}.ahihfahhi9dagbc {ehaahc9-aasi:des;ehaahc9-gh97i:des;ahca-7ah97i:7des;}.agdeadac {idgaag-idiidb:9es iahgd;idgaag-gh97i:9es iahgd;idgaag-aasi:9es #9s9s9s;idgaag-ide:9es #9s9s" - + "9s;ahhhihahi9:7haaac;edhhihdc:hihdagia;ahai7:7sses;7-hcaas:9;ehaahc9:ses;ggghdg:edhciag;}.haaagi {ihgd9gdgca-gdadg:#g9gdga;sadhi:aasi;}haaagi.gghiaghh {sdci-hh7a:s.dab;ahai7:9cses;}.hbhaa {sdci-hh7a:d" - + "d%;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;}.ihiaaaehgag {ahai7:7ses;}.iasihcegi {ehaahc9:des;bhg9hc:ses;aagihgha-hah9c:ide;}i7 {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-aah97i:idaa;" - + "sdci-hh7a:dd%;}.ihiaa {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;sdci-aah97i:idaa;}.ahaga {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;}.aaaaafiddaihg {gaahg:idi7;a" - + "hai7:hgid;7ah97i:gces;ihgd9gdgca-gdadg:#d77ahc;}.iddaihgfaasi {sadhi:aasi;ahai7:hgid;iasi-hah9c:gaciag;}.iddaihgfgh97i {sadhi:gh97i;ahai7:hgid;iasi-hah9c:gaciag;}aha.iddaihg {sadhi:aasi;}.iddaihgfid9f" - + "aasi {sadhi:aasi;}.iddaihgfid9 {gdadg:#ssssss;sadhi:aasi;}.iddaihgfid9fgh97i {sadhi:aasi;}.iddaihgfigiidc {sadhi:aasi;iasi-hah9c:gaciag;ggghdg:edhciag;ehaahc9:ces ses ces ses;bhg9hc:ses;idgaag:ses cdc" - + "a;ihgd9gdgca-gdadg:ighchehgaci;}.iddaihgfigiidc.hchgihaa {ggghdg:hgid;}.iddaihgfigiidcfhgdc {gaahg:gh97i;sadhi:cdca;bhg9hc-aasi:hgid;bhg9hc-gh97i:hgid;idgaag:ses;}.iddaihgfigiidc .igiidcfiasi,.iddaihg" - + "figiidc hehc {ahheah9:iadgd;sdci-hh7a:s.cab;ehaahc9-aasi:des;ehaahc9-gh97i:des;sdci-shbha9:aghha,aaaaaihgh,hhch-haghs;ahca-7ah97i:s.cab;iasi-aagdghihdc:cdca;}.iddaihgfigiidc.bdghadaag .igiidcfiasi {gd" - + "adg:#ggbggg;}.iddaihgfigiidc.hchgihaa .igiidcfiasi {gdadg:9gh9;}.iicfahih9dcigdafaasi {sadhi:aasi;ehaahc9-aasi:des;}.cdaghe,.cdaghe ia,.iaehiaa {a7hia-hehga:cdaghe;}ihiaa.cdaghe,ihiaa.cdaghe ig,ia.ag" - + "he {a7hia-hehga:cdgbha;}.ihifhbhaafaasi {sadhi:aasi;}.ihifhbhaafgh97i {sadhi:aasi;}.ihifhbhaafid9 {sadhi:aasi;sdci-hh7a:dd%;}.ihifhbhaafid9 h {ahca-7ah97i:7ses;ehaahc9-ide:7es;}.ihifhbhaafdssfaasi {" - + "sadhi:aasi;ahai7:7ses;ehaahc9-ide:7es;}.ihifhbhaafdssfgh97i {sadhi:aasi;ehaahc9-ide:7es;}.ihifhbhaafdssfid9 {sadhi:aasi;sdci-hh7a:dd%;ehaahc9-ide:7es;}aha.ihifhbhaa {idgaag-aasi:9es hdaha #7a77hh;id" - + "gaag-gh97i:9es hdaha #7a77hh;idgaag-idiidb:9es hdaha #7a77hh;}aha.aaaaa9 {ahai7:hgid;gaahg:idi7;}aha.aaaaa9faasi {sadhi:aasi;ehaahc9-aasi:des;ehaahc9-ide:7es;ehaahc9-idiidb:7es;7ah97i:9ges;}aha.aaaaa" - + "9fgh97i {sadhi:gh97i;ehaahc9-aasi:des;ehaahc9-ide:7es;ehaahc9-idiidb:7es;7ah97i:9ges;}.aaaaa9fiasi {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;gdadg:#gggggg;sdci-hh7a:dd%;ehaahc9-aasi:7es;ehaahc9-g" - + "h97i:7es;}.aaaaa9fad9hc {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;gdadg:#gggggg;sdci-hh7a:dd%;sdci-aah97i:idaa;ehaahc9-aasi:des;ehaahc9-gh97i:des;}.aaaaa9fad9dgi {bhg9hc-gh97i:7es;}aha.ad9d {sad" - + "hi:aasi;}.aaaaa7fiasi {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;gdadg:#i7i7i7;sdci-aah97i:idaa;ehaahc9-aasi:des;ehaahc9-gh97i:des;ahca-7ah97i:hhes;}.aaaaafadghihdc {gaahg:idi7;ahai7:hgid;7ah97i:7" - + "ces;ihgd9gdgca-gdadg:#d77ahc;edhhihdc:gaahihaa;}.adghihdcfaasi {bhg9hc-aasi:hes;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;}.aaaaafigahagggbi {gaahg:idi7;ahai7:hgid;7ah97i:7ces;ihgd9g" - + "dgca-gdadg:#d77ahc;}.igahagggbifaasi {ahai7:hgid;bhg9hc-gh97i:7dses;}.igahagggbifgh97i {sadhi:gh97i;ahai7:hgid;ahai7:7gces;}.igahagggbifigiidc {sadhi:aasi;bhg9hc-aasi:ses;bhg9hc-gh97i:ses;bhg9hc-ide:9" - + "es;ggghdg:edhciag;7ah97i:7ces;ihgd9gdgca-gdadg:ighchehgaci;idgaag:cdca;ehaahc9:ses;}.igahagggbifhbh9a {bhg9hc-aasi:hes;bhg9hc-gh97i:hes;bhg9hc-ide:9es;ggghdg:edhciag;7ah97i:7ces;idgaag:cdca;}.igahaggg" - + "bifehi7fgdcihhcag {ihgd9gdgca-gdadg:a7hia;ahai7:hgid;ehaahc9-ide:ses;ehaahc9-idiidb:ses;}.igahagggbihcah {ahai7:bes;7ah97i:7ces;ihgd9gdgca-gdadg:#d77ahc;}.igahagggbifehi7figiidc {sadhi:aasi;bhg9hc-gh9" - + "7i:9es;bhg9hc-ide:9es;bhg9hc-aasi:ses;}.cdsdgaag {idgaag:cdca;}.igahagggbifehi7fahcd {idgaag:cdca;}.igahagggbifehi7 {sadhi:aasi;}.igahagggbifehi7faasi,.igahagggbifehi7fgh97i {sdci-shbha9:sh7dbh,aghha," - + "aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;}.igahagggbifehi7fiasi {iasi-aagdghihdc:cdca;gdadg:#ssssss;sdci-hh7a:s.dab;ahca-7ah97i:7ges;bhg9hc-aasi:hes;}.hahgg7fehi7fgdcihhcag7 {sadhi:gh97i;ihgd9gdgca-gdadg:a7" - + "hia;gdadg:9gh9;ehaahc9-ide:ses;ehaahc9-idiidb:ses;7ah97i:7ges;idgaag:7es hdaha #d77ahc;}.hahgg7fhcegi7 {sadhi:aasi;ahai7:9gces;aagihgha-hah9c:bhaaaa;bhg9hc-aasi:9es;idgaag:7es hdaha a7hia;ihgd9gdgca-g" - + "dadg:a7hia;}#hahgg7iasi {sdci-shbha9:sh7dbh,dacaah,hhch-haghs;sdci-hh7a:9ab;}#hahgg7sddaihg {sdci-hh7a:9ab;}.hahgg7fehi7figiidc {sadhi:aasi;bhg9hc-aasi:ses;bhg9hc-ide:9es;bhg9hc-gh97i:9es;ggghdg:edhci" - + "ag;idgaag:cdca;}.ahgagidg9fehi7 {sadhi:aasi;}aha.ehi7faasi,aha.ehi7fgh97i {sadhi:aasi;sdci-aah97i:cdgbha;bhg9hc:ses;ahca-7ah97i:7des;ihgd9gdgca-gdadg:#d77ahc;}aha.ggggacifehi7figiidch {ihgd9gdgca-gd" - + "adg:#d77ahc;sadhi:aasi;}aha.idddbhgdh {sadhi:aasi;ihgd9gdgca-gdadg:#d77ahc;7ah97i:7des;ahca-7ah97i:7des;}ga.idddbhgd {ihgd9gdgca-gdadg:#gsg9g9;}ah.idddbhgd {ahhi-hi9aa:cdca;ehaahc9-aasi:des;ehaahc9-id" - + "e:7es;ehaahc9-idiidb:ses;ehaahc9-gh97i:des;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:s.dab;}ah.bhch9afidddbhgdh {ahhi-hi9aa:cdca;ehaahc9-aasi:des;ehaahc9-ide:7es;ehaahc9-idiidb:ses;ehaah" - + "c9-gh97i:des;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;idgaag-ide:9es hdaha #7d7d7d;sdci-hh7a:s.dab;}aha.hahgg7 {sadhi:aasi;ahai7:hgid;ihgd9gdgca-gdadg:#d77ahc;}aha.9dd9aafhahgg7 {sadhi:gh97i;ihg" - + "d9gdgca-gdadg:#d77ahc;}aha.hahgg7fids {sdci-aah97i:cdgbha;bhg9hc:ses;ahca-7ah97i:7des;sadhi:aasi;ihgd9gdgca-gdadg:#d77ahc;}.bacg {idgaag-idiidb:9es hdaha #cscscs;idgaag-gh97i:9es hdaha #cscscs;idgaag" - + "-ide:9es hdaha #gggggg;idgaag-aasi:9es hdaha #gggggg;ihgd9gdgca-gdadg:#gggggg;sdci-shbha9:aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:s.dab;ehaahc9:ses;}aha.shaafbhch9ag {ehaahc9:ses;ihgd9gdgca-gdadg:#s7sca" - + "7;idgaag:9es hdaha #sgsgsg;ahai7:9ss%;sadhi:aasi;}aha.sddiag {ahai7:hgid;sadhi:gh97i;ehaahc9-ide:7es;ehaahc9-idiidb:ses;}aha.bahhh9a {sadhi:aasi;sdci-aah97i:cdgbha;sdci-hh7a:dd%;gdadg:iahgd;bhg9hc:se" - + "s;ahca-7ah97i:77es;ahai7:hgid;ehaahc9:7es;}.gh97ifgahgd {idgaag:9es hdaha #9s9s9s;ihgd9gdgca-gdadg:#gsgggg;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:s.dab;ahhhihahi9:7haaac;edhhihdc:hihd" - + "agia;ahai7:97ses;7-hcaas:9;ehaahc9:9ses;ggghdg:edhciag;}aha.ehgdehhi {ihgd9gdgca-gdadg:#gggggg;idgaag:9es hdaha #b99h7h;ehaahc9:des;}aha.ehgdehhiagah {gaahg:idi7;ehaahc9:9ses;}.bhch9afeh9a {ihgd9gdgca" - + "-gdadg:#ghghgh;}.gdbbaci {edhhihdc:gaahihaa;bhg9hc-ide:7es;ehaahc9:9ses;gaahg:gh97i;}.aaac9dbbaci {ihgd9gdgca:#gggggg;}.daa9dbbaci {ihgd9gdgca-gdadg:#ghghgh;idgaag-ide:#sgsgsg;idgaag-idiidb:#sgsgsg;}." - + "haa9dbbaciagah {bhg9hc-idiidb:des;}.gdbbaciagi7dg {sdci-hh7a:9ab;sdci-aah97i:idaa;ehaahc9-idiidb:des;}.gdbbacisasi {sdci-hh7a:dd%;ehaahc9-idiidb:9es;}.gdbbacishbahihbe {sdci-hh7a:s.cab;}.gdbbaci7aaaia" - + "97agdids {edhhihdc:hihdagia;gh97i:9ses;ide:9ses;ggghdg:edhciag;}aha.eh9afihiaa {gaahg:idi7;ahai7:hgid;}aha.hhaafchah9hihdc {bhg9hc-ide:ses;}ia.hhaafchah9hihdc {ihgd9gdgca-hbh9a:gga(hi9aah/hhaafchafid" - + "9.ge9);ihgd9gdgca-gaeahi:gaeahi-s;ahai7:9bdes;idgaag-gh97i:9es hdaha #sgsgsg;}.ihiehhi {bhg9hc-aasi:7ses;bhg9hc-ide:7ses;bhg9hc-idiidb:7ses;ehaahc9-aasi:9bes;}.ihiehhi igiidc {ihgd9gdgca-gdadg:ighcheh" - + "gaci;idgaag:ses cdca;bhg9hc:ses;ehaahc9:ses;ggghdg:edhciag;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;iasi-hah9c:aasi;}.ihiehhi ah {ehaahc9-aasi:ses;ehaahc9-ide:ses;ehaahc9-gh97i:ses;" - + "ehaahc9-idiidb:ges;ahhi-hi9aa-i9ea:cdca;sdci-hh7a:s.dab;}.aaihfhiabfhgihaa {ahhi-hi9aa-hbh9a:gga(hbh9ah/haaagiaafhgihdc.9hs);}.aaihfhiabfhgihaa igiidc {sdci-aah97i:idaa;}aha.gh97ifeh9afgdciaci {ahai7" - + ":hgid;ihgd9gdgca-gdadg:a7hia;}aha.hbhaafhgifiddaihg {ihgd9gdgca-gdadg:#9s9s9s;7ah97i:7des;ehaahc9-idiidb:des;}aha.hgifigiidc {sdci-hh7a:s.dab;ehaahc9-aasi:7es;ehaahc9-gh97i:7es;sadhi:aasi;iasi-hah9c:" - + "gaciag;}aha.eh9afihiaa {bhg9hc:ses;}.eh9afihiaa hcegi,.eh9afihiaa hgibhi,.eh9afihiaa haaagi,.eh9afihiaa iasihgah,.sdgbfgdciaci iasihgah {sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;}a" - + "ha.eh9afahih {bhg9hc:9ses;sadhi:aasi;}aha.bdahafsdgb {idgaag:9es hdaha #a9a9a9;bhc-ahai7:gases;}aha.sdgbfgdciaci {bhg9hc:7as;gaahg:idi7;ahai7:hgid;}.sdgbfgdciaci h {sdci-hh7a:9ab;}aha.sdgbfihiaafihg" - + " {idgaag-aasi:9es hdaha #b99h7h;idgaag-gh97i:9es hdaha #b99h7h;gaahg:idi7;}.sdgbfihiaafiasi {ahca-7ah97i:7aes;sdci-shbha9:sh7dbh,aghha,aaaaaihgh,hhch-haghs;sdci-hh7a:9ab;sdci-aah97i:idaa;gdadg:#hhhh" - + "hh;sdci-aah97i:idaa;aagihgha-hah9c:ihhaahca;bhg9hc:ses;ehaahc9-aasi:des;}.iicfeh9a9dcigdafaasi {ehaahc9-ide:ges;sadhi:aasi;}.iicfeh9a9dcigdafgh97i {ehaahc9-ide:ges;sadhi:gh97i;}aha.sdgbfgdcigdah {gaa" - + "hg:idi7;}aha.ghahdfigiidch {ehaahc9:des;}.aaig9sdgaag {idgaag:9es hdaha gaa;}.aaig9 {idgaag:9es hdaha #iii;}.haahcgaafhahgg7 {ahai7:hgid;gaahg:idi7;bhg9hc:9ses;ihgd9gdgca-gdadg:#ac7ahs;edhhihdc:gaah" - + "ihaa;}aha.hahgg7fid9 {edhhihdc:gaahihaa;ihgd9gdgca-gdadg:#h9h9h9;idgaag-idiidb:7es hdaha #d9a9sb;}.hahgg7fgdcihhcag {ahai7:hgid;bhg9hc-aasi:7ses;ehaahc9-ide:9ses;}aha.hahgg7fgefaasifgdgcag {sadhi:aa" - + "si;}aha.hahgg7fgefgh97ifgdgcag {sadhi:gh97i;}.hahgg7fihiaa {sdci-hh7a:dd%;sdci-aah97i:idaa;ehaahc9-aasi:des;ehaahc9-ide:des;}.hahgg7fgghiaghh {ehaahc9-aasi:9ses;ehaahc9-gh97i:ses;ehaahc9-ide:des;sdci-" - + "hh7a:dd%;ihgd9gdgca-gdadg:#gggggg;idgaag:9es hdaha #sgsgsg;}aha.hahgg7figiidcfgda {ehaahc9-ide:des;idgaag-ide:9es hdaha #sgsgsg;sadhi:aasi;ahai7:9ss%;}aha.hahgg7figiidcfgdcihhcag {sadhi:gh97i;}aha.hah" - + "gg7fhaa9ghiaghhfgda {idgaag-idiidb:9es hdaha #sgsgsg;sadhi:aasi;ahai7:9ss%;7ah97i:7des;}aha.hahgg7fgghiaghhfgdcihhcag {idgaag:7es hdaha #d9a9sb;ehaahc9:des;}.hgdcehiaafiasi {sadhi:aasi;bhg9hc:ses;7ah9" - + "7i:7des;ahca-7ah97i:7des;ehaahc9-gh97i:des;sdci-hh7a:dd%;sdci-aah97i:idaa;}aha.hgdc {ahai7:7des;7ah97i:7des;sadhi:aasi;}a:ahcd.hahgg79ghiaghhfiasi {iasi-aagdghihdc:gcaagahca;gdadg:#ssssss;sdci-hh7a" - + "{sadhi:aasi;ahhi-hi9aa:cdca;bhg9hc-ide:hes;}.7aae9dcihhcag {edhhihdc:hihdagia;ide:7es;gh97i:7es;bhg9hc:ses;ehaahc9:ses;idgaag:ses cdca;7-hcaas:g;ggghdg:edhciag;ahhhihahi9:hc7aghi;ihgd9gdgca-gdadg:ighc" - + "hehgaci;}.7aae9dcihhcagaihihg {bhg9hc:ses;ehaahc9:ses;ggghdg:edhciag;ahhhihahi9:hc7aghi;}.9gh-bdagaa .7aae9dcihhcag {gh97i:ges;}.9gh-ahhad9 .9gh-ehcaa .7aae9dcihhcag {gh97i:7ses;}.sdgb7hih {sdci-hh7a" - + ":9ab;}ihiaa.cdihs9shiaa {idgaag:ses;}ihiaa.cdihs9shiaa .aasi9dagbc {iasi-hah9c:gh97i;aagihgha-hah9c:ide;sdci-aah97i:idaa;}ihiaa.cdihs9shiaa .gh97i9dagbc {iasi-hah9c:aasi;}ihiaa.hgeagihiaa {bhg9hc:s s " - + "s 7es;}ihiaa.hgeagihiaa iida9 ig ia.geadhaf7ahaag {idgaag-ide:9es hdaha g9i(9g7,9g7,9g7);idgaag-gh97i:9es hdaha g9i(9g7,9g7,9g7);idgaag-idiidb:cdca;idgaag-aasi:9es hdaha g9i(9g7,9g7,9g7);ihgd9gdgca:g9" - + "i(77d,77d,77d);ehaahc9:s;sdci-hh7a:s;7ah97i:hses;}ihiaa.hgeagihiaa iida9 ig ia.geadhaf7ahaag ihiaa {sdci-aah97i:ass;sdci-hh7a:9ab;ihgd9gdgca:ighchehgaci;gdadg:iahgd;ahai7:9ss%;bhg9hc:s;}ihiaa.hgeagihi" - + "aa iida9 ig ia.gdcihhchfgeadha {bhg9hc:s;ehaahc9-aasi:s;}aha.geadha {bhg9hc:s;ehaahc9:s;daagsada:hgid;7ah97i:7hses;ahai7:asses;idgaag:9es hdaha g9i(9g7,9g7,9g7);ihgd9gdgca:a7hia;}aha.geadha ihiaa {7ah" - + "97i:9ss%;idgaag:cdca;}.geadha-daagaghia {}aha.geadha ihiaa iida9 ig {7ah97i:7des;}aha.geadha ihiaa iida9 ig#geadhafiahcdgda {7ah97i:hgid;}.geadhafsddiag {idgaag-ide:cdca;idgaag-gh97i:9es hdaha g9i(9g7" - + ",9g7,9g7);idgaag-idiidb:9es hdaha g9i(9g7,9g7,9g7);idgaag-aasi:9es hdaha g9i(9g7,9g7,9g7);7ah97i:hses;ihgd9gdgca:g9i(77d,77d,77d);}.iaehiaa {sdci-aah97i:idaa;}.ihiaaf7ahaag {sdci-aah97i:idaa;sdci-hh7a" - + ":9ab;gdadg:#ssssss;ahca-7ah97i:7hes;ahai7:9ss%;}.gh97ifihiaaf7ahaag {ahca-7ah97i:7hes;ahai7:hes;sdci-aah97i:idaa;gdadg:#ssssss;sdci-hh7a:9ab;}.aasifihiaaf7ahaag {ahca-7ah97i:7hes;ahai7:ges;sdci-aah97i" - + "{ihgd9gdgca-gdadg:#gggggg;ia77bgd-abdas:ses;ia77bgd-ehgs:ses;ia77bgd-shsshf:ses;ia77bgd-shi:hces;faadbg-abdas:des;faadbg-ehgs:des;faadbg-shi:hces;faadbg-shsshf:ses;ghgs-abah:9ss%;}.aabhcfhaiahiaa {" - + "sdci-hh7a:9ab;}#shaahgdgb {edhhihdc:hihdagia;ide:ses;aasi:ses;ahai7:ses;7ah97i:ses;}.aaaaafhgiihih {ihgd9gdgca-gdadg:#gggggg;7ah97i:7ses;}.gdagbcf7ahaagfadc9 {sdci-hh7a:dd%;7ah97i:hses;gdadg:#sssss" - + "s;}aha.ihifhaafeagbhhhhdch,aha.ihifihhhgfeagbhhhhdch {sadhi:aasi;ahai7:hgid;iasi-hah9c:gaciag;}aha.eagbhhhhdchbhhaehhi {bhg9hc:ses;ehaahc9-aasi:7ses;ehaahc9-ide:des;ehaahc9-idiidb:des;}aha.eagbhhhhdch" - + "bhhaehhi ga {bhg9hc:ses;ehaahc9:ses ses ses 9ses;}aha.hgdcehiaafiasi {sadhi:aasi;bhg9hc:ses;7ah97i:7des;ahca-7ah97i:7des;ehaahc9-gh97i:des;sdci-aah97i:idaa;}aha.hgdc {ahai7:7des;7ah97i:7des;sadhi:a" - + "asi;}a.ahia {gdadg:#ggssss;sdci-aah97i:cdgbha;}a:ahhhiaa.ahia {gdadg:#ggssss;sdci-aah97i:cdgbha;}a:7daag.ahia {gdadg:#ggssss;sdci-aah97i:cdgbha;}a:hgihaa.ahia {gdadg:#ggssss;sdci-aah97i:cdgbha;}.ahia" - + "{9heha:#ggssss;ghgs-hhbdas:idaa;}.gh97ifiddaihg {sadhi:gh97i;ehaahc9-gh97i:des;}aha.asfhahgg7fid9 {bhg9hc-aasi:hes;bhg9hc-gh97i:hes;bhg9hc-idiidb:9ses;idgaag-idiidb:7es hdaha #d9a9sb;}.asfhahgg7 {ah" - + "ai7:hgid;gaahg:idi7;7ah97i:9hses;ehaahc9-ide:ses;bhg9hc:ses;ihgd9gdgca-gdadg:#d77ahc;}aha.asfhahgg7faasiaca {sadhi:aasi;}aha.asfhahgg7fgh97iaca {sadhi:gh97i;}.ahih h {sdci-hh7a:9ab;}.asfhahgg7fgdcihh" - + "cag {sadhi:aasi;bhg9hc-ide:des;}ia.asfhahgg7fiasi {sdci-hh7a:s.dab;}.asfhahgg7fiasi hcegi {sdci-hh7a:s.dab;}.asfhahgg7fiasi haaagi {sdci-hh7a:s.dab;}ia.asfihiaaaehgag {ahai7:9ses;}.asfihiaa9aaa {ehaah" - + "c9-aasi:9ses;ehaahc9-gh97i:des;}aha.hgihdcfhiae {ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:des;ehaahc9-gh97i:9ses;bhg9hc-gh97i:9des;ihgd9gdgca-gdadg:a7hia;idgaag-idiidb:7es dgihai;idgaag-gh97i:7" - + "es dgihai;ahai7:dd%;}aha.aaghhhdcfhiae {ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:des;ehaahc9-gh97i:des;ihgd9gdgca-gdadg:a7hia;idgaag-idiidb:7es dgihai;idgaag-gh97i:7es dgihai;ahai7:dd%;}aha.i7" - + "ac {ihgd9gdgca:#hhgggh;ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:7es;ehaahc9-gh97i:des;idgaag-idiidb:7es dgihai;idgaag-gh97i:7es dgihai;ahai7:dd%;}aha.i7acfida9 {ehaahc9-ide:des;ehaahc9-idiidb:" - + "des;ehaahc9-aasi:9ses;ehaahc9-gh97i:des;ahai7:dd%;}aha.aaha {ihgd9gdgca:#hhgggh;ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:7es;ehaahc9-gh97i:des;idgaag-idiidb:7es dgihai;idgaag-gh97i:7es dgihai;a" - + "hai7:dd%;}aha.aahafida9 {ehaahc9-ide:des;ehaahc9-idiidb:des;ehaahc9-aasi:9ses;ehaahc9-gh97i:des;ahai7:dd%;}aha.haafhiae {ehaahc9-ide:9ses;ehaahc9-idiidb:9ses;iasi-hah9c:gaciag;}aha.casifhiae {ihgd9gd" - + "gca:#hhgggh;ehaahc9-ide:7es;ehaahc9-idiidb:7es;ehaahc9-aasi:7es;ehaahc9-gh97i:des;idgaag-idiidb:7es dgihai;idgaag-gh97i:7es dgihai;ahai7:dd%;}aha.hsfida9 {ehaahc9-ide:des;ehaahc9-idiidb:des;ehaahc9-aa" - + "si:9ses;ehaahc9-gh97i:des;ahai7:dd%;}aha.ehghbaiagh {ehaahc9-ide:des;ehaahc9-idiidb:des;ehaahc9-aasi:9ses;ehaahc9-gh97i:des;ahai7:dd%;}aha.eh9afida9 {ehaahc9-ide:9ses;ehaahc9-aasi:9ses;}aha.h7dgifhgi" - + "hdcfchba {sdci-hh7a:9ss%;}aha.h7dgifaaghhhdcfchba {sdci-hh7a:9ss%;}.gahaagfcdihshghihdc {ahheah9:cdca;}.gahaaghaabaci {edhhihdc:hihdagia;ide:-9es;aasi:-9ses;7ah97i:9es;ahca-7ah97i:9es;idgaag:cdca;eh" - + "aahc9:ses;bhg9hc:ses;ahai7:9es;daagsada:7haaac;}ihiaa.dig i7 aha {edhhihdc:gaahihaa;ide:-9ses;7ah97i:9es;daagsada:7haaac;}.idaaehiaah ahiaa,.ahiaa {sdci-aah97i:idaa;sdci-hh7a:9ab;}shaaahai.ghahddgdge " - + "{ehaahc9:ses;idgaag:cdca;iasi-hah9c:aasi;}shaaahai.ghahddgdge aa9aca {ehaahc9:ses;}shaaahai.ghahddgdge aha {ehaahc9-aasi:7ses;ehaahc9-idiidb:des;}shaaahai.ghahddgdge ahiaa {ahheah9:iadgd;bhg9hc-aasi:9" - + "79.ihiaa,77.ihiaa {bhg9hc:ses;}.9gh-bdagaa,.ahdhfihi7haa9dciaci,.hahgg7fid9,.haahcgaafhahgg7 {7ddb:9;}.eghcghehaehhi {ahhi-hi9aa-i9ea:cdca;}.ihiehhi igiidc,.aaaaa7fbacg igiidc,.aaaaahfbacg igiidc,.ihh" - + "hgsgiidc,.iddaihgfigiidc,.igahagggbihfahgchba hcegi,.shaaa9hiabsgdahagsgaa hcegi {ahai7:hgid;daagsada:ahhhiaa;}.gbaiaeaahahc9h {ehaahc9-aasi:7ses;sdci-aah97i:idaa;sdci-hh7a:9ss%;}.9ghaids {ahai7:9ss%;" - + "sdci-shbha9:sh7dbh,dacaah,hhch-haghs;sdci-hh7a:9ss%;ehaahc9:ses;bhg9hc:ses;idgaag-idiidb:ses;idgaag-aasi:ses;idgaag-gh97i:ses;ihgd9gdgca-gdadg:#gshghg;daagsada:7haaac;}.digids hcegi {ggghdg:aashgai;}." - + "bgaihehhi {sadhi:aasi;ahheah9:hcahca;ehaahc9:s 7ses;bhg9hc:s;}.bgaihehhi .cd7hagah {ahhi-hi9aa:cdca;}.s9fgaciagidhhihdc {bhg9hc:ses hgid;}.ahdhfeh9a9dciaci {ihgd9gdgca-hbh9a:gga(hi9aah/ahdhfid9.ge9);i" - + "hgd9gdgca-gaeahi:gaeahi-9;}shca9haghaaaaagihdc,.asfhahgg7fid9,#aaaaa7,.aaaaa7fihifshaafaasi,.iddaihg,.iddaihgfid9,.aaaaa7fihih,.aaaaa7fbacg .ihifbha,.aaaaa7fihifshaafgh97i,aha.aaaaa7fhgihaa .ihifbha,." - + "ahdhfaaaaa9,.gdagbcf7ahaagfadc9,.ahdhfeh9ashiaa,.ahdhfeh9agddiag,.igahagggbifehi7fgdcihhcag,.ggggacifehi7figiidch,.hahgg7fids,#aaaaah,.aaaaahfchah9hihdc,.aaaaahfhgihaa .ihifbha,.ahdhfihi .ihisd9,.ahdh" - + "fihi .haaagiaa .ihisd9,.ahdhfihighaa,#aaaaa9,.aaaaa9,aha.9ghaids .s7ag,aha.9ghaids .sig,aha.9ghaids .sig ia,.gdagbcf7ahaag,.ihifhbhaafid9,.ihifhbhaafdssfid9,.eagbfihifhaaagiaa .ihifhbhaafid9,.ahdhfaaa" - + "aah {ihgd9gdgca-hbh9a:gga(heghiahfgfd.ec9);ihgd9gdgca-gaeahi:gaeahi-s;}shca9haghaaaaagihdc {ihgd9gdgca-edhhihdc:-ses -ses;7ah97i:9gces;}.asfhahgg7fid9 {ihgd9gdgca-edhhihdc:-ses -9gces;7ah97i:97ses;}#a" - + "aaaa7,.aaaaa7fihifshaafaasi {ihgd9gdgca-edhhihdc:-ses -7aces;7ah97i:gces;}.iddaihg,.iddaihgfid9 {ihgd9gdgca-edhhihdc:-ses -h9aes;7ah97i:gces;}a.aaaaa7fihih,.aaaaa7fbacg .ihifbha,.aaaaa7fihifshaafgh97i" - + " {ihgd9gdgca-edhhihdc:-ses -hages;7ah97i:hhes;}aha.aaaaa7fhgihaa .ihifbha {ihgd9gdgca-edhhihdc:-ses -hdbes;7ah97i:hhes;}.ahdhfaaaaa9 {ihgd9gdgca-edhhihdc:-ses -ghses;7ah97i:h7es;}.gdagbcf7ahaagfadc9 {" - + "ihgd9gdgca-edhhihdc:-ses -ga7es;7ah97i:hses;}.ahdhfeh9ashiaa {ihgd9gdgca-edhhihdc:-ses -gd7es;7ah97i:7des;}.hahgg7fgefgh97ifgdgcag {ihgd9gdgca-edhhihdc:-h9es -99ges;ahai7:9ses;7ah97i:ces;}.hahgg7fid9 " - + "{ihgd9gdgca-hbh9a:gga(hi9aah/haahcgaafehcaafid9.ge9);ihgd9gdgca-gaeahi:gaeahi-s;}.eh9afihiaa,aha.eh9afgdcigdah,aha.sdgbfgdcigdah,aha.9gh-ahhad9 aha.9gh-bdagaa aha.si,aha.gh97ifeh9afgdciaci aha.9gh-bda" - + "gaa aha.7a,aha.ggahiahh7hga9dciaciagah aha.9gh-bdagaa aha.si,aha.cdihs99dciaciagah aha.9gh-bdagaa aha.si,aha.agdesdshh7hga9dciaciagah aha.9gh-bdagaa aha.si,.sdgbfihiaafihg,aha.9gh-ahhad9 aha.9gh-bdaga" - + "a aha.7a,.hcaggaacfihiaashg,.ihiaaf7ahaag,.gh97ifihiaaf7ahaag,.aasifihiaaf7ahaag,.igiidcfid9,.hchgihaa .igiidcfid9 {ihgd9gdgca-hbh9a:gga(ihhaaeghiahfgfd.ec9);ihgd9gdgca-gaeahi:gaeahi-s;}.eh9afihiaa,ah" - + "a.eh9afgdcigdah,aha.sdgbfgdcigdah,aha.9gh-ahhad9 aha.9gh-bdagaa aha.si,aha.gh97ifeh9afgdciaci aha.9gh-bdagaa aha.7a,aha.ggahiahh7hga9dciaciagah aha.9gh-bdagaa aha.si,aha.cdihs99dciaciagah aha.9gh-bdag" - + "aa aha.si,aha.agdesdshh7hga9dciaciagah aha.9gh-bdagaa aha.si {ihgd9gdgca-edhhihdc:-ses -ses;7ah97i:7des;}.sdgbfihiaafihg,aha.9gh-ahhad9 aha.9gh-bdagaa aha.7a,.hcaggaacfihiaashg,.ihiaaf7ahaag,.gh97ifih" - + "iaaf7ahaag,.aasifihiaaf7ahaag {ihgd9gdgca-edhhihdc:-ses -7des;7ah97i:7aes;}.igiidcfid9 {edhhihdc:gaahihaa;bhg9hc-gh97i:7es;ehaahc9-gh97i:9hes;ehaahc9-aasi:9hes;bhg9hc-aasi:7es;a7hia-hehga:cdaghe;ihgd9" - + "gdgca-edhhihdc:-ses -ddes;7ah97i:77es;}.hchgihaa .igiidcfid9 {ihgd9gdgca-edhhihdc:-ses -bbes;7ah97i:77es;}.aashgaifad9d,.hchgihaa .igiidcfaasi,.igiidcfaasi,.igiidcfgh97i,.hchgihaa .igiidcfgh97i,.hgdcf" - + "hcsd,.hgdcfaggdg {ihgd9gdgca-hbh9a:gga(ihhaaeghiahfghgh.ec9);ihgd9gdgca-gaeahi:cd-gaeahi;}.aashgaifad9d {ihgd9gdgca-edhhihdc:-ses -ses;ahai7:c7es;7ah97i:hdes;}.hchgihaa .igiidcfaasi {ihgd9gdgca-edhhih" - + "dc:-c7es -ses;ahai7:9ges;7ah97i:77es;}.igiidcfaasi {edhhihdc:hihdagia;ide:ses;aasi:-7es;ihgd9gdgca-edhhihdc:-daes -ses;ahai7:9hes;7ah97i:77es;}.igiidcfgh97i {edhhihdc:hihdagia;ide:ses;gh97i:-7es;ihgd9" - + "gdgca-edhhihdc:-9sdes -ses;ahai7:9hes;7ah97i:77es;}.hchgihaa .igiidcfgh97i {ihgd9gdgca-edhhihdc:-977es -ses;ahai7:9hes;7ah97i:77es;}.hgdcfhcsd {ihgd9gdgca-edhhihdc:-c7es -77es;ahai7:9ges;7ah97i:9des;}" - + ".hgdcfaggdg {ihgd9gdgca-edhhihdc:-daes -77es;ahai7:9ges;7ah97i:9ges;}"; - - var largeNewValue = largeTest, - len = largeTest.length, - count = nextRandom() % 20, - removeBound = len-(count*100), - logData = []; - for (; count > 0; count--) { - var removePos = nextRandom() % removeBound; - var removeLength = 1+nextRandom()%100; - logData.push("(" + removePos + ", " + removeLength + ")"); - largeNewValue = largeNewValue.substring(0, removePos) - + largeNewValue.substring(removePos + removeLength); - } - log("len: " + len + " count: " + count + " removed ( " + logData.join(", ") + " )"); - - diffResult = diff.diffWords(largeTest, largeNewValue); - log("diffResult length: " + diffResult.length); - var removeCount = 0; - var removeChanges = [], addChanges = [], testChanges = []; - for (var i = 0; i < diffResult.length; i++) { - if (diffResult[i].removed) { - log("remove Change " + i, diffResult[i]); - removeChanges.push(diffResult[i].value); - } else if (diffResult[i].added) { - log("add Change " + i, diffResult[i]); - addChanges.push(diffResult[i].value); - } else { - log("no Change " + i, diffResult[i]); - removeChanges.push(diffResult[i].value); - addChanges.push(diffResult[i].value); - } - } - - log("diffResult remove length: " + removeCount); - assert.equal(largeTest.replace(/s+/g, ""), removeChanges.join("").replace(/s+/g, ""), "New Diff results match"); - assert.equal(largeNewValue.replace(/s+/g, ""), addChanges.join("").replace(/s+/g, ""), "Old Diff results match"); -}; - -exports['Patch'] = function() { - // Create patch - var oldFile = - "value\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "remove value\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "remove value\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "value\n" - + "context\n" - + "context"; - var newFile = - "new value\n" - + "new value 2\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "add value\n" - + "context\n" - + "context\n" - + "context\n" - + "context\n" - + "new value\n" - + "new value 2\n" - + "context\n" - + "context"; - var expectedResult = - "Index: testFileName\n" - + "===================================================================\n" - + "--- testFileName\tOld Header\n" - + "+++ testFileName\tNew Header\n" - + "@@ -1,5 +1,6 @@\n" - + "+new value\n" - + "+new value 2\n" - + "-value\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "@@ -7,9 +8,8 @@\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "-remove value\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "@@ -17,20 +17,21 @@\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "-remove value\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "+add value\n" - + " context\n" - + " context\n" - + " context\n" - + " context\n" - + "+new value\n" - + "+new value 2\n" - + "-value\n" - + " context\n" - + " context\n" - + "\\ No newline at end of file\n"; - - diffResult = diff.createPatch("testFileName", oldFile, newFile, "Old Header", "New Header"); - assert.equal( - expectedResult, - diffResult); - - expectedResult = - "Index: testFileName\n" - + "===================================================================\n" - + "--- testFileName\tOld Header\n" - + "+++ testFileName\tNew Header\n"; - diffResult = diff.createPatch("testFileName", oldFile, oldFile, "Old Header", "New Header"); - assert.equal( - expectedResult, - diffResult, - "Patch same diffResult Value"); -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/.npmignore b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/.npmignore deleted file mode 100644 index 2af4b71..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.*.swp -test/a/ diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/.travis.yml b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/.travis.yml deleted file mode 100644 index baa0031..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/README.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/README.md deleted file mode 100644 index cc69164..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/README.md +++ /dev/null @@ -1,250 +0,0 @@ -# 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/examples/g.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/examples/g.js deleted file mode 100644 index be122df..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/examples/g.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/examples/usr-local.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/examples/usr-local.js deleted file mode 100644 index 327a425..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/examples/usr-local.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/glob.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/glob.js deleted file mode 100644 index f0118a4..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/glob.js +++ /dev/null @@ -1,675 +0,0 @@ -// 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.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) - } - - if (this.mark) { - // at *some* point we statted all of these - all = all.map(function (m) { - var sc = this.cache[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) { - if (!this.stat || this.statCache[m] || m === this.EOF) { - this._emitQueue.push(m) - this._processEmitQueue() - } else { - this._stat(m, function(exists, isDir) { - if (exists) { - 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) - - 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.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) - }) - -} - -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/.npmignore b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/README.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index ca91152..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,442 +0,0 @@ -// 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/package.json deleted file mode 100644 index e044da3..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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" - }, - "_id": "graceful-fs@1.2.3", - "_from": "graceful-fs@~1.2.0" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/open.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d532..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/ulimit.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/ulimit.js deleted file mode 100644 index 8d0882d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/graceful-fs/test/ulimit.js +++ /dev/null @@ -1,158 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/README.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/README.md deleted file mode 100644 index b2beaed..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/inherits.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/inherits.js deleted file mode 100644 index 061b396..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/package.json deleted file mode 100644 index aae88db..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/inherits/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "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" - }, - "_id": "inherits@1.0.0", - "_from": "inherits@1", - "scripts": {} -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/README.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/README.md deleted file mode 100644 index 6fd07d2..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -### 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. **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 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. - - -## 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.) diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/minimatch.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index 405746b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1079 +0,0 @@ -;(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.monkeyPatch = monkeyPatch -function monkeyPatch () { - var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") - var orig = desc.value - desc.value = function (p) { - if (p instanceof Minimatch) return p.match(this) - return orig.call(this, p) - } - Object.defineProperty(String.prototype, desc) -} - -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.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) console.error(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) - }) - - if (options.debug) console.error(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - if (options.debug) console.error(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - if (options.debug) console.error(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) !== "{") { - // console.error(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error(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) { - // console.error("no sets") - return [pattern] - } - - var tail = braceExpand(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) { - // console.error("numset", numset[1], numset[2]) - var suf = braceExpand(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 = "" - } - - // console.error("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error("", 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) { - // console.error("didn't close", pattern) - return braceExpand("\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - // console.error("set", set) - // console.error("suffix", pattern.substr(i)) - var suf = braceExpand(pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - // console.error("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand(p, options) - }) - // console.error("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}(?:$|\\\/))" - : "(?!\\.)" - - 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 - } - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - if (options.debug) { - console.error("%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 "!": - if (options.debug) { - console.error("%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) { - 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. - 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 === "!" ? "(?:(?!" : "(?:" - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - 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 - } - - 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 + "|" - }) - - // console.error("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) { - // console.error("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) - if (options.debug) { - console.error(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 - // console.error(this.pattern, "set", set) - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i] - var hit = this.matchOne(f, 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 - - if (options.debug) { - console.error("matchOne", - { "this": this - , file: file - , pattern: pattern }) - } - - if (options.matchBase && pattern.length === 1) { - file = path.basename(file.join("/")).split("/") - } - - if (options.debug) { - console.error("matchOne", file.length, pattern.length) - } - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - if (options.debug) { - console.error("matchOne loop") - } - var p = pattern[pi] - , f = file[fi] - - if (options.debug) { - console.error(pattern, p, f) - } - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - if (options.debug) - console.error('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) { - if (options.debug) - console.error('** 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] - - if (options.debug) { - console.error('\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)) { - if (options.debug) - console.error('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) === ".")) { - if (options.debug) - console.error("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - if (options.debug) - console.error('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 - // console.error("\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 - } - if (options.debug) { - console.error("string match", p, f, hit) - } - } else { - hit = f.match(p) - if (options.debug) { - console.error("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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/AUTHORS deleted file mode 100644 index 016d7fb..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Carlos Brito Lage -Marko Mikulicic -Trent Mick -Kevin O'Hara -Marco Rogers -Jesse Dailey diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f9..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js deleted file mode 100644 index 9111540..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/bench.js +++ /dev/null @@ -1,25 +0,0 @@ -var LRU = require('lru-cache'); - -var max = +process.argv[2] || 10240; -var more = 102400; - -var cache = LRU({ - max: max, maxAge: 86400e3 -}); - -// fill cache -for (var i = 0; i < max; ++i) { - cache.set(i, {}); -} - -var start = process.hrtime(); - -// adding more items -for ( ; i < max+more; ++i) { - cache.set(i, {}); -} - -var end = process.hrtime(start); -var msecs = end[0] * 1E3 + end[1] / 1E6; - -console.log('adding %d items took %d ms', more, msecs.toPrecision(5)); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 49c1dc6..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,263 +0,0 @@ -;(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) - } - - var max - if (typeof options === 'number') { - max = options - options = { max: max } - } - - if (!options) options = {} - - max = options.max - - var lengthCalculator = options.length || naiveLength - - if (typeof lengthCalculator !== "function") { - lengthCalculator = naiveLength - } - - if (!max || !(typeof max === "number") || max <= 0 ) { - // a little bit silly. maybe this should throw? - max = Infinity - } - - var allowStale = options.stale || false - - var maxAge = options.maxAge || null - - var dispose = options.dispose - - var cache = Object.create(null) // hash of items by key - , lruList = Object.create(null) // list of items in order of use recency - , mru = 0 // most recently used - , lru = 0 // least recently used - , length = 0 // number of items in the list - , itemCount = 0 - - - // resize the cache when the max changes. - Object.defineProperty(this, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - max = mL - // if it gets above double max, trim right away. - // otherwise, do it whenever it's convenient. - if (length > max) trim() - } - , get : function () { return max } - , enumerable : true - }) - - // resize the cache when the lengthCalculator changes. - Object.defineProperty(this, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - lengthCalculator = naiveLength - length = itemCount - for (var key in cache) { - cache[key].length = 1 - } - } else { - lengthCalculator = lC - length = 0 - for (var key in cache) { - cache[key].length = lengthCalculator(cache[key].value) - length += cache[key].length - } - } - - if (length > max) trim() - } - , get : function () { return lengthCalculator } - , enumerable : true - }) - - Object.defineProperty(this, "length", - { get : function () { return length } - , enumerable : true - }) - - - Object.defineProperty(this, "itemCount", - { get : function () { return itemCount } - , enumerable : true - }) - - this.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - i++ - var hit = lruList[k] - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } - } - - this.keys = function () { - var keys = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - keys[i++] = hit.key - } - return keys - } - - this.values = function () { - var values = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - values[i++] = hit.value - } - return values - } - - this.reset = function () { - if (dispose) { - for (var k in cache) { - dispose(k, cache[k].value) - } - } - cache = {} - lruList = {} - lru = 0 - mru = 0 - length = 0 - itemCount = 0 - } - - // Provided for debugging/dev purposes only. No promises whatsoever that - // this API stays stable. - this.dump = function () { - return cache - } - - this.dumpLru = function () { - return lruList - } - - this.set = function (key, value) { - if (hOP(cache, key)) { - // dispose of the old one before overwriting - if (dispose) dispose(key, cache[key].value) - if (maxAge) cache[key].now = Date.now() - cache[key].value = value - this.get(key) - return true - } - - var len = lengthCalculator(value) - var age = maxAge ? Date.now() : 0 - var hit = new Entry(key, value, mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > max) { - if (dispose) dispose(key, value) - return false - } - - length += hit.length - lruList[hit.lu] = cache[key] = hit - itemCount ++ - - if (length > max) trim() - return true - } - - this.has = function (key) { - if (!hOP(cache, key)) return false - var hit = cache[key] - if (maxAge && (Date.now() - hit.now > maxAge)) { - return false - } - return true - } - - this.get = function (key) { - return get(key, true) - } - - this.peek = function (key) { - return get(key, false) - } - - function get (key, doUse) { - var hit = cache[key] - if (hit) { - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } else { - if (doUse) use(hit) - } - if (hit) hit = hit.value - } - return hit - } - - function use (hit) { - shiftLU(hit) - hit.lu = mru ++ - lruList[hit.lu] = hit - } - - this.del = function (key) { - del(cache[key]) - } - - function trim () { - while (lru < mru && length > max) - del(lruList[lru]) - } - - function shiftLU(hit) { - delete lruList[ hit.lu ] - while (lru < mru && !lruList[lru]) lru ++ - } - - function del(hit) { - if (hit) { - if (dispose) dispose(hit.key, hit.value) - length -= hit.length - itemCount -- - delete cache[ hit.key ] - shiftLU(hit) - } - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, mru, len, age) { - this.key = key - this.value = value - this.lu = mru - this.length = len - this.now = age -} - -})() diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 411acad..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.3.1", - "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" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Carlos Brito Lage", - "email": "carlos@carloslage.net" - }, - { - "name": "Marko Mikulicic", - "email": "marko.mikulicic@isti.cnr.it" - }, - { - "name": "Trent Mick", - "email": "trentm@gmail.com" - }, - { - "name": "Kevin O'Hara", - "email": "kevinohara80@gmail.com" - }, - { - "name": "Marco Rogers", - "email": "marco.rogers@gmail.com" - }, - { - "name": "Jesse Dailey", - "email": "jesse.dailey@gmail.com" - } - ], - "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" - }, - "_id": "lru-cache@2.3.1", - "_from": "lru-cache@2" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index 70f3f8b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,329 +0,0 @@ -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() -}) diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b0..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index ec8e2eb..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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" - }, - "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index a347405..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "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.12", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "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!\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### 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. **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 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\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "_id": "minimatch@0.2.12", - "_from": "minimatch@~0.2.11" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/basic.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/brace-expand.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index 7ee278a..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/caching.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/defaults.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 25f1f60..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/package.json deleted file mode 100644 index 4654f76..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "3.2.1", - "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\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" - }, - "_id": "glob@3.2.1", - "dist": { - "shasum": "e3c79e8967e845154f6bca69752a40fb9a447e15" - }, - "_from": "glob@3.2.1", - "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.1.tgz" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/00-setup.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/00-setup.js deleted file mode 100644 index 245afaf..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/00-setup.js +++ /dev/null @@ -1,176 +0,0 @@ -// 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/bash-comparison.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/bash-comparison.js deleted file mode 100644 index 239ed1a..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/bash-comparison.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/bash-results.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/bash-results.json deleted file mode 100644 index a9bc347..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,350 +0,0 @@ -{ - "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/globstar-match.js", - "./test/mark.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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/cwd-test.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/cwd-test.js deleted file mode 100644 index 352c27e..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/cwd-test.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/globstar-match.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/globstar-match.js deleted file mode 100644 index 9b234fa..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/globstar-match.js +++ /dev/null @@ -1,19 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/mark.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/mark.js deleted file mode 100644 index ed68a33..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/mark.js +++ /dev/null @@ -1,74 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/nocase-nomagic.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/nocase-nomagic.js deleted file mode 100644 index d862970..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/nocase-nomagic.js +++ /dev/null @@ -1,113 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/pause-resume.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/pause-resume.js deleted file mode 100644 index e1ffbab..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/root-nomount.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/root-nomount.js deleted file mode 100644 index 3ac5979..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/root-nomount.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/root.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/root.js deleted file mode 100644 index 95c23f9..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/root.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/stat.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/stat.js deleted file mode 100644 index 6291711..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/stat.js +++ /dev/null @@ -1,32 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/zz-cleanup.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/zz-cleanup.js deleted file mode 100644 index e085f0f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/glob/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -// 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/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/History.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/History.md deleted file mode 100644 index a4b7b49..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/History.md +++ /dev/null @@ -1,63 +0,0 @@ - -1.7.0 / 2012-12-30 -================== - - * support transient notifications in Gnome - -1.6.1 / 2012-09-25 -================== - - * restore compatibility with node < 0.8 [fgnass] - -1.6.0 / 2012-09-06 -================== - - * add notification center support [drudge] - -1.5.1 / 2012-04-08 -================== - - * Merge pull request #16 from KyleAMathews/patch-1 - * Fixes #15 - -1.5.0 / 2012-02-08 -================== - - * Added windows support [perfusorius] - -1.4.1 / 2011-12-28 -================== - - * Fixed: dont exit(). Closes #9 - -1.4.0 / 2011-12-17 -================== - - * Changed API: `growl.notify()` -> `growl()` - -1.3.0 / 2011-12-17 -================== - - * Added support for Ubuntu/Debian/Linux users [niftylettuce] - * Fixed: send notifications even if title not specified [alessioalex] - -1.2.0 / 2011-10-06 -================== - - * Add support for priority. - -1.1.0 / 2011-03-15 -================== - - * Added optional callbacks - * Added parsing of version - -1.0.1 / 2010-03-26 -================== - - * Fixed; sys.exec -> child_process.exec to support latest node - -1.0.0 / 2010-03-19 -================== - - * Initial release diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/Readme.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/Readme.md deleted file mode 100644 index 48d717c..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/Readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# Growl for nodejs - -Growl support for Nodejs. This is essentially a port of my [Ruby Growl Library](http://github.com/visionmedia/growl). Ubuntu/Linux support added thanks to [@niftylettuce](http://github.com/niftylettuce). - -## Installation - -### Install - -### Mac OS X (Darwin): - - Install [growlnotify(1)](http://growl.info/extras.php#growlnotify). On OS X 10.8, Notification Center is supported using [terminal-notifier](https://github.com/alloy/terminal-notifier). To install: - - $ sudo gem install terminal-notifier - - Install [npm](http://npmjs.org/) and run: - - $ npm install growl - -### Ubuntu (Linux): - - Install `notify-send` through the [libnotify-bin](http://packages.ubuntu.com/libnotify-bin) package: - - $ sudo apt-get install libnotify-bin - - Install [npm](http://npmjs.org/) and run: - - $ npm install growl - -### Windows: - - Download and install [Growl for Windows](http://www.growlforwindows.com/gfw/default.aspx) - - Download [growlnotify](http://www.growlforwindows.com/gfw/help/growlnotify.aspx) - **IMPORTANT :** Unpack growlnotify to a folder that is present in your path! - - Install [npm](http://npmjs.org/) and run: - - $ npm install growl - -## Examples - -Callback functions are optional - - var growl = require('growl') - growl('You have mail!') - growl('5 new messages', { sticky: true }) - growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true }) - growl('Message with title', { title: 'Title'}) - growl('Set priority', { priority: 2 }) - growl('Show Safari icon', { image: 'Safari' }) - growl('Show icon', { image: 'path/to/icon.icns' }) - growl('Show image', { image: 'path/to/my.image.png' }) - growl('Show png filesystem icon', { image: 'png' }) - growl('Show pdf filesystem icon', { image: 'article.pdf' }) - growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(err){ - // ... notified - }) - -## Options - - - title - - notification title - - name - - application name - - priority - - priority for the notification (default is 0) - - sticky - - weither or not the notification should remainin until closed - - image - - Auto-detects the context: - - path to an icon sets --iconpath - - path to an image sets --image - - capitalized word sets --appIcon - - filename uses extname as --icon - - otherwise treated as --icon - -## License - -(The MIT License) - -Copyright (c) 2009 TJ Holowaychuk - -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/lib/growl.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/lib/growl.js deleted file mode 100644 index 04f4f9b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/lib/growl.js +++ /dev/null @@ -1,234 +0,0 @@ -// Growl - Copyright TJ Holowaychuk (MIT Licensed) - -/** - * Module dependencies. - */ - -var exec = require('child_process').exec - , fs = require('fs') - , path = require('path') - , exists = fs.existsSync || path.existsSync - , os = require('os') - , quote = JSON.stringify - , cmd; - -function which(name) { - var paths = process.env.PATH.split(':'); - var loc; - - for (var i = 0, len = paths.length; i < len; ++i) { - loc = path.join(paths[i], name); - if (exists(loc)) return loc; - } -} - -switch(os.type()) { - case 'Darwin': - if (which('terminal-notifier')) { - cmd = { - type: "Darwin-NotificationCenter" - , pkg: "terminal-notifier" - , msg: '-message' - , title: '-title' - , subtitle: '-subtitle' - , priority: { - cmd: '-execute' - , range: [] - } - }; - } else { - cmd = { - type: "Darwin-Growl" - , pkg: "growlnotify" - , msg: '-m' - , sticky: '--sticky' - , priority: { - cmd: '--priority' - , range: [ - -2 - , -1 - , 0 - , 1 - , 2 - , "Very Low" - , "Moderate" - , "Normal" - , "High" - , "Emergency" - ] - } - }; - } - break; - case 'Linux': - cmd = { - type: "Linux" - , pkg: "notify-send" - , msg: '' - , sticky: '-t 0' - , icon: '-i' - , priority: { - cmd: '-u' - , range: [ - "low" - , "normal" - , "critical" - ] - } - }; - break; - case 'Windows_NT': - cmd = { - type: "Windows" - , pkg: "growlnotify" - , msg: '' - , sticky: '/s:true' - , title: '/t:' - , icon: '/i:' - , priority: { - cmd: '/p:' - , range: [ - -2 - , -1 - , 0 - , 1 - , 2 - ] - } - }; - break; -} - -/** - * Expose `growl`. - */ - -exports = module.exports = growl; - -/** - * Node-growl version. - */ - -exports.version = '1.4.1' - -/** - * Send growl notification _msg_ with _options_. - * - * Options: - * - * - title Notification title - * - sticky Make the notification stick (defaults to false) - * - priority Specify an int or named key (default is 0) - * - name Application name (defaults to growlnotify) - * - image - * - path to an icon sets --iconpath - * - path to an image sets --image - * - capitalized word sets --appIcon - * - filename uses extname as --icon - * - otherwise treated as --icon - * - * Examples: - * - * growl('New email') - * growl('5 new emails', { title: 'Thunderbird' }) - * growl('Email sent', function(){ - * // ... notification sent - * }) - * - * @param {string} msg - * @param {object} options - * @param {function} fn - * @api public - */ - -function growl(msg, options, fn) { - var image - , args - , options = options || {} - , fn = fn || function(){}; - - // noop - if (!cmd) return fn(new Error('growl not supported on this platform')); - args = [cmd.pkg]; - - // image - if (image = options.image) { - switch(cmd.type) { - case 'Darwin-Growl': - var flag, ext = path.extname(image).substr(1) - flag = flag || ext == 'icns' && 'iconpath' - flag = flag || /^[A-Z]/.test(image) && 'appIcon' - flag = flag || /^png|gif|jpe?g$/.test(ext) && 'image' - flag = flag || ext && (image = ext) && 'icon' - flag = flag || 'icon' - args.push('--' + flag, image) - break; - case 'Linux': - args.push(cmd.icon + " " + image); - // libnotify defaults to sticky, set a hint for transient notifications - if (!options.sticky) args.push('--hint=int:transient:1'); - break; - case 'Windows': - args.push(cmd.icon + quote(image)); - break; - } - } - - // sticky - if (options.sticky) args.push(cmd.sticky); - - // priority - if (options.priority) { - var priority = options.priority + ''; - var checkindexOf = cmd.priority.range.indexOf(priority); - if (~cmd.priority.range.indexOf(priority)) { - args.push(cmd.priority, options.priority); - } - } - - // name - if (options.name && cmd.type === "Darwin-Growl") { - args.push('--name', options.name); - } - - switch(cmd.type) { - case 'Darwin-Growl': - args.push(cmd.msg); - args.push(quote(msg)); - if (options.title) args.push(quote(options.title)); - break; - case 'Darwin-NotificationCenter': - args.push(cmd.msg); - args.push(quote(msg)); - if (options.title) { - args.push(cmd.title); - args.push(quote(options.title)); - } - if (options.subtitle) { - args.push(cmd.subtitle); - args.push(quote(options.title)); - } - break; - case 'Darwin-Growl': - args.push(cmd.msg); - args.push(quote(msg)); - if (options.title) args.push(quote(options.title)); - break; - case 'Linux': - if (options.title) { - args.push(quote(options.title)); - args.push(cmd.msg); - args.push(quote(msg)); - } else { - args.push(quote(msg)); - } - break; - case 'Windows': - args.push(quote(msg)); - if (options.title) args.push(cmd.title + quote(options.title)); - break; - } - - // execute - exec(args.join(' '), fn); -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/package.json deleted file mode 100644 index 6565e46..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "growl", - "version": "1.7.0", - "description": "Growl unobtrusive notifications", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "main": "./lib/growl.js", - "readme": "# Growl for nodejs\n\nGrowl support for Nodejs. This is essentially a port of my [Ruby Growl Library](http://github.com/visionmedia/growl). Ubuntu/Linux support added thanks to [@niftylettuce](http://github.com/niftylettuce). \n\n## Installation\n\n### Install \n\n### Mac OS X (Darwin):\n\n Install [growlnotify(1)](http://growl.info/extras.php#growlnotify). On OS X 10.8, Notification Center is supported using [terminal-notifier](https://github.com/alloy/terminal-notifier). To install:\n \n $ sudo gem install terminal-notifier\n \n Install [npm](http://npmjs.org/) and run:\n \n $ npm install growl\n\n### Ubuntu (Linux):\n\n Install `notify-send` through the [libnotify-bin](http://packages.ubuntu.com/libnotify-bin) package:\n\n $ sudo apt-get install libnotify-bin\n\n Install [npm](http://npmjs.org/) and run:\n \n $ npm install growl\n\n### Windows:\n\n Download and install [Growl for Windows](http://www.growlforwindows.com/gfw/default.aspx)\n\n Download [growlnotify](http://www.growlforwindows.com/gfw/help/growlnotify.aspx) - **IMPORTANT :** Unpack growlnotify to a folder that is present in your path!\n\n Install [npm](http://npmjs.org/) and run:\n \n $ npm install growl\n\n## Examples\n\nCallback functions are optional\n\n var growl = require('growl')\n growl('You have mail!')\n growl('5 new messages', { sticky: true })\n growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })\n growl('Message with title', { title: 'Title'})\n growl('Set priority', { priority: 2 })\n growl('Show Safari icon', { image: 'Safari' })\n growl('Show icon', { image: 'path/to/icon.icns' })\n growl('Show image', { image: 'path/to/my.image.png' })\n growl('Show png filesystem icon', { image: 'png' })\n growl('Show pdf filesystem icon', { image: 'article.pdf' })\n growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(err){\n // ... notified\n })\n\n## Options\n\n - title\n - notification title\n - name\n - application name\n - priority\n - priority for the notification (default is 0)\n - sticky\n - weither or not the notification should remainin until closed\n - image\n - Auto-detects the context:\n - path to an icon sets --iconpath\n - path to an image sets --image\n - capitalized word sets --appIcon\n - filename uses extname as --icon\n - otherwise treated as --icon\n \n## License \n\n(The MIT License)\n\nCopyright (c) 2009 TJ Holowaychuk \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.\n", - "readmeFilename": "Readme.md", - "_id": "growl@1.7.0", - "_from": "growl@1.7.x" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/test.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/test.js deleted file mode 100644 index cf22d90..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/growl/test.js +++ /dev/null @@ -1,20 +0,0 @@ - -var growl = require('./lib/growl') - -growl('You have mail!') -growl('5 new messages', { sticky: true }) -growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true }) -growl('Message with title', { title: 'Title'}) -growl('Set priority', { priority: 2 }) -growl('Show Safari icon', { image: 'Safari' }) -growl('Show icon', { image: 'path/to/icon.icns' }) -growl('Show image', { image: 'path/to/my.image.png' }) -growl('Show png filesystem icon', { image: 'png' }) -growl('Show pdf filesystem icon', { image: 'article.pdf' }) -growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(){ - console.log('callback'); -}) -growl('Show pdf filesystem icon', { title: 'Use show()', image: 'article.pdf' }) -growl('here \' are \n some \\ characters that " need escaping', {}, function(error, stdout, stderr) { - if (error !== null) throw new Error('escaping failed:\n' + stdout + stderr); -}) diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/.npmignore b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/.npmignore deleted file mode 100644 index b9af3d4..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -test -support -benchmarks -examples -lib-cov -coverage.html -.gitmodules -.travis.yml -History.md -Readme.md -Makefile -test/ -support/ -benchmarks/ -examples/ diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/LICENSE deleted file mode 100644 index 8ad0e0d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2009-2010 TJ Holowaychuk - -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/bin/jade b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/bin/jade deleted file mode 100755 index 7e6002f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/bin/jade +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var fs = require('fs') - , program = require('commander') - , path = require('path') - , basename = path.basename - , dirname = path.dirname - , resolve = path.resolve - , join = path.join - , mkdirp = require('mkdirp') - , jade = require('../'); - -// jade options - -var options = {}; - -// options - -program - .version(jade.version) - .usage('[options] [dir|file ...]') - .option('-o, --obj ', 'javascript options object') - .option('-O, --out ', 'output the compiled html to ') - .option('-p, --path ', 'filename used to resolve includes') - .option('-P, --pretty', 'compile pretty html output') - .option('-c, --client', 'compile for client-side runtime.js') - .option('-D, --no-debug', 'compile without debugging (smaller functions)') - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' # translate jade the templates dir'); - console.log(' $ jade templates'); - console.log(''); - console.log(' # create {foo,bar}.html'); - console.log(' $ jade {foo,bar}.jade'); - console.log(''); - console.log(' # jade over stdio'); - console.log(' $ jade < my.jade > my.html'); - console.log(''); - console.log(' # jade over stdio'); - console.log(' $ echo "h1 Jade!" | jade'); - console.log(''); - console.log(' # foo, bar dirs rendering to /tmp'); - console.log(' $ jade foo bar --out /tmp '); - console.log(''); -}); - -program.parse(process.argv); - -// options given, parse them - -if (program.obj) options = eval('(' + program.obj + ')'); - -// --filename - -if (program.path) options.filename = program.path; - -// --no-debug - -options.compileDebug = program.debug; - -// --client - -options.client = program.client; - -// --pretty - -options.pretty = program.pretty; - -// left-over args are file paths - -var files = program.args; - -// compile files - -if (files.length) { - console.log(); - files.forEach(renderFile); - process.on('exit', console.log); -// stdio -} else { - stdin(); -} - -/** - * Compile from stdin. - */ - -function stdin() { - var buf = ''; - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(chunk){ buf += chunk; }); - process.stdin.on('end', function(){ - var fn = jade.compile(buf, options); - var output = options.client - ? fn.toString() - : fn(options); - process.stdout.write(output); - }).resume(); -} - -/** - * Process the given path, compiling the jade files found. - * Always walk the subdirectories. - */ - -function renderFile(path) { - var re = /\.jade$/; - fs.lstat(path, function(err, stat) { - if (err) throw err; - // Found jade file - if (stat.isFile() && re.test(path)) { - fs.readFile(path, 'utf8', function(err, str){ - if (err) throw err; - options.filename = path; - var fn = jade.compile(str, options); - var extname = options.client ? '.js' : '.html'; - path = path.replace(re, extname); - if (program.out) path = join(program.out, basename(path)); - var dir = resolve(dirname(path)); - mkdirp(dir, 0755, function(err){ - if (err) throw err; - var output = options.client - ? fn.toString() - : fn(options); - fs.writeFile(path, output, function(err){ - if (err) throw err; - console.log(' \033[90mrendered \033[36m%s\033[0m', path); - }); - }); - }); - // Found directory - } else if (stat.isDirectory()) { - fs.readdir(path, function(err, files) { - if (err) throw err; - files.map(function(filename) { - return path + '/' + filename; - }).forEach(renderFile); - }); - } - }); -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/index.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/index.js deleted file mode 100644 index 8ad059f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = process.env.JADE_COV - ? require('./lib-cov/jade') - : require('./lib/jade'); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.js deleted file mode 100644 index 1983a20..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.js +++ /dev/null @@ -1,3586 +0,0 @@ -(function() { - -// CommonJS require() - -function require(p){ - var path = require.resolve(p) - , mod = require.modules[path]; - if (!mod) throw new Error('failed to require "' + p + '"'); - if (!mod.exports) { - mod.exports = {}; - mod.call(mod.exports, mod, mod.exports, require.relative(path)); - } - return mod.exports; - } - -require.modules = {}; - -require.resolve = function (path){ - var orig = path - , reg = path + '.js' - , index = path + '/index.js'; - return require.modules[reg] && reg - || require.modules[index] && index - || orig; - }; - -require.register = function (path, fn){ - require.modules[path] = fn; - }; - -require.relative = function (parent) { - return function(p){ - if ('.' != p.charAt(0)) return require(p); - - var path = parent.split('/') - , segs = p.split('/'); - path.pop(); - - for (var i = 0; i < segs.length; i++) { - var seg = segs[i]; - if ('..' == seg) path.pop(); - else if ('.' != seg) path.push(seg); - } - - return require(path.join('/')); - }; - }; - - -require.register("compiler.js", function(module, exports, require){ - -/*! - * Jade - Compiler - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var nodes = require('./nodes') - , filters = require('./filters') - , doctypes = require('./doctypes') - , selfClosing = require('./self-closing') - , runtime = require('./runtime') - , utils = require('./utils'); - - - if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } - } - - if (!String.prototype.trimLeft) { - String.prototype.trimLeft = function(){ - return this.replace(/^\s+/, ''); - } - } - - - -/** - * Initialize `Compiler` with the given `node`. - * - * @param {Node} node - * @param {Object} options - * @api public - */ - -var Compiler = module.exports = function Compiler(node, options) { - this.options = options = options || {}; - this.node = node; - this.hasCompiledDoctype = false; - this.hasCompiledTag = false; - this.pp = options.pretty || false; - this.debug = false !== options.compileDebug; - this.indents = 0; - this.parentIndents = 0; - if (options.doctype) this.setDoctype(options.doctype); -}; - -/** - * Compiler prototype. - */ - -Compiler.prototype = { - - /** - * Compile parse tree to JavaScript. - * - * @api public - */ - - compile: function(){ - this.buf = ['var interp;']; - if (this.pp) this.buf.push("var __indent = [];"); - this.lastBufferedIdx = -1; - this.visit(this.node); - return this.buf.join('\n'); - }, - - /** - * Sets the default doctype `name`. Sets terse mode to `true` when - * html 5 is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {string} name - * @api public - */ - - setDoctype: function(name){ - var doctype = doctypes[(name || 'default').toLowerCase()]; - doctype = doctype || ''; - this.doctype = doctype; - this.terse = '5' == name || 'html' == name; - this.xml = 0 == this.doctype.indexOf(' 1 && !escape && block.nodes[0].isText && block.nodes[1].isText) - this.prettyIndent(1, true); - - for (var i = 0; i < len; ++i) { - // Pretty print text - if (pp && i > 0 && !escape && block.nodes[i].isText && block.nodes[i-1].isText) - this.prettyIndent(1, false); - - this.visit(block.nodes[i]); - // Multiple text nodes are separated by newlines - if (block.nodes[i+1] && block.nodes[i].isText && block.nodes[i+1].isText) - this.buffer('\\n'); - } - }, - - /** - * Visit `doctype`. Sets terse mode to `true` when html 5 - * is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {Doctype} doctype - * @api public - */ - - visitDoctype: function(doctype){ - if (doctype && (doctype.val || !this.doctype)) { - this.setDoctype(doctype.val || 'default'); - } - - if (this.doctype) this.buffer(this.doctype); - this.hasCompiledDoctype = true; - }, - - /** - * Visit `mixin`, generating a function that - * may be called within the template. - * - * @param {Mixin} mixin - * @api public - */ - - visitMixin: function(mixin){ - var name = mixin.name.replace(/-/g, '_') + '_mixin' - , args = mixin.args || '' - , block = mixin.block - , attrs = mixin.attrs - , pp = this.pp; - - if (mixin.call) { - if (pp) this.buf.push("__indent.push('" + Array(this.indents + 1).join(' ') + "');") - if (block || attrs.length) { - - this.buf.push(name + '.call({'); - - if (block) { - this.buf.push('block: function(){'); - - // Render block with no indents, dynamically added when rendered - this.parentIndents++; - var _indents = this.indents; - this.indents = 0; - this.visit(mixin.block); - this.indents = _indents; - this.parentIndents--; - - if (attrs.length) { - this.buf.push('},'); - } else { - this.buf.push('}'); - } - } - - if (attrs.length) { - var val = this.attrs(attrs); - if (val.inherits) { - this.buf.push('attributes: merge({' + val.buf - + '}, attributes), escaped: merge(' + val.escaped + ', escaped, true)'); - } else { - this.buf.push('attributes: {' + val.buf + '}, escaped: ' + val.escaped); - } - } - - if (args) { - this.buf.push('}, ' + args + ');'); - } else { - this.buf.push('});'); - } - - } else { - this.buf.push(name + '(' + args + ');'); - } - if (pp) this.buf.push("__indent.pop();") - } else { - this.buf.push('var ' + name + ' = function(' + args + '){'); - this.buf.push('var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};'); - this.parentIndents++; - this.visit(block); - this.parentIndents--; - this.buf.push('};'); - } - }, - - /** - * Visit `tag` buffering tag markup, generating - * attributes, visiting the `tag`'s code and block. - * - * @param {Tag} tag - * @api public - */ - - visitTag: function(tag){ - this.indents++; - var name = tag.name - , pp = this.pp; - - if (tag.buffer) name = "' + (" + name + ") + '"; - - if (!this.hasCompiledTag) { - if (!this.hasCompiledDoctype && 'html' == name) { - this.visitDoctype(); - } - this.hasCompiledTag = true; - } - - // pretty print - if (pp && !tag.isInline()) - this.prettyIndent(0, true); - - if ((~selfClosing.indexOf(name) || tag.selfClosing) && !this.xml) { - this.buffer('<' + name); - this.visitAttributes(tag.attrs); - this.terse - ? this.buffer('>') - : this.buffer('/>'); - } else { - // Optimize attributes buffering - if (tag.attrs.length) { - this.buffer('<' + name); - if (tag.attrs.length) this.visitAttributes(tag.attrs); - this.buffer('>'); - } else { - this.buffer('<' + name + '>'); - } - if (tag.code) this.visitCode(tag.code); - this.escape = 'pre' == tag.name; - this.visit(tag.block); - - // pretty print - if (pp && !tag.isInline() && 'pre' != tag.name && !tag.canInline()) - this.prettyIndent(0, true); - - this.buffer(''); - } - this.indents--; - }, - - /** - * Visit `filter`, throwing when the filter does not exist. - * - * @param {Filter} filter - * @api public - */ - - visitFilter: function(filter){ - var fn = filters[filter.name]; - - // unknown filter - if (!fn) { - if (filter.isASTFilter) { - throw new Error('unknown ast filter "' + filter.name + ':"'); - } else { - throw new Error('unknown filter ":' + filter.name + '"'); - } - } - - if (filter.isASTFilter) { - this.buf.push(fn(filter.block, this, filter.attrs)); - } else { - var text = filter.block.nodes.map(function(node){ return node.val }).join('\n'); - filter.attrs = filter.attrs || {}; - filter.attrs.filename = this.options.filename; - this.buffer(utils.text(fn(text, filter.attrs))); - } - }, - - /** - * Visit `text` node. - * - * @param {Text} text - * @api public - */ - - visitText: function(text){ - text = utils.text(text.val.replace(/\\/g, '\\\\')); - if (this.escape) text = escape(text); - this.buffer(text); - }, - - /** - * Visit a `comment`, only buffering when the buffer flag is set. - * - * @param {Comment} comment - * @api public - */ - - visitComment: function(comment){ - if (!comment.buffer) return; - if (this.pp) this.prettyIndent(1, true); - this.buffer(''); - }, - - /** - * Visit a `BlockComment`. - * - * @param {Comment} comment - * @api public - */ - - visitBlockComment: function(comment){ - if (!comment.buffer) return; - if (0 == comment.val.trim().indexOf('if')) { - this.buffer(''); - } else { - this.buffer(''); - } - }, - - /** - * Visit `code`, respecting buffer / escape flags. - * If the code is followed by a block, wrap it in - * a self-calling function. - * - * @param {Code} code - * @api public - */ - - visitCode: function(code){ - // Wrap code blocks with {}. - // we only wrap unbuffered code blocks ATM - // since they are usually flow control - - // Buffer code - if (code.buffer) { - var val = code.val.trimLeft(); - this.buf.push('var __val__ = ' + val); - val = 'null == __val__ ? "" : __val__'; - if (code.escape) val = 'escape(' + val + ')'; - this.buf.push("buf.push(" + val + ");"); - } else { - this.buf.push(code.val); - } - - // Block support - if (code.block) { - if (!code.buffer) this.buf.push('{'); - this.visit(code.block); - if (!code.buffer) this.buf.push('}'); - } - }, - - /** - * Visit `each` block. - * - * @param {Each} each - * @api public - */ - - visitEach: function(each){ - this.buf.push('' - + '// iterate ' + each.obj + '\n' - + ';(function(){\n' - + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' - + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push('' - + ' }\n' - + ' } else {\n' - + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' - + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push(' }\n'); - - this.buf.push(' }\n }\n}).call(this);\n'); - }, - - /** - * Visit `attrs`. - * - * @param {Array} attrs - * @api public - */ - - visitAttributes: function(attrs){ - var val = this.attrs(attrs); - if (val.inherits) { - this.buf.push("buf.push(attrs(merge({ " + val.buf + - " }, attributes), merge(" + val.escaped + ", escaped, true)));"); - } else if (val.constant) { - eval('var buf={' + val.buf + '};'); - this.buffer(runtime.attrs(buf, JSON.parse(val.escaped)), true); - } else { - this.buf.push("buf.push(attrs({ " + val.buf + " }, " + val.escaped + "));"); - } - }, - - /** - * Compile attributes. - */ - - attrs: function(attrs){ - var buf = [] - , classes = [] - , escaped = {} - , constant = attrs.every(function(attr){ return isConstant(attr.val) }) - , inherits = false; - - if (this.terse) buf.push('terse: true'); - - attrs.forEach(function(attr){ - if (attr.name == 'attributes') return inherits = true; - escaped[attr.name] = attr.escaped; - if (attr.name == 'class') { - classes.push('(' + attr.val + ')'); - } else { - var pair = "'" + attr.name + "':(" + attr.val + ')'; - buf.push(pair); - } - }); - - if (classes.length) { - classes = classes.join(" + ' ' + "); - buf.push("class: " + classes); - } - - return { - buf: buf.join(', ').replace('class:', '"class":'), - escaped: JSON.stringify(escaped), - inherits: inherits, - constant: constant - }; - } -}; - -/** - * Check if expression can be evaluated to a constant - * - * @param {String} expression - * @return {Boolean} - * @api private - */ - -function isConstant(val){ - // Check strings/literals - if (/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val)) - return true; - - // Check numbers - if (!isNaN(Number(val))) - return true; - - // Check arrays - var matches; - if (matches = /^ *\[(.*)\] *$/.exec(val)) - return matches[1].split(',').every(isConstant); - - return false; -} - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} -}); // module: compiler.js - -require.register("doctypes.js", function(module, exports, require){ - -/*! - * Jade - doctypes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - '5': '' - , 'default': '' - , 'xml': '' - , 'transitional': '' - , 'strict': '' - , 'frameset': '' - , '1.1': '' - , 'basic': '' - , 'mobile': '' -}; -}); // module: doctypes.js - -require.register("filters.js", function(module, exports, require){ - -/*! - * Jade - filters - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - - /** - * Wrap text with CDATA block. - */ - - cdata: function(str){ - return ''; - }, - - /** - * Transform sass to css, wrapped in style tags. - */ - - sass: function(str){ - str = str.replace(/\\n/g, '\n'); - var sass = require('sass').render(str).replace(/\n/g, '\\n'); - return ''; - }, - - /** - * Transform stylus to css, wrapped in style tags. - */ - - stylus: function(str, options){ - var ret; - str = str.replace(/\\n/g, '\n'); - var stylus = require('stylus'); - stylus(str, options).render(function(err, css){ - if (err) throw err; - ret = css.replace(/\n/g, '\\n'); - }); - return ''; - }, - - /** - * Transform less to css, wrapped in style tags. - */ - - less: function(str){ - var ret; - str = str.replace(/\\n/g, '\n'); - require('less').render(str, function(err, css){ - if (err) throw err; - ret = ''; - }); - return ret; - }, - - /** - * Transform markdown to html. - */ - - markdown: function(str){ - var md; - - // support markdown / discount - try { - md = require('markdown'); - } catch (err){ - try { - md = require('discount'); - } catch (err) { - try { - md = require('markdown-js'); - } catch (err) { - try { - md = require('marked'); - } catch (err) { - throw new - Error('Cannot find markdown library, install markdown, discount, or marked.'); - } - } - } - } - - str = str.replace(/\\n/g, '\n'); - return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); - }, - - /** - * Transform coffeescript to javascript. - */ - - coffeescript: function(str){ - str = str.replace(/\\n/g, '\n'); - var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n'); - return ''; - } -}; - -}); // module: filters.js - -require.register("inline-tags.js", function(module, exports, require){ - -/*! - * Jade - inline tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'a' - , 'abbr' - , 'acronym' - , 'b' - , 'br' - , 'code' - , 'em' - , 'font' - , 'i' - , 'img' - , 'ins' - , 'kbd' - , 'map' - , 'samp' - , 'small' - , 'span' - , 'strong' - , 'sub' - , 'sup' -]; -}); // module: inline-tags.js - -require.register("jade.js", function(module, exports, require){ -/*! - * Jade - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Parser = require('./parser') - , Lexer = require('./lexer') - , Compiler = require('./compiler') - , runtime = require('./runtime') - -/** - * Library version. - */ - -exports.version = '0.26.1'; - -/** - * Expose self closing tags. - */ - -exports.selfClosing = require('./self-closing'); - -/** - * Default supported doctypes. - */ - -exports.doctypes = require('./doctypes'); - -/** - * Text filters. - */ - -exports.filters = require('./filters'); - -/** - * Utilities. - */ - -exports.utils = require('./utils'); - -/** - * Expose `Compiler`. - */ - -exports.Compiler = Compiler; - -/** - * Expose `Parser`. - */ - -exports.Parser = Parser; - -/** - * Expose `Lexer`. - */ - -exports.Lexer = Lexer; - -/** - * Nodes. - */ - -exports.nodes = require('./nodes'); - -/** - * Jade runtime helpers. - */ - -exports.runtime = runtime; - -/** - * Template function cache. - */ - -exports.cache = {}; - -/** - * Parse the given `str` of jade and return a function body. - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api private - */ - -function parse(str, options){ - try { - // Parse - var parser = new Parser(str, options.filename, options); - - // Compile - var compiler = new (options.compiler || Compiler)(parser.parse(), options) - , js = compiler.compile(); - - // Debug compiler - if (options.debug) { - console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); - } - - return '' - + 'var buf = [];\n' - + (options.self - ? 'var self = locals || {};\n' + js - : 'with (locals || {}) {\n' + js + '\n}\n') - + 'return buf.join("");'; - } catch (err) { - parser = parser.context(); - runtime.rethrow(err, parser.filename, parser.lexer.lineno); - } -} - -/** - * Compile a `Function` representation of the given jade `str`. - * - * Options: - * - * - `compileDebug` when `false` debugging code is stripped from the compiled template - * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` - * for use with the Jade client-side runtime.js - * - * @param {String} str - * @param {Options} options - * @return {Function} - * @api public - */ - -exports.compile = function(str, options){ - var options = options || {} - , client = options.client - , filename = options.filename - ? JSON.stringify(options.filename) - : 'undefined' - , fn; - - if (options.compileDebug !== false) { - fn = [ - 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' - , 'try {' - , parse(String(str), options) - , '} catch (err) {' - , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' - , '}' - ].join('\n'); - } else { - fn = parse(String(str), options); - } - - if (client) { - fn = 'attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n' + fn; - } - - fn = new Function('locals, attrs, escape, rethrow, merge', fn); - - if (client) return fn; - - return function(locals){ - return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow, runtime.merge); - }; -}; - -/** - * Render the given `str` of jade and invoke - * the callback `fn(err, str)`. - * - * Options: - * - * - `cache` enable template caching - * - `filename` filename required for `include` / `extends` and caching - * - * @param {String} str - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -exports.render = function(str, options, fn){ - // swap args - if ('function' == typeof options) { - fn = options, options = {}; - } - - // cache requires .filename - if (options.cache && !options.filename) { - return fn(new Error('the "filename" option is required for caching')); - } - - try { - var path = options.filename; - var tmpl = options.cache - ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) - : exports.compile(str, options); - fn(null, tmpl(options)); - } catch (err) { - fn(err); - } -}; - -/** - * Render a Jade file at the given `path` and callback `fn(err, str)`. - * - * @param {String} path - * @param {Object|Function} options or callback - * @param {Function} fn - * @api public - */ - -exports.renderFile = function(path, options, fn){ - var key = path + ':string'; - - if ('function' == typeof options) { - fn = options, options = {}; - } - - try { - options.filename = path; - var str = options.cache - ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) - : fs.readFileSync(path, 'utf8'); - exports.render(str, options, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Express support. - */ - -exports.__express = exports.renderFile; - -}); // module: jade.js - -require.register("lexer.js", function(module, exports, require){ - -/*! - * Jade - Lexer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize `Lexer` with the given `str`. - * - * Options: - * - * - `colons` allow colons for attr delimiters - * - * @param {String} str - * @param {Object} options - * @api private - */ - -var Lexer = module.exports = function Lexer(str, options) { - options = options || {}; - this.input = str.replace(/\r\n|\r/g, '\n'); - this.colons = options.colons; - this.deferredTokens = []; - this.lastIndents = 0; - this.lineno = 1; - this.stash = []; - this.indentStack = []; - this.indentRe = null; - this.pipeless = false; -}; - -/** - * Lexer prototype. - */ - -Lexer.prototype = { - - /** - * Construct a token with the given `type` and `val`. - * - * @param {String} type - * @param {String} val - * @return {Object} - * @api private - */ - - tok: function(type, val){ - return { - type: type - , line: this.lineno - , val: val - } - }, - - /** - * Consume the given `len` of input. - * - * @param {Number} len - * @api private - */ - - consume: function(len){ - this.input = this.input.substr(len); - }, - - /** - * Scan for `type` with the given `regexp`. - * - * @param {String} type - * @param {RegExp} regexp - * @return {Object} - * @api private - */ - - scan: function(regexp, type){ - var captures; - if (captures = regexp.exec(this.input)) { - this.consume(captures[0].length); - return this.tok(type, captures[1]); - } - }, - - /** - * Defer the given `tok`. - * - * @param {Object} tok - * @api private - */ - - defer: function(tok){ - this.deferredTokens.push(tok); - }, - - /** - * Lookahead `n` tokens. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - var fetch = n - this.stash.length; - while (fetch-- > 0) this.stash.push(this.next()); - return this.stash[--n]; - }, - - /** - * Return the indexOf `start` / `end` delimiters. - * - * @param {String} start - * @param {String} end - * @return {Number} - * @api private - */ - - indexOfDelimiters: function(start, end){ - var str = this.input - , nstart = 0 - , nend = 0 - , pos = 0; - for (var i = 0, len = str.length; i < len; ++i) { - if (start == str.charAt(i)) { - ++nstart; - } else if (end == str.charAt(i)) { - if (++nend == nstart) { - pos = i; - break; - } - } - } - return pos; - }, - - /** - * Stashed token. - */ - - stashed: function() { - return this.stash.length - && this.stash.shift(); - }, - - /** - * Deferred token. - */ - - deferred: function() { - return this.deferredTokens.length - && this.deferredTokens.shift(); - }, - - /** - * end-of-source. - */ - - eos: function() { - if (this.input.length) return; - if (this.indentStack.length) { - this.indentStack.shift(); - return this.tok('outdent'); - } else { - return this.tok('eos'); - } - }, - - /** - * Blank line. - */ - - blank: function() { - var captures; - if (captures = /^\n *\n/.exec(this.input)) { - this.consume(captures[0].length - 1); - if (this.pipeless) return this.tok('text', ''); - return this.next(); - } - }, - - /** - * Comment. - */ - - comment: function() { - var captures; - if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('comment', captures[2]); - tok.buffer = '-' != captures[1]; - return tok; - } - }, - - /** - * Interpolated tag. - */ - - interpolation: function() { - var captures; - if (captures = /^#\{(.*?)\}/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('interpolation', captures[1]); - } - }, - - /** - * Tag. - */ - - tag: function() { - var captures; - if (captures = /^(\w[-:\w]*)(\/?)/.exec(this.input)) { - this.consume(captures[0].length); - var tok, name = captures[1]; - if (':' == name[name.length - 1]) { - name = name.slice(0, -1); - tok = this.tok('tag', name); - this.defer(this.tok(':')); - while (' ' == this.input[0]) this.input = this.input.substr(1); - } else { - tok = this.tok('tag', name); - } - tok.selfClosing = !! captures[2]; - return tok; - } - }, - - /** - * Filter. - */ - - filter: function() { - return this.scan(/^:(\w+)/, 'filter'); - }, - - /** - * Doctype. - */ - - doctype: function() { - return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); - }, - - /** - * Id. - */ - - id: function() { - return this.scan(/^#([\w-]+)/, 'id'); - }, - - /** - * Class. - */ - - className: function() { - return this.scan(/^\.([\w-]+)/, 'class'); - }, - - /** - * Text. - */ - - text: function() { - return this.scan(/^(?:\| ?| ?)?([^\n]+)/, 'text'); - }, - - /** - * Extends. - */ - - "extends": function() { - return this.scan(/^extends? +([^\n]+)/, 'extends'); - }, - - /** - * Block prepend. - */ - - prepend: function() { - var captures; - if (captures = /^prepend +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'prepend' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block append. - */ - - append: function() { - var captures; - if (captures = /^append +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'append' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block. - */ - - block: function() { - var captures; - if (captures = /^block\b *(?:(prepend|append) +)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = captures[1] || 'replace' - , name = captures[2] - , tok = this.tok('block', name); - - tok.mode = mode; - return tok; - } - }, - - /** - * Yield. - */ - - yield: function() { - return this.scan(/^yield */, 'yield'); - }, - - /** - * Include. - */ - - include: function() { - return this.scan(/^include +([^\n]+)/, 'include'); - }, - - /** - * Case. - */ - - "case": function() { - return this.scan(/^case +([^\n]+)/, 'case'); - }, - - /** - * When. - */ - - when: function() { - return this.scan(/^when +([^:\n]+)/, 'when'); - }, - - /** - * Default. - */ - - "default": function() { - return this.scan(/^default */, 'default'); - }, - - /** - * Assignment. - */ - - assignment: function() { - var captures; - if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { - this.consume(captures[0].length); - var name = captures[1] - , val = captures[2]; - return this.tok('code', 'var ' + name + ' = (' + val + ');'); - } - }, - - /** - * Call mixin. - */ - - call: function(){ - var captures; - if (captures = /^\+([-\w]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('call', captures[1]); - - // Check for args (not attributes) - if (captures = /^ *\((.*?)\)/.exec(this.input)) { - if (!/^ *[-\w]+ *=/.test(captures[1])) { - this.consume(captures[0].length); - tok.args = captures[1]; - } - } - - return tok; - } - }, - - /** - * Mixin. - */ - - mixin: function(){ - var captures; - if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('mixin', captures[1]); - tok.args = captures[2]; - return tok; - } - }, - - /** - * Conditional. - */ - - conditional: function() { - var captures; - if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var type = captures[1] - , js = captures[2]; - - switch (type) { - case 'if': js = 'if (' + js + ')'; break; - case 'unless': js = 'if (!(' + js + '))'; break; - case 'else if': js = 'else if (' + js + ')'; break; - case 'else': js = 'else'; break; - } - - return this.tok('code', js); - } - }, - - /** - * While. - */ - - "while": function() { - var captures; - if (captures = /^while +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('code', 'while (' + captures[1] + ')'); - } - }, - - /** - * Each. - */ - - each: function() { - var captures; - if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('each', captures[1]); - tok.key = captures[2] || '$index'; - tok.code = captures[3]; - return tok; - } - }, - - /** - * Code. - */ - - code: function() { - var captures; - if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var flags = captures[1]; - captures[1] = captures[2]; - var tok = this.tok('code', captures[1]); - tok.escape = flags[0] === '='; - tok.buffer = flags[0] === '=' || flags[1] === '='; - return tok; - } - }, - - /** - * Attributes. - */ - - attrs: function() { - if ('(' == this.input.charAt(0)) { - var index = this.indexOfDelimiters('(', ')') - , str = this.input.substr(1, index-1) - , tok = this.tok('attrs') - , len = str.length - , colons = this.colons - , states = ['key'] - , escapedAttr - , key = '' - , val = '' - , quote - , c - , p; - - function state(){ - return states[states.length - 1]; - } - - function interpolate(attr) { - return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ - return quote + " + (" + expr + ") + " + quote; - }); - } - - this.consume(index + 1); - tok.attrs = {}; - tok.escaped = {}; - - function parse(c) { - var real = c; - // TODO: remove when people fix ":" - if (colons && ':' == c) c = '='; - switch (c) { - case ',': - case '\n': - switch (state()) { - case 'expr': - case 'array': - case 'string': - case 'object': - val += c; - break; - default: - states.push('key'); - val = val.trim(); - key = key.trim(); - if ('' == key) return; - key = key.replace(/^['"]|['"]$/g, '').replace('!', ''); - tok.escaped[key] = escapedAttr; - tok.attrs[key] = '' == val - ? true - : interpolate(val); - key = val = ''; - } - break; - case '=': - switch (state()) { - case 'key char': - key += real; - break; - case 'val': - case 'expr': - case 'array': - case 'string': - case 'object': - val += real; - break; - default: - escapedAttr = '!' != p; - states.push('val'); - } - break; - case '(': - if ('val' == state() - || 'expr' == state()) states.push('expr'); - val += c; - break; - case ')': - if ('expr' == state() - || 'val' == state()) states.pop(); - val += c; - break; - case '{': - if ('val' == state()) states.push('object'); - val += c; - break; - case '}': - if ('object' == state()) states.pop(); - val += c; - break; - case '[': - if ('val' == state()) states.push('array'); - val += c; - break; - case ']': - if ('array' == state()) states.pop(); - val += c; - break; - case '"': - case "'": - switch (state()) { - case 'key': - states.push('key char'); - break; - case 'key char': - states.pop(); - break; - case 'string': - if (c == quote) states.pop(); - val += c; - break; - default: - states.push('string'); - val += c; - quote = c; - } - break; - case '': - break; - default: - switch (state()) { - case 'key': - case 'key char': - key += c; - break; - default: - val += c; - } - } - p = c; - } - - for (var i = 0; i < len; ++i) { - parse(str.charAt(i)); - } - - parse(','); - - if ('/' == this.input.charAt(0)) { - this.consume(1); - tok.selfClosing = true; - } - - return tok; - } - }, - - /** - * Indent | Outdent | Newline. - */ - - indent: function() { - var captures, re; - - // established regexp - if (this.indentRe) { - captures = this.indentRe.exec(this.input); - // determine regexp - } else { - // tabs - re = /^\n(\t*) */; - captures = re.exec(this.input); - - // spaces - if (captures && !captures[1].length) { - re = /^\n( *)/; - captures = re.exec(this.input); - } - - // established - if (captures && captures[1].length) this.indentRe = re; - } - - if (captures) { - var tok - , indents = captures[1].length; - - ++this.lineno; - this.consume(indents + 1); - - if (' ' == this.input[0] || '\t' == this.input[0]) { - throw new Error('Invalid indentation, you can use tabs or spaces but not both'); - } - - // blank line - if ('\n' == this.input[0]) return this.tok('newline'); - - // outdent - if (this.indentStack.length && indents < this.indentStack[0]) { - while (this.indentStack.length && this.indentStack[0] > indents) { - this.stash.push(this.tok('outdent')); - this.indentStack.shift(); - } - tok = this.stash.pop(); - // indent - } else if (indents && indents != this.indentStack[0]) { - this.indentStack.unshift(indents); - tok = this.tok('indent', indents); - // newline - } else { - tok = this.tok('newline'); - } - - return tok; - } - }, - - /** - * Pipe-less text consumed only when - * pipeless is true; - */ - - pipelessText: function() { - if (this.pipeless) { - if ('\n' == this.input[0]) return; - var i = this.input.indexOf('\n'); - if (-1 == i) i = this.input.length; - var str = this.input.substr(0, i); - this.consume(str.length); - return this.tok('text', str); - } - }, - - /** - * ':' - */ - - colon: function() { - return this.scan(/^: */, ':'); - }, - - /** - * Return the next token object, or those - * previously stashed by lookahead. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.stashed() - || this.next(); - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - next: function() { - return this.deferred() - || this.blank() - || this.eos() - || this.pipelessText() - || this.yield() - || this.doctype() - || this.interpolation() - || this["case"]() - || this.when() - || this["default"]() - || this["extends"]() - || this.append() - || this.prepend() - || this.block() - || this.include() - || this.mixin() - || this.call() - || this.conditional() - || this.each() - || this["while"]() - || this.assignment() - || this.tag() - || this.filter() - || this.code() - || this.id() - || this.className() - || this.attrs() - || this.indent() - || this.comment() - || this.colon() - || this.text(); - } -}; - -}); // module: lexer.js - -require.register("nodes/attrs.js", function(module, exports, require){ - -/*! - * Jade - nodes - Attrs - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'), - Block = require('./block'); - -/** - * Initialize a `Attrs` node. - * - * @api public - */ - -var Attrs = module.exports = function Attrs() { - this.attrs = []; -}; - -/** - * Inherit from `Node`. - */ - -Attrs.prototype = new Node; -Attrs.prototype.constructor = Attrs; - - -/** - * Set attribute `name` to `val`, keep in mind these become - * part of a raw js object literal, so to quote a value you must - * '"quote me"', otherwise or example 'user.name' is literal JavaScript. - * - * @param {String} name - * @param {String} val - * @param {Boolean} escaped - * @return {Tag} for chaining - * @api public - */ - -Attrs.prototype.setAttribute = function(name, val, escaped){ - this.attrs.push({ name: name, val: val, escaped: escaped }); - return this; -}; - -/** - * Remove attribute `name` when present. - * - * @param {String} name - * @api public - */ - -Attrs.prototype.removeAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - delete this.attrs[i]; - } - } -}; - -/** - * Get attribute value by `name`. - * - * @param {String} name - * @return {String} - * @api public - */ - -Attrs.prototype.getAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - return this.attrs[i].val; - } - } -}; - -}); // module: nodes/attrs.js - -require.register("nodes/block-comment.js", function(module, exports, require){ - -/*! - * Jade - nodes - BlockComment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `BlockComment` with the given `block`. - * - * @param {String} val - * @param {Block} block - * @param {Boolean} buffer - * @api public - */ - -var BlockComment = module.exports = function BlockComment(val, block, buffer) { - this.block = block; - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -BlockComment.prototype = new Node; -BlockComment.prototype.constructor = BlockComment; - -}); // module: nodes/block-comment.js - -require.register("nodes/block.js", function(module, exports, require){ - -/*! - * Jade - nodes - Block - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Block` with an optional `node`. - * - * @param {Node} node - * @api public - */ - -var Block = module.exports = function Block(node){ - this.nodes = []; - if (node) this.push(node); -}; - -/** - * Inherit from `Node`. - */ - -Block.prototype = new Node; -Block.prototype.constructor = Block; - - -/** - * Block flag. - */ - -Block.prototype.isBlock = true; - -/** - * Replace the nodes in `other` with the nodes - * in `this` block. - * - * @param {Block} other - * @api private - */ - -Block.prototype.replace = function(other){ - other.nodes = this.nodes; -}; - -/** - * Pust the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.push = function(node){ - return this.nodes.push(node); -}; - -/** - * Check if this block is empty. - * - * @return {Boolean} - * @api public - */ - -Block.prototype.isEmpty = function(){ - return 0 == this.nodes.length; -}; - -/** - * Unshift the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.unshift = function(node){ - return this.nodes.unshift(node); -}; - -/** - * Return the "last" block, or the first `yield` node. - * - * @return {Block} - * @api private - */ - -Block.prototype.includeBlock = function(){ - var ret = this - , node; - - for (var i = 0, len = this.nodes.length; i < len; ++i) { - node = this.nodes[i]; - if (node.yield) return node; - else if (node.textOnly) continue; - else if (node.includeBlock) ret = node.includeBlock(); - else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); - } - - return ret; -}; - -/** - * Return a clone of this block. - * - * @return {Block} - * @api private - */ - -Block.prototype.clone = function(){ - var clone = new Block; - for (var i = 0, len = this.nodes.length; i < len; ++i) { - clone.push(this.nodes[i].clone()); - } - return clone; -}; - - -}); // module: nodes/block.js - -require.register("nodes/case.js", function(module, exports, require){ - -/*! - * Jade - nodes - Case - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Case` with `expr`. - * - * @param {String} expr - * @api public - */ - -var Case = exports = module.exports = function Case(expr, block){ - this.expr = expr; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Case.prototype = new Node; -Case.prototype.constructor = Case; - - -var When = exports.When = function When(expr, block){ - this.expr = expr; - this.block = block; - this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -When.prototype = new Node; -When.prototype.constructor = When; - - - -}); // module: nodes/case.js - -require.register("nodes/code.js", function(module, exports, require){ - -/*! - * Jade - nodes - Code - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Code` node with the given code `val`. - * Code may also be optionally buffered and escaped. - * - * @param {String} val - * @param {Boolean} buffer - * @param {Boolean} escape - * @api public - */ - -var Code = module.exports = function Code(val, buffer, escape) { - this.val = val; - this.buffer = buffer; - this.escape = escape; - if (val.match(/^ *else/)) this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -Code.prototype = new Node; -Code.prototype.constructor = Code; - -}); // module: nodes/code.js - -require.register("nodes/comment.js", function(module, exports, require){ - -/*! - * Jade - nodes - Comment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Comment` with the given `val`, optionally `buffer`, - * otherwise the comment may render in the output. - * - * @param {String} val - * @param {Boolean} buffer - * @api public - */ - -var Comment = module.exports = function Comment(val, buffer) { - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -Comment.prototype = new Node; -Comment.prototype.constructor = Comment; - -}); // module: nodes/comment.js - -require.register("nodes/doctype.js", function(module, exports, require){ - -/*! - * Jade - nodes - Doctype - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Doctype` with the given `val`. - * - * @param {String} val - * @api public - */ - -var Doctype = module.exports = function Doctype(val) { - this.val = val; -}; - -/** - * Inherit from `Node`. - */ - -Doctype.prototype = new Node; -Doctype.prototype.constructor = Doctype; - -}); // module: nodes/doctype.js - -require.register("nodes/each.js", function(module, exports, require){ - -/*! - * Jade - nodes - Each - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize an `Each` node, representing iteration - * - * @param {String} obj - * @param {String} val - * @param {String} key - * @param {Block} block - * @api public - */ - -var Each = module.exports = function Each(obj, val, key, block) { - this.obj = obj; - this.val = val; - this.key = key; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Each.prototype = new Node; -Each.prototype.constructor = Each; - -}); // module: nodes/each.js - -require.register("nodes/filter.js", function(module, exports, require){ - -/*! - * Jade - nodes - Filter - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node') - , Block = require('./block'); - -/** - * Initialize a `Filter` node with the given - * filter `name` and `block`. - * - * @param {String} name - * @param {Block|Node} block - * @api public - */ - -var Filter = module.exports = function Filter(name, block, attrs) { - this.name = name; - this.block = block; - this.attrs = attrs; - this.isASTFilter = !block.nodes.every(function(node){ return node.isText }); -}; - -/** - * Inherit from `Node`. - */ - -Filter.prototype = new Node; -Filter.prototype.constructor = Filter; - -}); // module: nodes/filter.js - -require.register("nodes/index.js", function(module, exports, require){ - -/*! - * Jade - nodes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -exports.Node = require('./node'); -exports.Tag = require('./tag'); -exports.Code = require('./code'); -exports.Each = require('./each'); -exports.Case = require('./case'); -exports.Text = require('./text'); -exports.Block = require('./block'); -exports.Mixin = require('./mixin'); -exports.Filter = require('./filter'); -exports.Comment = require('./comment'); -exports.Literal = require('./literal'); -exports.BlockComment = require('./block-comment'); -exports.Doctype = require('./doctype'); - -}); // module: nodes/index.js - -require.register("nodes/literal.js", function(module, exports, require){ - -/*! - * Jade - nodes - Literal - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Literal` node with the given `str. - * - * @param {String} str - * @api public - */ - -var Literal = module.exports = function Literal(str) { - this.str = str - .replace(/\\/g, "\\\\") - .replace(/\n|\r\n/g, "\\n") - .replace(/'/g, "\\'"); -}; - -/** - * Inherit from `Node`. - */ - -Literal.prototype = new Node; -Literal.prototype.constructor = Literal; - - -}); // module: nodes/literal.js - -require.register("nodes/mixin.js", function(module, exports, require){ - -/*! - * Jade - nodes - Mixin - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Attrs = require('./attrs'); - -/** - * Initialize a new `Mixin` with `name` and `block`. - * - * @param {String} name - * @param {String} args - * @param {Block} block - * @api public - */ - -var Mixin = module.exports = function Mixin(name, args, block, call){ - this.name = name; - this.args = args; - this.block = block; - this.attrs = []; - this.call = call; -}; - -/** - * Inherit from `Attrs`. - */ - -Mixin.prototype = new Attrs; -Mixin.prototype.constructor = Mixin; - - - -}); // module: nodes/mixin.js - -require.register("nodes/node.js", function(module, exports, require){ - -/*! - * Jade - nodes - Node - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize a `Node`. - * - * @api public - */ - -var Node = module.exports = function Node(){}; - -/** - * Clone this node (return itself) - * - * @return {Node} - * @api private - */ - -Node.prototype.clone = function(){ - return this; -}; - -}); // module: nodes/node.js - -require.register("nodes/tag.js", function(module, exports, require){ - -/*! - * Jade - nodes - Tag - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Attrs = require('./attrs'), - Block = require('./block'), - inlineTags = require('../inline-tags'); - -/** - * Initialize a `Tag` node with the given tag `name` and optional `block`. - * - * @param {String} name - * @param {Block} block - * @api public - */ - -var Tag = module.exports = function Tag(name, block) { - this.name = name; - this.attrs = []; - this.block = block || new Block; -}; - -/** - * Inherit from `Attrs`. - */ - -Tag.prototype = new Attrs; -Tag.prototype.constructor = Tag; - - -/** - * Clone this tag. - * - * @return {Tag} - * @api private - */ - -Tag.prototype.clone = function(){ - var clone = new Tag(this.name, this.block.clone()); - clone.line = this.line; - clone.attrs = this.attrs; - clone.textOnly = this.textOnly; - return clone; -}; - -/** - * Check if this tag is an inline tag. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.isInline = function(){ - return ~inlineTags.indexOf(this.name); -}; - -/** - * Check if this tag's contents can be inlined. Used for pretty printing. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.canInline = function(){ - var nodes = this.block.nodes; - - function isInline(node){ - // Recurse if the node is a block - if (node.isBlock) return node.nodes.every(isInline); - return node.isText || (node.isInline && node.isInline()); - } - - // Empty tag - if (!nodes.length) return true; - - // Text-only or inline-only tag - if (1 == nodes.length) return isInline(nodes[0]); - - // Multi-line inline-only tag - if (this.block.nodes.every(isInline)) { - for (var i = 1, len = nodes.length; i < len; ++i) { - if (nodes[i-1].isText && nodes[i].isText) - return false; - } - return true; - } - - // Mixed tag - return false; -}; -}); // module: nodes/tag.js - -require.register("nodes/text.js", function(module, exports, require){ - -/*! - * Jade - nodes - Text - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Text` node with optional `line`. - * - * @param {String} line - * @api public - */ - -var Text = module.exports = function Text(line) { - this.val = ''; - if ('string' == typeof line) this.val = line; -}; - -/** - * Inherit from `Node`. - */ - -Text.prototype = new Node; -Text.prototype.constructor = Text; - - -/** - * Flag as text. - */ - -Text.prototype.isText = true; -}); // module: nodes/text.js - -require.register("parser.js", function(module, exports, require){ - -/*! - * Jade - Parser - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Lexer = require('./lexer') - , nodes = require('./nodes'); - -/** - * Initialize `Parser` with the given input `str` and `filename`. - * - * @param {String} str - * @param {String} filename - * @param {Object} options - * @api public - */ - -var Parser = exports = module.exports = function Parser(str, filename, options){ - this.input = str; - this.lexer = new Lexer(str, options); - this.filename = filename; - this.blocks = {}; - this.mixins = {}; - this.options = options; - this.contexts = [this]; -}; - -/** - * Tags that may not contain tags. - */ - -var textOnly = exports.textOnly = ['script', 'style']; - -/** - * Parser prototype. - */ - -Parser.prototype = { - - /** - * Push `parser` onto the context stack, - * or pop and return a `Parser`. - */ - - context: function(parser){ - if (parser) { - this.contexts.push(parser); - } else { - return this.contexts.pop(); - } - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.lexer.advance(); - }, - - /** - * Skip `n` tokens. - * - * @param {Number} n - * @api private - */ - - skip: function(n){ - while (n--) this.advance(); - }, - - /** - * Single token lookahead. - * - * @return {Object} - * @api private - */ - - peek: function() { - return this.lookahead(1); - }, - - /** - * Return lexer lineno. - * - * @return {Number} - * @api private - */ - - line: function() { - return this.lexer.lineno; - }, - - /** - * `n` token lookahead. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - return this.lexer.lookahead(n); - }, - - /** - * Parse input returning a string of js for evaluation. - * - * @return {String} - * @api public - */ - - parse: function(){ - var block = new nodes.Block, parser; - block.line = this.line(); - - while ('eos' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - - if (parser = this.extending) { - this.context(parser); - var ast = parser.parse(); - this.context(); - // hoist mixins - for (var name in this.mixins) - ast.unshift(this.mixins[name]); - return ast; - } - - return block; - }, - - /** - * Expect the given type, or throw an exception. - * - * @param {String} type - * @api private - */ - - expect: function(type){ - if (this.peek().type === type) { - return this.advance(); - } else { - throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); - } - }, - - /** - * Accept the given `type`. - * - * @param {String} type - * @api private - */ - - accept: function(type){ - if (this.peek().type === type) { - return this.advance(); - } - }, - - /** - * tag - * | doctype - * | mixin - * | include - * | filter - * | comment - * | text - * | each - * | code - * | yield - * | id - * | class - * | interpolation - */ - - parseExpr: function(){ - switch (this.peek().type) { - case 'tag': - return this.parseTag(); - case 'mixin': - return this.parseMixin(); - case 'block': - return this.parseBlock(); - case 'case': - return this.parseCase(); - case 'when': - return this.parseWhen(); - case 'default': - return this.parseDefault(); - case 'extends': - return this.parseExtends(); - case 'include': - return this.parseInclude(); - case 'doctype': - return this.parseDoctype(); - case 'filter': - return this.parseFilter(); - case 'comment': - return this.parseComment(); - case 'text': - return this.parseText(); - case 'each': - return this.parseEach(); - case 'code': - return this.parseCode(); - case 'call': - return this.parseCall(); - case 'interpolation': - return this.parseInterpolation(); - case 'yield': - this.advance(); - var block = new nodes.Block; - block.yield = true; - return block; - case 'id': - case 'class': - var tok = this.advance(); - this.lexer.defer(this.lexer.tok('tag', 'div')); - this.lexer.defer(tok); - return this.parseExpr(); - default: - throw new Error('unexpected token "' + this.peek().type + '"'); - } - }, - - /** - * Text - */ - - parseText: function(){ - var tok = this.expect('text') - , node = new nodes.Text(tok.val); - node.line = this.line(); - return node; - }, - - /** - * ':' expr - * | block - */ - - parseBlockExpansion: function(){ - if (':' == this.peek().type) { - this.advance(); - return new nodes.Block(this.parseExpr()); - } else { - return this.block(); - } - }, - - /** - * case - */ - - parseCase: function(){ - var val = this.expect('case').val - , node = new nodes.Case(val); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * when - */ - - parseWhen: function(){ - var val = this.expect('when').val - return new nodes.Case.When(val, this.parseBlockExpansion()); - }, - - /** - * default - */ - - parseDefault: function(){ - this.expect('default'); - return new nodes.Case.When('default', this.parseBlockExpansion()); - }, - - /** - * code - */ - - parseCode: function(){ - var tok = this.expect('code') - , node = new nodes.Code(tok.val, tok.buffer, tok.escape) - , block - , i = 1; - node.line = this.line(); - while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; - block = 'indent' == this.lookahead(i).type; - if (block) { - this.skip(i-1); - node.block = this.block(); - } - return node; - }, - - /** - * comment - */ - - parseComment: function(){ - var tok = this.expect('comment') - , node; - - if ('indent' == this.peek().type) { - node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); - } else { - node = new nodes.Comment(tok.val, tok.buffer); - } - - node.line = this.line(); - return node; - }, - - /** - * doctype - */ - - parseDoctype: function(){ - var tok = this.expect('doctype') - , node = new nodes.Doctype(tok.val); - node.line = this.line(); - return node; - }, - - /** - * filter attrs? text-block - */ - - parseFilter: function(){ - var block - , tok = this.expect('filter') - , attrs = this.accept('attrs'); - - this.lexer.pipeless = true; - block = this.parseTextBlock(); - this.lexer.pipeless = false; - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * tag ':' attrs? block - */ - - parseASTFilter: function(){ - var block - , tok = this.expect('tag') - , attrs = this.accept('attrs'); - - this.expect(':'); - block = this.block(); - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * each block - */ - - parseEach: function(){ - var tok = this.expect('each') - , node = new nodes.Each(tok.code, tok.val, tok.key); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * 'extends' name - */ - - parseExtends: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - if (!this.filename) - throw new Error('the "filename" option is required to extend templates'); - - var path = this.expect('extends').val.trim() - , dir = dirname(this.filename); - - var path = join(dir, path + '.jade') - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - parser.blocks = this.blocks; - parser.contexts = this.contexts; - this.extending = parser; - - // TODO: null node - return new nodes.Literal(''); - }, - - /** - * 'block' name block - */ - - parseBlock: function(){ - var block = this.expect('block') - , mode = block.mode - , name = block.val.trim(); - - block = 'indent' == this.peek().type - ? this.block() - : new nodes.Block(new nodes.Literal('')); - - var prev = this.blocks[name]; - - if (prev) { - switch (prev.mode) { - case 'append': - block.nodes = block.nodes.concat(prev.nodes); - prev = block; - break; - case 'prepend': - block.nodes = prev.nodes.concat(block.nodes); - prev = block; - break; - } - } - - block.mode = mode; - return this.blocks[name] = prev || block; - }, - - /** - * include block? - */ - - parseInclude: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - var path = this.expect('include').val.trim() - , dir = dirname(this.filename); - - if (!this.filename) - throw new Error('the "filename" option is required to use includes'); - - // no extension - if (!~basename(path).indexOf('.')) { - path += '.jade'; - } - - // non-jade - if ('.jade' != path.substr(-5)) { - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8'); - return new nodes.Literal(str); - } - - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - parser.blocks = this.blocks; - parser.mixins = this.mixins; - - this.context(parser); - var ast = parser.parse(); - this.context(); - ast.filename = path; - - if ('indent' == this.peek().type) { - ast.includeBlock().push(this.block()); - } - - return ast; - }, - - /** - * call ident block - */ - - parseCall: function(){ - var tok = this.expect('call') - , name = tok.val - , args = tok.args - , mixin = new nodes.Mixin(name, args, new nodes.Block, true); - - this.tag(mixin); - if (mixin.block.isEmpty()) mixin.block = null; - return mixin; - }, - - /** - * mixin block - */ - - parseMixin: function(){ - var tok = this.expect('mixin') - , name = tok.val - , args = tok.args - , mixin; - - // definition - if ('indent' == this.peek().type) { - mixin = new nodes.Mixin(name, args, this.block(), false); - this.mixins[name] = mixin; - return mixin; - // call - } else { - return new nodes.Mixin(name, args, null, true); - } - }, - - /** - * indent (text | newline)* outdent - */ - - parseTextBlock: function(){ - var block = new nodes.Block; - block.line = this.line(); - var spaces = this.expect('indent').val; - if (null == this._spaces) this._spaces = spaces; - var indent = Array(spaces - this._spaces + 1).join(' '); - while ('outdent' != this.peek().type) { - switch (this.peek().type) { - case 'newline': - this.advance(); - break; - case 'indent': - this.parseTextBlock().nodes.forEach(function(node){ - block.push(node); - }); - break; - default: - var text = new nodes.Text(indent + this.advance().val); - text.line = this.line(); - block.push(text); - } - } - - if (spaces == this._spaces) this._spaces = null; - this.expect('outdent'); - return block; - }, - - /** - * indent expr* outdent - */ - - block: function(){ - var block = new nodes.Block; - block.line = this.line(); - this.expect('indent'); - while ('outdent' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - this.expect('outdent'); - return block; - }, - - /** - * interpolation (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseInterpolation: function(){ - var tok = this.advance(); - var tag = new nodes.Tag(tok.val); - tag.buffer = true; - return this.tag(tag); - }, - - /** - * tag (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseTag: function(){ - // ast-filter look-ahead - var i = 2; - if ('attrs' == this.lookahead(i).type) ++i; - if (':' == this.lookahead(i).type) { - if ('indent' == this.lookahead(++i).type) { - return this.parseASTFilter(); - } - } - - var tok = this.advance() - , tag = new nodes.Tag(tok.val); - - tag.selfClosing = tok.selfClosing; - - return this.tag(tag); - }, - - /** - * Parse tag. - */ - - tag: function(tag){ - var dot; - - tag.line = this.line(); - - // (attrs | class | id)* - out: - while (true) { - switch (this.peek().type) { - case 'id': - case 'class': - var tok = this.advance(); - tag.setAttribute(tok.type, "'" + tok.val + "'"); - continue; - case 'attrs': - var tok = this.advance() - , obj = tok.attrs - , escaped = tok.escaped - , names = Object.keys(obj); - - if (tok.selfClosing) tag.selfClosing = true; - - for (var i = 0, len = names.length; i < len; ++i) { - var name = names[i] - , val = obj[name]; - tag.setAttribute(name, val, escaped[name]); - } - continue; - default: - break out; - } - } - - // check immediate '.' - if ('.' == this.peek().val) { - dot = tag.textOnly = true; - this.advance(); - } - - // (text | code | ':')? - switch (this.peek().type) { - case 'text': - tag.block.push(this.parseText()); - break; - case 'code': - tag.code = this.parseCode(); - break; - case ':': - this.advance(); - tag.block = new nodes.Block; - tag.block.push(this.parseExpr()); - break; - } - - // newline* - while ('newline' == this.peek().type) this.advance(); - - tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); - - // script special-case - if ('script' == tag.name) { - var type = tag.getAttribute('type'); - if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { - tag.textOnly = false; - } - } - - // block? - if ('indent' == this.peek().type) { - if (tag.textOnly) { - this.lexer.pipeless = true; - tag.block = this.parseTextBlock(); - this.lexer.pipeless = false; - } else { - var block = this.block(); - if (tag.block) { - for (var i = 0, len = block.nodes.length; i < len; ++i) { - tag.block.push(block.nodes[i]); - } - } else { - tag.block = block; - } - } - } - - return tag; - } -}; - -}); // module: parser.js - -require.register("runtime.js", function(module, exports, require){ - -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Merge two attribute objects giving precedence - * to values in object `b`. Classes are special-cased - * allowing for arrays and merging/joining appropriately - * resulting in a string. - * - * @param {Object} a - * @param {Object} b - * @return {Object} a - * @api private - */ - -exports.merge = function merge(a, b) { - var ac = a['class']; - var bc = b['class']; - - if (ac || bc) { - ac = ac || []; - bc = bc || []; - if (!Array.isArray(ac)) ac = [ac]; - if (!Array.isArray(bc)) bc = [bc]; - ac = ac.filter(nulls); - bc = bc.filter(nulls); - a['class'] = ac.concat(bc).join(' '); - } - - for (var key in b) { - if (key != 'class') { - a[key] = b[key]; - } - } - - return a; -}; - -/** - * Filter null `val`s. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function nulls(val) { - return val != null; -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped && escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!(\w+|\#\d+);)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; - -}); // module: runtime.js - -require.register("self-closing.js", function(module, exports, require){ - -/*! - * Jade - self closing tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'meta' - , 'img' - , 'link' - , 'input' - , 'source' - , 'area' - , 'base' - , 'col' - , 'br' - , 'hr' -]; -}); // module: self-closing.js - -require.register("utils.js", function(module, exports, require){ - -/*! - * Jade - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Convert interpolation in the given string to JavaScript. - * - * @param {String} str - * @return {String} - * @api private - */ - -var interpolate = exports.interpolate = function(str){ - return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ - return escape - ? str - : "' + " - + ('!' == flag ? '' : 'escape') - + "((interp = " + code.replace(/\\'/g, "'") - + ") == null ? '' : interp) + '"; - }); -}; - -/** - * Escape single quotes in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -var escape = exports.escape = function(str) { - return str.replace(/'/g, "\\'"); -}; - -/** - * Interpolate, and escape the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.text = function(str){ - return interpolate(escape(str)); -}; -}); // module: utils.js - -window.jade = require("jade"); -})(); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.md b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.md deleted file mode 100644 index 051dc03..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.md +++ /dev/null @@ -1,510 +0,0 @@ - -# Jade - - The jade template engine for node.js - -## Synopsis - - jade [-h|--help] [-v|--version] [-o|--obj STR] - [-O|--out DIR] [-p|--path PATH] [-P|--pretty] - [-c|--client] [-D|--no-debug] - -## Examples - - translate jade the templates dir - - $ jade templates - - create {foo,bar}.html - - $ jade {foo,bar}.jade - - jade over stdio - - $ jade < my.jade > my.html - - jade over s - - $ echo "h1 Jade!" | jade - - foo, bar dirs rendering to /tmp - - $ jade foo bar --out /tmp - - compile client-side templates without debugging - instrumentation, making the output javascript - very light-weight. This requires runtime.js - in your projects. - - $ jade --client --no-debug < my.jade - -## Tags - - Tags are simply nested via whitespace, closing - tags defined for you. These indents are called "blocks". - - ul - li - a Foo - li - a Bar - - You may have several tags in one "block": - - ul - li - a Foo - a Bar - a Baz - -## Self-closing Tags - - Some tags are flagged as self-closing by default, such - as `meta`, `link`, and so on. To explicitly self-close - a tag simply append the `/` character: - - foo/ - foo(bar='baz')/ - - Would yield: - - - - -## Attributes - - Tag attributes look similar to HTML, however - the values are regular JavaScript, here are - some examples: - - a(href='google.com') Google - a(class='button', href='google.com') Google - - As mentioned the attribute values are just JavaScript, - this means ternary operations and other JavaScript expressions - work just fine: - - body(class=user.authenticated ? 'authenticated' : 'anonymous') - a(href=user.website || 'http://google.com') - - Multiple lines work too: - - input(type='checkbox', - name='agreement', - checked) - - Multiple lines without the comma work fine: - - input(type='checkbox' - name='agreement' - checked) - - Funky whitespace? fine: - - input( - type='checkbox' - name='agreement' - checked) - -## Boolean attributes - - Boolean attributes are mirrored by Jade, and accept - bools, aka _true_ or _false_. When no value is specified - _true_ is assumed. For example: - - input(type="checkbox", checked) - // => "" - - For example if the checkbox was for an agreement, perhaps `user.agreed` - was _true_ the following would also output 'checked="checked"': - - input(type="checkbox", checked=user.agreed) - -## Class attributes - - The _class_ attribute accepts an array of classes, - this can be handy when generated from a javascript - function etc: - - classes = ['foo', 'bar', 'baz'] - a(class=classes) - // => "" - -## Class literal - - Classes may be defined using a ".CLASSNAME" syntax: - - .button - // => "
                  " - - Or chained: - - .large.button - // => "
                  " - - The previous defaulted to divs, however you - may also specify the tag type: - - h1.title My Title - // => "

                  My Title

                  " - -## Id literal - - Much like the class literal there's an id literal: - - #user-1 - // => "
                  " - - Again we may specify the tag as well: - - ul#menu - li: a(href='/home') Home - li: a(href='/store') Store - li: a(href='/contact') Contact - - Finally all of these may be used in any combination, - the following are all valid tags: - - a.button#contact(style: 'color: red') Contact - a.button(style: 'color: red')#contact Contact - a(style: 'color: red').button#contact Contact - -## Block expansion - - Jade supports the concept of "block expansion", in which - using a trailing ":" after a tag will inject a block: - - ul - li: a Foo - li: a Bar - li: a Baz - -## Text - - Arbitrary text may follow tags: - - p Welcome to my site - - yields: - -

                  Welcome to my site

                  - -## Pipe text - - Another form of text is "pipe" text. Pipes act - as the text margin for large bodies of text. - - p - | This is a large - | body of text for - | this tag. - | - | Nothing too - | exciting. - - yields: - -

                  This is a large - body of text for - this tag. - - Nothing too - exciting. -

                  - - Using pipes we can also specify regular Jade tags - within the text: - - p - | Click to visit - a(href='http://google.com') Google - | if you want. - -## Text only tags - - As an alternative to pipe text you may add - a trailing "." to indicate that the block - contains nothing but plain-text, no tags: - - p. - This is a large - body of text for - this tag. - - Nothing too - exciting. - - Some tags are text-only by default, for example - _script_, _textarea_, and _style_ tags do not - contain nested HTML so Jade implies the trailing ".": - - script - if (foo) { - bar(); - } - - style - body { - padding: 50px; - font: 14px Helvetica; - } - -## Template script tags - - Sometimes it's useful to define HTML in script - tags using Jade, typically for client-side templates. - - To do this simply give the _script_ tag an arbitrary - _type_ attribute such as _text/x-template_: - - script(type='text/template') - h1 Look! - p Jade still works in here! - -## Interpolation - - Both plain-text and piped-text support interpolation, - which comes in two forms, escapes and non-escaped. The - following will output the _user.name_ in the paragraph - but HTML within it will be escaped to prevent XSS attacks: - - p Welcome #{user.name} - - The following syntax is identical however it will _not_ escape - HTML, and should only be used with strings that you trust: - - p Welcome !{user.name} - -## Inline HTML - - Sometimes constructing small inline snippets of HTML - in Jade can be annoying, luckily we can add plain - HTML as well: - - p Welcome #{user.name} - -## Code - - To buffer output with Jade simply use _=_ at the beginning - of a line or after a tag. This method escapes any HTML - present in the string. - - p= user.description - - To buffer output unescaped use the _!=_ variant, but again - be careful of XSS. - - p!= user.description - - The final way to mess with JavaScript code in Jade is the unbuffered - _-_, which can be used for conditionals, defining variables etc: - - - var user = { description: 'foo bar baz' } - #user - - if (user.description) { - h2 Description - p.description= user.description - - } - - When compiled blocks are wrapped in anonymous functions, so the - following is also valid, without braces: - - - var user = { description: 'foo bar baz' } - #user - - if (user.description) - h2 Description - p.description= user.description - - If you really want you could even use `.forEach()` and others: - - - users.forEach(function(user){ - .user - h2= user.name - p User #{user.name} is #{user.age} years old - - }) - - Taking this further Jade provides some syntax for conditionals, - iteration, switch statements etc. Let's look at those next! - -## Assignment - - Jade's first-class assignment is simple, simply use the _=_ - operator and Jade will _var_ it for you. The following are equivalent: - - - var user = { name: 'tobi' } - user = { name: 'tobi' } - -## Conditionals - - Jade's first-class conditional syntax allows for optional - parenthesis, and you may now omit the leading _-_ otherwise - it's identical, still just regular javascript: - - user = { description: 'foo bar baz' } - #user - if user.description - h2 Description - p.description= user.description - - Jade provides the negated version, _unless_ as well, the following - are equivalent: - - - if (!(user.isAnonymous)) - p You're logged in as #{user.name} - - unless user.isAnonymous - p You're logged in as #{user.name} - -## Iteration - - JavaScript's _for_ loops don't look very declarative, so Jade - also provides its own _for_ loop construct, aliased as _each_: - - for user in users - .user - h2= user.name - p user #{user.name} is #{user.age} year old - - As mentioned _each_ is identical: - - each user in users - .user - h2= user.name - - If necessary the index is available as well: - - for user, i in users - .user(class='user-#{i}') - h2= user.name - - Remember, it's just JavaScript: - - ul#letters - for letter in ['a', 'b', 'c'] - li= letter - -## Mixins - - Mixins provide a way to define jade "functions" which "mix in" - their contents when called. This is useful for abstracting - out large fragments of Jade. - - The simplest possible mixin which accepts no arguments might - look like this: - - mixin hello - p Hello - - You use a mixin by placing `+` before the name: - - +hello - - For something a little more dynamic, mixins can take - arguments, the mixin itself is converted to a javascript - function internally: - - mixin hello(user) - p Hello #{user} - - +hello('Tobi') - - Yields: - -

                  Hello Tobi

                  - - Mixins may optionally take blocks, when a block is passed - its contents becomes the implicit `block` argument. For - example here is a mixin passed a block, and also invoked - without passing a block: - - mixin article(title) - .article - .article-wrapper - h1= title - if block - block - else - p No content provided - - +article('Hello world') - - +article('Hello world') - p This is my - p Amazing article - - yields: - -
                  -
                  -

                  Hello world

                  -

                  No content provided

                  -
                  -
                  - -
                  -
                  -

                  Hello world

                  -

                  This is my

                  -

                  Amazing article

                  -
                  -
                  - - Mixins can even take attributes, just like a tag. When - attributes are passed they become the implicit `attributes` - argument. Individual attributes can be accessed just like - normal object properties: - - mixin centered - .centered(class=attributes.class) - block - - +centered.bold Hello world - - +centered.red - p This is my - p Amazing article - - yields: - -
                  Hello world
                  -
                  -

                  This is my

                  -

                  Amazing article

                  -
                  - - If you use `attributes` directly, *all* passed attributes - get used: - - mixin link - a.menu(attributes) - block - - +link.highlight(href='#top') Top - +link#sec1.plain(href='#section1') Section 1 - +link#sec2.plain(href='#section2') Section 2 - - yields: - - Top - Section 1 - Section 2 - - If you pass arguments, they must directly follow the mixin: - - mixin list(arr) - if block - .title - block - ul(attributes) - each item in arr - li= item - - +list(['foo', 'bar', 'baz'])(id='myList', class='bold') - - yields: - -
                    -
                  • foo
                  • -
                  • bar
                  • -
                  • baz
                  • -
                  diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.min.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.min.js deleted file mode 100644 index 72e4535..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/jade.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');return mod.exports||(mod.exports={},mod.call(mod.exports,mod,mod.exports,require.relative(path))),mod.exports}require.modules={},require.resolve=function(path){var orig=path,reg=path+".js",index=path+"/index.js";return require.modules[reg]&®||require.modules[index]&&index||orig},require.register=function(path,fn){require.modules[path]=fn},require.relative=function(parent){return function(p){if("."!=p.charAt(0))return require(p);var path=parent.split("/"),segs=p.split("/");path.pop();for(var i=0;i",this.doctype=doctype,this.terse="5"==name||"html"==name,this.xml=0==this.doctype.indexOf("1&&!escape&&block.nodes[0].isText&&block.nodes[1].isText&&this.prettyIndent(1,!0);for(var i=0;i0&&!escape&&block.nodes[i].isText&&block.nodes[i-1].isText&&this.prettyIndent(1,!1),this.visit(block.nodes[i]),block.nodes[i+1]&&block.nodes[i].isText&&block.nodes[i+1].isText&&this.buffer("\\n")},visitDoctype:function(doctype){doctype&&(doctype.val||!this.doctype)&&this.setDoctype(doctype.val||"default"),this.doctype&&this.buffer(this.doctype),this.hasCompiledDoctype=!0},visitMixin:function(mixin){var name=mixin.name.replace(/-/g,"_")+"_mixin",args=mixin.args||"",block=mixin.block,attrs=mixin.attrs,pp=this.pp;if(mixin.call){pp&&this.buf.push("__indent.push('"+Array(this.indents+1).join(" ")+"');");if(block||attrs.length){this.buf.push(name+".call({");if(block){this.buf.push("block: function(){"),this.parentIndents++;var _indents=this.indents;this.indents=0,this.visit(mixin.block),this.indents=_indents,this.parentIndents--,attrs.length?this.buf.push("},"):this.buf.push("}")}if(attrs.length){var val=this.attrs(attrs);val.inherits?this.buf.push("attributes: merge({"+val.buf+"}, attributes), escaped: merge("+val.escaped+", escaped, true)"):this.buf.push("attributes: {"+val.buf+"}, escaped: "+val.escaped)}args?this.buf.push("}, "+args+");"):this.buf.push("});")}else this.buf.push(name+"("+args+");");pp&&this.buf.push("__indent.pop();")}else this.buf.push("var "+name+" = function("+args+"){"),this.buf.push("var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};"),this.parentIndents++,this.visit(block),this.parentIndents--,this.buf.push("};")},visitTag:function(tag){this.indents++;var name=tag.name,pp=this.pp;tag.buffer&&(name="' + ("+name+") + '"),this.hasCompiledTag||(!this.hasCompiledDoctype&&"html"==name&&this.visitDoctype(),this.hasCompiledTag=!0),pp&&!tag.isInline()&&this.prettyIndent(0,!0),(~selfClosing.indexOf(name)||tag.selfClosing)&&!this.xml?(this.buffer("<"+name),this.visitAttributes(tag.attrs),this.terse?this.buffer(">"):this.buffer("/>")):(tag.attrs.length?(this.buffer("<"+name),tag.attrs.length&&this.visitAttributes(tag.attrs),this.buffer(">")):this.buffer("<"+name+">"),tag.code&&this.visitCode(tag.code),this.escape="pre"==tag.name,this.visit(tag.block),pp&&!tag.isInline()&&"pre"!=tag.name&&!tag.canInline()&&this.prettyIndent(0,!0),this.buffer("")),this.indents--},visitFilter:function(filter){var fn=filters[filter.name];if(!fn)throw filter.isASTFilter?new Error('unknown ast filter "'+filter.name+':"'):new Error('unknown filter ":'+filter.name+'"');if(filter.isASTFilter)this.buf.push(fn(filter.block,this,filter.attrs));else{var text=filter.block.nodes.map(function(node){return node.val}).join("\n");filter.attrs=filter.attrs||{},filter.attrs.filename=this.options.filename,this.buffer(utils.text(fn(text,filter.attrs)))}},visitText:function(text){text=utils.text(text.val.replace(/\\/g,"\\\\")),this.escape&&(text=escape(text)),this.buffer(text)},visitComment:function(comment){if(!comment.buffer)return;this.pp&&this.prettyIndent(1,!0),this.buffer("")},visitBlockComment:function(comment){if(!comment.buffer)return;0==comment.val.trim().indexOf("if")?(this.buffer("")):(this.buffer(""))},visitCode:function(code){if(code.buffer){var val=code.val.trimLeft();this.buf.push("var __val__ = "+val),val='null == __val__ ? "" : __val__',code.escape&&(val="escape("+val+")"),this.buf.push("buf.push("+val+");")}else this.buf.push(code.val);code.block&&(code.buffer||this.buf.push("{"),this.visit(code.block),code.buffer||this.buf.push("}"))},visitEach:function(each){this.buf.push("// iterate "+each.obj+"\n"+";(function(){\n"+" if ('number' == typeof "+each.obj+".length) {\n"+" for (var "+each.key+" = 0, $$l = "+each.obj+".length; "+each.key+" < $$l; "+each.key+"++) {\n"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n } else {\n for (var "+each.key+" in "+each.obj+") {\n"+" if ("+each.obj+".hasOwnProperty("+each.key+")){"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n"),this.buf.push(" }\n }\n}).call(this);\n")},visitAttributes:function(attrs){var val=this.attrs(attrs);val.inherits?this.buf.push("buf.push(attrs(merge({ "+val.buf+" }, attributes), merge("+val.escaped+", escaped, true)));"):val.constant?(eval("var buf={"+val.buf+"};"),this.buffer(runtime.attrs(buf,JSON.parse(val.escaped)),!0)):this.buf.push("buf.push(attrs({ "+val.buf+" }, "+val.escaped+"));")},attrs:function(attrs){var buf=[],classes=[],escaped={},constant=attrs.every(function(attr){return isConstant(attr.val)}),inherits=!1;return this.terse&&buf.push("terse: true"),attrs.forEach(function(attr){if(attr.name=="attributes")return inherits=!0;escaped[attr.name]=attr.escaped;if(attr.name=="class")classes.push("("+attr.val+")");else{var pair="'"+attr.name+"':("+attr.val+")";buf.push(pair)}}),classes.length&&(classes=classes.join(" + ' ' + "),buf.push("class: "+classes)),{buf:buf.join(", ").replace("class:",'"class":'),escaped:JSON.stringify(escaped),inherits:inherits,constant:constant}}};function isConstant(val){if(/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val))return!0;if(!isNaN(Number(val)))return!0;var matches;return(matches=/^ *\[(.*)\] *$/.exec(val))?matches[1].split(",").every(isConstant):!1}function escape(html){return String(html).replace(/&(?!\w+;)/g,"&").replace(//g,">").replace(/"/g,""")}}),require.register("doctypes.js",function(module,exports,require){module.exports={5:"","default":"",xml:'',transitional:'',strict:'',frameset:'',1.1:'',basic:'',mobile:''}}),require.register("filters.js",function(module,exports,require){module.exports={cdata:function(str){return""},sass:function(str){str=str.replace(/\\n/g,"\n");var sass=require("sass").render(str).replace(/\n/g,"\\n");return'"},stylus:function(str,options){var ret;str=str.replace(/\\n/g,"\n");var stylus=require("stylus");return stylus(str,options).render(function(err,css){if(err)throw err;ret=css.replace(/\n/g,"\\n")}),'"},less:function(str){var ret;return str=str.replace(/\\n/g,"\n"),require("less").render(str,function(err,css){if(err)throw err;ret='"}),ret},markdown:function(str){var md;try{md=require("markdown")}catch(err){try{md=require("discount")}catch(err){try{md=require("markdown-js")}catch(err){try{md=require("marked")}catch(err){throw new Error("Cannot find markdown library, install markdown, discount, or marked.")}}}}return str=str.replace(/\\n/g,"\n"),md.parse(str).replace(/\n/g,"\\n").replace(/'/g,"'")},coffeescript:function(str){str=str.replace(/\\n/g,"\n");var js=require("coffee-script").compile(str).replace(/\\/g,"\\\\").replace(/\n/g,"\\n");return'"}}}),require.register("inline-tags.js",function(module,exports,require){module.exports=["a","abbr","acronym","b","br","code","em","font","i","img","ins","kbd","map","samp","small","span","strong","sub","sup"]}),require.register("jade.js",function(module,exports,require){var Parser=require("./parser"),Lexer=require("./lexer"),Compiler=require("./compiler"),runtime=require("./runtime");exports.version="0.26.1",exports.selfClosing=require("./self-closing"),exports.doctypes=require("./doctypes"),exports.filters=require("./filters"),exports.utils=require("./utils"),exports.Compiler=Compiler,exports.Parser=Parser,exports.Lexer=Lexer,exports.nodes=require("./nodes"),exports.runtime=runtime,exports.cache={};function parse(str,options){try{var parser=new Parser(str,options.filename,options),compiler=new(options.compiler||Compiler)(parser.parse(),options),js=compiler.compile();return options.debug&&console.error("\nCompiled Function:\n\n%s",js.replace(/^/gm," ")),"var buf = [];\n"+(options.self?"var self = locals || {};\n"+js:"with (locals || {}) {\n"+js+"\n}\n")+'return buf.join("");'}catch(err){parser=parser.context(),runtime.rethrow(err,parser.filename,parser.lexer.lineno)}}exports.compile=function(str,options){var options=options||{},client=options.client,filename=options.filename?JSON.stringify(options.filename):"undefined",fn;return options.compileDebug!==!1?fn=["var __jade = [{ lineno: 1, filename: "+filename+" }];","try {",parse(String(str),options),"} catch (err) {"," rethrow(err, __jade[0].filename, __jade[0].lineno);","}"].join("\n"):fn=parse(String(str),options),client&&(fn="attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n"+fn),fn=new Function("locals, attrs, escape, rethrow, merge",fn),client?fn:function(locals){return fn(locals,runtime.attrs,runtime.escape,runtime.rethrow,runtime.merge)}},exports.render=function(str,options,fn){"function"==typeof options&&(fn=options,options={});if(options.cache&&!options.filename)return fn(new Error('the "filename" option is required for caching'));try{var path=options.filename,tmpl=options.cache?exports.cache[path]||(exports.cache[path]=exports.compile(str,options)):exports.compile(str,options);fn(null,tmpl(options))}catch(err){fn(err)}},exports.renderFile=function(path,options,fn){var key=path+":string";"function"==typeof options&&(fn=options,options={});try{options.filename=path;var str=options.cache?exports.cache[key]||(exports.cache[key]=fs.readFileSync(path,"utf8")):fs.readFileSync(path,"utf8");exports.render(str,options,fn)}catch(err){fn(err)}},exports.__express=exports.renderFile}),require.register("lexer.js",function(module,exports,require){var Lexer=module.exports=function Lexer(str,options){options=options||{},this.input=str.replace(/\r\n|\r/g,"\n"),this.colons=options.colons,this.deferredTokens=[],this.lastIndents=0,this.lineno=1,this.stash=[],this.indentStack=[],this.indentRe=null,this.pipeless=!1};Lexer.prototype={tok:function(type,val){return{type:type,line:this.lineno,val:val}},consume:function(len){this.input=this.input.substr(len)},scan:function(regexp,type){var captures;if(captures=regexp.exec(this.input))return this.consume(captures[0].length),this.tok(type,captures[1])},defer:function(tok){this.deferredTokens.push(tok)},lookahead:function(n){var fetch=n-this.stash.length;while(fetch-->0)this.stash.push(this.next());return this.stash[--n]},indexOfDelimiters:function(start,end){var str=this.input,nstart=0,nend=0,pos=0;for(var i=0,len=str.length;iindents)this.stash.push(this.tok("outdent")),this.indentStack.shift();tok=this.stash.pop()}else indents&&indents!=this.indentStack[0]?(this.indentStack.unshift(indents),tok=this.tok("indent",indents)):tok=this.tok("newline");return tok}},pipelessText:function(){if(this.pipeless){if("\n"==this.input[0])return;var i=this.input.indexOf("\n");-1==i&&(i=this.input.length);var str=this.input.substr(0,i);return this.consume(str.length),this.tok("text",str)}},colon:function(){return this.scan(/^: */,":")},advance:function(){return this.stashed()||this.next()},next:function(){return this.deferred()||this.blank()||this.eos()||this.pipelessText()||this.yield()||this.doctype()||this.interpolation()||this["case"]()||this.when()||this["default"]()||this["extends"]()||this.append()||this.prepend()||this.block()||this.include()||this.mixin()||this.call()||this.conditional()||this.each()||this["while"]()||this.assignment()||this.tag()||this.filter()||this.code()||this.id()||this.className()||this.attrs()||this.indent()||this.comment()||this.colon()||this.text()}}}),require.register("nodes/attrs.js",function(module,exports,require){var Node=require("./node"),Block=require("./block"),Attrs=module.exports=function Attrs(){this.attrs=[]};Attrs.prototype=new Node,Attrs.prototype.constructor=Attrs,Attrs.prototype.setAttribute=function(name,val,escaped){return this.attrs.push({name:name,val:val,escaped:escaped}),this},Attrs.prototype.removeAttribute=function(name){for(var i=0,len=this.attrs.length;i/g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err}}),require.register("self-closing.js",function(module,exports,require){module.exports=["meta","img","link","input","source","area","base","col","br","hr"]}),require.register("utils.js",function(module,exports,require){var interpolate=exports.interpolate=function(str){return str.replace(/(\\)?([#!]){(.*?)}/g,function(str,escape,flag,code){return escape?str:"' + "+("!"==flag?"":"escape")+"((interp = "+code.replace(/\\'/g,"'")+") == null ? '' : interp) + '"})},escape=exports.escape=function(str){return str.replace(/'/g,"\\'")};exports.text=function(str){return interpolate(escape(str))}}),window.jade=require("jade")})(); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/compiler.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/compiler.js deleted file mode 100644 index 516ac83..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/compiler.js +++ /dev/null @@ -1,642 +0,0 @@ - -/*! - * Jade - Compiler - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var nodes = require('./nodes') - , filters = require('./filters') - , doctypes = require('./doctypes') - , selfClosing = require('./self-closing') - , runtime = require('./runtime') - , utils = require('./utils'); - -// if browser -// -// if (!Object.keys) { -// Object.keys = function(obj){ -// var arr = []; -// for (var key in obj) { -// if (obj.hasOwnProperty(key)) { -// arr.push(key); -// } -// } -// return arr; -// } -// } -// -// if (!String.prototype.trimLeft) { -// String.prototype.trimLeft = function(){ -// return this.replace(/^\s+/, ''); -// } -// } -// -// end - - -/** - * Initialize `Compiler` with the given `node`. - * - * @param {Node} node - * @param {Object} options - * @api public - */ - -var Compiler = module.exports = function Compiler(node, options) { - this.options = options = options || {}; - this.node = node; - this.hasCompiledDoctype = false; - this.hasCompiledTag = false; - this.pp = options.pretty || false; - this.debug = false !== options.compileDebug; - this.indents = 0; - this.parentIndents = 0; - if (options.doctype) this.setDoctype(options.doctype); -}; - -/** - * Compiler prototype. - */ - -Compiler.prototype = { - - /** - * Compile parse tree to JavaScript. - * - * @api public - */ - - compile: function(){ - this.buf = ['var interp;']; - if (this.pp) this.buf.push("var __indent = [];"); - this.lastBufferedIdx = -1; - this.visit(this.node); - return this.buf.join('\n'); - }, - - /** - * Sets the default doctype `name`. Sets terse mode to `true` when - * html 5 is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {string} name - * @api public - */ - - setDoctype: function(name){ - var doctype = doctypes[(name || 'default').toLowerCase()]; - doctype = doctype || ''; - this.doctype = doctype; - this.terse = '5' == name || 'html' == name; - this.xml = 0 == this.doctype.indexOf(' 1 && !escape && block.nodes[0].isText && block.nodes[1].isText) - this.prettyIndent(1, true); - - for (var i = 0; i < len; ++i) { - // Pretty print text - if (pp && i > 0 && !escape && block.nodes[i].isText && block.nodes[i-1].isText) - this.prettyIndent(1, false); - - this.visit(block.nodes[i]); - // Multiple text nodes are separated by newlines - if (block.nodes[i+1] && block.nodes[i].isText && block.nodes[i+1].isText) - this.buffer('\\n'); - } - }, - - /** - * Visit `doctype`. Sets terse mode to `true` when html 5 - * is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {Doctype} doctype - * @api public - */ - - visitDoctype: function(doctype){ - if (doctype && (doctype.val || !this.doctype)) { - this.setDoctype(doctype.val || 'default'); - } - - if (this.doctype) this.buffer(this.doctype); - this.hasCompiledDoctype = true; - }, - - /** - * Visit `mixin`, generating a function that - * may be called within the template. - * - * @param {Mixin} mixin - * @api public - */ - - visitMixin: function(mixin){ - var name = mixin.name.replace(/-/g, '_') + '_mixin' - , args = mixin.args || '' - , block = mixin.block - , attrs = mixin.attrs - , pp = this.pp; - - if (mixin.call) { - if (pp) this.buf.push("__indent.push('" + Array(this.indents + 1).join(' ') + "');") - if (block || attrs.length) { - - this.buf.push(name + '.call({'); - - if (block) { - this.buf.push('block: function(){'); - - // Render block with no indents, dynamically added when rendered - this.parentIndents++; - var _indents = this.indents; - this.indents = 0; - this.visit(mixin.block); - this.indents = _indents; - this.parentIndents--; - - if (attrs.length) { - this.buf.push('},'); - } else { - this.buf.push('}'); - } - } - - if (attrs.length) { - var val = this.attrs(attrs); - if (val.inherits) { - this.buf.push('attributes: merge({' + val.buf - + '}, attributes), escaped: merge(' + val.escaped + ', escaped, true)'); - } else { - this.buf.push('attributes: {' + val.buf + '}, escaped: ' + val.escaped); - } - } - - if (args) { - this.buf.push('}, ' + args + ');'); - } else { - this.buf.push('});'); - } - - } else { - this.buf.push(name + '(' + args + ');'); - } - if (pp) this.buf.push("__indent.pop();") - } else { - this.buf.push('var ' + name + ' = function(' + args + '){'); - this.buf.push('var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};'); - this.parentIndents++; - this.visit(block); - this.parentIndents--; - this.buf.push('};'); - } - }, - - /** - * Visit `tag` buffering tag markup, generating - * attributes, visiting the `tag`'s code and block. - * - * @param {Tag} tag - * @api public - */ - - visitTag: function(tag){ - this.indents++; - var name = tag.name - , pp = this.pp; - - if (tag.buffer) name = "' + (" + name + ") + '"; - - if (!this.hasCompiledTag) { - if (!this.hasCompiledDoctype && 'html' == name) { - this.visitDoctype(); - } - this.hasCompiledTag = true; - } - - // pretty print - if (pp && !tag.isInline()) - this.prettyIndent(0, true); - - if ((~selfClosing.indexOf(name) || tag.selfClosing) && !this.xml) { - this.buffer('<' + name); - this.visitAttributes(tag.attrs); - this.terse - ? this.buffer('>') - : this.buffer('/>'); - } else { - // Optimize attributes buffering - if (tag.attrs.length) { - this.buffer('<' + name); - if (tag.attrs.length) this.visitAttributes(tag.attrs); - this.buffer('>'); - } else { - this.buffer('<' + name + '>'); - } - if (tag.code) this.visitCode(tag.code); - this.escape = 'pre' == tag.name; - this.visit(tag.block); - - // pretty print - if (pp && !tag.isInline() && 'pre' != tag.name && !tag.canInline()) - this.prettyIndent(0, true); - - this.buffer(''); - } - this.indents--; - }, - - /** - * Visit `filter`, throwing when the filter does not exist. - * - * @param {Filter} filter - * @api public - */ - - visitFilter: function(filter){ - var fn = filters[filter.name]; - - // unknown filter - if (!fn) { - if (filter.isASTFilter) { - throw new Error('unknown ast filter "' + filter.name + ':"'); - } else { - throw new Error('unknown filter ":' + filter.name + '"'); - } - } - - if (filter.isASTFilter) { - this.buf.push(fn(filter.block, this, filter.attrs)); - } else { - var text = filter.block.nodes.map(function(node){ return node.val }).join('\n'); - filter.attrs = filter.attrs || {}; - filter.attrs.filename = this.options.filename; - this.buffer(utils.text(fn(text, filter.attrs))); - } - }, - - /** - * Visit `text` node. - * - * @param {Text} text - * @api public - */ - - visitText: function(text){ - text = utils.text(text.val.replace(/\\/g, '\\\\')); - if (this.escape) text = escape(text); - this.buffer(text); - }, - - /** - * Visit a `comment`, only buffering when the buffer flag is set. - * - * @param {Comment} comment - * @api public - */ - - visitComment: function(comment){ - if (!comment.buffer) return; - if (this.pp) this.prettyIndent(1, true); - this.buffer(''); - }, - - /** - * Visit a `BlockComment`. - * - * @param {Comment} comment - * @api public - */ - - visitBlockComment: function(comment){ - if (!comment.buffer) return; - if (0 == comment.val.trim().indexOf('if')) { - this.buffer(''); - } else { - this.buffer(''); - } - }, - - /** - * Visit `code`, respecting buffer / escape flags. - * If the code is followed by a block, wrap it in - * a self-calling function. - * - * @param {Code} code - * @api public - */ - - visitCode: function(code){ - // Wrap code blocks with {}. - // we only wrap unbuffered code blocks ATM - // since they are usually flow control - - // Buffer code - if (code.buffer) { - var val = code.val.trimLeft(); - this.buf.push('var __val__ = ' + val); - val = 'null == __val__ ? "" : __val__'; - if (code.escape) val = 'escape(' + val + ')'; - this.buf.push("buf.push(" + val + ");"); - } else { - this.buf.push(code.val); - } - - // Block support - if (code.block) { - if (!code.buffer) this.buf.push('{'); - this.visit(code.block); - if (!code.buffer) this.buf.push('}'); - } - }, - - /** - * Visit `each` block. - * - * @param {Each} each - * @api public - */ - - visitEach: function(each){ - this.buf.push('' - + '// iterate ' + each.obj + '\n' - + ';(function(){\n' - + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' - + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push('' - + ' }\n' - + ' } else {\n' - + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' - // if browser - // + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' - // end - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - // if browser - // this.buf.push(' }\n'); - // end - - this.buf.push(' }\n }\n}).call(this);\n'); - }, - - /** - * Visit `attrs`. - * - * @param {Array} attrs - * @api public - */ - - visitAttributes: function(attrs){ - var val = this.attrs(attrs); - if (val.inherits) { - this.buf.push("buf.push(attrs(merge({ " + val.buf + - " }, attributes), merge(" + val.escaped + ", escaped, true)));"); - } else if (val.constant) { - eval('var buf={' + val.buf + '};'); - this.buffer(runtime.attrs(buf, JSON.parse(val.escaped)), true); - } else { - this.buf.push("buf.push(attrs({ " + val.buf + " }, " + val.escaped + "));"); - } - }, - - /** - * Compile attributes. - */ - - attrs: function(attrs){ - var buf = [] - , classes = [] - , escaped = {} - , constant = attrs.every(function(attr){ return isConstant(attr.val) }) - , inherits = false; - - if (this.terse) buf.push('terse: true'); - - attrs.forEach(function(attr){ - if (attr.name == 'attributes') return inherits = true; - escaped[attr.name] = attr.escaped; - if (attr.name == 'class') { - classes.push('(' + attr.val + ')'); - } else { - var pair = "'" + attr.name + "':(" + attr.val + ')'; - buf.push(pair); - } - }); - - if (classes.length) { - classes = classes.join(" + ' ' + "); - buf.push("class: " + classes); - } - - return { - buf: buf.join(', ').replace('class:', '"class":'), - escaped: JSON.stringify(escaped), - inherits: inherits, - constant: constant - }; - } -}; - -/** - * Check if expression can be evaluated to a constant - * - * @param {String} expression - * @return {Boolean} - * @api private - */ - -function isConstant(val){ - // Check strings/literals - if (/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val)) - return true; - - // Check numbers - if (!isNaN(Number(val))) - return true; - - // Check arrays - var matches; - if (matches = /^ *\[(.*)\] *$/.exec(val)) - return matches[1].split(',').every(isConstant); - - return false; -} - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/doctypes.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/doctypes.js deleted file mode 100644 index e87ca1e..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/doctypes.js +++ /dev/null @@ -1,18 +0,0 @@ - -/*! - * Jade - doctypes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - '5': '' - , 'default': '' - , 'xml': '' - , 'transitional': '' - , 'strict': '' - , 'frameset': '' - , '1.1': '' - , 'basic': '' - , 'mobile': '' -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/filters.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/filters.js deleted file mode 100644 index fdb634c..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/filters.js +++ /dev/null @@ -1,97 +0,0 @@ - -/*! - * Jade - filters - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - - /** - * Wrap text with CDATA block. - */ - - cdata: function(str){ - return ''; - }, - - /** - * Transform sass to css, wrapped in style tags. - */ - - sass: function(str){ - str = str.replace(/\\n/g, '\n'); - var sass = require('sass').render(str).replace(/\n/g, '\\n'); - return ''; - }, - - /** - * Transform stylus to css, wrapped in style tags. - */ - - stylus: function(str, options){ - var ret; - str = str.replace(/\\n/g, '\n'); - var stylus = require('stylus'); - stylus(str, options).render(function(err, css){ - if (err) throw err; - ret = css.replace(/\n/g, '\\n'); - }); - return ''; - }, - - /** - * Transform less to css, wrapped in style tags. - */ - - less: function(str){ - var ret; - str = str.replace(/\\n/g, '\n'); - require('less').render(str, function(err, css){ - if (err) throw err; - ret = ''; - }); - return ret; - }, - - /** - * Transform markdown to html. - */ - - markdown: function(str){ - var md; - - // support markdown / discount - try { - md = require('markdown'); - } catch (err){ - try { - md = require('discount'); - } catch (err) { - try { - md = require('markdown-js'); - } catch (err) { - try { - md = require('marked'); - } catch (err) { - throw new - Error('Cannot find markdown library, install markdown, discount, or marked.'); - } - } - } - } - - str = str.replace(/\\n/g, '\n'); - return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); - }, - - /** - * Transform coffeescript to javascript. - */ - - coffeescript: function(str){ - str = str.replace(/\\n/g, '\n'); - var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n'); - return ''; - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/inline-tags.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/inline-tags.js deleted file mode 100644 index 491de0b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/inline-tags.js +++ /dev/null @@ -1,28 +0,0 @@ - -/*! - * Jade - inline tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'a' - , 'abbr' - , 'acronym' - , 'b' - , 'br' - , 'code' - , 'em' - , 'font' - , 'i' - , 'img' - , 'ins' - , 'kbd' - , 'map' - , 'samp' - , 'small' - , 'span' - , 'strong' - , 'sub' - , 'sup' -]; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/jade.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/jade.js deleted file mode 100644 index 00f0abb..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/jade.js +++ /dev/null @@ -1,237 +0,0 @@ -/*! - * Jade - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Parser = require('./parser') - , Lexer = require('./lexer') - , Compiler = require('./compiler') - , runtime = require('./runtime') -// if node - , fs = require('fs'); -// end - -/** - * Library version. - */ - -exports.version = '0.26.3'; - -/** - * Expose self closing tags. - */ - -exports.selfClosing = require('./self-closing'); - -/** - * Default supported doctypes. - */ - -exports.doctypes = require('./doctypes'); - -/** - * Text filters. - */ - -exports.filters = require('./filters'); - -/** - * Utilities. - */ - -exports.utils = require('./utils'); - -/** - * Expose `Compiler`. - */ - -exports.Compiler = Compiler; - -/** - * Expose `Parser`. - */ - -exports.Parser = Parser; - -/** - * Expose `Lexer`. - */ - -exports.Lexer = Lexer; - -/** - * Nodes. - */ - -exports.nodes = require('./nodes'); - -/** - * Jade runtime helpers. - */ - -exports.runtime = runtime; - -/** - * Template function cache. - */ - -exports.cache = {}; - -/** - * Parse the given `str` of jade and return a function body. - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api private - */ - -function parse(str, options){ - try { - // Parse - var parser = new Parser(str, options.filename, options); - - // Compile - var compiler = new (options.compiler || Compiler)(parser.parse(), options) - , js = compiler.compile(); - - // Debug compiler - if (options.debug) { - console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); - } - - return '' - + 'var buf = [];\n' - + (options.self - ? 'var self = locals || {};\n' + js - : 'with (locals || {}) {\n' + js + '\n}\n') - + 'return buf.join("");'; - } catch (err) { - parser = parser.context(); - runtime.rethrow(err, parser.filename, parser.lexer.lineno); - } -} - -/** - * Compile a `Function` representation of the given jade `str`. - * - * Options: - * - * - `compileDebug` when `false` debugging code is stripped from the compiled template - * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` - * for use with the Jade client-side runtime.js - * - * @param {String} str - * @param {Options} options - * @return {Function} - * @api public - */ - -exports.compile = function(str, options){ - var options = options || {} - , client = options.client - , filename = options.filename - ? JSON.stringify(options.filename) - : 'undefined' - , fn; - - if (options.compileDebug !== false) { - fn = [ - 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' - , 'try {' - , parse(String(str), options) - , '} catch (err) {' - , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' - , '}' - ].join('\n'); - } else { - fn = parse(String(str), options); - } - - if (client) { - fn = 'attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n' + fn; - } - - fn = new Function('locals, attrs, escape, rethrow, merge', fn); - - if (client) return fn; - - return function(locals){ - return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow, runtime.merge); - }; -}; - -/** - * Render the given `str` of jade and invoke - * the callback `fn(err, str)`. - * - * Options: - * - * - `cache` enable template caching - * - `filename` filename required for `include` / `extends` and caching - * - * @param {String} str - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -exports.render = function(str, options, fn){ - // swap args - if ('function' == typeof options) { - fn = options, options = {}; - } - - // cache requires .filename - if (options.cache && !options.filename) { - return fn(new Error('the "filename" option is required for caching')); - } - - try { - var path = options.filename; - var tmpl = options.cache - ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) - : exports.compile(str, options); - fn(null, tmpl(options)); - } catch (err) { - fn(err); - } -}; - -/** - * Render a Jade file at the given `path` and callback `fn(err, str)`. - * - * @param {String} path - * @param {Object|Function} options or callback - * @param {Function} fn - * @api public - */ - -exports.renderFile = function(path, options, fn){ - var key = path + ':string'; - - if ('function' == typeof options) { - fn = options, options = {}; - } - - try { - options.filename = path; - var str = options.cache - ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) - : fs.readFileSync(path, 'utf8'); - exports.render(str, options, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Express support. - */ - -exports.__express = exports.renderFile; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/lexer.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/lexer.js deleted file mode 100644 index bca314a..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/lexer.js +++ /dev/null @@ -1,771 +0,0 @@ - -/*! - * Jade - Lexer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize `Lexer` with the given `str`. - * - * Options: - * - * - `colons` allow colons for attr delimiters - * - * @param {String} str - * @param {Object} options - * @api private - */ - -var Lexer = module.exports = function Lexer(str, options) { - options = options || {}; - this.input = str.replace(/\r\n|\r/g, '\n'); - this.colons = options.colons; - this.deferredTokens = []; - this.lastIndents = 0; - this.lineno = 1; - this.stash = []; - this.indentStack = []; - this.indentRe = null; - this.pipeless = false; -}; - -/** - * Lexer prototype. - */ - -Lexer.prototype = { - - /** - * Construct a token with the given `type` and `val`. - * - * @param {String} type - * @param {String} val - * @return {Object} - * @api private - */ - - tok: function(type, val){ - return { - type: type - , line: this.lineno - , val: val - } - }, - - /** - * Consume the given `len` of input. - * - * @param {Number} len - * @api private - */ - - consume: function(len){ - this.input = this.input.substr(len); - }, - - /** - * Scan for `type` with the given `regexp`. - * - * @param {String} type - * @param {RegExp} regexp - * @return {Object} - * @api private - */ - - scan: function(regexp, type){ - var captures; - if (captures = regexp.exec(this.input)) { - this.consume(captures[0].length); - return this.tok(type, captures[1]); - } - }, - - /** - * Defer the given `tok`. - * - * @param {Object} tok - * @api private - */ - - defer: function(tok){ - this.deferredTokens.push(tok); - }, - - /** - * Lookahead `n` tokens. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - var fetch = n - this.stash.length; - while (fetch-- > 0) this.stash.push(this.next()); - return this.stash[--n]; - }, - - /** - * Return the indexOf `start` / `end` delimiters. - * - * @param {String} start - * @param {String} end - * @return {Number} - * @api private - */ - - indexOfDelimiters: function(start, end){ - var str = this.input - , nstart = 0 - , nend = 0 - , pos = 0; - for (var i = 0, len = str.length; i < len; ++i) { - if (start == str.charAt(i)) { - ++nstart; - } else if (end == str.charAt(i)) { - if (++nend == nstart) { - pos = i; - break; - } - } - } - return pos; - }, - - /** - * Stashed token. - */ - - stashed: function() { - return this.stash.length - && this.stash.shift(); - }, - - /** - * Deferred token. - */ - - deferred: function() { - return this.deferredTokens.length - && this.deferredTokens.shift(); - }, - - /** - * end-of-source. - */ - - eos: function() { - if (this.input.length) return; - if (this.indentStack.length) { - this.indentStack.shift(); - return this.tok('outdent'); - } else { - return this.tok('eos'); - } - }, - - /** - * Blank line. - */ - - blank: function() { - var captures; - if (captures = /^\n *\n/.exec(this.input)) { - this.consume(captures[0].length - 1); - if (this.pipeless) return this.tok('text', ''); - return this.next(); - } - }, - - /** - * Comment. - */ - - comment: function() { - var captures; - if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('comment', captures[2]); - tok.buffer = '-' != captures[1]; - return tok; - } - }, - - /** - * Interpolated tag. - */ - - interpolation: function() { - var captures; - if (captures = /^#\{(.*?)\}/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('interpolation', captures[1]); - } - }, - - /** - * Tag. - */ - - tag: function() { - var captures; - if (captures = /^(\w[-:\w]*)(\/?)/.exec(this.input)) { - this.consume(captures[0].length); - var tok, name = captures[1]; - if (':' == name[name.length - 1]) { - name = name.slice(0, -1); - tok = this.tok('tag', name); - this.defer(this.tok(':')); - while (' ' == this.input[0]) this.input = this.input.substr(1); - } else { - tok = this.tok('tag', name); - } - tok.selfClosing = !! captures[2]; - return tok; - } - }, - - /** - * Filter. - */ - - filter: function() { - return this.scan(/^:(\w+)/, 'filter'); - }, - - /** - * Doctype. - */ - - doctype: function() { - return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); - }, - - /** - * Id. - */ - - id: function() { - return this.scan(/^#([\w-]+)/, 'id'); - }, - - /** - * Class. - */ - - className: function() { - return this.scan(/^\.([\w-]+)/, 'class'); - }, - - /** - * Text. - */ - - text: function() { - return this.scan(/^(?:\| ?| ?)?([^\n]+)/, 'text'); - }, - - /** - * Extends. - */ - - "extends": function() { - return this.scan(/^extends? +([^\n]+)/, 'extends'); - }, - - /** - * Block prepend. - */ - - prepend: function() { - var captures; - if (captures = /^prepend +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'prepend' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block append. - */ - - append: function() { - var captures; - if (captures = /^append +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'append' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block. - */ - - block: function() { - var captures; - if (captures = /^block\b *(?:(prepend|append) +)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = captures[1] || 'replace' - , name = captures[2] - , tok = this.tok('block', name); - - tok.mode = mode; - return tok; - } - }, - - /** - * Yield. - */ - - yield: function() { - return this.scan(/^yield */, 'yield'); - }, - - /** - * Include. - */ - - include: function() { - return this.scan(/^include +([^\n]+)/, 'include'); - }, - - /** - * Case. - */ - - "case": function() { - return this.scan(/^case +([^\n]+)/, 'case'); - }, - - /** - * When. - */ - - when: function() { - return this.scan(/^when +([^:\n]+)/, 'when'); - }, - - /** - * Default. - */ - - "default": function() { - return this.scan(/^default */, 'default'); - }, - - /** - * Assignment. - */ - - assignment: function() { - var captures; - if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { - this.consume(captures[0].length); - var name = captures[1] - , val = captures[2]; - return this.tok('code', 'var ' + name + ' = (' + val + ');'); - } - }, - - /** - * Call mixin. - */ - - call: function(){ - var captures; - if (captures = /^\+([-\w]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('call', captures[1]); - - // Check for args (not attributes) - if (captures = /^ *\((.*?)\)/.exec(this.input)) { - if (!/^ *[-\w]+ *=/.test(captures[1])) { - this.consume(captures[0].length); - tok.args = captures[1]; - } - } - - return tok; - } - }, - - /** - * Mixin. - */ - - mixin: function(){ - var captures; - if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('mixin', captures[1]); - tok.args = captures[2]; - return tok; - } - }, - - /** - * Conditional. - */ - - conditional: function() { - var captures; - if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var type = captures[1] - , js = captures[2]; - - switch (type) { - case 'if': js = 'if (' + js + ')'; break; - case 'unless': js = 'if (!(' + js + '))'; break; - case 'else if': js = 'else if (' + js + ')'; break; - case 'else': js = 'else'; break; - } - - return this.tok('code', js); - } - }, - - /** - * While. - */ - - "while": function() { - var captures; - if (captures = /^while +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('code', 'while (' + captures[1] + ')'); - } - }, - - /** - * Each. - */ - - each: function() { - var captures; - if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('each', captures[1]); - tok.key = captures[2] || '$index'; - tok.code = captures[3]; - return tok; - } - }, - - /** - * Code. - */ - - code: function() { - var captures; - if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var flags = captures[1]; - captures[1] = captures[2]; - var tok = this.tok('code', captures[1]); - tok.escape = flags[0] === '='; - tok.buffer = flags[0] === '=' || flags[1] === '='; - return tok; - } - }, - - /** - * Attributes. - */ - - attrs: function() { - if ('(' == this.input.charAt(0)) { - var index = this.indexOfDelimiters('(', ')') - , str = this.input.substr(1, index-1) - , tok = this.tok('attrs') - , len = str.length - , colons = this.colons - , states = ['key'] - , escapedAttr - , key = '' - , val = '' - , quote - , c - , p; - - function state(){ - return states[states.length - 1]; - } - - function interpolate(attr) { - return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ - return quote + " + (" + expr + ") + " + quote; - }); - } - - this.consume(index + 1); - tok.attrs = {}; - tok.escaped = {}; - - function parse(c) { - var real = c; - // TODO: remove when people fix ":" - if (colons && ':' == c) c = '='; - switch (c) { - case ',': - case '\n': - switch (state()) { - case 'expr': - case 'array': - case 'string': - case 'object': - val += c; - break; - default: - states.push('key'); - val = val.trim(); - key = key.trim(); - if ('' == key) return; - key = key.replace(/^['"]|['"]$/g, '').replace('!', ''); - tok.escaped[key] = escapedAttr; - tok.attrs[key] = '' == val - ? true - : interpolate(val); - key = val = ''; - } - break; - case '=': - switch (state()) { - case 'key char': - key += real; - break; - case 'val': - case 'expr': - case 'array': - case 'string': - case 'object': - val += real; - break; - default: - escapedAttr = '!' != p; - states.push('val'); - } - break; - case '(': - if ('val' == state() - || 'expr' == state()) states.push('expr'); - val += c; - break; - case ')': - if ('expr' == state() - || 'val' == state()) states.pop(); - val += c; - break; - case '{': - if ('val' == state()) states.push('object'); - val += c; - break; - case '}': - if ('object' == state()) states.pop(); - val += c; - break; - case '[': - if ('val' == state()) states.push('array'); - val += c; - break; - case ']': - if ('array' == state()) states.pop(); - val += c; - break; - case '"': - case "'": - switch (state()) { - case 'key': - states.push('key char'); - break; - case 'key char': - states.pop(); - break; - case 'string': - if (c == quote) states.pop(); - val += c; - break; - default: - states.push('string'); - val += c; - quote = c; - } - break; - case '': - break; - default: - switch (state()) { - case 'key': - case 'key char': - key += c; - break; - default: - val += c; - } - } - p = c; - } - - for (var i = 0; i < len; ++i) { - parse(str.charAt(i)); - } - - parse(','); - - if ('/' == this.input.charAt(0)) { - this.consume(1); - tok.selfClosing = true; - } - - return tok; - } - }, - - /** - * Indent | Outdent | Newline. - */ - - indent: function() { - var captures, re; - - // established regexp - if (this.indentRe) { - captures = this.indentRe.exec(this.input); - // determine regexp - } else { - // tabs - re = /^\n(\t*) */; - captures = re.exec(this.input); - - // spaces - if (captures && !captures[1].length) { - re = /^\n( *)/; - captures = re.exec(this.input); - } - - // established - if (captures && captures[1].length) this.indentRe = re; - } - - if (captures) { - var tok - , indents = captures[1].length; - - ++this.lineno; - this.consume(indents + 1); - - if (' ' == this.input[0] || '\t' == this.input[0]) { - throw new Error('Invalid indentation, you can use tabs or spaces but not both'); - } - - // blank line - if ('\n' == this.input[0]) return this.tok('newline'); - - // outdent - if (this.indentStack.length && indents < this.indentStack[0]) { - while (this.indentStack.length && this.indentStack[0] > indents) { - this.stash.push(this.tok('outdent')); - this.indentStack.shift(); - } - tok = this.stash.pop(); - // indent - } else if (indents && indents != this.indentStack[0]) { - this.indentStack.unshift(indents); - tok = this.tok('indent', indents); - // newline - } else { - tok = this.tok('newline'); - } - - return tok; - } - }, - - /** - * Pipe-less text consumed only when - * pipeless is true; - */ - - pipelessText: function() { - if (this.pipeless) { - if ('\n' == this.input[0]) return; - var i = this.input.indexOf('\n'); - if (-1 == i) i = this.input.length; - var str = this.input.substr(0, i); - this.consume(str.length); - return this.tok('text', str); - } - }, - - /** - * ':' - */ - - colon: function() { - return this.scan(/^: */, ':'); - }, - - /** - * Return the next token object, or those - * previously stashed by lookahead. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.stashed() - || this.next(); - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - next: function() { - return this.deferred() - || this.blank() - || this.eos() - || this.pipelessText() - || this.yield() - || this.doctype() - || this.interpolation() - || this["case"]() - || this.when() - || this["default"]() - || this["extends"]() - || this.append() - || this.prepend() - || this.block() - || this.include() - || this.mixin() - || this.call() - || this.conditional() - || this.each() - || this["while"]() - || this.assignment() - || this.tag() - || this.filter() - || this.code() - || this.id() - || this.className() - || this.attrs() - || this.indent() - || this.comment() - || this.colon() - || this.text(); - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/attrs.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/attrs.js deleted file mode 100644 index 5de9b59..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/attrs.js +++ /dev/null @@ -1,77 +0,0 @@ - -/*! - * Jade - nodes - Attrs - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'), - Block = require('./block'); - -/** - * Initialize a `Attrs` node. - * - * @api public - */ - -var Attrs = module.exports = function Attrs() { - this.attrs = []; -}; - -/** - * Inherit from `Node`. - */ - -Attrs.prototype.__proto__ = Node.prototype; - -/** - * Set attribute `name` to `val`, keep in mind these become - * part of a raw js object literal, so to quote a value you must - * '"quote me"', otherwise or example 'user.name' is literal JavaScript. - * - * @param {String} name - * @param {String} val - * @param {Boolean} escaped - * @return {Tag} for chaining - * @api public - */ - -Attrs.prototype.setAttribute = function(name, val, escaped){ - this.attrs.push({ name: name, val: val, escaped: escaped }); - return this; -}; - -/** - * Remove attribute `name` when present. - * - * @param {String} name - * @api public - */ - -Attrs.prototype.removeAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - delete this.attrs[i]; - } - } -}; - -/** - * Get attribute value by `name`. - * - * @param {String} name - * @return {String} - * @api public - */ - -Attrs.prototype.getAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - return this.attrs[i].val; - } - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js deleted file mode 100644 index 4f41e4a..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js +++ /dev/null @@ -1,33 +0,0 @@ - -/*! - * Jade - nodes - BlockComment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `BlockComment` with the given `block`. - * - * @param {String} val - * @param {Block} block - * @param {Boolean} buffer - * @api public - */ - -var BlockComment = module.exports = function BlockComment(val, block, buffer) { - this.block = block; - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -BlockComment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/block.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/block.js deleted file mode 100644 index bb00a1d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/block.js +++ /dev/null @@ -1,121 +0,0 @@ - -/*! - * Jade - nodes - Block - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Block` with an optional `node`. - * - * @param {Node} node - * @api public - */ - -var Block = module.exports = function Block(node){ - this.nodes = []; - if (node) this.push(node); -}; - -/** - * Inherit from `Node`. - */ - -Block.prototype.__proto__ = Node.prototype; - -/** - * Block flag. - */ - -Block.prototype.isBlock = true; - -/** - * Replace the nodes in `other` with the nodes - * in `this` block. - * - * @param {Block} other - * @api private - */ - -Block.prototype.replace = function(other){ - other.nodes = this.nodes; -}; - -/** - * Pust the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.push = function(node){ - return this.nodes.push(node); -}; - -/** - * Check if this block is empty. - * - * @return {Boolean} - * @api public - */ - -Block.prototype.isEmpty = function(){ - return 0 == this.nodes.length; -}; - -/** - * Unshift the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.unshift = function(node){ - return this.nodes.unshift(node); -}; - -/** - * Return the "last" block, or the first `yield` node. - * - * @return {Block} - * @api private - */ - -Block.prototype.includeBlock = function(){ - var ret = this - , node; - - for (var i = 0, len = this.nodes.length; i < len; ++i) { - node = this.nodes[i]; - if (node.yield) return node; - else if (node.textOnly) continue; - else if (node.includeBlock) ret = node.includeBlock(); - else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); - } - - return ret; -}; - -/** - * Return a clone of this block. - * - * @return {Block} - * @api private - */ - -Block.prototype.clone = function(){ - var clone = new Block; - for (var i = 0, len = this.nodes.length; i < len; ++i) { - clone.push(this.nodes[i].clone()); - } - return clone; -}; - diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/case.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/case.js deleted file mode 100644 index 08ff033..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/case.js +++ /dev/null @@ -1,43 +0,0 @@ - -/*! - * Jade - nodes - Case - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Case` with `expr`. - * - * @param {String} expr - * @api public - */ - -var Case = exports = module.exports = function Case(expr, block){ - this.expr = expr; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Case.prototype.__proto__ = Node.prototype; - -var When = exports.When = function When(expr, block){ - this.expr = expr; - this.block = block; - this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -When.prototype.__proto__ = Node.prototype; - diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/code.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/code.js deleted file mode 100644 index babc675..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/code.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Code - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Code` node with the given code `val`. - * Code may also be optionally buffered and escaped. - * - * @param {String} val - * @param {Boolean} buffer - * @param {Boolean} escape - * @api public - */ - -var Code = module.exports = function Code(val, buffer, escape) { - this.val = val; - this.buffer = buffer; - this.escape = escape; - if (val.match(/^ *else/)) this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -Code.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/comment.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/comment.js deleted file mode 100644 index 2e1469e..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/comment.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Jade - nodes - Comment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Comment` with the given `val`, optionally `buffer`, - * otherwise the comment may render in the output. - * - * @param {String} val - * @param {Boolean} buffer - * @api public - */ - -var Comment = module.exports = function Comment(val, buffer) { - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -Comment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/doctype.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/doctype.js deleted file mode 100644 index b8f33e5..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/doctype.js +++ /dev/null @@ -1,29 +0,0 @@ - -/*! - * Jade - nodes - Doctype - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Doctype` with the given `val`. - * - * @param {String} val - * @api public - */ - -var Doctype = module.exports = function Doctype(val) { - this.val = val; -}; - -/** - * Inherit from `Node`. - */ - -Doctype.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/each.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/each.js deleted file mode 100644 index f54101f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/each.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Each - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize an `Each` node, representing iteration - * - * @param {String} obj - * @param {String} val - * @param {String} key - * @param {Block} block - * @api public - */ - -var Each = module.exports = function Each(obj, val, key, block) { - this.obj = obj; - this.val = val; - this.key = key; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Each.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/filter.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/filter.js deleted file mode 100644 index 851a004..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/filter.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Filter - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node') - , Block = require('./block'); - -/** - * Initialize a `Filter` node with the given - * filter `name` and `block`. - * - * @param {String} name - * @param {Block|Node} block - * @api public - */ - -var Filter = module.exports = function Filter(name, block, attrs) { - this.name = name; - this.block = block; - this.attrs = attrs; - this.isASTFilter = !block.nodes.every(function(node){ return node.isText }); -}; - -/** - * Inherit from `Node`. - */ - -Filter.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/index.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/index.js deleted file mode 100644 index 386ad2f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/index.js +++ /dev/null @@ -1,20 +0,0 @@ - -/*! - * Jade - nodes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -exports.Node = require('./node'); -exports.Tag = require('./tag'); -exports.Code = require('./code'); -exports.Each = require('./each'); -exports.Case = require('./case'); -exports.Text = require('./text'); -exports.Block = require('./block'); -exports.Mixin = require('./mixin'); -exports.Filter = require('./filter'); -exports.Comment = require('./comment'); -exports.Literal = require('./literal'); -exports.BlockComment = require('./block-comment'); -exports.Doctype = require('./doctype'); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/literal.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/literal.js deleted file mode 100644 index fde586b..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/literal.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Jade - nodes - Literal - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Literal` node with the given `str. - * - * @param {String} str - * @api public - */ - -var Literal = module.exports = function Literal(str) { - this.str = str - .replace(/\\/g, "\\\\") - .replace(/\n|\r\n/g, "\\n") - .replace(/'/g, "\\'"); -}; - -/** - * Inherit from `Node`. - */ - -Literal.prototype.__proto__ = Node.prototype; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/mixin.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/mixin.js deleted file mode 100644 index 8407bc7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/mixin.js +++ /dev/null @@ -1,36 +0,0 @@ - -/*! - * Jade - nodes - Mixin - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Attrs = require('./attrs'); - -/** - * Initialize a new `Mixin` with `name` and `block`. - * - * @param {String} name - * @param {String} args - * @param {Block} block - * @api public - */ - -var Mixin = module.exports = function Mixin(name, args, block, call){ - this.name = name; - this.args = args; - this.block = block; - this.attrs = []; - this.call = call; -}; - -/** - * Inherit from `Attrs`. - */ - -Mixin.prototype.__proto__ = Attrs.prototype; - diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/node.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/node.js deleted file mode 100644 index e98f042..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/node.js +++ /dev/null @@ -1,25 +0,0 @@ - -/*! - * Jade - nodes - Node - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize a `Node`. - * - * @api public - */ - -var Node = module.exports = function Node(){}; - -/** - * Clone this node (return itself) - * - * @return {Node} - * @api private - */ - -Node.prototype.clone = function(){ - return this; -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/tag.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/tag.js deleted file mode 100644 index 4b6728a..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/tag.js +++ /dev/null @@ -1,95 +0,0 @@ - -/*! - * Jade - nodes - Tag - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Attrs = require('./attrs'), - Block = require('./block'), - inlineTags = require('../inline-tags'); - -/** - * Initialize a `Tag` node with the given tag `name` and optional `block`. - * - * @param {String} name - * @param {Block} block - * @api public - */ - -var Tag = module.exports = function Tag(name, block) { - this.name = name; - this.attrs = []; - this.block = block || new Block; -}; - -/** - * Inherit from `Attrs`. - */ - -Tag.prototype.__proto__ = Attrs.prototype; - -/** - * Clone this tag. - * - * @return {Tag} - * @api private - */ - -Tag.prototype.clone = function(){ - var clone = new Tag(this.name, this.block.clone()); - clone.line = this.line; - clone.attrs = this.attrs; - clone.textOnly = this.textOnly; - return clone; -}; - -/** - * Check if this tag is an inline tag. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.isInline = function(){ - return ~inlineTags.indexOf(this.name); -}; - -/** - * Check if this tag's contents can be inlined. Used for pretty printing. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.canInline = function(){ - var nodes = this.block.nodes; - - function isInline(node){ - // Recurse if the node is a block - if (node.isBlock) return node.nodes.every(isInline); - return node.isText || (node.isInline && node.isInline()); - } - - // Empty tag - if (!nodes.length) return true; - - // Text-only or inline-only tag - if (1 == nodes.length) return isInline(nodes[0]); - - // Multi-line inline-only tag - if (this.block.nodes.every(isInline)) { - for (var i = 1, len = nodes.length; i < len; ++i) { - if (nodes[i-1].isText && nodes[i].isText) - return false; - } - return true; - } - - // Mixed tag - return false; -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/text.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/text.js deleted file mode 100644 index 3b5dd55..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/nodes/text.js +++ /dev/null @@ -1,36 +0,0 @@ - -/*! - * Jade - nodes - Text - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Text` node with optional `line`. - * - * @param {String} line - * @api public - */ - -var Text = module.exports = function Text(line) { - this.val = ''; - if ('string' == typeof line) this.val = line; -}; - -/** - * Inherit from `Node`. - */ - -Text.prototype.__proto__ = Node.prototype; - -/** - * Flag as text. - */ - -Text.prototype.isText = true; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/parser.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/parser.js deleted file mode 100644 index 92f2af0..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/parser.js +++ /dev/null @@ -1,710 +0,0 @@ - -/*! - * Jade - Parser - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Lexer = require('./lexer') - , nodes = require('./nodes'); - -/** - * Initialize `Parser` with the given input `str` and `filename`. - * - * @param {String} str - * @param {String} filename - * @param {Object} options - * @api public - */ - -var Parser = exports = module.exports = function Parser(str, filename, options){ - this.input = str; - this.lexer = new Lexer(str, options); - this.filename = filename; - this.blocks = {}; - this.mixins = {}; - this.options = options; - this.contexts = [this]; -}; - -/** - * Tags that may not contain tags. - */ - -var textOnly = exports.textOnly = ['script', 'style']; - -/** - * Parser prototype. - */ - -Parser.prototype = { - - /** - * Push `parser` onto the context stack, - * or pop and return a `Parser`. - */ - - context: function(parser){ - if (parser) { - this.contexts.push(parser); - } else { - return this.contexts.pop(); - } - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.lexer.advance(); - }, - - /** - * Skip `n` tokens. - * - * @param {Number} n - * @api private - */ - - skip: function(n){ - while (n--) this.advance(); - }, - - /** - * Single token lookahead. - * - * @return {Object} - * @api private - */ - - peek: function() { - return this.lookahead(1); - }, - - /** - * Return lexer lineno. - * - * @return {Number} - * @api private - */ - - line: function() { - return this.lexer.lineno; - }, - - /** - * `n` token lookahead. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - return this.lexer.lookahead(n); - }, - - /** - * Parse input returning a string of js for evaluation. - * - * @return {String} - * @api public - */ - - parse: function(){ - var block = new nodes.Block, parser; - block.line = this.line(); - - while ('eos' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - - if (parser = this.extending) { - this.context(parser); - var ast = parser.parse(); - this.context(); - // hoist mixins - for (var name in this.mixins) - ast.unshift(this.mixins[name]); - return ast; - } - - return block; - }, - - /** - * Expect the given type, or throw an exception. - * - * @param {String} type - * @api private - */ - - expect: function(type){ - if (this.peek().type === type) { - return this.advance(); - } else { - throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); - } - }, - - /** - * Accept the given `type`. - * - * @param {String} type - * @api private - */ - - accept: function(type){ - if (this.peek().type === type) { - return this.advance(); - } - }, - - /** - * tag - * | doctype - * | mixin - * | include - * | filter - * | comment - * | text - * | each - * | code - * | yield - * | id - * | class - * | interpolation - */ - - parseExpr: function(){ - switch (this.peek().type) { - case 'tag': - return this.parseTag(); - case 'mixin': - return this.parseMixin(); - case 'block': - return this.parseBlock(); - case 'case': - return this.parseCase(); - case 'when': - return this.parseWhen(); - case 'default': - return this.parseDefault(); - case 'extends': - return this.parseExtends(); - case 'include': - return this.parseInclude(); - case 'doctype': - return this.parseDoctype(); - case 'filter': - return this.parseFilter(); - case 'comment': - return this.parseComment(); - case 'text': - return this.parseText(); - case 'each': - return this.parseEach(); - case 'code': - return this.parseCode(); - case 'call': - return this.parseCall(); - case 'interpolation': - return this.parseInterpolation(); - case 'yield': - this.advance(); - var block = new nodes.Block; - block.yield = true; - return block; - case 'id': - case 'class': - var tok = this.advance(); - this.lexer.defer(this.lexer.tok('tag', 'div')); - this.lexer.defer(tok); - return this.parseExpr(); - default: - throw new Error('unexpected token "' + this.peek().type + '"'); - } - }, - - /** - * Text - */ - - parseText: function(){ - var tok = this.expect('text') - , node = new nodes.Text(tok.val); - node.line = this.line(); - return node; - }, - - /** - * ':' expr - * | block - */ - - parseBlockExpansion: function(){ - if (':' == this.peek().type) { - this.advance(); - return new nodes.Block(this.parseExpr()); - } else { - return this.block(); - } - }, - - /** - * case - */ - - parseCase: function(){ - var val = this.expect('case').val - , node = new nodes.Case(val); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * when - */ - - parseWhen: function(){ - var val = this.expect('when').val - return new nodes.Case.When(val, this.parseBlockExpansion()); - }, - - /** - * default - */ - - parseDefault: function(){ - this.expect('default'); - return new nodes.Case.When('default', this.parseBlockExpansion()); - }, - - /** - * code - */ - - parseCode: function(){ - var tok = this.expect('code') - , node = new nodes.Code(tok.val, tok.buffer, tok.escape) - , block - , i = 1; - node.line = this.line(); - while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; - block = 'indent' == this.lookahead(i).type; - if (block) { - this.skip(i-1); - node.block = this.block(); - } - return node; - }, - - /** - * comment - */ - - parseComment: function(){ - var tok = this.expect('comment') - , node; - - if ('indent' == this.peek().type) { - node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); - } else { - node = new nodes.Comment(tok.val, tok.buffer); - } - - node.line = this.line(); - return node; - }, - - /** - * doctype - */ - - parseDoctype: function(){ - var tok = this.expect('doctype') - , node = new nodes.Doctype(tok.val); - node.line = this.line(); - return node; - }, - - /** - * filter attrs? text-block - */ - - parseFilter: function(){ - var block - , tok = this.expect('filter') - , attrs = this.accept('attrs'); - - this.lexer.pipeless = true; - block = this.parseTextBlock(); - this.lexer.pipeless = false; - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * tag ':' attrs? block - */ - - parseASTFilter: function(){ - var block - , tok = this.expect('tag') - , attrs = this.accept('attrs'); - - this.expect(':'); - block = this.block(); - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * each block - */ - - parseEach: function(){ - var tok = this.expect('each') - , node = new nodes.Each(tok.code, tok.val, tok.key); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * 'extends' name - */ - - parseExtends: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - if (!this.filename) - throw new Error('the "filename" option is required to extend templates'); - - var path = this.expect('extends').val.trim() - , dir = dirname(this.filename); - - var path = join(dir, path + '.jade') - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - parser.blocks = this.blocks; - parser.contexts = this.contexts; - this.extending = parser; - - // TODO: null node - return new nodes.Literal(''); - }, - - /** - * 'block' name block - */ - - parseBlock: function(){ - var block = this.expect('block') - , mode = block.mode - , name = block.val.trim(); - - block = 'indent' == this.peek().type - ? this.block() - : new nodes.Block(new nodes.Literal('')); - - var prev = this.blocks[name]; - - if (prev) { - switch (prev.mode) { - case 'append': - block.nodes = block.nodes.concat(prev.nodes); - prev = block; - break; - case 'prepend': - block.nodes = prev.nodes.concat(block.nodes); - prev = block; - break; - } - } - - block.mode = mode; - return this.blocks[name] = prev || block; - }, - - /** - * include block? - */ - - parseInclude: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - var path = this.expect('include').val.trim() - , dir = dirname(this.filename); - - if (!this.filename) - throw new Error('the "filename" option is required to use includes'); - - // no extension - if (!~basename(path).indexOf('.')) { - path += '.jade'; - } - - // non-jade - if ('.jade' != path.substr(-5)) { - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8'); - return new nodes.Literal(str); - } - - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - parser.blocks = this.blocks; - parser.mixins = this.mixins; - - this.context(parser); - var ast = parser.parse(); - this.context(); - ast.filename = path; - - if ('indent' == this.peek().type) { - ast.includeBlock().push(this.block()); - } - - return ast; - }, - - /** - * call ident block - */ - - parseCall: function(){ - var tok = this.expect('call') - , name = tok.val - , args = tok.args - , mixin = new nodes.Mixin(name, args, new nodes.Block, true); - - this.tag(mixin); - if (mixin.block.isEmpty()) mixin.block = null; - return mixin; - }, - - /** - * mixin block - */ - - parseMixin: function(){ - var tok = this.expect('mixin') - , name = tok.val - , args = tok.args - , mixin; - - // definition - if ('indent' == this.peek().type) { - mixin = new nodes.Mixin(name, args, this.block(), false); - this.mixins[name] = mixin; - return mixin; - // call - } else { - return new nodes.Mixin(name, args, null, true); - } - }, - - /** - * indent (text | newline)* outdent - */ - - parseTextBlock: function(){ - var block = new nodes.Block; - block.line = this.line(); - var spaces = this.expect('indent').val; - if (null == this._spaces) this._spaces = spaces; - var indent = Array(spaces - this._spaces + 1).join(' '); - while ('outdent' != this.peek().type) { - switch (this.peek().type) { - case 'newline': - this.advance(); - break; - case 'indent': - this.parseTextBlock().nodes.forEach(function(node){ - block.push(node); - }); - break; - default: - var text = new nodes.Text(indent + this.advance().val); - text.line = this.line(); - block.push(text); - } - } - - if (spaces == this._spaces) this._spaces = null; - this.expect('outdent'); - return block; - }, - - /** - * indent expr* outdent - */ - - block: function(){ - var block = new nodes.Block; - block.line = this.line(); - this.expect('indent'); - while ('outdent' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - this.expect('outdent'); - return block; - }, - - /** - * interpolation (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseInterpolation: function(){ - var tok = this.advance(); - var tag = new nodes.Tag(tok.val); - tag.buffer = true; - return this.tag(tag); - }, - - /** - * tag (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseTag: function(){ - // ast-filter look-ahead - var i = 2; - if ('attrs' == this.lookahead(i).type) ++i; - if (':' == this.lookahead(i).type) { - if ('indent' == this.lookahead(++i).type) { - return this.parseASTFilter(); - } - } - - var tok = this.advance() - , tag = new nodes.Tag(tok.val); - - tag.selfClosing = tok.selfClosing; - - return this.tag(tag); - }, - - /** - * Parse tag. - */ - - tag: function(tag){ - var dot; - - tag.line = this.line(); - - // (attrs | class | id)* - out: - while (true) { - switch (this.peek().type) { - case 'id': - case 'class': - var tok = this.advance(); - tag.setAttribute(tok.type, "'" + tok.val + "'"); - continue; - case 'attrs': - var tok = this.advance() - , obj = tok.attrs - , escaped = tok.escaped - , names = Object.keys(obj); - - if (tok.selfClosing) tag.selfClosing = true; - - for (var i = 0, len = names.length; i < len; ++i) { - var name = names[i] - , val = obj[name]; - tag.setAttribute(name, val, escaped[name]); - } - continue; - default: - break out; - } - } - - // check immediate '.' - if ('.' == this.peek().val) { - dot = tag.textOnly = true; - this.advance(); - } - - // (text | code | ':')? - switch (this.peek().type) { - case 'text': - tag.block.push(this.parseText()); - break; - case 'code': - tag.code = this.parseCode(); - break; - case ':': - this.advance(); - tag.block = new nodes.Block; - tag.block.push(this.parseExpr()); - break; - } - - // newline* - while ('newline' == this.peek().type) this.advance(); - - tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); - - // script special-case - if ('script' == tag.name) { - var type = tag.getAttribute('type'); - if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { - tag.textOnly = false; - } - } - - // block? - if ('indent' == this.peek().type) { - if (tag.textOnly) { - this.lexer.pipeless = true; - tag.block = this.parseTextBlock(); - this.lexer.pipeless = false; - } else { - var block = this.block(); - if (tag.block) { - for (var i = 0, len = block.nodes.length; i < len; ++i) { - tag.block.push(block.nodes[i]); - } - } else { - tag.block = block; - } - } - } - - return tag; - } -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/runtime.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/runtime.js deleted file mode 100644 index fb711f5..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/runtime.js +++ /dev/null @@ -1,174 +0,0 @@ - -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Merge two attribute objects giving precedence - * to values in object `b`. Classes are special-cased - * allowing for arrays and merging/joining appropriately - * resulting in a string. - * - * @param {Object} a - * @param {Object} b - * @return {Object} a - * @api private - */ - -exports.merge = function merge(a, b) { - var ac = a['class']; - var bc = b['class']; - - if (ac || bc) { - ac = ac || []; - bc = bc || []; - if (!Array.isArray(ac)) ac = [ac]; - if (!Array.isArray(bc)) bc = [bc]; - ac = ac.filter(nulls); - bc = bc.filter(nulls); - a['class'] = ac.concat(bc).join(' '); - } - - for (var key in b) { - if (key != 'class') { - a[key] = b[key]; - } - } - - return a; -}; - -/** - * Filter null `val`s. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function nulls(val) { - return val != null; -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped && escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!(\w+|\#\d+);)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/self-closing.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/self-closing.js deleted file mode 100644 index 0548771..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/self-closing.js +++ /dev/null @@ -1,19 +0,0 @@ - -/*! - * Jade - self closing tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'meta' - , 'img' - , 'link' - , 'input' - , 'source' - , 'area' - , 'base' - , 'col' - , 'br' - , 'hr' -]; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/utils.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/utils.js deleted file mode 100644 index ff46d02..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/lib/utils.js +++ /dev/null @@ -1,49 +0,0 @@ - -/*! - * Jade - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Convert interpolation in the given string to JavaScript. - * - * @param {String} str - * @return {String} - * @api private - */ - -var interpolate = exports.interpolate = function(str){ - return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ - return escape - ? str - : "' + " - + ('!' == flag ? '' : 'escape') - + "((interp = " + code.replace(/\\'/g, "'") - + ") == null ? '' : interp) + '"; - }); -}; - -/** - * Escape single quotes in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -var escape = exports.escape = function(str) { - return str.replace(/'/g, "\\'"); -}; - -/** - * Interpolate, and escape the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.text = function(str){ - return interpolate(escape(str)); -}; \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej deleted file mode 100644 index 69244ff..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej +++ /dev/null @@ -1,5 +0,0 @@ ---- /dev/null -+++ .gitignore -@@ -0,0 +1,2 @@ -+node_modules/ -+npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown deleted file mode 100644 index b4dd75f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown +++ /dev/null @@ -1,54 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig deleted file mode 100644 index 7741462..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej deleted file mode 100644 index 81e7f43..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej +++ /dev/null @@ -1,19 +0,0 @@ ---- examples/pow.js -+++ examples/pow.js -@@ -1,6 +1,15 @@ --var mkdirp = require('mkdirp').mkdirp; -+var mkdirp = require('../').mkdirp, -+ mkdirpSync = require('../').mkdirpSync; - - mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') - }); -+ -+try { -+ mkdirpSync('/tmp/bar/foo/baz', 0755); -+ console.log('double pow!'); -+} -+catch (ex) { -+ console.log(ex); -+} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js deleted file mode 100644 index 25f43ad..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js +++ /dev/null @@ -1,79 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) return cb(); - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er) { - if (er) cb(er); - else mkdirP(p, mode, cb); - }); - break; - - case 'EEXIST': - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original EEXIST be the failure reason. - if (er2 || !stat.isDirectory()) cb(er) - else cb(); - }); - break; - - default: - cb(er); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode) - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - var err1 = sync(path.dirname(p), mode) - if (err1) throw err1; - else return sync(p, mode); - break; - - case 'EEXIST' : - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0; - else return null; - break; - default : - throw err0 - break; - } - } - - return null; -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json deleted file mode 100644 index 1cbc0c7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.0", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "0.0.x" - }, - "license": "MIT/X11", - "engines": { - "node": "*" - }, - "readme": "mkdirp\n======\n\nLike `mkdir -p`, but in node.js!\n\nexample\n=======\n\npow.js\n------\n var mkdirp = require('mkdirp');\n \n mkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n });\n\nOutput\n pow!\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\nmethods\n=======\n\nvar mkdirp = require('mkdirp');\n\nmkdirp(dir, mode, cb)\n---------------------\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nmkdirp.sync(dir, mode)\n----------------------\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n npm install mkdirp\n\nlicense\n=======\n\nMIT/X11\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "_id": "mkdirp@0.3.0", - "_from": "mkdirp@0.3.0" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js deleted file mode 100644 index e0e389d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file, 0755); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 83cba56..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/package.json deleted file mode 100644 index 3b0610d..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "jade", - "description": "Jade template engine", - "version": "0.26.3", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/jade" - }, - "main": "./index.js", - "bin": { - "jade": "./bin/jade" - }, - "man": [ - "./jade.1" - ], - "dependencies": { - "commander": "0.6.1", - "mkdirp": "0.3.0" - }, - "devDependencies": { - "mocha": "*", - "markdown": "*", - "stylus": "*", - "uubench": "*", - "should": "*", - "less": "*", - "uglify-js": "*" - }, - "component": { - "scripts": { - "jade": "runtime.js" - } - }, - "scripts": { - "prepublish": "npm prune" - }, - "bugs": { - "url": "https://github.com/visionmedia/jade/issues" - }, - "readme": "ERROR: No README data found!", - "_id": "jade@0.26.3", - "_from": "jade@0.26.3" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/runtime.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/runtime.js deleted file mode 100644 index 0f54907..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/runtime.js +++ /dev/null @@ -1,179 +0,0 @@ - -jade = (function(exports){ -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Merge two attribute objects giving precedence - * to values in object `b`. Classes are special-cased - * allowing for arrays and merging/joining appropriately - * resulting in a string. - * - * @param {Object} a - * @param {Object} b - * @return {Object} a - * @api private - */ - -exports.merge = function merge(a, b) { - var ac = a['class']; - var bc = b['class']; - - if (ac || bc) { - ac = ac || []; - bc = bc || []; - if (!Array.isArray(ac)) ac = [ac]; - if (!Array.isArray(bc)) bc = [bc]; - ac = ac.filter(nulls); - bc = bc.filter(nulls); - a['class'] = ac.concat(bc).join(' '); - } - - for (var key in b) { - if (key != 'class') { - a[key] = b[key]; - } - } - - return a; -}; - -/** - * Filter null `val`s. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function nulls(val) { - return val != null; -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped && escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!(\w+|\#\d+);)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; - - return exports; - -})({}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/runtime.min.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/runtime.min.js deleted file mode 100644 index 1714efb..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/runtime.min.js +++ /dev/null @@ -1 +0,0 @@ -jade=function(exports){Array.isArray||(Array.isArray=function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}),Object.keys||(Object.keys=function(obj){var arr=[];for(var key in obj)obj.hasOwnProperty(key)&&arr.push(key);return arr}),exports.merge=function merge(a,b){var ac=a["class"],bc=b["class"];if(ac||bc)ac=ac||[],bc=bc||[],Array.isArray(ac)||(ac=[ac]),Array.isArray(bc)||(bc=[bc]),ac=ac.filter(nulls),bc=bc.filter(nulls),a["class"]=ac.concat(bc).join(" ");for(var key in b)key!="class"&&(a[key]=b[key]);return a};function nulls(val){return val!=null}return exports.attrs=function attrs(obj,escaped){var buf=[],terse=obj.terse;delete obj.terse;var keys=Object.keys(obj),len=keys.length;if(len){buf.push("");for(var i=0;i/g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err},exports}({}); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/test.jade b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/test.jade deleted file mode 100644 index b3a8988..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/test.jade +++ /dev/null @@ -1,7 +0,0 @@ -p. - This is a large - body of text for - this tag. - - Nothing too - exciting. \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/head.jade b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/head.jade deleted file mode 100644 index 8515406..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/head.jade +++ /dev/null @@ -1,5 +0,0 @@ -head - script(src='/jquery.js') - yield - if false - script(src='/jquery.ui.js') diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/index.jade b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/index.jade deleted file mode 100644 index 1032c5f..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/index.jade +++ /dev/null @@ -1,22 +0,0 @@ - -tag = 'p' -foo = 'bar' - -#{tag} value -#{tag}(foo='bar') value -#{foo ? 'a' : 'li'}(something) here - -mixin item(icon) - li - if attributes.href - a(attributes) - img.icon(src=icon) - block - else - span(attributes) - img.icon(src=icon) - block - -ul - +item('contact') Contact - +item(href='/contact') Contact diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/index.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/index.js deleted file mode 100644 index 226e8c0..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/index.js +++ /dev/null @@ -1,11 +0,0 @@ - -/** - * Module dependencies. - */ - -var jade = require('../'); - -jade.renderFile('testing/index.jade', { pretty: true, debug: true, compileDebug: false }, function(err, str){ - if (err) throw err; - console.log(str); -}); \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/layout.jade b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/layout.jade deleted file mode 100644 index 6923cf1..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/layout.jade +++ /dev/null @@ -1,6 +0,0 @@ -html - include head - script(src='/caustic.js') - script(src='/app.js') - body - block content \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/user.jade b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/user.jade deleted file mode 100644 index 3c636b7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/user.jade +++ /dev/null @@ -1,7 +0,0 @@ -h1 Tobi -p Is a ferret - -ul - li: a foo - li: a bar - li: a baz \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/user.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/user.js deleted file mode 100644 index 2ecc45e..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/jade/testing/user.js +++ /dev/null @@ -1,27 +0,0 @@ -function anonymous(locals, attrs, escape, rethrow) { -var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow; -var __jade = [{ lineno: 1, filename: "testing/user.jade" }]; -try { -var buf = []; -with (locals || {}) { -var interp; -__jade.unshift({ lineno: 1, filename: __jade[0].filename }); -__jade.unshift({ lineno: 1, filename: __jade[0].filename }); -buf.push('

                  Tobi'); -__jade.unshift({ lineno: undefined, filename: __jade[0].filename }); -__jade.shift(); -buf.push('

                  '); -__jade.shift(); -__jade.unshift({ lineno: 2, filename: __jade[0].filename }); -buf.push('

                  Is a ferret'); -__jade.unshift({ lineno: undefined, filename: __jade[0].filename }); -__jade.shift(); -buf.push('

                  '); -__jade.shift(); -__jade.shift(); -} -return buf.join(""); -} catch (err) { - rethrow(err, __jade[0].filename, __jade[0].lineno); -} -} \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/.npmignore b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/.travis.yml b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 84fd7ca..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.9 diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/LICENSE b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/examples/pow.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/index.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/package.json b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/package.json deleted file mode 100644 index 50ba940..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.5", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "http://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.4.0" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "_id": "mkdirp@0.3.5", - "_from": "mkdirp@0.3.5" -} diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/readme.markdown b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 83b0216..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/chmod.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/clobber.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/mkdirp.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/perm.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/perm_sync.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/race.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/rel.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/return.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/return_sync.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/root.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/sync.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cad..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/umask.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/umask_sync.js b/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 35bd5cb..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/grunt-mocha/node_modules/mocha/package.json b/node_modules/grunt-mocha/node_modules/mocha/package.json deleted file mode 100644 index 15b06c7..0000000 --- a/node_modules/grunt-mocha/node_modules/mocha/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "mocha", - "version": "1.12.1", - "description": "simple, flexible, fun test framework", - "keywords": [ - "mocha", - "test", - "bdd", - "tdd", - "tap" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/mocha.git" - }, - "main": "./index", - "bin": { - "mocha": "./bin/mocha", - "_mocha": "./bin/_mocha" - }, - "engines": { - "node": ">= 0.4.x" - }, - "scripts": { - "test": "make test-all" - }, - "dependencies": { - "commander": "0.6.1", - "growl": "1.7.x", - "jade": "0.26.3", - "diff": "1.0.2", - "debug": "*", - "mkdirp": "0.3.5", - "glob": "3.2.1" - }, - "devDependencies": { - "should": "*", - "coffee-script": "1.2" - }, - "files": [ - "bin", - "images", - "lib", - "index.js", - "mocha.css", - "mocha.js" - ], - "readme": " [![Build Status](https://secure.travis-ci.org/visionmedia/mocha.png)](http://travis-ci.org/visionmedia/mocha)\n\n [![Mocha test framework](http://f.cl.ly/items/3l1k0n2A1U3M1I1L210p/Screen%20Shot%202012-02-24%20at%202.21.43%20PM.png)](http://visionmedia.github.io/mocha)\n\n Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://visionmedia.github.io/mocha).\n\n## Contributors\n\n```\n\n project : mocha\n repo age : 1 year, 7 months\n active : 272 days\n commits : 1116\n files : 123\n authors :\n 504 TJ Holowaychuk 45.2%\n 389 Tj Holowaychuk 34.9%\n 31 Guillermo Rauch 2.8%\n 13 Attila Domokos 1.2%\n 9 John Firebaugh 0.8%\n 8 Jo Liss 0.7%\n 7 Nathan Rajlich 0.6%\n 6 James Carr 0.5%\n 6 Brendan Nee 0.5%\n 5 Aaron Heckmann 0.4%\n 4 hokaccha 0.4%\n 4 Xavier Antoviaque 0.4%\n 4 Joshua Krall 0.4%\n 3 Wil Moore III 0.3%\n 3 Jesse Dailey 0.3%\n 3 Nathan Bowser 0.3%\n 3 Tyson Tate 0.3%\n 3 Cory Thomas 0.3%\n 3 Ryunosuke SATO 0.3%\n 3 Paul Miller 0.3%\n 3 Ben Lindsey 0.3%\n 2 Forbes Lindesay 0.2%\n 2 Konstantin Käfer 0.2%\n 2 Brian Beck 0.2%\n 2 Merrick Christensen 0.2%\n 2 Michael Riley 0.2%\n 2 David Henderson 0.2%\n 2 Nathan Alderson 0.2%\n 2 Paul Armstrong 0.2%\n 2 Pete Hawkins 0.2%\n 2 Quang Van 0.2%\n 2 Raynos 0.2%\n 2 Jonas Westerlund 0.2%\n 2 Domenic Denicola 0.2%\n 2 Shawn Krisman 0.2%\n 2 Simon Gaeremynck 0.2%\n 2 FARKAS Máté 0.2%\n 2 Timo Tijhof 0.2%\n 2 Justin DuJardin 0.2%\n 2 Juzer Ali 0.2%\n 2 Ian Storm Taylor 0.2%\n 2 Arian Stolwijk 0.2%\n 2 domenic 0.2%\n 1 Richard Dingwall 0.1%\n 1 Russ Bradberry 0.1%\n 1 Sasha Koss 0.1%\n 1 Seiya Konno 0.1%\n 1 Standa Opichal 0.1%\n 1 Steve Mason 0.1%\n 1 Will Langstroth 0.1%\n 1 Yanis Wang 0.1%\n 1 Yuest Wang 0.1%\n 1 abrkn 0.1%\n 1 airportyh 0.1%\n 1 fengmk2 0.1%\n 1 tgautier@yahoo.com 0.1%\n 1 traleig1 0.1%\n 1 vlad 0.1%\n 1 yuitest 0.1%\n 1 Adam Crabtree 0.1%\n 1 Andreas Brekken 0.1%\n 1 Atsuya Takagi 0.1%\n 1 Austin Birch 0.1%\n 1 Bjørge Næss 0.1%\n 1 Brian Moore 0.1%\n 1 Bryan Donovan 0.1%\n 1 Casey Foster 0.1%\n 1 Corey Butler 0.1%\n 1 Dave McKenna 0.1%\n 1 Fedor Indutny 0.1%\n 1 Florian Margaine 0.1%\n 1 Frederico Silva 0.1%\n 1 Fredrik Lindin 0.1%\n 1 Gareth Murphy 0.1%\n 1 Gavin Mogan 0.1%\n 1 Greg Perkins 0.1%\n 1 Harry Brundage 0.1%\n 1 Herman Junge 0.1%\n 1 Ian Young 0.1%\n 1 Ivan 0.1%\n 1 Jaakko Salonen 0.1%\n 1 Jakub Nešetřil 0.1%\n 1 James Bowes 0.1%\n 1 James Lal 0.1%\n 1 Jason Barry 0.1%\n 1 Javier Aranda 0.1%\n 1 Jeff Kunkle 0.1%\n 1 Jonathan Creamer 0.1%\n 1 Jussi Virtanen 0.1%\n 1 Katie Gengler 0.1%\n 1 Kazuhito Hokamura 0.1%\n 1 Koen Punt 0.1%\n 1 Laszlo Bacsi 0.1%\n 1 László Bácsi 0.1%\n 1 Maciej Małecki 0.1%\n 1 Matt Robenolt 0.1%\n 1 Matt Smith 0.1%\n 1 Matthew Shanley 0.1%\n 1 Michael Schoonmaker 0.1%\n 1 Phil Sung 0.1%\n 1 R56 0.1%\n```\n\n## Links\n\n - [Google Group](http://groups.google.com/group/mochajs)\n - [Wiki](https://github.com/visionmedia/mocha/wiki)\n - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/visionmedia/mocha/issues" - }, - "_id": "mocha@1.12.1", - "dist": { - "shasum": "8240a1ba4f98460e576b235bbff5c353ac105735" - }, - "_from": "mocha@~1.12.0", - "_resolved": "https://registry.npmjs.org/mocha/-/mocha-1.12.1.tgz" -} diff --git a/node_modules/grunt-mocha/package.json b/node_modules/grunt-mocha/package.json deleted file mode 100644 index 70a8abd..0000000 --- a/node_modules/grunt-mocha/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "grunt-mocha", - "description": "Grunt task for running client-side Mocha specs in PhantomJS", - "version": "0.4.1", - "homepage": "https://github.com/kmiyashiro/grunt-mocha", - "author": { - "name": "Kelly Miyashiro", - "email": "miyashiro.kelly@gmail.com", - "url": "http://non-diligent.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/kmiyashiro/grunt-mocha.git" - }, - "bugs": { - "url": "https://github.com/kmiyashiro/grunt-mocha/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/kmiyashiro/grunt-mocha/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": "*" - }, - "scripts": { - "test": "./node_modules/.bin/grunt test" - }, - "dependencies": { - "grunt-lib-phantomjs": "~0.3", - "mocha": "~1.12" - }, - "peerDependencies": { - "grunt": "~0.4" - }, - "devDependencies": { - "grunt": "~0.4", - "grunt-contrib-connect": "~0.2", - "grunt-contrib-jshint": "~0.3" - }, - "keywords": [ - "gruntplugin", - "mocha", - "test", - "phantomjs" - ], - "files": [ - "growl", - "phantomjs", - "support", - "tasks" - ], - "readme": "Automatically run *client-side* mocha specs via grunt/mocha/PhantomJS\n\nFor a grunt task for server-side mocha tests, see [grunt-mocha-test](https://github.com/pghalliday/grunt-mocha-test) or [grunt-simple-mocha](https://github.com/yaymukund/grunt-simple-mocha)\n\n# Grunt Compatibility\n\n* Grunt 0.4 use grunt-mocha 0.2+\n* Grunt 0.3 use grunt-mocha 0.1\n\n**Grunt 0.4.0 migration details in [HISTORY.md](HISTORY.md#020)**\n\n# grunt-mocha\n\n(package/README format heavily borrowed from [grunt-jasmine-task](https://github.com/creynders/grunt-jasmine-task) and builtin QUnit task)\n\n[Grunt](https://github.com/cowboy/grunt) plugin for running Mocha browser specs in a headless browser (PhantomJS)\n\n## Getting Started\n\n### Task config\n\n```js\nmocha: {\n // runs all html files (except test2.html) in the test dir\n // In this example, there's only one, but you can add as many as\n // you want. You can split them up into different groups here\n // ex: admin: [ 'test/admin.html' ]\n all: [ 'test/**/!(test2).html' ],\n\n // Runs 'test/test2.html' with specified mocha options.\n // This variant auto-includes 'bridge.js' so you do not have\n // to include it in your HTML spec file. Instead, you must add an\n // environment check before you run `mocha.run` in your HTML.\n test2: {\n // Test files\n src: [ 'example/test/test2.html' ],\n options: {\n // Bail means if a test fails, grunt will abort. False by default.\n bail: true,\n\n // Pipe output console.log from your JS to grunt. False by default.\n log: true,\n\n // mocha options\n mocha: {\n ignoreLeaks: false,\n grep: 'food'\n },\n\n // Select a Mocha reporter\n // http://visionmedia.github.com/mocha/#reporters\n reporter: 'Nyan',\n\n // Indicates whether 'mocha.run()' should be executed in\n // 'bridge.js'. If you include `mocha.run()` in your html spec,\n // check if environment is PhantomJS. See example/test/test2.html\n run: true,\n\n // Override the timeout of the test (default is 5000)\n timeout: 10000\n }\n },\n\n // Runs the same as test2 but with URL's\n test3: {\n // Task options\n options: {\n // mocha options\n mocha: {\n ignoreLeaks: false,\n grep: 'food'\n },\n\n // URLs passed through as options\n urls: [ 'http://localhost:' + port + '/example/test/test2.html' ],\n\n // Indicates whether 'mocha.run()' should be executed in 'bridge.js'\n run: true\n }\n }\n}\n```\n\n### Vanilla JS\n\n#### Option 1 (recommended)\n\n- Write mocha task description in grunt config using and specify `run: true` option (see [this tasks Gruntfile.js](Gruntfile.js) for details);\n- Check for PhantomJS `userAgent` in a test html file and run tests only in a real browser (see [test2.html](example/test/test2.html) for details).\n\nIn this case you shouldn't include [bridge.js](phantomjs/bridge.js) (it will be included automatically) and tests will be run from [bridge.js](phantomjs/bridge.js).\n\n#### Option 2\n\nAlternatively, include `bridge.js` from `tasks/phantomjs` after you include `mocha.js` and run `mocha.setup` in your HTML file. The helper will override `mocha.setup` if it detects PhantomJS. See [test.html](example/test/test.html).\n\n### AMD\n\nMocha **must** be included via script tag in the header. There is no need to load Mocha via AMD. You may load other testing libs via AMD if that gives you a fuzzy feeling.\n\nExample setup with AMD (advanced): https://gist.github.com/2655876\n\n### Grunt and this plugin\n\nFirst, make sure you have grunt installed globally, `npm install grunt -g`\n\nInstall this grunt plugin next to your project's [Gruntfile.js](http://gruntjs.com/getting-started) with: `npm install grunt-mocha`\n\nThen add this line to your project's `Gruntfile.js` gruntfile at the bottom:\n\n```javascript\ngrunt.loadNpmTasks('grunt-mocha');\n```\n\nAlso add this to the `grunt.initConfig` object in the same file:\n\n```javascript\nmocha: {\n index: ['specs/index.html']\n},\n```\n\nReplace `specs/index.html` with the location of your mocha spec running html file.\n\nNow you can run the mocha task with `grunt mocha`, but it won't work. That's because you need...\n\n### PhantomJS\n\nThis task is for running Mocha tests in a headless browser, PhantomJS, which is installed via [grunt-lib-phantomjs](https://github.com/gruntjs/grunt-lib-phantomjs) as a dependency of this task.\n\n### Mocha\n\nUse [Mocha](http://visionmedia.github.com/mocha/)\n\n### Hacks\n\nThe PhantomJS -> Grunt superdimensional conduit uses `alert`. If you have disabled or aliased alert in your app, this won't work. I have conveniently set a global `PHANTOMJS` on `window` so you can conditionally override alert in your app.\n\n## License\nCopyright (c) 2013 Kelly Miyashiro\nLicensed under the MIT license.\n", - "readmeFilename": "README.md", - "_id": "grunt-mocha@0.4.1", - "dist": { - "shasum": "371bc322c8cb225ba7a3c468fce3dfbd8763ab6f" - }, - "_from": "grunt-mocha@~0.4.0", - "_resolved": "https://registry.npmjs.org/grunt-mocha/-/grunt-mocha-0.4.1.tgz" -} diff --git a/node_modules/grunt-mocha/phantomjs/bridge.js b/node_modules/grunt-mocha/phantomjs/bridge.js deleted file mode 100644 index e111295..0000000 --- a/node_modules/grunt-mocha/phantomjs/bridge.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Is injected into the spec runner file - - * Copyright (c) 2012 Kelly Miyashiro - * Copyright (c) 2012 "Cowboy" Ben Alman - * Licensed under the MIT license. - * http://benalman.com/about/license/ - */ - -/*global mocha:true, alert:true, window:true */ - -(function() { - // Send messages to the parent phantom.js process via alert! Good times!! - function sendMessage() { - var args = [].slice.call(arguments); - alert(JSON.stringify(args)); - } - - // Create a listener who'll bubble events from Phantomjs to Grunt - function createGruntListener(ev, runner) { - - runner.on(ev, function(test, err) { - var data = { - err: err - }; - - if (test) { - data.title = test.title; - data.fullTitle = test.fullTitle(); - } - - sendMessage('mocha.' + ev, data); - - }); - } - - var GruntReporter = function(runner){ - // 1.4.2 moved reporters to Mocha instead of mocha - var mochaInstance = window.Mocha || window.mocha; - - if (!mochaInstance) { - throw new Error('Mocha was not found, make sure you include Mocha in your HTML spec file.'); - } - - // Setup HTML reporter to output data on the screen - mochaInstance.reporters.HTML.call(this, runner); - - // Create a Grunt listener for each Mocha events - var events = [ - 'start', - 'test', - 'test end', - 'suite', - 'suite end', - 'fail', - 'pass', - 'pending', - 'end' - ]; - - for(var i = 0; i < events.length; i++) { - createGruntListener(events[i], runner); - } - - }; - - var options = window.PHANTOMJS; - if (options) { - // Default mocha options - var config = { - ui: 'bdd', - ignoreLeaks: true, - reporter: GruntReporter - }, - run = options.run, - key; - - if (options) { - // If options is a string, assume it is to set the UI (bdd/tdd etc) - if (typeof options === "string") { - config.ui = options; - } else { - // Extend defaults with passed options - for (key in options.mocha) { - config[key] = options.mocha[key]; - } - } - } - - config.reporter = GruntReporter; - - mocha.setup(config); - - // task option `run`, automatically runs mocha for grunt only - if (run) { - mocha.run(); - } - } -}()); diff --git a/node_modules/grunt-mocha/phantomjs/main.js b/node_modules/grunt-mocha/phantomjs/main.js deleted file mode 100644 index d7030fb..0000000 --- a/node_modules/grunt-mocha/phantomjs/main.js +++ /dev/null @@ -1,138 +0,0 @@ -/* - * grunt-lib-phantomjs - * http://gruntjs.com/ - * - * Modified for mocha-grunt by Kelly Miyashiro - * - * Copyright (c) 2012 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -/*global phantom:true*/ - -'use strict'; - -var fs = require('fs'); - -// The temporary file used for communications. -var tmpfile = phantom.args[0]; -// The page .html file to load. -var url = phantom.args[1]; -// Extra, optionally overridable stuff. -var options = JSON.parse(phantom.args[2] || {}); - -// Default options. -if (!options.timeout) { options.timeout = 5000; } - -// Keep track of the last time a client message was sent. -var last = new Date(); - -// Messages are sent to the parent by appending them to the tempfile. -var sendMessage = function(arg) { - var args = Array.isArray(arg) ? arg : [].slice.call(arguments); - last = new Date(); - fs.write(tmpfile, JSON.stringify(args) + '\n', 'a'); -}; - -// This allows grunt to abort if the PhantomJS version isn't adequate. -sendMessage('private', 'version', phantom.version); - -// Abort if the page doesn't send any messages for a while. -setInterval(function() { - if (new Date() - last > options.timeout) { - sendMessage('fail.timeout'); - phantom.exit(); - } -}, 100); - -// Create a new page. -var page = require('webpage').create(); - -// Inject bridge script into client page. -var injected; -var inject = function() { - if (injected) { return; } - // Inject client-side helper script. - sendMessage('inject', options.inject); - page.injectJs(options.inject); - injected = true; -}; - -// Keep track if the client-side helper script already has been injected. -page.onUrlChanged = function(newUrl) { - injected = false; - sendMessage('onUrlChanged', newUrl); -}; - -// The client page must send its messages via alert(jsonstring). -page.onAlert = function(str) { - // The only thing that should ever alert "inject" is the custom event - // handler this script adds to be executed on DOMContentLoaded. - if (str === 'inject') { - inject(); - return; - } - // Otherwise, parse the specified message string and send it back to grunt. - // Unless there's a parse error. Then, complain. - try { - sendMessage(JSON.parse(str)); - } catch(err) { - sendMessage('error.invalidJSON', str); - } -}; - -// Relay console logging messages. -page.onConsoleMessage = function(message) { - sendMessage('console', message); -}; - -// For debugging. -page.onResourceRequested = function(request) { - sendMessage('onResourceRequested', request.url); -}; - -page.onResourceReceived = function(request) { - if (request.stage === 'end') { - sendMessage('onResourceReceived', request.url); - } -}; - -page.onError = function(msg, trace) { - sendMessage('error.onError', msg, trace); -}; - -// Run before the page is loaded. -page.onInitialized = function() { - sendMessage('onInitialized'); - - // Customization for mocha, passing mocha options from task config - page.evaluate(function(options) { - window.PHANTOMJS = options; - }, options); - - // Abort if there is no bridge to inject. - if (!options.inject) { return; } - // Tell the client that when DOMContentLoaded fires, it needs to tell this - // script to inject the bridge. This should ensure that the bridge gets - // injected before any other DOMContentLoaded or window.load event handler. - page.evaluate(function() { - /*jshint browser:true, devel:true */ - document.addEventListener('DOMContentLoaded', function() { - alert('inject'); - }, false); - }); -}; - -// Run when the page has finished loading. -page.onLoadFinished = function(status) { - // The window has loaded. - sendMessage('onLoadFinished', status); - if (status !== 'success') { - // File loading failure. - sendMessage('fail.load', url); - phantom.exit(); - } -}; - -// Actually load url. -page.open(url); diff --git a/node_modules/grunt-mocha/support/mocha-helpers.js b/node_modules/grunt-mocha/support/mocha-helpers.js deleted file mode 100644 index c8d9e0c..0000000 --- a/node_modules/grunt-mocha/support/mocha-helpers.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Some helper functions when working with mocha - */ - -'use strict'; - -var exports = module.exports; - -/** - * Take a collection of stats objects and reduce them - * - * @param stats {Array} Array of mocha test stats - */ - -exports.reduceStats = function(stats) { - var initial = { - passes : 0, - failures : 0, - tests : 0, - duration : 0 - }; - - // console.log(testStats); - var total = stats.reduce(function(prev, stats, i, list) { - prev.passes += stats.passes; - prev.failures += stats.failures; - prev.tests += stats.tests; - prev.duration += (stats.end - stats.start); - return prev; - }, initial); - - total.duration = this.formatMs(total.duration); - - return total; -}; - -exports.formatMs = function(ms) { - return (Math.ceil(ms * 100) / 100000).toFixed(2); -} diff --git a/node_modules/grunt-mocha/tasks/mocha.js b/node_modules/grunt-mocha/tasks/mocha.js deleted file mode 100644 index e533d6b..0000000 --- a/node_modules/grunt-mocha/tasks/mocha.js +++ /dev/null @@ -1,274 +0,0 @@ -/* - * grunt - * https://github.com/cowboy/grunt - * - * Copyright (c) 2012 "Cowboy" Ben Alman - * Licensed under the MIT license. - * http://benalman.com/about/license/ - * - * Mocha task - * Copyright (c) 2012 Kelly Miyashiro - * Licensed under the MIT license. - * http://benalman.com/about/license/ - */ - -'use strict'; - -module.exports = function(grunt) { - var _ = grunt.util._; - - // Nodejs libs. - var path = require('path'); - var EventEmitter = require('events').EventEmitter; - - // External lib. - var phantomjs = require('grunt-lib-phantomjs').init(grunt); - var reporters = require('mocha').reporters; - - // Helpers - var helpers = require('../support/mocha-helpers'); - - var reporter; - - // Growl is optional - var growl; - try { - growl = require('growl'); - } catch(e) { - growl = function(){}; - grunt.verbose.write('Growl not found, \'npm install growl\' for Growl support'); - } - - // Get an asset file, local to the root of the project. - var asset = path.join.bind(null, __dirname, '..'); - - // Manage runners listening to phantomjs - var phantomjsEventManager = (function() { - var listeners = {}; - var suites = []; - - // Hook on Phantomjs Mocha reporter events. - phantomjs.on('mocha.*', function(test) { - var name, fullTitle, slow, err; - var evt = this.event.replace('mocha.', ''); - - if (evt === 'end') { - phantomjs.halt(); - } - - // Expand test values (and façace the Mocha test object) - if (test) { - fullTitle = test.fullTitle; - test.fullTitle = function() { - return fullTitle; - }; - - slow = this.slow; - test.slow = function() { - return slow; - }; - - test.parent = suites[suites.length - 1] || null; - - err = test.err; - } - - if (evt === 'suite') { - suites.push(test); - } else if (evt === 'suite end') { - suites.pop(test); - } - - // Trigger events for each runner listening - for (name in listeners) { - listeners[name].emit.call(listeners[name], evt, test, err); - } - }); - - return { - add: function(name, runner) { - listeners[name] = runner; - }, - remove: function(name) { - delete listeners[name]; - } - }; - }()); - - // Built-in error handlers. - phantomjs.on('fail.load', function(url) { - phantomjs.halt(); - grunt.verbose.write('Running PhantomJS...').or.write('...'); - grunt.log.error(); - grunt.warn('PhantomJS unable to load "' + url + '" URI.', 90); - }); - - phantomjs.on('fail.timeout', function() { - phantomjs.halt(); - grunt.log.writeln(); - grunt.warn('PhantomJS timed out, possibly due to a missing Mocha run() call.', 90); - }); - - // Debugging messages. - // phantomjs.on('debug', grunt.log.debug.bind(grunt.log, 'phantomjs')); - - // ========================================================================== - // TASKS - // ========================================================================== - - grunt.registerMultiTask('mocha', 'Run Mocha unit tests in a headless PhantomJS instance.', function() { - - // Merge task-specific and/or target-specific options with these defaults. - var options = this.options({ - // Output console.log calls - log: false, - // Mocha reporter - reporter: 'Dot', - // Default PhantomJS timeout. - timeout: 5000, - // Mocha-PhantomJS bridge file to be injected. - inject: asset('phantomjs/bridge.js'), - // Main PhantomJS script file - phantomScript: asset('phantomjs/main.js'), - // Explicit non-file URLs to test. - urls: [], - // Fail with grunt.warn on first test failure - bail: false - }); - - // console.log pass-through. - if (options.log) { - phantomjs.on('console', grunt.log.writeln.bind(grunt.log)); - } - - // Clean Phantomjs options to prevent any conflicts - var PhantomjsOptions = _.omit(options, 'reporter', 'urls'); - - var configStr = JSON.stringify(PhantomjsOptions, null, ' '); - grunt.verbose.writeln('Additional configuration: ' + configStr); - - // Combine any specified URLs with src files. - var urls = options.urls.concat(this.filesSrc); - - // Remember all stats from all tests - var testStats = []; - - // This task is asynchronous. - var done = this.async(); - - // Process each filepath in-order. - grunt.util.async.forEachSeries(urls, function(url, next) { - grunt.log.writeln('Testing: ' + url); - - // create a new mocha runner façade - var runner = new EventEmitter(); - phantomjsEventManager.add(url, runner); - - // Clear runner event listener when test is over - runner.on('end', function() { - phantomjsEventManager.remove(url); - }); - - // Set Mocha reporter - var Reporter = null; - if (reporters[options.reporter]) { - Reporter = reporters[options.reporter]; - } - else { - // Resolve external reporter module - var p; - try { - p = require.resolve(options.reporter); - } - catch (e) { - // Resolve to local path - p = path.resolve(options.reporter); - } - if (p) { - try { - Reporter = require(p); - } - catch (e) { } - } - } - if (Reporter === null) { - grunt.fatal('Specified reporter is unknown or unresolvable: ' + options.reporter); - } - reporter = new Reporter(runner); - - // Launch PhantomJS. - phantomjs.spawn(url, { - // Exit code to use if PhantomJS fails in an uncatchable way. - failCode: 90, - // Additional PhantomJS options. - options: PhantomjsOptions, - // Do stuff when done. - done: function(err) { - var stats = runner.stats; - testStats.push(stats); - - if (err) { - // Show Growl notice - // @TODO: Get an example of this - // growl('PhantomJS Error!'); - - // If there was a PhantomJS error, abort the series. - grunt.fatal(err); - done(); - } else { - // If failures, show growl notice - if (stats.failures > 0) { - var reduced = helpers.reduceStats([stats]); - var failMsg = reduced.failures + '/' + reduced.tests + - ' tests failed (' + reduced.duration + 's)'; - - // Show Growl notice, if avail - growl(failMsg, { - image: asset('growl/error.png'), - title: 'Failure in ' + grunt.task.current.target, - priority: 3 - }); - - // Bail tests if bail option is true - if (options.bail) grunt.warn(failMsg); - } - - // Process next file/url - next(); - } - } - }); - }, - // All tests have been run. - function() { - var stats = helpers.reduceStats(testStats); - - if (stats.failures === 0) { - var okMsg = stats.tests + ' passed!' + ' (' + stats.duration + 's)'; - - growl(okMsg, { - image: asset('growl/ok.png'), - title: 'Tests passed', - priority: 3 - }); - - grunt.log.ok(okMsg); - } else { - var failMsg = stats.failures + '/' + stats.tests + ' tests failed (' + - stats.duration + 's)'; - - // Show Growl notice, if avail - growl(failMsg, { - image: asset('growl/error.png'), - title: 'Failure in ' + grunt.task.current.target, - priority: 3 - }); - - grunt.warn(failMsg); - } - - // Async test done - done(); - }); - }); -}; diff --git a/node_modules/grunt-rev/.jshintrc b/node_modules/grunt-rev/.jshintrc deleted file mode 100644 index 6b4c1a9..0000000 --- a/node_modules/grunt-rev/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "boss": true, - "eqnull": true, - "node": true, - "es5": true -} diff --git a/node_modules/grunt-rev/.npmignore b/node_modules/grunt-rev/.npmignore deleted file mode 100644 index b785247..0000000 --- a/node_modules/grunt-rev/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -tmp diff --git a/node_modules/grunt-rev/.travis.yml b/node_modules/grunt-rev/.travis.yml deleted file mode 100644 index 60bbd48..0000000 --- a/node_modules/grunt-rev/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.8" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/node_modules/grunt-rev/Gruntfile.js b/node_modules/grunt-rev/Gruntfile.js deleted file mode 100644 index 31a0cf4..0000000 --- a/node_modules/grunt-rev/Gruntfile.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * grunt-rev - * https://github.com/cbas/grunt-rev - * - * Copyright (c) 2013 Sebastiaan Deckers - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'tasks/*.js', - '<%= nodeunit.tests %>', - ], - options: { - jshintrc: '.jshintrc', - }, - }, - - // Before generating any new files, remove any previously-created files. - clean: { - tests: ['tmp'], - }, - - // Work on a copy of the files because they will be renamed during testing. - copy: { - test: { - flatten: true, - expand: true, - src: ['test/fixtures/*.txt'], - dest: 'tmp/', - }, - }, - - // Configuration to be run (and then tested). - rev: { - default_options: { - src: ['tmp/default.txt'] - }, - custom_options: { - options: { - algorithm: 'sha1', - length: 4 - }, - src: ['tmp/custom.txt'] - }, - }, - - // Unit tests. - nodeunit: { - tests: ['test/*_test.js'], - }, - - }); - - // Actually load this plugin's task(s). - grunt.loadTasks('tasks'); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - - // 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', 'copy', 'rev', 'nodeunit']); - - // By default, lint and run all tests. - grunt.registerTask('default', ['jshint', 'test']); - -}; diff --git a/node_modules/grunt-rev/LICENSE-MIT b/node_modules/grunt-rev/LICENSE-MIT deleted file mode 100644 index c632220..0000000 --- a/node_modules/grunt-rev/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Sebastiaan Deckers - -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/node_modules/grunt-rev/README.md b/node_modules/grunt-rev/README.md deleted file mode 100644 index dbf09f0..0000000 --- a/node_modules/grunt-rev/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# grunt-rev [![Build Status](https://travis-ci.org/cbas/grunt-rev.png)](https://travis-ci.org/cbas/grunt-rev) - -> Static file asset revisioning through content hashing - -## Getting Started -_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._ - -From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command: - -```bash -npm install grunt-rev --save-dev -``` - -Once that's done, add this line to your project's Gruntfile: - -```js -grunt.loadNpmTasks('grunt-rev'); -``` - -If the plugin has been installed correctly, running `grunt --help` at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a `devDependency`, which ensures that it will be installed whenever the `npm install` command is run. - -[grunt]: http://gruntjs.com/ -[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md -[package.json]: https://npmjs.org/doc/json.html - -## The "rev" task - -Use the **rev** task together with [yeoman/grunt-usemin](https://github.com/yeoman/grunt-usemin) for cache busting of static files in your app. This allows them to be cached forever by the browser. - -### Overview -In your project's Gruntfile, add a section named `rev` to the data object passed into `grunt.initConfig()`. - -```js -grunt.initConfig({ - rev: { - options: { - algorithm: 'md5', - length: 8 - }, - assets: { - files: [{ - src: [ - 'img/**/*.{jpg,jpeg,gif,png}', - 'fonts/**/*.{eot,svg,ttf,woff}' - ] - }] - } - }, -}) -``` - -### Options - -#### options.algorithm -Type: `String` -Default value: `'md5'` - -`algorithm` is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha1'`, `'md5'`, `'sha256'`, `'sha512'`, etc. On recent releases, `openssl list-message-digest-algorithms` will display the available digest algorithms. - -#### options.length -Type: `Number` -Default value: `8` - -The number of characters of the file content hash to prefix the file name with. - -### Usage Examples - -#### Basic Asset Revving -This will rename `app.js` and `app.css` with an 8 character long hash prefix. For example `js/9becff3a.app.js` and `css/ae35dd05.app.css`. The hash value depends on the file contents. - -```js -grunt.initConfig({ - rev: { - files: { - src: ['scripts/app.js', 'css/app.css'] - } - } -}) -``` - -#### Custom Options -Change the algorithm or length to style the generated asset file names. Note that the `usemin` companion task requires at least one anycase hexadecimal character to prefix the file name. - -```js -grunt.initConfig({ - rev: { - options: { - algorithm: 'sha1', - length: 4 - }, - files: { - src: ['**/*.{js,css,png,jpg}'] - } - } -}) -``` - -## 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][]. - -## Release History -_(Nothing yet)_ diff --git a/node_modules/grunt-rev/package.json b/node_modules/grunt-rev/package.json deleted file mode 100644 index d13748c..0000000 --- a/node_modules/grunt-rev/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "grunt-rev", - "description": "Static file asset revisioning through content hashing", - "version": "0.1.0", - "homepage": "https://github.com/cbas/grunt-rev", - "author": { - "name": "Sebastiaan Deckers", - "email": "seb@ninja.sg", - "url": "http://ninja.sg" - }, - "repository": { - "type": "git", - "url": "git://github.com/cbas/grunt-rev.git" - }, - "bugs": { - "url": "https://github.com/cbas/grunt-rev/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cbas/grunt-rev/blob/master/LICENSE-MIT" - } - ], - "main": "Gruntfile.js", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "devDependencies": { - "grunt-contrib-copy": "0.4.0", - "grunt-contrib-jshint": "0.1.1rc6", - "grunt-contrib-clean": "0.4.0rc6", - "grunt-contrib-nodeunit": "0.1.2rc6", - "grunt": "0.4.0rc6" - }, - "keywords": [ - "gruntplugin" - ], - "readme": "# grunt-rev [![Build Status](https://travis-ci.org/cbas/grunt-rev.png)](https://travis-ci.org/cbas/grunt-rev)\n\n> Static file asset revisioning through content hashing\n\n## Getting Started\n_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._\n\nFrom the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:\n\n```bash\nnpm install grunt-rev --save-dev\n```\n\nOnce that's done, add this line to your project's Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-rev');\n```\n\nIf the plugin has been installed correctly, running `grunt --help` at the command line should list the newly-installed plugin's task or tasks. In addition, the plugin should be listed in package.json as a `devDependency`, which ensures that it will be installed whenever the `npm install` command is run.\n\n[grunt]: http://gruntjs.com/\n[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md\n[package.json]: https://npmjs.org/doc/json.html\n\n## The \"rev\" task\n\nUse the **rev** task together with [yeoman/grunt-usemin](https://github.com/yeoman/grunt-usemin) for cache busting of static files in your app. This allows them to be cached forever by the browser.\n\n### Overview\nIn your project's Gruntfile, add a section named `rev` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n rev: {\n options: {\n algorithm: 'md5',\n length: 8\n },\n assets: {\n files: [{\n src: [\n 'img/**/*.{jpg,jpeg,gif,png}',\n 'fonts/**/*.{eot,svg,ttf,woff}'\n ]\n }]\n }\n },\n})\n```\n\n### Options\n\n#### options.algorithm\nType: `String`\nDefault value: `'md5'`\n\n`algorithm` is dependent on the available algorithms supported by the version of OpenSSL on the platform. Examples are `'sha1'`, `'md5'`, `'sha256'`, `'sha512'`, etc. On recent releases, `openssl list-message-digest-algorithms` will display the available digest algorithms.\n\n#### options.length\nType: `Number`\nDefault value: `8`\n\nThe number of characters of the file content hash to prefix the file name with.\n\n### Usage Examples\n\n#### Basic Asset Revving\nThis will rename `app.js` and `app.css` with an 8 character long hash prefix. For example `js/9becff3a.app.js` and `css/ae35dd05.app.css`. The hash value depends on the file contents.\n\n```js\ngrunt.initConfig({\n rev: {\n files: {\n src: ['scripts/app.js', 'css/app.css']\n }\n }\n})\n```\n\n#### Custom Options\nChange the algorithm or length to style the generated asset file names. Note that the `usemin` companion task requires at least one anycase hexadecimal character to prefix the file name.\n\n```js\ngrunt.initConfig({\n rev: {\n options: {\n algorithm: 'sha1',\n length: 4\n },\n files: {\n src: ['**/*.{js,css,png,jpg}']\n }\n }\n})\n```\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][].\n\n## Release History\n_(Nothing yet)_\n", - "readmeFilename": "README.md", - "_id": "grunt-rev@0.1.0", - "dist": { - "shasum": "b32427e7d842345839709343a58c387361694947" - }, - "_from": "grunt-rev@~0.1.0", - "_resolved": "https://registry.npmjs.org/grunt-rev/-/grunt-rev-0.1.0.tgz" -} diff --git a/node_modules/grunt-rev/tasks/rev.js b/node_modules/grunt-rev/tasks/rev.js deleted file mode 100644 index 208bb97..0000000 --- a/node_modules/grunt-rev/tasks/rev.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * grunt-rev - * https://github.com/cbas/grunt-rev - * - * Copyright (c) 2013 Sebastiaan Deckers - * Licensed under the MIT license. - */ - -'use strict'; - -var fs = require('fs'), - path = require('path'), - crypto = require('crypto'); - -module.exports = function(grunt) { - - function md5(filepath, algorithm, encoding) { - var hash = crypto.createHash(algorithm); - grunt.log.verbose.write('Hashing ' + filepath + '...'); - hash.update(grunt.file.read(filepath)); - return hash.digest(encoding); - } - - grunt.registerMultiTask('rev', 'Prefix static asset file names with a content hash', function() { - - var options = this.options({ - algorithm: 'md5', - length: 8 - }); - - this.files.forEach(function(filePair) { - filePair.src.forEach(function(f) { - - var hash = md5(f, options.algorithm, 'hex'), - prefix = hash.slice(0, options.length), - renamed = [prefix, path.basename(f)].join('.'), - outPath = path.resolve(path.dirname(f), renamed); - - grunt.verbose.ok().ok(hash); - fs.renameSync(f, outPath); - grunt.log.write(f + ' ').ok(renamed); - - }); - }); - - }); - -}; diff --git a/node_modules/grunt-rev/test/fixtures/custom.txt b/node_modules/grunt-rev/test/fixtures/custom.txt deleted file mode 100644 index ff3bb63..0000000 --- a/node_modules/grunt-rev/test/fixtures/custom.txt +++ /dev/null @@ -1 +0,0 @@ -The quick brown fox jumps over the lazy dog \ No newline at end of file diff --git a/node_modules/grunt-rev/test/fixtures/default.txt b/node_modules/grunt-rev/test/fixtures/default.txt deleted file mode 100644 index ff3bb63..0000000 --- a/node_modules/grunt-rev/test/fixtures/default.txt +++ /dev/null @@ -1 +0,0 @@ -The quick brown fox jumps over the lazy dog \ No newline at end of file diff --git a/node_modules/grunt-rev/test/rev_test.js b/node_modules/grunt-rev/test/rev_test.js deleted file mode 100644 index ebfff96..0000000 --- a/node_modules/grunt-rev/test/rev_test.js +++ /dev/null @@ -1,46 +0,0 @@ -'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.rev = { - setUp: function(done) { - // setup here if necessary - done(); - }, - default_options: function(test) { - test.expect(1); - - var exists = grunt.file.exists('tmp/9e107d9d.default.txt'); - test.ok(exists, '8 character MD5 hash prefix'); - - test.done(); - }, - custom_options: function(test) { - test.expect(1); - - var exists = grunt.file.exists('tmp/2fd4.custom.txt'); - test.ok(exists, '4 character SHA-1 hash prefix'); - - test.done(); - }, -}; diff --git a/node_modules/grunt-svgmin/node_modules/.bin/svgo b/node_modules/grunt-svgmin/node_modules/.bin/svgo deleted file mode 120000 index d6a228b..0000000 --- a/node_modules/grunt-svgmin/node_modules/.bin/svgo +++ /dev/null @@ -1 +0,0 @@ -../svgo/bin/svgo \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/.jamignore b/node_modules/grunt-svgmin/node_modules/filesize/.jamignore deleted file mode 100644 index 096746c..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/.jamignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/.npmignore b/node_modules/grunt-svgmin/node_modules/filesize/.npmignore deleted file mode 100644 index 2ccbe46..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ diff --git a/node_modules/grunt-svgmin/node_modules/filesize/.travis.yml b/node_modules/grunt-svgmin/node_modules/filesize/.travis.yml deleted file mode 100644 index c2ba3f9..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/Gruntfile.js b/node_modules/grunt-svgmin/node_modules/filesize/Gruntfile.js deleted file mode 100644 index f3bffdc..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/Gruntfile.js +++ /dev/null @@ -1,69 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - pkg : grunt.file.readJSON("package.json"), - concat: { - options : { - banner : "/**\n" + - " * <%= pkg.name %>\n" + - " *\n" + - " * @author <%= pkg.author.name %> <<%= pkg.author.email %>>\n" + - " * @copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>\n" + - " * @license <%= pkg.licenses[0].type %> <<%= pkg.licenses[0].url %>>\n" + - " * @link <%= pkg.homepage %>\n" + - " * @module <%= pkg.name %>\n" + - " * @version <%= pkg.version %>\n" + - " */\n" - }, - dist: { - src : [ - "", - "src/filesize.js" - ], - dest : "lib/filesize.js" - } - }, - nodeunit: { - all : ["test/*.js"] - }, - uglify: { - options: { - banner : "/**\n" + - " * <%= pkg.name %>\n" + - " *\n" + - " * @author <%= pkg.author.name %> <<%= pkg.author.email %>>\n" + - " * @copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>\n" + - " * @license <%= pkg.licenses[0].type %> <<%= pkg.licenses[0].url %>>\n" + - " * @link <%= pkg.homepage %>\n" + - " * @module <%= pkg.name %>\n" + - " * @version <%= pkg.version %>\n" + - " */\n", - mangle: { - except: ["filesize"] - } - }, - target: { - files: { - "lib/<%= pkg.name %>.min.js" : ["<%= concat.dist.dest %>"] - } - } - } - }); - - grunt.loadNpmTasks("grunt-contrib-concat"); - grunt.loadNpmTasks("grunt-contrib-nodeunit"); - grunt.loadNpmTasks("grunt-contrib-uglify"); - - grunt.registerTask("test", ["nodeunit"]); - - grunt.registerTask("version", function () { - var cfg = grunt.config("pkg"), - ver = cfg.version, - fn = "lib/" + cfg.name + ".js", - fp = grunt.file.read(fn); - - console.log("Setting version to: " + ver); - grunt.file.write(fn, fp.replace(/\{\{VERSION\}\}/g, ver)); - }); - - grunt.registerTask("default", ["concat", "version", "uglify", "test"]); -}; \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/LICENSE b/node_modules/grunt-svgmin/node_modules/filesize/LICENSE deleted file mode 100644 index af35006..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -Copyright (c) 2012, Jason Mulligan -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of avoidwork inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/README.md b/node_modules/grunt-svgmin/node_modules/filesize/README.md deleted file mode 100644 index 6faeb5c..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/README.md +++ /dev/null @@ -1,30 +0,0 @@ -[![build status](https://secure.travis-ci.org/avoidwork/filesize.js.png)](http://travis-ci.org/avoidwork/filesize.js) -# filesize.js - -filesize.js provides a simple way to get a human readable file size string from a number (float or integer) or string. An optional second parameter is the decimal place to round to (default is 2), or _true_ which triggers Unix style output. - -## Examples - -``` js -filesize(500); // "3.91Kb" -filesize(500, true); // "3.9k" -filesize(1500); // "1.46KB" -filesize("1500000000"); // "1.40GB" -filesize("1500000000", 0); // "1GB" -filesize(1212312421412412); // "1.08PB" -filesize(1212312421412412, true); // "1.1P" - shorthand output, similar to *nix "ls -lh" -``` - -## How can I load filesize.js? - -filesize.js supports AMD loaders (require.js, curl.js, etc.), node.js & npm (npm install filesize), or using a script tag. - -## Information - -#### License - -filesize.js is licensed under BSD-3 https://raw.github.com/avoidwork/filesize.js/master/LICENSE - -#### Copyright - -Copyright (c) 2012, Jason Mulligan \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/lib/filesize.js b/node_modules/grunt-svgmin/node_modules/filesize/lib/filesize.js deleted file mode 100644 index 4b3444b..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/lib/filesize.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * filesize - * - * @author Jason Mulligan - * @copyright 2013 Jason Mulligan - * @license BSD-3 - * @link http://filesizejs.com - * @module filesize - * @version 1.8.0 - */ -(function (global) { - "use strict"; - - var base = 10, - sizes = [["B", 1], ["Kb", 128], ["KB", 1024], ["Mb", 131072], ["MB", 1.049e+6], ["Gb", 1.342e+8], ["GB", 1.074e+9], ["Tb", 1.374e+11], ["TB", 1.1e+12], ["Pb", 1.407e+14], ["PB", 1.126e+15]], - nth = sizes.length, - regex = /\.(.*)/, - bit = /b$/, - zero = /^0$/; - - /** - * filesize - * - * @param {Mixed} arg String, Int or Float to transform - * @param {Number} pos [Optional] Position to round to, defaults to 2 if short is ommitted - * @param {Boolean} short [Optional] Shorthand output, similar to "ls -lh", overrides pos to 1 - * @return {String} Readable file size String - */ - function filesize (arg) { - var result = "", - i = nth, - neg, num, pos, short, size, suffix, z; - - if (arguments[2] !== undefined) { - pos = arguments[1]; - short = arguments[2]; - } - else typeof arguments[1] === "boolean" ? short = arguments[1] : pos = arguments[1]; - - if (isNaN(arg) || (pos !== undefined && isNaN(pos))) throw Error("Invalid arguments"); - - short = (short === true); - pos = short ? 1 : (pos === undefined ? 2 : parseInt(pos, base)); - num = Number(arg); - neg = (num < 0); - - // Flipping a negative number to determine the size - if (neg) num = -num; - - // Zero is now a special case because bytes divide by 1 - if (num === 0) { - if (short) pos = 0; - result = Number(0).toFixed(pos) + "B"; - } - else { - while (i--) { - size = sizes[i][1]; - suffix = sizes[i][0]; - if (num >= size) { - result = (num / size).toFixed(pos); - if (short) { - if (bit.test(suffix)) suffix = suffix.toLowerCase(); - suffix = suffix.charAt(0); - z = regex.exec(result); - if (z !== null && z[1] !== undefined && zero.test(z[1])) result = parseInt(result, base); - } - result += suffix; - break; - } - } - } - - return (neg ? "-" : "") + result; - }; - - if (typeof exports !== "undefined") module.exports = filesize; - else if (typeof define === "function") define(function () { return filesize; }); - else global.filesize = filesize; -})(this); \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/lib/filesize.min.js b/node_modules/grunt-svgmin/node_modules/filesize/lib/filesize.min.js deleted file mode 100644 index a2e24b6..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/lib/filesize.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * filesize - * - * @author Jason Mulligan - * @copyright 2013 Jason Mulligan - * @license BSD-3 - * @link http://filesizejs.com - * @module filesize - * @version 1.8.0 - */ -(function(e){"use strict";function filesize(e){var u,a,f,d,b,m,g,l="",c=n;if(void 0!==arguments[2]?(f=arguments[1],d=arguments[2]):"boolean"==typeof arguments[1]?d=arguments[1]:f=arguments[1],isNaN(e)||void 0!==f&&isNaN(f))throw Error("Invalid arguments");if(d=d===!0,f=d?1:void 0===f?2:parseInt(f,t),a=Number(e),u=0>a,u&&(a=-a),0===a)d&&(f=0),l=Number(0).toFixed(f)+"B";else for(;c--;)if(b=r[c][1],m=r[c][0],a>=b){l=(a/b).toFixed(f),d&&(o.test(m)&&(m=m.toLowerCase()),m=m.charAt(0),g=i.exec(l),null!==g&&void 0!==g[1]&&s.test(g[1])&&(l=parseInt(l,t))),l+=m;break}return(u?"-":"")+l}var t=10,r=[["B",1],["Kb",128],["KB",1024],["Mb",131072],["MB",1049e3],["Gb",1342e5],["GB",1074e6],["Tb",1374e8],["TB",11e11],["Pb",1407e11],["PB",1126e12]],n=r.length,i=/\.(.*)/,o=/b$/,s=/^0$/;"undefined"!=typeof exports?module.exports=filesize:"function"==typeof define?define(function(){return filesize}):e.filesize=filesize})(this); \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/package.json b/node_modules/grunt-svgmin/node_modules/filesize/package.json deleted file mode 100644 index f8a5bec..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "filesize", - "description": "JavaScript library to generate a human readable String describing the file size", - "version": "1.8.0", - "homepage": "http://filesizejs.com", - "author": { - "name": "Jason Mulligan", - "email": "jason.mulligan@avoidwork.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/avoidwork/filesize.js.git" - }, - "bugs": { - "url": "https://github.com/avoidwork/filesize.js/issues" - }, - "licenses": [ - { - "type": "BSD-3", - "url": "https://raw.github.com/avoidwork/filesize.js/master/LICENSE" - } - ], - "main": "lib/filesize", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt test" - }, - "devDependencies": { - "grunt": "~0.4.0", - "grunt-cli": "~ 0.1.6", - "grunt-contrib-concat": "~ 0.1.3", - "grunt-contrib-nodeunit": "~ 0.1.2", - "grunt-contrib-uglify": "~ 0.1.2" - }, - "keywords": [ - "file", - "filesize", - "size", - "readable", - "filesystem" - ], - "readme": "[![build status](https://secure.travis-ci.org/avoidwork/filesize.js.png)](http://travis-ci.org/avoidwork/filesize.js)\n# filesize.js\n\nfilesize.js provides a simple way to get a human readable file size string from a number (float or integer) or string. An optional second parameter is the decimal place to round to (default is 2), or _true_ which triggers Unix style output.\n\n## Examples\n\n``` js\nfilesize(500); // \"3.91Kb\"\nfilesize(500, true); // \"3.9k\"\nfilesize(1500); // \"1.46KB\"\nfilesize(\"1500000000\"); // \"1.40GB\"\nfilesize(\"1500000000\", 0); // \"1GB\"\nfilesize(1212312421412412); // \"1.08PB\"\nfilesize(1212312421412412, true); // \"1.1P\" - shorthand output, similar to *nix \"ls -lh\"\n```\n\n## How can I load filesize.js?\n\nfilesize.js supports AMD loaders (require.js, curl.js, etc.), node.js & npm (npm install filesize), or using a script tag.\n\n## Information\n\n#### License\n\nfilesize.js is licensed under BSD-3 https://raw.github.com/avoidwork/filesize.js/master/LICENSE\n\n#### Copyright\n\nCopyright (c) 2012, Jason Mulligan ", - "readmeFilename": "README.md", - "_id": "filesize@1.8.0", - "dist": { - "shasum": "06940f235326a8eebeba5c7ee419507a00c1b3ab" - }, - "_from": "filesize@~1.8.0", - "_resolved": "https://registry.npmjs.org/filesize/-/filesize-1.8.0.tgz" -} diff --git a/node_modules/grunt-svgmin/node_modules/filesize/src/filesize.js b/node_modules/grunt-svgmin/node_modules/filesize/src/filesize.js deleted file mode 100644 index 753a4e8..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/src/filesize.js +++ /dev/null @@ -1,69 +0,0 @@ -(function (global) { - "use strict"; - - var base = 10, - sizes = [["B", 1], ["Kb", 128], ["KB", 1024], ["Mb", 131072], ["MB", 1.049e+6], ["Gb", 1.342e+8], ["GB", 1.074e+9], ["Tb", 1.374e+11], ["TB", 1.1e+12], ["Pb", 1.407e+14], ["PB", 1.126e+15]], - nth = sizes.length, - regex = /\.(.*)/, - bit = /b$/, - zero = /^0$/; - - /** - * filesize - * - * @param {Mixed} arg String, Int or Float to transform - * @param {Number} pos [Optional] Position to round to, defaults to 2 if short is ommitted - * @param {Boolean} short [Optional] Shorthand output, similar to "ls -lh", overrides pos to 1 - * @return {String} Readable file size String - */ - function filesize (arg) { - var result = "", - i = nth, - neg, num, pos, short, size, suffix, z; - - if (arguments[2] !== undefined) { - pos = arguments[1]; - short = arguments[2]; - } - else typeof arguments[1] === "boolean" ? short = arguments[1] : pos = arguments[1]; - - if (isNaN(arg) || (pos !== undefined && isNaN(pos))) throw Error("Invalid arguments"); - - short = (short === true); - pos = short ? 1 : (pos === undefined ? 2 : parseInt(pos, base)); - num = Number(arg); - neg = (num < 0); - - // Flipping a negative number to determine the size - if (neg) num = -num; - - // Zero is now a special case because bytes divide by 1 - if (num === 0) { - if (short) pos = 0; - result = Number(0).toFixed(pos) + "B"; - } - else { - while (i--) { - size = sizes[i][1]; - suffix = sizes[i][0]; - if (num >= size) { - result = (num / size).toFixed(pos); - if (short) { - if (bit.test(suffix)) suffix = suffix.toLowerCase(); - suffix = suffix.charAt(0); - z = regex.exec(result); - if (z !== null && z[1] !== undefined && zero.test(z[1])) result = parseInt(result, base); - } - result += suffix; - break; - } - } - } - - return (neg ? "-" : "") + result; - }; - - if (typeof exports !== "undefined") module.exports = filesize; - else if (typeof define === "function") define(function () { return filesize; }); - else global.filesize = filesize; -})(this); \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/filesize/test/filesize_test.js b/node_modules/grunt-svgmin/node_modules/filesize/test/filesize_test.js deleted file mode 100644 index 32ceb7a..0000000 --- a/node_modules/grunt-svgmin/node_modules/filesize/test/filesize_test.js +++ /dev/null @@ -1,42 +0,0 @@ -var filesize = require("../lib/filesize.js"); - -exports["filesize"] = { - setUp: function (done) { - this.num = 1024; - this.str = "1024"; - this.invld = "abc"; - this.Kb = 500; - this.neg = -1024; - this.byte = 1; - this.zero = 0; - done(); - }, - valid: function (test) { - test.expect(16); - test.equal(filesize(this.Kb), "3.91Kb", "Should match"); - test.equal(filesize(this.Kb,true), "3.9k", "Should match"); - test.equal(filesize(this.num), "1.00KB", "Should match"); - test.equal(filesize(this.str), "1.00KB", "Should match"); - test.equal(filesize(this.num, 1), "1.0KB", "Should match"); - test.equal(filesize(this.str, 1), "1.0KB", "Should match"); - test.equal(filesize(this.num, true), "1K", "Should match"); - test.equal(filesize(this.str, true), "1K", "Should match"); - test.equal(filesize(this.neg), "-1.00KB", "Should match"); - test.equal(filesize(this.neg, true), "-1K", "Should match"); - test.equal(filesize(this.byte), "1.00B", "Should match"); - test.equal(filesize(this.byte, 1), "1.0B", "Should match"); - test.equal(filesize(this.byte, true), "1B", "Should match"); - test.equal(filesize(this.zero), "0.00B", "Should match"); - test.equal(filesize(this.zero, 1), "0.0B", "Should match"); - test.equal(filesize(this.zero, true), "0B", "Should match"); - this.byte = 1; - test.done(); - }, - invalid: function (test) { - test.expect(3); - test.throws(function () { filesize(this.invld) }, Error, "Should match"); - test.throws(function () { filesize(this.invld, 1) }, Error, "Should match"); - test.throws(function () { filesize(this.invld, true) }, Error, "Should match"); - test.done(); - } -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/.npmignore b/node_modules/grunt-svgmin/node_modules/svgo/.npmignore deleted file mode 100644 index 2c43c13..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/.npmignore +++ /dev/null @@ -1,9 +0,0 @@ -docs -examples -test -.editorconfig -.jshintignore -.jshintrc -.travis.yml -logo.svg -CHANGELOG.MD diff --git a/node_modules/grunt-svgmin/node_modules/svgo/.svgo.yml b/node_modules/grunt-svgmin/node_modules/svgo/.svgo.yml deleted file mode 100644 index b08cc0a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/.svgo.yml +++ /dev/null @@ -1,45 +0,0 @@ -# replace default config -# full: true - -plugins: - - # - name - # - # or: - # - name: false - # - name: true - # - # or: - # - name: - # param1: 1 - # param2: 2 - - - removeDoctype - - removeXMLProcInst - - removeComments - - removeMetadata - - removeEditorsNSData - - cleanupAttrs - - convertStyleToAttrs - - removeRasterImages - - cleanupNumericValues - - convertColors - - removeUnknownsAndDefaults - - removeNonInheritableGroupAttrs - - removeUselessStrokeAndFill - - removeViewBox - - cleanupEnableBackground - - removeHiddenElems - - removeEmptyText - - moveElemsAttrsToGroup - - collapseGroups - - moveGroupAttrsToElems - - convertPathData - - convertTransform - - removeEmptyAttrs - - removeEmptyContainers - - mergePaths - - cleanupIDs - - removeUnusedNS - - transformsWithOnePath - - sortAttrs diff --git a/node_modules/grunt-svgmin/node_modules/svgo/CHANGELOG.md b/node_modules/grunt-svgmin/node_modules/svgo/CHANGELOG.md deleted file mode 100644 index 7798efb..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/CHANGELOG.md +++ /dev/null @@ -1,256 +0,0 @@ - -### [ [>](https://github.com/svg/svgo/tree/v0.3.7) ] 0.3.7 / 24.06.2013 -* do not remove `result` attribute from filter primitives (fix [#122](https://github.com/svg/svgo/issues/122)) -* plugins/cleanupAttrs: replace newline with space when needed (fix [#119](https://github.com/svg/svgo/issues/119)) -* lib/coa: look for config file in current folder -* lib/coa: always traverse all files in the given folder -* deprecate svgo-grunt in favor of [grunt-svgmin](https://github.com/sindresorhus/grunt-svgmin) -* re-enable node-coveralls - -### [ [>](https://github.com/svg/svgo/tree/v0.3.6) ] 0.3.6 / 06.06.2013 -* plugins/removeNonInheritableGroupAttrs: more attrs groups to exclude (fix [#116](https://github.com/svg/svgo/issues/116) & [#118](https://github.com/svg/svgo/issues/118)) -* lib/coa: optimize folder file by file (temp fix [#114](https://github.com/svg/svgo/issues/114)) -* `.jshintrc`: JSHint 2.0 -* temporarily disable node-coveralls - -### [ [>](https://github.com/svg/svgo/tree/v0.3.5) ] 0.3.5 / 07.05.2013 -* plugins/transformsWithOnePath: fix curves bounding box calculation -* plugins/transformsWithOnePath: fix possible c+t or q+s bug - - -### [ [>](https://github.com/svg/svgo/tree/v0.3.4) ] 0.3.4 / 06.05.2013 -* plugins/convertPathData: fix m->M bug in some cases -* plugins/transformsWithOnePath: fix last point calculation for C/S/Q/T -* plugins/mergePaths: add space delimiter between z and m - -### [ [>](https://github.com/svg/svgo/tree/v0.3.3) ] 0.3.3 / 05.05.2013 -* plugins/convertPathData: convert very first m to M, fix applyTransforms with translate() (fix [#112](https://github.com/svg/svgo/issues/112)) -* plugins/transformsWithOnePath: fix real width/height rounding; fix scale transform origin; reorder transforms -* plugins/transformsWithOnePath: ability to set new width or height independently with auto rescaling - -### [ [>](https://github.com/svg/svgo/tree/v0.3.2) ] 0.3.2 / 03.05.2013 -* new plugin [plugins/sortAttrs](https://github.com/svg/svgo/blob/master/plugins/sortAttrs.js) -* plugins/transformsWithOnePath: buggy hcrop (fix [#111](https://github.com/svg/svgo/issues/111)) -* Impossible to set output presision to 0 (no fractional part) (fix [#110](https://github.com/svg/svgo/issues/110)) -* Istanbul + coveralls.io -* update README with NPM version from badge.fury.io -* update README with dependency status from gemnasium.com -* npmignore unneeded files -* reoptimized project logo - -### [ [>](https://github.com/svg/svgo/tree/v0.3.1) ] 0.3.1 / 15.04.2013 -* plugins/transformsWithOnePath: resize SVG and automatically rescale inner Path -* better errors handling - -### [ [>](https://github.com/svg/svgo/tree/v0.3.0) ] 0.3.0 / 12.04.2013 -* global refactoring: getting rid of the many dependencies -* new plugin [plugins/mergePaths](https://github.com/svg/svgo/blob/master/plugins/mergePaths.js) -* new plugin [plugins/transformsWithOnePath](https://github.com/svg/svgo/blob/master/plugins/transformsWithOnePath.js) (renamed and featured `cropAndCenterAlongPath`) -* config: replace default config with `full: true` -* coa: JSON string as value of `--config` -* coa: different types of Data URI strings (close [#105](https://github.com/svg/svgo/issues/105)) -* plugins/_transforms: allow spaces at the beginning of transform -* Travis CI: Nodejs 0.10 & 0.11 -* `node.extend` → `whet.extend` -* update `.gitignore` -* update docs - -### [ [>](https://github.com/svg/svgo/tree/v0.2.4) ] 0.2.4 / 05.04.2013 -* new plugin [plugins/cropAndCenterAlongPath](https://github.com/svg/svgo/blob/master/plugins/cropAndCenterAlongPath.js) for the [Fontello](https://github.com/fontello) project - -### [ [>](https://github.com/svg/svgo/tree/v0.2.3) ] 0.2.3 / 22.02.2013 -* new plugin [plugins/removeNonInheritableGroupAttrs](https://github.com/svg/svgo/blob/master/plugins/removeNonInheritableGroupAttrs.js) (fix [#101](https://github.com/svg/svgo/issues/101)) -* new plugin [plugins/removeRasterImages](https://github.com/svg/svgo/blob/master/plugins/removeRasterImages.js) (close [#98](https://github.com/svg/svgo/issues/98)) -* plugins/convertTransform: bug with trailing spaces in transform value string (fix [#103](https://github.com/svg/svgo/issues/103)) - -### [ [>](https://github.com/svg/svgo/tree/v0.2.2) ] 0.2.2 / 09.02.2013 -* plugins/convertTransforms: wrong translate() shorthand (fix [#94](https://github.com/svg/svgo/issues/94)) -* [yaml.js](https://github.com/jeremyfa/yaml.js) → [js-yaml](https://github.com/nodeca/js-yaml) -* update outdated deps - -### [ [>](https://github.com/svg/svgo/tree/v0.2.1) ] 0.2.1 / 18.01.2013 -* plugins/moveElemsAttrsToGroup + plugins/moveGroupAttrsToElems: move or just leave transform attr from Group to the inner Path Elems (close [#86](https://github.com/svg/svgo/issues/86)) -* plugins/removeViewBox: doesn't catch floating-point numbers (fix [#88](https://github.com/svg/svgo/issues/88)) -* plugins/cleanupEnableBackground: doesn't catch floating-point numbers (fix [#89](https://github.com/svg/svgo/issues/89)) -* plugins/cleanupNumericValues: wrong floating-point numbers regexp (fix [#92](https://github.com/svg/svgo/issues/92)) -* SVG file generated by fontcustom.com not properly compressed (fix [#90](https://github.com/svg/svgo/issues/90)) -* `README.ru.md`: стилизация русского языка, улучшение языковых конструкций, правка ошибок (close [#91](https://github.com/svg/svgo/issues/91)) -* minor JSHint warning fix - -### [ [>](https://github.com/svg/svgo/tree/v0.2.0) ] 0.2.0 / 23.12.2012 -* plugins/convertPathData: apply transforms to Path pata (close [#33](https://github.com/svg/svgo/issues/33)) -* plugins/convertPathData: `-1.816-9.278.682-13.604` parsing error (fix [#85](https://github.com/svg/svgo/issues/85)) -* plugins/convertTransform: `translate(10, 0)` eq `translate(10)`, but not `translate(10, 10)` eq `translate(10)` (fix [#83](https://github.com/svg/svgo/issues/83)) -* run plugins/cleanupIDs before plugins/collapseGroups (fix [#84](https://github.com/svg/svgo/issues/84)) -* update `.gitignore` - -### [ [>](https://github.com/svg/svgo/tree/v0.1.9) ] 0.1.9 / 17.12.2012 -* plugins/cleanupIDs: renamed from removeUnusedIDs; minify used IDs (fix [#7](https://github.com/svg/svgo/issues/7)) -* lib/svgo/js2svg: restore HTML entities back (fix [#80](https://github.com/svg/svgo/issues/80) + [#81](https://github.com/svg/svgo/issues/81)) -* plugins/removeDoctype: do not remove if custom XML entities presents (fix [#77](https://github.com/svg/svgo/issues/77)) -* lib/svgo/coa: refactoring, colors and fix [#70](https://github.com/svg/svgo/issues/70) -* lib/svgo: store elapsed time in result object -* usage examples with SVGZ (close [#18](https://github.com/svg/svgo/issues/18)) -* more optimized logo -* update `.gitignore` - -### [ [>](https://github.com/svg/svgo/tree/v0.1.8) ] 0.1.8 / 11.12.2012 -* new plugin [plugins/removeUselessStrokeAndFill](https://github.com/svg/svgo/blob/master/plugins/removeUselessStrokeAndFill.js) (close [#75](https://github.com/svg/svgo/issues/75)) -* new plugin [plugins/removeUnusedIDs](https://github.com/svg/svgo/blob/master/plugins/removeUnusedIDs.js) (close [#76](https://github.com/svg/svgo/issues/76)) -* plugins/convertPathData: wrong M interpretation in some cases (fix [#73](https://github.com/svg/svgo/issues/73)) -* plugins/cleanupAttrs: use `isElem()` API -* `.travis.yml`: check all branches - - -### [ [>](https://github.com/svg/svgo/tree/v0.1.7) ] 0.1.7 / 08.12.2012 -* plugins/convertPathData: incorrect interpretation of `z + m` (fix [#69](https://github.com/svg/svgo/issues/69)) -* plugins/convertTransform: do a more accurate floating numbers rounding in `matrixToTransform()` (fix [#68](https://github.com/svg/svgo/issues/68)) - -### [ [>](https://github.com/svg/svgo/tree/v0.1.6) ] 0.1.6 / 07.12.2012 -* plugins/convertPathData: collapse repeated instructions only after curveSmoothShorthands (fix [#64](https://github.com/svg/svgo/issues/64)) -* lib/svgo/coa: handle 'there is nothing to optimize' case and display a message about it (fix [#61](https://github.com/svg/svgo/issues/61)) -* plugins/cleanupSVGElem: delete as useless artefact - - -### [ [>](https://github.com/svg/svgo/tree/v0.1.5) ] 0.1.5 / 06.12.2012 -* E-notated numbers in paths not recognised (fix [#63](https://github.com/svg/svgo/issues/63)) -* update README with `svgo-grunt` and `svgo-osx-folder-action` -* fix `mocha-as-promised` plug in node 0.6 - -### [ [>](https://github.com/svg/svgo/tree/v0.1.4) ] 0.1.4 / 05.12.2012 -* plugins/_collections: more defaults -* `README.ru.md` -* `docs/how-it-works/ru.md` -* mocha + mocha-as-promised + chai + chai-as-promised + should + istanbul = <3 -* update dependencies semvers in `package.json` -* `v0.1.x` and `v0.2.x` milestones - -### [ [>](https://github.com/svg/svgo/tree/v0.1.3) ] 0.1.3 / 30.11.2012 -* new plugin [plugins/cleanupNumericValues](https://github.com/svg/svgo/blob/master/plugins/cleanupNumericValues.js) (close [#8](https://github.com/svg/svgo/issues/8)) -* plugins/removeDefaultPx functionality now included in plugins/removeUnknownsAndDefaults -* plugins/removeUnknownsAndDefaults: refactoring and picking up the complete elems+attrs collection (close [#59](https://github.com/svg/svgo/issues/59)) -* plugins/convertTransform: error in matrices multiplication (fix [#58](https://github.com/svg/svgo/issues/58)) -* plugins/convertTransform: mark translate() and scale() as useless only with one param (fix [#57](https://github.com/svg/svgo/issues/57)) -* plugins/convertPathData: drastic speed improvement with huge Path data -* plugins/convertPathData: fix the very first Mm with multiple points (fix [#56](https://github.com/svg/svgo/issues/56)) -* plugins/moveElemsAttrsToGroup: additional check for transform attr -* brand-new project `logo.svg` -* `.travis.yml`: build only master branch -* global `'use strict'` -* `.jshintignore` -* README and CHANGELOG: minor corrections - -### [ [>](https://github.com/svg/svgo/tree/v0.1.2) ] 0.1.2 / 24.11.2012 -* lib/svgo/svg2js: correct 'onerror' failure (fix [#51](https://github.com/svg/svgo/issues/51)) -* config: disable sax-js position tracking by default (fix [#52](https://github.com/svg/svgo/issues/52)) -* lib/svgo: rename 'startBytes' to 'inBytes' and 'endBytes' to 'outBytes' (close [#53](https://github.com/svg/svgo/issues/53)) -* plugins/removeUnknownsAndDefaults: remove SVG id attr (close [#54](https://github.com/svg/svgo/issues/54)) - -### [ [>](https://github.com/svg/svgo/tree/v0.1.1) ] 0.1.1 / 23.11.2012 -* plugins/moveElemsAttrsToGroup: fix inheitable only attrs array (fix [#47](https://github.com/svg/svgo/issues/47)) -* plugins/removeEmptyContainers: do not remove an empty 'svg' element (fix [#48](https://github.com/svg/svgo/issues/48)) -* plugins/removeDefaultPx: should also understand a floating-numbers too (fix [#49](https://github.com/svg/svgo/issues/49)) -* plugins/removeUnknownsAndDefaults: merge multiple groupDefaults attrs (close [#50](https://github.com/svg/svgo/issues/50)) - -### [ [>](https://github.com/svg/svgo/tree/v0.1.0) ] 0.1.0 / 22.11.2012 -* new plugin [plugins/removeUnknownsAndDefaults](https://github.com/svg/svgo/blob/master/plugins/removeUnknownsAndDefaults.js) (close [#6](https://github.com/svg/svgo/issues/6)) -* plugins/convertPathData: convert straight curves into lines segments (close [#17](https://github.com/svg/svgo/issues/17)); remove an absolute coords conversions -* plugins/convertPathData: convert quadratic Bézier curveto into smooth shorthand (close [#31](https://github.com/svg/svgo/issues/31)) -* plugins/convertPathData: convert curveto into smooth shorthand (close [#30](https://github.com/svg/svgo/issues/30)) -* lib/svgo: global API refactoring (close [#37](https://github.com/svg/svgo/issues/37)) -* lib/svgo: fatal and stupid error in stream chunks concatenation (fix [#40](https://github.com/svg/svgo/issues/40)) -* lib/coa: batch folder optimization (close [#29](https://github.com/svg/svgo/issues/29)) -* lib/coa: support arguments as aliases to `--input` and `--output` (close [#28](https://github.com/svg/svgo/issues/28)) -* project logo by [Egor Bolhshakov](http://xizzzy.ru/) -* move modules to `./lib/svgo/` -* rename and convert `config.json` to `.svgo.yml` -* add [./docs/](https://github.com/svg/svgo/tree/master/docs) -* plugins/convertPathData: don't remove first `M` even if it's `0,0` -* plugins/convertPathData: stronger defense from infinite loop -* plugins/moveElemsAttrsToGroup: should affect only inheritable attributes (fix [#46](https://github.com/svg/svgo/issues/46))* -* plugins/removeComments: ignore comments which starts with '!' (close [#43](https://github.com/svg/svgo/issues/43)) -* config: `cleanupAttrs` should be before `convertStyleToAttrs` (fix [#44](https://github.com/svg/svgo/issues/44))* -* lib/svgo/jsAPI: add `eachAttr()` optional context param -* temporarily remove PhantomJS and `--test` (close [#38](https://github.com/svg/svgo/issues/38)) -* q@0.8.10 compatibility: 'end is deprecated, use done instead' fix -* add [Istanbul](https://github.com/gotwarlost/istanbul) code coverage -* update dependencies versions and gitignore -* README: add TODO section with versions milestones -* update README with License section -* update LICENSE with russian translation -* `.editorconfig`: 2 spaces for YAML - -### [ [>](https://github.com/svg/svgo/tree/v0.0.9) ] 0.0.9 / 29.10.2012 -* [plugins how-to](https://github.com/svg/svgo/tree/master/plugins#readme) (close [#27](https://github.com/svg/svgo/issues/27)) -* allow any plugin of any type to go in any order (close [#14](https://github.com/svg/svgo/issues/14)) -* allow to do a multiple optimizations with one init (close [#25](https://github.com/svg/svgo/issues/25)) -* plugins/convertPathData: global refactoring -* plugins/convertPathData: do all the tricks with absolute coords too (fix [#22](https://github.com/svg/svgo/issues/22)) -* plugins/convertPathData: accumulation of rounding errors (fix [#23](https://github.com/svg/svgo/issues/23)) -* plugins/convertPathData: prevent an infinity loop on invalid path data (fix [#26](https://github.com/svg/svgo/issues/26)) -* plugins/convertPathData: do not remove very first M from the path data (fix [#24](https://github.com/svg/svgo/issues/24)) -* plugins/convertPathData: optimize path data in <glyph> and <missing-glyph> (close [#20](https://github.com/svg/svgo/issues/20)) -* plugins/convertTransform: add patternTransform attribute to the process (close [#15](https://github.com/svg/svgo/issues/15)) -* plugins/convertTransform: Firefox: removing extra space in front of negative number is alowed only in path data, but not in transform (fix [#12](https://github.com/svg/svgo/issues/12)) -* plugins/removeXMLProcInst: remove only 'xml' but not 'xml-stylesheet' (fix [#21](https://github.com/svg/svgo/issues/15)) -* plugins/collapseGroups: merge split-level transforms (fix [#13](https://github.com/svg/svgo/issues/13)) -* jsdoc corrections - -### [ [>](https://github.com/svg/svgo/tree/v0.0.8) ] 0.0.8 / 20.10.2012 -* new plugin [convertTransform](plugins/convertTransform.js) (close [#5](https://github.com/svg/svgo/issues/5)) -* new plugin [removeUnusedNS](plugins/removeUnusedNS.js) -* plugins/convertPathData: remove useless segments -* plugins/convertPathData: a lot of refactoring -* plugins/convertPathData: round numbers before conditions because of exponential notation (fix [#3](https://github.com/svg/svgo/issues/3)) -* plugins/moveElemsAttrsToGroup: merge split-level transforms instead of replacing (fix [#10](https://github.com/svg/svgo/issues/10)) -* lib/svg2js: catch and output xml parser errors (fix [#4](https://github.com/svg/svgo/issues/4)) -* lib/coa: open file for writing only when we are ready (fix [#2](https://github.com/svg/svgo/issues/2)) -* lib/tools: node.extend module -* lib/plugins: refactoring -* lib/js2svg: refactoring -* lib/jsAPI: simplification and refactoring -* absolute urls in README -* update .editorconfig -* update .travis.yml with nodejs 0.9 - -### [ [>](https://github.com/svg/svgo/tree/v0.0.7) ] 0.0.7 / 14.10.2012 -* new plugin [convertPathData](plugins/convertPathData.js) -* --input data now can be a Data URI base64 string -* --output data now can be a Data URI base64 string with --datauri flag -* Travis CI -* JSHint corrections + .jshintrc -* [.editorconfig](http://editorconfig.org/) -* display time spent on optimization -* .svgo → config.json -* lib/phantom_wrapper.js → lib/phantom.js - -### [ [>](https://github.com/svg/svgo/tree/v0.0.6) ] 0.0.6 / 04.10.2012 -* add --test option to make a visual comparison of two files (PhantomJS pre-required) -* update README and CHANGELOG with the correct relative urls - -### [ [>](https://github.com/svg/svgo/tree/v0.0.5) ] 0.0.5 / 03.10.2012 -* every plugin now has [at least one test](plugins) -* removeViewBox, cleanupEnableBackground, removeEditorsNSData, convertStyleToAttrs and collapseGroups plugins fixes -* new --pretty option for the pretty printed SVG -* lib/config refactoring - -### [ [>](https://github.com/svg/svgo/tree/v0.0.4) ] 0.0.4 / 30.09.2012 -* new plugin [removeViewBox](plugins/removeViewBox.js) -* new plugin [cleanupEnableBackground](plugins/cleanupEnableBackground.js) -* display useful info after successful optimization -* 'npm test' with 'spec' mocha output by default - -### [ [>](https://github.com/svg/svgo/tree/v0.0.3) ] 0.0.3 / 29.09.2012 -* plugins/collapseGroups bugfix -* plugins/moveElemsAttrsToGroup bugfix -* svgo now display --help if running w/o arguments -* massive jsdoc updates -* plugins engine main filter function optimization - -### [ [>](https://github.com/svg/svgo/tree/v0.0.2) ] 0.0.2 / 28.09.2012 -* add --disable and --enable command line options -* add an empty values rejecting to coa.js -* update README - -### [ [>](https://github.com/svg/svgo/tree/v0.0.1) ] 0.0.1 / 27.09.2012 -* initial public version diff --git a/node_modules/grunt-svgmin/node_modules/svgo/LICENSE b/node_modules/grunt-svgmin/node_modules/svgo/LICENSE deleted file mode 100644 index 4c51fac..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/LICENSE +++ /dev/null @@ -1,55 +0,0 @@ -The MIT License - -Copyright © 2012 Kir Belevich - -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. - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Лицензия MIT - -Copyright © 2012 Кир Белевич - -Данная лицензия разрешает лицам, получившим копию данного -программного обеспечения и сопутствующей документации -(в дальнейшем именуемыми «Программное Обеспечение»), безвозмездно -использовать Программное Обеспечение без ограничений, включая -неограниченное право на использование, копирование, изменение, -добавление, публикацию, распространение, сублицензирование -и/или продажу копий Программного Обеспечения, также как и лицам, -которым предоставляется данное Программное Обеспечение, -при соблюдении следующих условий: - -Указанное выше уведомление об авторском праве и данные условия -должны быть включены во все копии или значимые части данного -Программного Обеспечения. - -ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», -БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, -ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ГАРАНТИЯМИ ТОВАРНОЙ ПРИГОДНОСТИ, -СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ -ПРАВ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ -ОТВЕТСТВЕННОСТИ ПО ИСКАМ О ВОЗМЕЩЕНИИ УЩЕРБА, УБЫТКОВ ИЛИ ДРУГИХ -ТРЕБОВАНИЙ ПО ДЕЙСТВУЮЩИМ КОНТРАКТАМ, ДЕЛИКТАМ ИЛИ ИНОМУ, -ВОЗНИКШИМ ИЗ, ИМЕЮЩИМ ПРИЧИНОЙ ИЛИ СВЯЗАННЫМ С ПРОГРАММНЫМ -ОБЕСПЕЧЕНИЕМ ИЛИ ИСПОЛЬЗОВАНИЕМ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ -ИЛИ ИНЫМИ ДЕЙСТВИЯМИ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ. diff --git a/node_modules/grunt-svgmin/node_modules/svgo/Makefile b/node_modules/grunt-svgmin/node_modules/svgo/Makefile deleted file mode 100644 index 95427e2..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -test: - @NODE_ENV=test ./node_modules/.bin/mocha - -lib-cov: - @./node_modules/.bin/istanbul instrument --output lib-cov --no-compact --variable global.__coverage__ lib - -coverage: lib-cov - @COVERAGE=1 ISTANBUL_REPORTERS=text-summary ./node_modules/.bin/mocha --reporter mocha-istanbul - @rm -rf lib-cov - -coveralls: lib-cov - @COVERAGE=1 ISTANBUL_REPORTERS=lcovonly ./node_modules/.bin/mocha --reporter mocha-istanbul - @cat lcov.info | ./node_modules/.bin/coveralls - @rm -rf lib-cov lcov.info - -travis: test coveralls - -jshint: - @jshint --show-non-errors . - -.PHONY: test diff --git a/node_modules/grunt-svgmin/node_modules/svgo/README.md b/node_modules/grunt-svgmin/node_modules/svgo/README.md deleted file mode 100644 index 5858a89..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/README.md +++ /dev/null @@ -1,128 +0,0 @@ -**english** | [русский](https://github.com/svg/svgo/blob/master/README.ru.md) -- - - - -logo - -## SVGO [![NPM version](https://badge.fury.io/js/svgo.png)](https://npmjs.org/package/svgo) [![Dependency Status](https://gemnasium.com/svg/svgo.png)](https://gemnasium.com/svg/svgo) [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](https://travis-ci.org/svg/svgo) [![Coverage Status](https://coveralls.io/repos/svg/svgo/badge.png?branch=master)](https://coveralls.io/r/svg/svgo) - -**SVG O**ptimizer is a Nodejs-based tool for optimizing SVG vector graphics files. -![](https://mc.yandex.ru/watch/18431326) - -## Why? - -SVG files, especially exported from various editors, usually contains a lot of redundant and useless information such as editor metadata, comments, hidden elements, default or non-optimal values and other stuff that can be safely removed or converted without affecting SVG rendering result. - -## What it can do - -SVGO has a plugin-based architecture, so almost every optimization is a separate plugin. - -Today we have: - -* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupAttrs.js) ] cleanup attributes from newlines, trailing and repeating spaces -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeDoctype.js) ] remove doctype declaration -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeXMLProcInst.js) ] remove XML processing instructions -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeComments.js) ] remove comments -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeMetadata.js) ] remove `` -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEditorsNSData.js) ] remove editors namespaces, elements and attributes -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyAttrs.js) ] remove empty attributes -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeHiddenElems.js) ] remove hidden elements -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyText.js) ] remove empty Text elements -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyContainers.js) ] remove empty Container elements -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeViewBox.js) ] remove `viewBox` attribute when possible -* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupEnableBackground.js) ] remove or cleanup `enable-background` attribute when possible -* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertStyleToAttrs.js) ] convert styles into attributes -* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertColors.js) ] convert colors (from `rgb()` to `#rrggbb`, from `#rrggbb` to `#rgb`) -* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertPathData.js) ] convert Path data to relative, convert one segment to another, trim useless delimiters and much more -* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertTransform.js) ] collapse multiple transforms into one, convert matrices to the short aliases and much more -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeUnknownsAndDefaults.js) ] remove unknown elements content and attributes, remove attrs with default values -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeNonInheritableGroupAttrs.js) ] remove non-inheritable group's "presentation" attributes -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeUnusedNS.js) ] remove unused namespaces declaration -* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupIDs.js) ] remove unused and minify used IDs -* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupNumericValues.js) ] round numeric values to the fixed precision, remove default 'px' units -* [ [>](https://github.com/svg/svgo/blob/master/plugins/moveElemsAttrsToGroup.js) ] move elements attributes to the existing group wrapper -* [ [>](https://github.com/svg/svgo/blob/master/plugins/moveGroupAttrsToElems.js) ] move some group attributes to the content elements -* [ [>](https://github.com/svg/svgo/blob/master/plugins/collapseGroups.js) ] collapse useless groups -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeRasterImages.js) ] remove raster images (disabled by default) -* [ [>](https://github.com/svg/svgo/blob/master/plugins/mergePaths.js) ] merge multiple Paths into one -* [ [>](https://github.com/svg/svgo/blob/master/plugins/transformsWithOnePath.js) ] apply transforms, crop by real width, center vertical alignment and resize SVG with one Path inside - -Want to know how it works and how to write your own plugin? [Of course you want to](https://github.com/svg/svgo/blob/master/docs/how-it-works/en.md). - - -## How to use - -```sh -$ [sudo] npm install -g svgo -``` - -``` -Usage: - svgo [OPTIONS] [ARGS] - -Options: - -h, --help : Help - -v, --version : Version - -i INPUT, --input=INPUT : Input file, "-" for STDIN - -s STRING, --string=STRING : Input SVG data string - -f FOLDER, --folder=FOLDER : Input folder, optimize and rewrite all *.svg files - -o OUTPUT, --output=OUTPUT : Output file (by default the same as the input), "-" for STDOUT - --config=CONFIG : Config file to extend or replace default - --disable=DISABLE : Disable plugin by name - --enable=ENABLE : Enable plugin by name - --datauri=DATAURI : Output as Data URI string (base64, URI encoded or unencoded) - --pretty : Make SVG pretty printed - -Arguments: - INPUT : Alias to --input - OUTPUT : Alias to --output -``` - -* with files: - - $ svgo test.svg - - or: - - $ svgo test.svg test.min.svg - -* with STDIN / STDOUT: - - $ cat test.svg | svgo -i - -o - > test.min.svg - -* with folder - - $ svgo -f ../path/to/folder/with/svg/files - -* with strings: - - $ svgo -s 'test' -o test.min.svg - - or even with Data URI base64: - - $ svgo -s 'data:image/svg+xml;base64,…' -o test.min.svg - -* with SVGZ: - - from `.svgz` to `.svg`: - - $ gunzip -c test.svgz | svgo -i - -o test.min.svg - - from `.svg` to `.svgz`: - - $ svgo test.svg -o - | gzip -cfq9 > test.svgz - -* with GUI – [svgo-gui](https://github.com/svg/svgo-gui) -* as a Nodejs module – [examples](https://github.com/svg/svgo/tree/master/examples) -* as a Grunt task – [grunt-svgmin](https://github.com/sindresorhus/grunt-svgmin) -* as an OSX Folder Action – [svgo-osx-folder-action](https://github.com/svg/svgo-osx-folder-action) - -## TODO - -* [v0.3.x](https://github.com/svg/svgo/issues?milestone=7&state=open) - - -## License and copyrights - -This software is released under the terms of the [MIT license](https://github.com/svg/svgo/blob/master/LICENSE). - -Logo by [Yegor Bolshakov](http://xizzzy.ru/). diff --git a/node_modules/grunt-svgmin/node_modules/svgo/README.ru.md b/node_modules/grunt-svgmin/node_modules/svgo/README.ru.md deleted file mode 100644 index 724ae9f..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/README.ru.md +++ /dev/null @@ -1,128 +0,0 @@ -[english](https://github.com/svg/svgo/blob/master/README.md) | **русский** -- - - - -logo - -## SVGO [![NPM version](https://badge.fury.io/js/svgo.png)](https://npmjs.org/package/svgo) [![Dependency Status](https://gemnasium.com/svg/svgo.png)](https://gemnasium.com/svg/svgo) [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](https://travis-ci.org/svg/svgo) [![Coverage Status](https://coveralls.io/repos/svg/svgo/badge.png?branch=master)](https://coveralls.io/r/svg/svgo) - -**SVG** **O**ptimizer – это инструмент для оптимизации векторной графики в формате SVG, написанный на Node.js. -![](https://mc.yandex.ru/watch/18431326) - -## Зачем? - -SVG-файлы, особенно – экспортированные из различных редакторов, содержат много избыточной и бесполезной информации, комментариев, скрытых элементов, неоптимальные или стандартные значения и другой мусор, удаление которого безопасно и не влияет на конечный результат отрисовки. - -## Возможности - -SVGO имеет расширяемую архитектуру, в которой почти каждая оптимизация является отдельным расширением. - -Сегодня у нас есть: - -* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupAttrs.js) ] удаление переносов строк и лишних пробелов -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeDoctype.js) ] удаление doctype -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeXMLProcInst.js) ] удаление XML-инструкций -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeComments.js) ] удаление комментариев -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeMetadata.js) ] удаление `` -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEditorsNSData.js) ] удаление пространств имён различных редакторов, их элементов и атрибутов -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyAttrs.js) ] удаление пустых атрибутов -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeHiddenElems.js) ] удаление скрытых элементов -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyText.js) ] удаление пустых текстовых элементов -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyContainers.js) ] удаление пустых элементов-контейнеров -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeViewBox.js) ] удаление атрибута `viewBox`, когда это возможно -* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupEnableBackground.js) ] удаление или оптимизация атрибута `enable-background`, когда это возможно -* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertStyleToAttrs.js) ] конвертирование стилей в атрибуте `style` в отдельные svg-атрибуты -* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertColors.js) ] конвертирование цветовых значений: из `rgb()` в `#rrggbb`, из `#rrggbb` в `#rgb` -* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertPathData.js) ] конвертирование данных Path в относительные координаты, конвертирование одних типов сегментов в другие, удаление ненужных разделителей и тому подобное -* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertTransform.js) ] схлопывание нескольких трансформаций в одну, конвертирование матриц в короткие алиасы и многое другое -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeUnknownsAndDefaults.js) ] удаление неизвестных элементов, контента и атрибутов -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeNonInheritableGroupAttrs.js) ] удаление ненаследуемых "презентационных" атрибутов групп -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeUnusedNS.js) ] удаление деклараций неиспользуемых пространств имён -* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupIDs.js) ] удаление неиспользуемых и сокращение используемых ID -* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupNumericValues.js) ] округление дробных чисел до заданной точности, удаление `px` как единицы измерения по-умолчанию -* [ [>](https://github.com/svg/svgo/blob/master/plugins/moveElemsAttrsToGroup.js) ] перемещение совпадающих атрибутов у всех элементов внутри группы `` -* [ [>](https://github.com/svg/svgo/blob/master/plugins/moveGroupAttrsToElems.js) ] перемещение некоторых атрибутов группы на элементы внутри -* [ [>](https://github.com/svg/svgo/blob/master/plugins/collapseGroups.js) ] схлопывание бесполезных групп `` -* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeRasterImages.js) ] удаление растровых изображений (выключено по умолчанию) -* [ [>](https://github.com/svg/svgo/blob/master/plugins/mergePaths.js) ] склеивание нескольких Path в одну кривую -* [ [>](https://github.com/svg/svgo/blob/master/plugins/transformsWithOnePath.js) ] применение трансформаций, обрезка по реальной ширине, вертикальное выравнивание по центру и изменение размеров SVG с одним Path внутри - -Хотите узнать, как это работает и как написать свой плагин? [Конечно же, да!](https://github.com/svg/svgo/blob/master/docs/how-it-works/ru.md). - - -## Как использовать - -```sh -$ [sudo] npm install -g svgo -``` - -``` -Usage: - svgo [OPTIONS] [ARGS] - -Options: - -h, --help : Help - -v, --version : Version - -i INPUT, --input=INPUT : Input file, "-" for STDIN - -s STRING, --string=STRING : Input SVG data string - -f FOLDER, --folder=FOLDER : Input folder, optimize and rewrite all *.svg files - -o OUTPUT, --output=OUTPUT : Output file (by default the same as the input), "-" for STDOUT - --config=CONFIG : Config file to extend or replace default - --disable=DISABLE : Disable plugin by name - --enable=ENABLE : Enable plugin by name - --datauri=DATAURI : Output as Data URI string (base64, URI encoded or unencoded) - --pretty : Make SVG pretty printed - -Arguments: - INPUT : Alias to --input - OUTPUT : Alias to --output -``` - -* с файлами: - - $ svgo test.svg - - или: - - $ svgo test.svg test.min.svg - -* с STDIN / STDOUT: - - $ cat test.svg | svgo -i - -o - > test.min.svg - -* с папками - - $ svgo -f ../path/to/folder/with/svg/files - -* со строками: - - $ svgo -s 'test' -o test.min.svg - - или даже с Data URI base64: - - $ svgo -s 'data:image/svg+xml;base64,…' -o test.min.svg - -* с SVGZ: - - из `.svgz` в `.svg`: - - $ gunzip -c test.svgz | svgo -i - -o test.min.svg - - из `.svg` в `.svgz`: - - $ svgo test.svg -o - | gzip -cfq9 > test.svgz - -* с помощью GUI – [svgo-gui](https://github.com/svg/svgo-gui) -* как модуль Node.js – [examples](https://github.com/svg/svgo/tree/master/examples) -* как таск для Grunt – [grunt-svgmin](https://github.com/sindresorhus/grunt-svgmin) -* как действие папки в OSX – [svgo-osx-folder-action](https://github.com/svg/svgo-osx-folder-action) - -## TODO - -* [v0.3.x](https://github.com/svg/svgo/issues?milestone=7&state=open) - - -## Лицензия и копирайты - -Данное программное обеспечение выпускается под [лицензией MIT](https://github.com/svg/svgo/blob/master/LICENSE). - -Логотип – [Егор Большаков](http://xizzzy.ru/). diff --git a/node_modules/grunt-svgmin/node_modules/svgo/bin/svgo b/node_modules/grunt-svgmin/node_modules/svgo/bin/svgo deleted file mode 100755 index 2fd77c0..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/bin/svgo +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -require('../lib/svgo/coa').run(); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lcov.info b/node_modules/grunt-svgmin/node_modules/svgo/lcov.info deleted file mode 100644 index 1784de2..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lcov.info +++ /dev/null @@ -1,552 +0,0 @@ -TN: -SF:/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/config.js -FN:14,(anonymous_1) -FN:51,preparePluginsArray -FN:56,(anonymous_3) -FN:101,extendConfig -FN:108,(anonymous_5) -FN:115,(anonymous_6) -FN:161,optimizePluginsArray -FN:165,(anonymous_8) -FN:169,(anonymous_9) -FNF:9 -FNH:9 -FNDA:88,(anonymous_1) -FNDA:88,preparePluginsArray -FNDA:144,(anonymous_3) -FNDA:1,extendConfig -FNDA:3,(anonymous_5) -FNDA:87,(anonymous_6) -FNDA:88,optimizePluginsArray -FNDA:144,(anonymous_8) -FNDA:144,(anonymous_9) -DA:1,1 -DA:3,1 -DA:5,1 -DA:14,1 -DA:16,88 -DA:18,88 -DA:20,86 -DA:22,86 -DA:23,86 -DA:24,86 -DA:29,2 -DA:31,2 -DA:33,2 -DA:34,1 -DA:37,2 -DA:41,88 -DA:51,1 -DA:53,88 -DA:56,88 -DA:59,144 -DA:61,86 -DA:62,86 -DA:65,86 -DA:66,0 -DA:67,0 -DA:70,86 -DA:71,0 -DA:74,86 -DA:75,86 -DA:78,86 -DA:83,58 -DA:84,58 -DA:88,144 -DA:101,1 -DA:103,1 -DA:106,1 -DA:108,1 -DA:111,3 -DA:113,3 -DA:115,3 -DA:117,87 -DA:119,3 -DA:120,2 -DA:121,2 -DA:124,1 -DA:125,1 -DA:128,0 -DA:129,0 -DA:142,1 -DA:143,0 -DA:147,1 -DA:148,0 -DA:151,1 -DA:161,1 -DA:163,88 -DA:165,88 -DA:166,144 -DA:169,88 -DA:171,144 -DA:172,44 -DA:173,44 -DA:176,100 -DA:178,100 -DA:182,88 -LF:64 -LH:57 -BRDA:18,1,0,86 -BRDA:18,1,1,2 -BRDA:18,2,0,88 -BRDA:18,2,1,87 -BRDA:22,3,0,86 -BRDA:22,3,1,0 -BRDA:33,4,0,1 -BRDA:33,4,1,1 -BRDA:59,5,0,86 -BRDA:59,5,1,58 -BRDA:65,6,0,0 -BRDA:65,6,1,86 -BRDA:66,7,0,0 -BRDA:66,7,1,0 -BRDA:70,8,0,0 -BRDA:70,8,1,86 -BRDA:74,9,0,86 -BRDA:74,9,1,0 -BRDA:106,10,0,1 -BRDA:106,10,1,0 -BRDA:111,11,0,3 -BRDA:111,11,1,0 -BRDA:117,12,0,3 -BRDA:117,12,1,84 -BRDA:119,13,0,2 -BRDA:119,13,1,1 -BRDA:120,14,0,2 -BRDA:120,14,1,1 -BRDA:124,15,0,1 -BRDA:124,15,1,0 -BRDA:128,16,0,0 -BRDA:128,16,1,0 -BRDA:142,17,0,0 -BRDA:142,17,1,1 -BRDA:147,18,0,0 -BRDA:147,18,1,1 -BRDA:171,19,0,44 -BRDA:171,19,1,100 -BRDA:171,20,0,144 -BRDA:171,20,1,56 -BRF:40 -BRH:27 -end_of_record -TN: -SF:/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/svg2js.js -FN:21,(anonymous_1) -FN:28,pushToContent -FN:38,(anonymous_3) -FN:46,(anonymous_4) -FN:54,(anonymous_5) -FN:62,(anonymous_6) -FN:70,(anonymous_7) -FN:98,(anonymous_8) -FN:106,(anonymous_9) -FN:113,(anonymous_10) -FN:125,(anonymous_11) -FNF:11 -FNH:10 -FNDA:86,(anonymous_1) -FNDA:560,pushToContent -FNDA:3,(anonymous_3) -FNDA:3,(anonymous_4) -FNDA:4,(anonymous_5) -FNDA:1,(anonymous_6) -FNDA:461,(anonymous_7) -FNDA:88,(anonymous_8) -FNDA:461,(anonymous_9) -FNDA:0,(anonymous_10) -FNDA:86,(anonymous_11) -DA:1,1 -DA:3,1 -DA:6,1 -DA:21,1 -DA:23,86 -DA:28,86 -DA:30,560 -DA:32,560 -DA:34,560 -DA:38,86 -DA:40,3 -DA:46,86 -DA:48,3 -DA:54,86 -DA:56,4 -DA:62,86 -DA:64,1 -DA:70,86 -DA:72,461 -DA:78,461 -DA:79,408 -DA:81,408 -DA:82,573 -DA:91,461 -DA:92,461 -DA:94,461 -DA:98,86 -DA:100,88 -DA:106,86 -DA:108,461 -DA:109,461 -DA:113,86 -DA:118,0 -DA:120,0 -DA:121,0 -DA:125,86 -DA:127,86 -DA:131,86 -LF:38 -LH:35 -BRDA:32,1,0,560 -BRDA:32,1,1,302 -BRDA:78,2,0,408 -BRDA:78,2,1,53 -BRF:4 -BRH:4 -end_of_record -TN: -SF:/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/jsAPI.js -FN:5,(anonymous_1) -FN:18,(anonymous_2) -FN:33,(anonymous_3) -FN:47,(anonymous_4) -FN:67,(anonymous_5) -FN:84,(anonymous_6) -FN:106,(anonymous_7) -FN:129,(anonymous_8) -FNF:8 -FNH:8 -FNDA:560,(anonymous_1) -FNDA:1410,(anonymous_2) -FNDA:487,(anonymous_3) -FNDA:1660,(anonymous_4) -FNDA:399,(anonymous_5) -FNDA:59,(anonymous_6) -FNDA:27,(anonymous_7) -FNDA:588,(anonymous_8) -DA:1,1 -DA:3,1 -DA:5,1 -DA:7,560 -DA:18,1 -DA:20,1410 -DA:22,1189 -DA:24,881 -DA:33,1 -DA:35,487 -DA:47,1 -DA:49,1660 -DA:51,1573 -DA:53,629 -DA:55,549 -DA:67,1 -DA:69,399 -DA:71,398 -DA:73,396 -DA:84,1 -DA:86,59 -DA:88,58 -DA:90,56 -DA:92,55 -DA:94,55 -DA:96,55 -DA:106,1 -DA:108,27 -DA:113,5 -DA:115,22 -DA:116,22 -DA:118,22 -DA:129,1 -DA:131,588 -DA:133,532 -DA:134,737 -DA:137,532 -LF:37 -LH:37 -BRDA:20,1,0,221 -BRDA:20,1,1,1189 -BRDA:22,2,0,308 -BRDA:22,2,1,881 -BRDA:22,3,0,308 -BRDA:22,3,1,249 -BRDA:24,4,0,881 -BRDA:24,4,1,870 -BRDA:35,5,0,487 -BRDA:35,5,1,251 -BRDA:49,6,0,87 -BRDA:49,6,1,1573 -BRDA:49,7,0,1660 -BRDA:49,7,1,1573 -BRDA:51,8,0,944 -BRDA:51,8,1,629 -BRDA:53,9,0,80 -BRDA:53,9,1,549 -BRDA:53,10,0,80 -BRDA:53,10,1,27 -BRDA:69,11,0,1 -BRDA:69,11,1,398 -BRDA:69,12,0,399 -BRDA:69,12,1,399 -BRDA:71,13,0,2 -BRDA:71,13,1,396 -BRDA:71,14,0,1 -BRDA:71,14,1,1 -BRDA:86,15,0,1 -BRDA:86,15,1,58 -BRDA:88,16,0,2 -BRDA:88,16,1,56 -BRDA:90,17,0,1 -BRDA:90,17,1,55 -BRDA:90,18,0,56 -BRDA:90,18,1,2 -BRDA:94,19,0,15 -BRDA:94,19,1,40 -BRDA:108,20,0,5 -BRDA:108,20,1,22 -BRDA:108,21,0,27 -BRDA:108,21,1,26 -BRDA:108,21,2,26 -BRDA:108,21,3,26 -BRDA:108,21,4,26 -BRDA:108,21,5,25 -BRDA:108,21,6,25 -BRDA:108,21,7,23 -BRDA:108,21,8,23 -BRDA:115,22,0,22 -BRDA:115,22,1,1 -BRDA:131,23,0,56 -BRDA:131,23,1,532 -BRF:53 -BRH:53 -end_of_record -TN: -SF:/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo.js -FN:18,(anonymous_1) -FN:24,(anonymous_2) -FN:28,(anonymous_3) -FNF:3 -FNH:3 -FNDA:85,(anonymous_1) -FNDA:85,(anonymous_2) -FNDA:85,(anonymous_3) -DA:1,1 -DA:13,1 -DA:18,1 -DA:20,85 -DA:24,1 -DA:26,85 -DA:28,85 -DA:30,85 -DA:31,0 -DA:32,0 -DA:35,85 -DA:37,85 -LF:12 -LH:10 -BRDA:30,1,0,0 -BRDA:30,1,1,85 -BRF:2 -BRH:1 -end_of_record -TN: -SF:/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/plugins.js -FN:12,(anonymous_1) -FN:14,(anonymous_2) -FN:42,perItem -FN:44,monkeys -FN:46,(anonymous_5) -FN:92,full -FN:94,(anonymous_7) -FNF:7 -FNH:7 -FNDA:85,(anonymous_1) -FNDA:85,(anonymous_2) -FNDA:75,perItem -FNDA:204,monkeys -FNDA:338,(anonymous_5) -FNDA:10,full -FNDA:10,(anonymous_7) -DA:1,1 -DA:12,1 -DA:14,85 -DA:16,85 -DA:18,58 -DA:19,58 -DA:21,17 -DA:22,17 -DA:24,10 -DA:25,10 -DA:30,85 -DA:42,1 -DA:44,75 -DA:46,204 -DA:49,338 -DA:50,48 -DA:54,338 -DA:58,338 -DA:59,338 -DA:61,338 -DA:62,34 -DA:65,338 -DA:69,338 -DA:70,81 -DA:73,338 -DA:77,204 -DA:81,75 -DA:92,1 -DA:94,10 -DA:95,10 -DA:96,10 -DA:100,10 -LF:32 -LH:32 -BRDA:16,1,0,58 -BRDA:16,1,1,17 -BRDA:16,1,2,10 -BRDA:49,2,0,48 -BRDA:49,2,1,290 -BRDA:49,3,0,338 -BRDA:49,3,1,80 -BRDA:58,4,0,676 -BRDA:58,4,1,642 -BRDA:61,5,0,34 -BRDA:61,5,1,304 -BRDA:61,6,0,338 -BRDA:61,6,1,338 -BRDA:69,7,0,81 -BRDA:69,7,1,257 -BRDA:69,8,0,338 -BRDA:69,8,1,258 -BRDA:95,9,0,10 -BRDA:95,9,1,0 -BRF:19 -BRH:18 -end_of_record -TN: -SF:/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/js2svg.js -FN:43,(anonymous_1) -FN:49,JS2SVG -FN:79,(anonymous_3) -FN:87,(anonymous_4) -FN:124,(anonymous_5) -FN:145,(anonymous_6) -FN:160,(anonymous_7) -FN:177,(anonymous_8) -FN:192,(anonymous_9) -FN:207,(anonymous_10) -FN:253,(anonymous_11) -FN:257,(anonymous_12) -FN:278,(anonymous_13) -FNF:13 -FNH:12 -FNDA:85,(anonymous_1) -FNDA:85,JS2SVG -FNDA:265,(anonymous_3) -FNDA:496,(anonymous_4) -FNDA:673,(anonymous_5) -FNDA:1,(anonymous_6) -FNDA:1,(anonymous_7) -FNDA:1,(anonymous_8) -FNDA:0,(anonymous_9) -FNDA:410,(anonymous_10) -FNDA:410,(anonymous_11) -FNDA:488,(anonymous_12) -FNDA:83,(anonymous_13) -DA:1,1 -DA:3,1 -DA:5,1 -DA:43,1 -DA:45,85 -DA:49,1 -DA:51,85 -DA:52,85 -DA:54,0 -DA:57,85 -DA:58,85 -DA:59,85 -DA:60,85 -DA:61,85 -DA:62,85 -DA:63,85 -DA:64,85 -DA:65,85 -DA:68,85 -DA:79,1 -DA:81,265 -DA:83,265 -DA:85,265 -DA:87,265 -DA:89,496 -DA:90,410 -DA:91,86 -DA:92,83 -DA:93,3 -DA:94,1 -DA:95,2 -DA:96,1 -DA:97,1 -DA:98,1 -DA:99,0 -DA:100,0 -DA:107,265 -DA:109,265 -DA:124,1 -DA:126,673 -DA:128,673 -DA:129,673 -DA:130,795 -DA:134,673 -DA:145,1 -DA:147,1 -DA:160,1 -DA:162,1 -DA:177,1 -DA:179,1 -DA:192,1 -DA:194,0 -DA:207,1 -DA:210,410 -DA:215,6 -DA:216,6 -DA:220,410 -DA:222,230 -DA:231,180 -DA:253,1 -DA:255,410 -DA:257,410 -DA:259,488 -DA:267,410 -DA:278,1 -DA:281,83 -DA:282,415 -DA:285,83 -LF:68 -LH:64 -BRDA:51,1,0,85 -BRDA:51,1,1,0 -BRDA:57,2,0,85 -BRDA:57,2,1,0 -BRDA:83,3,0,265 -BRDA:83,3,1,0 -BRDA:89,4,0,410 -BRDA:89,4,1,86 -BRDA:91,5,0,83 -BRDA:91,5,1,3 -BRDA:93,6,0,1 -BRDA:93,6,1,2 -BRDA:95,7,0,1 -BRDA:95,7,1,1 -BRDA:97,8,0,1 -BRDA:97,8,1,0 -BRDA:99,9,0,0 -BRDA:99,9,1,0 -BRDA:128,10,0,673 -BRDA:128,10,1,0 -BRDA:210,11,0,6 -BRDA:210,11,1,404 -BRDA:211,12,0,410 -BRDA:211,12,1,85 -BRDA:211,12,2,6 -BRDA:220,13,0,230 -BRDA:220,13,1,180 -BRF:27 -BRH:20 -end_of_record diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo.js b/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo.js deleted file mode 100644 index 4049786..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo.js +++ /dev/null @@ -1,39 +0,0 @@ -if (typeof global.__coverage__ === 'undefined') { global.__coverage__ = {}; } -if (!global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo.js']) { - global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo.js'] = {"path":"/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0},"b":{"1":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":18,"loc":{"start":{"line":18,"column":28},"end":{"line":18,"column":45}}},"2":{"name":"(anonymous_2)","line":24,"loc":{"start":{"line":24,"column":26},"end":{"line":24,"column":53}}},"3":{"name":"(anonymous_3)","line":28,"loc":{"start":{"line":28,"column":19},"end":{"line":28,"column":35}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":13,"column":0},"end":{"line":16,"column":38}},"3":{"start":{"line":18,"column":0},"end":{"line":22,"column":2}},"4":{"start":{"line":20,"column":4},"end":{"line":20,"column":33}},"5":{"start":{"line":24,"column":0},"end":{"line":41,"column":2}},"6":{"start":{"line":26,"column":4},"end":{"line":26,"column":29}},"7":{"start":{"line":28,"column":4},"end":{"line":39,"column":7}},"8":{"start":{"line":30,"column":8},"end":{"line":33,"column":9}},"9":{"start":{"line":31,"column":12},"end":{"line":31,"column":28}},"10":{"start":{"line":32,"column":12},"end":{"line":32,"column":19}},"11":{"start":{"line":35,"column":8},"end":{"line":35,"column":47}},"12":{"start":{"line":37,"column":8},"end":{"line":37,"column":47}}},"branchMap":{"1":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":8},"end":{"line":30,"column":8}},{"start":{"line":30,"column":8},"end":{"line":30,"column":8}}]}}}; -} -var __cov_ja$xaYQ5RD1E5uKcwGg8ig = global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo.js']; -__cov_ja$xaYQ5RD1E5uKcwGg8ig.s['1']++; -'use strict'; -__cov_ja$xaYQ5RD1E5uKcwGg8ig.s['2']++; -var CONFIG = require('./svgo/config'), SVG2JS = require('./svgo/svg2js'), PLUGINS = require('./svgo/plugins'), JS2SVG = require('./svgo/js2svg'); -__cov_ja$xaYQ5RD1E5uKcwGg8ig.s['3']++; -var SVGO = module.exports = function (config) { - __cov_ja$xaYQ5RD1E5uKcwGg8ig.f['1']++; - __cov_ja$xaYQ5RD1E5uKcwGg8ig.s['4']++; - this.config = CONFIG(config); - }; -__cov_ja$xaYQ5RD1E5uKcwGg8ig.s['5']++; -SVGO.prototype.optimize = function (svgstr, callback) { - __cov_ja$xaYQ5RD1E5uKcwGg8ig.f['2']++; - __cov_ja$xaYQ5RD1E5uKcwGg8ig.s['6']++; - var config = this.config; - __cov_ja$xaYQ5RD1E5uKcwGg8ig.s['7']++; - SVG2JS(svgstr, function (svgjs) { - __cov_ja$xaYQ5RD1E5uKcwGg8ig.f['3']++; - __cov_ja$xaYQ5RD1E5uKcwGg8ig.s['8']++; - if (svgjs.error) { - __cov_ja$xaYQ5RD1E5uKcwGg8ig.b['1'][0]++; - __cov_ja$xaYQ5RD1E5uKcwGg8ig.s['9']++; - callback(svgjs); - __cov_ja$xaYQ5RD1E5uKcwGg8ig.s['10']++; - return; - } else { - __cov_ja$xaYQ5RD1E5uKcwGg8ig.b['1'][1]++; - } - __cov_ja$xaYQ5RD1E5uKcwGg8ig.s['11']++; - svgjs = PLUGINS(svgjs, config.plugins); - __cov_ja$xaYQ5RD1E5uKcwGg8ig.s['12']++; - callback(JS2SVG(svgjs, config.js2svg)); - }); -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/coa.js b/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/coa.js deleted file mode 100644 index 6eed8a4..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/coa.js +++ /dev/null @@ -1,403 +0,0 @@ -if (typeof global.__coverage__ === 'undefined') { global.__coverage__ = {}; } -if (!global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/coa.js']) { - global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/coa.js'] = {"path":"/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/coa.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0,0,0,0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0},"fnMap":{"1":{"name":"(anonymous_1)","line":29,"loc":{"start":{"line":29,"column":13},"end":{"line":29,"column":24}}},"2":{"name":"(anonymous_2)","line":36,"loc":{"start":{"line":36,"column":13},"end":{"line":36,"column":27}}},"3":{"name":"(anonymous_3)","line":47,"loc":{"start":{"line":47,"column":13},"end":{"line":47,"column":27}}},"4":{"name":"(anonymous_4)","line":54,"loc":{"start":{"line":54,"column":13},"end":{"line":54,"column":27}}},"5":{"name":"(anonymous_5)","line":61,"loc":{"start":{"line":61,"column":13},"end":{"line":61,"column":27}}},"6":{"name":"(anonymous_6)","line":69,"loc":{"start":{"line":69,"column":13},"end":{"line":69,"column":27}}},"7":{"name":"(anonymous_7)","line":77,"loc":{"start":{"line":77,"column":13},"end":{"line":77,"column":27}}},"8":{"name":"(anonymous_8)","line":84,"loc":{"start":{"line":84,"column":13},"end":{"line":84,"column":27}}},"9":{"name":"(anonymous_9)","line":99,"loc":{"start":{"line":99,"column":9},"end":{"line":99,"column":30}}},"10":{"name":"(anonymous_10)","line":166,"loc":{"start":{"line":166,"column":32},"end":{"line":166,"column":48}}},"11":{"name":"(anonymous_11)","line":169,"loc":{"start":{"line":169,"column":33},"end":{"line":169,"column":44}}},"12":{"name":"(anonymous_12)","line":177,"loc":{"start":{"line":177,"column":43},"end":{"line":177,"column":63}}},"13":{"name":"optimizeFromString","line":198,"loc":{"start":{"line":198,"column":0},"end":{"line":198,"column":68}}},"14":{"name":"(anonymous_14)","line":206,"loc":{"start":{"line":206,"column":26},"end":{"line":206,"column":43}}},"15":{"name":"saveFileAndPrintInfo","line":243,"loc":{"start":{"line":243,"column":0},"end":{"line":243,"column":67}}},"16":{"name":"(anonymous_16)","line":245,"loc":{"start":{"line":245,"column":37},"end":{"line":245,"column":48}}},"17":{"name":"printTimeInfo","line":257,"loc":{"start":{"line":257,"column":0},"end":{"line":257,"column":29}}},"18":{"name":"printProfitInfo","line":263,"loc":{"start":{"line":263,"column":0},"end":{"line":263,"column":44}}},"19":{"name":"changePluginsState","line":284,"loc":{"start":{"line":284,"column":0},"end":{"line":284,"column":50}}},"20":{"name":"(anonymous_20)","line":289,"loc":{"start":{"line":289,"column":22},"end":{"line":289,"column":37}}},"21":{"name":"(anonymous_21)","line":294,"loc":{"start":{"line":294,"column":35},"end":{"line":294,"column":52}}},"22":{"name":"(anonymous_22)","line":337,"loc":{"start":{"line":337,"column":22},"end":{"line":337,"column":37}}},"23":{"name":"optimizeFolder","line":351,"loc":{"start":{"line":351,"column":0},"end":{"line":351,"column":38}}},"24":{"name":"(anonymous_24)","line":361,"loc":{"start":{"line":361,"column":21},"end":{"line":361,"column":42}}},"25":{"name":"optimizeFile","line":369,"loc":{"start":{"line":369,"column":8},"end":{"line":369,"column":36}}},"26":{"name":"(anonymous_26)","line":377,"loc":{"start":{"line":377,"column":46},"end":{"line":377,"column":66}}},"27":{"name":"(anonymous_27)","line":388,"loc":{"start":{"line":388,"column":40},"end":{"line":388,"column":57}}},"28":{"name":"(anonymous_28)","line":398,"loc":{"start":{"line":398,"column":68},"end":{"line":398,"column":79}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":18}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":19}},"4":{"start":{"line":6,"column":0},"end":{"line":13,"column":26}},"5":{"start":{"line":20,"column":0},"end":{"line":196,"column":7}},"6":{"start":{"line":30,"column":12},"end":{"line":30,"column":31}},"7":{"start":{"line":37,"column":12},"end":{"line":37,"column":75}},"8":{"start":{"line":48,"column":12},"end":{"line":48,"column":76}},"9":{"start":{"line":55,"column":12},"end":{"line":55,"column":76}},"10":{"start":{"line":62,"column":12},"end":{"line":62,"column":76}},"11":{"start":{"line":70,"column":12},"end":{"line":70,"column":77}},"12":{"start":{"line":78,"column":12},"end":{"line":78,"column":76}},"13":{"start":{"line":85,"column":12},"end":{"line":85,"column":118}},"14":{"start":{"line":101,"column":8},"end":{"line":104,"column":23}},"15":{"start":{"line":107,"column":8},"end":{"line":113,"column":30}},"16":{"start":{"line":113,"column":10},"end":{"line":113,"column":30}},"17":{"start":{"line":116,"column":8},"end":{"line":127,"column":9}},"18":{"start":{"line":119,"column":12},"end":{"line":125,"column":13}},"19":{"start":{"line":120,"column":16},"end":{"line":120,"column":49}},"20":{"start":{"line":124,"column":16},"end":{"line":124,"column":60}},"21":{"start":{"line":130,"column":8},"end":{"line":132,"column":9}},"22":{"start":{"line":131,"column":12},"end":{"line":131,"column":69}},"23":{"start":{"line":135,"column":8},"end":{"line":137,"column":9}},"24":{"start":{"line":136,"column":12},"end":{"line":136,"column":67}},"25":{"start":{"line":140,"column":8},"end":{"line":146,"column":9}},"26":{"start":{"line":142,"column":12},"end":{"line":142,"column":34}},"27":{"start":{"line":143,"column":12},"end":{"line":143,"column":48}},"28":{"start":{"line":144,"column":12},"end":{"line":144,"column":40}},"29":{"start":{"line":149,"column":8},"end":{"line":153,"column":9}},"30":{"start":{"line":150,"column":12},"end":{"line":150,"column":60}},"31":{"start":{"line":152,"column":12},"end":{"line":152,"column":19}},"32":{"start":{"line":156,"column":8},"end":{"line":194,"column":9}},"33":{"start":{"line":159,"column":12},"end":{"line":185,"column":13}},"34":{"start":{"line":161,"column":16},"end":{"line":161,"column":30}},"35":{"start":{"line":163,"column":16},"end":{"line":163,"column":38}},"36":{"start":{"line":165,"column":16},"end":{"line":172,"column":30}},"37":{"start":{"line":167,"column":24},"end":{"line":167,"column":38}},"38":{"start":{"line":170,"column":24},"end":{"line":170,"column":86}},"39":{"start":{"line":177,"column":16},"end":{"line":183,"column":19}},"40":{"start":{"line":178,"column":20},"end":{"line":180,"column":21}},"41":{"start":{"line":179,"column":24},"end":{"line":179,"column":34}},"42":{"start":{"line":182,"column":20},"end":{"line":182,"column":82}},"43":{"start":{"line":188,"column":15},"end":{"line":194,"column":9}},"44":{"start":{"line":190,"column":12},"end":{"line":190,"column":56}},"45":{"start":{"line":192,"column":12},"end":{"line":192,"column":81}},"46":{"start":{"line":198,"column":0},"end":{"line":241,"column":1}},"47":{"start":{"line":200,"column":4},"end":{"line":204,"column":32}},"48":{"start":{"line":206,"column":4},"end":{"line":239,"column":7}},"49":{"start":{"line":208,"column":8},"end":{"line":211,"column":9}},"50":{"start":{"line":209,"column":12},"end":{"line":209,"column":38}},"51":{"start":{"line":210,"column":12},"end":{"line":210,"column":19}},"52":{"start":{"line":213,"column":8},"end":{"line":215,"column":9}},"53":{"start":{"line":214,"column":12},"end":{"line":214,"column":65}},"54":{"start":{"line":217,"column":8},"end":{"line":217,"column":58}},"55":{"start":{"line":218,"column":8},"end":{"line":218,"column":38}},"56":{"start":{"line":221,"column":8},"end":{"line":237,"column":9}},"57":{"start":{"line":223,"column":12},"end":{"line":223,"column":53}},"58":{"start":{"line":229,"column":12},"end":{"line":231,"column":13}},"59":{"start":{"line":230,"column":16},"end":{"line":230,"column":31}},"60":{"start":{"line":233,"column":12},"end":{"line":233,"column":28}},"61":{"start":{"line":235,"column":12},"end":{"line":235,"column":79}},"62":{"start":{"line":243,"column":0},"end":{"line":255,"column":1}},"63":{"start":{"line":245,"column":4},"end":{"line":253,"column":7}},"64":{"start":{"line":248,"column":8},"end":{"line":248,"column":28}},"65":{"start":{"line":251,"column":8},"end":{"line":251,"column":43}},"66":{"start":{"line":257,"column":0},"end":{"line":261,"column":1}},"67":{"start":{"line":259,"column":4},"end":{"line":259,"column":42}},"68":{"start":{"line":263,"column":0},"end":{"line":274,"column":1}},"69":{"start":{"line":265,"column":4},"end":{"line":265,"column":56}},"70":{"start":{"line":267,"column":4},"end":{"line":272,"column":6}},"71":{"start":{"line":284,"column":0},"end":{"line":349,"column":1}},"72":{"start":{"line":287,"column":4},"end":{"line":345,"column":5}},"73":{"start":{"line":289,"column":8},"end":{"line":330,"column":11}},"74":{"start":{"line":291,"column":12},"end":{"line":292,"column":20}},"75":{"start":{"line":294,"column":12},"end":{"line":314,"column":15}},"76":{"start":{"line":297,"column":16},"end":{"line":301,"column":17}},"77":{"start":{"line":298,"column":20},"end":{"line":298,"column":49}},"78":{"start":{"line":300,"column":20},"end":{"line":300,"column":33}},"79":{"start":{"line":304,"column":16},"end":{"line":312,"column":17}},"80":{"start":{"line":306,"column":20},"end":{"line":308,"column":21}},"81":{"start":{"line":307,"column":24},"end":{"line":307,"column":44}},"82":{"start":{"line":311,"column":20},"end":{"line":311,"column":35}},"83":{"start":{"line":317,"column":12},"end":{"line":328,"column":13}},"84":{"start":{"line":319,"column":16},"end":{"line":319,"column":29}},"85":{"start":{"line":321,"column":16},"end":{"line":321,"column":34}},"86":{"start":{"line":324,"column":16},"end":{"line":324,"column":41}},"87":{"start":{"line":326,"column":16},"end":{"line":326,"column":31}},"88":{"start":{"line":335,"column":8},"end":{"line":335,"column":33}},"89":{"start":{"line":337,"column":8},"end":{"line":343,"column":11}},"90":{"start":{"line":338,"column":12},"end":{"line":338,"column":25}},"91":{"start":{"line":340,"column":12},"end":{"line":340,"column":30}},"92":{"start":{"line":342,"column":12},"end":{"line":342,"column":37}},"93":{"start":{"line":347,"column":4},"end":{"line":347,"column":18}},"94":{"start":{"line":351,"column":0},"end":{"line":426,"column":1}},"95":{"start":{"line":353,"column":4},"end":{"line":353,"column":32}},"96":{"start":{"line":356,"column":4},"end":{"line":356,"column":30}},"97":{"start":{"line":358,"column":4},"end":{"line":358,"column":35}},"98":{"start":{"line":361,"column":4},"end":{"line":424,"column":7}},"99":{"start":{"line":363,"column":8},"end":{"line":365,"column":9}},"100":{"start":{"line":364,"column":12},"end":{"line":364,"column":22}},"101":{"start":{"line":367,"column":8},"end":{"line":367,"column":18}},"102":{"start":{"line":369,"column":8},"end":{"line":420,"column":9}},"103":{"start":{"line":372,"column":12},"end":{"line":372,"column":52}},"104":{"start":{"line":375,"column":12},"end":{"line":414,"column":13}},"105":{"start":{"line":377,"column":16},"end":{"line":412,"column":19}},"106":{"start":{"line":379,"column":20},"end":{"line":381,"column":21}},"107":{"start":{"line":380,"column":24},"end":{"line":380,"column":34}},"108":{"start":{"line":383,"column":20},"end":{"line":386,"column":33}},"109":{"start":{"line":388,"column":20},"end":{"line":410,"column":23}},"110":{"start":{"line":390,"column":24},"end":{"line":393,"column":25}},"111":{"start":{"line":391,"column":28},"end":{"line":391,"column":54}},"112":{"start":{"line":392,"column":28},"end":{"line":392,"column":35}},"113":{"start":{"line":395,"column":24},"end":{"line":395,"column":74}},"114":{"start":{"line":396,"column":24},"end":{"line":396,"column":54}},"115":{"start":{"line":398,"column":24},"end":{"line":408,"column":27}},"116":{"start":{"line":400,"column":28},"end":{"line":400,"column":50}},"117":{"start":{"line":403,"column":28},"end":{"line":403,"column":48}},"118":{"start":{"line":406,"column":28},"end":{"line":406,"column":63}},"119":{"start":{"line":416,"column":12},"end":{"line":418,"column":13}},"120":{"start":{"line":417,"column":16},"end":{"line":417,"column":39}},"121":{"start":{"line":422,"column":8},"end":{"line":422,"column":31}}},"branchMap":{"1":{"line":37,"type":"binary-expr","locations":[{"start":{"line":37,"column":19},"end":{"line":37,"column":22}},{"start":{"line":37,"column":26},"end":{"line":37,"column":74}}]},"2":{"line":48,"type":"binary-expr","locations":[{"start":{"line":48,"column":19},"end":{"line":48,"column":22}},{"start":{"line":48,"column":26},"end":{"line":48,"column":75}}]},"3":{"line":55,"type":"binary-expr","locations":[{"start":{"line":55,"column":19},"end":{"line":55,"column":22}},{"start":{"line":55,"column":26},"end":{"line":55,"column":75}}]},"4":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":19},"end":{"line":62,"column":22}},{"start":{"line":62,"column":26},"end":{"line":62,"column":75}}]},"5":{"line":70,"type":"binary-expr","locations":[{"start":{"line":70,"column":19},"end":{"line":70,"column":22}},{"start":{"line":70,"column":26},"end":{"line":70,"column":76}}]},"6":{"line":78,"type":"binary-expr","locations":[{"start":{"line":78,"column":19},"end":{"line":78,"column":22}},{"start":{"line":78,"column":26},"end":{"line":78,"column":75}}]},"7":{"line":85,"type":"binary-expr","locations":[{"start":{"line":85,"column":19},"end":{"line":85,"column":22}},{"start":{"line":85,"column":26},"end":{"line":85,"column":117}}]},"8":{"line":101,"type":"cond-expr","locations":[{"start":{"line":101,"column":41},"end":{"line":101,"column":51}},{"start":{"line":101,"column":54},"end":{"line":101,"column":64}}]},"9":{"line":101,"type":"binary-expr","locations":[{"start":{"line":101,"column":20},"end":{"line":101,"column":24}},{"start":{"line":101,"column":28},"end":{"line":101,"column":38}}]},"10":{"line":102,"type":"cond-expr","locations":[{"start":{"line":102,"column":43},"end":{"line":102,"column":54}},{"start":{"line":102,"column":57},"end":{"line":102,"column":68}}]},"11":{"line":102,"type":"binary-expr","locations":[{"start":{"line":102,"column":21},"end":{"line":102,"column":25}},{"start":{"line":102,"column":29},"end":{"line":102,"column":40}}]},"12":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":8},"end":{"line":107,"column":8}},{"start":{"line":107,"column":8},"end":{"line":107,"column":8}}]},"13":{"line":108,"type":"binary-expr","locations":[{"start":{"line":108,"column":13},"end":{"line":108,"column":19}},{"start":{"line":108,"column":23},"end":{"line":108,"column":36}},{"start":{"line":109,"column":12},"end":{"line":109,"column":24}},{"start":{"line":110,"column":12},"end":{"line":110,"column":23}},{"start":{"line":111,"column":12},"end":{"line":111,"column":24}},{"start":{"line":112,"column":12},"end":{"line":112,"column":31}}]},"14":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":8},"end":{"line":116,"column":8}},{"start":{"line":116,"column":8},"end":{"line":116,"column":8}}]},"15":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":12},"end":{"line":119,"column":12}},{"start":{"line":119,"column":12},"end":{"line":119,"column":12}}]},"16":{"line":130,"type":"if","locations":[{"start":{"line":130,"column":8},"end":{"line":130,"column":8}},{"start":{"line":130,"column":8},"end":{"line":130,"column":8}}]},"17":{"line":135,"type":"if","locations":[{"start":{"line":135,"column":8},"end":{"line":135,"column":8}},{"start":{"line":135,"column":8},"end":{"line":135,"column":8}}]},"18":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":8},"end":{"line":140,"column":8}},{"start":{"line":140,"column":8},"end":{"line":140,"column":8}}]},"19":{"line":142,"type":"binary-expr","locations":[{"start":{"line":142,"column":21},"end":{"line":142,"column":27}},{"start":{"line":142,"column":31},"end":{"line":142,"column":33}}]},"20":{"line":143,"type":"binary-expr","locations":[{"start":{"line":143,"column":28},"end":{"line":143,"column":41}},{"start":{"line":143,"column":45},"end":{"line":143,"column":47}}]},"21":{"line":149,"type":"if","locations":[{"start":{"line":149,"column":8},"end":{"line":149,"column":8}},{"start":{"line":149,"column":8},"end":{"line":149,"column":8}}]},"22":{"line":156,"type":"if","locations":[{"start":{"line":156,"column":8},"end":{"line":156,"column":8}},{"start":{"line":156,"column":8},"end":{"line":156,"column":8}}]},"23":{"line":159,"type":"if","locations":[{"start":{"line":159,"column":12},"end":{"line":159,"column":12}},{"start":{"line":159,"column":12},"end":{"line":159,"column":12}}]},"24":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":20},"end":{"line":178,"column":20}},{"start":{"line":178,"column":20},"end":{"line":178,"column":20}}]},"25":{"line":188,"type":"if","locations":[{"start":{"line":188,"column":15},"end":{"line":188,"column":15}},{"start":{"line":188,"column":15},"end":{"line":188,"column":15}}]},"26":{"line":208,"type":"if","locations":[{"start":{"line":208,"column":8},"end":{"line":208,"column":8}},{"start":{"line":208,"column":8},"end":{"line":208,"column":8}}]},"27":{"line":213,"type":"if","locations":[{"start":{"line":213,"column":8},"end":{"line":213,"column":8}},{"start":{"line":213,"column":8},"end":{"line":213,"column":8}}]},"28":{"line":221,"type":"if","locations":[{"start":{"line":221,"column":8},"end":{"line":221,"column":8}},{"start":{"line":221,"column":8},"end":{"line":221,"column":8}}]},"29":{"line":221,"type":"binary-expr","locations":[{"start":{"line":221,"column":12},"end":{"line":221,"column":26}},{"start":{"line":221,"column":31},"end":{"line":221,"column":44}},{"start":{"line":221,"column":48},"end":{"line":221,"column":55}}]},"30":{"line":229,"type":"if","locations":[{"start":{"line":229,"column":12},"end":{"line":229,"column":12}},{"start":{"line":229,"column":12},"end":{"line":229,"column":12}}]},"31":{"line":229,"type":"binary-expr","locations":[{"start":{"line":229,"column":16},"end":{"line":229,"column":23}},{"start":{"line":229,"column":27},"end":{"line":229,"column":32}}]},"32":{"line":269,"type":"cond-expr","locations":[{"start":{"line":269,"column":30},"end":{"line":269,"column":35}},{"start":{"line":269,"column":38},"end":{"line":269,"column":43}}]},"33":{"line":287,"type":"if","locations":[{"start":{"line":287,"column":4},"end":{"line":287,"column":4}},{"start":{"line":287,"column":4},"end":{"line":287,"column":4}}]},"34":{"line":287,"type":"binary-expr","locations":[{"start":{"line":287,"column":8},"end":{"line":287,"column":14}},{"start":{"line":287,"column":18},"end":{"line":287,"column":32}}]},"35":{"line":297,"type":"if","locations":[{"start":{"line":297,"column":16},"end":{"line":297,"column":16}},{"start":{"line":297,"column":16},"end":{"line":297,"column":16}}]},"36":{"line":304,"type":"if","locations":[{"start":{"line":304,"column":16},"end":{"line":304,"column":16}},{"start":{"line":304,"column":16},"end":{"line":304,"column":16}}]},"37":{"line":306,"type":"if","locations":[{"start":{"line":306,"column":20},"end":{"line":306,"column":20}},{"start":{"line":306,"column":20},"end":{"line":306,"column":20}}]},"38":{"line":306,"type":"binary-expr","locations":[{"start":{"line":306,"column":24},"end":{"line":306,"column":55}},{"start":{"line":306,"column":59},"end":{"line":306,"column":65}}]},"39":{"line":317,"type":"if","locations":[{"start":{"line":317,"column":12},"end":{"line":317,"column":12}},{"start":{"line":317,"column":12},"end":{"line":317,"column":12}}]},"40":{"line":317,"type":"binary-expr","locations":[{"start":{"line":317,"column":16},"end":{"line":317,"column":24}},{"start":{"line":317,"column":28},"end":{"line":317,"column":40}}]},"41":{"line":363,"type":"if","locations":[{"start":{"line":363,"column":8},"end":{"line":363,"column":8}},{"start":{"line":363,"column":8},"end":{"line":363,"column":8}}]},"42":{"line":375,"type":"if","locations":[{"start":{"line":375,"column":12},"end":{"line":375,"column":12}},{"start":{"line":375,"column":12},"end":{"line":375,"column":12}}]},"43":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":20},"end":{"line":379,"column":20}},{"start":{"line":379,"column":20},"end":{"line":379,"column":20}}]},"44":{"line":390,"type":"if","locations":[{"start":{"line":390,"column":24},"end":{"line":390,"column":24}},{"start":{"line":390,"column":24},"end":{"line":390,"column":24}}]},"45":{"line":416,"type":"if","locations":[{"start":{"line":416,"column":12},"end":{"line":416,"column":12}},{"start":{"line":416,"column":12},"end":{"line":416,"column":12}}]}}}; -} -var __cov_FwF3etjQ__6RgWEd3RaQwg = global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/coa.js']; -__cov_FwF3etjQ__6RgWEd3RaQwg.s['1']++; -'use strict'; -__cov_FwF3etjQ__6RgWEd3RaQwg.s['2']++; -require('colors'); -__cov_FwF3etjQ__6RgWEd3RaQwg.s['3']++; -require('js-yaml'); -__cov_FwF3etjQ__6RgWEd3RaQwg.s['4']++; -var FS = require('fs'), PATH = require('path'), UTIL = require('util'), SVGO = require('../svgo'), PKG = require('../../package.json'), encodeSVGDatauri = require('./tools').encodeSVGDatauri, decodeSVGDatauri = require('./tools').decodeSVGDatauri, regSVGFile = /\.svg$/; -__cov_FwF3etjQ__6RgWEd3RaQwg.s['5']++; -module.exports = require('coa').Cmd().helpful().name(PKG.name).title(PKG.description).opt().name('version').title('Version').short('v').long('version').only().flag().act(function () { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['1']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['6']++; - return PKG.version; -}).end().opt().name('input').title('Input file, "-" for STDIN').short('i').long('input').val(function (val) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['2']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['7']++; - return (__cov_FwF3etjQ__6RgWEd3RaQwg.b['1'][0]++, val) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['1'][1]++, this.reject('Option --input must have a value.')); -}).end().opt().name('string').title('Input SVG data string').short('s').long('string').end().opt().name('folder').title('Input folder, optimize and rewrite all *.svg files').short('f').long('folder').val(function (val) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['3']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['8']++; - return (__cov_FwF3etjQ__6RgWEd3RaQwg.b['2'][0]++, val) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['2'][1]++, this.reject('Option --folder must have a value.')); -}).end().opt().name('output').title('Output file (by default the same as the input), "-" for STDOUT').short('o').long('output').val(function (val) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['4']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['9']++; - return (__cov_FwF3etjQ__6RgWEd3RaQwg.b['3'][0]++, val) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['3'][1]++, this.reject('Option --output must have a value.')); -}).end().opt().name('config').title('Config file to extend or replace default').long('config').val(function (val) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['5']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['10']++; - return (__cov_FwF3etjQ__6RgWEd3RaQwg.b['4'][0]++, val) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['4'][1]++, this.reject('Option --config must have a value.')); -}).end().opt().name('disable').title('Disable plugin by name').long('disable').arr().val(function (val) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['6']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['11']++; - return (__cov_FwF3etjQ__6RgWEd3RaQwg.b['5'][0]++, val) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['5'][1]++, this.reject('Option --disable must have a value.')); -}).end().opt().name('enable').title('Enable plugin by name').long('enable').arr().val(function (val) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['7']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['12']++; - return (__cov_FwF3etjQ__6RgWEd3RaQwg.b['6'][0]++, val) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['6'][1]++, this.reject('Option --enable must have a value.')); -}).end().opt().name('datauri').title('Output as Data URI string (base64, URI encoded or unencoded)').long('datauri').val(function (val) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['8']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['13']++; - return (__cov_FwF3etjQ__6RgWEd3RaQwg.b['7'][0]++, val) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['7'][1]++, this.reject('Option --datauri must have one of the following values: base64, enc or unenc')); -}).end().opt().name('pretty').title('Make SVG pretty printed').long('pretty').flag().end().arg().name('input').title('Alias to --input').end().arg().name('output').title('Alias to --output').end().act(function (opts, args) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['9']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['14']++; - var input = (__cov_FwF3etjQ__6RgWEd3RaQwg.b['9'][0]++, args) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['9'][1]++, args.input) ? (__cov_FwF3etjQ__6RgWEd3RaQwg.b['8'][0]++, args.input) : (__cov_FwF3etjQ__6RgWEd3RaQwg.b['8'][1]++, opts.input), output = (__cov_FwF3etjQ__6RgWEd3RaQwg.b['11'][0]++, args) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['11'][1]++, args.output) ? (__cov_FwF3etjQ__6RgWEd3RaQwg.b['10'][0]++, args.output) : (__cov_FwF3etjQ__6RgWEd3RaQwg.b['10'][1]++, opts.output), config, configFull; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['15']++; - if (((__cov_FwF3etjQ__6RgWEd3RaQwg.b['13'][0]++, !input) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['13'][1]++, input === '-')) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['13'][2]++, !opts.string) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['13'][3]++, !opts.stdin) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['13'][4]++, !opts.folder) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['13'][5]++, process.stdin.isTTY)) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['12'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['16']++; - return this.usage(); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['12'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['17']++; - if (opts.config) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['14'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['18']++; - if (opts.config.charAt(0) === '{') { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['15'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['19']++; - config = JSON.parse(opts.config); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['15'][1]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['20']++; - config = require(PATH.resolve(opts.config)); - } - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['14'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['21']++; - if (opts.disable) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['16'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['22']++; - config = changePluginsState(opts.disable, false, config); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['16'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['23']++; - if (opts.enable) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['17'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['24']++; - config = changePluginsState(opts.enable, true, config); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['17'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['25']++; - if (opts.pretty) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['18'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['26']++; - config = (__cov_FwF3etjQ__6RgWEd3RaQwg.b['19'][0]++, config) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['19'][1]++, {}); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['27']++; - config.js2svg = (__cov_FwF3etjQ__6RgWEd3RaQwg.b['20'][0]++, config.js2svg) || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['20'][1]++, {}); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['28']++; - config.js2svg.pretty = true; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['18'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['29']++; - if (opts.folder) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['21'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['30']++; - optimizeFolder(opts.folder, config, configFull); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['31']++; - return; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['21'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['32']++; - if (input) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['22'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['33']++; - if (input === '-') { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['23'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['34']++; - var data = ''; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['35']++; - process.stdin.pause(); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['36']++; - process.stdin.on('data', function (chunk) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['10']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['37']++; - data += chunk; - }).once('end', function () { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['11']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['38']++; - optimizeFromString(data, config, opts.datauri, input, output); - }).resume(); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['23'][1]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['39']++; - FS.readFile(input, 'utf8', function (err, data) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['12']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['40']++; - if (err) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['24'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['41']++; - throw err; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['24'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['42']++; - optimizeFromString(data, config, opts.datauri, input, output); - }); - } - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['22'][1]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['43']++; - if (opts.string) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['25'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['44']++; - opts.string = decodeSVGDatauri(opts.string); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['45']++; - optimizeFromString(opts.string, config, opts.datauri, input, output); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['25'][1]++; - } - } -}); -__cov_FwF3etjQ__6RgWEd3RaQwg.s['46']++; -function optimizeFromString(svgstr, config, datauri, input, output) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['13']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['47']++; - var startTime = Date.now(config), time, inBytes = Buffer.byteLength(svgstr, 'utf8'), outBytes, svgo = new SVGO(config); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['48']++; - svgo.optimize(svgstr, function (result) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['14']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['49']++; - if (result.error) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['26'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['50']++; - console.log(result.error); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['51']++; - return; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['26'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['52']++; - if (datauri) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['27'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['53']++; - result.data = encodeSVGDatauri(result.data, datauri); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['27'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['54']++; - outBytes = Buffer.byteLength(result.data, 'utf8'); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['55']++; - time = Date.now() - startTime; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['56']++; - if ((__cov_FwF3etjQ__6RgWEd3RaQwg.b['29'][0]++, output === '-') || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['29'][1]++, input === '-') && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['29'][2]++, !output)) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['28'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['57']++; - process.stdout.write(result.data + '\n'); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['28'][1]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['58']++; - if ((__cov_FwF3etjQ__6RgWEd3RaQwg.b['31'][0]++, !output) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['31'][1]++, input)) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['30'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['59']++; - output = input; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['30'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['60']++; - UTIL.puts('\r'); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['61']++; - saveFileAndPrintInfo(result.data, output, inBytes, outBytes, time); - } - }); -} -__cov_FwF3etjQ__6RgWEd3RaQwg.s['62']++; -function saveFileAndPrintInfo(data, path, inBytes, outBytes, time) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['15']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['63']++; - FS.writeFile(path, data, 'utf8', function () { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['16']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['64']++; - printTimeInfo(time); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['65']++; - printProfitInfo(inBytes, outBytes); - }); -} -__cov_FwF3etjQ__6RgWEd3RaQwg.s['66']++; -function printTimeInfo(time) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['17']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['67']++; - UTIL.puts('Done in ' + time + ' ms!'); -} -__cov_FwF3etjQ__6RgWEd3RaQwg.s['68']++; -function printProfitInfo(inBytes, outBytes) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['18']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['69']++; - var profitPercents = 100 - outBytes * 100 / inBytes; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['70']++; - UTIL.puts(Math.round(inBytes / 1024 * 1000) / 1000 + ' KiB' + (profitPercents < 0 ? (__cov_FwF3etjQ__6RgWEd3RaQwg.b['32'][0]++, ' + ') : (__cov_FwF3etjQ__6RgWEd3RaQwg.b['32'][1]++, ' - ')) + String(Math.abs(Math.round(profitPercents * 10) / 10) + '%').green + ' = ' + Math.round(outBytes / 1024 * 1000) / 1000 + ' KiB\n'); -} -__cov_FwF3etjQ__6RgWEd3RaQwg.s['71']++; -function changePluginsState(names, state, config) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['19']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['72']++; - if ((__cov_FwF3etjQ__6RgWEd3RaQwg.b['34'][0]++, config) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['34'][1]++, config.plugins)) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['33'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['73']++; - names.forEach(function (name) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['20']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['74']++; - var matched, key; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['75']++; - config.plugins.forEach(function (plugin) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['21']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['76']++; - if (typeof plugin === 'object') { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['35'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['77']++; - key = Object.keys(plugin)[0]; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['35'][1]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['78']++; - key = plugin; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['79']++; - if (key === name) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['36'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['80']++; - if ((__cov_FwF3etjQ__6RgWEd3RaQwg.b['38'][0]++, typeof plugin[key] !== 'object') || (__cov_FwF3etjQ__6RgWEd3RaQwg.b['38'][1]++, !state)) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['37'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['81']++; - plugin[key] = state; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['37'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['82']++; - matched = true; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['36'][1]++; - } - }); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['83']++; - if ((__cov_FwF3etjQ__6RgWEd3RaQwg.b['40'][0]++, !matched) && (__cov_FwF3etjQ__6RgWEd3RaQwg.b['40'][1]++, !config.full)) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['39'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['84']++; - var obj = {}; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['85']++; - obj[name] = state; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['86']++; - config.plugins.push(obj); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['87']++; - matched = true; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['39'][1]++; - } - }); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['33'][1]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['88']++; - config = { plugins: [] }; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['89']++; - names.forEach(function (name) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['22']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['90']++; - var obj = {}; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['91']++; - obj[name] = state; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['92']++; - config.plugins.push(obj); - }); - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['93']++; - return config; -} -__cov_FwF3etjQ__6RgWEd3RaQwg.s['94']++; -function optimizeFolder(path, config) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['23']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['95']++; - var svgo = new SVGO(config); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['96']++; - path = PATH.resolve(path); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['97']++; - UTIL.puts('\n' + path + ':\n'); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['98']++; - FS.readdir(path, function (err, files) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['24']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['99']++; - if (err) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['41'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['100']++; - throw err; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['41'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['101']++; - var i = 0; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['102']++; - function optimizeFile(file) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['25']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['103']++; - var filepath = PATH.resolve(path, file); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['104']++; - if (regSVGFile.test(filepath)) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['42'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['105']++; - FS.readFile(filepath, 'utf8', function (err, data) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['26']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['106']++; - if (err) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['43'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['107']++; - throw err; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['43'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['108']++; - var startTime = Date.now(), time, inBytes = Buffer.byteLength(data, 'utf8'), outBytes; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['109']++; - svgo.optimize(data, function (result) { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['27']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['110']++; - if (result.error) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['44'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['111']++; - console.log(result.error); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['112']++; - return; - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['44'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['113']++; - outBytes = Buffer.byteLength(result.data, 'utf8'); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['114']++; - time = Date.now() - startTime; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['115']++; - FS.writeFile(filepath, result.data, 'utf8', function () { - __cov_FwF3etjQ__6RgWEd3RaQwg.f['28']++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['116']++; - UTIL.puts(file + ':'); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['117']++; - printTimeInfo(time); - __cov_FwF3etjQ__6RgWEd3RaQwg.s['118']++; - printProfitInfo(inBytes, outBytes); - }); - }); - }); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['42'][1]++; - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['119']++; - if (++i < files.length) { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['45'][0]++; - __cov_FwF3etjQ__6RgWEd3RaQwg.s['120']++; - optimizeFile(files[i]); - } else { - __cov_FwF3etjQ__6RgWEd3RaQwg.b['45'][1]++; - } - } - __cov_FwF3etjQ__6RgWEd3RaQwg.s['121']++; - optimizeFile(files[i]); - }); -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/config.js b/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/config.js deleted file mode 100644 index d20c439..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/config.js +++ /dev/null @@ -1,215 +0,0 @@ -if (typeof global.__coverage__ === 'undefined') { global.__coverage__ = {}; } -if (!global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/config.js']) { - global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/config.js'] = {"path":"/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/config.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":14,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":34}}},"2":{"name":"preparePluginsArray","line":51,"loc":{"start":{"line":51,"column":0},"end":{"line":51,"column":38}}},"3":{"name":"(anonymous_3)","line":56,"loc":{"start":{"line":56,"column":23},"end":{"line":56,"column":38}}},"4":{"name":"extendConfig","line":101,"loc":{"start":{"line":101,"column":0},"end":{"line":101,"column":40}}},"5":{"name":"(anonymous_5)","line":108,"loc":{"start":{"line":108,"column":31},"end":{"line":108,"column":46}}},"6":{"name":"(anonymous_6)","line":115,"loc":{"start":{"line":115,"column":41},"end":{"line":115,"column":58}}},"7":{"name":"optimizePluginsArray","line":161,"loc":{"start":{"line":161,"column":0},"end":{"line":161,"column":39}}},"8":{"name":"(anonymous_8)","line":165,"loc":{"start":{"line":165,"column":26},"end":{"line":165,"column":41}}},"9":{"name":"(anonymous_9)","line":169,"loc":{"start":{"line":169,"column":29},"end":{"line":169,"column":44}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":19}},"3":{"start":{"line":5,"column":0},"end":{"line":5,"column":36}},"4":{"start":{"line":14,"column":0},"end":{"line":43,"column":2}},"5":{"start":{"line":16,"column":4},"end":{"line":16,"column":17}},"6":{"start":{"line":18,"column":4},"end":{"line":39,"column":5}},"7":{"start":{"line":20,"column":8},"end":{"line":20,"column":26}},"8":{"start":{"line":22,"column":8},"end":{"line":25,"column":9}},"9":{"start":{"line":23,"column":12},"end":{"line":23,"column":69}},"10":{"start":{"line":24,"column":12},"end":{"line":24,"column":70}},"11":{"start":{"line":29,"column":8},"end":{"line":29,"column":58}},"12":{"start":{"line":31,"column":8},"end":{"line":31,"column":65}},"13":{"start":{"line":33,"column":8},"end":{"line":35,"column":9}},"14":{"start":{"line":34,"column":12},"end":{"line":34,"column":54}},"15":{"start":{"line":37,"column":8},"end":{"line":37,"column":66}},"16":{"start":{"line":41,"column":4},"end":{"line":41,"column":20}},"17":{"start":{"line":51,"column":0},"end":{"line":92,"column":1}},"18":{"start":{"line":53,"column":4},"end":{"line":54,"column":12}},"19":{"start":{"line":56,"column":4},"end":{"line":90,"column":7}},"20":{"start":{"line":59,"column":8},"end":{"line":86,"column":9}},"21":{"start":{"line":61,"column":12},"end":{"line":61,"column":39}},"22":{"start":{"line":62,"column":12},"end":{"line":62,"column":65}},"23":{"start":{"line":65,"column":12},"end":{"line":76,"column":13}},"24":{"start":{"line":66,"column":16},"end":{"line":66,"column":75}},"25":{"start":{"line":67,"column":16},"end":{"line":67,"column":37}},"26":{"start":{"line":70,"column":19},"end":{"line":76,"column":13}},"27":{"start":{"line":71,"column":15},"end":{"line":71,"column":37}},"28":{"start":{"line":74,"column":19},"end":{"line":76,"column":13}},"29":{"start":{"line":75,"column":15},"end":{"line":75,"column":36}},"30":{"start":{"line":78,"column":12},"end":{"line":78,"column":30}},"31":{"start":{"line":83,"column":12},"end":{"line":83,"column":66}},"32":{"start":{"line":84,"column":12},"end":{"line":84,"column":31}},"33":{"start":{"line":88,"column":8},"end":{"line":88,"column":22}},"34":{"start":{"line":101,"column":0},"end":{"line":153,"column":1}},"35":{"start":{"line":103,"column":4},"end":{"line":103,"column":12}},"36":{"start":{"line":106,"column":4},"end":{"line":139,"column":5}},"37":{"start":{"line":108,"column":8},"end":{"line":137,"column":11}},"38":{"start":{"line":111,"column":12},"end":{"line":135,"column":13}},"39":{"start":{"line":113,"column":16},"end":{"line":113,"column":43}},"40":{"start":{"line":115,"column":16},"end":{"line":133,"column":19}},"41":{"start":{"line":117,"column":20},"end":{"line":131,"column":21}},"42":{"start":{"line":119,"column":24},"end":{"line":130,"column":25}},"43":{"start":{"line":120,"column":28},"end":{"line":120,"column":87}},"44":{"start":{"line":121,"column":28},"end":{"line":121,"column":49}},"45":{"start":{"line":124,"column":31},"end":{"line":130,"column":25}},"46":{"start":{"line":125,"column":27},"end":{"line":125,"column":49}},"47":{"start":{"line":128,"column":31},"end":{"line":130,"column":25}},"48":{"start":{"line":129,"column":27},"end":{"line":129,"column":48}},"49":{"start":{"line":142,"column":4},"end":{"line":144,"column":5}},"50":{"start":{"line":143,"column":8},"end":{"line":143,"column":40}},"51":{"start":{"line":147,"column":4},"end":{"line":149,"column":5}},"52":{"start":{"line":148,"column":8},"end":{"line":148,"column":40}},"53":{"start":{"line":151,"column":4},"end":{"line":151,"column":20}},"54":{"start":{"line":161,"column":0},"end":{"line":184,"column":1}},"55":{"start":{"line":163,"column":4},"end":{"line":163,"column":13}},"56":{"start":{"line":165,"column":4},"end":{"line":167,"column":7}},"57":{"start":{"line":166,"column":8},"end":{"line":166,"column":22}},"58":{"start":{"line":169,"column":4},"end":{"line":180,"column":7}},"59":{"start":{"line":171,"column":8},"end":{"line":174,"column":9}},"60":{"start":{"line":172,"column":12},"end":{"line":172,"column":31}},"61":{"start":{"line":173,"column":12},"end":{"line":173,"column":25}},"62":{"start":{"line":176,"column":8},"end":{"line":176,"column":20}},"63":{"start":{"line":178,"column":8},"end":{"line":178,"column":20}},"64":{"start":{"line":182,"column":4},"end":{"line":182,"column":19}}},"branchMap":{"1":{"line":18,"type":"if","locations":[{"start":{"line":18,"column":4},"end":{"line":18,"column":4}},{"start":{"line":18,"column":4},"end":{"line":18,"column":4}}]},"2":{"line":18,"type":"binary-expr","locations":[{"start":{"line":18,"column":8},"end":{"line":18,"column":14}},{"start":{"line":18,"column":18},"end":{"line":18,"column":29}}]},"3":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":8},"end":{"line":22,"column":8}},{"start":{"line":22,"column":8},"end":{"line":22,"column":8}}]},"4":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":8},"end":{"line":33,"column":8}},{"start":{"line":33,"column":8},"end":{"line":33,"column":8}}]},"5":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":8},"end":{"line":59,"column":8}},{"start":{"line":59,"column":8},"end":{"line":59,"column":8}}]},"6":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":12},"end":{"line":65,"column":12}},{"start":{"line":65,"column":12},"end":{"line":65,"column":12}}]},"7":{"line":66,"type":"binary-expr","locations":[{"start":{"line":66,"column":43},"end":{"line":66,"column":56}},{"start":{"line":66,"column":60},"end":{"line":66,"column":62}}]},"8":{"line":70,"type":"if","locations":[{"start":{"line":70,"column":19},"end":{"line":70,"column":19}},{"start":{"line":70,"column":19},"end":{"line":70,"column":19}}]},"9":{"line":74,"type":"if","locations":[{"start":{"line":74,"column":19},"end":{"line":74,"column":19}},{"start":{"line":74,"column":19},"end":{"line":74,"column":19}}]},"10":{"line":106,"type":"if","locations":[{"start":{"line":106,"column":4},"end":{"line":106,"column":4}},{"start":{"line":106,"column":4},"end":{"line":106,"column":4}}]},"11":{"line":111,"type":"if","locations":[{"start":{"line":111,"column":12},"end":{"line":111,"column":12}},{"start":{"line":111,"column":12},"end":{"line":111,"column":12}}]},"12":{"line":117,"type":"if","locations":[{"start":{"line":117,"column":20},"end":{"line":117,"column":20}},{"start":{"line":117,"column":20},"end":{"line":117,"column":20}}]},"13":{"line":119,"type":"if","locations":[{"start":{"line":119,"column":24},"end":{"line":119,"column":24}},{"start":{"line":119,"column":24},"end":{"line":119,"column":24}}]},"14":{"line":120,"type":"binary-expr","locations":[{"start":{"line":120,"column":55},"end":{"line":120,"column":68}},{"start":{"line":120,"column":72},"end":{"line":120,"column":74}}]},"15":{"line":124,"type":"if","locations":[{"start":{"line":124,"column":31},"end":{"line":124,"column":31}},{"start":{"line":124,"column":31},"end":{"line":124,"column":31}}]},"16":{"line":128,"type":"if","locations":[{"start":{"line":128,"column":31},"end":{"line":128,"column":31}},{"start":{"line":128,"column":31},"end":{"line":128,"column":31}}]},"17":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":4},"end":{"line":142,"column":4}},{"start":{"line":142,"column":4},"end":{"line":142,"column":4}}]},"18":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":4},"end":{"line":147,"column":4}},{"start":{"line":147,"column":4},"end":{"line":147,"column":4}}]},"19":{"line":171,"type":"if","locations":[{"start":{"line":171,"column":8},"end":{"line":171,"column":8}},{"start":{"line":171,"column":8},"end":{"line":171,"column":8}}]},"20":{"line":171,"type":"binary-expr","locations":[{"start":{"line":171,"column":12},"end":{"line":171,"column":16}},{"start":{"line":171,"column":20},"end":{"line":171,"column":49}}]}}}; -} -var __cov_hs$Kto$KAanBN9T2b8p0Jw = global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/config.js']; -__cov_hs$Kto$KAanBN9T2b8p0Jw.s['1']++; -'use strict'; -__cov_hs$Kto$KAanBN9T2b8p0Jw.s['2']++; -require('js-yaml'); -__cov_hs$Kto$KAanBN9T2b8p0Jw.s['3']++; -var EXTEND = require('whet.extend'); -__cov_hs$Kto$KAanBN9T2b8p0Jw.s['4']++; -module.exports = function (config) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['1']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['5']++; - var defaults; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['6']++; - if ((__cov_hs$Kto$KAanBN9T2b8p0Jw.b['2'][0]++, config) && (__cov_hs$Kto$KAanBN9T2b8p0Jw.b['2'][1]++, config.full)) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['1'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['7']++; - defaults = config; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['8']++; - if (defaults.plugins) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['3'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['9']++; - defaults.plugins = preparePluginsArray(defaults.plugins); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['10']++; - defaults.plugins = optimizePluginsArray(defaults.plugins); - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['3'][1]++; - } - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['1'][1]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['11']++; - defaults = EXTEND({}, require('../../.svgo.yml')); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['12']++; - defaults.plugins = preparePluginsArray(defaults.plugins); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['13']++; - if (config) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['4'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['14']++; - defaults = extendConfig(defaults, config); - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['4'][1]++; - } - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['15']++; - defaults.plugins = optimizePluginsArray(defaults.plugins); - } - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['16']++; - return defaults; -}; -__cov_hs$Kto$KAanBN9T2b8p0Jw.s['17']++; -function preparePluginsArray(plugins) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['2']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['18']++; - var plugin, key; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['19']++; - return plugins.map(function (item) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['3']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['20']++; - if (typeof item === 'object') { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['5'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['21']++; - key = Object.keys(item)[0]; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['22']++; - plugin = EXTEND({}, require('../../plugins/' + key)); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['23']++; - if (typeof item[key] === 'object') { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['6'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['24']++; - plugin.params = EXTEND({}, (__cov_hs$Kto$KAanBN9T2b8p0Jw.b['7'][0]++, plugin.params) || (__cov_hs$Kto$KAanBN9T2b8p0Jw.b['7'][1]++, {}), item[key]); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['25']++; - plugin.active = true; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['6'][1]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['26']++; - if (item[key] === false) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['8'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['27']++; - plugin.active = false; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['8'][1]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['28']++; - if (item[key] === true) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['9'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['29']++; - plugin.active = true; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['9'][1]++; - } - } - } - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['30']++; - plugin.name = key; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['5'][1]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['31']++; - plugin = EXTEND({}, require('../../plugins/' + item)); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['32']++; - plugin.name = item; - } - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['33']++; - return plugin; - }); -} -__cov_hs$Kto$KAanBN9T2b8p0Jw.s['34']++; -function extendConfig(defaults, config) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['4']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['35']++; - var key; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['36']++; - if (config.plugins) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['10'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['37']++; - config.plugins.forEach(function (item) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['5']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['38']++; - if (typeof item === 'object') { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['11'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['39']++; - key = Object.keys(item)[0]; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['40']++; - defaults.plugins.forEach(function (plugin) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['6']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['41']++; - if (plugin.name === key) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['12'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['42']++; - if (typeof item[key] === 'object') { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['13'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['43']++; - plugin.params = EXTEND({}, (__cov_hs$Kto$KAanBN9T2b8p0Jw.b['14'][0]++, plugin.params) || (__cov_hs$Kto$KAanBN9T2b8p0Jw.b['14'][1]++, {}), item[key]); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['44']++; - plugin.active = true; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['13'][1]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['45']++; - if (item[key] === false) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['15'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['46']++; - plugin.active = false; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['15'][1]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['47']++; - if (item[key] === true) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['16'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['48']++; - plugin.active = true; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['16'][1]++; - } - } - } - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['12'][1]++; - } - }); - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['11'][1]++; - } - }); - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['10'][1]++; - } - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['49']++; - if (config.svg2js) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['17'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['50']++; - defaults.svg2js = config.svg2js; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['17'][1]++; - } - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['51']++; - if (config.js2svg) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['18'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['52']++; - defaults.js2svg = config.js2svg; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['18'][1]++; - } - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['53']++; - return defaults; -} -__cov_hs$Kto$KAanBN9T2b8p0Jw.s['54']++; -function optimizePluginsArray(plugins) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['7']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['55']++; - var prev; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['56']++; - plugins = plugins.map(function (item) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['8']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['57']++; - return [item]; - }); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['58']++; - plugins = plugins.filter(function (item) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.f['9']++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['59']++; - if ((__cov_hs$Kto$KAanBN9T2b8p0Jw.b['20'][0]++, prev) && (__cov_hs$Kto$KAanBN9T2b8p0Jw.b['20'][1]++, item[0].type === prev[0].type)) { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['19'][0]++; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['60']++; - prev.push(item[0]); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['61']++; - return false; - } else { - __cov_hs$Kto$KAanBN9T2b8p0Jw.b['19'][1]++; - } - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['62']++; - prev = item; - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['63']++; - return true; - }); - __cov_hs$Kto$KAanBN9T2b8p0Jw.s['64']++; - return plugins; -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/js2svg.js b/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/js2svg.js deleted file mode 100644 index db4acf5..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/js2svg.js +++ /dev/null @@ -1,251 +0,0 @@ -if (typeof global.__coverage__ === 'undefined') { global.__coverage__ = {}; } -if (!global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/js2svg.js']) { - global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/js2svg.js'] = {"path":"/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/js2svg.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0,0],"13":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0},"fnMap":{"1":{"name":"(anonymous_1)","line":43,"loc":{"start":{"line":43,"column":17},"end":{"line":43,"column":40}}},"2":{"name":"JS2SVG","line":49,"loc":{"start":{"line":49,"column":0},"end":{"line":49,"column":24}}},"3":{"name":"(anonymous_3)","line":79,"loc":{"start":{"line":79,"column":27},"end":{"line":79,"column":42}}},"4":{"name":"(anonymous_4)","line":87,"loc":{"start":{"line":87,"column":29},"end":{"line":87,"column":44}}},"5":{"name":"(anonymous_5)","line":124,"loc":{"start":{"line":124,"column":32},"end":{"line":124,"column":43}}},"6":{"name":"(anonymous_6)","line":145,"loc":{"start":{"line":145,"column":33},"end":{"line":145,"column":51}}},"7":{"name":"(anonymous_7)","line":160,"loc":{"start":{"line":160,"column":34},"end":{"line":160,"column":56}}},"8":{"name":"(anonymous_8)","line":177,"loc":{"start":{"line":177,"column":33},"end":{"line":177,"column":51}}},"9":{"name":"(anonymous_9)","line":192,"loc":{"start":{"line":192,"column":31},"end":{"line":192,"column":47}}},"10":{"name":"(anonymous_10)","line":207,"loc":{"start":{"line":207,"column":30},"end":{"line":207,"column":45}}},"11":{"name":"(anonymous_11)","line":253,"loc":{"start":{"line":253,"column":31},"end":{"line":253,"column":46}}},"12":{"name":"(anonymous_12)","line":257,"loc":{"start":{"line":257,"column":18},"end":{"line":257,"column":33}}},"13":{"name":"(anonymous_13)","line":278,"loc":{"start":{"line":278,"column":30},"end":{"line":278,"column":45}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}},"3":{"start":{"line":5,"column":0},"end":{"line":33,"column":2}},"4":{"start":{"line":43,"column":0},"end":{"line":47,"column":2}},"5":{"start":{"line":45,"column":4},"end":{"line":45,"column":44}},"6":{"start":{"line":49,"column":0},"end":{"line":70,"column":1}},"7":{"start":{"line":51,"column":4},"end":{"line":55,"column":5}},"8":{"start":{"line":52,"column":8},"end":{"line":52,"column":57}},"9":{"start":{"line":54,"column":8},"end":{"line":54,"column":31}},"10":{"start":{"line":57,"column":4},"end":{"line":66,"column":5}},"11":{"start":{"line":58,"column":8},"end":{"line":58,"column":39}},"12":{"start":{"line":59,"column":8},"end":{"line":59,"column":40}},"13":{"start":{"line":60,"column":8},"end":{"line":60,"column":39}},"14":{"start":{"line":61,"column":8},"end":{"line":61,"column":37}},"15":{"start":{"line":62,"column":8},"end":{"line":62,"column":40}},"16":{"start":{"line":63,"column":8},"end":{"line":63,"column":39}},"17":{"start":{"line":64,"column":8},"end":{"line":64,"column":40}},"18":{"start":{"line":65,"column":8},"end":{"line":65,"column":36}},"19":{"start":{"line":68,"column":4},"end":{"line":68,"column":25}},"20":{"start":{"line":79,"column":0},"end":{"line":117,"column":2}},"21":{"start":{"line":81,"column":4},"end":{"line":81,"column":17}},"22":{"start":{"line":83,"column":4},"end":{"line":105,"column":5}},"23":{"start":{"line":85,"column":8},"end":{"line":85,"column":27}},"24":{"start":{"line":87,"column":8},"end":{"line":103,"column":17}},"25":{"start":{"line":89,"column":12},"end":{"line":101,"column":13}},"26":{"start":{"line":90,"column":15},"end":{"line":90,"column":44}},"27":{"start":{"line":91,"column":19},"end":{"line":101,"column":13}},"28":{"start":{"line":92,"column":15},"end":{"line":92,"column":49}},"29":{"start":{"line":93,"column":19},"end":{"line":101,"column":13}},"30":{"start":{"line":94,"column":16},"end":{"line":94,"column":56}},"31":{"start":{"line":95,"column":19},"end":{"line":101,"column":13}},"32":{"start":{"line":96,"column":16},"end":{"line":96,"column":71}},"33":{"start":{"line":97,"column":19},"end":{"line":101,"column":13}},"34":{"start":{"line":98,"column":16},"end":{"line":98,"column":56}},"35":{"start":{"line":99,"column":19},"end":{"line":101,"column":13}},"36":{"start":{"line":100,"column":16},"end":{"line":100,"column":52}},"37":{"start":{"line":107,"column":4},"end":{"line":107,"column":23}},"38":{"start":{"line":109,"column":4},"end":{"line":115,"column":6}},"39":{"start":{"line":124,"column":0},"end":{"line":136,"column":2}},"40":{"start":{"line":126,"column":4},"end":{"line":126,"column":20}},"41":{"start":{"line":128,"column":4},"end":{"line":132,"column":5}},"42":{"start":{"line":129,"column":8},"end":{"line":131,"column":9}},"43":{"start":{"line":130,"column":12},"end":{"line":130,"column":41}},"44":{"start":{"line":134,"column":4},"end":{"line":134,"column":18}},"45":{"start":{"line":145,"column":0},"end":{"line":151,"column":2}},"46":{"start":{"line":147,"column":4},"end":{"line":149,"column":35}},"47":{"start":{"line":160,"column":0},"end":{"line":168,"column":2}},"48":{"start":{"line":162,"column":4},"end":{"line":166,"column":36}},"49":{"start":{"line":177,"column":0},"end":{"line":183,"column":2}},"50":{"start":{"line":179,"column":4},"end":{"line":181,"column":35}},"51":{"start":{"line":192,"column":0},"end":{"line":198,"column":2}},"52":{"start":{"line":194,"column":4},"end":{"line":196,"column":33}},"53":{"start":{"line":207,"column":0},"end":{"line":244,"column":2}},"54":{"start":{"line":210,"column":4},"end":{"line":217,"column":5}},"55":{"start":{"line":215,"column":8},"end":{"line":215,"column":46}},"56":{"start":{"line":216,"column":8},"end":{"line":216,"column":48}},"57":{"start":{"line":220,"column":4},"end":{"line":242,"column":5}},"58":{"start":{"line":222,"column":8},"end":{"line":226,"column":40}},"59":{"start":{"line":231,"column":8},"end":{"line":240,"column":40}},"60":{"start":{"line":253,"column":0},"end":{"line":269,"column":2}},"61":{"start":{"line":255,"column":4},"end":{"line":255,"column":19}},"62":{"start":{"line":257,"column":4},"end":{"line":265,"column":13}},"63":{"start":{"line":259,"column":8},"end":{"line":263,"column":40}},"64":{"start":{"line":267,"column":4},"end":{"line":267,"column":17}},"65":{"start":{"line":278,"column":0},"end":{"line":290,"column":2}},"66":{"start":{"line":281,"column":4},"end":{"line":283,"column":5}},"67":{"start":{"line":282,"column":8},"end":{"line":282,"column":69}},"68":{"start":{"line":285,"column":4},"end":{"line":288,"column":32}}},"branchMap":{"1":{"line":51,"type":"if","locations":[{"start":{"line":51,"column":4},"end":{"line":51,"column":4}},{"start":{"line":51,"column":4},"end":{"line":51,"column":4}}]},"2":{"line":57,"type":"if","locations":[{"start":{"line":57,"column":4},"end":{"line":57,"column":4}},{"start":{"line":57,"column":4},"end":{"line":57,"column":4}}]},"3":{"line":83,"type":"if","locations":[{"start":{"line":83,"column":4},"end":{"line":83,"column":4}},{"start":{"line":83,"column":4},"end":{"line":83,"column":4}}]},"4":{"line":89,"type":"if","locations":[{"start":{"line":89,"column":12},"end":{"line":89,"column":12}},{"start":{"line":89,"column":12},"end":{"line":89,"column":12}}]},"5":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":19},"end":{"line":91,"column":19}},{"start":{"line":91,"column":19},"end":{"line":91,"column":19}}]},"6":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":19},"end":{"line":93,"column":19}},{"start":{"line":93,"column":19},"end":{"line":93,"column":19}}]},"7":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":19},"end":{"line":95,"column":19}},{"start":{"line":95,"column":19},"end":{"line":95,"column":19}}]},"8":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":19},"end":{"line":97,"column":19}},{"start":{"line":97,"column":19},"end":{"line":97,"column":19}}]},"9":{"line":99,"type":"if","locations":[{"start":{"line":99,"column":19},"end":{"line":99,"column":19}},{"start":{"line":99,"column":19},"end":{"line":99,"column":19}}]},"10":{"line":128,"type":"if","locations":[{"start":{"line":128,"column":4},"end":{"line":128,"column":4}},{"start":{"line":128,"column":4},"end":{"line":128,"column":4}}]},"11":{"line":210,"type":"if","locations":[{"start":{"line":210,"column":4},"end":{"line":210,"column":4}},{"start":{"line":210,"column":4},"end":{"line":210,"column":4}}]},"12":{"line":211,"type":"binary-expr","locations":[{"start":{"line":211,"column":8},"end":{"line":211,"column":26}},{"start":{"line":212,"column":8},"end":{"line":212,"column":29}},{"start":{"line":213,"column":8},"end":{"line":213,"column":30}}]},"13":{"line":220,"type":"if","locations":[{"start":{"line":220,"column":4},"end":{"line":220,"column":4}},{"start":{"line":220,"column":4},"end":{"line":220,"column":4}}]}}}; -} -var __cov_nc_kWjfK9t_j_qqb$WQRgQ = global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/js2svg.js']; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['1']++; -'use strict'; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['2']++; -var EXTEND = require('whet.extend'); -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['3']++; -var defaults = { - doctypeStart: '', - procInstStart: '', - tagOpenStart: '<', - tagOpenEnd: '>', - tagCloseStart: '', - tagShortStart: '<', - tagShortEnd: '/>', - attrStart: '="', - attrEnd: '"', - commentStart: '', - cdataStart: '', - textStart: '', - textEnd: '', - indent: ' ', - entities: { - '&': '&', - '\'': ''', - '"': '"', - '>': '>', - '<': '<' - }, - pretty: false - }; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['4']++; -module.exports = function (data, config) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['1']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['5']++; - return new JS2SVG(config).convert(data); -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['6']++; -function JS2SVG(config) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['2']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['7']++; - if (config) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['1'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['8']++; - this.config = EXTEND(true, {}, defaults, config); - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['1'][1]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['9']++; - this.config = defaults; - } - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['10']++; - if (this.config.pretty) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['2'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['11']++; - this.config.doctypeEnd += '\n'; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['12']++; - this.config.procInstEnd += '\n'; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['13']++; - this.config.commentEnd += '\n'; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['14']++; - this.config.cdataEnd += '\n'; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['15']++; - this.config.tagShortEnd += '\n'; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['16']++; - this.config.tagOpenEnd += '\n'; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['17']++; - this.config.tagCloseEnd += '\n'; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['18']++; - this.config.textEnd += '\n'; - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['2'][1]++; - } - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['19']++; - this.indentLevel = 0; -} -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['20']++; -JS2SVG.prototype.convert = function (data) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['3']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['21']++; - var svg = ''; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['22']++; - if (data.content) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['3'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['23']++; - this.indentLevel++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['24']++; - data.content.forEach(function (item) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['4']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['25']++; - if (item.elem) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['4'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['26']++; - svg += this.createElem(item); - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['4'][1]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['27']++; - if (item.text) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['5'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['28']++; - svg += this.createText(item.text); - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['5'][1]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['29']++; - if (item.doctype) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['6'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['30']++; - svg += this.createDoctype(item.doctype); - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['6'][1]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['31']++; - if (item.processinginstruction) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['7'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['32']++; - svg += this.createProcInst(item.processinginstruction); - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['7'][1]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['33']++; - if (item.comment) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['8'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['34']++; - svg += this.createComment(item.comment); - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['8'][1]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['35']++; - if (item.cdata) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['9'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['36']++; - svg += this.createCDATA(item.cdata); - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['9'][1]++; - } - } - } - } - } - } - }, this); - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['3'][1]++; - } - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['37']++; - this.indentLevel--; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['38']++; - return { - data: svg, - info: { - width: this.width, - height: this.height - } - }; -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['39']++; -JS2SVG.prototype.createIndent = function () { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['5']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['40']++; - var indent = ''; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['41']++; - if (this.config.pretty) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['10'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['42']++; - for (var i = 1; i < this.indentLevel; i++) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['43']++; - indent += this.config.indent; - } - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['10'][1]++; - } - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['44']++; - return indent; -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['45']++; -JS2SVG.prototype.createDoctype = function (doctype) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['6']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['46']++; - return this.config.doctypeStart + doctype + this.config.doctypeEnd; -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['47']++; -JS2SVG.prototype.createProcInst = function (instruction) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['7']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['48']++; - return this.config.procInstStart + instruction.name + ' ' + instruction.body + this.config.procInstEnd; -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['49']++; -JS2SVG.prototype.createComment = function (comment) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['8']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['50']++; - return this.config.commentStart + comment + this.config.commentEnd; -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['51']++; -JS2SVG.prototype.createCDATA = function (cdata) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['9']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['52']++; - return this.config.cdataStart + cdata + this.config.cdataEnd; -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['53']++; -JS2SVG.prototype.createElem = function (data) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['10']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['54']++; - if ((__cov_nc_kWjfK9t_j_qqb$WQRgQ.b['12'][0]++, data.isElem('svg')) && (__cov_nc_kWjfK9t_j_qqb$WQRgQ.b['12'][1]++, data.hasAttr('width')) && (__cov_nc_kWjfK9t_j_qqb$WQRgQ.b['12'][2]++, data.hasAttr('height'))) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['11'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['55']++; - this.width = data.attr('width').value; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['56']++; - this.height = data.attr('height').value; - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['11'][1]++; - } - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['57']++; - if (data.isEmpty()) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['13'][0]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['58']++; - return this.createIndent() + this.config.tagShortStart + data.elem + this.createAttrs(data) + this.config.tagShortEnd; - } else { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.b['13'][1]++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['59']++; - return this.createIndent() + this.config.tagOpenStart + data.elem + this.createAttrs(data) + this.config.tagOpenEnd + this.convert(data).data + this.createIndent() + this.config.tagCloseStart + data.elem + this.config.tagCloseEnd; - } -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['60']++; -JS2SVG.prototype.createAttrs = function (elem) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['11']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['61']++; - var attrs = ''; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['62']++; - elem.eachAttr(function (attr) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['12']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['63']++; - attrs += ' ' + attr.name + this.config.attrStart + attr.value + this.config.attrEnd; - }, this); - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['64']++; - return attrs; -}; -__cov_nc_kWjfK9t_j_qqb$WQRgQ.s['65']++; -JS2SVG.prototype.createText = function (text) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.f['13']++; - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['66']++; - for (var entity in this.config.entities) { - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['67']++; - text = text.split(entity).join(this.config.entities[entity]); - } - __cov_nc_kWjfK9t_j_qqb$WQRgQ.s['68']++; - return this.createIndent() + this.config.textStart + text + this.config.textEnd; -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/jsAPI.js b/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/jsAPI.js deleted file mode 100644 index 65b51f4..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/jsAPI.js +++ /dev/null @@ -1,172 +0,0 @@ -if (typeof global.__coverage__ === 'undefined') { global.__coverage__ = {}; } -if (!global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/jsAPI.js']) { - global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/jsAPI.js'] = {"path":"/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/jsAPI.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0,0,0,0,0,0,0,0],"22":[0,0],"23":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":"(anonymous_1)","line":5,"loc":{"start":{"line":5,"column":29},"end":{"line":5,"column":44}}},"2":{"name":"(anonymous_2)","line":18,"loc":{"start":{"line":18,"column":25},"end":{"line":18,"column":41}}},"3":{"name":"(anonymous_3)","line":33,"loc":{"start":{"line":33,"column":27},"end":{"line":33,"column":38}}},"4":{"name":"(anonymous_4)","line":47,"loc":{"start":{"line":47,"column":27},"end":{"line":47,"column":47}}},"5":{"name":"(anonymous_5)","line":67,"loc":{"start":{"line":67,"column":24},"end":{"line":67,"column":44}}},"6":{"name":"(anonymous_6)","line":84,"loc":{"start":{"line":84,"column":30},"end":{"line":84,"column":50}}},"7":{"name":"(anonymous_7)","line":106,"loc":{"start":{"line":106,"column":27},"end":{"line":106,"column":42}}},"8":{"name":"(anonymous_8)","line":129,"loc":{"start":{"line":129,"column":28},"end":{"line":129,"column":56}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}},"3":{"start":{"line":5,"column":0},"end":{"line":9,"column":2}},"4":{"start":{"line":7,"column":4},"end":{"line":7,"column":23}},"5":{"start":{"line":18,"column":0},"end":{"line":26,"column":2}},"6":{"start":{"line":20,"column":4},"end":{"line":20,"column":35}},"7":{"start":{"line":20,"column":16},"end":{"line":20,"column":35}},"8":{"start":{"line":22,"column":4},"end":{"line":22,"column":84}},"9":{"start":{"line":22,"column":30},"end":{"line":22,"column":84}},"10":{"start":{"line":24,"column":4},"end":{"line":24,"column":46}},"11":{"start":{"line":33,"column":1},"end":{"line":37,"column":2}},"12":{"start":{"line":35,"column":4},"end":{"line":35,"column":49}},"13":{"start":{"line":47,"column":1},"end":{"line":57,"column":2}},"14":{"start":{"line":49,"column":4},"end":{"line":49,"column":69}},"15":{"start":{"line":49,"column":56},"end":{"line":49,"column":69}},"16":{"start":{"line":51,"column":4},"end":{"line":51,"column":47}},"17":{"start":{"line":51,"column":27},"end":{"line":51,"column":47}},"18":{"start":{"line":53,"column":4},"end":{"line":53,"column":98}},"19":{"start":{"line":53,"column":27},"end":{"line":53,"column":98}},"20":{"start":{"line":55,"column":4},"end":{"line":55,"column":30}},"21":{"start":{"line":67,"column":1},"end":{"line":75,"column":2}},"22":{"start":{"line":69,"column":4},"end":{"line":69,"column":63}},"23":{"start":{"line":69,"column":46},"end":{"line":69,"column":63}},"24":{"start":{"line":71,"column":4},"end":{"line":71,"column":89}},"25":{"start":{"line":71,"column":27},"end":{"line":71,"column":89}},"26":{"start":{"line":73,"column":4},"end":{"line":73,"column":28}},"27":{"start":{"line":84,"column":1},"end":{"line":98,"column":2}},"28":{"start":{"line":86,"column":4},"end":{"line":86,"column":40}},"29":{"start":{"line":86,"column":27},"end":{"line":86,"column":40}},"30":{"start":{"line":88,"column":4},"end":{"line":88,"column":42}},"31":{"start":{"line":88,"column":29},"end":{"line":88,"column":42}},"32":{"start":{"line":90,"column":4},"end":{"line":90,"column":60}},"33":{"start":{"line":90,"column":47},"end":{"line":90,"column":60}},"34":{"start":{"line":92,"column":4},"end":{"line":92,"column":28}},"35":{"start":{"line":94,"column":4},"end":{"line":94,"column":59}},"36":{"start":{"line":94,"column":41},"end":{"line":94,"column":59}},"37":{"start":{"line":96,"column":4},"end":{"line":96,"column":16}},"38":{"start":{"line":106,"column":1},"end":{"line":120,"column":2}},"39":{"start":{"line":108,"column":4},"end":{"line":113,"column":19}},"40":{"start":{"line":113,"column":6},"end":{"line":113,"column":19}},"41":{"start":{"line":115,"column":4},"end":{"line":115,"column":34}},"42":{"start":{"line":116,"column":4},"end":{"line":116,"column":33}},"43":{"start":{"line":118,"column":4},"end":{"line":118,"column":33}},"44":{"start":{"line":129,"column":1},"end":{"line":139,"column":2}},"45":{"start":{"line":131,"column":4},"end":{"line":131,"column":38}},"46":{"start":{"line":131,"column":25},"end":{"line":131,"column":38}},"47":{"start":{"line":133,"column":4},"end":{"line":135,"column":5}},"48":{"start":{"line":134,"column":8},"end":{"line":134,"column":49}},"49":{"start":{"line":137,"column":4},"end":{"line":137,"column":16}}},"branchMap":{"1":{"line":20,"type":"if","locations":[{"start":{"line":20,"column":4},"end":{"line":20,"column":4}},{"start":{"line":20,"column":4},"end":{"line":20,"column":4}}]},"2":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":4},"end":{"line":22,"column":4}},{"start":{"line":22,"column":4},"end":{"line":22,"column":4}}]},"3":{"line":22,"type":"binary-expr","locations":[{"start":{"line":22,"column":37},"end":{"line":22,"column":48}},{"start":{"line":22,"column":53},"end":{"line":22,"column":82}}]},"4":{"line":24,"type":"binary-expr","locations":[{"start":{"line":24,"column":11},"end":{"line":24,"column":22}},{"start":{"line":24,"column":26},"end":{"line":24,"column":45}}]},"5":{"line":35,"type":"binary-expr","locations":[{"start":{"line":35,"column":11},"end":{"line":35,"column":24}},{"start":{"line":35,"column":28},"end":{"line":35,"column":48}}]},"6":{"line":49,"type":"if","locations":[{"start":{"line":49,"column":4},"end":{"line":49,"column":4}},{"start":{"line":49,"column":4},"end":{"line":49,"column":4}}]},"7":{"line":49,"type":"binary-expr","locations":[{"start":{"line":49,"column":8},"end":{"line":49,"column":19}},{"start":{"line":49,"column":23},"end":{"line":49,"column":54}}]},"8":{"line":51,"type":"if","locations":[{"start":{"line":51,"column":4},"end":{"line":51,"column":4}},{"start":{"line":51,"column":4},"end":{"line":51,"column":4}}]},"9":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":4},"end":{"line":53,"column":4}},{"start":{"line":53,"column":4},"end":{"line":53,"column":4}}]},"10":{"line":53,"type":"binary-expr","locations":[{"start":{"line":53,"column":34},"end":{"line":53,"column":52}},{"start":{"line":53,"column":56},"end":{"line":53,"column":97}}]},"11":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":4},"end":{"line":69,"column":4}},{"start":{"line":69,"column":4},"end":{"line":69,"column":4}}]},"12":{"line":69,"type":"binary-expr","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":23}},{"start":{"line":69,"column":27},"end":{"line":69,"column":44}}]},"13":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":4},"end":{"line":71,"column":4}},{"start":{"line":71,"column":4},"end":{"line":71,"column":4}}]},"14":{"line":71,"type":"cond-expr","locations":[{"start":{"line":71,"column":60},"end":{"line":71,"column":76}},{"start":{"line":71,"column":79},"end":{"line":71,"column":88}}]},"15":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":4},"end":{"line":86,"column":4}},{"start":{"line":86,"column":4},"end":{"line":86,"column":4}}]},"16":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":4},"end":{"line":88,"column":4}},{"start":{"line":88,"column":4},"end":{"line":88,"column":4}}]},"17":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":4},"end":{"line":90,"column":4}},{"start":{"line":90,"column":4},"end":{"line":90,"column":4}}]},"18":{"line":90,"type":"binary-expr","locations":[{"start":{"line":90,"column":8},"end":{"line":90,"column":11}},{"start":{"line":90,"column":15},"end":{"line":90,"column":45}}]},"19":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"20":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":4},"end":{"line":108,"column":4}},{"start":{"line":108,"column":4},"end":{"line":108,"column":4}}]},"21":{"line":108,"type":"binary-expr","locations":[{"start":{"line":108,"column":8},"end":{"line":108,"column":13}},{"start":{"line":109,"column":9},"end":{"line":109,"column":13}},{"start":{"line":109,"column":17},"end":{"line":109,"column":40}},{"start":{"line":110,"column":9},"end":{"line":110,"column":13}},{"start":{"line":110,"column":17},"end":{"line":110,"column":41}},{"start":{"line":111,"column":9},"end":{"line":111,"column":13}},{"start":{"line":111,"column":17},"end":{"line":111,"column":42}},{"start":{"line":112,"column":9},"end":{"line":112,"column":13}},{"start":{"line":112,"column":17},"end":{"line":112,"column":41}}]},"22":{"line":115,"type":"binary-expr","locations":[{"start":{"line":115,"column":17},"end":{"line":115,"column":27}},{"start":{"line":115,"column":31},"end":{"line":115,"column":33}}]},"23":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":4},"end":{"line":131,"column":4}},{"start":{"line":131,"column":4},"end":{"line":131,"column":4}}]}}}; -} -var __cov_XNNw84rhgmX8MBNlCw_I3g = global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/jsAPI.js']; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['1']++; -'use strict'; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['2']++; -var EXTEND = require('whet.extend'); -__cov_XNNw84rhgmX8MBNlCw_I3g.s['3']++; -var JSAPI = module.exports = function (data) { - __cov_XNNw84rhgmX8MBNlCw_I3g.f['1']++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['4']++; - EXTEND(this, data); - }; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['5']++; -JSAPI.prototype.isElem = function (param) { - __cov_XNNw84rhgmX8MBNlCw_I3g.f['2']++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['6']++; - if (!param) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['1'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['7']++; - return !!this.elem; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['1'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['8']++; - if (Array.isArray(param)) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['2'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['9']++; - return (__cov_XNNw84rhgmX8MBNlCw_I3g.b['3'][0]++, !!this.elem) && (__cov_XNNw84rhgmX8MBNlCw_I3g.b['3'][1]++, param.indexOf(this.elem) > -1); - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['2'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['10']++; - return (__cov_XNNw84rhgmX8MBNlCw_I3g.b['4'][0]++, !!this.elem) && (__cov_XNNw84rhgmX8MBNlCw_I3g.b['4'][1]++, this.elem === param); -}; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['11']++; -JSAPI.prototype.isEmpty = function () { - __cov_XNNw84rhgmX8MBNlCw_I3g.f['3']++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['12']++; - return (__cov_XNNw84rhgmX8MBNlCw_I3g.b['5'][0]++, !this.content) || (__cov_XNNw84rhgmX8MBNlCw_I3g.b['5'][1]++, !this.content.length); -}; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['13']++; -JSAPI.prototype.hasAttr = function (name, val) { - __cov_XNNw84rhgmX8MBNlCw_I3g.f['4']++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['14']++; - if ((__cov_XNNw84rhgmX8MBNlCw_I3g.b['7'][0]++, !this.attrs) || (__cov_XNNw84rhgmX8MBNlCw_I3g.b['7'][1]++, !Object.keys(this.attrs).length)) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['6'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['15']++; - return false; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['6'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['16']++; - if (!arguments.length) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['8'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['17']++; - return !!this.attrs; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['8'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['18']++; - if (val !== undefined) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['9'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['19']++; - return (__cov_XNNw84rhgmX8MBNlCw_I3g.b['10'][0]++, !!this.attrs[name]) && (__cov_XNNw84rhgmX8MBNlCw_I3g.b['10'][1]++, this.attrs[name].value === val.toString()); - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['9'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['20']++; - return !!this.attrs[name]; -}; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['21']++; -JSAPI.prototype.attr = function (name, val) { - __cov_XNNw84rhgmX8MBNlCw_I3g.f['5']++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['22']++; - if ((__cov_XNNw84rhgmX8MBNlCw_I3g.b['12'][0]++, !this.hasAttr()) || (__cov_XNNw84rhgmX8MBNlCw_I3g.b['12'][1]++, !arguments.length)) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['11'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['23']++; - return undefined; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['11'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['24']++; - if (val !== undefined) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['13'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['25']++; - return this.hasAttr(name, val) ? (__cov_XNNw84rhgmX8MBNlCw_I3g.b['14'][0]++, this.attrs[name]) : (__cov_XNNw84rhgmX8MBNlCw_I3g.b['14'][1]++, undefined); - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['13'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['26']++; - return this.attrs[name]; -}; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['27']++; -JSAPI.prototype.removeAttr = function (name, val) { - __cov_XNNw84rhgmX8MBNlCw_I3g.f['6']++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['28']++; - if (!arguments.length) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['15'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['29']++; - return false; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['15'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['30']++; - if (!this.hasAttr(name)) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['16'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['31']++; - return false; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['16'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['32']++; - if ((__cov_XNNw84rhgmX8MBNlCw_I3g.b['18'][0]++, val) && (__cov_XNNw84rhgmX8MBNlCw_I3g.b['18'][1]++, this.attrs[name].value !== val)) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['17'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['33']++; - return false; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['17'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['34']++; - delete this.attrs[name]; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['35']++; - if (!Object.keys(this.attrs).length) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['19'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['36']++; - delete this.attrs; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['19'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['37']++; - return true; -}; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['38']++; -JSAPI.prototype.addAttr = function (attr) { - __cov_XNNw84rhgmX8MBNlCw_I3g.f['7']++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['39']++; - if ((__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][0]++, !attr) || (__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][1]++, attr) && (__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][2]++, attr.name === undefined) || (__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][3]++, attr) && (__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][4]++, attr.value === undefined) || (__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][5]++, attr) && (__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][6]++, attr.prefix === undefined) || (__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][7]++, attr) && (__cov_XNNw84rhgmX8MBNlCw_I3g.b['21'][8]++, attr.local === undefined)) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['20'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['40']++; - return false; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['20'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['41']++; - this.attrs = (__cov_XNNw84rhgmX8MBNlCw_I3g.b['22'][0]++, this.attrs) || (__cov_XNNw84rhgmX8MBNlCw_I3g.b['22'][1]++, {}); - __cov_XNNw84rhgmX8MBNlCw_I3g.s['42']++; - this.attrs[attr.name] = attr; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['43']++; - return this.attrs[attr.name]; -}; -__cov_XNNw84rhgmX8MBNlCw_I3g.s['44']++; -JSAPI.prototype.eachAttr = function (callback, context) { - __cov_XNNw84rhgmX8MBNlCw_I3g.f['8']++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['45']++; - if (!this.hasAttr()) { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['23'][0]++; - __cov_XNNw84rhgmX8MBNlCw_I3g.s['46']++; - return false; - } else { - __cov_XNNw84rhgmX8MBNlCw_I3g.b['23'][1]++; - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['47']++; - for (var name in this.attrs) { - __cov_XNNw84rhgmX8MBNlCw_I3g.s['48']++; - callback.call(context, this.attrs[name]); - } - __cov_XNNw84rhgmX8MBNlCw_I3g.s['49']++; - return true; -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/plugins.js b/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/plugins.js deleted file mode 100644 index f8f87d7..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/plugins.js +++ /dev/null @@ -1,107 +0,0 @@ -if (typeof global.__coverage__ === 'undefined') { global.__coverage__ = {}; } -if (!global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/plugins.js']) { - global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/plugins.js'] = {"path":"/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/plugins.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0},"b":{"1":[0,0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":12,"loc":{"start":{"line":12,"column":17},"end":{"line":12,"column":41}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":20},"end":{"line":14,"column":36}}},"3":{"name":"perItem","line":42,"loc":{"start":{"line":42,"column":0},"end":{"line":42,"column":41}}},"4":{"name":"monkeys","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":28}}},"5":{"name":"(anonymous_5)","line":46,"loc":{"start":{"line":46,"column":45},"end":{"line":46,"column":60}}},"6":{"name":"full","line":92,"loc":{"start":{"line":92,"column":0},"end":{"line":92,"column":29}}},"7":{"name":"(anonymous_7)","line":94,"loc":{"start":{"line":94,"column":20},"end":{"line":94,"column":37}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":12,"column":0},"end":{"line":32,"column":2}},"3":{"start":{"line":14,"column":4},"end":{"line":28,"column":7}},"4":{"start":{"line":16,"column":8},"end":{"line":26,"column":9}},"5":{"start":{"line":18,"column":16},"end":{"line":18,"column":44}},"6":{"start":{"line":19,"column":16},"end":{"line":19,"column":22}},"7":{"start":{"line":21,"column":16},"end":{"line":21,"column":50}},"8":{"start":{"line":22,"column":16},"end":{"line":22,"column":22}},"9":{"start":{"line":24,"column":16},"end":{"line":24,"column":41}},"10":{"start":{"line":25,"column":16},"end":{"line":25,"column":22}},"11":{"start":{"line":30,"column":4},"end":{"line":30,"column":16}},"12":{"start":{"line":42,"column":0},"end":{"line":83,"column":1}},"13":{"start":{"line":44,"column":4},"end":{"line":79,"column":5}},"14":{"start":{"line":46,"column":8},"end":{"line":75,"column":11}},"15":{"start":{"line":49,"column":12},"end":{"line":51,"column":13}},"16":{"start":{"line":50,"column":16},"end":{"line":50,"column":30}},"17":{"start":{"line":54,"column":12},"end":{"line":56,"column":30}},"18":{"start":{"line":58,"column":12},"end":{"line":66,"column":13}},"19":{"start":{"line":59,"column":16},"end":{"line":59,"column":40}},"20":{"start":{"line":61,"column":16},"end":{"line":63,"column":17}},"21":{"start":{"line":62,"column":20},"end":{"line":62,"column":35}},"22":{"start":{"line":65,"column":16},"end":{"line":65,"column":20}},"23":{"start":{"line":69,"column":12},"end":{"line":71,"column":13}},"24":{"start":{"line":70,"column":16},"end":{"line":70,"column":30}},"25":{"start":{"line":73,"column":12},"end":{"line":73,"column":26}},"26":{"start":{"line":77,"column":8},"end":{"line":77,"column":21}},"27":{"start":{"line":81,"column":4},"end":{"line":81,"column":25}},"28":{"start":{"line":92,"column":0},"end":{"line":102,"column":1}},"29":{"start":{"line":94,"column":4},"end":{"line":98,"column":7}},"30":{"start":{"line":95,"column":8},"end":{"line":97,"column":9}},"31":{"start":{"line":96,"column":12},"end":{"line":96,"column":50}},"32":{"start":{"line":100,"column":4},"end":{"line":100,"column":16}}},"branchMap":{"1":{"line":16,"type":"switch","locations":[{"start":{"line":17,"column":12},"end":{"line":19,"column":22}},{"start":{"line":20,"column":12},"end":{"line":22,"column":22}},{"start":{"line":23,"column":12},"end":{"line":25,"column":22}}]},"2":{"line":49,"type":"if","locations":[{"start":{"line":49,"column":12},"end":{"line":49,"column":12}},{"start":{"line":49,"column":12},"end":{"line":49,"column":12}}]},"3":{"line":49,"type":"binary-expr","locations":[{"start":{"line":49,"column":16},"end":{"line":49,"column":23}},{"start":{"line":49,"column":27},"end":{"line":49,"column":39}}]},"4":{"line":58,"type":"binary-expr","locations":[{"start":{"line":58,"column":18},"end":{"line":58,"column":24}},{"start":{"line":58,"column":28},"end":{"line":58,"column":38}}]},"5":{"line":61,"type":"if","locations":[{"start":{"line":61,"column":16},"end":{"line":61,"column":16}},{"start":{"line":61,"column":16},"end":{"line":61,"column":16}}]},"6":{"line":61,"type":"binary-expr","locations":[{"start":{"line":61,"column":20},"end":{"line":61,"column":33}},{"start":{"line":61,"column":37},"end":{"line":61,"column":77}}]},"7":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":12},"end":{"line":69,"column":12}},{"start":{"line":69,"column":12},"end":{"line":69,"column":12}}]},"8":{"line":69,"type":"binary-expr","locations":[{"start":{"line":69,"column":16},"end":{"line":69,"column":24}},{"start":{"line":69,"column":28},"end":{"line":69,"column":40}}]},"9":{"line":95,"type":"if","locations":[{"start":{"line":95,"column":8},"end":{"line":95,"column":8}},{"start":{"line":95,"column":8},"end":{"line":95,"column":8}}]}}}; -} -var __cov_Am4cOOzsIicwl6jPKJNdcQ = global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/plugins.js']; -__cov_Am4cOOzsIicwl6jPKJNdcQ.s['1']++; -'use strict'; -__cov_Am4cOOzsIicwl6jPKJNdcQ.s['2']++; -module.exports = function (data, plugins) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.f['1']++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['3']++; - plugins.forEach(function (group) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.f['2']++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['4']++; - switch (group[0].type) { - case 'perItem': - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['1'][0]++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['5']++; - data = perItem(data, group); - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['6']++; - break; - case 'perItemReverse': - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['1'][1]++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['7']++; - data = perItem(data, group, true); - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['8']++; - break; - case 'full': - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['1'][2]++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['9']++; - data = full(data, group); - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['10']++; - break; - } - }); - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['11']++; - return data; -}; -__cov_Am4cOOzsIicwl6jPKJNdcQ.s['12']++; -function perItem(data, plugins, reverse) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.f['3']++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['13']++; - function monkeys(items) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.f['4']++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['14']++; - items.content = items.content.filter(function (item) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.f['5']++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['15']++; - if ((__cov_Am4cOOzsIicwl6jPKJNdcQ.b['3'][0]++, reverse) && (__cov_Am4cOOzsIicwl6jPKJNdcQ.b['3'][1]++, item.content)) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['2'][0]++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['16']++; - monkeys(item); - } else { - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['2'][1]++; - } - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['17']++; - var i = 0, length = plugins.length, filter = true; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['18']++; - while ((__cov_Am4cOOzsIicwl6jPKJNdcQ.b['4'][0]++, filter) && (__cov_Am4cOOzsIicwl6jPKJNdcQ.b['4'][1]++, i < length)) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['19']++; - var plugin = plugins[i]; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['20']++; - if ((__cov_Am4cOOzsIicwl6jPKJNdcQ.b['6'][0]++, plugin.active) && (__cov_Am4cOOzsIicwl6jPKJNdcQ.b['6'][1]++, plugin.fn(item, plugin.params) === false)) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['5'][0]++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['21']++; - filter = false; - } else { - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['5'][1]++; - } - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['22']++; - i++; - } - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['23']++; - if ((__cov_Am4cOOzsIicwl6jPKJNdcQ.b['8'][0]++, !reverse) && (__cov_Am4cOOzsIicwl6jPKJNdcQ.b['8'][1]++, item.content)) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['7'][0]++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['24']++; - monkeys(item); - } else { - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['7'][1]++; - } - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['25']++; - return filter; - }); - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['26']++; - return items; - } - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['27']++; - return monkeys(data); -} -__cov_Am4cOOzsIicwl6jPKJNdcQ.s['28']++; -function full(data, plugins) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.f['6']++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['29']++; - plugins.forEach(function (plugin) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.f['7']++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['30']++; - if (plugin.active) { - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['9'][0]++; - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['31']++; - data = plugin.fn(data, plugin.params); - } else { - __cov_Am4cOOzsIicwl6jPKJNdcQ.b['9'][1]++; - } - }); - __cov_Am4cOOzsIicwl6jPKJNdcQ.s['32']++; - return data; -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/svg2js.js b/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/svg2js.js deleted file mode 100644 index 14cf30a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/svg2js.js +++ /dev/null @@ -1,124 +0,0 @@ -if (typeof global.__coverage__ === 'undefined') { global.__coverage__ = {}; } -if (!global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/svg2js.js']) { - global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/svg2js.js'] = {"path":"/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/svg2js.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0},"b":{"1":[0,0],"2":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0},"fnMap":{"1":{"name":"(anonymous_1)","line":21,"loc":{"start":{"line":21,"column":17},"end":{"line":21,"column":42}}},"2":{"name":"pushToContent","line":28,"loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":36}}},"3":{"name":"(anonymous_3)","line":38,"loc":{"start":{"line":38,"column":20},"end":{"line":38,"column":38}}},"4":{"name":"(anonymous_4)","line":46,"loc":{"start":{"line":46,"column":34},"end":{"line":46,"column":49}}},"5":{"name":"(anonymous_5)","line":54,"loc":{"start":{"line":54,"column":20},"end":{"line":54,"column":38}}},"6":{"name":"(anonymous_6)","line":62,"loc":{"start":{"line":62,"column":18},"end":{"line":62,"column":34}}},"7":{"name":"(anonymous_7)","line":70,"loc":{"start":{"line":70,"column":20},"end":{"line":70,"column":35}}},"8":{"name":"(anonymous_8)","line":98,"loc":{"start":{"line":98,"column":17},"end":{"line":98,"column":32}}},"9":{"name":"(anonymous_9)","line":106,"loc":{"start":{"line":106,"column":21},"end":{"line":106,"column":32}}},"10":{"name":"(anonymous_10)","line":113,"loc":{"start":{"line":113,"column":18},"end":{"line":113,"column":30}}},"11":{"name":"(anonymous_11)","line":125,"loc":{"start":{"line":125,"column":16},"end":{"line":125,"column":27}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":3,"column":0},"end":{"line":4,"column":31}},"3":{"start":{"line":6,"column":0},"end":{"line":13,"column":2}},"4":{"start":{"line":21,"column":0},"end":{"line":133,"column":2}},"5":{"start":{"line":23,"column":4},"end":{"line":26,"column":19}},"6":{"start":{"line":28,"column":4},"end":{"line":36,"column":5}},"7":{"start":{"line":30,"column":8},"end":{"line":30,"column":37}},"8":{"start":{"line":32,"column":8},"end":{"line":32,"column":64}},"9":{"start":{"line":34,"column":8},"end":{"line":34,"column":23}},"10":{"start":{"line":38,"column":4},"end":{"line":44,"column":6}},"11":{"start":{"line":40,"column":8},"end":{"line":42,"column":11}},"12":{"start":{"line":46,"column":4},"end":{"line":52,"column":6}},"13":{"start":{"line":48,"column":8},"end":{"line":50,"column":11}},"14":{"start":{"line":54,"column":4},"end":{"line":60,"column":6}},"15":{"start":{"line":56,"column":8},"end":{"line":58,"column":11}},"16":{"start":{"line":62,"column":4},"end":{"line":68,"column":6}},"17":{"start":{"line":64,"column":8},"end":{"line":66,"column":11}},"18":{"start":{"line":70,"column":4},"end":{"line":96,"column":6}},"19":{"start":{"line":72,"column":8},"end":{"line":76,"column":10}},"20":{"start":{"line":78,"column":8},"end":{"line":89,"column":9}},"21":{"start":{"line":79,"column":12},"end":{"line":79,"column":28}},"22":{"start":{"line":81,"column":12},"end":{"line":88,"column":13}},"23":{"start":{"line":82,"column":16},"end":{"line":87,"column":18}},"24":{"start":{"line":91,"column":8},"end":{"line":91,"column":35}},"25":{"start":{"line":92,"column":8},"end":{"line":92,"column":23}},"26":{"start":{"line":94,"column":8},"end":{"line":94,"column":25}},"27":{"start":{"line":98,"column":4},"end":{"line":104,"column":6}},"28":{"start":{"line":100,"column":8},"end":{"line":102,"column":11}},"29":{"start":{"line":106,"column":4},"end":{"line":111,"column":6}},"30":{"start":{"line":108,"column":8},"end":{"line":108,"column":20}},"31":{"start":{"line":109,"column":8},"end":{"line":109,"column":42}},"32":{"start":{"line":113,"column":4},"end":{"line":123,"column":6}},"33":{"start":{"line":118,"column":8},"end":{"line":118,"column":26}},"34":{"start":{"line":120,"column":8},"end":{"line":120,"column":39}},"35":{"start":{"line":121,"column":8},"end":{"line":121,"column":35}},"36":{"start":{"line":125,"column":4},"end":{"line":129,"column":6}},"37":{"start":{"line":127,"column":8},"end":{"line":127,"column":23}},"38":{"start":{"line":131,"column":4},"end":{"line":131,"column":28}}},"branchMap":{"1":{"line":32,"type":"binary-expr","locations":[{"start":{"line":32,"column":27},"end":{"line":32,"column":42}},{"start":{"line":32,"column":46},"end":{"line":32,"column":48}}]},"2":{"line":78,"type":"if","locations":[{"start":{"line":78,"column":8},"end":{"line":78,"column":8}},{"start":{"line":78,"column":8},"end":{"line":78,"column":8}}]}}}; -} -var __cov_rvB9jLDFFzwdtyhXzftqlA = global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/svg2js.js']; -__cov_rvB9jLDFFzwdtyhXzftqlA.s['1']++; -'use strict'; -__cov_rvB9jLDFFzwdtyhXzftqlA.s['2']++; -var SAX = require('sax'), JSAPI = require('./jsAPI'); -__cov_rvB9jLDFFzwdtyhXzftqlA.s['3']++; -var config = { - strict: true, - trim: true, - normalize: true, - lowercase: true, - xmlns: true, - position: false - }; -__cov_rvB9jLDFFzwdtyhXzftqlA.s['4']++; -module.exports = function (data, callback) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['1']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['5']++; - var sax = SAX.parser(config.strict, config), root = {}, current = root, stack = []; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['6']++; - function pushToContent(content) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['2']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['7']++; - content = new JSAPI(content); - __cov_rvB9jLDFFzwdtyhXzftqlA.s['8']++; - (current.content = (__cov_rvB9jLDFFzwdtyhXzftqlA.b['1'][0]++, current.content) || (__cov_rvB9jLDFFzwdtyhXzftqlA.b['1'][1]++, [])).push(content); - __cov_rvB9jLDFFzwdtyhXzftqlA.s['9']++; - return content; - } - __cov_rvB9jLDFFzwdtyhXzftqlA.s['10']++; - sax.ondoctype = function (doctype) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['3']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['11']++; - pushToContent({ doctype: doctype }); - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['12']++; - sax.onprocessinginstruction = function (data) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['4']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['13']++; - pushToContent({ processinginstruction: data }); - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['14']++; - sax.oncomment = function (comment) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['5']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['15']++; - pushToContent({ comment: comment }); - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['16']++; - sax.oncdata = function (cdata) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['6']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['17']++; - pushToContent({ cdata: cdata }); - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['18']++; - sax.onopentag = function (data) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['7']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['19']++; - var elem = { - elem: data.name, - prefix: data.prefix, - local: data.local - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['20']++; - if (Object.keys(data.attributes).length) { - __cov_rvB9jLDFFzwdtyhXzftqlA.b['2'][0]++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['21']++; - elem.attrs = {}; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['22']++; - for (var name in data.attributes) { - __cov_rvB9jLDFFzwdtyhXzftqlA.s['23']++; - elem.attrs[name] = { - name: name, - value: data.attributes[name].value, - prefix: data.attributes[name].prefix, - local: data.attributes[name].local - }; - } - } else { - __cov_rvB9jLDFFzwdtyhXzftqlA.b['2'][1]++; - } - __cov_rvB9jLDFFzwdtyhXzftqlA.s['24']++; - elem = pushToContent(elem); - __cov_rvB9jLDFFzwdtyhXzftqlA.s['25']++; - current = elem; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['26']++; - stack.push(elem); - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['27']++; - sax.ontext = function (text) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['8']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['28']++; - pushToContent({ text: text }); - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['29']++; - sax.onclosetag = function () { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['9']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['30']++; - stack.pop(); - __cov_rvB9jLDFFzwdtyhXzftqlA.s['31']++; - current = stack[stack.length - 1]; - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['32']++; - sax.onerror = function (e) { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['10']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['33']++; - this.error = null; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['34']++; - callback({ error: e.message }); - __cov_rvB9jLDFFzwdtyhXzftqlA.s['35']++; - throw new Error(e.message); - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['36']++; - sax.onend = function () { - __cov_rvB9jLDFFzwdtyhXzftqlA.f['11']++; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['37']++; - callback(root); - }; - __cov_rvB9jLDFFzwdtyhXzftqlA.s['38']++; - sax.write(data).close(); -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/tools.js b/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/tools.js deleted file mode 100644 index 333099d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib-cov/svgo/tools.js +++ /dev/null @@ -1,161 +0,0 @@ -if (typeof global.__coverage__ === 'undefined') { global.__coverage__ = {}; } -if (!global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/tools.js']) { - global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/tools.js'] = {"path":"/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/tools.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0,0,0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":10,"loc":{"start":{"line":10,"column":27},"end":{"line":10,"column":47}}},"2":{"name":"(anonymous_2)","line":43,"loc":{"start":{"line":43,"column":27},"end":{"line":43,"column":41}}},"3":{"name":"(anonymous_3)","line":68,"loc":{"start":{"line":68,"column":26},"end":{"line":68,"column":42}}},"4":{"name":"(anonymous_4)","line":71,"loc":{"start":{"line":71,"column":18},"end":{"line":71,"column":33}}},"5":{"name":"(anonymous_5)","line":81,"loc":{"start":{"line":81,"column":26},"end":{"line":81,"column":41}}},"6":{"name":"(anonymous_6)","line":82,"loc":{"start":{"line":82,"column":20},"end":{"line":82,"column":32}}},"7":{"name":"(anonymous_7)","line":87,"loc":{"start":{"line":87,"column":25},"end":{"line":87,"column":48}}},"8":{"name":"(anonymous_8)","line":93,"loc":{"start":{"line":93,"column":17},"end":{"line":93,"column":35}}},"9":{"name":"(anonymous_9)","line":145,"loc":{"start":{"line":145,"column":52},"end":{"line":145,"column":66}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}},"2":{"start":{"line":10,"column":0},"end":{"line":35,"column":2}},"3":{"start":{"line":12,"column":4},"end":{"line":12,"column":38}},"4":{"start":{"line":15,"column":4},"end":{"line":31,"column":5}},"5":{"start":{"line":17,"column":8},"end":{"line":17,"column":29}},"6":{"start":{"line":19,"column":8},"end":{"line":19,"column":58}},"7":{"start":{"line":22,"column":11},"end":{"line":31,"column":5}},"8":{"start":{"line":24,"column":8},"end":{"line":24,"column":53}},"9":{"start":{"line":27,"column":11},"end":{"line":31,"column":5}},"10":{"start":{"line":29,"column":8},"end":{"line":29,"column":33}},"11":{"start":{"line":33,"column":4},"end":{"line":33,"column":15}},"12":{"start":{"line":43,"column":0},"end":{"line":66,"column":2}},"13":{"start":{"line":45,"column":4},"end":{"line":45,"column":38}},"14":{"start":{"line":48,"column":4},"end":{"line":62,"column":5}},"15":{"start":{"line":50,"column":8},"end":{"line":50,"column":71}},"16":{"start":{"line":53,"column":11},"end":{"line":62,"column":5}},"17":{"start":{"line":55,"column":8},"end":{"line":55,"column":52}},"18":{"start":{"line":58,"column":11},"end":{"line":62,"column":5}},"19":{"start":{"line":60,"column":8},"end":{"line":60,"column":32}},"20":{"start":{"line":64,"column":4},"end":{"line":64,"column":15}},"21":{"start":{"line":68,"column":0},"end":{"line":79,"column":2}},"22":{"start":{"line":69,"column":4},"end":{"line":69,"column":20}},"23":{"start":{"line":71,"column":4},"end":{"line":76,"column":7}},"24":{"start":{"line":72,"column":8},"end":{"line":75,"column":10}},"25":{"start":{"line":78,"column":4},"end":{"line":78,"column":18}},"26":{"start":{"line":81,"column":0},"end":{"line":85,"column":2}},"27":{"start":{"line":82,"column":4},"end":{"line":84,"column":7}},"28":{"start":{"line":83,"column":8},"end":{"line":83,"column":33}},"29":{"start":{"line":87,"column":0},"end":{"line":130,"column":2}},"30":{"start":{"line":89,"column":4},"end":{"line":91,"column":13}},"31":{"start":{"line":93,"column":4},"end":{"line":126,"column":7}},"32":{"start":{"line":96,"column":8},"end":{"line":96,"column":24}},"33":{"start":{"line":99,"column":8},"end":{"line":101,"column":9}},"34":{"start":{"line":100,"column":12},"end":{"line":100,"column":27}},"35":{"start":{"line":105,"column":8},"end":{"line":112,"column":9}},"36":{"start":{"line":111,"column":12},"end":{"line":111,"column":27}},"37":{"start":{"line":115,"column":8},"end":{"line":115,"column":20}},"38":{"start":{"line":120,"column":8},"end":{"line":122,"column":9}},"39":{"start":{"line":121,"column":12},"end":{"line":121,"column":43}},"40":{"start":{"line":124,"column":8},"end":{"line":124,"column":32}},"41":{"start":{"line":128,"column":4},"end":{"line":128,"column":15}},"42":{"start":{"line":145,"column":0},"end":{"line":155,"column":2}},"43":{"start":{"line":147,"column":4},"end":{"line":151,"column":5}},"44":{"start":{"line":148,"column":8},"end":{"line":148,"column":34}},"45":{"start":{"line":149,"column":11},"end":{"line":151,"column":5}},"46":{"start":{"line":150,"column":8},"end":{"line":150,"column":40}},"47":{"start":{"line":153,"column":4},"end":{"line":153,"column":15}}},"branchMap":{"1":{"line":15,"type":"if","locations":[{"start":{"line":15,"column":4},"end":{"line":15,"column":4}},{"start":{"line":15,"column":4},"end":{"line":15,"column":4}}]},"2":{"line":15,"type":"binary-expr","locations":[{"start":{"line":15,"column":8},"end":{"line":15,"column":13}},{"start":{"line":15,"column":17},"end":{"line":15,"column":34}}]},"3":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":11},"end":{"line":22,"column":11}},{"start":{"line":22,"column":11},"end":{"line":22,"column":11}}]},"4":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":11},"end":{"line":27,"column":11}},{"start":{"line":27,"column":11},"end":{"line":27,"column":11}}]},"5":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":48,"column":4}},{"start":{"line":48,"column":4},"end":{"line":48,"column":4}}]},"6":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":11},"end":{"line":53,"column":11}},{"start":{"line":53,"column":11},"end":{"line":53,"column":11}}]},"7":{"line":58,"type":"if","locations":[{"start":{"line":58,"column":11},"end":{"line":58,"column":11}},{"start":{"line":58,"column":11},"end":{"line":58,"column":11}}]},"8":{"line":74,"type":"cond-expr","locations":[{"start":{"line":74,"column":34},"end":{"line":74,"column":38}},{"start":{"line":74,"column":41},"end":{"line":74,"column":47}}]},"9":{"line":99,"type":"if","locations":[{"start":{"line":99,"column":8},"end":{"line":99,"column":8}},{"start":{"line":99,"column":8},"end":{"line":99,"column":8}}]},"10":{"line":105,"type":"if","locations":[{"start":{"line":105,"column":8},"end":{"line":105,"column":8}},{"start":{"line":105,"column":8},"end":{"line":105,"column":8}}]},"11":{"line":106,"type":"binary-expr","locations":[{"start":{"line":106,"column":12},"end":{"line":106,"column":37}},{"start":{"line":107,"column":13},"end":{"line":107,"column":21}},{"start":{"line":108,"column":14},"end":{"line":108,"column":22}},{"start":{"line":108,"column":26},"end":{"line":108,"column":34}},{"start":{"line":108,"column":38},"end":{"line":108,"column":52}}]},"12":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":8},"end":{"line":120,"column":8}},{"start":{"line":120,"column":8},"end":{"line":120,"column":8}}]},"13":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":4},"end":{"line":147,"column":4}},{"start":{"line":147,"column":4},"end":{"line":147,"column":4}}]},"14":{"line":147,"type":"binary-expr","locations":[{"start":{"line":147,"column":8},"end":{"line":147,"column":15}},{"start":{"line":147,"column":19},"end":{"line":147,"column":26}}]},"15":{"line":149,"type":"if","locations":[{"start":{"line":149,"column":11},"end":{"line":149,"column":11}},{"start":{"line":149,"column":11},"end":{"line":149,"column":11}}]},"16":{"line":149,"type":"binary-expr","locations":[{"start":{"line":149,"column":15},"end":{"line":149,"column":22}},{"start":{"line":149,"column":26},"end":{"line":149,"column":34}}]}}}; -} -var __cov_kdpVQfBNDg4qiKaFLdPCOA = global.__coverage__['/Users/deepsweet/Documents/projects/svgo-stable/lib/svgo/tools.js']; -__cov_kdpVQfBNDg4qiKaFLdPCOA.s['1']++; -'use strict'; -__cov_kdpVQfBNDg4qiKaFLdPCOA.s['2']++; -exports.encodeSVGDatauri = function (str, type) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['1']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['3']++; - var prefix = 'data:image/svg+xml'; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['4']++; - if ((__cov_kdpVQfBNDg4qiKaFLdPCOA.b['2'][0]++, !type) || (__cov_kdpVQfBNDg4qiKaFLdPCOA.b['2'][1]++, type === 'base64')) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['1'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['5']++; - prefix += ';base64,'; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['6']++; - str = prefix + new Buffer(str).toString('base64'); - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['1'][1]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['7']++; - if (type === 'enc') { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['3'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['8']++; - str = prefix + ',' + encodeURIComponent(str); - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['3'][1]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['9']++; - if (type === 'unenc') { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['4'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['10']++; - str = prefix + ',' + str; - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['4'][1]++; - } - } - } - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['11']++; - return str; -}; -__cov_kdpVQfBNDg4qiKaFLdPCOA.s['12']++; -exports.decodeSVGDatauri = function (str) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['2']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['13']++; - var prefix = 'data:image/svg+xml'; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['14']++; - if (str.substring(0, 26) === prefix + ';base64,') { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['5'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['15']++; - str = new Buffer(str.substring(26), 'base64').toString('utf8'); - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['5'][1]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['16']++; - if (str.substring(0, 20) === prefix + ',%') { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['6'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['17']++; - str = decodeURIComponent(str.substring(19)); - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['6'][1]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['18']++; - if (str.substring(0, 20) === prefix + ',<') { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['7'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['19']++; - str = str.substring(19); - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['7'][1]++; - } - } - } - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['20']++; - return str; -}; -__cov_kdpVQfBNDg4qiKaFLdPCOA.s['21']++; -exports.flattenOneLevel = function (array) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['3']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['22']++; - var result = []; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['23']++; - array.forEach(function (item) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['4']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['24']++; - Array.prototype.push.apply(result, Array.isArray(item) ? (__cov_kdpVQfBNDg4qiKaFLdPCOA.b['8'][0]++, item) : (__cov_kdpVQfBNDg4qiKaFLdPCOA.b['8'][1]++, [item])); - }); - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['25']++; - return result; -}; -__cov_kdpVQfBNDg4qiKaFLdPCOA.s['26']++; -exports.intersectArrays = function (a, b) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['5']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['27']++; - return a.filter(function (n) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['6']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['28']++; - return b.indexOf(n) > -1; - }); -}; -__cov_kdpVQfBNDg4qiKaFLdPCOA.s['29']++; -exports.cleanupOutData = function (data, params) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['7']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['30']++; - var str = '', delimiter, prev; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['31']++; - data.forEach(function (item, i) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['8']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['32']++; - delimiter = ' '; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['33']++; - if (i === 0) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['9'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['34']++; - delimiter = ''; - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['9'][1]++; - } - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['35']++; - if ((__cov_kdpVQfBNDg4qiKaFLdPCOA.b['11'][0]++, params.negativeExtraSpace) && ((__cov_kdpVQfBNDg4qiKaFLdPCOA.b['11'][1]++, item < 0) || (__cov_kdpVQfBNDg4qiKaFLdPCOA.b['11'][2]++, item > 0) && (__cov_kdpVQfBNDg4qiKaFLdPCOA.b['11'][3]++, item < 1) && (__cov_kdpVQfBNDg4qiKaFLdPCOA.b['11'][4]++, prev % 1 !== 0))) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['10'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['36']++; - delimiter = ''; - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['10'][1]++; - } - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['37']++; - prev = item; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['38']++; - if (params.leadingZero) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['12'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['39']++; - item = removeLeadingZero(item); - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['12'][1]++; - } - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['40']++; - str += delimiter + item; - }); - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['41']++; - return str; -}; -__cov_kdpVQfBNDg4qiKaFLdPCOA.s['42']++; -var removeLeadingZero = exports.removeLeadingZero = function (num) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.f['9']++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['43']++; - if ((__cov_kdpVQfBNDg4qiKaFLdPCOA.b['14'][0]++, num > 0) && (__cov_kdpVQfBNDg4qiKaFLdPCOA.b['14'][1]++, num < 1)) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['13'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['44']++; - num = ('' + num).slice(1); - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['13'][1]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['45']++; - if ((__cov_kdpVQfBNDg4qiKaFLdPCOA.b['16'][0]++, num < 0) && (__cov_kdpVQfBNDg4qiKaFLdPCOA.b['16'][1]++, num > -1)) { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['15'][0]++; - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['46']++; - num = '-' + ('' + num).slice(2); - } else { - __cov_kdpVQfBNDg4qiKaFLdPCOA.b['15'][1]++; - } - } - __cov_kdpVQfBNDg4qiKaFLdPCOA.s['47']++; - return num; - }; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo.js b/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo.js deleted file mode 100644 index ca07411..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -/** - * SVGO is a Nodejs-based tool for optimizing SVG vector graphics files. - * - * @see http://deepsweet.github.com/svgo/ - * - * @author Kir Belevich (https://github.com/deepsweet) - * @copyright © 2012 Kir Belevich - * @license MIT https://raw.github.com/deepsweet/svgo/master/LICENSE - */ - -var CONFIG = require('./svgo/config'), - SVG2JS = require('./svgo/svg2js'), - PLUGINS = require('./svgo/plugins'), - JS2SVG = require('./svgo/js2svg'); - -var SVGO = module.exports = function(config) { - - this.config = CONFIG(config); - -}; - -SVGO.prototype.optimize = function(svgstr, callback) { - - var config = this.config; - - SVG2JS(svgstr, function(svgjs) { - - if (svgjs.error) { - callback(svgjs); - return; - } - - svgjs = PLUGINS(svgjs, config.plugins); - - callback(JS2SVG(svgjs, config.js2svg)); - - }); - -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/coa.js b/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/coa.js deleted file mode 100644 index f969cf5..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/coa.js +++ /dev/null @@ -1,426 +0,0 @@ -'use strict'; - -require('colors'); -require('js-yaml'); - -var FS = require('fs'), - PATH = require('path'), - UTIL = require('util'), - SVGO = require('../svgo'), - PKG = require('../../package.json'), - encodeSVGDatauri = require('./tools').encodeSVGDatauri, - decodeSVGDatauri = require('./tools').decodeSVGDatauri, - regSVGFile = /\.svg$/; - -/** - * Command-Option-Argument. - * - * @see https://github.com/veged/coa - */ -module.exports = require('coa').Cmd() - .helpful() - .name(PKG.name) - .title(PKG.description) - .opt() - .name('version').title('Version') - .short('v').long('version') - .only() - .flag() - .act(function() { - return PKG.version; - }) - .end() - .opt() - .name('input').title('Input file, "-" for STDIN') - .short('i').long('input') - .val(function(val) { - return val || this.reject('Option --input must have a value.'); - }) - .end() - .opt() - .name('string').title('Input SVG data string') - .short('s').long('string') - .end() - .opt() - .name('folder').title('Input folder, optimize and rewrite all *.svg files') - .short('f').long('folder') - .val(function(val) { - return val || this.reject('Option --folder must have a value.'); - }) - .end() - .opt() - .name('output').title('Output file (by default the same as the input), "-" for STDOUT') - .short('o').long('output') - .val(function(val) { - return val || this.reject('Option --output must have a value.'); - }) - .end() - .opt() - .name('config').title('Config file to extend or replace default') - .long('config') - .val(function(val) { - return val || this.reject('Option --config must have a value.'); - }) - .end() - .opt() - .name('disable').title('Disable plugin by name') - .long('disable') - .arr() - .val(function(val) { - return val || this.reject('Option --disable must have a value.'); - }) - .end() - .opt() - .name('enable').title('Enable plugin by name') - .long('enable') - .arr() - .val(function(val) { - return val || this.reject('Option --enable must have a value.'); - }) - .end() - .opt() - .name('datauri').title('Output as Data URI string (base64, URI encoded or unencoded)') - .long('datauri') - .val(function(val) { - return val || this.reject('Option --datauri must have one of the following values: base64, enc or unenc'); - }) - .end() - .opt() - .name('pretty').title('Make SVG pretty printed') - .long('pretty') - .flag() - .end() - .arg() - .name('input').title('Alias to --input') - .end() - .arg() - .name('output').title('Alias to --output') - .end() - .act(function(opts, args) { - - var input = args && args.input ? args.input : opts.input, - output = args && args.output ? args.output : opts.output, - config, - configFull; - - // w/o anything - if ( - (!input || input === '-') && - !opts.string && - !opts.stdin && - !opts.folder && - process.stdin.isTTY - ) return this.usage(); - - // --config - if (opts.config) { - - // string - if (opts.config.charAt(0) === '{') { - config = JSON.parse(opts.config); - - // external file - } else { - config = require(PATH.resolve(opts.config)); - } - - } - - // --disable - if (opts.disable) { - config = changePluginsState(opts.disable, false, config); - } - - // --enable - if (opts.enable) { - config = changePluginsState(opts.enable, true, config); - } - - // --pretty - if (opts.pretty) { - - config = config || {}; - config.js2svg = config.js2svg || {}; - config.js2svg.pretty = true; - - } - - // --folder - if (opts.folder) { - optimizeFolder(opts.folder, config, configFull); - - return; - } - - // --input - if (input) { - - // STDIN - if (input === '-') { - - var data = ''; - - process.stdin.pause(); - - process.stdin - .on('data', function(chunk) { - data += chunk; - }) - .once('end', function() { - optimizeFromString(data, config, opts.datauri, input, output); - }) - .resume(); - - // file - } else { - - FS.readFile(input, 'utf8', function(err, data) { - if (err) { - throw err; - } - - optimizeFromString(data, config, opts.datauri, input, output); - }); - - } - - // --string - } else if (opts.string) { - - opts.string = decodeSVGDatauri(opts.string); - - optimizeFromString(opts.string, config, opts.datauri, input, output); - - } - - }); - -function optimizeFromString(svgstr, config, datauri, input, output) { - - var startTime = Date.now(config), - time, - inBytes = Buffer.byteLength(svgstr, 'utf8'), - outBytes, - svgo = new SVGO(config); - - svgo.optimize(svgstr, function(result) { - - if (result.error) { - console.log(result.error); - return; - } - - if (datauri) { - result.data = encodeSVGDatauri(result.data, datauri); - } - - outBytes = Buffer.byteLength(result.data, 'utf8'); - time = Date.now() - startTime; - - // stdout - if (output === '-' || (input === '-' && !output)) { - - process.stdout.write(result.data + '\n'); - - // file - } else { - - // overwrite input file if there is no output - if (!output && input) { - output = input; - } - - UTIL.puts('\r'); - - saveFileAndPrintInfo(result.data, output, inBytes, outBytes, time); - - } - - }); - -} - -function saveFileAndPrintInfo(data, path, inBytes, outBytes, time) { - - FS.writeFile(path, data, 'utf8', function() { - - // print time info - printTimeInfo(time); - - // print optimization profit info - printProfitInfo(inBytes, outBytes); - - }); - -} - -function printTimeInfo(time) { - - UTIL.puts('Done in ' + time + ' ms!'); - -} - -function printProfitInfo(inBytes, outBytes) { - - var profitPercents = 100 - outBytes * 100 / inBytes; - - UTIL.puts( - (Math.round((inBytes / 1024) * 1000) / 1000) + ' KiB' + - (profitPercents < 0 ? ' + ' : ' - ') + - String(Math.abs((Math.round(profitPercents * 10) / 10)) + '%').green + ' = ' + - (Math.round((outBytes / 1024) * 1000) / 1000) + ' KiB\n' - ); - -} - -/** - * Change plugins state by names array. - * - * @param {Array} names plugins names - * @param {Boolean} state active state - * @param {Object} config original config - * @return {Object} changed config - */ -function changePluginsState(names, state, config) { - - // extend config - if (config && config.plugins) { - - names.forEach(function(name) { - - var matched, - key; - - config.plugins.forEach(function(plugin) { - - // get plugin name - if (typeof plugin === 'object') { - key = Object.keys(plugin)[0]; - } else { - key = plugin; - } - - // if there are such plugin name - if (key === name) { - // do not replace plugin's params with true - if (typeof plugin[key] !== 'object' || !state) { - plugin[key] = state; - } - - // mark it as matched - matched = true; - } - - }); - - // if not matched and current config is not full - if (!matched && !config.full) { - - var obj = {}; - - obj[name] = state; - - // push new plugin Object - config.plugins.push(obj); - - matched = true; - - } - - }); - - // just push - } else { - - config = { plugins: [] }; - - names.forEach(function(name) { - var obj = {}; - - obj[name] = state; - - config.plugins.push(obj); - }); - - } - - return config; - -} - -function optimizeFolder(path, config) { - - var svgo = new SVGO(config); - - // absoluted folder path - path = PATH.resolve(path); - - UTIL.puts('\n' + path + ':\n'); - - // list folder content - FS.readdir(path, function(err, files) { - - if (err) { - throw err; - } - - var i = 0; - - function optimizeFile(file) { - - // absoluted file path - var filepath = PATH.resolve(path, file); - - // check if file name matches *.svg - if (regSVGFile.test(filepath)) { - - FS.readFile(filepath, 'utf8', function(err, data) { - - if (err) { - throw err; - } - - var startTime = Date.now(), - time, - inBytes = Buffer.byteLength(data, 'utf8'), - outBytes; - - svgo.optimize(data, function(result) { - - if (result.error) { - console.log(result.error); - return; - } - - outBytes = Buffer.byteLength(result.data, 'utf8'); - time = Date.now() - startTime; - - FS.writeFile(filepath, result.data, 'utf8', function() { - - UTIL.puts(file + ':'); - - // print time info - printTimeInfo(time); - - // print optimization profit info - printProfitInfo(inBytes, outBytes); - - }); - - }); - - }); - - } - - if (++i < files.length) { - optimizeFile(files[i]); - } - - } - - optimizeFile(files[i]); - - }); - -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/config.js b/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/config.js deleted file mode 100644 index 661a83b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/config.js +++ /dev/null @@ -1,184 +0,0 @@ -'use strict'; - -require('js-yaml'); - -var EXTEND = require('whet.extend'); - -/** - * Read and/or extend/replace default config file, - * prepare and optimize plugins array. - * - * @param {Object} [config] input config - * @return {Object} output config - */ -module.exports = function(config) { - - var defaults; - - if (config && config.full) { - - defaults = config; - - if (defaults.plugins) { - defaults.plugins = preparePluginsArray(defaults.plugins); - defaults.plugins = optimizePluginsArray(defaults.plugins); - } - - } else { - - defaults = EXTEND({}, require('../../.svgo.yml')); - - defaults.plugins = preparePluginsArray(defaults.plugins); - - if (config) { - defaults = extendConfig(defaults, config); - } - - defaults.plugins = optimizePluginsArray(defaults.plugins); - - } - - return defaults; - -}; - -/** - * Require() all plugins in array. - * - * @param {Array} plugins input plugins array - * @return {Array} input plugins array of arrays - */ -function preparePluginsArray(plugins) { - - var plugin, - key; - - return plugins.map(function(item) { - - // {} - if (typeof item === 'object') { - - key = Object.keys(item)[0]; - plugin = EXTEND({}, require('../../plugins/' + key)); - - // name: {} - if (typeof item[key] === 'object') { - plugin.params = EXTEND({}, plugin.params || {}, item[key]); - plugin.active = true; - - // name: false - } else if (item[key] === false) { - plugin.active = false; - - // name: true - } else if (item[key] === true) { - plugin.active = true; - } - - plugin.name = key; - - // name - } else { - - plugin = EXTEND({}, require('../../plugins/' + item)); - plugin.name = item; - - } - - return plugin; - - }); - -} - -/** - * Extend plugins with the custom config object. - * - * @param {Array} plugins input plugins - * @param {Object} config config - * @return {Array} output plugins - */ -function extendConfig(defaults, config) { - - var key; - - // plugins - if (config.plugins) { - - config.plugins.forEach(function(item) { - - // {} - if (typeof item === 'object') { - - key = Object.keys(item)[0]; - - defaults.plugins.forEach(function(plugin) { - - if (plugin.name === key) { - // name: {} - if (typeof item[key] === 'object') { - plugin.params = EXTEND({}, plugin.params || {}, item[key]); - plugin.active = true; - - // name: false - } else if (item[key] === false) { - plugin.active = false; - - // name: true - } else if (item[key] === true) { - plugin.active = true; - } - } - - }); - - } - - }); - - } - - // svg2js - if (config.svg2js) { - defaults.svg2js = config.svg2js; - } - - // js2svg - if (config.js2svg) { - defaults.js2svg = config.js2svg; - } - - return defaults; - -} - -/** - * Try to group sequential elements of plugins array. - * - * @param {Object} plugins input plugins - * @return {Array} output plugins - */ -function optimizePluginsArray(plugins) { - - var prev; - - plugins = plugins.map(function(item) { - return [item]; - }); - - plugins = plugins.filter(function(item) { - - if (prev && item[0].type === prev[0].type) { - prev.push(item[0]); - return false; - } - - prev = item; - - return true; - - }); - - return plugins; - -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/js2svg.js b/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/js2svg.js deleted file mode 100644 index 31dbcdd..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/js2svg.js +++ /dev/null @@ -1,290 +0,0 @@ -'use strict'; - -var EXTEND = require('whet.extend'); - -var defaults = { - doctypeStart: '', - procInstStart: '', - tagOpenStart: '<', - tagOpenEnd: '>', - tagCloseStart: '', - tagShortStart: '<', - tagShortEnd: '/>', - attrStart: '="', - attrEnd: '"', - commentStart: '', - cdataStart: '', - textStart: '', - textEnd: '', - indent: ' ', - entities: { - '&': '&', - '\'': ''', - '"': '"', - '>': '>', - '<': '<', - }, - pretty: false -}; - -/** - * Convert SVG-as-JS object to SVG (XML) string. - * - * @param {Object} data input data - * @param {Object} config config - * - * @return {Object} output data - */ -module.exports = function(data, config) { - - return new JS2SVG(config).convert(data); - -}; - -function JS2SVG(config) { - - if (config) { - this.config = EXTEND(true, {}, defaults, config); - } else { - this.config = defaults; - } - - if (this.config.pretty) { - this.config.doctypeEnd += '\n'; - this.config.procInstEnd += '\n'; - this.config.commentEnd += '\n'; - this.config.cdataEnd += '\n'; - this.config.tagShortEnd += '\n'; - this.config.tagOpenEnd += '\n'; - this.config.tagCloseEnd += '\n'; - this.config.textEnd += '\n'; - } - - this.indentLevel = 0; - -} - -/** - * Start conversion. - * - * @param {Object} data input data - * - * @return {String} - */ -JS2SVG.prototype.convert = function(data) { - - var svg = ''; - - if (data.content) { - - this.indentLevel++; - - data.content.forEach(function(item) { - - if (item.elem) { - svg += this.createElem(item); - } else if (item.text) { - svg += this.createText(item.text); - } else if (item.doctype) { - svg += this.createDoctype(item.doctype); - } else if (item.processinginstruction) { - svg += this.createProcInst(item.processinginstruction); - } else if (item.comment) { - svg += this.createComment(item.comment); - } else if (item.cdata) { - svg += this.createCDATA(item.cdata); - } - - }, this); - - } - - this.indentLevel--; - - return { - data: svg, - info: { - width: this.width, - height: this.height - } - }; - -}; - -/** - * Create indent string in accordance with the current node level. - * - * @return {String} - */ -JS2SVG.prototype.createIndent = function() { - - var indent = ''; - - if (this.config.pretty) { - for (var i = 1; i < this.indentLevel; i++) { - indent += this.config.indent; - } - } - - return indent; - -}; - -/** - * Create doctype tag. - * - * @param {String} doctype doctype body string - * - * @return {String} - */ -JS2SVG.prototype.createDoctype = function(doctype) { - - return this.config.doctypeStart + - doctype + - this.config.doctypeEnd; - -}; - -/** - * Create XML Processing Instruction tag. - * - * @param {Object} instruction instruction object - * - * @return {String} - */ -JS2SVG.prototype.createProcInst = function(instruction) { - - return this.config.procInstStart + - instruction.name + - ' ' + - instruction.body + - this.config.procInstEnd; - -}; - -/** - * Create comment tag. - * - * @param {String} comment comment body - * - * @return {String} - */ -JS2SVG.prototype.createComment = function(comment) { - - return this.config.commentStart + - comment + - this.config.commentEnd; - -}; - -/** - * Create CDATA section. - * - * @param {String} cdata CDATA body - * - * @return {String} - */ -JS2SVG.prototype.createCDATA = function(cdata) { - - return this.config.cdataStart + - cdata + - this.config.cdataEnd; - -}; - -/** - * Create element tag. - * - * @param {Object} data element object - * - * @return {String} - */ -JS2SVG.prototype.createElem = function(data) { - - // beautiful injection for obtaining SVG information :) - if ( - data.isElem('svg') && - data.hasAttr('width') && - data.hasAttr('height') - ) { - this.width = data.attr('width').value; - this.height = data.attr('height').value; - } - - // empty element and short tag - if (data.isEmpty()) { - - return this.createIndent() + - this.config.tagShortStart + - data.elem + - this.createAttrs(data) + - this.config.tagShortEnd; - - // non-empty element - } else { - - return this.createIndent() + - this.config.tagOpenStart + - data.elem + - this.createAttrs(data) + - this.config.tagOpenEnd + - this.convert(data).data + - this.createIndent() + - this.config.tagCloseStart + - data.elem + - this.config.tagCloseEnd; - - } - -}; - -/** - * Create element attributes. - * - * @param {Object} elem attributes object - * - * @return {String} - */ -JS2SVG.prototype.createAttrs = function(elem) { - - var attrs = ''; - - elem.eachAttr(function(attr) { - - attrs += ' ' + - attr.name + - this.config.attrStart + - attr.value + - this.config.attrEnd; - - }, this); - - return attrs; - -}; - -/** - * Create text node. - * - * @param {String} text text - * - * @return {String} - */ -JS2SVG.prototype.createText = function(text) { - - // convert entities back - for (var entity in this.config.entities) { - text = text.split(entity).join(this.config.entities[entity]); - } - - return this.createIndent() + - this.config.textStart + - text + - this.config.textEnd; - -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/jsAPI.js b/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/jsAPI.js deleted file mode 100644 index ce91713..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/jsAPI.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -var EXTEND = require('whet.extend'); - -var JSAPI = module.exports = function(data) { - - EXTEND(this, data); - -}; - -/** - * Determine if item is an element - * (any, with a specific name or in a names array). - * - * @param {String|Array} [param] element name or names arrays - * @return {Boolean} - */ -JSAPI.prototype.isElem = function(param) { - - if (!param) return !!this.elem; - - if (Array.isArray(param)) return !!this.elem && (param.indexOf(this.elem) > -1); - - return !!this.elem && this.elem === param; - -}; - -/** - * Determine if element is empty. - * - * @return {Boolean} - */ - JSAPI.prototype.isEmpty = function() { - - return !this.content || !this.content.length; - -}; - -/** - * Determine if element has an attribute - * (any, or by name or by name + value). - * - * @param {String} [name] attribute name - * @param {String} [val] attribute value (will be toString()'ed) - * @return {Boolean} - */ - JSAPI.prototype.hasAttr = function(name, val) { - - if (!this.attrs || !Object.keys(this.attrs).length) return false; - - if (!arguments.length) return !!this.attrs; - - if (val !== undefined) return !!this.attrs[name] && this.attrs[name].value === val.toString(); - - return !!this.attrs[name]; - -}; - -/** - * Get a specific attribute from an element - * (by name or name + value). - * - * @param {String} name attribute name - * @param {String} [val] attribute value (will be toString()'ed) - * @return {Object|Undefined} - */ - JSAPI.prototype.attr = function(name, val) { - - if (!this.hasAttr() || !arguments.length) return undefined; - - if (val !== undefined) return this.hasAttr(name, val) ? this.attrs[name] : undefined; - - return this.attrs[name]; - -}; - -/** - * Remove a specific attribute. - * - * @param {String} name attribute name - * @param {String} [val] attribute value - * @return {Boolean} - */ - JSAPI.prototype.removeAttr = function(name, val) { - - if (!arguments.length) return false; - - if (!this.hasAttr(name)) return false; - - if (val && this.attrs[name].value !== val) return false; - - delete this.attrs[name]; - - if (!Object.keys(this.attrs).length) delete this.attrs; - - return true; - -}; - -/** - * Add attribute. - * - * @param {Object} attr attribute object - * @return {Object} created attribute - */ - JSAPI.prototype.addAttr = function(attr) { - - if (!attr || - (attr && attr.name === undefined) || - (attr && attr.value === undefined) || - (attr && attr.prefix === undefined) || - (attr && attr.local === undefined) - ) return false; - - this.attrs = this.attrs || {}; - this.attrs[attr.name] = attr; - - return this.attrs[attr.name]; - -}; - -/** - * Iterates over all attributes. - * - * @param {Function} callback callback - * @param {Object} [context] callback context - * @return {Boolean} false if there are no any attributes - */ - JSAPI.prototype.eachAttr = function(callback, context) { - - if (!this.hasAttr()) return false; - - for (var name in this.attrs) { - callback.call(context, this.attrs[name]); - } - - return true; - -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/plugins.js b/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/plugins.js deleted file mode 100644 index 7b087ca..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/plugins.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict'; - -/** - * Plugins engine. - * - * @module plugins - * - * @param {Object} data input data - * @param {Object} plugins plugins object from config - * @return {Object} output data - */ -module.exports = function(data, plugins) { - - plugins.forEach(function(group) { - - switch(group[0].type) { - case 'perItem': - data = perItem(data, group); - break; - case 'perItemReverse': - data = perItem(data, group, true); - break; - case 'full': - data = full(data, group); - break; - } - - }); - - return data; - -}; - -/** - * Direct or reverse per-item loop. - * - * @param {Object} data input data - * @param {Array} plugins plugins list to process - * @param {Boolean} [reverse] reverse pass? - * @return {Object} output data - */ -function perItem(data, plugins, reverse) { - - function monkeys(items) { - - items.content = items.content.filter(function(item) { - - // reverse pass - if (reverse && item.content) { - monkeys(item); - } - - // main filter - var i = 0, - length = plugins.length, - filter = true; - - while(filter && i < length) { - var plugin = plugins[i]; - - if (plugin.active && plugin.fn(item, plugin.params) === false) { - filter = false; - } - - i++; - } - - // direct pass - if (!reverse && item.content) { - monkeys(item); - } - - return filter; - - }); - - return items; - - } - - return monkeys(data); - -} - -/** - * "Full" plugins. - * - * @param {Object} data input data - * @param {Array} plugins plugins list to process - * @return {Object} output data - */ -function full(data, plugins) { - - plugins.forEach(function(plugin) { - if (plugin.active) { - data = plugin.fn(data, plugin.params); - } - }); - - return data; - -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/svg2js.js b/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/svg2js.js deleted file mode 100644 index abb484a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/svg2js.js +++ /dev/null @@ -1,133 +0,0 @@ -'use strict'; - -var SAX = require('sax'), - JSAPI = require('./jsAPI'); - -var config = { - strict: true, - trim: true, - normalize: true, - lowercase: true, - xmlns: true, - position: false -}; - -/** - * Convert SVG (XML) string to SVG-as-JS object. - * - * @param {String} data input data - * @param {Function} callback - */ -module.exports = function(data, callback) { - - var sax = SAX.parser(config.strict, config), - root = {}, - current = root, - stack = []; - - function pushToContent(content) { - - content = new JSAPI(content); - - (current.content = current.content || []).push(content); - - return content; - - } - - sax.ondoctype = function(doctype) { - - pushToContent({ - doctype: doctype - }); - - }; - - sax.onprocessinginstruction = function(data) { - - pushToContent({ - processinginstruction: data - }); - - }; - - sax.oncomment = function(comment) { - - pushToContent({ - comment: comment - }); - - }; - - sax.oncdata = function(cdata) { - - pushToContent({ - cdata: cdata - }); - - }; - - sax.onopentag = function(data) { - - var elem = { - elem: data.name, - prefix: data.prefix, - local: data.local - }; - - if (Object.keys(data.attributes).length) { - elem.attrs = {}; - - for (var name in data.attributes) { - elem.attrs[name] = { - name: name, - value: data.attributes[name].value, - prefix: data.attributes[name].prefix, - local: data.attributes[name].local - }; - } - } - - elem = pushToContent(elem); - current = elem; - - stack.push(elem); - - }; - - sax.ontext = function(text) { - - pushToContent({ - text: text - }); - - }; - - sax.onclosetag = function() { - - stack.pop(); - current = stack[stack.length - 1]; - - }; - - sax.onerror = function(e) { - - // https://github.com/isaacs/sax-js#events - // "The error will be hanging out on parser.error, - // and must be deleted before parsing can continue" - this.error = null; - - callback({ error: e.message }); - throw new Error(e.message); - - }; - - sax.onend = function() { - - callback(root); - - }; - - sax.write(data).close(); - -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/tools.js b/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/tools.js deleted file mode 100644 index 9c8eb84..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/lib/svgo/tools.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -/** - * Encode plain SVG data string into Data URI string. - * - * @param {String} str input string - * @param {String} type Data URI type - * @return {String} output string - */ -exports.encodeSVGDatauri = function(str, type) { - - var prefix = 'data:image/svg+xml'; - - // base64 - if (!type || type === 'base64') { - - prefix += ';base64,'; - - str = prefix + new Buffer(str).toString('base64'); - - // URI encoded - } else if (type === 'enc') { - - str = prefix + ',' + encodeURIComponent(str); - - // unencoded - } else if (type === 'unenc') { - - str = prefix + ',' + str; - - } - - return str; - -}; - -/** - * Decode SVG Data URI string into plain SVG string. - * - * @param {string} str input string - * @return {String} output string - */ -exports.decodeSVGDatauri = function(str) { - - var prefix = 'data:image/svg+xml'; - - // base64 - if (str.substring(0, 26) === (prefix + ';base64,')) { - - str = new Buffer(str.substring(26), 'base64').toString('utf8'); - - // URI encoded - } else if (str.substring(0, 20) === (prefix + ',%')) { - - str = decodeURIComponent(str.substring(19)); - - // unencoded - } else if (str.substring(0, 20) === (prefix + ',<')) { - - str = str.substring(19); - - } - - return str; - -}; - -exports.flattenOneLevel = function(array) { - var result = []; - - array.forEach(function(item) { - Array.prototype.push.apply( - result, - Array.isArray(item) ? item : [item] - ); - }); - - return result; -}; - -exports.intersectArrays = function(a, b) { - return a.filter(function(n) { - return b.indexOf(n) > -1; - }); -}; - -exports.cleanupOutData = function(data, params) { - - var str = '', - delimiter, - prev; - - data.forEach(function(item, i) { - - // space delimiter by default - delimiter = ' '; - - // no extra space in front of first number - if (i === 0) { - delimiter = ''; - } - - // no extra space in front of negative number or - // in front of a floating number if a previous number is floating too - if ( - params.negativeExtraSpace && - (item < 0 || - (item > 0 && item < 1 && prev % 1 !== 0) - ) - ) { - delimiter = ''; - } - - // save prev item value - prev = item; - - // remove floating-point numbers leading zeros - // 0.5 → .5 - // -0.5 → -.5 - if (params.leadingZero) { - item = removeLeadingZero(item); - } - - str += delimiter + item; - - }); - - return str; - -}; - -/** - * Remove floating-point numbers leading zero. - * - * @example - * 0.5 → .5 - * - * @example - * -0.5 → -.5 - * - * @param {Float} num input number - * - * @return {String} output number as string - */ -var removeLeadingZero = exports.removeLeadingZero = function(num) { - - if (num > 0 && num < 1) { - num = ('' + num).slice(1); - } else if (num < 0 && num > -1) { - num = '-' + ('' + num).slice(2); - } - - return num; - -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/.bin/js-yaml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/.bin/js-yaml deleted file mode 120000 index 9dbd010..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/.bin/js-yaml +++ /dev/null @@ -1 +0,0 @@ -../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/.npmignore b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/.npmignore deleted file mode 100644 index e7559d1..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.idea -*.iml -node_modules/ -lib-cov/ -html-report/ diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/.travis.yml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/.travis.yml deleted file mode 100644 index 30d2ca1..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js - -node_js: - - 0.6 - - 0.8 - - 0.9 - -matrix: - allow_failures: - - node_js: 0.9 diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/GNUmakefile b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/GNUmakefile deleted file mode 100644 index 51db7b6..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/GNUmakefile +++ /dev/null @@ -1,34 +0,0 @@ -BIN = ./node_modules/.bin - -.PHONY: all -all: lib - -lib: $(foreach s,$(wildcard src/*.coffee),$(patsubst src/%.coffee,lib/%.js,$s)) - -lib-cov: clean-coverage lib - $(BIN)/istanbul instrument --output lib-cov --no-compact --variable global.__coverage__ lib - -lib/%.js: src/%.coffee - $(BIN)/coffee -cb -o $(@D) $< - -.PHONY: test -test: lib - $(BIN)/mocha - -.PHONY: coverage -coverage: lib-cov - COVER=1 $(BIN)/mocha --reporter mocha-istanbul - @echo - @echo Open html-report/index.html file in your browser - -.PHONY: watch -watch: - $(BIN)/coffee --watch --bare --output lib src/*.coffee - -.PHONY: clean -clean: clean-coverage - -.PHONY: clean-coverage -clean-coverage: - -rm -rf lib-cov - -rm -rf html-report diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/README.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/README.md deleted file mode 100644 index fb593c6..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/README.md +++ /dev/null @@ -1,317 +0,0 @@ -# Command-Option-Argument -[![build status](https://secure.travis-ci.org/veged/coa.png)](http://travis-ci.org/veged/coa) - -## What is it? - -COA is a parser for command line options that aim to get maximum profit from formalization your program API. -Once you write definition in terms of commands, options and arguments you automaticaly get: - -* Command line help text -* Program API for use COA-based programs as modules -* Shell completion - -### Other features - -* Rich types for options and arguments, such as arrays, boolean flags and required -* Commands can be async throught using promising (powered by [Q](https://github.com/kriskowal/q)) -* Easy submoduling some existing commands to new top-level one -* Combined validation and complex parsing of values - -### TODO - -* Localization -* Shell-mode -* Configs - * Aliases - * Defaults - -## Examples - -````javascript -require('coa').Cmd() // main (top level) command declaration - .name(process.argv[1]) // set top level command name from program name - .title('My awesome command line util') // title for use in text messages - .helpful() // make command "helpful", i.e. options -h --help with usage message - .opt() // add some option - .name('version') // name for use in API - .title('Version') // title for use in text messages - .short('v') // short key: -v - .long('version') // long key: --version - .flag() // for options without value - .act(function(opts) { // add action for option - // return message as result of action - return JSON.parse(require('fs').readFileSync(__dirname + '/package.json')) - .version; - }) - .end() // end option chain and return to main command - .cmd().name('subcommand').apply(require('./subcommand').COA).end() // load subcommand from module - .cmd() // inplace subcommand declaration - .name('othercommand').title('Awesome other subcommand').helpful() - .opt() - .name('input').title('input file, required') - .short('i').long('input') - .val(function(v) { // validator function, also for translate simple values - return require('fs').createReadStream(v) }) - .req() // make option required - .end() // end option chain and return to command - .end() // end subcommand chain and return to parent command - .run(process.argv.slice(2)); // parse and run on process.argv -```` - -````javascript -// subcommand.js -exports.COA = function() { - this - .title('Awesome subcommand').helpful() - .opt() - .name('output').title('output file') - .short('o').long('output') - .output() // use default preset for "output" option declaration - .end() -}; -```` - -## API reference - -### Cmd -Command is a top level entity. Commands may have options and arguments. - -#### Cmd.api -Returns object containing all its subcommands as methods to use from other programs.
                  -**@returns** *{Object}* - -#### Cmd.name -Set a canonical command identifier to be used anywhere in the API.
                  -**@param** *String* `_name` command name
                  -**@returns** *COA.Cmd* `this` instance (for chainability) - -#### Cmd.title -Set a long description for command to be used anywhere in text messages.
                  -**@param** *String* `_title` command title
                  -**@returns** *COA.Cmd* `this` instance (for chainability) - -#### Cmd.cmd -Create new or add existing subcommand for current command.
                  -**@param** *COA.Cmd* `[cmd]` existing command instance
                  -**@returns** *COA.Cmd* new or added subcommand instance - -#### Cmd.opt -Create option for current command.
                  -**@returns** *COA.Opt* `new` option instance - -#### Cmd.arg -Create argument for current command.
                  -**@returns** *COA.Opt* `new` argument instance - -#### Cmd.act -Add (or set) action for current command.
                  -**@param** *Function* `act` action function, - invoked in the context of command instance - and has the parameters:
                  - - *Object* `opts` parsed options
                  - - *Array* `args` parsed arguments
                  - - *Object* `res` actions result accumulator
                  - It can return rejected promise by Cmd.reject (in case of error) - or any other value treated as result.
                  -**@param** *{Boolean}* [force=false] flag for set action instead add to existings
                  -**@returns** *COA.Cmd* `this` instance (for chainability) - -#### Cmd.apply -Apply function with arguments in context of command instance.
                  -**@param** *Function* `fn`
                  -**@param** *Array* `args`
                  -**@returns** *COA.Cmd* `this` instance (for chainability) - -#### Cmd.comp -Set custom additional completion for current command.
                  -**@param** *Function* `fn` completion generation function, - invoked in the context of command instance. - Accepts parameters:
                  - - *Object* `opts` completion options
                  - It can return promise or any other value treated as result.
                  -**@returns** *COA.Cmd* `this` instance (for chainability) - -#### Cmd.helpful -Make command "helpful", i.e. add -h --help flags for print usage.
                  -**@returns** *COA.Cmd* `this` instance (for chainability) - -#### Cmd.completable -Adds shell completion to command, adds "completion" subcommand, that makes all the magic.
                  -Must be called only on root command.
                  -**@returns** *COA.Cmd* `this` instance (for chainability) - -#### Cmd.usage -Build full usage text for current command instance.
                  -**@returns** *String* `usage` text - -#### Cmd.run -Parse arguments from simple format like NodeJS process.argv -and run ahead current program, i.e. call process.exit when all actions done.
                  -**@param** *Array* `argv`
                  -**@returns** *COA.Cmd* `this` instance (for chainability) - -#### Cmd.invoke -Invoke specified (or current) command using provided options and arguments.
                  -**@param** *String|Array* `cmds` subcommand to invoke (optional)
                  -**@param** *Object* `opts` command options (optional)
                  -**@param** *Object* `args` command arguments (optional)
                  -**@returns** *Q.Promise* - -#### Cmd.reject -Return reject of actions results promise.
                  -Use in .act() for return with error.
                  -**@param** *Object* `reason` reject reason
                  - You can customize toString() method and exitCode property - of reason object.
                  -**@returns** *Q.promise* rejected promise - -#### Cmd.end -Finish chain for current subcommand and return parent command instance.
                  -**@returns** *COA.Cmd* `parent` command - -### Opt -Option is a named entity. Options may have short and long keys for use from command line.
                  -**@namespace**
                  -**@class** Presents option - -#### Opt.name -Set a canonical option identifier to be used anywhere in the API.
                  -**@param** *String* `_name` option name
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.title -Set a long description for option to be used anywhere in text messages.
                  -**@param** *String* `_title` option title
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.short -Set a short key for option to be used with one hyphen from command line.
                  -**@param** *String* `_short`
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.long -Set a short key for option to be used with double hyphens from command line.
                  -**@param** *String* `_long`
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.flag -Make an option boolean, i.e. option without value.
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.arr -Makes an option accepts multiple values.
                  -Otherwise, the value will be used by the latter passed.
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.req -Makes an option req.
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.only -Makes an option to act as a command, -i.e. program will exit just after option action.
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.val -Set a validation (or value) function for argument.
                  -Value from command line passes through before becoming available from API.
                  -Using for validation and convertion simple types to any values.
                  -**@param** *Function* `_val` validating function, - invoked in the context of option instance - and has one parameter with value from command line
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.def -Set a default value for option. -Default value passed through validation function as ordinary value.
                  -**@param** *Object* `_def`
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.output -Make option value outputing stream.
                  -It's add useful validation and shortcut for STDOUT.
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.act -Add action for current option command. -This action is performed if the current option -is present in parsed options (with any value).
                  -**@param** *Function* `act` action function, - invoked in the context of command instance - and has the parameters:
                  - - *Object* `opts` parsed options
                  - - *Array* `args` parsed arguments
                  - - *Object* `res` actions result accumulator
                  - It can return rejected promise by Cmd.reject (in case of error) - or any other value treated as result.
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.comp -Set custom additional completion for current option.
                  -**@param** *Function* `fn` completion generation function, - invoked in the context of command instance. - Accepts parameters:
                  - - *Object* `opts` completion options
                  - It can return promise or any other value treated as result.
                  -**@returns** *COA.Opt* `this` instance (for chainability) - -#### Opt.end -Finish chain for current option and return parent command instance.
                  -**@returns** *COA.Cmd* `parent` command - - -### Arg -Argument is a unnamed entity.
                  -From command line arguments passed as list of unnamed values. - -#### Arg.name -Set a canonical argument identifier to be used anywhere in text messages.
                  -**@param** *String* `_name` argument name
                  -**@returns** *COA.Arg* `this` instance (for chainability) - -#### Arg.title -Set a long description for argument to be used anywhere in text messages.
                  -**@param** *String* `_title` argument title
                  -**@returns** *COA.Arg* `this` instance (for chainability) - -#### Arg.arr -Makes an argument accepts multiple values.
                  -Otherwise, the value will be used by the latter passed.
                  -**@returns** *COA.Arg* `this` instance (for chainability) - -#### Arg.req -Makes an argument req.
                  -**@returns** *COA.Arg* `this` instance (for chainability) - -#### Arg.val -Set a validation (or value) function for argument.
                  -Value from command line passes through before becoming available from API.
                  -Using for validation and convertion simple types to any values.
                  -**@param** *Function* `_val` validating function, - invoked in the context of argument instance - and has one parameter with value from command line
                  -**@returns** *COA.Arg* `this` instance (for chainability) - -#### Arg.def -Set a default value for argument. -Default value passed through validation function as ordinary value.
                  -**@param** *Object* `_def`
                  -**@returns** *COA.Arg* `this` instance (for chainability) - -#### Arg.output -Make argument value outputing stream.
                  -It's add useful validation and shortcut for STDOUT.
                  -**@returns** *COA.Arg* `this` instance (for chainability) - -#### Opt.comp -Set custom additional completion for current argument.
                  -**@param** *Function* `fn` completion generation function, - invoked in the context of command instance. - Accepts parameters:
                  - - *Object* `opts` completion options
                  - It can return promise or any other value treated as result.
                  -**@returns** *COA.Arg* `this` instance (for chainability) - -#### Arg.end -Finish chain for current option and return parent command instance.
                  -**@returns** *COA.Cmd* `parent` command diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/index.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/index.js deleted file mode 100644 index 76c1c3a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require(process.env.COVER? './lib-cov' : './lib'); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/arg.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/arg.js deleted file mode 100644 index 2c6526f..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/arg.js +++ /dev/null @@ -1,175 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -var Arg, Cmd, Color, Opt; - -Color = require('./color').Color; - -Cmd = require('./cmd').Cmd; - -Opt = require('./opt').Opt; - -/** -Argument - -Unnamed entity. From command line arguments passed as list of unnamed values. -@namespace -@class Presents argument -*/ - - -exports.Arg = Arg = (function() { - /** - @constructs - @param {COA.Cmd} cmd parent command - */ - - function Arg(_cmd) { - this._cmd = _cmd; - this._cmd._args.push(this); - } - - /** - Set a canonical argument identifier to be used anywhere in text messages. - @param {String} _name argument name - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.name = Opt.prototype.name; - - /** - Set a long description for argument to be used anywhere in text messages. - @param {String} _title argument title - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.title = Cmd.prototype.title; - - /** - Makes an argument accepts multiple values. - Otherwise, the value will be used by the latter passed. - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.arr = Opt.prototype.arr; - - /** - Makes an argument required. - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.req = Opt.prototype.req; - - /** - Set a validation (or value) function for argument. - Value from command line passes through before becoming available from API. - Using for validation and convertion simple types to any values. - @param {Function} _val validating function, - invoked in the context of argument instance - and has one parameter with value from command line - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.val = Opt.prototype.val; - - /** - Set a default value for argument. - Default value passed through validation function as ordinary value. - @param {Object} _def - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.def = Opt.prototype.def; - - /** - Set custom additional completion for current argument. - @param {Function} completion generation function, - invoked in the context of argument instance. - Accepts parameters: - - {Object} opts completion options - It can return promise or any other value treated as result. - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.comp = Cmd.prototype.comp; - - /** - Make argument value inputting stream. - It's add useful validation and shortcut for STDIN. - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.input = Opt.prototype.input; - - /** - Make argument value outputing stream. - It's add useful validation and shortcut for STDOUT. - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.output = Opt.prototype.output; - - Arg.prototype._parse = function(arg, args) { - return this._saveVal(args, arg); - }; - - Arg.prototype._saveVal = Opt.prototype._saveVal; - - Arg.prototype._checkParsed = function(opts, args) { - return !args.hasOwnProperty(this._name); - }; - - Arg.prototype._usage = function() { - var res; - res = []; - res.push(Color('lpurple', this._name.toUpperCase()), ' : ', this._title); - if (this._req) { - res.push(' ', Color('lred', '(required)')); - } - return res.join(''); - }; - - Arg.prototype._requiredText = function() { - return 'Missing required argument:\n ' + this._usage(); - }; - - /** - Return rejected promise with error code. - Use in .val() for return with error. - @param {Object} reject reason - You can customize toString() method and exitCode property - of reason object. - @returns {Q.promise} rejected promise - */ - - - Arg.prototype.reject = Cmd.prototype.reject; - - /** - Finish chain for current option and return parent command instance. - @returns {COA.Cmd} parent command - */ - - - Arg.prototype.end = Cmd.prototype.end; - - /** - Apply function with arguments in context of arg instance. - @param {Function} fn - @param {Array} args - @returns {COA.Arg} this instance (for chainability) - */ - - - Arg.prototype.apply = Cmd.prototype.apply; - - return Arg; - -})(); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/cmd.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/cmd.js deleted file mode 100644 index d8fea74..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/cmd.js +++ /dev/null @@ -1,551 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -var Cmd, Color, PATH, Q, UTIL, - __slice = [].slice; - -UTIL = require('util'); - -PATH = require('path'); - -Color = require('./color').Color; - -Q = require('q'); - -/** -Command - -Top level entity. Commands may have options and arguments. -@namespace -@class Presents command -*/ - - -exports.Cmd = Cmd = (function() { - /** - @constructs - @param {COA.Cmd} [cmd] parent command - */ - - function Cmd(cmd) { - if (!(this instanceof Cmd)) { - return new Cmd(cmd); - } - this._parent(cmd); - this._cmds = []; - this._cmdsByName = {}; - this._opts = []; - this._optsByKey = {}; - this._args = []; - } - - Cmd.get = function(propertyName, func) { - return Object.defineProperty(this.prototype, propertyName, { - configurable: true, - enumerable: true, - get: func - }); - }; - - /** - Returns object containing all its subcommands as methods - to use from other programs. - @returns {Object} - */ - - - Cmd.get('api', function() { - var c, _fn, - _this = this; - if (!this._api) { - this._api = function() { - return _this.invoke.apply(_this, arguments); - }; - } - _fn = function(c) { - return _this._api[c] = _this._cmdsByName[c].api; - }; - for (c in this._cmdsByName) { - _fn(c); - } - return this._api; - }); - - Cmd.prototype._parent = function(cmd) { - if (cmd) { - cmd._cmds.push(this); - } - this._cmd = cmd || this; - return this; - }; - - /** - Set a canonical command identifier to be used anywhere in the API. - @param {String} _name command name - @returns {COA.Cmd} this instance (for chainability) - */ - - - Cmd.prototype.name = function(_name) { - this._name = _name; - if (this._cmd !== this) { - this._cmd._cmdsByName[_name] = this; - } - return this; - }; - - /** - Set a long description for command to be used anywhere in text messages. - @param {String} _title command title - @returns {COA.Cmd} this instance (for chainability) - */ - - - Cmd.prototype.title = function(_title) { - this._title = _title; - return this; - }; - - /** - Create new or add existing subcommand for current command. - @param {COA.Cmd} [cmd] existing command instance - @returns {COA.Cmd} new subcommand instance - */ - - - Cmd.prototype.cmd = function(cmd) { - if (cmd) { - return cmd._parent(this); - } else { - return new Cmd(this); - } - }; - - /** - Create option for current command. - @returns {COA.Opt} new option instance - */ - - - Cmd.prototype.opt = function() { - return new (require('./opt').Opt)(this); - }; - - /** - Create argument for current command. - @returns {COA.Opt} new argument instance - */ - - - Cmd.prototype.arg = function() { - return new (require('./arg').Arg)(this); - }; - - /** - Add (or set) action for current command. - @param {Function} act action function, - invoked in the context of command instance - and has the parameters: - - {Object} opts parsed options - - {Array} args parsed arguments - - {Object} res actions result accumulator - It can return rejected promise by Cmd.reject (in case of error) - or any other value treated as result. - @param {Boolean} [force=false] flag for set action instead add to existings - @returns {COA.Cmd} this instance (for chainability) - */ - - - Cmd.prototype.act = function(act, force) { - if (!act) { - return this; - } - if (!force && this._act) { - this._act.push(act); - } else { - this._act = [act]; - } - return this; - }; - - /** - Set custom additional completion for current command. - @param {Function} completion generation function, - invoked in the context of command instance. - Accepts parameters: - - {Object} opts completion options - It can return promise or any other value treated as result. - @returns {COA.Cmd} this instance (for chainability) - */ - - - Cmd.prototype.comp = function(_comp) { - this._comp = _comp; - return this; - }; - - /** - Apply function with arguments in context of command instance. - @param {Function} fn - @param {Array} args - @returns {COA.Cmd} this instance (for chainability) - */ - - - Cmd.prototype.apply = function() { - var args, fn; - fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - fn.apply(this, args); - return this; - }; - - /** - Make command "helpful", i.e. add -h --help flags for print usage. - @returns {COA.Cmd} this instance (for chainability) - */ - - - Cmd.prototype.helpful = function() { - return this.opt().name('help').title('Help').short('h').long('help').flag().only().act(function() { - return this.usage(); - }).end(); - }; - - /** - Adds shell completion to command, adds "completion" subcommand, - that makes all the magic. - Must be called only on root command. - @returns {COA.Cmd} this instance (for chainability) - */ - - - Cmd.prototype.completable = function() { - return this.cmd().name('completion').apply(require('./completion')).end(); - }; - - Cmd.prototype._exit = function(msg, code) { - return process.once('exit', function() { - if (msg) { - UTIL.error(msg); - } - return process.exit(code || 0); - }); - }; - - /** - Build full usage text for current command instance. - @returns {String} usage text - */ - - - Cmd.prototype.usage = function() { - var res; - res = []; - if (this._title) { - res.push(this._fullTitle()); - } - res.push('', 'Usage:'); - if (this._cmds.length) { - res.push(['', '', Color('lred', this._fullName()), Color('lblue', 'COMMAND'), Color('lgreen', '[OPTIONS]'), Color('lpurple', '[ARGS]')].join(' ')); - } - if (this._opts.length + this._args.length) { - res.push(['', '', Color('lred', this._fullName()), Color('lgreen', '[OPTIONS]'), Color('lpurple', '[ARGS]')].join(' ')); - } - res.push(this._usages(this._cmds, 'Commands'), this._usages(this._opts, 'Options'), this._usages(this._args, 'Arguments')); - return res.join('\n'); - }; - - Cmd.prototype._usage = function() { - return Color('lblue', this._name) + ' : ' + this._title; - }; - - Cmd.prototype._usages = function(os, title) { - var o, res, _i, _len; - if (!os.length) { - return; - } - res = ['', title + ':']; - for (_i = 0, _len = os.length; _i < _len; _i++) { - o = os[_i]; - res.push(' ' + o._usage()); - } - return res.join('\n'); - }; - - Cmd.prototype._fullTitle = function() { - return (this._cmd === this ? '' : this._cmd._fullTitle() + '\n') + this._title; - }; - - Cmd.prototype._fullName = function() { - return (this._cmd === this ? '' : this._cmd._fullName() + ' ') + PATH.basename(this._name); - }; - - Cmd.prototype._ejectOpt = function(opts, opt) { - var pos; - if ((pos = opts.indexOf(opt)) >= 0) { - if (opts[pos]._arr) { - return opts[pos]; - } else { - return opts.splice(pos, 1)[0]; - } - } - }; - - Cmd.prototype._checkRequired = function(opts, args) { - var all, i; - if (!(this._opts.filter(function(o) { - return o._only && o._name in opts; - })).length) { - all = this._opts.concat(this._args); - while (i = all.shift()) { - if (i._req && i._checkParsed(opts, args)) { - return this.reject(i._requiredText()); - } - } - } - }; - - Cmd.prototype._parseCmd = function(argv, unparsed) { - var cmd, i, optSeen; - if (unparsed == null) { - unparsed = []; - } - argv = argv.concat(); - optSeen = false; - while (i = argv.shift()) { - if (!i.indexOf('-')) { - optSeen = true; - } - if (!optSeen && /^\w[\w-_]*$/.test(i) && (cmd = this._cmdsByName[i])) { - return cmd._parseCmd(argv, unparsed); - } - unparsed.push(i); - } - return { - cmd: this, - argv: unparsed - }; - }; - - Cmd.prototype._parseOptsAndArgs = function(argv) { - var a, arg, args, i, m, nonParsedArgs, nonParsedOpts, opt, opts, res; - opts = {}; - args = {}; - nonParsedOpts = this._opts.concat(); - nonParsedArgs = this._args.concat(); - while (i = argv.shift()) { - if (i !== '--' && !i.indexOf('-')) { - if (m = i.match(/^(--\w[\w-_]*)=(.*)$/)) { - i = m[1]; - if (!this._optsByKey[i]._flag) { - argv.unshift(m[2]); - } - } - if (opt = this._ejectOpt(nonParsedOpts, this._optsByKey[i])) { - if (Q.isRejected(res = opt._parse(argv, opts))) { - return res; - } - } else { - return this.reject("Unknown option: " + i); - } - } else { - if (i === '--') { - i = argv.splice(0); - } - i = Array.isArray(i) ? i : [i]; - while (a = i.shift()) { - if (arg = nonParsedArgs.shift()) { - if (arg._arr) { - nonParsedArgs.unshift(arg); - } - if (Q.isRejected(res = arg._parse(a, args))) { - return res; - } - } else { - return this.reject("Unknown argument: " + a); - } - } - } - } - return { - opts: this._setDefaults(opts, nonParsedOpts), - args: this._setDefaults(args, nonParsedArgs) - }; - }; - - Cmd.prototype._setDefaults = function(params, desc) { - var i, _i, _len; - for (_i = 0, _len = desc.length; _i < _len; _i++) { - i = desc[_i]; - if (!(i._name in params) && '_def' in i) { - i._saveVal(params, i._def); - } - } - return params; - }; - - Cmd.prototype._processParams = function(params, desc) { - var i, n, notExists, res, v, vals, _i, _j, _len, _len1; - notExists = []; - for (_i = 0, _len = desc.length; _i < _len; _i++) { - i = desc[_i]; - n = i._name; - if (!(n in params)) { - notExists.push(i); - continue; - } - vals = params[n]; - delete params[n]; - if (!Array.isArray(vals)) { - vals = [vals]; - } - for (_j = 0, _len1 = vals.length; _j < _len1; _j++) { - v = vals[_j]; - if (Q.isRejected(res = i._saveVal(params, v))) { - return res; - } - } - } - return this._setDefaults(params, notExists); - }; - - Cmd.prototype._parseArr = function(argv) { - return Q.when(this._parseCmd(argv), function(p) { - return Q.when(p.cmd._parseOptsAndArgs(p.argv), function(r) { - return { - cmd: p.cmd, - opts: r.opts, - args: r.args - }; - }); - }); - }; - - Cmd.prototype._do = function(input) { - var _this = this; - return Q.when(input, function(input) { - var cmd; - cmd = input.cmd; - return [_this._checkRequired].concat(cmd._act || []).reduce(function(res, act) { - return Q.when(res, function(res) { - return act.call(cmd, input.opts, input.args, res); - }); - }, void 0); - }); - }; - - /** - Parse arguments from simple format like NodeJS process.argv - and run ahead current program, i.e. call process.exit when all actions done. - @param {Array} argv - @returns {COA.Cmd} this instance (for chainability) - */ - - - Cmd.prototype.run = function(argv) { - var cb, - _this = this; - if (argv == null) { - argv = process.argv.slice(2); - } - cb = function(code) { - return function(res) { - var _ref, _ref1; - if (res) { - return _this._exit((_ref = res.stack) != null ? _ref : res.toString(), (_ref1 = res.exitCode) != null ? _ref1 : code); - } else { - return _this._exit(); - } - }; - }; - Q.when(this["do"](argv), cb(0), cb(1)).done(); - return this; - }; - - /** - Convenient function to run command from tests. - @param {Array} argv - @returns {Q.Promise} - */ - - - Cmd.prototype["do"] = function(argv) { - return this._do(this._parseArr(argv || [])); - }; - - /** - Invoke specified (or current) command using provided - options and arguments. - @param {String|Array} cmds subcommand to invoke (optional) - @param {Object} opts command options (optional) - @param {Object} args command arguments (optional) - @returns {Q.Promise} - */ - - - Cmd.prototype.invoke = function(cmds, opts, args) { - var _this = this; - if (cmds == null) { - cmds = []; - } - if (opts == null) { - opts = {}; - } - if (args == null) { - args = {}; - } - if (typeof cmds === 'string') { - cmds = cmds.split(' '); - } - if (arguments.length < 3) { - if (!Array.isArray(cmds)) { - args = opts; - opts = cmds; - cmds = []; - } - } - return Q.when(this._parseCmd(cmds), function(p) { - if (p.argv.length) { - return _this.reject("Unknown command: " + cmds.join(' ')); - } - return Q.all([_this._processParams(opts, _this._opts), _this._processParams(args, _this._args)]).spread(function(opts, args) { - return _this._do({ - cmd: p.cmd, - opts: opts, - args: args - }).fail(function(res) { - if (res && res.exitCode === 0) { - return res.toString(); - } else { - return _this.reject(res); - } - }); - }); - }); - }; - - /** - Return reject of actions results promise with error code. - Use in .act() for return with error. - @param {Object} reject reason - You can customize toString() method and exitCode property - of reason object. - @returns {Q.promise} rejected promise - */ - - - Cmd.prototype.reject = function(reason) { - return Q.reject(reason); - }; - - /** - Finish chain for current subcommand and return parent command instance. - @returns {COA.Cmd} parent command - */ - - - Cmd.prototype.end = function() { - return this._cmd; - }; - - return Cmd; - -})(); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/color.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/color.js deleted file mode 100644 index 25e275b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/color.js +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -var colors; - -colors = { - black: '30', - dgray: '1;30', - red: '31', - lred: '1;31', - green: '32', - lgreen: '1;32', - brown: '33', - yellow: '1;33', - blue: '34', - lblue: '1;34', - purple: '35', - lpurple: '1;35', - cyan: '36', - lcyan: '1;36', - lgray: '37', - white: '1;37' -}; - -exports.Color = function(c, str) { - return ['\x1B[', colors[c], 'm', str, '\x1B[m'].join(''); -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/completion.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/completion.js deleted file mode 100644 index 58ecefc..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/completion.js +++ /dev/null @@ -1,134 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -/** -Most of the code adopted from the npm package shell completion code. -See https://github.com/isaacs/npm/blob/master/lib/completion.js -*/ - -var Q, complete, dumpScript, escape, getOpts, unescape; - -Q = require('q'); - -escape = require('./shell').escape; - -unescape = require('./shell').unescape; - -module.exports = function() { - return this.title('Shell completion').helpful().arg().name('raw').title('Completion words').arr().end().act(function(opts, args) { - var argv, cmd, e, _ref; - if (process.platform === 'win32') { - e = new Error('shell completion not supported on windows'); - e.code = 'ENOTSUP'; - e.errno = require('constants').ENOTSUP; - return this.reject(e); - } - if (!(process.env.COMP_CWORD != null) || !(process.env.COMP_LINE != null) || !(process.env.COMP_POINT != null)) { - return dumpScript(this._cmd._name); - } - console.error('COMP_LINE: %s', process.env.COMP_LINE); - console.error('COMP_CWORD: %s', process.env.COMP_CWORD); - console.error('COMP_POINT: %s', process.env.COMP_POINT); - console.error('args: %j', args.raw); - opts = getOpts(args.raw); - _ref = this._cmd._parseCmd(opts.partialWords), cmd = _ref.cmd, argv = _ref.argv; - return Q.when(complete(cmd, opts), function(compls) { - console.error('filtered: %j', compls); - return console.log(compls.map(escape).join('\n')); - }); - }); -}; - -dumpScript = function(name) { - var defer, fs, path; - fs = require('fs'); - path = require('path'); - defer = Q.defer(); - fs.readFile(path.resolve(__dirname, 'completion.sh'), 'utf8', function(err, d) { - var onError; - if (err) { - return defer.reject(err); - } - d = d.replace(/{{cmd}}/g, path.basename(name)).replace(/^\#\!.*?\n/, ''); - onError = function(err) { - if (err.errno === require('constants').EPIPE) { - process.stdout.removeListener('error', onError); - return defer.resolve(); - } else { - return defer.reject(err); - } - }; - process.stdout.on('error', onError); - return process.stdout.write(d, function() { - return defer.resolve(); - }); - }); - return defer.promise; -}; - -getOpts = function(argv) { - var i, line, partialLine, partialWord, partialWords, point, w, word, words; - line = process.env.COMP_LINE; - w = +process.env.COMP_CWORD; - point = +process.env.COMP_POINT; - words = argv.map(unescape); - word = words[w]; - partialLine = line.substr(0, point); - partialWords = words.slice(0, w); - partialWord = argv[w] || ''; - i = partialWord.length; - while (partialWord.substr(0, i) !== partialLine.substr(-1 * i) && i > 0) { - i--; - } - partialWord = unescape(partialWord.substr(0, i)); - if (partialWord) { - partialWords.push(partialWord); - } - return { - line: line, - w: w, - point: point, - words: words, - word: word, - partialLine: partialLine, - partialWords: partialWords, - partialWord: partialWord - }; -}; - -complete = function(cmd, opts) { - var compls, m, o, opt, optPrefix, optWord; - compls = []; - if (opts.partialWord.indexOf('-')) { - compls = Object.keys(cmd._cmdsByName); - } else { - if (m = opts.partialWord.match(/^(--\w[\w-_]*)=(.*)$/)) { - optWord = m[1]; - optPrefix = optWord + '='; - } else { - compls = Object.keys(cmd._optsByKey); - } - } - if (!(o = opts.partialWords[opts.w - 1]).indexOf('-')) { - optWord = o; - } - if (optWord && (opt = cmd._optsByKey[optWord])) { - if (!opt._flag && opt._comp) { - compls = Q.join(compls, Q.when(opt._comp(opts), function(c, o) { - return c.concat(o.map(function(v) { - return (optPrefix || '') + v; - })); - })); - } - } - if (cmd._comp) { - compls = Q.join(compls, Q.when(cmd._comp(opts)), function(c, o) { - return c.concat(o); - }); - } - return Q.when(compls, function(compls) { - console.error('partialWord: %s', opts.partialWord); - console.error('compls: %j', compls); - return compls.filter(function(c) { - return c.indexOf(opts.partialWord) === 0; - }); - }); -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/completion.sh b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/completion.sh deleted file mode 100644 index 6d15c87..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/completion.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -###-begin-{{cmd}}-completion-### -# -# {{cmd}} command completion script -# -# Installation: {{cmd}} completion >> ~/.bashrc (or ~/.zshrc) -# Or, maybe: {{cmd}} completion > /usr/local/etc/bash_completion.d/{{cmd}} -# - -COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} -COMP_WORDBREAKS=${COMP_WORDBREAKS/@/} -export COMP_WORDBREAKS - -if complete &>/dev/null; then - _{{cmd}}_completion () { - local si="$IFS" - IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \ - COMP_LINE="$COMP_LINE" \ - COMP_POINT="$COMP_POINT" \ - {{cmd}} completion -- "${COMP_WORDS[@]}" \ - 2>/dev/null)) || return $? - IFS="$si" - } - complete -F _{{cmd}}_completion {{cmd}} -elif compctl &>/dev/null; then - _{{cmd}}_completion () { - local cword line point words si - read -Ac words - read -cn cword - let cword-=1 - read -l line - read -ln point - si="$IFS" - IFS=$'\n' reply=($(COMP_CWORD="$cword" \ - COMP_LINE="$line" \ - COMP_POINT="$point" \ - {{cmd}} completion -- "${words[@]}" \ - 2>/dev/null)) || return $? - IFS="$si" - } - compctl -K _{{cmd}}_completion {{cmd}} -fi -###-end-{{cmd}}-completion-### diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/index.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/index.js deleted file mode 100644 index 8856a2d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/index.js +++ /dev/null @@ -1,7 +0,0 @@ -// Generated by CoffeeScript 1.4.0 - -exports.Cmd = require('./cmd').Cmd; - -exports.shell = require('./shell'); - -exports.require = require; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/opt.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/opt.js deleted file mode 100644 index 5c890e8..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/opt.js +++ /dev/null @@ -1,338 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -var Cmd, Color, Opt, Q, fs; - -fs = require('fs'); - -Q = require('q'); - -Color = require('./color').Color; - -Cmd = require('./cmd').Cmd; - -/** -Option - -Named entity. Options may have short and long keys for use from command line. -@namespace -@class Presents option -*/ - - -exports.Opt = Opt = (function() { - /** - @constructs - @param {COA.Cmd} cmd parent command - */ - - function Opt(_cmd) { - this._cmd = _cmd; - this._cmd._opts.push(this); - } - - /** - Set a canonical option identifier to be used anywhere in the API. - @param {String} _name option name - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.name = function(_name) { - this._name = _name; - return this; - }; - - /** - Set a long description for option to be used anywhere in text messages. - @param {String} _title option title - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.title = Cmd.prototype.title; - - /** - Set a short key for option to be used with one hyphen from command line. - @param {String} _short - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.short = function(_short) { - this._short = _short; - return this._cmd._optsByKey['-' + _short] = this; - }; - - /** - Set a short key for option to be used with double hyphens from command line. - @param {String} _long - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.long = function(_long) { - this._long = _long; - return this._cmd._optsByKey['--' + _long] = this; - }; - - /** - Make an option boolean, i.e. option without value. - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.flag = function() { - this._flag = true; - return this; - }; - - /** - Makes an option accepts multiple values. - Otherwise, the value will be used by the latter passed. - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.arr = function() { - this._arr = true; - return this; - }; - - /** - Makes an option required. - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.req = function() { - this._req = true; - return this; - }; - - /** - Makes an option to act as a command, - i.e. program will exit just after option action. - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.only = function() { - this._only = true; - return this; - }; - - /** - Set a validation (or value) function for option. - Value from command line passes through before becoming available from API. - Using for validation and convertion simple types to any values. - @param {Function} _val validating function, - invoked in the context of option instance - and has one parameter with value from command line - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.val = function(_val) { - this._val = _val; - return this; - }; - - /** - Set a default value for option. - Default value passed through validation function as ordinary value. - @param {Object} _def - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.def = function(_def) { - this._def = _def; - return this; - }; - - /** - Make option value inputting stream. - It's add useful validation and shortcut for STDIN. - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.input = function() { - process.stdin.pause(); - return this.def(process.stdin).val(function(v) { - var s; - if (typeof v === 'string') { - if (v === '-') { - return process.stdin; - } else { - s = fs.createReadStream(v, { - encoding: 'utf8' - }); - s.pause(); - return s; - } - } else { - return v; - } - }); - }; - - /** - Make option value outputing stream. - It's add useful validation and shortcut for STDOUT. - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.output = function() { - return this.def(process.stdout).val(function(v) { - if (typeof v === 'string') { - if (v === '-') { - return process.stdout; - } else { - return fs.createWriteStream(v, { - encoding: 'utf8' - }); - } - } else { - return v; - } - }); - }; - - /** - Add action for current option command. - This action is performed if the current option - is present in parsed options (with any value). - @param {Function} act action function, - invoked in the context of command instance - and has the parameters: - - {Object} opts parsed options - - {Array} args parsed arguments - - {Object} res actions result accumulator - It can return rejected promise by Cmd.reject (in case of error) - or any other value treated as result. - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.act = function(act) { - var name, opt; - opt = this; - name = this._name; - this._cmd.act(function(opts) { - var res, - _this = this; - if (name in opts) { - res = act.apply(this, arguments); - if (opt._only) { - return Q.when(res, function(res) { - return _this.reject({ - toString: function() { - return res.toString(); - }, - exitCode: 0 - }); - }); - } else { - return res; - } - } - }); - return this; - }; - - /** - Set custom additional completion for current option. - @param {Function} completion generation function, - invoked in the context of option instance. - Accepts parameters: - - {Object} opts completion options - It can return promise or any other value treated as result. - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.comp = Cmd.prototype.comp; - - Opt.prototype._saveVal = function(opts, val) { - var _name; - if (this._val) { - val = this._val(val); - } - if (this._arr) { - (opts[_name = this._name] || (opts[_name] = [])).push(val); - } else { - opts[this._name] = val; - } - return val; - }; - - Opt.prototype._parse = function(argv, opts) { - return this._saveVal(opts, this._flag ? true : argv.shift()); - }; - - Opt.prototype._checkParsed = function(opts, args) { - return !opts.hasOwnProperty(this._name); - }; - - Opt.prototype._usage = function() { - var nameStr, res; - res = []; - nameStr = this._name.toUpperCase(); - if (this._short) { - res.push('-', Color('lgreen', this._short)); - if (!this._flag) { - res.push(' ' + nameStr); - } - res.push(', '); - } - if (this._long) { - res.push('--', Color('green', this._long)); - if (!this._flag) { - res.push('=' + nameStr); - } - } - res.push(' : ', this._title); - if (this._req) { - res.push(' ', Color('lred', '(required)')); - } - return res.join(''); - }; - - Opt.prototype._requiredText = function() { - return 'Missing required option:\n ' + this._usage(); - }; - - /** - Return rejected promise with error code. - Use in .val() for return with error. - @param {Object} reject reason - You can customize toString() method and exitCode property - of reason object. - @returns {Q.promise} rejected promise - */ - - - Opt.prototype.reject = Cmd.prototype.reject; - - /** - Finish chain for current option and return parent command instance. - @returns {COA.Cmd} parent command - */ - - - Opt.prototype.end = Cmd.prototype.end; - - /** - Apply function with arguments in context of option instance. - @param {Function} fn - @param {Array} args - @returns {COA.Opt} this instance (for chainability) - */ - - - Opt.prototype.apply = Cmd.prototype.apply; - - return Opt; - -})(); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/shell.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/shell.js deleted file mode 100644 index 01ddc64..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/lib/shell.js +++ /dev/null @@ -1,15 +0,0 @@ -// Generated by CoffeeScript 1.4.0 - -exports.unescape = function(w) { - w = w.charAt(0) === '"' ? w.replace(/^"|([^\\])"$/g, '$1') : w.replace(/\\ /g, ' '); - return w.replace(/\\("|'|\$|`|\\)/g, '$1'); -}; - -exports.escape = function(w) { - w = w.replace(/(["'$`\\])/g, '\\$1'); - if (w.match(/\s+/)) { - return '"' + w + '"'; - } else { - return w; - } -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/node_modules/q/README.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/node_modules/q/README.md deleted file mode 100644 index b3fdee3..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/coa/node_modules/q/README.md +++ /dev/null @@ -1,638 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/kriskowal/q.png)](http://travis-ci.org/kriskowal/q) - - - Promises/A+ logo - - -If a function cannot return a value or throw an exception without -blocking, it can return a promise instead. A promise is an object -that represents the return value or the thrown exception that the -function may eventually provide. A promise can also be used as a -proxy for a [remote object][Q-Connection] to overcome latency. - -[Q-Connection]: https://github.com/kriskowal/q-connection - -On the first pass, promises can mitigate the “[Pyramid of -Doom][POD]”: the situation where code marches to the right faster -than it marches forward. - -[POD]: http://calculist.org/blog/2011/12/14/why-coroutines-wont-work-on-the-web/ - -```javascript -step1(function (value1) { - step2(value1, function(value2) { - step3(value2, function(value3) { - step4(value3, function(value4) { - // Do something with value4 - }); - }); - }); -}); -``` - -With a promise library, you can flatten the pyramid. - -```javascript -Q.fcall(step1) -.then(step2) -.then(step3) -.then(step4) -.then(function (value4) { - // Do something with value4 -}, function (error) { - // Handle any error from step1 through step4 -}) -.done(); -``` - -With this approach, you also get implicit error propagation, -just like ``try``, ``catch``, and ``finally``. An error in -``step1`` will flow all the way to ``step5``, where it’s -caught and handled. - -The callback approach is called an “inversion of control”. -A function that accepts a callback instead of a return value -is saying, “Don’t call me, I’ll call you.”. Promises -[un-invert][IOC] the inversion, cleanly separating the input -arguments from control flow arguments. This simplifies the -use and creation of API’s, particularly variadic, -rest and spread arguments. - -[IOC]: http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript - - -## Getting Started - -The Q module can be loaded as: - -- a `` - - - - - \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/example.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/example.js deleted file mode 100644 index b1e03a4..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/example.js +++ /dev/null @@ -1,77 +0,0 @@ -var colors = require('./colors'); - -//colors.mode = "browser"; - -var test = colors.red("hopefully colorless output"); -console.log('Rainbows are fun!'.rainbow); -console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported -console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported -//console.log('zalgo time!'.zalgo); -console.log(test.stripColors); -console.log("a".grey + " b".black); -console.log("Zebras are so fun!".zebra); -console.log('background color attack!'.black.whiteBG) - -// -// Remark: .strikethrough may not work with Mac OS Terminal App -// -console.log("This is " + "not".strikethrough + " fun."); -console.log(colors.rainbow('Rainbows are fun!')); -console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported -console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported -//console.log(colors.zalgo('zalgo time!')); -console.log(colors.stripColors(test)); -console.log(colors.grey("a") + colors.black(" b")); - -colors.addSequencer("america", function(letter, i, exploded) { - if(letter === " ") return letter; - switch(i%3) { - case 0: return letter.red; - case 1: return letter.white; - case 2: return letter.blue; - } -}); - -colors.addSequencer("random", (function() { - var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; - - return function(letter, i, exploded) { - return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; - }; -})()); - -console.log("AMERICA! F--K YEAH!".america); -console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); - -// -// Custom themes -// - -// Load theme with JSON literal -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); - -// outputs grey text -console.log("this is an input".input); - -// Load a theme from file -colors.setTheme('./themes/winston-dark.js'); - -console.log("this is an input".input); - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/package.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/package.json deleted file mode 100644 index 51e1d02..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "colors", - "description": "get colors in your node.js console like what", - "version": "0.6.2", - "author": { - "name": "Marak Squires" - }, - "homepage": "https://github.com/Marak/colors.js", - "bugs": { - "url": "https://github.com/Marak/colors.js/issues" - }, - "keywords": [ - "ansi", - "terminal", - "colors" - ], - "repository": { - "type": "git", - "url": "http://github.com/Marak/colors.js.git" - }, - "engines": { - "node": ">=0.1.90" - }, - "main": "colors", - "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", - "readmeFilename": "ReadMe.md", - "_id": "colors@0.6.2", - "_from": "colors@~0.6.0", - "scripts": {} -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/test.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/test.js deleted file mode 100644 index c32417d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/test.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require('assert'), - colors = require('./colors'); - -var s = 'string'; - -function a(s, code) { - return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; -} - -function aE(s, color, code) { - assert.equal(s[color], a(s, code)); - assert.equal(colors[color](s), a(s, code)); - assert.equal(s[color], colors[color](s)); - assert.equal(s[color].stripColors, s); - assert.equal(s[color].stripColors, colors.stripColors(s)); -} - -function h(s, color) { - return '' + s + ''; -} - -var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; -var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); - -colors.mode = 'console'; -assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); -assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); -assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); -assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); -assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); -assert.ok(s.rainbow); -aE(s, 'white', 37); -aE(s, 'grey', 90); -aE(s, 'black', 30); -aE(s, 'blue', 34); -aE(s, 'cyan', 36); -aE(s, 'green', 32); -aE(s, 'magenta', 35); -aE(s, 'red', 31); -aE(s, 'yellow', 33); -assert.equal(s, 'string'); - -colors.setTheme({error:'red'}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'browser'; -assert.equal(s.bold, '' + s + ''); -assert.equal(s.italic, '' + s + ''); -assert.equal(s.underline, '' + s + ''); -assert.equal(s.strikethrough, '' + s + ''); -assert.equal(s.inverse, '' + s + ''); -assert.ok(s.rainbow); -stylesColors.forEach(function (color) { - assert.equal(s[color], h(s, color)); - assert.equal(colors[color](s), h(s, color)); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'none'; -stylesAll.forEach(function (style) { - assert.equal(s[style], s); - assert.equal(colors[style](s), s); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/themes/winston-dark.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/themes/winston-dark.js deleted file mode 100644 index 49a905b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/themes/winston-dark.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'black', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/themes/winston-light.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/themes/winston-light.js deleted file mode 100644 index 571972c..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/colors/themes/winston-light.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/HISTORY.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/HISTORY.md deleted file mode 100644 index 960a537..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/HISTORY.md +++ /dev/null @@ -1,186 +0,0 @@ -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/LICENSE b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/LICENSE deleted file mode 100644 index 0f16ee9..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/README.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/README.md deleted file mode 100644 index 7446d2a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/README.md +++ /dev/null @@ -1,277 +0,0 @@ -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/bin/js-yaml.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/bin/js-yaml.js deleted file mode 100755 index 5110a4c..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/bin/js-yaml.js +++ /dev/null @@ -1,125 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/custom_types.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/custom_types.js deleted file mode 100644 index 1cb987c..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/custom_types.js +++ /dev/null @@ -1,104 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/custom_types.yaml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/custom_types.yaml deleted file mode 100644 index 033134f..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/custom_types.yaml +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/dumper.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/dumper.js deleted file mode 100644 index 7952b18..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/dumper.js +++ /dev/null @@ -1,31 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/dumper.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/dumper.json deleted file mode 100644 index 9f54c05..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/dumper.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/sample_document.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/sample_document.js deleted file mode 100644 index 2378aba..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/sample_document.js +++ /dev/null @@ -1,18 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/sample_document.yaml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/sample_document.yaml deleted file mode 100644 index 4479ee9..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/examples/sample_document.yaml +++ /dev/null @@ -1,197 +0,0 @@ ---- -# 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/index.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/index.js deleted file mode 100644 index 40606dd..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/js-yaml.js'); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml.js deleted file mode 100644 index 1409828..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml.js +++ /dev/null @@ -1,43 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/common.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/common.js deleted file mode 100644 index cc7f824..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/common.js +++ /dev/null @@ -1,60 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/dumper.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/dumper.js deleted file mode 100644 index 25a38bf..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/dumper.js +++ /dev/null @@ -1,485 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/exception.js deleted file mode 100644 index 479ba88..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/exception.js +++ /dev/null @@ -1,25 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/loader.js deleted file mode 100644 index 2230318..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/loader.js +++ /dev/null @@ -1,1585 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/mark.js deleted file mode 100644 index bfe279b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/mark.js +++ /dev/null @@ -1,78 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/require.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/require.js deleted file mode 100644 index c237ff8..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/require.js +++ /dev/null @@ -1,23 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema.js deleted file mode 100644 index ce21391..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema.js +++ /dev/null @@ -1,103 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/core.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/core.js deleted file mode 100644 index 206daab..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/core.js +++ /dev/null @@ -1,18 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/default_full.js deleted file mode 100644 index a55ef42..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +++ /dev/null @@ -1,25 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js deleted file mode 100644 index 11d89bb..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +++ /dev/null @@ -1,28 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js deleted file mode 100644 index b7a33eb..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +++ /dev/null @@ -1,17 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/json.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/json.js deleted file mode 100644 index 5be3dbf..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/schema/json.js +++ /dev/null @@ -1,25 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type.js deleted file mode 100644 index e0124f2..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type.js +++ /dev/null @@ -1,82 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/binary.js deleted file mode 100644 index 37b4bc7..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ /dev/null @@ -1,118 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/bool.js deleted file mode 100644 index 987a9e6..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ /dev/null @@ -1,74 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/float.js deleted file mode 100644 index edb5fcb..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/float.js +++ /dev/null @@ -1,102 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/int.js deleted file mode 100644 index f5e1e7e..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/int.js +++ /dev/null @@ -1,85 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/function.js deleted file mode 100644 index 7ef21ac..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ /dev/null @@ -1,56 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js deleted file mode 100644 index 9f4f89e..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ /dev/null @@ -1,56 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js deleted file mode 100644 index 8d2835e..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +++ /dev/null @@ -1,28 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/map.js deleted file mode 100644 index 5cda6de..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/map.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:map', { - loader: { - kind: 'object' - } -}); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/merge.js deleted file mode 100644 index 8facc70..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ /dev/null @@ -1,18 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/null.js deleted file mode 100644 index 936c488..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/null.js +++ /dev/null @@ -1,36 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/omap.js deleted file mode 100644 index f7c248d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ /dev/null @@ -1,53 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/pairs.js deleted file mode 100644 index 828ff1b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ /dev/null @@ -1,41 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/seq.js deleted file mode 100644 index 80a7cf0..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:seq', { - loader: { - kind: 'array' - } -}); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/set.js deleted file mode 100644 index 64bdc66..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/set.js +++ /dev/null @@ -1,31 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/str.js deleted file mode 100644 index 384f14e..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/str.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:str', { - loader: { - kind: 'string' - } -}); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/timestamp.js deleted file mode 100644 index 24da9e2..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ /dev/null @@ -1,91 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/.bin/esparse b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/.bin/esparse deleted file mode 120000 index 7423b18..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/.bin/esvalidate b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/.bin/esvalidate deleted file mode 120000 index 16069ef..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/HISTORY.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/HISTORY.md deleted file mode 100644 index 102f82b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/HISTORY.md +++ /dev/null @@ -1,109 +0,0 @@ -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/LICENSE b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/LICENSE deleted file mode 100644 index 1afdae5..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/README.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/README.md deleted file mode 100644 index f20e0c1..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/README.md +++ /dev/null @@ -1,239 +0,0 @@ -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/arguments.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/arguments.js deleted file mode 100755 index 5b090fa..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +++ /dev/null @@ -1,36 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/choice.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/choice.js deleted file mode 100755 index 2616fa4..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/choice.js +++ /dev/null @@ -1,22 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/constants.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/constants.js deleted file mode 100755 index 172a4f3..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/constants.js +++ /dev/null @@ -1,59 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/help.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/help.js deleted file mode 100755 index 7eb9555..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/help.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/nargs.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/nargs.js deleted file mode 100755 index 74f376b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/parents.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/parents.js deleted file mode 100755 index dfe8968..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/parents.js +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js deleted file mode 100755 index 430d5e1..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +++ /dev/null @@ -1,23 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js deleted file mode 100755 index df9c494..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +++ /dev/null @@ -1,49 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/sum.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/sum.js deleted file mode 100755 index 4532800..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/sum.js +++ /dev/null @@ -1,35 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js deleted file mode 100644 index afb4a2d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +++ /dev/null @@ -1,270 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/index.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/index.js deleted file mode 100644 index 3b6eea0..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/argparse'); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action.js deleted file mode 100644 index 6f7e9a5..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/append.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/append.js deleted file mode 100644 index 48c6dbe..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/append.js +++ /dev/null @@ -1,55 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js deleted file mode 100644 index 90747ab..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +++ /dev/null @@ -1,47 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/count.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/count.js deleted file mode 100644 index d6a5899..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/count.js +++ /dev/null @@ -1,40 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/help.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/help.js deleted file mode 100644 index 7f7b4e2..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +++ /dev/null @@ -1,48 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store.js deleted file mode 100644 index 8ebc974..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store.js +++ /dev/null @@ -1,50 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js deleted file mode 100644 index 8410fcf..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +++ /dev/null @@ -1,43 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js deleted file mode 100644 index 66417bf..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js +++ /dev/null @@ -1,27 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js deleted file mode 100644 index 43ec708..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js +++ /dev/null @@ -1,26 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js deleted file mode 100644 index adecf65..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js +++ /dev/null @@ -1,148 +0,0 @@ -/** 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/version.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/version.js deleted file mode 100644 index a17877c..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action/version.js +++ /dev/null @@ -1,50 +0,0 @@ -/*: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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action_container.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action_container.js deleted file mode 100644 index dbe3e3c..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/action_container.js +++ /dev/null @@ -1,481 +0,0 @@ -/** 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argparse.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argparse.js deleted file mode 100644 index f2a2c51..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argparse.js +++ /dev/null @@ -1,14 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js deleted file mode 100644 index c8a02a0..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js +++ /dev/null @@ -1,50 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js deleted file mode 100644 index 8287e00..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js +++ /dev/null @@ -1,54 +0,0 @@ -/** 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js deleted file mode 100644 index 58b271f..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +++ /dev/null @@ -1,75 +0,0 @@ -/** 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js deleted file mode 100644 index 97cf098..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +++ /dev/null @@ -1,1165 +0,0 @@ -/** - * 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/const.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/const.js deleted file mode 100644 index de831ba..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/const.js +++ /dev/null @@ -1,18 +0,0 @@ -// -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js deleted file mode 100644 index cd2f369..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js +++ /dev/null @@ -1,88 +0,0 @@ -'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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js deleted file mode 100644 index 541d918..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +++ /dev/null @@ -1,803 +0,0 @@ -/** - * 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/namespace.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/namespace.js deleted file mode 100644 index 3546f2d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/lib/namespace.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml deleted file mode 100644 index ab27b29..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile deleted file mode 100644 index aed29c3..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "https://rubygems.org" - -gem 'uglifier' -gem 'rake' diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index 2c52be4..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown deleted file mode 100644 index 1a39ad9..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +++ /dev/null @@ -1,814 +0,0 @@ -# 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile deleted file mode 100644 index 2cd9eed..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -# 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json deleted file mode 100644 index ae91b65..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js deleted file mode 100644 index 4f6b2b9..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js +++ /dev/null @@ -1 +0,0 @@ -!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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js deleted file mode 100644 index 8761117..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +++ /dev/null @@ -1,673 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json deleted file mode 100644 index 9556365..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js deleted file mode 100644 index 44a2167..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js deleted file mode 100644 index 9ceeea7..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js +++ /dev/null @@ -1,148 +0,0 @@ -(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js deleted file mode 100644 index 77364f2..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js +++ /dev/null @@ -1,685 +0,0 @@ -$(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c17..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Underscore.strings Test Suite - - - - - - - - -

                    Underscore.string Test Suite

                    -

                    -

                    -
                      - - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js deleted file mode 100644 index 32252a3..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js +++ /dev/null @@ -1,200 +0,0 @@ -$(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js deleted file mode 100644 index 16cf7bf..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js +++ /dev/null @@ -1,59 +0,0 @@ -$(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js deleted file mode 100644 index e089626..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js +++ /dev/null @@ -1,426 +0,0 @@ -$(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js deleted file mode 100644 index a529658..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js +++ /dev/null @@ -1,259 +0,0 @@ -$(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html deleted file mode 100644 index 064fa98..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js deleted file mode 100644 index 22949c3..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js +++ /dev/null @@ -1,548 +0,0 @@ -$(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js deleted file mode 100644 index 05e3f2a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js +++ /dev/null @@ -1,75 +0,0 @@ -(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js deleted file mode 100644 index c9be20a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js +++ /dev/null @@ -1,249 +0,0 @@ -$(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json deleted file mode 100644 index 014ab26..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js deleted file mode 100644 index c1d9d3a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1 +0,0 @@ -(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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js deleted file mode 100644 index a12f0d9..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/package.json deleted file mode 100644 index 09382f8..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/argparse/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/README.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/README.md deleted file mode 100644 index a74bd12..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/README.md +++ /dev/null @@ -1,73 +0,0 @@ -**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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 3e7bb81..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,117 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index e0af3f7..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,177 +0,0 @@ -#!/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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/esprima.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/esprima.js deleted file mode 100644 index f1320da..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/esprima.js +++ /dev/null @@ -1,3908 +0,0 @@ -/* - 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/package.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/package.json deleted file mode 100644 index 9a2294a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/compat.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/compat.js deleted file mode 100644 index ee3a629..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/compat.js +++ /dev/null @@ -1,239 +0,0 @@ -/* - 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/reflect.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/reflect.js deleted file mode 100644 index dba1ba8..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/reflect.js +++ /dev/null @@ -1,422 +0,0 @@ -// 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/run.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/run.js deleted file mode 100644 index 32ca3fa..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/run.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/runner.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/runner.js deleted file mode 100644 index c1a3fc9..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/runner.js +++ /dev/null @@ -1,387 +0,0 @@ -/* - 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/test.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/test.js deleted file mode 100644 index 8ceee54..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/node_modules/esprima/test/test.js +++ /dev/null @@ -1,20238 +0,0 @@ -/* - 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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/package.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/package.json deleted file mode 100644 index 265cca7..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/js-yaml/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "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@" -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/AUTHORS b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/AUTHORS deleted file mode 100644 index 7145cbc..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/AUTHORS +++ /dev/null @@ -1,10 +0,0 @@ -# contributors sorted by whether or not they're me. -Isaac Z. Schlueter -Stein Martin Hustad -Mikeal Rogers -Laurie Harper -Jann Horn -Elijah Insua -Henry Rawas -Justin Makeig -Mike Schilling diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/LICENSE b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/LICENSE deleted file mode 100644 index 62e4ccf..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ -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. - - -The file "examples/strict.dtd" is licensed by the W3C and used according -to the terms of the W3C SOFTWARE NOTICE AND LICENSE. See LICENSE-W3C.html -for details. diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/LICENSE-W3C.html b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/LICENSE-W3C.html deleted file mode 100644 index a611e3f..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/LICENSE-W3C.html +++ /dev/null @@ -1,188 +0,0 @@ - -W3C Software Notice and License
                      - - - -
                      -

                      - W3C - -

                      - -
                      - - - -
                      -
                      - -
                      - - -
                      -
                      - -
                      - - -
                      -
                      -
                      - -
                      -
                      -

                      W3C Software Notice and License

                      -
                      -
                      -

                      This work (and included software, documentation such as READMEs, or other -related items) is being provided by the copyright holders under the following -license.

                      -

                      License

                      - -

                      -By obtaining, using and/or copying this work, you (the licensee) -agree that you have read, understood, and will comply with the following -terms and conditions.

                      - -

                      Permission to copy, modify, and distribute this software and its -documentation, with or without modification, for any purpose and without -fee or royalty is hereby granted, provided that you include the following on -ALL copies of the software and documentation or portions thereof, including -modifications:

                      - -
                      • The full text of this NOTICE in a location viewable to users of the - redistributed or derivative work.
                      • Any pre-existing intellectual property disclaimers, notices, or terms - and conditions. If none exist, the W3C Software Short - Notice should be included (hypertext is preferred, text is permitted) - within the body of any redistributed or derivative code.
                      • Notice of any changes or modifications to the files, including the date - changes were made. (We recommend you provide URIs to the location from - which the code is derived.)
                      - -

                      Disclaimers

                      - -

                      THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS -MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR -PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE -ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.

                      - -

                      COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR -DOCUMENTATION.

                      - -

                      The name and trademarks of copyright holders may NOT be used in -advertising or publicity pertaining to the software without specific, written -prior permission. Title to copyright in this software and any associated -documentation will at all times remain with copyright holders.

                      - -

                      Notes

                      - -

                      This version: http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231

                      - -

                      This formulation of W3C's notice and license became active on December 31 -2002. This version removes the copyright ownership notice such that this -license can be used with materials other than those owned by the W3C, -reflects that ERCIM is now a host of the W3C, includes references to this -specific dated version of the license, and removes the ambiguous grant of -"use". Otherwise, this version is the same as the previous -version and is written so as to preserve the Free -Software Foundation's assessment of GPL compatibility and OSI's certification -under the Open Source -Definition.

                      -
                      -
                      -
                      -
                      - - - -
                      - -
                      diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/README.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/README.md deleted file mode 100644 index c965242..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# sax js - -A sax-style parser for XML and HTML. - -Designed with [node](http://nodejs.org/) in mind, but should work fine in -the browser or other CommonJS implementations. - -## What This Is - -* A very simple tool to parse through an XML string. -* A stepping stone to a streaming HTML parser. -* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML - docs. - -## What This Is (probably) Not - -* An HTML Parser - That's a fine goal, but this isn't it. It's just - XML. -* A DOM Builder - You can use it to build an object model out of XML, - but it doesn't do that out of the box. -* XSLT - No DOM = no querying. -* 100% Compliant with (some other SAX implementation) - Most SAX - implementations are in Java and do a lot more than this does. -* An XML Validator - It does a little validation when in strict mode, but - not much. -* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic - masochism. -* A DTD-aware Thing - Fetching DTDs is a much bigger job. - -## Regarding `Hello, world!').close(); - - // stream usage - // takes the same options as the parser - var saxStream = require("sax").createStream(strict, options) - saxStream.on("error", function (e) { - // unhandled errors will throw, since this is a proper node - // event emitter. - console.error("error!", e) - // clear the error - this._parser.error = null - this._parser.resume() - }) - saxStream.on("opentag", function (node) { - // same object as above - }) - // pipe is supported, and it's readable/writable - // same chunks coming in also go out. - fs.createReadStream("file.xml") - .pipe(saxStream) - .pipe(fs.createWriteStream("file-copy.xml")) - - - -## Arguments - -Pass the following arguments to the parser function. All are optional. - -`strict` - Boolean. Whether or not to be a jerk. Default: `false`. - -`opt` - Object bag of settings regarding string formatting. All default to `false`. - -Settings supported: - -* `trim` - Boolean. Whether or not to trim text and comment nodes. -* `normalize` - Boolean. If true, then turn any whitespace into a single - space. -* `lowercase` - Boolean. If true, then lowercase tag names and attribute names - in loose mode, rather than uppercasing them. -* `xmlns` - Boolean. If true, then namespaces are supported. -* `position` - Boolean. If false, then don't track line/col/position. - -## Methods - -`write` - Write bytes onto the stream. You don't have to do this all at -once. You can keep writing as much as you want. - -`close` - Close the stream. Once closed, no more data may be written until -it is done processing the buffer, which is signaled by the `end` event. - -`resume` - To gracefully handle errors, assign a listener to the `error` -event. Then, when the error is taken care of, you can call `resume` to -continue parsing. Otherwise, the parser will not continue while in an error -state. - -## Members - -At all times, the parser object will have the following members: - -`line`, `column`, `position` - Indications of the position in the XML -document where the parser currently is looking. - -`startTagPosition` - Indicates the position where the current tag starts. - -`closed` - Boolean indicating whether or not the parser can be written to. -If it's `true`, then wait for the `ready` event to write again. - -`strict` - Boolean indicating whether or not the parser is a jerk. - -`opt` - Any options passed into the constructor. - -`tag` - The current tag being dealt with. - -And a bunch of other stuff that you probably shouldn't touch. - -## Events - -All events emit with a single argument. To listen to an event, assign a -function to `on`. Functions get executed in the this-context of -the parser object. The list of supported events are also in the exported -`EVENTS` array. - -When using the stream interface, assign handlers using the EventEmitter -`on` function in the normal fashion. - -`error` - Indication that something bad happened. The error will be hanging -out on `parser.error`, and must be deleted before parsing can continue. By -listening to this event, you can keep an eye on that kind of stuff. Note: -this happens *much* more in strict mode. Argument: instance of `Error`. - -`text` - Text node. Argument: string of text. - -`doctype` - The ``. Argument: -object with `name` and `body` members. Attributes are not parsed, as -processing instructions have implementation dependent semantics. - -`sgmldeclaration` - Random SGML declarations. Stuff like `` -would trigger this kind of event. This is a weird thing to support, so it -might go away at some point. SAX isn't intended to be used to parse SGML, -after all. - -`opentag` - An opening tag. Argument: object with `name` and `attributes`. -In non-strict mode, tag names are uppercased, unless the `lowercase` -option is set. If the `xmlns` option is set, then it will contain -namespace binding information on the `ns` member, and will have a -`local`, `prefix`, and `uri` member. - -`closetag` - A closing tag. In loose mode, tags are auto-closed if their -parent closes. In strict mode, well-formedness is enforced. Note that -self-closing tags will have `closeTag` emitted immediately after `openTag`. -Argument: tag name. - -`attribute` - An attribute node. Argument: object with `name` and `value`. -In non-strict mode, attribute names are uppercased, unless the `lowercase` -option is set. If the `xmlns` option is set, it will also contains namespace -information. - -`comment` - A comment node. Argument: the string of the comment. - -`opencdata` - The opening tag of a ``) of a `` tags trigger a `"script"` -event, and their contents are not checked for special xml characters. -If you pass `noscript: true`, then this behavior is suppressed. - -## Reporting Problems - -It's best to write a failing test if you find an issue. I will always -accept pull requests with failing tests if they demonstrate intended -behavior, but it is very hard to figure out what issue you're describing -without a test. Writing a test is also the best way for you yourself -to figure out if you really understand the issue you think you have with -sax-js. diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/component.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/component.json deleted file mode 100644 index 96b5d73..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/component.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "sax", - "description": "An evented streaming XML parser in JavaScript", - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "version": "0.5.2", - "main": "lib/sax.js", - "license": "BSD", - "scripts": [ - "lib/sax.js" - ], - "repository": "git://github.com/isaacs/sax-js.git" -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/big-not-pretty.xml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/big-not-pretty.xml deleted file mode 100644 index fb5265d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/big-not-pretty.xml +++ /dev/null @@ -1,8002 +0,0 @@ - - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - - something blerm a bit down here - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/example.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/example.js deleted file mode 100644 index 7b0246e..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/example.js +++ /dev/null @@ -1,29 +0,0 @@ - -var fs = require("fs"), - util = require("util"), - path = require("path"), - xml = fs.readFileSync(path.join(__dirname, "test.xml"), "utf8"), - sax = require("../lib/sax"), - strict = sax.parser(true), - loose = sax.parser(false, {trim:true}), - inspector = function (ev) { return function (data) { - console.error("%s %s %j", this.line+":"+this.column, ev, data); - }}; - -sax.EVENTS.forEach(function (ev) { - loose["on"+ev] = inspector(ev); -}); -loose.onend = function () { - console.error("end"); - console.error(loose); -}; - -// do this in random bits at a time to verify that it works. -(function () { - if (xml) { - var c = Math.ceil(Math.random() * 1000) - loose.write(xml.substr(0,c)); - xml = xml.substr(c); - process.nextTick(arguments.callee); - } else loose.close(); -})(); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/get-products.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/get-products.js deleted file mode 100644 index 9e8d74a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/get-products.js +++ /dev/null @@ -1,58 +0,0 @@ -// pull out /GeneralSearchResponse/categories/category/items/product tags -// the rest we don't care about. - -var sax = require("../lib/sax.js") -var fs = require("fs") -var path = require("path") -var xmlFile = path.resolve(__dirname, "shopping.xml") -var util = require("util") -var http = require("http") - -fs.readFile(xmlFile, function (er, d) { - http.createServer(function (req, res) { - if (er) throw er - var xmlstr = d.toString("utf8") - - var parser = sax.parser(true) - var products = [] - var product = null - var currentTag = null - - parser.onclosetag = function (tagName) { - if (tagName === "product") { - products.push(product) - currentTag = product = null - return - } - if (currentTag && currentTag.parent) { - var p = currentTag.parent - delete currentTag.parent - currentTag = p - } - } - - parser.onopentag = function (tag) { - if (tag.name !== "product" && !product) return - if (tag.name === "product") { - product = tag - } - tag.parent = currentTag - tag.children = [] - tag.parent && tag.parent.children.push(tag) - currentTag = tag - } - - parser.ontext = function (text) { - if (currentTag) currentTag.children.push(text) - } - - parser.onend = function () { - var out = util.inspect(products, false, 3, true) - res.writeHead(200, {"content-type":"application/json"}) - res.end("{\"ok\":true}") - // res.end(JSON.stringify(products)) - } - - parser.write(xmlstr).end() - }).listen(1337) -}) diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/hello-world.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/hello-world.js deleted file mode 100644 index cbfa518..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/hello-world.js +++ /dev/null @@ -1,4 +0,0 @@ -require("http").createServer(function (req, res) { - res.writeHead(200, {"content-type":"application/json"}) - res.end(JSON.stringify({ok: true})) -}).listen(1337) diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/not-pretty.xml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/not-pretty.xml deleted file mode 100644 index 9592852..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/not-pretty.xml +++ /dev/null @@ -1,8 +0,0 @@ - - something blerm a bit down here diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/pretty-print.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/pretty-print.js deleted file mode 100644 index cd6aca9..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/pretty-print.js +++ /dev/null @@ -1,74 +0,0 @@ -var sax = require("../lib/sax") - , printer = sax.createStream(false, {lowercasetags:true, trim:true}) - , fs = require("fs") - -function entity (str) { - return str.replace('"', '"') -} - -printer.tabstop = 2 -printer.level = 0 -printer.indent = function () { - print("\n") - for (var i = this.level; i > 0; i --) { - for (var j = this.tabstop; j > 0; j --) { - print(" ") - } - } -} -printer.on("opentag", function (tag) { - this.indent() - this.level ++ - print("<"+tag.name) - for (var i in tag.attributes) { - print(" "+i+"=\""+entity(tag.attributes[i])+"\"") - } - print(">") -}) - -printer.on("text", ontext) -printer.on("doctype", ontext) -function ontext (text) { - this.indent() - print(text) -} - -printer.on("closetag", function (tag) { - this.level -- - this.indent() - print("") -}) - -printer.on("cdata", function (data) { - this.indent() - print("") -}) - -printer.on("comment", function (comment) { - this.indent() - print("") -}) - -printer.on("error", function (error) { - console.error(error) - throw error -}) - -if (!process.argv[2]) { - throw new Error("Please provide an xml file to prettify\n"+ - "TODO: read from stdin or take a file") -} -var xmlfile = require("path").join(process.cwd(), process.argv[2]) -var fstr = fs.createReadStream(xmlfile, { encoding: "utf8" }) - -function print (c) { - if (!process.stdout.write(c)) { - fstr.pause() - } -} - -process.stdout.on("drain", function () { - fstr.resume() -}) - -fstr.pipe(printer) diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/shopping.xml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/shopping.xml deleted file mode 100644 index 223c6c6..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/shopping.xml +++ /dev/null @@ -1,2 +0,0 @@ - -sandbox3.1 r31.Kadu4DC.phase357782011.10.06 15:37:23 PSTp2.a121bc2aaf029435dce62011-10-21T18:38:45.982-04:00P0Y0M0DT0H0M0.169S1112You are currently using the SDC API sandbox environment! No clicks to merchant URLs from this response will be paid. Please change the host of your API requests to 'publisher.api.shopping.com' when you have finished development and testinghttp://statTest.dealtime.com/pixel/noscript?PV_EvnTyp=APPV&APPV_APITSP=10%2F21%2F11_06%3A38%3A45_PM&APPV_DSPRQSID=p2.a121bc2aaf029435dce6&APPV_IMGURL=http://img.shopping.com/sc/glb/sdc_logo_106x19.gif&APPV_LI_LNKINID=7000610&APPV_LI_SBMKYW=nikon&APPV_MTCTYP=1000&APPV_PRTID=2002&APPV_BrnID=14804http://www.shopping.com/digital-cameras/productsDigital CamerasDigital CamerasElectronicshttp://www.shopping.com/xCH-electronics-nikon~linkin_id-7000610?oq=nikonCameras and Photographyhttp://www.shopping.com/xCH-cameras_and_photography-nikon~linkin_id-7000610?oq=nikonDigital Camerashttp://www.shopping.com/digital-cameras/nikon/products?oq=nikon&linkin_id=7000610nikonnikonDigital Camerashttp://www.shopping.com/digital-cameras/nikon/products?oq=nikon&linkin_id=7000610Nikon D3100 Digital Camera14.2 Megapixel, SLR Camera, 3 in. LCD Screen, With High Definition Video, Weight: 1 lb.The Nikon D3100 digital SLR camera speaks to the growing ranks of enthusiastic D-SLR users and aspiring photographers by providing an easy-to-use and affordable entrance to the world of Nikon D-SLR’s. The 14.2-megapixel D3100 has powerful features, such as the enhanced Guide Mode that makes it easy to unleash creative potential and capture memories with still images and full HD video. Like having a personal photo tutor at your fingertips, this unique feature provides a simple graphical interface on the camera’s LCD that guides users by suggesting and/or adjusting camera settings to achieve the desired end result images. The D3100 is also the world’s first D-SLR to introduce full time auto focus (AF) in Live View and D-Movie mode to effortlessly achieve the critical focus needed when shooting Full HD 1080p video.http://di1.shopping.com/images/pi/93/bc/04/101677489-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=1http://di1.shopping.com/images/pi/93/bc/04/101677489-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=1http://di1.shopping.com/images/pi/93/bc/04/101677489-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=1http://di1.shopping.com/images/pi/93/bc/04/101677489-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=1http://di1.shopping.com/images/pi/93/bc/04/101677489-606x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=194.56http://img.shopping.com/sc/pr/sdc_stars_sm_4.5.gifhttp://www.shopping.com/Nikon-D3100/reviews~linkin_id-7000610429.001360.00http://www.shopping.com/Nikon-D3100/prices~linkin_id-7000610http://www.shopping.com/Nikon-D3100/info~linkin_id-7000610Nikon D3100 Digital SLR Camera with 18-55mm NIKKOR VR LensThe Nikon D3100 Digital SLR Camera is an affordable compact and lightweight photographic power-house. It features the all-purpose 18-55mm VR lens a high-resolution 14.2 MP CMOS sensor along with a feature set that's comprehensive yet easy to navigate - the intuitive onboard learn-as-you grow guide mode allows the photographer to understand what the 3100 can do quickly and easily. Capture beautiful pictures and amazing Full HD 1080p movies with sound and full-time autofocus. Availabilty: In Stock!7185Nikonhttp://di102.shopping.com/images/di/2d/5a/57/36424d5a717a366662532d61554c7767615f67-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di102.shopping.com/images/di/2d/5a/57/36424d5a717a366662532d61554c7767615f67-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di102.shopping.com/images/di/2d/5a/57/36424d5a717a366662532d61554c7767615f67-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di102.shopping.com/images/di/2d/5a/57/36424d5a717a366662532d61554c7767615f67-350x350-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stockFree Shipping with Any Purchase!529.000.00799.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=647&BEFID=7185&aon=%5E1&MerchantID=475674&crawler_id=475674&dealId=-ZW6BMZqz6fbS-aULwga_g%3D%3D&url=http%3A%2F%2Fwww.fumfie.com%2Fproduct%2F343.5%2Fshopping-com%3F&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D3100+Digital+SLR+Camera+with+18-55mm+NIKKOR+VR+Lens&dlprc=529.0&crn=&istrsmrc=1&isathrsl=0&AR=1&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=1&cid=&semid1=&semid2=&IsLps=0&CC=1&SL=1&FS=1&code=&acode=658&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=FumFiehttp://img.shopping.com/cctool/merch_logos/475674.gif866 666 91985604.27http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_fumfie~MRD-475674~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSF343C5Nikon Nikon D3100 14.2MP Digital SLR Camera with 18-55mm f/3.5-5.6 AF-S DX VR, CamerasNikon D3100 14.2MP Digital SLR Camera with 18-55mm f/3.5-5.6 AF-S DX VR7185Nikonhttp://di109.shopping.com/images/di/6d/64/31/65396c443876644f7534464851664a714b6e67-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/6d/64/31/65396c443876644f7534464851664a714b6e67-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/6d/64/31/65396c443876644f7534464851664a714b6e67-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/6d/64/31/65396c443876644f7534464851664a714b6e67-385x352-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2in-stock549.000.00549.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=779&BEFID=7185&aon=%5E1&MerchantID=305814&crawler_id=305814&dealId=md1e9lD8vdOu4FHQfJqKng%3D%3D&url=http%3A%2F%2Fwww.electronics-expo.com%2Findex.php%3Fpage%3Ditem%26id%3DNIKD3100%26source%3DSideCar%26scpid%3D8%26scid%3Dscsho318727%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+Nikon+D3100+14.2MP+Digital+SLR+Camera+with+18-55mm+f%2F3.5-5.6+AF-S+DX+VR%2C+Cameras&dlprc=549.0&crn=&istrsmrc=1&isathrsl=0&AR=9&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=9&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=771&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Electronics Expohttp://img.shopping.com/cctool/merch_logos/305814.gif1-888-707-EXPO3713.90http://img.shopping.com/sc/mr/sdc_checks_4.gifhttp://www.shopping.com/xMR-store_electronics_expo~MRD-305814~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSNIKD3100Nikon D3100 14.2-Megapixel Digital SLR Camera With 18-55mm Zoom-Nikkor Lens, BlackSplit-second shutter response captures shots other cameras may have missed Helps eliminate the frustration of shutter delay! 14.2-megapixels for enlargements worth framing and hanging. Takes breathtaking 1080p HD movies. ISO sensitivity from 100-1600 for bright or dimly lit settings. 3.0in. color LCD for beautiful, wide-angle framing and viewing. In-camera image editing lets you retouch with no PC. Automatic scene modes include Child, Sports, Night Portrait and more. Accepts SDHC memory cards. Nikon D3100 14.2-Megapixel Digital SLR Camera With 18-55mm Zoom-Nikkor Lens, Black is one of many Digital SLR Cameras available through Office Depot. Made by Nikon.7185Nikonhttp://di109.shopping.com/images/di/79/59/75/61586e4446744359377244556a6b5932616177-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di109.shopping.com/images/di/79/59/75/61586e4446744359377244556a6b5932616177-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di109.shopping.com/images/di/79/59/75/61586e4446744359377244556a6b5932616177-250x250-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3in-stock549.990.00699.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=698&BEFID=7185&aon=%5E1&MerchantID=467671&crawler_id=467671&dealId=yYuaXnDFtCY7rDUjkY2aaw%3D%3D&url=http%3A%2F%2Flink.mercent.com%2Fredirect.ashx%3Fmr%3AmerchantID%3DOfficeDepot%26mr%3AtrackingCode%3DCEC9669E-6ABC-E011-9F24-0019B9C043EB%26mr%3AtargetUrl%3Dhttp%3A%2F%2Fwww.officedepot.com%2Fa%2Fproducts%2F486292%2FNikon-D3100-142-Megapixel-Digital-SLR%2F%253fcm_mmc%253dMercent-_-Shopping-_-Cameras_and_Camcorders-_-486292&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D3100+14.2-Megapixel+Digital+SLR+Camera+With+18-55mm+Zoom-Nikkor+Lens%2C+Black&dlprc=549.99&crn=&istrsmrc=1&isathrsl=0&AR=10&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=10&cid=&semid1=&semid2=&IsLps=0&CC=1&SL=1&FS=1&code=&acode=690&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Office Depothttp://img.shopping.com/cctool/merch_logos/467671.gif1-800-GO-DEPOT1352.37http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_office_depot_4158555~MRD-467671~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS486292Nikon® D3100™ 14.2MP Digital SLR with 18-55mm LensThe Nikon D3100 DSLR will surprise you with its simplicity and impress you with superb results.7185Nikonhttp://di103.shopping.com/images/di/52/6c/35/36553743756954597348344d475a30326c7851-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di103.shopping.com/images/di/52/6c/35/36553743756954597348344d475a30326c7851-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di103.shopping.com/images/di/52/6c/35/36553743756954597348344d475a30326c7851-220x220-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4in-stock549.996.05549.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=504&BEFID=7185&aon=%5E1&MerchantID=332477&crawler_id=332477&dealId=Rl56U7CuiTYsH4MGZ02lxQ%3D%3D&url=http%3A%2F%2Ftracking.searchmarketing.com%2Fgsic.asp%3Faid%3D903483107%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon%C2%AE+D3100%E2%84%A2+14.2MP+Digital+SLR+with+18-55mm+Lens&dlprc=549.99&crn=&istrsmrc=0&isathrsl=0&AR=11&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=11&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=496&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RadioShackhttp://img.shopping.com/cctool/merch_logos/332477.gif242.25http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_radioshack_9689~MRD-332477~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS9614867Nikon D3100 SLR w/Nikon 18-55mm VR & 55-200mm VR Lenses14.2 Megapixels3" LCDLive ViewHD 1080p Video w/ Sound & Autofocus11-point Autofocus3 Frames per Second ShootingISO 100 to 3200 (Expand to 12800-Hi2)Self Cleaning SensorEXPEED 2, Image Processing EngineScene Recognition System7185Nikonhttp://di105.shopping.com/images/di/68/75/53/36785a4b444b614b4d544d5037316549364441-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di105.shopping.com/images/di/68/75/53/36785a4b444b614b4d544d5037316549364441-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di105.shopping.com/images/di/68/75/53/36785a4b444b614b4d544d5037316549364441-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di105.shopping.com/images/di/68/75/53/36785a4b444b614b4d544d5037316549364441-345x345-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5in-stock695.000.00695.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=371&BEFID=7185&aon=%5E1&MerchantID=487342&crawler_id=487342&dealId=huS6xZKDKaKMTMP71eI6DA%3D%3D&url=http%3A%2F%2Fwww.rythercamera.com%2Fcatalog%2Fproduct_info.php%3Fcsv%3Dsh%26products_id%3D32983%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D3100+SLR+w%2FNikon+18-55mm+VR+%26+55-200mm+VR+Lenses&dlprc=695.0&crn=&istrsmrc=0&isathrsl=0&AR=15&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=101677489&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=15&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=379&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RytherCamera.comhttp://img.shopping.com/cctool/merch_logos/487342.gif1-877-644-75930http://img.shopping.com/sc/glb/flag/US.gifUS32983Nikon COOLPIX S203 Digital Camera10 Megapixel, Ultra-Compact Camera, 2.5 in. LCD Screen, 3x Optical Zoom, With Video Capability, Weight: 0.23 lb.With 10.34 mega pixel, electronic VR vibration reduction, 5-level brightness adjustment, 3x optical zoom, and TFT LCD, Nikon Coolpix s203 fulfills all the demands of any photographer. The digital camera has an inbuilt memory of 44MB and an external memory slot made for all kinds of SD (Secure Digital) cards.http://di1.shopping.com/images/pi/c4/ef/1b/95397883-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=2http://di1.shopping.com/images/pi/c4/ef/1b/95397883-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=2http://di1.shopping.com/images/pi/c4/ef/1b/95397883-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=2http://di1.shopping.com/images/pi/c4/ef/1b/95397883-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=2http://di1.shopping.com/images/pi/c4/ef/1b/95397883-500x499-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=20139.00139.00http://www.shopping.com/Nikon-Coolpix-S203/prices~linkin_id-7000610http://www.shopping.com/Nikon-Coolpix-S203/info~linkin_id-7000610Nikon Coolpix S203 Digital Camera (Red)With 10.34 mega pixel, electronic VR vibration reduction, 5-level brightness adjustment, 3x optical zoom, and TFT LCD, Nikon Coolpix s203 fulfills all the demands of any photographer. The digital camera has an inbuilt memory of 44MB and an external memory slot made for all kinds of SD (Secure Digital) cards.7185Nikonhttp://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di108.shopping.com/images/di/73/42/64/324a6e4945504d2d415f6c42414d31525a6751-500x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stockFantastic prices with ease & comfort of Amazon.com!139.009.50139.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=566&BEFID=7185&aon=%5E1&MerchantID=301531&crawler_id=1903313&dealId=sBd2JnIEPM-A_lBAM1RZgQ%3D%3D&url=http%3A%2F%2Fwww.amazon.com%2Fdp%2FB002T964IM%2Fref%3Dasc_df_B002T964IM1751618%3Fsmid%3DA22UHVNXG98FAT%26tag%3Ddealtime-ce-mp01feed-20%26linkCode%3Dasn%26creative%3D395105%26creativeASIN%3DB002T964IM&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+Coolpix+S203+Digital+Camera+%28Red%29&dlprc=139.0&crn=&istrsmrc=0&isathrsl=0&AR=63&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=95397883&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=63&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=518&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Amazon Marketplacehttp://img.shopping.com/cctool/merch_logos/301531.gif2132.73http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_amazon_marketplace_9689~MRD-301531~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSB002T964IMNikon S3100 Digital Camera14.5 Megapixel, Compact Camera, 2.7 in. LCD Screen, 5x Optical Zoom, With High Definition Video, Weight: 0.23 lb.This digital camera features a wide-angle optical Zoom-NIKKOR glass lens that allows you to capture anything from landscapes to portraits to action shots. The high-definition movie mode with one-touch recording makes it easy to capture video clips.http://di1.shopping.com/images/pi/66/2d/33/106834268-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=3http://di1.shopping.com/images/pi/66/2d/33/106834268-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=3http://di1.shopping.com/images/pi/66/2d/33/106834268-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=3http://di1.shopping.com/images/pi/66/2d/33/106834268-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=3http://di1.shopping.com/images/pi/66/2d/33/106834268-507x387-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=312.00http://img.shopping.com/sc/pr/sdc_stars_sm_2.gifhttp://www.shopping.com/nikon-s3100/reviews~linkin_id-700061099.95134.95http://www.shopping.com/nikon-s3100/prices~linkin_id-7000610http://www.shopping.com/nikon-s3100/info~linkin_id-7000610CoolPix S3100 14 Megapixel Compact Digital Camera- RedNikon Coolpix S3100 - Digital camera - compact - 14.0 Mpix - optical zoom: 5 x - supported memory: SD, SDXC, SDHC - red7185Nikonhttp://di111.shopping.com/images/di/55/55/79/476f71563872302d78726b6e2d726e474e6267-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/55/55/79/476f71563872302d78726b6e2d726e474e6267-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/55/55/79/476f71563872302d78726b6e2d726e474e6267-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/55/55/79/476f71563872302d78726b6e2d726e474e6267-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stockGet 30 days FREE SHIPPING w/ ShipVantage119.956.95139.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=578&BEFID=7185&aon=%5E1&MerchantID=485615&crawler_id=485615&dealId=UUyGoqV8r0-xrkn-rnGNbg%3D%3D&url=http%3A%2F%2Fsears.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1NbQBJpFHJ3Yx0CTAICI2BbH1lEFmgKP3QvUVpEREdlfUAUHAQPLVpFTVdtJzxAHUNYW3AhQBM0QhFvEXAbYh8EAAVmDAJeU1oyGG0GcBdhGwUGCAVqYF9SO0xSN1sZdmA7dmMdBQAJB24qX1NbQxI6AjA2ME5dVFULPDsGPFcQTTdaLTA6SR0OFlQvPAwMDxYcYlxIVkcoLTcCDA%3D%3D%26nAID%3D13736960%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=CoolPix+S3100+14+Megapixel+Compact+Digital+Camera-+Red&dlprc=119.95&crn=&istrsmrc=1&isathrsl=0&AR=28&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=28&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=1&FS=0&code=&acode=583&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Searshttp://img.shopping.com/cctool/merch_logos/485615.gif1-800-349-43588882.85http://img.shopping.com/sc/mr/sdc_checks_3.gifhttp://www.shopping.com/xMR-store_sears_4189479~MRD-485615~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS00337013000COOLPIX S3100 PinkNikon Coolpix S3100 - Digital camera - compact - 14.0 Mpix - optical zoom: 5 x - supported memory: SD, SDXC, SDHC - pink7185Nikonhttp://di111.shopping.com/images/di/58/38/37/4177586c573164586f4d586b34515144546f51-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di111.shopping.com/images/di/58/38/37/4177586c573164586f4d586b34515144546f51-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di111.shopping.com/images/di/58/38/37/4177586c573164586f4d586b34515144546f51-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di111.shopping.com/images/di/58/38/37/4177586c573164586f4d586b34515144546f51-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2in-stockGet 30 days FREE SHIPPING w/ ShipVantage119.956.95139.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=578&BEFID=7185&aon=%5E1&MerchantID=485615&crawler_id=485615&dealId=X87AwXlW1dXoMXk4QQDToQ%3D%3D&url=http%3A%2F%2Fsears.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1NbQBJpFHJxYx0CTAICI2BbH1lEFmgKP3QvUVpEREdlfUAUHAQPLVpFTVdtJzxAHUNYW3AhQBM0QhFvEXAbYh8EAAVmb2JcUFxDEGsPc3QDEkFZVQ0WFhdRW0MWbgYWDlxzdGMdAVQWRi0xDAwPFhw9TSobb05eWVVYKzsLTFVVQi5RICs3SA8MU1s2MQQKD1wf%26nAID%3D13736960%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=COOLPIX+S3100+Pink&dlprc=119.95&crn=&istrsmrc=1&isathrsl=0&AR=31&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=31&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=1&FS=0&code=&acode=583&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Searshttp://img.shopping.com/cctool/merch_logos/485615.gif1-800-349-43588882.85http://img.shopping.com/sc/mr/sdc_checks_3.gifhttp://www.shopping.com/xMR-store_sears_4189479~MRD-485615~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS00337015000Nikon Coolpix S3100 14.0 MP Digital Camera - SilverNikon Coolpix S3100 14.0 MP Digital Camera - Silver7185Nikonhttp://di109.shopping.com/images/di/6e/76/46/776e70664134726c413144626b736473613077-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di109.shopping.com/images/di/6e/76/46/776e70664134726c413144626b736473613077-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di109.shopping.com/images/di/6e/76/46/776e70664134726c413144626b736473613077-270x270-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3in-stock109.970.00109.97http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=803&BEFID=7185&aon=%5E&MerchantID=475774&crawler_id=475774&dealId=nvFwnpfA4rlA1Dbksdsa0w%3D%3D&url=http%3A%2F%2Fwww.thewiz.com%2Fcatalog%2Fproduct.jsp%3FmodelNo%3DS3100SILVER%26gdftrk%3DgdfV2677_a_7c996_a_7c4049_a_7c26262&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+Coolpix+S3100+14.0+MP+Digital+Camera+-+Silver&dlprc=109.97&crn=&istrsmrc=0&isathrsl=0&AR=33&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=33&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=797&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=TheWiz.comhttp://img.shopping.com/cctool/merch_logos/475774.gif877-542-69880http://img.shopping.com/sc/glb/flag/US.gifUS26262Nikon� COOLPIX� S3100 14MP Digital Camera (Silver)The Nikon COOLPIX S3100 is the easy way to share your life and stay connected.7185Nikonhttp://di102.shopping.com/images/di/35/47/74/614e324e6572794b7770732d5365326c2d3467-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di102.shopping.com/images/di/35/47/74/614e324e6572794b7770732d5365326c2d3467-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di102.shopping.com/images/di/35/47/74/614e324e6572794b7770732d5365326c2d3467-220x220-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4in-stock119.996.05119.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=504&BEFID=7185&aon=%5E1&MerchantID=332477&crawler_id=332477&dealId=5GtaN2NeryKwps-Se2l-4g%3D%3D&url=http%3A%2F%2Ftracking.searchmarketing.com%2Fgsic.asp%3Faid%3D848064082%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon%C3%AF%C2%BF%C2%BD+COOLPIX%C3%AF%C2%BF%C2%BD+S3100+14MP+Digital+Camera+%28Silver%29&dlprc=119.99&crn=&istrsmrc=0&isathrsl=0&AR=37&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=37&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=509&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RadioShackhttp://img.shopping.com/cctool/merch_logos/332477.gif242.25http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_radioshack_9689~MRD-332477~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS10101095COOLPIX S3100 YellowNikon Coolpix S3100 - Digital camera - compact - 14.0 Mpix - optical zoom: 5 x - supported memory: SD, SDXC, SDHC - yellow7185Nikonhttp://di107.shopping.com/images/di/61/34/33/6d305258756c5833387a436e516a5535396a77-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di107.shopping.com/images/di/61/34/33/6d305258756c5833387a436e516a5535396a77-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di107.shopping.com/images/di/61/34/33/6d305258756c5833387a436e516a5535396a77-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di107.shopping.com/images/di/61/34/33/6d305258756c5833387a436e516a5535396a77-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5in-stockGet 30 days FREE SHIPPING w/ ShipVantage119.956.95139.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=578&BEFID=7185&aon=%5E1&MerchantID=485615&crawler_id=485615&dealId=a43m0RXulX38zCnQjU59jw%3D%3D&url=http%3A%2F%2Fsears.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1NbQBJpFHJwYx0CTAICI2BbH1lEFmgKP3QvUVpEREdlfUAUHAQPLVpFTVdtJzxAHUNYW3AhQBM0QhFvEXAbYh8EAAVmb2JcUFxDEGoPc3QDEkFZVQ0WFhdRW0MWbgYWDlxzdGMdAVQWRi0xDAwPFhw9TSobb05eWVVYKzsLTFVVQi5RICs3SA8MU1s2MQQKD1wf%26nAID%3D13736960%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=COOLPIX+S3100+Yellow&dlprc=119.95&crn=&istrsmrc=1&isathrsl=0&AR=38&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=106834268&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=38&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=1&FS=0&code=&acode=583&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Searshttp://img.shopping.com/cctool/merch_logos/485615.gif1-800-349-43588882.85http://img.shopping.com/sc/mr/sdc_checks_3.gifhttp://www.shopping.com/xMR-store_sears_4189479~MRD-485615~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS00337014000Nikon D90 Digital Camera12.3 Megapixel, Point and Shoot Camera, 3 in. LCD Screen, With Video Capability, Weight: 1.36 lb.Untitled Document Nikon D90 SLR Digital Camera With 28-80mm 75-300mm Lens Kit The Nikon D90 SLR Digital Camera, with its 12.3-megapixel DX-format CMOS, 3" High resolution LCD display, Scene Recognition System, Picture Control, Active D-Lighting, and one-button Live View, provides photo enthusiasts with the image quality and performance they need to pursue their own vision while still being intuitive enough for use as an everyday camera.http://di1.shopping.com/images/pi/52/fb/d3/99671132-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=4http://di1.shopping.com/images/pi/52/fb/d3/99671132-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=4http://di1.shopping.com/images/pi/52/fb/d3/99671132-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=4http://di1.shopping.com/images/pi/52/fb/d3/99671132-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=4http://di1.shopping.com/images/pi/52/fb/d3/99671132-499x255-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=475.00http://img.shopping.com/sc/pr/sdc_stars_sm_5.gifhttp://www.shopping.com/Nikon-D90-with-18-270mm-Lens/reviews~linkin_id-7000610689.002299.00http://www.shopping.com/Nikon-D90-with-18-270mm-Lens/prices~linkin_id-7000610http://www.shopping.com/Nikon-D90-with-18-270mm-Lens/info~linkin_id-7000610Nikon® D90 12.3MP Digital SLR Camera (Body Only)The Nikon D90 will make you rethink what a digital SLR camera can achieve.7185Nikonhttp://di106.shopping.com/images/di/47/55/35/4a4a6b70554178653548756a4237666b774141-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di106.shopping.com/images/di/47/55/35/4a4a6b70554178653548756a4237666b774141-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di106.shopping.com/images/di/47/55/35/4a4a6b70554178653548756a4237666b774141-220x220-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stock1015.996.051015.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=504&BEFID=7185&aon=%5E1&MerchantID=332477&crawler_id=332477&dealId=GU5JJkpUAxe5HujB7fkwAA%3D%3D&url=http%3A%2F%2Ftracking.searchmarketing.com%2Fgsic.asp%3Faid%3D851830266%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon%C2%AE+D90+12.3MP+Digital+SLR+Camera+%28Body+Only%29&dlprc=1015.99&crn=&istrsmrc=0&isathrsl=0&AR=14&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=14&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=496&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RadioShackhttp://img.shopping.com/cctool/merch_logos/332477.gif242.25http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_radioshack_9689~MRD-332477~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS10148659Nikon D90 SLR Digital Camera (Camera Body)The Nikon D90 SLR Digital Camera with its 12.3-megapixel DX-format CCD 3" High resolution LCD display Scene Recognition System Picture Control Active D-Lighting and one-button Live View provides photo enthusiasts with the image quality and performance they need to pursue their own vision while still being intuitive enough for use as an everyday camera. In addition the D90 introduces the D-Movie mode allowing for the first time an interchangeable lens SLR camera that is capable of recording 720p HD movie clips. Availabilty: In Stock7185Nikonhttp://di109.shopping.com/images/di/58/68/55/527553432d73704262544944666f3471667a51-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/58/68/55/527553432d73704262544944666f3471667a51-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/58/68/55/527553432d73704262544944666f3471667a51-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di109.shopping.com/images/di/58/68/55/527553432d73704262544944666f3471667a51-350x350-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2in-stockFree Shipping with Any Purchase!689.000.00900.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=647&BEFID=7185&aon=%5E1&MerchantID=475674&crawler_id=475674&dealId=XhURuSC-spBbTIDfo4qfzQ%3D%3D&url=http%3A%2F%2Fwww.fumfie.com%2Fproduct%2F169.5%2Fshopping-com%3F&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+SLR+Digital+Camera+%28Camera+Body%29&dlprc=689.0&crn=&istrsmrc=1&isathrsl=0&AR=16&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=16&cid=&semid1=&semid2=&IsLps=0&CC=1&SL=1&FS=1&code=&acode=658&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=FumFiehttp://img.shopping.com/cctool/merch_logos/475674.gif866 666 91985604.27http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_fumfie~MRD-475674~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSF169C5Nikon D90 SLR w/Nikon 18-105mm VR & 55-200mm VR Lenses12.3 MegapixelDX Format CMOS Sensor3" VGA LCD DisplayLive ViewSelf Cleaning SensorD-Movie ModeHigh Sensitivity (ISO 3200)4.5 fps BurstIn-Camera Image Editing7185Nikonhttp://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di101.shopping.com/images/di/6f/30/50/785f584c5744627278415952793372436d7951-500x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3in-stock1189.000.001189.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=371&BEFID=7185&aon=%5E1&MerchantID=487342&crawler_id=487342&dealId=o0Px_XLWDbrxAYRy3rCmyQ%3D%3D&url=http%3A%2F%2Fwww.rythercamera.com%2Fcatalog%2Fproduct_info.php%3Fcsv%3Dsh%26products_id%3D30619%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+SLR+w%2FNikon+18-105mm+VR+%26+55-200mm+VR+Lenses&dlprc=1189.0&crn=&istrsmrc=0&isathrsl=0&AR=20&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=20&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=379&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RytherCamera.comhttp://img.shopping.com/cctool/merch_logos/487342.gif1-877-644-75930http://img.shopping.com/sc/glb/flag/US.gifUS30619Nikon D90 12.3 Megapixel Digital SLR Camera (Body Only)Fusing 12.3 megapixel image quality and a cinematic 24fps D-Movie Mode, the Nikon D90 exceeds the demands of passionate photographers. Coupled with Nikon's EXPEED image processing technologies and NIKKOR optics, breathtaking image fidelity is assured. Combined with fast 0.15ms power-up and split-second 65ms shooting lag, dramatic action and decisive moments are captured easily. Effective 4-frequency, ultrasonic sensor cleaning frees image degrading dust particles from the sensor's optical low pass filter.7185Nikonhttp://di110.shopping.com/images/di/34/48/67/62574a534a3873736749663842304d58497741-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di110.shopping.com/images/di/34/48/67/62574a534a3873736749663842304d58497741-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di110.shopping.com/images/di/34/48/67/62574a534a3873736749663842304d58497741-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4in-stockFREE FEDEX 2-3 DAY DELIVERY899.950.00899.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=269&BEFID=7185&aon=%5E&MerchantID=9296&crawler_id=811558&dealId=4HgbWJSJ8ssgIf8B0MXIwA%3D%3D&url=http%3A%2F%2Fwww.pcnation.com%2Foptics-gallery%2Fdetails.asp%3Faffid%3D305%26item%3D2N145P&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+12.3+Megapixel+Digital+SLR+Camera+%28Body+Only%29&dlprc=899.95&crn=&istrsmrc=1&isathrsl=0&AR=21&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=21&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=257&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=PCNationhttp://img.shopping.com/cctool/merch_logos/9296.gif800-470-707916224.43http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_pcnation_9689~MRD-9296~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS2N145PNikon D90 12.3MP Digital SLR Camera (Body Only)Fusing 12.3-megapixel image quality inherited from the award-winning D300 with groundbreaking features, the D90's breathtaking, low-noise image quality is further advanced with EXPEED image processing. Split-second shutter response and continuous shooting at up to 4.5 frames-per-second provide the power to capture fast action and precise moments perfectly, while Nikon's exclusive Scene Recognition System contributes to faster 11-area autofocus performance, finer white balance detection and more. The D90 delivers the control passionate photographers demand, utilizing comprehensive exposure functions and the intelligence of 3D Color Matrix Metering II. Stunning results come to life on a 3-inch 920,000-dot color LCD monitor, providing accurate image review, Live View composition and brilliant playback of the D90's cinematic-quality 24-fps HD D-Movie mode.7185Nikonhttp://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di102.shopping.com/images/di/55/4e/44/6133754d445a584f6e76445f377354494c5967-500x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5in-stockFantastic prices with ease & comfort of Amazon.com!780.000.00780.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=566&BEFID=7185&aon=%5E1&MerchantID=301531&crawler_id=1903313&dealId=UNDa3uMDZXOnvD_7sTILYg%3D%3D&url=http%3A%2F%2Fwww.amazon.com%2Fdp%2FB001ET5U92%2Fref%3Dasc_df_B001ET5U921751618%3Fsmid%3DAHF4SYKP09WBH%26tag%3Ddealtime-ce-mp01feed-20%26linkCode%3Dasn%26creative%3D395105%26creativeASIN%3DB001ET5U92&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+12.3MP+Digital+SLR+Camera+%28Body+Only%29&dlprc=780.0&crn=&istrsmrc=0&isathrsl=0&AR=29&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=99671132&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=29&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=520&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Amazon Marketplacehttp://img.shopping.com/cctool/merch_logos/301531.gif2132.73http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_amazon_marketplace_9689~MRD-301531~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUSB001ET5U92Nikon D90 Digital Camera with 18-105mm lens12.9 Megapixel, SLR Camera, 3 in. LCD Screen, 5.8x Optical Zoom, With Video Capability, Weight: 2.3 lb.Its 12.3 megapixel DX-format CMOS image sensor and EXPEED image processing system offer outstanding image quality across a wide ISO light sensitivity range. Live View mode lets you compose and shoot via the high-resolution 3-inch LCD monitor, and an advanced Scene Recognition System and autofocus performance help capture images with astounding accuracy. Movies can be shot in Motion JPEG format using the D-Movie function. The camera’s large image sensor ensures exceptional movie image quality and you can create dramatic effects by shooting with a wide range of interchangeable NIKKOR lenses, from wide-angle to macro to fisheye, or by adjusting the lens aperture and experimenting with depth-of-field. The D90 – designed to fuel your passion for photography.http://di1.shopping.com/images/pi/57/6a/4f/70621646-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5http://di1.shopping.com/images/pi/57/6a/4f/70621646-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5http://di1.shopping.com/images/pi/57/6a/4f/70621646-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5http://di1.shopping.com/images/pi/57/6a/4f/70621646-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5http://di1.shopping.com/images/pi/57/6a/4f/70621646-490x489-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=2&c=1&l=7000610&t=111021183845&r=5324.81http://img.shopping.com/sc/pr/sdc_stars_sm_5.gifhttp://www.shopping.com/Nikon-D90-with-18-105mm-lens/reviews~linkin_id-7000610849.951599.95http://www.shopping.com/Nikon-D90-with-18-105mm-lens/prices~linkin_id-7000610http://www.shopping.com/Nikon-D90-with-18-105mm-lens/info~linkin_id-7000610Nikon D90 18-105mm VR LensThe Nikon D90 SLR Digital Camera with its 12.3-megapixel DX-format CMOS 3" High resolution LCD display Scene Recognition System Picture Control Active D-Lighting and one-button Live View prov7185Nikonhttp://di111.shopping.com/images/di/33/6f/35/6531566768674a5066684c7654314a464b5441-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/33/6f/35/6531566768674a5066684c7654314a464b5441-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1http://di111.shopping.com/images/di/33/6f/35/6531566768674a5066684c7654314a464b5441-260x260-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=1in-stock849.950.00849.95http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=419&BEFID=7185&aon=%5E1&MerchantID=9390&crawler_id=1905054&dealId=3o5e1VghgJPfhLvT1JFKTA%3D%3D&url=http%3A%2F%2Fwww.ajrichard.com%2FNikon-D90-18-105mm-VR-Lens%2Fp-292%3Frefid%3DShopping%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+18-105mm+VR+Lens&dlprc=849.95&crn=&istrsmrc=0&isathrsl=0&AR=2&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=2&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=425&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=AJRichardhttp://img.shopping.com/cctool/merch_logos/9390.gif1-888-871-125631244.48http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_ajrichard~MRD-9390~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS292Nikon D90 SLR w/Nikon 18-105mm VR Lens12.3 MegapixelDX Format CMOS Sensor3" VGA LCD DisplayLive ViewSelf Cleaning SensorD-Movie ModeHigh Sensitivity (ISO 3200)4.5 fps BurstIn-Camera Image Editing7185Nikonhttp://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2http://di108.shopping.com/images/di/5f/6c/59/576a5f6a62776673536b666377556344757777-500x500-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=2in-stock909.000.00909.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=371&BEFID=7185&aon=%5E1&MerchantID=487342&crawler_id=487342&dealId=_lYWj_jbwfsSkfcwUcDuww%3D%3D&url=http%3A%2F%2Fwww.rythercamera.com%2Fcatalog%2Fproduct_info.php%3Fcsv%3Dsh%26products_id%3D30971%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+SLR+w%2FNikon+18-105mm+VR+Lens&dlprc=909.0&crn=&istrsmrc=0&isathrsl=0&AR=3&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=3&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=1&code=&acode=379&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RytherCamera.comhttp://img.shopping.com/cctool/merch_logos/487342.gif1-877-644-75930http://img.shopping.com/sc/glb/flag/US.gifUS3097125448/D90 12.3 Megapixel Digital Camera 18-105mm Zoom Lens w/ 3" Screen - BlackNikon D90 - Digital camera - SLR - 12.3 Mpix - Nikon AF-S DX 18-105mm lens - optical zoom: 5.8 x - supported memory: SD, SDHC7185Nikonhttp://di110.shopping.com/images/di/31/4b/43/636c4347755776747932584b5539736b616467-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di110.shopping.com/images/di/31/4b/43/636c4347755776747932584b5539736b616467-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di110.shopping.com/images/di/31/4b/43/636c4347755776747932584b5539736b616467-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3http://di110.shopping.com/images/di/31/4b/43/636c4347755776747932584b5539736b616467-400x400-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=3in-stockGet 30 days FREE SHIPPING w/ ShipVantage1199.008.201199.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=578&BEFID=7185&aon=%5E1&MerchantID=485615&crawler_id=485615&dealId=1KCclCGuWvty2XKU9skadg%3D%3D&url=http%3A%2F%2Fsears.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1NbQBRtFXpzYx0CTAICI2BbH1lEFmgKP3QvUVpEREdlfUAUHAQPLVpFTVdtJzxAHUNYW3AhQBM0QhFvEXAbYh8EAAVmb2JcVlhCGGkPc3QDEkFZVQ0WFhdRW0MWbgYWDlxzdGMdAVQWRi0xDAwPFhw9TSobb05eWVVYKzsLTFVVQi5RICs3SA8MU1s2MQQKD1wf%26nAID%3D13736960%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=25448%2FD90+12.3+Megapixel+Digital+Camera+18-105mm+Zoom+Lens+w%2F+3%22+Screen+-+Black&dlprc=1199.0&crn=&istrsmrc=1&isathrsl=0&AR=4&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=4&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=586&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=Searshttp://img.shopping.com/cctool/merch_logos/485615.gif1-800-349-43588882.85http://img.shopping.com/sc/mr/sdc_checks_3.gifhttp://www.shopping.com/xMR-store_sears_4189479~MRD-485615~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS00353197000Nikon® D90 12.3MP Digital SLR with 18-105mm LensThe Nikon D90 will make you rethink what a digital SLR camera can achieve.7185Nikonhttp://di101.shopping.com/images/di/33/2d/56/4f53665656354a6f37486c41346b4a74616e41-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di101.shopping.com/images/di/33/2d/56/4f53665656354a6f37486c41346b4a74616e41-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4http://di101.shopping.com/images/di/33/2d/56/4f53665656354a6f37486c41346b4a74616e41-220x220-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=4in-stock1350.996.051350.99http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=504&BEFID=7185&aon=%5E1&MerchantID=332477&crawler_id=332477&dealId=3-VOSfVV5Jo7HlA4kJtanA%3D%3D&url=http%3A%2F%2Ftracking.searchmarketing.com%2Fgsic.asp%3Faid%3D982673361%26&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon%C2%AE+D90+12.3MP+Digital+SLR+with+18-105mm+Lens&dlprc=1350.99&crn=&istrsmrc=0&isathrsl=0&AR=5&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=5&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=0&FS=0&code=&acode=496&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=RadioShackhttp://img.shopping.com/cctool/merch_logos/332477.gif242.25http://img.shopping.com/sc/mr/sdc_checks_25.gifhttp://www.shopping.com/xMR-store_radioshack_9689~MRD-332477~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS11148905Nikon D90 Kit 12.3-megapixel Digital SLR with 18-105mm VR LensPhotographers, take your passion further!Now is the time for new creativity, and to rethink what a digital SLR camera can achieve. It's time for the D90, a camera with everything you would expect from Nikon's next-generation D-SLRs, and some unexpected surprises, as well. The stunning image quality is inherited from the D300, Nikon's DX-format flagship. The D90 also has Nikon's unmatched ergonomics and high performance, and now takes high-quality movies with beautifully cinematic results. The world of photography has changed, and with the D90 in your hands, it's time to make your own rules.AF-S DX NIKKOR 18-105mm f/3.5-5.6G ED VR LensWide-ratio 5.8x zoom Compact, versatile and ideal for a broad range of shooting situations, ranging from interiors and landscapes to beautiful portraits� a perfect everyday zoom. Nikon VR (Vibration Reduction) image stabilization Vibration Reduction is engineered specifically for each VR NIKKOR lens and enables handheld shooting at up to 3 shutter speeds slower than would7185Nikonhttp://di110.shopping.com/images/di/6b/51/6e/4236725334416a4e3564783568325f36333167-100x100-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di110.shopping.com/images/di/6b/51/6e/4236725334416a4e3564783568325f36333167-200x200-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di110.shopping.com/images/di/6b/51/6e/4236725334416a4e3564783568325f36333167-300x300-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://img.shopping.com/sc/ds/no_image_100X100.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5http://di110.shopping.com/images/di/6b/51/6e/4236725334416a4e3564783568325f36333167-300x232-0-0.jpg?p=p2.a121bc2aaf029435dce6&a=1&c=1&l=7000610&t=111021183845&r=5in-stockShipping Included!1050.000.001199.00http://statTest.dealtime.com/DealFrame/DealFrame.cmp?bm=135&BEFID=7185&aon=%5E1&MerchantID=313162&crawler_id=313162&dealId=kQnB6rS4AjN5dx5h2_631g%3D%3D&url=http%3A%2F%2Fonecall.rdr.channelintelligence.com%2Fgo.asp%3FfVhzOGNRAAQIASNiE1pZSxNoWHFwLx8GTAICa2ZeH1sPXTZLNzRpAh1HR0BxPQEGCBJNMhFHUElsFCFCVkVTTHAcBggEHQ4aHXNpGERGH3RQODsbAgdechJtbBt8fx8JAwhtZFAzJj1oGgIWCxRlNyFOUV9UUGIxBgo0T0IyTSYqJ0RWHw4QPCIBAAQXRGMDICg6TllZVBhh%26nAID%3D13736960&linkin_id=7000610&Issdt=111021183845&searchID=p2.a121bc2aaf029435dce6&DealName=Nikon+D90+Kit+12.3-megapixel+Digital+SLR+with+18-105mm+VR+Lens&dlprc=1050.0&crn=&istrsmrc=1&isathrsl=0&AR=6&NG=20&NDP=200&PN=1&ST=7&DB=sdcprod&MT=phx-pkadudc2&FPT=DSP&NDS=&NMS=&MRS=&PD=70621646&brnId=14804&IsFtr=0&IsSmart=0&DMT=&op=&CM=&DlLng=1&RR=6&cid=&semid1=&semid2=&IsLps=0&CC=0&SL=1&FS=1&code=&acode=143&category=&HasLink=&frameId=&ND=&MN=&PT=&prjID=&GR=&lnkId=&VK=OneCallhttp://img.shopping.com/cctool/merch_logos/313162.gif1.800.398.07661804.44http://img.shopping.com/sc/mr/sdc_checks_45.gifhttp://www.shopping.com/xMR-store_onecall_9689~MRD-313162~S-1~linkin_id-7000610http://img.shopping.com/sc/glb/flag/US.gifUS92826Price rangehttp://www.shopping.com/digital-cameras/nikon/products?oq=nikon&linkin_id=7000610$24 - $4012http://www.shopping.com/digital-cameras/nikon/products?minPrice=24&maxPrice=4012&linkin_id=7000610$4012 - $7999http://www.shopping.com/digital-cameras/nikon/products?minPrice=4012&maxPrice=7999&linkin_id=7000610Brandhttp://www.shopping.com/digital-cameras/nikon/products~all-9688-brand~MS-1?oq=nikon&linkin_id=7000610Nikonhttp://www.shopping.com/digital-cameras/nikon+brand-nikon/products~linkin_id-7000610Cranehttp://www.shopping.com/digital-cameras/nikon+9688-brand-crane/products~linkin_id-7000610Ikelitehttp://www.shopping.com/digital-cameras/nikon+ikelite/products~linkin_id-7000610Bowerhttp://www.shopping.com/digital-cameras/nikon+bower/products~linkin_id-7000610FUJIFILMhttp://www.shopping.com/digital-cameras/nikon+brand-fuji/products~linkin_id-7000610Storehttp://www.shopping.com/digital-cameras/nikon/products~all-store~MS-1?oq=nikon&linkin_id=7000610Amazon Marketplacehttp://www.shopping.com/digital-cameras/nikon+store-amazon-marketplace-9689/products~linkin_id-7000610Amazonhttp://www.shopping.com/digital-cameras/nikon+store-amazon/products~linkin_id-7000610Adoramahttp://www.shopping.com/digital-cameras/nikon+store-adorama/products~linkin_id-7000610J&R Music and Computer Worldhttp://www.shopping.com/digital-cameras/nikon+store-j-r-music-and-computer-world/products~linkin_id-7000610RytherCamera.comhttp://www.shopping.com/digital-cameras/nikon+store-rythercamera-com/products~linkin_id-7000610Resolutionhttp://www.shopping.com/digital-cameras/nikon/products~all-21885-resolution~MS-1?oq=nikon&linkin_id=7000610Under 4 Megapixelhttp://www.shopping.com/digital-cameras/nikon+under-4-megapixel/products~linkin_id-7000610At least 5 Megapixelhttp://www.shopping.com/digital-cameras/nikon+5-megapixel-digital-cameras/products~linkin_id-7000610At least 6 Megapixelhttp://www.shopping.com/digital-cameras/nikon+6-megapixel-digital-cameras/products~linkin_id-7000610At least 7 Megapixelhttp://www.shopping.com/digital-cameras/nikon+7-megapixel-digital-cameras/products~linkin_id-7000610At least 8 Megapixelhttp://www.shopping.com/digital-cameras/nikon+8-megapixel-digital-cameras/products~linkin_id-7000610Featureshttp://www.shopping.com/digital-cameras/nikon/products~all-32804-features~MS-1?oq=nikon&linkin_id=7000610Shockproofhttp://www.shopping.com/digital-cameras/nikon+32804-features-shockproof/products~linkin_id-7000610Waterproofhttp://www.shopping.com/digital-cameras/nikon+32804-features-waterproof/products~linkin_id-7000610Freezeproofhttp://www.shopping.com/digital-cameras/nikon+32804-features-freezeproof/products~linkin_id-7000610Dust proofhttp://www.shopping.com/digital-cameras/nikon+32804-features-dust-proof/products~linkin_id-7000610Image Stabilizationhttp://www.shopping.com/digital-cameras/nikon+32804-features-image-stabilization/products~linkin_id-7000610hybriddigital camerag1sonycameracanonnikonkodak digital camerakodaksony cybershotkodak easyshare digital cameranikon coolpixolympuspink digital cameracanon powershot \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/strict.dtd b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/strict.dtd deleted file mode 100644 index b274559..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/strict.dtd +++ /dev/null @@ -1,870 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%HTMLlat1; - - -%HTMLsymbol; - - -%HTMLspecial; - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/test.html b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/test.html deleted file mode 100644 index 61f8f1a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/test.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - testing the parser - - - -

                      hello - - - - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/test.xml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/test.xml deleted file mode 100644 index 801292d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/examples/test.xml +++ /dev/null @@ -1,1254 +0,0 @@ - - -]> - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - - Some Text - - - - - - - are ok in here. ]]> - - Pre-Text & Inlined text Post-text. -  - - \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/lib/sax.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/lib/sax.js deleted file mode 100644 index 77e20ae..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/lib/sax.js +++ /dev/null @@ -1,1329 +0,0 @@ -// wrapper for non-node envs -;(function (sax) { - -sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } -sax.SAXParser = SAXParser -sax.SAXStream = SAXStream -sax.createStream = createStream - -// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. -// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), -// since that's the earliest that a buffer overrun could occur. This way, checks are -// as rare as required, but as often as necessary to ensure never crossing this bound. -// Furthermore, buffers are only tested at most once per write(), so passing a very -// large string into write() might have undesirable effects, but this is manageable by -// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme -// edge case, result in creating at most one complete copy of the string passed in. -// Set to Infinity to have unlimited buffers. -sax.MAX_BUFFER_LENGTH = 64 * 1024 - -var buffers = [ - "comment", "sgmlDecl", "textNode", "tagName", "doctype", - "procInstName", "procInstBody", "entity", "attribName", - "attribValue", "cdata", "script" -] - -sax.EVENTS = // for discoverability. - [ "text" - , "processinginstruction" - , "sgmldeclaration" - , "doctype" - , "comment" - , "attribute" - , "opentag" - , "closetag" - , "opencdata" - , "cdata" - , "closecdata" - , "error" - , "end" - , "ready" - , "script" - , "opennamespace" - , "closenamespace" - ] - -function SAXParser (strict, opt) { - if (!(this instanceof SAXParser)) return new SAXParser(strict, opt) - - var parser = this - clearBuffers(parser) - parser.q = parser.c = "" - parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - parser.opt = opt || {} - parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags - parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase" - parser.tags = [] - parser.closed = parser.closedRoot = parser.sawRoot = false - parser.tag = parser.error = null - parser.strict = !!strict - parser.noscript = !!(strict || parser.opt.noscript) - parser.state = S.BEGIN - parser.ENTITIES = Object.create(sax.ENTITIES) - parser.attribList = [] - - // namespaces form a prototype chain. - // it always points at the current tag, - // which protos to its parent tag. - if (parser.opt.xmlns) parser.ns = Object.create(rootNS) - - // mostly just for error reporting - parser.trackPosition = parser.opt.position !== false - if (parser.trackPosition) { - parser.position = parser.line = parser.column = 0 - } - emit(parser, "onready") -} - -if (!Object.create) Object.create = function (o) { - function f () { this.__proto__ = o } - f.prototype = o - return new f -} - -if (!Object.getPrototypeOf) Object.getPrototypeOf = function (o) { - return o.__proto__ -} - -if (!Object.keys) Object.keys = function (o) { - var a = [] - for (var i in o) if (o.hasOwnProperty(i)) a.push(i) - return a -} - -function checkBufferLength (parser) { - var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) - , maxActual = 0 - for (var i = 0, l = buffers.length; i < l; i ++) { - var len = parser[buffers[i]].length - if (len > maxAllowed) { - // Text/cdata nodes can get big, and since they're buffered, - // we can get here under normal conditions. - // Avoid issues by emitting the text node now, - // so at least it won't get any bigger. - switch (buffers[i]) { - case "textNode": - closeText(parser) - break - - case "cdata": - emitNode(parser, "oncdata", parser.cdata) - parser.cdata = "" - break - - case "script": - emitNode(parser, "onscript", parser.script) - parser.script = "" - break - - default: - error(parser, "Max buffer length exceeded: "+buffers[i]) - } - } - maxActual = Math.max(maxActual, len) - } - // schedule the next check for the earliest possible buffer overrun. - parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) - + parser.position -} - -function clearBuffers (parser) { - for (var i = 0, l = buffers.length; i < l; i ++) { - parser[buffers[i]] = "" - } -} - -SAXParser.prototype = - { end: function () { end(this) } - , write: write - , resume: function () { this.error = null; return this } - , close: function () { return this.write(null) } - } - -try { - var Stream = require("stream").Stream -} catch (ex) { - var Stream = function () {} -} - - -var streamWraps = sax.EVENTS.filter(function (ev) { - return ev !== "error" && ev !== "end" -}) - -function createStream (strict, opt) { - return new SAXStream(strict, opt) -} - -function SAXStream (strict, opt) { - if (!(this instanceof SAXStream)) return new SAXStream(strict, opt) - - Stream.apply(this) - - this._parser = new SAXParser(strict, opt) - this.writable = true - this.readable = true - - - var me = this - - this._parser.onend = function () { - me.emit("end") - } - - this._parser.onerror = function (er) { - me.emit("error", er) - - // if didn't throw, then means error was handled. - // go ahead and clear error, so we can write again. - me._parser.error = null - } - - this._decoder = null; - - streamWraps.forEach(function (ev) { - Object.defineProperty(me, "on" + ev, { - get: function () { return me._parser["on" + ev] }, - set: function (h) { - if (!h) { - me.removeAllListeners(ev) - return me._parser["on"+ev] = h - } - me.on(ev, h) - }, - enumerable: true, - configurable: false - }) - }) -} - -SAXStream.prototype = Object.create(Stream.prototype, - { constructor: { value: SAXStream } }) - -SAXStream.prototype.write = function (data) { - if (typeof Buffer === 'function' && - typeof Buffer.isBuffer === 'function' && - Buffer.isBuffer(data)) { - if (!this._decoder) { - var SD = require('string_decoder').StringDecoder - this._decoder = new SD('utf8') - } - data = this._decoder.write(data); - } - - this._parser.write(data.toString()) - this.emit("data", data) - return true -} - -SAXStream.prototype.end = function (chunk) { - if (chunk && chunk.length) this.write(chunk) - else if (this.leftovers) this._parser.write(this.leftovers.toString()) - this._parser.end() - return true -} - -SAXStream.prototype.on = function (ev, handler) { - var me = this - if (!me._parser["on"+ev] && streamWraps.indexOf(ev) !== -1) { - me._parser["on"+ev] = function () { - var args = arguments.length === 1 ? [arguments[0]] - : Array.apply(null, arguments) - args.splice(0, 0, ev) - me.emit.apply(me, args) - } - } - - return Stream.prototype.on.call(me, ev, handler) -} - - - -// character classes and tokens -var whitespace = "\r\n\t " - // this really needs to be replaced with character classes. - // XML allows all manner of ridiculous numbers and digits. - , number = "0124356789" - , letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - // (Letter | "_" | ":") - , quote = "'\"" - , entity = number+letter+"#" - , attribEnd = whitespace + ">" - , CDATA = "[CDATA[" - , DOCTYPE = "DOCTYPE" - , XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace" - , XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/" - , rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } - -// turn all the string character sets into character class objects. -whitespace = charClass(whitespace) -number = charClass(number) -letter = charClass(letter) - -// http://www.w3.org/TR/REC-xml/#NT-NameStartChar -// This implementation works on strings, a single character at a time -// as such, it cannot ever support astral-plane characters (10000-EFFFF) -// without a significant breaking change to either this parser, or the -// JavaScript language. Implementation of an emoji-capable xml parser -// is left as an exercise for the reader. -var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ - -var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/ - -quote = charClass(quote) -entity = charClass(entity) -attribEnd = charClass(attribEnd) - -function charClass (str) { - return str.split("").reduce(function (s, c) { - s[c] = true - return s - }, {}) -} - -function isRegExp (c) { - return Object.prototype.toString.call(c) === '[object RegExp]' -} - -function is (charclass, c) { - return isRegExp(charclass) ? !!c.match(charclass) : charclass[c] -} - -function not (charclass, c) { - return !is(charclass, c) -} - -var S = 0 -sax.STATE = -{ BEGIN : S++ -, TEXT : S++ // general stuff -, TEXT_ENTITY : S++ // & and such. -, OPEN_WAKA : S++ // < -, SGML_DECL : S++ // -, SCRIPT : S++ // " - , expect : - [ [ "opentag", { name: "xml", attributes: {}, isSelfClosing: false } ] - , [ "opentag", { name: "script", attributes: {}, isSelfClosing: false } ] - , [ "text", "hello world" ] - , [ "closetag", "script" ] - , [ "closetag", "xml" ] - ] - , strict : false - , opt : { lowercasetags: true, noscript: true } - } - ) - -require(__dirname).test - ( { xml : "" - , expect : - [ [ "opentag", { name: "xml", attributes: {}, isSelfClosing: false } ] - , [ "opentag", { name: "script", attributes: {}, isSelfClosing: false } ] - , [ "opencdata", undefined ] - , [ "cdata", "hello world" ] - , [ "closecdata", undefined ] - , [ "closetag", "script" ] - , [ "closetag", "xml" ] - ] - , strict : false - , opt : { lowercasetags: true, noscript: true } - } - ) - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/issue-84.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/issue-84.js deleted file mode 100644 index 0e7ee69..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/issue-84.js +++ /dev/null @@ -1,13 +0,0 @@ -// https://github.com/isaacs/sax-js/issues/49 -require(__dirname).test - ( { xml : "body" - , expect : - [ [ "processinginstruction", { name: "has", body: "unbalanced \"quotes" } ], - [ "opentag", { name: "xml", attributes: {}, isSelfClosing: false } ] - , [ "text", "body" ] - , [ "closetag", "xml" ] - ] - , strict : false - , opt : { lowercasetags: true, noscript: true } - } - ) diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/parser-position.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/parser-position.js deleted file mode 100644 index e4a68b1..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/parser-position.js +++ /dev/null @@ -1,28 +0,0 @@ -var sax = require("../lib/sax"), - assert = require("assert") - -function testPosition(chunks, expectedEvents) { - var parser = sax.parser(); - expectedEvents.forEach(function(expectation) { - parser['on' + expectation[0]] = function() { - for (var prop in expectation[1]) { - assert.equal(parser[prop], expectation[1][prop]); - } - } - }); - chunks.forEach(function(chunk) { - parser.write(chunk); - }); -}; - -testPosition(['

                      abcdefgh
                      '], - [ ['opentag', { position: 5, startTagPosition: 1 }] - , ['text', { position: 19, startTagPosition: 14 }] - , ['closetag', { position: 19, startTagPosition: 14 }] - ]); - -testPosition(['
                      abcde','fgh
                      '], - [ ['opentag', { position: 5, startTagPosition: 1 }] - , ['text', { position: 19, startTagPosition: 14 }] - , ['closetag', { position: 19, startTagPosition: 14 }] - ]); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/script-close-better.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/script-close-better.js deleted file mode 100644 index f4887b9..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/script-close-better.js +++ /dev/null @@ -1,12 +0,0 @@ -require(__dirname).test({ - xml : "", - expect : [ - ["opentag", {"name": "HTML","attributes": {}, isSelfClosing: false}], - ["opentag", {"name": "HEAD","attributes": {}, isSelfClosing: false}], - ["opentag", {"name": "SCRIPT","attributes": {}, isSelfClosing: false}], - ["script", "'
                      foo
                      ", - expect : [ - ["opentag", {"name": "HTML","attributes": {}, "isSelfClosing": false}], - ["opentag", {"name": "HEAD","attributes": {}, "isSelfClosing": false}], - ["opentag", {"name": "SCRIPT","attributes": {}, "isSelfClosing": false}], - ["script", "if (1 < 0) { console.log('elo there'); }"], - ["closetag", "SCRIPT"], - ["closetag", "HEAD"], - ["closetag", "HTML"] - ] -}); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-child-strict.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-child-strict.js deleted file mode 100644 index 3d6e985..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-child-strict.js +++ /dev/null @@ -1,44 +0,0 @@ - -require(__dirname).test({ - xml : - ""+ - "" + - "" + - "" + - "" + - "=(|)" + - "" + - "", - expect : [ - ["opentag", { - "name": "root", - "attributes": {}, - "isSelfClosing": false - }], - ["opentag", { - "name": "child", - "attributes": {}, - "isSelfClosing": false - }], - ["opentag", { - "name": "haha", - "attributes": {}, - "isSelfClosing": true - }], - ["closetag", "haha"], - ["closetag", "child"], - ["opentag", { - "name": "monkey", - "attributes": {}, - "isSelfClosing": false - }], - ["text", "=(|)"], - ["closetag", "monkey"], - ["closetag", "root"], - ["end"], - ["ready"] - ], - strict : true, - opt : {} -}); - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-child.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-child.js deleted file mode 100644 index f31c366..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-child.js +++ /dev/null @@ -1,44 +0,0 @@ - -require(__dirname).test({ - xml : - ""+ - "" + - "" + - "" + - "" + - "=(|)" + - "" + - "", - expect : [ - ["opentag", { - "name": "ROOT", - "attributes": {}, - "isSelfClosing": false - }], - ["opentag", { - "name": "CHILD", - "attributes": {}, - "isSelfClosing": false - }], - ["opentag", { - "name": "HAHA", - "attributes": {}, - "isSelfClosing": true - }], - ["closetag", "HAHA"], - ["closetag", "CHILD"], - ["opentag", { - "name": "MONKEY", - "attributes": {}, - "isSelfClosing": false - }], - ["text", "=(|)"], - ["closetag", "MONKEY"], - ["closetag", "ROOT"], - ["end"], - ["ready"] - ], - strict : false, - opt : {} -}); - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-tag.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-tag.js deleted file mode 100644 index d1d8b7c..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/self-closing-tag.js +++ /dev/null @@ -1,25 +0,0 @@ - -require(__dirname).test({ - xml : - " "+ - " "+ - " "+ - " "+ - "=(|) "+ - ""+ - " ", - expect : [ - ["opentag", {name:"ROOT", attributes:{}, isSelfClosing: false}], - ["opentag", {name:"HAHA", attributes:{}, isSelfClosing: true}], - ["closetag", "HAHA"], - ["opentag", {name:"HAHA", attributes:{}, isSelfClosing: true}], - ["closetag", "HAHA"], - // ["opentag", {name:"HAHA", attributes:{}}], - // ["closetag", "HAHA"], - ["opentag", {name:"MONKEY", attributes:{}, isSelfClosing: false}], - ["text", "=(|)"], - ["closetag", "MONKEY"], - ["closetag", "ROOT"] - ], - opt : { trim : true } -}); \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/stray-ending.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/stray-ending.js deleted file mode 100644 index bec467b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/stray-ending.js +++ /dev/null @@ -1,17 +0,0 @@ -// stray ending tags should just be ignored in non-strict mode. -// https://github.com/isaacs/sax-js/issues/32 -require(__dirname).test - ( { xml : - "" - , expect : - [ [ "opentag", { name: "A", attributes: {}, isSelfClosing: false } ] - , [ "opentag", { name: "B", attributes: {}, isSelfClosing: false } ] - , [ "text", "" ] - , [ "closetag", "B" ] - , [ "closetag", "A" ] - ] - , strict : false - , opt : {} - } - ) - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/trailing-attribute-no-value.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/trailing-attribute-no-value.js deleted file mode 100644 index 222837f..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/trailing-attribute-no-value.js +++ /dev/null @@ -1,10 +0,0 @@ - -require(__dirname).test({ - xml : - "", - expect : [ - ["attribute", {name:"ATTRIB", value:"attrib"}], - ["opentag", {name:"ROOT", attributes:{"ATTRIB":"attrib"}, isSelfClosing: false}] - ], - opt : { trim : true } -}); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/trailing-non-whitespace.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/trailing-non-whitespace.js deleted file mode 100644 index 619578b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/trailing-non-whitespace.js +++ /dev/null @@ -1,18 +0,0 @@ - -require(__dirname).test({ - xml : "Welcome, to monkey land", - expect : [ - ["opentag", { - "name": "SPAN", - "attributes": {}, - isSelfClosing: false - }], - ["text", "Welcome,"], - ["closetag", "SPAN"], - ["text", " to monkey land"], - ["end"], - ["ready"] - ], - strict : false, - opt : {} -}); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/unclosed-root.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/unclosed-root.js deleted file mode 100644 index f4eeac6..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/unclosed-root.js +++ /dev/null @@ -1,11 +0,0 @@ -require(__dirname).test - ( { xml : "" - - , expect : - [ [ "opentag", { name: "root", attributes: {}, isSelfClosing: false } ] - , [ "error", "Unclosed root tag\nLine: 0\nColumn: 6\nChar: " ] - ] - , strict : true - , opt : {} - } - ) diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/unquoted.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/unquoted.js deleted file mode 100644 index b3a9a81..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/unquoted.js +++ /dev/null @@ -1,18 +0,0 @@ -// unquoted attributes should be ok in non-strict mode -// https://github.com/isaacs/sax-js/issues/31 -require(__dirname).test - ( { xml : - "" - , expect : - [ [ "attribute", { name: "CLASS", value: "test" } ] - , [ "attribute", { name: "HELLO", value: "world" } ] - , [ "opentag", { name: "SPAN", - attributes: { CLASS: "test", HELLO: "world" }, - isSelfClosing: false } ] - , [ "closetag", "SPAN" ] - ] - , strict : false - , opt : {} - } - ) - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/utf8-split.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/utf8-split.js deleted file mode 100644 index e22bc10..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/utf8-split.js +++ /dev/null @@ -1,32 +0,0 @@ -var assert = require('assert') -var saxStream = require('../lib/sax').createStream() - -var b = new Buffer('误') - -saxStream.on('text', function(text) { - assert.equal(text, b.toString()) -}) - -saxStream.write(new Buffer('')) -saxStream.write(b.slice(0, 1)) -saxStream.write(b.slice(1)) -saxStream.write(new Buffer('')) -saxStream.write(b.slice(0, 2)) -saxStream.write(b.slice(2)) -saxStream.write(new Buffer('')) -saxStream.write(b) -saxStream.write(new Buffer('')) -saxStream.write(Buffer.concat([new Buffer(''), b.slice(0, 1)])) -saxStream.end(Buffer.concat([b.slice(1), new Buffer('')])) - -var saxStream2 = require('../lib/sax').createStream() - -saxStream2.on('text', function(text) { - assert.equal(text, '�') -}); - -saxStream2.write(new Buffer('')); -saxStream2.write(new Buffer([0xC0])); -saxStream2.write(new Buffer('')); -saxStream2.write(Buffer.concat([new Buffer(''), b.slice(0,1)])); -saxStream2.end(); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-issue-41.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-issue-41.js deleted file mode 100644 index 17ab45a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-issue-41.js +++ /dev/null @@ -1,68 +0,0 @@ -var t = require(__dirname) - - , xmls = // should be the same both ways. - [ "" - , "" ] - - , ex1 = - [ [ "opennamespace" - , { prefix: "a" - , uri: "http://ATTRIBUTE" - } - ] - , [ "attribute" - , { name: "xmlns:a" - , value: "http://ATTRIBUTE" - , prefix: "xmlns" - , local: "a" - , uri: "http://www.w3.org/2000/xmlns/" - } - ] - , [ "attribute" - , { name: "a:attr" - , local: "attr" - , prefix: "a" - , uri: "http://ATTRIBUTE" - , value: "value" - } - ] - , [ "opentag" - , { name: "parent" - , uri: "" - , prefix: "" - , local: "parent" - , attributes: - { "a:attr": - { name: "a:attr" - , local: "attr" - , prefix: "a" - , uri: "http://ATTRIBUTE" - , value: "value" - } - , "xmlns:a": - { name: "xmlns:a" - , local: "a" - , prefix: "xmlns" - , uri: "http://www.w3.org/2000/xmlns/" - , value: "http://ATTRIBUTE" - } - } - , ns: {"a": "http://ATTRIBUTE"} - , isSelfClosing: true - } - ] - , ["closetag", "parent"] - , ["closenamespace", { prefix: "a", uri: "http://ATTRIBUTE" }] - ] - - // swap the order of elements 2 and 1 - , ex2 = [ex1[0], ex1[2], ex1[1]].concat(ex1.slice(3)) - , expected = [ex1, ex2] - -xmls.forEach(function (x, i) { - t.test({ xml: x - , expect: expected[i] - , strict: true - , opt: { xmlns: true } - }) -}) diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-rebinding.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-rebinding.js deleted file mode 100644 index 07e0425..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-rebinding.js +++ /dev/null @@ -1,63 +0,0 @@ - -require(__dirname).test - ( { xml : - ""+ - ""+ - ""+ - ""+ - ""+ - "" - - , expect : - [ [ "opennamespace", { prefix: "x", uri: "x1" } ] - , [ "opennamespace", { prefix: "y", uri: "y1" } ] - , [ "attribute", { name: "xmlns:x", value: "x1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } ] - , [ "attribute", { name: "xmlns:y", value: "y1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "y" } ] - , [ "attribute", { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } ] - , [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ] - , [ "opentag", { name: "root", uri: "", prefix: "", local: "root", - attributes: { "xmlns:x": { name: "xmlns:x", value: "x1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } - , "xmlns:y": { name: "xmlns:y", value: "y1", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "y" } - , "x:a": { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } - , "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } }, - ns: { x: 'x1', y: 'y1' }, - isSelfClosing: false } ] - - , [ "opennamespace", { prefix: "x", uri: "x2" } ] - , [ "attribute", { name: "xmlns:x", value: "x2", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } ] - , [ "opentag", { name: "rebind", uri: "", prefix: "", local: "rebind", - attributes: { "xmlns:x": { name: "xmlns:x", value: "x2", uri: "http://www.w3.org/2000/xmlns/", prefix: "xmlns", local: "x" } }, - ns: { x: 'x2' }, - isSelfClosing: false } ] - - , [ "attribute", { name: "x:a", value: "x2", uri: "x2", prefix: "x", local: "a" } ] - , [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ] - , [ "opentag", { name: "check", uri: "", prefix: "", local: "check", - attributes: { "x:a": { name: "x:a", value: "x2", uri: "x2", prefix: "x", local: "a" } - , "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } }, - ns: { x: 'x2' }, - isSelfClosing: true } ] - - , [ "closetag", "check" ] - - , [ "closetag", "rebind" ] - , [ "closenamespace", { prefix: "x", uri: "x2" } ] - - , [ "attribute", { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } ] - , [ "attribute", { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } ] - , [ "opentag", { name: "check", uri: "", prefix: "", local: "check", - attributes: { "x:a": { name: "x:a", value: "x1", uri: "x1", prefix: "x", local: "a" } - , "y:a": { name: "y:a", value: "y1", uri: "y1", prefix: "y", local: "a" } }, - ns: { x: 'x1', y: 'y1' }, - isSelfClosing: true } ] - , [ "closetag", "check" ] - - , [ "closetag", "root" ] - , [ "closenamespace", { prefix: "x", uri: "x1" } ] - , [ "closenamespace", { prefix: "y", uri: "y1" } ] - ] - , strict : true - , opt : { xmlns: true } - } - ) - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-strict.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-strict.js deleted file mode 100644 index b5e3e51..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-strict.js +++ /dev/null @@ -1,74 +0,0 @@ - -require(__dirname).test - ( { xml : - ""+ - ""+ - ""+ - ""+ - ""+ - ""+ - ""+ - ""+ - ""+ - "" - - , expect : - [ [ "opentag", { name: "root", prefix: "", local: "root", uri: "", - attributes: {}, ns: {}, isSelfClosing: false } ] - - , [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } ] - , [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "", - attributes: { "attr": { name: "attr", value: "normal", uri: "", prefix: "", local: "attr", uri: "" } }, - ns: {}, isSelfClosing: true } ] - , [ "closetag", "plain" ] - - , [ "opennamespace", { prefix: "", uri: "uri:default" } ] - - , [ "attribute", { name: "xmlns", value: "uri:default", prefix: "xmlns", local: "", uri: "http://www.w3.org/2000/xmlns/" } ] - , [ "opentag", { name: "ns1", prefix: "", local: "ns1", uri: "uri:default", - attributes: { "xmlns": { name: "xmlns", value: "uri:default", prefix: "xmlns", local: "", uri: "http://www.w3.org/2000/xmlns/" } }, - ns: { "": "uri:default" }, isSelfClosing: false } ] - - , [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } ] - , [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "uri:default", ns: { '': 'uri:default' }, - attributes: { "attr": { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } }, - isSelfClosing: true } ] - , [ "closetag", "plain" ] - - , [ "closetag", "ns1" ] - - , [ "closenamespace", { prefix: "", uri: "uri:default" } ] - - , [ "opennamespace", { prefix: "a", uri: "uri:nsa" } ] - - , [ "attribute", { name: "xmlns:a", value: "uri:nsa", prefix: "xmlns", local: "a", uri: "http://www.w3.org/2000/xmlns/" } ] - - , [ "opentag", { name: "ns2", prefix: "", local: "ns2", uri: "", - attributes: { "xmlns:a": { name: "xmlns:a", value: "uri:nsa", prefix: "xmlns", local: "a", uri: "http://www.w3.org/2000/xmlns/" } }, - ns: { a: "uri:nsa" }, isSelfClosing: false } ] - - , [ "attribute", { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } ] - , [ "opentag", { name: "plain", prefix: "", local: "plain", uri: "", - attributes: { "attr": { name: "attr", value: "normal", prefix: "", local: "attr", uri: "" } }, - ns: { a: 'uri:nsa' }, - isSelfClosing: true } ] - , [ "closetag", "plain" ] - - , [ "attribute", { name: "a:attr", value: "namespaced", prefix: "a", local: "attr", uri: "uri:nsa" } ] - , [ "opentag", { name: "a:ns", prefix: "a", local: "ns", uri: "uri:nsa", - attributes: { "a:attr": { name: "a:attr", value: "namespaced", prefix: "a", local: "attr", uri: "uri:nsa" } }, - ns: { a: 'uri:nsa' }, - isSelfClosing: true } ] - , [ "closetag", "a:ns" ] - - , [ "closetag", "ns2" ] - - , [ "closenamespace", { prefix: "a", uri: "uri:nsa" } ] - - , [ "closetag", "root" ] - ] - , strict : true - , opt : { xmlns: true } - } - ) - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-unbound-element.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-unbound-element.js deleted file mode 100644 index 9d031a2..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-unbound-element.js +++ /dev/null @@ -1,33 +0,0 @@ -require(__dirname).test( - { strict : true - , opt : { xmlns: true } - , expect : - [ [ "error", "Unbound namespace prefix: \"unbound:root\"\nLine: 0\nColumn: 15\nChar: >"] - , [ "opentag", { name: "unbound:root", uri: "unbound", prefix: "unbound", local: "root" - , attributes: {}, ns: {}, isSelfClosing: true } ] - , [ "closetag", "unbound:root" ] - ] - } -).write(""); - -require(__dirname).test( - { strict : true - , opt : { xmlns: true } - , expect : - [ [ "opennamespace", { prefix: "unbound", uri: "someuri" } ] - , [ "attribute", { name: 'xmlns:unbound', value: 'someuri' - , prefix: 'xmlns', local: 'unbound' - , uri: 'http://www.w3.org/2000/xmlns/' } ] - , [ "opentag", { name: "unbound:root", uri: "someuri", prefix: "unbound", local: "root" - , attributes: { 'xmlns:unbound': { - name: 'xmlns:unbound' - , value: 'someuri' - , prefix: 'xmlns' - , local: 'unbound' - , uri: 'http://www.w3.org/2000/xmlns/' } } - , ns: { "unbound": "someuri" }, isSelfClosing: true } ] - , [ "closetag", "unbound:root" ] - , [ "closenamespace", { prefix: 'unbound', uri: 'someuri' }] - ] - } -).write(""); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-unbound.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-unbound.js deleted file mode 100644 index b740e26..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-unbound.js +++ /dev/null @@ -1,15 +0,0 @@ - -require(__dirname).test( - { strict : true - , opt : { xmlns: true } - , expect : - [ ["error", "Unbound namespace prefix: \"unbound\"\nLine: 0\nColumn: 28\nChar: >"] - - , [ "attribute", { name: "unbound:attr", value: "value", uri: "unbound", prefix: "unbound", local: "attr" } ] - , [ "opentag", { name: "root", uri: "", prefix: "", local: "root", - attributes: { "unbound:attr": { name: "unbound:attr", value: "value", uri: "unbound", prefix: "unbound", local: "attr" } }, - ns: {}, isSelfClosing: true } ] - , [ "closetag", "root" ] - ] - } -).write("") diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-ns.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-ns.js deleted file mode 100644 index b1984d2..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-ns.js +++ /dev/null @@ -1,31 +0,0 @@ -var xmlns_attr = -{ - name: "xmlns", value: "http://foo", prefix: "xmlns", - local: "", uri : "http://www.w3.org/2000/xmlns/" -}; - -var attr_attr = -{ - name: "attr", value: "bar", prefix: "", - local : "attr", uri : "" -}; - - -require(__dirname).test - ( { xml : - "" - , expect : - [ [ "opennamespace", { prefix: "", uri: "http://foo" } ] - , [ "attribute", xmlns_attr ] - , [ "attribute", attr_attr ] - , [ "opentag", { name: "elm", prefix: "", local: "elm", uri : "http://foo", - ns : { "" : "http://foo" }, - attributes: { xmlns: xmlns_attr, attr: attr_attr }, - isSelfClosing: true } ] - , [ "closetag", "elm" ] - , [ "closenamespace", { prefix: "", uri: "http://foo"} ] - ] - , strict : true - , opt : {xmlns: true} - } - ) diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-prefix-attribute.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-prefix-attribute.js deleted file mode 100644 index e41f218..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-prefix-attribute.js +++ /dev/null @@ -1,36 +0,0 @@ -require(__dirname).test( - { xml : "" - , expect : - [ [ "attribute" - , { name: "xml:lang" - , local: "lang" - , prefix: "xml" - , uri: "http://www.w3.org/XML/1998/namespace" - , value: "en" - } - ] - , [ "opentag" - , { name: "root" - , uri: "" - , prefix: "" - , local: "root" - , attributes: - { "xml:lang": - { name: "xml:lang" - , local: "lang" - , prefix: "xml" - , uri: "http://www.w3.org/XML/1998/namespace" - , value: "en" - } - } - , ns: {} - , isSelfClosing: true - } - ] - , ["closetag", "root"] - ] - , strict : true - , opt : { xmlns: true } - } -) - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-prefix.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-prefix.js deleted file mode 100644 index a85b478..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-prefix.js +++ /dev/null @@ -1,21 +0,0 @@ -require(__dirname).test( - { xml : "" - , expect : - [ - [ "opentag" - , { name: "xml:root" - , uri: "http://www.w3.org/XML/1998/namespace" - , prefix: "xml" - , local: "root" - , attributes: {} - , ns: {} - , isSelfClosing: true - } - ] - , ["closetag", "xml:root"] - ] - , strict : true - , opt : { xmlns: true } - } -) - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-redefine.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-redefine.js deleted file mode 100644 index d35d5a0..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/sax/test/xmlns-xml-default-redefine.js +++ /dev/null @@ -1,41 +0,0 @@ -require(__dirname).test( - { xml : "" - , expect : - [ ["error" - , "xml: prefix must be bound to http://www.w3.org/XML/1998/namespace\n" - + "Actual: ERROR\n" - + "Line: 0\nColumn: 27\nChar: '" - ] - , [ "attribute" - , { name: "xmlns:xml" - , local: "xml" - , prefix: "xmlns" - , uri: "http://www.w3.org/2000/xmlns/" - , value: "ERROR" - } - ] - , [ "opentag" - , { name: "xml:root" - , uri: "http://www.w3.org/XML/1998/namespace" - , prefix: "xml" - , local: "root" - , attributes: - { "xmlns:xml": - { name: "xmlns:xml" - , local: "xml" - , prefix: "xmlns" - , uri: "http://www.w3.org/2000/xmlns/" - , value: "ERROR" - } - } - , ns: {} - , isSelfClosing: true - } - ] - , ["closetag", "xml:root"] - ] - , strict : true - , opt : { xmlns: true } - } -) - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/.npmignore b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/.npmignore deleted file mode 100644 index 5f53129..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -support -examples -*.sock diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/.travis.yml b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/.travis.yml deleted file mode 100644 index de6634c..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/Cakefile b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/Cakefile deleted file mode 100644 index 2c62c15..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/Cakefile +++ /dev/null @@ -1,52 +0,0 @@ -fs = require 'fs' -CoffeeScript = require 'coffee-script' -{spawn, exec} = require 'child_process' - -# ANSI Terminal Colors. -enableColors = no -unless process.platform is 'win32' - enableColors = not process.env.NODE_DISABLE_COLORS - -bold = red = green = reset = '' -if enableColors - bold = '\x1B[0;1m' - red = '\x1B[0;31m' - green = '\x1B[0;32m' - reset = '\x1B[0m' - - -### -Just proc extender -### -proc_extender = (cb, proc) => - proc.stderr.on 'data', (buffer) -> console.log "#{buffer}" - # proc.stdout.on 'data', (buffer) -> console.log "#{buffer}".info - proc.on 'exit', (status) -> - process.exit(1) if status != 0 - cb() if typeof cb is 'function' - null - -# Run a CoffeeScript through our node/coffee interpreter. -run_coffee = (args, cb) => - proc_extender cb, spawn 'node', ['./node_modules/.bin/coffee'].concat(args) - -# Run a mocha tests -run_mocha = (args, cb) => - proc_extender cb, spawn 'node', ['./node_modules/.bin/mocha'].concat(args) - -# Log a message with a color. -log = (message, color, explanation) -> - console.log color + message + reset + ' ' + (explanation or '') - - -task 'build', 'build module from source', build = (cb) -> - files = fs.readdirSync 'src' - files = ('src/' + file for file in files when file.match(/\.coffee$/)) - run_coffee ['-c', '-o', 'lib/'].concat(files), cb - log ' -> build done', green - -task 'test', 'test builded module', -> - build -> - test_file = './test/extend_test.coffee' - run_mocha test_file, -> log ' -> all tests passed :)', green - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/History.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/History.md deleted file mode 100644 index 51b6b5a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/History.md +++ /dev/null @@ -1,28 +0,0 @@ -## 0.9.9 / 2013-01-28 01:20 AM - - - Re-write tests to Mocha - - Remove 'null' and 'undefined' filter - - Fix Cakefile - -## 0.9.7 / 2012-06-21 02:54 PM - - - Rename extend.{ext} -> whet.extend.{ext} - -## 0.9.5 / 2012-05-24 07:56 PM - - - Add travis-ci tests - - fix index.js - - -## 0.9.4 / 2012-05-24 03:08 PM - - - Move .coffee to ./scr, add compiled .js version to ./lib - - Move CoffeeScript to develop dependencies - - Add Cakefile - - Doc improved - - Small fix - - -## 0.9.1 / 2012-05-17 11:05 AM - - - Initial release \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/LICENSE b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/LICENSE deleted file mode 100644 index eec600b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 Dmitrii Karpich - -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/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/Readme.md b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/Readme.md deleted file mode 100644 index 723158d..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/Readme.md +++ /dev/null @@ -1,21 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/Meettya/whet.extend.png)](http://travis-ci.org/Meettya/whet.extend) - -# whet.extend - -A sharped version of node.extend as port of jQuery.extend that **actually works** on node.js - - - -## Description - -Its drop-in replacement of [node.extend](https://github.com/dreamerslab/node.extend), re-factored and re-written with CoffeeScript - -I just need some more CS practice AND its fun :) - - -## Usage - -Checkout the doc from [jQuery](http://api.jquery.com/jQuery.extend/) - - - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/index.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/index.js deleted file mode 100644 index 22850e0..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require( './lib/whet.extend' ); \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/lib/whet.extend.js b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/lib/whet.extend.js deleted file mode 100644 index 784d85b..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/lib/whet.extend.js +++ /dev/null @@ -1,104 +0,0 @@ -// Generated by CoffeeScript 1.3.3 - -/* - * whet.extend v0.9.7 - * Standalone port of jQuery.extend that actually works on node.js - * https://github.com/Meettya/whet.extend - * - * Copyright 2012, Dmitrii Karpich - * Released under the MIT License -*/ - - -(function() { - var extend, _findValue, _isClass, _isOwnProp, _isPlainObj, _isPrimitiveType, _isTypeOf, _prepareClone, - __slice = [].slice; - - module.exports = extend = function() { - var args, copy, deep, name, options, target, _i, _len, _ref; - deep = arguments[0], target = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; - if (!_isClass(deep, 'Boolean')) { - args.unshift(target); - _ref = [deep || {}, false], target = _ref[0], deep = _ref[1]; - } - if (_isPrimitiveType(target)) { - target = {}; - } - for (_i = 0, _len = args.length; _i < _len; _i++) { - options = args[_i]; - if (options != null) { - for (name in options) { - copy = options[name]; - target[name] = _findValue(deep, copy, target[name]); - } - } - } - return target; - }; - - /* - Internal methods from now - */ - - - _isClass = function(obj, str) { - return ("[object " + str + "]") === Object.prototype.toString.call(obj); - }; - - _isOwnProp = function(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); - }; - - _isTypeOf = function(obj, str) { - return str === typeof obj; - }; - - _isPlainObj = function(obj) { - var key; - if (!obj) { - return false; - } - if (obj.nodeType || obj.setInterval || !_isClass(obj, 'Object')) { - return false; - } - if (obj.constructor && !_isOwnProp(obj, 'constructor') && !_isOwnProp(obj.constructor.prototype, 'isPrototypeOf')) { - return false; - } - for (key in obj) { - key; - - } - return key === void 0 || _isOwnProp(obj, key); - }; - - _isPrimitiveType = function(obj) { - return !(_isTypeOf(obj, 'object') || _isTypeOf(obj, 'function')); - }; - - _prepareClone = function(copy, src) { - if (_isClass(copy, 'Array')) { - if (_isClass(src, 'Array')) { - return src; - } else { - return []; - } - } else { - if (_isPlainObj(src)) { - return src; - } else { - return {}; - } - } - }; - - _findValue = function(deep, copy, src) { - var clone; - if (deep && (_isClass(copy, 'Array') || _isPlainObj(copy))) { - clone = _prepareClone(copy, src); - return extend(deep, clone, copy); - } else { - return copy; - } - }; - -}).call(this); diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/package.json b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/package.json deleted file mode 100644 index f02edd3..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "whet.extend", - "version": "0.9.9", - "description": "A sharped version of port of jQuery.extend that actually works on node.js", - "keywords": [ - "extend", - "jQuery", - "jQuery extend", - "clone", - "copy", - "inherit" - ], - "author": { - "name": "Dmitrii Karpich", - "email": "meettya@gmail.com" - }, - "devDependencies": { - "should": "0.5.1", - "coffee-script": ">=1.3.3", - "chai": "~1.4.2", - "mocha": "~1.8.1" - }, - "scripts": { - "test": "cake test" - }, - "repository": { - "type": "git", - "url": "https://github.com/Meettya/whet.extend.git" - }, - "main": "index.js", - "engines": { - "node": ">=0.6.0" - }, - "license": "MIT", - "readme": "[![Build Status](https://secure.travis-ci.org/Meettya/whet.extend.png)](http://travis-ci.org/Meettya/whet.extend)\n\n# whet.extend\n\nA sharped version of node.extend as port of jQuery.extend that **actually works** on node.js\n\n\n\n## Description\n\nIts drop-in replacement of [node.extend](https://github.com/dreamerslab/node.extend), re-factored and re-written with CoffeeScript\n\nI just need some more CS practice AND its fun :)\n\n\n## Usage\n\nCheckout the doc from [jQuery](http://api.jquery.com/jQuery.extend/)\n\n\n\n", - "readmeFilename": "Readme.md", - "bugs": { - "url": "https://github.com/Meettya/whet.extend/issues" - }, - "_id": "whet.extend@0.9.9", - "dist": { - "shasum": "eaafe7a0f38fa7311cd90fe5f324437646ab1901" - }, - "_from": "whet.extend@", - "_resolved": "https://registry.npmjs.org/whet.extend/-/whet.extend-0.9.9.tgz" -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/src/whet.extend.coffee b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/src/whet.extend.coffee deleted file mode 100644 index 8bcfdc4..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/src/whet.extend.coffee +++ /dev/null @@ -1,68 +0,0 @@ -### - * whet.extend v0.9.7 - * Standalone port of jQuery.extend that actually works on node.js - * https://github.com/Meettya/whet.extend - * - * Copyright 2012, Dmitrii Karpich - * Released under the MIT License -### - -module.exports = extend = (deep, target, args...) -> - - unless _isClass deep, 'Boolean' - args.unshift target - [ target, deep ] = [ deep or {}, false ] - - #Handle case when target is a string or something (possible in deep copy) - target = {} if _isPrimitiveType target - - for options in args when options? - for name, copy of options - target[name] = _findValue deep, copy, target[name] - - target - -### -Internal methods from now -### - -_isClass = (obj, str) -> - "[object #{str}]" is Object::toString.call obj - -_isOwnProp = (obj, prop) -> - Object::hasOwnProperty.call obj, prop - -_isTypeOf = (obj, str) -> - str is typeof obj - -_isPlainObj = (obj) -> - - return false unless obj - return false if obj.nodeType or obj.setInterval or not _isClass obj, 'Object' - - # Not own constructor property must be Object - return false if obj.constructor and - not _isOwnProp(obj, 'constructor') and - not _isOwnProp(obj.constructor::, 'isPrototypeOf') - - # Own properties are enumerated firstly, so to speed up, - # if last one is own, then all properties are own. - key for key of obj - key is undefined or _isOwnProp obj, key - -_isPrimitiveType = (obj) -> - not ( _isTypeOf(obj, 'object') or _isTypeOf(obj, 'function') ) - -_prepareClone = (copy, src) -> - if _isClass copy, 'Array' - if _isClass src, 'Array' then src else [] - else - if _isPlainObj src then src else {} - -_findValue = (deep, copy, src) -> - # if we're merging plain objects or arrays - if deep and ( _isClass(copy, 'Array') or _isPlainObj copy ) - clone = _prepareClone copy, src - extend deep, clone, copy - else - copy diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/extend_test.coffee b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/extend_test.coffee deleted file mode 100644 index 0d3491f..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/extend_test.coffee +++ /dev/null @@ -1,566 +0,0 @@ -### -Test suite for node AND browser in one file -So, we are need some data from global -Its so wrong, but its OK for test -### -# resolve require from [window] or by require() -# _ = @_ ? require 'lodash' - -lib_path = GLOBAL?.lib_path || '' - -extend = require "#{lib_path}whet.extend" - -describe 'whet.extend:', -> - - str = int = arr = date = obj = deep = null - - beforeEach -> - str = 'me a test' - int = 10 - arr = [ 1, 'what', new Date( 81, 8, 4 )]; - date = new Date( 81, 4, 13 ); - - obj = - str : str - int : int - arr : arr - date : date - - deep = - ori : obj - layer : - int : 10 - str : 'str' - date : new Date( 84, 5, 12 ) - arr : [ 101, 'dude', new Date( 82, 10, 4 )] - deep : - str : obj.str - int : int - arr : obj.arr - date : new Date( 81, 7, 4 ) - - describe 'should merge string with:', -> - - it 'string', -> - ori = 'what u gonna say'; - target = extend ori, str - - ori.should.eql 'what u gonna say' - str.should.eql 'me a test' - target.should.eql - '0' : 'm', - '1' : 'e', - '2' : ' ', - '3' : 'a', - '4' : ' ', - '5' : 't', - '6' : 'e', - '7' : 's', - '8' : 't' - - it 'number', -> - ori = 'what u gonna say' - target = extend ori, int - - ori.should.eql 'what u gonna say' - int.should.eql 10 - target.should.eql {} - - it 'array', -> - ori = 'what u gonna say' - target = extend ori, arr - - ori.should.eql 'what u gonna say' - arr.should.eql [ 1, 'what', new Date( 81, 8, 4 )] - target.should.eql - '0' : 1, - '1' : 'what', - '2' : new Date( 81, 8, 4 ) - - it 'date', -> - ori = 'what u gonna say' - target = extend ori, date - - ori.should.eql 'what u gonna say' - date.should.eql new Date( 81, 4, 13 ) - target.should.eql new Date( 81, 4, 13 ) - - it 'object', -> - ori = 'what u gonna say' - target = extend ori, obj - - ori.should.eql 'what u gonna say' - obj.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - target.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - describe 'should merge number with:', -> - - it 'string', -> - ori = 20 - target = extend ori, str - - ori.should.eql 20 - str.should.eql 'me a test' - target.should.eql - '0' : 'm', - '1' : 'e', - '2' : ' ', - '3' : 'a', - '4' : ' ', - '5' : 't', - '6' : 'e', - '7' : 's', - '8' : 't' - - it 'number', -> - ori = 20 - target = extend ori, int - - ori.should.eql 20 - int.should.eql 10 - target.should.eql {} - - it 'array', -> - ori = 20 - target = extend ori, arr - - ori.should.eql 20 - arr.should.eql [ 1, 'what', new Date( 81, 8, 4 )] - target.should.eql - '0' : 1, - '1' : 'what', - '2' : new Date( 81, 8, 4 ) - - it 'date', -> - ori = 20 - target = extend ori, date - - ori.should.eql 20 - date.should.eql new Date( 81, 4, 13 ) - target.should.eql new Date( 81, 4, 13 ) - - it 'object', -> - ori = 20 - target = extend ori, obj - - ori.should.eql 20 - obj.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - target.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - describe 'should merge array with:', -> - - it 'string', -> - ori = [ 1, 2, 3, 4, 5, 6 ] - target = extend ori, str - - ori.should.eql [ 'm', 'e', ' ', 'a', ' ', 't', 'e', 's', 't' ] - str.should.eql 'me a test' - target.should.eql - '0' : 'm', - '1' : 'e', - '2' : ' ', - '3' : 'a', - '4' : ' ', - '5' : 't', - '6' : 'e', - '7' : 's', - '8' : 't' - - it 'number', -> - ori = [ 1, 2, 3, 4, 5, 6 ] - target = extend ori, int - - ori.should.eql [ 1, 2, 3, 4, 5, 6 ] - int.should.eql 10 - target.should.eql [ 1, 2, 3, 4, 5, 6 ] - - it 'array', -> - ori = [ 1, 2, 3, 4, 5, 6 ] - target = extend ori, arr - - ori.should.eql [ 1, 'what', new Date( 81, 8, 4 ), 4, 5, 6 ] - arr.should.eql [ 1, 'what', new Date( 81, 8, 4 )] - target.should.eql [ 1, 'what', new Date( 81, 8, 4 ), 4, 5, 6 ] - - it 'date', -> - ori = [ 1, 2, 3, 4, 5, 6 ] - target = extend ori, date - - ori.should.eql [ 1, 2, 3, 4, 5, 6 ] - date.should.eql new Date( 81, 4, 13 ) - target.should.eql [ 1, 2, 3, 4, 5, 6 ] - - it 'object', -> - ori = [ 1, 2, 3, 4, 5, 6 ] - target = extend ori, obj - - ori.length.should.equal 6 - ori[ 'str' ].should.eql 'me a test' - ori[ 'int' ].should.eql 10 - ori[ 'arr' ].should.eql [ 1, 'what', new Date( 81, 8, 4 )] - ori[ 'date' ].should.eql new Date( 81, 4, 13 ) - obj.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - target.length.should.equal 6 - target[ 'str' ].should.eql 'me a test' - target[ 'int' ].should.eql 10 - target[ 'arr' ].should.eql [ 1, 'what', new Date( 81, 8, 4 )] - target[ 'date' ].should.eql new Date( 81, 4, 13 ) - - describe 'should merge date with:', -> - - it 'string', -> - ori = new Date( 81, 9, 20 ) - target = extend ori, str - - ori.should.eql - '0' : 'm', - '1' : 'e', - '2' : ' ', - '3' : 'a', - '4' : ' ', - '5' : 't', - '6' : 'e', - '7' : 's', - '8' : 't' - - str.should.eql 'me a test' - target.should.eql - '0' : 'm', - '1' : 'e', - '2' : ' ', - '3' : 'a', - '4' : ' ', - '5' : 't', - '6' : 'e', - '7' : 's', - '8' : 't' - - it 'number', -> - ori = new Date( 81, 9, 20 ) - target = extend ori, int - - ori.should.eql {} - int.should.eql 10 - target.should.eql {} - - it 'array', -> - ori = new Date( 81, 9, 20 ) - target = extend ori, arr - - ori.should.eql [ 1, 'what', new Date( 81, 8, 4 )] - int.should.eql 10 - target.should.eql [ 1, 'what', new Date( 81, 8, 4 )] - - it 'date', -> - ori = new Date( 81, 9, 20 ) - target = extend ori, date - - ori.should.eql {} - date.should.eql new Date( 81, 4, 13 ) - target.should.eql {} - - it 'object', -> - ori = new Date( 81, 9, 20 ) - target = extend ori, obj - - ori.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - obj.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - target.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - describe 'should merge object with:', -> - - it 'string', -> - ori = - str : 'no shit' - int : 76 - arr : [ 1, 2, 3, 4 ] - date : new Date( 81, 7, 26 ) - - target = extend ori, str - - ori.should.eql - '0' : 'm', - '1' : 'e', - '2' : ' ', - '3' : 'a', - '4' : ' ', - '5' : 't', - '6' : 'e', - '7' : 's', - '8' : 't', - str: 'no shit', - int: 76, - arr: [ 1, 2, 3, 4 ], - date: new Date( 81, 7, 26 ) - - str.should.eql 'me a test' - target.should.eql - '0' : 'm', - '1' : 'e', - '2' : ' ', - '3' : 'a', - '4' : ' ', - '5' : 't', - '6' : 'e', - '7' : 's', - '8' : 't', - str: 'no shit', - int: 76, - arr: [ 1, 2, 3, 4 ], - date: new Date( 81, 7, 26 ) - - it 'number', -> - ori = - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - target = extend ori, int - - ori.should.eql - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - int.should.eql 10 - target.should.eql - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - it 'array', -> - ori = - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - target = extend ori, arr - - ori.should.eql - '0' : 1, - '1' : 'what', - '2' : new Date( 81, 8, 4 ), - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - arr.should.eql [ 1, 'what', new Date( 81, 8, 4 )] - target.should.eql - '0' : 1, - '1' : 'what', - '2' : new Date( 81, 8, 4 ), - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - it 'date', -> - ori = - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - target = extend ori, date - - ori.should.eql - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - date.should.eql new Date( 81, 4, 13 ) - target.should.eql - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - it 'object', -> - ori = - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - target = extend ori, obj - - ori.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - obj.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - target.should.eql - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - - describe 'should make deep clone: ', -> - - it 'object with object', -> - ori = - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ) - - target = extend true, ori, deep - - ori.should.eql - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ), - ori : - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - layer : - int : 10, - str : 'str', - date : new Date( 84, 5, 12 ), - arr : [ 101, 'dude', new Date( 82, 10, 4 )], - deep : - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 7, 4 ) - - deep.should.eql - ori : - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - layer : - int : 10, - str : 'str', - date : new Date( 84, 5, 12 ), - arr : [ 101, 'dude', new Date( 82, 10, 4 )], - deep : - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 7, 4 ) - - target.should.eql - str : 'no shit', - int : 76, - arr : [ 1, 2, 3, 4 ], - date : new Date( 81, 7, 26 ), - ori : - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - layer : - int : 10, - str : 'str', - date : new Date( 84, 5, 12 ), - arr : [ 101, 'dude', new Date( 82, 10, 4 )], - deep : - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 7, 4 ) - - target.layer.deep = 339; - deep.should.eql - ori : - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 4, 13 ) - layer : - int : 10, - str : 'str', - date : new Date( 84, 5, 12 ), - arr : [ 101, 'dude', new Date( 82, 10, 4 )], - deep : - str : 'me a test', - int : 10, - arr : [ 1, 'what', new Date( 81, 8, 4 )], - date : new Date( 81, 7, 4 ) - - ### - NEVER USE EXTEND WITH THE ABOVE SITUATION - ### - - describe 'must pass additional test: ', -> - - it 'should merge objects with \'null\' and \'undefined\'', -> - ori = - a : 10 - b : null - c : 'test data' - d : undefined - - additional = - x : 'googol' - y : 8939843 - z : null - az : undefined - - target = extend ori, additional - target.should.to.be.eql - a : 10 - b : null - c : 'test data' - d : undefined - x : 'googol' - y : 8939843 - z : null - az : undefined - - diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/mocha.opts b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/mocha.opts deleted file mode 100644 index 1a64c82..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/mocha.opts +++ /dev/null @@ -1,7 +0,0 @@ ---compilers coffee:coffee-script ---require coffee-script ---require ./test/test_helper.coffee ---reporter spec ---colors ---growl ---ui bdd \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/test_helper.coffee b/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/test_helper.coffee deleted file mode 100644 index da2e517..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/node_modules/whet.extend/test/test_helper.coffee +++ /dev/null @@ -1,11 +0,0 @@ -### -global helper for chai.should() -### -chai = require 'chai' -GLOBAL.should = chai.should() -GLOBAL.expect = chai.expect # to work with 'undefined' - should cant it - -### -addon for lib_path -### -GLOBAL.lib_path = '../lib/' \ No newline at end of file diff --git a/node_modules/grunt-svgmin/node_modules/svgo/package.json b/node_modules/grunt-svgmin/node_modules/svgo/package.json deleted file mode 100644 index e65dd10..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "svgo", - "version": "0.3.7", - "description": "Nodejs-based tool for optimizing SVG vector graphics files", - "keywords": [ - "svgo", - "svg", - "optimize", - "minify" - ], - "homepage": "http://svg.github.com/svgo/", - "bugs": { - "url": "https://github.com/svg/svgo/issues", - "email": "kir@soulshine.in" - }, - "author": { - "name": "Kir Belevich", - "email": "kir@soulshine.in", - "url": "https://github.com/deepsweet" - }, - "contributors": [ - { - "name": "Sergey Belov", - "email": "peimei@ya.ru", - "url": "http://github.com/arikon" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/svg/svgo.git" - }, - "main": "./lib/svgo.js", - "bin": { - "svgo": "./bin/svgo" - }, - "directories": { - "bin": "./bin", - "lib": "./lib", - "example": "./examples" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "sax": "~0.5.0", - "coa": "~0.3.7", - "js-yaml": "", - "colors": "~0.6.0", - "whet.extend": "" - }, - "devDependencies": { - "mocha": "~1.9.0", - "should": "~1.2.0", - "istanbul": "~0.1.0", - "mocha-istanbul": "", - "coveralls": "" - }, - "engines": { - "node": ">=0.6.0" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/svg/svgo/master/LICENSE" - } - ], - "readme": "**english** | [русский](https://github.com/svg/svgo/blob/master/README.ru.md)\n- - -\n\n\"logo\"/\n\n## SVGO [![NPM version](https://badge.fury.io/js/svgo.png)](https://npmjs.org/package/svgo) [![Dependency Status](https://gemnasium.com/svg/svgo.png)](https://gemnasium.com/svg/svgo) [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](https://travis-ci.org/svg/svgo) [![Coverage Status](https://coveralls.io/repos/svg/svgo/badge.png?branch=master)](https://coveralls.io/r/svg/svgo)\n\n**SVG O**ptimizer is a Nodejs-based tool for optimizing SVG vector graphics files.\n![](https://mc.yandex.ru/watch/18431326)\n\n## Why?\n\nSVG files, especially exported from various editors, usually contains a lot of redundant and useless information such as editor metadata, comments, hidden elements, default or non-optimal values and other stuff that can be safely removed or converted without affecting SVG rendering result.\n\n## What it can do\n\nSVGO has a plugin-based architecture, so almost every optimization is a separate plugin.\n\nToday we have:\n\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupAttrs.js) ] cleanup attributes from newlines, trailing and repeating spaces\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeDoctype.js) ] remove doctype declaration\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeXMLProcInst.js) ] remove XML processing instructions\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeComments.js) ] remove comments\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeMetadata.js) ] remove ``\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEditorsNSData.js) ] remove editors namespaces, elements and attributes\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyAttrs.js) ] remove empty attributes\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeHiddenElems.js) ] remove hidden elements\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyText.js) ] remove empty Text elements\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeEmptyContainers.js) ] remove empty Container elements\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeViewBox.js) ] remove `viewBox` attribute when possible\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupEnableBackground.js) ] remove or cleanup `enable-background` attribute when possible\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertStyleToAttrs.js) ] convert styles into attributes\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertColors.js) ] convert colors (from `rgb()` to `#rrggbb`, from `#rrggbb` to `#rgb`)\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertPathData.js) ] convert Path data to relative, convert one segment to another, trim useless delimiters and much more\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/convertTransform.js) ] collapse multiple transforms into one, convert matrices to the short aliases and much more\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeUnknownsAndDefaults.js) ] remove unknown elements content and attributes, remove attrs with default values\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeNonInheritableGroupAttrs.js) ] remove non-inheritable group's \"presentation\" attributes\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeUnusedNS.js) ] remove unused namespaces declaration\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupIDs.js) ] remove unused and minify used IDs\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/cleanupNumericValues.js) ] round numeric values to the fixed precision, remove default 'px' units\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/moveElemsAttrsToGroup.js) ] move elements attributes to the existing group wrapper\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/moveGroupAttrsToElems.js) ] move some group attributes to the content elements\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/collapseGroups.js) ] collapse useless groups\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/removeRasterImages.js) ] remove raster images (disabled by default)\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/mergePaths.js) ] merge multiple Paths into one\n* [ [>](https://github.com/svg/svgo/blob/master/plugins/transformsWithOnePath.js) ] apply transforms, crop by real width, center vertical alignment and resize SVG with one Path inside\n\nWant to know how it works and how to write your own plugin? [Of course you want to](https://github.com/svg/svgo/blob/master/docs/how-it-works/en.md).\n\n\n## How to use\n\n```sh\n$ [sudo] npm install -g svgo\n```\n\n```\nUsage:\n svgo [OPTIONS] [ARGS]\n\nOptions:\n -h, --help : Help\n -v, --version : Version\n -i INPUT, --input=INPUT : Input file, \"-\" for STDIN\n -s STRING, --string=STRING : Input SVG data string\n -f FOLDER, --folder=FOLDER : Input folder, optimize and rewrite all *.svg files\n -o OUTPUT, --output=OUTPUT : Output file (by default the same as the input), \"-\" for STDOUT\n --config=CONFIG : Config file to extend or replace default\n --disable=DISABLE : Disable plugin by name\n --enable=ENABLE : Enable plugin by name\n --datauri=DATAURI : Output as Data URI string (base64, URI encoded or unencoded)\n --pretty : Make SVG pretty printed\n\nArguments:\n INPUT : Alias to --input\n OUTPUT : Alias to --output\n```\n\n* with files:\n\n $ svgo test.svg\n\n or:\n\n $ svgo test.svg test.min.svg\n\n* with STDIN / STDOUT:\n\n $ cat test.svg | svgo -i - -o - > test.min.svg\n\n* with folder\n\n $ svgo -f ../path/to/folder/with/svg/files\n\n* with strings:\n\n $ svgo -s 'test' -o test.min.svg\n\n or even with Data URI base64:\n\n $ svgo -s 'data:image/svg+xml;base64,…' -o test.min.svg\n\n* with SVGZ:\n\n from `.svgz` to `.svg`:\n\n $ gunzip -c test.svgz | svgo -i - -o test.min.svg\n\n from `.svg` to `.svgz`:\n\n $ svgo test.svg -o - | gzip -cfq9 > test.svgz\n\n* with GUI – [svgo-gui](https://github.com/svg/svgo-gui)\n* as a Nodejs module – [examples](https://github.com/svg/svgo/tree/master/examples)\n* as a Grunt task – [grunt-svgmin](https://github.com/sindresorhus/grunt-svgmin)\n* as an OSX Folder Action – [svgo-osx-folder-action](https://github.com/svg/svgo-osx-folder-action)\n\n## TODO\n\n* [v0.3.x](https://github.com/svg/svgo/issues?milestone=7&state=open)\n\n\n## License and copyrights\n\nThis software is released under the terms of the [MIT license](https://github.com/svg/svgo/blob/master/LICENSE).\n\nLogo by [Yegor Bolshakov](http://xizzzy.ru/).\n", - "readmeFilename": "README.md", - "_id": "svgo@0.3.7", - "dist": { - "shasum": "18e6bbfd9f70b84b5fe88e6656d84402c71ae7a0" - }, - "_from": "svgo@~0.3.1", - "_resolved": "https://registry.npmjs.org/svgo/-/svgo-0.3.7.tgz" -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/plugins/_collections.js b/node_modules/grunt-svgmin/node_modules/svgo/plugins/_collections.js deleted file mode 100644 index a455a5f..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/plugins/_collections.js +++ /dev/null @@ -1,2345 +0,0 @@ -'use strict'; - -// http://www.w3.org/TR/SVG/intro.html#Definitions -exports.elemsGroups = { - animation: ['animate', 'animateColor', 'animateMotion', 'animateTransform', 'set'], - descriptive: ['desc', 'metadata', 'title'], - shape: ['circle', 'ellipse', 'line', 'path', 'polygon', 'polyline', 'rect'], - structural: ['defs', 'g', 'svg', 'symbol', 'use'], - gradient: ['linearGradient', 'radialGradient'], - container: ['a', 'defs', 'g', 'marker', 'mask', 'missing-glyph', 'pattern', 'svg', 'switch', 'symbol'], - textContentChild: ['altGlyph', 'textPath', 'tref', 'tspan'], - lightSource: ['feDiffuseLighting', 'feSpecularLighting', 'feDistantLight', 'fePointLight', 'feSpotLight'], - filterPrimitive: ['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feFlood', 'feGaussianBlur', 'feImage', 'feMerge', 'feMorphology', 'feOffset', 'feSpecularLighting', 'feTile', 'feTurbulence'] -}; - -exports.pathElems = ['path', 'glyph', 'missing-glyph']; - -// http://www.w3.org/TR/SVG/intro.html#Definitions -exports.attrsGroups = { - animationAddition: ['additive', 'accumulate'], - animationAttributeTarget: ['attributeType', 'attributeName'], - animationEvent: ['onbegin', 'onend', 'onrepeat', 'onload'], - animationTiming: ['begin', 'dur', 'end', 'min', 'max', 'restart', 'repeatCount', 'repeatDur', 'fill'], - animationValue: ['calcMode', 'values', 'keyTimes', 'keySplines', 'from', 'to', 'by'], - conditionalProcessing: ['requiredFeatures', 'requiredExtensions', 'systemLanguage'], - core: ['id', 'xml:base', 'xml:lang', 'xml:space'], - graphicalEvent: ['onfocusin', 'onfocusout', 'onactivate', 'onclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onload'], - presentation: ['alignment-baseline', 'baseline-shift', 'clip', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'display', 'dominant-baseline', 'enable-background', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'overflow', 'pointer-events', 'shape-rendering', 'stop-color', 'stop-opacity', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'unicode-bidi', 'visibility', 'word-spacing', 'writing-mode'], - xlink: ['xlink:href', 'xlink:show', 'xlink:actuate', 'xlink:type', 'xlink:role', 'xlink:arcrole', 'xlink:title'], - documentEvent: ['onunload', 'onabort', 'onerror', 'onresize', 'onscroll', 'onzoom'], - filterPrimitive: ['x', 'y', 'width', 'height', 'result'], - transferFunction: ['type', 'tableValues', 'slope', 'intercept', 'amplitude', 'exponent', 'offset'] -}; - -exports.attrsGroupsDefaults = { - core: {'xml:space': 'preserve'}, - filterPrimitive: {x: '0', y: '0', width: '100%', height: '100%'}, - presentation: { - clip: 'auto', - 'clip-path': 'none', - 'clip-rule': 'nonzero', - mask: 'none', - opacity: '1', - 'stop-color': '#000', - 'stop-opacity': '1', - 'fill-opacity': '1', - 'fill-rule': 'nonzero', - fill: '#000', - stroke: 'none', - 'stroke-width': '1', - 'stroke-linecap': 'butt', - 'stroke-linejoin': 'miter', - 'stroke-miterlimit': '4', - 'stroke-dasharray': 'none', - 'stroke-dashoffset': '0', - 'stroke-opacity': '1', - display: 'inline', - visibility: 'visible', - 'marker-start': 'none', - 'marker-mid': 'none', - 'marker-end': 'none', - 'color-interpolation': 'sRGB', - 'color-interpolation-filters': 'linearRGB', - 'color-rendering': 'auto', - 'shape-rendering': 'auto', - 'text-rendering': 'auto', - 'image-rendering': 'auto', - 'font-style': 'normal', - 'font-variant': 'normal', - 'font-weight': 'normal', - 'font-stretch': 'normal', - 'font-size': 'medium', - 'font-size-adjust': 'none', - kerning: 'auto', - 'letter-spacing': 'normal', - 'word-spacing': 'normal', - 'text-decoration': 'none', - 'text-anchor': 'start', - 'writing-mode': 'lr-tb', - 'glyph-orientation-vertical': 'auto', - 'glyph-orientation-horizontal': '0deg', - direction: 'ltr', - 'unicode-bidi': 'normal', - 'dominant-baseline': 'auto', - 'alignment-baseline': 'baseline', - 'baseline-shift': 'baseline' - }, - transferFunction: {slope: '1', intercept: '0', amplitude: '1', exponent: '1', offset: '0'} -}; - -// http://www.w3.org/TR/SVG/eltindex.html -exports.elems = { - a: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'target' - ], - defaults: { - target: '_self' - }, - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - altGlyph: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'x', - 'y', - 'dx', - 'dy', - 'glyphRef', - 'format', - 'rotate' - ] - }, - altGlyphDef: { - attrsGroups: [ - 'core' - ], - content: [ - 'glyphRef' - ] - }, - altGlyphItem: { - attrsGroups: [ - 'core' - ], - content: [ - 'glyphRef', - 'altGlyphItem' - ] - }, - animate: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'animationAddition', - 'animationAttributeTarget', - 'animationEvent', - 'animationTiming', - 'animationValue', - 'presentation', - 'xlink' - ], - attrs: [ - 'externalResourcesRequired' - ], - contentGroups: [ - 'descriptive' - ] - }, - animateColor: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'animationEvent', - 'xlink', - 'animationAttributeTarget', - 'animationTiming', - 'animationValue', - 'animationAddition', - 'presentation' - ], - attrs: [ - 'externalResourcesRequired' - ], - contentGroups: [ - 'descriptive' - ] - }, - animateMotion: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'animationEvent', - 'xlink', - 'animationTiming', - 'animationValue', - 'animationAddition' - ], - attrs: [ - 'externalResourcesRequired', - 'path', - 'keyPoints', - 'rotate', - 'origin' - ], - defaults: { - 'rotate': '0' - }, - contentGroups: [ - 'descriptive' - ], - content: [ - 'mpath' - ] - }, - animateTransform: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'animationEvent', - 'xlink', - 'animationAttributeTarget', - 'animationTiming', - 'animationValue', - 'animationAddition' - ], - attrs: [ - 'externalResourcesRequired', - 'type' - ], - defaults: { - type: 'translate' - }, - contentGroups: [ - 'descriptive' - ] - }, - circle: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'cx', - 'cy', - 'r' - ], - defaults: { - cx: '0', - cy: '0' - }, - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - clipPath: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'clipPathUnits' - ], - defaults: { - clipPathUnits: 'userSpaceOnUse' - }, - contentGroups: [ - 'animation', - 'descriptive', - 'shape' - ], - content: [ - 'text', - 'use' - ] - }, - 'color-profile': { - attrsGroups: [ - 'core', - 'xlink' - ], - attrs: [ - 'local', - 'name', - 'rendering-intent' - ], - defaults: { - name: 'sRGB', - 'rendering-intent': 'auto' - }, - contentGroups: [ - 'descriptive' - ] - }, - cursor: { - attrsGroups: [ - 'core', - 'conditionalProcessing', - 'xlink' - ], - attrs: [ - 'externalResourcesRequired', - 'x', - 'y' - ], - defaults: { - x: '0', - y: '0' - }, - contentGroups: [ - 'descriptive' - ] - }, - defs: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform' - ], - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - desc: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'class', - 'style' - ] - }, - ellipse: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'cx', - 'cy', - 'rx', - 'ry' - ], - defaults: { - cx: '0', - cy: '0' - }, - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - feBlend: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - // TODO: in - 'If no value is provided and this is the first filter primitive, - // then this filter primitive will use SourceGraphic as its input' - 'in', - 'in2', - 'mode' - ], - defaults: { - mode: 'normal' - }, - content: [ - 'animate', - 'set' - ] - }, - feColorMatrix: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'type', - 'values' - ], - defaults: { - type: 'matrix' - }, - content: [ - 'animate', - 'set' - ] - }, - feComponentTransfer: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in' - ], - content: [ - 'feFuncA', - 'feFuncB', - 'feFuncG', - 'feFuncR' - ] - }, - feComposite: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'in2', - 'operator', - 'k1', - 'k2', - 'k3', - 'k4' - ], - defaults: { - operator: 'over', - k1: '0', - k2: '0', - k3: '0', - k4: '0' - }, - content: [ - 'animate', - 'set' - ] - }, - feConvolveMatrix: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'order', - 'kernelMatrix', - // TODO: divisor - 'The default value is the sum of all values in kernelMatrix, - // with the exception that if the sum is zero, then the divisor is set to 1' - 'divisor', - 'bias', - // TODO: targetX - 'By default, the convolution matrix is centered in X over each - // pixel of the input image (i.e., targetX = floor ( orderX / 2 ))' - 'targetX', - 'targetY', - 'edgeMode', - // TODO: kernelUnitLength - 'The first number is the value. The second number - // is the value. If the value is not specified, it defaults to the same value as ' - 'kernelUnitLength', - 'preserveAlpha' - ], - defaults: { - order: '3', - bias: '0', - edgeMode: 'duplicate', - preserveAlpha: 'false' - }, - content: [ - 'animate', - 'set' - ] - }, - feDiffuseLighting: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'surfaceScale', - 'diffuseConstant', - 'kernelUnitLength' - ], - defaults: { - surfaceScale: '1', - diffuseConstant: '1' - }, - contentGroups: [ - 'descriptive' - ], - content: [ - // TODO: 'exactly one light source element, in any order' - 'feDistantLight', - 'fePointLight', - 'feSpotLight' - ] - }, - feDisplacementMap: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'in2', - 'scale', - 'xChannelSelector', - 'yChannelSelector' - ], - defaults: { - scale: '0', - xChannelSelector: 'A', - yChannelSelector: 'A' - }, - content: [ - 'animate', - 'set' - ] - }, - feDistantLight: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'azimuth', - 'elevation' - ], - defaults: { - azimuth: '0', - elevation: '0' - }, - content: [ - 'animate', - 'set' - ] - }, - feFlood: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style' - ], - content: [ - 'animate', - 'animateColor', - 'set' - ] - }, - feFuncA: { - attrsGroups: [ - 'core', - 'transferFunction' - ], - content: [ - 'set', - 'animate' - ] - }, - feFuncB: { - attrsGroups: [ - 'core', - 'transferFunction' - ], - content: [ - 'set', - 'animate' - ] - }, - feFuncG: { - attrsGroups: [ - 'core', - 'transferFunction' - ], - content: [ - 'set', - 'animate' - ] - }, - feFuncR: { - attrsGroups: [ - 'core', - 'transferFunction' - ], - content: [ - 'set', - 'animate' - ] - }, - feGaussianBlur: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'stdDeviation' - ], - defaults: { - stdDeviation: '0' - }, - content: [ - 'set', - 'animate' - ] - }, - feImage: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'preserveAspectRatio', - 'xlink:href' - ], - defaults: { - preserveAspectRatio: 'xMidYMid meet' - }, - content: [ - 'animate', - 'animateTransform', - 'set' - ] - }, - feMerge: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style' - ], - content: [ - 'feMergeNode' - ] - }, - feMergeNode: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'in' - ], - content: [ - 'animate', - 'set' - ] - }, - feMorphology: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'operator', - 'radius' - ], - defaults: { - operator: 'erode', - radius: '0' - }, - content: [ - 'animate', - 'set' - ] - }, - feOffset: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'dx', - 'dy' - ], - defaults: { - dx: '0', - dy: '0' - }, - content: [ - 'animate', - 'set' - ] - }, - fePointLight: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'x', - 'y', - 'z' - ], - defaults: { - x: '0', - y: '0', - z: '0' - }, - content: [ - 'animate', - 'set' - ] - }, - feSpecularLighting: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in', - 'surfaceScale', - 'specularConstant', - 'specularExponent', - 'kernelUnitLength' - ], - defaults: { - surfaceScale: '1', - specularConstant: '1', - specularExponent: '1' - }, - contentGroups: [ - 'descriptive', - // TODO: exactly one 'light source element' - 'lightSource' - ] - }, - feSpotLight: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'x', - 'y', - 'z', - 'pointsAtX', - 'pointsAtY', - 'pointsAtZ', - 'specularExponent', - 'limitingConeAngle' - ], - defaults: { - x: '0', - y: '0', - z: '0', - pointsAtX: '0', - pointsAtY: '0', - pointsAtZ: '0', - specularExponent: '1' - }, - content: [ - 'animate', - 'set' - ] - }, - feTile: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'in' - ], - content: [ - 'animate', - 'set' - ] - }, - feTurbulence: { - attrsGroups: [ - 'core', - 'presentation', - 'filterPrimitive' - ], - attrs: [ - 'class', - 'style', - 'baseFrequency', - 'numOctaves', - 'seed', - 'stitchTiles', - 'type' - ], - defaults: { - baseFrequency: '0', - numOctaves: '1', - seed: '0', - stitchTiles: 'noStitch', - type: 'turbulence' - }, - content: [ - 'animate', - 'set' - ] - }, - filter: { - attrsGroups: [ - 'core', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'x', - 'y', - 'width', - 'height', - 'filterRes', - 'filterUnits', - 'primitiveUnits', - 'xlink:href' - ], - defaults: { - primitiveUnits: 'userSpaceOnUse', - x: '-10%', - y: '-10%', - width: '120%', - height: '120%' - }, - contentGroups: [ - 'descriptive', - 'filterPrimitive' - ], - content: [ - 'animate', - 'set' - ] - }, - font: { - attrsGroups: [ - 'core', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'horiz-origin-x', - 'horiz-origin-y', - 'horiz-adv-x', - 'vert-origin-x', - 'vert-origin-y', - 'vert-adv-y' - ], - defaults: { - 'horiz-origin-x': '0', - 'horiz-origin-y': '0' - }, - contentGroups: [ - 'descriptive' - ], - content: [ - 'font-face', - 'glyph', - 'hkern', - 'missing-glyph', - 'vkern' - ] - }, - 'font-face': { - attrsGroups: [ - 'core' - ], - attrs: [ - 'font-family', - 'font-style', - 'font-variant', - 'font-weight', - 'font-stretch', - 'font-size', - 'unicode-range', - 'units-per-em', - 'panose-1', - 'stemv', - 'stemh', - 'slope', - 'cap-height', - 'x-height', - 'accent-height', - 'ascent', - 'descent', - 'widths', - 'bbox', - 'ideographic', - 'alphabetic', - 'mathematical', - 'hanging', - 'v-ideographic', - 'v-alphabetic', - 'v-mathematical', - 'v-hanging', - 'underline-position', - 'underline-thickness', - 'strikethrough-position', - 'strikethrough-thickness', - 'overline-position', - 'overline-thickness' - ], - defaults: { - 'font-style': 'all', - 'font-variant': 'normal', - 'font-weight': 'all', - 'font-stretch': 'normal', - 'unicode-range': 'U+0-10FFFF', - 'units-per-em': '1000', - 'panose-1': '0 0 0 0 0 0 0 0 0 0', - 'slope': '0' - }, - contentGroups: [ - 'descriptive' - ], - content: [ - // TODO: "at most one 'font-face-src' element" - 'font-face-src' - ] - }, - // TODO: empty content - 'font-face-format': { - attrsGroups: [ - 'core' - ], - attrs: [ - 'string' - ] - }, - 'font-face-name': { - attrsGroups: [ - 'core' - ], - attrs: [ - 'name' - ] - }, - 'font-face-src': { - attrsGroups: [ - 'core' - ], - content: [ - 'font-face-name', - 'font-face-uri' - ] - }, - 'font-face-uri': { - attrsGroups: [ - 'core', - 'xlink' - ], - attrs: [ - 'xlink:href' - ], - content: [ - 'font-face-format' - ] - }, - foreignObject: { - attrsGroups: [ - 'core', - 'conditionalProcessing', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'x', - 'y', - 'width', - 'height' - ], - defaults: { - x: 0, - y: 0 - } - }, - g: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform' - ], - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - glyph: { - attrsGroups: [ - 'core', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'd', - 'horiz-adv-x', - 'vert-origin-x', - 'vert-origin-y', - 'vert-adv-y', - 'unicode', - 'glyph-name', - 'orientation', - 'arabic-form', - 'lang' - ], - defaults: { - 'arabic-form': 'initial' - }, - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ], - }, - glyphRef: { - attrsGroups: [ - 'core', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'd', - 'horiz-adv-x', - 'vert-origin-x', - 'vert-origin-y', - 'vert-adv-y' - ], - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - hkern: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'u1', - 'g1', - 'u2', - 'g2', - 'k' - ] - }, - image: { - attrsGroups: [ - 'core', - 'conditionalProcessing', - 'graphicalEvent', - 'xlink', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'preserveAspectRatio', - 'transform', - 'x', - 'y', - 'width', - 'height', - 'xlink:href' - ], - defaults: { - x: '0', - y: '0', - preserveAspectRatio: 'xMidYMid meet' - }, - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - line: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'x1', - 'y1', - 'x2', - 'y2' - ], - defaults: { - x1: '0', - y1: '0', - x2: '0', - y2: '0' - }, - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - linearGradient: { - attrsGroups: [ - 'core', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'x1', - 'y1', - 'x2', - 'y2', - 'gradientUnits', - 'gradientTransform', - 'spreadMethod', - 'xlink:href' - ], - defaults: { - x1: '0', - y1: '0', - x2: '100%', - y2: '0', - spreadMethod: 'pad' - }, - contentGroups: [ - 'descriptive' - ], - content: [ - 'animate', - 'animateTransform', - 'set', - 'stop' - ] - }, - marker: { - attrsGroups: [ - 'core', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'viewBox', - 'preserveAspectRatio', - 'refX', - 'refY', - 'markerUnits', - 'markerWidth', - 'markerHeight', - 'orient' - ], - defaults: { - markerUnits: 'strokeWidth', - refX: '0', - refY: '0', - markerWidth: '3', - markerHeight: '3' - }, - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - mask: { - attrsGroups: [ - 'conditionalProcessing', - 'core' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'x', - 'y', - 'width', - 'height', - 'maskUnits', - 'maskContentUnits' - ], - defaults: { - maskUnits: 'objectBoundingBox', - maskContentUnits: 'userSpaceOnUse', - x: '-10%', - y: '-10%', - width: '120%', - height: '120%' - }, - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - metadata: { - attrsGroups: [ - 'core' - ] - }, - 'missing-glyph': { - attrsGroups: [ - 'core', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'd', - 'horiz-adv-x', - 'vert-origin-x', - 'vert-origin-y', - 'vert-adv-y' - ], - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - mpath: { - attrsGroups: [ - 'core', - 'xlink' - ], - attrs: [ - 'externalResourcesRequired', - 'xlink:href' - ], - contentGroups: [ - 'descriptive' - ] - }, - path: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'd', - 'pathLength' - ], - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - pattern: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'viewBox', - 'preserveAspectRatio', - 'x', - 'y', - 'width', - 'height', - 'patternUnits', - 'patternContentUnits', - 'patternTransform', - 'xlink:href' - ], - defaults: { - patternUnits: 'objectBoundingBox', - patternContentUnits: 'userSpaceOnUse', - x: '0', - y: '0', - width: '0', - height: '0', - preserveAspectRatio: 'xMidYMid meet' - }, - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - polygon: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'points' - ], - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - polyline: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'points' - ], - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - radialGradient: { - attrsGroups: [ - 'core', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'cx', - 'cy', - 'r', - 'fx', - 'fy', - 'gradientUnits', - 'gradientTransform', - 'spreadMethod', - 'xlink:href' - ], - defaults: { - gradientUnits: 'objectBoundingBox', - cx: '50%', - cy: '50%', - r: '50%' - }, - contentGroups: [ - 'descriptive' - ], - content: [ - 'animate', - 'animateTransform', - 'set', - 'stop' - ] - }, - rect: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'x', - 'y', - 'width', - 'height', - 'rx', - 'ry' - ], - defaults: { - x: '0', - y: '0' - }, - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - script: { - attrsGroups: [ - 'core', - 'xlink' - ], - attrs: [ - 'externalResourcesRequired', - 'type', - 'xlink:href' - ] - }, - set: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'animation', - 'xlink', - 'animationAttributeTarget', - 'animationTiming', - ], - attrs: [ - 'externalResourcesRequired', - 'to' - ], - contentGroups: [ - 'descriptive' - ] - }, - stop: { - attrsGroups: [ - 'core', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'offset' - ], - contentGroups: [ - 'animate', - 'animateColor', - 'set' - ] - }, - style: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'type', - 'media', - 'title' - ] - }, - svg: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'documentEvent', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'x', - 'y', - 'width', - 'height', - 'viewBox', - 'preserveAspectRatio', - 'zoomAndPan', - 'version', - 'baseProfile', - 'contentScriptType', - 'contentStyleType' - ], - defaults: { - x: '0', - y: '0', - width: '100%', - height: '100%', - preserveAspectRatio: 'xMidYMid meet', - zoomAndPan: 'magnify', - version: '1.1', - baseProfile: 'none', - contentScriptType: 'application/ecmascript', - contentStyleType: 'text/css' - }, - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - switch: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform' - ], - contentGroups: [ - 'animation', - 'descriptive', - 'shape' - ], - content: [ - 'a', - 'foreignObject', - 'g', - 'image', - 'svg', - 'switch', - 'text', - 'use' - ] - }, - symbol: { - attrsGroups: [ - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'preserveAspectRatio', - 'viewBox' - ], - contentGroups: [ - 'animation', - 'descriptive', - 'shape', - 'structural', - 'gradient' - ], - content: [ - 'a', - 'altGlyphDef', - 'clipPath', - 'color-profile', - 'cursor', - 'filter', - 'font', - 'font-face', - 'foreignObject', - 'image', - 'marker', - 'mask', - 'pattern', - 'script', - 'style', - 'switch', - 'text', - 'view' - ] - }, - text: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'lengthAdjust', - 'x', - 'y', - 'dx', - 'dy', - 'rotate', - 'textLength' - ], - defaults: { - x: '0', - y: '0', - lengthAdjust: 'spacing' - }, - contentGroups: [ - 'animation', - 'descriptive', - 'textContentChild' - ], - content: [ - 'a' - ] - }, - textPath: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'xlink:href', - 'startOffset', - 'method', - 'spacing' - ], - defaults: { - startOffset: '0', - method: 'align', - spacing: 'exact' - }, - contentGroups: [ - 'descriptive' - ], - content: [ - 'a', - 'altGlyph', - 'animate', - 'animateColor', - 'set', - 'tref', - 'tspan' - ] - }, - title: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'class', - 'style' - ] - }, - tref: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'xlink:href' - ], - contentGroups: [ - 'descriptive' - ], - content: [ - 'animate', - 'animateColor', - 'set' - ] - }, - tspan: { - attrsGroups: [ - 'conditionalProcessing', - 'core', - 'graphicalEvent', - 'presentation' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'x', - 'y', - 'dx', - 'dy', - 'rotate', - 'textLength', - 'lengthAdjust' - ], - contentGroups: [ - 'descriptive' - ], - content: [ - 'a', - 'altGlyph', - 'animate', - 'animateColor', - 'set', - 'tref', - 'tspan' - ] - }, - use: { - attrsGroups: [ - 'core', - 'conditionalProcessing', - 'graphicalEvent', - 'presentation', - 'xlink' - ], - attrs: [ - 'class', - 'style', - 'externalResourcesRequired', - 'transform', - 'x', - 'y', - 'width', - 'height', - 'xlink:href' - ], - defaults: { - x: '0', - y: '0' - }, - contentGroups: [ - 'animation', - 'descriptive' - ] - }, - view: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'externalResourcesRequired', - 'viewBox', - 'preserveAspectRatio', - 'zoomAndPan', - 'viewTarget' - ], - contentGroups: [ - 'descriptive' - ] - }, - vkern: { - attrsGroups: [ - 'core' - ], - attrs: [ - 'u1', - 'g1', - 'u2', - 'g2', - 'k' - ] - } -}; - -// http://wiki.inkscape.org/wiki/index.php/Inkscape-specific_XML_attributes -exports.editorNamespaces = [ - 'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd', - 'http://www.inkscape.org/namespaces/inkscape', - 'http://ns.adobe.com/AdobeIllustrator/10.0/', - 'http://ns.adobe.com/Graphs/1.0/', - 'http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/', - 'http://ns.adobe.com/Variables/1.0/', - 'http://ns.adobe.com/SaveForWeb/1.0/', - 'http://ns.adobe.com/Extensibility/1.0/', - 'http://ns.adobe.com/Flows/1.0/', - 'http://ns.adobe.com/ImageReplacement/1.0/', - 'http://ns.adobe.com/GenericCustomNamespace/1.0/', - 'http://ns.adobe.com/XPath/1.0/' -]; - -// http://www.w3.org/TR/SVG/linking.html#processingIRI -exports.referencesProps = [ - 'clip-path', - 'color-profile', - 'fill', - 'filter', - 'marker-start', - 'marker-mid', - 'marker-end', - 'mask', - 'stroke' -]; - -// http://www.w3.org/TR/SVG/styling.html#SVGStylingProperties -exports.stylingProps = [ - 'font', - 'font-family', - 'font-size', - 'font-size-adjust', - 'font-stretch', - 'font-style', - 'font-variant', - 'font-weight',, - 'direction', - 'letter-spacing', - 'text-decoration', - 'unicode-bidi', - 'word-spacing', - 'clip', - 'color', - 'cursor', - 'display', - 'overflow', - 'visibility', - 'clip-path', - 'clip-rule', - 'mask', - 'opacity', - 'enable-background', - 'filter', - 'flood-color', - 'flood-opacity', - 'lighting-color', - 'stop-color', - 'stop-opacity', - 'pointer-events', - 'color-interpolation', - 'color-interpolation-filters', - 'color-profile', - 'color-rendering', - 'fill', - 'fill-opacity', - 'fill-rule', - 'image-rendering', - 'marker', - 'marker-end', - 'marker-mid', - 'marker-start', - 'shape-rendering', - 'stroke', - 'stroke-dasharray', - 'stroke-dashoffset', - 'stroke-linecap', - 'stroke-linejoin', - 'stroke-miterlimit', - 'stroke-opacity', - 'stroke-width', - 'text-rendering', - 'alignment-baseline', - 'baseline-shift', - 'dominant-baseline', - 'glyph-orientation-horizontal', - 'glyph-orientation-vertical', - 'kerning', - 'text-anchor', - 'writing-mode' -]; - -// http://www.w3.org/TR/SVG/propidx.html -exports.inheritableAttrs = [ - 'clip-rule', - 'color', - 'color-interpolation', - 'color-interpolation-filters', - 'color-profile', - 'color-rendering', - 'cursor', - 'direction', - 'fill', - 'fill-opacity', - 'fill-rule', - 'font', - 'font-family', - 'font-size', - 'font-size-adjust', - 'font-stretch', - 'font-style', - 'font-variant', - 'font-weight', - 'glyph-orientation-horizontal', - 'glyph-orientation-vertical', - 'image-rendering', - 'kerning', - 'letter-spacing', - 'marker', - 'marker-end', - 'marker-mid', - 'marker-start', - 'pointer-events', - 'shape-rendering', - 'stroke', - 'stroke-dasharray', - 'stroke-dashoffset', - 'stroke-linecap', - 'stroke-linejoin', - 'stroke-miterlimit', - 'stroke-opacity', - 'stroke-width', - 'text-anchor', - 'text-rendering', - 'transform', - 'visibility', - 'word-spacing', - 'writing-mode' -]; - -// http://www.w3.org/TR/SVG/single-page.html#types-ColorKeywords -exports.colorsNames = { - 'aliceblue': '#f0f8ff', - 'antiquewhite': '#faebd7', - 'aqua': '#0ff', - 'aquamarine': '#7fffd4', - 'azure': '#f0ffff', - 'beige': '#f5f5dc', - 'bisque': '#ffe4c4', - 'black': '#000', - 'blanchedalmond': '#ffebcd', - 'blue': '#00f', - 'blueviolet': '#8a2be2', - 'brown': '#a52a2a', - 'burlywood': '#deb887', - 'cadetblue': '#5f9ea0', - 'chartreuse': '#7fff00', - 'chocolate': '#d2691e', - 'coral': '#ff7f50', - 'cornflowerblue': '#6495ed', - 'cornsilk': '#fff8dc', - 'crimson': '#dc143c', - 'cyan': '#0ff', - 'darkblue': '#00008b', - 'darkcyan': '#008b8b', - 'darkgoldenrod': '#b8860b', - 'darkgray': '#a9a9a9', - 'darkgreen': '#006400', - 'darkkhaki': '#bdb76b', - 'darkmagenta': '#8b008b', - 'darkolivegreen': '#556b2f', - 'darkorange': '#ff8c00', - 'darkorchid': '#9932cc', - 'darkred': '#8b0000', - 'darksalmon': '#e9967a', - 'darkseagreen': '#8fbc8f', - 'darkslateblue': '#483d8b', - 'darkslategray': '#2f4f4f', - 'darkturquoise': '#00ced1', - 'darkviolet': '#9400d3', - 'deeppink': '#ff1493', - 'deepskyblue': '#00bfff', - 'dimgray': '#696969', - 'dodgerblue': '#1e90ff', - 'firebrick': '#b22222', - 'floralwhite': '#fffaf0', - 'forestgreen': '#228b22', - 'fuchsia': '#f0f', - 'gainsboro': '#dcdcdc', - 'ghostwhite': '#f8f8ff', - 'gold': '#ffd700', - 'goldenrod': '#daa520', - 'gray': '#808080', - 'green': '#008000', - 'greenyellow': '#adff2f', - 'honeydew': '#f0fff0', - 'hotpink': '#ff69b4', - 'indianred': '#cd5c5c', - 'indigo': '#4b0082', - 'ivory': '#fffff0', - 'khaki': '#f0e68c', - 'lavender': '#e6e6fa', - 'lavenderblush': '#fff0f5', - 'lawngreen': '#7cfc00', - 'lemonchiffon': '#fffacd', - 'lightblue': '#add8e6', - 'lightcoral': '#f08080', - 'lightcyan': '#e0ffff', - 'lightgoldenrodyellow': '#fafad2', - 'lightgreen': '#90ee90', - 'lightgrey': '#d3d3d3', - 'lightpink': '#ffb6c1', - 'lightsalmon': '#ffa07a', - 'lightseagreen': '#20b2aa', - 'lightskyblue': '#87cefa', - 'lightslategray': '#778899', - 'lightsteelblue': '#b0c4de', - 'lightyellow': '#ffffe0', - 'lime': '#00ff00', - 'limegreen': '#32cd32', - 'linen': '#faf0e6', - 'magenta': '#f0f', - 'maroon': '#800000', - 'mediumaquamarine': '#66cdaa', - 'mediumblue': '#0000cd', - 'mediumorchid': '#ba55d3', - 'mediumpurple': '#9370db', - 'mediumseagreen': '#3cb371', - 'mediumslateblue': '#7b68ee', - 'mediumspringgreen': '#00fa9a', - 'mediumturquoise': '#48d1cc', - 'mediumvioletred': '#c71585', - 'midnightblue': '#191970', - 'mintcream': '#f5fffa', - 'mistyrose': '#ffe4e1', - 'moccasin': '#ffe4b5', - 'navajowhite': '#ffdead', - 'navy': '#000080', - 'oldlace': '#fdf5e6', - 'olive': '#808000', - 'olivedrab': '#6b8e23', - 'orange': '#ffa500', - 'orangered': '#ff4500', - 'orchid': '#da70d6', - 'palegoldenrod': '#eee8aa', - 'palegreen': '#98fb98', - 'paleturquoise': '#afeeee', - 'palevioletred': '#db7093', - 'papayawhip': '#ffefd5', - 'peachpuff': '#ffdab9', - 'peru': '#cd853f', - 'pink': '#ffc0cb', - 'plum': '#dda0dd', - 'powderblue': '#b0e0e6', - 'purple': '#800080', - 'red': '#f00', - 'rosybrown': '#bc8f8f', - 'royalblue': '#4169e1', - 'saddlebrown': '#8b4513', - 'salmon': '#fa8072', - 'sandybrown': '#f4a460', - 'seagreen': '#2e8b57', - 'seashell': '#fff5ee', - 'sienna': '#a0522d', - 'silver': '#c0c0c0', - 'skyblue': '#87ceeb', - 'slateblue': '#6a5acd', - 'slategray': '#708090', - 'snow': '#fffafa', - 'springgreen': '#00ff7f', - 'steelblue': '#4682b4', - 'tan': '#d2b48c', - 'teal': '#008080', - 'thistle': '#d8bfd8', - 'tomato': '#ff6347', - 'turquoise': '#40e0d0', - 'violet': '#ee82ee', - 'wheat': '#f5deb3', - 'white': '#fff', - 'whitesmoke': '#f5f5f5', - 'yellow': '#ff00', - 'yellowgreen': '#9acd32' -}; - -// http://www.w3.org/TR/SVG/single-page.html#types-DataTypeColor -exports.colorsProps = [ - 'color', 'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color' -]; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/plugins/_path.js b/node_modules/grunt-svgmin/node_modules/svgo/plugins/_path.js deleted file mode 100644 index e8d3a1a..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/plugins/_path.js +++ /dev/null @@ -1,486 +0,0 @@ -'use strict'; - -var regPathInstructions = /([MmLlHhVvCcSsQqTtAaZz])\s*/, - regPathData = /[\-+]?\d*\.?\d+([eE][\-+]?\d+)?/g, - transform2js = require('./_transforms').transform2js, - transformsMultiply = require('./_transforms').transformsMultiply, - cleanupOutData = require('../lib/svgo/tools').cleanupOutData; - -/** - * Convert path string to JS representation. - * - * @param {String} pathString input string - * @param {Object} params plugin params - * @return {Array} output array - */ -exports.path2js = function(pathString) { - - // JS representation of the path data - var path = [], - // current instruction context - instruction; - - // splitting path string into array like ['M', '10 50', 'L', '20 30'] - pathString.split(regPathInstructions).forEach(function(data) { - if (data) { - // instruction item - if (regPathInstructions.test(data)) { - instruction = data; - - // z - instruction w/o data - if ('Zz'.indexOf(instruction) > -1) { - path.push({ - instruction: 'z' - }); - } - // data item - } else { - - data = data.trim().match(regPathData); - - if (data) { - - var index = 0, - pair = 2; - - data = data.map(function(str) { - return +str; - }); - - // deal with very first 'Mm' and multiple points data - if ('Mm'.indexOf(instruction) > -1) { - - path.push({ - instruction: instruction, - data: data.slice(index, index + pair) - }); - - index += pair; - - if (data.length) { - instruction = instruction === instruction.toLowerCase() ? 'l' : 'L'; - } - - } - - if ('HhVv'.indexOf(instruction) > -1) { - pair = 1; - } else if ('LlTt'.indexOf(instruction) > -1) { - pair = 2; - } else if ('QqSs'.indexOf(instruction) > -1) { - pair = 4; - } else if ('Cc'.indexOf(instruction) > -1) { - pair = 6; - } else if ('Aa'.indexOf(instruction) > -1) { - pair = 7; - } - - while(index < data.length) { - path.push({ - instruction: instruction, - data: data.slice(index, index + pair) - }); - - index += pair; - } - - } - - } - } - }); - - return path; - -}; - -/** - * Convert relative Path data to absolute. - * - * @param {Array} data input data - * @return {Array} output data - */ -exports.relative2absolute = function(data) { - - var currentPoint = [0, 0], - subpathPoint = [0, 0], - i; - - data.forEach(function(item) { - - if (item.instruction === 'M') { - - currentPoint = item.data.slice(-2); - subpathPoint = item.data.slice(-2); - - } else if ('mlcsqta'.indexOf(item.instruction) > -1) { - - for (i = 0; i < item.data.length; i++) { - if (i % 2 === 0) { - item.data[i] += currentPoint[0]; - } else { - item.data[i] += currentPoint[1]; - } - - if (i > 0) { - var index = i + 1; - - if ('mlt'.indexOf(item.instruction) > -1 && index % 2 === 0) { - currentPoint[0] = item.data[i - 1]; - currentPoint[1] = item.data[i]; - } else if ('qs'.indexOf(item.instruction) > -1 && index % 4 === 0) { - currentPoint[0] = item.data[i - 1]; - currentPoint[1] = item.data[i]; - } else if (item.instruction === 'c' && index % 6 === 0) { - currentPoint[0] = item.data[i - 1]; - currentPoint[1] = item.data[i]; - } else if (item.instruction === 'a' && index % 7 === 0) { - currentPoint[0] = item.data[i - 1]; - currentPoint[1] = item.data[i]; - } - } - } - - if (item.instruction === 'm') { - subpathPoint = item.data.slice(-2); - } - - } else if (item.instruction === 'h') { - - for (i = 0; i < item.data.length; i++) { - item.data[i] += currentPoint[0]; - } - - currentPoint[0] = item.data[item.data.length - 1]; - - } else if (item.instruction === 'v') { - - for (i = 0; i < item.data.length; i++) { - item.data[i] += currentPoint[1]; - } - - currentPoint[1] = item.data[item.data.length - 1]; - - } else { - - currentPoint = subpathPoint; - - } - - item.instruction = item.instruction.toUpperCase(); - - }); - - return data; - -}; - -/** - * Apply transformation(s) to the Path data. - * - * @param {Object} elem current element - * @param {Array} path input path data - * @return {Array} output path data - */ -exports.applyTransforms = function(elem, path) { - - // if there are no 'stroke' attr and 'a' segments - if ( - elem.hasAttr('transform') && - !elem.hasAttr('stroke') && - path.every(function(i) { return i.instruction !== 'a'; }) - ) { - - var matrix = transformsMultiply(transform2js(elem.attr('transform').value)), - newPoint; - - path.forEach(function(pathItem) { - - if (pathItem.data) { - - // h -> l - if (pathItem.instruction === 'h') { - - pathItem.instruction = 'l'; - pathItem.data[1] = 0; - - // v -> l - } else if (pathItem.instruction === 'v') { - - pathItem.instruction = 'l'; - pathItem.data[1] = pathItem.data[0]; - pathItem.data[0] = 0; - - } - - // if there is a translate() transform - if (pathItem.instruction === 'M' && - (matrix.data[4] !== 0 || - matrix.data[5] !== 0) - ) { - - // then apply it only to the first absoluted M - newPoint = transformPoint(matrix.data, pathItem.data[0], pathItem.data[1]); - pathItem.data[0] = newPoint[0]; - pathItem.data[1] = newPoint[1]; - - // clear translate() data from transform matrix - matrix.data[4] = 0; - matrix.data[5] = 0; - - } else { - - for (var i = 0; i < pathItem.data.length; i += 2) { - newPoint = transformPoint(matrix.data, pathItem.data[i], pathItem.data[i + 1]); - pathItem.data[i] = newPoint[0]; - pathItem.data[i + 1] = newPoint[1]; - } - - } - - } - - }); - - // remove transform attr - elem.removeAttr('transform'); - - } - - return path; - -}; - -/** - * Apply transform 3x3 matrix to x-y point. - * - * @param {Array} matrix transform 3x3 matrix - * @param {Array} point x-y point - * @return {Array} point with new coordinates - */ -function transformPoint(matrix, x, y) { - - return [ - matrix[0] * x + matrix[2] * y + matrix[4], - matrix[1] * x + matrix[3] * y + matrix[5] - ]; - -} - -/** - * Compute Cubic Bézie bounding box. - * - * @see http://processingjs.nihongoresources.com/bezierinfo/ - * - * @param {Float} xa - * @param {Float} ya - * @param {Float} xb - * @param {Float} yb - * @param {Float} xc - * @param {Float} yc - * @param {Float} xd - * @param {Float} yd - * - * @return {Object} - */ -exports.computeCubicBoundingBox = function(xa, ya, xb, yb, xc, yc, xd, yd) { - - var minx = Number.POSITIVE_INFINITY, - miny = Number.POSITIVE_INFINITY, - maxx = Number.NEGATIVE_INFINITY, - maxy = Number.NEGATIVE_INFINITY, - ts, - t, - x, - y, - i; - - // X - if (xa < minx) { minx = xa; } - if (xa > maxx) { maxx = xa; } - if (xd < minx) { minx= xd; } - if (xd > maxx) { maxx = xd; } - - ts = computeCubicFirstDerivativeRoots(xa, xb, xc, xd); - - for (i = 0; i < ts.length; i++) { - - t = ts[i]; - - if (t >= 0 && t <= 1) { - x = computeCubicBaseValue(t, xa, xb, xc, xd); - // y = computeCubicBaseValue(t, ya, yb, yc, yd); - - if (x < minx) { minx = x; } - if (x > maxx) { maxx = x; } - } - - } - - // Y - if (ya < miny) { miny = ya; } - if (ya > maxy) { maxy = ya; } - if (yd < miny) { miny = yd; } - if (yd > maxy) { maxy = yd; } - - ts = computeCubicFirstDerivativeRoots(ya, yb, yc, yd); - - for (i = 0; i < ts.length; i++) { - - t = ts[i]; - - if (t >= 0 && t <= 1) { - // x = computeCubicBaseValue(t, xa, xb, xc, xd); - y = computeCubicBaseValue(t, ya, yb, yc, yd); - - if (y < miny) { miny = y; } - if (y > maxy) { maxy = y; } - } - - } - - return { - minx: minx, - miny: miny, - maxx: maxx, - maxy: maxy - }; - -}; - -// compute the value for the cubic bezier function at time=t -function computeCubicBaseValue(t, a, b, c, d) { - - var mt = 1 - t; - - return mt * mt * mt * a + 3 * mt * mt * t * b + 3 * mt * t * t * c + t * t * t * d; - -} - -// compute the value for the first derivative of the cubic bezier function at time=t -function computeCubicFirstDerivativeRoots(a, b, c, d) { - - var result = [-1, -1], - tl = -a + 2 * b - c, - tr = -Math.sqrt(-a * (c - d) + b * b - b * (c + d) + c * c), - dn = -a + 3 * b - 3 * c + d; - - if (dn !== 0) { - result[0] = (tl + tr) / dn; - result[1] = (tl - tr) / dn; - } - - return result; - -} - -/** - * Compute Quadratic Bézier bounding box. - * - * @see http://processingjs.nihongoresources.com/bezierinfo/ - * - * @param {Float} xa - * @param {Float} ya - * @param {Float} xb - * @param {Float} yb - * @param {Float} xc - * @param {Float} yc - * - * @return {Object} - */ -exports.computeQuadraticBoundingBox = function(xa, ya, xb, yb, xc, yc) { - - var minx = Number.POSITIVE_INFINITY, - miny = Number.POSITIVE_INFINITY, - maxx = Number.NEGATIVE_INFINITY, - maxy = Number.NEGATIVE_INFINITY, - t, - x, - y; - - // X - if (xa < minx) { minx = xa; } - if (xa > maxx) { maxx = xa; } - if (xc < minx) { minx = xc; } - if (xc > maxx) { maxx = xc; } - - t = computeQuadraticFirstDerivativeRoot(xa, xb, xc); - - if (t >= 0 && t <= 1) { - x = computeQuadraticBaseValue(t, xa, xb, xc); - // y = computeQuadraticBaseValue(t, ya, yb, yc); - - if (x < minx) { minx = x; } - if (x > maxx) { maxx = x; } - } - - // Y - if (ya < miny) { miny = ya; } - if (ya > maxy) { maxy = ya; } - if (yc < miny) { miny = yc; } - if (yc > maxy) { maxy = yc; } - - t = computeQuadraticFirstDerivativeRoot(ya, yb, yc); - - if (t >= 0 && t <=1 ) { - // x = computeQuadraticBaseValue(t, xa, xb, xc); - y = computeQuadraticBaseValue(t, ya, yb, yc); - - if (y < miny) { miny = y; } - if (y > maxy) { maxy = y ; } - - } - - return { - minx: minx, - miny: miny, - maxx: maxx, - maxy: maxy - }; - -}; - -// compute the value for the quadratic bezier function at time=t -function computeQuadraticBaseValue(t, a, b, c) { - - var mt = 1 - t; - - return mt * mt * a + 2 * mt * t * b + t * t * c; - -} - -// compute the value for the first derivative of the quadratic bezier function at time=t -function computeQuadraticFirstDerivativeRoot(a, b, c) { - - var t = -1, - denominator = a - 2 * b + c; - - if (denominator !== 0) { - t = (a - b) / denominator; - } - - return t; - -} - -/** - * Convert path array to string. - * - * @param {Array} path input path data - * @param {Object} params plugin params - * @return {String} output path string - */ -exports.js2path = function(path, params) { - - // output path data string - var pathString = ''; - - path.forEach(function(item) { - - pathString += item.instruction + (item.data ? cleanupOutData(item.data, params) : ''); - - }); - - return pathString; - -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/plugins/_transforms.js b/node_modules/grunt-svgmin/node_modules/svgo/plugins/_transforms.js deleted file mode 100644 index 24a9eaa..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/plugins/_transforms.js +++ /dev/null @@ -1,248 +0,0 @@ -'use strict'; - -var regTransformTypes = /matrix|translate|scale|rotate|skewX|skewY/, - regTransformSplit = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, - regTransformDataSplit = /[\s,]+/; - -/** - * Convert transform string to JS representation. - * - * @param {String} transformString input string - * @param {Object} params plugin params - * @return {Array} output array - */ -exports.transform2js = function(transformString) { - - // JS representation of the transform data - var transforms = [], - // current transform context - current; - - // split value into ['', 'translate', '10 50', '', 'scale', '2', '', 'rotate', '-45', ''] - transformString.split(regTransformSplit).forEach(function(item) { - - if (item) { - // if item is a translate function - if (regTransformTypes.test(item)) { - // then collect it and change current context - transforms.push(current = { - name: item - }); - // else if item is data - } else { - // then split it into [10, 50] and collect as context.data - current.data = item.split(regTransformDataSplit).map(function(i) { - return +i; - }); - } - } - - }); - - return transforms; - -}; - -/** - * Multiply transforms into one. - * - * @param {Array} input transforms array - * @return {Array} output matrix array - */ -exports.transformsMultiply = function(transforms) { - - // convert transforms objects to the matrices - transforms = transforms.map(function(transform) { - return transform.name === 'martix' ? - transform : - transformToMatrix(transform); - }); - - // multiply all matrices into one - transforms = { - name: 'matrix', - data: transforms.reduce(function(a, b) { - return multiplyTransformMatrices(a, b); - }) - }; - - return transforms; - -}; - -/** - * Do math like a schoolgirl. - * - * @type {Object} - */ -var mth = exports.mth = { - - rad: function(deg) { - return deg * Math.PI / 180; - }, - - deg: function(rad) { - return rad * 180 / Math.PI; - }, - - cos: function(deg) { - return Math.cos(this.rad(deg)); - }, - - acos: function(val, floatPrecision) { - return +(this.deg(Math.acos(val)).toFixed(floatPrecision)); - }, - - sin: function(deg) { - return Math.sin(this.rad(deg)); - }, - - asin: function(val, floatPrecision) { - return +(this.deg(Math.asin(val)).toFixed(floatPrecision)); - }, - - tan: function(deg) { - return Math.tan(this.rad(deg)); - }, - - atan: function(val, floatPrecision) { - return +(this.deg(Math.atan(val)).toFixed(floatPrecision)); - } - -}; - -/** - * Convert matrix data to the transform alias. - * - * @param {Object} data matrix transform object - * @return {Object} transform object - */ -exports.matrixToTransform = function(transform, params) { - - var data = transform.data; - - // [1, 0, 0, 1, tx, ty] → translate(tx, ty) - if ( - data[0] === 1 && - data[1] === 0 && - data[2] === 0 && - data[3] === 1 - ) { - transform.name = 'translate'; - transform.data = [data[4], data[5]]; - - // [sx, 0, 0, sy, 0, 0] → scale(sx, sy) - } else if ( - data[1] === 0 && - data[2] === 0 && - data[4] === 0 && - data[5] === 0 - ) { - transform.name = 'scale'; - transform.data = [data[0], data[3]]; - - // [cos(a), sin(a), -sin(a), cos(a), 0 0] → rotate(a) - } else if ( - data[0] === data[3] && - data[1] === -data[2] && - data[4] === 0 && - data[5] === 0 - ) { - var a1 = mth.acos(data[0], params.floatPrecision), - a2 = mth.asin(data[1], params.floatPrecision); - - a1 = a2 < 0 ? -a1 : a1; - - if (Math.round(a1) === Math.round(a2)) { - transform.name = 'rotate'; - transform.data = [a1]; - } - - // [1, 0, tan(a), 1, 0, 0] → skewX(a) - } else if ( - data[0] === 1 && - data[1] === 0 && - data[3] === 1 && - data[4] === 0 && - data[5] === 0 - ) { - transform.name = 'skewX'; - transform.data = [mth.atan(data[2], params.floatPrecision)]; - - // [1, tan(a), 0, 1, 0, 0] → skewY(a) - } else if ( - data[0] === 1 && - data[2] === 0 && - data[3] === 1 && - data[4] === 0 && - data[5] === 0 - ) { - transform.name = 'skewY'; - transform.data = [mth.atan(data[1], params.floatPrecision)]; - } - - return transform; - -}; - -/** - * Convert transform to the matrix data. - * - * @param {Object} transform transform object - * @return {Array} matrix data - */ -var transformToMatrix = exports.transformToMatrix = function(transform) { - - if (transform.name === 'matrix') return transform.data; - - var matrix; - - switch(transform.name) { - case 'translate': - // [1, 0, 0, 1, tx, ty] - matrix = [1, 0, 0, 1, transform.data[0], transform.data[1] || 0]; - break; - case 'scale': - // [sx, 0, 0, sy, 0, 0] - matrix = [transform.data[0], 0, 0, transform.data[1] || transform.data[0], 0, 0]; - break; - case 'rotate': - // [cos(a), sin(a), -sin(a), cos(a), 0, 0] - var cos = mth.cos(transform.data[0]), - sin = mth.sin(transform.data[0]); - - matrix = [cos, sin, -sin, cos, 0, 0]; - break; - case 'skewX': - // [1, 0, tan(a), 1, 0, 0] - matrix = [1, 0, mth.tan(transform.data[0]), 1, 0, 0]; - break; - case 'skewY': - // [1, tan(a), 0, 1, 0, 0] - matrix = [1, mth.tan(transform.data[0]), 0, 1, 0, 0]; - break; - } - - return matrix; - -}; - -/** - * Multiply transformation matrices. - * - * @param {Array} a matrix A data - * @param {Array} b matrix B data - * @return {Array} result - */ -function multiplyTransformMatrices(a, b) { - - return [ - +(a[0] * b[0] + a[2] * b[1]).toFixed(3), - +(a[1] * b[0] + a[3] * b[1]).toFixed(3), - +(a[0] * b[2] + a[2] * b[3]).toFixed(3), - +(a[1] * b[2] + a[3] * b[3]).toFixed(3), - +(a[0] * b[4] + a[2] * b[5] + a[4]).toFixed(3), - +(a[1] * b[4] + a[3] * b[5] + a[5]).toFixed(3) - ]; - -} diff --git a/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupAttrs.js b/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupAttrs.js deleted file mode 100644 index 51effd8..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupAttrs.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -exports.type = 'perItem'; - -exports.active = true; - -exports.params = { - newlines: true, - trim: true, - spaces: true -}; - -var regNewlinesNeedSpace = /(\S)\n(\S)/g, - regNewlines = /\n/g, - regSpaces = /\s{2,}/g; - -/** - * Cleanup attributes values from newlines, trailing and repeating spaces. - * - * @param {Object} item current iteration item - * @param {Object} params plugin params - * @return {Boolean} if false, item will be filtered out - * - * @author Kir Belevich - */ -exports.fn = function(item, params) { - - if (item.isElem()) { - - item.eachAttr(function(attr) { - - if (params.newlines) { - // new line which requires a space instead of themselve - attr.value = attr.value.replace(regNewlinesNeedSpace, function(match, p1, p2) { - return p1 + ' ' + p2; - }); - - // simple new line - attr.value = attr.value.replace(regNewlines, ''); - } - - if (params.trim) { - attr.value = attr.value.trim(); - } - - if (params.spaces) { - attr.value = attr.value.replace(regSpaces, ' '); - } - - }); - - } - -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupEnableBackground.js b/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupEnableBackground.js deleted file mode 100644 index f27c5b3..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupEnableBackground.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -exports.type = 'perItem'; - -exports.active = true; - -var regEnableBackground = /^new\s0\s0\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)$/, - elems = ['svg', 'mask', 'pattern']; - -/** - * Remove or cleanup enable-background attr which coincides with a width/height box. - * - * @see http://www.w3.org/TR/SVG/filters.html#EnableBackgroundProperty - * - * @example - * - * ⬇ - * - * - * @param {Object} item current iteration item - * @return {Boolean} if false, item will be filtered out - * - * @author Kir Belevich - */ -exports.fn = function(item) { - - if ( - item.isElem(elems) && - item.hasAttr('enable-background') && - item.hasAttr('width') && - item.hasAttr('height') - ) { - - var match = item.attr('enable-background').value.match(regEnableBackground); - - if (match) { - if ( - item.attr('width').value === match[1] && - item.attr('height').value === match[3] - ) { - if (item.isElem('svg')) { - item.removeAttr('enable-background'); - } else { - item.attr('enable-background').value = 'new'; - } - } - } - - } - -}; diff --git a/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupIDs.js b/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupIDs.js deleted file mode 100644 index 592b0fa..0000000 --- a/node_modules/grunt-svgmin/node_modules/svgo/plugins/cleanupIDs.js +++ /dev/null @@ -1,203 +0,0 @@ -'use strict'; - -exports.type = 'full'; - -exports.active = true; - -exports.params = { - remove: true, - minify: true -}; - -var referencesProps = require('./_collections').referencesProps, - regReferencesUrl = /^url\(#(.+?)\)$/, - regReferencesHref = /^#(.+?)$/, - styleOrScript = ['style', 'script'], - generateIDchars = [ - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' - ], - maxIDindex = generateIDchars.length - 1; - -/** - * Remove unused and minify used IDs - * (only if there are no any - - -## Installation - - npm install colors - -## colors and styles! - -- bold -- italic -- underline -- inverse -- yellow -- cyan -- white -- magenta -- green -- red -- grey -- blue -- rainbow -- zebra -- random - -## Usage - -``` js -var colors = require('./colors'); - -console.log('hello'.green); // outputs green text -console.log('i like cake and pies'.underline.red) // outputs red underlined text -console.log('inverse the color'.inverse); // inverses the color -console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) -``` - -# Creating Custom themes - -```js - -var colors = require('colors'); - -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); -``` - - -### Contributors - -Marak (Marak Squires) -Alexis Sellier (cloudhead) -mmalecki (Maciej Małecki) -nicoreed (Nico Reed) -morganrallen (Morgan Allen) -JustinCampbell (Justin Campbell) -ded (Dustin Diaz) - - -#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded) diff --git a/node_modules/grunt/node_modules/colors/colors.js b/node_modules/grunt/node_modules/colors/colors.js deleted file mode 100644 index 7a537d8..0000000 --- a/node_modules/grunt/node_modules/colors/colors.js +++ /dev/null @@ -1,342 +0,0 @@ -/* -colors.js - -Copyright (c) 2010 - -Marak Squires -Alexis Sellier (cloudhead) - -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 isHeadless = false; - -if (typeof module !== 'undefined') { - isHeadless = true; -} - -if (!isHeadless) { - var exports = {}; - var module = {}; - var colors = exports; - exports.mode = "browser"; -} else { - exports.mode = "console"; -} - -// -// Prototypes the string object to have additional method calls that add terminal colors -// -var addProperty = function (color, func) { - exports[color] = function (str) { - return func.apply(str); - }; - String.prototype.__defineGetter__(color, func); -}; - -function stylize(str, style) { - - var styles; - - if (exports.mode === 'console') { - styles = { - //styles - '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'], - //text colors - //grayscale - 'white' : ['\x1B[37m', '\x1B[39m'], - 'grey' : ['\x1B[90m', '\x1B[39m'], - 'black' : ['\x1B[30m', '\x1B[39m'], - //colors - 'blue' : ['\x1B[34m', '\x1B[39m'], - 'cyan' : ['\x1B[36m', '\x1B[39m'], - 'green' : ['\x1B[32m', '\x1B[39m'], - 'magenta' : ['\x1B[35m', '\x1B[39m'], - 'red' : ['\x1B[31m', '\x1B[39m'], - 'yellow' : ['\x1B[33m', '\x1B[39m'], - //background colors - //grayscale - 'whiteBG' : ['\x1B[47m', '\x1B[49m'], - 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'], - 'blackBG' : ['\x1B[40m', '\x1B[49m'], - //colors - 'blueBG' : ['\x1B[44m', '\x1B[49m'], - 'cyanBG' : ['\x1B[46m', '\x1B[49m'], - 'greenBG' : ['\x1B[42m', '\x1B[49m'], - 'magentaBG' : ['\x1B[45m', '\x1B[49m'], - 'redBG' : ['\x1B[41m', '\x1B[49m'], - 'yellowBG' : ['\x1B[43m', '\x1B[49m'] - }; - } else if (exports.mode === 'browser') { - styles = { - //styles - 'bold' : ['', ''], - 'italic' : ['', ''], - 'underline' : ['', ''], - 'inverse' : ['', ''], - 'strikethrough' : ['', ''], - //text colors - //grayscale - 'white' : ['', ''], - 'grey' : ['', ''], - 'black' : ['', ''], - //colors - 'blue' : ['', ''], - 'cyan' : ['', ''], - 'green' : ['', ''], - 'magenta' : ['', ''], - 'red' : ['', ''], - 'yellow' : ['', ''], - //background colors - //grayscale - 'whiteBG' : ['', ''], - 'greyBG' : ['', ''], - 'blackBG' : ['', ''], - //colors - 'blueBG' : ['', ''], - 'cyanBG' : ['', ''], - 'greenBG' : ['', ''], - 'magentaBG' : ['', ''], - 'redBG' : ['', ''], - 'yellowBG' : ['', ''] - }; - } else if (exports.mode === 'none') { - return str + ''; - } else { - console.log('unsupported mode, try "browser", "console" or "none"'); - } - return styles[style][0] + str + styles[style][1]; -} - -function applyTheme(theme) { - - // - // Remark: This is a list of methods that exist - // on String that you should not overwrite. - // - var stringPrototypeBlacklist = [ - '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', - 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', - 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', - 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' - ]; - - Object.keys(theme).forEach(function (prop) { - if (stringPrototypeBlacklist.indexOf(prop) !== -1) { - console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); - } - else { - if (typeof(theme[prop]) === 'string') { - addProperty(prop, function () { - return exports[theme[prop]](this); - }); - } - else { - addProperty(prop, function () { - var ret = this; - for (var t = 0; t < theme[prop].length; t++) { - ret = exports[theme[prop][t]](ret); - } - return ret; - }); - } - } - }); -} - - -// -// Iterate through all default styles and colors -// -var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG']; -x.forEach(function (style) { - - // __defineGetter__ at the least works in more browsers - // http://robertnyman.com/javascript/javascript-getters-setters.html - // Object.defineProperty only works in Chrome - addProperty(style, function () { - return stylize(this, style); - }); -}); - -function sequencer(map) { - return function () { - if (!isHeadless) { - return this.replace(/( )/, '$1'); - } - var exploded = this.split(""), i = 0; - exploded = exploded.map(map); - return exploded.join(""); - }; -} - -var rainbowMap = (function () { - var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV - return function (letter, i, exploded) { - if (letter === " ") { - return letter; - } else { - return stylize(letter, rainbowColors[i++ % rainbowColors.length]); - } - }; -})(); - -exports.themes = {}; - -exports.addSequencer = function (name, map) { - addProperty(name, sequencer(map)); -}; - -exports.addSequencer('rainbow', rainbowMap); -exports.addSequencer('zebra', function (letter, i, exploded) { - return i % 2 === 0 ? letter : letter.inverse; -}); - -exports.setTheme = function (theme) { - if (typeof theme === 'string') { - try { - exports.themes[theme] = require(theme); - applyTheme(exports.themes[theme]); - return exports.themes[theme]; - } catch (err) { - console.log(err); - return err; - } - } else { - applyTheme(theme); - } -}; - - -addProperty('stripColors', function () { - return ("" + this).replace(/\x1B\[\d+m/g, ''); -}); - -// please no -function zalgo(text, options) { - var soul = { - "up" : [ - '̍', '̎', '̄', '̅', - '̿', '̑', '̆', '̐', - '͒', '͗', '͑', '̇', - '̈', '̊', '͂', '̓', - '̈', '͊', '͋', '͌', - '̃', '̂', '̌', '͐', - '̀', '́', '̋', '̏', - '̒', '̓', '̔', '̽', - '̉', 'ͣ', 'ͤ', 'ͥ', - 'ͦ', 'ͧ', 'ͨ', 'ͩ', - 'ͪ', 'ͫ', 'ͬ', 'ͭ', - 'ͮ', 'ͯ', '̾', '͛', - '͆', '̚' - ], - "down" : [ - '̖', '̗', '̘', '̙', - '̜', '̝', '̞', '̟', - '̠', '̤', '̥', '̦', - '̩', '̪', '̫', '̬', - '̭', '̮', '̯', '̰', - '̱', '̲', '̳', '̹', - '̺', '̻', '̼', 'ͅ', - '͇', '͈', '͉', '͍', - '͎', '͓', '͔', '͕', - '͖', '͙', '͚', '̣' - ], - "mid" : [ - '̕', '̛', '̀', '́', - '͘', '̡', '̢', '̧', - '̨', '̴', '̵', '̶', - '͜', '͝', '͞', - '͟', '͠', '͢', '̸', - '̷', '͡', ' ҉' - ] - }, - all = [].concat(soul.up, soul.down, soul.mid), - zalgo = {}; - - function randomNumber(range) { - var r = Math.floor(Math.random() * range); - return r; - } - - function is_char(character) { - var bool = false; - all.filter(function (i) { - bool = (i === character); - }); - return bool; - } - - function heComes(text, options) { - var result = '', counts, l; - options = options || {}; - options["up"] = options["up"] || true; - options["mid"] = options["mid"] || true; - options["down"] = options["down"] || true; - options["size"] = options["size"] || "maxi"; - text = text.split(''); - for (l in text) { - if (is_char(l)) { - continue; - } - result = result + text[l]; - counts = {"up" : 0, "down" : 0, "mid" : 0}; - switch (options.size) { - case 'mini': - counts.up = randomNumber(8); - counts.min = randomNumber(2); - counts.down = randomNumber(8); - break; - case 'maxi': - counts.up = randomNumber(16) + 3; - counts.min = randomNumber(4) + 1; - counts.down = randomNumber(64) + 3; - break; - default: - counts.up = randomNumber(8) + 1; - counts.mid = randomNumber(6) / 2; - counts.down = randomNumber(8) + 1; - break; - } - - var arr = ["up", "mid", "down"]; - for (var d in arr) { - var index = arr[d]; - for (var i = 0 ; i <= counts[index]; i++) { - if (options[index]) { - result = result + soul[index][randomNumber(soul[index].length)]; - } - } - } - } - return result; - } - return heComes(text); -} - - -// don't summon zalgo -addProperty('zalgo', function () { - return zalgo(this); -}); diff --git a/node_modules/grunt/node_modules/colors/example.html b/node_modules/grunt/node_modules/colors/example.html deleted file mode 100644 index 7a2ae60..0000000 --- a/node_modules/grunt/node_modules/colors/example.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Colors Example - - - - - - \ No newline at end of file diff --git a/node_modules/grunt/node_modules/colors/example.js b/node_modules/grunt/node_modules/colors/example.js deleted file mode 100644 index b1e03a4..0000000 --- a/node_modules/grunt/node_modules/colors/example.js +++ /dev/null @@ -1,77 +0,0 @@ -var colors = require('./colors'); - -//colors.mode = "browser"; - -var test = colors.red("hopefully colorless output"); -console.log('Rainbows are fun!'.rainbow); -console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported -console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported -//console.log('zalgo time!'.zalgo); -console.log(test.stripColors); -console.log("a".grey + " b".black); -console.log("Zebras are so fun!".zebra); -console.log('background color attack!'.black.whiteBG) - -// -// Remark: .strikethrough may not work with Mac OS Terminal App -// -console.log("This is " + "not".strikethrough + " fun."); -console.log(colors.rainbow('Rainbows are fun!')); -console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported -console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported -//console.log(colors.zalgo('zalgo time!')); -console.log(colors.stripColors(test)); -console.log(colors.grey("a") + colors.black(" b")); - -colors.addSequencer("america", function(letter, i, exploded) { - if(letter === " ") return letter; - switch(i%3) { - case 0: return letter.red; - case 1: return letter.white; - case 2: return letter.blue; - } -}); - -colors.addSequencer("random", (function() { - var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; - - return function(letter, i, exploded) { - return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; - }; -})()); - -console.log("AMERICA! F--K YEAH!".america); -console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); - -// -// Custom themes -// - -// Load theme with JSON literal -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); - -// outputs grey text -console.log("this is an input".input); - -// Load a theme from file -colors.setTheme('./themes/winston-dark.js'); - -console.log("this is an input".input); - diff --git a/node_modules/grunt/node_modules/colors/package.json b/node_modules/grunt/node_modules/colors/package.json deleted file mode 100644 index edded69..0000000 --- a/node_modules/grunt/node_modules/colors/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "colors", - "description": "get colors in your node.js console like what", - "version": "0.6.2", - "author": { - "name": "Marak Squires" - }, - "homepage": "https://github.com/Marak/colors.js", - "bugs": { - "url": "https://github.com/Marak/colors.js/issues" - }, - "keywords": [ - "ansi", - "terminal", - "colors" - ], - "repository": { - "type": "git", - "url": "http://github.com/Marak/colors.js.git" - }, - "engines": { - "node": ">=0.1.90" - }, - "main": "colors", - "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", - "readmeFilename": "ReadMe.md", - "_id": "colors@0.6.2", - "_from": "colors@~0.6.0-1" -} diff --git a/node_modules/grunt/node_modules/colors/test.js b/node_modules/grunt/node_modules/colors/test.js deleted file mode 100644 index c32417d..0000000 --- a/node_modules/grunt/node_modules/colors/test.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require('assert'), - colors = require('./colors'); - -var s = 'string'; - -function a(s, code) { - return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; -} - -function aE(s, color, code) { - assert.equal(s[color], a(s, code)); - assert.equal(colors[color](s), a(s, code)); - assert.equal(s[color], colors[color](s)); - assert.equal(s[color].stripColors, s); - assert.equal(s[color].stripColors, colors.stripColors(s)); -} - -function h(s, color) { - return '' + s + ''; -} - -var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; -var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); - -colors.mode = 'console'; -assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); -assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); -assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); -assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); -assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); -assert.ok(s.rainbow); -aE(s, 'white', 37); -aE(s, 'grey', 90); -aE(s, 'black', 30); -aE(s, 'blue', 34); -aE(s, 'cyan', 36); -aE(s, 'green', 32); -aE(s, 'magenta', 35); -aE(s, 'red', 31); -aE(s, 'yellow', 33); -assert.equal(s, 'string'); - -colors.setTheme({error:'red'}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'browser'; -assert.equal(s.bold, '' + s + ''); -assert.equal(s.italic, '' + s + ''); -assert.equal(s.underline, '' + s + ''); -assert.equal(s.strikethrough, '' + s + ''); -assert.equal(s.inverse, '' + s + ''); -assert.ok(s.rainbow); -stylesColors.forEach(function (color) { - assert.equal(s[color], h(s, color)); - assert.equal(colors[color](s), h(s, color)); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'none'; -stylesAll.forEach(function (style) { - assert.equal(s[style], s); - assert.equal(colors[style](s), s); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); diff --git a/node_modules/grunt/node_modules/colors/themes/winston-dark.js b/node_modules/grunt/node_modules/colors/themes/winston-dark.js deleted file mode 100644 index 49a905b..0000000 --- a/node_modules/grunt/node_modules/colors/themes/winston-dark.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'black', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/node_modules/grunt/node_modules/colors/themes/winston-light.js b/node_modules/grunt/node_modules/colors/themes/winston-light.js deleted file mode 100644 index 571972c..0000000 --- a/node_modules/grunt/node_modules/colors/themes/winston-light.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/node_modules/grunt/node_modules/dateformat/Readme.md b/node_modules/grunt/node_modules/dateformat/Readme.md deleted file mode 100644 index d469e6d..0000000 --- a/node_modules/grunt/node_modules/dateformat/Readme.md +++ /dev/null @@ -1,67 +0,0 @@ -# node-dateformat - -A node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function. - -## Modifications - -* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers. -* Added a `module.exports = dateFormat;` statement at the bottom - -## Usage - -As taken from Steven's post, modified to match the Modifications listed above: - - var dateFormat = require('dateformat'); - var now = new Date(); - - // Basic usage - dateFormat(now, "dddd, mmmm dS, yyyy, h:MM:ss TT"); - // Saturday, June 9th, 2007, 5:46:21 PM - - // You can use one of several named masks - dateFormat(now, "isoDateTime"); - // 2007-06-09T17:46:21 - - // ...Or add your own - dateFormat.masks.hammerTime = 'HH:MM! "Can\'t touch this!"'; - dateFormat(now, "hammerTime"); - // 17:46! Can't touch this! - - // When using the standalone dateFormat function, - // you can also provide the date as a string - dateFormat("Jun 9 2007", "fullDate"); - // Saturday, June 9, 2007 - - // Note that if you don't include the mask argument, - // dateFormat.masks.default is used - dateFormat(now); - // Sat Jun 09 2007 17:46:21 - - // And if you don't include the date argument, - // the current date and time is used - dateFormat(); - // Sat Jun 09 2007 17:46:22 - - // You can also skip the date argument (as long as your mask doesn't - // contain any numbers), in which case the current date/time is used - dateFormat("longTime"); - // 5:46:22 PM EST - - // And finally, you can convert local time to UTC time. Simply pass in - // true as an additional argument (no argument skipping allowed in this case): - dateFormat(now, "longTime", true); - // 10:46:21 PM UTC - - // ...Or add the prefix "UTC:" to your mask. - dateFormat(now, "UTC:h:MM:ss TT Z"); - // 10:46:21 PM UTC - - // You can also get the ISO 8601 week of the year: - dateFormat(now, "W"); - // 42 -## License - -(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license. - -[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format -[stevenlevithan]: http://stevenlevithan.com/ diff --git a/node_modules/grunt/node_modules/dateformat/lib/dateformat.js b/node_modules/grunt/node_modules/dateformat/lib/dateformat.js deleted file mode 100644 index 9229424..0000000 --- a/node_modules/grunt/node_modules/dateformat/lib/dateformat.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Date Format 1.2.3 - * (c) 2007-2009 Steven Levithan - * MIT license - * - * Includes enhancements by Scott Trenda - * and Kris Kowal - * - * Accepts a date, a mask, or a date and a mask. - * Returns a formatted version of the given date. - * The date defaults to the current date/time. - * The mask defaults to dateFormat.masks.default. - */ - -var dateFormat = function () { - var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZW]|"[^"]*"|'[^']*'/g, - timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, - timezoneClip = /[^-+\dA-Z]/g, - pad = function (val, len) { - val = String(val); - len = len || 2; - while (val.length < len) val = "0" + val; - return val; - }, - /** - * Get the ISO 8601 week number - * Based on comments from - * http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html - */ - getWeek = function (date) { - // Remove time components of date - var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate()); - - // Change date to Thursday same week - targetThursday.setDate(targetThursday.getDate() - ((targetThursday.getDay() + 6) % 7) + 3); - - // Take January 4th as it is always in week 1 (see ISO 8601) - var firstThursday = new Date(targetThursday.getFullYear(), 0, 4); - - // Change date to Thursday same week - firstThursday.setDate(firstThursday.getDate() - ((firstThursday.getDay() + 6) % 7) + 3); - - // Check if daylight-saving-time-switch occured and correct for it - var ds = targetThursday.getTimezoneOffset()/firstThursday.getTimezoneOffset()-1; - targetThursday.setHours(targetThursday.getHours()+ds); - - // Number of weeks between target Thursday and first Thursday - var weekDiff = (targetThursday - firstThursday) / (86400000*7); - return 1 + weekDiff; - }; - - // Regexes and supporting functions are cached through closure - return function (date, mask, utc) { - var dF = dateFormat; - - // You can't provide utc if you skip other args (use the "UTC:" mask prefix) - if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { - mask = date; - date = undefined; - } - - date = date || new Date; - - if(!(date instanceof Date)) { - date = new Date(date); - } - - if (isNaN(date)) { - throw TypeError("Invalid date"); - } - - mask = String(dF.masks[mask] || mask || dF.masks["default"]); - - // Allow setting the utc argument via the mask - if (mask.slice(0, 4) == "UTC:") { - mask = mask.slice(4); - utc = true; - } - - var _ = utc ? "getUTC" : "get", - d = date[_ + "Date"](), - D = date[_ + "Day"](), - m = date[_ + "Month"](), - y = date[_ + "FullYear"](), - H = date[_ + "Hours"](), - M = date[_ + "Minutes"](), - s = date[_ + "Seconds"](), - L = date[_ + "Milliseconds"](), - o = utc ? 0 : date.getTimezoneOffset(), - W = getWeek(date), - flags = { - d: d, - dd: pad(d), - ddd: dF.i18n.dayNames[D], - dddd: dF.i18n.dayNames[D + 7], - m: m + 1, - mm: pad(m + 1), - mmm: dF.i18n.monthNames[m], - mmmm: dF.i18n.monthNames[m + 12], - yy: String(y).slice(2), - yyyy: y, - h: H % 12 || 12, - hh: pad(H % 12 || 12), - H: H, - HH: pad(H), - M: M, - MM: pad(M), - s: s, - ss: pad(s), - l: pad(L, 3), - L: pad(L > 99 ? Math.round(L / 10) : L), - t: H < 12 ? "a" : "p", - tt: H < 12 ? "am" : "pm", - T: H < 12 ? "A" : "P", - TT: H < 12 ? "AM" : "PM", - Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), - o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), - S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10], - W: W - }; - - return mask.replace(token, function ($0) { - return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); - }); - }; -}(); - -// Some common format strings -dateFormat.masks = { - "default": "ddd mmm dd yyyy HH:MM:ss", - shortDate: "m/d/yy", - mediumDate: "mmm d, yyyy", - longDate: "mmmm d, yyyy", - fullDate: "dddd, mmmm d, yyyy", - shortTime: "h:MM TT", - mediumTime: "h:MM:ss TT", - longTime: "h:MM:ss TT Z", - isoDate: "yyyy-mm-dd", - isoTime: "HH:MM:ss", - isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", - isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" -}; - -// Internationalization strings -dateFormat.i18n = { - dayNames: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" - ], - monthNames: [ - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ] -}; - -/* -// For convenience... -Date.prototype.format = function (mask, utc) { - return dateFormat(this, mask, utc); -}; -*/ - -if (typeof exports !== "undefined") { - module.exports = dateFormat; -} diff --git a/node_modules/grunt/node_modules/dateformat/package.json b/node_modules/grunt/node_modules/dateformat/package.json deleted file mode 100644 index cd4b896..0000000 --- a/node_modules/grunt/node_modules/dateformat/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "dateformat", - "description": "A node.js package for Steven Levithan's excellent dateFormat() function.", - "maintainers": "Felix Geisendörfer ", - "homepage": "https://github.com/felixge/node-dateformat", - "author": { - "name": "Steven Levithan" - }, - "version": "1.0.2-1.2.3", - "main": "./lib/dateformat", - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "# node-dateformat\n\nA node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function.\n\n## Modifications\n\n* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers.\n* Added a `module.exports = dateFormat;` statement at the bottom\n\n## Usage\n\nAs taken from Steven's post, modified to match the Modifications listed above:\n\n var dateFormat = require('dateformat');\n var now = new Date();\n\n // Basic usage\n dateFormat(now, \"dddd, mmmm dS, yyyy, h:MM:ss TT\");\n // Saturday, June 9th, 2007, 5:46:21 PM\n\n // You can use one of several named masks\n dateFormat(now, \"isoDateTime\");\n // 2007-06-09T17:46:21\n\n // ...Or add your own\n dateFormat.masks.hammerTime = 'HH:MM! \"Can\\'t touch this!\"';\n dateFormat(now, \"hammerTime\");\n // 17:46! Can't touch this!\n\n // When using the standalone dateFormat function,\n // you can also provide the date as a string\n dateFormat(\"Jun 9 2007\", \"fullDate\");\n // Saturday, June 9, 2007\n\n // Note that if you don't include the mask argument,\n // dateFormat.masks.default is used\n dateFormat(now);\n // Sat Jun 09 2007 17:46:21\n\n // And if you don't include the date argument,\n // the current date and time is used\n dateFormat();\n // Sat Jun 09 2007 17:46:22\n\n // You can also skip the date argument (as long as your mask doesn't\n // contain any numbers), in which case the current date/time is used\n dateFormat(\"longTime\");\n // 5:46:22 PM EST\n\n // And finally, you can convert local time to UTC time. Simply pass in\n // true as an additional argument (no argument skipping allowed in this case):\n dateFormat(now, \"longTime\", true);\n // 10:46:21 PM UTC\n\n // ...Or add the prefix \"UTC:\" to your mask.\n dateFormat(now, \"UTC:h:MM:ss TT Z\");\n // 10:46:21 PM UTC\n\n // You can also get the ISO 8601 week of the year:\n dateFormat(now, \"W\");\n // 42\n## License\n\n(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license.\n\n[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format\n[stevenlevithan]: http://stevenlevithan.com/\n", - "readmeFilename": "Readme.md", - "_id": "dateformat@1.0.2-1.2.3", - "_from": "dateformat@1.0.2-1.2.3" -} diff --git a/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.js b/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.js deleted file mode 100644 index d1ddbe8..0000000 --- a/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.js +++ /dev/null @@ -1,4 +0,0 @@ -var dateFormat = require('../lib/dateformat.js'); - -var val = process.argv[2] || new Date(); -console.log(dateFormat(val, 'W')); diff --git a/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh b/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh deleted file mode 100644 index 3c3e69b..0000000 --- a/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# this just takes php's date() function as a reference to check if week of year -# is calculated correctly in the range from 1970 .. 2038 by brute force... - -SEQ="seq" -SYSTEM=`uname` -if [ "$SYSTEM" = "Darwin" ]; then - SEQ="jot" -fi - -for YEAR in {1970..2038}; do - for MONTH in {1..12}; do - DAYS=$(cal $MONTH $YEAR | egrep "28|29|30|31" |tail -1 |awk '{print $NF}') - for DAY in $( $SEQ $DAYS ); do - DATE=$YEAR-$MONTH-$DAY - echo -n $DATE ... - NODEVAL=$(node test_weekofyear.js $DATE) - PHPVAL=$(php -r "echo intval(date('W', strtotime('$DATE')));") - if [ "$NODEVAL" -ne "$PHPVAL" ]; then - echo "MISMATCH: node: $NODEVAL vs php: $PHPVAL for date $DATE" - else - echo " OK" - fi - done - done -done diff --git a/node_modules/grunt/node_modules/eventemitter2/README.md b/node_modules/grunt/node_modules/eventemitter2/README.md deleted file mode 100644 index 9501fa3..0000000 --- a/node_modules/grunt/node_modules/eventemitter2/README.md +++ /dev/null @@ -1,212 +0,0 @@ -# EventEmitter2 - -EventEmitter2 is an implementation of the EventEmitter found in Node.js - -## Features - - - Namespaces/Wildcards. - - Times To Listen (TTL), extends the `once` concept with `many`. - - Browser environment compatibility. - - Demonstrates good performance in benchmarks - -``` -EventEmitterHeatUp x 3,728,965 ops/sec \302\2610.68% (60 runs sampled) -EventEmitter x 2,822,904 ops/sec \302\2610.74% (63 runs sampled) -EventEmitter2 x 7,251,227 ops/sec \302\2610.55% (58 runs sampled) -EventEmitter2 (wild) x 3,220,268 ops/sec \302\2610.44% (65 runs sampled) -Fastest is EventEmitter2 -``` - -## Differences (Non breaking, compatible with existing EventEmitter) - - - The constructor takes a configuration object. - -```javascript - var EventEmitter2 = require('eventemitter2').EventEmitter2; - var server = new EventEmitter2({ - wildcard: true, // should the event emitter use wildcards. - delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`. - newListener: false, // if you want to emit the newListener event set to true. - maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10. - }); -``` - - - Getting the actual event that fired. - -```javascript - server.on('foo.*', function(value1, value2) { - console.log(this.event, value1, value2); - }); -``` - - - Fire an event N times and then remove it, an extension of the `once` concept. - -```javascript - server.many('foo', 4, function() { - console.log('hello'); - }); -``` - - - Pass in a namespaced event as an array rather than a delimited string. - -```javascript - server.many(['foo', 'bar', 'bazz'], function() { - console.log('hello'); - }); -``` - - -## API - -When an `EventEmitter` instance experiences an error, the typical action is -to emit an `error` event. Error events are treated as a special case. -If there is no listener for it, then the default action is to print a stack -trace and exit the program. - -All EventEmitters emit the event `newListener` when new listeners are -added. - - -**Namespaces** with **Wildcards** -To use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor. -When namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated -by a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a -constructor option. - -An event name passed to any event emitter method can contain a wild card (the `*` character). -If the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, -the wildcard may appear as `['foo', '*']`. - -If either of the above described events were passed to the `on` method, subsequent emits such -as the following would be observed... - -```javascript - emitter.emit('foo.bazz'); - emitter.emit(['foo', 'bar']); -``` - - -#### emitter.addListener(event, listener) -#### emitter.on(event, listener) - -Adds a listener to the end of the listeners array for the specified event. - -```javascript - server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) { - console.log('The event was raised!'); - }); -``` - -```javascript - server.on('data', function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.onAny(listener) - -Adds a listener that will be fired when any event is emitted. - -```javascript - server.onAny(function(value) { - console.log('All events trigger this.'); - }); -``` - -#### emitter.offAny(listener) - -Removes the listener that will be fired when any event is emitted. - -```javascript - server.offAny(function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.once(event, listener) - -Adds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.once('get', function (value) { - console.log('Ah, we have our first value!'); - }); -``` - -#### emitter.many(event, timesToListen, listener) - -Adds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.many('get', 4, function (value) { - console.log('This event will be listened to exactly four times.'); - }); -``` - - -#### emitter.removeListener(event, listener) -#### emitter.off(event, listener) - -Remove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener. - -```javascript - var callback = function(value) { - console.log('someone connected!'); - }; - server.on('get', callback); - // ... - server.removeListener('get', callback); -``` - - -#### emitter.removeAllListeners([event]) - -Removes all listeners, or those of the specified event. - - -#### emitter.setMaxListeners(n) - -By default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited. - - -#### emitter.listeners(event) - -Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.on('get', function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listeners('get')); // [ [Function] ] -``` - -#### emitter.listenersAny() - -Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.onAny(function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected! -``` - -#### emitter.emit(event, [arg1], [arg2], [...]) - -Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. - -## Test coverage - -There is a test suite that tries to cover each use case, it can be found here. - -## Licence - -(The MIT License) - -Copyright (c) 2011 hij1nx - -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/node_modules/grunt/node_modules/eventemitter2/index.js b/node_modules/grunt/node_modules/eventemitter2/index.js deleted file mode 100644 index 6f583b5..0000000 --- a/node_modules/grunt/node_modules/eventemitter2/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/eventemitter2'); diff --git a/node_modules/grunt/node_modules/eventemitter2/lib/eventemitter2.js b/node_modules/grunt/node_modules/eventemitter2/lib/eventemitter2.js deleted file mode 100644 index dc9849e..0000000 --- a/node_modules/grunt/node_modules/eventemitter2/lib/eventemitter2.js +++ /dev/null @@ -1,561 +0,0 @@ -;!function(exports, undefined) { - - var isArray = Array.isArray ? Array.isArray : function _isArray(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - var defaultMaxListeners = 10; - - function init() { - this._events = {}; - if (this._conf) { - configure.call(this, this._conf); - } - } - - function configure(conf) { - if (conf) { - - this._conf = conf; - - conf.delimiter && (this.delimiter = conf.delimiter); - conf.maxListeners && (this._events.maxListeners = conf.maxListeners); - conf.wildcard && (this.wildcard = conf.wildcard); - conf.newListener && (this.newListener = conf.newListener); - - if (this.wildcard) { - this.listenerTree = {}; - } - } - } - - function EventEmitter(conf) { - this._events = {}; - this.newListener = false; - configure.call(this, conf); - } - - // - // Attention, function return type now is array, always ! - // It has zero elements if no any matches found and one or more - // elements (leafs) if there are matches - // - function searchListenerTree(handlers, type, tree, i) { - if (!tree) { - return []; - } - var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached, - typeLength = type.length, currentType = type[i], nextType = type[i+1]; - if (i === typeLength && tree._listeners) { - // - // If at the end of the event(s) list and the tree has listeners - // invoke those listeners. - // - if (typeof tree._listeners === 'function') { - handlers && handlers.push(tree._listeners); - return [tree]; - } else { - for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) { - handlers && handlers.push(tree._listeners[leaf]); - } - return [tree]; - } - } - - if ((currentType === '*' || currentType === '**') || tree[currentType]) { - // - // If the event emitted is '*' at this part - // or there is a concrete match at this patch - // - if (currentType === '*') { - for (branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1)); - } - } - return listeners; - } else if(currentType === '**') { - endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*')); - if(endReached && tree._listeners) { - // The next element has a _listeners, add it to the handlers. - listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength)); - } - - for (branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - if(branch === '*' || branch === '**') { - if(tree[branch]._listeners && !endReached) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength)); - } - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i)); - } else if(branch === nextType) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2)); - } else { - // No match on this one, shift into the tree but not in the type array. - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i)); - } - } - } - return listeners; - } - - listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1)); - } - - xTree = tree['*']; - if (xTree) { - // - // If the listener tree will allow any match for this part, - // then recursively explore all branches of the tree - // - searchListenerTree(handlers, type, xTree, i+1); - } - - xxTree = tree['**']; - if(xxTree) { - if(i < typeLength) { - if(xxTree._listeners) { - // If we have a listener on a '**', it will catch all, so add its handler. - searchListenerTree(handlers, type, xxTree, typeLength); - } - - // Build arrays of matching next branches and others. - for(branch in xxTree) { - if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) { - if(branch === nextType) { - // We know the next element will match, so jump twice. - searchListenerTree(handlers, type, xxTree[branch], i+2); - } else if(branch === currentType) { - // Current node matches, move into the tree. - searchListenerTree(handlers, type, xxTree[branch], i+1); - } else { - isolatedBranch = {}; - isolatedBranch[branch] = xxTree[branch]; - searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1); - } - } - } - } else if(xxTree._listeners) { - // We have reached the end and still on a '**' - searchListenerTree(handlers, type, xxTree, typeLength); - } else if(xxTree['*'] && xxTree['*']._listeners) { - searchListenerTree(handlers, type, xxTree['*'], typeLength); - } - } - - return listeners; - } - - function growListenerTree(type, listener) { - - type = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - - // - // Looks for two consecutive '**', if so, don't add the event at all. - // - for(var i = 0, len = type.length; i+1 < len; i++) { - if(type[i] === '**' && type[i+1] === '**') { - return; - } - } - - var tree = this.listenerTree; - var name = type.shift(); - - while (name) { - - if (!tree[name]) { - tree[name] = {}; - } - - tree = tree[name]; - - if (type.length === 0) { - - if (!tree._listeners) { - tree._listeners = listener; - } - else if(typeof tree._listeners === 'function') { - tree._listeners = [tree._listeners, listener]; - } - else if (isArray(tree._listeners)) { - - tree._listeners.push(listener); - - if (!tree._listeners.warned) { - - var m = defaultMaxListeners; - - if (typeof this._events.maxListeners !== 'undefined') { - m = this._events.maxListeners; - } - - if (m > 0 && tree._listeners.length > m) { - - tree._listeners.warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - tree._listeners.length); - console.trace(); - } - } - } - return true; - } - name = type.shift(); - } - return true; - } - - // By default EventEmitters will print a warning if more than - // 10 listeners are added to it. This is a useful default which - // helps finding memory leaks. - // - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - - EventEmitter.prototype.delimiter = '.'; - - EventEmitter.prototype.setMaxListeners = function(n) { - this._events || init.call(this); - this._events.maxListeners = n; - if (!this._conf) this._conf = {}; - this._conf.maxListeners = n; - }; - - EventEmitter.prototype.event = ''; - - EventEmitter.prototype.once = function(event, fn) { - this.many(event, 1, fn); - return this; - }; - - EventEmitter.prototype.many = function(event, ttl, fn) { - var self = this; - - if (typeof fn !== 'function') { - throw new Error('many only accepts instances of Function'); - } - - function listener() { - if (--ttl === 0) { - self.off(event, listener); - } - fn.apply(this, arguments); - } - - listener._origin = fn; - - this.on(event, listener); - - return self; - }; - - EventEmitter.prototype.emit = function() { - - this._events || init.call(this); - - var type = arguments[0]; - - if (type === 'newListener' && !this.newListener) { - if (!this._events.newListener) { return false; } - } - - // Loop through the *_all* functions and invoke them. - if (this._all) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - for (i = 0, l = this._all.length; i < l; i++) { - this.event = type; - this._all[i].apply(this, args); - } - } - - // If there is no 'error' event listener then throw. - if (type === 'error') { - - if (!this._all && - !this._events.error && - !(this.wildcard && this.listenerTree.error)) { - - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - var handler; - - if(this.wildcard) { - handler = []; - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - searchListenerTree.call(this, handler, ns, this.listenerTree, 0); - } - else { - handler = this._events[type]; - } - - if (typeof handler === 'function') { - this.event = type; - if (arguments.length === 1) { - handler.call(this); - } - else if (arguments.length > 1) - switch (arguments.length) { - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - handler.apply(this, args); - } - return true; - } - else if (handler) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - this.event = type; - listeners[i].apply(this, args); - } - return (listeners.length > 0) || this._all; - } - else { - return this._all; - } - - }; - - EventEmitter.prototype.on = function(type, listener) { - - if (typeof type === 'function') { - this.onAny(type); - return this; - } - - if (typeof listener !== 'function') { - throw new Error('on only accepts instances of Function'); - } - this._events || init.call(this); - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if(this.wildcard) { - growListenerTree.call(this, type, listener); - return this; - } - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } - else if(typeof this._events[type] === 'function') { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - else if (isArray(this._events[type])) { - // If we've already got an array, just append. - this._events[type].push(listener); - - // Check for listener leak - if (!this._events[type].warned) { - - var m = defaultMaxListeners; - - if (typeof this._events.maxListeners !== 'undefined') { - m = this._events.maxListeners; - } - - if (m > 0 && this._events[type].length > m) { - - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - } - return this; - }; - - EventEmitter.prototype.onAny = function(fn) { - - if(!this._all) { - this._all = []; - } - - if (typeof fn !== 'function') { - throw new Error('onAny only accepts instances of Function'); - } - - // Add the function to the event listener collection. - this._all.push(fn); - return this; - }; - - EventEmitter.prototype.addListener = EventEmitter.prototype.on; - - EventEmitter.prototype.off = function(type, listener) { - if (typeof listener !== 'function') { - throw new Error('removeListener only takes instances of Function'); - } - - var handlers,leafs=[]; - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - } - else { - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events[type]) return this; - handlers = this._events[type]; - leafs.push({_listeners:handlers}); - } - - for (var iLeaf=0; iLeaf 0) { - fns = this._all; - for(i = 0, l = fns.length; i < l; i++) { - if(fn === fns[i]) { - fns.splice(i, 1); - return this; - } - } - } else { - this._all = []; - } - return this; - }; - - EventEmitter.prototype.removeListener = EventEmitter.prototype.off; - - EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - !this._events || init.call(this); - return this; - } - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - var leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - - for (var iLeaf=0; iLeaf= 0.2.2" - }, - "main": "./lib/eventemitter2.js", - "scripts": { - "test": "nodeunit test/simple/ && nodeunit test/wildcardEvents/", - "benchmark": "node test/perf/benchmark.js" - }, - "files": [ - "lib/eventemitter2.js", - "index.js" - ], - "readme": "# EventEmitter2\n\nEventEmitter2 is an implementation of the EventEmitter found in Node.js\n\n## Features\n\n - Namespaces/Wildcards.\n - Times To Listen (TTL), extends the `once` concept with `many`.\n - Browser environment compatibility.\n - Demonstrates good performance in benchmarks\n\n```\nEventEmitterHeatUp x 3,728,965 ops/sec \\302\\2610.68% (60 runs sampled)\nEventEmitter x 2,822,904 ops/sec \\302\\2610.74% (63 runs sampled)\nEventEmitter2 x 7,251,227 ops/sec \\302\\2610.55% (58 runs sampled)\nEventEmitter2 (wild) x 3,220,268 ops/sec \\302\\2610.44% (65 runs sampled)\nFastest is EventEmitter2\n```\n\n## Differences (Non breaking, compatible with existing EventEmitter)\n\n - The constructor takes a configuration object.\n \n```javascript\n var EventEmitter2 = require('eventemitter2').EventEmitter2;\n var server = new EventEmitter2({\n wildcard: true, // should the event emitter use wildcards.\n delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`.\n newListener: false, // if you want to emit the newListener event set to true.\n maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10.\n });\n```\n\n - Getting the actual event that fired.\n\n```javascript\n server.on('foo.*', function(value1, value2) {\n console.log(this.event, value1, value2);\n });\n```\n\n - Fire an event N times and then remove it, an extension of the `once` concept.\n\n```javascript\n server.many('foo', 4, function() {\n console.log('hello');\n });\n```\n\n - Pass in a namespaced event as an array rather than a delimited string.\n\n```javascript\n server.many(['foo', 'bar', 'bazz'], function() {\n console.log('hello');\n });\n```\n\n\n## API\n\nWhen an `EventEmitter` instance experiences an error, the typical action is\nto emit an `error` event. Error events are treated as a special case.\nIf there is no listener for it, then the default action is to print a stack\ntrace and exit the program.\n\nAll EventEmitters emit the event `newListener` when new listeners are\nadded.\n\n\n**Namespaces** with **Wildcards**\nTo use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor.\nWhen namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated\nby a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a \nconstructor option.\n\nAn event name passed to any event emitter method can contain a wild card (the `*` character).\nIf the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, \nthe wildcard may appear as `['foo', '*']`.\n\nIf either of the above described events were passed to the `on` method, subsequent emits such \nas the following would be observed...\n\n```javascript\n emitter.emit('foo.bazz');\n emitter.emit(['foo', 'bar']);\n```\n\n\n#### emitter.addListener(event, listener)\n#### emitter.on(event, listener)\n\nAdds a listener to the end of the listeners array for the specified event.\n\n```javascript\n server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) {\n console.log('The event was raised!');\n });\n```\n\n```javascript\n server.on('data', function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.onAny(listener)\n\nAdds a listener that will be fired when any event is emitted.\n\n```javascript\n server.onAny(function(value) {\n console.log('All events trigger this.');\n });\n```\n\n#### emitter.offAny(listener)\n\nRemoves the listener that will be fired when any event is emitted.\n\n```javascript\n server.offAny(function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.once(event, listener)\n\nAdds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.once('get', function (value) {\n console.log('Ah, we have our first value!');\n });\n```\n\n#### emitter.many(event, timesToListen, listener)\n\nAdds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.many('get', 4, function (value) {\n console.log('This event will be listened to exactly four times.');\n });\n```\n\n\n#### emitter.removeListener(event, listener)\n#### emitter.off(event, listener)\n\nRemove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener.\n\n```javascript\n var callback = function(value) {\n console.log('someone connected!');\n };\n server.on('get', callback);\n // ...\n server.removeListener('get', callback);\n```\n\n\n#### emitter.removeAllListeners([event])\n\nRemoves all listeners, or those of the specified event.\n\n\n#### emitter.setMaxListeners(n)\n\nBy default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited.\n\n\n#### emitter.listeners(event)\n\nReturns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.on('get', function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listeners('get')); // [ [Function] ]\n```\n\n#### emitter.listenersAny()\n\nReturns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.onAny(function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected!\n```\n\n#### emitter.emit(event, [arg1], [arg2], [...])\n\nExecute each of the listeners that may be listening for the specified event name in order with the list of arguments.\n\n## Test coverage\n\nThere is a test suite that tries to cover each use case, it can be found here.\n\n## Licence\n\n(The MIT License)\n\nCopyright (c) 2011 hij1nx \n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/hij1nx/EventEmitter2/issues" - }, - "_id": "eventemitter2@0.4.13", - "_from": "eventemitter2@~0.4.9" -} diff --git a/node_modules/grunt/node_modules/findup-sync/.jshintrc b/node_modules/grunt/node_modules/findup-sync/.jshintrc deleted file mode 100644 index 6d171b8..0000000 --- a/node_modules/grunt/node_modules/findup-sync/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "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/node_modules/grunt/node_modules/findup-sync/.npmignore b/node_modules/grunt/node_modules/findup-sync/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/findup-sync/Gruntfile.js b/node_modules/grunt/node_modules/findup-sync/Gruntfile.js deleted file mode 100644 index 2f964a5..0000000 --- a/node_modules/grunt/node_modules/findup-sync/Gruntfile.js +++ /dev/null @@ -1,25 +0,0 @@ -'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/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT b/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT deleted file mode 100644 index bb2aad6..0000000 --- a/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -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/node_modules/grunt/node_modules/findup-sync/README.md b/node_modules/grunt/node_modules/findup-sync/README.md deleted file mode 100644 index 3b08b4e..0000000 --- a/node_modules/grunt/node_modules/findup-sync/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# 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/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js b/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js deleted file mode 100644 index 742a478..0000000 --- a/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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/node_modules/grunt/node_modules/findup-sync/node_modules/.bin/lodash b/node_modules/grunt/node_modules/findup-sync/node_modules/.bin/lodash deleted file mode 120000 index 24deae2..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/.bin/lodash +++ /dev/null @@ -1 +0,0 @@ -../lodash/build.js \ No newline at end of file diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/LICENSE.txt b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/LICENSE.txt deleted file mode 100644 index cc08239..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2013 The Dojo Foundation -Based on Underscore.js 1.4.3, copyright 2009-2013 Jeremy Ashkenas, -DocumentCloud Inc. - -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md deleted file mode 100644 index 6181c77..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md +++ /dev/null @@ -1,276 +0,0 @@ -# Lo-Dash v1.0.1 -[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash) - -An alternative to Underscore.js, delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features). - -## Download - -* Lo-Dash builds (for modern environments):
                      -[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.js) and -[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.min.js) - -* Lo-Dash compatibility builds (for legacy and modern environments):
                      -[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.compat.js) and -[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.compat.min.js) - -* Underscore compatibility builds:
                      -[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.underscore.js) and -[Production](https://raw.github.com/bestiejs/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](https://github.com/bestiejs/lodash#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/bestiejs/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. - -## Custom builds - -Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need. -To top it off, we handle all method dependency and alias mapping for you. - - * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument. -```bash -lodash backbone -``` - - * CSP builds, supporting default [Content Security Policy](https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument. - The `csp` modifier is an alais of the `mobile` modifier. Lo-Dash may be used in Chrome extensions by using either the `csp`, `mobile`, or `underscore` build and using precompiled templates, or loading Lo-Dash in a [sandbox](http://developer.chrome.com/stable/extensions/sandboxingEval.html). -```bash -lodash csp -``` - - * Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument. -```bash -lodash legacy -``` - - * Modern builds, tailored for newer environments with ES5 support, may be created using the `modern` modifier argument. -```bash -lodash modern -``` - - * Mobile builds, without method compilation and most bug fixes for old browsers, may be created using the `mobile` modifier argument. -```bash -lodash mobile -``` - - * Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument. -```bash -lodash strict -``` - - * Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument. -```bash -lodash underscore -``` - -Custom builds may be created using the following commands: - - * Use the `category` argument to pass comma separated categories of methods to include in the build.
                      - Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*. -```bash -lodash category=collections,functions -lodash category="collections, functions" -``` - - * Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.
                      - Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*. -```bash -lodash exports=amd,commonjs,node -lodash exports="amd, commonjs, node" -``` - - * Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash. -```bash -lodash iife="!function(window,undefined){%output%}(this)" -``` - - * Use the `include` argument to pass comma separated method/category names to include in the build. -```bash -lodash include=each,filter,map -lodash include="each, filter, map" -``` - - * Use the `minus` argument to pass comma separated method/category names to remove from those included in the build. -```bash -lodash underscore minus=result,shuffle -lodash underscore minus="result, shuffle" -``` - - * Use the `plus` argument to pass comma separated method/category names to add to those included in the build. -```bash -lodash backbone plus=random,template -lodash backbone plus="random, template" -``` - - * Use the `template` argument to pass the file path pattern used to match template files to precompile. -```bash -lodash template="./*.jst" -``` - - * Use the `settings` argument to pass the template settings used when precompiling templates. -```bash -lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}" -``` - - * Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates. -```bash -lodash moduleId="underscore" -``` - -All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.
                      -Unless specified by `-o` or `--output`, all files created are saved to the current working directory. - -The following options are also supported: - - * `-c`, `--stdout` ......... Write output to standard output - * `-d`, `--debug` ........... Write only the non-minified development output - * `-h`, `--help` ............. Display help information - * `-m`, `--minify` ......... Write only the minified production output - * `-o`, `--output` ......... Write output to a given path/filename - * `-p`, `--source-map` .. Generate a source map for the minified output, using an optional source map URL - * `-s`, `--silent` ......... Skip status updates normally logged to the console - * `-V`, `--version` ....... Output current version of Lo-Dash - -The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`). - -## Installation and usage - -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/bestiejs/lodash/wiki/Changelog). - -## BestieJS - -Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Kit Cambridge](http://kitcambridge.github.com/) - [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build.js deleted file mode 100755 index 4e34c82..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build.js +++ /dev/null @@ -1,2509 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** Load modules */ - var fs = require('fs'), - path = require('path'), - vm = require('vm'), - minify = require(path.join(__dirname, 'build', 'minify.js')), - _ = require(path.join(__dirname, 'lodash.js')); - - /** The current working directory */ - var cwd = process.cwd(); - - /** Used for array method references */ - var arrayRef = []; - - /** Shortcut used to push arrays of values to an array */ - var push = arrayRef.push; - - /** Shortcut used to convert array-like objects to arrays */ - var slice = arrayRef.slice; - - /** Shortcut to the `stdout` object */ - var stdout = process.stdout; - - /** Used to associate aliases with their real names */ - var aliasToRealMap = { - 'all': 'every', - 'any': 'some', - 'collect': 'map', - 'detect': 'find', - 'drop': 'rest', - 'each': 'forEach', - 'extend': 'assign', - 'foldl': 'reduce', - 'foldr': 'reduceRight', - 'head': 'first', - 'include': 'contains', - 'inject': 'reduce', - 'methods': 'functions', - 'select': 'filter', - 'tail': 'rest', - 'take': 'first', - 'unique': 'uniq' - }; - - /** Used to associate real names with their aliases */ - var realToAliasMap = { - 'assign': ['extend'], - 'contains': ['include'], - 'every': ['all'], - 'filter': ['select'], - 'find': ['detect'], - 'first': ['head', 'take'], - 'forEach': ['each'], - 'functions': ['methods'], - 'map': ['collect'], - 'reduce': ['foldl', 'inject'], - 'reduceRight': ['foldr'], - 'rest': ['drop', 'tail'], - 'some': ['any'], - 'uniq': ['unique'] - }; - - /** Used to track function dependencies */ - var dependencyMap = { - 'after': [], - 'assign': ['isArray', 'forEach', 'forOwn'], - 'at': ['isString'], - 'bind': ['isFunction', 'isObject'], - 'bindAll': ['bind', 'functions'], - 'bindKey': ['isFunction', 'isObject'], - 'clone': ['assign', 'forEach', 'forOwn', 'isArray', 'isObject'], - 'cloneDeep': ['clone'], - 'compact': [], - 'compose': [], - 'contains': ['indexOf', 'isString'], - 'countBy': ['forEach', 'identity', 'isEqual', 'keys'], - 'debounce': [], - 'defaults': ['isArray', 'forEach', 'forOwn'], - 'defer': ['bind'], - 'delay': [], - 'difference': ['indexOf'], - 'escape': [], - 'every': ['identity', 'isArray', 'isEqual', 'keys'], - 'filter': ['identity', 'isArray', 'isEqual', 'keys'], - 'find': ['forEach', 'identity', 'isEqual', 'keys'], - 'first': [], - 'flatten': ['isArray'], - 'forEach': ['identity', 'isArguments', 'isArray', 'isString'], - 'forIn': ['identity', 'isArguments'], - 'forOwn': ['identity', 'isArguments'], - 'functions': ['forIn', 'isFunction'], - 'groupBy': ['forEach', 'identity', 'isEqual', 'keys'], - 'has': [], - 'identity': [], - 'indexOf': ['sortedIndex'], - 'initial': [], - 'intersection': ['indexOf'], - 'invert': ['keys'], - 'invoke': ['forEach'], - 'isArguments': [], - 'isArray': [], - 'isBoolean': [], - 'isDate': [], - 'isElement': [], - 'isEmpty': ['forOwn', 'isArguments', 'isFunction'], - 'isEqual': ['forIn', 'isArguments', 'isFunction'], - 'isFinite': [], - 'isFunction': [], - 'isNaN': ['isNumber'], - 'isNull': [], - 'isNumber': [], - 'isObject': [], - 'isPlainObject': ['forIn', 'isArguments', 'isFunction'], - 'isRegExp': [], - 'isString': [], - 'isUndefined': [], - 'keys': ['forOwn', 'isArguments', 'isObject'], - 'last': [], - 'lastIndexOf': [], - 'map': ['identity', 'isArray', 'isEqual', 'keys'], - 'max': ['isArray', 'isEqual', 'isString', 'keys'], - 'memoize': [], - 'merge': ['forEach', 'forOwn', 'isArray', 'isObject', 'isPlainObject'], - 'min': ['isArray', 'isEqual', 'isString', 'keys'], - 'mixin': ['forEach', 'forOwn', 'functions'], - 'noConflict': [], - 'object': [], - 'omit': ['forIn', 'indexOf'], - 'once': [], - 'pairs': ['keys'], - 'partial': ['isFunction', 'isObject'], - 'partialRight': ['isFunction', 'isObject'], - 'pick': ['forIn', 'isObject'], - 'pluck': ['map'], - 'random': [], - 'range': [], - 'reduce': ['identity', 'isArray', 'isEqual', 'keys'], - 'reduceRight': ['forEach', 'identity', 'isEqual', 'isString', 'keys'], - 'reject': ['filter', 'identity', 'isEqual', 'keys'], - 'rest': [], - 'result': ['isFunction'], - 'shuffle': ['forEach'], - 'size': ['keys'], - 'some': ['identity', 'isArray', 'isEqual', 'keys'], - 'sortBy': ['forEach', 'identity', 'isEqual', 'keys'], - 'sortedIndex': ['identity', 'isEqual', 'keys'], - 'tap': ['mixin'], - 'template': ['defaults', 'escape', 'keys', 'values'], - 'throttle': [], - 'times': [], - 'toArray': ['isString', 'values'], - 'unescape': [], - 'union': ['uniq'], - 'uniq': ['indexOf', 'isEqual', 'keys'], - 'uniqueId': [], - 'value': ['mixin'], - 'values': ['keys'], - 'where': ['filter'], - 'without': ['indexOf'], - 'wrap': [], - 'zip': ['max', 'pluck'], - - // method used by the `backbone` and `underscore` builds - 'chain': ['mixin'], - 'findWhere': ['where'] - }; - - /** Used to inline `iteratorTemplate` */ - var iteratorOptions = [ - 'args', - 'arrays', - 'bottom', - 'firstArg', - 'hasDontEnumBug', - 'hasEnumPrototype', - 'isKeysFast', - 'loop', - 'nonEnumArgs', - 'noCharByIndex', - 'shadowed', - 'top', - 'useHas' - ]; - - /** List of all Lo-Dash methods */ - var allMethods = _.keys(dependencyMap); - - /** List of Backbone's Lo-Dash dependencies */ - var backboneDependencies = [ - 'bind', - 'bindAll', - 'chain', - 'clone', - 'contains', - 'countBy', - 'defaults', - 'escape', - 'every', - 'extend', - 'filter', - 'find', - 'first', - 'forEach', - 'groupBy', - 'has', - 'indexOf', - 'initial', - 'invoke', - 'isArray', - 'isEmpty', - 'isEqual', - 'isFunction', - 'isObject', - 'isRegExp', - 'isString', - 'keys', - 'last', - 'lastIndexOf', - 'map', - 'max', - 'min', - 'mixin', - 'once', - 'pick', - 'reduce', - 'reduceRight', - 'reject', - 'rest', - 'result', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'sortedIndex', - 'toArray', - 'uniqueId', - 'value', - 'without' - ]; - - /** List of methods used by Underscore */ - var underscoreMethods = _.without.apply(_, [allMethods].concat([ - 'at', - 'bindKey', - 'cloneDeep', - 'forIn', - 'forOwn', - 'isPlainObject', - 'merge', - 'partialRight' - ])); - - /** List of ways to export the `lodash` function */ - var exportsAll = [ - 'amd', - 'commonjs', - 'global', - 'node' - ]; - - /*--------------------------------------------------------------------------*/ - - /** - * Adds support for Underscore style chaining to the `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function addChainMethods(source) { - // add `_.chain` - source = source.replace(matchFunction(source, 'tap'), function(match) { - return [ - '', - ' /**', - ' * Creates a `lodash` object that wraps the given `value`.', - ' *', - ' * @static', - ' * @memberOf _', - ' * @category Chaining', - ' * @param {Mixed} value The value to wrap.', - ' * @returns {Object} Returns the wrapper object.', - ' * @example', - ' *', - ' * var stooges = [', - " * { 'name': 'moe', 'age': 40 },", - " * { 'name': 'larry', 'age': 50 },", - " * { 'name': 'curly', 'age': 60 }", - ' * ];', - ' *', - ' * var youngest = _.chain(stooges)', - ' * .sortBy(function(stooge) { return stooge.age; })', - " * .map(function(stooge) { return stooge.name + ' is ' + stooge.age; })", - ' * .first();', - " * // => 'moe is 40'", - ' */', - ' function chain(value) {', - ' value = new lodash(value);', - ' value.__chain__ = true;', - ' return value;', - ' }', - '', - match - ].join('\n'); - }); - - // add `wrapperChain` - source = source.replace(matchFunction(source, 'wrapperToString'), function(match) { - return [ - '', - ' /**', - ' * Enables method chaining on the wrapper object.', - ' *', - ' * @name chain', - ' * @memberOf _', - ' * @category Chaining', - ' * @returns {Mixed} Returns the wrapper object.', - ' * @example', - ' *', - ' * var sum = _([1, 2, 3])', - ' * .chain()', - ' * .reduce(function(sum, num) { return sum + num; })', - ' * .value()', - ' * // => 6`', - ' */', - ' function wrapperChain() {', - ' this.__chain__ = true;', - ' return this;', - ' }', - '', - match - ].join('\n'); - }); - - // add `lodash.chain` assignment - source = source.replace(getMethodAssignments(source), function(match) { - return match.replace(/^(?: *\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\n)?( *)lodash\.VERSION *=/m, '$1lodash.chain = chain;\n\n$&'); - }); - - // add `lodash.prototype.chain` assignment - source = source.replace(/^( *)lodash\.prototype\.value *=.+\n/m, '$1lodash.prototype.chain = wrapperChain;\n$&'); - - // remove `lodash.prototype.toString` and `lodash.prototype.valueOf` assignments - source = source.replace(/^ *lodash\.prototype\.(?:toString|valueOf) *=.+\n/gm, ''); - - // remove `lodash.prototype` batch method assignments - source = source.replace(/(?:\s*\/\/.*)*\n( *)forOwn\(lodash, *function\(func, *methodName\)[\s\S]+?\n\1}.+/g, ''); - - // move `mixin(lodash)` to after the method assignments - source = source.replace(/(?:\s*\/\/.*)*\s*mixin\(lodash\).+/, ''); - source = source.replace(getMethodAssignments(source), function(match) { - return match + [ - '', - '', - ' // add functions to `lodash.prototype`', - ' mixin(lodash);' - ].join('\n'); - }); - - // add `__chain__` checks to `_.mixin` - source = source.replace(matchFunction(source, 'mixin'), function(match) { - return match.replace(/^( *)return new lodash.+/m, function() { - var indent = arguments[1]; - return indent + [ - '', - 'var result = func.apply(lodash, args);', - 'if (this.__chain__) {', - ' result = new lodash(result);', - ' result.__chain__ = true;', - '}', - 'return result;' - ].join('\n' + indent); - }); - }); - - // replace wrapper `Array` method assignments - source = source.replace(/^(?: *\/\/.*\n)*( *)each\(\['[\s\S]+?\n\1}$/m, function() { - return [ - ' // add `Array` mutator functions to the wrapper', - " each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {", - ' var func = arrayRef[methodName];', - ' lodash.prototype[methodName] = function() {', - ' var value = this.__wrapped__;', - ' func.apply(value, arguments);', - '', - ' // avoid array-like object bugs with `Array#shift` and `Array#splice`', - ' // in Firefox < 10 and IE < 9', - ' if (hasObjectSpliceBug && value.length === 0) {', - ' delete value[0];', - ' }', - ' return this;', - ' };', - ' });', - '', - ' // add `Array` accessor functions to the wrapper', - " each(['concat', 'join', 'slice'], function(methodName) {", - ' var func = arrayRef[methodName];', - ' lodash.prototype[methodName] = function() {', - ' var value = this.__wrapped__,', - ' result = func.apply(value, arguments);', - '', - ' if (this.__chain__) {', - ' result = new lodash(result);', - ' result.__chain__ = true;', - ' }', - ' return result;', - ' };', - ' });' - ].join('\n'); - }); - - return source; - } - - /** - * Adds build `commands` to the copyright/license header of the `source`. - * - * @private - * @param {String} source The source to process. - * @param {Array} [commands=[]] An array of commands. - * @returns {String} Returns the modified source. - */ - function addCommandsToHeader(source, commands) { - return source.replace(/(\/\**\n)( \*)( *@license[\s*]+)( *Lo-Dash [\w.-]+)(.*)/, function() { - // remove `node path/to/build.js` from `commands` - if (commands[0] == 'node') { - commands.splice(0, 2); - } - // add quotes to commands with spaces or equals signs - commands = _.map(commands, function(command) { - var separator = (command.match(/[= ]/) || [''])[0]; - if (separator) { - var pair = command.split(separator); - command = pair[0] + separator + '"' + pair[1] + '"'; - } - // escape newlines, carriage returns, multi-line comment end tokens - command = command - .replace(/\n/g, '\\n') - .replace(/\r/g, '\\r') - .replace(/\*\//g, '*\\/'); - - return command; - }); - // add build commands to copyright/license header - var parts = slice.call(arguments, 1); - return ( - parts[0] + - parts[1] + - parts[2] + parts[3] + ' (Custom Build)' + parts[4] + '\n' + - parts[1] + ' Build: `lodash ' + commands.join(' ') + '`' - ); - }); - } - - /** - * Compiles template files matched by the given file path `pattern` into a - * single source, extending `_.templates` with precompiled templates named after - * each template file's basename. - * - * @private - * @param {String} [pattern='/*.jst'] The file path pattern. - * @param {Object} options The options object. - * @returns {String} Returns the compiled source. - */ - function buildTemplate(pattern, options) { - pattern || (pattern = path.join(cwd, '*.jst')); - - var directory = path.dirname(pattern); - - var source = [ - ';(function(window) {', - " var freeExports = typeof exports == 'object' && exports;", - '', - " var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;", - '', - " var freeGlobal = typeof global == 'object' && global;", - ' if (freeGlobal.global === freeGlobal) {', - ' window = freeGlobal;', - ' }', - '', - ' var templates = {},', - ' _ = window._;', - '' - ]; - - // convert to a regexp - pattern = RegExp( - path.basename(pattern) - .replace(/[.+?^=!:${}()|[\]\/\\]/g, '\\$&') - .replace(/\*/g, '.*?') + '$' - ); - - fs.readdirSync(directory).forEach(function(filename) { - var filePath = path.join(directory, filename); - if (pattern.test(filename)) { - var text = fs.readFileSync(filePath, 'utf8'), - precompiled = getFunctionSource(_.template(text, null, options)), - prop = filename.replace(/\..*$/, ''); - - source.push(" templates['" + prop.replace(/['\n\r\t]/g, '\\$&') + "'] = " + precompiled + ';', ''); - } - }); - - source.push( - " if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {", - " define(['" + options.moduleId + "'], function(lodash) {", - ' _ = lodash;', - ' lodash.templates = lodash.extend(lodash.templates || {}, templates);', - ' });', - " } else if (freeExports) {", - " if (freeModule) {", - ' (freeModule.exports = templates).templates = templates;', - ' } else {', - ' freeExports.templates = templates;', - ' }', - ' } else if (_) {', - ' _.templates = _.extend(_.templates || {}, templates);', - ' }', - '}(this));' - ); - - return source.join('\n'); - } - - /** - * Capitalizes a given string. - * - * @private - * @param {String} string The string to capitalize. - * @returns {String} Returns the capitalized string. - */ - function capitalize(string) { - return string[0].toUpperCase() + string.toLowerCase().slice(1); - } - - /** - * Removes unnecessary comments, whitespace, and pseudo private properties. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function cleanupSource(source) { - return source - // remove pseudo private properties - .replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n') - // remove lines with just whitespace and semicolons - .replace(/^ *;\n/gm, '') - // consolidate multiple newlines - .replace(/\n{3,}/g, '\n\n') - // consolidate consecutive horizontal rule comment separators - .replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) { - return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*')); - }); - } - - /** - * Writes the help message to standard output. - * - * @private - */ - function displayHelp() { - console.log([ - '', - ' Commands:', - '', - ' lodash backbone Build with only methods required by Backbone', - ' lodash csp Build supporting default Content Security Policy restrictions', - ' lodash legacy Build tailored for older environments without ES5 support', - ' lodash modern Build tailored for newer environments with ES5 support', - ' lodash mobile Build without method compilation and most bug fixes for old browsers', - ' lodash strict Build with `_.assign`, `_.bindAll`, & `_.defaults` in strict mode', - ' lodash underscore Build tailored for projects already using Underscore', - ' lodash include=... Comma separated method/category names to include in the build', - ' lodash minus=... Comma separated method/category names to remove from those included in the build', - ' lodash plus=... Comma separated method/category names to add to those included in the build', - ' lodash category=... Comma separated categories of methods to include in the build (case-insensitive)', - ' (i.e. “arrays”, “chaining”, “collections”, “functions”, “objects”, and “utilities”)', - ' lodash exports=... Comma separated names of ways to export the `lodash` function', - ' (i.e. “amd”, “commonjs”, “global”, “node”, and “none”)', - ' lodash iife=... Code to replace the immediately-invoked function expression that wraps Lo-Dash', - ' (e.g. `lodash iife="!function(window,undefined){%output%}(this)"`)', - '', - ' lodash template=... File path pattern used to match template files to precompile', - ' (e.g. `lodash template=./*.jst`)', - ' lodash settings=... Template settings used when precompiling templates', - ' (e.g. `lodash settings="{interpolate:/{{([\\s\\S]+?)}}/g}"`)', - ' lodash moduleId=... The AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates', - '', - ' All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.', - ' Unless specified by `-o` or `--output`, all files created are saved to the current working directory.', - '', - ' Options:', - '', - ' -c, --stdout Write output to standard output', - ' -d, --debug Write only the non-minified development output', - ' -h, --help Display help information', - ' -m, --minify Write only the minified production output', - ' -o, --output Write output to a given path/filename', - ' -p, --source-map Generate a source map for the minified output, using an optional source map URL', - ' -s, --silent Skip status updates normally logged to the console', - ' -V, --version Output current version of Lo-Dash', - '' - ].join('\n')); - } - - /** - * Gets the aliases associated with a given function name. - * - * @private - * @param {String} methodName The name of the method to get aliases for. - * @returns {Array} Returns an array of aliases. - */ - function getAliases(methodName) { - return realToAliasMap[methodName] || []; - } - - /** - * Gets the category of the given method name. - * - * @private - * @param {String} source The source to inspect. - * @param {String} methodName The method name. - * @returns {String} Returns the method name's category. - */ - function getCategory(source, methodName) { - var result = /@category +(\w+)/.exec(matchFunction(source, methodName)); - return result ? result[1] : ''; - } - - /** - * Gets an array of category dependencies for a given category. - * - * @private - * @param {String} source The source to inspect. - * @param {String} category The category. - * @returns {Array} Returns an array of cetegory dependants. - */ - function getCategoryDependencies(source, category) { - var methods = _.uniq(getMethodsByCategory(source, category).reduce(function(result, methodName) { - push.apply(result, getDependencies(methodName)); - return result; - }, [])); - - var categories = _.uniq(methods.map(function(methodName) { - return getCategory(source, methodName); - })); - - return categories.filter(function(other) { - return other != category; - }); - } - - /** - * Gets an array of depenants for a method by a given name. - * - * @private - * @param {String} methodName The method name. - * @returns {Array} Returns an array of method dependants. - */ - function getDependants(methodName) { - // iterate over the `dependencyMap`, adding the names of methods that - // have `methodName` as a dependency - return _.reduce(dependencyMap, function(result, dependencies, otherName) { - if (_.contains(dependencies, methodName)) { - result.push(otherName); - } - return result; - }, []); - } - - /** - * Gets an array of dependencies for a given method name. If passed an array - * of dependencies it will return an array containing the given dependencies - * plus any additional detected sub-dependencies. - * - * @private - * @param {Array|String} methodName A single method name or array of - * dependencies to query. - * @returns {Array} Returns an array of method dependencies. - */ - function getDependencies(methodName) { - var dependencies = Array.isArray(methodName) ? methodName : dependencyMap[methodName]; - if (!dependencies) { - return []; - } - // recursively accumulate the dependencies of the `methodName` function, and - // the dependencies of its dependencies, and so on - return _.uniq(dependencies.reduce(function(result, otherName) { - result.push.apply(result, getDependencies(otherName).concat(otherName)); - return result; - }, [])); - } - - /** - * Gets the formatted source of the given function. - * - * @private - * @param {Function} func The function to process. - * @returns {String} Returns the formatted source. - */ - function getFunctionSource(func) { - var source = func.source || (func + ''); - - // format leading whitespace - return source.replace(/\n(?:.*)/g, function(match, index) { - match = match.slice(1); - return ( - match == '}' && source.indexOf('}', index + 2) < 0 ? '\n ' : '\n ' - ) + match; - }); - } - - /** - * Gets the `_.isArguments` fallback from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the `isArguments` fallback. - */ - function getIsArgumentsFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\((?:noArgsClass|!isArguments)[\s\S]+?};\n\1}/) || [''])[0]; - } - - /** - * Gets the `_.isFunction` fallback from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the `isFunction` fallback. - */ - function getIsFunctionFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(isFunction\(\/x\/[\s\S]+?};\n\1}/) || [''])[0]; - } - - /** - * Gets the `iteratorTemplate` from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the `iteratorTemplate`. - */ - function getIteratorTemplate(source) { - return (source.match(/^( *)var iteratorTemplate *= *[\s\S]+?\n\1.+?;\n/m) || [''])[0]; - } - - /** - * Gets the Lo-Dash method assignments snippet from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the method assignments snippet. - */ - function getMethodAssignments(source) { - return (source.match(/\/\*-+\*\/\n(?:\s*\/\/.*)*\s*lodash\.\w+ *=[\s\S]+?lodash\.VERSION *=.+/) || [''])[0]; - } - - /** - * Gets the names of methods in `source` belonging to the given `category`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} category The category to filter by. - * @returns {Array} Returns a new array of method names belonging to the given category. - */ - function getMethodsByCategory(source, category) { - return allMethods.filter(function(methodName) { - return getCategory(source, methodName) == category; - }); - } - - /** - * Gets the real name, not alias, of a given method name. - * - * @private - * @param {String} methodName The name of the method to resolve. - * @returns {String} Returns the real method name. - */ - function getRealName(methodName) { - return aliasToRealMap[methodName] || methodName; - } - - /** - * Determines if all functions of the given names have been removed from `source`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} [funcName1, funcName2, ...] The names of functions to check. - * @returns {Boolean} Returns `true` if all functions have been removed, else `false`. - */ - function isRemoved(source) { - return slice.call(arguments, 1).every(function(funcName) { - return !matchFunction(source, funcName); - }); - } - - /** - * Searches `source` for a `funcName` function declaration, expression, or - * assignment and returns the matched snippet. - * - * @private - * @param {String} source The source to inspect. - * @param {String} funcName The name of the function to match. - * @returns {String} Returns the matched function snippet. - */ - function matchFunction(source, funcName) { - var result = source.match(RegExp( - // match multi-line comment block (could be on a single line) - '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/\\n)?' + - // begin non-capturing group - '( *)(?:' + - // match a function declaration - 'function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' + - // match a variable declaration with function expression - 'var ' + funcName + ' *=.*?function[\\s\\S]+?\\n\\1};' + - // end non-capturing group - ')\\n' - )); - - // match variables that are explicitly defined as functions - result || (result = source.match(RegExp( - // match multi-line comment block - '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' + - // match simple variable declarations and those with `createIterator` - ' *var ' + funcName + ' *=(?:.+?|.*?createIterator\\([\\s\\S]+?\\));\\n' - ))); - - return /@type +Function|function\s*\w*\(/.test(result) ? result[0] : ''; - } - - /** - * Converts a comma separated options string into an array. - * - * @private - * @param {String} value The option to convert. - * @returns {Array} Returns the new converted array. - */ - function optionToArray(value) { - return value.match(/\w+=(.*)$/)[1].split(/, */); - } - - /** - * Converts a comma separated options string into an array containing - * only real method names. - * - * @private - * @param {String} source The source to inspect. - * @param {String} value The option to convert. - * @returns {Array} Returns the new converted array. - */ - function optionToMethodsArray(source, value) { - var methodNames = optionToArray(value); - - // convert categories to method names - methodNames.forEach(function(category) { - push.apply(methodNames, getMethodsByCategory(source, category)); - }); - - // convert aliases to real method names - methodNames = methodNames.map(getRealName); - - // remove nonexistent and duplicate method names - return _.uniq(_.intersection(allMethods, methodNames)); - } - - /** - * Removes all `argsAreObjects` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeArgsAreObjects(source) { - source = removeVar(source, 'argsAreObjects'); - - // remove `argsAreObjects` from `_.isArray` - source = source.replace(matchFunction(source, 'isArray'), function(match) { - return match.replace(/\(argsAreObjects && *([^)]+)\)/g, '$1'); - }); - - // remove `argsAreObjects` from `_.isEqual` - source = source.replace(matchFunction(source, 'isEqual'), function(match) { - return match.replace(/!argsAreObjects[^:]+:\s*/g, ''); - }); - - return source; - } - - /** - * Removes the all references to `varName` from `createIterator` in `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} varName The name of the variable to remove. - * @returns {String} Returns the modified source. - */ - function removeFromCreateIterator(source, varName) { - var snippet = matchFunction(source, 'createIterator'); - if ( snippet) { - // remove data object property assignment - var modified = snippet.replace(RegExp("^ *'" + varName + "': *" + varName + '.+\\n', 'm'), ''); - source = source.replace(snippet, modified); - - // clip at the `factory` assignment - snippet = modified.match(/Function\([\s\S]+$/)[0]; - - modified = snippet - .replace(RegExp('\\b' + varName + '\\b,? *', 'g'), '') - .replace(/, *',/, "',") - .replace(/,\s*\)/, ')') - - source = source.replace(snippet, modified); - } - return source; - } - - /** - * Removes the `funcName` function declaration, expression, or assignment and - * associated code from `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} funcName The name of the function to remove. - * @returns {String} Returns the modified source. - */ - function removeFunction(source, funcName) { - // remove function - var snippet = matchFunction(source, funcName); - if (snippet) { - source = source.replace(snippet, ''); - } - // grab the method assignments snippet - snippet = getMethodAssignments(source); - - // remove assignment and aliases - var modified = getAliases(funcName).concat(funcName).reduce(function(result, otherName) { - return result.replace(RegExp('(?:\\n *//.*\\s*)* *lodash\\.' + otherName + ' *= *.+\\n'), ''); - }, snippet); - - // replace with the modified snippet - source = source.replace(snippet, modified); - - return removeFromCreateIterator(source, funcName); - } - - /** - * Removes all `hasDontEnumBug` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeHasDontEnumBug(source) { - source = removeFromCreateIterator(source, 'hasDontEnumBug'); - source = removeFromCreateIterator(source, 'shadowed'); - - // remove `hasDontEnumBug` declaration and assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var hasDontEnumBug\b.*|.+?hasDontEnumBug *=.+/g, ''); - - // remove `shadowed` variable - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var shadowed[\s\S]+?;\n/, ''); - - // remove `hasDontEnumBug` from `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match.replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(hasDontEnumBug[\s\S]+?["']\1<% *} *%>.+/, ''); - }); - - return source; - } - - /** - * Removes all `hasEnumPrototype` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeHasEnumPrototype(source) { - source = removeFromCreateIterator(source, 'hasEnumPrototype'); - - // remove `hasEnumPrototype` declaration and assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var hasEnumPrototype\b.*|.+?hasEnumPrototype *=.+/g, ''); - - // remove `hasEnumPrototype` from `_.keys` - source = source.replace(matchFunction(source, 'keys'), function(match) { - return match - .replace(/\(hasEnumPrototype[^)]+\)(?:\s*\|\|\s*)?/, '') - .replace(/\s*if *\(\s*\)[^}]+}/, ''); - }); - - // remove `hasEnumPrototype` from `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match - .replace(/(?: *\/\/.*\n)* *["'] *(?:<% *)?if *\(hasEnumPrototype *(?:&&|\))[\s\S]+?<% *} *(?:%>|["']).+/g, '') - .replace(/hasEnumPrototype *\|\|\s*/g, ''); - }); - - return source; - } - - /** - * Removes the `_.isArguments` fallback from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeIsArgumentsFallback(source) { - return source.replace(getIsArgumentsFallback(source), ''); - } - - /** - * Removes the `_.isFunction` fallback from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeIsFunctionFallback(source) { - return source.replace(getIsFunctionFallback(source), ''); - } - - /** - * Removes all `iteratesOwnLast` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeIteratesOwnLast(source) { - // remove `iteratesOwnLast` declaration and assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var iteratesOwnLast\b.*|.+?iteratesOwnLast *=.+/g, ''); - - // remove `iteratesOwnLast` from `shimIsPlainObject` - source = source.replace(matchFunction(source, 'shimIsPlainObject'), function(match) { - return match.replace(/(?:\s*\/\/.*)*\n( *)if *\(iteratesOwnLast[\s\S]+?\n\1}/, ''); - }); - - return source; - } - - /** - * Removes the `Object.keys` object iteration optimization from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeKeysOptimization(source) { - source = removeVar(source, 'isKeysFast'); - - // remove optimized branch in `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match.replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(isKeysFast[\s\S]+?["']\1<% *} *else *{ *%>.+\n([\s\S]+?) *["']\1<% *} *%>.+/, "'\\n' +\n$2"); - }); - - return source; - } - - /** - * Removes all `noArgsClass` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNoArgsClass(source) { - source = removeVar(source, 'noArgsClass'); - - // replace `noArgsClass` in the `_.isArguments` fallback - source = source.replace(getIsArgumentsFallback(source), function(match) { - return match.replace(/noArgsClass/g, '!isArguments(arguments)'); - }); - - // remove `noArgsClass` from `_.isEmpty` - source = source.replace(matchFunction(source, 'isEmpty'), function(match) { - return match.replace(/ *\|\|\s*\(noArgsClass *&&[^)]+?\)\)/g, ''); - }); - - return source; - } - - /** - * Removes all `noCharByIndex` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNoCharByIndex(source) { - source = removeVar(source, 'noCharByIndex'); - - // remove `noCharByIndex` from `_.at` - source = source.replace(matchFunction(source, 'at'), function(match) { - return match.replace(/^ *if *\(noCharByIndex[^}]+}\n/m, ''); - }); - - // remove `noCharByIndex` from `_.reduceRight` - source = source.replace(matchFunction(source, 'reduceRight'), function(match) { - return match.replace(/}\s*else if *\(noCharByIndex[^}]+/, ''); - }); - - // remove `noCharByIndex` from `_.toArray` - source = source.replace(matchFunction(source, 'toArray'), function(match) { - return match.replace(/noCharByIndex[^:]+:/, ''); - }); - - // `noCharByIndex` from `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match - .replace(/'if *\(<%= *arrays *%>[^']*/, '$&\\n') - .replace(/(?: *\/\/.*\n)* *["']( *)<% *if *\(noCharByIndex[\s\S]+?["']\1<% *} *%>.+/, ''); - }); - - return source; - } - - /** - * Removes all `nonEnumArgs` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNonEnumArgs(source) { - source = removeFromCreateIterator(source, 'nonEnumArgs'); - - // remove `nonEnumArgs` declaration and assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var nonEnumArgs\b.*|.+?nonEnumArgs *=.+/g, ''); - - // remove `nonEnumArgs` from `_.keys` - source = source.replace(matchFunction(source, 'keys'), function(match) { - return match - .replace(/(?:\s*\|\|\s*)?\(nonEnumArgs[^)]+\)\)/, '') - .replace(/\s*if *\(\s*\)[^}]+}/, ''); - }); - - // remove `nonEnumArgs` from `iteratorTemplate` - source = source.replace(getIteratorTemplate(source), function(match) { - return match - .replace(/(?: *\/\/.*\n)*( *["'] *)<% *} *else *if *\(nonEnumArgs[\s\S]+?(\1<% *} *%>.+)/, '$2') - .replace(/ *\|\|\s*nonEnumArgs/, ''); - }); - - return source; - } - - /** - * Removes all `noNodeClass` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNoNodeClass(source) { - // remove `noNodeClass` assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *try *{(?:\s*\/\/.*)*\n *var noNodeClass[\s\S]+?catch[^}]+}\n/, ''); - - // remove `noNodeClass` from `shimIsPlainObject` - source = source.replace(matchFunction(source, 'shimIsPlainObject'), function(match) { - return match.replace(/ *&& *\(!noNodeClass[\s\S]+?\)\)/, ''); - }); - - // remove `noNodeClass` from `_.clone` - source = source.replace(matchFunction(source, 'clone'), function(match) { - return match.replace(/ *\|\|\s*\(noNodeClass[\s\S]+?\)\)/, ''); - }); - - // remove `noNodeClass` from `_.isEqual` - source = source.replace(matchFunction(source, 'isEqual'), function(match) { - return match.replace(/ *\|\|\s*\(noNodeClass[\s\S]+?\)\)\)/, ''); - }); - - return source; - } - - /** - * Removes all `hasObjectSpliceByg` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeHasObjectSpliceBug(source) { - return removeVar(source, 'hasObjectSpliceBug') - // remove `hasObjectSpliceBug` fix from the `Array` function mixins - .replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?(?:{\s*}|\n\1})/, ''); - } - - /** - * Removes the `setImmediate` fork of `_.defer`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeSetImmediate(source) { - return source.replace(/(?:\s*\/\/.*)*\n( *)if *\(isV8 *&& *freeModule[\s\S]+?\n\1}/, ''); - } - - /** - * Removes a given variable from `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} varName The name of the variable to remove. - * @returns {String} Returns the modified source. - */ - function removeVar(source, varName) { - // simplify `cloneableClasses`, `ctorByClass`, or `hasObjectSpliceBug` - if (/^(?:cloneableClasses|ctorByClass|hasObjectSpliceBug)$/.test(varName)) { - source = source.replace(RegExp('(var ' + varName + ' *=)[\\s\\S]+?\\n\\n'), '$1=null;\n\n'); - } - source = source.replace(RegExp( - // match multi-line comment block - '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' + - // match a variable declaration that's not part of a declaration list - '( *)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' + - // match a variable in a declaration list - '\\n +' + varName + ' *=.+?,' - ), ''); - - // remove a varaible at the start of a variable declaration list - source = source.replace(RegExp('(var +)' + varName + ' *=.+?,\\s+'), '$1'); - - // remove a variable at the end of a variable declaration list - source = source.replace(RegExp(',\\s*' + varName + ' *=.+?;'), ';'); - - return removeFromCreateIterator(source, varName); - } - - /** - * Replaces the `funcName` function body in `source` with `funcValue`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} varName The name of the function to replace. - * @returns {String} Returns the modified source. - */ - function replaceFunction(source, funcName, funcValue) { - var match = matchFunction(source, funcName); - if (match) { - // clip snippet after the JSDoc comment block - match = match.replace(/^\s*(?:\/\/.*|\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)\n/, ''); - source = source.replace(match, function() { - return funcValue.trimRight() + '\n'; - }); - } - return source; - } - - /** - * Replaces the `varName` variable declaration value in `source` with `varValue`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} varName The name of the variable to replace. - * @returns {String} Returns the modified source. - */ - function replaceVar(source, varName, varValue) { - // replace a variable that's not part of a declaration list - var result = source.replace(RegExp( - '(( *)var ' + varName + ' *= *)' + - '(?:.+?;|(?:Function\\(.+?|.*?[^,])\\n[\\s\\S]+?\\n\\2.+?;)\\n' - ), function(match, captured) { - return captured + varValue + ';\n'; - }); - - if (source == result) { - // replace a varaible at the start or middle of a declaration list - result = source.replace(RegExp('((?:var|\\n) +' + varName + ' *=).+?,'), function(match, captured) { - return captured + ' ' + varValue + ','; - }); - } - if (source == result) { - // replace a variable at the end of a variable declaration list - result = source.replace(RegExp('(,\\s*' + varName + ' *=).+?;'), function(match, captured) { - return captured + ' ' + varValue + ';'; - }); - } - return result; - } - - /** - * Hard-codes the `strict` template option value for `iteratorTemplate`. - * - * @private - * @param {String} source The source to process. - * @param {Boolean} value The value to set. - * @returns {String} Returns the modified source. - */ - function setUseStrictOption(source, value) { - // inject or remove the "use strict" directive - source = source.replace(/^([\s\S]*?function[^{]+{)(?:\s*'use strict';)?/, '$1' + (value ? "\n 'use strict';" : '')); - - // replace `strict` branch in `iteratorTemplate` with hard-coded option - source = source.replace(getIteratorTemplate(source), function(match) { - return match.replace(/(template\()(?:\s*"'use strict.+)?/, '$1' + (value ? '\n "\'use strict\';\\n" +' : '')); - }); - - return source; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a debug and/or minified build, executing the `callback` for each. - * The `callback` is invoked with two arguments; (filePath, outputSource). - * - * Note: For a list of commands see `displayHelp()` or run `lodash --help`. - * - * @param {Array} [options=[]] An array of commands. - * @param {Function} callback The function called per build. - */ - function build(options, callback) { - options || (options = []); - - // the debug version of `source` - var debugSource; - - // used to specify the source map URL - var sourceMapURL; - - // used to report invalid command-line arguments - var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) { - if (/^(?:-o|--output)$/.test(options[index - 1]) || - /^(?:category|exclude|exports|iife|include|moduleId|minus|plus|settings|template)=.*$/.test(value)) { - return true; - } - var result = [ - 'backbone', - 'csp', - 'legacy', - 'mobile', - 'modern', - 'modularize', - 'strict', - 'underscore', - '-c', '--stdout', - '-d', '--debug', - '-h', '--help', - '-m', '--minify', - '-o', '--output', - '-p', '--source-map', - '-s', '--silent', - '-V', '--version' - ].indexOf(value) > -1; - - if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) { - result = true; - sourceMapURL = value; - } - return result; - }); - - // report invalid arguments - if (invalidArgs.length) { - console.log( - '\n' + - 'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') + - ' passed: ' + invalidArgs.join(', ') - ); - displayHelp(); - return; - } - - // display help message - if (_.find(options, function(arg) { - return /^(?:-h|--help)$/.test(arg); - })) { - displayHelp(); - return; - } - - // display `lodash.VERSION` - if (_.find(options, function(arg) { - return /^(?:-V|--version)$/.test(arg); - })) { - console.log(_.VERSION); - return; - } - - /*------------------------------------------------------------------------*/ - - // backup `dependencyMap` to restore later - var dependencyBackup = _.cloneDeep(dependencyMap); - - // used to specify a custom IIFE to wrap Lo-Dash - var iife = options.reduce(function(result, value) { - var match = value.match(/iife=(.*)/); - return match ? match[1] : result; - }, null); - - // the path to the source file - var filePath = path.join(__dirname, 'lodash.js'); - - // flag to specify a Backbone build - var isBackbone = options.indexOf('backbone') > -1; - - // flag to specify a Content Security Policy build - var isCSP = options.indexOf('csp') > -1 || options.indexOf('CSP') > -1; - - // flag to specify only creating the debug build - var isDebug = options.indexOf('-d') > -1 || options.indexOf('--debug') > -1; - - // flag to indicate that a custom IIFE was specified - var isIIFE = typeof iife == 'string'; - - // flag to specify creating a source map for the minified source - var isMapped = options.indexOf('-p') > -1 || options.indexOf('--source-map') > -1; - - // flag to specify only creating the minified build - var isMinify = options.indexOf('-m') > -1 || options.indexOf('--minify') > -1; - - // flag to specify a mobile build - var isMobile = isCSP || options.indexOf('mobile') > -1; - - // flag to specify a modern build - var isModern = isMobile || options.indexOf('modern') > -1; - - // flag to specify a modularize build - var isModularize = options.indexOf('modularize') > -1; - - // flag to specify writing output to standard output - var isStdOut = options.indexOf('-c') > -1 || options.indexOf('--stdout') > -1; - - // flag to specify skipping status updates normally logged to the console - var isSilent = isStdOut || options.indexOf('-s') > -1 || options.indexOf('--silent') > -1; - - // flag to specify `_.assign`, `_.bindAll`, and `_.defaults` are - // constructed using the "use strict" directive - var isStrict = options.indexOf('strict') > -1; - - // flag to specify an Underscore build - var isUnderscore = isBackbone || options.indexOf('underscore') > -1; - - // flag to specify a legacy build - var isLegacy = !(isModern || isUnderscore) && options.indexOf('legacy') > -1; - - // used to specify methods of specific categories - var categories = options.reduce(function(result, value) { - return /category/.test(value) ? optionToArray(value) : result; - }, []); - - // used to specify the ways to export the `lodash` function - var exportsOptions = options.reduce(function(result, value) { - return /exports/.test(value) ? optionToArray(value).sort() : result; - }, isUnderscore - ? ['commonjs', 'global', 'node'] - : exportsAll.slice() - ); - - // used to specify the AMD module ID of Lo-Dash used by precompiled templates - var moduleId = options.reduce(function(result, value) { - var match = value.match(/moduleId=(.*)/); - return match ? match[1] : result; - }, 'lodash'); - - // used to specify the output path for builds - var outputPath = options.reduce(function(result, value, index) { - if (/-o|--output/.test(value)) { - result = options[index + 1]; - result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result)); - } - return result; - }, ''); - - // used to match external template files to precompile - var templatePattern = options.reduce(function(result, value) { - var match = value.match(/template=(.+)$/); - return match - ? path.join(fs.realpathSync(path.dirname(match[1])), path.basename(match[1])) - : result; - }, ''); - - // used when precompiling template files - var templateSettings = options.reduce(function(result, value) { - var match = value.match(/settings=(.+)$/); - return match - ? _.assign(result, Function('return {' + match[1].replace(/^{|}$/g, '') + '}')()) - : result; - }, _.assign(_.clone(_.templateSettings), { - 'moduleId': moduleId - })); - - // flag to specify a template build - var isTemplate = !!templatePattern; - - // the lodash.js source - var source = fs.readFileSync(filePath, 'utf8'); - - // flag to specify replacing Lo-Dash's `_.clone` with Underscore's - var useUnderscoreClone = isUnderscore; - - // flags to specify exposing Lo-Dash methods in an Underscore build - var exposeAssign = !isUnderscore, - exposeForIn = !isUnderscore, - exposeForOwn = !isUnderscore, - exposeIsPlainObject = !isUnderscore; - - // flags to specify export options - var isAMD = exportsOptions.indexOf('amd') > -1, - isCommonJS = exportsOptions.indexOf('commonjs') > -1, - isGlobal = exportsOptions.indexOf('global') > -1, - isNode = exportsOptions.indexOf('node') > -1; - - /*------------------------------------------------------------------------*/ - - // names of methods to include in the build - var buildMethods = !isTemplate && (function() { - var result; - - var includeMethods = options.reduce(function(accumulator, value) { - return /include/.test(value) - ? _.union(accumulator, optionToMethodsArray(source, value)) - : accumulator; - }, []); - - var minusMethods = options.reduce(function(accumulator, value) { - return /exclude|minus/.test(value) - ? _.union(accumulator, optionToMethodsArray(source, value)) - : accumulator; - }, []); - - var plusMethods = options.reduce(function(accumulator, value) { - return /plus/.test(value) - ? _.union(accumulator, optionToMethodsArray(source, value)) - : accumulator; - }, []); - - // set flags to include Lo-Dash's methods if explicitly requested - if (isUnderscore) { - var methods = _.without.apply(_, [_.union(includeMethods, plusMethods)].concat(minusMethods)); - exposeAssign = methods.indexOf('assign') > -1; - exposeForIn = methods.indexOf('forIn') > -1; - exposeForOwn = methods.indexOf('forOwn') > -1; - exposeIsPlainObject = methods.indexOf('isPlainObject') > -1; - - methods = _.without.apply(_, [plusMethods].concat(minusMethods)); - useUnderscoreClone = methods.indexOf('clone') < 0; - } - // update dependencies - if (isLegacy) { - dependencyMap.defer = _.without(dependencyMap.defer, 'bind'); - } - if (isUnderscore) { - dependencyMap.contains = _.without(dependencyMap.contains, 'isString'); - dependencyMap.countBy = _.without(dependencyMap.countBy, 'isEqual', 'keys'); - dependencyMap.every = _.without(dependencyMap.every, 'isEqual', 'keys'); - dependencyMap.filter = _.without(dependencyMap.filter, 'isEqual'); - dependencyMap.find = _.without(dependencyMap.find, 'isEqual', 'keys'); - dependencyMap.groupBy = _.without(dependencyMap.groupBy, 'isEqual', 'keys'); - dependencyMap.isEqual = _.without(dependencyMap.isEqual, 'forIn', 'isArguments'); - dependencyMap.isEmpty = ['isArray', 'isString']; - dependencyMap.map = _.without(dependencyMap.map, 'isEqual', 'keys'); - dependencyMap.max = _.without(dependencyMap.max, 'isEqual', 'isString', 'keys'); - dependencyMap.min = _.without(dependencyMap.min, 'isEqual', 'isString', 'keys'); - dependencyMap.pick = _.without(dependencyMap.pick, 'forIn', 'isObject'); - dependencyMap.reduce = _.without(dependencyMap.reduce, 'isEqual', 'keys'); - dependencyMap.reject = _.without(dependencyMap.reject, 'isEqual', 'keys'); - dependencyMap.some = _.without(dependencyMap.some, 'isEqual', 'keys'); - dependencyMap.sortBy = _.without(dependencyMap.sortBy, 'isEqual', 'keys'); - dependencyMap.sortedIndex = _.without(dependencyMap.sortedIndex, 'isEqual', 'keys'); - dependencyMap.template = _.without(dependencyMap.template, 'keys', 'values'); - dependencyMap.uniq = _.without(dependencyMap.uniq, 'isEqual', 'keys'); - dependencyMap.where.push('find', 'isEmpty'); - - if (useUnderscoreClone) { - dependencyMap.clone = _.without(dependencyMap.clone, 'forEach', 'forOwn'); - } - } - if (isModern || isUnderscore) { - dependencyMap.reduceRight = _.without(dependencyMap.reduceRight, 'isEqual', 'isString'); - } - - // add method names explicitly - if (includeMethods.length) { - result = getDependencies(includeMethods); - } - // add method names required by Backbone and Underscore builds - if (isBackbone && !result) { - result = getDependencies(backboneDependencies); - } - else if (isUnderscore && !result) { - result = getDependencies(underscoreMethods); - } - // add method names by category - if (categories.length) { - result = _.union(result || [], getDependencies(categories.reduce(function(accumulator, category) { - // resolve method names belonging to each category (case-insensitive) - return accumulator.concat(getMethodsByCategory(source, capitalize(category))); - }, []))); - } - if (!result) { - result = allMethods.slice(); - } - if (plusMethods.length) { - result = _.union(result, getDependencies(plusMethods)); - } - if (minusMethods.length) { - result = _.without.apply(_, [result].concat(minusMethods, getDependants(minusMethods))); - } - return result; - }()); - - /*------------------------------------------------------------------------*/ - - // load customized Lo-Dash module - var lodash = !isTemplate && (function() { - var context = vm.createContext({ - 'clearTimeout': clearTimeout, - 'console': console, - 'setTimeout': setTimeout - }); - - source = setUseStrictOption(source, isStrict); - - if (isLegacy) { - _.each(['getPrototypeOf', 'isBindFast', 'isKeysFast', 'nativeBind', 'nativeIsArray', 'nativeKeys'], function(varName) { - source = replaceVar(source, varName, 'false'); - }); - - source = replaceVar(source, 'noArgsClass', 'true'); - source = removeKeysOptimization(source); - } - if (isMobile || isUnderscore) { - source = removeKeysOptimization(source); - } - if (isModern || isUnderscore) { - source = removeHasDontEnumBug(source); - source = removeHasEnumPrototype(source); - source = removeIteratesOwnLast(source); - source = removeNoCharByIndex(source); - source = removeNoNodeClass(source); - - if (!isMobile) { - source = removeNonEnumArgs(source); - } - } - if (isModern) { - // remove `_.isPlainObject` fallback - source = source.replace(matchFunction(source, 'isPlainObject'), function(match) { - return match.replace(/!getPrototypeOf.+?: */, ''); - }); - } - if (isUnderscore) { - // replace `_.assign` - source = replaceFunction(source, 'assign', [ - ' function assign(object) {', - ' if (!object) {', - ' return object;', - ' }', - ' for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {', - ' var iterable = arguments[argsIndex];', - ' if (iterable) {', - ' for (var key in iterable) {', - ' object[key] = iterable[key];', - ' }', - ' }', - ' }', - ' return object;', - ' }' - ].join('\n')); - - // replace `_.clone` - if (useUnderscoreClone) { - source = replaceFunction(source, 'clone', [ - ' function clone(value) {', - ' return isObject(value)', - ' ? (isArray(value) ? slice(value) : assign({}, value))', - ' : value', - ' }' - ].join('\n')); - } - - // replace `_.contains` - source = replaceFunction(source, 'contains', [ - ' function contains(collection, target) {', - ' var length = collection ? collection.length : 0,', - ' result = false;', - " if (typeof length == 'number') {", - ' result = indexOf(collection, target) > -1;', - ' } else {', - ' each(collection, function(value) {', - ' return (result = value === target) && indicatorObject;', - ' });', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.defaults` - source = replaceFunction(source, 'defaults', [ - ' function defaults(object) {', - ' if (!object) {', - ' return object;', - ' }', - ' for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {', - ' var iterable = arguments[argsIndex];', - ' if (iterable) {', - ' for (var key in iterable) {', - ' if (object[key] == null) {', - ' object[key] = iterable[key];', - ' }', - ' }', - ' }', - ' }', - ' return object;', - ' }' - ].join('\n')); - - // replace `_.difference` - source = replaceFunction(source, 'difference', [ - ' function difference(array) {', - ' var index = -1,', - ' length = array.length,', - ' flattened = concat.apply(arrayRef, arguments),', - ' result = [];', - '', - ' while (++index < length) {', - ' var value = array[index]', - ' if (indexOf(flattened, value, length) < 0) {', - ' result.push(value);', - ' }', - ' }', - ' return result', - ' }' - ].join('\n')); - - // replace `_.intersection` - source = replaceFunction(source, 'intersection', [ - ' function intersection(array) {', - ' var args = arguments,', - ' argsLength = args.length,', - ' index = -1,', - ' length = array ? array.length : 0,', - ' result = [];', - '', - ' outer:', - ' while (++index < length) {', - ' var value = array[index];', - ' if (indexOf(result, value) < 0) {', - ' var argsIndex = argsLength;', - ' while (--argsIndex) {', - ' if (indexOf(args[argsIndex], value) < 0) {', - ' continue outer;', - ' }', - ' }', - ' result.push(value);', - ' }', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.isEmpty` - source = replaceFunction(source, 'isEmpty', [ - ' function isEmpty(value) {', - ' if (!value) {', - ' return true;', - ' }', - ' if (isArray(value) || isString(value)) {', - ' return !value.length;', - ' }', - ' for (var key in value) {', - ' if (hasOwnProperty.call(value, key)) {', - ' return false;', - ' }', - ' }', - ' return true;', - ' }' - ].join('\n')); - - // replace `_.isEqual` - source = replaceFunction(source, 'isEqual', [ - ' function isEqual(a, b, stackA, stackB) {', - ' if (a === b) {', - ' return a !== 0 || (1 / a == 1 / b);', - ' }', - ' var type = typeof a,', - ' otherType = typeof b;', - '', - ' if (a === a &&', - " (!a || (type != 'function' && type != 'object')) &&", - " (!b || (otherType != 'function' && otherType != 'object'))) {", - ' return false;', - ' }', - ' if (a == null || b == null) {', - ' return a === b;', - ' }', - ' var className = toString.call(a),', - ' otherClass = toString.call(b);', - '', - ' if (className != otherClass) {', - ' return false;', - ' }', - ' switch (className) {', - ' case boolClass:', - ' case dateClass:', - ' return +a == +b;', - '', - ' case numberClass:', - ' return a != +a', - ' ? b != +b', - ' : (a == 0 ? (1 / a == 1 / b) : a == +b);', - '', - ' case regexpClass:', - ' case stringClass:', - " return a == b + '';", - ' }', - ' var isArr = className == arrayClass;', - ' if (!isArr) {', - ' if (a.__wrapped__ || b.__wrapped__) {', - ' return isEqual(a.__wrapped__ || a, b.__wrapped__ || b, stackA, stackB);', - ' }', - ' if (className != objectClass) {', - ' return false;', - ' }', - ' var ctorA = a.constructor,', - ' ctorB = b.constructor;', - '', - ' if (ctorA != ctorB && !(', - ' isFunction(ctorA) && ctorA instanceof ctorA &&', - ' isFunction(ctorB) && ctorB instanceof ctorB', - ' )) {', - ' return false;', - ' }', - ' }', - ' stackA || (stackA = []);', - ' stackB || (stackB = []);', - '', - ' var length = stackA.length;', - ' while (length--) {', - ' if (stackA[length] == a) {', - ' return stackB[length] == b;', - ' }', - ' }', - ' var result = true,', - ' size = 0;', - '', - ' stackA.push(a);', - ' stackB.push(b);', - '', - ' if (isArr) {', - ' size = b.length;', - ' result = size == a.length;', - '', - ' if (result) {', - ' while (size--) {', - ' if (!(result = isEqual(a[size], b[size], stackA, stackB))) {', - ' break;', - ' }', - ' }', - ' }', - ' return result;', - ' }', - ' forIn(b, function(value, key, b) {', - ' if (hasOwnProperty.call(b, key)) {', - ' size++;', - ' return !(result = hasOwnProperty.call(a, key) && isEqual(a[key], value, stackA, stackB)) && indicatorObject;', - ' }', - ' });', - '', - ' if (result) {', - ' forIn(a, function(value, key, a) {', - ' if (hasOwnProperty.call(a, key)) {', - ' return !(result = --size > -1) && indicatorObject;', - ' }', - ' });', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.omit` - source = replaceFunction(source, 'omit', [ - ' function omit(object) {', - ' var props = concat.apply(arrayRef, arguments),', - ' result = {};', - '', - ' forIn(object, function(value, key) {', - ' if (indexOf(props, key, 1) < 0) {', - ' result[key] = value;', - ' }', - ' });', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.pick` - source = replaceFunction(source, 'pick', [ - ' function pick(object) {', - ' var index = 0,', - ' props = concat.apply(arrayRef, arguments),', - ' length = props.length,', - ' result = {};', - '', - ' while (++index < length) {', - ' var prop = props[index];', - ' if (prop in object) {', - ' result[prop] = object[prop];', - ' }', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.result` - source = replaceFunction(source, 'result', [ - ' function result(object, property) {', - ' var value = object ? object[property] : null;', - ' return isFunction(value) ? object[property]() : value;', - ' }' - ].join('\n')); - - // replace `_.template` - source = replaceFunction(source, 'template', [ - ' function template(text, data, options) {', - " text || (text = '');", - ' options = defaults({}, options, lodash.templateSettings);', - '', - ' var index = 0,', - ' source = "__p += \'",', - ' variable = options.variable;', - '', - ' var reDelimiters = RegExp(', - " (options.escape || reNoMatch).source + '|' +", - " (options.interpolate || reNoMatch).source + '|' +", - " (options.evaluate || reNoMatch).source + '|$'", - " , 'g');", - '', - ' text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {', - ' source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);', - ' if (escapeValue) {', - ' source += "\' +\\n_.escape(" + escapeValue + ") +\\n\'";', - ' }', - ' if (evaluateValue) {', - ' source += "\';\\n" + evaluateValue + ";\\n__p += \'";', - ' }', - ' if (interpolateValue) {', - ' source += "\' +\\n((__t = (" + interpolateValue + ")) == null ? \'\' : __t) +\\n\'";', - ' }', - ' index = offset + match.length;', - ' return match;', - ' });', - '', - ' source += "\';\\n";', - ' if (!variable) {', - " variable = 'obj';", - " source = 'with (' + variable + ' || {}) {\\n' + source + '\\n}\\n';", - ' }', - " source = 'function(' + variable + ') {\\n' +", - ' "var __t, __p = \'\', __j = Array.prototype.join;\\n" +', - ' "function print() { __p += __j.call(arguments, \'\') }\\n" +', - ' source +', - " 'return __p\\n}';", - '', - ' try {', - " var result = Function('_', 'return ' + source)(lodash);", - ' } catch(e) {', - ' e.source = source;', - ' throw e;', - ' }', - ' if (data) {', - ' return result(data);', - ' }', - ' result.source = source;', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.uniq` - source = replaceFunction(source, 'uniq', [ - ' function uniq(array, isSorted, callback, thisArg) {', - ' var index = -1,', - ' length = array ? array.length : 0,', - ' result = [],', - ' seen = result;', - '', - " if (typeof isSorted == 'function') {", - ' thisArg = callback;', - ' callback = isSorted;', - ' isSorted = false;', - ' }', - ' if (callback) {', - ' seen = [];', - ' callback = createCallback(callback, thisArg);', - ' }', - ' 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) {', - ' seen.push(computed);', - ' }', - ' result.push(value);', - ' }', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.uniqueId` - source = replaceFunction(source, 'uniqueId', [ - ' function uniqueId(prefix) {', - " var id = ++idCounter + '';", - ' return prefix ? prefix + id : id;', - ' }' - ].join('\n')); - - // replace `_.where` - source = replaceFunction(source, 'where', [ - ' function where(collection, properties, first) {', - ' return (first && isEmpty(properties))', - ' ? null', - ' : (first ? find : filter)(collection, properties);', - ' }' - ].join('\n')); - - // replace `_.without` - source = replaceFunction(source, 'without', [ - ' function without(array) {', - ' var index = -1,', - ' length = array.length,', - ' result = [];', - '', - ' while (++index < length) {', - ' var value = array[index]', - ' if (indexOf(arguments, value, 1) < 0) {', - ' result.push(value);', - ' }', - ' }', - ' return result', - ' }' - ].join('\n')); - - // add `_.findWhere` - source = source.replace(matchFunction(source, 'find'), function (match) { - return match + [ - '', - ' function findWhere(object, properties) {', - ' return where(object, properties, true);', - ' }', - '' - ].join('\n') - }); - - source = source.replace(getMethodAssignments(source), function(match) { - return match.replace(/^( *)lodash.find *=.+/m, '$&\n$1lodash.findWhere = findWhere;'); - }); - - // add Underscore style chaining - source = addChainMethods(source); - - // remove `_.templateSettings.imports assignment - source = source.replace(/,[^']*'imports':[^}]+}/, ''); - - // remove large array optimizations - source = removeFunction(source, 'cachedContains'); - source = removeVar(source, 'largeArraySize'); - - // remove `_.isEqual` use from `createCallback` - source = source.replace(matchFunction(source, 'createCallback'), function(match) { - return match.replace(/isEqual\(([^,]+), *([^,]+)[^)]+\)/, '$1 === $2'); - }); - - // remove conditional `charCodeCallback` use from `_.max` and `_.min` - _.each(['max', 'min'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/!callback *&& *isString\(collection\)[\s\S]+?: */g, ''); - }); - }); - - // remove unneeded variables - if (useUnderscoreClone) { - source = removeVar(source, 'cloneableClasses'); - source = removeVar(source, 'ctorByClass'); - } - // remove unused features from `createBound` - if (buildMethods.indexOf('partial') < 0 && buildMethods.indexOf('partialRight') < 0) { - source = source.replace(matchFunction(source, 'createBound'), function(match) { - return match - .replace(/, *right[^)]*/, '') - .replace(/(function createBound\([^{]+{)[\s\S]+?(\n *function bound)/, '$1$2') - .replace(/thisBinding *=[^}]+}/, 'thisBinding = thisArg;\n') - .replace(/\(args *=.+/, 'partialArgs.concat(slice(args))'); - }); - } - } - vm.runInContext(source, context); - return context._; - }()); - - /*------------------------------------------------------------------------*/ - - if (isTemplate) { - source = buildTemplate(templatePattern, templateSettings); - } - else { - // remove methods from the build - allMethods.forEach(function(otherName) { - if (!_.contains(buildMethods, otherName)) { - source = removeFunction(source, otherName); - } - }); - - // remove `isArguments` fallback before `isArguments` is transformed by - // other parts of the build process - if (isRemoved(source, 'isArguments')) { - source = removeIsArgumentsFallback(source); - } - - // remove `iteratorTemplate` dependency checks from `_.template` - source = source.replace(matchFunction(source, 'template'), function(match) { - return match - .replace(/iteratorTemplate *&& */g, '') - .replace(/iteratorTemplate *\? *([^:]+?) *:[^,;]+/g, '$1'); - }); - - /*----------------------------------------------------------------------*/ - - if (isLegacy) { - source = removeSetImmediate(source); - - _.each(['isBindFast', 'isV8', 'nativeBind', 'nativeIsArray', 'nativeKeys', 'reNative'], function(varName) { - source = removeVar(source, varName); - }); - - // remove native `Function#bind` branch in `_.bind` - source = source.replace(matchFunction(source, 'bind'), function(match) { - return match.replace(/(?:\s*\/\/.*)*\s*return isBindFast[^:]+:\s*/, 'return '); - }); - - // remove native `Array.isArray` branch in `_.isArray` - source = source.replace(matchFunction(source, 'isArray'), function(match) { - return match.replace(/nativeIsArray * \|\|\s*/, ''); - }); - - // replace `_.keys` with `shimKeys` - if (!isRemoved(source, 'keys')) { - source = source.replace( - matchFunction(source, 'keys').replace(/[\s\S]+?var keys *= */, ''), - matchFunction(source, 'shimKeys').replace(/[\s\S]+?function shimKeys/, 'function').replace(/}\n$/, '};\n') - ); - - source = removeFunction(source, 'shimKeys'); - } - // replace `_.isArguments` with fallback - if (!isRemoved(source, 'isArguments')) { - source = source.replace( - matchFunction(source, 'isArguments').replace(/[\s\S]+?function isArguments/, ''), - getIsArgumentsFallback(source).match(/isArguments *= *function([\s\S]+?) *};/)[1] + ' }\n' - ); - - source = removeIsArgumentsFallback(source); - } - } - if (isModern) { - source = removeArgsAreObjects(source); - source = removeHasObjectSpliceBug(source); - source = removeIsArgumentsFallback(source); - } - if (isModern || isUnderscore) { - source = removeNoArgsClass(source); - source = removeNoNodeClass(source); - } - if (isMobile || isUnderscore) { - source = removeVar(source, 'iteratorTemplate'); - - // inline all functions defined with `createIterator` - _.functions(lodash).forEach(function(methodName) { - // strip leading underscores to match pseudo private functions - var reFunc = RegExp('(\\bvar ' + methodName.replace(/^_/, '') + ' *= *)createIterator\\(((?:{|[a-zA-Z])[\\s\\S]+?)\\);\\n'); - if (reFunc.test(source)) { - // extract, format, and inject the compiled function's source code - source = source.replace(reFunc, function(match, captured) { - return captured + getFunctionSource(lodash[methodName]) + ';\n'; - }); - } - }); - } - if (isUnderscore) { - // remove `_.assign`, `_.forIn`, `_.forOwn`, and `_.isPlainObject` assignments - (function() { - var snippet = getMethodAssignments(source), - modified = snippet; - - if (!exposeAssign) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.assign *= *.+\n/m, ''); - } - if (!exposeForIn) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forIn *= *.+\n/m, ''); - } - if (!exposeForOwn) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.forOwn *= *.+\n/m, ''); - } - if (!exposeIsPlainObject) { - modified = modified.replace(/^(?: *\/\/.*\s*)* *lodash\.isPlainObject *= *.+\n/m, ''); - } - source = source.replace(snippet, modified); - }()); - - // remove `thisArg` from unexposed `forIn` and `forOwn` - _.each([ - { 'methodName': 'forIn', 'flag': exposeForIn }, - { 'methodName': 'forOwn', 'flag': exposeForOwn } - ], function(data) { - if (!data.flag) { - source = source.replace(matchFunction(source, data.methodName), function(match) { - return match - .replace(/(callback), *thisArg/g, '$1') - .replace(/^( *)callback *=.+/m, '$1callback || (callback = identity);') - }); - } - }); - - // remove chainability from `each` and `_.forEach` - _.each(['each', 'forEach'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/\n *return .+?([};\s]+)$/, '$1'); - }); - }); - - // unexpose "exit early" feature of `each`, `_.forEach`, `_.forIn`, and `_.forOwn` - _.each(['each', 'forEach', 'forIn', 'forOwn'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/=== *false\)/g, '=== indicatorObject)'); - }); - }); - - // modify `_.every`, `_.find`, `_.isEqual`, and `_.some` to use the private `indicatorObject` - _.each(['every', 'isEqual'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/\(result *= *(.+?)\);/g, '!(result = $1) && indicatorObject;'); - }); - }); - - source = source.replace(matchFunction(source, 'find'), function(match) { - return match.replace(/return false/, 'return indicatorObject'); - }); - - source = source.replace(matchFunction(source, 'some'), function(match) { - return match.replace(/!\(result *= *(.+?)\);/, '(result = $1) && indicatorObject;'); - }); - } - if (!(isMobile || isUnderscore)) { - // inline `iteratorTemplate` template - source = source.replace(getIteratorTemplate(source), function() { - var snippet = getFunctionSource(lodash._iteratorTemplate); - - // prepend data object references to property names to avoid having to - // use a with-statement - iteratorOptions.forEach(function(property) { - snippet = snippet.replace(RegExp('([^\\w.])\\b' + property + '\\b', 'g'), '$1obj.' + property); - }); - - // remove unnecessary code - snippet = snippet - .replace(/var __t.+/, "var __p = '';") - .replace(/function print[^}]+}/, '') - .replace(/'(?:\\n|\s)+'/g, "''") - .replace(/__p *\+= *' *';/g, '') - .replace(/(__p *\+= *)' *' *\+/g, '$1') - .replace(/({) *;|; *(})/g, '$1$2') - .replace(/\(\(__t *= *\( *([^)]+) *\)\) *== *null *\? *'' *: *__t\)/g, '($1)'); - - // remove the with-statement - snippet = snippet.replace(/ *with *\(.+?\) *{/, '\n').replace(/}([^}]*}[^}]*$)/, '$1'); - - // minor cleanup - snippet = snippet - .replace(/obj *\|\|\s*\(obj *= *{}\);/, '') - .replace(/var __p = '';\s*__p \+=/, 'var __p ='); - - // remove comments, including sourceURLs - snippet = snippet.replace(/\s*\/\/.*(?:\n|$)/g, ''); - - return ' var iteratorTemplate = ' + snippet + ';\n'; - }); - } - } - - /*------------------------------------------------------------------------*/ - - // customize Lo-Dash's IIFE - (function() { - if (isIIFE) { - var token = '%output%', - index = iife.indexOf(token); - - source = source.match(/^\/\**[\s\S]+?\*\/\n/) + - iife.slice(0, index) + - source.replace(/^[\s\S]+?\(function[^{]+?{|}\(this\)\)[;\s]*$/g, '') + - iife.slice(index + token.length); - } - }()); - - /*------------------------------------------------------------------------*/ - - // customize Lo-Dash's export bootstrap - (function() { - if (!isAMD) { - source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +define[\s\S]+?else /, '$1'); - } - if (!isNode) { - source = source.replace(/(?: *\/\/.*\n)*( *)if *\(freeModule[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2'); - } - if (!isCommonJS) { - source = source.replace(/(?: *\/\/.*\n)*(?:( *)else *{)?\s*freeExports\.\w+ *=[\s\S]+?(?:\n\1})?\n/, ''); - } - if (!isGlobal) { - source = source.replace(/(?:( *)(})? *else(?: *if *\(_\))? *{)?(?:\s*\/\/.*)*\s*(?:window\._|_\.templates) *=[\s\S]+?(?:\n\1})?\n/g, '$1$2\n'); - } - // remove `if (freeExports) {...}` if it's empty - if (isAMD && isGlobal) { - source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}\n/, ''); - } else { - source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}(?:\s*else *{([\s\S]+?) *})?\n/, '$1\n'); - } - }()); - - /*------------------------------------------------------------------------*/ - - if (!isTemplate) { - // modify/remove references to removed methods/variables - if (isRemoved(source, 'invert')) { - source = replaceVar(source, 'htmlUnescapes', "{'&':'&','<':'<','>':'>','"':'\"',''':\"'\"}"); - } - if (isRemoved(source, 'isArguments')) { - source = replaceVar(source, 'noArgsClass', 'false'); - } - if (isRemoved(source, 'isFunction')) { - source = removeIsFunctionFallback(source); - } - if (isRemoved(source, 'mixin')) { - source = removeHasObjectSpliceBug(source); - - // simplify the `lodash` function - source = replaceFunction(source, 'lodash', [ - ' function lodash() {', - ' // no operation performed', - ' }' - ].join('\n')); - - // remove all `lodash.prototype` additions - source = source - .replace(/(?:\s*\/\/.*)*\n( *)forOwn\(lodash, *function\(func, *methodName\)[\s\S]+?\n\1}.+/g, '') - .replace(/(?:\s*\/\/.*)*\n( *)each\(\['[\s\S]+?\n\1}.+/g, '') - .replace(/(?:\s*\/\/.*)*\s*lodash\.prototype.+\n/g, '') - .replace(/(?:\s*\/\/.*)*\s*mixin\(lodash\).+\n/, ''); - } - // remove functions, variables, and snippets that the minifier may miss - if (isRemoved(source, 'clone')) { - source = removeVar(source, 'cloneableClasses'); - source = removeVar(source, 'ctorByClass'); - } - if (isRemoved(source, 'isArray')) { - source = removeVar(source, 'nativeIsArray'); - } - if (isRemoved(source, 'isPlainObject')) { - source = removeVar(source, 'getPrototypeOf'); - source = removeIteratesOwnLast(source); - } - if (isRemoved(source, 'keys')) { - source = removeFunction(source, 'shimKeys'); - } - if (isRemoved(source, 'template')) { - // remove `templateSettings` assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *lodash\.templateSettings[\s\S]+?};\n/, ''); - } - if (isRemoved(source, 'isArguments', 'isEmpty')) { - source = removeNoArgsClass(source); - } - if (isRemoved(source, 'clone', 'isEqual', 'isPlainObject')) { - source = removeNoNodeClass(source); - } - if ((source.match(/\bcreateIterator\b/g) || []).length < 2) { - source = removeFunction(source, 'createIterator'); - source = removeVar(source, 'defaultsIteratorOptions'); - source = removeVar(source, 'eachIteratorOptions'); - source = removeVar(source, 'forOwnIteratorOptions'); - source = removeVar(source, 'templateIterator'); - source = removeHasDontEnumBug(source); - source = removeHasEnumPrototype(source); - } - if (isRemoved(source, 'createIterator', 'bind', 'keys')) { - source = removeSetImmediate(source); - source = removeVar(source, 'isBindFast'); - source = removeVar(source, 'isV8'); - source = removeVar(source, 'nativeBind'); - } - if (isRemoved(source, 'createIterator', 'keys')) { - source = removeVar(source, 'nativeKeys'); - source = removeKeysOptimization(source); - source = removeNonEnumArgs(source); - } - if (!source.match(/var (?:hasDontEnumBug|hasEnumPrototype|iteratesOwnLast|nonEnumArgs)\b/g)) { - // remove IIFE used to assign `hasDontEnumBug`, `hasEnumPrototype`, `iteratesOwnLast`, and `nonEnumArgs` - source = source.replace(/^ *\(function\(\) *{[\s\S]+?}\(1\)\);\n/m, ''); - } - } - if ((source.match(/\bfreeModule\b/g) || []).length < 2) { - source = removeVar(source, 'freeModule'); - } - if ((source.match(/\bfreeExports\b/g) || []).length < 2) { - source = removeVar(source, 'freeExports'); - } - - debugSource = cleanupSource(source); - source = cleanupSource(source); - - /*------------------------------------------------------------------------*/ - - // flag to track if `outputPath` has been used by `callback` - var outputUsed = false; - - // flag to specify creating a custom build - var isCustom = ( - isLegacy || isMapped || isModern || isStrict || isUnderscore || outputPath || - /(?:category|exclude|exports|iife|include|minus|plus)=/.test(options) || - !_.isEqual(exportsOptions, exportsAll) - ); - - // used as the basename of the output path - var basename = outputPath - ? path.basename(outputPath, '.js') - : 'lodash' + (isTemplate ? '.template' : isCustom ? '.custom' : ''); - - // restore `dependencyMap` - dependencyMap = dependencyBackup; - - // output debug build - if (!isMinify && (isCustom || isDebug || isTemplate)) { - if (isCustom) { - debugSource = addCommandsToHeader(debugSource, options); - } - if (isDebug && isStdOut) { - stdout.write(debugSource); - callback({ - 'source': debugSource - }); - } - else if (!isStdOut) { - filePath = outputPath || path.join(cwd, basename + '.js'); - outputUsed = true; - callback({ - 'source': debugSource, - 'outputPath': filePath - }); - } - } - // begin the minification process - if (!isDebug) { - if (outputPath && outputUsed) { - outputPath = path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.min.js'); - } else if (!outputPath) { - outputPath = path.join(cwd, basename + '.min.js'); - } - minify(source, { - 'filePath': filePath, - 'isMapped': isMapped, - 'isSilent': isSilent, - 'isTemplate': isTemplate, - 'modes': isIIFE && ['simple', 'hybrid'], - 'outputPath': outputPath, - 'sourceMapURL': sourceMapURL, - 'onComplete': function(data) { - if (isCustom) { - data.source = addCommandsToHeader(data.source, options); - } - if (isStdOut) { - stdout.write(data.source); - callback(data); - } else { - callback(data); - } - } - }); - } - } - - /*--------------------------------------------------------------------------*/ - - // expose `build` - if (module != require.main) { - module.exports = build; - } - else { - // or invoked directly - build(process.argv, function(data) { - var outputPath = data.outputPath, - sourceMap = data.sourceMap; - - if (outputPath) { - fs.writeFileSync(outputPath, data.source, 'utf8'); - if (sourceMap) { - fs.writeFileSync(path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.map'), sourceMap, 'utf8'); - } - } - }); - } -}()); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/minify.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/minify.js deleted file mode 100755 index 2250669..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/minify.js +++ /dev/null @@ -1,753 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** Load Node modules */ - var fs = require('fs'), - https = require('https'), - path = require('path'), - spawn = require('child_process').spawn, - zlib = require('zlib'), - tar = require('../vendor/tar/tar.js'), - _ = require('../lodash.js'); - - /** Load other modules */ - var preprocess = require('./pre-compile.js'), - postprocess = require('./post-compile.js'); - - /** The Git object ID of `closure-compiler.tar.gz` */ - var closureId = '23cf67d0f0b979d97631fc108a2a43bb82225994'; - - /** The Git object ID of `uglifyjs.tar.gz` */ - var uglifyId = 'a934fb18f8fa2768c6a68de44b6e035fe96a268b'; - - /** The path of the directory that is the base of the repository */ - var basePath = fs.realpathSync(path.join(__dirname, '..')); - - /** The path of the `vendor` directory */ - var vendorPath = path.join(basePath, 'vendor'); - - /** The path to the Closure Compiler `.jar` */ - var closurePath = path.join(vendorPath, 'closure-compiler', 'compiler.jar'); - - /** The path to the UglifyJS module */ - var uglifyPath = path.join(vendorPath, 'uglifyjs', 'tools', 'node.js'); - - /** The Closure Compiler command-line options */ - var closureOptions = ['--warning_level=QUIET']; - - /** The media type for raw blob data */ - var mediaType = 'application/vnd.github.v3.raw'; - - /** Used to reference parts of the blob href */ - var location = (function() { - var host = 'api.github.com', - origin = 'https://api.github.com', - pathname = '/repos/bestiejs/lodash/git/blobs'; - - return { - 'host': host, - 'href': origin + pathname, - 'origin': origin, - 'pathname': pathname - }; - }()); - - /** The Closure Compiler optimization modes */ - var optimizationModes = { - 'simple': 'SIMPLE_OPTIMIZATIONS', - 'advanced': 'ADVANCED_OPTIMIZATIONS' - }; - - /** Reassign `existsSync` for older versions of Node */ - fs.existsSync || (fs.existsSync = path.existsSync); - - /*--------------------------------------------------------------------------*/ - - /** - * Minifies a given Lo-Dash `source` and invokes the `options.onComplete` - * callback when finished. The `onComplete` callback is invoked with one - * argument; (outputSource). - * - * @param {Array|String} [source=''] The source to minify or array of commands. - * -o, --output - Write output to a given path/filename. - * -s, --silent - Skip status updates normally logged to the console. - * -t, --template - Applies template specific minifier options. - * - * @param {Object} [options={}] The options object. - * outputPath - Write output to a given path/filename. - * isSilent - Skip status updates normally logged to the console. - * isTemplate - Applies template specific minifier options. - * onComplete - The function called once minification has finished. - */ - function minify(source, options) { - // used to specify the source map URL - var sourceMapURL; - - // used to specify the default minifer modes - var modes = ['simple', 'advanced', 'hybrid']; - - source || (source = ''); - options || (options = {}); - - // juggle arguments - if (Array.isArray(source)) { - // convert commands to an options object - options = source; - - // used to report invalid command-line arguments - var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) { - if (/^(?:-o|--output)$/.test(options[index - 1]) || - /^modes=.*$/.test(value)) { - return true; - } - var result = [ - '-o', '--output', - '-p', '--source-map', - '-s', '--silent', - '-t', '--template' - ].indexOf(value) > -1; - - if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) { - result = true; - sourceMapURL = value; - } - return result; - }); - - // report invalid arguments - if (invalidArgs.length) { - console.log( - '\n' + - 'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') + - ' passed: ' + invalidArgs.join(', ') - ); - return; - } - var filePath = options[options.length - 1], - isMapped = options.indexOf('-p') > -1 || options.indexOf('--source-map') > -1, - isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1, - isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1, - outputPath = path.join(path.dirname(filePath), path.basename(filePath, '.js') + '.min.js'); - - modes = options.reduce(function(result, value) { - var match = value.match(/modes=(.*)$/); - return match ? match[1].split(/, */) : result; - }, modes); - - outputPath = options.reduce(function(result, value, index) { - if (/-o|--output/.test(value)) { - result = options[index + 1]; - result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result)); - } - return result; - }, outputPath); - - options = { - 'filePath': filePath, - 'isMapped': isMapped, - 'isSilent': isSilent, - 'isTemplate': isTemplate, - 'modes': modes, - 'outputPath': outputPath, - 'sourceMapURL': sourceMapURL - }; - - source = fs.readFileSync(filePath, 'utf8'); - } - - modes = options.modes || modes; - if (options.isMapped) { - modes = modes.filter(function(mode) { - return mode != 'hybrid'; - }); - } - if (options.isTemplate) { - modes = modes.filter(function(mode) { - return mode != 'advanced'; - }); - } - options.modes = modes; - - // fetch the Closure Compiler - getDependency({ - 'id': 'closure-compiler', - 'hashId': closureId, - 'path': vendorPath, - 'title': 'the Closure Compiler', - 'onComplete': function(exception) { - var error = exception; - - // fetch UglifyJS - getDependency({ - 'id': 'uglifyjs', - 'hashId': uglifyId, - 'title': 'UglifyJS', - 'path': vendorPath, - 'onComplete': function(exception) { - error || (error = exception); - if (!error) { - new Minify(source, options); - } - } - }); - } - }); - } - - /** - * The Minify constructor used to keep state of each `minify` invocation. - * - * @private - * @constructor - * @param {String} source The source to minify. - * @param {Object} options The options object. - * outputPath - Write output to a given path/filename. - * isSilent - Skip status updates normally logged to the console. - * isTemplate - Applies template specific minifier options. - * onComplete - The function called once minification has finished. - */ - function Minify(source, options) { - // juggle arguments - if (typeof source == 'object' && source) { - options = source || options; - source = options.source || ''; - } - this.compiled = { 'simple': {}, 'advanced': {} }; - this.hybrid = { 'simple': {}, 'advanced': {} }; - this.uglified = {}; - - this.filePath = options.filePath; - this.isMapped = !!options.isMapped; - this.isSilent = !!options.isSilent; - this.isTemplate = !!options.isTemplate; - this.outputPath = options.outputPath; - this.sourceMapURL = options.sourceMapURL; - - var modes = this.modes = options.modes; - source = this.source = preprocess(source, options); - - this.onComplete = options.onComplete || function(data) { - var outputPath = this.outputPath, - sourceMap = data.sourceMap; - - fs.writeFileSync(outputPath, data.source, 'utf8'); - if (sourceMap) { - fs.writeFileSync(getMapPath(outputPath), sourceMap, 'utf8'); - } - }; - - // begin the minification process - if (modes.indexOf('simple') > -1) { - closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this)); - } else if (modes.indexOf('advanced') > -1) { - onClosureSimpleGzip.call(this); - } else { - onClosureAdvancedGzip.call(this); - } - } - - /*--------------------------------------------------------------------------*/ - - /** - * Fetches a required `.tar.gz` dependency with the given Git object ID from - * the Lo-Dash repo on GitHub. The object ID may be obtained by running - * `git hash-object path/to/dependency.tar.gz`. - * - * @private - * @param {Object} options The options object. - * id - The Git object ID of the `.tar.gz` file. - * onComplete - The function called once the extraction has finished. - * path - The path of the extraction directory. - * title - The dependency's title used in status updates logged to the console. - */ - function getDependency(options) { - options || (options = {}); - - var ran, - destPath = options.path, - hashId = options.hashId, - id = options.id, - onComplete = options.onComplete, - title = options.title; - - // exit early if dependency exists - if (fs.existsSync(path.join(destPath, id))) { - onComplete(); - return; - } - var callback = function(exception) { - if (ran) { - return; - } - if (exception) { - console.error([ - 'There was a problem installing ' + title + '.', - 'Try running the command as root, via `sudo`, or manually install by running:', - '', - "curl -H 'Accept: " + mediaType + "' " + location.href + '/' + hashId + " | tar xvz -C '" + destPath + "'", - '' - ].join('\n')); - } - ran = true; - process.removeListener('uncaughtException', callback); - onComplete(exception); - }; - - console.log('Downloading ' + title + '...'); - process.on('uncaughtException', callback); - - https.get({ - 'host': location.host, - 'path': location.pathname + '/' + hashId, - 'headers': { - // By default, all GitHub blob API endpoints return a JSON document - // containing Base64-encoded blob data. Overriding the `Accept` header - // with the GitHub raw media type returns the blob data directly. - // See http://developer.github.com/v3/media/. - 'Accept': mediaType - } - }, function(response) { - var decompressor = zlib.createUnzip(), - parser = new tar.Extract({ 'path': destPath }); - - parser.on('end', callback); - response.pipe(decompressor).pipe(parser); - }); - } - - /** - * Resolves the source map path from the given output path. - * - * @private - * @param {String} outputPath The output path. - * @returns {String} Returns the source map path. - */ - function getMapPath(outputPath) { - return path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.map'); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Compresses a `source` string using the Closure Compiler. Yields the - * minified result, and any exceptions encountered, to a `callback` function. - * - * @private - * @param {String} source The JavaScript source to minify. - * @param {String} mode The optimization mode. - * @param {Function} callback The function called once the process has completed. - */ - function closureCompile(source, mode, callback) { - var filePath = this.filePath, - isAdvanced = mode == 'advanced', - isMapped = this.isMapped, - options = closureOptions.slice(), - outputPath = this.outputPath, - mapPath = getMapPath(outputPath), - sourceMapURL = this.sourceMapURL || path.basename(mapPath); - - // remove copyright header to make other modifications easier - var license = (/^(?:\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*/.exec(source) || [''])[0]; - if (license) { - source = source.replace(license, ''); - } - - var hasIIFE = /^;?\(function[^{]+{\s*/.test(source), - isStrict = hasIIFE && /^;?\(function[^{]+{\s*["']use strict["']/.test(source); - - // to avoid stripping the IIFE, convert it to a function call - if (hasIIFE && isAdvanced) { - source = source - .replace(/\(function/, '__iife__$&') - .replace(/\(this\)\)([\s;]*(\n\/\/.+)?)$/, ', this)$1'); - } - - options.push('--compilation_level=' + optimizationModes[mode]); - if (isMapped) { - options.push('--create_source_map=' + mapPath, '--source_map_format=V3'); - } - - var compiler = spawn('java', ['-jar', closurePath].concat(options)); - if (!this.isSilent) { - console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...'); - } - - var error = ''; - compiler.stderr.on('data', function(data) { - error += data; - }); - - var output = ''; - compiler.stdout.on('data', function(data) { - output += data; - }); - - compiler.on('exit', function(status) { - // `status` contains the process exit code - if (status) { - var exception = new Error(error); - exception.status = status; - } - // restore IIFE and move exposed vars inside the IIFE - if (hasIIFE && isAdvanced) { - output = output - .replace(/__iife__\(/, '(') - .replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1') - .replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1'); - } - // inject "use strict" directive - if (isStrict) { - output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";'); - } - // restore copyright header - if (license) { - output = license + output; - } - if (isMapped) { - var mapOutput = fs.readFileSync(mapPath, 'utf8'); - fs.unlinkSync(mapPath); - output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/'; - - mapOutput = JSON.parse(mapOutput); - mapOutput.file = path.basename(outputPath); - mapOutput.sources = [path.basename(filePath)]; - mapOutput = JSON.stringify(mapOutput, null, 2); - } - callback(exception, output, mapOutput); - }); - - // proxy the standard input to the Closure Compiler - compiler.stdin.end(source); - } - - /** - * Compresses a `source` string using UglifyJS. Yields the result to a - * `callback` function. This function is synchronous; the `callback` is used - * for symmetry. - * - * @private - * @param {String} source The JavaScript source to minify. - * @param {String} label The label to log. - * @param {Function} callback The function called once the process has completed. - */ - function uglify(source, label, callback) { - if (!this.isSilent) { - console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...'); - } - try { - var uglifyJS = require(uglifyPath); - - // 1. parse - var toplevel = uglifyJS.parse(source); - - // 2. compress - // enable unsafe comparisons - toplevel.figure_out_scope(); - toplevel = toplevel.transform(uglifyJS.Compressor({ - 'comparisons': false, - 'unsafe_comps': true, - 'warnings': false - })); - - // 3. mangle - // excluding the `define` function exposed by AMD loaders - toplevel.figure_out_scope(); - toplevel.compute_char_frequency(); - toplevel.mangle_names({ - 'except': ['define'] - }); - - // 4. output - // restrict lines to 500 characters for consistency with the Closure Compiler - var stream = uglifyJS.OutputStream({ - 'ascii_only': true, - 'comments': /@cc_on|@license|@preserve/i, - 'max_line_len': 500, - }); - - toplevel.print(stream); - } - catch(e) { - var exception = e; - } - callback(exception, stream && String(stream)); - } - - /*--------------------------------------------------------------------------*/ - - /** - * The Closure Compiler callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - * @param {String} map The source map output. - */ - function onClosureSimpleCompile(exception, result, map) { - if (exception) { - throw exception; - } - result = postprocess(result); - - var simple = this.compiled.simple; - simple.source = result; - simple.sourceMap = map; - zlib.gzip(result, onClosureSimpleGzip.bind(this)); - } - - /** - * The Closure Compiler `gzip` callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onClosureSimpleGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.compiled.simple.gzip = result; - } - // compile the source using advanced optimizations - if (this.modes.indexOf('advanced') > -1) { - closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this)); - } else { - onClosureAdvancedGzip.call(this); - } - } - - /** - * The Closure Compiler callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - * @param {String} map The source map output. - */ - function onClosureAdvancedCompile(exception, result, map) { - if (exception) { - throw exception; - } - result = postprocess(result); - - var advanced = this.compiled.advanced; - advanced.source = result; - advanced.sourceMap = map; - zlib.gzip(result, onClosureAdvancedGzip.bind(this)); - } - - /** - * The Closure Compiler `gzip` callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onClosureAdvancedGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.compiled.advanced.gzip = result; - } - // minify the source using UglifyJS - if (!this.isMapped) { - uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this)); - } else { - onComplete.call(this); - } - } - - /** - * The UglifyJS callback. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onUglify(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.uglified.source = result; - zlib.gzip(result, onUglifyGzip.bind(this)); - } - - /** - * The UglifyJS `gzip` callback. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onUglifyGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.uglified.gzip = result; - } - // minify the already Closure Compiler simple optimized source using UglifyJS - var modes = this.modes; - if (modes.indexOf('hybrid') > -1) { - if (modes.indexOf('simple') > -1) { - uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this)); - } else if (modes.indexOf('advanced') > -1) { - onSimpleHybridGzip.call(this); - } - } else { - onComplete.call(this); - } - } - - /** - * The hybrid callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onSimpleHybrid(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.hybrid.simple.source = result; - zlib.gzip(result, onSimpleHybridGzip.bind(this)); - } - - /** - * The hybrid `gzip` callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onSimpleHybridGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.hybrid.simple.gzip = result; - } - // minify the already Closure Compiler advance optimized source using UglifyJS - if (this.modes.indexOf('advanced') > -1) { - uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this)); - } else { - onComplete.call(this); - } - } - - /** - * The hybrid callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onAdvancedHybrid(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.hybrid.advanced.source = result; - zlib.gzip(result, onAdvancedHybridGzip.bind(this)); - } - - /** - * The hybrid `gzip` callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onAdvancedHybridGzip(exception, result) { - if (exception) { - throw exception; - } - if (result != null) { - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.hybrid.advanced.gzip = result; - } - // finish by choosing the smallest compressed file - onComplete.call(this); - } - - /** - * The callback executed after the source is minified and gzipped. - * - * @private - */ - function onComplete() { - var compiledSimple = this.compiled.simple, - compiledAdvanced = this.compiled.advanced, - uglified = this.uglified, - hybridSimple = this.hybrid.simple, - hybridAdvanced = this.hybrid.advanced; - - var objects = [ - compiledSimple, - compiledAdvanced, - uglified, - hybridSimple, - hybridAdvanced - ]; - - var gzips = objects - .map(function(data) { return data.gzip; }) - .filter(Boolean); - - // select the smallest gzipped file and use its minified counterpart as the - // official minified release (ties go to the Closure Compiler) - var min = gzips.reduce(function(min, gzip) { - var length = gzip.length; - return min > length ? length : min; - }, Infinity); - - // pass the minified source to the "onComplete" callback - objects.some(function(data) { - var gzip = data.gzip; - if (gzip && gzip.length == min) { - data.outputPath = this.outputPath; - this.onComplete(data); - return true; - } - }, this); - } - - /*--------------------------------------------------------------------------*/ - - // expose `minify` - if (module != require.main) { - module.exports = minify; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node minify.js source.js`) and write to - // `.min.js` - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - minify(options); - }()); - } -}()); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/post-compile.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/post-compile.js deleted file mode 100644 index db56866..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/post-compile.js +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** The Node filesystem module */ - var fs = require('fs'); - - /** The minimal license/copyright template */ - var licenseTemplate = [ - '/**', - ' * @license', - ' * Lo-Dash <%= VERSION %> lodash.com/license', - ' * Underscore.js 1.4.4 underscorejs.org/LICENSE', - ' */' - ].join('\n'); - - /*--------------------------------------------------------------------------*/ - - /** - * Post-process a given minified Lo-Dash `source`, preparing it for - * deployment. - * - * @param {String} source The source to process. - * @returns {String} Returns the processed source. - */ - function postprocess(source) { - // remove copyright header - source = source.replace(/^\/\**[\s\S]+?\*\/\n/, ''); - - // correct overly aggressive Closure Compiler advanced optimizations - source = source - .replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}') - .replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")'); - - // flip `typeof` expressions to help optimize Safari and - // correct the AMD module definition for AMD build optimizers - // (e.g. from `"number" == typeof x` to `typeof x == "number") - source = source.replace(/(\w)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[.\w]+(?!\[)))/g, function(match, other, type, equality, expression) { - return (other ? other + ' ' : '') + expression + equality + type; - }); - - // add trailing semicolon - if (source) { - source = source.replace(/[\s;]*?(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*$/, ';$1'); - } - // exit early if version snippet isn't found - var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source); - if (!snippet) { - return source; - } - // add new copyright header - var version = snippet[2]; - source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source; - - return source; - } - - /*--------------------------------------------------------------------------*/ - - // expose `postprocess` - if (module != require.main) { - module.exports = postprocess; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node post-compile.js source.js`) and write to - // the same file - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - var filePath = options[options.length - 1], - source = fs.readFileSync(filePath, 'utf8'); - - fs.writeFileSync(filePath, postprocess(source), 'utf8'); - }()); - } -}()); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/pre-compile.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/pre-compile.js deleted file mode 100644 index 94e1011..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/build/pre-compile.js +++ /dev/null @@ -1,382 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** The Node filesystem module */ - var fs = require('fs'); - - /** Used to minify variables embedded in compiled strings */ - var compiledVars = [ - 'args', - 'argsIndex', - 'argsLength', - 'callback', - 'collection', - 'createCallback', - 'ctor', - 'guard', - 'hasOwnProperty', - 'index', - 'isArguments', - 'isArray', - 'isString', - 'iterable', - 'length', - 'nativeKeys', - 'object', - 'objectTypes', - 'ownIndex', - 'ownProps', - 'result', - 'skipProto', - 'source', - 'thisArg' - ]; - - /** Used to minify `compileIterator` option properties */ - var iteratorOptions = [ - 'args', - 'arrays', - 'bottom', - 'firstArg', - 'hasDontEnumBug', - 'hasEnumPrototype', - 'isKeysFast', - 'loop', - 'nonEnumArgs', - 'noCharByIndex', - 'shadowed', - 'top', - 'useHas' - ]; - - /** Used to minify variables and string values to a single character */ - var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); - minNames.push.apply(minNames, minNames.map(function(value) { - return value + value; - })); - - /** Used to protect the specified properties from getting minified */ - var propWhitelist = [ - '_', - '__wrapped__', - 'after', - 'all', - 'amd', - 'any', - 'assign', - 'at', - 'attachEvent', - 'bind', - 'bindAll', - 'bindKey', - 'clearTimeout', - 'clone', - 'cloneDeep', - 'collect', - 'compact', - 'compose', - 'contains', - 'countBy', - 'criteria', - 'debounce', - 'defaults', - 'defer', - 'delay', - 'detect', - 'difference', - 'drop', - 'each', - 'environment', - 'escape', - 'evaluate', - 'every', - 'exports', - 'extend', - 'filter', - 'find', - 'first', - 'flatten', - 'foldl', - 'foldr', - 'forEach', - 'forIn', - 'forOwn', - 'functions', - 'global', - 'groupBy', - 'has', - 'head', - 'imports', - 'identity', - 'include', - 'index', - 'indexOf', - 'initial', - 'inject', - 'interpolate', - 'intersection', - 'invert', - 'invoke', - 'isArguments', - 'isArray', - 'isBoolean', - 'isDate', - 'isElement', - 'isEmpty', - 'isEqual', - 'isEqual', - 'isFinite', - 'isFinite', - 'isFunction', - 'isNaN', - 'isNull', - 'isNumber', - 'isObject', - 'isPlainObject', - 'isRegExp', - 'isString', - 'isUndefined', - 'keys', - 'last', - 'lastIndexOf', - 'map', - 'max', - 'memoize', - 'merge', - 'methods', - 'min', - 'mixin', - 'noConflict', - 'object', - 'omit', - 'once', - 'opera', - 'pairs', - 'partial', - 'partialRight', - 'pick', - 'pluck', - 'random', - 'range', - 'reduce', - 'reduceRight', - 'reject', - 'rest', - 'result', - 'select', - 'setImmediate', - 'setTimeout', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'sortedIndex', - 'source', - 'tail', - 'take', - 'tap', - 'template', - 'templateSettings', - 'throttle', - 'times', - 'toArray', - 'unescape', - 'union', - 'uniq', - 'unique', - 'uniqueId', - 'value', - 'values', - 'variable', - 'VERSION', - 'where', - 'without', - 'wrap', - 'zip', - - // properties used by the `backbone` and `underscore` builds - '__chain__', - 'chain', - 'findWhere' - ]; - - /*--------------------------------------------------------------------------*/ - - /** - * Pre-process a given Lo-Dash `source`, preparing it for minification. - * - * @param {String} [source=''] The source to process. - * @param {Object} [options={}] The options object. - * @returns {String} Returns the processed source. - */ - function preprocess(source, options) { - source || (source = ''); - options || (options = {}); - - // remove unrecognized JSDoc tags so the Closure Compiler won't complain - source = source.replace(/@(?:alias|category)\b.*/g, ''); - - if (options.isTemplate) { - return source; - } - // add brackets to whitelisted properties so the Closure Compiler won't mung them - // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export - source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), function(match, prop) { - return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']"; - }); - - // remove brackets from `_.escape()` in `_.template` - source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape'); - - // remove brackets from `collection.indexOf` in `_.contains` - source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)'); - - // remove brackets from `result[length].value` in `_.sortBy` - source = source.replace("result[length]['value']", 'result[length].value'); - - // remove whitespace from string literals - source = source.replace(/^([ "'\w]+:)? *"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, captured) { - // remove object literal property name - if (/:$/.test(captured)) { - string = string.slice(captured.length); - } - // avoids removing the '\n' of the `stringEscapes` object - string = string.replace(/\[object |delete |else (?!{)|function | in |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) { - return match == false || match == '\\n' ? '' : match; - }); - // prepend object literal property name - return (captured || '') + string; - }); - - // remove whitespace from `_.template` related regexes - source = source.replace(/reEmptyString\w+ *=.+/g, function(match) { - return match.replace(/ |\\n/g, ''); - }); - - // remove newline from double-quoted strings in `_.template` - source = source - .replace('"__p += \'"', '"__p+=\'"') - .replace('"\';\n"', '"\';"') - - // remove debug sourceURL use in `_.template` - source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, ''); - - // minify internal properties used by 'compareAscending' and `_.sortBy` - (function() { - var properties = ['criteria', 'index', 'value'], - snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g); - - if (!snippets) { - return; - } - snippets.forEach(function(snippet) { - var modified = snippet; - - // minify properties - properties.forEach(function(property, index) { - var minName = minNames[index], - reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'), - reDotProp = RegExp('\\.' + property + '\\b', 'g'), - rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g'); - - modified = modified - .replace(reBracketProp, "['" + minName + "']") - .replace(reDotProp, "['" + minName + "']") - .replace(rePropColon, "$1'" + minName + "':"); - }); - - // replace with modified snippet - source = source.replace(snippet, modified); - }); - }()); - - // minify all compilable snippets - var snippets = source.match( - RegExp([ - // match the `iteratorTemplate` - '( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}', - // match methods created by `createIterator` calls - 'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n', - // match variables storing `createIterator` options - '( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}', - // match the the `createIterator` function - '( +)function createIterator\\b[\\s\\S]+?\\n\\3}' - ].join('|'), 'g') - ); - - // exit early if no compilable snippets - if (!snippets) { - return source; - } - - snippets.forEach(function(snippet, index) { - var isCreateIterator = /function createIterator\b/.test(snippet), - isIteratorTemplate = /var iteratorTemplate\b/.test(snippet), - modified = snippet; - - // add brackets to iterator option properties so the Closure Compiler won't mung them - modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), function(match, prop) { - return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']"; - }); - - if (isCreateIterator) { - // clip before the `factory` call to avoid minifying its arguments - source = source.replace(snippet, modified); - snippet = modified = modified.replace(/return factory\([\s\S]+$/, ''); - } - // minify `createIterator` option property names - iteratorOptions.forEach(function(property, index) { - var minName = minNames[index]; - - // minify variables in `iteratorTemplate` or property names in everything else - modified = isIteratorTemplate - ? modified.replace(RegExp('\\b' + property + '\\b', 'g'), minName) - : modified.replace(RegExp("'" + property + "'", 'g'), "'" + minName + "'"); - }); - - // minify snippet variables / arguments - compiledVars.forEach(function(variable, index) { - var minName = minNames[index]; - - // ensure properties in compiled strings aren't minified - modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName); - - // correct `typeof` values - if (/^(?:boolean|function|object|number|string|undefined)$/.test(variable)) { - modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + variable + "'"); - } - }); - - // replace with modified snippet - source = source.replace(snippet, modified); - }); - - return source; - } - - /*--------------------------------------------------------------------------*/ - - // expose `preprocess` - if (module != require.main) { - module.exports = preprocess; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node pre-compile.js source.js`) and write to - // the same file - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - var filePath = options[options.length - 1], - isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1, - source = fs.readFileSync(filePath, 'utf8'); - - fs.writeFileSync(filePath, preprocess(source, { - 'isTemplate': isTemplate - }), 'utf8'); - }()); - } -}()); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js deleted file mode 100644 index 37ebc92..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js +++ /dev/null @@ -1,5152 +0,0 @@ -/** - * @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/bestiejs/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n* [John-David Dalton](http://allyoucanleet.com/)\n [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\")\n\n## Contributors\n\n* [Kit Cambridge](http://kitcambridge.github.com/)\n [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\")\n* [Mathias Bynens](http://mathiasbynens.be/)\n [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\")\n", - "readmeFilename": "README.md", - "_id": "lodash@1.0.1", - "_from": "lodash@~1.0.1" -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/perf/perf.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/perf/perf.js deleted file mode 100644 index 4ff9cf5..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/perf/perf.js +++ /dev/null @@ -1,1724 +0,0 @@ -(function(window) { - - /** Use a single "load" function */ - var load = typeof require == 'function' ? require : window.load; - - /** The file path of the Lo-Dash file to test */ - var filePath = (function() { - var min = 0; - var result = window.phantom - ? phantom.args - : (window.system - ? (min = 1, system.args) - : (window.process ? (min = 2, process.argv) : (window.arguments || [])) - ); - - var last = result[result.length - 1]; - result = (result.length > min && last != 'test.js') ? last : '../lodash.js'; - - try { - result = require('fs').realpathSync(result); - } catch(e) { } - - return result; - }()); - - /** Load Benchmark.js */ - var Benchmark = - window.Benchmark || ( - Benchmark = load('../vendor/benchmark.js/benchmark.js') || window.Benchmark, - Benchmark.Benchmark || Benchmark - ); - - /** Load Lo-Dash */ - var lodash = - window.lodash || ( - lodash = load(filePath) || window._, - lodash = lodash._ || lodash, - lodash.noConflict() - ); - - /** Load Underscore */ - var _ = - window._ || ( - _ = load('../vendor/underscore/underscore.js') || window._, - _._ || _ - ); - - /** Used to access the Firebug Lite panel (set by `run`) */ - var fbPanel; - - /** Used to score performance */ - var score = { 'a': 0, 'b': 0 }; - - /** Used to queue benchmark suites */ - var suites = []; - - /** The `ui` object */ - var ui = window.ui || { - 'buildPath': basename(filePath, '.js'), - 'otherPath': 'underscore' - }; - - /** The Lo-Dash build basename */ - var buildName = basename(ui.buildPath, '.js'); - - /** The other library basename */ - var otherName = basename(ui.otherPath, '.js'); - - /** Expose functions to the global object */ - window._ = _; - window.Benchmark = Benchmark; - window.lodash = lodash; - - /** Add `console.log()` support for Narwhal and RingoJS */ - if (!window.console && window.print) { - window.console = { 'log': window.print }; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Gets the basename of the given `filePath`. If the file `extension` is passed, - * it will be removed from the basename. - * - * @private - * @param {String} path The file path to inspect. - * @param {String} extension The extension to remove. - * @returns {String} Returns the basename. - */ - function basename(filePath, extension) { - var result = (filePath || '').split(/[\\/]/).pop(); - return arguments.length < 2 - ? result - : result.replace(RegExp(extension.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&') + '$'), ''); - } - - /** - * Gets the Hz, i.e. operations per second, of `bench` adjusted for the - * margin of error. - * - * @private - * @param {Object} bench The benchmark object. - * @returns {Number} Returns the adjusted Hz. - */ - function getHz(bench) { - var result = 1 / (bench.stats.mean + bench.stats.moe); - return isFinite(result) ? result : 0; - } - - /** - * Logs text to the console. - * - * @private - * @param {String} text The text to log. - */ - function log(text) { - console.log(text + ''); - if (fbPanel) { - // scroll the Firebug Lite panel down - fbPanel.scrollTop = fbPanel.scrollHeight; - } - } - - /** - * Runs all benchmark suites. - * - * @private (@public in the browser) - */ - function run() { - fbPanel = (fbPanel = window.document && document.getElementById('FirebugUI')) && - (fbPanel = (fbPanel = fbPanel.contentWindow || fbPanel.contentDocument).document || fbPanel) && - fbPanel.getElementById('fbPanel1'); - - log('\nSit back and relax, this may take a while.'); - suites[0].run(); - } - - /*--------------------------------------------------------------------------*/ - - lodash.extend(Benchmark.Suite.options, { - 'onStart': function() { - log('\n' + this.name + ':'); - }, - 'onCycle': function(event) { - log(event.target); - }, - 'onComplete': function() { - var formatNumber = Benchmark.formatNumber, - fastest = this.filter('fastest'), - fastestHz = getHz(fastest[0]), - slowest = this.filter('slowest'), - slowestHz = getHz(slowest[0]), - aHz = getHz(this[0]), - bHz = getHz(this[1]); - - if (fastest.length > 1) { - log('It\'s too close to call.'); - aHz = bHz = slowestHz; - } - else { - var percent = ((fastestHz / slowestHz) - 1) * 100; - - log( - fastest[0].name + ' is ' + - formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) + - '% faster.' - ); - } - // add score adjusted for margin of error - score.a += aHz; - score.b += bHz; - - // remove current suite from queue - suites.shift(); - - if (suites.length) { - // run next suite - suites[0].run(); - } - else { - var fastestTotalHz = Math.max(score.a, score.b), - slowestTotalHz = Math.min(score.a, score.b), - totalPercent = formatNumber(Math.round(((fastestTotalHz / slowestTotalHz) - 1) * 100)), - totalX = fastestTotalHz / slowestTotalHz, - message = 'is ' + totalPercent + '% ' + (totalX == 1 ? '' : '(' + formatNumber(totalX.toFixed(2)) + 'x) ') + 'faster than'; - - // report results - if (score.a >= score.b) { - log('\n' + buildName + ' ' + message + ' ' + otherName + '.'); - } else { - log('\n' + otherName + ' ' + message + ' ' + buildName + '.'); - } - } - } - }); - - /*--------------------------------------------------------------------------*/ - - lodash.extend(Benchmark.options, { - 'async': true, - 'setup': '\ - var window = Function("return this || global")(),\ - _ = window._,\ - lodash = window.lodash,\ - belt = this.name == "Lo-Dash" ? lodash : _;\ - \ - var index,\ - date = new Date,\ - limit = 20,\ - regexp = /x/,\ - object = {},\ - objects = Array(limit),\ - numbers = Array(limit),\ - fourNumbers = [5, 25, 10, 30],\ - nestedNumbers = [1, [2], [3, [[4]]]],\ - twoNumbers = [12, 23];\ - \ - for (index = 0; index < limit; index++) {\ - numbers[index] = index;\ - object["key" + index] = index;\ - objects[index] = { "num": index };\ - }\ - \ - if (typeof bind != "undefined") {\ - var contextObject = { "name": "moe" },\ - ctor = function() {};\ - \ - var func = function(greeting, punctuation) {\ - return greeting + ", " + this.name + (punctuation || ".");\ - };\ - \ - var lodashBoundNormal = lodash.bind(func, contextObject),\ - lodashBoundPartial = lodash.bind(func, contextObject, "hi");\ - \ - var _boundNormal = _.bind(func, contextObject),\ - _boundPartial = _.bind(func, contextObject, "hi");\ - }\ - \ - if (typeof bindAll != "undefined") {\ - var bindAllObjects = Array(this.count),\ - funcNames = belt.functions(lodash);\ - \ - // potentially expensive\n\ - for (index = 0; index < this.count; index++) {\ - bindAllObjects[index] = belt.reduce(funcNames, function(object, funcName) {\ - object[funcName] = lodash[funcName];\ - return object;\ - }, {});\ - }\ - }\ - if (typeof compact != "undefined") {\ - var uncompacted = numbers.slice();\ - uncompacted[2] = false;\ - uncompacted[6] = null;\ - uncompacted[18] = "";\ - }\ - \ - if (typeof countBy != "undefined" || typeof omit != "undefined") {\ - var wordToNumber = {\ - "one": 1,\ - "two": 2,\ - "three": 3,\ - "four": 4,\ - "five": 5,\ - "six": 6,\ - "seven": 7,\ - "eight": 8,\ - "nine": 9,\ - "ten": 10,\ - "eleven": 11,\ - "twelve": 12,\ - "thirteen": 13,\ - "fourteen": 14,\ - "fifteen": 15,\ - "sixteen": 16,\ - "seventeen": 17,\ - "eighteen": 18,\ - "nineteen": 19,\ - "twenty": 20,\ - "twenty-one": 21,\ - "twenty-two": 22,\ - "twenty-three": 23,\ - "twenty-four": 24,\ - "twenty-five": 25,\ - "twenty-six": 26,\ - "twenty-seven": 27,\ - "twenty-eight": 28,\ - "twenty-nine": 29,\ - "thirty": 30,\ - "thirty-one": 31,\ - "thirty-two": 32,\ - "thirty-three": 33,\ - "thirty-four": 34,\ - "thirty-five": 35,\ - "thirty-six": 36,\ - "thirty-seven": 37,\ - "thirty-eight": 38,\ - "thirty-nine": 39,\ - "forty": 40\ - };\ - \ - var words = belt.keys(wordToNumber).slice(0, limit);\ - }\ - \ - if (typeof isEqual != "undefined") {\ - var objectOfPrimitives = {\ - "boolean": true,\ - "number": 1,\ - "string": "a"\ - };\ - \ - var objectOfObjects = {\ - "boolean": new Boolean(true),\ - "number": new Number(1),\ - "string": new String("a")\ - };\ - \ - var object2 = {},\ - objects2 = Array(limit),\ - numbers2 = Array(limit),\ - nestedNumbers2 = [1, [2], [3, [[4]]]],\ - nestedNumbers3 = [1, [2], [5, [[6]]]],\ - simpleObject = { "a": 1 },\ - simpleObject2 = { "a": 2 },\ - simpleObjects = [simpleObject],\ - simpleObjects2 = [simpleObject2],\ - twoNumbers2 = [18, 27];\ - \ - for (index = 0; index < limit; index++) {\ - object2["key" + index] = index;\ - objects2[index] = { "num": index };\ - numbers2[index] = index;\ - }\ - }\ - \ - if (typeof multiArrays != "undefined") {\ - var twentyValues = Array(20),\ - twentyValues2 = Array(20),\ - twentyFiveValues = Array(25),\ - twentyFiveValues2 = Array(25),\ - thirtyValues = Array(30),\ - thirtyValues2 = Array(30),\ - fortyValues = Array(40),\ - fortyValues2 = Array(40),\ - fiftyValues = Array(50),\ - fiftyValues2 = Array(50),\ - seventyFiveValues = Array(75),\ - seventyFiveValues2 = Array(75),\ - hundredValues = Array(100),\ - hundredValues2 = Array(100),\ - lowerChars = "abcdefghijklmnopqrstuvwxyz".split(""),\ - upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");\ - \ - for (index = 0; index < 100; index++) {\ - if (index < 15) {\ - twentyValues[index] = lowerChars[index];\ - twentyValues2[index] = upperChars[index];\ - }\ - if (index < 20) {\ - twentyValues[index] =\ - twentyValues2[index] = index;\ - \ - twentyFiveValues[index] = lowerChars[index];\ - twentyFiveValues2[index] = upperChars[index];\ - }\ - if (index < 25) {\ - twentyFiveValues[index] =\ - twentyFiveValues2[index] = index;\ - \ - thirtyValues[index] =\ - fortyValues[index] =\ - fiftyValues[index] =\ - seventyFiveValues[index] =\ - hundredValues[index] = lowerChars[index];\ - \ - thirtyValues2[index] =\ - fortyValues2[index] =\ - fiftyValues2[index] =\ - seventyFiveValues2[index] =\ - hundredValues2[index] = upperChars[index];\ - }\ - else {\ - if (index < 30) {\ - thirtyValues[index] =\ - thirtyValues2[index] = index;\ - }\ - if (index < 40) {\ - fortyValues[index] =\ - fortyValues2[index] = index;\ - }\ - if (index < 50) {\ - fiftyValues[index] =\ - fiftyValues2[index] = index;\ - }\ - if (index < 75) {\ - seventyFiveValues[index] =\ - seventyFiveValues2[index] = index;\ - }\ - hundredValues[index] =\ - hundredValues2[index] = index;\ - }\ - }\ - }\ - \ - if (typeof template != "undefined") {\ - var tplData = {\ - "header1": "Header1",\ - "header2": "Header2",\ - "header3": "Header3",\ - "header4": "Header4",\ - "header5": "Header5",\ - "header6": "Header6",\ - "list": ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]\ - };\ - \ - var tpl =\ - "
                      " +\ - "

                      <%= header1 %>

                      " +\ - "

                      <%= header2 %>

                      " +\ - "

                      <%= header3 %>

                      " +\ - "

                      <%= header4 %>

                      " +\ - "
                      <%= header5 %>
                      " +\ - "
                      <%= header6 %>
                      " +\ - "
                        " +\ - "<% for (var index = 0, length = list.length; index < length; index++) { %>" +\ - "
                      • <%= list[index] %>
                      • " +\ - "<% } %>" +\ - "
                      " +\ - "
                      ";\ - \ - var tplVerbose =\ - "
                      " +\ - "

                      <%= data.header1 %>

                      " +\ - "

                      <%= data.header2 %>

                      " +\ - "

                      <%= data.header3 %>

                      " +\ - "

                      <%= data.header4 %>

                      " +\ - "
                      <%= data.header5 %>
                      " +\ - "
                      <%= data.header6 %>
                      " +\ - "
                        " +\ - "<% for (var index = 0, length = data.list.length; index < length; index++) { %>" +\ - "
                      • <%= data.list[index] %>
                      • " +\ - "<% } %>" +\ - "
                      " +\ - "
                      ";\ - \ - var settingsObject = { "variable": "data" };\ - \ - var lodashTpl = lodash.template(tpl),\ - lodashTplVerbose = lodash.template(tplVerbose, null, settingsObject);\ - \ - var _tpl = _.template(tpl),\ - _tplVerbose = _.template(tplVerbose, null, settingsObject);\ - }' - }); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.bind` (uses native `Function#bind` if available and inferred fast)') - .add(buildName, { - 'fn': 'lodash.bind(func, { "name": "moe" }, "hi")', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_.bind(func, { "name": "moe" }, "hi")', - 'teardown': 'function bind(){}' - }) - ); - - suites.push( - Benchmark.Suite('bound call') - .add(buildName, { - 'fn': 'lodashBoundNormal()', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_boundNormal()', - 'teardown': 'function bind(){}' - }) - ); - - suites.push( - Benchmark.Suite('bound call with arguments') - .add(buildName, { - 'fn': 'lodashBoundNormal("hi", "!")', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_boundNormal("hi", "!")', - 'teardown': 'function bind(){}' - }) - ); - - suites.push( - Benchmark.Suite('bound and partially applied call (uses native `Function#bind` if available)') - .add(buildName, { - 'fn': 'lodashBoundPartial()', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_boundPartial()', - 'teardown': 'function bind(){}' - }) - ); - - suites.push( - Benchmark.Suite('bound and partially applied call with arguments (uses native `Function#bind` if available)') - .add(buildName, { - 'fn': 'lodashBoundPartial("!")', - 'teardown': 'function bind(){}' - }) - .add(otherName, { - 'fn': '_boundPartial("!")', - 'teardown': 'function bind(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.bindAll` iterating arguments') - .add(buildName, { - 'fn': 'lodash.bindAll.apply(lodash, [bindAllObjects.pop()].concat(funcNames))', - 'teardown': 'function bindAll(){}' - }) - .add(otherName, { - 'fn': '_.bindAll.apply(_, [bindAllObjects.pop()].concat(funcNames))', - 'teardown': 'function bindAll(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.bindAll` iterating the `object`') - .add(buildName, { - 'fn': 'lodash.bindAll(bindAllObjects.pop())', - 'teardown': 'function bindAll(){}' - }) - .add(otherName, { - 'fn': '_.bindAll(bindAllObjects.pop())', - 'teardown': 'function bindAll(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.clone` with an object') - .add(buildName, '\ - lodash.clone(object)' - ) - .add(otherName, '\ - _.clone(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.compact`') - .add(buildName, { - 'fn': 'lodash.compact(uncompacted)', - 'teardown': 'function compact(){}' - }) - .add(otherName, { - 'fn': '_.compact(uncompacted)', - 'teardown': 'function compact(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.contains` iterating an array') - .add(buildName, '\ - lodash.contains(numbers, 19)' - ) - .add(otherName, '\ - _.contains(numbers, 19)' - ) - ); - - suites.push( - Benchmark.Suite('`_.contains` iterating an object') - .add(buildName, '\ - lodash.contains(object, 19)' - ) - .add(otherName, '\ - _.contains(object, 19)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.countBy` with `callback` iterating an array') - .add(buildName, '\ - lodash.countBy(numbers, function(num) { return num >> 1; })' - ) - .add(otherName, '\ - _.countBy(numbers, function(num) { return num >> 1; })' - ) - ); - - suites.push( - Benchmark.Suite('`_.countBy` with `property` name iterating an array') - .add(buildName, { - 'fn': 'lodash.countBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.countBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.countBy` with `callback` iterating an object') - .add(buildName, { - 'fn': 'lodash.countBy(wordToNumber, function(num) { return num >> 1; })', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.countBy(wordToNumber, function(num) { return num >> 1; })', - 'teardown': 'function countBy(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.defaults`') - .add(buildName, '\ - lodash.defaults({ "key2": 2, "key6": 6, "key18": 18 }, object)' - ) - .add(otherName, '\ - _.defaults({ "key2": 2, "key6": 6, "key18": 18 }, object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.difference`') - .add(buildName, '\ - lodash.difference(numbers, twoNumbers, fourNumbers)' - ) - .add(otherName, '\ - _.difference(numbers, twoNumbers, fourNumbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.difference` iterating 30 elements') - .add(buildName, { - 'fn': 'lodash.difference(thirtyValues, thirtyValues2)', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.difference(thirtyValues, thirtyValues2)', - 'teardown': 'function multiArrays(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.difference` iterating 20 and 40 elements') - .add(buildName, { - 'fn': 'lodash.difference(twentyValues, fortyValues2)', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.difference(twentyValues, fortyValues2)', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.each` iterating an array') - .add(buildName, '\ - var result = [];\ - lodash.each(numbers, function(num) {\ - result.push(num * 2);\ - })' - ) - .add(otherName, '\ - var result = [];\ - _.each(numbers, function(num) {\ - result.push(num * 2);\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.each` iterating an array with `thisArg` (slow path)') - .add(buildName, '\ - var result = [];\ - lodash.each(numbers, function(num, index) {\ - result.push(num + this["key" + index]);\ - }, object)' - ) - .add(otherName, '\ - var result = [];\ - _.each(numbers, function(num, index) {\ - result.push(num + this["key" + index]);\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.each` iterating an object') - .add(buildName, '\ - var result = [];\ - lodash.each(object, function(num) {\ - result.push(num * 2);\ - })' - ) - .add(otherName, '\ - var result = [];\ - _.each(object, function(num) {\ - result.push(num * 2);\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.every` iterating an array') - .add(buildName, '\ - lodash.every(numbers, function(num) {\ - return num + "";\ - })' - ) - .add(otherName, '\ - _.every(numbers, function(num) {\ - return num + "";\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.every` iterating an object') - .add(buildName, '\ - lodash.every(object, function(num) {\ - return num + "";\ - })' - ) - .add(otherName, '\ - _.every(object, function(num) {\ - return num + "";\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.extend`') - .add(buildName, '\ - lodash.extend({}, object)' - ) - .add(otherName, '\ - _.extend({}, object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.filter` iterating an array') - .add(buildName, '\ - lodash.filter(numbers, function(num) {\ - return num % 2;\ - })' - ) - .add(otherName, '\ - _.filter(numbers, function(num) {\ - return num % 2;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.filter` iterating an array with `thisArg` (slow path)') - .add(buildName, '\ - lodash.filter(numbers, function(num, index) {\ - return this["key" + index] % 2;\ - }, object)' - ) - .add(otherName, '\ - _.filter(numbers, function(num, index) {\ - return this["key" + index] % 2;\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.filter` iterating an object') - .add(buildName, '\ - lodash.filter(object, function(num) {\ - return num % 2\ - })' - ) - .add(otherName, '\ - _.filter(object, function(num) {\ - return num % 2\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.find` iterating an array') - .add(buildName, '\ - lodash.find(numbers, function(num) {\ - return num === 19;\ - })' - ) - .add(otherName, '\ - _.find(numbers, function(num) {\ - return num === 19;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.find` iterating an object') - .add(buildName, '\ - lodash.find(object, function(value, key) {\ - return /\D9$/.test(key);\ - })' - ) - .add(otherName, '\ - _.find(object, function(value, key) {\ - return /\D9$/.test(key);\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.find` with `properties`') - .add(buildName, '\ - lodash.find(objects, { "num": 9 });' - ) - .add(otherName, '\ - _.findWhere(objects, { "num": 9 });' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.flatten`') - .add(buildName, '\ - lodash.flatten(nestedNumbers)' - ) - .add(otherName, '\ - _.flatten(nestedNumbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.flatten` with `shallow`') - .add(buildName, '\ - lodash.flatten(nestedNumbers, true)' - ) - .add(otherName, '\ - _.flatten(nestedNumbers, true)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.functions`') - .add(buildName, '\ - lodash.functions(lodash)' - ) - .add(otherName, '\ - _.functions(lodash)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.groupBy` with `callback` iterating an array') - .add(buildName, '\ - lodash.groupBy(numbers, function(num) { return num >> 1; })' - ) - .add(otherName, '\ - _.groupBy(numbers, function(num) { return num >> 1; })' - ) - ); - - suites.push( - Benchmark.Suite('`_.groupBy` with `property` name iterating an array') - .add(buildName, { - 'fn': 'lodash.groupBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.groupBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.groupBy` with `callback` iterating an object') - .add(buildName, { - 'fn': 'lodash.groupBy(wordToNumber, function(num) { return num >> 1; })', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.groupBy(wordToNumber, function(num) { return num >> 1; })', - 'teardown': 'function countBy(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.indexOf`') - .add(buildName, '\ - lodash.indexOf(numbers, 9)' - ) - .add(otherName, '\ - _.indexOf(numbers, 9)' - ) - ); - - suites.push( - Benchmark.Suite('`_.indexOf` with `isSorted`') - .add(buildName, '\ - lodash.indexOf(numbers, 19, true)' - ) - .add(otherName, '\ - _.indexOf(numbers, 19, true)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.intersection`') - .add(buildName, '\ - lodash.intersection(numbers, twoNumbers, fourNumbers)' - ) - .add(otherName, '\ - _.intersection(numbers, twoNumbers, fourNumbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.intersection` iterating 100 elements') - .add(buildName, { - 'fn': 'lodash.intersection(hundredValues, hundredValues2)', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.intersection(hundredValues, hundredValues2)', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.invert`') - .add(buildName, '\ - lodash.invert(object)' - ) - .add(otherName, '\ - _.invert(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.invoke` iterating an array') - .add(buildName, '\ - lodash.invoke(numbers, "toFixed", "2")' - ) - .add(otherName, '\ - _.invoke(numbers, "toFixed", "2")' - ) - ); - - suites.push( - Benchmark.Suite('`_.invoke` with a function for `methodName` iterating an array') - .add(buildName, '\ - lodash.invoke(numbers, String.prototype.split, "")' - ) - .add(otherName, '\ - _.invoke(numbers, String.prototype.split, "")' - ) - ); - - suites.push( - Benchmark.Suite('`_.invoke` iterating an object') - .add(buildName, '\ - lodash.invoke(object, "toFixed", "2")' - ) - .add(otherName, '\ - _.invoke(object, "toFixed", "2")' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.isEqual` comparing primitives and objects (edge case)') - .add(buildName, { - 'fn': 'lodash.isEqual(objectOfPrimitives, objectOfObjects)', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '_.isEqual(objectOfPrimitives, objectOfObjects)', - 'teardown': 'function isEqual(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.isEqual` comparing arrays') - .add(buildName, { - 'fn': '\ - lodash.isEqual(numbers, numbers2);\ - lodash.isEqual(twoNumbers, twoNumbers2);', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '\ - _.isEqual(numbers, numbers2);\ - _.isEqual(twoNumbers, twoNumbers2);', - 'teardown': 'function isEqual(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.isEqual` comparing nested arrays') - .add(buildName, { - 'fn': '\ - lodash.isEqual(nestedNumbers, nestedNumbers2);\ - lodash.isEqual(nestedNumbers2, nestedNumbers3);', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '\ - _.isEqual(nestedNumbers, nestedNumbers2);\ - _.isEqual(nestedNumbers2, nestedNumbers3);', - 'teardown': 'function isEqual(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.isEqual` comparing arrays of objects') - .add(buildName, { - 'fn': '\ - lodash.isEqual(objects, objects2);\ - lodash.isEqual(simpleObjects, simpleObjects2);', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '\ - _.isEqual(objects, objects2);\ - _.isEqual(simpleObjects, simpleObjects2);', - 'teardown': 'function isEqual(){}' - }) - ); - - suites.push( - Benchmark.Suite('`_.isEqual` comparing objects') - .add(buildName, { - 'fn': '\ - lodash.isEqual(object, object2);\ - lodash.isEqual(simpleObject, simpleObject2);', - 'teardown': 'function isEqual(){}' - }) - .add(otherName, { - 'fn': '\ - _.isEqual(object, object2);\ - _.isEqual(simpleObject, simpleObject2);', - 'teardown': 'function isEqual(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.isArguments`, `_.isDate`, `_.isFunction`, `_.isNumber`, `_.isRegExp`') - .add(buildName, '\ - lodash.isArguments(arguments);\ - lodash.isArguments(object);\ - lodash.isDate(date);\ - lodash.isDate(object);\ - lodash.isFunction(lodash);\ - lodash.isFunction(object);\ - lodash.isNumber(1);\ - lodash.isNumber(object);\ - lodash.isRegExp(regexp);\ - lodash.isRegExp(object);' - ) - .add(otherName, '\ - _.isArguments(arguments);\ - _.isArguments(object);\ - _.isDate(date);\ - _.isDate(object);\ - _.isFunction(_);\ - _.isFunction(object);\ - _.isNumber(1);\ - _.isNumber(object);\ - _.isRegExp(regexp);\ - _.isRegExp(object);' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.keys` (uses native `Object.keys` if available)') - .add(buildName, '\ - lodash.keys(object)' - ) - .add(otherName, '\ - _.keys(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.lastIndexOf`') - .add(buildName, '\ - lodash.lastIndexOf(numbers, 9)' - ) - .add(otherName, '\ - _.lastIndexOf(numbers, 9)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.map` iterating an array') - .add(buildName, '\ - lodash.map(objects, function(value) {\ - return value.num;\ - })' - ) - .add(otherName, '\ - _.map(objects, function(value) {\ - return value.num;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.map` with `thisArg` iterating an array (slow path)') - .add(buildName, '\ - lodash.map(objects, function(value, index) {\ - return this["key" + index] + value.num;\ - }, object)' - ) - .add(otherName, '\ - _.map(objects, function(value, index) {\ - return this["key" + index] + value.num;\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.map` iterating an object') - .add(buildName, '\ - lodash.map(object, function(value) {\ - return value;\ - })' - ) - .add(otherName, '\ - _.map(object, function(value) {\ - return value;\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.max`') - .add(buildName, '\ - lodash.max(numbers)' - ) - .add(otherName, '\ - _.max(numbers)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.min`') - .add(buildName, '\ - lodash.min(numbers)' - ) - .add(otherName, '\ - _.min(numbers)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.omit` iterating 20 properties, omitting 2 keys') - .add(buildName, '\ - lodash.omit(object, "key6", "key13")' - ) - .add(otherName, '\ - _.omit(object, "key6", "key13")' - ) - ); - - suites.push( - Benchmark.Suite('`_.omit` iterating 40 properties, omitting 20 keys') - .add(buildName, { - 'fn': 'lodash.omit(wordToNumber, words)', - 'teardown': 'function omit(){}' - }) - .add(otherName, { - 'fn': 'result = _.omit(wordToNumber, words)', - 'teardown': 'function omit(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.pairs`') - .add(buildName, '\ - lodash.pairs(object)' - ) - .add(otherName, '\ - _.pairs(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.pick`') - .add(buildName, '\ - lodash.pick(object, "key6", "key13")' - ) - .add(otherName, '\ - _.pick(object, "key6", "key13")' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.pluck`') - .add(buildName, '\ - lodash.pluck(objects, "num")' - ) - .add(otherName, '\ - _.pluck(objects, "num")' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.reduce` iterating an array') - .add(buildName, '\ - lodash.reduce(numbers, function(result, value, index) {\ - result[index] = value;\ - return result;\ - }, {});' - ) - .add(otherName, '\ - _.reduce(numbers, function(result, value, index) {\ - result[index] = value;\ - return result;\ - }, {});' - ) - ); - - suites.push( - Benchmark.Suite('`_.reduce` iterating an object') - .add(buildName, '\ - lodash.reduce(object, function(result, value, key) {\ - result.push([key, value]);\ - return result;\ - }, []);' - ) - .add(otherName, '\ - _.reduce(object, function(result, value, key) {\ - result.push([key, value]);\ - return result;\ - }, []);' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.reduceRight` iterating an array') - .add(buildName, '\ - lodash.reduceRight(numbers, function(result, value, index) {\ - result[index] = value;\ - return result;\ - }, {});' - ) - .add(otherName, '\ - _.reduceRight(numbers, function(result, value, index) {\ - result[index] = value;\ - return result;\ - }, {});' - ) - ); - - suites.push( - Benchmark.Suite('`_.reduceRight` iterating an object') - .add(buildName, '\ - lodash.reduceRight(object, function(result, value, key) {\ - result.push([key, value]);\ - return result;\ - }, []);' - ) - .add(otherName, '\ - _.reduceRight(object, function(result, value, key) {\ - result.push([key, value]);\ - return result;\ - }, []);' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.reject` iterating an array') - .add(buildName, '\ - lodash.reject(numbers, function(num) {\ - return num % 2;\ - })' - ) - .add(otherName, '\ - _.reject(numbers, function(num) {\ - return num % 2;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.reject` iterating an array with `thisArg` (slow path)') - .add(buildName, '\ - lodash.reject(numbers, function(num, index) {\ - return this["key" + index] % 2;\ - }, object)' - ) - .add(otherName, '\ - _.reject(numbers, function(num, index) {\ - return this["key" + index] % 2;\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.reject` iterating an object') - .add(buildName, '\ - lodash.reject(object, function(num) {\ - return num % 2\ - })' - ) - .add(otherName, '\ - _.reject(object, function(num) {\ - return num % 2\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.shuffle`') - .add(buildName, '\ - lodash.shuffle(numbers)' - ) - .add(otherName, '\ - _.shuffle(numbers)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.size` with an object') - .add(buildName, '\ - lodash.size(object)' - ) - .add(otherName, '\ - _.size(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.some` iterating an array') - .add(buildName, '\ - lodash.some(numbers, function(num) {\ - return num == 19;\ - })' - ) - .add(otherName, '\ - _.some(numbers, function(num) {\ - return num == 19;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.some` with `thisArg` iterating an array (slow path)') - .add(buildName, '\ - lodash.some(objects, function(value, index) {\ - return this["key" + index] == 19;\ - }, object)' - ) - .add(otherName, '\ - _.some(objects, function(value, index) {\ - return this["key" + index] == 19;\ - }, object)' - ) - ); - - suites.push( - Benchmark.Suite('`_.some` iterating an object') - .add(buildName, '\ - lodash.some(object, function(num) {\ - return num == 19;\ - })' - ) - .add(otherName, '\ - _.some(object, function(num) {\ - return num == 19;\ - })' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.sortBy` with `callback`') - .add(buildName, '\ - lodash.sortBy(numbers, function(num) { return Math.sin(num); })' - ) - .add(otherName, '\ - _.sortBy(numbers, function(num) { return Math.sin(num); })' - ) - ); - - suites.push( - Benchmark.Suite('`_.sortBy` with `callback` and `thisArg` (slow path)') - .add(buildName, '\ - lodash.sortBy(numbers, function(num) { return this.sin(num); }, Math)' - ) - .add(otherName, '\ - _.sortBy(numbers, function(num) { return this.sin(num); }, Math)' - ) - ); - - suites.push( - Benchmark.Suite('`_.sortBy` with `property` name') - .add(buildName, { - 'fn': 'lodash.sortBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '_.sortBy(words, "length")', - 'teardown': 'function countBy(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.sortedIndex`') - .add(buildName, '\ - lodash.sortedIndex(numbers, 25)' - ) - .add(otherName, '\ - _.sortedIndex(numbers, 25)' - ) - ); - - suites.push( - Benchmark.Suite('`_.sortedIndex` with `callback`') - .add(buildName, { - 'fn': '\ - lodash.sortedIndex(words, "twenty-five", function(value) {\ - return wordToNumber[value];\ - })', - 'teardown': 'function countBy(){}' - }) - .add(otherName, { - 'fn': '\ - _.sortedIndex(words, "twenty-five", function(value) {\ - return wordToNumber[value];\ - })', - 'teardown': 'function countBy(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.template` (slow path)') - .add(buildName, { - 'fn': 'lodash.template(tpl, tplData)', - 'teardown': 'function template(){}' - }) - .add(otherName, { - 'fn': '_.template(tpl, tplData)', - 'teardown': 'function template(){}' - }) - ); - - suites.push( - Benchmark.Suite('compiled template') - .add(buildName, { - 'fn': 'lodashTpl(tplData)', - 'teardown': 'function template(){}' - }) - .add(otherName, { - 'fn': '_tpl(tplData)', - 'teardown': 'function template(){}' - }) - ); - - suites.push( - Benchmark.Suite('compiled template without a with-statement') - .add(buildName, { - 'fn': 'lodashTplVerbose(tplData)', - 'teardown': 'function template(){}' - }) - .add(otherName, { - 'fn': '_tplVerbose(tplData)', - 'teardown': 'function template(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.times`') - .add(buildName, '\ - var result = [];\ - lodash.times(limit, function(n) { result.push(n); })' - ) - .add(otherName, '\ - var result = [];\ - _.times(limit, function(n) { result.push(n); })' - ) - ); - - suites.push( - Benchmark.Suite('`_.times` with `thisArg`') - .add(buildName, '\ - var result = [];\ - lodash.times(limit, function(n) { result.push(this.sin(n)); }, Math)' - ) - .add(otherName, '\ - var result = [];\ - _.times(limit, function(n) { result.push(this.sin(n)); }, Math)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.toArray` with an array (edge case)') - .add(buildName, '\ - lodash.toArray(numbers)' - ) - .add(otherName, '\ - _.toArray(numbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.toArray` with an object') - .add(buildName, '\ - lodash.toArray(object)' - ) - .add(otherName, '\ - _.toArray(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.union`') - .add(buildName, '\ - lodash.union(numbers, twoNumbers, fourNumbers)' - ) - .add(otherName, '\ - _.union(numbers, twoNumbers, fourNumbers)' - ) - ); - - suites.push( - Benchmark.Suite('`_.union` iterating an array of 75 elements') - .add(buildName, { - 'fn': 'lodash.union(fiftyValues, twentyFiveValues2);', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.union(fiftyValues, twentyFiveValues2);', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.uniq`') - .add(buildName, '\ - lodash.uniq(numbers.concat(twoNumbers, fourNumbers))' - ) - .add(otherName, '\ - _.uniq(numbers.concat(twoNumbers, fourNumbers))' - ) - ); - - suites.push( - Benchmark.Suite('`_.uniq` with `callback`') - .add(buildName, '\ - lodash.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\ - return num % 2;\ - });' - ) - .add(otherName, '\ - _.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\ - return num % 2;\ - })' - ) - ); - - suites.push( - Benchmark.Suite('`_.uniq` iterating an array of 75 elements') - .add(buildName, { - 'fn': 'lodash.uniq(fiftyValues.concat(twentyFiveValues2));', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.uniq(fiftyValues.concat(twentyFiveValues2));', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.values`') - .add(buildName, '\ - lodash.values(object)' - ) - .add(otherName, '\ - _.values(object)' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.where`') - .add(buildName, '\ - lodash.where(objects, { "num": 9 });' - ) - .add(otherName, '\ - _.where(objects, { "num": 9 });' - ) - ); - - /*--------------------------------------------------------------------------*/ - - suites.push( - Benchmark.Suite('`_.without`') - .add(buildName, '\ - lodash.without(numbers, 9, 12, 14, 15)' - ) - .add(otherName, '\ - _.without(numbers, 9, 12, 14, 15)' - ) - ); - - suites.push( - Benchmark.Suite('`_.without` iterating an array of 30 elements') - .add(buildName, { - 'fn': 'lodash.without.apply(lodash, [thirtyValues].concat(thirtyValues2));', - 'teardown': 'function multiArrays(){}' - }) - .add(otherName, { - 'fn': '_.without.apply(_, [thirtyValues].concat(thirtyValues2));', - 'teardown': 'function multiArrays(){}' - }) - ); - - /*--------------------------------------------------------------------------*/ - - if (Benchmark.platform + '') { - log(Benchmark.platform); - } - - // in the browser, expose `run` to be called later - if (window.document && !window.phantom) { - window.run = run; - } else { - run(); - } -}(typeof global == 'object' && global || this)); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/a.jst b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/a.jst deleted file mode 100644 index cca541d..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/a.jst +++ /dev/null @@ -1,3 +0,0 @@ -
                        -<% _.forEach(people, function(name) { %>
                      • <%- name %>
                      • <% }); %> -
                      \ No newline at end of file diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/b.jst b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/b.jst deleted file mode 100644 index cad081d..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/b.jst +++ /dev/null @@ -1 +0,0 @@ -<% print("Hello " + epithet); %>. \ No newline at end of file diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/c.jst b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/c.jst deleted file mode 100644 index f926799..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/c.jst +++ /dev/null @@ -1 +0,0 @@ -Hello ${ name }! \ No newline at end of file diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/d.tpl b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/d.tpl deleted file mode 100644 index c7a43bc..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/template/d.tpl +++ /dev/null @@ -1 +0,0 @@ -Hello {{ name }}! \ No newline at end of file diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/test-build.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/test-build.js deleted file mode 100644 index 759d98e..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/test-build.js +++ /dev/null @@ -1,1324 +0,0 @@ -#!/usr/bin/env node -;(function(undefined) { - 'use strict'; - - /** Load modules */ - var fs = require('fs'), - path = require('path'), - vm = require('vm'), - build = require('../build.js'), - minify = require('../build/minify'), - _ = require('../lodash.js'); - - /** The unit testing framework */ - var QUnit = ( - global.addEventListener || (global.addEventListener = Function.prototype), - global.QUnit = require('../vendor/qunit/qunit/qunit.js'), - require('../vendor/qunit-clib/qunit-clib.js'), - global.addEventListener === Function.prototype && delete global.addEventListener, - global.QUnit - ); - - /** The time limit for the tests to run (milliseconds) */ - var timeLimit = process.argv.reduce(function(result, value, index) { - if (/--time-limit/.test(value)) { - return parseInt(process.argv[index + 1].replace(/(\d+h)?(\d+m)?(\d+s)?/, function(match, h, m, s) { - return ((parseInt(h) || 0) * 3600000) + - ((parseInt(m) || 0) * 60000) + - ((parseInt(s) || 0) * 1000); - })) || result; - } - return result; - }, 0); - - /** Used to associate aliases with their real names */ - var aliasToRealMap = { - 'all': 'every', - 'any': 'some', - 'collect': 'map', - 'detect': 'find', - 'drop': 'rest', - 'each': 'forEach', - 'extend': 'assign', - 'foldl': 'reduce', - 'foldr': 'reduceRight', - 'head': 'first', - 'include': 'contains', - 'inject': 'reduce', - 'methods': 'functions', - 'select': 'filter', - 'tail': 'rest', - 'take': 'first', - 'unique': 'uniq' - }; - - /** Used to associate real names with their aliases */ - var realToAliasMap = { - 'assign': ['extend'], - 'contains': ['include'], - 'every': ['all'], - 'filter': ['select'], - 'find': ['detect'], - 'first': ['head', 'take'], - 'forEach': ['each'], - 'functions': ['methods'], - 'map': ['collect'], - 'reduce': ['foldl', 'inject'], - 'reduceRight': ['foldr'], - 'rest': ['drop', 'tail'], - 'some': ['any'], - 'uniq': ['unique'] - }; - - /** List of all Lo-Dash methods */ - var allMethods = _.functions(_) - .filter(function(methodName) { return !/^_/.test(methodName); }) - .concat('chain') - .sort(); - - /** List of "Arrays" category methods */ - var arraysMethods = [ - 'compact', - 'difference', - 'drop', - 'first', - 'flatten', - 'head', - 'indexOf', - 'initial', - 'intersection', - 'last', - 'lastIndexOf', - 'object', - 'range', - 'rest', - 'sortedIndex', - 'tail', - 'take', - 'union', - 'uniq', - 'unique', - 'without', - 'zip' - ]; - - /** List of "Chaining" category methods */ - var chainingMethods = [ - 'mixin', - 'tap', - 'value' - ]; - - /** List of "Collections" category methods */ - var collectionsMethods = [ - 'all', - 'any', - 'at', - 'collect', - 'contains', - 'countBy', - 'detect', - 'each', - 'every', - 'filter', - 'find', - 'foldl', - 'foldr', - 'forEach', - 'groupBy', - 'include', - 'inject', - 'invoke', - 'map', - 'max', - 'min', - 'pluck', - 'reduce', - 'reduceRight', - 'reject', - 'select', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'toArray', - 'where' - ]; - - /** List of "Functions" category methods */ - var functionsMethods = [ - 'after', - 'bind', - 'bindAll', - 'bindKey', - 'compose', - 'debounce', - 'defer', - 'delay', - 'memoize', - 'once', - 'partial', - 'partialRight', - 'throttle', - 'wrap' - ]; - - /** List of "Objects" category methods */ - var objectsMethods = [ - 'assign', - 'clone', - 'cloneDeep', - 'defaults', - 'extend', - 'forIn', - 'forOwn', - 'functions', - 'has', - 'invert', - 'isArguments', - 'isArray', - 'isBoolean', - 'isDate', - 'isElement', - 'isEmpty', - 'isEqual', - 'isFinite', - 'isFunction', - 'isNaN', - 'isNull', - 'isNumber', - 'isObject', - 'isPlainObject', - 'isRegExp', - 'isString', - 'isUndefined', - 'keys', - 'methods', - 'merge', - 'omit', - 'pairs', - 'pick', - 'values' - ]; - - /** List of "Utilities" category methods */ - var utilityMethods = [ - 'escape', - 'identity', - 'noConflict', - 'random', - 'result', - 'template', - 'times', - 'unescape', - 'uniqueId' - ]; - - /** List of Backbone's Lo-Dash dependencies */ - var backboneDependencies = [ - 'bind', - 'bindAll', - 'chain', - 'clone', - 'contains', - 'countBy', - 'defaults', - 'escape', - 'every', - 'extend', - 'filter', - 'find', - 'first', - 'forEach', - 'groupBy', - 'has', - 'indexOf', - 'initial', - 'invoke', - 'isArray', - 'isEmpty', - 'isEqual', - 'isFunction', - 'isObject', - 'isRegExp', - 'isString', - 'keys', - 'last', - 'lastIndexOf', - 'map', - 'max', - 'min', - 'mixin', - 'once', - 'pick', - 'reduce', - 'reduceRight', - 'reject', - 'rest', - 'result', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'sortedIndex', - 'toArray', - 'uniqueId', - 'value', - 'without' - ]; - - /** List of methods used by Underscore */ - var underscoreMethods = _.without.apply(_, [allMethods].concat([ - 'at', - 'bindKey', - 'cloneDeep', - 'forIn', - 'forOwn', - 'isPlainObject', - 'merge', - 'partialRight' - ])); - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a context object to use with `vm.runInContext`. - * - * @private - * @returns {Object} Returns a new context object. - */ - function createContext() { - return vm.createContext({ - 'clearTimeout': clearTimeout, - 'setTimeout': setTimeout - }); - } - - /** - * Expands a list of method names to include real and alias names. - * - * @private - * @param {Array} methodNames The array of method names to expand. - * @returns {Array} Returns a new array of expanded method names. - */ - function expandMethodNames(methodNames) { - return methodNames.reduce(function(result, methodName) { - var realName = getRealName(methodName); - result.push.apply(result, [realName].concat(getAliases(realName))); - return result; - }, []); - } - - /** - * Gets the aliases associated with a given function name. - * - * @private - * @param {String} funcName The name of the function to get aliases for. - * @returns {Array} Returns an array of aliases. - */ - function getAliases(funcName) { - return realToAliasMap[funcName] || []; - } - - /** - * Gets the names of methods belonging to the given `category`. - * - * @private - * @param {String} category The category to filter by. - * @returns {Array} Returns a new array of method names belonging to the given category. - */ - function getMethodsByCategory(category) { - switch (category) { - case 'Arrays': - return arraysMethods.slice(); - case 'Chaining': - return chainingMethods.slice(); - case 'Collections': - return collectionsMethods.slice(); - case 'Functions': - return functionsMethods.slice(); - case 'Objects': - return objectsMethods.slice(); - case 'Utilities': - return utilityMethods.slice(); - } - return []; - } - - /** - * Gets the real name, not alias, of a given function name. - * - * @private - * @param {String} funcName The name of the function to resolve. - * @returns {String} Returns the real name. - */ - function getRealName(funcName) { - return aliasToRealMap[funcName] || funcName; - } - - /** - * Tests if a given method on the `lodash` object can be called successfully. - * - * @private - * @param {Object} lodash The built Lo-Dash object. - * @param {String} methodName The name of the Lo-Dash method to test. - * @param {String} message The unit test message. - */ - function testMethod(lodash, methodName, message) { - var pass = true, - array = [['a', 1], ['b', 2], ['c', 3]], - object = { 'a': 1, 'b': 2, 'c': 3 }, - noop = function() {}, - string = 'abc', - template = '<%= a %>', - func = lodash[methodName]; - - try { - if (arraysMethods.indexOf(methodName) > -1) { - if (/(?:indexOf|sortedIndex|without)$/i.test(methodName)) { - func(array, string); - } else if (/^(?:difference|intersection|union|uniq|zip)/.test(methodName)) { - func(array, array); - } else if (methodName == 'range') { - func(2, 4); - } else { - func(array); - } - } - else if (chainingMethods.indexOf(methodName) > -1) { - if (methodName == 'chain') { - lodash.chain(array); - lodash(array).chain(); - } - else if (methodName == 'mixin') { - lodash.mixin({}); - } - else { - lodash(array)[methodName](noop); - } - } - else if (collectionsMethods.indexOf(methodName) > -1) { - if (/^(?:count|group|sort)By$/.test(methodName)) { - func(array, noop); - func(array, string); - func(object, noop); - func(object, string); - } - else if (/^(?:size|toArray)$/.test(methodName)) { - func(array); - func(object); - } - else if (methodName == 'at') { - func(array, 0, 2); - func(object, 'a', 'c'); - } - else if (methodName == 'invoke') { - func(array, 'slice'); - func(object, 'toFixed'); - } - else if (methodName == 'where') { - func(array, object); - func(object, object); - } - else { - func(array, noop, object); - func(object, noop, object); - } - } - else if (functionsMethods.indexOf(methodName) > -1) { - if (methodName == 'after') { - func(1, noop); - } else if (methodName == 'bindAll') { - func({ 'noop': noop }); - } else if (methodName == 'bindKey') { - func(lodash, 'identity', array, string); - } else if (/^(?:bind|partial(?:Right)?)$/.test(methodName)) { - func(noop, object, array, string); - } else if (/^(?:compose|memoize|wrap)$/.test(methodName)) { - func(noop, noop); - } else if (/^(?:debounce|throttle)$/.test(methodName)) { - func(noop, 100); - } else { - func(noop); - } - } - else if (objectsMethods.indexOf(methodName) > -1) { - if (methodName == 'clone') { - func(object); - func(object, true); - } - else if (/^(?:defaults|extend|merge)$/.test(methodName)) { - func({}, object); - } else if (/^(?:forIn|forOwn)$/.test(methodName)) { - func(object, noop); - } else if (/^(?:omit|pick)$/.test(methodName)) { - func(object, 'b'); - } else if (methodName == 'has') { - func(object, string); - } else { - func(object); - } - } - else if (utilityMethods.indexOf(methodName) > -1) { - if (methodName == 'result') { - func(object, 'b'); - } else if (methodName == 'template') { - func(template, object); - func(template, null, { 'imports': object })(object); - } else if (methodName == 'times') { - func(2, noop, object); - } else { - func(string, object); - } - } - } - catch(e) { - console.log(e); - pass = false; - } - ok(pass, '_.' + methodName + ': ' + message); - } - - /*--------------------------------------------------------------------------*/ - - QUnit.module('minified AMD snippet'); - - (function() { - var start = _.once(QUnit.start); - - asyncTest('`lodash`', function() { - build(['-s'], function(data) { - // used by r.js build optimizer - var defineHasRegExp = /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g, - basename = path.basename(data.outputPath, '.js'); - - ok(!!defineHasRegExp.exec(data.source), basename); - start(); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('template builds'); - - (function() { - var templatePath = __dirname + '/template'; - - asyncTest('`lodash template=*.jst`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'template=' + templatePath + '/*.jst'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - var object = { - 'a': { 'people': ['moe', 'larry', 'curly'] }, - 'b': { 'epithet': 'stooge' }, - 'c': { 'name': 'ES6' } - }; - - context._ = _; - vm.runInContext(data.source, context); - - equal(_.templates.a(object.a).replace(/[\r\n]+/g, ''), '
                      • moe
                      • larry
                      • curly
                      ', basename); - equal(_.templates.b(object.b), 'Hello stooge.', basename); - equal(_.templates.c(object.c), 'Hello ES6!', basename); - delete _.templates; - start(); - }); - }); - - var commands = [ - '', - 'moduleId=underscore' - ]; - - commands.forEach(function(command) { - var expectedId = /underscore/.test(command) ? 'underscore' : 'lodash'; - - asyncTest('`lodash template=*.jst exports=amd' + (command ? ' ' + command : '') + '`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'template=' + templatePath + '/*.jst', 'exports=amd'].concat(command || []), function(data) { - var moduleId, - basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - context.define = function(requires, factory) { - factory(_); - moduleId = requires[0]; - }; - - context.define.amd = {}; - vm.runInContext(data.source, context); - - equal(moduleId, expectedId, basename); - ok('a' in _.templates && 'b' in _.templates, basename); - equal(_.templates.a({ 'people': ['moe', 'larry'] }), '
                        \n
                      • moe
                      • larry
                      • \n
                      ', basename); - - delete _.templates; - start(); - }); - }); - - asyncTest('`lodash settings=...' + (command ? ' ' + command : '') + '`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'template=' + templatePath + '/*.tpl', 'settings={interpolate:/{{([\\s\\S]+?)}}/}'].concat(command || []), function(data) { - var moduleId, - basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - var object = { - 'd': { 'name': 'Mustache' } - }; - - context.define = function(requires, factory) { - factory(_); - moduleId = requires[0]; - }; - - context.define.amd = {}; - vm.runInContext(data.source, context); - - equal(moduleId, expectedId, basename); - equal(_.templates.d(object.d), 'Hello Mustache!', basename); - delete _.templates; - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('independent builds'); - - (function() { - var reCustom = /Custom Build/, - reLicense = /^\/\**\s+\* @license[\s\S]+?\*\/\n/; - - asyncTest('debug only', function() { - var start = _.once(QUnit.start); - build(['-d', '-s'], function(data) { - equal(path.basename(data.outputPath, '.js'), 'lodash'); - start(); - }); - }); - - asyncTest('debug custom', function() { - var start = _.once(QUnit.start); - build(['-d', '-s', 'backbone'], function(data) { - equal(path.basename(data.outputPath, '.js'), 'lodash.custom'); - - var comment = data.source.match(reLicense); - ok(reCustom.test(comment)); - start(); - }); - }); - - asyncTest('minified only', function() { - var start = _.once(QUnit.start); - build(['-m', '-s'], function(data) { - equal(path.basename(data.outputPath, '.js'), 'lodash.min'); - start(); - }); - }); - - asyncTest('minified custom', function() { - var start = _.once(QUnit.start); - build(['-m', '-s', 'backbone'], function(data) { - equal(path.basename(data.outputPath, '.js'), 'lodash.custom.min'); - - var comment = data.source.match(reLicense); - ok(reCustom.test(comment)); - start(); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('source maps'); - - (function() { - var mapCommands = [ - '-p', - '-p custom.map', - '--source-map', - '--source-map custom.map' - ]; - - var outputCommands = [ - '', - '-o foo.js', - '-m -o bar.js' - ]; - - mapCommands.forEach(function(mapCommand) { - outputCommands.forEach(function(outputCommand) { - asyncTest('`lodash ' + mapCommand + (outputCommand ? ' ' + outputCommand : '') + '`', function() { - var callback = _.once(function(data) { - var basename = path.basename(data.outputPath, '.js'), - comment = (/(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)$/.exec(data.source) || [])[0], - sources = /foo.js/.test(outputCommand) ? ['foo.js'] : ['lodash' + (outputCommand.length ? '' : '.custom') + '.js'], - sourceMap = JSON.parse(data.sourceMap), - sourceMapURL = (/\w+(?=\.map$)/.exec(mapCommand) || [basename])[0]; - - ok(RegExp('/\\*\\n//@ sourceMappingURL=' + sourceMapURL + '.map\\n\\*/').test(comment), basename); - equal(sourceMap.file, basename + '.js', basename); - deepEqual(sourceMap.sources, sources, basename); - - QUnit.start(); - }); - - outputCommand = outputCommand ? outputCommand.split(' ') : []; - if (outputCommand.indexOf('-m') < 0) { - callback = _.after(2, callback); - } - build(['-s'].concat(mapCommand.split(' '), outputCommand), callback); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('strict modifier'); - - (function() { - var object = Object.freeze({ - 'a': _.identity, - 'b': undefined - }); - - var modes = [ - 'non-strict', - 'strict' - ]; - - modes.forEach(function(strictMode, index) { - asyncTest(strictMode + ' should ' + (index ? 'error': 'silently fail') + ' attempting to overwrite read-only properties', function() { - var commands = ['-s', 'include=bindAll,defaults,extend'], - start = _.after(2, _.once(QUnit.start)); - - if (index) { - commands.push('strict'); - } - build(commands, function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - var actual = _.every([ - function() { lodash.bindAll(object); }, - function() { lodash.extend(object, { 'a': 1 }); }, - function() { lodash.defaults(object, { 'b': 2 }); } - ], function(fn) { - var pass = !index; - try { - fn(); - } catch(e) { - pass = !!index; - } - return pass; - }); - - ok(actual, basename); - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('underscore chaining methods'); - - (function() { - var commands = [ - 'backbone', - 'underscore' - ]; - - commands.forEach(function(command) { - asyncTest('`lodash ' + command +'`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', command], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - ok(lodash.chain(1) instanceof lodash, '_.chain: ' + basename); - ok(lodash(1).chain() instanceof lodash, '_#chain: ' + basename); - - var wrapped = lodash(1); - strictEqual(wrapped.identity(), 1, '_(...) wrapped values are not chainable by default: ' + basename); - equal(String(wrapped) === '1', false, '_#toString should not be implemented: ' + basename); - equal(Number(wrapped) === 1 , false, '_#valueOf should not be implemented: ' + basename); - - wrapped.chain(); - ok(wrapped.has('x') instanceof lodash, '_#has returns wrapped values when chaining: ' + basename); - ok(wrapped.join() instanceof lodash, '_#join returns wrapped values when chaining: ' + basename); - - wrapped = lodash([1, 2, 3]); - ok(wrapped.pop() instanceof lodash, '_#pop returns wrapped values: ' + basename); - ok(wrapped.shift() instanceof lodash, '_#shift returns wrapped values: ' + basename); - deepEqual(wrapped.splice(0, 0).value(), [2], '_#splice returns wrapper: ' + basename); - - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('underscore modifier'); - - (function() { - asyncTest('modified methods should work correctly', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore'], function(data) { - var last, - array = [{ 'a': 1, 'b': 2 }, { 'a': 2, 'b': 2 }], - basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - var object = { - 'fn': lodash.bind(function(foo) { - return foo + this.bar; - }, { 'bar': 1 }, 1) - }; - - equal(object.fn(), 2, '_.bind: ' + basename); - - var actual = lodash.clone('a', function() { - return this.a; - }, { 'a': 'A' }); - - equal(actual, 'a', '_.clone should ignore `callback` and `thisArg`: ' + basename); - strictEqual(lodash.clone(array, true)[0], array[0], '_.clone should ignore `deep`: ' + basename); - - strictEqual(lodash.contains({ 'a': 1, 'b': 2 }, 1), true, '_.contains should work with objects: ' + basename); - strictEqual(lodash.contains([1, 2, 3], 1, 2), true, '_.contains should ignore `fromIndex`: ' + basename); - strictEqual(lodash.every([true, false, true]), false, '_.every: ' + basename); - - function Foo() {} - Foo.prototype = { 'a': 1 }; - - actual = lodash.defaults({ 'a': null }, { 'a': 1 }); - strictEqual(actual.a, 1, '_.defaults should overwrite `null` values: ' + basename); - - deepEqual(lodash.defaults({}, new Foo), Foo.prototype, '_.defaults should assign inherited `source` properties: ' + basename); - deepEqual(lodash.extend({}, new Foo), Foo.prototype, '_.extend should assign inherited `source` properties: ' + basename); - - actual = lodash.extend({}, { 'a': 0 }, function(a, b) { - return this[b]; - }, [2]); - - strictEqual(actual.a, 0, '_.extend should ignore `callback` and `thisArg`: ' + basename); - - actual = lodash.find(array, function(value) { - return 'a' in value; - }); - - equal(actual, _.first(array), '_.find: ' + basename); - - actual = lodash.forEach(array, function(value) { - last = value; - return false; - }); - - equal(last, _.last(array), '_.forEach should not exit early: ' + basename); - equal(actual, undefined, '_.forEach should return `undefined`: ' + basename); - - object = { 'length': 0, 'splice': Array.prototype.splice }; - equal(lodash.isEmpty(object), false, '_.isEmpty should return `false` for jQuery/MooTools DOM query collections: ' + basename); - - object = { 'a': 1, 'b': 2, 'c': 3 }; - equal(lodash.isEqual(object, { 'a': 1, 'b': 0, 'c': 3 }), false, '_.isEqual: ' + basename); - - actual = lodash.isEqual('a', 'b', function(a, b) { - return this[a] == this[b]; - }, { 'a': 1, 'b': 1 }); - - strictEqual(actual, false, '_.isEqual should ignore `callback` and `thisArg`: ' + basename); - - equal(lodash.max('abc'), -Infinity, '_.max should return `-Infinity` for strings: ' + basename); - equal(lodash.min('abc'), Infinity, '_.min should return `Infinity` for strings: ' + basename); - - // avoid issues comparing objects with `deepEqual` - object = { 'a': 1, 'b': 2, 'c': 3 }; - actual = lodash.omit(object, function(value) { return value == 3; }); - deepEqual(_.keys(actual).sort(), ['a', 'b', 'c'], '_.omit should not accept a `callback`: ' + basename); - - actual = lodash.pick(object, function(value) { return value != 3; }); - deepEqual(_.keys(actual), [], '_.pick should not accept a `callback`: ' + basename); - - strictEqual(lodash.result(), null, '_.result should return `null` for falsey `object` arguments: ' + basename); - strictEqual(lodash.some([false, true, false]), true, '_.some: ' + basename); - equal(lodash.template('${a}', object), '${a}', '_.template should ignore ES6 delimiters: ' + basename); - equal('imports' in lodash.templateSettings, false, '_.templateSettings should not have an "imports" property: ' + basename); - strictEqual(lodash.uniqueId(0), '1', '_.uniqueId should ignore a prefix of `0`: ' + basename); - - var collection = [{ 'a': { 'b': 1, 'c': 2 } }]; - deepEqual(lodash.where(collection, { 'a': { 'b': 1 } }), [], '_.where performs shallow comparisons: ' + basename); - - collection = [{ 'a': 1 }, { 'a': 1 }]; - deepEqual(lodash.where(collection, { 'a': 1 }, true), collection[0], '_.where supports a `first` argument: ' + basename); - deepEqual(lodash.where(collection, {}, true), null, '_.where should return `null` when passed `first` and falsey `properties`: ' + basename); - - deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename); - strictEqual(lodash.findWhere(collection, {}), null, '_.findWhere should return `null` for falsey `properties`: ' + basename); - - start(); - }); - }); - - asyncTest('should not have any Lo-Dash-only methods', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - _.each([ - 'assign', - 'at', - 'bindKey', - 'forIn', - 'forOwn', - 'isPlainObject', - 'merge', - 'partialRight' - ], function(methodName) { - equal(lodash[methodName], undefined, '_.' + methodName + ' should not exist: ' + basename); - }); - - start(); - }); - }); - - asyncTest('`lodash underscore include=findWhere`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore', 'include=findWhere'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - var collection = [{ 'a': 1 }, { 'a': 1 }]; - deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename); - - start(); - }); - }); - - asyncTest('`lodash underscore include=partial`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore', 'include=partial'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._; - - equal(lodash.partial(_.identity, 2)(), 2, '_.partial: ' + basename); - start(); - }); - }); - - asyncTest('`lodash underscore plus=clone`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'underscore', 'plus=clone'], function(data) { - var array = [{ 'value': 1 }], - basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - vm.runInContext(data.source, context); - var lodash = context._, - clone = lodash.clone(array, true); - - ok(_.isEqual(array, clone), basename); - notEqual(array[0], clone[0], basename); - start(); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('exports command'); - - (function() { - var commands = [ - 'exports=amd', - 'exports=commonjs', - 'exports=global', - 'exports=node', - 'exports=none' - ]; - - commands.forEach(function(command, index) { - asyncTest('`lodash ' + command +'`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', command], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(), - pass = false, - source = data.source; - - switch(index) { - case 0: - context.define = function(fn) { - pass = true; - context._ = fn(); - }; - context.define.amd = {}; - vm.runInContext(source, context); - ok(pass, basename); - break; - - case 1: - context.exports = {}; - vm.runInContext(source, context); - ok(_.isFunction(context.exports._), basename); - strictEqual(context._, undefined, basename); - break; - - case 2: - vm.runInContext(source, context); - ok(_.isFunction(context._), basename); - break; - - case 3: - context.exports = {}; - context.module = { 'exports': context.exports }; - vm.runInContext(source, context); - ok(_.isFunction(context.module.exports), basename); - strictEqual(context._, undefined, basename); - break; - - case 4: - vm.runInContext(source, context); - strictEqual(context._, undefined, basename); - } - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('iife command'); - - (function() { - var commands = [ - 'iife=this["lodash"]=(function(window,undefined){%output%;return lodash}(this))', - 'iife=define(function(window,undefined){return function(){%output%;return lodash}}(this));' - ]; - - commands.forEach(function(command) { - asyncTest('`lodash ' + command +'`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'exports=none', command], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - context.define = function(func) { - context.lodash = func(); - }; - - try { - vm.runInContext(data.source, context); - } catch(e) { - console.log(e); - } - - var lodash = context.lodash || {}; - ok(_.isString(lodash.VERSION), basename); - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('output options'); - - (function() { - var commands = [ - '-o a.js', - '--output a.js' - ]; - - commands.forEach(function(command, index) { - asyncTest('`lodash ' + command +'`', function() { - var counter = -1, - start = _.after(2, _.once(QUnit.start)); - - build(['-s'].concat(command.split(' ')), function(data) { - equal(path.basename(data.outputPath, '.js'), (++counter ? 'a.min' : 'a'), command); - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('stdout options'); - - (function() { - var commands = [ - '-c', - '-c -d', - '--stdout', - ]; - - commands.forEach(function(command, index) { - asyncTest('`lodash ' + command +'`', function() { - var written, - start = _.once(QUnit.start), - write = process.stdout.write; - - process.stdout.write = function(string) { - written = string; - }; - - build(['exports=', 'include='].concat(command.split(' ')), function(data) { - process.stdout.write = write; - equal(written, data.source); - equal(arguments.length, 1); - start(); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('mobile build'); - - (function() { - asyncTest('`lodash mobile`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['-s', 'mobile'], function(data) { - var basename = path.basename(data.outputPath, '.js'), - context = createContext(); - - try { - vm.runInContext(data.source, context); - } catch(e) { - console.log(e); - } - - var array = [1, 2, 3], - object1 = [{ 'a': 1 }], - object2 = [{ 'b': 2 }], - object3 = [{ 'a': 1, 'b': 2 }], - circular1 = { 'a': 1 }, - circular2 = { 'a': 1 }, - lodash = context._; - - circular1.b = circular1; - circular2.b = circular2; - - deepEqual(lodash.merge(object1, object2), object3, basename); - deepEqual(lodash.sortBy([3, 2, 1], _.identity), array, basename); - strictEqual(lodash.isEqual(circular1, circular2), true, basename); - - var actual = lodash.cloneDeep(circular1); - ok(actual != circular1 && actual.b == actual, basename); - start(); - }); - }); - - asyncTest('`lodash csp`', function() { - var sources = []; - - var check = _.after(2, _.once(function() { - equal(sources[0], sources[1]); - QUnit.start(); - })); - - var callback = function(data) { - // remove copyright header and append source - sources.push(data.source.replace(/^\/\**[\s\S]+?\*\/\n/, '')); - check(); - }; - - build(['-s', '-d', 'csp'], callback); - build(['-s', '-d', 'mobile'], callback); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('lodash build'); - - (function() { - var commands = [ - 'backbone', - 'csp', - 'legacy', - 'mobile', - 'modern', - 'strict', - 'underscore', - 'category=arrays', - 'category=chaining', - 'category=collections', - 'category=functions', - 'category=objects', - 'category=utilities', - 'exclude=union,uniq,zip', - 'include=each,filter,map', - 'include=once plus=bind,Chaining', - 'category=collections,functions', - 'backbone legacy category=utilities minus=first,last', - 'legacy include=defer', - 'legacy underscore', - 'underscore include=debounce,throttle plus=after minus=throttle', - 'underscore mobile strict category=functions exports=amd,global plus=pick,uniq', - ] - .concat( - allMethods.map(function(methodName) { - return 'include=' + methodName; - }) - ); - - commands.forEach(function(origCommand) { - _.times(4, function(index) { - var command = origCommand; - - if (index == 1) { - if (/legacy|mobile/.test(command)) { - return; - } - command = 'mobile ' + command; - } - if (index == 2) { - if (/legacy|modern/.test(command)) { - return; - } - command = 'modern ' + command; - } - if (index == 3) { - if (/category|legacy|underscore/.test(command)) { - return; - } - command = 'underscore ' + command; - } - asyncTest('`lodash ' + command +'`', function() { - var start = _.after(2, _.once(QUnit.start)); - - build(['--silent'].concat(command.split(' ')), function(data) { - var methodNames, - basename = path.basename(data.outputPath, '.js'), - context = createContext(), - isUnderscore = /backbone|underscore/.test(command), - exposeAssign = !isUnderscore; - - try { - vm.runInContext(data.source, context); - } catch(e) { - console.log(e); - } - // add method names explicitly - if (/include/.test(command)) { - methodNames = command.match(/include=(\S*)/)[1].split(/, */); - } - // add method names required by Backbone and Underscore builds - if (/backbone/.test(command) && !methodNames) { - methodNames = backboneDependencies.slice(); - } - if (isUnderscore) { - if (methodNames) { - exposeAssign = methodNames.indexOf('assign') > -1; - } else { - methodNames = underscoreMethods.slice(); - } - } - // add method names explicitly by category - if (/category/.test(command)) { - // resolve method names belonging to each category (case-insensitive) - methodNames = command.match(/category=(\S*)/)[1].split(/, */).reduce(function(result, category) { - var capitalized = category[0].toUpperCase() + category.toLowerCase().slice(1); - return result.concat(getMethodsByCategory(capitalized)); - }, methodNames || []); - } - // init `methodNames` if it hasn't been inited - if (!methodNames) { - methodNames = allMethods.slice(); - } - if (/plus/.test(command)) { - methodNames = methodNames.concat(command.match(/plus=(\S*)/)[1].split(/, */)); - } - if (/minus/.test(command)) { - methodNames = _.without.apply(_, [methodNames] - .concat(expandMethodNames(command.match(/minus=(\S*)/)[1].split(/, */)))); - } - if (/exclude/.test(command)) { - methodNames = _.without.apply(_, [methodNames] - .concat(expandMethodNames(command.match(/exclude=(\S*)/)[1].split(/, */)))); - } - - // expand aliases and categories to real method names - methodNames = expandMethodNames(methodNames).reduce(function(result, methodName) { - return result.concat(methodName, getMethodsByCategory(methodName)); - }, []); - - // remove nonexistent and duplicate method names - methodNames = _.uniq(_.intersection(allMethods, expandMethodNames(methodNames))); - - if (!exposeAssign) { - methodNames = _.without(methodNames, 'assign'); - } - var lodash = context._ || {}; - methodNames.forEach(function(methodName) { - testMethod(lodash, methodName, basename); - }); - - start(); - }); - }); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - if (timeLimit > 0) { - setTimeout(function() { - process.exit(QUnit.config.stats.bad ? 1 : 0); - }, timeLimit); - } - // explicitly call `QUnit.start()` for Narwhal, Node.js, Rhino, and RingoJS - if (!global.document) { - QUnit.start(); - } -}()); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/test.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/test.js deleted file mode 100644 index 632af43..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/test/test.js +++ /dev/null @@ -1,2920 +0,0 @@ -;(function(window, undefined) { - 'use strict'; - - /** Use a single "load" function */ - var load = typeof require == 'function' ? require : window.load; - - /** The file path of the Lo-Dash file to test */ - var filePath = (function() { - var min = 0; - var result = window.phantom - ? phantom.args - : (window.system - ? (min = 1, system.args) - : (window.process ? (min = 2, process.argv) : (window.arguments || [])) - ); - - var last = result[result.length - 1]; - result = (result.length > min && last != 'test.js') ? last : '../lodash.js'; - - try { - result = require('fs').realpathSync(result); - } catch(e) { } - - return result; - }()); - - /** The basename of the Lo-Dash file to test */ - var basename = /[\w.-]+$/.exec(filePath)[0]; - - /** The `platform` object to check */ - var platform = - window.platform || - load('../vendor/platform.js/platform.js') || - window.platform; - - /** The unit testing framework */ - var QUnit = - window.QUnit || ( - window.addEventListener || (window.addEventListener = Function.prototype), - window.setTimeout || (window.setTimeout = Function.prototype), - window.QUnit = load('../vendor/qunit/qunit/qunit.js') || window.QUnit, - load('../vendor/qunit-clib/qunit-clib.js'), - window.addEventListener === Function.prototype && delete window.addEventListener, - window.QUnit - ); - - /** The `lodash` function to test */ - var _ = window._ || ( - _ = load(filePath) || window._, - _._ || _ - ); - - /** Used to pass falsey values to methods */ - var falsey = [ - , - '', - 0, - false, - NaN, - null, - undefined - ]; - - /** Shortcut used to make object properties immutable */ - var freeze = Object.freeze; - - /** Used to set property descriptors */ - var setDescriptor = (function(fn) { - try { - var o = {}; - return fn(o, o, o) && fn; - } catch(e) { } - }(Object.defineProperty)); - - /** Shortcut used to convert array-like objects to arrays */ - var slice = [].slice; - - /** Used to check problem JScript properties (a.k.a. the [[DontEnum]] bug) */ - var shadowed = { - 'constructor': 1, - 'hasOwnProperty': 2, - 'isPrototypeOf': 3, - 'propertyIsEnumerable': 4, - 'toLocaleString': 5, - 'toString': 6, - 'valueOf': 7 - }; - - /** Used to check problem JScript properties too */ - var shadowedKeys = [ - 'constructor', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'toLocaleString', - 'toString', - 'valueOf' - ]; - - /*--------------------------------------------------------------------------*/ - - /** - * Skips a given number of tests with a passing result. - * - * @private - * @param {Number} [count=1] The number of tests to skip. - */ - function skipTest(count) { - count || (count = 1); - while (count--) { - ok(true, 'test skipped'); - } - } - - /*--------------------------------------------------------------------------*/ - - // add object from iframe - (function() { - if (!window.document || window.phantom) { - return; - } - var body = document.body, - iframe = document.createElement('iframe'); - - iframe.frameBorder = iframe.height = iframe.width = 0; - body.appendChild(iframe); - var idoc = (idoc = iframe.contentDocument || iframe.contentWindow).document || idoc; - idoc.write(" -``` - -Optionally, expose Java’s nanosecond timer by adding the `nano` applet to the ``: - -```html - -``` - -Or enable Chrome’s microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking): - - --enable-benchmarking - -Via [npm](http://npmjs.org/): - -```bash -npm install benchmark -``` - -In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): - -```js -var Benchmark = require('benchmark'); -``` - -Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons: - -```bash -npm install microtime -``` - -In [RingoJS v0.7.0-](http://ringojs.org/): - -```js -var Benchmark = require('benchmark').Benchmark; -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('benchmark.js'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({ - 'paths': { - 'benchmark': 'path/to/benchmark' - } -}, -['benchmark'], function(Benchmark) { - console.log(Benchmark.version); -}); - -// or with platform.js -// https://github.com/bestiejs/platform.js -require({ - 'paths': { - 'benchmark': 'path/to/benchmark', - 'platform': 'path/to/platform' - } -}, -['benchmark', 'platform'], function(Benchmark, platform) { - Benchmark.platform = platform; - console.log(Benchmark.platform.name); -}); -``` - -Usage example: - -```js -var suite = new Benchmark.Suite; - -// add tests -suite.add('RegExp#test', function() { - /o/.test('Hello World!'); -}) -.add('String#indexOf', function() { - 'Hello World!'.indexOf('o') > -1; -}) -// add listeners -.on('cycle', function(event) { - console.log(String(event.target)); -}) -.on('complete', function() { - console.log('Fastest is ' + this.filter('fastest').pluck('name')); -}) -// run async -.run({ 'async': true }); - -// logs: -// > RegExp#test x 4,161,532 +-0.99% (59 cycles) -// > String#indexOf x 6,139,623 +-1.00% (131 cycles) -// > Fastest is String#indexOf -``` - -## BestieJS - -Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Authors - -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Kit Cambridge](http://kitcambridge.github.com/) - [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/benchmark.js/benchmark.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/benchmark.js/benchmark.js deleted file mode 100644 index 6adf726..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/benchmark.js/benchmark.js +++ /dev/null @@ -1,3960 +0,0 @@ -/*! - * Benchmark.js v1.0.0 - * Copyright 2010-2013 Mathias Bynens - * Based on JSLitmus.js, copyright Robert Kieffer - * Modified by John-David Dalton - * Available under MIT license - */ -;(function(window, undefined) { - 'use strict'; - - /** Used to assign each benchmark an incrimented id */ - var counter = 0; - - /** Detect DOM document object */ - var doc = isHostType(window, 'document') && document; - - /** Detect free variable `define` */ - var freeDefine = typeof define == 'function' && - typeof define.amd == 'object' && define.amd && define; - - /** Detect free variable `exports` */ - var freeExports = typeof exports == 'object' && exports && - (typeof global == 'object' && global && global == global.global && (window = global), exports); - - /** Detect free variable `require` */ - var freeRequire = typeof require == 'function' && require; - - /** Used to store the `Object` built-in in case it's overwritten later */ - var Object = window.Object; - - /** Used to crawl all properties regardless of enumerability */ - var getAllKeys = Object.getOwnPropertyNames; - - /** Used to get property descriptors */ - var getDescriptor = Object.getOwnPropertyDescriptor; - - /** Used in case an object doesn't have its own method */ - var hasOwnProperty = {}.hasOwnProperty; - - /** Used to check if an object is extensible */ - var isExtensible = Object.isExtensible || function() { return true; }; - - /** Used to access Wade Simmons' Node microtime module */ - var microtimeObject = req('microtime'); - - /** Used to access the browser's high resolution timer */ - var perfObject = isHostType(window, 'performance') && performance; - - /** Used to call the browser's high resolution timer */ - var perfName = perfObject && ( - perfObject.now && 'now' || - perfObject.webkitNow && 'webkitNow' - ); - - /** Used to access Node's high resolution timer */ - var processObject = isHostType(window, 'process') && process; - - /** Used to check if an own property is enumerable */ - var propertyIsEnumerable = {}.propertyIsEnumerable; - - /** Used to set property descriptors */ - var setDescriptor = Object.defineProperty; - - /** Used to resolve a value's internal [[Class]] */ - var toString = {}.toString; - - /** Used to prevent a `removeChild` memory leak in IE < 9 */ - var trash = doc && doc.createElement('div'); - - /** Used to integrity check compiled tests */ - var uid = 'uid' + (+new Date); - - /** Used to avoid infinite recursion when methods call each other */ - var calledBy = {}; - - /** Used to avoid hz of Infinity */ - var divisors = { - '1': 4096, - '2': 512, - '3': 64, - '4': 8, - '5': 0 - }; - - /** - * T-Distribution two-tailed critical values for 95% confidence - * http://www.itl.nist.gov/div898/handbook/eda/section3/eda3672.htm - */ - var tTable = { - '1': 12.706,'2': 4.303, '3': 3.182, '4': 2.776, '5': 2.571, '6': 2.447, - '7': 2.365, '8': 2.306, '9': 2.262, '10': 2.228, '11': 2.201, '12': 2.179, - '13': 2.16, '14': 2.145, '15': 2.131, '16': 2.12, '17': 2.11, '18': 2.101, - '19': 2.093, '20': 2.086, '21': 2.08, '22': 2.074, '23': 2.069, '24': 2.064, - '25': 2.06, '26': 2.056, '27': 2.052, '28': 2.048, '29': 2.045, '30': 2.042, - 'infinity': 1.96 - }; - - /** - * Critical Mann-Whitney U-values for 95% confidence - * http://www.saburchill.com/IBbiology/stats/003.html - */ - var uTable = { - '5': [0, 1, 2], - '6': [1, 2, 3, 5], - '7': [1, 3, 5, 6, 8], - '8': [2, 4, 6, 8, 10, 13], - '9': [2, 4, 7, 10, 12, 15, 17], - '10': [3, 5, 8, 11, 14, 17, 20, 23], - '11': [3, 6, 9, 13, 16, 19, 23, 26, 30], - '12': [4, 7, 11, 14, 18, 22, 26, 29, 33, 37], - '13': [4, 8, 12, 16, 20, 24, 28, 33, 37, 41, 45], - '14': [5, 9, 13, 17, 22, 26, 31, 36, 40, 45, 50, 55], - '15': [5, 10, 14, 19, 24, 29, 34, 39, 44, 49, 54, 59, 64], - '16': [6, 11, 15, 21, 26, 31, 37, 42, 47, 53, 59, 64, 70, 75], - '17': [6, 11, 17, 22, 28, 34, 39, 45, 51, 57, 63, 67, 75, 81, 87], - '18': [7, 12, 18, 24, 30, 36, 42, 48, 55, 61, 67, 74, 80, 86, 93, 99], - '19': [7, 13, 19, 25, 32, 38, 45, 52, 58, 65, 72, 78, 85, 92, 99, 106, 113], - '20': [8, 14, 20, 27, 34, 41, 48, 55, 62, 69, 76, 83, 90, 98, 105, 112, 119, 127], - '21': [8, 15, 22, 29, 36, 43, 50, 58, 65, 73, 80, 88, 96, 103, 111, 119, 126, 134, 142], - '22': [9, 16, 23, 30, 38, 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, 133, 141, 150, 158], - '23': [9, 17, 24, 32, 40, 48, 56, 64, 73, 81, 89, 98, 106, 115, 123, 132, 140, 149, 157, 166, 175], - '24': [10, 17, 25, 33, 42, 50, 59, 67, 76, 85, 94, 102, 111, 120, 129, 138, 147, 156, 165, 174, 183, 192], - '25': [10, 18, 27, 35, 44, 53, 62, 71, 80, 89, 98, 107, 117, 126, 135, 145, 154, 163, 173, 182, 192, 201, 211], - '26': [11, 19, 28, 37, 46, 55, 64, 74, 83, 93, 102, 112, 122, 132, 141, 151, 161, 171, 181, 191, 200, 210, 220, 230], - '27': [11, 20, 29, 38, 48, 57, 67, 77, 87, 97, 107, 118, 125, 138, 147, 158, 168, 178, 188, 199, 209, 219, 230, 240, 250], - '28': [12, 21, 30, 40, 50, 60, 70, 80, 90, 101, 111, 122, 132, 143, 154, 164, 175, 186, 196, 207, 218, 228, 239, 250, 261, 272], - '29': [13, 22, 32, 42, 52, 62, 73, 83, 94, 105, 116, 127, 138, 149, 160, 171, 182, 193, 204, 215, 226, 238, 249, 260, 271, 282, 294], - '30': [13, 23, 33, 43, 54, 65, 76, 87, 98, 109, 120, 131, 143, 154, 166, 177, 189, 200, 212, 223, 235, 247, 258, 270, 282, 293, 305, 317] - }; - - /** - * An object used to flag environments/features. - * - * @static - * @memberOf Benchmark - * @type Object - */ - var support = {}; - - (function() { - - /** - * Detect Adobe AIR. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.air = isClassOf(window.runtime, 'ScriptBridgingProxyObject'); - - /** - * Detect if `arguments` objects have the correct internal [[Class]] value. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.argumentsClass = isClassOf(arguments, 'Arguments'); - - /** - * Detect if in a browser environment. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.browser = doc && isHostType(window, 'navigator'); - - /** - * Detect if strings support accessing characters by index. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.charByIndex = - // IE 8 supports indexes on string literals but not string objects - ('x'[0] + Object('x')[0]) == 'xx'; - - /** - * Detect if strings have indexes as own properties. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.charByOwnIndex = - // Narwhal, Rhino, RingoJS, IE 8, and Opera < 10.52 support indexes on - // strings but don't detect them as own properties - support.charByIndex && hasKey('x', '0'); - - /** - * Detect if Java is enabled/exposed. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.java = isClassOf(window.java, 'JavaPackage'); - - /** - * Detect if the Timers API exists. - * - * @memberOf Benchmark.support - * @type Boolean - */ - support.timeout = isHostType(window, 'setTimeout') && isHostType(window, 'clearTimeout'); - - /** - * Detect if functions support decompilation. - * - * @name decompilation - * @memberOf Benchmark.support - * @type Boolean - */ - try { - // Safari 2.x removes commas in object literals - // from Function#toString results - // http://webk.it/11609 - // Firefox 3.6 and Opera 9.25 strip grouping - // parentheses from Function#toString results - // http://bugzil.la/559438 - support.decompilation = Function( - 'return (' + (function(x) { return { 'x': '' + (1 + x) + '', 'y': 0 }; }) + ')' - )()(0).x === '1'; - } catch(e) { - support.decompilation = false; - } - - /** - * Detect ES5+ property descriptor API. - * - * @name descriptors - * @memberOf Benchmark.support - * @type Boolean - */ - try { - var o = {}; - support.descriptors = (setDescriptor(o, o, o), 'value' in getDescriptor(o, o)); - } catch(e) { - support.descriptors = false; - } - - /** - * Detect ES5+ Object.getOwnPropertyNames(). - * - * @name getAllKeys - * @memberOf Benchmark.support - * @type Boolean - */ - try { - support.getAllKeys = /\bvalueOf\b/.test(getAllKeys(Object.prototype)); - } catch(e) { - support.getAllKeys = false; - } - - /** - * Detect if own properties are iterated before inherited properties (all but IE < 9). - * - * @name iteratesOwnLast - * @memberOf Benchmark.support - * @type Boolean - */ - support.iteratesOwnFirst = (function() { - var props = []; - function ctor() { this.x = 1; } - ctor.prototype = { 'y': 1 }; - for (var prop in new ctor) { props.push(prop); } - return props[0] == 'x'; - }()); - - /** - * Detect if a 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` property value of `typeof` "function". - * - * @name nodeClass - * @memberOf Benchmark.support - * @type Boolean - */ - try { - support.nodeClass = ({ 'toString': 0 } + '', toString.call(doc || 0) != '[object Object]'); - } catch(e) { - support.nodeClass = true; - } - }()); - - /** - * Timer object used by `clock()` and `Deferred#resolve`. - * - * @private - * @type Object - */ - var timer = { - - /** - * The timer namespace object or constructor. - * - * @private - * @memberOf timer - * @type Function|Object - */ - 'ns': Date, - - /** - * Starts the deferred timer. - * - * @private - * @memberOf timer - * @param {Object} deferred The deferred instance. - */ - 'start': null, // lazy defined in `clock()` - - /** - * Stops the deferred timer. - * - * @private - * @memberOf timer - * @param {Object} deferred The deferred instance. - */ - 'stop': null // lazy defined in `clock()` - }; - - /** Shortcut for inverse results */ - var noArgumentsClass = !support.argumentsClass, - noCharByIndex = !support.charByIndex, - noCharByOwnIndex = !support.charByOwnIndex; - - /** Math shortcuts */ - var abs = Math.abs, - floor = Math.floor, - log = Math.log, - max = Math.max, - min = Math.min, - pow = Math.pow, - sqrt = Math.sqrt; - - /*--------------------------------------------------------------------------*/ - - /** - * The Benchmark constructor. - * - * @constructor - * @param {String} name A name to identify the benchmark. - * @param {Function|String} fn The test to benchmark. - * @param {Object} [options={}] Options object. - * @example - * - * // basic usage (the `new` operator is optional) - * var bench = new Benchmark(fn); - * - * // or using a name first - * var bench = new Benchmark('foo', fn); - * - * // or with options - * var bench = new Benchmark('foo', fn, { - * - * // displayed by Benchmark#toString if `name` is not available - * 'id': 'xyz', - * - * // called when the benchmark starts running - * 'onStart': onStart, - * - * // called after each run cycle - * 'onCycle': onCycle, - * - * // called when aborted - * 'onAbort': onAbort, - * - * // called when a test errors - * 'onError': onError, - * - * // called when reset - * 'onReset': onReset, - * - * // called when the benchmark completes running - * 'onComplete': onComplete, - * - * // compiled/called before the test loop - * 'setup': setup, - * - * // compiled/called after the test loop - * 'teardown': teardown - * }); - * - * // or name and options - * var bench = new Benchmark('foo', { - * - * // a flag to indicate the benchmark is deferred - * 'defer': true, - * - * // benchmark test function - * 'fn': function(deferred) { - * // call resolve() when the deferred test is finished - * deferred.resolve(); - * } - * }); - * - * // or options only - * var bench = new Benchmark({ - * - * // benchmark name - * 'name': 'foo', - * - * // benchmark test as a string - * 'fn': '[1,2,3,4].sort()' - * }); - * - * // a test's `this` binding is set to the benchmark instance - * var bench = new Benchmark('foo', function() { - * 'My name is '.concat(this.name); // My name is foo - * }); - */ - function Benchmark(name, fn, options) { - var me = this; - - // allow instance creation without the `new` operator - if (me == null || me.constructor != Benchmark) { - return new Benchmark(name, fn, options); - } - // juggle arguments - if (isClassOf(name, 'Object')) { - // 1 argument (options) - options = name; - } - else if (isClassOf(name, 'Function')) { - // 2 arguments (fn, options) - options = fn; - fn = name; - } - else if (isClassOf(fn, 'Object')) { - // 2 arguments (name, options) - options = fn; - fn = null; - me.name = name; - } - else { - // 3 arguments (name, fn [, options]) - me.name = name; - } - setOptions(me, options); - me.id || (me.id = ++counter); - me.fn == null && (me.fn = fn); - me.stats = deepClone(me.stats); - me.times = deepClone(me.times); - } - - /** - * The Deferred constructor. - * - * @constructor - * @memberOf Benchmark - * @param {Object} clone The cloned benchmark instance. - */ - function Deferred(clone) { - var me = this; - if (me == null || me.constructor != Deferred) { - return new Deferred(clone); - } - me.benchmark = clone; - clock(me); - } - - /** - * The Event constructor. - * - * @constructor - * @memberOf Benchmark - * @param {String|Object} type The event type. - */ - function Event(type) { - var me = this; - return (me == null || me.constructor != Event) - ? new Event(type) - : (type instanceof Event) - ? type - : extend(me, { 'timeStamp': +new Date }, typeof type == 'string' ? { 'type': type } : type); - } - - /** - * The Suite constructor. - * - * @constructor - * @memberOf Benchmark - * @param {String} name A name to identify the suite. - * @param {Object} [options={}] Options object. - * @example - * - * // basic usage (the `new` operator is optional) - * var suite = new Benchmark.Suite; - * - * // or using a name first - * var suite = new Benchmark.Suite('foo'); - * - * // or with options - * var suite = new Benchmark.Suite('foo', { - * - * // called when the suite starts running - * 'onStart': onStart, - * - * // called between running benchmarks - * 'onCycle': onCycle, - * - * // called when aborted - * 'onAbort': onAbort, - * - * // called when a test errors - * 'onError': onError, - * - * // called when reset - * 'onReset': onReset, - * - * // called when the suite completes running - * 'onComplete': onComplete - * }); - */ - function Suite(name, options) { - var me = this; - - // allow instance creation without the `new` operator - if (me == null || me.constructor != Suite) { - return new Suite(name, options); - } - // juggle arguments - if (isClassOf(name, 'Object')) { - // 1 argument (options) - options = name; - } else { - // 2 arguments (name [, options]) - me.name = name; - } - setOptions(me, options); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Note: Some array methods have been implemented in plain JavaScript to avoid - * bugs in IE, Opera, Rhino, and Mobile Safari. - * - * IE compatibility mode and IE < 9 have buggy Array `shift()` and `splice()` - * functions that fail to remove the last element, `object[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. - * - * In Opera < 9.50 and some older/beta Mobile Safari versions using `unshift()` - * generically to augment the `arguments` object will pave the value at index 0 - * without incrimenting the other values's indexes. - * https://github.com/documentcloud/underscore/issues/9 - * - * Rhino and environments it powers, like Narwhal and RingoJS, may have - * buggy Array `concat()`, `reverse()`, `shift()`, `slice()`, `splice()` and - * `unshift()` functions that make sparse arrays non-sparse by assigning the - * undefined indexes a value of undefined. - * https://github.com/mozilla/rhino/commit/702abfed3f8ca043b2636efd31c14ba7552603dd - */ - - /** - * Creates an array containing the elements of the host array followed by the - * elements of each argument in order. - * - * @memberOf Benchmark.Suite - * @returns {Array} The new array. - */ - function concat() { - var value, - j = -1, - length = arguments.length, - result = slice.call(this), - index = result.length; - - while (++j < length) { - value = arguments[j]; - if (isClassOf(value, 'Array')) { - for (var k = 0, l = value.length; k < l; k++, index++) { - if (k in value) { - result[index] = value[k]; - } - } - } else { - result[index++] = value; - } - } - return result; - } - - /** - * Utility function used by `shift()`, `splice()`, and `unshift()`. - * - * @private - * @param {Number} start The index to start inserting elements. - * @param {Number} deleteCount The number of elements to delete from the insert point. - * @param {Array} elements The elements to insert. - * @returns {Array} An array of deleted elements. - */ - function insert(start, deleteCount, elements) { - // `result` should have its length set to the `deleteCount` - // see https://bugs.ecmascript.org/show_bug.cgi?id=332 - var deleteEnd = start + deleteCount, - elementCount = elements ? elements.length : 0, - index = start - 1, - length = start + elementCount, - object = this, - result = Array(deleteCount), - tail = slice.call(object, deleteEnd); - - // delete elements from the array - while (++index < deleteEnd) { - if (index in object) { - result[index - start] = object[index]; - delete object[index]; - } - } - // insert elements - index = start - 1; - while (++index < length) { - object[index] = elements[index - start]; - } - // append tail elements - start = index--; - length = max(0, (object.length >>> 0) - deleteCount + elementCount); - while (++index < length) { - if ((index - start) in tail) { - object[index] = tail[index - start]; - } else if (index in object) { - delete object[index]; - } - } - // delete excess elements - deleteCount = deleteCount > elementCount ? deleteCount - elementCount : 0; - while (deleteCount--) { - index = length + deleteCount; - if (index in object) { - delete object[index]; - } - } - object.length = length; - return result; - } - - /** - * Rearrange the host array's elements in reverse order. - * - * @memberOf Benchmark.Suite - * @returns {Array} The reversed array. - */ - function reverse() { - var upperIndex, - value, - index = -1, - object = Object(this), - length = object.length >>> 0, - middle = floor(length / 2); - - if (length > 1) { - while (++index < middle) { - upperIndex = length - index - 1; - value = upperIndex in object ? object[upperIndex] : uid; - if (index in object) { - object[upperIndex] = object[index]; - } else { - delete object[upperIndex]; - } - if (value != uid) { - object[index] = value; - } else { - delete object[index]; - } - } - } - return object; - } - - /** - * Removes the first element of the host array and returns it. - * - * @memberOf Benchmark.Suite - * @returns {Mixed} The first element of the array. - */ - function shift() { - return insert.call(this, 0, 1)[0]; - } - - /** - * Creates an array of the host array's elements from the start index up to, - * but not including, the end index. - * - * @memberOf Benchmark.Suite - * @param {Number} start The starting index. - * @param {Number} end The end index. - * @returns {Array} The new array. - */ - function slice(start, end) { - var index = -1, - object = Object(this), - length = object.length >>> 0, - result = []; - - start = toInteger(start); - start = start < 0 ? max(length + start, 0) : min(start, length); - start--; - end = end == null ? length : toInteger(end); - end = end < 0 ? max(length + end, 0) : min(end, length); - - while ((++index, ++start) < end) { - if (start in object) { - result[index] = object[start]; - } - } - return result; - } - - /** - * Allows removing a range of elements and/or inserting elements into the - * host array. - * - * @memberOf Benchmark.Suite - * @param {Number} start The start index. - * @param {Number} deleteCount The number of elements to delete. - * @param {Mixed} [val1, val2, ...] values to insert at the `start` index. - * @returns {Array} An array of removed elements. - */ - function splice(start, deleteCount) { - var object = Object(this), - length = object.length >>> 0; - - start = toInteger(start); - start = start < 0 ? max(length + start, 0) : min(start, length); - - // support the de-facto SpiderMonkey extension - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice#Parameters - // https://bugs.ecmascript.org/show_bug.cgi?id=429 - deleteCount = arguments.length == 1 - ? length - start - : min(max(toInteger(deleteCount), 0), length - start); - - return insert.call(object, start, deleteCount, slice.call(arguments, 2)); - } - - /** - * Converts the specified `value` to an integer. - * - * @private - * @param {Mixed} value The value to convert. - * @returns {Number} The resulting integer. - */ - function toInteger(value) { - value = +value; - return value === 0 || !isFinite(value) ? value || 0 : value - (value % 1); - } - - /** - * Appends arguments to the host array. - * - * @memberOf Benchmark.Suite - * @returns {Number} The new length. - */ - function unshift() { - var object = Object(this); - insert.call(object, 0, 0, arguments); - return object.length; - } - - /*--------------------------------------------------------------------------*/ - - /** - * A generic `Function#bind` like method. - * - * @private - * @param {Function} fn The function to be bound to `thisArg`. - * @param {Mixed} thisArg The `this` binding for the given function. - * @returns {Function} The bound function. - */ - function bind(fn, thisArg) { - return function() { fn.apply(thisArg, arguments); }; - } - - /** - * Creates a function from the given arguments string and body. - * - * @private - * @param {String} args The comma separated function arguments. - * @param {String} body The function body. - * @returns {Function} The new function. - */ - function createFunction() { - // lazy define - createFunction = function(args, body) { - var result, - anchor = freeDefine ? define.amd : Benchmark, - prop = uid + 'createFunction'; - - runScript((freeDefine ? 'define.amd.' : 'Benchmark.') + prop + '=function(' + args + '){' + body + '}'); - result = anchor[prop]; - delete anchor[prop]; - return result; - }; - // fix JaegerMonkey bug - // http://bugzil.la/639720 - createFunction = support.browser && (createFunction('', 'return"' + uid + '"') || noop)() == uid ? createFunction : Function; - return createFunction.apply(null, arguments); - } - - /** - * Delay the execution of a function based on the benchmark's `delay` property. - * - * @private - * @param {Object} bench The benchmark instance. - * @param {Object} fn The function to execute. - */ - function delay(bench, fn) { - bench._timerId = setTimeout(fn, bench.delay * 1e3); - } - - /** - * Destroys the given element. - * - * @private - * @param {Element} element The element to destroy. - */ - function destroyElement(element) { - trash.appendChild(element); - trash.innerHTML = ''; - } - - /** - * Iterates over an object's properties, executing the `callback` for each. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} callback The function executed per own property. - * @param {Object} options The options object. - * @returns {Object} Returns the object iterated over. - */ - function forProps() { - var forShadowed, - skipSeen, - forArgs = true, - shadowed = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']; - - (function(enumFlag, key) { - // must use a non-native constructor to catch the Safari 2 issue - function Klass() { this.valueOf = 0; }; - Klass.prototype.valueOf = 0; - // check various for-in bugs - for (key in new Klass) { - enumFlag += key == 'valueOf' ? 1 : 0; - } - // check if `arguments` objects have non-enumerable indexes - for (key in arguments) { - key == '0' && (forArgs = false); - } - // Safari 2 iterates over shadowed properties twice - // http://replay.waybackmachine.org/20090428222941/http://tobielangel.com/2007/1/29/for-in-loop-broken-in-safari/ - skipSeen = enumFlag == 2; - // IE < 9 incorrectly makes an object's properties non-enumerable if they have - // the same name as other non-enumerable properties in its prototype chain. - forShadowed = !enumFlag; - }(0)); - - // lazy define - forProps = function(object, callback, options) { - options || (options = {}); - - var result = object; - object = Object(object); - - var ctor, - key, - keys, - skipCtor, - done = !result, - which = options.which, - allFlag = which == 'all', - index = -1, - iteratee = object, - length = object.length, - ownFlag = allFlag || which == 'own', - seen = {}, - skipProto = isClassOf(object, 'Function'), - thisArg = options.bind; - - if (thisArg !== undefined) { - callback = bind(callback, thisArg); - } - // iterate all properties - if (allFlag && support.getAllKeys) { - for (index = 0, keys = getAllKeys(object), length = keys.length; index < length; index++) { - key = keys[index]; - if (callback(object[key], key, object) === false) { - break; - } - } - } - // else iterate only enumerable properties - else { - for (key in object) { - // 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 set a function's `prototype` property [[Enumerable]] value - // to `true`. Because of this we standardize on skipping the `prototype` - // property of functions regardless of their [[Enumerable]] value. - if ((done = - !(skipProto && key == 'prototype') && - !(skipSeen && (hasKey(seen, key) || !(seen[key] = true))) && - (!ownFlag || ownFlag && hasKey(object, key)) && - callback(object[key], key, object) === false)) { - break; - } - } - // in IE < 9 strings don't support accessing characters by index - if (!done && (forArgs && isArguments(object) || - ((noCharByIndex || noCharByOwnIndex) && isClassOf(object, 'String') && - (iteratee = noCharByIndex ? object.split('') : object)))) { - while (++index < length) { - if ((done = - callback(iteratee[index], String(index), object) === false)) { - break; - } - } - } - if (!done && forShadowed) { - // Because IE < 9 can't set the `[[Enumerable]]` attribute of an existing - // property and the `constructor` property of a prototype defaults to - // non-enumerable, we manually skip the `constructor` property when we - // think we are iterating over a `prototype` object. - ctor = object.constructor; - skipCtor = ctor && ctor.prototype && ctor.prototype.constructor === ctor; - for (index = 0; index < 7; index++) { - key = shadowed[index]; - if (!(skipCtor && key == 'constructor') && - hasKey(object, key) && - callback(object[key], key, object) === false) { - break; - } - } - } - } - return result; - }; - return forProps.apply(null, arguments); - } - - /** - * Gets the name of the first argument from a function's source. - * - * @private - * @param {Function} fn The function. - * @returns {String} The argument name. - */ - function getFirstArgument(fn) { - return (!hasKey(fn, 'toString') && - (/^[\s(]*function[^(]*\(([^\s,)]+)/.exec(fn) || 0)[1]) || ''; - } - - /** - * Computes the geometric mean (log-average) of a sample. - * See http://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_arithmetic_mean_of_logarithms. - * - * @private - * @param {Array} sample The sample. - * @returns {Number} The geometric mean. - */ - function getGeometricMean(sample) { - return pow(Math.E, reduce(sample, function(sum, x) { - return sum + log(x); - }) / sample.length) || 0; - } - - /** - * Computes the arithmetic mean of a sample. - * - * @private - * @param {Array} sample The sample. - * @returns {Number} The mean. - */ - function getMean(sample) { - return (reduce(sample, function(sum, x) { - return sum + x; - }) / sample.length) || 0; - } - - /** - * Gets the source code of a function. - * - * @private - * @param {Function} fn The function. - * @param {String} altSource A string used when a function's source code is unretrievable. - * @returns {String} The function's source code. - */ - function getSource(fn, altSource) { - var result = altSource; - if (isStringable(fn)) { - result = String(fn); - } else if (support.decompilation) { - // escape the `{` for Firefox 1 - result = (/^[^{]+\{([\s\S]*)\}\s*$/.exec(fn) || 0)[1]; - } - // trim string - result = (result || '').replace(/^\s+|\s+$/g, ''); - - // detect strings containing only the "use strict" directive - return /^(?:\/\*+[\w|\W]*?\*\/|\/\/.*?[\n\r\u2028\u2029]|\s)*(["'])use strict\1;?$/.test(result) - ? '' - : result; - } - - /** - * Checks if a value is an `arguments` object. - * - * @private - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the value is an `arguments` object, else `false`. - */ - function isArguments() { - // lazy define - isArguments = function(value) { - return toString.call(value) == '[object Arguments]'; - }; - if (noArgumentsClass) { - isArguments = function(value) { - return hasKey(value, 'callee') && - !(propertyIsEnumerable && propertyIsEnumerable.call(value, 'callee')); - }; - } - return isArguments(arguments[0]); - } - - /** - * Checks if an object is of the specified class. - * - * @private - * @param {Mixed} value The value to check. - * @param {String} name The name of the class. - * @returns {Boolean} Returns `true` if the value is of the specified class, else `false`. - */ - function isClassOf(value, name) { - return value != null && toString.call(value) == '[object ' + name + ']'; - } - - /** - * Host objects can return type values that are different from their actual - * data type. The objects we are concerned with usually return non-primitive - * types of object, function, or unknown. - * - * @private - * @param {Mixed} object The owner of the property. - * @param {String} property The property to check. - * @returns {Boolean} Returns `true` if the property value is a non-primitive, else `false`. - */ - function isHostType(object, property) { - var type = object != null ? typeof object[property] : 'number'; - return !/^(?:boolean|number|string|undefined)$/.test(type) && - (type == 'object' ? !!object[property] : true); - } - - /** - * 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 the `value` is a plain `Object` object, else `false`. - */ - function isPlainObject(value) { - // avoid non-objects and false positives for `arguments` objects in IE < 9 - var result = false; - if (!(value && typeof value == 'object') || isArguments(value)) { - return result; - } - // IE < 9 presents DOM nodes as `Object` objects except they have `toString` - // methods that are `typeof` "string" and still can coerce nodes to strings. - // Also check that the constructor is `Object` (i.e. `Object instanceof Object`) - var ctor = value.constructor; - if ((support.nodeClass || !(typeof value.toString != 'function' && typeof (value + '') == 'string')) && - (!isClassOf(ctor, 'Function') || ctor instanceof ctor)) { - // 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. - if (support.iteratesOwnFirst) { - forProps(value, function(subValue, subKey) { - result = subKey; - }); - return result === false || hasKey(value, result); - } - // 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. - forProps(value, function(subValue, subKey) { - result = !hasKey(value, subKey); - return false; - }); - return result === false; - } - return result; - } - - /** - * Checks if a value can be safely coerced to a string. - * - * @private - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the value can be coerced, else `false`. - */ - function isStringable(value) { - return hasKey(value, 'toString') || isClassOf(value, 'String'); - } - - /** - * Wraps a function and passes `this` to the original function as the - * first argument. - * - * @private - * @param {Function} fn The function to be wrapped. - * @returns {Function} The new function. - */ - function methodize(fn) { - return function() { - var args = [this]; - args.push.apply(args, arguments); - return fn.apply(null, args); - }; - } - - /** - * A no-operation function. - * - * @private - */ - function noop() { - // no operation performed - } - - /** - * A wrapper around require() to suppress `module missing` errors. - * - * @private - * @param {String} id The module id. - * @returns {Mixed} The exported module or `null`. - */ - function req(id) { - try { - var result = freeExports && freeRequire(id); - } catch(e) { } - return result || null; - } - - /** - * Runs a snippet of JavaScript via script injection. - * - * @private - * @param {String} code The code to run. - */ - function runScript(code) { - var anchor = freeDefine ? define.amd : Benchmark, - script = doc.createElement('script'), - sibling = doc.getElementsByTagName('script')[0], - parent = sibling.parentNode, - prop = uid + 'runScript', - prefix = '(' + (freeDefine ? 'define.amd.' : 'Benchmark.') + prop + '||function(){})();'; - - // Firefox 2.0.0.2 cannot use script injection as intended because it executes - // asynchronously, but that's OK because script injection is only used to avoid - // the previously commented JaegerMonkey bug. - try { - // remove the inserted script *before* running the code to avoid differences - // in the expected script element count/order of the document. - script.appendChild(doc.createTextNode(prefix + code)); - anchor[prop] = function() { destroyElement(script); }; - } catch(e) { - parent = parent.cloneNode(false); - sibling = null; - script.text = code; - } - parent.insertBefore(script, sibling); - delete anchor[prop]; - } - - /** - * A helper function for setting options/event handlers. - * - * @private - * @param {Object} bench The benchmark instance. - * @param {Object} [options={}] Options object. - */ - function setOptions(bench, options) { - options = extend({}, bench.constructor.options, options); - bench.options = forOwn(options, function(value, key) { - if (value != null) { - // add event listeners - if (/^on[A-Z]/.test(key)) { - forEach(key.split(' '), function(key) { - bench.on(key.slice(2).toLowerCase(), value); - }); - } else if (!hasKey(bench, key)) { - bench[key] = deepClone(value); - } - } - }); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Handles cycling/completing the deferred benchmark. - * - * @memberOf Benchmark.Deferred - */ - function resolve() { - var me = this, - clone = me.benchmark, - bench = clone._original; - - if (bench.aborted) { - // cycle() -> clone cycle/complete event -> compute()'s invoked bench.run() cycle/complete - me.teardown(); - clone.running = false; - cycle(me); - } - else if (++me.cycles < clone.count) { - // continue the test loop - if (support.timeout) { - // use setTimeout to avoid a call stack overflow if called recursively - setTimeout(function() { clone.compiled.call(me, timer); }, 0); - } else { - clone.compiled.call(me, timer); - } - } - else { - timer.stop(me); - me.teardown(); - delay(clone, function() { cycle(me); }); - } - } - - /*--------------------------------------------------------------------------*/ - - /** - * A deep clone utility. - * - * @static - * @memberOf Benchmark - * @param {Mixed} value The value to clone. - * @returns {Mixed} The cloned value. - */ - function deepClone(value) { - var accessor, - circular, - clone, - ctor, - descriptor, - extensible, - key, - length, - markerKey, - parent, - result, - source, - subIndex, - data = { 'value': value }, - index = 0, - marked = [], - queue = { 'length': 0 }, - unmarked = []; - - /** - * An easily detectable decorator for cloned values. - */ - function Marker(object) { - this.raw = object; - } - - /** - * The callback used by `forProps()`. - */ - function forPropsCallback(subValue, subKey) { - // exit early to avoid cloning the marker - if (subValue && subValue.constructor == Marker) { - return; - } - // add objects to the queue - if (subValue === Object(subValue)) { - queue[queue.length++] = { 'key': subKey, 'parent': clone, 'source': value }; - } - // assign non-objects - else { - try { - // will throw an error in strict mode if the property is read-only - clone[subKey] = subValue; - } catch(e) { } - } - } - - /** - * Gets an available marker key for the given object. - */ - function getMarkerKey(object) { - // avoid collisions with existing keys - var result = uid; - while (object[result] && object[result].constructor != Marker) { - result += 1; - } - return result; - } - - do { - key = data.key; - parent = data.parent; - source = data.source; - clone = value = source ? source[key] : data.value; - accessor = circular = descriptor = false; - - // create a basic clone to filter out functions, DOM elements, and - // other non `Object` objects - if (value === Object(value)) { - // use custom deep clone function if available - if (isClassOf(value.deepClone, 'Function')) { - clone = value.deepClone(); - } else { - ctor = value.constructor; - switch (toString.call(value)) { - case '[object Array]': - clone = new ctor(value.length); - break; - - case '[object Boolean]': - clone = new ctor(value == true); - break; - - case '[object Date]': - clone = new ctor(+value); - break; - - case '[object Object]': - isPlainObject(value) && (clone = {}); - break; - - case '[object Number]': - case '[object String]': - clone = new ctor(value); - break; - - case '[object RegExp]': - clone = ctor(value.source, - (value.global ? 'g' : '') + - (value.ignoreCase ? 'i' : '') + - (value.multiline ? 'm' : '')); - } - } - // continue clone if `value` doesn't have an accessor descriptor - // http://es5.github.com/#x8.10.1 - if (clone && clone != value && - !(descriptor = source && support.descriptors && getDescriptor(source, key), - accessor = descriptor && (descriptor.get || descriptor.set))) { - // use an existing clone (circular reference) - if ((extensible = isExtensible(value))) { - markerKey = getMarkerKey(value); - if (value[markerKey]) { - circular = clone = value[markerKey].raw; - } - } else { - // for frozen/sealed objects - for (subIndex = 0, length = unmarked.length; subIndex < length; subIndex++) { - data = unmarked[subIndex]; - if (data.object === value) { - circular = clone = data.clone; - break; - } - } - } - if (!circular) { - // mark object to allow quickly detecting circular references and tie it to its clone - if (extensible) { - value[markerKey] = new Marker(clone); - marked.push({ 'key': markerKey, 'object': value }); - } else { - // for frozen/sealed objects - unmarked.push({ 'clone': clone, 'object': value }); - } - // iterate over object properties - forProps(value, forPropsCallback, { 'which': 'all' }); - } - } - } - if (parent) { - // for custom property descriptors - if (accessor || (descriptor && !(descriptor.configurable && descriptor.enumerable && descriptor.writable))) { - if ('value' in descriptor) { - descriptor.value = clone; - } - setDescriptor(parent, key, descriptor); - } - // for default property descriptors - else { - parent[key] = clone; - } - } else { - result = clone; - } - } while ((data = queue[index++])); - - // remove markers - for (index = 0, length = marked.length; index < length; index++) { - data = marked[index]; - delete data.object[data.key]; - } - return result; - } - - /** - * An iteration utility for arrays and objects. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @static - * @memberOf Benchmark - * @param {Array|Object} object The object to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Array|Object} Returns the object iterated over. - */ - function each(object, callback, thisArg) { - var result = object; - object = Object(object); - - var fn = callback, - index = -1, - length = object.length, - isSnapshot = !!(object.snapshotItem && (length = object.snapshotLength)), - isSplittable = (noCharByIndex || noCharByOwnIndex) && isClassOf(object, 'String'), - isConvertable = isSnapshot || isSplittable || 'item' in object, - origObject = object; - - // in Opera < 10.5 `hasKey(object, 'length')` returns `false` for NodeLists - if (length === length >>> 0) { - if (isConvertable) { - // the third argument of the callback is the original non-array object - callback = function(value, index) { - return fn.call(this, value, index, origObject); - }; - // in IE < 9 strings don't support accessing characters by index - if (isSplittable) { - object = object.split(''); - } else { - object = []; - while (++index < length) { - // in Safari 2 `index in object` is always `false` for NodeLists - object[index] = isSnapshot ? result.snapshotItem(index) : result[index]; - } - } - } - forEach(object, callback, thisArg); - } else { - forOwn(object, callback, thisArg); - } - return result; - } - - /** - * Copies enumerable properties from the source(s) object to the destination object. - * - * @static - * @memberOf Benchmark - * @param {Object} destination The destination object. - * @param {Object} [source={}] The source object. - * @returns {Object} The destination object. - */ - function extend(destination, source) { - // Chrome < 14 incorrectly sets `destination` to `undefined` when we `delete arguments[0]` - // http://code.google.com/p/v8/issues/detail?id=839 - var result = destination; - delete arguments[0]; - - forEach(arguments, function(source) { - forProps(source, function(value, key) { - result[key] = value; - }); - }); - return result; - } - - /** - * A generic `Array#filter` like method. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Function|String} callback The function/alias called per iteration. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Array} A new array of values that passed callback filter. - * @example - * - * // get odd numbers - * Benchmark.filter([1, 2, 3, 4, 5], function(n) { - * return n % 2; - * }); // -> [1, 3, 5]; - * - * // get fastest benchmarks - * Benchmark.filter(benches, 'fastest'); - * - * // get slowest benchmarks - * Benchmark.filter(benches, 'slowest'); - * - * // get benchmarks that completed without erroring - * Benchmark.filter(benches, 'successful'); - */ - function filter(array, callback, thisArg) { - var result; - - if (callback == 'successful') { - // callback to exclude those that are errored, unrun, or have hz of Infinity - callback = function(bench) { return bench.cycles && isFinite(bench.hz); }; - } - else if (callback == 'fastest' || callback == 'slowest') { - // get successful, sort by period + margin of error, and filter fastest/slowest - result = filter(array, 'successful').sort(function(a, b) { - a = a.stats; b = b.stats; - return (a.mean + a.moe > b.mean + b.moe ? 1 : -1) * (callback == 'fastest' ? 1 : -1); - }); - result = filter(result, function(bench) { - return result[0].compare(bench) == 0; - }); - } - return result || reduce(array, function(result, value, index) { - return callback.call(thisArg, value, index, array) ? (result.push(value), result) : result; - }, []); - } - - /** - * A generic `Array#forEach` like method. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Array} Returns the array iterated over. - */ - function forEach(array, callback, thisArg) { - var index = -1, - length = (array = Object(array)).length >>> 0; - - if (thisArg !== undefined) { - callback = bind(callback, thisArg); - } - while (++index < length) { - if (index in array && - callback(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * Iterates over an object's own properties, executing the `callback` for each. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @static - * @memberOf Benchmark - * @param {Object} object The object to iterate over. - * @param {Function} callback The function executed per own property. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Object} Returns the object iterated over. - */ - function forOwn(object, callback, thisArg) { - return forProps(object, callback, { 'bind': thisArg, 'which': 'own' }); - } - - /** - * Converts a number to a more readable comma-separated string representation. - * - * @static - * @memberOf Benchmark - * @param {Number} number The number to convert. - * @returns {String} The more readable string representation. - */ - function formatNumber(number) { - number = String(number).split('.'); - return number[0].replace(/(?=(?:\d{3})+$)(?!\b)/g, ',') + - (number[1] ? '.' + number[1] : ''); - } - - /** - * Checks if an object has the specified key as a direct property. - * - * @static - * @memberOf Benchmark - * @param {Object} object The object to check. - * @param {String} key The key to check for. - * @returns {Boolean} Returns `true` if key is a direct property, else `false`. - */ - function hasKey() { - // lazy define for worst case fallback (not as accurate) - hasKey = function(object, key) { - var parent = object != null && (object.constructor || Object).prototype; - return !!parent && key in Object(object) && !(key in parent && object[key] === parent[key]); - }; - // for modern browsers - if (isClassOf(hasOwnProperty, 'Function')) { - hasKey = function(object, key) { - return object != null && hasOwnProperty.call(object, key); - }; - } - // for Safari 2 - else if ({}.__proto__ == Object.prototype) { - hasKey = function(object, key) { - var result = false; - if (object != null) { - object = Object(object); - object.__proto__ = [object.__proto__, object.__proto__ = null, result = key in object][0]; - } - return result; - }; - } - return hasKey.apply(this, arguments); - } - - /** - * A generic `Array#indexOf` like method. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=0] The index to start searching from. - * @returns {Number} The index of the matched value or `-1`. - */ - function indexOf(array, value, fromIndex) { - var index = toInteger(fromIndex), - length = (array = Object(array)).length >>> 0; - - index = (index < 0 ? max(0, length + index) : index) - 1; - while (++index < length) { - if (index in array && value === array[index]) { - return index; - } - } - return -1; - } - - /** - * Modify a string by replacing named tokens with matching object property values. - * - * @static - * @memberOf Benchmark - * @param {String} string The string to modify. - * @param {Object} object The template object. - * @returns {String} The modified string. - */ - function interpolate(string, object) { - forOwn(object, function(value, key) { - // escape regexp special characters in `key` - string = string.replace( - RegExp('#\\{' + key.replace(/([.*+?^${}()|[\]\\])/g, '\\$1') + '\\}', 'g'), - value.replace(/\$/g, '$$$$') - ); - }); - return string; - } - - /** - * Invokes a method on all items in an array. - * - * @static - * @memberOf Benchmark - * @param {Array} benches Array of benchmarks to iterate over. - * @param {String|Object} name The name of the method to invoke OR options object. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. - * @returns {Array} A new array of values returned from each method invoked. - * @example - * - * // invoke `reset` on all benchmarks - * Benchmark.invoke(benches, 'reset'); - * - * // invoke `emit` with arguments - * Benchmark.invoke(benches, 'emit', 'complete', listener); - * - * // invoke `run(true)`, treat benchmarks as a queue, and register invoke callbacks - * Benchmark.invoke(benches, { - * - * // invoke the `run` method - * 'name': 'run', - * - * // pass a single argument - * 'args': true, - * - * // treat as queue, removing benchmarks from front of `benches` until empty - * 'queued': true, - * - * // called before any benchmarks have been invoked. - * 'onStart': onStart, - * - * // called between invoking benchmarks - * 'onCycle': onCycle, - * - * // called after all benchmarks have been invoked. - * 'onComplete': onComplete - * }); - */ - function invoke(benches, name) { - var args, - bench, - queued, - index = -1, - eventProps = { 'currentTarget': benches }, - options = { 'onStart': noop, 'onCycle': noop, 'onComplete': noop }, - result = map(benches, function(bench) { return bench; }); - - /** - * Invokes the method of the current object and if synchronous, fetches the next. - */ - function execute() { - var listeners, - async = isAsync(bench); - - if (async) { - // use `getNext` as the first listener - bench.on('complete', getNext); - listeners = bench.events.complete; - listeners.splice(0, 0, listeners.pop()); - } - // execute method - result[index] = isClassOf(bench && bench[name], 'Function') ? bench[name].apply(bench, args) : undefined; - // if synchronous return true until finished - return !async && getNext(); - } - - /** - * Fetches the next bench or executes `onComplete` callback. - */ - function getNext(event) { - var cycleEvent, - last = bench, - async = isAsync(last); - - if (async) { - last.off('complete', getNext); - last.emit('complete'); - } - // emit "cycle" event - eventProps.type = 'cycle'; - eventProps.target = last; - cycleEvent = Event(eventProps); - options.onCycle.call(benches, cycleEvent); - - // choose next benchmark if not exiting early - if (!cycleEvent.aborted && raiseIndex() !== false) { - bench = queued ? benches[0] : result[index]; - if (isAsync(bench)) { - delay(bench, execute); - } - else if (async) { - // resume execution if previously asynchronous but now synchronous - while (execute()) { } - } - else { - // continue synchronous execution - return true; - } - } else { - // emit "complete" event - eventProps.type = 'complete'; - options.onComplete.call(benches, Event(eventProps)); - } - // When used as a listener `event.aborted = true` will cancel the rest of - // the "complete" listeners because they were already called above and when - // used as part of `getNext` the `return false` will exit the execution while-loop. - if (event) { - event.aborted = true; - } else { - return false; - } - } - - /** - * Checks if invoking `Benchmark#run` with asynchronous cycles. - */ - function isAsync(object) { - // avoid using `instanceof` here because of IE memory leak issues with host objects - var async = args[0] && args[0].async; - return Object(object).constructor == Benchmark && name == 'run' && - ((async == null ? object.options.async : async) && support.timeout || object.defer); - } - - /** - * Raises `index` to the next defined index or returns `false`. - */ - function raiseIndex() { - var length = result.length; - if (queued) { - // if queued remove the previous bench and subsequent skipped non-entries - do { - ++index > 0 && shift.call(benches); - } while ((length = benches.length) && !('0' in benches)); - } - else { - while (++index < length && !(index in result)) { } - } - // if we reached the last index then return `false` - return (queued ? length : index < length) ? index : (index = false); - } - - // juggle arguments - if (isClassOf(name, 'String')) { - // 2 arguments (array, name) - args = slice.call(arguments, 2); - } else { - // 2 arguments (array, options) - options = extend(options, name); - name = options.name; - args = isClassOf(args = 'args' in options ? options.args : [], 'Array') ? args : [args]; - queued = options.queued; - } - - // start iterating over the array - if (raiseIndex() !== false) { - // emit "start" event - bench = result[index]; - eventProps.type = 'start'; - eventProps.target = bench; - options.onStart.call(benches, Event(eventProps)); - - // end early if the suite was aborted in an "onStart" listener - if (benches.aborted && benches.constructor == Suite && name == 'run') { - // emit "cycle" event - eventProps.type = 'cycle'; - options.onCycle.call(benches, Event(eventProps)); - // emit "complete" event - eventProps.type = 'complete'; - options.onComplete.call(benches, Event(eventProps)); - } - // else start - else { - if (isAsync(bench)) { - delay(bench, execute); - } else { - while (execute()) { } - } - } - } - return result; - } - - /** - * Creates a string of joined array values or object key-value pairs. - * - * @static - * @memberOf Benchmark - * @param {Array|Object} object The object to operate on. - * @param {String} [separator1=','] The separator used between key-value pairs. - * @param {String} [separator2=': '] The separator used between keys and values. - * @returns {String} The joined result. - */ - function join(object, separator1, separator2) { - var result = [], - length = (object = Object(object)).length, - arrayLike = length === length >>> 0; - - separator2 || (separator2 = ': '); - each(object, function(value, key) { - result.push(arrayLike ? value : key + separator2 + value); - }); - return result.join(separator1 || ','); - } - - /** - * A generic `Array#map` like method. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} thisArg The `this` binding for the callback. - * @returns {Array} A new array of values returned by the callback. - */ - function map(array, callback, thisArg) { - return reduce(array, function(result, value, index) { - result[index] = callback.call(thisArg, value, index, array); - return result; - }, Array(Object(array).length >>> 0)); - } - - /** - * Retrieves the value of a specified property from all items in an array. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {String} property The property to pluck. - * @returns {Array} A new array of property values. - */ - function pluck(array, property) { - return map(array, function(object) { - return object == null ? undefined : object[property]; - }); - } - - /** - * A generic `Array#reduce` like method. - * - * @static - * @memberOf Benchmark - * @param {Array} array The array to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} accumulator Initial value of the accumulator. - * @returns {Mixed} The accumulator. - */ - function reduce(array, callback, accumulator) { - var noaccum = arguments.length < 3; - forEach(array, function(value, index) { - accumulator = noaccum ? (noaccum = false, value) : callback(accumulator, value, index, array); - }); - return accumulator; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Aborts all benchmarks in the suite. - * - * @name abort - * @memberOf Benchmark.Suite - * @returns {Object} The suite instance. - */ - function abortSuite() { - var event, - me = this, - resetting = calledBy.resetSuite; - - if (me.running) { - event = Event('abort'); - me.emit(event); - if (!event.cancelled || resetting) { - // avoid infinite recursion - calledBy.abortSuite = true; - me.reset(); - delete calledBy.abortSuite; - - if (!resetting) { - me.aborted = true; - invoke(me, 'abort'); - } - } - } - return me; - } - - /** - * Adds a test to the benchmark suite. - * - * @memberOf Benchmark.Suite - * @param {String} name A name to identify the benchmark. - * @param {Function|String} fn The test to benchmark. - * @param {Object} [options={}] Options object. - * @returns {Object} The benchmark instance. - * @example - * - * // basic usage - * suite.add(fn); - * - * // or using a name first - * suite.add('foo', fn); - * - * // or with options - * suite.add('foo', fn, { - * 'onCycle': onCycle, - * 'onComplete': onComplete - * }); - * - * // or name and options - * suite.add('foo', { - * 'fn': fn, - * 'onCycle': onCycle, - * 'onComplete': onComplete - * }); - * - * // or options only - * suite.add({ - * 'name': 'foo', - * 'fn': fn, - * 'onCycle': onCycle, - * 'onComplete': onComplete - * }); - */ - function add(name, fn, options) { - var me = this, - bench = Benchmark(name, fn, options), - event = Event({ 'type': 'add', 'target': bench }); - - if (me.emit(event), !event.cancelled) { - me.push(bench); - } - return me; - } - - /** - * Creates a new suite with cloned benchmarks. - * - * @name clone - * @memberOf Benchmark.Suite - * @param {Object} options Options object to overwrite cloned options. - * @returns {Object} The new suite instance. - */ - function cloneSuite(options) { - var me = this, - result = new me.constructor(extend({}, me.options, options)); - - // copy own properties - forOwn(me, function(value, key) { - if (!hasKey(result, key)) { - result[key] = value && isClassOf(value.clone, 'Function') - ? value.clone() - : deepClone(value); - } - }); - return result; - } - - /** - * An `Array#filter` like method. - * - * @name filter - * @memberOf Benchmark.Suite - * @param {Function|String} callback The function/alias called per iteration. - * @returns {Object} A new suite of benchmarks that passed callback filter. - */ - function filterSuite(callback) { - var me = this, - result = new me.constructor; - - result.push.apply(result, filter(me, callback)); - return result; - } - - /** - * Resets all benchmarks in the suite. - * - * @name reset - * @memberOf Benchmark.Suite - * @returns {Object} The suite instance. - */ - function resetSuite() { - var event, - me = this, - aborting = calledBy.abortSuite; - - if (me.running && !aborting) { - // no worries, `resetSuite()` is called within `abortSuite()` - calledBy.resetSuite = true; - me.abort(); - delete calledBy.resetSuite; - } - // reset if the state has changed - else if ((me.aborted || me.running) && - (me.emit(event = Event('reset')), !event.cancelled)) { - me.running = false; - if (!aborting) { - invoke(me, 'reset'); - } - } - return me; - } - - /** - * Runs the suite. - * - * @name run - * @memberOf Benchmark.Suite - * @param {Object} [options={}] Options object. - * @returns {Object} The suite instance. - * @example - * - * // basic usage - * suite.run(); - * - * // or with options - * suite.run({ 'async': true, 'queued': true }); - */ - function runSuite(options) { - var me = this; - - me.reset(); - me.running = true; - options || (options = {}); - - invoke(me, { - 'name': 'run', - 'args': options, - 'queued': options.queued, - 'onStart': function(event) { - me.emit(event); - }, - 'onCycle': function(event) { - var bench = event.target; - if (bench.error) { - me.emit({ 'type': 'error', 'target': bench }); - } - me.emit(event); - event.aborted = me.aborted; - }, - 'onComplete': function(event) { - me.score = getGeometricMean(map(me, function(bench) { - return bench.reference / (bench.times.period * 1e6); - })) || 0; - - me.running = false; - me.emit(event); - } - }); - return me; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Executes all registered listeners of the specified event type. - * - * @memberOf Benchmark, Benchmark.Suite - * @param {String|Object} type The event type or object. - * @returns {Mixed} Returns the return value of the last listener executed. - */ - function emit(type) { - var listeners, - me = this, - event = Event(type), - events = me.events, - args = (arguments[0] = event, arguments); - - event.currentTarget || (event.currentTarget = me); - event.target || (event.target = me); - delete event.result; - - if (events && (listeners = hasKey(events, event.type) && events[event.type])) { - forEach(listeners.slice(), function(listener) { - if ((event.result = listener.apply(me, args)) === false) { - event.cancelled = true; - } - return !event.aborted; - }); - } - return event.result; - } - - /** - * Returns an array of event listeners for a given type that can be manipulated - * to add or remove listeners. - * - * @memberOf Benchmark, Benchmark.Suite - * @param {String} type The event type. - * @returns {Array} The listeners array. - */ - function listeners(type) { - var me = this, - events = me.events || (me.events = {}); - - return hasKey(events, type) ? events[type] : (events[type] = []); - } - - /** - * Unregisters a listener for the specified event type(s), - * or unregisters all listeners for the specified event type(s), - * or unregisters all listeners for all event types. - * - * @memberOf Benchmark, Benchmark.Suite - * @param {String} [type] The event type. - * @param {Function} [listener] The function to unregister. - * @returns {Object} The benchmark instance. - * @example - * - * // unregister a listener for an event type - * bench.off('cycle', listener); - * - * // unregister a listener for multiple event types - * bench.off('start cycle', listener); - * - * // unregister all listeners for an event type - * bench.off('cycle'); - * - * // unregister all listeners for multiple event types - * bench.off('start cycle complete'); - * - * // unregister all listeners for all event types - * bench.off(); - */ - function off(type, listener) { - var me = this, - events = me.events; - - events && each(type ? type.split(' ') : events, function(listeners, type) { - var index; - if (typeof listeners == 'string') { - type = listeners; - listeners = hasKey(events, type) && events[type]; - } - if (listeners) { - if (listener) { - index = indexOf(listeners, listener); - if (index > -1) { - listeners.splice(index, 1); - } - } else { - listeners.length = 0; - } - } - }); - return me; - } - - /** - * Registers a listener for the specified event type(s). - * - * @memberOf Benchmark, Benchmark.Suite - * @param {String} type The event type. - * @param {Function} listener The function to register. - * @returns {Object} The benchmark instance. - * @example - * - * // register a listener for an event type - * bench.on('cycle', listener); - * - * // register a listener for multiple event types - * bench.on('start cycle', listener); - */ - function on(type, listener) { - var me = this, - events = me.events || (me.events = {}); - - forEach(type.split(' '), function(type) { - (hasKey(events, type) - ? events[type] - : (events[type] = []) - ).push(listener); - }); - return me; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Aborts the benchmark without recording times. - * - * @memberOf Benchmark - * @returns {Object} The benchmark instance. - */ - function abort() { - var event, - me = this, - resetting = calledBy.reset; - - if (me.running) { - event = Event('abort'); - me.emit(event); - if (!event.cancelled || resetting) { - // avoid infinite recursion - calledBy.abort = true; - me.reset(); - delete calledBy.abort; - - if (support.timeout) { - clearTimeout(me._timerId); - delete me._timerId; - } - if (!resetting) { - me.aborted = true; - me.running = false; - } - } - } - return me; - } - - /** - * Creates a new benchmark using the same test and options. - * - * @memberOf Benchmark - * @param {Object} options Options object to overwrite cloned options. - * @returns {Object} The new benchmark instance. - * @example - * - * var bizarro = bench.clone({ - * 'name': 'doppelganger' - * }); - */ - function clone(options) { - var me = this, - result = new me.constructor(extend({}, me, options)); - - // correct the `options` object - result.options = extend({}, me.options, options); - - // copy own custom properties - forOwn(me, function(value, key) { - if (!hasKey(result, key)) { - result[key] = deepClone(value); - } - }); - return result; - } - - /** - * Determines if a benchmark is faster than another. - * - * @memberOf Benchmark - * @param {Object} other The benchmark to compare. - * @returns {Number} Returns `-1` if slower, `1` if faster, and `0` if indeterminate. - */ - function compare(other) { - var critical, - zStat, - me = this, - sample1 = me.stats.sample, - sample2 = other.stats.sample, - size1 = sample1.length, - size2 = sample2.length, - maxSize = max(size1, size2), - minSize = min(size1, size2), - u1 = getU(sample1, sample2), - u2 = getU(sample2, sample1), - u = min(u1, u2); - - function getScore(xA, sampleB) { - return reduce(sampleB, function(total, xB) { - return total + (xB > xA ? 0 : xB < xA ? 1 : 0.5); - }, 0); - } - - function getU(sampleA, sampleB) { - return reduce(sampleA, function(total, xA) { - return total + getScore(xA, sampleB); - }, 0); - } - - function getZ(u) { - return (u - ((size1 * size2) / 2)) / sqrt((size1 * size2 * (size1 + size2 + 1)) / 12); - } - - // exit early if comparing the same benchmark - if (me == other) { - return 0; - } - // reject the null hyphothesis the two samples come from the - // same population (i.e. have the same median) if... - if (size1 + size2 > 30) { - // ...the z-stat is greater than 1.96 or less than -1.96 - // http://www.statisticslectures.com/topics/mannwhitneyu/ - zStat = getZ(u); - return abs(zStat) > 1.96 ? (zStat > 0 ? -1 : 1) : 0; - } - // ...the U value is less than or equal the critical U value - // http://www.geoib.com/mann-whitney-u-test.html - critical = maxSize < 5 || minSize < 3 ? 0 : uTable[maxSize][minSize - 3]; - return u <= critical ? (u == u1 ? 1 : -1) : 0; - } - - /** - * Reset properties and abort if running. - * - * @memberOf Benchmark - * @returns {Object} The benchmark instance. - */ - function reset() { - var data, - event, - me = this, - index = 0, - changes = { 'length': 0 }, - queue = { 'length': 0 }; - - if (me.running && !calledBy.abort) { - // no worries, `reset()` is called within `abort()` - calledBy.reset = true; - me.abort(); - delete calledBy.reset; - } - else { - // a non-recursive solution to check if properties have changed - // http://www.jslab.dk/articles/non.recursive.preorder.traversal.part4 - data = { 'destination': me, 'source': extend({}, me.constructor.prototype, me.options) }; - do { - forOwn(data.source, function(value, key) { - var changed, - destination = data.destination, - currValue = destination[key]; - - if (value && typeof value == 'object') { - if (isClassOf(value, 'Array')) { - // check if an array value has changed to a non-array value - if (!isClassOf(currValue, 'Array')) { - changed = currValue = []; - } - // or has changed its length - if (currValue.length != value.length) { - changed = currValue = currValue.slice(0, value.length); - currValue.length = value.length; - } - } - // check if an object has changed to a non-object value - else if (!currValue || typeof currValue != 'object') { - changed = currValue = {}; - } - // register a changed object - if (changed) { - changes[changes.length++] = { 'destination': destination, 'key': key, 'value': currValue }; - } - queue[queue.length++] = { 'destination': currValue, 'source': value }; - } - // register a changed primitive - else if (value !== currValue && !(value == null || isClassOf(value, 'Function'))) { - changes[changes.length++] = { 'destination': destination, 'key': key, 'value': value }; - } - }); - } - while ((data = queue[index++])); - - // if changed emit the `reset` event and if it isn't cancelled reset the benchmark - if (changes.length && (me.emit(event = Event('reset')), !event.cancelled)) { - forEach(changes, function(data) { - data.destination[data.key] = data.value; - }); - } - } - return me; - } - - /** - * Displays relevant benchmark information when coerced to a string. - * - * @name toString - * @memberOf Benchmark - * @returns {String} A string representation of the benchmark instance. - */ - function toStringBench() { - var me = this, - error = me.error, - hz = me.hz, - id = me.id, - stats = me.stats, - size = stats.sample.length, - pm = support.java ? '+/-' : '\xb1', - result = me.name || (isNaN(id) ? id : ''); - - if (error) { - result += ': ' + join(error); - } else { - result += ' x ' + formatNumber(hz.toFixed(hz < 100 ? 2 : 0)) + ' ops/sec ' + pm + - stats.rme.toFixed(2) + '% (' + size + ' run' + (size == 1 ? '' : 's') + ' sampled)'; - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Clocks the time taken to execute a test per cycle (secs). - * - * @private - * @param {Object} bench The benchmark instance. - * @returns {Number} The time taken. - */ - function clock() { - var applet, - options = Benchmark.options, - template = { 'begin': 's$=new n$', 'end': 'r$=(new n$-s$)/1e3', 'uid': uid }, - timers = [{ 'ns': timer.ns, 'res': max(0.0015, getRes('ms')), 'unit': 'ms' }]; - - // lazy define for hi-res timers - clock = function(clone) { - var deferred; - if (clone instanceof Deferred) { - deferred = clone; - clone = deferred.benchmark; - } - - var bench = clone._original, - fn = bench.fn, - fnArg = deferred ? getFirstArgument(fn) || 'deferred' : '', - stringable = isStringable(fn); - - var source = { - 'setup': getSource(bench.setup, preprocess('m$.setup()')), - 'fn': getSource(fn, preprocess('m$.fn(' + fnArg + ')')), - 'fnArg': fnArg, - 'teardown': getSource(bench.teardown, preprocess('m$.teardown()')) - }; - - var count = bench.count = clone.count, - decompilable = support.decompilation || stringable, - id = bench.id, - isEmpty = !(source.fn || stringable), - name = bench.name || (typeof id == 'number' ? '' : id), - ns = timer.ns, - result = 0; - - // init `minTime` if needed - clone.minTime = bench.minTime || (bench.minTime = bench.options.minTime = options.minTime); - - // repair nanosecond timer - // (some Chrome builds erase the `ns` variable after millions of executions) - if (applet) { - try { - ns.nanoTime(); - } catch(e) { - // use non-element to avoid issues with libs that augment them - ns = timer.ns = new applet.Packages.nano; - } - } - - // Compile in setup/teardown functions and the test loop. - // Create a new compiled test, instead of using the cached `bench.compiled`, - // to avoid potential engine optimizations enabled over the life of the test. - var compiled = bench.compiled = createFunction(preprocess('t$'), interpolate( - preprocess(deferred - ? 'var d$=this,#{fnArg}=d$,m$=d$.benchmark._original,f$=m$.fn,su$=m$.setup,td$=m$.teardown;' + - // when `deferred.cycles` is `0` then... - 'if(!d$.cycles){' + - // set `deferred.fn` - 'd$.fn=function(){var #{fnArg}=d$;if(typeof f$=="function"){try{#{fn}\n}catch(e$){f$(d$)}}else{#{fn}\n}};' + - // set `deferred.teardown` - 'd$.teardown=function(){d$.cycles=0;if(typeof td$=="function"){try{#{teardown}\n}catch(e$){td$()}}else{#{teardown}\n}};' + - // execute the benchmark's `setup` - 'if(typeof su$=="function"){try{#{setup}\n}catch(e$){su$()}}else{#{setup}\n};' + - // start timer - 't$.start(d$);' + - // execute `deferred.fn` and return a dummy object - '}d$.fn();return{}' - - : 'var r$,s$,m$=this,f$=m$.fn,i$=m$.count,n$=t$.ns;#{setup}\n#{begin};' + - 'while(i$--){#{fn}\n}#{end};#{teardown}\nreturn{elapsed:r$,uid:"#{uid}"}'), - source - )); - - try { - if (isEmpty) { - // Firefox may remove dead code from Function#toString results - // http://bugzil.la/536085 - throw new Error('The test "' + name + '" is empty. This may be the result of dead code removal.'); - } - else if (!deferred) { - // pretest to determine if compiled code is exits early, usually by a - // rogue `return` statement, by checking for a return object with the uid - bench.count = 1; - compiled = (compiled.call(bench, timer) || {}).uid == uid && compiled; - bench.count = count; - } - } catch(e) { - compiled = null; - clone.error = e || new Error(String(e)); - bench.count = count; - } - // fallback when a test exits early or errors during pretest - if (decompilable && !compiled && !deferred && !isEmpty) { - compiled = createFunction(preprocess('t$'), interpolate( - preprocess( - (clone.error && !stringable - ? 'var r$,s$,m$=this,f$=m$.fn,i$=m$.count' - : 'function f$(){#{fn}\n}var r$,s$,m$=this,i$=m$.count' - ) + - ',n$=t$.ns;#{setup}\n#{begin};m$.f$=f$;while(i$--){m$.f$()}#{end};' + - 'delete m$.f$;#{teardown}\nreturn{elapsed:r$}' - ), - source - )); - - try { - // pretest one more time to check for errors - bench.count = 1; - compiled.call(bench, timer); - bench.compiled = compiled; - bench.count = count; - delete clone.error; - } - catch(e) { - bench.count = count; - if (clone.error) { - compiled = null; - } else { - bench.compiled = compiled; - clone.error = e || new Error(String(e)); - } - } - } - // assign `compiled` to `clone` before calling in case a deferred benchmark - // immediately calls `deferred.resolve()` - clone.compiled = compiled; - // if no errors run the full test loop - if (!clone.error) { - result = compiled.call(deferred || bench, timer).elapsed; - } - return result; - }; - - /*------------------------------------------------------------------------*/ - - /** - * Gets the current timer's minimum resolution (secs). - */ - function getRes(unit) { - var measured, - begin, - count = 30, - divisor = 1e3, - ns = timer.ns, - sample = []; - - // get average smallest measurable time - while (count--) { - if (unit == 'us') { - divisor = 1e6; - if (ns.stop) { - ns.start(); - while (!(measured = ns.microseconds())) { } - } else if (ns[perfName]) { - divisor = 1e3; - measured = Function('n', 'var r,s=n.' + perfName + '();while(!(r=n.' + perfName + '()-s)){};return r')(ns); - } else { - begin = ns(); - while (!(measured = ns() - begin)) { } - } - } - else if (unit == 'ns') { - divisor = 1e9; - if (ns.nanoTime) { - begin = ns.nanoTime(); - while (!(measured = ns.nanoTime() - begin)) { } - } else { - begin = (begin = ns())[0] + (begin[1] / divisor); - while (!(measured = ((measured = ns())[0] + (measured[1] / divisor)) - begin)) { } - divisor = 1; - } - } - else { - begin = new ns; - while (!(measured = new ns - begin)) { } - } - // check for broken timers (nanoTime may have issues) - // http://alivebutsleepy.srnet.cz/unreliable-system-nanotime/ - if (measured > 0) { - sample.push(measured); - } else { - sample.push(Infinity); - break; - } - } - // convert to seconds - return getMean(sample) / divisor; - } - - /** - * Replaces all occurrences of `$` with a unique number and - * template tokens with content. - */ - function preprocess(code) { - return interpolate(code, template).replace(/\$/g, /\d+/.exec(uid)); - } - - /*------------------------------------------------------------------------*/ - - // detect nanosecond support from a Java applet - each(doc && doc.applets || [], function(element) { - return !(timer.ns = applet = 'nanoTime' in element && element); - }); - - // check type in case Safari returns an object instead of a number - try { - if (typeof timer.ns.nanoTime() == 'number') { - timers.push({ 'ns': timer.ns, 'res': getRes('ns'), 'unit': 'ns' }); - } - } catch(e) { } - - // detect Chrome's microsecond timer: - // enable benchmarking via the --enable-benchmarking command - // line switch in at least Chrome 7 to use chrome.Interval - try { - if ((timer.ns = new (window.chrome || window.chromium).Interval)) { - timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' }); - } - } catch(e) { } - - // detect `performance.now` microsecond resolution timer - if ((timer.ns = perfName && perfObject)) { - timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' }); - } - - // detect Node's nanosecond resolution timer available in Node >= 0.8 - if (processObject && typeof (timer.ns = processObject.hrtime) == 'function') { - timers.push({ 'ns': timer.ns, 'res': getRes('ns'), 'unit': 'ns' }); - } - - // detect Wade Simmons' Node microtime module - if (microtimeObject && typeof (timer.ns = microtimeObject.now) == 'function') { - timers.push({ 'ns': timer.ns, 'res': getRes('us'), 'unit': 'us' }); - } - - // pick timer with highest resolution - timer = reduce(timers, function(timer, other) { - return other.res < timer.res ? other : timer; - }); - - // remove unused applet - if (timer.unit != 'ns' && applet) { - applet = destroyElement(applet); - } - // error if there are no working timers - if (timer.res == Infinity) { - throw new Error('Benchmark.js was unable to find a working timer.'); - } - // use API of chosen timer - if (timer.unit == 'ns') { - if (timer.ns.nanoTime) { - extend(template, { - 'begin': 's$=n$.nanoTime()', - 'end': 'r$=(n$.nanoTime()-s$)/1e9' - }); - } else { - extend(template, { - 'begin': 's$=n$()', - 'end': 'r$=n$(s$);r$=r$[0]+(r$[1]/1e9)' - }); - } - } - else if (timer.unit == 'us') { - if (timer.ns.stop) { - extend(template, { - 'begin': 's$=n$.start()', - 'end': 'r$=n$.microseconds()/1e6' - }); - } else if (perfName) { - extend(template, { - 'begin': 's$=n$.' + perfName + '()', - 'end': 'r$=(n$.' + perfName + '()-s$)/1e3' - }); - } else { - extend(template, { - 'begin': 's$=n$()', - 'end': 'r$=(n$()-s$)/1e6' - }); - } - } - - // define `timer` methods - timer.start = createFunction(preprocess('o$'), - preprocess('var n$=this.ns,#{begin};o$.elapsed=0;o$.timeStamp=s$')); - - timer.stop = createFunction(preprocess('o$'), - preprocess('var n$=this.ns,s$=o$.timeStamp,#{end};o$.elapsed=r$')); - - // resolve time span required to achieve a percent uncertainty of at most 1% - // http://spiff.rit.edu/classes/phys273/uncert/uncert.html - options.minTime || (options.minTime = max(timer.res / 2 / 0.01, 0.05)); - return clock.apply(null, arguments); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Computes stats on benchmark results. - * - * @private - * @param {Object} bench The benchmark instance. - * @param {Object} options The options object. - */ - function compute(bench, options) { - options || (options = {}); - - var async = options.async, - elapsed = 0, - initCount = bench.initCount, - minSamples = bench.minSamples, - queue = [], - sample = bench.stats.sample; - - /** - * Adds a clone to the queue. - */ - function enqueue() { - queue.push(bench.clone({ - '_original': bench, - 'events': { - 'abort': [update], - 'cycle': [update], - 'error': [update], - 'start': [update] - } - })); - } - - /** - * Updates the clone/original benchmarks to keep their data in sync. - */ - function update(event) { - var clone = this, - type = event.type; - - if (bench.running) { - if (type == 'start') { - // Note: `clone.minTime` prop is inited in `clock()` - clone.count = bench.initCount; - } - else { - if (type == 'error') { - bench.error = clone.error; - } - if (type == 'abort') { - bench.abort(); - bench.emit('cycle'); - } else { - event.currentTarget = event.target = bench; - bench.emit(event); - } - } - } else if (bench.aborted) { - // clear abort listeners to avoid triggering bench's abort/cycle again - clone.events.abort.length = 0; - clone.abort(); - } - } - - /** - * Determines if more clones should be queued or if cycling should stop. - */ - function evaluate(event) { - var critical, - df, - mean, - moe, - rme, - sd, - sem, - variance, - clone = event.target, - done = bench.aborted, - now = +new Date, - size = sample.push(clone.times.period), - maxedOut = size >= minSamples && (elapsed += now - clone.times.timeStamp) / 1e3 > bench.maxTime, - times = bench.times, - varOf = function(sum, x) { return sum + pow(x - mean, 2); }; - - // exit early for aborted or unclockable tests - if (done || clone.hz == Infinity) { - maxedOut = !(size = sample.length = queue.length = 0); - } - - if (!done) { - // sample mean (estimate of the population mean) - mean = getMean(sample); - // sample variance (estimate of the population variance) - variance = reduce(sample, varOf, 0) / (size - 1) || 0; - // sample standard deviation (estimate of the population standard deviation) - sd = sqrt(variance); - // standard error of the mean (a.k.a. the standard deviation of the sampling distribution of the sample mean) - sem = sd / sqrt(size); - // degrees of freedom - df = size - 1; - // critical value - critical = tTable[Math.round(df) || 1] || tTable.infinity; - // margin of error - moe = sem * critical; - // relative margin of error - rme = (moe / mean) * 100 || 0; - - extend(bench.stats, { - 'deviation': sd, - 'mean': mean, - 'moe': moe, - 'rme': rme, - 'sem': sem, - 'variance': variance - }); - - // Abort the cycle loop when the minimum sample size has been collected - // and the elapsed time exceeds the maximum time allowed per benchmark. - // We don't count cycle delays toward the max time because delays may be - // increased by browsers that clamp timeouts for inactive tabs. - // https://developer.mozilla.org/en/window.setTimeout#Inactive_tabs - if (maxedOut) { - // reset the `initCount` in case the benchmark is rerun - bench.initCount = initCount; - bench.running = false; - done = true; - times.elapsed = (now - times.timeStamp) / 1e3; - } - if (bench.hz != Infinity) { - bench.hz = 1 / mean; - times.cycle = mean * bench.count; - times.period = mean; - } - } - // if time permits, increase sample size to reduce the margin of error - if (queue.length < 2 && !maxedOut) { - enqueue(); - } - // abort the invoke cycle when done - event.aborted = done; - } - - // init queue and begin - enqueue(); - invoke(queue, { - 'name': 'run', - 'args': { 'async': async }, - 'queued': true, - 'onCycle': evaluate, - 'onComplete': function() { bench.emit('complete'); } - }); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Cycles a benchmark until a run `count` can be established. - * - * @private - * @param {Object} clone The cloned benchmark instance. - * @param {Object} options The options object. - */ - function cycle(clone, options) { - options || (options = {}); - - var deferred; - if (clone instanceof Deferred) { - deferred = clone; - clone = clone.benchmark; - } - - var clocked, - cycles, - divisor, - event, - minTime, - period, - async = options.async, - bench = clone._original, - count = clone.count, - times = clone.times; - - // continue, if not aborted between cycles - if (clone.running) { - // `minTime` is set to `Benchmark.options.minTime` in `clock()` - cycles = ++clone.cycles; - clocked = deferred ? deferred.elapsed : clock(clone); - minTime = clone.minTime; - - if (cycles > bench.cycles) { - bench.cycles = cycles; - } - if (clone.error) { - event = Event('error'); - event.message = clone.error; - clone.emit(event); - if (!event.cancelled) { - clone.abort(); - } - } - } - - // continue, if not errored - if (clone.running) { - // time taken to complete last test cycle - bench.times.cycle = times.cycle = clocked; - // seconds per operation - period = bench.times.period = times.period = clocked / count; - // ops per second - bench.hz = clone.hz = 1 / period; - // avoid working our way up to this next time - bench.initCount = clone.initCount = count; - // do we need to do another cycle? - clone.running = clocked < minTime; - - if (clone.running) { - // tests may clock at `0` when `initCount` is a small number, - // to avoid that we set its count to something a bit higher - if (!clocked && (divisor = divisors[clone.cycles]) != null) { - count = floor(4e6 / divisor); - } - // calculate how many more iterations it will take to achive the `minTime` - if (count <= clone.count) { - count += Math.ceil((minTime - clocked) / period); - } - clone.running = count != Infinity; - } - } - // should we exit early? - event = Event('cycle'); - clone.emit(event); - if (event.aborted) { - clone.abort(); - } - // figure out what to do next - if (clone.running) { - // start a new cycle - clone.count = count; - if (deferred) { - clone.compiled.call(deferred, timer); - } else if (async) { - delay(clone, function() { cycle(clone, options); }); - } else { - cycle(clone); - } - } - else { - // fix TraceMonkey bug associated with clock fallbacks - // http://bugzil.la/509069 - if (support.browser) { - runScript(uid + '=1;delete ' + uid); - } - // done - clone.emit('complete'); - } - } - - /*--------------------------------------------------------------------------*/ - - /** - * Runs the benchmark. - * - * @memberOf Benchmark - * @param {Object} [options={}] Options object. - * @returns {Object} The benchmark instance. - * @example - * - * // basic usage - * bench.run(); - * - * // or with options - * bench.run({ 'async': true }); - */ - function run(options) { - var me = this, - event = Event('start'); - - // set `running` to `false` so `reset()` won't call `abort()` - me.running = false; - me.reset(); - me.running = true; - - me.count = me.initCount; - me.times.timeStamp = +new Date; - me.emit(event); - - if (!event.cancelled) { - options = { 'async': ((options = options && options.async) == null ? me.async : options) && support.timeout }; - - // for clones created within `compute()` - if (me._original) { - if (me.defer) { - Deferred(me); - } else { - cycle(me, options); - } - } - // for original benchmarks - else { - compute(me, options); - } - } - return me; - } - - /*--------------------------------------------------------------------------*/ - - // Firefox 1 erroneously defines variable and argument names of functions on - // the function itself as non-configurable properties with `undefined` values. - // The bugginess continues as the `Benchmark` constructor has an argument - // named `options` and Firefox 1 will not assign a value to `Benchmark.options`, - // making it non-writable in the process, unless it is the first property - // assigned by for-in loop of `extend()`. - extend(Benchmark, { - - /** - * The default options copied by benchmark instances. - * - * @static - * @memberOf Benchmark - * @type Object - */ - 'options': { - - /** - * A flag to indicate that benchmark cycles will execute asynchronously - * by default. - * - * @memberOf Benchmark.options - * @type Boolean - */ - 'async': false, - - /** - * A flag to indicate that the benchmark clock is deferred. - * - * @memberOf Benchmark.options - * @type Boolean - */ - 'defer': false, - - /** - * The delay between test cycles (secs). - * @memberOf Benchmark.options - * @type Number - */ - 'delay': 0.005, - - /** - * Displayed by Benchmark#toString when a `name` is not available - * (auto-generated if absent). - * - * @memberOf Benchmark.options - * @type String - */ - 'id': undefined, - - /** - * The default number of times to execute a test on a benchmark's first cycle. - * - * @memberOf Benchmark.options - * @type Number - */ - 'initCount': 1, - - /** - * The maximum time a benchmark is allowed to run before finishing (secs). - * - * Note: Cycle delays aren't counted toward the maximum time. - * - * @memberOf Benchmark.options - * @type Number - */ - 'maxTime': 5, - - /** - * The minimum sample size required to perform statistical analysis. - * - * @memberOf Benchmark.options - * @type Number - */ - 'minSamples': 5, - - /** - * The time needed to reduce the percent uncertainty of measurement to 1% (secs). - * - * @memberOf Benchmark.options - * @type Number - */ - 'minTime': 0, - - /** - * The name of the benchmark. - * - * @memberOf Benchmark.options - * @type String - */ - 'name': undefined, - - /** - * An event listener called when the benchmark is aborted. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onAbort': undefined, - - /** - * An event listener called when the benchmark completes running. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onComplete': undefined, - - /** - * An event listener called after each run cycle. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onCycle': undefined, - - /** - * An event listener called when a test errors. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onError': undefined, - - /** - * An event listener called when the benchmark is reset. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onReset': undefined, - - /** - * An event listener called when the benchmark starts running. - * - * @memberOf Benchmark.options - * @type Function - */ - 'onStart': undefined, - - /** - * The reference time taken to execute the test once (usecs). - * - * @memberOf Benchmark.options - * @type Number - */ - 'reference': 0 - }, - - /** - * Platform object with properties describing things like browser name, - * version, and operating system. - * - * @static - * @memberOf Benchmark - * @type Object - */ - 'platform': req('platform') || window.platform || { - - /** - * The platform description. - * - * @memberOf Benchmark.platform - * @type String - */ - 'description': window.navigator && navigator.userAgent || null, - - /** - * The name of the browser layout engine. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'layout': null, - - /** - * The name of the product hosting the browser. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'product': null, - - /** - * The name of the browser/environment. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'name': null, - - /** - * The name of the product's manufacturer. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'manufacturer': null, - - /** - * The name of the operating system. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'os': null, - - /** - * The alpha/beta release indicator. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'prerelease': null, - - /** - * The browser/environment version. - * - * @memberOf Benchmark.platform - * @type String|Null - */ - 'version': null, - - /** - * Return platform description when the platform object is coerced to a string. - * - * @memberOf Benchmark.platform - * @type Function - * @returns {String} The platform description. - */ - 'toString': function() { - return this.description || ''; - } - }, - - /** - * The semantic version number. - * - * @static - * @memberOf Benchmark - * @type String - */ - 'version': '1.0.0', - - // an object of environment/feature detection flags - 'support': support, - - // clone objects - 'deepClone': deepClone, - - // iteration utility - 'each': each, - - // augment objects - 'extend': extend, - - // generic Array#filter - 'filter': filter, - - // generic Array#forEach - 'forEach': forEach, - - // generic own property iteration utility - 'forOwn': forOwn, - - // converts a number to a comma-separated string - 'formatNumber': formatNumber, - - // generic Object#hasOwnProperty - // (trigger hasKey's lazy define before assigning it to Benchmark) - 'hasKey': (hasKey(Benchmark, ''), hasKey), - - // generic Array#indexOf - 'indexOf': indexOf, - - // template utility - 'interpolate': interpolate, - - // invokes a method on each item in an array - 'invoke': invoke, - - // generic Array#join for arrays and objects - 'join': join, - - // generic Array#map - 'map': map, - - // retrieves a property value from each item in an array - 'pluck': pluck, - - // generic Array#reduce - 'reduce': reduce - }); - - /*--------------------------------------------------------------------------*/ - - extend(Benchmark.prototype, { - - /** - * The number of times a test was executed. - * - * @memberOf Benchmark - * @type Number - */ - 'count': 0, - - /** - * The number of cycles performed while benchmarking. - * - * @memberOf Benchmark - * @type Number - */ - 'cycles': 0, - - /** - * The number of executions per second. - * - * @memberOf Benchmark - * @type Number - */ - 'hz': 0, - - /** - * The compiled test function. - * - * @memberOf Benchmark - * @type Function|String - */ - 'compiled': undefined, - - /** - * The error object if the test failed. - * - * @memberOf Benchmark - * @type Object - */ - 'error': undefined, - - /** - * The test to benchmark. - * - * @memberOf Benchmark - * @type Function|String - */ - 'fn': undefined, - - /** - * A flag to indicate if the benchmark is aborted. - * - * @memberOf Benchmark - * @type Boolean - */ - 'aborted': false, - - /** - * A flag to indicate if the benchmark is running. - * - * @memberOf Benchmark - * @type Boolean - */ - 'running': false, - - /** - * Compiled into the test and executed immediately **before** the test loop. - * - * @memberOf Benchmark - * @type Function|String - * @example - * - * // basic usage - * var bench = Benchmark({ - * 'setup': function() { - * var c = this.count, - * element = document.getElementById('container'); - * while (c--) { - * element.appendChild(document.createElement('div')); - * } - * }, - * 'fn': function() { - * element.removeChild(element.lastChild); - * } - * }); - * - * // compiles to something like: - * var c = this.count, - * element = document.getElementById('container'); - * while (c--) { - * element.appendChild(document.createElement('div')); - * } - * var start = new Date; - * while (count--) { - * element.removeChild(element.lastChild); - * } - * var end = new Date - start; - * - * // or using strings - * var bench = Benchmark({ - * 'setup': '\ - * var a = 0;\n\ - * (function() {\n\ - * (function() {\n\ - * (function() {', - * 'fn': 'a += 1;', - * 'teardown': '\ - * }())\n\ - * }())\n\ - * }())' - * }); - * - * // compiles to something like: - * var a = 0; - * (function() { - * (function() { - * (function() { - * var start = new Date; - * while (count--) { - * a += 1; - * } - * var end = new Date - start; - * }()) - * }()) - * }()) - */ - 'setup': noop, - - /** - * Compiled into the test and executed immediately **after** the test loop. - * - * @memberOf Benchmark - * @type Function|String - */ - 'teardown': noop, - - /** - * An object of stats including mean, margin or error, and standard deviation. - * - * @memberOf Benchmark - * @type Object - */ - 'stats': { - - /** - * The margin of error. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'moe': 0, - - /** - * The relative margin of error (expressed as a percentage of the mean). - * - * @memberOf Benchmark#stats - * @type Number - */ - 'rme': 0, - - /** - * The standard error of the mean. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'sem': 0, - - /** - * The sample standard deviation. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'deviation': 0, - - /** - * The sample arithmetic mean. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'mean': 0, - - /** - * The array of sampled periods. - * - * @memberOf Benchmark#stats - * @type Array - */ - 'sample': [], - - /** - * The sample variance. - * - * @memberOf Benchmark#stats - * @type Number - */ - 'variance': 0 - }, - - /** - * An object of timing data including cycle, elapsed, period, start, and stop. - * - * @memberOf Benchmark - * @type Object - */ - 'times': { - - /** - * The time taken to complete the last cycle (secs). - * - * @memberOf Benchmark#times - * @type Number - */ - 'cycle': 0, - - /** - * The time taken to complete the benchmark (secs). - * - * @memberOf Benchmark#times - * @type Number - */ - 'elapsed': 0, - - /** - * The time taken to execute the test once (secs). - * - * @memberOf Benchmark#times - * @type Number - */ - 'period': 0, - - /** - * A timestamp of when the benchmark started (ms). - * - * @memberOf Benchmark#times - * @type Number - */ - 'timeStamp': 0 - }, - - // aborts benchmark (does not record times) - 'abort': abort, - - // creates a new benchmark using the same test and options - 'clone': clone, - - // compares benchmark's hertz with another - 'compare': compare, - - // executes listeners - 'emit': emit, - - // get listeners - 'listeners': listeners, - - // unregister listeners - 'off': off, - - // register listeners - 'on': on, - - // reset benchmark properties - 'reset': reset, - - // runs the benchmark - 'run': run, - - // pretty print benchmark info - 'toString': toStringBench - }); - - /*--------------------------------------------------------------------------*/ - - extend(Deferred.prototype, { - - /** - * The deferred benchmark instance. - * - * @memberOf Benchmark.Deferred - * @type Object - */ - 'benchmark': null, - - /** - * The number of deferred cycles performed while benchmarking. - * - * @memberOf Benchmark.Deferred - * @type Number - */ - 'cycles': 0, - - /** - * The time taken to complete the deferred benchmark (secs). - * - * @memberOf Benchmark.Deferred - * @type Number - */ - 'elapsed': 0, - - /** - * A timestamp of when the deferred benchmark started (ms). - * - * @memberOf Benchmark.Deferred - * @type Number - */ - 'timeStamp': 0, - - // cycles/completes the deferred benchmark - 'resolve': resolve - }); - - /*--------------------------------------------------------------------------*/ - - extend(Event.prototype, { - - /** - * A flag to indicate if the emitters listener iteration is aborted. - * - * @memberOf Benchmark.Event - * @type Boolean - */ - 'aborted': false, - - /** - * A flag to indicate if the default action is cancelled. - * - * @memberOf Benchmark.Event - * @type Boolean - */ - 'cancelled': false, - - /** - * The object whose listeners are currently being processed. - * - * @memberOf Benchmark.Event - * @type Object - */ - 'currentTarget': undefined, - - /** - * The return value of the last executed listener. - * - * @memberOf Benchmark.Event - * @type Mixed - */ - 'result': undefined, - - /** - * The object to which the event was originally emitted. - * - * @memberOf Benchmark.Event - * @type Object - */ - 'target': undefined, - - /** - * A timestamp of when the event was created (ms). - * - * @memberOf Benchmark.Event - * @type Number - */ - 'timeStamp': 0, - - /** - * The event type. - * - * @memberOf Benchmark.Event - * @type String - */ - 'type': '' - }); - - /*--------------------------------------------------------------------------*/ - - /** - * The default options copied by suite instances. - * - * @static - * @memberOf Benchmark.Suite - * @type Object - */ - Suite.options = { - - /** - * The name of the suite. - * - * @memberOf Benchmark.Suite.options - * @type String - */ - 'name': undefined - }; - - /*--------------------------------------------------------------------------*/ - - extend(Suite.prototype, { - - /** - * The number of benchmarks in the suite. - * - * @memberOf Benchmark.Suite - * @type Number - */ - 'length': 0, - - /** - * A score computed using the normalized result of each benchmark in the suite. - * - * @memberOf Benchmark.Suite - * @type Number - */ - 'score': 0, - - /** - * A flag to indicate if the suite is aborted. - * - * @memberOf Benchmark.Suite - * @type Boolean - */ - 'aborted': false, - - /** - * A flag to indicate if the suite is running. - * - * @memberOf Benchmark.Suite - * @type Boolean - */ - 'running': false, - - /** - * An `Array#forEach` like method. - * Callbacks may terminate the loop by explicitly returning `false`. - * - * @memberOf Benchmark.Suite - * @param {Function} callback The function called per iteration. - * @returns {Object} The suite iterated over. - */ - 'forEach': methodize(forEach), - - /** - * An `Array#indexOf` like method. - * - * @memberOf Benchmark.Suite - * @param {Mixed} value The value to search for. - * @returns {Number} The index of the matched value or `-1`. - */ - 'indexOf': methodize(indexOf), - - /** - * Invokes a method on all benchmarks in the suite. - * - * @memberOf Benchmark.Suite - * @param {String|Object} name The name of the method to invoke OR options object. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. - * @returns {Array} A new array of values returned from each method invoked. - */ - 'invoke': methodize(invoke), - - /** - * Converts the suite of benchmarks to a string. - * - * @memberOf Benchmark.Suite - * @param {String} [separator=','] A string to separate each element of the array. - * @returns {String} The string. - */ - 'join': [].join, - - /** - * An `Array#map` like method. - * - * @memberOf Benchmark.Suite - * @param {Function} callback The function called per iteration. - * @returns {Array} A new array of values returned by the callback. - */ - 'map': methodize(map), - - /** - * Retrieves the value of a specified property from all benchmarks in the suite. - * - * @memberOf Benchmark.Suite - * @param {String} property The property to pluck. - * @returns {Array} A new array of property values. - */ - 'pluck': methodize(pluck), - - /** - * Removes the last benchmark from the suite and returns it. - * - * @memberOf Benchmark.Suite - * @returns {Mixed} The removed benchmark. - */ - 'pop': [].pop, - - /** - * Appends benchmarks to the suite. - * - * @memberOf Benchmark.Suite - * @returns {Number} The suite's new length. - */ - 'push': [].push, - - /** - * Sorts the benchmarks of the suite. - * - * @memberOf Benchmark.Suite - * @param {Function} [compareFn=null] A function that defines the sort order. - * @returns {Object} The sorted suite. - */ - 'sort': [].sort, - - /** - * An `Array#reduce` like method. - * - * @memberOf Benchmark.Suite - * @param {Function} callback The function called per iteration. - * @param {Mixed} accumulator Initial value of the accumulator. - * @returns {Mixed} The accumulator. - */ - 'reduce': methodize(reduce), - - // aborts all benchmarks in the suite - 'abort': abortSuite, - - // adds a benchmark to the suite - 'add': add, - - // creates a new suite with cloned benchmarks - 'clone': cloneSuite, - - // executes listeners of a specified type - 'emit': emit, - - // creates a new suite of filtered benchmarks - 'filter': filterSuite, - - // get listeners - 'listeners': listeners, - - // unregister listeners - 'off': off, - - // register listeners - 'on': on, - - // resets all benchmarks in the suite - 'reset': resetSuite, - - // runs all benchmarks in the suite - 'run': runSuite, - - // array methods - 'concat': concat, - - 'reverse': reverse, - - 'shift': shift, - - 'slice': slice, - - 'splice': splice, - - 'unshift': unshift - }); - - /*--------------------------------------------------------------------------*/ - - // expose Deferred, Event and Suite - extend(Benchmark, { - 'Deferred': Deferred, - 'Event': Event, - 'Suite': Suite - }); - - // expose Benchmark - // some AMD build optimizers, like r.js, check for specific condition patterns like the following: - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // define as an anonymous module so, through path mapping, it can be aliased - define(function() { - return Benchmark; - }); - } - // check for `exports` after `define` in case a build optimizer adds an `exports` object - else if (freeExports) { - // in Node.js or RingoJS v0.8.0+ - if (typeof module == 'object' && module && module.exports == freeExports) { - (module.exports = Benchmark).Benchmark = Benchmark; - } - // in Narwhal or RingoJS v0.7.0- - else { - freeExports.Benchmark = Benchmark; - } - } - // in a browser or Rhino - else { - // use square bracket notation so Closure Compiler won't munge `Benchmark` - // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export - window['Benchmark'] = Benchmark; - } - - // trigger clock's lazy define early to avoid a security error - if (support.air) { - clock({ '_original': { 'fn': noop, 'count': 1, 'options': {} } }); - } -}(this)); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/LICENSE.txt b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/LICENSE.txt deleted file mode 100644 index a7501f9..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2011-2013 John-David Dalton - -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/README.md deleted file mode 100644 index c2f1cb6..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# Platform.js v1.0.0 - -A platform detection library that works on nearly all JavaScript platforms1. - -## Disclaimer - -Platform.js is for informational purposes only and **not** intended as a substitution for [feature detection/inference](http://allyoucanleet.com/post/18087210413/feature-testing-costs#screencast2) checks. - -## BestieJS - -Platform.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Documentation - -The documentation for Platform.js can be viewed here: [/doc/README.md](https://github.com/bestiejs/platform.js/blob/master/doc/README.md#readme) - -For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/platform.js/wiki/Roadmap). - -## Support - -Platform.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1-14, IE 6-9, Opera 9.25-12, Safari 3-6, Node.js 0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. - -## Installation and usage - -In a browser or Adobe AIR: - -```html - -``` - -Via [npm](http://npmjs.org/): - -```bash -npm install platform -``` - -In [Node.js](http://nodejs.org/) and [RingoJS](http://ringojs.org/): - -```js -var platform = require('platform'); -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('platform.js'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({ - 'paths': { - 'platform': 'path/to/platform' - } -}, -['platform'], function(platform) { - console.log(platform.name); -}); -``` - -Usage example: - -```js -// on IE10 x86 platform preview running in IE7 compatibility mode on Windows 7 64 bit edition -platform.name; // 'IE' -platform.version; // '10.0' -platform.layout; // 'Trident' -platform.os; // 'Windows Server 2008 R2 / 7 x64' -platform.description; // 'IE 10.0 x86 (platform preview; running in IE 7 mode) on Windows Server 2008 R2 / 7 x64' - -// or on an iPad -platform.name; // 'Safari' -platform.version; // '5.1' -platform.product; // 'iPad' -platform.manufacturer; // 'Apple' -platform.layout; // 'WebKit' -platform.os; // 'iOS 5.0' -platform.description; // 'Safari 5.1 on Apple iPad (iOS 5.0)' - -// or parsing a given UA string -var info = platform.parse('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7.2; en; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 11.52'); -info.name; // 'Opera' -info.version; // '11.52' -info.layout; // 'Presto' -info.os; // 'Mac OS X 10.7.2' -info.description; // 'Opera 11.52 (identifying as Firefox 4.0) on Mac OS X 10.7.2' -``` - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/platform.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/platform.js deleted file mode 100644 index d643c18..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/platform.js/platform.js +++ /dev/null @@ -1,996 +0,0 @@ -/*! - * Platform.js v1.0.0 - * Copyright 2010-2013 John-David Dalton - * Available under MIT license - */ -;(function(window) { - 'use strict'; - - /** Backup possible window/global object */ - var oldWin = window; - - /** Detect free variable `exports` */ - var freeExports = typeof exports == 'object' && exports; - - /** Detect free variable `global` */ - var freeGlobal = typeof global == 'object' && global && - (global == global.global ? (window = global) : global); - - /** Opera regexp */ - var reOpera = /Opera/; - - /** Used to resolve a value's internal [[Class]] */ - var toString = {}.toString; - - /** Detect Java environment */ - var java = /Java/.test(getClassOf(window.java)) && window.java; - - /** A character to represent alpha */ - var alpha = java ? 'a' : '\u03b1'; - - /** A character to represent beta */ - var beta = java ? 'b' : '\u03b2'; - - /** Browser document object */ - var doc = window.document || {}; - - /** Used to check for own properties of an object */ - var hasOwnProperty = {}.hasOwnProperty; - - /** Browser navigator object */ - var nav = window.navigator || {}; - - /** - * Detect Opera browser - * http://www.howtocreate.co.uk/operaStuff/operaObject.html - * http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini - */ - var opera = window.operamini || window.opera; - - /** Opera [[Class]] */ - var operaClass = reOpera.test(operaClass = getClassOf(opera)) ? operaClass : (opera = null); - - /** Possible global object */ - var thisBinding = this; - - /** Browser user agent string */ - var userAgent = nav.userAgent || ''; - - /*--------------------------------------------------------------------------*/ - - /** - * Capitalizes a string value. - * - * @private - * @param {String} string The string to capitalize. - * @returns {String} The capitalized string. - */ - function capitalize(string) { - string = String(string); - return string.charAt(0).toUpperCase() + string.slice(1); - } - - /** - * An iteration utility for arrays and objects. - * - * @private - * @param {Array|Object} object The object to iterate over. - * @param {Function} callback The function called per iteration. - */ - function each(object, callback) { - var index = -1, - length = object.length; - - if (length == length >>> 0) { - while (++index < length) { - callback(object[index], index, object); - } - } else { - forOwn(object, callback); - } - } - - /** - * Trim and conditionally capitalize string values. - * - * @private - * @param {String} string The string to format. - * @returns {String} The formatted string. - */ - function format(string) { - string = trim(string); - return /^(?:webOS|i(?:OS|P))/.test(string) - ? string - : capitalize(string); - } - - /** - * Iterates over an object's own properties, executing the `callback` for each. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} callback The function executed per own property. - */ - function forOwn(object, callback) { - for (var key in object) { - hasKey(object, key) && callback(object[key], key, object); - } - } - - /** - * Gets the internal [[Class]] of a value. - * - * @private - * @param {Mixed} value The value. - * @returns {String} The [[Class]]. - */ - function getClassOf(value) { - return value == null - ? capitalize(value) - : toString.call(value).slice(8, -1); - } - - /** - * Checks if an object has the specified key as a direct property. - * - * @private - * @param {Object} object The object to check. - * @param {String} key The key to check for. - * @returns {Boolean} Returns `true` if key is a direct property, else `false`. - */ - function hasKey() { - // lazy define for others (not as accurate) - hasKey = function(object, key) { - var parent = object != null && (object.constructor || Object).prototype; - return !!parent && key in Object(object) && !(key in parent && object[key] === parent[key]); - }; - // for modern browsers - if (getClassOf(hasOwnProperty) == 'Function') { - hasKey = function(object, key) { - return object != null && hasOwnProperty.call(object, key); - }; - } - // for Safari 2 - else if ({}.__proto__ == Object.prototype) { - hasKey = function(object, key) { - var result = false; - if (object != null) { - object = Object(object); - object.__proto__ = [object.__proto__, object.__proto__ = null, result = key in object][0]; - } - return result; - }; - } - return hasKey.apply(this, arguments); - } - - /** - * Host objects can return type values that are different from their actual - * data type. The objects we are concerned with usually return non-primitive - * types of object, function, or unknown. - * - * @private - * @param {Mixed} object The owner of the property. - * @param {String} property The property to check. - * @returns {Boolean} Returns `true` if the property value is a non-primitive, else `false`. - */ - function isHostType(object, property) { - var type = object != null ? typeof object[property] : 'number'; - return !/^(?:boolean|number|string|undefined)$/.test(type) && - (type == 'object' ? !!object[property] : true); - } - - /** - * Prepares a string for use in a RegExp constructor by making hyphens and - * spaces optional. - * - * @private - * @param {String} string The string to qualify. - * @returns {String} The qualified string. - */ - function qualify(string) { - return String(string).replace(/([ -])(?!$)/g, '$1?'); - } - - /** - * A bare-bones` Array#reduce` like utility function. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} accumulator Initial value of the accumulator. - * @returns {Mixed} The accumulator. - */ - function reduce(array, callback) { - var accumulator = null; - each(array, function(value, index) { - accumulator = callback(accumulator, value, index, array); - }); - return accumulator; - } - - /** - * Removes leading and trailing whitespace from a string. - * - * @private - * @param {String} string The string to trim. - * @returns {String} The trimmed string. - */ - function trim(string) { - return String(string).replace(/^ +| +$/g, ''); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a new platform object. - * - * @memberOf platform - * @param {String} [ua = navigator.userAgent] The user agent string. - * @returns {Object} A platform object. - */ - function parse(ua) { - - ua || (ua = userAgent); - - /** Temporary variable used over the script's lifetime */ - var data; - - /** The CPU architecture */ - var arch = ua; - - /** Platform description array */ - var description = []; - - /** Platform alpha/beta indicator */ - var prerelease = null; - - /** A flag to indicate that environment features should be used to resolve the platform */ - var useFeatures = ua == userAgent; - - /** The browser/environment version */ - var version = useFeatures && opera && typeof opera.version == 'function' && opera.version(); - - /* Detectable layout engines (order is important) */ - var layout = getLayout([ - { 'label': 'WebKit', 'pattern': 'AppleWebKit' }, - 'iCab', - 'Presto', - 'NetFront', - 'Tasman', - 'Trident', - 'KHTML', - 'Gecko' - ]); - - /* Detectable browser names (order is important) */ - var name = getName([ - 'Adobe AIR', - 'Arora', - 'Avant Browser', - 'Camino', - 'Epiphany', - 'Fennec', - 'Flock', - 'Galeon', - 'GreenBrowser', - 'iCab', - 'Iceweasel', - 'Iron', - 'K-Meleon', - 'Konqueror', - 'Lunascape', - 'Maxthon', - 'Midori', - 'Nook Browser', - 'PhantomJS', - 'Raven', - 'Rekonq', - 'RockMelt', - 'SeaMonkey', - { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, - 'Sleipnir', - 'SlimBrowser', - 'Sunrise', - 'Swiftfox', - 'WebPositive', - 'Opera Mini', - 'Opera', - 'Chrome', - { 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' }, - { 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' }, - { 'label': 'IE', 'pattern': 'MSIE' }, - 'Safari' - ]); - - /* Detectable products (order is important) */ - var product = getProduct([ - 'BlackBerry', - { 'label': 'Galaxy S', 'pattern': 'GT-I9000' }, - { 'label': 'Galaxy S2', 'pattern': 'GT-I9100' }, - 'Google TV', - 'iPad', - 'iPod', - 'iPhone', - 'Kindle', - { 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, - 'Nook', - 'PlayBook', - 'PlayStation Vita', - 'TouchPad', - 'Transformer', - 'Xoom' - ]); - - /* Detectable manufacturers */ - var manufacturer = getManufacturer({ - 'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 }, - 'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 }, - 'Asus': { 'Transformer': 1 }, - 'Barnes & Noble': { 'Nook': 1 }, - 'BlackBerry': { 'PlayBook': 1 }, - 'Google': { 'Google TV': 1 }, - 'HP': { 'TouchPad': 1 }, - 'LG': { }, - 'Motorola': { 'Xoom': 1 }, - 'Nokia': { }, - 'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1 }, - 'Sony': { 'PlayStation Vita': 1 } - }); - - /* Detectable OSes (order is important) */ - var os = getOS([ - 'Android', - 'CentOS', - 'Debian', - 'Fedora', - 'FreeBSD', - 'Gentoo', - 'Haiku', - 'Kubuntu', - 'Linux Mint', - 'Red Hat', - 'SuSE', - 'Ubuntu', - 'Xubuntu', - 'Cygwin', - 'Symbian OS', - 'hpwOS', - 'webOS ', - 'webOS', - 'Tablet OS', - 'Linux', - 'Mac OS X', - 'Macintosh', - 'Mac', - 'Windows 98;', - 'Windows ' - ]); - - /*------------------------------------------------------------------------*/ - - /** - * Picks the layout engine from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected layout engine. - */ - function getLayout(guesses) { - return reduce(guesses, function(result, guess) { - return result || RegExp('\\b' + ( - guess.pattern || qualify(guess) - ) + '\\b', 'i').exec(ua) && (guess.label || guess); - }); - } - - /** - * Picks the manufacturer from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected manufacturer. - */ - function getManufacturer(guesses) { - return reduce(guesses, function(result, value, key) { - // lookup the manufacturer by product or scan the UA for the manufacturer - return result || ( - value[product] || - value[0/*Opera 9.25 fix*/, /^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || - RegExp('\\b' + (key.pattern || qualify(key)) + '(?:\\b|\\w*\\d)', 'i').exec(ua) - ) && (key.label || key); - }); - } - - /** - * Picks the browser name from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected browser name. - */ - function getName(guesses) { - return reduce(guesses, function(result, guess) { - return result || RegExp('\\b' + ( - guess.pattern || qualify(guess) - ) + '\\b', 'i').exec(ua) && (guess.label || guess); - }); - } - - /** - * Picks the OS name from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected OS name. - */ - function getOS(guesses) { - return reduce(guesses, function(result, guess) { - var pattern = guess.pattern || qualify(guess); - if (!result && (result = - RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua))) { - // platform tokens defined at - // http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx - // http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx - data = { - '6.2': '8', - '6.1': 'Server 2008 R2 / 7', - '6.0': 'Server 2008 / Vista', - '5.2': 'Server 2003 / XP 64-bit', - '5.1': 'XP', - '5.01': '2000 SP1', - '5.0': '2000', - '4.0': 'NT', - '4.90': 'ME' - }; - // detect Windows version from platform tokens - if (/^Win/i.test(result) && - (data = data[0/*Opera 9.25 fix*/, /[\d.]+$/.exec(result)])) { - result = 'Windows ' + data; - } - // correct character case and cleanup - result = format(String(result) - .replace(RegExp(pattern, 'i'), guess.label || guess) - .replace(/ ce$/i, ' CE') - .replace(/hpw/i, 'web') - .replace(/Macintosh/, 'Mac OS') - .replace(/_PowerPC/i, ' OS') - .replace(/(OS X) [^ \d]+/i, '$1') - .replace(/\/(\d)/, ' $1') - .replace(/_/g, '.') - .replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '') - .replace(/x86\.64/gi, 'x86_64') - .split(' on ')[0]); - } - return result; - }); - } - - /** - * Picks the product name from an array of guesses. - * - * @private - * @param {Array} guesses An array of guesses. - * @returns {String|Null} The detected product name. - */ - function getProduct(guesses) { - return reduce(guesses, function(result, guess) { - var pattern = guess.pattern || qualify(guess); - if (!result && (result = - RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) || - RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua) - )) { - // split by forward slash and append product version if needed - if ((result = String(guess.label || result).split('/'))[1] && !/[\d.]+/.test(result[0])) { - result[0] += ' ' + result[1]; - } - // correct character case and cleanup - guess = guess.label || guess; - result = format(result[0] - .replace(RegExp(pattern, 'i'), guess) - .replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ') - .replace(RegExp('(' + guess + ')(\\w)', 'i'), '$1 $2')); - } - return result; - }); - } - - /** - * Resolves the version using an array of UA patterns. - * - * @private - * @param {Array} patterns An array of UA patterns. - * @returns {String|Null} The detected version. - */ - function getVersion(patterns) { - return reduce(patterns, function(result, pattern) { - return result || (RegExp(pattern + - '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null; - }); - } - - /*------------------------------------------------------------------------*/ - - /** - * Returns `platform.description` when the platform object is coerced to a string. - * - * @name toString - * @memberOf platform - * @returns {String} Returns `platform.description` if available, else an empty string. - */ - function toStringPlatform() { - return this.description || ''; - } - - /*------------------------------------------------------------------------*/ - - // convert layout to an array so we can add extra details - layout && (layout = [layout]); - - // detect product names that contain their manufacturer's name - if (manufacturer && !product) { - product = getProduct([manufacturer]); - } - // clean up Google TV - if ((data = /Google TV/.exec(product))) { - product = data[0]; - } - // detect simulators - if (/\bSimulator\b/i.test(ua)) { - product = (product ? product + ' ' : '') + 'Simulator'; - } - // detect iOS - if (/^iP/.test(product)) { - name || (name = 'Safari'); - os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua)) - ? ' ' + data[1].replace(/_/g, '.') - : ''); - } - // detect Kubuntu - else if (name == 'Konqueror' && !/buntu/i.test(os)) { - os = 'Kubuntu'; - } - // detect Android browsers - else if (manufacturer && manufacturer != 'Google' && - /Chrome|Vita/.test(name + ';' + product)) { - name = 'Android Browser'; - os = /Android/.test(os) ? os : 'Android'; - } - // detect false positives for Firefox/Safari - else if (!name || (data = !/\bMinefield\b/i.test(ua) && /Firefox|Safari/.exec(name))) { - // escape the `/` for Firefox 1 - if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) { - // clear name of false positives - name = null; - } - // reassign a generic name - if ((data = product || manufacturer || os) && - (product || manufacturer || /Android|Symbian OS|Tablet OS|webOS/.test(os))) { - name = /[a-z]+(?: Hat)?/i.exec(/Android/.test(os) ? os : data) + ' Browser'; - } - } - // detect non-Opera versions (order is important) - if (!version) { - version = getVersion([ - '(?:Cloud9|CriOS|CrMo|Opera ?Mini|Raven|Silk(?!/[\\d.]+$))', - 'Version', - qualify(name), - '(?:Firefox|Minefield|NetFront)' - ]); - } - // detect stubborn layout engines - if (layout == 'iCab' && parseFloat(version) > 3) { - layout = ['WebKit']; - } else if (data = - /Opera/.test(name) && 'Presto' || - /\b(?:Midori|Nook|Safari)\b/i.test(ua) && 'WebKit' || - !layout && /\bMSIE\b/i.test(ua) && (/^Mac/.test(os) ? 'Tasman' : 'Trident')) { - layout = [data]; - } - // leverage environment features - if (useFeatures) { - // detect server-side environments - // Rhino has a global function while others have a global object - if (isHostType(window, 'global')) { - if (java) { - data = java.lang.System; - arch = data.getProperty('os.arch'); - os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version'); - } - if (typeof exports == 'object' && exports) { - // if `thisBinding` is the [ModuleScope] - if (thisBinding == oldWin && typeof system == 'object' && (data = [system])[0]) { - os || (os = data[0].os || null); - try { - data[1] = require('ringo/engine').version; - version = data[1].join('.'); - name = 'RingoJS'; - } catch(e) { - if (data[0].global == freeGlobal) { - name = 'Narwhal'; - } - } - } else if (typeof process == 'object' && (data = process)) { - name = 'Node.js'; - arch = data.arch; - os = data.platform; - version = /[\d.]+/.exec(data.version)[0]; - } - } else if (getClassOf(window.environment) == 'Environment') { - name = 'Rhino'; - } - } - // detect Adobe AIR - else if (getClassOf(data = window.runtime) == 'ScriptBridgingProxyObject') { - name = 'Adobe AIR'; - os = data.flash.system.Capabilities.os; - } - // detect PhantomJS - else if (getClassOf(data = window.phantom) == 'RuntimeObject') { - name = 'PhantomJS'; - version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch); - } - // detect IE compatibility modes - else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) { - // we're in compatibility mode when the Trident version + 4 doesn't - // equal the document mode - version = [version, doc.documentMode]; - if ((data = +data[1] + 4) != version[1]) { - description.push('IE ' + version[1] + ' mode'); - layout[1] = ''; - version[1] = data; - } - version = name == 'IE' ? String(version[1].toFixed(1)) : version[0]; - } - os = os && format(os); - } - // detect prerelease phases - if (version && (data = - /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || - /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) || - /\bMinefield\b/i.test(ua) && 'a')) { - prerelease = /b/i.test(data) ? 'beta' : 'alpha'; - version = version.replace(RegExp(data + '\\+?$'), '') + - (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || ''); - } - // rename code name "Fennec" - if (name == 'Fennec') { - name = 'Firefox Mobile'; - } - // obscure Maxthon's unreliable version - else if (name == 'Maxthon' && version) { - version = version.replace(/\.[\d.]+/, '.x'); - } - // detect Silk desktop/accelerated modes - else if (name == 'Silk') { - if (!/Mobi/i.test(ua)) { - os = 'Android'; - description.unshift('desktop mode'); - } - if (/Accelerated *= *true/i.test(ua)) { - description.unshift('accelerated'); - } - } - // detect Windows Phone desktop mode - else if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) { - name += ' Mobile'; - os = 'Windows Phone OS ' + data + '.x'; - description.unshift('desktop mode'); - } - // add mobile postfix - else if ((name == 'IE' || name && !product && !/Browser|Mobi/.test(name)) && - (os == 'Windows CE' || /Mobi/i.test(ua))) { - name += ' Mobile'; - } - // detect IE platform preview - else if (name == 'IE' && useFeatures && typeof external == 'object' && !external) { - description.unshift('platform preview'); - } - // detect BlackBerry OS version - // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp - else if (/BlackBerry/.test(product) && (data = - (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] || - version)) { - os = 'Device Software ' + data; - version = null; - } - // detect Opera identifying/masking itself as another browser - // http://www.opera.com/support/kb/view/843/ - else if (this != forOwn && ( - (useFeatures && opera) || - (/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) || - (name == 'Firefox' && /OS X (?:\d+\.){2,}/.test(os)) || - (name == 'IE' && ( - (os && !/^Win/.test(os) && version > 5.5) || - /Windows XP/.test(os) && version > 8 || - version == 8 && !/Trident/.test(ua) - )) - ) && !reOpera.test(data = parse.call(forOwn, ua.replace(reOpera, '') + ';')) && data.name) { - - // when "indentifying", the UA contains both Opera and the other browser's name - data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : ''); - if (reOpera.test(name)) { - if (/IE/.test(data) && os == 'Mac OS') { - os = null; - } - data = 'identify' + data; - } - // when "masking", the UA contains only the other browser's name - else { - data = 'mask' + data; - if (operaClass) { - name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2')); - } else { - name = 'Opera'; - } - if (/IE/.test(data)) { - os = null; - } - if (!useFeatures) { - version = null; - } - } - layout = ['Presto']; - description.push(data); - } - // detect WebKit Nightly and approximate Chrome/Safari versions - if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { - // correct build for numeric comparison - // (e.g. "532.5" becomes "532.05") - data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data]; - // nightly builds are postfixed with a `+` - if (name == 'Safari' && data[1].slice(-1) == '+') { - name = 'WebKit Nightly'; - prerelease = 'alpha'; - version = data[1].slice(0, -1); - } - // clear incorrect browser versions - else if (version == data[1] || - version == (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1]) { - version = null; - } - // use the full Chrome version when available - data = [data[0], (/\bChrome\/([\d.]+)/i.exec(ua) || 0)[1]]; - - // detect JavaScriptCore - // http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi - if (!useFeatures || (/internal|\n/i.test(toString.toString()) && !data[1])) { - layout[1] = 'like Safari'; - data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : '5'); - } else { - layout[1] = 'like Chrome'; - data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : '21'); - } - // add the postfix of ".x" or "+" for approximate versions - layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'); - // obscure version for some Safari 1-2 releases - if (name == 'Safari' && (!version || parseInt(version) > 45)) { - version = data; - } - } - // detect Opera desktop modes - if (name == 'Opera' && (data = /(?:zbov|zvav)$/.exec(os))) { - name += ' '; - description.unshift('desktop mode'); - if (data == 'zvav') { - name += 'Mini'; - version = null; - } else { - name += 'Mobile'; - } - } - // detect Chrome desktop mode - else if (name == 'Safari' && /Chrome/.exec(layout[1])) { - description.unshift('desktop mode'); - name = 'Chrome Mobile'; - version = null; - - if (/Mac OS X/.test(os)) { - manufacturer = 'Apple'; - os = 'iOS 4.3+'; - } else { - os = null; - } - } - // strip incorrect OS versions - if (version && version.indexOf(data = /[\d.]+$/.exec(os)) == 0 && - ua.indexOf('/' + data + '-') > -1) { - os = trim(os.replace(data, '')); - } - // add layout engine - if (layout && !/Avant|Nook/.test(name) && ( - /Browser|Lunascape|Maxthon/.test(name) || - /^(?:Adobe|Arora|Midori|Phantom|Rekonq|Rock|Sleipnir|Web)/.test(name) && layout[1])) { - // don't add layout details to description if they are falsey - (data = layout[layout.length - 1]) && description.push(data); - } - // combine contextual information - if (description.length) { - description = ['(' + description.join('; ') + ')']; - } - // append manufacturer - if (manufacturer && product && product.indexOf(manufacturer) < 0) { - description.push('on ' + manufacturer); - } - // append product - if (product) { - description.push((/^on /.test(description[description.length -1]) ? '' : 'on ') + product); - } - // parse OS into an object - if (os) { - data = / ([\d.+]+)$/.exec(os); - os = { - 'architecture': 32, - 'family': data ? os.replace(data[0], '') : os, - 'version': data ? data[1] : null, - 'toString': function() { - var version = this.version; - return this.family + (version ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : ''); - } - }; - } - // add browser/OS architecture - if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) { - if (os) { - os.architecture = 64; - os.family = os.family.replace(RegExp(' *' + data), ''); - } - if (name && (/WOW64/i.test(ua) || - (useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform)))) { - description.unshift('32-bit'); - } - } - - ua || (ua = null); - - /*------------------------------------------------------------------------*/ - - /** - * The platform object. - * - * @name platform - * @type Object - */ - return { - - /** - * The browser/environment version. - * - * @memberOf platform - * @type String|Null - */ - 'version': name && version && (description.unshift(version), version), - - /** - * The name of the browser/environment. - * - * @memberOf platform - * @type String|Null - */ - 'name': name && (description.unshift(name), name), - - /** - * The name of the operating system. - * - * @memberOf platform - * @type Object - */ - 'os': os - ? (name && - !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product)) && - description.push(product ? '(' + os + ')' : 'on ' + os), os) - : { - - /** - * The CPU architecture the OS is built for. - * - * @memberOf platform.os - * @type Number|Null - */ - 'architecture': null, - - /** - * The family of the OS. - * - * @memberOf platform.os - * @type String|Null - */ - 'family': null, - - /** - * The version of the OS. - * - * @memberOf platform.os - * @type String|Null - */ - 'version': null, - - /** - * Returns the OS string. - * - * @memberOf platform.os - * @returns {String} The OS string. - */ - 'toString': function() { return 'null'; } - }, - - /** - * The platform description. - * - * @memberOf platform - * @type String|Null - */ - 'description': description.length ? description.join(' ') : ua, - - /** - * The name of the browser layout engine. - * - * @memberOf platform - * @type String|Null - */ - 'layout': layout && layout[0], - - /** - * The name of the product's manufacturer. - * - * @memberOf platform - * @type String|Null - */ - 'manufacturer': manufacturer, - - /** - * The alpha/beta release indicator. - * - * @memberOf platform - * @type String|Null - */ - 'prerelease': prerelease, - - /** - * The name of the product hosting the browser. - * - * @memberOf platform - * @type String|Null - */ - 'product': product, - - /** - * The browser's user agent string. - * - * @memberOf platform - * @type String|Null - */ - 'ua': ua, - - // parses a user agent string into a platform object - 'parse': parse, - - // returns the platform description - 'toString': toStringPlatform - }; - } - - /*--------------------------------------------------------------------------*/ - - // expose platform - // some AMD build optimizers, like r.js, check for specific condition patterns like the following: - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // define as an anonymous module so, through path mapping, it can be aliased - define(function() { - return parse(); - }); - } - // check for `exports` after `define` in case a build optimizer adds an `exports` object - else if (freeExports) { - // in Narwhal, Node.js, or RingoJS - forOwn(parse(), function(value, key) { - freeExports[key] = value; - }); - } - // in a browser or Rhino - else { - // use square bracket notation so Closure Compiler won't munge `platform` - // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export - window['platform'] = parse(); - } -}(this)); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/LICENSE.txt b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/LICENSE.txt deleted file mode 100644 index a7501f9..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2011-2013 John-David Dalton - -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/README.md deleted file mode 100644 index 7c2edfa..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# QUnit CLIB v1.2.0 -## command-line interface boilerplate - -QUnit CLIB helps extend QUnit's CLI support to many common CLI environments. - -## Screenshot - -![QUnit CLIB brings QUnit to your favorite shell.](http://i.imgur.com/jpu9l.png) - -## Support - -QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.19, Narwhal v0.3.2, PhantomJS 1.8.1, RingoJS v0.9, and Rhino v1.7RC5. - -## Usage - -```js -(function(window) { - - // use a single "load" function - var load = typeof require == 'function' ? require : window.load; - - // load QUnit and CLIB if needed - var QUnit = - window.QUnit || ( - window.addEventListener || (window.addEventListener = Function.prototype), - window.setTimeout || (window.setTimeout = Function.prototype), - window.QUnit = load('path/to/qunit.js') || window.QUnit, - load('path/to/qunit-clib.js'), - window.addEventListener === Function.prototype && delete window.addEventListener, - window.QUnit - ); - - // explicitly call `QUnit.module()` instead of `module()` - // in case we are in a CLI environment - QUnit.module('A Test Module'); - - test('A Test', function() { - // ... - }); - - // must call `QUnit.start()` if using QUnit < 1.3.0 with Node.js or any - // version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS - if (!window.document) { - QUnit.start(); - } -}(typeof global == 'object' && global || this)); -``` - -## Footnotes - - 1. QUnit v1.3.0 does not work with Narwhal or Ringo < v0.8.0 - - 2. Rhino v1.7RC4 does not support timeout fallbacks `clearTimeout` and `setTimeout` - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/qunit-clib.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/qunit-clib.js deleted file mode 100644 index 7174feb..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit-clib/qunit-clib.js +++ /dev/null @@ -1,269 +0,0 @@ -/*! - * QUnit CLI Boilerplate v1.2.0 - * Copyright 2011-2012 John-David Dalton - * Based on a gist by Jörn Zaefferer - * Available under MIT license - */ -;(function(window) { - 'use strict'; - - /** - * Timeout fallbacks based on the work of Andrea Giammarchi and Weston C. - * https://github.com/WebReflection/wru/blob/master/src/rhinoTimers.js - * http://stackoverflow.com/questions/2261705/how-to-run-a-javascript-function-asynchronously-without-using-settimeout - */ - (function() { - - /** - * Schedules timer-based callbacks. - * - * @private - * @param {Function|String} fn The function to call. - * @oaram {Number} delay The number of milliseconds to delay the `fn` call. - * @param [arg1, arg2, ...] Arguments to invoke `fn` with. - * @param {Boolean} repeated A flag to specify whether `fn` is called repeatedly. - * @returns {Number} The the ID of the timeout. - */ - function schedule(fn, delay, args, repeated) { - // Rhino 1.7RC4 will error assigning `task` below - // https://bugzilla.mozilla.org/show_bug.cgi?id=775566 - var task = ids[++counter] = new JavaAdapter(java.util.TimerTask, { - 'run': function() { - fn.apply(window, args); - } - }); - // support non-functions - if (typeof fn != 'function') { - fn = (function(code) { - code = String(code); - return function() { eval(code); }; - }(fn)); - } - // used by setInterval - if (repeated) { - timer.schedule(task, delay, delay); - } - // used by setTimeout - else { - timer.schedule(task, delay); - } - return counter; - } - - /** - * Clears the delay set by `setInterval` or `setTimeout`. - * - * @memberOf window - * @param {Number} id The ID of the timeout to be cleared. - */ - function clearTimer(id) { - if (ids[id]) { - ids[id].cancel(); - timer.purge(); - delete ids[id]; - } - } - - /** - * Executes a code snippet or function repeatedly, with a delay between each call. - * - * @memberOf window - * @param {Function|String} fn The function to call or string to evaluate. - * @oaram {Number} delay The number of milliseconds to delay each `fn` call. - * @param [arg1, arg2, ...] Arguments to invoke `fn` with. - * @returns {Number} The the ID of the timeout. - */ - function setInterval(fn, delay) { - return schedule(fn, delay, slice.call(arguments, 2), true); - } - - /** - * Executes a code snippet or a function after specified delay. - * - * @memberOf window - * @param {Function|String} fn The function to call or string to evaluate. - * @oaram {Number} delay The number of milliseconds to delay the `fn` call. - * @param [arg1, arg2, ...] Arguments to invoke `fn` with. - * @returns {Number} The the ID of the timeout. - */ - function setTimeout(fn, delay) { - return schedule(fn, delay, slice.call(arguments, 2)); - } - - try { - var counter = 0, - ids = {}, - slice = Array.prototype.slice, - timer = new java.util.Timer; - - window.clearInterval = - window.clearTimeout = clearTimer; - window.setInterval = setInterval; - window.setTimeout = setTimeout; - } catch(e) { } - }()); - - /*--------------------------------------------------------------------------*/ - - (function() { - - /** Used as a horizontal rule in console output */ - var hr = '----------------------------------------'; - - /** Shorten `window.QUnit.QUnit` to `window.QUnit` */ - window.QUnit && (QUnit = QUnit.QUnit || QUnit); - - /** - * A logging callback triggered when all testing is completed. - * - * @memberOf QUnit - * @param {Object} details An object with properties `failed`, `passed`, `runtime`, and `total`. - */ - QUnit.done(function() { - var ran; - return function(details) { - // stop `asyncTest()` from erroneously calling `done()` twice in - // environments w/o timeouts - if (ran) { - return; - } - ran = true; - - console.log(hr); - console.log(' PASS: ' + details.passed + ' FAIL: ' + details.failed + ' TOTAL: ' + details.total); - console.log(' Finished in ' + details.runtime + ' milliseconds.'); - console.log(hr); - - // exit out of Rhino - try { - quit(); - } catch(e) { } - - // exit out of Node.js or PhantomJS - try { - var process = window.process || window.phantom; - if (details.failed) { - console.error('Error: ' + details.failed + ' of ' + details.total + ' tests failed.'); - process.exit(1); - } else { - process.exit(0); - } - } catch(e) { } - }; - }()); - - /** - * A logging callback triggered after every assertion. - * - * @memberOf QUnit - * @param {Object} details An object with properties `actual`, `expected`, `message`, and `result`. - */ - QUnit.log(function(details) { - var expected = details.expected, - result = details.result, - type = typeof expected != 'undefined' ? 'EQ' : 'OK'; - - var assertion = [ - result ? 'PASS' : 'FAIL', - type, - details.message || 'ok' - ]; - - if (!result && type == 'EQ') { - assertion.push('Expected: ' + expected + ', Actual: ' + details.actual); - } - QUnit.config.testStats.assertions.push(assertion.join(' | ')); - }); - - /** - * A logging callback triggered at the start of every test module. - * - * @memberOf QUnit - * @param {Object} details An object with property `name`. - */ - QUnit.moduleStart(function(details) { - console.log(hr); - console.log(details.name); - console.log(hr); - }); - - /** - * Converts an object into a string representation. - * - * @memberOf QUnit - * @type Function - * @param {Object} object The object to stringify. - * @returns {String} The result string. - */ - QUnit.jsDump.parsers.object = (function() { - var func = QUnit.jsDump.parsers.object; - return function(object) { - // fork to support Rhino's error objects - if (typeof object.rhinoException == 'object') { - return object.name + - ' { message: "' + object.message + - '", fileName: "' + object.fileName + - '", lineNumber: ' + object.lineNumber + ' }'; - } - return func(object); - }; - }()); - - /** - * A logging callback triggered after a test is completed. - * - * @memberOf QUnit - * @param {Object} details An object with properties `failed`, `name`, `passed`, and `total`. - */ - QUnit.testDone(function(details) { - var assertions = QUnit.config.testStats.assertions, - testName = details.name; - - if (details.failed > 0) { - console.log(' FAIL - '+ testName); - assertions.forEach(function(value) { - console.log(' ' + value); - }); - } - else { - console.log(' PASS - ' + testName); - } - assertions.length = 0; - }); - - /** - * An object used to hold information about the current running test. - * - * @memberOf QUnit.config - * @type Object - */ - QUnit.config.testStats = { - - /** - * An array of test summaries (pipe separated). - * - * @memberOf QUnit.config.testStats - * @type Array - */ - 'assertions': [] - }; - }()); - - /*--------------------------------------------------------------------------*/ - - // expose shortcuts - // exclude `module` because some environments have it as a built-in object - ('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' + - 'ok raises same start stop strictEqual test throws').replace(/\S+/g, function(methodName) { - window[methodName] = QUnit[methodName]; - }); - - // add `console.log()` support for Narwhal, Rhino, and RingoJS - if (!window.console && window.print) { - window.console = { 'log': window.print }; - } - // must call `QUnit.start()` in the test file if using QUnit < 1.3.0 with - // Node.js or any version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS - QUnit.init(); - -}(typeof global == 'object' && global || this)); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/README.md deleted file mode 100644 index 6ab73f5..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/README.md +++ /dev/null @@ -1,62 +0,0 @@ -[QUnit](http://qunitjs.com) - A JavaScript Unit Testing framework. -================================ - -QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery -project to test its code and plugins but is capable of testing any generic -JavaScript code (and even capable of testing JavaScript code on the server-side). - -QUnit is especially useful for regression testing: Whenever a bug is reported, -write a test that asserts the existence of that particular bug. Then fix it and -commit both. Every time you work on the code again, run the tests. If the bug -comes up again - a regression - you'll spot it immediately and know how to fix -it, because you know what code you just changed. - -Having good unit test coverage makes safe refactoring easy and cheap. You can -run the tests after each small refactoring step and always know what change -broke something. - -QUnit is similar to other unit testing frameworks like JUnit, but makes use of -the features JavaScript provides and helps with testing code in the browser, e.g. -with its stop/start facilities for testing asynchronous code. - -If you are interested in helping developing QUnit, you are in the right place. -For related discussions, visit the -[QUnit and Testing forum](http://forum.jquery.com/qunit-and-testing). - -Development ------------ - -To submit patches, fork the repository, create a branch for the change. Then implement -the change, run `grunt` to lint and test it, then commit, push and create a pull request. - -Include some background for the change in the commit message and `Fixes #nnn`, referring -to the issue number you're addressing. - -To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`. That gives you a global -grunt binary. For additional grunt tasks, also run `npm install`. - -Releases --------- - -Install git-extras and run `git changelog` to update History.md. -Update qunit/qunit.js|css and package.json to the release version, commit and -tag, update them again to the next version, commit and push commits and tags -(`git push --tags origin master`). - -Put the 'v' in front of the tag, e.g. `v1.8.0`. Clean up the changelog, removing merge commits -or whitespace cleanups. - -To upload to code.jquery.com (replace $version accordingly), ssh to code.origin.jquery.com: - - cp qunit/qunit.js /var/www/html/code.jquery.com/qunit/qunit-$version.js - cp qunit/qunit.css /var/www/html/code.jquery.com/qunit/qunit-$version.css - -Then update /var/www/html/code.jquery.com/index.html and purge it with: - - curl -s http://code.origin.jquery.com/?reload - -Update web-base-template to link to those files for qunitjs.com. - -Publish to npm via - - npm publish diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/qunit/qunit.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/qunit/qunit.js deleted file mode 100644 index 302545f..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/qunit/qunit/qunit.js +++ /dev/null @@ -1,2152 +0,0 @@ -/** - * QUnit v1.11.0 - A JavaScript Unit Testing Framework - * - * http://qunitjs.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -(function( window ) { - -var QUnit, - assert, - config, - onErrorFnPrev, - testId = 0, - fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - // Keep a local reference to Date (GH-283) - Date = window.Date, - defined = { - setTimeout: typeof window.setTimeout !== "undefined", - sessionStorage: (function() { - var x = "qunit-test-string"; - try { - sessionStorage.setItem( x, x ); - sessionStorage.removeItem( x ); - return true; - } catch( e ) { - return false; - } - }()) - }, - /** - * Provides a normalized error string, correcting an issue - * with IE 7 (and prior) where Error.prototype.toString is - * not properly implemented - * - * Based on http://es5.github.com/#x15.11.4.4 - * - * @param {String|Error} error - * @return {String} error message - */ - errorString = function( error ) { - var name, message, - errorString = error.toString(); - if ( errorString.substring( 0, 7 ) === "[object" ) { - name = error.name ? error.name.toString() : "Error"; - message = error.message ? error.message.toString() : ""; - if ( name && message ) { - return name + ": " + message; - } else if ( name ) { - return name; - } else if ( message ) { - return message; - } else { - return "Error"; - } - } else { - return errorString; - } - }, - /** - * Makes a clone of an object using only Array or Object as base, - * and copies over the own enumerable properties. - * - * @param {Object} obj - * @return {Object} New object with only the own properties (recursively). - */ - objectValues = function( obj ) { - // Grunt 0.3.x uses an older version of jshint that still has jshint/jshint#392. - /*jshint newcap: false */ - var key, val, - vals = QUnit.is( "array", obj ) ? [] : {}; - for ( key in obj ) { - if ( hasOwn.call( obj, key ) ) { - val = obj[key]; - vals[key] = val === Object(val) ? objectValues(val) : val; - } - } - return vals; - }; - -function Test( settings ) { - extend( this, settings ); - this.assertions = []; - this.testNumber = ++Test.count; -} - -Test.count = 0; - -Test.prototype = { - init: function() { - var a, b, li, - tests = id( "qunit-tests" ); - - if ( tests ) { - b = document.createElement( "strong" ); - b.innerHTML = this.nameHtml; - - // `a` initialized at top of scope - a = document.createElement( "a" ); - a.innerHTML = "Rerun"; - a.href = QUnit.url({ testNumber: this.testNumber }); - - li = document.createElement( "li" ); - li.appendChild( b ); - li.appendChild( a ); - li.className = "running"; - li.id = this.id = "qunit-test-output" + testId++; - - tests.appendChild( li ); - } - }, - setup: function() { - if ( this.module !== config.previousModule ) { - if ( config.previousModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.previousModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - config.previousModule = this.module; - config.moduleStats = { all: 0, bad: 0 }; - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } else if ( config.autorun ) { - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } - - config.current = this; - - this.testEnvironment = extend({ - setup: function() {}, - teardown: function() {} - }, this.moduleTestEnvironment ); - - this.started = +new Date(); - runLoggingCallbacks( "testStart", QUnit, { - name: this.testName, - module: this.module - }); - - // allow utility functions to access the current test environment - // TODO why?? - QUnit.current_testEnvironment = this.testEnvironment; - - if ( !config.pollution ) { - saveGlobal(); - } - if ( config.notrycatch ) { - this.testEnvironment.setup.call( this.testEnvironment ); - return; - } - try { - this.testEnvironment.setup.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); - } - }, - run: function() { - config.current = this; - - var running = id( "qunit-testresult" ); - - if ( running ) { - running.innerHTML = "Running:
                      " + this.nameHtml; - } - - if ( this.async ) { - QUnit.stop(); - } - - this.callbackStarted = +new Date(); - - if ( config.notrycatch ) { - this.callback.call( this.testEnvironment, QUnit.assert ); - this.callbackRuntime = +new Date() - this.callbackStarted; - return; - } - - try { - this.callback.call( this.testEnvironment, QUnit.assert ); - this.callbackRuntime = +new Date() - this.callbackStarted; - } catch( e ) { - this.callbackRuntime = +new Date() - this.callbackStarted; - - QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) ); - // else next test will carry the responsibility - saveGlobal(); - - // Restart the tests if they're blocking - if ( config.blocking ) { - QUnit.start(); - } - } - }, - teardown: function() { - config.current = this; - if ( config.notrycatch ) { - if ( typeof this.callbackRuntime === "undefined" ) { - this.callbackRuntime = +new Date() - this.callbackStarted; - } - this.testEnvironment.teardown.call( this.testEnvironment ); - return; - } else { - try { - this.testEnvironment.teardown.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); - } - } - checkPollution(); - }, - finish: function() { - config.current = this; - if ( config.requireExpects && this.expected === null ) { - QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); - } else if ( this.expected !== null && this.expected !== this.assertions.length ) { - QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); - } else if ( this.expected === null && !this.assertions.length ) { - QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); - } - - var i, assertion, a, b, time, li, ol, - test = this, - good = 0, - bad = 0, - tests = id( "qunit-tests" ); - - this.runtime = +new Date() - this.started; - config.stats.all += this.assertions.length; - config.moduleStats.all += this.assertions.length; - - if ( tests ) { - ol = document.createElement( "ol" ); - ol.className = "qunit-assert-list"; - - for ( i = 0; i < this.assertions.length; i++ ) { - assertion = this.assertions[i]; - - li = document.createElement( "li" ); - li.className = assertion.result ? "pass" : "fail"; - li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); - ol.appendChild( li ); - - if ( assertion.result ) { - good++; - } else { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - - // store result when possible - if ( QUnit.config.reorder && defined.sessionStorage ) { - if ( bad ) { - sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); - } else { - sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); - } - } - - if ( bad === 0 ) { - addClass( ol, "qunit-collapsed" ); - } - - // `b` initialized at top of scope - b = document.createElement( "strong" ); - b.innerHTML = this.nameHtml + " (" + bad + ", " + good + ", " + this.assertions.length + ")"; - - addEvent(b, "click", function() { - var next = b.parentNode.lastChild, - collapsed = hasClass( next, "qunit-collapsed" ); - ( collapsed ? removeClass : addClass )( next, "qunit-collapsed" ); - }); - - addEvent(b, "dblclick", function( e ) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) { - target = target.parentNode; - } - if ( window.location && target.nodeName.toLowerCase() === "strong" ) { - window.location = QUnit.url({ testNumber: test.testNumber }); - } - }); - - // `time` initialized at top of scope - time = document.createElement( "span" ); - time.className = "runtime"; - time.innerHTML = this.runtime + " ms"; - - // `li` initialized at top of scope - li = id( this.id ); - li.className = bad ? "fail" : "pass"; - li.removeChild( li.firstChild ); - a = li.firstChild; - li.appendChild( b ); - li.appendChild( a ); - li.appendChild( time ); - li.appendChild( ol ); - - } else { - for ( i = 0; i < this.assertions.length; i++ ) { - if ( !this.assertions[i].result ) { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - } - - runLoggingCallbacks( "testDone", QUnit, { - name: this.testName, - module: this.module, - failed: bad, - passed: this.assertions.length - bad, - total: this.assertions.length, - duration: this.runtime - }); - - QUnit.reset(); - - config.current = undefined; - }, - - queue: function() { - var bad, - test = this; - - synchronize(function() { - test.init(); - }); - function run() { - // each of these can by async - synchronize(function() { - test.setup(); - }); - synchronize(function() { - test.run(); - }); - synchronize(function() { - test.teardown(); - }); - synchronize(function() { - test.finish(); - }); - } - - // `bad` initialized at top of scope - // defer when previous test run passed, if storage is available - bad = QUnit.config.reorder && defined.sessionStorage && - +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); - - if ( bad ) { - run(); - } else { - synchronize( run, true ); - } - } -}; - -// Root QUnit object. -// `QUnit` initialized at top of scope -QUnit = { - - // call on start of module test to prepend name to all tests - module: function( name, testEnvironment ) { - config.currentModule = name; - config.currentModuleTestEnvironment = testEnvironment; - config.modules[name] = true; - }, - - asyncTest: function( testName, expected, callback ) { - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - QUnit.test( testName, expected, callback, true ); - }, - - test: function( testName, expected, callback, async ) { - var test, - nameHtml = "" + escapeText( testName ) + ""; - - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - if ( config.currentModule ) { - nameHtml = "" + escapeText( config.currentModule ) + ": " + nameHtml; - } - - test = new Test({ - nameHtml: nameHtml, - testName: testName, - expected: expected, - async: async, - callback: callback, - module: config.currentModule, - moduleTestEnvironment: config.currentModuleTestEnvironment, - stack: sourceFromStacktrace( 2 ) - }); - - if ( !validTest( test ) ) { - return; - } - - test.queue(); - }, - - // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. - expect: function( asserts ) { - if (arguments.length === 1) { - config.current.expected = asserts; - } else { - return config.current.expected; - } - }, - - start: function( count ) { - // QUnit hasn't been initialized yet. - // Note: RequireJS (et al) may delay onLoad - if ( config.semaphore === undefined ) { - QUnit.begin(function() { - // This is triggered at the top of QUnit.load, push start() to the event loop, to allow QUnit.load to finish first - setTimeout(function() { - QUnit.start( count ); - }); - }); - return; - } - - config.semaphore -= count || 1; - // don't start until equal number of stop-calls - if ( config.semaphore > 0 ) { - return; - } - // ignore if start is called more often then stop - if ( config.semaphore < 0 ) { - config.semaphore = 0; - QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)", null, sourceFromStacktrace(2) ); - return; - } - // A slight delay, to avoid any current callbacks - if ( defined.setTimeout ) { - window.setTimeout(function() { - if ( config.semaphore > 0 ) { - return; - } - if ( config.timeout ) { - clearTimeout( config.timeout ); - } - - config.blocking = false; - process( true ); - }, 13); - } else { - config.blocking = false; - process( true ); - } - }, - - stop: function( count ) { - config.semaphore += count || 1; - config.blocking = true; - - if ( config.testTimeout && defined.setTimeout ) { - clearTimeout( config.timeout ); - config.timeout = window.setTimeout(function() { - QUnit.ok( false, "Test timed out" ); - config.semaphore = 1; - QUnit.start(); - }, config.testTimeout ); - } - } -}; - -// `assert` initialized at top of scope -// Asssert helpers -// All of these must either call QUnit.push() or manually do: -// - runLoggingCallbacks( "log", .. ); -// - config.current.assertions.push({ .. }); -// We attach it to the QUnit object *after* we expose the public API, -// otherwise `assert` will become a global variable in browsers (#341). -assert = { - /** - * Asserts rough true-ish result. - * @name ok - * @function - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); - */ - ok: function( result, msg ) { - if ( !config.current ) { - throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - result = !!result; - - var source, - details = { - module: config.current.module, - name: config.current.testName, - result: result, - message: msg - }; - - msg = escapeText( msg || (result ? "okay" : "failed" ) ); - msg = "" + msg + ""; - - if ( !result ) { - source = sourceFromStacktrace( 2 ); - if ( source ) { - details.source = source; - msg += "
                      Source:
                      " + escapeText( source ) + "
                      "; - } - } - runLoggingCallbacks( "log", QUnit, details ); - config.current.assertions.push({ - result: result, - message: msg - }); - }, - - /** - * Assert that the first two arguments are equal, with an optional message. - * Prints out both actual and expected values. - * @name equal - * @function - * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); - */ - equal: function( actual, expected, message ) { - /*jshint eqeqeq:false */ - QUnit.push( expected == actual, actual, expected, message ); - }, - - /** - * @name notEqual - * @function - */ - notEqual: function( actual, expected, message ) { - /*jshint eqeqeq:false */ - QUnit.push( expected != actual, actual, expected, message ); - }, - - /** - * @name propEqual - * @function - */ - propEqual: function( actual, expected, message ) { - actual = objectValues(actual); - expected = objectValues(expected); - QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name notPropEqual - * @function - */ - notPropEqual: function( actual, expected, message ) { - actual = objectValues(actual); - expected = objectValues(expected); - QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name deepEqual - * @function - */ - deepEqual: function( actual, expected, message ) { - QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name notDeepEqual - * @function - */ - notDeepEqual: function( actual, expected, message ) { - QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name strictEqual - * @function - */ - strictEqual: function( actual, expected, message ) { - QUnit.push( expected === actual, actual, expected, message ); - }, - - /** - * @name notStrictEqual - * @function - */ - notStrictEqual: function( actual, expected, message ) { - QUnit.push( expected !== actual, actual, expected, message ); - }, - - "throws": function( block, expected, message ) { - var actual, - expectedOutput = expected, - ok = false; - - // 'expected' is optional - if ( typeof expected === "string" ) { - message = expected; - expected = null; - } - - config.current.ignoreGlobalErrors = true; - try { - block.call( config.current.testEnvironment ); - } catch (e) { - actual = e; - } - config.current.ignoreGlobalErrors = false; - - if ( actual ) { - // we don't want to validate thrown error - if ( !expected ) { - ok = true; - expectedOutput = null; - // expected is a regexp - } else if ( QUnit.objectType( expected ) === "regexp" ) { - ok = expected.test( errorString( actual ) ); - // expected is a constructor - } else if ( actual instanceof expected ) { - ok = true; - // expected is a validation function which returns true is validation passed - } else if ( expected.call( {}, actual ) === true ) { - expectedOutput = null; - ok = true; - } - - QUnit.push( ok, actual, expectedOutput, message ); - } else { - QUnit.pushFailure( message, null, 'No exception was thrown.' ); - } - } -}; - -/** - * @deprecate since 1.8.0 - * Kept assertion helpers in root for backwards compatibility. - */ -extend( QUnit, assert ); - -/** - * @deprecated since 1.9.0 - * Kept root "raises()" for backwards compatibility. - * (Note that we don't introduce assert.raises). - */ -QUnit.raises = assert[ "throws" ]; - -/** - * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 - * Kept to avoid TypeErrors for undefined methods. - */ -QUnit.equals = function() { - QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); -}; -QUnit.same = function() { - QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); -}; - -// We want access to the constructor's prototype -(function() { - function F() {} - F.prototype = QUnit; - QUnit = new F(); - // Make F QUnit's constructor so that we can add to the prototype later - QUnit.constructor = F; -}()); - -/** - * Config object: Maintain internal state - * Later exposed as QUnit.config - * `config` initialized at top of scope - */ -config = { - // The queue of tests to run - queue: [], - - // block until document ready - blocking: true, - - // when enabled, show only failing tests - // gets persisted through sessionStorage and can be changed in UI via checkbox - hidepassed: false, - - // by default, run previously failed tests first - // very useful in combination with "Hide passed tests" checked - reorder: true, - - // by default, modify document.title when suite is done - altertitle: true, - - // when enabled, all tests must call expect() - requireExpects: false, - - // add checkboxes that are persisted in the query-string - // when enabled, the id is set to `true` as a `QUnit.config` property - urlConfig: [ - { - id: "noglobals", - label: "Check for Globals", - tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." - }, - { - id: "notrycatch", - label: "No try-catch", - tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." - } - ], - - // Set of all modules. - modules: {}, - - // logging callback queues - begin: [], - done: [], - log: [], - testStart: [], - testDone: [], - moduleStart: [], - moduleDone: [] -}; - -// Export global variables, unless an 'exports' object exists, -// in that case we assume we're in CommonJS (dealt with on the bottom of the script) -if ( typeof exports === "undefined" ) { - extend( window, QUnit ); - - // Expose QUnit object - window.QUnit = QUnit; -} - -// Initialize more QUnit.config and QUnit.urlParams -(function() { - var i, - location = window.location || { search: "", protocol: "file:" }, - params = location.search.slice( 1 ).split( "&" ), - length = params.length, - urlParams = {}, - current; - - if ( params[ 0 ] ) { - for ( i = 0; i < length; i++ ) { - current = params[ i ].split( "=" ); - current[ 0 ] = decodeURIComponent( current[ 0 ] ); - // allow just a key to turn on a flag, e.g., test.html?noglobals - current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; - urlParams[ current[ 0 ] ] = current[ 1 ]; - } - } - - QUnit.urlParams = urlParams; - - // String search anywhere in moduleName+testName - config.filter = urlParams.filter; - - // Exact match of the module name - config.module = urlParams.module; - - config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; - - // Figure out if we're running the tests from a server or not - QUnit.isLocal = location.protocol === "file:"; -}()); - -// Extend QUnit object, -// these after set here because they should not be exposed as global functions -extend( QUnit, { - assert: assert, - - config: config, - - // Initialize the configuration options - init: function() { - extend( config, { - stats: { all: 0, bad: 0 }, - moduleStats: { all: 0, bad: 0 }, - started: +new Date(), - updateRate: 1000, - blocking: false, - autostart: true, - autorun: false, - filter: "", - queue: [], - semaphore: 1 - }); - - var tests, banner, result, - qunit = id( "qunit" ); - - if ( qunit ) { - qunit.innerHTML = - "

                      " + escapeText( document.title ) + "

                      " + - "

                      " + - "
                      " + - "

                      " + - "
                        "; - } - - tests = id( "qunit-tests" ); - banner = id( "qunit-banner" ); - result = id( "qunit-testresult" ); - - if ( tests ) { - tests.innerHTML = ""; - } - - if ( banner ) { - banner.className = ""; - } - - if ( result ) { - result.parentNode.removeChild( result ); - } - - if ( tests ) { - result = document.createElement( "p" ); - result.id = "qunit-testresult"; - result.className = "result"; - tests.parentNode.insertBefore( result, tests ); - result.innerHTML = "Running...
                         "; - } - }, - - // Resets the test setup. Useful for tests that modify the DOM. - reset: function() { - var fixture = id( "qunit-fixture" ); - if ( fixture ) { - fixture.innerHTML = config.fixture; - } - }, - - // Trigger an event on an element. - // @example triggerEvent( document.body, "click" ); - triggerEvent: function( elem, type, event ) { - if ( document.createEvent ) { - event = document.createEvent( "MouseEvents" ); - event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, - 0, 0, 0, 0, 0, false, false, false, false, 0, null); - - elem.dispatchEvent( event ); - } else if ( elem.fireEvent ) { - elem.fireEvent( "on" + type ); - } - }, - - // Safe object type checking - is: function( type, obj ) { - return QUnit.objectType( obj ) === type; - }, - - objectType: function( obj ) { - if ( typeof obj === "undefined" ) { - return "undefined"; - // consider: typeof null === object - } - if ( obj === null ) { - return "null"; - } - - var match = toString.call( obj ).match(/^\[object\s(.*)\]$/), - type = match && match[1] || ""; - - switch ( type ) { - case "Number": - if ( isNaN(obj) ) { - return "nan"; - } - return "number"; - case "String": - case "Boolean": - case "Array": - case "Date": - case "RegExp": - case "Function": - return type.toLowerCase(); - } - if ( typeof obj === "object" ) { - return "object"; - } - return undefined; - }, - - push: function( result, actual, expected, message ) { - if ( !config.current ) { - throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); - } - - var output, source, - details = { - module: config.current.module, - name: config.current.testName, - result: result, - message: message, - actual: actual, - expected: expected - }; - - message = escapeText( message ) || ( result ? "okay" : "failed" ); - message = "" + message + ""; - output = message; - - if ( !result ) { - expected = escapeText( QUnit.jsDump.parse(expected) ); - actual = escapeText( QUnit.jsDump.parse(actual) ); - output += ""; - - if ( actual !== expected ) { - output += ""; - output += ""; - } - - source = sourceFromStacktrace(); - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
                        Expected:
                        " + expected + "
                        Result:
                        " + actual + "
                        Diff:
                        " + QUnit.diff( expected, actual ) + "
                        Source:
                        " + escapeText( source ) + "
                        "; - } - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: !!result, - message: output - }); - }, - - pushFailure: function( message, source, actual ) { - if ( !config.current ) { - throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - - var output, - details = { - module: config.current.module, - name: config.current.testName, - result: false, - message: message - }; - - message = escapeText( message ) || "error"; - message = "" + message + ""; - output = message; - - output += ""; - - if ( actual ) { - output += ""; - } - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
                        Result:
                        " + escapeText( actual ) + "
                        Source:
                        " + escapeText( source ) + "
                        "; - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: false, - message: output - }); - }, - - url: function( params ) { - params = extend( extend( {}, QUnit.urlParams ), params ); - var key, - querystring = "?"; - - for ( key in params ) { - if ( !hasOwn.call( params, key ) ) { - continue; - } - querystring += encodeURIComponent( key ) + "=" + - encodeURIComponent( params[ key ] ) + "&"; - } - return window.location.protocol + "//" + window.location.host + - window.location.pathname + querystring.slice( 0, -1 ); - }, - - extend: extend, - id: id, - addEvent: addEvent - // load, equiv, jsDump, diff: Attached later -}); - -/** - * @deprecated: Created for backwards compatibility with test runner that set the hook function - * into QUnit.{hook}, instead of invoking it and passing the hook function. - * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. - * Doing this allows us to tell if the following methods have been overwritten on the actual - * QUnit object. - */ -extend( QUnit.constructor.prototype, { - - // Logging callbacks; all receive a single argument with the listed properties - // run test/logs.html for any related changes - begin: registerLoggingCallback( "begin" ), - - // done: { failed, passed, total, runtime } - done: registerLoggingCallback( "done" ), - - // log: { result, actual, expected, message } - log: registerLoggingCallback( "log" ), - - // testStart: { name } - testStart: registerLoggingCallback( "testStart" ), - - // testDone: { name, failed, passed, total, duration } - testDone: registerLoggingCallback( "testDone" ), - - // moduleStart: { name } - moduleStart: registerLoggingCallback( "moduleStart" ), - - // moduleDone: { name, failed, passed, total } - moduleDone: registerLoggingCallback( "moduleDone" ) -}); - -if ( typeof document === "undefined" || document.readyState === "complete" ) { - config.autorun = true; -} - -QUnit.load = function() { - runLoggingCallbacks( "begin", QUnit, {} ); - - // Initialize the config, saving the execution queue - var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, - urlConfigCheckboxesContainer, urlConfigCheckboxes, moduleFilter, - numModules = 0, - moduleFilterHtml = "", - urlConfigHtml = "", - oldconfig = extend( {}, config ); - - QUnit.init(); - extend(config, oldconfig); - - config.blocking = false; - - len = config.urlConfig.length; - - for ( i = 0; i < len; i++ ) { - val = config.urlConfig[i]; - if ( typeof val === "string" ) { - val = { - id: val, - label: val, - tooltip: "[no tooltip available]" - }; - } - config[ val.id ] = QUnit.urlParams[ val.id ]; - urlConfigHtml += ""; - } - - moduleFilterHtml += ""; - - // `userAgent` initialized at top of scope - userAgent = id( "qunit-userAgent" ); - if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; - } - - // `banner` initialized at top of scope - banner = id( "qunit-header" ); - if ( banner ) { - banner.innerHTML = "" + banner.innerHTML + " "; - } - - // `toolbar` initialized at top of scope - toolbar = id( "qunit-testrunner-toolbar" ); - if ( toolbar ) { - // `filter` initialized at top of scope - filter = document.createElement( "input" ); - filter.type = "checkbox"; - filter.id = "qunit-filter-pass"; - - addEvent( filter, "click", function() { - var tmp, - ol = document.getElementById( "qunit-tests" ); - - if ( filter.checked ) { - ol.className = ol.className + " hidepass"; - } else { - tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; - ol.className = tmp.replace( / hidepass /, " " ); - } - if ( defined.sessionStorage ) { - if (filter.checked) { - sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); - } else { - sessionStorage.removeItem( "qunit-filter-passed-tests" ); - } - } - }); - - if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { - filter.checked = true; - // `ol` initialized at top of scope - ol = document.getElementById( "qunit-tests" ); - ol.className = ol.className + " hidepass"; - } - toolbar.appendChild( filter ); - - // `label` initialized at top of scope - label = document.createElement( "label" ); - label.setAttribute( "for", "qunit-filter-pass" ); - label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." ); - label.innerHTML = "Hide passed tests"; - toolbar.appendChild( label ); - - urlConfigCheckboxesContainer = document.createElement("span"); - urlConfigCheckboxesContainer.innerHTML = urlConfigHtml; - urlConfigCheckboxes = urlConfigCheckboxesContainer.getElementsByTagName("input"); - // For oldIE support: - // * Add handlers to the individual elements instead of the container - // * Use "click" instead of "change" - // * Fallback from event.target to event.srcElement - addEvents( urlConfigCheckboxes, "click", function( event ) { - var params = {}, - target = event.target || event.srcElement; - params[ target.name ] = target.checked ? true : undefined; - window.location = QUnit.url( params ); - }); - toolbar.appendChild( urlConfigCheckboxesContainer ); - - if (numModules > 1) { - moduleFilter = document.createElement( 'span' ); - moduleFilter.setAttribute( 'id', 'qunit-modulefilter-container' ); - moduleFilter.innerHTML = moduleFilterHtml; - addEvent( moduleFilter.lastChild, "change", function() { - var selectBox = moduleFilter.getElementsByTagName("select")[0], - selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value); - - window.location = QUnit.url( { module: ( selectedModule === "" ) ? undefined : selectedModule } ); - }); - toolbar.appendChild(moduleFilter); - } - } - - // `main` initialized at top of scope - main = id( "qunit-fixture" ); - if ( main ) { - config.fixture = main.innerHTML; - } - - if ( config.autostart ) { - QUnit.start(); - } -}; - -addEvent( window, "load", QUnit.load ); - -// `onErrorFnPrev` initialized at top of scope -// Preserve other handlers -onErrorFnPrev = window.onerror; - -// Cover uncaught exceptions -// Returning true will surpress the default browser handler, -// returning false will let it run. -window.onerror = function ( error, filePath, linerNr ) { - var ret = false; - if ( onErrorFnPrev ) { - ret = onErrorFnPrev( error, filePath, linerNr ); - } - - // Treat return value as window.onerror itself does, - // Only do our handling if not surpressed. - if ( ret !== true ) { - if ( QUnit.config.current ) { - if ( QUnit.config.current.ignoreGlobalErrors ) { - return true; - } - QUnit.pushFailure( error, filePath + ":" + linerNr ); - } else { - QUnit.test( "global failure", extend( function() { - QUnit.pushFailure( error, filePath + ":" + linerNr ); - }, { validTest: validTest } ) ); - } - return false; - } - - return ret; -}; - -function done() { - config.autorun = true; - - // Log the last module results - if ( config.currentModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.currentModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - - var i, key, - banner = id( "qunit-banner" ), - tests = id( "qunit-tests" ), - runtime = +new Date() - config.started, - passed = config.stats.all - config.stats.bad, - html = [ - "Tests completed in ", - runtime, - " milliseconds.
                        ", - "", - passed, - " assertions of ", - config.stats.all, - " passed, ", - config.stats.bad, - " failed." - ].join( "" ); - - if ( banner ) { - banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); - } - - if ( tests ) { - id( "qunit-testresult" ).innerHTML = html; - } - - if ( config.altertitle && typeof document !== "undefined" && document.title ) { - // show ✖ for good, ✔ for bad suite result in title - // use escape sequences in case file gets loaded with non-utf-8-charset - document.title = [ - ( config.stats.bad ? "\u2716" : "\u2714" ), - document.title.replace( /^[\u2714\u2716] /i, "" ) - ].join( " " ); - } - - // clear own sessionStorage items if all tests passed - if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { - // `key` & `i` initialized at top of scope - for ( i = 0; i < sessionStorage.length; i++ ) { - key = sessionStorage.key( i++ ); - if ( key.indexOf( "qunit-test-" ) === 0 ) { - sessionStorage.removeItem( key ); - } - } - } - - // scroll back to top to show results - if ( window.scrollTo ) { - window.scrollTo(0, 0); - } - - runLoggingCallbacks( "done", QUnit, { - failed: config.stats.bad, - passed: passed, - total: config.stats.all, - runtime: runtime - }); -} - -/** @return Boolean: true if this test should be ran */ -function validTest( test ) { - var include, - filter = config.filter && config.filter.toLowerCase(), - module = config.module && config.module.toLowerCase(), - fullName = (test.module + ": " + test.testName).toLowerCase(); - - // Internally-generated tests are always valid - if ( test.callback && test.callback.validTest === validTest ) { - delete test.callback.validTest; - return true; - } - - if ( config.testNumber ) { - return test.testNumber === config.testNumber; - } - - if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { - return false; - } - - if ( !filter ) { - return true; - } - - include = filter.charAt( 0 ) !== "!"; - if ( !include ) { - filter = filter.slice( 1 ); - } - - // If the filter matches, we need to honour include - if ( fullName.indexOf( filter ) !== -1 ) { - return include; - } - - // Otherwise, do the opposite - return !include; -} - -// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) -// Later Safari and IE10 are supposed to support error.stack as well -// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack -function extractStacktrace( e, offset ) { - offset = offset === undefined ? 3 : offset; - - var stack, include, i; - - if ( e.stacktrace ) { - // Opera - return e.stacktrace.split( "\n" )[ offset + 3 ]; - } else if ( e.stack ) { - // Firefox, Chrome - stack = e.stack.split( "\n" ); - if (/^error$/i.test( stack[0] ) ) { - stack.shift(); - } - if ( fileName ) { - include = []; - for ( i = offset; i < stack.length; i++ ) { - if ( stack[ i ].indexOf( fileName ) !== -1 ) { - break; - } - include.push( stack[ i ] ); - } - if ( include.length ) { - return include.join( "\n" ); - } - } - return stack[ offset ]; - } else if ( e.sourceURL ) { - // Safari, PhantomJS - // hopefully one day Safari provides actual stacktraces - // exclude useless self-reference for generated Error objects - if ( /qunit.js$/.test( e.sourceURL ) ) { - return; - } - // for actual exceptions, this is useful - return e.sourceURL + ":" + e.line; - } -} -function sourceFromStacktrace( offset ) { - try { - throw new Error(); - } catch ( e ) { - return extractStacktrace( e, offset ); - } -} - -/** - * Escape text for attribute or text content. - */ -function escapeText( s ) { - if ( !s ) { - return ""; - } - s = s + ""; - // Both single quotes and double quotes (for attributes) - return s.replace( /['"<>&]/g, function( s ) { - switch( s ) { - case '\'': - return '''; - case '"': - return '"'; - case '<': - return '<'; - case '>': - return '>'; - case '&': - return '&'; - } - }); -} - -function synchronize( callback, last ) { - config.queue.push( callback ); - - if ( config.autorun && !config.blocking ) { - process( last ); - } -} - -function process( last ) { - function next() { - process( last ); - } - var start = new Date().getTime(); - config.depth = config.depth ? config.depth + 1 : 1; - - while ( config.queue.length && !config.blocking ) { - if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { - config.queue.shift()(); - } else { - window.setTimeout( next, 13 ); - break; - } - } - config.depth--; - if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { - done(); - } -} - -function saveGlobal() { - config.pollution = []; - - if ( config.noglobals ) { - for ( var key in window ) { - // in Opera sometimes DOM element ids show up here, ignore them - if ( !hasOwn.call( window, key ) || /^qunit-test-output/.test( key ) ) { - continue; - } - config.pollution.push( key ); - } - } -} - -function checkPollution() { - var newGlobals, - deletedGlobals, - old = config.pollution; - - saveGlobal(); - - newGlobals = diff( config.pollution, old ); - if ( newGlobals.length > 0 ) { - QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); - } - - deletedGlobals = diff( old, config.pollution ); - if ( deletedGlobals.length > 0 ) { - QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); - } -} - -// returns a new Array with the elements that are in a but not in b -function diff( a, b ) { - var i, j, - result = a.slice(); - - for ( i = 0; i < result.length; i++ ) { - for ( j = 0; j < b.length; j++ ) { - if ( result[i] === b[j] ) { - result.splice( i, 1 ); - i--; - break; - } - } - } - return result; -} - -function extend( a, b ) { - for ( var prop in b ) { - if ( b[ prop ] === undefined ) { - delete a[ prop ]; - - // Avoid "Member not found" error in IE8 caused by setting window.constructor - } else if ( prop !== "constructor" || a !== window ) { - a[ prop ] = b[ prop ]; - } - } - - return a; -} - -/** - * @param {HTMLElement} elem - * @param {string} type - * @param {Function} fn - */ -function addEvent( elem, type, fn ) { - // Standards-based browsers - if ( elem.addEventListener ) { - elem.addEventListener( type, fn, false ); - // IE - } else { - elem.attachEvent( "on" + type, fn ); - } -} - -/** - * @param {Array|NodeList} elems - * @param {string} type - * @param {Function} fn - */ -function addEvents( elems, type, fn ) { - var i = elems.length; - while ( i-- ) { - addEvent( elems[i], type, fn ); - } -} - -function hasClass( elem, name ) { - return (" " + elem.className + " ").indexOf(" " + name + " ") > -1; -} - -function addClass( elem, name ) { - if ( !hasClass( elem, name ) ) { - elem.className += (elem.className ? " " : "") + name; - } -} - -function removeClass( elem, name ) { - var set = " " + elem.className + " "; - // Class name may appear multiple times - while ( set.indexOf(" " + name + " ") > -1 ) { - set = set.replace(" " + name + " " , " "); - } - // If possible, trim it for prettiness, but not neccecarily - elem.className = window.jQuery ? jQuery.trim( set ) : ( set.trim ? set.trim() : set ); -} - -function id( name ) { - return !!( typeof document !== "undefined" && document && document.getElementById ) && - document.getElementById( name ); -} - -function registerLoggingCallback( key ) { - return function( callback ) { - config[key].push( callback ); - }; -} - -// Supports deprecated method of completely overwriting logging callbacks -function runLoggingCallbacks( key, scope, args ) { - var i, callbacks; - if ( QUnit.hasOwnProperty( key ) ) { - QUnit[ key ].call(scope, args ); - } else { - callbacks = config[ key ]; - for ( i = 0; i < callbacks.length; i++ ) { - callbacks[ i ].call( scope, args ); - } - } -} - -// Test for equality any JavaScript type. -// Author: Philippe Rathé -QUnit.equiv = (function() { - - // Call the o related callback with the given arguments. - function bindCallbacks( o, callbacks, args ) { - var prop = QUnit.objectType( o ); - if ( prop ) { - if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { - return callbacks[ prop ].apply( callbacks, args ); - } else { - return callbacks[ prop ]; // or undefined - } - } - } - - // the real equiv function - var innerEquiv, - // stack to decide between skip/abort functions - callers = [], - // stack to avoiding loops from circular referencing - parents = [], - - getProto = Object.getPrototypeOf || function ( obj ) { - return obj.__proto__; - }, - callbacks = (function () { - - // for string, boolean, number and null - function useStrictEquality( b, a ) { - /*jshint eqeqeq:false */ - if ( b instanceof a.constructor || a instanceof b.constructor ) { - // to catch short annotaion VS 'new' annotation of a - // declaration - // e.g. var i = 1; - // var j = new Number(1); - return a == b; - } else { - return a === b; - } - } - - return { - "string": useStrictEquality, - "boolean": useStrictEquality, - "number": useStrictEquality, - "null": useStrictEquality, - "undefined": useStrictEquality, - - "nan": function( b ) { - return isNaN( b ); - }, - - "date": function( b, a ) { - return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); - }, - - "regexp": function( b, a ) { - return QUnit.objectType( b ) === "regexp" && - // the regex itself - a.source === b.source && - // and its modifers - a.global === b.global && - // (gmi) ... - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline && - a.sticky === b.sticky; - }, - - // - skip when the property is a method of an instance (OOP) - // - abort otherwise, - // initial === would have catch identical references anyway - "function": function() { - var caller = callers[callers.length - 1]; - return caller !== Object && typeof caller !== "undefined"; - }, - - "array": function( b, a ) { - var i, j, len, loop; - - // b could be an object literal here - if ( QUnit.objectType( b ) !== "array" ) { - return false; - } - - len = a.length; - if ( len !== b.length ) { - // safe and faster - return false; - } - - // track reference to avoid circular references - parents.push( a ); - for ( i = 0; i < len; i++ ) { - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - loop = true;// dont rewalk array - } - } - if ( !loop && !innerEquiv(a[i], b[i]) ) { - parents.pop(); - return false; - } - } - parents.pop(); - return true; - }, - - "object": function( b, a ) { - var i, j, loop, - // Default to true - eq = true, - aProperties = [], - bProperties = []; - - // comparing constructors is more strict than using - // instanceof - if ( a.constructor !== b.constructor ) { - // Allow objects with no prototype to be equivalent to - // objects with Object as their constructor. - if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || - ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { - return false; - } - } - - // stack constructor before traversing properties - callers.push( a.constructor ); - // track reference to avoid circular references - parents.push( a ); - - for ( i in a ) { // be strict: don't ensures hasOwnProperty - // and go deep - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - // don't go down the same path twice - loop = true; - } - } - aProperties.push(i); // collect a's properties - - if (!loop && !innerEquiv( a[i], b[i] ) ) { - eq = false; - break; - } - } - - callers.pop(); // unstack, we are done - parents.pop(); - - for ( i in b ) { - bProperties.push( i ); // collect b's properties - } - - // Ensures identical properties name - return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); - } - }; - }()); - - innerEquiv = function() { // can take multiple arguments - var args = [].slice.apply( arguments ); - if ( args.length < 2 ) { - return true; // end transition - } - - return (function( a, b ) { - if ( a === b ) { - return true; // catch the most you can - } else if ( a === null || b === null || typeof a === "undefined" || - typeof b === "undefined" || - QUnit.objectType(a) !== QUnit.objectType(b) ) { - return false; // don't lose time with error prone cases - } else { - return bindCallbacks(a, callbacks, [ b, a ]); - } - - // apply transition with (1..n) arguments - }( args[0], args[1] ) && arguments.callee.apply( this, args.splice(1, args.length - 1 )) ); - }; - - return innerEquiv; -}()); - -/** - * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | - * http://flesler.blogspot.com Licensed under BSD - * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 - * - * @projectDescription Advanced and extensible data dumping for Javascript. - * @version 1.0.0 - * @author Ariel Flesler - * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} - */ -QUnit.jsDump = (function() { - function quote( str ) { - return '"' + str.toString().replace( /"/g, '\\"' ) + '"'; - } - function literal( o ) { - return o + ""; - } - function join( pre, arr, post ) { - var s = jsDump.separator(), - base = jsDump.indent(), - inner = jsDump.indent(1); - if ( arr.join ) { - arr = arr.join( "," + s + inner ); - } - if ( !arr ) { - return pre + post; - } - return [ pre, inner + arr, base + post ].join(s); - } - function array( arr, stack ) { - var i = arr.length, ret = new Array(i); - this.up(); - while ( i-- ) { - ret[i] = this.parse( arr[i] , undefined , stack); - } - this.down(); - return join( "[", ret, "]" ); - } - - var reName = /^function (\w+)/, - jsDump = { - // type is used mostly internally, you can fix a (custom)type in advance - parse: function( obj, type, stack ) { - stack = stack || [ ]; - var inStack, res, - parser = this.parsers[ type || this.typeOf(obj) ]; - - type = typeof parser; - inStack = inArray( obj, stack ); - - if ( inStack !== -1 ) { - return "recursion(" + (inStack - stack.length) + ")"; - } - if ( type === "function" ) { - stack.push( obj ); - res = parser.call( this, obj, stack ); - stack.pop(); - return res; - } - return ( type === "string" ) ? parser : this.parsers.error; - }, - typeOf: function( obj ) { - var type; - if ( obj === null ) { - type = "null"; - } else if ( typeof obj === "undefined" ) { - type = "undefined"; - } else if ( QUnit.is( "regexp", obj) ) { - type = "regexp"; - } else if ( QUnit.is( "date", obj) ) { - type = "date"; - } else if ( QUnit.is( "function", obj) ) { - type = "function"; - } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { - type = "window"; - } else if ( obj.nodeType === 9 ) { - type = "document"; - } else if ( obj.nodeType ) { - type = "node"; - } else if ( - // native arrays - toString.call( obj ) === "[object Array]" || - // NodeList objects - ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) - ) { - type = "array"; - } else if ( obj.constructor === Error.prototype.constructor ) { - type = "error"; - } else { - type = typeof obj; - } - return type; - }, - separator: function() { - return this.multiline ? this.HTML ? "
                        " : "\n" : this.HTML ? " " : " "; - }, - // extra can be a number, shortcut for increasing-calling-decreasing - indent: function( extra ) { - if ( !this.multiline ) { - return ""; - } - var chr = this.indentChar; - if ( this.HTML ) { - chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); - } - return new Array( this._depth_ + (extra||0) ).join(chr); - }, - up: function( a ) { - this._depth_ += a || 1; - }, - down: function( a ) { - this._depth_ -= a || 1; - }, - setParser: function( name, parser ) { - this.parsers[name] = parser; - }, - // The next 3 are exposed so you can use them - quote: quote, - literal: literal, - join: join, - // - _depth_: 1, - // This is the list of parsers, to modify them, use jsDump.setParser - parsers: { - window: "[Window]", - document: "[Document]", - error: function(error) { - return "Error(\"" + error.message + "\")"; - }, - unknown: "[Unknown]", - "null": "null", - "undefined": "undefined", - "function": function( fn ) { - var ret = "function", - // functions never have name in IE - name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1]; - - if ( name ) { - ret += " " + name; - } - ret += "( "; - - ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); - return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); - }, - array: array, - nodelist: array, - "arguments": array, - object: function( map, stack ) { - var ret = [ ], keys, key, val, i; - QUnit.jsDump.up(); - keys = []; - for ( key in map ) { - keys.push( key ); - } - keys.sort(); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - val = map[ key ]; - ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); - } - QUnit.jsDump.down(); - return join( "{", ret, "}" ); - }, - node: function( node ) { - var len, i, val, - open = QUnit.jsDump.HTML ? "<" : "<", - close = QUnit.jsDump.HTML ? ">" : ">", - tag = node.nodeName.toLowerCase(), - ret = open + tag, - attrs = node.attributes; - - if ( attrs ) { - for ( i = 0, len = attrs.length; i < len; i++ ) { - val = attrs[i].nodeValue; - // IE6 includes all attributes in .attributes, even ones not explicitly set. - // Those have values like undefined, null, 0, false, "" or "inherit". - if ( val && val !== "inherit" ) { - ret += " " + attrs[i].nodeName + "=" + QUnit.jsDump.parse( val, "attribute" ); - } - } - } - ret += close; - - // Show content of TextNode or CDATASection - if ( node.nodeType === 3 || node.nodeType === 4 ) { - ret += node.nodeValue; - } - - return ret + open + "/" + tag + close; - }, - // function calls it internally, it's the arguments part of the function - functionArgs: function( fn ) { - var args, - l = fn.length; - - if ( !l ) { - return ""; - } - - args = new Array(l); - while ( l-- ) { - // 97 is 'a' - args[l] = String.fromCharCode(97+l); - } - return " " + args.join( ", " ) + " "; - }, - // object calls it internally, the key part of an item in a map - key: quote, - // function calls it internally, it's the content of the function - functionCode: "[code]", - // node calls it internally, it's an html attribute value - attribute: quote, - string: quote, - date: quote, - regexp: literal, - number: literal, - "boolean": literal - }, - // if true, entities are escaped ( <, >, \t, space and \n ) - HTML: false, - // indentation unit - indentChar: " ", - // if true, items in a collection, are separated by a \n, else just a space. - multiline: true - }; - - return jsDump; -}()); - -// from jquery.js -function inArray( elem, array ) { - if ( array.indexOf ) { - return array.indexOf( elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; -} - -/* - * Javascript Diff Algorithm - * By John Resig (http://ejohn.org/) - * Modified by Chu Alan "sprite" - * - * Released under the MIT license. - * - * More Info: - * http://ejohn.org/projects/javascript-diff-algorithm/ - * - * Usage: QUnit.diff(expected, actual) - * - * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick brown fox jumped jumps over" - */ -QUnit.diff = (function() { - /*jshint eqeqeq:false, eqnull:true */ - function diff( o, n ) { - var i, - ns = {}, - os = {}; - - for ( i = 0; i < n.length; i++ ) { - if ( !hasOwn.call( ns, n[i] ) ) { - ns[ n[i] ] = { - rows: [], - o: null - }; - } - ns[ n[i] ].rows.push( i ); - } - - for ( i = 0; i < o.length; i++ ) { - if ( !hasOwn.call( os, o[i] ) ) { - os[ o[i] ] = { - rows: [], - n: null - }; - } - os[ o[i] ].rows.push( i ); - } - - for ( i in ns ) { - if ( !hasOwn.call( ns, i ) ) { - continue; - } - if ( ns[i].rows.length === 1 && hasOwn.call( os, i ) && os[i].rows.length === 1 ) { - n[ ns[i].rows[0] ] = { - text: n[ ns[i].rows[0] ], - row: os[i].rows[0] - }; - o[ os[i].rows[0] ] = { - text: o[ os[i].rows[0] ], - row: ns[i].rows[0] - }; - } - } - - for ( i = 0; i < n.length - 1; i++ ) { - if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && - n[ i + 1 ] == o[ n[i].row + 1 ] ) { - - n[ i + 1 ] = { - text: n[ i + 1 ], - row: n[i].row + 1 - }; - o[ n[i].row + 1 ] = { - text: o[ n[i].row + 1 ], - row: i + 1 - }; - } - } - - for ( i = n.length - 1; i > 0; i-- ) { - if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && - n[ i - 1 ] == o[ n[i].row - 1 ]) { - - n[ i - 1 ] = { - text: n[ i - 1 ], - row: n[i].row - 1 - }; - o[ n[i].row - 1 ] = { - text: o[ n[i].row - 1 ], - row: i - 1 - }; - } - } - - return { - o: o, - n: n - }; - } - - return function( o, n ) { - o = o.replace( /\s+$/, "" ); - n = n.replace( /\s+$/, "" ); - - var i, pre, - str = "", - out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), - oSpace = o.match(/\s+/g), - nSpace = n.match(/\s+/g); - - if ( oSpace == null ) { - oSpace = [ " " ]; - } - else { - oSpace.push( " " ); - } - - if ( nSpace == null ) { - nSpace = [ " " ]; - } - else { - nSpace.push( " " ); - } - - if ( out.n.length === 0 ) { - for ( i = 0; i < out.o.length; i++ ) { - str += "" + out.o[i] + oSpace[i] + ""; - } - } - else { - if ( out.n[0].text == null ) { - for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { - str += "" + out.o[n] + oSpace[n] + ""; - } - } - - for ( i = 0; i < out.n.length; i++ ) { - if (out.n[i].text == null) { - str += "" + out.n[i] + nSpace[i] + ""; - } - else { - // `pre` initialized at top of scope - pre = ""; - - for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { - pre += "" + out.o[n] + oSpace[n] + ""; - } - str += " " + out.n[i].text + nSpace[i] + pre; - } - } - } - - return str; - }; -}()); - -// for CommonJS enviroments, export everything -if ( typeof exports !== "undefined" ) { - extend( exports, QUnit ); -} - -// get at whatever the global object is, like window in browsers -}( (function() {return this;}.call()) )); diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/README.md deleted file mode 100644 index 7cfe3bb..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar - programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly - more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a - JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/buffer-entry.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/buffer-entry.js deleted file mode 100644 index c7b5a6e..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/buffer-entry.js +++ /dev/null @@ -1,30 +0,0 @@ -// just like the Entry class, but it buffers the contents -// -// XXX It would be good to set a maximum BufferEntry filesize, -// since it eats up memory. In normal operation, -// these are only for long filenames or link names, which are -// rarely very big. - -module.exports = BufferEntry - -var inherits = require("../vendor/inherits/inherits.js") - , Entry = require("./entry.js") - -function BufferEntry () { - Entry.apply(this, arguments) - this._buffer = new Buffer(this.props.size) - this._offset = 0 - this.body = "" - this.on("end", function () { - this.body = this._buffer.toString().slice(0, -1) - }) -} - -// collect the bytes as they come in. -BufferEntry.prototype.write = function (c) { - c.copy(this._buffer, this._offset) - this._offset += c.length - Entry.prototype.write.call(this, c) -} - -inherits(BufferEntry, Entry) diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/entry-writer.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/entry-writer.js deleted file mode 100644 index 9d6a9b7..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/entry-writer.js +++ /dev/null @@ -1,169 +0,0 @@ -module.exports = EntryWriter - -var tar = require("../tar.js") - , TarHeader = require("./header.js") - , Entry = require("./entry.js") - , inherits = require("../vendor/inherits/inherits.js") - , BlockStream = require("../vendor/block-stream/block-stream.js") - , ExtendedHeaderWriter - , Stream = require("stream").Stream - , EOF = {} - -inherits(EntryWriter, Stream) - -function EntryWriter (props) { - var me = this - - if (!(me instanceof EntryWriter)) { - return new EntryWriter(props) - } - - Stream.apply(this) - - me.writable = true - me.readable = true - - me._stream = new BlockStream(512) - - me._stream.on("data", function (c) { - me.emit("data", c) - }) - - me._stream.on("drain", function () { - me.emit("drain") - }) - - me._stream.on("end", function () { - me.emit("end") - me.emit("close") - }) - - me.props = props - if (props.type === "Directory") { - props.size = 0 - } - props.ustar = "ustar\0" - props.ustarver = "00" - me.path = props.path - - me._buffer = [] - me._didHeader = false - me._meta = false - - me.on("pipe", function () { - me._process() - }) -} - -EntryWriter.prototype.write = function (c) { - // console.error(".. ew write") - if (this._ended) return this.emit("error", new Error("write after end")) - this._buffer.push(c) - this._process() - this._needDrain = this._buffer.length > 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/entry.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/entry.js deleted file mode 100644 index 9d5b8bc..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/entry.js +++ /dev/null @@ -1,212 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , fstream = require("../vendor/fstream/fstream.js").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, -{ 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 - } - -, end: function (c) { - if (c) this.write(c) - this._ending = true - this._read() - } - -, pause: function () { - this._paused = true - this.emit("pause") - } - -, 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 -, _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? - if (this._index < this._queueLen) { - 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 - } - -, _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 - } -, warn: fstream.warn -, error: fstream.error -}) diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extended-header-writer.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extended-header-writer.js deleted file mode 100644 index 10a7d8f..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extended-header-writer.js +++ /dev/null @@ -1,192 +0,0 @@ - -module.exports = ExtendedHeaderWriter - -var inherits = require("../vendor/inherits/inherits.js") - , EntryWriter = require("./entry-writer.js") - -inherits(ExtendedHeaderWriter, EntryWriter) - -var tar = require("../tar.js") - , path = require("path") - , inherits = require("../vendor/inherits/inherits.js") - , 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extended-header.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extended-header.js deleted file mode 100644 index 63b79ec..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extended-header.js +++ /dev/null @@ -1,139 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , 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, { _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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extract.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extract.js deleted file mode 100644 index bffc033..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/extract.js +++ /dev/null @@ -1,78 +0,0 @@ -// give it a tarball and a path, and it'll dump the contents - -module.exports = Extract - -var tar = require("../tar.js") - , fstream = require("../vendor/fstream/fstream.js") - , inherits = require("../vendor/inherits/inherits.js") - , 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/global-header-writer.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/global-header-writer.js deleted file mode 100644 index 99ff257..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/global-header-writer.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = GlobalHeaderWriter - -var ExtendedHeaderWriter = require("./extended-header-writer.js") - , inherits = require("../vendor/inherits/inherits.js") - -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/header.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/header.js deleted file mode 100644 index 05b237c..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/header.js +++ /dev/null @@ -1,385 +0,0 @@ -// 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/pack.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/pack.js deleted file mode 100644 index 11b11fb..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/pack.js +++ /dev/null @@ -1,226 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , GlobalHeaderWriter = require("./global-header-writer.js") - , collect = require("../vendor/fstream/fstream.js").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, "/") - } - - 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/parse.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/parse.js deleted file mode 100644 index 3f71a92..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/lib/parse.js +++ /dev/null @@ -1,270 +0,0 @@ - -// 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("../vendor/block-stream/block-stream.js") - , 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("../vendor/inherits/inherits.js") - , fstream = require("../vendor/fstream/fstream.js") - -// 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/tar.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/tar.js deleted file mode 100644 index b9dbca4..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/tar.js +++ /dev/null @@ -1,172 +0,0 @@ -// 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 - , 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/README.md deleted file mode 100644 index c16e9c4..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js deleted file mode 100644 index af63e5f..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js +++ /dev/null @@ -1,209 +0,0 @@ -// 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/inherits.js") - , 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/README.md deleted file mode 100644 index 9d8cb77..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js deleted file mode 100644 index c66d26f..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.Abstract = require("./lib/abstract.js") -exports.Reader = require("./lib/reader.js") -exports.Writer = require("./lib/writer.js") - -exports.File = - { Reader: require("./lib/file-reader.js") - , Writer: require("./lib/file-writer.js") } - -exports.Dir = - { Reader : require("./lib/dir-reader.js") - , Writer : require("./lib/dir-writer.js") } - -exports.Link = - { Reader : require("./lib/link-reader.js") - , Writer : require("./lib/link-writer.js") } - -exports.Proxy = - { Reader : require("./lib/proxy-reader.js") - , Writer : require("./lib/proxy-writer.js") } - -exports.Reader.Dir = exports.DirReader = exports.Dir.Reader -exports.Reader.File = exports.FileReader = exports.File.Reader -exports.Reader.Link = exports.LinkReader = exports.Link.Reader -exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader - -exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer -exports.Writer.File = exports.FileWriter = exports.File.Writer -exports.Writer.Link = exports.LinkWriter = exports.Link.Writer -exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer - -exports.collect = require("./lib/collect.js") diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js deleted file mode 100644 index 6161f3b..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js +++ /dev/null @@ -1,85 +0,0 @@ -// the parent class for all fstreams. - -module.exports = Abstract - -var Stream = require("stream").Stream - , inherits = require("../../inherits/inherits.js") - -function Abstract () { - Stream.call(this) -} - -inherits(Abstract, Stream) - -Abstract.prototype.on = function (ev, fn) { - if (ev === "ready" && this.ready) { - process.nextTick(fn.bind(this)) - } else { - Stream.prototype.on.call(this, ev, fn) - } - return this -} - -Abstract.prototype.abort = function () { - this._aborted = true - this.emit("abort") -} - -Abstract.prototype.destroy = function () {} - -Abstract.prototype.warn = function (msg, code) { - var me = this - , er = decorate(msg, code, me) - if (!me.listeners("warn")) { - console.error("%s %s\n" + - "path = %s\n" + - "syscall = %s\n" + - "fstream_type = %s\n" + - "fstream_path = %s\n" + - "fstream_unc_path = %s\n" + - "fstream_class = %s\n" + - "fstream_stack =\n%s\n", - code || "UNKNOWN", - er.stack, - er.path, - er.syscall, - er.fstream_type, - er.fstream_path, - er.fstream_unc_path, - er.fstream_class, - er.fstream_stack.join("\n")) - } else { - me.emit("warn", er) - } -} - -Abstract.prototype.info = function (msg, code) { - this.emit("info", msg, code) -} - -Abstract.prototype.error = function (msg, code, th) { - var er = decorate(msg, code, this) - if (th) throw er - else this.emit("error", er) -} - -function decorate (er, code, me) { - if (!(er instanceof Error)) er = new Error(er) - er.code = er.code || code - er.path = er.path || me.path - er.fstream_type = er.fstream_type || me.type - er.fstream_path = er.fstream_path || me.path - if (me._path !== me.path) { - er.fstream_unc_path = er.fstream_unc_path || me._path - } - if (me.linkpath) { - er.fstream_linkpath = er.fstream_linkpath || me.linkpath - } - er.fstream_class = er.fstream_class || me.constructor.name - er.fstream_stack = er.fstream_stack || - new Error().stack.split(/\n/).slice(3).map(function (s) { - return s.replace(/^ at /, "") - }) - - return er -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js deleted file mode 100644 index a36f780..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = collect - -function collect (stream) { - if (stream._collected) return - - stream._collected = true - stream.pause() - - stream.on("data", save) - stream.on("end", save) - var buf = [] - function save (b) { - if (typeof b === "string") b = new Buffer(b) - if (Buffer.isBuffer(b) && !b.length) return - buf.push(b) - } - - stream.on("entry", saveEntry) - var entryBuffer = [] - function saveEntry (e) { - collect(e) - entryBuffer.push(e) - } - - stream.on("proxy", proxyPause) - function proxyPause (p) { - p.pause() - } - - - // replace the pipe method with a new version that will - // unlock the buffered stuff. if you just call .pipe() - // without a destination, then it'll re-play the events. - stream.pipe = (function (orig) { return function (dest) { - // console.error(" === open the pipes", dest && dest.path) - - // let the entries flow through one at a time. - // Once they're all done, then we can resume completely. - var e = 0 - ;(function unblockEntry () { - var entry = entryBuffer[e++] - // console.error(" ==== unblock entry", entry && entry.path) - if (!entry) return resume() - entry.on("end", unblockEntry) - if (dest) dest.add(entry) - else stream.emit("entry", entry) - })() - - function resume () { - stream.removeListener("entry", saveEntry) - stream.removeListener("data", save) - stream.removeListener("end", save) - - stream.pipe = orig - if (dest) stream.pipe(dest) - - buf.forEach(function (b) { - if (b) stream.emit("data", b) - else stream.emit("end") - }) - - stream.resume() - } - - return dest - }})(stream.pipe) -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js deleted file mode 100644 index e655b0d..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js +++ /dev/null @@ -1,250 +0,0 @@ -// A thing that emits "entry" events with Reader objects -// Pausing it causes it to stop emitting entry events, and also -// pauses the current entry if there is one. - -module.exports = DirReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , Reader = require("./reader.js") - , assert = require("assert").ok - -inherits(DirReader, Reader) - -function DirReader (props) { - var me = this - if (!(me instanceof DirReader)) throw new Error( - "DirReader must be called as constructor.") - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - throw new Error("Non-directory type "+ props.type) - } - - me.entries = null - me._index = -1 - me._paused = false - me._length = -1 - - if (props.sort) { - this.sort = props.sort - } - - Reader.call(this, props) -} - -DirReader.prototype._getEntries = function () { - var me = this - - // race condition. might pause() before calling _getEntries, - // and then resume, and try to get them a second time. - if (me._gotEntries) return - me._gotEntries = true - - fs.readdir(me._path, function (er, entries) { - if (er) return me.error(er) - - me.entries = entries - - me.emit("entries", entries) - if (me._paused) me.once("resume", processEntries) - else processEntries() - - function processEntries () { - me._length = me.entries.length - if (typeof me.sort === "function") { - me.entries = me.entries.sort(me.sort.bind(me)) - } - me._read() - } - }) -} - -// start walking the dir, and emit an "entry" event for each one. -DirReader.prototype._read = function () { - var me = this - - if (!me.entries) return me._getEntries() - - if (me._paused || me._currentEntry || me._aborted) { - // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted) - return - } - - me._index ++ - if (me._index >= me.entries.length) { - if (!me._ended) { - me._ended = true - me.emit("end") - me.emit("close") - } - return - } - - // ok, handle this one, then. - - // save creating a proxy, by stat'ing the thing now. - var p = path.resolve(me._path, me.entries[me._index]) - assert(p !== me._path) - assert(me.entries[me._index]) - - // set this to prevent trying to _read() again in the stat time. - me._currentEntry = p - fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) { - if (er) return me.error(er) - - var who = me._proxy || me - - stat.path = p - stat.basename = path.basename(p) - stat.dirname = path.dirname(p) - var childProps = me.getChildProps.call(who, stat) - childProps.path = p - childProps.basename = path.basename(p) - childProps.dirname = path.dirname(p) - - var entry = Reader(childProps, stat) - - // console.error("DR Entry", p, stat.size) - - me._currentEntry = entry - - // "entry" events are for direct entries in a specific dir. - // "child" events are for any and all children at all levels. - // This nomenclature is not completely final. - - entry.on("pause", function (who) { - if (!me._paused && !entry._disowned) { - me.pause(who) - } - }) - - entry.on("resume", function (who) { - if (me._paused && !entry._disowned) { - me.resume(who) - } - }) - - entry.on("stat", function (props) { - me.emit("_entryStat", entry, props) - if (entry._aborted) return - if (entry._paused) entry.once("resume", function () { - me.emit("entryStat", entry, props) - }) - else me.emit("entryStat", entry, props) - }) - - entry.on("ready", function EMITCHILD () { - // console.error("DR emit child", entry._path) - if (me._paused) { - // console.error(" DR emit child - try again later") - // pause the child, and emit the "entry" event once we drain. - // console.error("DR pausing child entry") - entry.pause(me) - return me.once("resume", EMITCHILD) - } - - // skip over sockets. they can't be piped around properly, - // so there's really no sense even acknowledging them. - // if someone really wants to see them, they can listen to - // the "socket" events. - if (entry.type === "Socket") { - me.emit("socket", entry) - } else { - me.emitEntry(entry) - } - }) - - var ended = false - entry.on("close", onend) - entry.on("disown", onend) - function onend () { - if (ended) return - ended = true - me.emit("childEnd", entry) - me.emit("entryEnd", entry) - me._currentEntry = null - if (!me._paused) { - me._read() - } - } - - // XXX Remove this. Works in node as of 0.6.2 or so. - // Long filenames should not break stuff. - entry.on("error", function (er) { - if (entry._swallowErrors) { - me.warn(er) - entry.emit("end") - entry.emit("close") - } else { - me.emit("error", er) - } - }) - - // proxy up some events. - ; [ "child" - , "childEnd" - , "warn" - ].forEach(function (ev) { - entry.on(ev, me.emit.bind(me, ev)) - }) - }) -} - -DirReader.prototype.disown = function (entry) { - entry.emit("beforeDisown") - entry._disowned = true - entry.parent = entry.root = null - if (entry === this._currentEntry) { - this._currentEntry = null - } - entry.emit("disown") -} - -DirReader.prototype.getChildProps = function (stat) { - return { depth: this.depth + 1 - , root: this.root || this - , parent: this - , follow: this.follow - , filter: this.filter - , sort: this.props.sort - } -} - -DirReader.prototype.pause = function (who) { - var me = this - if (me._paused) return - who = who || me - me._paused = true - if (me._currentEntry && me._currentEntry.pause) { - me._currentEntry.pause(who) - } - me.emit("pause", who) -} - -DirReader.prototype.resume = function (who) { - var me = this - if (!me._paused) return - who = who || me - - me._paused = false - // console.error("DR Emit Resume", me._path) - me.emit("resume", who) - if (me._paused) { - // console.error("DR Re-paused", me._path) - return - } - - if (me._currentEntry) { - if (me._currentEntry.resume) me._currentEntry.resume(who) - } else me._read() -} - -DirReader.prototype.emitEntry = function (entry) { - this.emit("entry", entry) - this.emit("child", entry) -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js deleted file mode 100644 index 71eb358..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js +++ /dev/null @@ -1,171 +0,0 @@ -// It is expected that, when .add() returns false, the consumer -// of the DirWriter will pause until a "drain" event occurs. Note -// that this is *almost always going to be the case*, unless the -// thing being written is some sort of unsupported type, and thus -// skipped over. - -module.exports = DirWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , collect = require("./collect.js") - -inherits(DirWriter, Writer) - -function DirWriter (props) { - var me = this - if (!(me instanceof DirWriter)) me.error( - "DirWriter must be called as constructor.", null, true) - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - me.error("Non-directory type "+ props.type + " " + - JSON.stringify(props), null, true) - } - - Writer.call(this, props) -} - -DirWriter.prototype._create = function () { - var me = this - mkdir(me._path, Writer.dirmode, function (er) { - if (er) return me.error(er) - // ready to start getting entries! - me.ready = true - me.emit("ready") - me._process() - }) -} - -// a DirWriter has an add(entry) method, but its .write() doesn't -// do anything. Why a no-op rather than a throw? Because this -// leaves open the door for writing directory metadata for -// gnu/solaris style dumpdirs. -DirWriter.prototype.write = function () { - return true -} - -DirWriter.prototype.end = function () { - this._ended = true - this._process() -} - -DirWriter.prototype.add = function (entry) { - var me = this - - // console.error("\tadd", entry._path, "->", me._path) - collect(entry) - if (!me.ready || me._currentEntry) { - me._buffer.push(entry) - return false - } - - // create a new writer, and pipe the incoming entry into it. - if (me._ended) { - return me.error("add after end") - } - - me._buffer.push(entry) - me._process() - - return 0 === this._buffer.length -} - -DirWriter.prototype._process = function () { - var me = this - - // console.error("DW Process p=%j", me._processing, me.basename) - - if (me._processing) return - - var entry = me._buffer.shift() - if (!entry) { - // console.error("DW Drain") - me.emit("drain") - if (me._ended) me._finish() - return - } - - me._processing = true - // console.error("DW Entry", entry._path) - - me.emit("entry", entry) - - // ok, add this entry - // - // don't allow recursive copying - var p = entry - do { - var pp = p._path || p.path - if (pp === me.root._path || pp === me._path || - (pp && pp.indexOf(me._path) === 0)) { - // console.error("DW Exit (recursive)", entry.basename, me._path) - me._processing = false - if (entry._collected) entry.pipe() - return me._process() - } - } while (p = p.parent) - - // console.error("DW not recursive") - - // chop off the entry's root dir, replace with ours - var props = { parent: me - , root: me.root || me - , type: entry.type - , depth: me.depth + 1 } - - var p = entry._path || entry.path || entry.props.path - if (entry.parent) { - p = p.substr(entry.parent._path.length + 1) - } - // get rid of any ../../ shenanigans - props.path = path.join(me.path, path.join("/", p)) - - // if i have a filter, the child should inherit it. - props.filter = me.filter - - // all the rest of the stuff, copy over from the source. - Object.keys(entry.props).forEach(function (k) { - if (!props.hasOwnProperty(k)) { - props[k] = entry.props[k] - } - }) - - // not sure at this point what kind of writer this is. - var child = me._currentChild = new Writer(props) - child.on("ready", function () { - // console.error("DW Child Ready", child.type, child._path) - // console.error(" resuming", entry._path) - entry.pipe(child) - entry.resume() - }) - - // XXX Make this work in node. - // Long filenames should not break stuff. - child.on("error", function (er) { - if (child._swallowErrors) { - me.warn(er) - child.emit("end") - child.emit("close") - } else { - me.emit("error", er) - } - }) - - // we fire _end internally *after* end, so that we don't move on - // until any "end" listeners have had their chance to do stuff. - child.on("close", onend) - var ended = false - function onend () { - if (ended) return - ended = true - // console.error("* DW Child end", child.basename) - me._currentChild = null - me._processing = false - me._process() - } -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js deleted file mode 100644 index e53718a..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js +++ /dev/null @@ -1,147 +0,0 @@ -// Basically just a wrapper around an fs.ReadStream - -module.exports = FileReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - , EOF = {EOF: true} - , CLOSE = {CLOSE: true} - -inherits(FileReader, Reader) - -function FileReader (props) { - // console.error(" FR create", props.path, props.size, new Error().stack) - var me = this - if (!(me instanceof FileReader)) throw new Error( - "FileReader must be called as constructor.") - - // should already be established as a File type - // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, - // with a HardLinkReader class. - if (!((props.type === "Link" && props.Link) || - (props.type === "File" && props.File))) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesEmitted = 0 - Reader.call(me, props) -} - -FileReader.prototype._getStream = function () { - var me = this - , stream = me._stream = fs.createReadStream(me._path, me.props) - - if (me.props.blksize) { - stream.bufferSize = me.props.blksize - } - - stream.on("open", me.emit.bind(me, "open")) - - stream.on("data", function (c) { - // console.error("\t\t%d %s", c.length, me.basename) - me._bytesEmitted += c.length - // no point saving empty chunks - if (!c.length) return - else if (me._paused || me._buffer.length) { - me._buffer.push(c) - me._read() - } else me.emit("data", c) - }) - - stream.on("end", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering End", me._path) - me._buffer.push(EOF) - me._read() - } else { - me.emit("end") - } - - if (me._bytesEmitted !== me.props.size) { - me.error("Didn't get expected byte count\n"+ - "expect: "+me.props.size + "\n" + - "actual: "+me._bytesEmitted) - } - }) - - stream.on("close", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering Close", me._path) - me._buffer.push(CLOSE) - me._read() - } else { - // console.error("FR close 1", me._path) - me.emit("close") - } - }) - - me._read() -} - -FileReader.prototype._read = function () { - var me = this - // console.error("FR _read", me._path) - if (me._paused) { - // console.error("FR _read paused", me._path) - return - } - - if (!me._stream) { - // console.error("FR _getStream calling", me._path) - return me._getStream() - } - - // clear out the buffer, if there is one. - if (me._buffer.length) { - // console.error("FR _read has buffer", me._buffer.length, me._path) - var buf = me._buffer - for (var i = 0, l = buf.length; i < l; i ++) { - var c = buf[i] - if (c === EOF) { - // console.error("FR Read emitting buffered end", me._path) - me.emit("end") - } else if (c === CLOSE) { - // console.error("FR Read emitting buffered close", me._path) - me.emit("close") - } else { - // console.error("FR Read emitting buffered data", me._path) - me.emit("data", c) - } - - if (me._paused) { - // console.error("FR Read Re-pausing at "+i, me._path) - me._buffer = buf.slice(i) - return - } - } - me._buffer.length = 0 - } - // console.error("FR _read done") - // that's about all there is to it. -} - -FileReader.prototype.pause = function (who) { - var me = this - // console.error("FR Pause", me._path) - if (me._paused) return - who = who || me - me._paused = true - if (me._stream) me._stream.pause() - me.emit("pause", who) -} - -FileReader.prototype.resume = function (who) { - var me = this - // console.error("FR Resume", me._path) - if (!me._paused) return - who = who || me - me.emit("resume", who) - me._paused = false - if (me._stream) me._stream.resume() - me._read() -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js deleted file mode 100644 index 70bb86d..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js +++ /dev/null @@ -1,95 +0,0 @@ -module.exports = FileWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , mkdir = require("../../mkdirp") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , EOF = {} - -inherits(FileWriter, Writer) - -function FileWriter (props) { - var me = this - if (!(me instanceof FileWriter)) throw new Error( - "FileWriter must be called as constructor.") - - // should already be established as a File type - if (props.type !== "File" || !props.File) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesWritten = 0 - - Writer.call(this, props) -} - -FileWriter.prototype._create = function () { - var me = this - if (me._stream) return - - var so = {} - if (me.props.flags) so.flags = me.props.flags - so.mode = Writer.filemode - if (me._old && me._old.blksize) so.bufferSize = me._old.blksize - - me._stream = fs.createWriteStream(me._path, so) - - me._stream.on("open", function (fd) { - me.ready = true - me._buffer.forEach(function (c) { - if (c === EOF) me._stream.end() - else me._stream.write(c) - }) - me.emit("ready") - }) - - me._stream.on("drain", function () { me.emit("drain") }) - - me._stream.on("close", function () { - // console.error("\n\nFW Stream Close", me._path, me.size) - me._finish() - }) -} - -FileWriter.prototype.write = function (c) { - var me = this - - me._bytesWritten += c.length - - if (!me.ready) { - me._buffer.push(c) - return false - } - - var ret = me._stream.write(c) - // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length) - - // allow 2 buffered writes, because otherwise there's just too - // much stop and go bs. - return ret || (me._stream._queue && me._stream._queue.length <= 2) -} - -FileWriter.prototype.end = function (c) { - var me = this - - if (c) me.write(c) - - if (!me.ready) { - me._buffer.push(EOF) - return false - } - - return me._stream.end() -} - -FileWriter.prototype._finish = function () { - var me = this - if (typeof me.size === "number" && me._bytesWritten != me.size) { - me.error( - "Did not get expected byte count.\n" + - "expect: " + me.size + "\n" + - "actual: " + me._bytesWritten) - } - Writer.prototype._finish.call(me) -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js deleted file mode 100644 index cd65c41..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = getType - -function getType (st) { - var types = - [ "Directory" - , "File" - , "SymbolicLink" - , "Link" // special for hardlinks from tarballs - , "BlockDevice" - , "CharacterDevice" - , "FIFO" - , "Socket" ] - , type - - if (st.type && -1 !== types.indexOf(st.type)) { - st[st.type] = true - return st.type - } - - for (var i = 0, l = types.length; i < l; i ++) { - type = types[i] - var is = st[type] || st["is" + type] - if (typeof is === "function") is = is.call(st) - if (is) { - st[type] = true - st.type = type - return type - } - } - - return null -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js deleted file mode 100644 index 1d07e2f..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js +++ /dev/null @@ -1,54 +0,0 @@ -// Basically just a wrapper around an fs.readlink -// -// XXX: Enhance this to support the Link type, by keeping -// a lookup table of {:}, so that hardlinks -// can be preserved in tarballs. - -module.exports = LinkReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - -inherits(LinkReader, Reader) - -function LinkReader (props) { - var me = this - if (!(me instanceof LinkReader)) throw new Error( - "LinkReader must be called as constructor.") - - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - Reader.call(me, props) -} - -// When piping a LinkReader into a LinkWriter, we have to -// already have the linkpath property set, so that has to -// happen *before* the "ready" event, which means we need to -// override the _stat method. -LinkReader.prototype._stat = function (currentStat) { - var me = this - fs.readlink(me._path, function (er, linkpath) { - if (er) return me.error(er) - me.linkpath = me.props.linkpath = linkpath - me.emit("linkpath", linkpath) - Reader.prototype._stat.call(me, currentStat) - }) -} - -LinkReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we need - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js deleted file mode 100644 index c652eb3..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js +++ /dev/null @@ -1,95 +0,0 @@ - -module.exports = LinkWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , path = require("path") - , rimraf = require("../../rimraf/rimraf.js") - -inherits(LinkWriter, Writer) - -function LinkWriter (props) { - var me = this - if (!(me instanceof LinkWriter)) throw new Error( - "LinkWriter must be called as constructor.") - - // should already be established as a Link type - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - if (props.linkpath === "") props.linkpath = "." - if (!props.linkpath) { - me.error("Need linkpath property to create " + props.type) - } - - Writer.call(this, props) -} - -LinkWriter.prototype._create = function () { - // console.error(" LW _create") - var me = this - , hard = me.type === "Link" || process.platform === "win32" - , link = hard ? "link" : "symlink" - , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath - - // can only change the link path by clobbering - // For hard links, let's just assume that's always the case, since - // there's no good way to read them if we don't already know. - if (hard) return clobber(me, lp, link) - - fs.readlink(me._path, function (er, p) { - // only skip creation if it's exactly the same link - if (p && p === lp) return finish(me) - clobber(me, lp, link) - }) -} - -function clobber (me, lp, link) { - rimraf(me._path, function (er) { - if (er) return me.error(er) - create(me, lp, link) - }) -} - -function create (me, lp, link) { - fs[link](lp, me._path, function (er) { - // if this is a hard link, and we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier in. - // Additionally, an EPERM or EACCES can happen on win32 if it's trying - // to make a link to a directory. Again, just skip it. - // A better solution would be to have fs.symlink be supported on - // windows in some nice fashion. - if (er) { - if ((er.code === "ENOENT" || - er.code === "EACCES" || - er.code === "EPERM" ) && process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - } else return me.error(er) - } - finish(me) - }) -} - -function finish (me) { - me.ready = true - me.emit("ready") - if (me._ended && !me._finished) me._finish() -} - -LinkWriter.prototype.end = function () { - // console.error("LW finish in end") - this._ended = true - if (this.ready) { - this._finished = true - this._finish() - } -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js deleted file mode 100644 index a51ebdf..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js +++ /dev/null @@ -1,93 +0,0 @@ -// A reader for when we don't yet know what kind of thing -// the thing is. - -module.exports = ProxyReader - -var Reader = require("./reader.js") - , getType = require("./get-type.js") - , inherits = require("../../inherits/inherits.js") - , fs = require("../../graceful-fs/graceful-fs.js") - -inherits(ProxyReader, Reader) - -function ProxyReader (props) { - var me = this - if (!(me instanceof ProxyReader)) throw new Error( - "ProxyReader must be called as constructor.") - - me.props = props - me._buffer = [] - me.ready = false - - Reader.call(me, props) -} - -ProxyReader.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Reader(props, current)) - }) -} - -ProxyReader.prototype._addProxy = function (proxy) { - var me = this - if (me._proxyTarget) { - return me.error("proxy already set") - } - - me._proxyTarget = proxy - proxy._proxy = me - - ; [ "error" - , "data" - , "end" - , "close" - , "linkpath" - , "entry" - , "entryEnd" - , "child" - , "childEnd" - , "warn" - , "stat" - ].forEach(function (ev) { - // console.error("~~ proxy event", ev, me.path) - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - proxy.on("ready", function () { - // console.error("~~ proxy is ready!", me.path) - me.ready = true - me.emit("ready") - }) - - var calls = me._buffer - me._buffer.length = 0 - calls.forEach(function (c) { - proxy[c[0]].apply(proxy, c[1]) - }) -} - -ProxyReader.prototype.pause = function () { - return this._proxyTarget ? this._proxyTarget.pause() : false -} - -ProxyReader.prototype.resume = function () { - return this._proxyTarget ? this._proxyTarget.resume() : false -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js deleted file mode 100644 index 2e6bae4..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js +++ /dev/null @@ -1,109 +0,0 @@ -// A writer for when we don't know what kind of thing -// the thing is. That is, it's not explicitly set, -// so we're going to make it whatever the thing already -// is, or "File" -// -// Until then, collect all events. - -module.exports = ProxyWriter - -var Writer = require("./writer.js") - , getType = require("./get-type.js") - , inherits = require("../../inherits/inherits.js") - , collect = require("./collect.js") - , fs = require("fs") - -inherits(ProxyWriter, Writer) - -function ProxyWriter (props) { - var me = this - if (!(me instanceof ProxyWriter)) throw new Error( - "ProxyWriter must be called as constructor.") - - me.props = props - me._needDrain = false - - Writer.call(me, props) -} - -ProxyWriter.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Writer(props, current)) - }) -} - -ProxyWriter.prototype._addProxy = function (proxy) { - // console.error("~~ set proxy", this.path) - var me = this - if (me._proxy) { - return me.error("proxy already set") - } - - me._proxy = proxy - ; [ "ready" - , "error" - , "close" - , "pipe" - , "drain" - , "warn" - ].forEach(function (ev) { - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - var calls = me._buffer - calls.forEach(function (c) { - // console.error("~~ ~~ proxy buffered call", c[0], c[1]) - proxy[c[0]].call(proxy, c[1]) - }) - me._buffer.length = 0 - if (me._needsDrain) me.emit("drain") -} - -ProxyWriter.prototype.add = function (entry) { - // console.error("~~ proxy add") - collect(entry) - - if (!this._proxy) { - this._buffer.push(["add", [entry]]) - this._needDrain = true - return false - } - return this._proxy.add(entry) -} - -ProxyWriter.prototype.write = function (c) { - // console.error("~~ proxy write") - if (!this._proxy) { - this._buffer.push(["write", [c]]) - this._needDrain = true - return false - } - return this._proxy.write(c) -} - -ProxyWriter.prototype.end = function (c) { - // console.error("~~ proxy end") - if (!this._proxy) { - this._buffer.push(["end", c]) - return false - } - return this._proxy.end(c) -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js deleted file mode 100644 index 42a8701..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js +++ /dev/null @@ -1,258 +0,0 @@ - -module.exports = Reader - -var fs = require("../../graceful-fs/graceful-fs.js") - , Stream = require("stream").Stream - , inherits = require("../../inherits/inherits.js") - , path = require("path") - , getType = require("./get-type.js") - , hardLinks = Reader.hardLinks = {} - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Reader, Abstract) - -var DirReader = require("./dir-reader.js") - , FileReader = require("./file-reader.js") - , LinkReader = require("./link-reader.js") - , SocketReader = require("./socket-reader.js") - , ProxyReader = require("./proxy-reader.js") - -function Reader (props, currentStat) { - var me = this - if (!(me instanceof Reader)) return new Reader(props, currentStat) - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) { - me.error("Must provide a path", null, true) - } - - // polymorphism. - // call fstream.Reader(dir) to get a DirReader object, etc. - // Note that, unlike in the Writer case, ProxyReader is going - // to be the *normal* state of affairs, since we rarely know - // the type of a file prior to reading it. - - - var type - , ClassType - - if (props.type && typeof props.type === "function") { - type = props.type - ClassType = type - } else { - type = getType(props) - ClassType = Reader - } - - if (currentStat && !type) { - type = getType(currentStat) - props[type] = true - props.type = type - } - - switch (type) { - case "Directory": - ClassType = DirReader - break - - case "Link": - // XXX hard links are just files. - // However, it would be good to keep track of files' dev+inode - // and nlink values, and create a HardLinkReader that emits - // a linkpath value of the original copy, so that the tar - // writer can preserve them. - // ClassType = HardLinkReader - // break - - case "File": - ClassType = FileReader - break - - case "SymbolicLink": - ClassType = LinkReader - break - - case "Socket": - ClassType = SocketReader - break - - case null: - ClassType = ProxyReader - break - } - - if (!(me instanceof ClassType)) { - return new ClassType(props) - } - - Abstract.call(me) - - me.readable = true - me.writable = false - - me.type = type - me.props = props - me.depth = props.depth = props.depth || 0 - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - // how DOES one create files on the moon? - // if the path has spaces in it, then UNC will fail. - me._swallowErrors = true - //if (me._path.indexOf(" ") === -1) { - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - //} - } - } - me.basename = props.basename = path.basename(me.path) - me.dirname = props.dirname = path.dirname(me.path) - - // these have served their purpose, and are now just noisy clutter - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - me.filter = typeof props.filter === "function" ? props.filter : null - if (props.sort === "alpha") props.sort = alphasort - - // start the ball rolling. - // this will stat the thing, and then call me._read() - // to start reading whatever it is. - // console.error("calling stat", props.path, currentStat) - me._stat(currentStat) -} - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - -Reader.prototype._stat = function (currentStat) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - - // console.error("Reader._stat", me._path, currentStat) - if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) - else fs[stat](me._path, statCb) - - - function statCb (er, props_) { - // console.error("Reader._stat, statCb", me._path, props_, props_.nlink) - if (er) return me.error(er) - - Object.keys(props_).forEach(function (k) { - props[k] = props_[k] - }) - - // if it's not the expected size, then abort here. - if (undefined !== me.size && props.size !== me.size) { - return me.error("incorrect size") - } - me.size = props.size - - var type = getType(props) - // special little thing for handling hardlinks. - if (type !== "Directory" && props.nlink && props.nlink > 1) { - var k = props.dev + ":" + props.ino - // console.error("Reader has nlink", me._path, k) - if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path - else { - // switch into hardlink mode. - type = me.type = me.props.type = "Link" - me.Link = me.props.Link = true - me.linkpath = me.props.linkpath = hardLinks[k] - // console.error("Hardlink detected, switching mode", me._path, me.linkpath) - // Setting __proto__ would arguably be the "correct" - // approach here, but that just seems too wrong. - me._stat = me._read = LinkReader.prototype._read - } - } - - if (me.type && me.type !== type) { - me.error("Unexpected type: " + type) - } - - // if the filter doesn't pass, then just skip over this one. - // still have to emit end so that dir-walking can move on. - if (me.filter) { - var who = me._proxy || me - // special handling for ProxyReaders - if (!me.filter.call(who, who, props)) { - if (!me._disowned) { - me.abort() - me.emit("end") - me.emit("close") - } - return - } - } - - // last chance to abort or disown before the flow starts! - var events = ["_stat", "stat", "ready"] - var e = 0 - ;(function go () { - if (me._aborted) { - me.emit("end") - me.emit("close") - return - } - - if (me._paused) { - me.once("resume", go) - return - } - - var ev = events[e ++] - if (!ev) return me._read() - me.emit(ev, props) - go() - })() - } -} - -Reader.prototype.pipe = function (dest, opts) { - var me = this - if (typeof dest.add === "function") { - // piping to a multi-compatible, and we've got directory entries. - me.on("entry", function (entry) { - var ret = dest.add(entry) - if (false === ret) { - me.pause() - } - }) - } - - // console.error("R Pipe apply Stream Pipe") - return Stream.prototype.pipe.apply(this, arguments) -} - -Reader.prototype.pause = function (who) { - this._paused = true - who = who || this - this.emit("pause", who) - if (this._stream) this._stream.pause(who) -} - -Reader.prototype.resume = function (who) { - this._paused = false - who = who || this - this.emit("resume", who) - if (this._stream) this._stream.resume(who) - this._read() -} - -Reader.prototype._read = function () { - this.error("Cannot read unknown type: "+this.type) -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js deleted file mode 100644 index 1de8ce9..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js +++ /dev/null @@ -1,38 +0,0 @@ -// Just get the stats, and then don't do anything. -// You can't really "read" from a socket. You "connect" to it. -// Mostly, this is here so that reading a dir with a socket in it -// doesn't blow up. - -module.exports = SocketReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - -inherits(SocketReader, Reader) - -function SocketReader (props) { - var me = this - if (!(me instanceof SocketReader)) throw new Error( - "SocketReader must be called as constructor.") - - if (!(props.type === "Socket" && props.Socket)) { - throw new Error("Non-socket type "+ props.type) - } - - Reader.call(me, props) -} - -SocketReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we have - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js deleted file mode 100644 index decc20e..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js +++ /dev/null @@ -1,389 +0,0 @@ - -module.exports = Writer - -var fs = require("../../graceful-fs/graceful-fs.js") - , inherits = require("../../inherits/inherits.js") - , rimraf = require("../../rimraf/rimraf.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , umask = process.platform === "win32" ? 0 : process.umask() - , getType = require("./get-type.js") - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Writer, Abstract) - -Writer.dirmode = 0777 & (~umask) -Writer.filemode = 0666 & (~umask) - -var DirWriter = require("./dir-writer.js") - , LinkWriter = require("./link-writer.js") - , FileWriter = require("./file-writer.js") - , ProxyWriter = require("./proxy-writer.js") - -// props is the desired state. current is optionally the current stat, -// provided here so that subclasses can avoid statting the target -// more than necessary. -function Writer (props, current) { - var me = this - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) me.error("Must provide a path", null, true) - - // polymorphism. - // call fstream.Writer(dir) to get a DirWriter object, etc. - var type = getType(props) - , ClassType = Writer - - switch (type) { - case "Directory": - ClassType = DirWriter - break - case "File": - ClassType = FileWriter - break - case "Link": - case "SymbolicLink": - ClassType = LinkWriter - break - case null: - // Don't know yet what type to create, so we wrap in a proxy. - ClassType = ProxyWriter - break - } - - if (!(me instanceof ClassType)) return new ClassType(props) - - // now get down to business. - - Abstract.call(me) - - // props is what we want to set. - // set some convenience properties as well. - me.type = props.type - me.props = props - me.depth = props.depth || 0 - me.clobber = false === props.clobber ? props.clobber : true - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - me._swallowErrors = true - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - } - } - me.basename = path.basename(props.path) - me.dirname = path.dirname(props.path) - me.linkpath = props.linkpath || null - - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - - if (typeof props.mode === "string") { - props.mode = parseInt(props.mode, 8) - } - - me.readable = false - me.writable = true - - // buffer until ready, or while handling another entry - me._buffer = [] - me.ready = false - - me.filter = typeof props.filter === "function" ? props.filter: null - - // start the ball rolling. - // this checks what's there already, and then calls - // me._create() to call the impl-specific creation stuff. - me._stat(current) -} - -// Calling this means that it's something we can't create. -// Just assert that it's already there, otherwise raise a warning. -Writer.prototype._create = function () { - var me = this - fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) { - if (er) { - return me.warn("Cannot create " + me._path + "\n" + - "Unsupported type: "+me.type, "ENOTSUP") - } - me._finish() - }) -} - -Writer.prototype._stat = function (current) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - , who = me._proxy || me - - if (current) statCb(null, current) - else fs[stat](me._path, statCb) - - function statCb (er, current) { - if (me.filter && !me.filter.call(who, who, current)) { - me._aborted = true - me.emit("end") - me.emit("close") - return - } - - // if it's not there, great. We'll just create it. - // if it is there, then we'll need to change whatever differs - if (er || !current) { - return create(me) - } - - me._old = current - var currentType = getType(current) - - // if it's a type change, then we need to clobber or error. - // if it's not a type change, then let the impl take care of it. - if (currentType !== me.type) { - return rimraf(me._path, function (er) { - if (er) return me.error(er) - me._old = null - create(me) - }) - } - - // otherwise, just handle in the app-specific way - // this creates a fs.WriteStream, or mkdir's, or whatever - create(me) - } -} - -function create (me) { - // console.error("W create", me._path, Writer.dirmode) - - // XXX Need to clobber non-dirs that are in the way, - // unless { clobber: false } in the props. - mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) { - // console.error("W created", path.dirname(me._path), er) - if (er) return me.error(er) - - // later on, we have to set the mode and owner for these - me._madeDir = made - return me._create() - }) -} - -function endChmod (me, want, current, path, cb) { - var wantMode = want.mode - , chmod = want.follow || me.type !== "SymbolicLink" - ? "chmod" : "lchmod" - - if (!fs[chmod]) return cb() - if (typeof wantMode !== "number") return cb() - - var curMode = current.mode & 0777 - wantMode = wantMode & 0777 - if (wantMode === curMode) return cb() - - fs[chmod](path, wantMode, cb) -} - - -function endChown (me, want, current, path, cb) { - // Don't even try it unless root. Too easy to EPERM. - if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() - if (typeof want.uid !== "number" && - typeof want.gid !== "number" ) return cb() - - if (current.uid === want.uid && - current.gid === want.gid) return cb() - - var chown = (me.props.follow || me.type !== "SymbolicLink") - ? "chown" : "lchown" - if (!fs[chown]) return cb() - - if (typeof want.uid !== "number") want.uid = current.uid - if (typeof want.gid !== "number") want.gid = current.gid - - fs[chown](path, want.uid, want.gid, cb) -} - -function endUtimes (me, want, current, path, cb) { - if (!fs.utimes || process.platform === "win32") return cb() - - var utimes = (want.follow || me.type !== "SymbolicLink") - ? "utimes" : "lutimes" - - if (utimes === "lutimes" && !fs[utimes]) { - utimes = "utimes" - } - - if (!fs[utimes]) return cb() - - var curA = current.atime - , curM = current.mtime - , meA = want.atime - , meM = want.mtime - - if (meA === undefined) meA = curA - if (meM === undefined) meM = curM - - if (!isDate(meA)) meA = new Date(meA) - if (!isDate(meM)) meA = new Date(meM) - - if (meA.getTime() === curA.getTime() && - meM.getTime() === curM.getTime()) return cb() - - fs[utimes](path, meA, meM, cb) -} - - -// XXX This function is beastly. Break it up! -Writer.prototype._finish = function () { - var me = this - - // console.error(" W Finish", me._path, me.size) - - // set up all the things. - // At this point, we're already done writing whatever we've gotta write, - // adding files to the dir, etc. - var todo = 0 - var errState = null - var done = false - - if (me._old) { - // the times will almost *certainly* have changed. - // adds the utimes syscall, but remove another stat. - me._old.atime = new Date(0) - me._old.mtime = new Date(0) - // console.error(" W Finish Stale Stat", me._path, me.size) - setProps(me._old) - } else { - var stat = me.props.follow ? "stat" : "lstat" - // console.error(" W Finish Stating", me._path, me.size) - fs[stat](me._path, function (er, current) { - // console.error(" W Finish Stated", me._path, me.size, current) - if (er) { - // if we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier on. - if (er.code === "ENOENT" && - (me.type === "Link" || me.type === "SymbolicLink") && - process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - return - } else return me.error(er) - } - setProps(me._old = current) - }) - } - - return - - function setProps (current) { - endChmod(me, me.props, current, me._path, next("chmod")) - endChown(me, me.props, current, me._path, next("chown")) - endUtimes(me, me.props, current, me._path, next("chown")) - } - - function next (what) { - todo ++ - return function (er) { - // console.error(" W Finish", what, todo) - if (errState) return - if (er) { - er.fstream_finish_call = what - return me.error(errState = er) - } - if (--todo > 0) return - if (done) return - done = true - - // we may still need to set the mode/etc. on some parent dirs - // that were created previously. delay end/close until then. - if (!me._madeDir) return end() - else endMadeDir(me, me._path, end) - - function end (er) { - if (er) { - er.fstream_finish_call = "setupMadeDir" - return me.error(er) - } - // all the props have been set, so we're completely done. - me.emit("end") - me.emit("close") - } - } - } -} - -function endMadeDir (me, p, cb) { - var made = me._madeDir - // everything *between* made and path.dirname(me._path) - // needs to be set up. Note that this may just be one dir. - var d = path.dirname(p) - - endMadeDir_(me, d, function (er) { - if (er) return cb(er) - if (d === made) { - return cb() - } - endMadeDir(me, d, cb) - }) -} - -function endMadeDir_ (me, p, cb) { - var dirProps = {} - Object.keys(me.props).forEach(function (k) { - dirProps[k] = me.props[k] - - // only make non-readable dirs if explicitly requested. - if (k === "mode" && me.type !== "Directory") { - dirProps[k] = dirProps[k] | 0111 - } - }) - - var todo = 3 - , errState = null - fs.stat(p, function (er, current) { - if (er) return cb(errState = er) - endChmod(me, dirProps, current, p, next) - endChown(me, dirProps, current, p, next) - endUtimes(me, dirProps, current, p, next) - }) - - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- todo === 0) return cb() - } -} - -Writer.prototype.pipe = function () { - this.error("Can't pipe from writable stream") -} - -Writer.prototype.add = function () { - this.error("Cannot add to non-Directory type") -} - -Writer.prototype.write = function () { - return true -} - -function objectToString (d) { - return Object.prototype.toString.call(d) -} - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md deleted file mode 100644 index 7d2e681..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js deleted file mode 100644 index be9951e..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,312 +0,0 @@ -// 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 = require("fs") - -// there is such a thing as TOO graceful. -if (fs.open === gracefulOpen) return - -var queue = [] - , constants = require("constants") - -exports = module.exports = fs -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync - - -// 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 ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.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 - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) -} - - -// (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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/README.md deleted file mode 100644 index b2beaed..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js deleted file mode 100644 index 061b396..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown deleted file mode 100644 index 40de04f..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/README.markdown +++ /dev/null @@ -1,61 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js deleted file mode 100644 index bef2e06..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js +++ /dev/null @@ -1,161 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("../../graceful-fs/graceful-fs.js") -} catch (er) { - fs = require("fs") -} - -var lstat = "lstat" -if (process.platform === "win32") { - // not reliable on windows prior to 0.7.9 - var v = process.version.replace(/^v/, '').split(/\.|-/).map(Number) - if (v[0] === 0 && (v[1] < 7 || v[1] == 7 && v[2] < 9)) { - lstat = "stat" - } -} -if (!fs[lstat]) lstat = "stat" -var lstatSync = lstat + "Sync" - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -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 (er.code === "EBUSY" && 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) - }) -} - -function rimraf_ (p, cb) { - fs[lstat](p, function (er, s) { - if (er) { - // already gone - if (er.code === "ENOENT") return cb() - // some other kind of error, permissions, etc. - return cb(er) - } - - return rm_(p, s, false, cb) - }) -} - - -var myGid = function myGid () { - var g = process.getuid && process.getgid() - myGid = function myGid () { return g } - return g -} - -var myUid = function myUid () { - var u = process.getuid && process.getuid() - myUid = function myUid () { return u } - return u -} - - -function writable (s) { - var mode = s.mode || 0777 - , uid = myUid() - , gid = myGid() - return (mode & 0002) - || (gid === s.gid && (mode & 0020)) - || (uid === s.uid && (mode & 0200)) -} - -function rm_ (p, s, didWritableCheck, cb) { - if (!didWritableCheck && !writable(s)) { - // make file writable - // user/group/world, doesn't matter at this point - // since it's about to get nuked. - return fs.chmod(p, s.mode | 0222, function (er) { - if (er) return cb(er) - rm_(p, s, true, cb) - }) - } - - if (!s.isDirectory()) { - return fs.unlink(p, cb) - } - - // directory - fs.readdir(p, function (er, files) { - if (er) return cb(er) - asyncForEach(files.map(function (f) { - return path.join(p, f) - }), function (file, cb) { - rimraf(file, cb) - }, function (er) { - if (er) return cb(er) - fs.rmdir(p, cb) - }) - }) -} - -function asyncForEach (list, fn, cb) { - if (!list.length) cb() - var c = list.length - , errState = null - list.forEach(function (item, i, list) { - fn(item, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- c === 0) return cb() - }) - }) -} - -// this looks simpler, but it will fail with big directory trees, -// or on slow stupid awful cygwin filesystems -function rimrafSync (p) { - try { - var s = fs[lstatSync](p) - } catch (er) { - if (er.code === "ENOENT") return - throw er - } - - if (!writable(s)) { - fs.chmodSync(p, s.mode | 0222) - } - - if (!s.isDirectory()) return fs.unlinkSync(p) - - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/LICENSE b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/LICENSE deleted file mode 100644 index 0d8dbe4..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud - -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/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/README.md deleted file mode 100644 index b1f3e50..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/underscore.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/underscore.js deleted file mode 100644 index a12f0d9..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/vendor/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// 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/node_modules/grunt/node_modules/findup-sync/package.json b/node_modules/grunt/node_modules/findup-sync/package.json deleted file mode 100644 index 95772f2..0000000 --- a/node_modules/grunt/node_modules/findup-sync/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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.0" -} diff --git a/node_modules/grunt/node_modules/findup-sync/test/findup-sync_test.js b/node_modules/grunt/node_modules/findup-sync/test/findup-sync_test.js deleted file mode 100644 index f8baf9e..0000000 --- a/node_modules/grunt/node_modules/findup-sync/test/findup-sync_test.js +++ /dev/null @@ -1,48 +0,0 @@ -'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/node_modules/grunt/node_modules/findup-sync/test/fixtures/a.txt b/node_modules/grunt/node_modules/findup-sync/test/fixtures/a.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/b/bar.txt b/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/b/bar.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/foo.txt b/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/foo.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/findup-sync/test/fixtures/aaa.txt b/node_modules/grunt/node_modules/findup-sync/test/fixtures/aaa.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/glob/.npmignore b/node_modules/grunt/node_modules/glob/.npmignore deleted file mode 100644 index 2af4b71..0000000 --- a/node_modules/grunt/node_modules/glob/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.*.swp -test/a/ diff --git a/node_modules/grunt/node_modules/glob/.travis.yml b/node_modules/grunt/node_modules/glob/.travis.yml deleted file mode 100644 index baa0031..0000000 --- a/node_modules/grunt/node_modules/glob/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt/node_modules/glob/LICENSE b/node_modules/grunt/node_modules/glob/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt/node_modules/glob/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt/node_modules/glob/README.md b/node_modules/grunt/node_modules/glob/README.md deleted file mode 100644 index 6e27df6..0000000 --- a/node_modules/grunt/node_modules/glob/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# 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/node_modules/grunt/node_modules/glob/examples/g.js b/node_modules/grunt/node_modules/glob/examples/g.js deleted file mode 100644 index be122df..0000000 --- a/node_modules/grunt/node_modules/glob/examples/g.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt/node_modules/glob/examples/usr-local.js b/node_modules/grunt/node_modules/glob/examples/usr-local.js deleted file mode 100644 index 327a425..0000000 --- a/node_modules/grunt/node_modules/glob/examples/usr-local.js +++ /dev/null @@ -1,9 +0,0 @@ -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/node_modules/grunt/node_modules/glob/glob.js b/node_modules/grunt/node_modules/glob/glob.js deleted file mode 100644 index 891c883..0000000 --- a/node_modules/grunt/node_modules/glob/glob.js +++ /dev/null @@ -1,643 +0,0 @@ -// 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/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index ca91152..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,442 +0,0 @@ -// 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/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json deleted file mode 100644 index e044da3..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "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" - }, - "_id": "graceful-fs@1.2.3", - "_from": "graceful-fs@~1.2.0" -} diff --git a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/open.js b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d532..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/ulimit.js b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/ulimit.js deleted file mode 100644 index 8d0882d..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/ulimit.js +++ /dev/null @@ -1,158 +0,0 @@ -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/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md b/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md deleted file mode 100644 index b2beaed..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/grunt/node_modules/glob/node_modules/inherits/inherits.js b/node_modules/grunt/node_modules/glob/node_modules/inherits/inherits.js deleted file mode 100644 index 061b396..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json b/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json deleted file mode 100644 index 974e1bd..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "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" - }, - "_id": "inherits@1.0.0", - "_from": "inherits@1" -} diff --git a/node_modules/grunt/node_modules/glob/package.json b/node_modules/grunt/node_modules/glob/package.json deleted file mode 100644 index e85a4ff..0000000 --- a/node_modules/grunt/node_modules/glob/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "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" - }, - "_id": "glob@3.1.21", - "_from": "glob@~3.1.21" -} diff --git a/node_modules/grunt/node_modules/glob/test/00-setup.js b/node_modules/grunt/node_modules/glob/test/00-setup.js deleted file mode 100644 index 245afaf..0000000 --- a/node_modules/grunt/node_modules/glob/test/00-setup.js +++ /dev/null @@ -1,176 +0,0 @@ -// 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/node_modules/grunt/node_modules/glob/test/bash-comparison.js b/node_modules/grunt/node_modules/glob/test/bash-comparison.js deleted file mode 100644 index 239ed1a..0000000 --- a/node_modules/grunt/node_modules/glob/test/bash-comparison.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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/node_modules/grunt/node_modules/glob/test/bash-results.json b/node_modules/grunt/node_modules/glob/test/bash-results.json deleted file mode 100644 index c227449..0000000 --- a/node_modules/grunt/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "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/node_modules/grunt/node_modules/glob/test/cwd-test.js b/node_modules/grunt/node_modules/glob/test/cwd-test.js deleted file mode 100644 index 352c27e..0000000 --- a/node_modules/grunt/node_modules/glob/test/cwd-test.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt/node_modules/glob/test/mark.js b/node_modules/grunt/node_modules/glob/test/mark.js deleted file mode 100644 index ed68a33..0000000 --- a/node_modules/grunt/node_modules/glob/test/mark.js +++ /dev/null @@ -1,74 +0,0 @@ -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/node_modules/grunt/node_modules/glob/test/nocase-nomagic.js b/node_modules/grunt/node_modules/glob/test/nocase-nomagic.js deleted file mode 100644 index d862970..0000000 --- a/node_modules/grunt/node_modules/glob/test/nocase-nomagic.js +++ /dev/null @@ -1,113 +0,0 @@ -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/node_modules/grunt/node_modules/glob/test/pause-resume.js b/node_modules/grunt/node_modules/glob/test/pause-resume.js deleted file mode 100644 index e1ffbab..0000000 --- a/node_modules/grunt/node_modules/glob/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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/node_modules/grunt/node_modules/glob/test/root-nomount.js b/node_modules/grunt/node_modules/glob/test/root-nomount.js deleted file mode 100644 index 3ac5979..0000000 --- a/node_modules/grunt/node_modules/glob/test/root-nomount.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt/node_modules/glob/test/root.js b/node_modules/grunt/node_modules/glob/test/root.js deleted file mode 100644 index 95c23f9..0000000 --- a/node_modules/grunt/node_modules/glob/test/root.js +++ /dev/null @@ -1,46 +0,0 @@ -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/node_modules/grunt/node_modules/glob/test/zz-cleanup.js b/node_modules/grunt/node_modules/glob/test/zz-cleanup.js deleted file mode 100644 index e085f0f..0000000 --- a/node_modules/grunt/node_modules/glob/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -// 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/node_modules/grunt/node_modules/hooker/LICENSE-MIT b/node_modules/grunt/node_modules/hooker/LICENSE-MIT deleted file mode 100644 index 90c336c..0000000 --- a/node_modules/grunt/node_modules/hooker/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 "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/node_modules/grunt/node_modules/hooker/README.md b/node_modules/grunt/node_modules/hooker/README.md deleted file mode 100644 index 138943a..0000000 --- a/node_modules/grunt/node_modules/hooker/README.md +++ /dev/null @@ -1,186 +0,0 @@ -# JavaScript Hooker - -Monkey-patch (hook) functions for debugging and stuff. - -## Getting Started - -This code should work just fine in Node.js: - -First, install the module with: `npm install hooker` - -```javascript -var hooker = require('hooker'); -hooker.hook(Math, "max", function() { - console.log(arguments.length + " arguments passed"); -}); -Math.max(5, 6, 7) // logs: "3 arguments passed", returns 7 -``` - -Or in the browser: - -```html - - -``` - -In the browser, you can attach Hooker's methods to any object. - -```html - - - -``` - -## Documentation - -### hooker.hook -Monkey-patch (hook) one or more methods of an object. -#### Signature: -`hooker.hook(object, [ props, ] [options | prehookFunction])` -#### `props` -The optional `props` argument can be a method name, array of method names or null. If null (or omitted), all enumerable methods of `object` will be hooked. -#### `options` -* `pre` - (Function) a pre-hook function to be executed before the original function. Arguments passed into the method will be passed into the pre-hook function as well. -* `post` - (Function) a post-hook function to be executed after the original function. The original function's result is passed into the post-hook function as its first argument, followed by the method arguments. -* `once` - (Boolean) if true, auto-unhook the function after the first execution. -* `passName` - (Boolean) if true, pass the name of the method into the pre-hook function as its first arg (preceding all other arguments), and into the post-hook function as the second arg (after result but preceding all other arguments). - -#### Returns: -An array of hooked method names. - -### hooker.unhook -Un-monkey-patch (unhook) one or more methods of an object. -#### Signature: -`hooker.unhook(object [, props ])` -#### `props` -The optional `props` argument can be a method name, array of method names or null. If null (or omitted), all methods of `object` will be unhooked. -#### Returns: -An array of unhooked method names. - -### hooker.orig -Get a reference to the original method from a hooked function. -#### Signature: -`hooker.orig(object, props)` - -### hooker.override -When a pre- or post-hook returns the result of this function, the value -passed will be used in place of the original function's return value. Any -post-hook override value will take precedence over a pre-hook override value. -#### Signature: -`hooker.override(value)` - -### hooker.preempt -When a pre-hook returns the result of this function, the value passed will -be used in place of the original function's return value, and the original -function will NOT be executed. -#### Signature: -`hooker.preempt(value)` - -### hooker.filter -When a pre-hook returns the result of this function, the context and -arguments passed will be applied into the original function. -#### Signature: -`hooker.filter(context, arguments)` - - -## Examples -See the unit tests for more examples. - -```javascript -var hooker = require('hooker'); -// Simple logging. -hooker.hook(Math, "max", function() { - console.log(arguments.length + " arguments passed"); -}); -Math.max(5, 6, 7) // logs: "3 arguments passed", returns 7 - -hooker.unhook(Math, "max"); // (This is assumed between all further examples) -Math.max(5, 6, 7) // 7 - -// Returning hooker.override(value) overrides the original value. -hooker.hook(Math, "max", function() { - if (arguments.length === 0) { - return hooker.override(9000); - } -}); -Math.max(5, 6, 7) // 7 -Math.max() // 9000 - -// Auto-unhook after one execution. -hooker.hook(Math, "max", { - once: true, - pre: function() { - console.log("Init something here"); - } -}); -Math.max(5, 6, 7) // logs: "Init something here", returns 7 -Math.max(5, 6, 7) // 7 - -// Filter `this` and arguments through a pre-hook function. -hooker.hook(Math, "max", { - pre: function() { - var args = [].map.call(arguments, function(num) { - return num * 2; - }); - return hooker.filter(this, args); // thisValue, arguments - } -}); -Math.max(5, 6, 7) // 14 - -// Modify the original function's result with a post-hook function. -hooker.hook(Math, "max", { - post: function(result) { - return hooker.override(result * 100); - } -}); -Math.max(5, 6, 7) // 700 - -// Hook every Math method. Note: if Math's methods were enumerable, the second -// argument could be omitted. Since they aren't, an array of properties to hook -// must be explicitly passed. Non-method properties will be skipped. -// See a more generic example here: http://bit.ly/vvJlrS -hooker.hook(Math, Object.getOwnPropertyNames(Math), { - passName: true, - pre: function(name) { - console.log("=> Math." + name, [].slice.call(arguments, 1)); - }, - post: function(result, name) { - console.log("<= Math." + name, result); - } -}); - -var result = Math.max(5, 6, 7); -// => Math.max [ 5, 6, 7 ] -// <= Math.max 7 -result // 7 - -result = Math.ceil(3.456); -// => Math.ceil [ 3.456 ] -// <= Math.ceil 4 -result // 4 -``` - -## 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](https://github.com/cowboy/grunt). - -_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_ - -## Release History -2012/01/09 - v0.2.3 - First official release. - -## License -Copyright (c) 2012 "Cowboy" Ben Alman -Licensed under the MIT license. - diff --git a/node_modules/grunt/node_modules/hooker/child.js b/node_modules/grunt/node_modules/hooker/child.js deleted file mode 100644 index ae7dcf2..0000000 --- a/node_modules/grunt/node_modules/hooker/child.js +++ /dev/null @@ -1,101 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var nodeunit = require('nodeunit'); - -var filepaths = fs.readdirSync('test').map(function(filename) { - return path.join('test', filename); -}); - -var unfinished = {}; -var currentModule; -function sendMessage(message) { - process.stdout.write(JSON.stringify(message) + '\n'); -} - -// If an exception is thrown, let the parent process know and exit. -process.on('uncaughtException', function (e) { - sendMessage({error: [e.name, e.message, e.stack]}); - process.exit(); -}); - -// If Nodeunit explodes because a test was missing test.done(), handle it. -var unfinished = {}; -process.on('exit', function (e) { - var len = Object.keys(unfinished).length - if (len > 0) { - sendMessage({exit: ['UNFINISHED']}); - // process.reallyExit(len); - } else { - sendMessage({exit: ['finished']}); - } - // process.exit(); -}); - -nodeunit.reporters.test = { - run: function(files, options, callback) { - // Nodeunit needs absolute paths. - var paths = files.map(function (filepath) { - return path.resolve(filepath); - }); - nodeunit.runFiles(paths, { - // No idea. - testspec: undefined, - // Executed when the first test in a file is run. If no tests exist in - // the file, this doesn't execute. - moduleStart: function(name) { - // Keep track of this so that moduleDone output can be suppressed in - // cases where a test file contains no tests. - currentModule = name; - // Send back to the parent process. - sendMessage({moduleStart: [name.toString()]}); - }, - // Executed after a file is done being processed. This executes whether - // tests exist in the file or not. - moduleDone: function(name) { - // Abort if no tests actually ran. - if (name !== currentModule) { return; } - // Send back to the parent process. - sendMessage({moduleDone: [name.toString()]}); - }, - // Executed before each test is run. - testStart: function(name) { - // Keep track of the current test, in case test.done() was omitted - // and Nodeunit explodes. - unfinished[name] = name; - // Send back to the parent process. - sendMessage({testStart: [name.toString()]}); - }, - // Executed after each test and all its assertions are run. - testDone: function(name, assertions) { - delete unfinished[name]; - // Send back to the parent process. - sendMessage({testDone: [ - name.toString(), - assertions.failures(), - assertions.map(function(assertion) { - var e = assertion.error; - if (e) { - assertion.error = { - name: e.name, - message: e.message, - stack: e.stack - }; - } - return assertion; - }) - ]}); - }, - // Executed when everything is all done. - done: function (assertions) { - // Send back to the parent process. - sendMessage({done: [ - assertions.failures(), - assertions.duration, - assertions - ]}); - } - }); - } -} - -nodeunit.reporters.test.run(filepaths, {}); diff --git a/node_modules/grunt/node_modules/hooker/dist/ba-hooker.js b/node_modules/grunt/node_modules/hooker/dist/ba-hooker.js deleted file mode 100644 index d10a321..0000000 --- a/node_modules/grunt/node_modules/hooker/dist/ba-hooker.js +++ /dev/null @@ -1,169 +0,0 @@ -/*! JavaScript Hooker - v0.2.3 - 1/29/2012 -* http://github.com/cowboy/javascript-hooker -* Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ - -(function(exports) { - // Get an array from an array-like object with slice.call(arrayLikeObject). - var slice = [].slice; - // Get an "[object [[Class]]]" string with toString.call(value). - var toString = {}.toString; - - // I can't think of a better way to ensure a value is a specific type other - // than to create instances and use the `instanceof` operator. - function HookerOverride(v) { this.value = v; } - function HookerPreempt(v) { this.value = v; } - function HookerFilter(c, a) { this.context = c; this.args = a; } - - // When a pre- or post-hook returns the result of this function, the value - // passed will be used in place of the original function's return value. Any - // post-hook override value will take precedence over a pre-hook override - // value. - exports.override = function(value) { - return new HookerOverride(value); - }; - - // When a pre-hook returns the result of this function, the value passed will - // be used in place of the original function's return value, and the original - // function will NOT be executed. - exports.preempt = function(value) { - return new HookerPreempt(value); - }; - - // When a pre-hook returns the result of this function, the context and - // arguments passed will be applied into the original function. - exports.filter = function(context, args) { - return new HookerFilter(context, args); - }; - - // Execute callback(s) for properties of the specified object. - function forMethods(obj, props, callback) { - var prop; - if (typeof props === "string") { - // A single prop string was passed. Create an array. - props = [props]; - } else if (props == null) { - // No props were passed, so iterate over all properties, building an - // array. Unfortunately, Object.keys(obj) doesn't work everywhere yet, so - // this has to be done manually. - props = []; - for (prop in obj) { - if (obj.hasOwnProperty(prop)) { - props.push(prop); - } - } - } - // Execute callback for every method in the props array. - var i = props.length; - while (i--) { - // If the property isn't a function... - if (toString.call(obj[props[i]]) !== "[object Function]" || - // ...or the callback returns false... - callback(obj, props[i]) === false) { - // ...remove it from the props array to be returned. - props.splice(i, 1); - } - } - // Return an array of method names for which the callback didn't fail. - return props; - } - - // Monkey-patch (hook) a method of an object. - exports.hook = function(obj, props, options) { - // If the props argument was omitted, shuffle the arguments. - if (options == null) { - options = props; - props = null; - } - // If just a function is passed instead of an options hash, use that as a - // pre-hook function. - if (typeof options === "function") { - options = {pre: options}; - } - - // Hook the specified method of the object. - return forMethods(obj, props, function(obj, prop) { - // The original (current) method. - var orig = obj[prop]; - // The new hooked function. - function hooked() { - var result, origResult, tmp; - - // Get an array of arguments. - var args = slice.call(arguments); - - // If passName option is specified, prepend prop to the args array, - // passing it as the first argument to any specified hook functions. - if (options.passName) { - args.unshift(prop); - } - - // If a pre-hook function was specified, invoke it in the current - // context with the passed-in arguments, and store its result. - if (options.pre) { - result = options.pre.apply(this, args); - } - - if (result instanceof HookerFilter) { - // If the pre-hook returned hooker.filter(context, args), invoke the - // original function with that context and arguments, and store its - // result. - origResult = result = orig.apply(result.context, result.args); - } else if (result instanceof HookerPreempt) { - // If the pre-hook returned hooker.preempt(value) just use the passed - // value and don't execute the original function. - origResult = result = result.value; - } else { - // Invoke the original function in the current context with the - // passed-in arguments, and store its result. - origResult = orig.apply(this, arguments); - // If the pre-hook returned hooker.override(value), use the passed - // value, otherwise use the original function's result. - result = result instanceof HookerOverride ? result.value : origResult; - } - - if (options.post) { - // If a post-hook function was specified, invoke it in the current - // context, passing in the result of the original function as the - // first argument, followed by any passed-in arguments. - tmp = options.post.apply(this, [origResult].concat(args)); - if (tmp instanceof HookerOverride) { - // If the post-hook returned hooker.override(value), use the passed - // value, otherwise use the previously computed result. - result = tmp.value; - } - } - - // Unhook if the "once" option was specified. - if (options.once) { - exports.unhook(obj, prop); - } - - // Return the result! - return result; - } - // Re-define the method. - obj[prop] = hooked; - // Fail if the function couldn't be hooked. - if (obj[prop] !== hooked) { return false; } - // Store a reference to the original method as a property on the new one. - obj[prop]._orig = orig; - }); - }; - - // Get a reference to the original method from a hooked function. - exports.orig = function(obj, prop) { - return obj[prop]._orig; - }; - - // Un-monkey-patch (unhook) a method of an object. - exports.unhook = function(obj, props) { - return forMethods(obj, props, function(obj, prop) { - // Get a reference to the original method, if it exists. - var orig = exports.orig(obj, prop); - // If there's no original method, it can't be unhooked, so fail. - if (!orig) { return false; } - // Unhook the method. - obj[prop] = orig; - }); - }; -}(typeof exports === "object" && exports || this)); diff --git a/node_modules/grunt/node_modules/hooker/dist/ba-hooker.min.js b/node_modules/grunt/node_modules/hooker/dist/ba-hooker.min.js deleted file mode 100644 index 2bcdb54..0000000 --- a/node_modules/grunt/node_modules/hooker/dist/ba-hooker.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! JavaScript Hooker - v0.2.3 - 1/29/2012 -* http://github.com/cowboy/javascript-hooker -* Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ -(function(a){function d(a){this.value=a}function e(a){this.value=a}function f(a,b){this.context=a,this.args=b}function g(a,b,d){var e;if(typeof b=="string")b=[b];else if(b==null){b=[];for(e in a)a.hasOwnProperty(e)&&b.push(e)}var f=b.length;while(f--)(c.call(a[b[f]])!=="[object Function]"||d(a,b[f])===!1)&&b.splice(f,1);return b}var b=[].slice,c={}.toString;a.override=function(a){return new d(a)},a.preempt=function(a){return new e(a)},a.filter=function(a,b){return new f(a,b)},a.hook=function(c,h,i){return i==null&&(i=h,h=null),typeof i=="function"&&(i={pre:i}),g(c,h,function(c,g){function j(){var j,k,l,m=b.call(arguments);return i.passName&&m.unshift(g),i.pre&&(j=i.pre.apply(this,m)),j instanceof f?k=j=h.apply(j.context,j.args):j instanceof e?k=j=j.value:(k=h.apply(this,arguments),j=j instanceof d?j.value:k),i.post&&(l=i.post.apply(this,[k].concat(m)),l instanceof d&&(j=l.value)),i.once&&a.unhook(c,g),j}var h=c[g];c[g]=j;if(c[g]!==j)return!1;c[g]._orig=h})},a.orig=function(a,b){return a[b]._orig},a.unhook=function(b,c){return g(b,c,function(b,c){var d=a.orig(b,c);if(!d)return!1;b[c]=d})}})(typeof exports=="object"&&exports||this) \ No newline at end of file diff --git a/node_modules/grunt/node_modules/hooker/grunt.js b/node_modules/grunt/node_modules/hooker/grunt.js deleted file mode 100644 index c695148..0000000 --- a/node_modules/grunt/node_modules/hooker/grunt.js +++ /dev/null @@ -1,47 +0,0 @@ -/*global config:true, task:true*/ -config.init({ - pkg: '', - meta: { - name: 'JavaScript Hooker', - banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= template.today("m/d/yyyy") %>\n' + - '* <%= pkg.homepage %>\n' + - '* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' + - ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' - }, - concat: { - 'dist/ba-hooker.js': ['', ''] - }, - min: { - 'dist/ba-hooker.min.js': ['', 'dist/ba-hooker.js'] - }, - test: { - files: ['test/**/*.js'] - }, - lint: { - files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] - }, - watch: { - files: '', - tasks: 'lint:files test:files' - }, - jshint: { - options: { - curly: true, - eqeqeq: true, - immed: true, - latedef: true, - newcap: true, - noarg: true, - sub: true, - undef: true, - eqnull: true - }, - globals: { - exports: true - } - }, - uglify: {} -}); - -// Default task. -task.registerTask('default', 'lint:files test:files concat min'); diff --git a/node_modules/grunt/node_modules/hooker/lib/hooker.js b/node_modules/grunt/node_modules/hooker/lib/hooker.js deleted file mode 100644 index 1ff9764..0000000 --- a/node_modules/grunt/node_modules/hooker/lib/hooker.js +++ /dev/null @@ -1,174 +0,0 @@ -/* - * JavaScript Hooker - * http://github.com/cowboy/javascript-hooker - * - * Copyright (c) 2012 "Cowboy" Ben Alman - * Licensed under the MIT license. - * http://benalman.com/about/license/ - */ - -(function(exports) { - // Get an array from an array-like object with slice.call(arrayLikeObject). - var slice = [].slice; - // Get an "[object [[Class]]]" string with toString.call(value). - var toString = {}.toString; - - // I can't think of a better way to ensure a value is a specific type other - // than to create instances and use the `instanceof` operator. - function HookerOverride(v) { this.value = v; } - function HookerPreempt(v) { this.value = v; } - function HookerFilter(c, a) { this.context = c; this.args = a; } - - // When a pre- or post-hook returns the result of this function, the value - // passed will be used in place of the original function's return value. Any - // post-hook override value will take precedence over a pre-hook override - // value. - exports.override = function(value) { - return new HookerOverride(value); - }; - - // When a pre-hook returns the result of this function, the value passed will - // be used in place of the original function's return value, and the original - // function will NOT be executed. - exports.preempt = function(value) { - return new HookerPreempt(value); - }; - - // When a pre-hook returns the result of this function, the context and - // arguments passed will be applied into the original function. - exports.filter = function(context, args) { - return new HookerFilter(context, args); - }; - - // Execute callback(s) for properties of the specified object. - function forMethods(obj, props, callback) { - var prop; - if (typeof props === "string") { - // A single prop string was passed. Create an array. - props = [props]; - } else if (props == null) { - // No props were passed, so iterate over all properties, building an - // array. Unfortunately, Object.keys(obj) doesn't work everywhere yet, so - // this has to be done manually. - props = []; - for (prop in obj) { - if (obj.hasOwnProperty(prop)) { - props.push(prop); - } - } - } - // Execute callback for every method in the props array. - var i = props.length; - while (i--) { - // If the property isn't a function... - if (toString.call(obj[props[i]]) !== "[object Function]" || - // ...or the callback returns false... - callback(obj, props[i]) === false) { - // ...remove it from the props array to be returned. - props.splice(i, 1); - } - } - // Return an array of method names for which the callback didn't fail. - return props; - } - - // Monkey-patch (hook) a method of an object. - exports.hook = function(obj, props, options) { - // If the props argument was omitted, shuffle the arguments. - if (options == null) { - options = props; - props = null; - } - // If just a function is passed instead of an options hash, use that as a - // pre-hook function. - if (typeof options === "function") { - options = {pre: options}; - } - - // Hook the specified method of the object. - return forMethods(obj, props, function(obj, prop) { - // The original (current) method. - var orig = obj[prop]; - // The new hooked function. - function hooked() { - var result, origResult, tmp; - - // Get an array of arguments. - var args = slice.call(arguments); - - // If passName option is specified, prepend prop to the args array, - // passing it as the first argument to any specified hook functions. - if (options.passName) { - args.unshift(prop); - } - - // If a pre-hook function was specified, invoke it in the current - // context with the passed-in arguments, and store its result. - if (options.pre) { - result = options.pre.apply(this, args); - } - - if (result instanceof HookerFilter) { - // If the pre-hook returned hooker.filter(context, args), invoke the - // original function with that context and arguments, and store its - // result. - origResult = result = orig.apply(result.context, result.args); - } else if (result instanceof HookerPreempt) { - // If the pre-hook returned hooker.preempt(value) just use the passed - // value and don't execute the original function. - origResult = result = result.value; - } else { - // Invoke the original function in the current context with the - // passed-in arguments, and store its result. - origResult = orig.apply(this, arguments); - // If the pre-hook returned hooker.override(value), use the passed - // value, otherwise use the original function's result. - result = result instanceof HookerOverride ? result.value : origResult; - } - - if (options.post) { - // If a post-hook function was specified, invoke it in the current - // context, passing in the result of the original function as the - // first argument, followed by any passed-in arguments. - tmp = options.post.apply(this, [origResult].concat(args)); - if (tmp instanceof HookerOverride) { - // If the post-hook returned hooker.override(value), use the passed - // value, otherwise use the previously computed result. - result = tmp.value; - } - } - - // Unhook if the "once" option was specified. - if (options.once) { - exports.unhook(obj, prop); - } - - // Return the result! - return result; - } - // Re-define the method. - obj[prop] = hooked; - // Fail if the function couldn't be hooked. - if (obj[prop] !== hooked) { return false; } - // Store a reference to the original method as a property on the new one. - obj[prop]._orig = orig; - }); - }; - - // Get a reference to the original method from a hooked function. - exports.orig = function(obj, prop) { - return obj[prop]._orig; - }; - - // Un-monkey-patch (unhook) a method of an object. - exports.unhook = function(obj, props) { - return forMethods(obj, props, function(obj, prop) { - // Get a reference to the original method, if it exists. - var orig = exports.orig(obj, prop); - // If there's no original method, it can't be unhooked, so fail. - if (!orig) { return false; } - // Unhook the method. - obj[prop] = orig; - }); - }; -}(typeof exports === "object" && exports || this)); diff --git a/node_modules/grunt/node_modules/hooker/package.json b/node_modules/grunt/node_modules/hooker/package.json deleted file mode 100644 index 97e7761..0000000 --- a/node_modules/grunt/node_modules/hooker/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "hooker", - "description": "Monkey-patch (hook) functions for debugging and stuff.", - "version": "0.2.3", - "homepage": "http://github.com/cowboy/javascript-hooker", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/javascript-hooker.git" - }, - "bugs": { - "url": "https://github.com/cowboy/javascript-hooker/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cowboy/javascript-hooker/blob/master/LICENSE-MIT" - } - ], - "dependencies": {}, - "devDependencies": { - "grunt": "~0.2.1" - }, - "keywords": [ - "patch", - "hook", - "function", - "debug", - "aop" - ], - "engines": { - "node": "*" - }, - "main": "lib/hooker", - "scripts": { - "test": "grunt test" - }, - "readme": "# JavaScript Hooker\n\nMonkey-patch (hook) functions for debugging and stuff.\n\n## Getting Started\n\nThis code should work just fine in Node.js:\n\nFirst, install the module with: `npm install hooker`\n\n```javascript\nvar hooker = require('hooker');\nhooker.hook(Math, \"max\", function() {\n console.log(arguments.length + \" arguments passed\");\n});\nMath.max(5, 6, 7) // logs: \"3 arguments passed\", returns 7\n```\n\nOr in the browser:\n\n```html\n\n\n```\n\nIn the browser, you can attach Hooker's methods to any object.\n\n```html\n\n\n\n```\n\n## Documentation\n\n### hooker.hook\nMonkey-patch (hook) one or more methods of an object.\n#### Signature:\n`hooker.hook(object, [ props, ] [options | prehookFunction])`\n#### `props`\nThe optional `props` argument can be a method name, array of method names or null. If null (or omitted), all enumerable methods of `object` will be hooked.\n#### `options`\n* `pre` - (Function) a pre-hook function to be executed before the original function. Arguments passed into the method will be passed into the pre-hook function as well.\n* `post` - (Function) a post-hook function to be executed after the original function. The original function's result is passed into the post-hook function as its first argument, followed by the method arguments.\n* `once` - (Boolean) if true, auto-unhook the function after the first execution.\n* `passName` - (Boolean) if true, pass the name of the method into the pre-hook function as its first arg (preceding all other arguments), and into the post-hook function as the second arg (after result but preceding all other arguments).\n\n#### Returns:\nAn array of hooked method names.\n\n### hooker.unhook\nUn-monkey-patch (unhook) one or more methods of an object.\n#### Signature:\n`hooker.unhook(object [, props ])`\n#### `props`\nThe optional `props` argument can be a method name, array of method names or null. If null (or omitted), all methods of `object` will be unhooked.\n#### Returns:\nAn array of unhooked method names.\n\n### hooker.orig\nGet a reference to the original method from a hooked function.\n#### Signature:\n`hooker.orig(object, props)`\n\n### hooker.override\nWhen a pre- or post-hook returns the result of this function, the value\npassed will be used in place of the original function's return value. Any\npost-hook override value will take precedence over a pre-hook override value.\n#### Signature:\n`hooker.override(value)`\n\n### hooker.preempt\nWhen a pre-hook returns the result of this function, the value passed will\nbe used in place of the original function's return value, and the original\nfunction will NOT be executed.\n#### Signature:\n`hooker.preempt(value)`\n\n### hooker.filter\nWhen a pre-hook returns the result of this function, the context and\narguments passed will be applied into the original function.\n#### Signature:\n`hooker.filter(context, arguments)`\n\n\n## Examples\nSee the unit tests for more examples.\n\n```javascript\nvar hooker = require('hooker');\n// Simple logging.\nhooker.hook(Math, \"max\", function() {\n console.log(arguments.length + \" arguments passed\");\n});\nMath.max(5, 6, 7) // logs: \"3 arguments passed\", returns 7\n\nhooker.unhook(Math, \"max\"); // (This is assumed between all further examples)\nMath.max(5, 6, 7) // 7\n\n// Returning hooker.override(value) overrides the original value.\nhooker.hook(Math, \"max\", function() {\n if (arguments.length === 0) {\n return hooker.override(9000);\n }\n});\nMath.max(5, 6, 7) // 7\nMath.max() // 9000\n\n// Auto-unhook after one execution.\nhooker.hook(Math, \"max\", {\n once: true,\n pre: function() {\n console.log(\"Init something here\");\n }\n});\nMath.max(5, 6, 7) // logs: \"Init something here\", returns 7\nMath.max(5, 6, 7) // 7\n\n// Filter `this` and arguments through a pre-hook function.\nhooker.hook(Math, \"max\", {\n pre: function() {\n var args = [].map.call(arguments, function(num) {\n return num * 2;\n });\n return hooker.filter(this, args); // thisValue, arguments\n }\n});\nMath.max(5, 6, 7) // 14\n\n// Modify the original function's result with a post-hook function.\nhooker.hook(Math, \"max\", {\n post: function(result) {\n return hooker.override(result * 100);\n }\n});\nMath.max(5, 6, 7) // 700\n\n// Hook every Math method. Note: if Math's methods were enumerable, the second\n// argument could be omitted. Since they aren't, an array of properties to hook\n// must be explicitly passed. Non-method properties will be skipped.\n// See a more generic example here: http://bit.ly/vvJlrS\nhooker.hook(Math, Object.getOwnPropertyNames(Math), {\n passName: true,\n pre: function(name) {\n console.log(\"=> Math.\" + name, [].slice.call(arguments, 1));\n },\n post: function(result, name) {\n console.log(\"<= Math.\" + name, result);\n }\n});\n\nvar result = Math.max(5, 6, 7);\n// => Math.max [ 5, 6, 7 ]\n// <= Math.max 7\nresult // 7\n\nresult = Math.ceil(3.456);\n// => Math.ceil [ 3.456 ]\n// <= Math.ceil 4\nresult // 4\n```\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](https://github.com/cowboy/grunt).\n\n_Also, please don't edit files in the \"dist\" subdirectory as they are generated via grunt. You'll find source code in the \"lib\" subdirectory!_\n\n## Release History\n2012/01/09 - v0.2.3 - First official release.\n\n## License\nCopyright (c) 2012 \"Cowboy\" Ben Alman \nLicensed under the MIT license. \n\n", - "readmeFilename": "README.md", - "_id": "hooker@0.2.3", - "_from": "hooker@~0.2.3" -} diff --git a/node_modules/grunt/node_modules/hooker/parent.js b/node_modules/grunt/node_modules/hooker/parent.js deleted file mode 100644 index c4a055e..0000000 --- a/node_modules/grunt/node_modules/hooker/parent.js +++ /dev/null @@ -1,17 +0,0 @@ -var spawn = require('child_process').spawn; - -function loop() { - console.log('starting'); - console.log(this); - //var child = spawn('./node_modules/nodeunit/bin/nodeunit', ['test']); - var child = spawn('node', ['child.js']); - child.stdout.on('data', function(buffer) { - process.stdout.write(buffer); - }); - child.on('exit', this.async()); -} - -var context = { - async: function() { return loop.bind(context); } -}; -loop.call(context); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/hooker/test/hooker_test.js b/node_modules/grunt/node_modules/hooker/test/hooker_test.js deleted file mode 100644 index dc5910a..0000000 --- a/node_modules/grunt/node_modules/hooker/test/hooker_test.js +++ /dev/null @@ -1,435 +0,0 @@ -/*global require:true */ -var hooker = require('../lib/hooker'); - -exports['hook'] = { - setUp: function(done) { - this.order = []; - this.track = function() { - [].push.apply(this.order, arguments); - }; - - this.prop = 1; - this.add = function(a, b) { - this.track("add", this.prop, a, b); - return this.prop + a + b; - }; - - this.obj = { - that: this, - prop: 1, - add1: function(a, b) { - this.that.track("add1", this.prop, a, b); - return this.prop + a + b; - }, - add2: function(a, b) { - this.that.track("add2", this.prop, a, b); - return this.prop + a + b; - }, - add3: function(a, b) { - this.that.track("add3", this.prop, a, b); - return this.prop + a + b; - } - }; - - done(); - }, - 'orig': function(test) { - test.expect(1); - var orig = this.add; - hooker.hook(this, "add", function() {}); - test.strictEqual(hooker.orig(this, "add"), orig, "should return a refernce to the original function."); - test.done(); - }, - 'once': function(test) { - test.expect(5); - var orig = this.add; - hooker.hook(this, "add", { - once: true, - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - } - }); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3], "functions should execute in-order."); - test.strictEqual(this.add, orig, "should automatically unhook when once is specified."); - this.order = []; - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["add", 1, 2, 3], "only the original function should execute."); - test.done(); - }, - 'pre-hook (simple syntax)': function(test) { - test.expect(3); - // Pre-hook. - var result = hooker.hook(this, "add", function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - }); - test.deepEqual(result, ["add"], "add should have been hooked."); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'pre-hook': function(test) { - test.expect(3); - // Pre-hook. - var result = hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - } - }); - test.deepEqual(result, ["add"], "add should have been hooked."); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'post-hook': function(test) { - test.expect(3); - // Post-hook. - var result = hooker.hook(this, "add", { - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - } - }); - test.deepEqual(result, ["add"], "add should have been hooked."); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["add", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - } - }); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - - 'pre-hook, return value override': function(test) { - test.expect(2); - // Pre-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // This return value will override the original function's return value. - return hooker.override("b" + this.prop + a + b); - } - }); - test.strictEqual(this.add(2, 3), "b123", "should return the overridden result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'post-hook, return value override': function(test) { - test.expect(2); - // Post-hook. - hooker.hook(this, "add", { - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - // This return value will override the original function's return value. - return hooker.override("a" + this.prop + a + b + result); - } - }); - test.strictEqual(this.add(2, 3), "a1236", "should return the post-hook overridden result."); - test.deepEqual(this.order, ["add", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, return value override': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // This return value will override the original function's return value. - return hooker.override("b" + this.prop + a + b); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - // This return value will override the original function's return value - // AND the pre-hook's return value. - return hooker.override("a" + this.prop + a + b + result); - } - }); - test.strictEqual(this.add(2, 3), "a1236", "should return the overridden result, and post-hook result should take precedence over pre-hook result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - - 'pre-hook, filtering arguments': function(test) { - test.expect(2); - // Pre-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Return hooker.filter(context, arguments) and they will be passed into - // the original function. The "track" and "order" propterites are just - // set here for the same of this unit test. - return hooker.filter({prop: "x", track: this.track, order: this.order}, ["y", "z"]); - } - }); - test.strictEqual(this.add(2, 3), "xyz", "should return the original function's result, given filtered context and arguments."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", "x", "y", "z"], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, filtering arguments': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Return hooker.filter(context, arguments) and they will be passed into - // the original function. The "track" and "order" propterites are just - // set here for the same of this unit test. - return hooker.filter({prop: "x", track: this.track, order: this.order}, ["y", "z"]); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - } - }); - test.strictEqual(this.add(2, 3), "xyz", "should return the original function's result, given filtered context and arguments."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", "x", "y", "z", "after", 1, 2, 3, "xyz"], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, filtering arguments, return value override': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Return hooker.filter(context, arguments) and they will be passed into - // the original function. The "track" and "order" propterites are just - // set here for the same of this unit test. - return hooker.filter({prop: "x", track: this.track, order: this.order}, ["y", "z"]); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - // This return value will override the original function's return value - // AND the pre-hook's return value. - return hooker.override("a" + this.prop + a + b + result); - } - }); - test.strictEqual(this.add(2, 3), "a123xyz", "should return the post-hook overridden result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", "x", "y", "z", "after", 1, 2, 3, "xyz"], "functions should execute in-order."); - test.done(); - }, - - 'pre-hook, preempt original function': function(test) { - test.expect(2); - // Pre-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Returning hooker.preempt will prevent the original function from being - // invoked and optionally set a return value. - return hooker.preempt(); - } - }); - test.strictEqual(this.add(2, 3), undefined, "should return the value passed to preempt."); - test.deepEqual(this.order, ["before", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'pre-hook, preempt original function with value': function(test) { - test.expect(2); - // Pre-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Returning hooker.preempt will prevent the original function from being - // invoked and optionally set a return value. - return hooker.preempt(9000); - } - }); - test.strictEqual(this.add(2, 3), 9000, "should return the value passed to preempt."); - test.deepEqual(this.order, ["before", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, preempt original function with value': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Returning hooker.preempt will prevent the original function from being - // invoked and optionally set a return value. - return hooker.preempt(9000); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - } - }); - test.strictEqual(this.add(2, 3), 9000, "should return the value passed to preempt."); - test.deepEqual(this.order, ["before", 1, 2, 3, "after", 1, 2, 3, 9000], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, preempt original function with value, return value override': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Returning hooker.preempt will prevent the original function from being - // invoked and optionally set a return value. - return hooker.preempt(9000); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - // This return value will override any preempt value set in pre-hook. - return hooker.override("a" + this.prop + a + b + result); - } - }); - test.strictEqual(this.add(2, 3), "a1239000", "should return the overridden result, and post-hook result should take precedence over preempt value."); - test.deepEqual(this.order, ["before", 1, 2, 3, "after", 1, 2, 3, 9000], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, some properties': function(test) { - test.expect(7); - // Pre- & post-hook. - var result = hooker.hook(this.obj, ["add1", "add2"], { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.that.track("before", this.prop, a, b); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.that.track("after", this.prop, a, b, result); - } - }); - test.deepEqual(result.sort(), ["add1", "add2"], "both functions should have been hooked."); - test.strictEqual(this.obj.add1(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add1", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add2(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add2", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add3(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["add3", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, all properties': function(test) { - test.expect(7); - // Pre- & post-hook. - var result = hooker.hook(this.obj, { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.that.track("before", this.prop, a, b); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.that.track("after", this.prop, a, b, result); - } - }); - test.deepEqual(result.sort(), ["add1", "add2", "add3"], "all functions should have been hooked."); - test.strictEqual(this.obj.add1(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add1", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add2(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add2", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add3(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add3", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, all properties, passName': function(test) { - test.expect(6); - // Pre- & post-hook. - hooker.hook(this.obj, { - passName: true, - pre: function(name, a, b) { - // Arguments are passed into pre-hook as specified. - this.that.track("before", this.prop, name, a, b); - }, - post: function(result, name, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.that.track("after", this.prop, name, a, b, result); - } - }); - test.strictEqual(this.obj.add1(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, "add1", 2, 3, "add1", 1, 2, 3, "after", 1, "add1", 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add2(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, "add2", 2, 3, "add2", 1, 2, 3, "after", 1, "add2", 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add3(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, "add3", 2, 3, "add3", 1, 2, 3, "after", 1, "add3", 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - 'unhook one property': function(test) { - test.expect(5); - var orig = this.add; - hooker.hook(this, "add", function() {}); - var result = hooker.unhook(this, "add"); - test.deepEqual(result, ["add"], "one function should have been unhooked."); - test.strictEqual(this.add, orig, "should have unhooked, restoring the original function"); - result = hooker.unhook(this, "add"); - test.deepEqual(result, [], "nothing should have been unhooked."); - test.strictEqual(this.add, orig, "shouldn't explode if already unhooked"); - test.strictEqual(this.add.orig, undefined, "original function shouldn't have an orig property"); - test.done(); - }, - 'unhook some properties': function(test) { - test.expect(6); - var add1 = this.obj.add1; - var add2 = this.obj.add2; - hooker.hook(this.obj, ["add1", "add2"], function() {}); - test.strictEqual(hooker.orig(this.obj, "add1"), add1, "should return a refernce to the original function"); - test.strictEqual(hooker.orig(this.obj, "add2"), add2, "should return a refernce to the original function"); - test.strictEqual(hooker.orig(this.obj, "add3"), undefined, "should not have been hooked, so should not have an original function"); - var result = hooker.unhook(this.obj, ["add1", "add2"]); - test.deepEqual(result.sort(), ["add1", "add2"], "both functions should have been unhooked."); - test.strictEqual(this.obj.add1, add1, "should have unhooked, restoring the original function"); - test.strictEqual(this.obj.add2, add2, "should have unhooked, restoring the original function"); - test.done(); - }, - 'unhook all properties': function(test) { - test.expect(7); - var add1 = this.obj.add1; - var add2 = this.obj.add2; - var add3 = this.obj.add3; - hooker.hook(this.obj, function() {}); - test.strictEqual(hooker.orig(this.obj, "add1"), add1, "should return a refernce to the original function"); - test.strictEqual(hooker.orig(this.obj, "add2"), add2, "should return a refernce to the original function"); - test.strictEqual(hooker.orig(this.obj, "add3"), add3, "should return a refernce to the original function"); - var result = hooker.unhook(this.obj); - test.deepEqual(result.sort(), ["add1", "add2", "add3"], "all functions should have been unhooked."); - test.strictEqual(this.obj.add1, add1, "should have unhooked, restoring the original function"); - test.strictEqual(this.obj.add2, add2, "should have unhooked, restoring the original function"); - test.strictEqual(this.obj.add3, add3, "should have unhooked, restoring the original function"); - test.done(); - } -}; diff --git a/node_modules/grunt/node_modules/iconv-lite/.npmignore b/node_modules/grunt/node_modules/iconv-lite/.npmignore deleted file mode 100644 index fe46877..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*~ -*sublime-* diff --git a/node_modules/grunt/node_modules/iconv-lite/.travis.yml b/node_modules/grunt/node_modules/iconv-lite/.travis.yml deleted file mode 100644 index 0bab9cd..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ - language: node_js - node_js: - - 0.4 - - 0.6 - - 0.8 diff --git a/node_modules/grunt/node_modules/iconv-lite/LICENSE b/node_modules/grunt/node_modules/iconv-lite/LICENSE deleted file mode 100644 index d518d83..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/README.md b/node_modules/grunt/node_modules/iconv-lite/README.md deleted file mode 100644 index ba30a32..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/README.md +++ /dev/null @@ -1,72 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/README.md~ b/node_modules/grunt/node_modules/iconv-lite/README.md~ deleted file mode 100644 index 5f57561..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/README.md~ +++ /dev/null @@ -1,54 +0,0 @@ -iconv-lite - native javascript conversion between character encodings. -====================================================================== - -## Usage - - var iconv = require('iconv-lite'); - - // Convert from an encoded buffer to string. - str = iconv.fromEncoding(buf, 'win-1251'); - // Or - str = iconv.decode(buf, 'win-1251'); - - // Convert from string to an encoded buffer. - buf = iconv.toEncoding("Sample input string", 'win-1251'); - // Or - buf = iconv.encode("Sample input string", 'win-1251'); - -## Supported encodings - -Currently only a small part of encodings supported: - -* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'. -* 'latin1' -* Cyrillic encodings: 'windows-1251', 'koi8-r', 'iso 8859-5'. - -Other encodings are easy to add, see the source. Please, participate. - - -## Encoding/decoding speed - -Comparison with iconv module (1000 times 256kb, on Core i5/2.5 GHz). - - Operation\module iconv iconv-lite (this) - toEncoding('win1251') 19.57 mb/s 49.04 mb/s - fromEncoding('win1251') 16.39 mb/s 24.11 mb/s - - -## Notes - -This module is JavaScript-only, thus can be used in a sandboxed environment like [Cloud9](http://c9.io). - -Untranslatable characters are set to '?'. No transliteration is currently supported, pull requests are welcome. - -## Testing - - npm install --dev iconv-lite - vows - -## 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/node_modules/grunt/node_modules/iconv-lite/encodings/big5.js b/node_modules/grunt/node_modules/iconv-lite/encodings/big5.js deleted file mode 100644 index 0423d63..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/big5.js +++ /dev/null @@ -1,9 +0,0 @@ -var big5Table = require('./table/big5.js'); -module.exports = { - 'windows950': 'big5', - 'cp950': 'big5', - 'big5': { - type: 'table', - table: big5Table - } -} diff --git a/node_modules/grunt/node_modules/iconv-lite/encodings/gbk.js b/node_modules/grunt/node_modules/iconv-lite/encodings/gbk.js deleted file mode 100644 index 78a63ec..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/gbk.js +++ /dev/null @@ -1,9 +0,0 @@ -var gbkTable = require('./table/gbk.js'); -module.exports = { - 'windows936': 'gbk', - 'gb2312': 'gbk', - 'gbk': { - type: 'table', - table: gbkTable - } -} diff --git a/node_modules/grunt/node_modules/iconv-lite/encodings/singlebyte.js b/node_modules/grunt/node_modules/iconv-lite/encodings/singlebyte.js deleted file mode 100644 index f41a7ea..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/singlebyte.js +++ /dev/null @@ -1,340 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/encodings/table/big5.js b/node_modules/grunt/node_modules/iconv-lite/encodings/table/big5.js deleted file mode 100644 index 605c72d..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/table/big5.js +++ /dev/null @@ -1 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js b/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js deleted file mode 100644 index c464623..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js +++ /dev/null @@ -1 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/generation/generate-big5-table.js b/node_modules/grunt/node_modules/iconv-lite/generation/generate-big5-table.js deleted file mode 100644 index 909e433..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/generation/generate-big5-table.js +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/generation/generate-singlebyte.js b/node_modules/grunt/node_modules/iconv-lite/generation/generate-singlebyte.js deleted file mode 100644 index 2cbebec..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/generation/generate-singlebyte.js +++ /dev/null @@ -1,142 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/index.js b/node_modules/grunt/node_modules/iconv-lite/index.js deleted file mode 100644 index a55691b..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/index.js +++ /dev/null @@ -1,231 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/package.json b/node_modules/grunt/node_modules/iconv-lite/package.json deleted file mode 100644 index 33287d8..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "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", - "_from": "iconv-lite@~0.2.5" -} diff --git a/node_modules/grunt/node_modules/iconv-lite/test/big5-test.js b/node_modules/grunt/node_modules/iconv-lite/test/big5-test.js deleted file mode 100644 index f3fe1a8..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/big5-test.js +++ /dev/null @@ -1,36 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt b/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt deleted file mode 100644 index 9c13042..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt +++ /dev/null @@ -1,13 +0,0 @@ - - - meta ҪϥΡG - - - - -oO@c餤I
                        -(This page uses big5 character set.)
                        -charset=big5 - - - \ No newline at end of file diff --git a/node_modules/grunt/node_modules/iconv-lite/test/cyrillic-test.js b/node_modules/grunt/node_modules/iconv-lite/test/cyrillic-test.js deleted file mode 100644 index 259d283..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/cyrillic-test.js +++ /dev/null @@ -1,86 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/test/gbk-test.js b/node_modules/grunt/node_modules/iconv-lite/test/gbk-test.js deleted file mode 100644 index 7b2e47b..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/gbk-test.js +++ /dev/null @@ -1,38 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt b/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt deleted file mode 100644 index 345b5d0..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt +++ /dev/null @@ -1,14 +0,0 @@ -ٶһ£֪ - - -
                         | ¼
                        - - - - - - - - \ No newline at end of file diff --git a/node_modules/grunt/node_modules/iconv-lite/test/greek-test.js b/node_modules/grunt/node_modules/iconv-lite/test/greek-test.js deleted file mode 100644 index 0394ee6..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/greek-test.js +++ /dev/null @@ -1,79 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/test/main-test.js b/node_modules/grunt/node_modules/iconv-lite/test/main-test.js deleted file mode 100644 index 50177f2..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/main-test.js +++ /dev/null @@ -1,55 +0,0 @@ -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/node_modules/grunt/node_modules/iconv-lite/test/performance.js b/node_modules/grunt/node_modules/iconv-lite/test/performance.js deleted file mode 100644 index 835deac..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/performance.js +++ /dev/null @@ -1,67 +0,0 @@ - -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/node_modules/grunt/node_modules/iconv-lite/test/turkish-test.js b/node_modules/grunt/node_modules/iconv-lite/test/turkish-test.js deleted file mode 100644 index b2eb68e..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/turkish-test.js +++ /dev/null @@ -1,90 +0,0 @@ -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/node_modules/grunt/node_modules/js-yaml/HISTORY.md b/node_modules/grunt/node_modules/js-yaml/HISTORY.md deleted file mode 100644 index dfc48c2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/HISTORY.md +++ /dev/null @@ -1,155 +0,0 @@ -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/node_modules/grunt/node_modules/js-yaml/LICENSE b/node_modules/grunt/node_modules/js-yaml/LICENSE deleted file mode 100644 index 0f16ee9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(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/node_modules/grunt/node_modules/js-yaml/README.md b/node_modules/grunt/node_modules/js-yaml/README.md deleted file mode 100644 index e326d60..0000000 --- a/node_modules/grunt/node_modules/js-yaml/README.md +++ /dev/null @@ -1,249 +0,0 @@ -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. - - -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. - - -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 `load()` 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); -} -``` - - -### load (string [ , options ]) - -Parses `string` as single YAML document. Returns a JavaScript object or throws -`YAMLException` on error. - -NOTE: This function **does not** understands multi-document sources, it throws -exception on those. - -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_SCHEMA`)_ - specifies a schema to use. - - -### loadAll (string, iterator [ , options ]) - -Same as `load()`, but understands multi-document sources and apply `iterator` to -each document. - -``` javascript -var yaml = require('js-yaml'); - -yaml.loadAll(data, function (doc) { - console.log(doc); -}); -``` - - -### safeLoad (string [ , options ]) - -Same as `load()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -### safeLoadAll (string, iterator [ , options ]) - -Same as `loadAll()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -### dump (object [ , options ]) - -Serializes `object` as YAML document. - -options: - -- `indent` _(default: 2)_ - indentation width to use (in spaces). -- `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_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`. - - -### safeDump (object [ , options ]) - -Same as `dump()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -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 -``` - -## License - -View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file -(MIT). diff --git a/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js b/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js deleted file mode 100755 index 5110a4c..0000000 --- a/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js +++ /dev/null @@ -1,125 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/examples/custom_types.js b/node_modules/grunt/node_modules/js-yaml/examples/custom_types.js deleted file mode 100644 index 1cb987c..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/custom_types.js +++ /dev/null @@ -1,104 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml b/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml deleted file mode 100644 index 033134f..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml +++ /dev/null @@ -1,18 +0,0 @@ -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/node_modules/grunt/node_modules/js-yaml/examples/dumper.js b/node_modules/grunt/node_modules/js-yaml/examples/dumper.js deleted file mode 100644 index 7952b18..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/dumper.js +++ /dev/null @@ -1,31 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/examples/dumper.json b/node_modules/grunt/node_modules/js-yaml/examples/dumper.json deleted file mode 100644 index 9f54c05..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/dumper.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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/node_modules/grunt/node_modules/js-yaml/examples/sample_document.js b/node_modules/grunt/node_modules/js-yaml/examples/sample_document.js deleted file mode 100644 index 1ce370d..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/sample_document.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - - -var inspect = require('util').inspect; - -// just require jsyaml -require('../lib/js-yaml'); - - -try { - var doc = require(__dirname + '/sample_document.yaml'); - console.log(inspect(doc, false, 10, true)); -} catch (e) { - console.log(e.stack || e.toString()); -} diff --git a/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml b/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml deleted file mode 100644 index 4479ee9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml +++ /dev/null @@ -1,197 +0,0 @@ ---- -# 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/node_modules/grunt/node_modules/js-yaml/index.js b/node_modules/grunt/node_modules/js-yaml/index.js deleted file mode 100644 index 40606dd..0000000 --- a/node_modules/grunt/node_modules/js-yaml/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/js-yaml.js'); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml.js deleted file mode 100644 index a5146a3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml.js +++ /dev/null @@ -1,33 +0,0 @@ -'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.Type = require('./js-yaml/type'); -module.exports.Schema = require('./js-yaml/schema'); -module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/minimal'); -module.exports.SAFE_SCHEMA = require('./js-yaml/schema/safe'); -module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default'); -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'); -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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/common.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/common.js deleted file mode 100644 index cc7f824..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/common.js +++ /dev/null @@ -1,60 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/dumper.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/dumper.js deleted file mode 100644 index 2385f56..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/dumper.js +++ /dev/null @@ -1,437 +0,0 @@ -'use strict'; - - -var common = require('./common'); -var NIL = common.NIL; -var YAMLException = require('./exception'); -var DEFAULT_SCHEMA = require('./schema/default'); -var SAFE_SCHEMA = require('./schema/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'; - - -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_SCHEMA, - indent = Math.max(1, (options['indent'] || 2)), - 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; - - 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) { - if (0 !== index) { - _result += ', '; - } - - writeNode(level, object[index], false, false); - _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) { - if (!compact || 0 !== index) { - _result += generateNextLine(level); - } - - writeNode(level + 1, object[index], true, true); - _result += '- ' + result; - } - - tag = _tag; - result = _result; - } - - function writeFlowMapping(level, object) { - var _result = '', - _tag = tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - if (0 !== index) { - _result += ', '; - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - writeNode(level, objectKey, false, false); - - if (result.length > 1024) { - _result += '? '; - } - - _result += result + ': '; - writeNode(level, objectValue, false, false); - _result += result; - } - - tag = _tag; - result = '{' + _result + '}'; - } - - function writeBlockMapping(level, object, compact) { - var _result = '', - _tag = tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - if (!compact || 0 !== index) { - _result += generateNextLine(level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - writeNode(level + 1, objectKey, true, true); - explicitPair = (null !== tag && '?' !== tag && result.length <= 1024); - - if (explicitPair) { - _result += '? '; - } - - _result += result; - - if (explicitPair) { - _result += generateNextLine(level); - } - - writeNode(level + 1, objectValue, true, explicitPair); - _result += ': ' + result; - } - - tag = _tag; - result = _result; - } - - 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; - } - - 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 { - throw new YAMLException('unacceptabe kind of an object to dump (' + kind + ')'); - } - - if (null !== tag && '?' !== tag) { - result = '!<' + tag + '> ' + result; - } - } - - writeNode(0, input, true, true); - return result + '\n'; -} - - -function safeDump(input, options) { - return dump(input, common.extend({ schema: SAFE_SCHEMA }, options)); -} - - -module.exports.dump = dump; -module.exports.safeDump = safeDump; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/exception.js deleted file mode 100644 index 479ba88..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/exception.js +++ /dev/null @@ -1,25 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/loader.js deleted file mode 100644 index bdc71d1..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/loader.js +++ /dev/null @@ -1,1549 +0,0 @@ -'use strict'; - - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var NIL = common.NIL; -var SAFE_SCHEMA = require('./schema/safe'); -var DEFAULT_SCHEMA = require('./schema/default'); - - -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_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; - - 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 = -1; - - 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. Perform the chomping. - if (lineIndent < textIndent) { - if (CHOMPING_KEEP === chomping) { - result += common.repeat('\n', emptyLines + 1); - } else if (CHOMPING_CLIP === chomping) { - result += '\n'; - } - break; - } - - detectedIndent = true; - - if (folding) { - if (CHAR_SPACE === character || CHAR_TAB === character) { - result += common.repeat('\n', emptyLines + 1); - emptyLines = 1; - } else if (0 === emptyLines) { - result += ' '; - emptyLines = 0; - } else { - result += common.repeat('\n', emptyLines); - emptyLines = 0; - } - } else { - result += common.repeat('\n', emptyLines + 1); - 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. - - 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; - - } else if (composeNode(nodeIndent, CONTEXT_FLOW_OUT, false, true)) { - if (line === _line) { - // TODO: Remove this cycle when the flow readers will consume - // trailing whitespaces like the block readers. - 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; - } - - 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; - } - - // TODO: It is needed only for flow node readers. It should be removed - // when the flow readers will consume trailing whitespaces as well as - // the block readers. - skipSeparationSpace(true, -1); - } - - if (lineIndent > nodeIndent && position < length) { - throwError('bad indentation of a mapping entry'); - } else if (lineIndent < nodeIndent) { - break; - } - } - - if (atExplicitKey) { - storeMappingPair(_result, keyTag, keyNode, null); - } - - 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: SAFE_SCHEMA }, options)); -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/mark.js deleted file mode 100644 index bfe279b..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/mark.js +++ /dev/null @@ -1,78 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/require.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/require.js deleted file mode 100644 index 47b77e3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/require.js +++ /dev/null @@ -1,23 +0,0 @@ -'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.load(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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema.js deleted file mode 100644 index ce21391..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema.js +++ /dev/null @@ -1,103 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/default.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/default.js deleted file mode 100644 index 71bb3fc..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/default.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/minimal.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/minimal.js deleted file mode 100644 index 7a6ebbe..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/minimal.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/safe.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/safe.js deleted file mode 100644 index 856b7c4..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/safe.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./minimal') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float'), - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type.js deleted file mode 100644 index e0124f2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type.js +++ /dev/null @@ -1,82 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/binary.js deleted file mode 100644 index 37b4bc7..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ /dev/null @@ -1,118 +0,0 @@ -// 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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/bool.js deleted file mode 100644 index 987a9e6..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ /dev/null @@ -1,74 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/float.js deleted file mode 100644 index edb5fcb..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/float.js +++ /dev/null @@ -1,102 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/int.js deleted file mode 100644 index f5e1e7e..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/int.js +++ /dev/null @@ -1,85 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js deleted file mode 100644 index 4b3b3ca..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ /dev/null @@ -1,56 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js deleted file mode 100644 index 9f4f89e..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ /dev/null @@ -1,56 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js deleted file mode 100644 index 8d2835e..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +++ /dev/null @@ -1,28 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/map.js deleted file mode 100644 index 5cda6de..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/map.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:map', { - loader: { - kind: 'object' - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/merge.js deleted file mode 100644 index 8facc70..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ /dev/null @@ -1,18 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js deleted file mode 100644 index 796e1af..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js +++ /dev/null @@ -1,36 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/omap.js deleted file mode 100644 index f7c248d..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ /dev/null @@ -1,53 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/pairs.js deleted file mode 100644 index 828ff1b..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ /dev/null @@ -1,41 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/seq.js deleted file mode 100644 index 80a7cf0..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:seq', { - loader: { - kind: 'array' - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/set.js deleted file mode 100644 index 64bdc66..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/set.js +++ /dev/null @@ -1,31 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/str.js deleted file mode 100644 index 384f14e..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/str.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:str', { - loader: { - kind: 'string' - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/timestamp.js deleted file mode 100644 index 24da9e2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ /dev/null @@ -1,91 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esparse b/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esparse deleted file mode 120000 index 7423b18..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esvalidate b/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esvalidate deleted file mode 120000 index 16069ef..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md deleted file mode 100644 index 102f82b..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md +++ /dev/null @@ -1,109 +0,0 @@ -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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE deleted file mode 100644 index 1afdae5..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md deleted file mode 100644 index f20e0c1..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md +++ /dev/null @@ -1,239 +0,0 @@ -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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/arguments.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/arguments.js deleted file mode 100755 index 5b090fa..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +++ /dev/null @@ -1,36 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/choice.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/choice.js deleted file mode 100755 index 2616fa4..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/choice.js +++ /dev/null @@ -1,22 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/constants.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/constants.js deleted file mode 100755 index 172a4f3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/constants.js +++ /dev/null @@ -1,59 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/help.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/help.js deleted file mode 100755 index 7eb9555..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/help.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/nargs.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/nargs.js deleted file mode 100755 index 74f376b..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/parents.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/parents.js deleted file mode 100755 index dfe8968..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/parents.js +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js deleted file mode 100755 index 430d5e1..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +++ /dev/null @@ -1,23 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js deleted file mode 100755 index df9c494..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +++ /dev/null @@ -1,49 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sum.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sum.js deleted file mode 100755 index 4532800..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sum.js +++ /dev/null @@ -1,35 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js deleted file mode 100644 index afb4a2d..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +++ /dev/null @@ -1,270 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/index.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/index.js deleted file mode 100644 index 3b6eea0..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/argparse'); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action.js deleted file mode 100644 index 6f7e9a5..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append.js deleted file mode 100644 index 48c6dbe..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append.js +++ /dev/null @@ -1,55 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js deleted file mode 100644 index 90747ab..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +++ /dev/null @@ -1,47 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/count.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/count.js deleted file mode 100644 index d6a5899..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/count.js +++ /dev/null @@ -1,40 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/help.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/help.js deleted file mode 100644 index 7f7b4e2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +++ /dev/null @@ -1,48 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store.js deleted file mode 100644 index 8ebc974..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store.js +++ /dev/null @@ -1,50 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js deleted file mode 100644 index 8410fcf..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +++ /dev/null @@ -1,43 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js deleted file mode 100644 index 66417bf..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js +++ /dev/null @@ -1,27 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js deleted file mode 100644 index 43ec708..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js +++ /dev/null @@ -1,26 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js deleted file mode 100644 index adecf65..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js +++ /dev/null @@ -1,148 +0,0 @@ -/** 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/version.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/version.js deleted file mode 100644 index a17877c..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/version.js +++ /dev/null @@ -1,50 +0,0 @@ -/*: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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action_container.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action_container.js deleted file mode 100644 index dbe3e3c..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action_container.js +++ /dev/null @@ -1,481 +0,0 @@ -/** 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argparse.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argparse.js deleted file mode 100644 index f2a2c51..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argparse.js +++ /dev/null @@ -1,14 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js deleted file mode 100644 index c8a02a0..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js +++ /dev/null @@ -1,50 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js deleted file mode 100644 index 8287e00..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js +++ /dev/null @@ -1,54 +0,0 @@ -/** 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js deleted file mode 100644 index 58b271f..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +++ /dev/null @@ -1,75 +0,0 @@ -/** 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js deleted file mode 100644 index 97cf098..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +++ /dev/null @@ -1,1165 +0,0 @@ -/** - * 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/const.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/const.js deleted file mode 100644 index de831ba..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/const.js +++ /dev/null @@ -1,18 +0,0 @@ -// -// 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js deleted file mode 100644 index cd2f369..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js +++ /dev/null @@ -1,88 +0,0 @@ -'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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js deleted file mode 100644 index 541d918..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +++ /dev/null @@ -1,803 +0,0 @@ -/** - * 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/namespace.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/namespace.js deleted file mode 100644 index 3546f2d..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/namespace.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml deleted file mode 100644 index ab27b29..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile deleted file mode 100644 index aed29c3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "https://rubygems.org" - -gem 'uglifier' -gem 'rake' diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index 2c52be4..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown deleted file mode 100644 index 1a39ad9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +++ /dev/null @@ -1,814 +0,0 @@ -# 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile deleted file mode 100644 index 2cd9eed..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -# 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json deleted file mode 100644 index ae91b65..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js deleted file mode 100644 index 4f6b2b9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js +++ /dev/null @@ -1 +0,0 @@ -!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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js deleted file mode 100644 index 8761117..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +++ /dev/null @@ -1,673 +0,0 @@ -// 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json deleted file mode 100644 index 4b47216..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "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" -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js deleted file mode 100644 index 44a2167..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js +++ /dev/null @@ -1,45 +0,0 @@ -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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js deleted file mode 100644 index 9ceeea7..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js +++ /dev/null @@ -1,148 +0,0 @@ -(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js deleted file mode 100644 index 77364f2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js +++ /dev/null @@ -1,685 +0,0 @@ -$(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c17..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Underscore.strings Test Suite - - - - - - - - -

                          Underscore.string Test Suite

                          -

                          -

                          -
                            - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js deleted file mode 100644 index 32252a3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js +++ /dev/null @@ -1,200 +0,0 @@ -$(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js deleted file mode 100644 index 16cf7bf..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js +++ /dev/null @@ -1,59 +0,0 @@ -$(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js deleted file mode 100644 index e089626..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js +++ /dev/null @@ -1,426 +0,0 @@ -$(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js deleted file mode 100644 index a529658..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js +++ /dev/null @@ -1,259 +0,0 @@ -$(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html deleted file mode 100644 index 064fa98..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js deleted file mode 100644 index 22949c3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js +++ /dev/null @@ -1,548 +0,0 @@ -$(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js deleted file mode 100644 index 05e3f2a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js +++ /dev/null @@ -1,75 +0,0 @@ -(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js deleted file mode 100644 index c9be20a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js +++ /dev/null @@ -1,249 +0,0 @@ -$(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json deleted file mode 100644 index 014ab26..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js deleted file mode 100644 index c1d9d3a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1 +0,0 @@ -(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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js deleted file mode 100644 index a12f0d9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// 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/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json deleted file mode 100644 index 09382f8..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/README.md b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/README.md deleted file mode 100644 index a74bd12..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/README.md +++ /dev/null @@ -1,73 +0,0 @@ -**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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 3e7bb81..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,117 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index e0af3f7..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,177 +0,0 @@ -#!/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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/esprima.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/esprima.js deleted file mode 100644 index f1320da..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/esprima.js +++ /dev/null @@ -1,3908 +0,0 @@ -/* - 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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/package.json deleted file mode 100644 index 9a2294a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/compat.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/compat.js deleted file mode 100644 index ee3a629..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/compat.js +++ /dev/null @@ -1,239 +0,0 @@ -/* - 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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/reflect.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/reflect.js deleted file mode 100644 index dba1ba8..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/reflect.js +++ /dev/null @@ -1,422 +0,0 @@ -// 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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/run.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/run.js deleted file mode 100644 index 32ca3fa..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/run.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - 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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/runner.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/runner.js deleted file mode 100644 index c1a3fc9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/runner.js +++ /dev/null @@ -1,387 +0,0 @@ -/* - 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/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/test.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/test.js deleted file mode 100644 index 8ceee54..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/test.js +++ /dev/null @@ -1,20238 +0,0 @@ -/* - 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/node_modules/grunt/node_modules/js-yaml/package.json b/node_modules/grunt/node_modules/js-yaml/package.json deleted file mode 100644 index 2244b99..0000000 --- a/node_modules/grunt/node_modules/js-yaml/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "js-yaml", - "version": "2.0.5", - "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@lavabit.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\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\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 `load()` 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### load (string [ , options ])\n\nParses `string` as single YAML document. Returns a JavaScript object or throws\n`YAMLException` on error.\n\nNOTE: This function **does not** understands multi-document sources, it throws\nexception on those.\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_SCHEMA`)_ - specifies a schema to use.\n\n\n### loadAll (string, iterator [ , options ])\n\nSame as `load()`, but understands multi-document sources and apply `iterator` to\neach document.\n\n``` javascript\nvar yaml = require('js-yaml');\n\nyaml.loadAll(data, function (doc) {\n console.log(doc);\n});\n```\n\n\n### safeLoad (string [ , options ])\n\nSame as `load()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### safeLoadAll (string, iterator [ , options ])\n\nSame as `loadAll()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### dump (object [ , options ])\n\nSerializes `object` as YAML document.\n\noptions:\n\n- `indent` _(default: 2)_ - indentation width to use (in spaces).\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_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### safeDump (object [ , options ])\n\nSame as `dump()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\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\n\n\n\n## Caveats\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## License\n\nView the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file\n(MIT).\n", - "readmeFilename": "README.md", - "_id": "js-yaml@2.0.5", - "_from": "js-yaml@~2.0.2" -} diff --git a/node_modules/grunt/node_modules/lodash/LICENSE.txt b/node_modules/grunt/node_modules/lodash/LICENSE.txt deleted file mode 100644 index b194ad1..0000000 --- a/node_modules/grunt/node_modules/lodash/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012 John-David Dalton -Based on Underscore.js 1.3.3, copyright 2009-2012 Jeremy Ashkenas, -DocumentCloud Inc. - -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/node_modules/grunt/node_modules/lodash/README.md b/node_modules/grunt/node_modules/lodash/README.md deleted file mode 100644 index cde0ebb..0000000 --- a/node_modules/grunt/node_modules/lodash/README.md +++ /dev/null @@ -1,247 +0,0 @@ -# Lo-Dash v0.9.2 -[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash) - -A drop-in replacement[*](https://github.com/bestiejs/lodash/wiki/Drop-in-Disclaimer) for Underscore.js, from the devs behind [jsPerf.com](http://jsperf.com), delivering [performance](http://lodash.com/benchmarks), [bug fixes](https://github.com/bestiejs/lodash#resolved-underscorejs-issues), and [additional features](http://lodash.com/#features). - -Lo-Dash’s performance is gained by avoiding slower native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls. - -## Download - - * [Development build](https://raw.github.com/bestiejs/lodash/v0.9.2/lodash.js) - * [Production build](https://raw.github.com/bestiejs/lodash/v0.9.2/lodash.min.js) - * [Underscore build](https://raw.github.com/bestiejs/lodash/v0.9.2/lodash.underscore.min.js) tailored for projects already using Underscore - * CDN copies of ≤ v0.9.2’s [Production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.min.js), [Underscore](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.underscore.min.js), and [Development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.js) builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/) - * For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#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). - -Create your own benchmarks at [jsPerf](http://jsperf.com), or [search](http://jsperf.com/search?q=lodash) for existing ones. - -For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap). - -## Screencasts - -For more information check out these screencasts over Lo-Dash: - - * [Introducing Lo-Dash](https://vimeo.com/44154599) - * [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) - * [Lo-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) - -## Features - - * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) - * [_.clone](http://lodash.com/docs#clone) supports *“deep”* cloning - * [_.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 - * [_.lateBind](http://lodash.com/docs#lateBind) for late binding - * [_.merge](http://lodash.com/docs#merge) for a *“deep”* [_.extend](http://lodash.com/docs#extend) - * [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding - * [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments - * [_.template](http://lodash.com/docs#template) supports [ES6 delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging - * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), - [and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings - -## Support - -Lo-Dash has been tested in at least Chrome 5~23, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.14, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. - -## Custom builds - -Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need. -To top it off, we handle all method dependency and alias mapping for you. - - * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument. -```bash -lodash backbone -``` - - * CSP builds, supporting default Content Security Policy restrictions, may be created using the `csp` modifier argument. -```bash -lodash csp -``` - - * Legacy builds, tailored for older browsers without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument. -```bash -lodash legacy -``` - - * Mobile builds, with IE < 9 bug fixes and method compilation removed, may be created using the `mobile` modifier argument. -```bash -lodash mobile -``` - - * Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument. -```bash -lodash strict -``` - - * Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument. -```bash -lodash underscore -``` - -Custom builds may be created using the following commands: - - * Use the `category` argument to pass comma separated categories of methods to include in the build.
                            - Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*. -```bash -lodash category=collections,functions -lodash category="collections, functions" -``` - - * Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.
                            - Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*. -```bash -lodash exports=amd,commonjs,node -lodash exports="amd, commonjs, node" -``` - - * Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash. -```bash -lodash iife="!function(window,undefined){%output%}(this)" -``` - - * Use the `include` argument to pass comma separated method/category names to include in the build. -```bash -lodash include=each,filter,map -lodash include="each, filter, map" -``` - - * Use the `minus` argument to pass comma separated method/category names to remove from those included in the build. -```bash -lodash underscore minus=result,shuffle -lodash underscore minus="result, shuffle" -``` - - * Use the `plus` argument to pass comma separated method/category names to add to those included in the build. -```bash -lodash backbone plus=random,template -lodash backbone plus="random, template" -``` - - * Use the `template` argument to pass the file path pattern used to match template files to precompile. -```bash -lodash template="./*.jst" -``` - - * Use the `settings` argument to pass the template settings used when precompiling templates. -```bash -lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}" -``` - - * Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates. -```bash -lodash moduleId="underscore" -``` - -All arguments, except `legacy` with `csp` or `mobile`, may be combined.
                            -Unless specified by `-o` or `--output`, all files created are saved to the current working directory. - -The following options are also supported: - - * `-c`, `--stdout`     Write output to standard output - * `-d`, `--debug`       Write only the debug output - * `-h`, `--help`         Display help information - * `-m`, `--minify`     Write only the minified output - * `-o`, `--output`     Write output to a given path/filename - * `-s`, `--silent`     Skip status updates normally logged to the console - * `-V`, `--version`   Output current version of Lo-Dash - -The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`). - -## Installation and usage - -In browsers: - -```html - -``` - -Using [npm](http://npmjs.org/): - -```bash -npm install lodash - -npm install -g lodash -npm link lodash -``` - -In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): - -```js -var _ = require('lodash'); -``` - -**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); -}); -``` - -## Resolved Underscore.js issues - - * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L545-551)] - * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L558-582)] - * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L140-146)] - * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L747-752)] - * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L828-840)] - * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L921-923)] - * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L1337-1340)] - -## Release Notes - -### v0.9.2 - - * Added `fromIndex` argument to `_.contains` - * Added `moduleId` build option - * Added Closure Compiler *“simple”* optimizations to the build process - * Added support for strings in `_.max` and `_.min` - * Added support for ES6 template delimiters to `_.template` - * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs - * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq` - -The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog). - -## BestieJS - -Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Author - -* [John-David Dalton](http://allyoucanleet.com/) - [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") - -## Contributors - -* [Kit Cambridge](http://kitcambridge.github.com/) - [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") -* [Mathias Bynens](http://mathiasbynens.be/) - [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") diff --git a/node_modules/grunt/node_modules/lodash/build.js b/node_modules/grunt/node_modules/lodash/build.js deleted file mode 100755 index af116d5..0000000 --- a/node_modules/grunt/node_modules/lodash/build.js +++ /dev/null @@ -1,1736 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** Load modules */ - var fs = require('fs'), - path = require('path'), - vm = require('vm'), - minify = require(path.join(__dirname, 'build', 'minify.js')), - _ = require(path.join(__dirname, 'lodash.js')); - - /** The current working directory */ - var cwd = process.cwd(); - - /** Used for array method references */ - var arrayRef = []; - - /** Shortcut used to push arrays of values to an array */ - var push = arrayRef.push; - - /** Shortcut used to convert array-like objects to arrays */ - var slice = arrayRef.slice; - - /** Shortcut to the `stdout` object */ - var stdout = process.stdout; - - /** Used to associate aliases with their real names */ - var aliasToRealMap = { - 'all': 'every', - 'any': 'some', - 'collect': 'map', - 'detect': 'find', - 'drop': 'rest', - 'each': 'forEach', - 'foldl': 'reduce', - 'foldr': 'reduceRight', - 'head': 'first', - 'include': 'contains', - 'inject': 'reduce', - 'methods': 'functions', - 'select': 'filter', - 'tail': 'rest', - 'take': 'first', - 'unique': 'uniq' - }; - - /** Used to associate real names with their aliases */ - var realToAliasMap = { - 'contains': ['include'], - 'every': ['all'], - 'filter': ['select'], - 'find': ['detect'], - 'first': ['head', 'take'], - 'forEach': ['each'], - 'functions': ['methods'], - 'map': ['collect'], - 'reduce': ['foldl', 'inject'], - 'reduceRight': ['foldr'], - 'rest': ['drop', 'tail'], - 'some': ['any'], - 'uniq': ['unique'] - }; - - /** Used to track function dependencies */ - var dependencyMap = { - 'after': [], - 'bind': ['isFunction', 'isObject'], - 'bindAll': ['bind', 'functions'], - 'chain': ['mixin'], - 'clone': ['extend', 'forEach', 'forOwn', 'isArguments', 'isObject', 'isPlainObject'], - 'compact': [], - 'compose': [], - 'contains': ['indexOf', 'isString', 'some'], - 'countBy': ['forEach'], - 'debounce': [], - 'defaults': ['isArguments'], - 'defer': [], - 'delay': [], - 'difference': ['indexOf'], - 'escape': [], - 'every': ['forEach', 'isArray'], - 'extend': ['isArguments'], - 'filter': ['forEach'], - 'find': ['forEach'], - 'first': [], - 'flatten': ['isArray'], - 'forEach': ['identity', 'isString'], - 'forIn': ['identity', 'isArguments'], - 'forOwn': ['identity', 'isArguments'], - 'functions': ['forIn', 'isFunction'], - 'groupBy': ['forEach'], - 'has': [], - 'identity': [], - 'indexOf': ['sortedIndex'], - 'initial': [], - 'intersection': ['filter', 'indexOf'], - 'invert': ['forOwn'], - 'invoke': ['forEach'], - 'isArguments': [], - 'isArray': [], - 'isBoolean': [], - 'isDate': [], - 'isElement': [], - 'isEmpty': ['forOwn', 'isArguments', 'isFunction'], - 'isEqual': ['isArguments', 'isFunction'], - 'isFinite': [], - 'isFunction': [], - 'isNaN': [], - 'isNull': [], - 'isNumber': [], - 'isObject': [], - 'isPlainObject': ['forIn', 'isArguments', 'isFunction'], - 'isRegExp': [], - 'isString': [], - 'isUndefined': [], - 'keys': ['forOwn', 'isArguments', 'isObject'], - 'last': [], - 'lastIndexOf': [], - 'lateBind': ['isFunction', 'isObject'], - 'map': ['forEach', 'isArray'], - 'max': ['forEach', 'isArray', 'isString'], - 'memoize': [], - 'merge': ['forOwn', 'isArray', 'isPlainObject'], - 'min': ['forEach', 'isArray', 'isString'], - 'mixin': ['forEach', 'functions'], - 'noConflict': [], - 'object': [], - 'omit': ['forIn', 'indexOf'], - 'once': [], - 'pairs': ['forOwn'], - 'partial': ['isFunction', 'isObject'], - 'pick': ['forIn'], - 'pluck': ['forEach'], - 'random': [], - 'range': [], - 'reduce': ['forEach'], - 'reduceRight': ['forEach', 'isString', 'keys'], - 'reject': ['filter'], - 'rest': [], - 'result': ['isFunction'], - 'shuffle': ['forEach'], - 'size': ['keys'], - 'some': ['forEach', 'isArray'], - 'sortBy': ['forEach'], - 'sortedIndex': ['identity'], - 'tap': ['mixin'], - 'template': ['escape'], - 'throttle': [], - 'times': [], - 'toArray': ['values'], - 'unescape': [], - 'union': ['uniq'], - 'uniq': ['identity', 'indexOf'], - 'uniqueId': [], - 'value': ['mixin'], - 'values': ['forOwn'], - 'where': ['filter', 'forIn'], - 'without': ['indexOf'], - 'wrap': [], - 'zip': ['max', 'pluck'] - }; - - /** Used to inline `iteratorTemplate` */ - var iteratorOptions = [ - 'args', - 'arrayLoop', - 'bottom', - 'firstArg', - 'hasDontEnumBug', - 'isKeysFast', - 'objectLoop', - 'noArgsEnum', - 'noCharByIndex', - 'shadowed', - 'top', - 'useHas', - 'useStrict' - ]; - - /** List of all Lo-Dash methods */ - var allMethods = _.keys(dependencyMap); - - /** List Backbone's Lo-Dash dependencies */ - var backboneDependencies = [ - 'bind', - 'bindAll', - 'clone', - 'contains', - 'escape', - 'every', - 'extend', - 'filter', - 'find', - 'first', - 'forEach', - 'groupBy', - 'has', - 'indexOf', - 'initial', - 'invoke', - 'isArray', - 'isEmpty', - 'isEqual', - 'isFunction', - 'isObject', - 'isRegExp', - 'keys', - 'last', - 'lastIndexOf', - 'lateBind', - 'map', - 'max', - 'min', - 'mixin', - 'reduce', - 'reduceRight', - 'reject', - 'rest', - 'result', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'sortedIndex', - 'toArray', - 'uniqueId', - 'without' - ]; - - /** List of methods used by Underscore */ - var underscoreMethods = _.without.apply(_, [allMethods].concat([ - 'forIn', - 'forOwn', - 'isPlainObject', - 'lateBind', - 'merge', - 'partial' - ])); - - /** List of ways to export the `lodash` function */ - var exportsAll = [ - 'amd', - 'commonjs', - 'global', - 'node' - ]; - - /*--------------------------------------------------------------------------*/ - - /** - * Compiles template files matched by the given file path `pattern` into a - * single source, extending `_.templates` with precompiled templates named after - * each template file's basename. - * - * @private - * @param {String} [pattern='/*.jst'] The file path pattern. - * @param {Object} options The options object. - * @returns {String} Returns the compiled source. - */ - function buildTemplate(pattern, options) { - pattern || (pattern = path.join(cwd, '*.jst')); - - var directory = path.dirname(pattern); - - var source = [ - ';(function(window) {', - " var freeExports = typeof exports == 'object' && exports &&", - " (typeof global == 'object' && global && global == global.global && (window = global), exports);", - '', - ' var templates = {},', - ' _ = window._;', - '' - ]; - - // convert to a regexp - pattern = RegExp( - path.basename(pattern) - .replace(/[.+?^=!:${}()|[\]\/\\]/g, '\\$&') - .replace(/\*/g, '.*?') + '$' - ); - - fs.readdirSync(directory).forEach(function(filename) { - var filePath = path.join(directory, filename); - if (pattern.test(filename)) { - var text = fs.readFileSync(filePath, 'utf8'), - precompiled = getFunctionSource(_.template(text, null, options)), - prop = filename.replace(/\..*$/, ''); - - source.push(" templates['" + prop.replace(/'/g, "\\'") + "'] = " + precompiled + ';', ''); - } - }); - - source.push( - " if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {", - " define(['" + options.moduleId + "'], function(lodash) {", - ' lodash.templates = lodash.extend(lodash.templates || {}, templates);', - ' });', - " } else if (freeExports) {", - " if (typeof module == 'object' && module && module.exports == freeExports) {", - ' (module.exports = templates).templates = templates;', - ' } else {', - ' freeExports.templates = templates;', - ' }', - ' } else if (_) {', - ' _.templates = _.extend(_.templates || {}, templates);', - ' }', - '}(this));' - ); - - return source.join('\n'); - } - - /** - * Removes unnecessary comments, whitespace, and pseudo private properties. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function cleanupSource(source) { - return source - // remove pseudo private properties - .replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n') - // remove lines with just whitespace and semicolons - .replace(/^ *;\n/gm, '') - // consolidate consecutive horizontal rule comment separators - .replace(/(?:\s*\/\*-+\*\/\s*){2,}/g, function(separators) { - return separators.match(/^\s*/)[0] + separators.slice(separators.lastIndexOf('/*')); - }); - } - - /** - * Writes the help message to standard output. - * - * @private - */ - function displayHelp() { - console.log([ - '', - ' Commands:', - '', - ' lodash backbone Build with only methods required by Backbone', - ' lodash csp Build supporting default Content Security Policy restrictions', - ' lodash legacy Build tailored for older browsers without ES5 support', - ' lodash mobile Build with IE < 9 bug fixes & method compilation removed', - ' lodash strict Build with `_.bindAll`, `_.defaults`, & `_.extend` in strict mode', - ' lodash underscore Build tailored for projects already using Underscore', - ' lodash include=... Comma separated method/category names to include in the build', - ' lodash minus=... Comma separated method/category names to remove from those included in the build', - ' lodash plus=... Comma separated method/category names to add to those included in the build', - ' lodash category=... Comma separated categories of methods to include in the build (case-insensitive)', - ' (i.e. “arrays”, “chaining”, “collections”, “functions”, “objects”, and “utilities”)', - ' lodash exports=... Comma separated names of ways to export the `lodash` function', - ' (i.e. “amd”, “commonjs”, “global”, “node”, and “none”)', - ' lodash iife=... Code to replace the immediately-invoked function expression that wraps Lo-Dash', - ' (e.g. `lodash iife="!function(window,undefined){%output%}(this)"`)', - '', - ' lodash template=... File path pattern used to match template files to precompile', - ' (e.g. `lodash template=./*.jst`)', - ' lodash settings=... Template settings used when precompiling templates', - ' (e.g. `lodash settings="{interpolate:/\\\\{\\\\{([\\\\s\\\\S]+?)\\\\}\\\\}/g}"`)', - ' lodash moduleId=... The AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates', - '', - ' All arguments, except `legacy` with `csp` or `mobile`, may be combined.', - ' Unless specified by `-o` or `--output`, all files created are saved to the current working directory.', - '', - ' Options:', - '', - ' -c, --stdout Write output to standard output', - ' -d, --debug Write only the debug output', - ' -h, --help Display help information', - ' -m, --minify Write only the minified output', - ' -o, --output Write output to a given path/filename', - ' -s, --silent Skip status updates normally logged to the console', - ' -V, --version Output current version of Lo-Dash', - '' - ].join('\n')); - } - - /** - * Gets the aliases associated with a given function name. - * - * @private - * @param {String} methodName The name of the method to get aliases for. - * @returns {Array} Returns an array of aliases. - */ - function getAliases(methodName) { - return realToAliasMap[methodName] || []; - } - - /** - * Gets the Lo-Dash method assignments snippet from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the method assignments snippet. - */ - function getMethodAssignments(source) { - return (source.match(/lodash\.VERSION *= *[\s\S]+?\/\*-+\*\/\n/) || [''])[0]; - } - - /** - * Gets an array of depenants for a method by a given name. - * - * @private - * @param {String} methodName The name of the method to query. - * @returns {Array} Returns an array of method dependants. - */ - function getDependants(methodName) { - // iterate over the `dependencyMap`, adding the names of methods that - // have `methodName` as a dependency - return _.reduce(dependencyMap, function(result, dependencies, otherName) { - if (_.contains(dependencies, methodName)) { - result.push(otherName); - } - return result; - }, []); - } - - /** - * Gets an array of dependencies for a given method name. If passed an array - * of dependencies it will return an array containing the given dependencies - * plus any additional detected sub-dependencies. - * - * @private - * @param {Array|String} methodName A single method name or array of - * dependencies to query. - * @returns {Array} Returns an array of method dependencies. - */ - function getDependencies(methodName) { - var dependencies = Array.isArray(methodName) ? methodName : dependencyMap[methodName]; - if (!dependencies) { - return []; - } - // recursively accumulate the dependencies of the `methodName` function, and - // the dependencies of its dependencies, and so on. - return _.uniq(dependencies.reduce(function(result, otherName) { - result.push.apply(result, getDependencies(otherName).concat(otherName)); - return result; - }, [])); - } - - /** - * Gets the formatted source of the given function. - * - * @private - * @param {Function} func The function to process. - * @returns {String} Returns the formatted source. - */ - function getFunctionSource(func) { - var source = func.source || (func + ''); - - // format leading whitespace - return source.replace(/\n(?:.*)/g, function(match, index) { - match = match.slice(1); - return ( - match == '}' && source.indexOf('}', index + 2) == -1 ? '\n ' : '\n ' - ) + match; - }); - } - - /** - * Gets the `_.isArguments` fallback from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the `isArguments` fallback. - */ - function getIsArgumentsFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(noArgsClass\)[\s\S]+?};\n\1}/) || [''])[0]; - } - - /** - * Gets the `_.isFunction` fallback from `source`. - * - * @private - * @param {String} source The source to inspect. - * @returns {String} Returns the `isFunction` fallback. - */ - function getIsFunctionFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(isFunction\(\/x\/[\s\S]+?};\n\1}/) || [''])[0]; - } - - /** - * Gets the names of methods in `source` belonging to the given `category`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} category The category to filter by. - * @returns {Array} Returns a new array of method names belonging to the given category. - */ - function getMethodsByCategory(source, category) { - return allMethods.filter(function(methodName) { - return category && RegExp('@category ' + category + '\\b').test(matchFunction(source, methodName)); - }); - } - - /** - * Gets the real name, not alias, of a given method name. - * - * @private - * @param {String} methodName The name of the method to resolve. - * @returns {String} Returns the real method name. - */ - function getRealName(methodName) { - return aliasToRealMap[methodName] || methodName; - } - - /** - * Determines if all functions of the given names have been removed from `source`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} [funcName1, funcName2, ...] The names of functions to check. - * @returns {Boolean} Returns `true` if all functions have been removed, else `false`. - */ - function isRemoved(source) { - return slice.call(arguments, 1).every(function(funcName) { - return !matchFunction(source, funcName); - }); - } - - /** - * Searches `source` for a `funcName` function declaration, expression, or - * assignment and returns the matched snippet. - * - * @private - * @param {String} source The source to inspect. - * @param {String} funcName The name of the function to match. - * @returns {String} Returns the matched function snippet. - */ - function matchFunction(source, funcName) { - var result = source.match(RegExp( - // match multi-line comment block (could be on a single line) - '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/\\n)?' + - // begin non-capturing group - '(?:' + - // match a function declaration - '( *)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' + - // match a variable declaration with `createIterator` - ' +var ' + funcName + ' *=.*?createIterator\\((?:{|[a-zA-Z])[\\s\\S]+?\\);|' + - // match a variable declaration with function expression - '( *)var ' + funcName + ' *=.*?function[\\s\\S]+?\\n\\2};' + - // end non-capturing group - ')\\n' - )); - - return result ? result[0] : ''; - } - - /** - * Converts a comma separated options string into an array. - * - * @private - * @param {String} value The option to convert. - * @returns {Array} Returns the new converted array. - */ - function optionToArray(value) { - return value.match(/\w+=(.*)$/)[1].split(/, */); - } - - /** - * Converts a comma separated options string into an array containing - * only real method names. - * - * @private - * @param {String} source The source to inspect. - * @param {String} value The option to convert. - * @returns {Array} Returns the new converted array. - */ - function optionToMethodsArray(source, value) { - var methodNames = optionToArray(value); - - // convert categories to method names - methodNames.forEach(function(category) { - push.apply(methodNames, getMethodsByCategory(source, category)); - }); - - // convert aliases to real method names - methodNames = methodNames.map(getRealName); - - // remove nonexistent and duplicate method names - return _.uniq(_.intersection(allMethods, methodNames)); - } - - /** - * Removes the all references to `refName` from `createIterator` in `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} refName The name of the reference to remove. - * @returns {String} Returns the modified source. - */ - function removeFromCreateIterator(source, refName) { - var snippet = matchFunction(source, 'createIterator'); - if (snippet) { - // clip the snippet at the `factory` assignment - snippet = snippet.match(/Function\([\s\S]+$/)[0]; - var modified = snippet.replace(RegExp('\\b' + refName + '\\b,? *', 'g'), ''); - source = source.replace(snippet, modified); - } - return source; - } - - /** - * Removes the `funcName` function declaration, expression, or assignment and - * associated code from `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} funcName The name of the function to remove. - * @returns {String} Returns the source with the function removed. - */ - function removeFunction(source, funcName) { - var modified, - snippet = matchFunction(source, funcName); - - // exit early if function is not found - if (!snippet) { - return source; - } - // remove function - source = source.replace(snippet, ''); - - // grab the method assignments snippet - snippet = getMethodAssignments(source); - - // remove assignment and aliases - modified = getAliases(funcName).concat(funcName).reduce(function(result, otherName) { - return result.replace(RegExp('(?:\\n *//.*\\s*)* *lodash\\.' + otherName + ' *= *.+\\n'), ''); - }, snippet); - - // replace with the modified snippet - source = source.replace(snippet, modified); - - return removeFromCreateIterator(source, funcName); - } - - /** - * Removes the `_.isArguments` fallback from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the source with the `isArguments` fallback removed. - */ - function removeIsArgumentsFallback(source) { - return source.replace(getIsArgumentsFallback(source), ''); - } - - /** - * Removes the `_.isFunction` fallback from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the source with the `isFunction` fallback removed. - */ - function removeIsFunctionFallback(source) { - return source.replace(getIsFunctionFallback(source), ''); - } - - /** - * Removes the `Object.keys` object iteration optimization from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeKeysOptimization(source) { - return removeVar(source, 'isKeysFast') - // remove optimized branch in `iteratorTemplate` - .replace(/(?: *\/\/.*\n)* *'( *)<% *if *\(isKeysFast[\s\S]+?'\1<% *} *else *\{ *%>.+\n([\s\S]+?) *'\1<% *} *%>.+/, "'\\n' +\n$2") - // remove data object property assignment in `createIterator` - .replace(/ *'isKeysFast':.+\n/, ''); - } - - /** - * Removes all `noArgsClass` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNoArgsClass(source) { - return removeVar(source, 'noArgsClass') - // remove `noArgsClass` from `_.clone` and `_.isEqual` - .replace(/ *\|\| *\(noArgsClass *&&[^)]+?\)\)/g, '') - // remove `noArgsClass` from `_.isEqual` - .replace(/if *\(noArgsClass[^}]+?}\n/, '\n'); - } - - /** - * Removes all `noNodeClass` references from `source`. - * - * @private - * @param {String} source The source to process. - * @returns {String} Returns the modified source. - */ - function removeNoNodeClass(source) { - return source - // remove `noNodeClass` assignment - .replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *try *\{(?:\s*\/\/.*)*\n *var noNodeClass[\s\S]+?catch[^}]+}\n/, '') - // remove `noNodeClass` from `isPlainObject` - .replace(/\(!noNodeClass *\|\|[\s\S]+?\)\) *&&/, '') - // remove `noNodeClass` from `_.isEqual` - .replace(/ *\|\| *\(noNodeClass *&&[\s\S]+?\)\)\)/, ''); - } - - /** - * Removes a given variable from `source`. - * - * @private - * @param {String} source The source to process. - * @param {String} varName The name of the variable to remove. - * @returns {String} Returns the source with the variable removed. - */ - function removeVar(source, varName) { - // simplify `cloneableClasses` - if (varName == 'cloneableClasses') { - source = source.replace(/(var cloneableClasses *=)[\s\S]+?(true;\n)/, '$1$2'); - } - // simplify `hasObjectSpliceBug` - if (varName == 'hasObjectSpliceBug') { - source = source.replace(/(var hasObjectSpliceBug *=)[^;]+/, '$1false'); - } - source = source.replace(RegExp( - // match multi-line comment block - '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' + - // match a variable declaration that's not part of a declaration list - '( *)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' + - // match a variable in a declaration list - '\\n +' + varName + ' *=.+?,' - ), ''); - - // remove a varaible at the start of a variable declaration list - source = source.replace(RegExp('(var +)' + varName + ' *=.+?,\\s+'), '$1'); - - // remove a variable at the end of a variable declaration list - source = source.replace(RegExp(',\\s*' + varName + ' *=.+?;'), ';'); - - // remove variable reference from `cloneableClasses` assignments - source = source.replace(RegExp('cloneableClasses\\[' + varName + '\\] *= *(?:false|true)?', 'g'), ''); - - return removeFromCreateIterator(source, varName); - } - - /** - * Searches `source` for a `varName` variable declaration and replaces its - * assigned value with `varValue`. - * - * @private - * @param {String} source The source to inspect. - * @param {String} varName The name of the variable to replace. - * @returns {String} Returns the source with the variable replaced. - */ - function replaceVar(source, varName, varValue) { - // replace a variable that's not part of a declaration list - var result = source.replace(RegExp( - '(( *)var ' + varName + ' *= *)' + - '(?:.+?;|(?:Function\\(.+?|.*?[^,])\\n[\\s\\S]+?\\n\\2.+?;)\\n' - ), '$1' + varValue + ';\n'); - - if (source == result) { - // replace a varaible at the start or middle of a declaration list - result = source.replace(RegExp('((?:var|\\n) +' + varName + ' *=).+?,'), '$1 ' + varValue + ','); - } - if (source == result) { - // replace a variable at the end of a variable declaration list - result = source.replace(RegExp('(,\\s*' + varName + ' *=).+?;'), '$1 ' + varValue + ';'); - } - return result; - } - - /** - * Hard-codes the `useStrict` template option value for `iteratorTemplate`. - * - * @private - * @param {String} source The source to process. - * @param {Boolean} value The value to set. - * @returns {String} Returns the modified source. - */ - function setUseStrictOption(source, value) { - // inject "use strict" - if (value) { - source = source.replace(/^[\s\S]*?function[^{]+{/, "$&\n 'use strict';"); - } - // replace `useStrict` branch in `value` with hard-coded option - return source.replace(/(?: *\/\/.*\n)*(\s*)' *<%.+?useStrict.+/, value ? "$1'\\'use strict\\';\\n' +" : ''); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a debug and/or minified build, executing the `callback` for each. - * The `callback` is invoked with two arguments; (filePath, outputSource). - * - * Note: For a list of commands see `displayHelp()` or run `lodash --help`. - * - * @param {Array} [options=[]] An array of commands. - * @param {Function} callback The function called per build. - */ - function build(options, callback) { - options || (options = []); - - // the debug version of `source` - var debugSource; - - // used to report invalid command-line arguments - var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) { - if (/^(?:-o|--output)$/.test(options[index - 1]) || - /^(?:category|exclude|exports|iife|include|moduleId|minus|plus|settings|template)=.*$/i.test(value)) { - return true; - } - return [ - 'backbone', - 'csp', - 'legacy', - 'mobile', - 'strict', - 'underscore', - '-c', '--stdout', - '-d', '--debug', - '-h', '--help', - '-m', '--minify', - '-o', '--output', - '-s', '--silent', - '-V', '--version' - ].indexOf(value) > -1; - }); - - // report invalid arguments - if (invalidArgs.length) { - console.log( - '\n' + - 'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') + - ' passed: ' + invalidArgs.join(', ') - ); - displayHelp(); - return; - } - - // display help message - if (_.find(options, function(arg) { - return /^(?:-h|--help)$/.test(arg); - })) { - displayHelp(); - return; - } - - // display `lodash.VERSION` - if (_.find(options, function(arg) { - return /^(?:-V|--version)$/.test(arg); - })) { - console.log(_.VERSION); - return; - } - - /*------------------------------------------------------------------------*/ - - // backup `dependencyMap` to restore later - var dependencyBackup = _.clone(dependencyMap, true); - - // used to specify a custom IIFE to wrap Lo-Dash - var iife = options.reduce(function(result, value) { - var match = value.match(/iife=(.*)/); - return match ? match[1] : result; - }, null); - - // flag used to specify a Backbone build - var isBackbone = options.indexOf('backbone') > -1; - - // flag used to specify a Content Security Policy build - var isCSP = options.indexOf('csp') > -1 || options.indexOf('CSP') > -1; - - // flag used to specify only creating the debug build - var isDebug = options.indexOf('-d') > -1 || options.indexOf('--debug') > -1; - - // flag used to specify a legacy build - var isLegacy = options.indexOf('legacy') > -1; - - // flag used to specify an Underscore build - var isUnderscore = options.indexOf('underscore') > -1; - - // flag used to specify only creating the minified build - var isMinify = !isDebug && options.indexOf('-m') > -1 || options.indexOf('--minify')> -1; - - // flag used to specify a mobile build - var isMobile = !isLegacy && (isCSP || isUnderscore || options.indexOf('mobile') > -1); - - // flag used to specify writing output to standard output - var isStdOut = options.indexOf('-c') > -1 || options.indexOf('--stdout') > -1; - - // flag used to specify skipping status updates normally logged to the console - var isSilent = isStdOut || options.indexOf('-s') > -1 || options.indexOf('--silent') > -1; - - // flag used to specify `_.bindAll`, `_.extend`, and `_.defaults` are - // constructed using the "use strict" directive - var isStrict = options.indexOf('strict') > -1; - - // used to specify the ways to export the `lodash` function - var exportsOptions = options.reduce(function(result, value) { - return /exports/.test(value) ? optionToArray(value).sort() : result; - }, isUnderscore - ? ['commonjs', 'global', 'node'] - : exportsAll.slice() - ); - - // used to specify the AMD module ID of Lo-Dash used by precompiled templates - var moduleId = options.reduce(function(result, value) { - var match = value.match(/moduleId=(.*)/); - return match ? match[1] : result; - }, 'lodash'); - - // used to specify the output path for builds - var outputPath = options.reduce(function(result, value, index) { - if (/-o|--output/.test(value)) { - result = options[index + 1]; - result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result)); - } - return result; - }, ''); - - // used to match external template files to precompile - var templatePattern = options.reduce(function(result, value) { - var match = value.match(/template=(.+)$/); - return match - ? path.join(fs.realpathSync(path.dirname(match[1])), path.basename(match[1])) - : result; - }, ''); - - // used when precompiling template files - var templateSettings = options.reduce(function(result, value) { - var match = value.match(/settings=(.+)$/); - return match - ? Function('return {' + match[1].replace(/^{|}$/g, '') + '}')() - : result; - }, _.extend(_.clone(_.templateSettings), { - 'moduleId': moduleId - })); - - // flag used to specify a template build - var isTemplate = !!templatePattern; - - // the lodash.js source - var source = fs.readFileSync(path.join(__dirname, 'lodash.js'), 'utf8'); - - // flag used to specify replacing Lo-Dash's `_.clone` with Underscore's - var useUnderscoreClone = isUnderscore; - - // flags used to specify exposing Lo-Dash methods in an Underscore build - var exposeForIn = !isUnderscore, - exposeForOwn = !isUnderscore, - exposeIsPlainObject = !isUnderscore; - - /*------------------------------------------------------------------------*/ - - // names of methods to include in the build - var buildMethods = !isTemplate && (function() { - var result; - - var minusMethods = options.reduce(function(accumulator, value) { - return /exclude|minus/.test(value) - ? _.union(accumulator, optionToMethodsArray(source, value)) - : accumulator; - }, []); - - var plusMethods = options.reduce(function(accumulator, value) { - return /plus/.test(value) - ? _.union(accumulator, optionToMethodsArray(source, value)) - : accumulator; - }, []); - - // update dependencies - if (isMobile) { - dependencyMap.reduceRight = ['forEach', 'keys']; - } - if (isUnderscore) { - dependencyMap.contains = ['indexOf', 'some'], - dependencyMap.isEqual = ['isArray', 'isFunction']; - dependencyMap.isEmpty = ['isArray', 'isString']; - dependencyMap.max = ['forEach', 'isArray']; - dependencyMap.min = ['forEach', 'isArray']; - dependencyMap.pick = []; - dependencyMap.template = ['defaults', 'escape']; - - if (useUnderscoreClone) { - dependencyMap.clone = ['extend', 'isArray']; - } - } - // add method names explicitly - options.some(function(value) { - return /include/.test(value) && - (result = getDependencies(optionToMethodsArray(source, value))); - }); - - // include Lo-Dash's methods if explicitly requested - if (result) { - exposeForIn = result.indexOf('forIn') > -1; - exposeForOwn = result.indexOf('forOwn') > -1; - exposeIsPlainObject = result.indexOf('isPlainObject') > -1; - useUnderscoreClone = result.indexOf('clone') < 0; - } - // add method names required by Backbone and Underscore builds - if (isBackbone && !result) { - result = getDependencies(backboneDependencies); - } - if (isUnderscore && !result) { - result = getDependencies(underscoreMethods); - } - - // add method names by category - options.some(function(value) { - if (!/category/.test(value)) { - return false; - } - // resolve method names belonging to each category (case-insensitive) - var methodNames = optionToArray(value).reduce(function(accumulator, category) { - var capitalized = category[0].toUpperCase() + category.toLowerCase().slice(1); - return accumulator.concat(getMethodsByCategory(source, capitalized)); - }, []); - - return (result = _.union(result || [], getDependencies(methodNames))); - }); - - if (!result) { - result = allMethods.slice(); - } - if (plusMethods.length) { - result = _.union(result, getDependencies(plusMethods)); - } - if (minusMethods.length) { - result = _.without.apply(_, [result].concat(minusMethods, getDependants(result))); - } - return result; - }()); - - /*------------------------------------------------------------------------*/ - - // load customized Lo-Dash module - var lodash = !isTemplate && (function() { - var context = vm.createContext({ - 'clearTimeout': clearTimeout, - 'console': console, - 'setTimeout': setTimeout - }); - - source = setUseStrictOption(source, isStrict); - - if (isLegacy) { - _.each(['getPrototypeOf', 'isBindFast', 'isKeysFast', 'nativeBind', 'nativeIsArray', 'nativeKeys'], function(varName) { - source = replaceVar(source, varName, 'false'); - }); - - source = replaceVar(source, 'noArgsClass', 'true'); - source = removeKeysOptimization(source); - } - else if (isUnderscore) { - // remove unneeded variables - source = removeVar(source, 'cloneableClasses'); - - // remove large array optimizations - source = removeFunction(source, 'cachedContains'); - source = removeVar(source, 'largeArraySize'); - - // replace `_.clone` - if (useUnderscoreClone) { - source = source.replace(/^( *)function clone[\s\S]+?\n\1}/m, [ - ' function clone(value) {', - ' return value && objectTypes[typeof value]', - ' ? (isArray(value) ? slice.call(value) : extend({}, value))', - ' : value', - ' }' - ].join('\n')); - } - - // replace `_.contains` - source = source.replace(/^( *)function contains[\s\S]+?\n\1}/m, [ - ' function contains(collection, target) {', - ' var length = collection ? collection.length : 0;', - " return typeof length == 'number'", - ' ? indexOf(collection, target) > -1', - ' : some(collection, function(value) { return value === target; });', - ' }' - ].join('\n')); - - // replace `_.difference` - source = source.replace(/^( *)function difference[\s\S]+?\n\1}/m, [ - ' function difference(array) {', - ' var index = -1,', - ' length = array.length,', - ' flattened = concat.apply(arrayRef, arguments),', - ' result = [];', - '', - ' while (++index < length) {', - ' var value = array[index]', - ' if (indexOf(flattened, value, length) < 0) {', - ' result.push(value);', - ' }', - ' }', - ' return result', - ' }' - ].join('\n')); - - // replace `_.intersection` - source = source.replace(/^( *)function intersection[\s\S]+?\n\1}/m, [ - ' function intersection(array) {', - ' var args = arguments,', - ' argsLength = args.length,', - ' result = [];', - '', - ' forEach(array, function(value) {', - ' if (indexOf(result, value) < 0) {', - ' var length = argsLength;', - ' while (--length) {', - ' if (indexOf(args[length], value) < 0) {', - ' return;', - ' }', - ' }', - ' result.push(value);', - ' }', - ' });', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.isEmpty` - source = source.replace(/^( *)function isEmpty[\s\S]+?\n\1}/m, [ - ' function isEmpty(value) {', - ' if (!value) {', - ' return true;', - ' }', - ' if (isArray(value) || isString(value)) {', - ' return !value.length;', - ' }', - ' for (var key in value) {', - ' if (hasOwnProperty.call(value, key)) {', - ' return false;', - ' }', - ' }', - ' return true;', - ' }' - ].join('\n')); - - // replace `_.isFinite` - source = source.replace(/^( *)function isFinite[\s\S]+?\n\1}/m, [ - ' function isFinite(value) {', - ' return nativeIsFinite(value) && toString.call(value) == numberClass;', - ' }' - ].join('\n')); - - // replace `_.omit` - source = source.replace(/^( *)function omit[\s\S]+?\n\1}/m, [ - ' function omit(object) {', - ' var props = concat.apply(arrayRef, arguments),', - ' result = {};', - '', - ' forIn(object, function(value, key) {', - ' if (indexOf(props, key, 1) < 0) {', - ' result[key] = value;', - ' }', - ' });', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.pick` - source = source.replace(/^( *)function pick[\s\S]+?\n\1}/m, [ - ' function pick(object) {', - ' var index = 0,', - ' props = concat.apply(arrayRef, arguments),', - ' length = props.length,', - ' result = {};', - '', - ' while (++index < length) {', - ' var prop = props[index];', - ' if (prop in object) {', - ' result[prop] = object[prop];', - ' }', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.uniq` - source = source.replace(/^( *)function uniq[\s\S]+?\n\1}/m, [ - ' function uniq(array, isSorted, callback, thisArg) {', - ' var index = -1,', - ' length = array ? array.length : 0,', - ' result = [],', - ' seen = result;', - '', - ' if (callback) {', - ' seen = [];', - ' callback = createCallback(callback, thisArg);', - ' }', - ' 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) {', - ' seen.push(computed);', - ' }', - ' result.push(value);', - ' }', - ' }', - ' return result;', - ' }' - ].join('\n')); - - // replace `_.without` - source = source.replace(/^( *)function without[\s\S]+?\n\1}/m, [ - ' function without(array) {', - ' var index = -1,', - ' length = array.length,', - ' result = [];', - '', - ' while (++index < length) {', - ' var value = array[index]', - ' if (indexOf(arguments, value, 1) < 0) {', - ' result.push(value);', - ' }', - ' }', - ' return result', - ' }' - ].join('\n')); - - // remove `arguments` object check from `_.isEqual` - source = source.replace(/ *\|\| *className *== *argsClass/, ''); - - // simplify DOM node check from `_.isEqual` - source = source.replace(/(if *\(className *!= *objectClass).+?noNodeClass[\s\S]+?{/, '$1) {'); - - // remove conditional `charCodeCallback` use from `_.max` and `_.min` - source = source.replace(/!callback *&& *isString\(collection\)[\s\S]+?: */g, ''); - - // remove unused features from `createBound` - if (buildMethods.indexOf('partial') == -1) { - source = source.replace(matchFunction(source, 'createBound'), function(match) { - return match - .replace(/(function createBound\([^{]+{)[\s\S]+?(\n *function bound)/, '$1$2') - .replace(/thisBinding *=[^}]+}/, 'thisBinding = thisArg;\n'); - }); - } - } - if (isMobile) { - source = replaceVar(source, 'isKeysFast', 'false'); - source = removeKeysOptimization(source); - - // remove `prototype` [[Enumerable]] fix from `_.keys` - source = source.replace(/(?:\s*\/\/.*)*(\s*return *).+?propertyIsEnumerable[\s\S]+?: */, '$1'); - - // remove `prototype` [[Enumerable]] fix from `iteratorTemplate` - source = source - .replace(/(?: *\/\/.*\n)* *' *(?:<% *)?if *\(!hasDontEnumBug *(?:&&|\))[\s\S]+?<% *} *(?:%>|').+/g, '') - .replace(/!hasDontEnumBug *\|\|/g, ''); - } - vm.runInContext(source, context); - return context._; - }()); - - /*------------------------------------------------------------------------*/ - - if (isTemplate) { - source = buildTemplate(templatePattern, templateSettings); - } - else { - // simplify template snippets by removing unnecessary brackets - source = source.replace( - RegExp("{(\\\\n' *\\+\\s*.*?\\+\\n\\s*' *)}(?:\\\\n)?' *([,\\n])", 'g'), "$1'$2" - ); - - source = source.replace( - RegExp("{(\\\\n' *\\+\\s*.*?\\+\\n\\s*' *)}(?:\\\\n)?' *\\+", 'g'), "$1;\\n'+" - ); - - // remove methods from the build - allMethods.forEach(function(otherName) { - if (!_.contains(buildMethods, otherName)) { - source = removeFunction(source, otherName); - } - }); - - // remove `isArguments` fallback before `isArguments` is transformed by - // other parts of the build process - if (isRemoved(source, 'isArguments')) { - source = removeIsArgumentsFallback(source); - } - - /*----------------------------------------------------------------------*/ - - if (isLegacy) { - _.each(['isBindFast', 'nativeBind', 'nativeIsArray', 'nativeKeys'], function(varName) { - source = removeVar(source, varName); - }); - - _.each(['bind', 'isArray'], function(methodName) { - var snippet = matchFunction(source, methodName), - modified = snippet; - - // remove native `Function#bind` branch in `_.bind` - if (methodName == 'bind') { - modified = modified.replace(/(?:\s*\/\/.*)*\s*return isBindFast[^:]+:\s*/, 'return '); - } - // remove native `Array.isArray` branch in `_.isArray` - else { - modified = modified.replace(/nativeIsArray * \|\|/, ''); - } - source = source.replace(snippet, modified); - }); - - // replace `_.keys` with `shimKeys` - if (!isRemoved(source, 'keys')) { - source = source.replace( - matchFunction(source, 'keys').replace(/[\s\S]+?var keys *= */, ''), - matchFunction(source, 'shimKeys').replace(/[\s\S]+?function shimKeys/, 'function').replace(/}\n$/, '};\n') - ); - - source = removeFunction(source, 'shimKeys'); - } - // replace `_.isArguments` with fallback - if (!isRemoved(source, 'isArguments')) { - source = source.replace( - matchFunction(source, 'isArguments').replace(/[\s\S]+?function isArguments/, ''), - getIsArgumentsFallback(source).match(/isArguments *= *function([\s\S]+?) *};/)[1] + ' }\n' - ); - - source = removeIsArgumentsFallback(source); - } - - source = removeVar(source, 'reNative'); - source = removeFromCreateIterator(source, 'nativeKeys'); - } - - /*----------------------------------------------------------------------*/ - - if (isMobile) { - // inline all functions defined with `createIterator` - _.functions(lodash).forEach(function(methodName) { - var reFunc = RegExp('(\\bvar ' + methodName + ' *= *)createIterator\\(((?:{|[a-zA-Z])[\\s\\S]+?)\\);\\n'); - - // skip if not defined with `createIterator` - if (!reFunc.test(source)) { - return; - } - // extract, format, and inject the compiled function's source code - source = source.replace(reFunc, '$1' + getFunctionSource(lodash[methodName]) + ';\n'); - }); - - if (isUnderscore) { - // remove `_.forIn`, `_.forOwn`, and `_.isPlainObject` assignments - (function() { - var snippet = getMethodAssignments(source), - modified = snippet; - - if (!exposeForIn) { - modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.forIn *= *.+\n/, ''); - } - if (!exposeForOwn) { - modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.forOwn *= *.+\n/, ''); - } - if (!exposeIsPlainObject) { - modified = modified.replace(/(?:\n *\/\/.*\s*)* *lodash\.isPlainObject *= *.+\n/, ''); - } - source = source.replace(snippet, modified); - }()); - - // replace `isArguments` and its fallback - (function() { - var snippet = matchFunction(source, 'isArguments') - .replace(/function isArguments/, 'lodash.isArguments = function'); - - source = removeFunction(source, 'isArguments'); - - source = source.replace(getIsArgumentsFallback(source), function(match) { - return snippet + '\n' + match - .replace(/\bisArguments\b/g, 'lodash.$&') - .replace(/\bnoArgsClass\b/g, '!lodash.isArguments(arguments)'); - }); - }()); - - // remove chainability from `_.forEach` - source = source.replace(matchFunction(source, 'forEach'), function(match) { - return match.replace(/return result([};\s]+)$/, '$1'); - }); - - // unexpose "exit early" feature from `_.forEach`, `_.forIn`, and `_.forOwn` - _.each(['forEach', 'forIn', 'forOwn'], function(methodName) { - source = source.replace(matchFunction(source, methodName), function(match) { - return match.replace(/=== *false\)/g, '=== indicatorObject)'); - }); - }); - - // modify `_.every` and `_.some` to use the private `indicatorObject` - source = source.replace(matchFunction(source, 'every'), function(match) { - return match.replace(/\(result *= *(.+?)\);/, '!(result = $1) && indicatorObject;'); - }); - - source = source.replace(matchFunction(source, 'some'), function(match) { - return match.replace(/!\(result *= *(.+?)\);/, '(result = $1) && indicatorObject;'); - }); - - // replace `_.template` - source = source.replace(/^( *)function template[\s\S]+?\n\1}/m, function() { - return [ - ' function template(text, data, options) {', - " text || (text = '');", - ' options = defaults({}, options, lodash.templateSettings);', - '', - ' var index = 0,', - ' source = "__p += \'",', - ' variable = options.variable;', - '', - ' var reDelimiters = RegExp(', - " (options.escape || reNoMatch).source + '|' +", - " (options.interpolate || reNoMatch).source + '|' +", - " (options.evaluate || reNoMatch).source + '|$'", - " , 'g');", - '', - ' text.replace(reDelimiters, function(match, escapeValue, interpolateValue, evaluateValue, offset) {', - ' source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);', - ' source +=', - ' escapeValue ? "\' +\\n_.escape(" + escapeValue + ") +\\n\'" :', - ' evaluateValue ? "\';\\n" + evaluateValue + ";\\n__p += \'" :', - ' interpolateValue ? "\' +\\n((__t = (" + interpolateValue + ")) == null ? \'\' : __t) +\\n\'" : \'\';', - '', - ' index = offset + match.length;', - ' });', - '', - ' source += "\';\\n";', - ' if (!variable) {', - " variable = 'obj';", - " source = 'with (' + variable + ' || {}) {\\n' + source + '\\n}\\n';", - ' }', - " source = 'function(' + variable + ') {\\n' +", - " 'var __t, __p = \\'\\', __j = Array.prototype.join;\\n' +", - " 'function print() { __p += __j.call(arguments, \\'\\') }\\n' +", - ' source +', - " 'return __p\\n}';", - '', - ' try {', - " var result = Function('_', 'return ' + source)(lodash);", - ' } catch(e) {', - ' e.source = source;', - ' throw e;', - ' }', - ' if (data) {', - ' return result(data);', - ' }', - ' result.source = source;', - ' return result;', - ' }' - ].join('\n'); - }); - - // remove unneeded template related variables - source = removeVar(source, 'reComplexDelimiter'); - source = removeVar(source, 'reEmptyStringLeading'); - source = removeVar(source, 'reEmptyStringMiddle'); - source = removeVar(source, 'reEmptyStringTrailing'); - source = removeVar(source, 'reInsertVariable'); - } - else { - source = removeIsArgumentsFallback(source); - source = removeVar(source, 'hasObjectSpliceBug'); - - // remove `hasObjectSpliceBug` fix from the mutator Array functions mixin - source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?\n\1}/, ''); - } - - // remove `thisArg` from unexposed `forIn` and `forOwn` - _.each([ - { 'methodName': 'forIn', 'flag': exposeForIn }, - { 'methodName': 'forOwn', 'flag': exposeForOwn } - ], function(data) { - if (!data.flag) { - source = source.replace(matchFunction(source, data.methodName), function(match) { - return match.replace(/(callback), *thisArg/g, '$1'); - }); - } - }); - - // remove `hasDontEnumBug`, `iteratesOwnLast`, and `noArgsEnum` declarations and assignments - source = source - .replace(/ *\(function\(\) *{[\s\S]+?}\(1\)\);\n/, '') - .replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var (?:hasDontEnumBug|iteratesOwnLast|noArgsEnum).+\n/g, ''); - - // remove `iteratesOwnLast` from `isPlainObject` - source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(iteratesOwnLast[\s\S]+?\n\1}/, ''); - - // remove JScript [[DontEnum]] fix from `_.isEqual` - source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(hasDontEnumBug[\s\S]+?\n\1}/, ''); - - // remove `noArraySliceOnStrings` from `_.toArray` - source = source.replace(/noArraySliceOnStrings *\?[^:]+: *([^)]+)/g, '$1'); - - // remove `noCharByIndex` from `_.reduceRight` - source = source.replace(/}\s*else if *\(noCharByIndex[^}]+/, ''); - - source = removeVar(source, 'extendIteratorOptions'); - source = removeVar(source, 'iteratorTemplate'); - source = removeVar(source, 'noArraySliceOnStrings'); - source = removeVar(source, 'noCharByIndex'); - source = removeNoArgsClass(source); - source = removeNoNodeClass(source); - } - else { - // inline `iteratorTemplate` template - source = source.replace(/(( *)var iteratorTemplate *= *)[\s\S]+?\n\2.+?;\n/, (function() { - var snippet = getFunctionSource(lodash._iteratorTemplate); - - // prepend data object references to property names to avoid having to - // use a with-statement - iteratorOptions.forEach(function(property) { - snippet = snippet.replace(RegExp('([^\\w.])\\b' + property + '\\b', 'g'), '$1obj.' + property); - }); - - // remove unnecessary code - snippet = snippet - .replace(/var __t.+/, "var __p = '';") - .replace(/function print[^}]+}/, '') - .replace(/'(?:\\n|\s)+'/g, "''") - .replace(/__p *\+= *' *';/g, '') - .replace(/(__p *\+= *)' *' *\+/g, '$1') - .replace(/(\{) *;|; *(\})/g, '$1$2') - .replace(/\(\(__t *= *\( *([^)]+) *\)\) *== *null *\? *'' *: *__t\)/g, '($1)'); - - // remove the with-statement - snippet = snippet.replace(/ *with *\(.+?\) *{/, '\n').replace(/}([^}]*}[^}]*$)/, '$1'); - - // minor cleanup - snippet = snippet - .replace(/obj *\|\| *\(obj *= *\{}\);/, '') - .replace(/var __p = '';\s*__p \+=/, 'var __p ='); - - // remove comments, including sourceURLs - snippet = snippet.replace(/\s*\/\/.*(?:\n|$)/g, ''); - - return '$1' + snippet + ';\n'; - }())); - } - } - - /*------------------------------------------------------------------------*/ - - // customize Lo-Dash's IIFE - (function() { - if (typeof iife == 'string') { - var token = '%output%', - index = iife.indexOf(token); - - source = source.match(/\/\*![\s\S]+?\*\/\n/) + - iife.slice(0, index) + - source.replace(/^[\s\S]+?\(function[^{]+?{|}\(this\)\)[;\s]*$/g, '') + - iife.slice(index + token.length); - } - }()); - - /*------------------------------------------------------------------------*/ - - // customize Lo-Dash's export bootstrap - (function() { - var isAMD = exportsOptions.indexOf('amd') > -1, - isCommonJS = exportsOptions.indexOf('commonjs') > -1, - isGlobal = exportsOptions.indexOf('global') > -1, - isNode = exportsOptions.indexOf('node') > -1; - - if (!isAMD) { - source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +define[\s\S]+?else /, '$1'); - } - if (!isNode) { - source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +module[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2'); - } - if (!isCommonJS) { - source = source.replace(/(?: *\/\/.*\n)*(?:( *)else *{)?\s*freeExports\.\w+ *=[\s\S]+?(?:\n\1})?\n/, ''); - } - if (!isGlobal) { - source = source.replace(/(?:( *)(})? *else(?: *if *\(_\))? *{)?(?:\s*\/\/.*)*\s*(?:window\._|_\.templates) *=[\s\S]+?(?:\n\1})?\n/g, '$1$2\n'); - } - // remove `if (freeExports) {...}` if it's empty - if (isAMD && isGlobal) { - source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}\n/, ''); - } else { - source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}(?:\s*else *{([\s\S]+?) *})?\n/, '$1\n'); - } - - if ((source.match(/\bfreeExports\b/g) || []).length < 2) { - source = removeVar(source, 'freeExports'); - } - }()); - - /*------------------------------------------------------------------------*/ - - if (isTemplate) { - debugSource = source; - } - else { - // modify/remove references to removed methods/variables - if (isRemoved(source, 'invert')) { - source = replaceVar(source, 'htmlUnescapes', "{'&':'&','<':'<','>':'>','"':'\"',''':\"'\"}"); - } - if (isRemoved(source, 'isArguments')) { - source = replaceVar(source, 'noArgsClass', 'false'); - } - if (isRemoved(source, 'isFunction')) { - source = removeIsFunctionFallback(source); - } - if (isRemoved(source, 'mixin')) { - // remove `lodash.prototype` additions - source = source.replace(/(?:\s*\/\/.*)*\s*mixin\(lodash\)[\s\S]+?\/\*-+\*\//, ''); - source = removeVar(source, 'hasObjectSpliceBug'); - } - - // remove pseudo private properties - source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n'); - - // assign debug source before further modifications that rely on the minifier - // to remove unused variables and other dead code - debugSource = source; - - // remove associated functions, variables, and code snippets that the minifier may miss - if (isRemoved(source, 'clone')) { - source = removeVar(source, 'cloneableClasses'); - } - if (isRemoved(source, 'isArray')) { - source = removeVar(source, 'nativeIsArray'); - } - if (isRemoved(source, 'isPlainObject')) { - source = removeVar(source, 'getPrototypeOf'); - } - if (isRemoved(source, 'keys')) { - source = removeFunction(source, 'shimKeys'); - } - if (isRemoved(source, 'template')) { - // remove `templateSettings` assignment - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *lodash\.templateSettings[\s\S]+?};\n/, ''); - } - if (isRemoved(source, 'toArray')) { - source = removeVar(source, 'noArraySliceOnStrings'); - } - if (isRemoved(source, 'clone', 'isArguments', 'isEmpty', 'isEqual')) { - source = removeNoArgsClass(source); - } - if (isRemoved(source, 'isEqual', 'isPlainObject')) { - source = removeNoNodeClass(source); - } - if ((source.match(/\bcreateIterator\b/g) || []).length < 2) { - source = removeFunction(source, 'createIterator'); - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var noArgsEnum;|.+?noArgsEnum *=.+/g, ''); - } - if (isRemoved(source, 'createIterator', 'bind')) { - source = removeVar(source, 'isBindFast'); - source = removeVar(source, 'nativeBind'); - } - if (isRemoved(source, 'createIterator', 'bind', 'isArray', 'isPlainObject', 'keys')) { - source = removeVar(source, 'reNative'); - } - if (isRemoved(source, 'createIterator', 'isEqual')) { - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var hasDontEnumBug;|.+?hasDontEnumBug *=.+/g, ''); - } - if (isRemoved(source, 'createIterator', 'isPlainObject')) { - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var iteratesOwnLast;|.+?iteratesOwnLast *=.+/g, ''); - } - if (isRemoved(source, 'createIterator', 'keys')) { - source = removeVar(source, 'nativeKeys'); - source = removeKeysOptimization(source); - } - if (!source.match(/var (?:hasDontEnumBug|iteratesOwnLast|noArgsEnum)\b/g)) { - // remove `hasDontEnumBug`, `iteratesOwnLast`, and `noArgsEnum` assignments - source = source.replace(/ *\(function\(\) *{[\s\S]+?}\(1\)\);\n/, ''); - } - } - - /*------------------------------------------------------------------------*/ - - // used to specify creating a custom build - var isCustom = isBackbone || isLegacy || isMobile || isStrict || isUnderscore || - /(?:category|exclude|exports|iife|include|minus|plus)=/.test(options) || - !_.isEqual(exportsOptions, exportsAll); - - // used as the basename of the output path - var basename = outputPath - ? path.basename(outputPath, '.js') - : 'lodash' + (isTemplate ? '.template' : isCustom ? '.custom' : ''); - - // restore `dependencyMap` - dependencyMap = dependencyBackup; - - // output debug build - if (!isMinify && (isCustom || isDebug || isTemplate)) { - if (isDebug && isStdOut) { - stdout.write(debugSource); - callback(debugSource); - } else if (!isStdOut) { - callback(debugSource, (isDebug && outputPath) || path.join(cwd, basename + '.js')); - } - } - // begin the minification process - if (!isDebug) { - outputPath || (outputPath = path.join(cwd, basename + '.min.js')); - - minify(source, { - 'isSilent': isSilent, - 'isTemplate': isTemplate, - 'outputPath': outputPath, - 'onComplete': function(source) { - // inject "use strict" directive - if (isStrict) { - source = source.replace(/^([\s\S]*?function[^{]+{)([^'"])/, '$1"use strict";$2'); - } - if (isStdOut) { - stdout.write(source); - callback(source); - } else { - callback(source, outputPath); - } - } - }); - } - } - - /*--------------------------------------------------------------------------*/ - - // expose `build` - if (module != require.main) { - module.exports = build; - } - else { - // or invoked directly - build(process.argv, function(source, filePath) { - filePath && fs.writeFileSync(filePath, source, 'utf8'); - }); - } -}()); diff --git a/node_modules/grunt/node_modules/lodash/build/minify.js b/node_modules/grunt/node_modules/lodash/build/minify.js deleted file mode 100755 index c5c98dd..0000000 --- a/node_modules/grunt/node_modules/lodash/build/minify.js +++ /dev/null @@ -1,579 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** Load Node modules */ - var fs = require('fs'), - https = require('https'), - path = require('path'), - spawn = require('child_process').spawn, - tar = require('../vendor/tar/tar.js'), - zlib = require('zlib'); - - /** Load other modules */ - var _ = require('../lodash.js'), - preprocess = require('./pre-compile.js'), - postprocess = require('./post-compile.js'); - - /** The Git object ID of `closure-compiler.tar.gz` */ - var closureId = 'a2787b470c577cee2404d186c562dd9835f779f5'; - - /** The Git object ID of `uglifyjs.tar.gz` */ - var uglifyId = '505f1be36ef60fd25a992a522f116d5179ab317f'; - - /** The path of the directory that is the base of the repository */ - var basePath = fs.realpathSync(path.join(__dirname, '..')); - - /** The path of the `vendor` directory */ - var vendorPath = path.join(basePath, 'vendor'); - - /** The path to the Closure Compiler `.jar` */ - var closurePath = path.join(vendorPath, 'closure-compiler', 'compiler.jar'); - - /** The path to the UglifyJS module */ - var uglifyPath = path.join(vendorPath, 'uglifyjs', 'tools', 'node.js'); - - /** The Closure Compiler command-line options */ - var closureOptions = ['--warning_level=QUIET']; - - /** The media type for raw blob data */ - var mediaType = 'application/vnd.github.v3.raw'; - - /** Used to reference parts of the blob href */ - var location = (function() { - var host = 'api.github.com', - origin = 'https://api.github.com', - pathname = '/repos/bestiejs/lodash/git/blobs'; - - return { - 'host': host, - 'href': origin + pathname, - 'origin': origin, - 'pathname': pathname - }; - }()); - - /** The Closure Compiler optimization modes */ - var optimizationModes = { - 'simple': 'SIMPLE_OPTIMIZATIONS', - 'advanced': 'ADVANCED_OPTIMIZATIONS' - }; - - /** Reassign `existsSync` for older versions of Node */ - fs.existsSync || (fs.existsSync = path.existsSync); - - /*--------------------------------------------------------------------------*/ - - /** - * Minifies a given Lo-Dash `source` and invokes the `options.onComplete` - * callback when finished. The `onComplete` callback is invoked with one - * argument; (outputSource). - * - * @param {Array|String} [source=''] The source to minify or array of commands. - * -o, --output - Write output to a given path/filename. - * -s, --silent - Skip status updates normally logged to the console. - * -t, --template - Applies template specific minifier options. - * - * @param {Object} [options={}] The options object. - * outputPath - Write output to a given path/filename. - * isSilent - Skip status updates normally logged to the console. - * isTemplate - Applies template specific minifier options. - * onComplete - The function called once minification has finished. - */ - function minify(source, options) { - source || (source = ''); - options || (options = {}); - - // juggle arguments - if (Array.isArray(source)) { - // convert commands to an options object - options = source; - - var filePath = options[options.length - 1], - isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1, - isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1, - outputPath = path.join(path.dirname(filePath), path.basename(filePath, '.js') + '.min.js'); - - outputPath = options.reduce(function(result, value, index) { - if (/-o|--output/.test(value)) { - result = options[index + 1]; - result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result)); - } - return result; - }, outputPath); - - options = { - 'isSilent': isSilent, - 'isTemplate': isTemplate, - 'outputPath': outputPath - }; - - source = fs.readFileSync(filePath, 'utf8'); - } - // fetch the Closure Compiler - getDependency({ - 'id': 'closure-compiler', - 'hashId': closureId, - 'path': vendorPath, - 'title': 'the Closure Compiler', - 'onComplete': function(exception) { - var error = exception; - - // fetch UglifyJS - getDependency({ - 'id': 'uglifyjs', - 'hashId': uglifyId, - 'title': 'UglifyJS', - 'path': vendorPath, - 'onComplete': function(exception) { - error || (error = exception); - if (!error) { - new Minify(source, options); - } - } - }); - } - }); - } - - /** - * The Minify constructor used to keep state of each `minify` invocation. - * - * @private - * @constructor - * @param {String} source The source to minify. - * @param {Object} options The options object. - * outputPath - Write output to a given path/filename. - * isSilent - Skip status updates normally logged to the console. - * isTemplate - Applies template specific minifier options. - * onComplete - The function called once minification has finished. - */ - function Minify(source, options) { - // juggle arguments - if (typeof source == 'object' && source) { - options = source || options; - source = options.source || ''; - } - this.compiled = { 'simple': {}, 'advanced': {} }; - this.hybrid = { 'simple': {}, 'advanced': {} }; - this.uglified = {}; - - this.isSilent = !!options.isSilent; - this.isTemplate = !!options.isTemplate; - this.outputPath = options.outputPath; - - source = preprocess(source, options); - this.source = source; - - this.onComplete = options.onComplete || function(source) { - fs.writeFileSync(this.outputPath, source, 'utf8'); - }; - - // begin the minification process - closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this)); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Fetches a required `.tar.gz` dependency with the given Git object ID from - * the Lo-Dash repo on GitHub. The object ID may be obtained by running - * `git hash-object path/to/dependency.tar.gz`. - * - * @private - * @param {Object} options The options object. - * id - The Git object ID of the `.tar.gz` file. - * onComplete - The function, invoked with one argument (exception), - * called once the extraction has finished. - * path - The path of the extraction directory. - * title - The dependency's title used in status updates logged to the console. - */ - function getDependency(options) { - options || (options = {}); - - var ran, - destPath = options.path, - hashId = options.hashId, - id = options.id, - onComplete = options.onComplete, - title = options.title; - - // exit early if dependency exists - if (fs.existsSync(path.join(destPath, id))) { - onComplete(); - return; - } - var callback = function(exception) { - if (ran) { - return; - } - if (exception) { - console.error([ - 'There was a problem installing ' + title + '.', - 'Try running the command as root, via `sudo`, or manually install by running:', - '', - "curl -H 'Accept: " + mediaType + "' " + location.href + '/' + hashId + " | tar xvz -C '" + destPath + "'", - '' - ].join('\n')); - } - ran = true; - process.removeListener('uncaughtException', callback); - onComplete(exception); - }; - - console.log('Downloading ' + title + '...'); - process.on('uncaughtException', callback); - - https.get({ - 'host': location.host, - 'path': location.pathname + '/' + hashId, - 'headers': { - // By default, all GitHub blob API endpoints return a JSON document - // containing Base64-encoded blob data. Overriding the `Accept` header - // with the GitHub raw media type returns the blob data directly. - // See http://developer.github.com/v3/media/. - 'Accept': mediaType, - // As of 2013-04-24, the GitHub API mandates the `User-Agent` header - // for all requests. - 'User-Agent': 'Lo-Dash/' + _.VERSION - } - }, function(response) { - var decompressor = zlib.createUnzip(), - parser = new tar.Extract({ 'path': destPath }); - - parser.on('end', callback); - response.pipe(decompressor).pipe(parser); - }); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Compresses a `source` string using the Closure Compiler. Yields the - * minified result, and any exceptions encountered, to a `callback` function. - * - * @private - * @param {String} source The JavaScript source to minify. - * @param {String} mode The optimization mode. - * @param {Function} callback The function called once the process has completed. - */ - function closureCompile(source, mode, callback) { - // use simple optimizations when minifying template files - var options = closureOptions.slice(); - options.push('--compilation_level=' + optimizationModes[this.isTemplate ? 'simple' : mode]); - - // the standard error stream, standard output stream, and the Closure Compiler process - var error = '', - output = '', - compiler = spawn('java', ['-jar', closurePath].concat(options)); - - if (!this.isSilent) { - console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...'); - } - compiler.stdout.on('data', function(data) { - // append the data to the output stream - output += data; - }); - - compiler.stderr.on('data', function(data) { - // append the error message to the error stream - error += data; - }); - - compiler.on('exit', function(status) { - // `status` contains the process exit code - if (status) { - var exception = new Error(error); - exception.status = status; - } - callback(exception, output); - }); - - // proxy the standard input to the Closure Compiler - compiler.stdin.end(source); - } - - /** - * Compresses a `source` string using UglifyJS. Yields the result to a - * `callback` function. This function is synchronous; the `callback` is used - * for symmetry. - * - * @private - * @param {String} source The JavaScript source to minify. - * @param {String} label The label to log. - * @param {Function} callback The function called once the process has completed. - */ - function uglify(source, label, callback) { - if (!this.isSilent) { - console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...'); - } - try { - var uglifyJS = require(uglifyPath); - - // 1. parse - var toplevel = uglifyJS.parse(source); - - // 2. compress - // enable unsafe comparisons - toplevel.figure_out_scope(); - toplevel = toplevel.transform(uglifyJS.Compressor({ - 'comparisons': false, - 'unsafe_comps': true, - 'warnings': false - })); - - // 3. mangle - // excluding the `define` function exposed by AMD loaders - toplevel.figure_out_scope(); - toplevel.compute_char_frequency(); - toplevel.mangle_names({ - 'except': ['define'] - }); - - // 4. output - // restrict lines to 500 characters for consistency with the Closure Compiler - var stream = uglifyJS.OutputStream({ - 'ascii_only': true, - 'comments': true, - 'max_line_len': 500, - }); - - toplevel.print(stream); - } - catch(e) { - var exception = e; - } - callback(exception, stream && String(stream)); - } - - /*--------------------------------------------------------------------------*/ - - /** - * The Closure Compiler callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onClosureSimpleCompile(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.compiled.simple.source = result; - zlib.gzip(result, onClosureSimpleGzip.bind(this)); - } - - /** - * The Closure Compiler `gzip` callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onClosureSimpleGzip(exception, result) { - if (exception) { - throw exception; - } - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.compiled.simple.gzip = result; - - // next, compile the source using advanced optimizations - closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this)); - } - - /** - * The Closure Compiler callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onClosureAdvancedCompile(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.compiled.advanced.source = result; - zlib.gzip(result, onClosureAdvancedGzip.bind(this)); - } - - /** - * The Closure Compiler `gzip` callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onClosureAdvancedGzip(exception, result) { - if (exception) { - throw exception; - } - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.compiled.advanced.gzip = result; - - // next, minify the source using only UglifyJS - uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this)); - } - - /** - * The UglifyJS callback. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onUglify(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.uglified.source = result; - zlib.gzip(result, onUglifyGzip.bind(this)); - } - - /** - * The UglifyJS `gzip` callback. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onUglifyGzip(exception, result) { - if (exception) { - throw exception; - } - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.uglified.gzip = result; - - // next, minify the already Closure Compiler simple optimized source using UglifyJS - uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this)); - } - - /** - * The hybrid callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onSimpleHybrid(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.hybrid.simple.source = result; - zlib.gzip(result, onSimpleHybridGzip.bind(this)); - } - - /** - * The hybrid `gzip` callback for simple optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onSimpleHybridGzip(exception, result) { - if (exception) { - throw exception; - } - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.hybrid.simple.gzip = result; - - // next, minify the already Closure Compiler advance optimized source using UglifyJS - uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this)); - } - - /** - * The hybrid callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {String} result The resulting minified source. - */ - function onAdvancedHybrid(exception, result) { - if (exception) { - throw exception; - } - result = postprocess(result); - this.hybrid.advanced.source = result; - zlib.gzip(result, onAdvancedHybridGzip.bind(this)); - } - - /** - * The hybrid `gzip` callback for advanced optimizations. - * - * @private - * @param {Object|Undefined} exception The error object. - * @param {Buffer} result The resulting gzipped source. - */ - function onAdvancedHybridGzip(exception, result) { - if (exception) { - throw exception; - } - if (!this.isSilent) { - console.log('Done. Size: %d bytes.', result.length); - } - this.hybrid.advanced.gzip = result; - - // finish by choosing the smallest compressed file - onComplete.call(this); - } - - /** - * The callback executed after the source is minified and gzipped. - * - * @private - */ - function onComplete() { - var compiledSimple = this.compiled.simple, - compiledAdvanced = this.compiled.advanced, - uglified = this.uglified, - hybridSimple = this.hybrid.simple, - hybridAdvanced = this.hybrid.advanced; - - // select the smallest gzipped file and use its minified counterpart as the - // official minified release (ties go to the Closure Compiler) - var min = Math.min( - compiledSimple.gzip.length, - compiledAdvanced.gzip.length, - uglified.gzip.length, - hybridSimple.gzip.length, - hybridAdvanced.gzip.length - ); - - // pass the minified source to the "onComplete" callback - [compiledSimple, compiledAdvanced, uglified, hybridSimple, hybridAdvanced].some(function(data) { - if (data.gzip.length == min) { - this.onComplete(data.source); - } - }, this); - } - - /*--------------------------------------------------------------------------*/ - - // expose `minify` - if (module != require.main) { - module.exports = minify; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node minify.js source.js`) and write to - // `.min.js` - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - minify(options); - }()); - } -}()); diff --git a/node_modules/grunt/node_modules/lodash/build/post-compile.js b/node_modules/grunt/node_modules/lodash/build/post-compile.js deleted file mode 100644 index 11e855e..0000000 --- a/node_modules/grunt/node_modules/lodash/build/post-compile.js +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** The Node filesystem module */ - var fs = require('fs'); - - /** The minimal license/copyright template */ - var licenseTemplate = { - 'lodash': - '/*!\n' + - ' Lo-Dash @VERSION lodash.com/license\n' + - ' Underscore.js 1.4.2 underscorejs.org/LICENSE\n' + - '*/', - 'underscore': - '/*! Underscore.js @VERSION underscorejs.org/LICENSE */' - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Post-process a given minified Lo-Dash `source`, preparing it for - * deployment. - * - * @param {String} source The source to process. - * @returns {String} Returns the processed source. - */ - function postprocess(source) { - // remove old copyright/license header - source = source.replace(/^\/\*![\s\S]+?\*\/\n/, ''); - - // move vars exposed by the Closure Compiler into the IIFE - source = source.replace(/^((?:(['"])use strict\2;)?(?:var (?:[a-z]+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$3$1'); - - // correct overly aggressive Closure Compiler advanced optimizations - source = source.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}'); - - // unescape properties (i.e. foo["bar"] => foo.bar) - source = source.replace(/(\w)\["([^."]+)"\]/g, function(match, left, right) { - return /\W/.test(right) ? match : (left + '.' + right); - }); - - // flip `typeof` expressions to help optimize Safari and - // correct the AMD module definition for AMD build optimizers - // (e.g. from `"number" == typeof x` to `typeof x == "number") - source = source.replace(/(return)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[\w.]+))/g, function(match, ret, type, equality, expression) { - return (ret ? ret + ' ' : '') + expression + equality + type; - }); - - // add trailing semicolon - if (source) { - source = source.replace(/[\s;]*$/, ';'); - } - // exit early if version snippet isn't found - var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source); - if (!snippet) { - return source; - } - // add license - return licenseTemplate[/call\(this\);?$/.test(source) ? 'underscore' : 'lodash'] - .replace('@VERSION', snippet[2]) + '\n;' + source; - } - - /*--------------------------------------------------------------------------*/ - - // expose `postprocess` - if (module != require.main) { - module.exports = postprocess; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node post-compile.js source.js`) and write to - // the same file - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - var filePath = options[options.length - 1], - source = fs.readFileSync(filePath, 'utf8'); - - fs.writeFileSync(filePath, postprocess(source), 'utf8'); - }()); - } -}()); diff --git a/node_modules/grunt/node_modules/lodash/build/pre-compile.js b/node_modules/grunt/node_modules/lodash/build/pre-compile.js deleted file mode 100644 index 1c13cef..0000000 --- a/node_modules/grunt/node_modules/lodash/build/pre-compile.js +++ /dev/null @@ -1,384 +0,0 @@ -#!/usr/bin/env node -;(function() { - 'use strict'; - - /** The Node filesystem module */ - var fs = require('fs'); - - /** Used to minify variables embedded in compiled strings */ - var compiledVars = [ - 'argsIndex', - 'argsLength', - 'callback', - 'collection', - 'createCallback', - 'ctor', - 'hasOwnProperty', - 'index', - 'isArguments', - 'isString', - 'iteratee', - 'length', - 'nativeKeys', - 'object', - 'objectTypes', - 'ownIndex', - 'ownProps', - 'propertyIsEnumerable', - 'result', - 'skipProto', - 'thisArg', - 'value' - ]; - - /** Used to minify `compileIterator` option properties */ - var iteratorOptions = [ - 'args', - 'arrayLoop', - 'bottom', - 'firstArg', - 'hasDontEnumBug', - 'isKeysFast', - 'objectLoop', - 'noArgsEnum', - 'noCharByIndex', - 'shadowed', - 'top', - 'useHas', - 'useStrict' - ]; - - /** Used to minify variables and string values to a single character */ - var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); - minNames.push.apply(minNames, minNames.map(function(value) { - return value + value; - })); - - /** Used to protect the specified properties from getting minified */ - var propWhitelist = [ - '_', - '__chain__', - '__wrapped__', - 'after', - 'all', - 'amd', - 'any', - 'attachEvent', - 'bind', - 'bindAll', - 'chain', - 'clone', - 'collect', - 'compact', - 'compose', - 'contains', - 'countBy', - 'criteria', - 'debounce', - 'defaults', - 'defer', - 'delay', - 'detect', - 'difference', - 'drop', - 'each', - 'environment', - 'escape', - 'evaluate', - 'every', - 'exports', - 'extend', - 'filter', - 'find', - 'first', - 'flatten', - 'foldl', - 'foldr', - 'forEach', - 'forIn', - 'forOwn', - 'functions', - 'global', - 'groupBy', - 'has', - 'head', - 'identity', - 'include', - 'index', - 'indexOf', - 'initial', - 'inject', - 'interpolate', - 'intersection', - 'invert', - 'invoke', - 'isArguments', - 'isArray', - 'isBoolean', - 'isDate', - 'isElement', - 'isEmpty', - 'isEqual', - 'isEqual', - 'isFinite', - 'isFinite', - 'isFunction', - 'isNaN', - 'isNull', - 'isNumber', - 'isObject', - 'isPlainObject', - 'isRegExp', - 'isString', - 'isUndefined', - 'keys', - 'last', - 'lastIndexOf', - 'lateBind', - 'map', - 'max', - 'memoize', - 'merge', - 'methods', - 'min', - 'mixin', - 'noConflict', - 'object', - 'omit', - 'once', - 'opera', - 'pairs', - 'partial', - 'pick', - 'pluck', - 'random', - 'range', - 'reduce', - 'reduceRight', - 'reject', - 'rest', - 'result', - 'select', - 'shuffle', - 'size', - 'some', - 'sortBy', - 'sortedIndex', - 'source', - 'tail', - 'take', - 'tap', - 'template', - 'templateSettings', - 'throttle', - 'times', - 'toArray', - 'unescape', - 'union', - 'uniq', - 'unique', - 'uniqueId', - 'value', - 'values', - 'variable', - 'VERSION', - 'where', - 'without', - 'wrap', - 'zip', - - // properties used by underscore.js - '_chain', - '_wrapped' - ]; - - /*--------------------------------------------------------------------------*/ - - /** - * Pre-process a given Lo-Dash `source`, preparing it for minification. - * - * @param {String} [source=''] The source to process. - * @param {Object} [options={}] The options object. - * @returns {String} Returns the processed source. - */ - function preprocess(source, options) { - source || (source = ''); - options || (options = {}); - - // remove unrecognized JSDoc tags so the Closure Compiler won't complain - source = source.replace(/@(?:alias|category)\b.*/g, ''); - - if (options.isTemplate) { - return source; - } - - // remove copyright to add later in post-compile.js - source = source.replace(/\/\*![\s\S]+?\*\//, ''); - - // add brackets to whitelisted properties so the Closure Compiler won't mung them - // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export - source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), "['$1']"); - - // remove brackets from `_.escape()` in `_.template` - source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape'); - - // remove brackets from `_.escape()` in underscore.js `_.template` - source = source.replace(/_\['escape'\]\(__t'/g, '_.escape(__t'); - - // remove brackets from `collection.indexOf` in `_.contains` - source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)'); - - // remove brackets from `result[length].value` in `_.sortBy` - source = source.replace("result[length]['value']", 'result[length].value'); - - // remove whitespace from string literals - source = source.replace(/'(?:(?=(\\?))\1.)*?'/g, function(string) { - // avoids removing the '\n' of the `stringEscapes` object - return string.replace(/\[object |delete |else |function | in |return\s+[\w']|throw |typeof |use strict|var |@ |'\\n'|\\\\n|\\n|\s+/g, function(match) { - return match == false || match == '\\n' ? '' : match; - }); - }); - - // add newline to `+"__p+='"` in underscore.js `_.template` - source = source.replace(/\+"__p\+='"/g, '+"\\n__p+=\'"'); - - // remove whitespace from `_.template` related regexes - source = source.replace(/(?:reEmptyString\w+|reInsertVariable) *=.+/g, function(match) { - return match.replace(/ |\\n/g, ''); - }); - - // remove newline from double-quoted strings in `_.template` - source = source - .replace('"\';\\n__with ("', '"\';__with("') - .replace('"\\n}__\\n__p += \'"', '"}____p+=\'"') - .replace('"__p = \'"', '"__p=\'"') - .replace('"\';\\n"', '"\';"') - .replace("') {\\n'", "'){'") - - // remove `useSourceURL` variable - source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *try *\{(?:\s*\/\/.*)*\n *var useSourceURL[\s\S]+?catch[^}]+}\n/, ''); - - // remove debug sourceURL use in `_.template` - source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, ''); - - // minify internal properties used by 'compareAscending' and `_.sortBy` - (function() { - var properties = ['criteria', 'index', 'value'], - snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g); - - if (!snippets) { - return; - } - snippets.forEach(function(snippet) { - var modified = snippet; - - // minify properties - properties.forEach(function(property, index) { - var reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'), - reDotProp = RegExp('\\.' + property + '\\b', 'g'), - rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g'); - - modified = modified - .replace(reBracketProp, "['" + minNames[index] + "']") - .replace(reDotProp, "['" + minNames[index] + "']") - .replace(rePropColon, "$1'" + minNames[index] + "':"); - }); - - // replace with modified snippet - source = source.replace(snippet, modified); - }); - }()); - - // minify all compilable snippets - var snippets = source.match( - RegExp([ - // match the `iteratorTemplate` - '( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}', - // match methods created by `createIterator` calls - 'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n', - // match variables storing `createIterator` options - '( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}', - // match the the `createIterator` function - '( +)function createIterator\\b[\\s\\S]+?\\n\\3}' - ].join('|'), 'g') - ); - - // exit early if no compilable snippets - if (!snippets) { - return source; - } - - snippets.forEach(function(snippet, index) { - var isCreateIterator = /function createIterator\b/.test(snippet), - isIteratorTemplate = /var iteratorTemplate\b/.test(snippet), - modified = snippet; - - // add brackets to whitelisted properties so the Closure Compiler won't mung them - modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), "['$1']"); - - if (isCreateIterator) { - // replace with modified snippet early and clip snippet to the `factory` - // call so other arguments aren't minified - source = source.replace(snippet, modified); - snippet = modified = modified.replace(/factory\([\s\S]+$/, ''); - } - - // minify snippet variables / arguments - compiledVars.forEach(function(variable, index) { - // ensure properties in compiled strings aren't minified - modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minNames[index]); - - // correct `typeof x == 'object'` - if (variable == 'object') { - modified = modified.replace(RegExp("(typeof [^']+')" + minNames[index] + "'", 'g'), "$1object'"); - } - }); - - // minify `createIterator` option property names - iteratorOptions.forEach(function(property, index) { - if (isIteratorTemplate) { - // minify property names as interpolated template variables - modified = modified.replace(RegExp('\\b' + property + '\\b', 'g'), minNames[index]); - } - else { - // minify property name strings - modified = modified.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'"); - // minify property names in accessors - if (isCreateIterator) { - modified = modified.replace(RegExp('\\.' + property + '\\b' , 'g'), '.' + minNames[index]); - } - } - }); - - // replace with modified snippet - source = source.replace(snippet, modified); - }); - - return source; - } - - /*--------------------------------------------------------------------------*/ - - // expose `preprocess` - if (module != require.main) { - module.exports = preprocess; - } - else { - // read the Lo-Dash source file from the first argument if the script - // was invoked directly (e.g. `node pre-compile.js source.js`) and write to - // the same file - (function() { - var options = process.argv; - if (options.length < 3) { - return; - } - var filePath = options[options.length - 1], - isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1, - source = fs.readFileSync(filePath, 'utf8'); - - fs.writeFileSync(filePath, preprocess(source, { - 'isTemplate': isTemplate - }), 'utf8'); - }()); - } -}()); diff --git a/node_modules/grunt/node_modules/lodash/index.js b/node_modules/grunt/node_modules/lodash/index.js deleted file mode 100755 index 5d063e2..0000000 --- a/node_modules/grunt/node_modules/lodash/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lodash'); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/lodash/lodash.js b/node_modules/grunt/node_modules/lodash/lodash.js deleted file mode 100644 index 9eae931..0000000 --- a/node_modules/grunt/node_modules/lodash/lodash.js +++ /dev/null @@ -1,4258 +0,0 @@ -/*! - * Lo-Dash v0.9.2 - * (c) 2012 John-David Dalton - * Based on Underscore.js 1.4.2 - * (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. - * Available under MIT license - */ -;(function(window, undefined) { - - /** Detect free variable `exports` */ - var freeExports = typeof exports == 'object' && exports; - - /** 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 = [], - // avoid a Closure Compiler bug by creatively creating an object - objectRef = new function(){}; - - /** 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 detect template delimiter values that require a with-statement */ - var reComplexDelimiter = /[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/; - - /** Used to match HTML entities */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27);/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 insert the data object variable into compiled template source */ - var reInsertVariable = /(?:__e|__t = )\(\s*(?![\d\s"']|this\.)/g; - - /** 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 = /\$\{((?:(?=\\?)\\?[\s\S])*?)}/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, - propertyIsEnumerable = objectRef.propertyIsEnumerable, - slice = arrayRef.slice, - 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 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 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 an `arguments` object's indexes are non-enumerable (IE < 9) */ - var noArgsEnum = 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) { noArgsEnum = !prop; } - - hasDontEnumBug = !/valueOf/.test(props); - iteratesOwnLast = props[0] != 'x'; - }(1)); - - /** Detect if an `arguments` object's [[Class]] is unresolvable (Firefox < 4, IE < 9) */ - var noArgsClass = !isArguments(arguments); - - /** Detect if `Array#slice` cannot be used to convert strings to arrays (Opera < 10.52) */ - var noArraySliceOnStrings = slice.call('x')[0] != 'x'; - - /** - * 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 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` property value of `typeof` "function". - */ - try { - var noNodeClass = ({ 'toString': 0 } + '', toString.call(window.document || 0) == objectClass); - } catch(e) { } - - /* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */ - var isBindFast = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera)); - - /* Detect if `Object.keys` exists and is inferred to be fast (IE, Opera, V8) */ - var isKeysFast = nativeKeys && /^.+$|true/.test(nativeKeys + !!window.attachEvent); - - /** - * Detect if sourceURL syntax is usable without erroring: - * - * The JS engine in Adobe products, like InDesign, will throw a syntax error - * when it encounters a single line comment beginning with the `@` symbol. - * - * The JS engine in Narwhal will generate the function `function anonymous(){//}` - * and throw a syntax error. - * - * Avoid comments beginning `@` symbols in IE because they are part of its - * non-standard conditional compilation support. - * http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx - */ - try { - var useSourceURL = (Function('//@')(), !window.attachEvent); - } catch(e) { } - - /** Used to identify object classifications that `_.clone` supports */ - var cloneableClasses = {}; - cloneableClasses[argsClass] = cloneableClasses[funcClass] = false; - 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' - }; - - /*--------------------------------------------------------------------------*/ - - /** - * The `lodash` function. - * - * @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 - if (value && 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. - * - * @static - * @memberOf _.templateSettings - * @type RegExp - */ - 'escape': /<%-([\s\S]+?)%>/g, - - /** - * Used to detect code to be evaluated. - * - * @static - * @memberOf _.templateSettings - * @type RegExp - */ - 'evaluate': /<%([\s\S]+?)%>/g, - - /** - * Used to detect `data` property values to inject. - * - * @static - * @memberOf _.templateSettings - * @type RegExp - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @static - * @memberOf _.templateSettings - * @type String - */ - 'variable': '' - }; - - /*--------------------------------------------------------------------------*/ - - /** - * 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 = template( - // conditional strict mode - '<% if (obj.useStrict) { %>\'use strict\';\n<% } %>' + - - // the `iteratee` may be reassigned by the `top` snippet - 'var index, value, iteratee = <%= firstArg %>, ' + - // assign the `result` variable an initial value - 'result = <%= firstArg %>;\n' + - // exit early if the first argument is falsey - 'if (!<%= firstArg %>) return result;\n' + - // add code before the iteration branches - '<%= top %>;\n' + - - // array-like iteration: - '<% if (arrayLoop) { %>' + - 'var length = iteratee.length; index = -1;\n' + - 'if (typeof length == \'number\') {' + - - // add support for accessing string characters by index if needed - ' <% if (noCharByIndex) { %>\n' + - ' if (isString(iteratee)) {\n' + - ' iteratee = iteratee.split(\'\')\n' + - ' }' + - ' <% } %>\n' + - - // iterate over the array-like value - ' while (++index < length) {\n' + - ' value = iteratee[index];\n' + - ' <%= arrayLoop %>\n' + - ' }\n' + - '}\n' + - 'else {' + - - // object iteration: - // add support for iterating over `arguments` objects if needed - ' <% } else if (noArgsEnum) { %>\n' + - ' var length = iteratee.length; index = -1;\n' + - ' if (length && isArguments(iteratee)) {\n' + - ' while (++index < length) {\n' + - ' value = iteratee[index += \'\'];\n' + - ' <%= objectLoop %>\n' + - ' }\n' + - ' } else {' + - ' <% } %>' + - - // 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`. Because of this Lo-Dash standardizes on skipping - // the the `prototype` property of functions regardless of its - // [[Enumerable]] value. - ' <% if (!hasDontEnumBug) { %>\n' + - ' var skipProto = typeof iteratee == \'function\' && \n' + - ' propertyIsEnumerable.call(iteratee, \'prototype\');\n' + - ' <% } %>' + - - // iterate own properties using `Object.keys` if it's fast - ' <% if (isKeysFast && useHas) { %>\n' + - ' var ownIndex = -1,\n' + - ' ownProps = objectTypes[typeof iteratee] ? nativeKeys(iteratee) : [],\n' + - ' length = ownProps.length;\n\n' + - ' while (++ownIndex < length) {\n' + - ' index = ownProps[ownIndex];\n' + - ' <% if (!hasDontEnumBug) { %>if (!(skipProto && index == \'prototype\')) {\n <% } %>' + - ' value = iteratee[index];\n' + - ' <%= objectLoop %>\n' + - ' <% if (!hasDontEnumBug) { %>}\n<% } %>' + - ' }' + - - // else using a for-in loop - ' <% } else { %>\n' + - ' for (index in iteratee) {<%' + - ' if (!hasDontEnumBug || useHas) { %>\n if (<%' + - ' if (!hasDontEnumBug) { %>!(skipProto && index == \'prototype\')<% }' + - ' if (!hasDontEnumBug && useHas) { %> && <% }' + - ' if (useHas) { %>hasOwnProperty.call(iteratee, index)<% }' + - ' %>) {' + - ' <% } %>\n' + - ' value = iteratee[index];\n' + - ' <%= objectLoop %>;' + - ' <% if (!hasDontEnumBug || useHas) { %>\n }<% } %>\n' + - ' }' + - ' <% } %>' + - - // Because IE < 9 can't set the `[[Enumerable]]` attribute of an - // existing property and the `constructor` property of a prototype - // defaults to non-enumerable, Lo-Dash skips the `constructor` - // property when it infers it's iterating over a `prototype` object. - ' <% if (hasDontEnumBug) { %>\n\n' + - ' var ctor = iteratee.constructor;\n' + - ' <% for (var k = 0; k < 7; k++) { %>\n' + - ' index = \'<%= shadowed[k] %>\';\n' + - ' if (<%' + - ' if (shadowed[k] == \'constructor\') {' + - ' %>!(ctor && ctor.prototype === iteratee) && <%' + - ' } %>hasOwnProperty.call(iteratee, index)) {\n' + - ' value = iteratee[index];\n' + - ' <%= objectLoop %>\n' + - ' }' + - ' <% } %>' + - ' <% } %>' + - ' <% if (arrayLoop || noArgsEnum) { %>\n}<% } %>\n' + - - // add code to the bottom of the iteration function - '<%= bottom %>;\n' + - // finally, return the `result` - 'return result' - ); - - /** - * Reusable iterator options shared by `forEach`, `forIn`, and `forOwn`. - */ - var forEachIteratorOptions = { - 'args': 'collection, callback, thisArg', - 'top': 'callback = createCallback(callback, thisArg)', - 'arrayLoop': 'if (callback(value, index, collection) === false) return result', - 'objectLoop': 'if (callback(value, index, collection) === false) return result' - }; - - /** Reusable iterator options for `defaults`, and `extend` */ - var extendIteratorOptions = { - 'useHas': false, - 'args': 'object', - 'top': - 'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' + - ' if (iteratee = arguments[argsIndex]) {', - 'objectLoop': 'result[index] = value', - 'bottom': ' }\n}' - }; - - /** Reusable iterator options for `forIn` and `forOwn` */ - var forOwnIteratorOptions = { - 'arrayLoop': null - }; - - /*--------------------------------------------------------------------------*/ - - /** - * 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 || a === undefined) { - return 1; - } - if (a < b || 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 `partailArgs` 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. - * @returns {Function} Returns the new bound function. - */ - function createBound(func, thisArg, partialArgs) { - var isFunc = isFunction(func), - isPartial = !partialArgs, - methodName = func; - - // juggle arguments - if (isPartial) { - partialArgs = thisArg; - } - - function bound() { - // `Function#bind` spec - // http://es5.github.com/#x15.3.4.5 - var args = arguments, - thisBinding = isPartial ? this : thisArg; - - if (!isFunc) { - func = thisArg[methodName]; - } - if (partialArgs.length) { - args = args.length - ? partialArgs.concat(slice.call(args)) - : partialArgs; - } - if (this instanceof bound) { - // get `func` instance if `bound` is invoked in a `new` expression - noop.prototype = func.prototype; - thisBinding = new noop; - - // 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 an iteration callback bound to an optional `thisArg`. If `func` is - * a property name, the callback will return the property value for a given element. - * - * @private - * @param {Function|String} [func=identity|property] The function called per - * iteration or property name to query. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Function} Returns a callback function. - */ - function createCallback(func, thisArg) { - if (!func) { - return identity; - } - if (typeof func != 'function') { - return function(object) { - return object[func]; - }; - } - if (thisArg !== undefined) { - 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). - * 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. - * arrayLoop - A string of code to execute in the array loop. - * objectLoop - 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 = { - 'arrayLoop': '', - 'bottom': '', - 'hasDontEnumBug': hasDontEnumBug, - 'isKeysFast': isKeysFast, - 'objectLoop': '', - 'noArgsEnum': noArgsEnum, - 'noCharByIndex': noCharByIndex, - 'shadowed': shadowed, - '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, isString, objectTypes, ' + - 'nativeKeys, propertyIsEnumerable', - 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' - ); - // return the compiled function - return factory( - createCallback, hasOwnProperty, isArguments, isString, objectTypes, - nativeKeys, propertyIsEnumerable - ); - } - - /** - * 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]; - } - - /** - * A no-operation function. - * - * @private - */ - function noop() { - // no operation performed - } - - /** - * 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 _ - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} callback 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(forEachIteratorOptions, forOwnIteratorOptions, { - 'useHas': false - }); - - /** - * Iterates over `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 _ - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} callback 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(forEachIteratorOptions, forOwnIteratorOptions); - - /** - * 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; - } - // IE < 9 presents DOM nodes as `Object` objects except they have `toString` - // methods that are `typeof` "string" and still can coerce nodes to strings. - // Also check that the constructor is `Object` (i.e. `Object instanceof Object`) - var ctor = value.constructor; - if ((!noNodeClass || !(typeof value.toString != 'function' && typeof (value + '') == 'string')) && - (!isFunction(ctor) || 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); - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a clone of `value`. If `deep` is `true`, all nested objects will - * also be cloned otherwise they will be assigned by reference. Functions, DOM - * nodes, `arguments` objects, and objects created by constructors other than - * `Object` are **not** cloned. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to clone. - * @param {Boolean} deep A flag to indicate a deep clone. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `deep`. - * @param- {Array} [stackA=[]] Internally used to track traversed source objects. - * @param- {Array} [stackB=[]] Internally used to associate clones with their - * source counterparts. - * @returns {Mixed} Returns the cloned `value`. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 }, - * { 'name': 'curly', 'age': 60 } - * ]; - * - * _.clone({ 'name': 'moe' }); - * // => { 'name': 'moe' } - * - * var shallow = _.clone(stooges); - * shallow[0] === stooges[0]; - * // => true - * - * var deep = _.clone(stooges, true); - * shallow[0] === stooges[0]; - * // => false - */ - function clone(value, deep, guard, stackA, stackB) { - if (value == null) { - return value; - } - if (guard) { - deep = false; - } - // inspect [[Class]] - var isObj = isObject(value); - if (isObj) { - // don't clone `arguments` objects, functions, or non-object Objects - var className = toString.call(value); - if (!cloneableClasses[className] || (noArgsClass && isArguments(value))) { - return value; - } - var isArr = className == arrayClass; - isObj = isArr || (className == objectClass ? isPlainObject(value) : isObj); - } - // shallow clone - if (!isObj || !deep) { - // don't clone functions - return isObj - ? (isArr ? slice.call(value) : extend({}, value)) - : value; - } - - var ctor = value.constructor; - switch (className) { - case boolClass: - case dateClass: - return new ctor(+value); - - case numberClass: - case stringClass: - return new ctor(value); - - case regexpClass: - return ctor(value.source, reFlags.exec(value)); - } - // 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 - var result = isArr ? ctor(value.length) : {}; - - // 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)(value, function(objValue, key) { - result[key] = clone(objValue, deep, null, stackA, stackB); - }); - - return result; - } - - /** - * Assigns enumerable properties of the default object(s) to the `destination` - * object for all `destination` properties that resolve to `null`/`undefined`. - * Once a property is set, additional defaults of the same property will be - * ignored. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [default1, default2, ...] The default objects. - * @returns {Object} Returns the destination object. - * @example - * - * var iceCream = { 'flavor': 'chocolate' }; - * _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' }); - * // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' } - */ - var defaults = createIterator(extendIteratorOptions, { - 'objectLoop': 'if (result[index] == null) ' + extendIteratorOptions.objectLoop - }); - - /** - * Assigns enumerable properties of the source object(s) to the `destination` - * object. Subsequent sources will overwrite propery assignments of previous - * sources. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [source1, source2, ...] The source objects. - * @returns {Object} Returns the destination object. - * @example - * - * _.extend({ 'name': 'moe' }, { 'age': 40 }); - * // => { 'name': 'moe', 'age': 40 } - */ - var extend = createIterator(extendIteratorOptions); - - /** - * 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', 'third': 'Curly' }); - * // => { 'Moe': 'first', 'Larry': 'second', 'Curly': 'third' } (order is not guaranteed) - */ - function invert(object) { - var result = {}; - forOwn(object, function(value, key) { - result[value] = key; - }); - return result; - } - - /** - * 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) { - return toString.call(value) == arrayClass; - }; - - /** - * Checks if `value` is a boolean (`true` or `false`) 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 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. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} a The value to compare. - * @param {Mixed} b The other value to compare. - * @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', 'luckyNumbers': [13, 27, 34] }; - * var clone = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; - * - * moe == clone; - * // => false - * - * _.isEqual(moe, clone); - * // => true - */ - function isEqual(a, b, stackA, stackB) { - // exit early for identical values - if (a === b) { - // treat `+0` vs. `-0` as not equal - return a !== 0 || (1 / a == 1 / b); - } - // a strict comparison is necessary because `null == undefined` - if (a == null || b == null) { - return a === b; - } - // compare [[Class]] names - var className = toString.call(a); - if (className != toString.call(b)) { - 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 + ''; - } - // exit early, in older browsers, if `a` is array-like but not `b` - var isArr = className == arrayClass || className == argsClass; - if (noArgsClass && !isArr && (isArr = isArguments(a)) && !isArguments(b)) { - return false; - } - if (!isArr) { - // unwrap any `lodash` wrapped values - if (a.__wrapped__ || b.__wrapped__) { - return isEqual(a.__wrapped__ || a, b.__wrapped__ || b); - } - // exit for functions and DOM nodes - if (className != objectClass || (noNodeClass && ( - (typeof a.toString != 'function' && typeof (a + '') == 'string') || - (typeof b.toString != 'function' && typeof (b + '') == 'string')))) { - return false; - } - var ctorA = a.constructor, - ctorB = 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 index = -1, - result = true, - size = 0; - - // 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 - size = a.length; - result = size == b.length; - - if (result) { - // deep compare the contents, ignoring non-numeric properties - while (size--) { - if (!(result = isEqual(a[size], b[size], stackA, stackB))) { - break; - } - } - } - return result; - } - // deep compare objects - for (var key in a) { - if (hasOwnProperty.call(a, key)) { - // count the number of properties. - size++; - // deep compare each property value. - if (!(hasOwnProperty.call(b, key) && isEqual(a[key], b[key], stackA, stackB))) { - return false; - } - } - } - // ensure both objects have the same number of properties - for (key in b) { - // The JS engine in Adobe products, like InDesign, has a bug that causes - // `!size--` to throw an error so it must be wrapped in parentheses. - // https://github.com/documentcloud/underscore/issues/355 - if (hasOwnProperty.call(b, key) && !(size--)) { - // `size` will be `-1` if `b` has more properties than `a` - return false; - } - } - // handle JScript [[DontEnum]] bug - if (hasDontEnumBug) { - while (++index < 7) { - key = shadowed[index]; - if (hasOwnProperty.call(a, key) && - !(hasOwnProperty.call(b, key) && isEqual(a[key], b[key], stackA, stackB))) { - return false; - } - } - } - return true; - } - - /** - * 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. - * - * @deprecated - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a finite number, 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 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. - * - * @deprecated - * @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 toString.call(value) == numberClass && value != +value - } - - /** - * Checks if `value` is `null`. - * - * @deprecated - * @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 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 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 toString.call(value) == stringClass; - } - - /** - * Checks if `value` is `undefined`. - * - * @deprecated - * @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 value === undefined; - } - - /** - * 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) { - // avoid iterating over the `prototype` property - return typeof object == 'function' && propertyIsEnumerable.call(object, 'prototype') - ? shimKeys(object) - : (isObject(object) ? nativeKeys(object) : []); - }; - - /** - * Merges enumerable properties of the source object(s) into the `destination` - * object. Subsequent sources will overwrite propery assignments of previous - * sources. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [source1, source2, ...] The source objects. - * @param- {Object} [indicator] Internally used to indicate that the `stack` - * argument is an array of traversed objects instead of another source object. - * @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 stooges = [ - * { 'name': 'moe' }, - * { 'name': 'larry' } - * ]; - * - * var ages = [ - * { 'age': 40 }, - * { 'age': 50 } - * ]; - * - * _.merge(stooges, ages); - * // => [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] - */ - function merge(object, source, indicator) { - var args = arguments, - index = 0, - length = 2, - stackA = args[3], - stackB = args[4]; - - if (indicator !== objectRef) { - stackA = []; - stackB = []; - length = args.length; - } - while (++index < length) { - forOwn(args[index], function(source, key) { - var found, isArr, value; - if (source && ((isArr = isArray(source)) || isPlainObject(source))) { - // avoid merging previously merged cyclic sources - var stackLength = stackA.length; - while (stackLength--) { - found = stackA[stackLength] == source; - if (found) { - break; - } - } - if (found) { - object[key] = stackB[stackLength]; - } - else { - // add `source` and associated `value` to the stack of traversed objects - stackA.push(source); - stackB.push(value = (value = object[key], isArr) - ? (isArray(value) ? value : []) - : (isPlainObject(value) ? value : {}) - ); - // recursively merge objects and arrays (susceptible to call stack limits) - object[key] = merge(value, source, objectRef, stackA, stackB); - } - } else if (source != null) { - object[key] = source; - } - }); - } - 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 `callback` 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, 'userid': 'moe1' }, 'userid'); - * // => { 'name': 'moe', 'age': 40 } - * - * _.omit({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { - * return key.charAt(0) == '_'; - * }); - * // => { '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, 'curly': 50 }); - * // => [['moe', 30], ['larry', 40], ['curly', 50]] (order is not guaranteed) - */ - function pairs(object) { - var result = []; - forOwn(object, function(value, key) { - result.push([key, value]); - }); - 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 {Function|String} callback|[prop1, prop2, ...] The properties to pick - * or the function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns an object composed of the picked properties. - * @example - * - * _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age'); - * // => { 'name': 'moe', 'age': 40 } - * - * _.pick({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, 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 = props.length; - - 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 result = []; - forOwn(object, function(value) { - result.push(value); - }); - 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; - - fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; - if (typeof length == 'number') { - return (isString(collection) - ? collection.indexOf(target, fromIndex) - : indexOf(collection, target, fromIndex) - ) > -1; - } - return some(collection, function(value) { - return ++index >= fromIndex && value === target; - }); - } - - /** - * Creates an object composed of keys returned from running each element of - * `collection` through a `callback`. The corresponding value of each key is - * the number of times the key was returned by `callback`. The `callback` is - * bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * The `callback` argument may also be the name of a property to count by (e.g. 'length'). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|String} callback|property The function called per iteration - * or property name to count by. - * @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). - * - * @static - * @memberOf _ - * @alias all - * @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 {Boolean} Returns `true` if all elements pass the callback check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => 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 { - forEach(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). - * - * @static - * @memberOf _ - * @alias select - * @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} 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] - */ - function filter(collection, callback, thisArg) { - var result = []; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, index, collection) { - if (callback(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * Examines each element in a `collection`, returning the first one the `callback` - * returns truthy for. The function returns as soon as it finds an acceptable - * element, and does not iterate over the entire `collection`. The `callback` is - * bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * - * @static - * @memberOf _ - * @alias detect - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} callback The function called per iteration. - * @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 - */ - 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 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 (order is not guaranteed) - */ - var forEach = createIterator(forEachIteratorOptions); - - /** - * Creates an object composed of keys returned from running each element of - * `collection` through a `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). - * The `callback` argument may also be the name of a property to group by (e.g. 'length'). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|String} callback|property The function called per iteration - * or property name to group by. - * @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] } - * - * _.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.call(arguments, 2), - isFunc = typeof methodName == 'function', - result = []; - - forEach(collection, function(value) { - result.push((isFunc ? methodName : value[methodName]).apply(value, args)); - }); - return result; - } - - /** - * Creates an array of values by running each element in the `collection` - * through a `callback`. The `callback` is bound to `thisArg` and invoked with - * three arguments; (value, index|key, collection). - * - * @static - * @memberOf _ - * @alias collect - * @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} 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) - */ - 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 { - forEach(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). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the maximum value. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 }, - * { 'name': 'curly', 'age': 60 } - * ]; - * - * _.max(stooges, function(stooge) { return stooge.age; }); - * // => { 'name': 'curly', 'age': 60 }; - */ - function max(collection, callback, thisArg) { - var computed = -Infinity, - index = -1, - length = collection ? collection.length : 0, - result = computed; - - if (callback || !isArray(collection)) { - callback = !callback && isString(collection) - ? charAtCallback - : createCallback(callback, thisArg); - - forEach(collection, function(value, index, collection) { - var current = callback(value, index, collection); - if (current > computed) { - computed = current; - result = value; - } - }); - } else { - while (++index < length) { - if (collection[index] > result) { - result = collection[index]; - } - } - } - 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). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the minimum value. - * @example - * - * _.min([10, 5, 100, 2, 1000]); - * // => 2 - */ - function min(collection, callback, thisArg) { - var computed = Infinity, - index = -1, - length = collection ? collection.length : 0, - result = computed; - - if (callback || !isArray(collection)) { - callback = !callback && isString(collection) - ? charAtCallback - : createCallback(callback, thisArg); - - forEach(collection, function(value, index, collection) { - var current = callback(value, index, collection); - if (current < computed) { - computed = current; - result = value; - } - }); - } else { - while (++index < length) { - if (collection[index] < result) { - result = collection[index]; - } - } - } - return result; - } - - /** - * Retrieves the value of a specified property from all elements in - * the `collection`. - * - * @static - * @memberOf _ - * @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 }, - * { 'name': 'curly', 'age': 60 } - * ]; - * - * _.pluck(stooges, 'name'); - * // => ['moe', 'larry', 'curly'] - */ - function pluck(collection, property) { - var result = []; - forEach(collection, function(value) { - result.push(value[property]); - }); - return result; - } - - /** - * Boils down a `collection` to a single value. The initial state of the - * reduction is `accumulator` and each successive step of it should be returned - * by the `callback`. The `callback` is bound to `thisArg` and invoked with 4 - * arguments; for arrays they are (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 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(memo, num) { return memo + num; }); - * // => 6 - */ - function reduce(collection, callback, accumulator, thisArg) { - var noaccum = arguments.length < 3; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, index, collection) { - accumulator = noaccum - ? (noaccum = false, value) - : callback(accumulator, value, index, collection) - }); - return accumulator; - } - - /** - * The right-associative version of `_.reduce`. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} callback 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 iteratee = 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)) { - iteratee = collection.split(''); - } - forEach(collection, function(value, index, collection) { - index = props ? props[--length] : --length; - accumulator = noaccum - ? (noaccum = false, iteratee[index]) - : callback.call(thisArg, accumulator, iteratee[index], index, collection); - }); - return accumulator; - } - - /** - * The opposite of `_.filter`, this method returns the values of a - * `collection` that `callback` does **not** return truthy for. - * - * @static - * @memberOf _ - * @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} 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] - */ - 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, - result = Array(collection ? collection.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). - * - * @static - * @memberOf _ - * @alias any - * @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 {Boolean} Returns `true` if any element passes the callback check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false]); - * // => true - */ - 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 { - forEach(collection, function(value, index, collection) { - return !(result = callback(value, index, collection)); - }); - } - return !!result; - } - - /** - * Creates an array, stable sorted in ascending order by the results of - * running each element of `collection` through a `callback`. The `callback` - * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * The `callback` argument may also be the name of a property to sort by (e.g. 'length'). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|String} callback|property The function called per iteration - * or property name to sort by. - * @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] - * - * _.sortBy(['larry', 'brendan', 'moe'], 'length'); - * // => ['moe', 'larry', 'brendan'] - */ - function sortBy(collection, callback, thisArg) { - var result = []; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, index, collection) { - result.push({ - 'criteria': callback(value, index, collection), - 'index': index, - 'value': value - }); - }); - - var 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 (noArraySliceOnStrings ? isString(collection) : typeof collection == 'string') - ? collection.split('') - : slice.call(collection); - } - return values(collection); - } - - /** - * Examines each element in a `collection`, returning an array of all elements - * that contain the given `properties`. - * - * @static - * @memberOf _ - * @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 contain the given `properties`. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 }, - * { 'name': 'curly', 'age': 60 } - * ]; - * - * _.where(stooges, { 'age': 40 }); - * // => [{ 'name': 'moe', 'age': 40 }] - */ - function where(collection, properties) { - var props = []; - forIn(properties, function(value, prop) { - props.push(prop); - }); - return filter(collection, function(object) { - var length = props.length; - while (length--) { - var result = object[props[length]] === properties[props[length]]; - if (!result) { - break; - } - } - return !!result; - }); - } - - /*--------------------------------------------------------------------------*/ - - /** - * 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`. Pass `n` to return the first `n` - * elements of the `array`. - * - * @static - * @memberOf _ - * @alias head, take - * @category Arrays - * @param {Array} array The array to query. - * @param {Number} [n] The number of elements to return. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `n`. - * @returns {Mixed} Returns the first element or an array of the first `n` - * elements of `array`. - * @example - * - * _.first([5, 4, 3, 2, 1]); - * // => 5 - */ - function first(array, n, guard) { - if (array) { - return (n == null || guard) ? array[0] : slice.call(array, 0, n); - } - } - - /** - * 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`. Pass `n` to exclude the last `n` - * elements from the result. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to query. - * @param {Number} [n=1] The number of elements to exclude. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `n`. - * @returns {Array} Returns all but the last element or `n` elements of `array`. - * @example - * - * _.initial([3, 2, 1]); - * // => [3, 2] - */ - function initial(array, n, guard) { - return array - ? slice.call(array, 0, -((n == null || guard) ? 1 : n)) - : []; - } - - /** - * 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, in order, 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 = {}, - result = []; - - forEach(array, function(value) { - if (indexOf(result, value) < 0) { - var length = argsLength; - while (--length) { - if (!(cache[length] || (cache[length] = cachedContains(args[length])))(value)) { - return; - } - } - result.push(value); - } - }); - return result; - } - - /** - * Gets the last element of the `array`. Pass `n` to return the last `n` - * elements of the `array`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to query. - * @param {Number} [n] The number of elements to return. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `n`. - * @returns {Mixed} Returns the last element or an array of the last `n` - * elements of `array`. - * @example - * - * _.last([3, 2, 1]); - * // => 1 - */ - function last(array, n, guard) { - if (array) { - var length = array.length; - return (n == null || guard) ? array[length - 1] : slice.call(array, -n || length); - } - } - - /** - * 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', 'curly'], [30, 40, 50]); - * // => { 'moe': 30, 'larry': 40, 'curly': 50 } - */ - 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 `stop`. This method is a port of Python's - * `range()` function. See http://docs.python.org/library/functions.html#range. - * - * @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://www.youtube.com/watch?v=XAqIpGU8ZZk#t=16m27s - 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`. Pass `n` to exclude the first `n` values from the result. - * - * @static - * @memberOf _ - * @alias drop, tail - * @category Arrays - * @param {Array} array The array to query. - * @param {Number} [n=1] The number of elements to exclude. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `n`. - * @returns {Array} Returns all but the first value or `n` values of `array`. - * @example - * - * _.rest([3, 2, 1]); - * // => [2, 1] - */ - function rest(array, n, guard) { - return array - ? slice.call(array, (n == null || guard) ? 1 : 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). The `callback` - * argument may also be the name of a property to order by. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to iterate over. - * @param {Mixed} value The value to evaluate. - * @param {Function|String} [callback=identity|property] The function called - * per iteration or property name to order by. - * @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 - * - * _.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 engine inlining - callback = callback ? createCallback(callback, thisArg) : 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). - * - * @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} [callback=identity] The function called per iteration. - * @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] - */ - 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 > 74; - 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) { - // manually coerce `computed` to a string because `hasOwnProperty`, in - // some older versions of Firefox, coerces objects incorrectly - seen = hasOwnProperty.call(cache, computed + '') ? cache[computed] : (cache[computed] = []); - } - if (isSorted - ? !index || seen[seen.length - 1] !== computed - : 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, 20), - 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', 'curly'], [30, 40, 50], [true, false, false]); - * // => [['moe', 30, true], ['larry', 40, false], ['curly', 50, 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.call(arguments, 2)); - } - - /** - * Binds methods on `object` to `object`, overwriting the existing method. - * 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 buttonView = { - * 'label': 'lodash', - * 'onClick': function() { alert('clicked: ' + this.label); } - * }; - * - * _.bindAll(buttonView); - * jQuery('#lodash_button').on('click', buttonView.onClick); - * // => When the button is clicked, `this.label` will have the correct value - */ - function bindAll(object) { - var funcs = 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 is the composition of the passed 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()))`. - * 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.call(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.call(arguments, 1); - return setTimeout(function() { func.apply(undefined, args); }, 1); - } - - /** - * Creates a function that, when called, invokes `object[methodName]` and - * prepends any additional `lateBind` 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. - * - * @static - * @memberOf _ - * @category Functions - * @param {Object} object The object the method belongs to. - * @param {String} methodName The method name. - * @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 = _.lateBind(object, 'greet', 'hi'); - * func(); - * // => 'hi moe' - * - * object.greet = function(greeting) { - * return greeting + ', ' + this.name + '!'; - * }; - * - * func(); - * // => 'hi, moe!' - */ - function lateBind(object, methodName) { - return createBound(methodName, object, slice.call(arguments, 2)); - } - - /** - * 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(); - * // Application is only created once. - */ - function once(func) { - var result, - ran = false; - - 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.call(arguments, 1)); - } - - /** - * 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); - 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. - * - * Note: It is used throughout Lo-Dash as a default callback. - * - * @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('larry'); - * // => 'Larry' - * - * _('curly').capitalize(); - * // => 'Curly' - */ - 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); - - var result = func.apply(lodash, args); - if (this.__chain__) { - result = new lodash(result); - result.__chain__ = true; - } - 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() { - 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 1 and 5 - * - * _.random(5); - * // => also a number between 1 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. - * - * @deprecated - * @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) { - // based on Backbone's private `getValue` function - // https://github.com/documentcloud/backbone/blob/0.9.2/backbone.js#L1419-1424 - var value = object ? object[property] : null; - 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 avoiding `_.template` use, or loading Lo-Dash in a sandboxed page. - * See http://developer.chrome.com/trunk/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', 'curly'] }); - * // => '
                          3. moe
                          4. larry
                          5. curly
                          6. ' - * - * // 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\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\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## Resolved Underscore.js issues\n\n * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L545-551)]\n * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L558-582)]\n * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L140-146)]\n * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L747-752)]\n * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L828-840)]\n * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L921-923)]\n * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v0.9.2/test/test.js#L1337-1340)]\n\n## Release Notes\n\n### v0.9.2\n\n * Added `fromIndex` argument to `_.contains`\n * Added `moduleId` build option\n * Added Closure Compiler *“simple”* optimizations to the build process\n * Added support for strings in `_.max` and `_.min`\n * Added support for ES6 template delimiters to `_.template`\n * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs\n * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq`\n\nThe full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n* [John-David Dalton](http://allyoucanleet.com/)\n [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\")\n\n## Contributors\n\n* [Kit Cambridge](http://kitcambridge.github.com/)\n [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\")\n* [Mathias Bynens](http://mathiasbynens.be/)\n [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\")\n", - "readmeFilename": "README.md", - "_id": "lodash@0.9.2", - "_from": "lodash@~0.9.0" -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/LICENCE b/node_modules/grunt/node_modules/lodash/vendor/tar/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt/node_modules/lodash/vendor/tar/README.md b/node_modules/grunt/node_modules/lodash/vendor/tar/README.md deleted file mode 100644 index 7cfe3bb..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# node-tar - -Tar for Node.js. - -## Goals of this project - -1. Be able to parse and reasonably extract the contents of any tar file - created by any program that creates tar files, period. - - At least, this includes every version of: - - * bsdtar - * gnutar - * solaris posix tar - * Joerg Schilling's star ("Schilly tar") - -2. Create tar files that can be extracted by any of the following tar - programs: - - * bsdtar/libarchive version 2.6.2 - * gnutar 1.15 and above - * SunOS Posix tar - * Joerg Schilling's star ("Schilly tar") - -3. 100% test coverage. Speed is important. Correctness is slightly - more important. - -4. Create the kind of tar interface that Node users would want to use. - -5. Satisfy npm's needs for a portable tar implementation with a - JavaScript interface. - -6. No excuses. No complaining. No tolerance for failure. - -## But isn't there already a tar.js? - -Yes, there are a few. This one is going to be better, and it will be -fanatically maintained, because npm will depend on it. - -That's why I need to write it from scratch. Creating and extracting -tarballs is such a large part of what npm does, I simply can't have it -be a black box any longer. - -## Didn't you have something already? Where'd it go? - -It's in the "old" folder. It's not functional. Don't use it. - -It was a useful exploration to learn the issues involved, but like most -software of any reasonable complexity, node-tar won't be useful until -it's been written at least 3 times. diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/buffer-entry.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/buffer-entry.js deleted file mode 100644 index c7b5a6e..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/buffer-entry.js +++ /dev/null @@ -1,30 +0,0 @@ -// just like the Entry class, but it buffers the contents -// -// XXX It would be good to set a maximum BufferEntry filesize, -// since it eats up memory. In normal operation, -// these are only for long filenames or link names, which are -// rarely very big. - -module.exports = BufferEntry - -var inherits = require("../vendor/inherits/inherits.js") - , Entry = require("./entry.js") - -function BufferEntry () { - Entry.apply(this, arguments) - this._buffer = new Buffer(this.props.size) - this._offset = 0 - this.body = "" - this.on("end", function () { - this.body = this._buffer.toString().slice(0, -1) - }) -} - -// collect the bytes as they come in. -BufferEntry.prototype.write = function (c) { - c.copy(this._buffer, this._offset) - this._offset += c.length - Entry.prototype.write.call(this, c) -} - -inherits(BufferEntry, Entry) diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/entry-writer.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/entry-writer.js deleted file mode 100644 index 9d6a9b7..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/entry-writer.js +++ /dev/null @@ -1,169 +0,0 @@ -module.exports = EntryWriter - -var tar = require("../tar.js") - , TarHeader = require("./header.js") - , Entry = require("./entry.js") - , inherits = require("../vendor/inherits/inherits.js") - , BlockStream = require("../vendor/block-stream/block-stream.js") - , ExtendedHeaderWriter - , Stream = require("stream").Stream - , EOF = {} - -inherits(EntryWriter, Stream) - -function EntryWriter (props) { - var me = this - - if (!(me instanceof EntryWriter)) { - return new EntryWriter(props) - } - - Stream.apply(this) - - me.writable = true - me.readable = true - - me._stream = new BlockStream(512) - - me._stream.on("data", function (c) { - me.emit("data", c) - }) - - me._stream.on("drain", function () { - me.emit("drain") - }) - - me._stream.on("end", function () { - me.emit("end") - me.emit("close") - }) - - me.props = props - if (props.type === "Directory") { - props.size = 0 - } - props.ustar = "ustar\0" - props.ustarver = "00" - me.path = props.path - - me._buffer = [] - me._didHeader = false - me._meta = false - - me.on("pipe", function () { - me._process() - }) -} - -EntryWriter.prototype.write = function (c) { - // console.error(".. ew write") - if (this._ended) return this.emit("error", new Error("write after end")) - this._buffer.push(c) - this._process() - this._needDrain = this._buffer.length > 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/node_modules/grunt/node_modules/lodash/vendor/tar/lib/entry.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/entry.js deleted file mode 100644 index 6221ffd..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/entry.js +++ /dev/null @@ -1,212 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , fstream = require("../vendor/fstream/fstream.js").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, -{ 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 - } - -, end: function (c) { - if (c) this.write(c) - this._ending = true - this._read() - } - -, pause: function () { - this._paused = true - this.emit("pause") - } - -, 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 -, _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 - } - -, _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 - } -, warn: fstream.warn -, error: fstream.error -}) diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extended-header-writer.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extended-header-writer.js deleted file mode 100644 index 10a7d8f..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extended-header-writer.js +++ /dev/null @@ -1,192 +0,0 @@ - -module.exports = ExtendedHeaderWriter - -var inherits = require("../vendor/inherits/inherits.js") - , EntryWriter = require("./entry-writer.js") - -inherits(ExtendedHeaderWriter, EntryWriter) - -var tar = require("../tar.js") - , path = require("path") - , inherits = require("../vendor/inherits/inherits.js") - , 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/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extended-header.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extended-header.js deleted file mode 100644 index 63b79ec..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extended-header.js +++ /dev/null @@ -1,139 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , 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, { _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/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extract.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extract.js deleted file mode 100644 index bffc033..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/extract.js +++ /dev/null @@ -1,78 +0,0 @@ -// give it a tarball and a path, and it'll dump the contents - -module.exports = Extract - -var tar = require("../tar.js") - , fstream = require("../vendor/fstream/fstream.js") - , inherits = require("../vendor/inherits/inherits.js") - , 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/node_modules/grunt/node_modules/lodash/vendor/tar/lib/global-header-writer.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/global-header-writer.js deleted file mode 100644 index 99ff257..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/global-header-writer.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = GlobalHeaderWriter - -var ExtendedHeaderWriter = require("./extended-header-writer.js") - , inherits = require("../vendor/inherits/inherits.js") - -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/node_modules/grunt/node_modules/lodash/vendor/tar/lib/header.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/header.js deleted file mode 100644 index 05b237c..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/header.js +++ /dev/null @@ -1,385 +0,0 @@ -// 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/node_modules/grunt/node_modules/lodash/vendor/tar/lib/pack.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/pack.js deleted file mode 100644 index c436ec1..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/pack.js +++ /dev/null @@ -1,231 +0,0 @@ -// 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("../vendor/inherits/inherits.js") - , GlobalHeaderWriter = require("./global-header-writer.js") - , collect = require("../vendor/fstream/fstream.js").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/node_modules/grunt/node_modules/lodash/vendor/tar/lib/parse.js b/node_modules/grunt/node_modules/lodash/vendor/tar/lib/parse.js deleted file mode 100644 index 3f71a92..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/lib/parse.js +++ /dev/null @@ -1,270 +0,0 @@ - -// 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("../vendor/block-stream/block-stream.js") - , 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("../vendor/inherits/inherits.js") - , fstream = require("../vendor/fstream/fstream.js") - -// 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/node_modules/grunt/node_modules/lodash/vendor/tar/tar.js b/node_modules/grunt/node_modules/lodash/vendor/tar/tar.js deleted file mode 100644 index a81298b..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/tar.js +++ /dev/null @@ -1,173 +0,0 @@ -// 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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE deleted file mode 100644 index 74489e2..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/README.md b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/README.md deleted file mode 100644 index c16e9c4..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js deleted file mode 100644 index af63e5f..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/block-stream/block-stream.js +++ /dev/null @@ -1,209 +0,0 @@ -// 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/inherits.js") - , 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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/LICENSE b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/README.md b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/README.md deleted file mode 100644 index 9d8cb77..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Like FS streams, but with stat on them, and supporting directories and -symbolic links, as well as normal files. Also, you can use this to set -the stats on a file, even if you don't change its contents, or to create -a symlink, etc. - -So, for example, you can "write" a directory, and it'll call `mkdir`. You -can specify a uid and gid, and it'll call `chown`. You can specify a -`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink -and provide a `linkpath` and it'll call `symlink`. - -Note that it won't automatically resolve symbolic links. So, if you -call `fstream.Reader('/some/symlink')` then you'll get an object -that stats and then ends immediately (since it has no data). To follow -symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: -true })`. - -There are various checks to make sure that the bytes emitted are the -same as the intended size, if the size is set. - -## Examples - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - }) - .write("hello\n") - .end() -``` - -This will create the directories if they're missing, and then write -`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have -been written when it's done. - -```javascript -fstream - .Writer({ path: "path/to/file" - , mode: 0755 - , size: 6 - , flags: "a" - }) - .write("hello\n") - .end() -``` - -You can pass flags in, if you want to append to a file. - -```javascript -fstream - .Writer({ path: "path/to/symlink" - , linkpath: "./file" - , SymbolicLink: true - , mode: "0755" // octal strings supported - }) - .end() -``` - -If isSymbolicLink is a function, it'll be called, and if it returns -true, then it'll treat it as a symlink. If it's not a function, then -any truish value will make a symlink, or you can set `type: -'SymbolicLink'`, which does the same thing. - -Note that the linkpath is relative to the symbolic link location, not -the parent dir or cwd. - -```javascript -fstream - .Reader("path/to/dir") - .pipe(fstream.Writer("path/to/other/dir")) -``` - -This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other -dir exists and isn't a directory, then it'll emit an error. It'll also -set the uid, gid, mode, etc. to be identical. In this way, it's more -like `rsync -a` than simply a copy. diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js deleted file mode 100644 index c66d26f..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/fstream.js +++ /dev/null @@ -1,31 +0,0 @@ -exports.Abstract = require("./lib/abstract.js") -exports.Reader = require("./lib/reader.js") -exports.Writer = require("./lib/writer.js") - -exports.File = - { Reader: require("./lib/file-reader.js") - , Writer: require("./lib/file-writer.js") } - -exports.Dir = - { Reader : require("./lib/dir-reader.js") - , Writer : require("./lib/dir-writer.js") } - -exports.Link = - { Reader : require("./lib/link-reader.js") - , Writer : require("./lib/link-writer.js") } - -exports.Proxy = - { Reader : require("./lib/proxy-reader.js") - , Writer : require("./lib/proxy-writer.js") } - -exports.Reader.Dir = exports.DirReader = exports.Dir.Reader -exports.Reader.File = exports.FileReader = exports.File.Reader -exports.Reader.Link = exports.LinkReader = exports.Link.Reader -exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader - -exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer -exports.Writer.File = exports.FileWriter = exports.File.Writer -exports.Writer.Link = exports.LinkWriter = exports.Link.Writer -exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer - -exports.collect = require("./lib/collect.js") diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js deleted file mode 100644 index 6161f3b..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/abstract.js +++ /dev/null @@ -1,85 +0,0 @@ -// the parent class for all fstreams. - -module.exports = Abstract - -var Stream = require("stream").Stream - , inherits = require("../../inherits/inherits.js") - -function Abstract () { - Stream.call(this) -} - -inherits(Abstract, Stream) - -Abstract.prototype.on = function (ev, fn) { - if (ev === "ready" && this.ready) { - process.nextTick(fn.bind(this)) - } else { - Stream.prototype.on.call(this, ev, fn) - } - return this -} - -Abstract.prototype.abort = function () { - this._aborted = true - this.emit("abort") -} - -Abstract.prototype.destroy = function () {} - -Abstract.prototype.warn = function (msg, code) { - var me = this - , er = decorate(msg, code, me) - if (!me.listeners("warn")) { - console.error("%s %s\n" + - "path = %s\n" + - "syscall = %s\n" + - "fstream_type = %s\n" + - "fstream_path = %s\n" + - "fstream_unc_path = %s\n" + - "fstream_class = %s\n" + - "fstream_stack =\n%s\n", - code || "UNKNOWN", - er.stack, - er.path, - er.syscall, - er.fstream_type, - er.fstream_path, - er.fstream_unc_path, - er.fstream_class, - er.fstream_stack.join("\n")) - } else { - me.emit("warn", er) - } -} - -Abstract.prototype.info = function (msg, code) { - this.emit("info", msg, code) -} - -Abstract.prototype.error = function (msg, code, th) { - var er = decorate(msg, code, this) - if (th) throw er - else this.emit("error", er) -} - -function decorate (er, code, me) { - if (!(er instanceof Error)) er = new Error(er) - er.code = er.code || code - er.path = er.path || me.path - er.fstream_type = er.fstream_type || me.type - er.fstream_path = er.fstream_path || me.path - if (me._path !== me.path) { - er.fstream_unc_path = er.fstream_unc_path || me._path - } - if (me.linkpath) { - er.fstream_linkpath = er.fstream_linkpath || me.linkpath - } - er.fstream_class = er.fstream_class || me.constructor.name - er.fstream_stack = er.fstream_stack || - new Error().stack.split(/\n/).slice(3).map(function (s) { - return s.replace(/^ at /, "") - }) - - return er -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js deleted file mode 100644 index a36f780..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/collect.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = collect - -function collect (stream) { - if (stream._collected) return - - stream._collected = true - stream.pause() - - stream.on("data", save) - stream.on("end", save) - var buf = [] - function save (b) { - if (typeof b === "string") b = new Buffer(b) - if (Buffer.isBuffer(b) && !b.length) return - buf.push(b) - } - - stream.on("entry", saveEntry) - var entryBuffer = [] - function saveEntry (e) { - collect(e) - entryBuffer.push(e) - } - - stream.on("proxy", proxyPause) - function proxyPause (p) { - p.pause() - } - - - // replace the pipe method with a new version that will - // unlock the buffered stuff. if you just call .pipe() - // without a destination, then it'll re-play the events. - stream.pipe = (function (orig) { return function (dest) { - // console.error(" === open the pipes", dest && dest.path) - - // let the entries flow through one at a time. - // Once they're all done, then we can resume completely. - var e = 0 - ;(function unblockEntry () { - var entry = entryBuffer[e++] - // console.error(" ==== unblock entry", entry && entry.path) - if (!entry) return resume() - entry.on("end", unblockEntry) - if (dest) dest.add(entry) - else stream.emit("entry", entry) - })() - - function resume () { - stream.removeListener("entry", saveEntry) - stream.removeListener("data", save) - stream.removeListener("end", save) - - stream.pipe = orig - if (dest) stream.pipe(dest) - - buf.forEach(function (b) { - if (b) stream.emit("data", b) - else stream.emit("end") - }) - - stream.resume() - } - - return dest - }})(stream.pipe) -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js deleted file mode 100644 index e655b0d..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-reader.js +++ /dev/null @@ -1,250 +0,0 @@ -// A thing that emits "entry" events with Reader objects -// Pausing it causes it to stop emitting entry events, and also -// pauses the current entry if there is one. - -module.exports = DirReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , Reader = require("./reader.js") - , assert = require("assert").ok - -inherits(DirReader, Reader) - -function DirReader (props) { - var me = this - if (!(me instanceof DirReader)) throw new Error( - "DirReader must be called as constructor.") - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - throw new Error("Non-directory type "+ props.type) - } - - me.entries = null - me._index = -1 - me._paused = false - me._length = -1 - - if (props.sort) { - this.sort = props.sort - } - - Reader.call(this, props) -} - -DirReader.prototype._getEntries = function () { - var me = this - - // race condition. might pause() before calling _getEntries, - // and then resume, and try to get them a second time. - if (me._gotEntries) return - me._gotEntries = true - - fs.readdir(me._path, function (er, entries) { - if (er) return me.error(er) - - me.entries = entries - - me.emit("entries", entries) - if (me._paused) me.once("resume", processEntries) - else processEntries() - - function processEntries () { - me._length = me.entries.length - if (typeof me.sort === "function") { - me.entries = me.entries.sort(me.sort.bind(me)) - } - me._read() - } - }) -} - -// start walking the dir, and emit an "entry" event for each one. -DirReader.prototype._read = function () { - var me = this - - if (!me.entries) return me._getEntries() - - if (me._paused || me._currentEntry || me._aborted) { - // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted) - return - } - - me._index ++ - if (me._index >= me.entries.length) { - if (!me._ended) { - me._ended = true - me.emit("end") - me.emit("close") - } - return - } - - // ok, handle this one, then. - - // save creating a proxy, by stat'ing the thing now. - var p = path.resolve(me._path, me.entries[me._index]) - assert(p !== me._path) - assert(me.entries[me._index]) - - // set this to prevent trying to _read() again in the stat time. - me._currentEntry = p - fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) { - if (er) return me.error(er) - - var who = me._proxy || me - - stat.path = p - stat.basename = path.basename(p) - stat.dirname = path.dirname(p) - var childProps = me.getChildProps.call(who, stat) - childProps.path = p - childProps.basename = path.basename(p) - childProps.dirname = path.dirname(p) - - var entry = Reader(childProps, stat) - - // console.error("DR Entry", p, stat.size) - - me._currentEntry = entry - - // "entry" events are for direct entries in a specific dir. - // "child" events are for any and all children at all levels. - // This nomenclature is not completely final. - - entry.on("pause", function (who) { - if (!me._paused && !entry._disowned) { - me.pause(who) - } - }) - - entry.on("resume", function (who) { - if (me._paused && !entry._disowned) { - me.resume(who) - } - }) - - entry.on("stat", function (props) { - me.emit("_entryStat", entry, props) - if (entry._aborted) return - if (entry._paused) entry.once("resume", function () { - me.emit("entryStat", entry, props) - }) - else me.emit("entryStat", entry, props) - }) - - entry.on("ready", function EMITCHILD () { - // console.error("DR emit child", entry._path) - if (me._paused) { - // console.error(" DR emit child - try again later") - // pause the child, and emit the "entry" event once we drain. - // console.error("DR pausing child entry") - entry.pause(me) - return me.once("resume", EMITCHILD) - } - - // skip over sockets. they can't be piped around properly, - // so there's really no sense even acknowledging them. - // if someone really wants to see them, they can listen to - // the "socket" events. - if (entry.type === "Socket") { - me.emit("socket", entry) - } else { - me.emitEntry(entry) - } - }) - - var ended = false - entry.on("close", onend) - entry.on("disown", onend) - function onend () { - if (ended) return - ended = true - me.emit("childEnd", entry) - me.emit("entryEnd", entry) - me._currentEntry = null - if (!me._paused) { - me._read() - } - } - - // XXX Remove this. Works in node as of 0.6.2 or so. - // Long filenames should not break stuff. - entry.on("error", function (er) { - if (entry._swallowErrors) { - me.warn(er) - entry.emit("end") - entry.emit("close") - } else { - me.emit("error", er) - } - }) - - // proxy up some events. - ; [ "child" - , "childEnd" - , "warn" - ].forEach(function (ev) { - entry.on(ev, me.emit.bind(me, ev)) - }) - }) -} - -DirReader.prototype.disown = function (entry) { - entry.emit("beforeDisown") - entry._disowned = true - entry.parent = entry.root = null - if (entry === this._currentEntry) { - this._currentEntry = null - } - entry.emit("disown") -} - -DirReader.prototype.getChildProps = function (stat) { - return { depth: this.depth + 1 - , root: this.root || this - , parent: this - , follow: this.follow - , filter: this.filter - , sort: this.props.sort - } -} - -DirReader.prototype.pause = function (who) { - var me = this - if (me._paused) return - who = who || me - me._paused = true - if (me._currentEntry && me._currentEntry.pause) { - me._currentEntry.pause(who) - } - me.emit("pause", who) -} - -DirReader.prototype.resume = function (who) { - var me = this - if (!me._paused) return - who = who || me - - me._paused = false - // console.error("DR Emit Resume", me._path) - me.emit("resume", who) - if (me._paused) { - // console.error("DR Re-paused", me._path) - return - } - - if (me._currentEntry) { - if (me._currentEntry.resume) me._currentEntry.resume(who) - } else me._read() -} - -DirReader.prototype.emitEntry = function (entry) { - this.emit("entry", entry) - this.emit("child", entry) -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js deleted file mode 100644 index 71eb358..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/dir-writer.js +++ /dev/null @@ -1,171 +0,0 @@ -// It is expected that, when .add() returns false, the consumer -// of the DirWriter will pause until a "drain" event occurs. Note -// that this is *almost always going to be the case*, unless the -// thing being written is some sort of unsupported type, and thus -// skipped over. - -module.exports = DirWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , collect = require("./collect.js") - -inherits(DirWriter, Writer) - -function DirWriter (props) { - var me = this - if (!(me instanceof DirWriter)) me.error( - "DirWriter must be called as constructor.", null, true) - - // should already be established as a Directory type - if (props.type !== "Directory" || !props.Directory) { - me.error("Non-directory type "+ props.type + " " + - JSON.stringify(props), null, true) - } - - Writer.call(this, props) -} - -DirWriter.prototype._create = function () { - var me = this - mkdir(me._path, Writer.dirmode, function (er) { - if (er) return me.error(er) - // ready to start getting entries! - me.ready = true - me.emit("ready") - me._process() - }) -} - -// a DirWriter has an add(entry) method, but its .write() doesn't -// do anything. Why a no-op rather than a throw? Because this -// leaves open the door for writing directory metadata for -// gnu/solaris style dumpdirs. -DirWriter.prototype.write = function () { - return true -} - -DirWriter.prototype.end = function () { - this._ended = true - this._process() -} - -DirWriter.prototype.add = function (entry) { - var me = this - - // console.error("\tadd", entry._path, "->", me._path) - collect(entry) - if (!me.ready || me._currentEntry) { - me._buffer.push(entry) - return false - } - - // create a new writer, and pipe the incoming entry into it. - if (me._ended) { - return me.error("add after end") - } - - me._buffer.push(entry) - me._process() - - return 0 === this._buffer.length -} - -DirWriter.prototype._process = function () { - var me = this - - // console.error("DW Process p=%j", me._processing, me.basename) - - if (me._processing) return - - var entry = me._buffer.shift() - if (!entry) { - // console.error("DW Drain") - me.emit("drain") - if (me._ended) me._finish() - return - } - - me._processing = true - // console.error("DW Entry", entry._path) - - me.emit("entry", entry) - - // ok, add this entry - // - // don't allow recursive copying - var p = entry - do { - var pp = p._path || p.path - if (pp === me.root._path || pp === me._path || - (pp && pp.indexOf(me._path) === 0)) { - // console.error("DW Exit (recursive)", entry.basename, me._path) - me._processing = false - if (entry._collected) entry.pipe() - return me._process() - } - } while (p = p.parent) - - // console.error("DW not recursive") - - // chop off the entry's root dir, replace with ours - var props = { parent: me - , root: me.root || me - , type: entry.type - , depth: me.depth + 1 } - - var p = entry._path || entry.path || entry.props.path - if (entry.parent) { - p = p.substr(entry.parent._path.length + 1) - } - // get rid of any ../../ shenanigans - props.path = path.join(me.path, path.join("/", p)) - - // if i have a filter, the child should inherit it. - props.filter = me.filter - - // all the rest of the stuff, copy over from the source. - Object.keys(entry.props).forEach(function (k) { - if (!props.hasOwnProperty(k)) { - props[k] = entry.props[k] - } - }) - - // not sure at this point what kind of writer this is. - var child = me._currentChild = new Writer(props) - child.on("ready", function () { - // console.error("DW Child Ready", child.type, child._path) - // console.error(" resuming", entry._path) - entry.pipe(child) - entry.resume() - }) - - // XXX Make this work in node. - // Long filenames should not break stuff. - child.on("error", function (er) { - if (child._swallowErrors) { - me.warn(er) - child.emit("end") - child.emit("close") - } else { - me.emit("error", er) - } - }) - - // we fire _end internally *after* end, so that we don't move on - // until any "end" listeners have had their chance to do stuff. - child.on("close", onend) - var ended = false - function onend () { - if (ended) return - ended = true - // console.error("* DW Child end", child.basename) - me._currentChild = null - me._processing = false - me._process() - } -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js deleted file mode 100644 index e53718a..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-reader.js +++ /dev/null @@ -1,147 +0,0 @@ -// Basically just a wrapper around an fs.ReadStream - -module.exports = FileReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , Reader = fstream.Reader - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - , EOF = {EOF: true} - , CLOSE = {CLOSE: true} - -inherits(FileReader, Reader) - -function FileReader (props) { - // console.error(" FR create", props.path, props.size, new Error().stack) - var me = this - if (!(me instanceof FileReader)) throw new Error( - "FileReader must be called as constructor.") - - // should already be established as a File type - // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, - // with a HardLinkReader class. - if (!((props.type === "Link" && props.Link) || - (props.type === "File" && props.File))) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesEmitted = 0 - Reader.call(me, props) -} - -FileReader.prototype._getStream = function () { - var me = this - , stream = me._stream = fs.createReadStream(me._path, me.props) - - if (me.props.blksize) { - stream.bufferSize = me.props.blksize - } - - stream.on("open", me.emit.bind(me, "open")) - - stream.on("data", function (c) { - // console.error("\t\t%d %s", c.length, me.basename) - me._bytesEmitted += c.length - // no point saving empty chunks - if (!c.length) return - else if (me._paused || me._buffer.length) { - me._buffer.push(c) - me._read() - } else me.emit("data", c) - }) - - stream.on("end", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering End", me._path) - me._buffer.push(EOF) - me._read() - } else { - me.emit("end") - } - - if (me._bytesEmitted !== me.props.size) { - me.error("Didn't get expected byte count\n"+ - "expect: "+me.props.size + "\n" + - "actual: "+me._bytesEmitted) - } - }) - - stream.on("close", function () { - if (me._paused || me._buffer.length) { - // console.error("FR Buffering Close", me._path) - me._buffer.push(CLOSE) - me._read() - } else { - // console.error("FR close 1", me._path) - me.emit("close") - } - }) - - me._read() -} - -FileReader.prototype._read = function () { - var me = this - // console.error("FR _read", me._path) - if (me._paused) { - // console.error("FR _read paused", me._path) - return - } - - if (!me._stream) { - // console.error("FR _getStream calling", me._path) - return me._getStream() - } - - // clear out the buffer, if there is one. - if (me._buffer.length) { - // console.error("FR _read has buffer", me._buffer.length, me._path) - var buf = me._buffer - for (var i = 0, l = buf.length; i < l; i ++) { - var c = buf[i] - if (c === EOF) { - // console.error("FR Read emitting buffered end", me._path) - me.emit("end") - } else if (c === CLOSE) { - // console.error("FR Read emitting buffered close", me._path) - me.emit("close") - } else { - // console.error("FR Read emitting buffered data", me._path) - me.emit("data", c) - } - - if (me._paused) { - // console.error("FR Read Re-pausing at "+i, me._path) - me._buffer = buf.slice(i) - return - } - } - me._buffer.length = 0 - } - // console.error("FR _read done") - // that's about all there is to it. -} - -FileReader.prototype.pause = function (who) { - var me = this - // console.error("FR Pause", me._path) - if (me._paused) return - who = who || me - me._paused = true - if (me._stream) me._stream.pause() - me.emit("pause", who) -} - -FileReader.prototype.resume = function (who) { - var me = this - // console.error("FR Resume", me._path) - if (!me._paused) return - who = who || me - me.emit("resume", who) - me._paused = false - if (me._stream) me._stream.resume() - me._read() -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js deleted file mode 100644 index 00e078d..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/file-writer.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = FileWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , mkdir = require("../../mkdirp") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , EOF = {} - -inherits(FileWriter, Writer) - -function FileWriter (props) { - var me = this - if (!(me instanceof FileWriter)) throw new Error( - "FileWriter must be called as constructor.") - - // should already be established as a File type - if (props.type !== "File" || !props.File) { - throw new Error("Non-file type "+ props.type) - } - - me._buffer = [] - me._bytesWritten = 0 - - Writer.call(this, props) -} - -FileWriter.prototype._create = function () { - var me = this - if (me._stream) return - - var so = {} - if (me.props.flags) so.flags = me.props.flags - so.mode = Writer.filemode - if (me._old && me._old.blksize) so.bufferSize = me._old.blksize - - me._stream = fs.createWriteStream(me._path, so) - - me._stream.on("open", function (fd) { - // console.error("FW open", me._buffer, me._path) - me.ready = true - me._buffer.forEach(function (c) { - if (c === EOF) me._stream.end() - else me._stream.write(c) - }) - me.emit("ready") - // give this a kick just in case it needs it. - me.emit("drain") - }) - - me._stream.on("drain", function () { me.emit("drain") }) - - me._stream.on("close", function () { - // console.error("\n\nFW Stream Close", me._path, me.size) - me._finish() - }) -} - -FileWriter.prototype.write = function (c) { - var me = this - - me._bytesWritten += c.length - - if (!me.ready) { - if (!Buffer.isBuffer(c) && typeof c !== 'string') - throw new Error('invalid write data') - me._buffer.push(c) - return false - } - - var ret = me._stream.write(c) - // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length) - - // allow 2 buffered writes, because otherwise there's just too - // much stop and go bs. - return ret || (me._stream._queue && me._stream._queue.length <= 2) -} - -FileWriter.prototype.end = function (c) { - var me = this - - if (c) me.write(c) - - if (!me.ready) { - me._buffer.push(EOF) - return false - } - - return me._stream.end() -} - -FileWriter.prototype._finish = function () { - var me = this - if (typeof me.size === "number" && me._bytesWritten != me.size) { - me.error( - "Did not get expected byte count.\n" + - "expect: " + me.size + "\n" + - "actual: " + me._bytesWritten) - } - Writer.prototype._finish.call(me) -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js deleted file mode 100644 index cd65c41..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/get-type.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = getType - -function getType (st) { - var types = - [ "Directory" - , "File" - , "SymbolicLink" - , "Link" // special for hardlinks from tarballs - , "BlockDevice" - , "CharacterDevice" - , "FIFO" - , "Socket" ] - , type - - if (st.type && -1 !== types.indexOf(st.type)) { - st[st.type] = true - return st.type - } - - for (var i = 0, l = types.length; i < l; i ++) { - type = types[i] - var is = st[type] || st["is" + type] - if (typeof is === "function") is = is.call(st) - if (is) { - st[type] = true - st.type = type - return type - } - } - - return null -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js deleted file mode 100644 index 1d07e2f..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-reader.js +++ /dev/null @@ -1,54 +0,0 @@ -// Basically just a wrapper around an fs.readlink -// -// XXX: Enhance this to support the Link type, by keeping -// a lookup table of {:}, so that hardlinks -// can be preserved in tarballs. - -module.exports = LinkReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - -inherits(LinkReader, Reader) - -function LinkReader (props) { - var me = this - if (!(me instanceof LinkReader)) throw new Error( - "LinkReader must be called as constructor.") - - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - Reader.call(me, props) -} - -// When piping a LinkReader into a LinkWriter, we have to -// already have the linkpath property set, so that has to -// happen *before* the "ready" event, which means we need to -// override the _stat method. -LinkReader.prototype._stat = function (currentStat) { - var me = this - fs.readlink(me._path, function (er, linkpath) { - if (er) return me.error(er) - me.linkpath = me.props.linkpath = linkpath - me.emit("linkpath", linkpath) - Reader.prototype._stat.call(me, currentStat) - }) -} - -LinkReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we need - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js deleted file mode 100644 index c652eb3..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/link-writer.js +++ /dev/null @@ -1,95 +0,0 @@ - -module.exports = LinkWriter - -var fs = require("../../graceful-fs/graceful-fs.js") - , Writer = require("./writer.js") - , inherits = require("../../inherits/inherits.js") - , path = require("path") - , rimraf = require("../../rimraf/rimraf.js") - -inherits(LinkWriter, Writer) - -function LinkWriter (props) { - var me = this - if (!(me instanceof LinkWriter)) throw new Error( - "LinkWriter must be called as constructor.") - - // should already be established as a Link type - if (!((props.type === "Link" && props.Link) || - (props.type === "SymbolicLink" && props.SymbolicLink))) { - throw new Error("Non-link type "+ props.type) - } - - if (props.linkpath === "") props.linkpath = "." - if (!props.linkpath) { - me.error("Need linkpath property to create " + props.type) - } - - Writer.call(this, props) -} - -LinkWriter.prototype._create = function () { - // console.error(" LW _create") - var me = this - , hard = me.type === "Link" || process.platform === "win32" - , link = hard ? "link" : "symlink" - , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath - - // can only change the link path by clobbering - // For hard links, let's just assume that's always the case, since - // there's no good way to read them if we don't already know. - if (hard) return clobber(me, lp, link) - - fs.readlink(me._path, function (er, p) { - // only skip creation if it's exactly the same link - if (p && p === lp) return finish(me) - clobber(me, lp, link) - }) -} - -function clobber (me, lp, link) { - rimraf(me._path, function (er) { - if (er) return me.error(er) - create(me, lp, link) - }) -} - -function create (me, lp, link) { - fs[link](lp, me._path, function (er) { - // if this is a hard link, and we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier in. - // Additionally, an EPERM or EACCES can happen on win32 if it's trying - // to make a link to a directory. Again, just skip it. - // A better solution would be to have fs.symlink be supported on - // windows in some nice fashion. - if (er) { - if ((er.code === "ENOENT" || - er.code === "EACCES" || - er.code === "EPERM" ) && process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - } else return me.error(er) - } - finish(me) - }) -} - -function finish (me) { - me.ready = true - me.emit("ready") - if (me._ended && !me._finished) me._finish() -} - -LinkWriter.prototype.end = function () { - // console.error("LW finish in end") - this._ended = true - if (this.ready) { - this._finished = true - this._finish() - } -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js deleted file mode 100644 index a51ebdf..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-reader.js +++ /dev/null @@ -1,93 +0,0 @@ -// A reader for when we don't yet know what kind of thing -// the thing is. - -module.exports = ProxyReader - -var Reader = require("./reader.js") - , getType = require("./get-type.js") - , inherits = require("../../inherits/inherits.js") - , fs = require("../../graceful-fs/graceful-fs.js") - -inherits(ProxyReader, Reader) - -function ProxyReader (props) { - var me = this - if (!(me instanceof ProxyReader)) throw new Error( - "ProxyReader must be called as constructor.") - - me.props = props - me._buffer = [] - me.ready = false - - Reader.call(me, props) -} - -ProxyReader.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Reader(props, current)) - }) -} - -ProxyReader.prototype._addProxy = function (proxy) { - var me = this - if (me._proxyTarget) { - return me.error("proxy already set") - } - - me._proxyTarget = proxy - proxy._proxy = me - - ; [ "error" - , "data" - , "end" - , "close" - , "linkpath" - , "entry" - , "entryEnd" - , "child" - , "childEnd" - , "warn" - , "stat" - ].forEach(function (ev) { - // console.error("~~ proxy event", ev, me.path) - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - proxy.on("ready", function () { - // console.error("~~ proxy is ready!", me.path) - me.ready = true - me.emit("ready") - }) - - var calls = me._buffer - me._buffer.length = 0 - calls.forEach(function (c) { - proxy[c[0]].apply(proxy, c[1]) - }) -} - -ProxyReader.prototype.pause = function () { - return this._proxyTarget ? this._proxyTarget.pause() : false -} - -ProxyReader.prototype.resume = function () { - return this._proxyTarget ? this._proxyTarget.resume() : false -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js deleted file mode 100644 index ea2b560..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/proxy-writer.js +++ /dev/null @@ -1,109 +0,0 @@ -// A writer for when we don't know what kind of thing -// the thing is. That is, it's not explicitly set, -// so we're going to make it whatever the thing already -// is, or "File" -// -// Until then, collect all events. - -module.exports = ProxyWriter - -var Writer = require("./writer.js") - , getType = require("./get-type.js") - , inherits = require("../../inherits/inherits.js") - , collect = require("./collect.js") - , fs = require("fs") - -inherits(ProxyWriter, Writer) - -function ProxyWriter (props) { - var me = this - if (!(me instanceof ProxyWriter)) throw new Error( - "ProxyWriter must be called as constructor.") - - me.props = props - me._needDrain = false - - Writer.call(me, props) -} - -ProxyWriter.prototype._stat = function () { - var me = this - , props = me.props - // stat the thing to see what the proxy should be. - , stat = props.follow ? "stat" : "lstat" - - fs[stat](props.path, function (er, current) { - var type - if (er || !current) { - type = "File" - } else { - type = getType(current) - } - - props[type] = true - props.type = me.type = type - - me._old = current - me._addProxy(Writer(props, current)) - }) -} - -ProxyWriter.prototype._addProxy = function (proxy) { - // console.error("~~ set proxy", this.path) - var me = this - if (me._proxy) { - return me.error("proxy already set") - } - - me._proxy = proxy - ; [ "ready" - , "error" - , "close" - , "pipe" - , "drain" - , "warn" - ].forEach(function (ev) { - proxy.on(ev, me.emit.bind(me, ev)) - }) - - me.emit("proxy", proxy) - - var calls = me._buffer - calls.forEach(function (c) { - // console.error("~~ ~~ proxy buffered call", c[0], c[1]) - proxy[c[0]].apply(proxy, c[1]) - }) - me._buffer.length = 0 - if (me._needsDrain) me.emit("drain") -} - -ProxyWriter.prototype.add = function (entry) { - // console.error("~~ proxy add") - collect(entry) - - if (!this._proxy) { - this._buffer.push(["add", [entry]]) - this._needDrain = true - return false - } - return this._proxy.add(entry) -} - -ProxyWriter.prototype.write = function (c) { - // console.error("~~ proxy write") - if (!this._proxy) { - this._buffer.push(["write", [c]]) - this._needDrain = true - return false - } - return this._proxy.write(c) -} - -ProxyWriter.prototype.end = function (c) { - // console.error("~~ proxy end") - if (!this._proxy) { - this._buffer.push(["end", [c]]) - return false - } - return this._proxy.end(c) -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js deleted file mode 100644 index 4ae98eb..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/reader.js +++ /dev/null @@ -1,259 +0,0 @@ - -module.exports = Reader - -var fs = require("../../graceful-fs/graceful-fs.js") - , Stream = require("stream").Stream - , inherits = require("../../inherits/inherits.js") - , path = require("path") - , getType = require("./get-type.js") - , hardLinks = Reader.hardLinks = {} - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Reader, Abstract) - -var DirReader = require("./dir-reader.js") - , FileReader = require("./file-reader.js") - , LinkReader = require("./link-reader.js") - , SocketReader = require("./socket-reader.js") - , ProxyReader = require("./proxy-reader.js") - -function Reader (props, currentStat) { - var me = this - if (!(me instanceof Reader)) return new Reader(props, currentStat) - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) { - me.error("Must provide a path", null, true) - } - - // polymorphism. - // call fstream.Reader(dir) to get a DirReader object, etc. - // Note that, unlike in the Writer case, ProxyReader is going - // to be the *normal* state of affairs, since we rarely know - // the type of a file prior to reading it. - - - var type - , ClassType - - if (props.type && typeof props.type === "function") { - type = props.type - ClassType = type - } else { - type = getType(props) - ClassType = Reader - } - - if (currentStat && !type) { - type = getType(currentStat) - props[type] = true - props.type = type - } - - switch (type) { - case "Directory": - ClassType = DirReader - break - - case "Link": - // XXX hard links are just files. - // However, it would be good to keep track of files' dev+inode - // and nlink values, and create a HardLinkReader that emits - // a linkpath value of the original copy, so that the tar - // writer can preserve them. - // ClassType = HardLinkReader - // break - - case "File": - ClassType = FileReader - break - - case "SymbolicLink": - ClassType = LinkReader - break - - case "Socket": - ClassType = SocketReader - break - - case null: - ClassType = ProxyReader - break - } - - if (!(me instanceof ClassType)) { - return new ClassType(props) - } - - Abstract.call(me) - - me.readable = true - me.writable = false - - me.type = type - me.props = props - me.depth = props.depth = props.depth || 0 - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - // how DOES one create files on the moon? - // if the path has spaces in it, then UNC will fail. - me._swallowErrors = true - //if (me._path.indexOf(" ") === -1) { - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - //} - } - } - me.basename = props.basename = path.basename(me.path) - me.dirname = props.dirname = path.dirname(me.path) - - // these have served their purpose, and are now just noisy clutter - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - me.filter = typeof props.filter === "function" ? props.filter : null - if (props.sort === "alpha") props.sort = alphasort - - // start the ball rolling. - // this will stat the thing, and then call me._read() - // to start reading whatever it is. - // console.error("calling stat", props.path, currentStat) - me._stat(currentStat) -} - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - -Reader.prototype._stat = function (currentStat) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - - // console.error("Reader._stat", me._path, currentStat) - if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) - else fs[stat](me._path, statCb) - - - function statCb (er, props_) { - // console.error("Reader._stat, statCb", me._path, props_, props_.nlink) - if (er) return me.error(er) - - Object.keys(props_).forEach(function (k) { - props[k] = props_[k] - }) - - // if it's not the expected size, then abort here. - if (undefined !== me.size && props.size !== me.size) { - return me.error("incorrect size") - } - me.size = props.size - - var type = getType(props) - // special little thing for handling hardlinks. - if (type !== "Directory" && props.nlink && props.nlink > 1) { - var k = props.dev + ":" + props.ino - // console.error("Reader has nlink", me._path, k) - if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path - else { - // switch into hardlink mode. - type = me.type = me.props.type = "Link" - me.Link = me.props.Link = true - me.linkpath = me.props.linkpath = hardLinks[k] - // console.error("Hardlink detected, switching mode", me._path, me.linkpath) - // Setting __proto__ would arguably be the "correct" - // approach here, but that just seems too wrong. - me._stat = me._read = LinkReader.prototype._read - } - } - - if (me.type && me.type !== type) { - me.error("Unexpected type: " + type) - } - - // if the filter doesn't pass, then just skip over this one. - // still have to emit end so that dir-walking can move on. - if (me.filter) { - var who = me._proxy || me - // special handling for ProxyReaders - if (!me.filter.call(who, who, props)) { - if (!me._disowned) { - me.abort() - me.emit("end") - me.emit("close") - } - return - } - } - - // last chance to abort or disown before the flow starts! - var events = ["_stat", "stat", "ready"] - var e = 0 - ;(function go () { - if (me._aborted) { - me.emit("end") - me.emit("close") - return - } - - if (me._paused) { - me.once("resume", go) - return - } - - var ev = events[e ++] - if (!ev) return me._read() - me.emit(ev, props) - go() - })() - } -} - -Reader.prototype.pipe = function (dest, opts) { - var me = this - if (typeof dest.add === "function") { - // piping to a multi-compatible, and we've got directory entries. - me.on("entry", function (entry) { - var ret = dest.add(entry) - if (false === ret) { - me.pause() - } - }) - } - - // console.error("R Pipe apply Stream Pipe") - return Stream.prototype.pipe.apply(this, arguments) -} - -Reader.prototype.pause = function (who) { - this._paused = true - who = who || this - this.emit("pause", who) - if (this._stream) this._stream.pause(who) -} - -Reader.prototype.resume = function (who) { - this._paused = false - who = who || this - this.emit("resume", who) - if (this._stream) this._stream.resume(who) - this._read() -} - -Reader.prototype._read = function () { - this.error("Cannot read unknown type: "+this.type) -} - diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js deleted file mode 100644 index 1de8ce9..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/socket-reader.js +++ /dev/null @@ -1,38 +0,0 @@ -// Just get the stats, and then don't do anything. -// You can't really "read" from a socket. You "connect" to it. -// Mostly, this is here so that reading a dir with a socket in it -// doesn't blow up. - -module.exports = SocketReader - -var fs = require("../../graceful-fs/graceful-fs.js") - , fstream = require("../fstream.js") - , inherits = require("../../inherits/inherits.js") - , mkdir = require("../../mkdirp") - , Reader = require("./reader.js") - -inherits(SocketReader, Reader) - -function SocketReader (props) { - var me = this - if (!(me instanceof SocketReader)) throw new Error( - "SocketReader must be called as constructor.") - - if (!(props.type === "Socket" && props.Socket)) { - throw new Error("Non-socket type "+ props.type) - } - - Reader.call(me, props) -} - -SocketReader.prototype._read = function () { - var me = this - if (me._paused) return - // basically just a no-op, since we got all the info we have - // from the _stat method - if (!me._ended) { - me.emit("end") - me.emit("close") - me._ended = true - } -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js deleted file mode 100644 index f689baf..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/fstream/lib/writer.js +++ /dev/null @@ -1,389 +0,0 @@ - -module.exports = Writer - -var fs = require("../../graceful-fs/graceful-fs.js") - , inherits = require("../../inherits/inherits.js") - , rimraf = require("../../rimraf/rimraf.js") - , mkdir = require("../../mkdirp") - , path = require("path") - , umask = process.platform === "win32" ? 0 : process.umask() - , getType = require("./get-type.js") - , Abstract = require("./abstract.js") - -// Must do this *before* loading the child classes -inherits(Writer, Abstract) - -Writer.dirmode = 0777 & (~umask) -Writer.filemode = 0666 & (~umask) - -var DirWriter = require("./dir-writer.js") - , LinkWriter = require("./link-writer.js") - , FileWriter = require("./file-writer.js") - , ProxyWriter = require("./proxy-writer.js") - -// props is the desired state. current is optionally the current stat, -// provided here so that subclasses can avoid statting the target -// more than necessary. -function Writer (props, current) { - var me = this - - if (typeof props === "string") { - props = { path: props } - } - - if (!props.path) me.error("Must provide a path", null, true) - - // polymorphism. - // call fstream.Writer(dir) to get a DirWriter object, etc. - var type = getType(props) - , ClassType = Writer - - switch (type) { - case "Directory": - ClassType = DirWriter - break - case "File": - ClassType = FileWriter - break - case "Link": - case "SymbolicLink": - ClassType = LinkWriter - break - case null: - // Don't know yet what type to create, so we wrap in a proxy. - ClassType = ProxyWriter - break - } - - if (!(me instanceof ClassType)) return new ClassType(props) - - // now get down to business. - - Abstract.call(me) - - // props is what we want to set. - // set some convenience properties as well. - me.type = props.type - me.props = props - me.depth = props.depth || 0 - me.clobber = false === props.clobber ? props.clobber : true - me.parent = props.parent || null - me.root = props.root || (props.parent && props.parent.root) || me - - me._path = me.path = path.resolve(props.path) - if (process.platform === "win32") { - me.path = me._path = me.path.replace(/\?/g, "_") - if (me._path.length >= 260) { - me._swallowErrors = true - me._path = "\\\\?\\" + me.path.replace(/\//g, "\\") - } - } - me.basename = path.basename(props.path) - me.dirname = path.dirname(props.path) - me.linkpath = props.linkpath || null - - props.parent = props.root = null - - // console.error("\n\n\n%s setting size to", props.path, props.size) - me.size = props.size - - if (typeof props.mode === "string") { - props.mode = parseInt(props.mode, 8) - } - - me.readable = false - me.writable = true - - // buffer until ready, or while handling another entry - me._buffer = [] - me.ready = false - - me.filter = typeof props.filter === "function" ? props.filter: null - - // start the ball rolling. - // this checks what's there already, and then calls - // me._create() to call the impl-specific creation stuff. - me._stat(current) -} - -// Calling this means that it's something we can't create. -// Just assert that it's already there, otherwise raise a warning. -Writer.prototype._create = function () { - var me = this - fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) { - if (er) { - return me.warn("Cannot create " + me._path + "\n" + - "Unsupported type: "+me.type, "ENOTSUP") - } - me._finish() - }) -} - -Writer.prototype._stat = function (current) { - var me = this - , props = me.props - , stat = props.follow ? "stat" : "lstat" - , who = me._proxy || me - - if (current) statCb(null, current) - else fs[stat](me._path, statCb) - - function statCb (er, current) { - if (me.filter && !me.filter.call(who, who, current)) { - me._aborted = true - me.emit("end") - me.emit("close") - return - } - - // if it's not there, great. We'll just create it. - // if it is there, then we'll need to change whatever differs - if (er || !current) { - return create(me) - } - - me._old = current - var currentType = getType(current) - - // if it's a type change, then we need to clobber or error. - // if it's not a type change, then let the impl take care of it. - if (currentType !== me.type) { - return rimraf(me._path, function (er) { - if (er) return me.error(er) - me._old = null - create(me) - }) - } - - // otherwise, just handle in the app-specific way - // this creates a fs.WriteStream, or mkdir's, or whatever - create(me) - } -} - -function create (me) { - // console.error("W create", me._path, Writer.dirmode) - - // XXX Need to clobber non-dirs that are in the way, - // unless { clobber: false } in the props. - mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) { - // console.error("W created", path.dirname(me._path), er) - if (er) return me.error(er) - - // later on, we have to set the mode and owner for these - me._madeDir = made - return me._create() - }) -} - -function endChmod (me, want, current, path, cb) { - var wantMode = want.mode - , chmod = want.follow || me.type !== "SymbolicLink" - ? "chmod" : "lchmod" - - if (!fs[chmod]) return cb() - if (typeof wantMode !== "number") return cb() - - var curMode = current.mode & 0777 - wantMode = wantMode & 0777 - if (wantMode === curMode) return cb() - - fs[chmod](path, wantMode, cb) -} - - -function endChown (me, want, current, path, cb) { - // Don't even try it unless root. Too easy to EPERM. - if (process.platform === "win32") return cb() - if (!process.getuid || !process.getuid() === 0) return cb() - if (typeof want.uid !== "number" && - typeof want.gid !== "number" ) return cb() - - if (current.uid === want.uid && - current.gid === want.gid) return cb() - - var chown = (me.props.follow || me.type !== "SymbolicLink") - ? "chown" : "lchown" - if (!fs[chown]) return cb() - - if (typeof want.uid !== "number") want.uid = current.uid - if (typeof want.gid !== "number") want.gid = current.gid - - fs[chown](path, want.uid, want.gid, cb) -} - -function endUtimes (me, want, current, path, cb) { - if (!fs.utimes || process.platform === "win32") return cb() - - var utimes = (want.follow || me.type !== "SymbolicLink") - ? "utimes" : "lutimes" - - if (utimes === "lutimes" && !fs[utimes]) { - utimes = "utimes" - } - - if (!fs[utimes]) return cb() - - var curA = current.atime - , curM = current.mtime - , meA = want.atime - , meM = want.mtime - - if (meA === undefined) meA = curA - if (meM === undefined) meM = curM - - if (!isDate(meA)) meA = new Date(meA) - if (!isDate(meM)) meA = new Date(meM) - - if (meA.getTime() === curA.getTime() && - meM.getTime() === curM.getTime()) return cb() - - fs[utimes](path, meA, meM, cb) -} - - -// XXX This function is beastly. Break it up! -Writer.prototype._finish = function () { - var me = this - - // console.error(" W Finish", me._path, me.size) - - // set up all the things. - // At this point, we're already done writing whatever we've gotta write, - // adding files to the dir, etc. - var todo = 0 - var errState = null - var done = false - - if (me._old) { - // the times will almost *certainly* have changed. - // adds the utimes syscall, but remove another stat. - me._old.atime = new Date(0) - me._old.mtime = new Date(0) - // console.error(" W Finish Stale Stat", me._path, me.size) - setProps(me._old) - } else { - var stat = me.props.follow ? "stat" : "lstat" - // console.error(" W Finish Stating", me._path, me.size) - fs[stat](me._path, function (er, current) { - // console.error(" W Finish Stated", me._path, me.size, current) - if (er) { - // if we're in the process of writing out a - // directory, it's very possible that the thing we're linking to - // doesn't exist yet (especially if it was intended as a symlink), - // so swallow ENOENT errors here and just soldier on. - if (er.code === "ENOENT" && - (me.type === "Link" || me.type === "SymbolicLink") && - process.platform === "win32") { - me.ready = true - me.emit("ready") - me.emit("end") - me.emit("close") - me.end = me._finish = function () {} - return - } else return me.error(er) - } - setProps(me._old = current) - }) - } - - return - - function setProps (current) { - todo += 3 - endChmod(me, me.props, current, me._path, next("chmod")) - endChown(me, me.props, current, me._path, next("chown")) - endUtimes(me, me.props, current, me._path, next("utimes")) - } - - function next (what) { - return function (er) { - // console.error(" W Finish", what, todo) - if (errState) return - if (er) { - er.fstream_finish_call = what - return me.error(errState = er) - } - if (--todo > 0) return - if (done) return - done = true - - // we may still need to set the mode/etc. on some parent dirs - // that were created previously. delay end/close until then. - if (!me._madeDir) return end() - else endMadeDir(me, me._path, end) - - function end (er) { - if (er) { - er.fstream_finish_call = "setupMadeDir" - return me.error(er) - } - // all the props have been set, so we're completely done. - me.emit("end") - me.emit("close") - } - } - } -} - -function endMadeDir (me, p, cb) { - var made = me._madeDir - // everything *between* made and path.dirname(me._path) - // needs to be set up. Note that this may just be one dir. - var d = path.dirname(p) - - endMadeDir_(me, d, function (er) { - if (er) return cb(er) - if (d === made) { - return cb() - } - endMadeDir(me, d, cb) - }) -} - -function endMadeDir_ (me, p, cb) { - var dirProps = {} - Object.keys(me.props).forEach(function (k) { - dirProps[k] = me.props[k] - - // only make non-readable dirs if explicitly requested. - if (k === "mode" && me.type !== "Directory") { - dirProps[k] = dirProps[k] | 0111 - } - }) - - var todo = 3 - , errState = null - fs.stat(p, function (er, current) { - if (er) return cb(errState = er) - endChmod(me, dirProps, current, p, next) - endChown(me, dirProps, current, p, next) - endUtimes(me, dirProps, current, p, next) - }) - - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- todo === 0) return cb() - } -} - -Writer.prototype.pipe = function () { - this.error("Can't pipe from writable stream") -} - -Writer.prototype.add = function () { - this.error("Cannot add to non-Directory type") -} - -Writer.prototype.write = function () { - return true -} - -function objectToString (d) { - return Object.prototype.toString.call(d) -} - -function isDate(d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; -} diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md deleted file mode 100644 index 7d2e681..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js deleted file mode 100644 index fe9c3f4..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,316 +0,0 @@ -// 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_ = require("fs") - -var fs = module.exports = {} - -Object.getOwnPropertyNames(fs_).forEach(function(prop) { - var desc = Object.getOwnPropertyDescriptor(fs_, prop) - Object.defineProperty(fs, prop, desc) -}) - -var queue = [] - , constants = require("constants") - -exports = module.exports = fs -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync - - -// 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 ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.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 - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) -} - - -// (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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/README.md b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/README.md deleted file mode 100644 index b2beaed..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js deleted file mode 100644 index 061b396..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js deleted file mode 100644 index fda6de8..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/readme.markdown b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/readme.markdown deleted file mode 100644 index 83b0216..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/mkdirp/readme.markdown +++ /dev/null @@ -1,63 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, mode, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -## mkdirp.sync(dir, mode) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -# license - -MIT diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/README.md b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js b/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js deleted file mode 100644 index 2d3ae41..0000000 --- a/node_modules/grunt/node_modules/lodash/vendor/tar/vendor/rimraf/rimraf.js +++ /dev/null @@ -1,132 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("../../graceful-fs/graceful-fs.js") -} catch (er) { - fs = require("fs") -} - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -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 (er.code === "EBUSY" && 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 && er.code === "ENOENT") - return cb() - if (er && (er.code === "EPERM" || er.code === "EISDIR")) - return rmdir(p, er, cb) - return cb(er) - }) -} - -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")) - 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" && er.code !== "EISDIR") - throw er - try { - fs.rmdirSync(p) - } catch (er2) { - if (er2.code === "ENOENT") - return - if (er2.code === "ENOTDIR") - throw er - if (er2.code === "ENOTEMPTY") { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) - } - } - } -} diff --git a/node_modules/grunt/node_modules/minimatch/LICENSE b/node_modules/grunt/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/minimatch/README.md b/node_modules/grunt/node_modules/minimatch/README.md deleted file mode 100644 index 6fd07d2..0000000 --- a/node_modules/grunt/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -### 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. **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 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. - - -## 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.) diff --git a/node_modules/grunt/node_modules/minimatch/minimatch.js b/node_modules/grunt/node_modules/minimatch/minimatch.js deleted file mode 100644 index 405746b..0000000 --- a/node_modules/grunt/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1079 +0,0 @@ -;(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.monkeyPatch = monkeyPatch -function monkeyPatch () { - var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") - var orig = desc.value - desc.value = function (p) { - if (p instanceof Minimatch) return p.match(this) - return orig.call(this, p) - } - Object.defineProperty(String.prototype, desc) -} - -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.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) console.error(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) - }) - - if (options.debug) console.error(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - if (options.debug) console.error(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - if (options.debug) console.error(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) !== "{") { - // console.error(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error(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) { - // console.error("no sets") - return [pattern] - } - - var tail = braceExpand(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) { - // console.error("numset", numset[1], numset[2]) - var suf = braceExpand(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 = "" - } - - // console.error("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error("", 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) { - // console.error("didn't close", pattern) - return braceExpand("\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - // console.error("set", set) - // console.error("suffix", pattern.substr(i)) - var suf = braceExpand(pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - // console.error("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand(p, options) - }) - // console.error("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}(?:$|\\\/))" - : "(?!\\.)" - - 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 - } - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - if (options.debug) { - console.error("%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 "!": - if (options.debug) { - console.error("%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) { - 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. - 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 === "!" ? "(?:(?!" : "(?:" - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - 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 - } - - 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 + "|" - }) - - // console.error("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) { - // console.error("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) - if (options.debug) { - console.error(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 - // console.error(this.pattern, "set", set) - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i] - var hit = this.matchOne(f, 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 - - if (options.debug) { - console.error("matchOne", - { "this": this - , file: file - , pattern: pattern }) - } - - if (options.matchBase && pattern.length === 1) { - file = path.basename(file.join("/")).split("/") - } - - if (options.debug) { - console.error("matchOne", file.length, pattern.length) - } - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - if (options.debug) { - console.error("matchOne loop") - } - var p = pattern[pi] - , f = file[fi] - - if (options.debug) { - console.error(pattern, p, f) - } - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - if (options.debug) - console.error('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) { - if (options.debug) - console.error('** 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] - - if (options.debug) { - console.error('\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)) { - if (options.debug) - console.error('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) === ".")) { - if (options.debug) - console.error("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - if (options.debug) - console.error('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 - // console.error("\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 - } - if (options.debug) { - console.error("string match", p, f, hit) - } - } else { - hit = f.match(p) - if (options.debug) { - console.error("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/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/AUTHORS deleted file mode 100644 index 016d7fb..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Carlos Brito Lage -Marko Mikulicic -Trent Mick -Kevin O'Hara -Marco Rogers -Jesse Dailey diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f9..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# 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/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/bench.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/bench.js deleted file mode 100644 index 9111540..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/bench.js +++ /dev/null @@ -1,25 +0,0 @@ -var LRU = require('lru-cache'); - -var max = +process.argv[2] || 10240; -var more = 102400; - -var cache = LRU({ - max: max, maxAge: 86400e3 -}); - -// fill cache -for (var i = 0; i < max; ++i) { - cache.set(i, {}); -} - -var start = process.hrtime(); - -// adding more items -for ( ; i < max+more; ++i) { - cache.set(i, {}); -} - -var end = process.hrtime(start); -var msecs = end[0] * 1E3 + end[1] / 1E6; - -console.log('adding %d items took %d ms', more, msecs.toPrecision(5)); diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 49c1dc6..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,263 +0,0 @@ -;(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) - } - - var max - if (typeof options === 'number') { - max = options - options = { max: max } - } - - if (!options) options = {} - - max = options.max - - var lengthCalculator = options.length || naiveLength - - if (typeof lengthCalculator !== "function") { - lengthCalculator = naiveLength - } - - if (!max || !(typeof max === "number") || max <= 0 ) { - // a little bit silly. maybe this should throw? - max = Infinity - } - - var allowStale = options.stale || false - - var maxAge = options.maxAge || null - - var dispose = options.dispose - - var cache = Object.create(null) // hash of items by key - , lruList = Object.create(null) // list of items in order of use recency - , mru = 0 // most recently used - , lru = 0 // least recently used - , length = 0 // number of items in the list - , itemCount = 0 - - - // resize the cache when the max changes. - Object.defineProperty(this, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - max = mL - // if it gets above double max, trim right away. - // otherwise, do it whenever it's convenient. - if (length > max) trim() - } - , get : function () { return max } - , enumerable : true - }) - - // resize the cache when the lengthCalculator changes. - Object.defineProperty(this, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - lengthCalculator = naiveLength - length = itemCount - for (var key in cache) { - cache[key].length = 1 - } - } else { - lengthCalculator = lC - length = 0 - for (var key in cache) { - cache[key].length = lengthCalculator(cache[key].value) - length += cache[key].length - } - } - - if (length > max) trim() - } - , get : function () { return lengthCalculator } - , enumerable : true - }) - - Object.defineProperty(this, "length", - { get : function () { return length } - , enumerable : true - }) - - - Object.defineProperty(this, "itemCount", - { get : function () { return itemCount } - , enumerable : true - }) - - this.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - i++ - var hit = lruList[k] - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } - } - - this.keys = function () { - var keys = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - keys[i++] = hit.key - } - return keys - } - - this.values = function () { - var values = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - values[i++] = hit.value - } - return values - } - - this.reset = function () { - if (dispose) { - for (var k in cache) { - dispose(k, cache[k].value) - } - } - cache = {} - lruList = {} - lru = 0 - mru = 0 - length = 0 - itemCount = 0 - } - - // Provided for debugging/dev purposes only. No promises whatsoever that - // this API stays stable. - this.dump = function () { - return cache - } - - this.dumpLru = function () { - return lruList - } - - this.set = function (key, value) { - if (hOP(cache, key)) { - // dispose of the old one before overwriting - if (dispose) dispose(key, cache[key].value) - if (maxAge) cache[key].now = Date.now() - cache[key].value = value - this.get(key) - return true - } - - var len = lengthCalculator(value) - var age = maxAge ? Date.now() : 0 - var hit = new Entry(key, value, mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > max) { - if (dispose) dispose(key, value) - return false - } - - length += hit.length - lruList[hit.lu] = cache[key] = hit - itemCount ++ - - if (length > max) trim() - return true - } - - this.has = function (key) { - if (!hOP(cache, key)) return false - var hit = cache[key] - if (maxAge && (Date.now() - hit.now > maxAge)) { - return false - } - return true - } - - this.get = function (key) { - return get(key, true) - } - - this.peek = function (key) { - return get(key, false) - } - - function get (key, doUse) { - var hit = cache[key] - if (hit) { - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } else { - if (doUse) use(hit) - } - if (hit) hit = hit.value - } - return hit - } - - function use (hit) { - shiftLU(hit) - hit.lu = mru ++ - lruList[hit.lu] = hit - } - - this.del = function (key) { - del(cache[key]) - } - - function trim () { - while (lru < mru && length > max) - del(lruList[lru]) - } - - function shiftLU(hit) { - delete lruList[ hit.lu ] - while (lru < mru && !lruList[lru]) lru ++ - } - - function del(hit) { - if (hit) { - if (dispose) dispose(hit.key, hit.value) - length -= hit.length - itemCount -- - delete cache[ hit.key ] - shiftLU(hit) - } - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, mru, len, age) { - this.key = key - this.value = value - this.lu = mru - this.length = len - this.now = age -} - -})() diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 411acad..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.3.1", - "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" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Carlos Brito Lage", - "email": "carlos@carloslage.net" - }, - { - "name": "Marko Mikulicic", - "email": "marko.mikulicic@isti.cnr.it" - }, - { - "name": "Trent Mick", - "email": "trentm@gmail.com" - }, - { - "name": "Kevin O'Hara", - "email": "kevinohara80@gmail.com" - }, - { - "name": "Marco Rogers", - "email": "marco.rogers@gmail.com" - }, - { - "name": "Jesse Dailey", - "email": "jesse.dailey@gmail.com" - } - ], - "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" - }, - "_id": "lru-cache@2.3.1", - "_from": "lru-cache@2" -} diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index 70f3f8b..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,329 +0,0 @@ -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() -}) diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b0..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/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/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# 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/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// 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/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index ec8e2eb..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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" - }, - "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" -} diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/grunt/node_modules/minimatch/package.json b/node_modules/grunt/node_modules/minimatch/package.json deleted file mode 100644 index 7af76fd..0000000 --- a/node_modules/grunt/node_modules/minimatch/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "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.12", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "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!\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### 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. **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 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\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "_id": "minimatch@0.2.12", - "_from": "minimatch@~0.2.6" -} diff --git a/node_modules/grunt/node_modules/minimatch/test/basic.js b/node_modules/grunt/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// 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/node_modules/grunt/node_modules/minimatch/test/brace-expand.js b/node_modules/grunt/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index 7ee278a..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/grunt/node_modules/minimatch/test/caching.js b/node_modules/grunt/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/grunt/node_modules/minimatch/test/defaults.js b/node_modules/grunt/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 25f1f60..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// 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/node_modules/grunt/node_modules/nopt/.npmignore b/node_modules/grunt/node_modules/nopt/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/nopt/LICENSE b/node_modules/grunt/node_modules/nopt/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/nopt/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/nopt/README.md b/node_modules/grunt/node_modules/nopt/README.md deleted file mode 100644 index eeddfd4..0000000 --- a/node_modules/grunt/node_modules/nopt/README.md +++ /dev/null @@ -1,208 +0,0 @@ -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/node_modules/grunt/node_modules/nopt/bin/nopt.js b/node_modules/grunt/node_modules/nopt/bin/nopt.js deleted file mode 100755 index df90c72..0000000 --- a/node_modules/grunt/node_modules/nopt/bin/nopt.js +++ /dev/null @@ -1,44 +0,0 @@ -#!/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/node_modules/grunt/node_modules/nopt/examples/my-program.js b/node_modules/grunt/node_modules/nopt/examples/my-program.js deleted file mode 100755 index 142447e..0000000 --- a/node_modules/grunt/node_modules/nopt/examples/my-program.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/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/node_modules/grunt/node_modules/nopt/lib/nopt.js b/node_modules/grunt/node_modules/nopt/lib/nopt.js deleted file mode 100644 index ff802da..0000000 --- a/node_modules/grunt/node_modules/nopt/lib/nopt.js +++ /dev/null @@ -1,552 +0,0 @@ -// 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/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE b/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md b/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe..0000000 --- a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/node_modules/grunt/node_modules/nopt/node_modules/abbrev/lib/abbrev.js b/node_modules/grunt/node_modules/nopt/node_modules/abbrev/lib/abbrev.js deleted file mode 100644 index bee4132..0000000 --- a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/lib/abbrev.js +++ /dev/null @@ -1,111 +0,0 @@ - -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/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json b/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json deleted file mode 100644 index 55ed011..0000000 --- a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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" - }, - "_id": "abbrev@1.0.4", - "_from": "abbrev@1" -} diff --git a/node_modules/grunt/node_modules/nopt/package.json b/node_modules/grunt/node_modules/nopt/package.json deleted file mode 100644 index 35c8f64..0000000 --- a/node_modules/grunt/node_modules/nopt/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "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" - }, - "_id": "nopt@1.0.10", - "_from": "nopt@~1.0.10" -} diff --git a/node_modules/grunt/node_modules/rimraf/AUTHORS b/node_modules/grunt/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# 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/node_modules/grunt/node_modules/rimraf/LICENSE b/node_modules/grunt/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/rimraf/README.md b/node_modules/grunt/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `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: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 7d2e681..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index be9951e..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,312 +0,0 @@ -// 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 = require("fs") - -// there is such a thing as TOO graceful. -if (fs.open === gracefulOpen) return - -var queue = [] - , constants = require("constants") - -exports = module.exports = fs -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync - - -// 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 ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.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 - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) -} - - -// (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/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index c539680..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "fs monkey-patching to avoid EMFILE and other problems", - "version": "1.1.14", - "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", - "EMFILE", - "error", - "handling", - "monkeypatch" - ], - "license": "BSD", - "readme": "Just like node's `fs` module, but it does an incremental back-off when\nEMFILE is encountered.\n\nUseful in asynchronous situations where one needs to try to open lots\nand lots of files.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@1.1.14", - "_from": "graceful-fs@~1.1" -} diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index d05f880..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -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/node_modules/grunt/node_modules/rimraf/package.json b/node_modules/grunt/node_modules/rimraf/package.json deleted file mode 100644 index e5441be..0000000 --- a/node_modules/grunt/node_modules/rimraf/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "rimraf", - "version": "2.0.3", - "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" - }, - "optionalDependencies": { - "graceful-fs": "~1.1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "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": "A `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* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~1.1" - }, - "_id": "rimraf@2.0.3", - "_from": "rimraf@~2.0.2" -} diff --git a/node_modules/grunt/node_modules/rimraf/rimraf.js b/node_modules/grunt/node_modules/rimraf/rimraf.js deleted file mode 100644 index 95b2de8..0000000 --- a/node_modules/grunt/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,161 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} - -var lstat = "lstat" -if (process.platform === "win32") { - // not reliable on windows prior to 0.7.9 - var v = process.version.replace(/^v/, '').split(/\.|-/).map(Number) - if (v[0] === 0 && (v[1] < 7 || v[1] == 7 && v[2] < 9)) { - lstat = "stat" - } -} -if (!fs[lstat]) lstat = "stat" -var lstatSync = lstat + "Sync" - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -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 (er.code === "EBUSY" && 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) - }) -} - -function rimraf_ (p, cb) { - fs[lstat](p, function (er, s) { - if (er) { - // already gone - if (er.code === "ENOENT") return cb() - // some other kind of error, permissions, etc. - return cb(er) - } - - return rm_(p, s, false, cb) - }) -} - - -var myGid = function myGid () { - var g = process.getgid && process.getgid() - myGid = function myGid () { return g } - return g -} - -var myUid = function myUid () { - var u = process.getuid && process.getuid() - myUid = function myUid () { return u } - return u -} - - -function writable (s) { - var mode = s.mode || 0777 - , uid = myUid() - , gid = myGid() - return (mode & 0002) - || (gid === s.gid && (mode & 0020)) - || (uid === s.uid && (mode & 0200)) -} - -function rm_ (p, s, didWritableCheck, cb) { - if (!didWritableCheck && !writable(s)) { - // make file writable - // user/group/world, doesn't matter at this point - // since it's about to get nuked. - return fs.chmod(p, s.mode | 0222, function (er) { - if (er) return cb(er) - rm_(p, s, true, cb) - }) - } - - if (!s.isDirectory()) { - return fs.unlink(p, cb) - } - - // directory - fs.readdir(p, function (er, files) { - if (er) return cb(er) - asyncForEach(files.map(function (f) { - return path.join(p, f) - }), function (file, cb) { - rimraf(file, cb) - }, function (er) { - if (er) return cb(er) - fs.rmdir(p, cb) - }) - }) -} - -function asyncForEach (list, fn, cb) { - if (!list.length) cb() - var c = list.length - , errState = null - list.forEach(function (item, i, list) { - fn(item, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- c === 0) return cb() - }) - }) -} - -// this looks simpler, but it will fail with big directory trees, -// or on slow stupid awful cygwin filesystems -function rimrafSync (p) { - try { - var s = fs[lstatSync](p) - } catch (er) { - if (er.code === "ENOENT") return - throw er - } - - if (!writable(s)) { - fs.chmodSync(p, s.mode | 0222) - } - - if (!s.isDirectory()) return fs.unlinkSync(p) - - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt/node_modules/rimraf/test/run.sh b/node_modules/grunt/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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/node_modules/grunt/node_modules/rimraf/test/setup.sh b/node_modules/grunt/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/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/node_modules/grunt/node_modules/rimraf/test/test-async.js b/node_modules/grunt/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt/node_modules/rimraf/test/test-fiber.js b/node_modules/grunt/node_modules/rimraf/test/test-fiber.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/rimraf/test/test-sync.js b/node_modules/grunt/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt/node_modules/underscore.string/.travis.yml b/node_modules/grunt/node_modules/underscore.string/.travis.yml deleted file mode 100644 index ab27b29..0000000 --- a/node_modules/grunt/node_modules/underscore.string/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -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/node_modules/grunt/node_modules/underscore.string/Gemfile b/node_modules/grunt/node_modules/underscore.string/Gemfile deleted file mode 100644 index f024827..0000000 --- a/node_modules/grunt/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source :rubygems - -gem 'serve' -gem 'uglifier' -gem 'rake' \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/Gemfile.lock b/node_modules/grunt/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index a6bb1e7..0000000 --- a/node_modules/grunt/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,34 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - activesupport (3.2.3) - i18n (~> 0.6) - multi_json (~> 1.0) - execjs (1.3.0) - multi_json (~> 1.0) - i18n (0.6.0) - multi_json (1.2.0) - rack (1.4.1) - rack-test (0.6.1) - rack (>= 1.0) - rake (0.9.2.2) - serve (1.5.1) - activesupport (~> 3.0) - i18n - rack (~> 1.2) - rack-test (~> 0.5) - tilt (~> 1.3) - tzinfo - tilt (1.3.3) - tzinfo (0.3.33) - uglifier (1.2.4) - execjs (>= 0.3.0) - multi_json (>= 1.0.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - serve - uglifier diff --git a/node_modules/grunt/node_modules/underscore.string/README.markdown b/node_modules/grunt/node_modules/underscore.string/README.markdown deleted file mode 100644 index d2244b5..0000000 --- a/node_modules/grunt/node_modules/underscore.string/README.markdown +++ /dev/null @@ -1,668 +0,0 @@ -# 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 -``` - -## 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" -``` - -**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'] -``` - -**includes** _.includes(string, substring) - -Tests if string contains a substring. - -```javascript -_.includes("foobar", "ob") -=> true -``` - -**include** available only through _.str object, because Underscore has function with the same name. - -```javascript -_.str.include("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=" ") - -Split string by delimiter (String or RegExp), ' ' by default. - -```javascript -_.words("I love you") -=> ["I","love","you"] - -_.words("I_love_you", "_") -=> ["I","love","you"] - -_.words("I-love-you", /-/) -=> ["I","love","you"] -``` - -**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'; -``` - -**repeat** _.repeat(string, count, [separator]) - -Repeats a string count times. - -```javascript -_.repeat("foo", 3) -=> 'foofoofoo'; - -_.repeat("foo", 3, "bar") -=> 'foobarfoobarfoo' -``` - -**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*** - -## Roadmap ## - -Any suggestions or bug reports are welcome. Just email me or more preferably open an issue. - -## Changelog ## - -### 2.0.0 ### - -* Added prune, humanize functions -* Added _.string (_.str) namespace for Underscore.string library -* Removed includes function - -#### 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 -``` -### 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 ### - -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 ## - -* Esa-Matti Suuronen (), -* Edward Tsech , -* Sasha Koss (), -* Vladimir Dronnikov , -* Pete Kruckenberg (), -* Paul Chavard (), -* Ed Finkler () -* Pavel Pravosud -* Anton Lindqvist () - -## 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/node_modules/grunt/node_modules/underscore.string/Rakefile b/node_modules/grunt/node_modules/underscore.string/Rakefile deleted file mode 100644 index baa164c..0000000 --- a/node_modules/grunt/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,28 +0,0 @@ -# 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') - 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 - pid = spawn('bundle exec serve', err: '/dev/null') - sleep 2 - - puts "Running underscore.string test suite." - result1 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test.html"} - - puts "Running Underscore test suite." - result2 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test_underscore/test.html"} - - Process.kill 'INT', pid - - exit(result1 && result2 ? 0 : 1) -end \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/grunt/node_modules/underscore.string/dist/underscore.string.min.js deleted file mode 100644 index cd436e1..0000000 --- a/node_modules/grunt/node_modules/underscore.string/dist/underscore.string.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){"use strict";var b=String.prototype.trim,c=String.prototype.trimRight,d=String.prototype.trimLeft,e=function(a){return a*1||0},f=function(a,b,c){a+="",b=~~b;for(var d=[];b>0;d[--b]=a);return d.join(c==null?"":c)},g=function(a){return Array.prototype.slice.call(a)},h=function(a){return a!=null?"["+m.escapeRegExp(""+a)+"]":"\\s"},i={lt:"<",gt:">",quot:'"',apos:"'",amp:"&"},j={};for(var k in i)j[i[k]]=k;var l=function(){function a(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}var b=f,c=function(){return c.cache.hasOwnProperty(arguments[0])||(c.cache[arguments[0]]=c.parse(arguments[0])),c.format.call(null,c.cache[arguments[0]],arguments)};return c.format=function(c,d){var e=1,f=c.length,g="",h,i=[],j,k,m,n,o,p;for(j=0;j=0?"+"+h:h,o=m[4]?m[4]=="0"?"0":m[4].charAt(1):" ",p=m[6]-String(h).length,n=m[6]?b(o,p):"",i.push(m[5]?h+n:n+h)}}return i.join("")},c.cache={},c.parse=function(a){var b=a,c=[],d=[],e=0;while(b){if((c=/^[^\x25]+/.exec(b))!==null)d.push(c[0]);else if((c=/^\x25{2}/.exec(b))!==null)d.push("%");else{if((c=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(b))===null)throw new Error("[_.sprintf] huh?");if(c[2]){e|=1;var f=[],g=c[2],h=[];if((h=/^([a-z_][a-z_\d]*)/i.exec(g))===null)throw new Error("[_.sprintf] huh?");f.push(h[1]);while((g=g.substring(h[0].length))!=="")if((h=/^\.([a-z_][a-z_\d]*)/i.exec(g))!==null)f.push(h[1]);else{if((h=/^\[(\d+)\]/.exec(g))===null)throw new Error("[_.sprintf] huh?");f.push(h[1])}c[2]=f}else e|=2;if(e===3)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");d.push(c)}b=b.substring(c[0].length)}return d},c}(),m={VERSION:"2.1.1",isBlank:function(a){return/^\s*$/.test(a)},stripTags:function(a){return(""+a).replace(/<\/?[^>]+>/g,"")},capitalize:function(a){return a+="",a.charAt(0).toUpperCase()+a.substring(1)},chop:function(a,b){a+="",b=~~b||a.length;var c=[];for(var d=0;d"']/g,function(a){return"&"+j[a]+";"})},unescapeHTML:function(a){return(""+a).replace(/\&([^;]+);/g,function(a,b){var c;return b in i?i[b]:(c=b.match(/^#x([\da-fA-F]+)$/))?String.fromCharCode(parseInt(c[1],16)):(c=b.match(/^#(\d+)$/))?String.fromCharCode(~~c[1]):a})},escapeRegExp:function(a){return a.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},insert:function(a,b,c){var d=m.chars(a);return d.splice(~~b,0,""+c),d.join("")},include:function(a,b){return!!~(""+a).indexOf(b)},join:function(){var a=g(arguments);return a.join(a.shift())},lines:function(a){return(""+a).split("\n")},reverse:function(a){return m.chars(a).reverse().join("")},splice:function(a,b,c,d){var e=m.chars(a);return e.splice(~~b,~~c,d),e.join("")},startsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substring(0,b.length)===b},endsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substring(a.length-b.length)===b},succ:function(a){a+="";var b=m.chars(a);return b.splice(a.length-1,1,String.fromCharCode(a.charCodeAt(a.length-1)+1)),b.join("")},titleize:function(a){return(""+a).replace(/\b./g,function(a){return a.toUpperCase()})},camelize:function(a){return m.trim(a).replace(/[-_\s]+(.)?/g,function(a,b){return b&&b.toUpperCase()})},underscored:function(a){return m.trim(a).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(a){return m.trim(a).replace(/[_\s]+/g,"-").replace(/([A-Z])/g,"-$1").replace(/-+/g,"-").toLowerCase()},classify:function(a){return a+="",m.titleize(a.replace(/_/g," ")).replace(/\s/g,"")},humanize:function(a){return m.capitalize(this.underscored(a).replace(/_id$/,"").replace(/_/g," "))},trim:function(a,c){return a+="",!c&&b?b.call(a):(c=h(c),a.replace(new RegExp("^"+c+"+|"+c+"+$","g"),""))},ltrim:function(a,b){return a+="",!b&&d?d.call(a):(b=h(b),a.replace(new RegExp("^"+b+"+"),""))},rtrim:function(a,b){return a+="",!b&&c?c.call(a):(b=h(b),a.replace(new RegExp(b+"+$"),""))},truncate:function(a,b,c){return a+="",c=c||"...",b=~~b,a.length>b?a.slice(0,b)+c:a},prune:function(a,b,c){a+="",b=~~b,c=c!=null?""+c:"...";var d,e,f=a.replace(/\W/g,function(a){return a.toUpperCase()!==a.toLowerCase()?"A":" "});return e=f.charAt(b),d=f.slice(0,b),e&&e.match(/\S/)&&(d=d.replace(/\s\S+$/,"")),d=m.rtrim(d),(d+c).length>a.length?a:a.substring(0,d.length)+c},words:function(a,b){return m.trim(a,b).split(b||/\s+/)},pad:function(a,b,c,d){a+="";var e=0;b=~~b,c?c.length>1&&(c=c.charAt(0)):c=" ";switch(d){case"right":return e=b-a.length,a+f(c,e);case"both":return e=b-a.length,f(c,Math.ceil(e/2))+a+f(c,Math.floor(e/2));default:return e=b-a.length,f(c,e)+a}},lpad:function(a,b,c){return m.pad(a,b,c)},rpad:function(a,b,c){return m.pad(a,b,c,"right")},lrpad:function(a,b,c){return m.pad(a,b,c,"both")},sprintf:l,vsprintf:function(a,b){return b.unshift(a),l.apply(null,b)},toNumber:function(a,b){a+="";var c=e(e(a).toFixed(~~b));return c===0&&!a.match(/^0+$/)?Number.NaN:c},strRight:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.indexOf(b):-1;return~c?a.slice(c+b.length,a.length):a},strRightBack:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.lastIndexOf(b):-1;return~c?a.slice(c+b.length,a.length):a},strLeft:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.indexOf(b):-1;return~c?a.slice(0,c):a},strLeftBack:function(a,b){a+="",b=b!=null?""+b:b;var c=a.lastIndexOf(b);return~c?a.slice(0,c):a},toSentence:function(a,b,c){b||(b=", "),c||(c=" and ");var d=a.length,e="";for(var f=0;f -// Underscore.strings 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.2.0rc - -(function(root){ - '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, separator){ - // ~~var — is the fastest available way to convert anything to Integer in javascript. - // We'll use it extensively in this lib. - str += ''; qty = ~~qty; - for (var repeat = []; qty > 0; repeat[--qty] = str) {} - return repeat.join(separator == null ? '' : separator); - }; - - var slice = function(a){ - return Array.prototype.slice.call(a); - }; - - var defaultToWhiteSpace = function(characters){ - if (characters != null) { - return '[' + _s.escapeRegExp(''+characters) + ']'; - } - return '\\s'; - }; - - var escapeChars = { - lt: '<', - gt: '>', - quot: '"', - apos: "'", - amp: '&' - }; - - var reversedEscapeChars = {}; - for(var key in escapeChars){ reversedEscapeChars[escapeChars[key]] = key; } - - // 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.2.0rc', - - isBlank: function(str){ - return (/^\s*$/).test(str); - }, - - stripTags: function(str){ - return (''+str).replace(/<\/?[^>]+>/g, ''); - }, - - capitalize : function(str) { - str += ''; - return str.charAt(0).toUpperCase() + str.substring(1); - }, - - chop: function(str, step){ - str = str+''; - step = ~~step || str.length; - var arr = []; - for (var i = 0; i < str.length; i += step) - arr.push(str.slice(i,i + step)); - return arr; - }, - - clean: function(str){ - return _s.strip(str).replace(/\s+/g, ' '); - }, - - count: function(str, substr){ - str += ''; substr += ''; - return str.split(substr).length - 1; - }, - - chars: function(str) { - return (''+str).split(''); - }, - - escapeHTML: function(str) { - return (''+str).replace(/[&<>"']/g, function(match){ return '&' + reversedEscapeChars[match] + ';'; }); - }, - - unescapeHTML: function(str) { - return (''+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){ - // From MooTools core 1.2.4 - return str.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1'); - }, - - insert: function(str, i, substr){ - var arr = _s.chars(str); - arr.splice(~~i, 0, ''+substr); - return arr.join(''); - }, - - include: function(str, needle){ - return !!~(''+str).indexOf(needle); - }, - - join: function() { - var args = slice(arguments); - return args.join(args.shift()); - }, - - lines: function(str) { - return (''+str).split("\n"); - }, - - reverse: function(str){ - return _s.chars(str).reverse().join(''); - }, - - splice: function(str, i, howmany, substr){ - var arr = _s.chars(str); - arr.splice(~~i, ~~howmany, substr); - return arr.join(''); - }, - - startsWith: function(str, starts){ - str += ''; starts += ''; - return str.length >= starts.length && str.substring(0, starts.length) === starts; - }, - - endsWith: function(str, ends){ - str += ''; ends += ''; - return str.length >= ends.length && str.substring(str.length - ends.length) === ends; - }, - - succ: function(str){ - str += ''; - var arr = _s.chars(str); - arr.splice(str.length-1, 1, String.fromCharCode(str.charCodeAt(str.length-1) + 1)); - return arr.join(''); - }, - - titleize: function(str){ - return (''+str).replace(/\b./g, function(ch){ return ch.toUpperCase(); }); - }, - - camelize: function(str){ - return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, chr){ - return chr && chr.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(/[_\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase(); - }, - - classify: function(str){ - str += ''; - return _s.titleize(str.replace(/_/g, ' ')).replace(/\s/g, '') - }, - - humanize: function(str){ - return _s.capitalize(this.underscored(str).replace(/_id$/,'').replace(/_/g, ' ')); - }, - - trim: function(str, characters){ - str += ''; - if (!characters && nativeTrim) { return nativeTrim.call(str); } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); - }, - - ltrim: function(str, characters){ - str+=''; - if (!characters && nativeTrimLeft) { - return nativeTrimLeft.call(str); - } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp('^' + characters + '+'), ''); - }, - - rtrim: function(str, characters){ - str+=''; - if (!characters && nativeTrimRight) { - return nativeTrimRight.call(str); - } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp(characters + '+$'), ''); - }, - - truncate: function(str, length, truncateStr){ - 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/sergiokas - */ - prune: function(str, length, pruneStr){ - str += ''; length = ~~length; - pruneStr = pruneStr != null ? ''+pruneStr : '...'; - - var pruned, borderChar, template = str.replace(/\W/g, function(ch){ - return (ch.toUpperCase() !== ch.toLowerCase()) ? 'A' : ' '; - }); - - borderChar = template.charAt(length); - - pruned = template.slice(0, length); - - // Check if we're in the middle of a word - if (borderChar && borderChar.match(/\S/)) - pruned = pruned.replace(/\s\S+$/, ''); - - pruned = _s.rtrim(pruned); - - return (pruned+pruneStr).length > str.length ? str : str.substring(0, pruned.length)+pruneStr; - }, - - words: function(str, delimiter) { - return _s.trim(str, delimiter).split(delimiter || /\s+/); - }, - - pad: function(str, length, padStr, type) { - str += ''; - - var padlen = 0; - - length = ~~length; - - 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) { - str += ''; - var num = parseNumber(parseNumber(str).toFixed(~~decimals)); - return num === 0 && !str.match(/^0+$/) ? Number.NaN : num; - }, - - strRight: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.indexOf(sep); - return ~pos ? str.slice(pos+sep.length, str.length) : str; - }, - - strRightBack: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.lastIndexOf(sep); - return ~pos ? str.slice(pos+sep.length, str.length) : str; - }, - - strLeft: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.indexOf(sep); - return ~pos ? str.slice(0, pos) : str; - }, - - strLeftBack: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = str.lastIndexOf(sep); - return ~pos ? str.slice(0, pos) : str; - }, - - toSentence: function(array, separator, lastSeparator) { - separator || (separator = ', '); - lastSeparator || (lastSeparator = ' and '); - var length = array.length, str = ''; - - for (var i = 0; i < length; i++) { - str += array[i]; - if (i === (length - 2)) { str += lastSeparator; } - else if (i < (length - 1)) { str += separator; } - } - - return str; - }, - - slugify: function(str) { - var from = "ąàáäâãćęèéëêìíïîłńòóöôõùúüûñçżź", - to = "aaaaaaceeeeeiiiilnooooouuuunczz", - regex = new RegExp(defaultToWhiteSpace(from), 'g'); - - str = (''+str).toLowerCase(); - - str = str.replace(regex, function(ch){ - var index = from.indexOf(ch); - return to.charAt(index) || '-'; - }); - - return _s.trim(str.replace(/[^\w\s-]/g, '').replace(/[-\s]+/g, '-'), '-'); - }, - - exports: function() { - var result = {}; - - for (var prop in this) { - if (!this.hasOwnProperty(prop) || ~_s.words('include contains reverse').indexOf(prop)) continue; - result[prop] = this[prop]; - } - - return result; - }, - - repeat: strRepeat - }; - - // 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; - - // CommonJS module is defined - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - // Export module - module.exports = _s; - } - exports._s = _s; - - } else if (typeof define === 'function' && define.amd) { - // Register as a named module with AMD. - define('underscore.string', function() { - return _s; - }); - - } else { - // Integrate with Underscore.js if defined - // or create our own underscore object. - root._ = root._ || {}; - root._.string = root._.str = _s; - } - -}(this || window)); diff --git a/node_modules/grunt/node_modules/underscore.string/package.json b/node_modules/grunt/node_modules/underscore.string/package.json deleted file mode 100644 index 5a5a895..0000000 --- a/node_modules/grunt/node_modules/underscore.string/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "underscore.string", - "version": "2.2.1", - "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": "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": "" - }, - { - "name": "Pavel Pravosud", - "email": "rwz@duckroll.ru" - } - ], - "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## 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**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**includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\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**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=\" \")\n\nSplit string by delimiter (String or RegExp), ' ' 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\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**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**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## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n## Changelog ##\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\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### 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\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\n* Esa-Matti Suuronen (),\n* Edward Tsech ,\n* Sasha Koss (),\n* Vladimir Dronnikov ,\n* Pete Kruckenberg (),\n* Paul Chavard (),\n* Ed Finkler ()\n* Pavel Pravosud \n* Anton Lindqvist ()\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.2.1", - "_from": "underscore.string@~2.2.0rc" -} diff --git a/node_modules/grunt/node_modules/underscore.string/test/run-qunit.js b/node_modules/grunt/node_modules/underscore.string/test/run-qunit.js deleted file mode 100644 index 326658e..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/run-qunit.js +++ /dev/null @@ -1,44 +0,0 @@ -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 page = new WebPage() - -page.onConsoleMessage = function(msg) { - console.log(msg) -} - -page.open(phantom.args[0], 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/node_modules/grunt/node_modules/underscore.string/test/speed.js b/node_modules/grunt/node_modules/underscore.string/test/speed.js deleted file mode 100644 index 4346414..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/speed.js +++ /dev/null @@ -1,138 +0,0 @@ -(function() { - - 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/node_modules/grunt/node_modules/underscore.string/test/strings.js b/node_modules/grunt/node_modules/underscore.string/test/strings.js deleted file mode 100644 index f700abf..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/strings.js +++ /dev/null @@ -1,438 +0,0 @@ -$(document).ready(function() { - - // Include Underscore.string methods to Underscore namespace - _.mixin(_.str.exports()); - - module("String extensions"); - - test("Strings: trim", function() { - equals(_.trim(123), "123", "Non string"); - equals(_(" foo").trim(), "foo"); - equals(_("foo ").trim(), "foo"); - equals(_(" foo ").trim(), "foo"); - equals(_(" foo ").trim(), "foo"); - equals(_(" foo ", " ").trim(), "foo", "Manually set whitespace"); - - equals(_("ffoo").trim("f"), "oo"); - equals(_("ooff").trim("f"), "oo"); - equals(_("ffooff").trim("f"), "oo"); - - - equals(_("_-foobar-_").trim("_-"), "foobar"); - - equals(_("http://foo/").trim("/"), "http://foo"); - equals(_("c:\\").trim('\\'), "c:"); - - equals(_(123).trim(), '123'); - equals(_(123).trim(3), '12'); - }); - - test("Strings: ltrim", function() { - equals(_(" foo").ltrim(), "foo"); - equals(_(" foo").ltrim(), "foo"); - equals(_("foo ").ltrim(), "foo "); - equals(_(" foo ").ltrim(), "foo "); - - - equals(_("ffoo").ltrim("f"), "oo"); - equals(_("ooff").ltrim("f"), "ooff"); - equals(_("ffooff").ltrim("f"), "ooff"); - - equals(_("_-foobar-_").ltrim("_-"), "foobar-_"); - - equals(_(123).ltrim(1), '23'); - }); - - test("Strings: rtrim", function() { - equals(_("http://foo/").rtrim("/"), "http://foo", 'clean trailing slash'); - equals(_(" foo").rtrim(), " foo"); - equals(_("foo ").rtrim(), "foo"); - equals(_("foo ").rtrim(), "foo"); - equals(_("foo bar ").rtrim(), "foo bar"); - equals(_(" foo ").rtrim(), " foo"); - - equals(_("ffoo").rtrim("f"), "ffoo"); - equals(_("ooff").rtrim("f"), "oo"); - equals(_("ffooff").rtrim("f"), "ffoo"); - - equals(_("_-foobar-_").rtrim("_-"), "_-foobar"); - - equals(_(123).rtrim(3), '12'); - }); - - test("Strings: capitalize", function() { - equals(_("fabio").capitalize(), "Fabio", 'First letter is upper case'); - equals(_.capitalize("fabio"), "Fabio", 'First letter is upper case'); - equals(_.capitalize('FOO'), 'FOO', 'Other letters unchanged'); - equals(_(123).capitalize(), "123", "Non string"); - }); - - test("Strings: join", function() { - equals(_.join("", "foo", "bar"), "foobar", 'basic join'); - equals(_.join("", 1, "foo", 2), "1foo2", 'join numbers and strings'); - equals(_.join(" ","foo", "bar"), "foo bar", 'join with spaces'); - equals(_.join("1", "2", "2"), "212", 'join number strings'); - equals(_.join(1, 2, 2), "212", 'join numbers'); - equals(_(" ").join("foo", "bar"), "foo bar", 'join object oriented'); - }); - - test("Strings: reverse", function() { - equals(_.str.reverse("foo"), "oof" ); - equals(_.str.reverse("foobar"), "raboof" ); - equals(_.str.reverse("foo bar"), "rab oof" ); - equals(_.str.reverse("saippuakauppias"), "saippuakauppias" ); - equals(_.str.reverse(123), "321", "Non string"); - equals(_.str.reverse(123.45), "54.321", "Non string"); - }); - - test("Strings: clean", function() { - equals(_(" foo bar ").clean(), "foo bar"); - equals(_(123).clean(), "123"); - }); - - test("Strings: sprintf", function() { - // Should be very tested function already. Thanks to - // http://www.diveintojavascript.com/projects/sprintf-for-javascript - equals(_.sprintf("Hello %s", "me"), "Hello me", 'basic'); - equals(_("Hello %s").sprintf("me"), "Hello me", 'object'); - equals(_("hello %s").chain().sprintf("me").capitalize().value(), "Hello me", 'Chaining works'); - equals(_.sprintf("%.1f", 1.22222), "1.2", 'round'); - equals(_.sprintf("%.1f", 1.17), "1.2", 'round 2'); - equals(_.sprintf("%(id)d - %(name)s", {id: 824, name: "Hello World"}), "824 - Hello World", 'Named replacements work'); - equals(_.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() { - equals(_.vsprintf("Hello %s", ["me"]), "Hello me", 'basic'); - equals(_("Hello %s").vsprintf(["me"]), "Hello me", 'object'); - equals(_("hello %s").chain().vsprintf(["me"]).capitalize().value(), "Hello me", 'Chaining works'); - equals(_.vsprintf("%.1f", [1.22222]), "1.2", 'round'); - equals(_.vsprintf("%.1f", [1.17]), "1.2", 'round 2'); - equals(_.vsprintf("%(id)d - %(name)s", [{id: 824, name: "Hello World"}]), "824 - Hello World", 'Named replacement works'); - equals(_.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'); - }); - - 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'); - }); - - 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'); - }); - - 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(){ - equals(_.clean(' foo bar '), 'foo bar'); - equals(_.clean(1), '1'); - }); - - test('String: count', function(){ - equals(_('Hello world').count('l'), 3); - equals(_('Hello world').count('Hello'), 1); - equals(_('Hello world').count('foo'), 0); - equals(_('x.xx....x.x').count('x'), 5); - equals(_(12345).count(1), 1); - equals(_(11345).count(1), 2); - }); - - test('String: insert', function(){ - equals(_('Hello ').insert(6, 'Jessy'), 'Hello Jessy'); - equals(_('Hello ').insert(100, 'Jessy'), 'Hello Jessy'); - equals(_(12345).insert(6, 'Jessy'), '12345Jessy'); - }); - - test('String: splice', function(){ - equals(_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'), - 'https://edtsech@bitbucket.org/epeli/underscore.strings'); - equals(_.splice(12345, 1, 2, 321), '132145', 'Non strings'); - }); - - test('String: succ', function(){ - equals(_('a').succ(), 'b'); - equals(_('A').succ(), 'B'); - equals(_('+').succ(), ','); - equals(_(1).succ(), '2'); - }); - - test('String: titleize', function(){ - equals(_('the titleize string method').titleize(), 'The Titleize String Method'); - equals(_('the titleize string method').titleize(), 'The Titleize String Method'); - equals(_(123).titleize(), '123'); - }); - - test('String: camelize', function(){ - equals(_('the_camelize_string_method').camelize(), 'theCamelizeStringMethod'); - equals(_('-the-camelize-string-method').camelize(), 'TheCamelizeStringMethod'); - equals(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_(' the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_(123).camelize(), '123'); - }); - - test('String: underscored', function(){ - equals(_('the-underscored-string-method').underscored(), 'the_underscored_string_method'); - equals(_('theUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equals(_('TheUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equals(_(' the underscored string method').underscored(), 'the_underscored_string_method'); - equals(_(123).underscored(), '123'); - }); - - test('String: dasherize', function(){ - equals(_('the_dasherize_string_method').dasherize(), 'the-dasherize-string-method'); - equals(_('TheDasherizeStringMethod').dasherize(), '-the-dasherize-string-method'); - equals(_('thisIsATest').dasherize(), 'this-is-a-test'); - equals(_('this Is A Test').dasherize(), 'this-is-a-test'); - equals(_('thisIsATest123').dasherize(), 'this-is-a-test123'); - equals(_('123thisIsATest').dasherize(), '123this-is-a-test'); - equals(_('the dasherize string method').dasherize(), 'the-dasherize-string-method'); - equals(_('the dasherize string method ').dasherize(), 'the-dasherize-string-method'); - equals(_('téléphone').dasherize(), 'téléphone'); - equals(_('foo$bar').dasherize(), 'foo$bar'); - equals(_(123).dasherize(), '123'); - }); - - test('String: camelize', function(){ - equals(_.camelize('-moz-transform'), 'MozTransform'); - equals(_.camelize('webkit-transform'), 'webkitTransform'); - equals(_.camelize('under_scored'), 'underScored'); - equals(_.camelize(' with spaces'), 'withSpaces'); - }); - - test('String: join', function(){ - equals(_.join(1, 2, 3, 4), '21314'); - equals(_.join('|', 'foo', 'bar', 'baz'), 'foo|bar|baz'); - }); - - test('String: classify', function(){ - equals(_.classify(1), '1'); - equals(_('some_class_name').classify(), 'SomeClassName'); - }); - - test('String: humanize', function(){ - equals(_('the_humanize_string_method').humanize(), 'The humanize string method'); - equals(_('ThehumanizeStringMethod').humanize(), 'Thehumanize string method'); - equals(_('the humanize string method').humanize(), 'The humanize string method'); - equals(_('the humanize_id string method_id').humanize(), 'The humanize id string method'); - equals(_('the humanize string method ').humanize(), 'The humanize string method'); - equals(_(' capitalize dash-CamelCase_underscore trim ').humanize(), 'Capitalize dash camel case underscore trim'); - equals(_(123).humanize(), '123'); - }); - - test('String: truncate', function(){ - equals(_('Hello world').truncate(6, 'read more'), 'Hello read more'); - equals(_('Hello world').truncate(5), 'Hello...'); - equals(_('Hello').truncate(10), 'Hello'); - equals(_(1234567890).truncate(5), '12345...'); - }); - - test('String: prune', function(){ - equals(_('Hello, cruel world').prune(6, ' read more'), 'Hello read more'); - equals(_('Hello, world').prune(5, 'read a lot more'), 'Hello, world'); - equals(_('Hello, world').prune(5), 'Hello...'); - equals(_('Hello, world').prune(8), 'Hello...'); - equals(_('Hello, cruel world').prune(15), 'Hello, cruel...'); - equals(_('Hello world').prune(22), 'Hello world'); - equals(_('Привет, жестокий мир').prune(6, ' read more'), 'Привет read more'); - equals(_('Привет, мир').prune(6, 'read a lot more'), 'Привет, мир'); - equals(_('Привет, мир').prune(6), 'Привет...'); - equals(_('Привет, мир').prune(8), 'Привет...'); - equals(_('Привет, жестокий мир').prune(16), 'Привет, жестокий...'); - equals(_('Привет, мир').prune(22), 'Привет, мир'); - equals(_(123).prune(10), '123'); - equals(_(123).prune(1,1), '11'); - }); - - test('String: isBlank', function(){ - ok(_('').isBlank()); - ok(_(' ').isBlank()); - ok(_('\n').isBlank()); - ok(!_('a').isBlank()); - ok(!_('0').isBlank()); - ok(!_(0).isBlank()); - }); - - test('String: escapeHTML', function(){ - equals(_('
                            Blah & "blah" & \'blah\'
                            ').escapeHTML(), - '<div>Blah & "blah" & 'blah'</div>'); - equals(_('<').escapeHTML(), '&lt;'); - equals(_(5).escapeHTML(), '5'); - // equals(_(undefined).escapeHTML(), ''); - }); - - test('String: unescapeHTML', function(){ - equals(_('<div>Blah & "blah" & 'blah'</div>').unescapeHTML(), - '
                            Blah & "blah" & \'blah\'
                            '); - equals(_('&lt;').unescapeHTML(), '<'); - equals(_(''').unescapeHTML(), "'"); - equals(_(''').unescapeHTML(), "'"); - equals(_('J').unescapeHTML(), "J"); - equals(_('J').unescapeHTML(), "J"); - equals(_('J').unescapeHTML(), "J"); - equals(_('&_#39;').unescapeHTML(), "&_#39;"); - equals(_(''_;').unescapeHTML(), "'_;"); - equals(_('&#38;').unescapeHTML(), "&"); - equals(_('&amp;').unescapeHTML(), "&"); - equals(_(5).unescapeHTML(), '5'); - // equals(_(undefined).unescapeHTML(), ''); - }); - - test('String: words', function() { - equals(_("I love you!").words().length, 3); - equals(_(" I love you! ").words().length, 3); - equals(_("I_love_you!").words('_').length, 3); - equals(_("I-love-you!").words(/-/).length, 3); - equals(_(123).words().length, 1); - }); - - test('String: chars', function() { - equals(_("Hello").chars().length, 5); - equals(_(123).chars().length, 3); - }); - - test('String: lines', function() { - equals(_("Hello\nWorld").lines().length, 2); - equals(_("Hello World").lines().length, 1); - equals(_(123).lines().length, 1); - }); - - test('String: pad', function() { - equals(_("1").pad(8), ' 1'); - equals(_(1).pad(8), ' 1'); - equals(_("1").pad(8, '0'), '00000001'); - equals(_("1").pad(8, '0', 'left'), '00000001'); - equals(_("1").pad(8, '0', 'right'), '10000000'); - equals(_("1").pad(8, '0', 'both'), '00001000'); - equals(_("foo").pad(8, '0', 'both'), '000foo00'); - equals(_("foo").pad(7, '0', 'both'), '00foo00'); - equals(_("foo").pad(7, '!@$%dofjrofj', 'both'), '!!foo!!'); - }); - - test('String: lpad', function() { - equals(_("1").lpad(8), ' 1'); - equals(_(1).lpad(8), ' 1'); - equals(_("1").lpad(8, '0'), '00000001'); - equals(_("1").lpad(8, '0', 'left'), '00000001'); - }); - - test('String: rpad', function() { - equals(_("1").rpad(8), '1 '); - equals(_(1).lpad(8), ' 1'); - equals(_("1").rpad(8, '0'), '10000000'); - equals(_("foo").rpad(8, '0'), 'foo00000'); - equals(_("foo").rpad(7, '0'), 'foo0000'); - }); - - test('String: lrpad', function() { - equals(_("1").lrpad(8), ' 1 '); - equals(_(1).lrpad(8), ' 1 '); - equals(_("1").lrpad(8, '0'), '00001000'); - equals(_("foo").lrpad(8, '0'), '000foo00'); - equals(_("foo").lrpad(7, '0'), '00foo00'); - equals(_("foo").lrpad(7, '!@$%dofjrofj'), '!!foo!!'); - }); - - test('String: toNumber', function() { - deepEqual(_("not a number").toNumber(), Number.NaN); - equals(_(0).toNumber(), 0); - equals(_("0").toNumber(), 0); - equals(_("0000").toNumber(), 0); - equals(_("2.345").toNumber(), 2); - equals(_("2.345").toNumber(NaN), 2); - equals(_("2.345").toNumber(2), 2.35); - equals(_("2.344").toNumber(2), 2.34); - equals(_("2").toNumber(2), 2.00); - equals(_(2).toNumber(2), 2.00); - equals(_(-2).toNumber(), -2); - equals(_("-2").toNumber(), -2); - }); - - test('String: strRight', function() { - equals(_("This_is_a_test_string").strRight("_"), "is_a_test_string"); - equals(_("This_is_a_test_string").strRight("string"), ""); - equals(_("This_is_a_test_string").strRight(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRight(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRight("-"), "This_is_a_test_string"); - equals(_(12345).strRight(2), "345"); - }); - - test('String: strRightBack', function() { - equals(_("This_is_a_test_string").strRightBack("_"), "string"); - equals(_("This_is_a_test_string").strRightBack("string"), ""); - equals(_("This_is_a_test_string").strRightBack(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRightBack(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRightBack("-"), "This_is_a_test_string"); - equals(_(12345).strRightBack(2), "345"); - }); - - test('String: strLeft', function() { - equals(_("This_is_a_test_string").strLeft("_"), "This"); - equals(_("This_is_a_test_string").strLeft("This"), ""); - equals(_("This_is_a_test_string").strLeft(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeft(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeft("-"), "This_is_a_test_string"); - equals(_(123454321).strLeft(3), "12"); - }); - - test('String: strLeftBack', function() { - equals(_("This_is_a_test_string").strLeftBack("_"), "This_is_a_test"); - equals(_("This_is_a_test_string").strLeftBack("This"), ""); - equals(_("This_is_a_test_string").strLeftBack(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeftBack(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeftBack("-"), "This_is_a_test_string"); - equals(_(123454321).strLeftBack(3), "123454"); - }); - - test('Strings: stripTags', function() { - equals(_('a link').stripTags(), 'a link'); - equals(_('a link - - - - - - - - -

                            Underscore.string Test Suite

                            -

                            -

                            -
                              -
                              -

                              Underscore.string Speed Suite

                              - -
                              - - diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html b/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c17..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Underscore.strings Test Suite - - - - - - - - -

                              Underscore.string Test Suite

                              -

                              -

                              -
                                - - diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/arrays.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/arrays.js deleted file mode 100644 index b3b1ce1..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/arrays.js +++ /dev/null @@ -1,166 +0,0 @@ -$(document).ready(function() { - - module("Arrays"); - - test("arrays: first", function() { - equals(_.first([1,2,3]), 1, 'can pull out the first element of an array'); - equals(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"'); - equals(_.first([1,2,3], 0).join(', '), "", 'can pass an index to first'); - equals(_.first([1,2,3], 2).join(', '), '1, 2', 'can pass an index to first'); - equals(_.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); - equals(result, 4, 'works on an arguments object.'); - result = _.map([[1,2,3],[1,2,3]], _.first); - equals(result.join(','), '1,1', 'works well with _.map'); - }); - - test("arrays: rest", function() { - var numbers = [1, 2, 3, 4]; - equals(_.rest(numbers).join(", "), "2, 3, 4", 'working rest()'); - equals(_.rest(numbers, 0).join(", "), "1, 2, 3, 4", 'working rest(0)'); - equals(_.rest(numbers, 2).join(', '), '3, 4', 'rest can take an index'); - var result = (function(){ return _(arguments).tail(); })(1, 2, 3, 4); - equals(result.join(', '), '2, 3, 4', 'aliased as tail and works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.rest); - equals(_.flatten(result).join(','), '2,3,2,3', 'works well with _.map'); - }); - - test("arrays: initial", function() { - equals(_.initial([1,2,3,4,5]).join(", "), "1, 2, 3, 4", 'working initial()'); - equals(_.initial([1,2,3,4],2).join(", "), "1, 2", 'initial can take an index'); - var result = (function(){ return _(arguments).initial(); })(1, 2, 3, 4); - equals(result.join(", "), "1, 2, 3", 'initial works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.initial); - equals(_.flatten(result).join(','), '1,2,1,2', 'initial works with _.map'); - }); - - test("arrays: last", function() { - equals(_.last([1,2,3]), 3, 'can pull out the last element of an array'); - equals(_.last([1,2,3], 0).join(', '), "", 'can pass an index to last'); - equals(_.last([1,2,3], 2).join(', '), '2, 3', 'can pass an index to last'); - equals(_.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); - equals(result, 4, 'works on an arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.last); - equals(result.join(','), '3,3', 'works well with _.map'); - }); - - test("arrays: compact", function() { - equals(_.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); - equals(result, 3, 'works on an arguments object'); - }); - - test("arrays: flatten", function() { - if (window.JSON) { - var list = [1, [2], [3, [[[4]]]]]; - equals(JSON.stringify(_.flatten(list)), '[1,2,3,4]', 'can flatten nested arrays'); - equals(JSON.stringify(_.flatten(list, true)), '[1,2,3,[[[4]]]]', 'can shallowly flatten nested arrays'); - var result = (function(){ return _.flatten(arguments); })(1, [2], [3, [[[4]]]]); - equals(JSON.stringify(result), '[1,2,3,4]', 'works on an arguments object'); - } - }); - - test("arrays: without", function() { - var list = [1, 2, 1, 0, 3, 1, 4]; - equals(_.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); - equals(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("arrays: uniq", function() { - var list = [1, 2, 1, 3, 1, 4]; - equals(_.uniq(list).join(', '), '1, 2, 3, 4', 'can find the unique values of an unsorted array'); - - var list = [1, 1, 1, 2, 2, 3]; - equals(_.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; }; - equals(_.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]; - equals(_.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); - equals(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); - }); - - test("arrays: intersection", function() { - var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho']; - equals(_.intersection(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays'); - equals(_(stooges).intersection(leaders).join(''), 'moe', 'can perform an OO-style intersection'); - var result = (function(){ return _.intersection(arguments, leaders); })('moe', 'curly', 'larry'); - equals(result.join(''), 'moe', 'works on an arguments object'); - }); - - test("arrays: union", function() { - var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]); - equals(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]]); - equals(result.join(' '), '1 2 3 30 40 1', 'takes the union of a list of nested arrays'); - }); - - test("arrays: difference", function() { - var result = _.difference([1, 2, 3], [2, 30, 40]); - equals(result.join(' '), '1 3', 'takes the difference of two arrays'); - - var result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]); - equals(result.join(' '), '3 4', 'takes the difference of three arrays'); - }); - - test('arrays: zip', function() { - var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true]; - var stooges = _.zip(names, ages, leaders); - equals(String(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths'); - }); - - test("arrays: indexOf", function() { - var numbers = [1, 2, 3]; - numbers.indexOf = null; - equals(_.indexOf(numbers, 2), 1, 'can compute indexOf, even without the native function'); - var result = (function(){ return _.indexOf(arguments, 2); })(1, 2, 3); - equals(result, 1, 'works on an arguments object'); - equals(_.indexOf(null, 2), -1, 'handles nulls properly'); - - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.indexOf(numbers, num, true); - equals(index, -1, '35 is not in the list'); - - numbers = [10, 20, 30, 40, 50]; num = 40; - index = _.indexOf(numbers, num, true); - equals(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); - equals(index, 1, '40 is in the list'); - }); - - test("arrays: lastIndexOf", function() { - var numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0]; - numbers.lastIndexOf = null; - equals(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function'); - equals(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element'); - var result = (function(){ return _.lastIndexOf(arguments, 1); })(1, 0, 1, 0, 0, 1, 0, 0, 0); - equals(result, 5, 'works on an arguments object'); - equals(_.indexOf(null, 2), -1, 'handles nulls properly'); - }); - - test("arrays: range", function() { - equals(_.range(0).join(''), '', 'range with 0 as a first argument generates an empty array'); - equals(_.range(4).join(' '), '0 1 2 3', 'range with a single positive argument generates an array of elements 0,1,2,...,n-1'); - equals(_.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'); - equals(_.range(8, 5).join(''), '', 'range with two arguments a & b, b<a generates an empty array'); - equals(_.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'); - equals(_.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'); - equals(_.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'); - equals(_.range(0, -10, -1).join(' '), '0 -1 -2 -3 -4 -5 -6 -7 -8 -9', 'final example in the Python docs'); - }); - -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/chaining.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/chaining.js deleted file mode 100644 index 0e3d5f3..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/chaining.js +++ /dev/null @@ -1,59 +0,0 @@ -$(document).ready(function() { - - module("Chaining"); - - test("chaining: 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("chaining: 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(); - equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("chaining: 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(); - equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("chaining: 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(); - equals(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); - }); - -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/collections.js deleted file mode 100644 index cff9763..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/collections.js +++ /dev/null @@ -1,270 +0,0 @@ -$(document).ready(function() { - - module("Collections"); - - test("collections: each", function() { - _.each([1, 2, 3], function(num, i) { - equals(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}); - equals(answers.join(', '), '5, 10, 15', 'context object property accessed'); - - answers = []; - _.forEach([1, 2, 3], function(num){ answers.push(num); }); - equals(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); }); - equals(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; }); - equals(answers, 0, 'handles a null properly'); - }); - - test('collections: map', function() { - var doubled = _.map([1, 2, 3], function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'doubled numbers'); - - doubled = _.collect([1, 2, 3], function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'aliased as "collect"'); - - var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier : 3}); - equals(tripled.join(', '), '3, 6, 9', 'tripled numbers with context'); - - var doubled = _([1, 2, 3]).map(function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers'); - - var ids = _.map($('div.underscore-test').children(), function(n){ return n.id; }); - ok(_.include(ids, 'qunit-header'), 'can use collection methods on NodeLists'); - - 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'); - - var length = _.map(Array(2), function(v) { return v; }).length; - equals(length, 2, "can preserve a sparse array's length"); - }); - - test('collections: reduce', function() { - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equals(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); - equals(sum, 18, 'can reduce with a context object'); - - sum = _.inject([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'aliased as "inject"'); - - sum = _([1, 2, 3]).reduce(function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'OO-style reduce'); - - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }); - equals(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'); - equals(_.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'); - - var sparseArray = []; - sparseArray[0] = 20; - sparseArray[2] = -5; - equals(_.reduce(sparseArray, function(a, b){ return a - b; }), 25, 'initially-sparse arrays with no memo'); - }); - - test('collections: reduceRight', function() { - var list = _.reduceRight(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equals(list, 'bazbarfoo', 'can perform right folds'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equals(list, 'bazbarfoo', 'aliased as "foldr"'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }); - equals(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'); - - ok(_.reduceRight(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); - - equals(_.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'); - - var sparseArray = []; - sparseArray[0] = 20; - sparseArray[2] = -5; - equals(_.reduceRight(sparseArray, function(a, b){ return a - b; }), -25, 'initially-sparse arrays with no memo'); - }); - - test('collections: detect', function() { - var result = _.detect([1, 2, 3], function(num){ return num * 2 == 4; }); - equals(result, 2, 'found the first "2" and broke the loop'); - }); - - test('collections: select', function() { - var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(evens.join(', '), '2, 4, 6', 'selected each even number'); - - evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(evens.join(', '), '2, 4, 6', 'aliased as "filter"'); - }); - - test('collections: reject', function() { - var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(odds.join(', '), '1, 3, 5', 'rejected each even number'); - }); - - test('collections: 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(_.every([true, true, true], _.identity), 'aliased as "every"'); - }); - - test('collections: 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(_.some([false, false, true]), 'aliased as "some"'); - Array.prototype.some = nativeSome; - }); - - test('collections: 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('collections: invoke', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, 'sort'); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - test('collections: invoke w/ function reference', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, Array.prototype.sort); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - // Relevant when using ClojureScript - test('collections: 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"; - equals(s.call(), 42, "call function exists"); - var result = _.invoke(list, 'sort'); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - delete String.prototype.call; - equals(s.call, undefined, "call function removed"); - }); - - test('collections: pluck', function() { - var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}]; - equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'pulls names out of objects'); - }); - - test('collections: max', function() { - equals(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); - - var neg = _.max([1, 2, 3], function(num){ return -num; }); - equals(neg, 1, 'can perform a computation-based max'); - - equals(-Infinity, _.max({}), 'Maximum value of an empty object'); - equals(-Infinity, _.max([]), 'Maximum value of an empty array'); - }); - - test('collections: min', function() { - equals(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); - - var neg = _.min([1, 2, 3], function(num){ return -num; }); - equals(neg, 3, 'can perform a computation-based min'); - - equals(Infinity, _.min({}), 'Minimum value of an empty object'); - equals(Infinity, _.min([]), 'Minimum value of an empty array'); - }); - - test('collections: sortBy', function() { - var people = [{name : 'curly', age : 50}, {name : 'moe', age : 30}]; - people = _.sortBy(people, function(person){ return person.age; }); - equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'stooges sorted by age'); - }); - - test('collections: 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'); - equals(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'); - equals(grouped['3'].join(' '), 'one two six ten'); - equals(grouped['4'].join(' '), 'four five nine'); - equals(grouped['5'].join(' '), 'three seven eight'); - }); - - test('collections: sortedIndex', function() { - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.sortedIndex(numbers, num); - equals(index, 3, '35 should be inserted at index 3'); - }); - - test('collections: shuffle', function() { - var numbers = _.range(10); - var shuffled = _.shuffle(numbers).sort(); - notStrictEqual(numbers, shuffled, 'original object is unmodified'); - equals(shuffled.join(','), numbers.join(','), 'contains the same members before and after shuffle'); - }); - - test('collections: 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'); - equals(_.toArray(a).join(', '), '1, 2, 3', 'cloned array contains same elements'); - - var numbers = _.toArray({one : 1, two : 2, three : 3}); - equals(numbers.join(', '), '1, 2, 3', 'object flattened into array'); - }); - - test('collections: size', function() { - equals(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object'); - }); - -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/functions.js deleted file mode 100644 index 78721af..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/functions.js +++ /dev/null @@ -1,198 +0,0 @@ -$(document).ready(function() { - - module("Functions"); - - test("functions: bind", function() { - var context = {name : 'moe'}; - var func = function(arg) { return "name: " + (this.name || arg); }; - var bound = _.bind(func, context); - equals(bound(), 'name: moe', 'can bind a function to a context'); - - bound = _(func).bind(context); - equals(bound(), 'name: moe', 'can do OO-style binding'); - - bound = _.bind(func, null, 'curly'); - equals(bound(), 'name: curly', 'can bind without specifying a context'); - - func = function(salutation, name) { return salutation + ': ' + name; }; - func = _.bind(func, this, 'hello'); - equals(func('moe'), 'hello: moe', 'the function was partially applied in advance'); - - var func = _.bind(func, this, 'curly'); - equals(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'); - equals(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments'); - - func = function(context, message) { equals(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("functions: 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; - equals(curly.getName(), 'name: curly', 'unbound function is bound to current object'); - equals(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; - equals(curly.sayHi(), 'hi: moe', 'calling bindAll with no arguments binds all functions to the object'); - }); - - test("functions: memoize", function() { - var fib = function(n) { - return n < 2 ? n : fib(n - 1) + fib(n - 2); - }; - var fastFib = _.memoize(fib); - equals(fib(10), 55, 'a memoized version of fibonacci produces identical results'); - equals(fastFib(10), 55, 'a memoized version of fibonacci produces identical results'); - - var o = function(str) { - return str; - }; - var fastO = _.memoize(o); - equals(o('toString'), 'toString', 'checks hasOwnProperty'); - equals(fastO('toString'), 'toString', 'checks hasOwnProperty'); - }); - - asyncTest("functions: 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("functions: defer", 1, function() { - var deferred = false; - _.defer(function(bool){ deferred = bool; }, true); - _.delay(function(){ ok(deferred, "deferred the function"); start(); }, 50); - }); - - asyncTest("functions: 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(){ ok(counter == 1, "incr was called immediately"); }, 30); - _.delay(function(){ ok(counter == 4, "incr was throttled"); start(); }, 400); - }); - - asyncTest("functions: 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(){ equals(value, 1, "updated to latest value"); }, 40); - _.delay(function(){ equals(value, 6, "updated to latest value"); start(); }, 400); - }); - - asyncTest("functions: throttle once", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); - _.delay(function(){ ok(counter == 1, "incr was called once"); start(); }, 220); - }); - - asyncTest("functions: throttle twice", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); throttledIncr(); - _.delay(function(){ ok(counter == 2, "incr was called twice"); start(); }, 220); - }); - - asyncTest("functions: 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(){ ok(counter == 1, "incr was debounced"); start(); }, 220); - }); - - test("functions: once", function() { - var num = 0; - var increment = _.once(function(){ num++; }); - increment(); - increment(); - equals(num, 1); - }); - - test("functions: wrap", function() { - var greet = function(name){ return "hi: " + name; }; - var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); }); - equals(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; }); - equals(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'); - same(ret, [noop, ['whats', 'your'], 'vector', 'victor']); - }); - - test("functions: compose", function() { - var greet = function(name){ return "hi: " + name; }; - var exclaim = function(sentence){ return sentence + '!'; }; - var composed = _.compose(exclaim, greet); - equals(composed('moe'), 'hi: moe!', 'can compose a function that takes another'); - - composed = _.compose(greet, exclaim); - equals(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative'); - }); - - test("functions: after", function() { - var testAfter = function(afterAmount, timesCalled) { - var afterCalled = 0; - var after = _.after(afterAmount, function() { - afterCalled++; - }); - while (timesCalled--) after(); - return afterCalled; - }; - - equals(testAfter(5, 5), 1, "after(N) should fire after being called N times"); - equals(testAfter(5, 4), 0, "after(N) should not fire unless called N times"); - equals(testAfter(0, 0), 1, "after(0) should fire immediately"); - }); - -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/objects.js deleted file mode 100644 index 0105d60..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/objects.js +++ /dev/null @@ -1,535 +0,0 @@ -$(document).ready(function() { - - module("Objects"); - - test("objects: keys", function() { - var exception = /object/; - equals(_.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; - equals(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); - raises(function() { _.keys(null); }, exception, 'throws an error for `null` values'); - raises(function() { _.keys(void 0); }, exception, 'throws an error for `undefined` values'); - raises(function() { _.keys(1); }, exception, 'throws an error for number primitives'); - raises(function() { _.keys('a'); }, exception, 'throws an error for string primitives'); - raises(function() { _.keys(true); }, exception, 'throws an error for boolean primitives'); - }); - - test("objects: values", function() { - equals(_.values({one : 1, two : 2}).join(', '), '1, 2', 'can extract the values from an object'); - }); - - test("objects: 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(){}; - equals(_.functions(new Animal).join(''), 'run', 'also looks up functions on the prototype'); - }); - - test("objects: extend", function() { - var result; - equals(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); - equals(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); - equals(_.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}); - equals(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); - }); - - test("objects: defaults", function() { - var result; - var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"}; - - _.defaults(options, {zero: 1, one: 10, twenty: 20}); - equals(options.zero, 0, 'value exists'); - equals(options.one, 1, 'value exists'); - equals(options.twenty, 20, 'default applied'); - - _.defaults(options, {empty: "full"}, {nan: "nan"}, {word: "word"}, {word: "dog"}); - equals(options.empty, "", 'value exists'); - ok(_.isNaN(options.nan), "NaN isn't overridden"); - equals(options.word, "word", 'new value is added, first one wins'); - }); - - test("objects: clone", function() { - var moe = {name : 'moe', lucky : [13, 27, 34]}; - var clone = _.clone(moe); - equals(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); - equals(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); - - equals(_.clone(undefined), void 0, 'non objects should not be changed by clone'); - equals(_.clone(1), 1, 'non objects should not be changed by clone'); - equals(_.clone(null), null, 'non objects should not be changed by clone'); - }); - - test("objects: 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"); - - // According to the Microsoft deviations spec, section 2.1.26, JScript 5.x treats `undefined` - // elements in arrays as elisions. Thus, sparse arrays and dense arrays containing `undefined` - // values are equivalent. - if (0 in [undefined]) { - ok(!_.isEqual(Array(3), [undefined, undefined, undefined]), "Sparse and dense arrays are not equal"); - ok(!_.isEqual([undefined, undefined, undefined], Array(3)), "Commutative equality is implemented for sparse and dense arrays"); - } - - // 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"); - - // 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"); - - // 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'); - equals(_({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'); - - // Custom `isEqual` methods - comparing different types - LocalizedString = (function() { - function LocalizedString(id) { this.id = id; this.string = (this.id===10)? 'Bonjour': ''; } - LocalizedString.prototype.isEqual = function(that) { - if (_.isString(that)) return this.string == that; - else if (that instanceof LocalizedString) return this.id == that.id; - return false; - }; - return LocalizedString; - })(); - var localized_string1 = new LocalizedString(10), localized_string2 = new LocalizedString(10), localized_string3 = new LocalizedString(11); - ok(_.isEqual(localized_string1, localized_string2), 'comparing same typed instances with same ids'); - ok(!_.isEqual(localized_string1, localized_string3), 'comparing same typed instances with different ids'); - ok(_.isEqual(localized_string1, 'Bonjour'), 'comparing different typed instances with same values'); - ok(_.isEqual('Bonjour', localized_string1), 'comparing different typed instances with same values'); - ok(!_.isEqual('Bonjour', localized_string3), 'comparing two localized strings with different ids'); - ok(!_.isEqual(localized_string1, 'Au revoir'), 'comparing different typed instances with different values'); - ok(!_.isEqual('Au revoir', localized_string1), 'comparing different typed instances with different values'); - - // Custom `isEqual` methods - comparing with serialized data - Date.prototype.toJSON = function() { - return { - _type:'Date', - year:this.getUTCFullYear(), - month:this.getUTCMonth(), - day:this.getUTCDate(), - hours:this.getUTCHours(), - minutes:this.getUTCMinutes(), - seconds:this.getUTCSeconds() - }; - }; - Date.prototype.isEqual = function(that) { - var this_date_components = this.toJSON(); - var that_date_components = (that instanceof Date) ? that.toJSON() : that; - delete this_date_components['_type']; delete that_date_components['_type'] - return _.isEqual(this_date_components, that_date_components); - }; - - var date = new Date(); - var date_json = { - _type:'Date', - year:date.getUTCFullYear(), - month:date.getUTCMonth(), - day:date.getUTCDate(), - hours:date.getUTCHours(), - minutes:date.getUTCMinutes(), - seconds:date.getUTCSeconds() - }; - - ok(_.isEqual(date_json, date), 'serialized date matches date'); - ok(_.isEqual(date, date_json), 'date matches serialized date'); - }); - - test("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: isRegExp", function() { - ok(!_.isRegExp(_.identity), 'functions are not RegExps'); - ok(_.isRegExp(/identity/), 'but RegExps are'); - ok(_.isRegExp(iRegExp), 'even from another frame'); - }); - - test("objects: 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'); - }); - - test("objects: 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("objects: 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("objects: 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("objects: tap", function() { - var intercepted = null; - var interceptor = function(obj) { intercepted = obj; }; - var returned = _.tap(1, interceptor); - equals(intercepted, 1, "passes tapped object to interceptor"); - equals(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/node_modules/grunt/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/speed.js deleted file mode 100644 index 86663a2..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/speed.js +++ /dev/null @@ -1,70 +0,0 @@ -(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(); }); - - 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('_.intersect()', function() { - return _.intersect(numbers, randomized); - }); - - JSLitmus.test('_.range()', function() { - return _.range(1000); - }); - -})(); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp.js deleted file mode 100644 index 68c39dc..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp.js +++ /dev/null @@ -1,27 +0,0 @@ -(function() { - - var func = function(){}; - var date = new Date(); - var str = "a string"; - 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(); }); - - JSLitmus.test('_.isNumber', function() { - return _.isNumber(1000) - }); - - JSLitmus.test('_.newIsNumber', function() { - return _.newIsNumber(1000) - }); - - JSLitmus.test('_.isNumber(NaN)', function() { - return _.isNumber(NaN) - }); - - JSLitmus.test('_.newIsNumber(NaN)', function() { - return _.newIsNumber(NaN) - }); - -})(); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html deleted file mode 100644 index bd34f9d..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Underscore Temporary Tests - - - - - - - -

                                Underscore Temporary Tests

                                -

                                - A page for temporary speed tests, used for developing faster implementations - of existing Underscore methods. -

                                -
                                - - diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html deleted file mode 100644 index 77f2f3a..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - Underscore Test Suite - - - - - - - - - - - - - - - -
                                -

                                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 'intersect' test measures the number of times you can - find the intersection of two thousand-element arrays in one second. -

                                  -
                                  - - -
                                  - - diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/utility.js deleted file mode 100644 index 7bc5cb4..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/utility.js +++ /dev/null @@ -1,155 +0,0 @@ -$(document).ready(function() { - - module("Utility"); - - test("utility: noConflict", function() { - var underscore = _.noConflict(); - ok(underscore.isUndefined(_), "The '_' variable has been returned to its previous state."); - var intersection = underscore.intersect([-1, 0, 1, 2], [1, 2, 3, 4]); - equals(intersection.join(', '), '1, 2', 'but the intersection function still works'); - window._ = underscore; - }); - - test("utility: identity", function() { - var moe = {name : 'moe'}; - equals(_.identity(moe), moe, 'moe is the same as his identity'); - }); - - test("utility: uniqueId", function() { - var ids = [], i = 0; - while(i++ < 100) ids.push(_.uniqueId()); - equals(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); - }); - - test("utility: 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("utility: mixin", function() { - _.mixin({ - myReverse: function(string) { - return string.split('').reverse().join(''); - } - }); - equals(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); - equals(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); - }); - - test("utility: _.escape", function() { - equals(_.escape("Curly & Moe"), "Curly & Moe"); - equals(_.escape("Curly & Moe"), "Curly &amp; Moe"); - }); - - test("utility: template", function() { - var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); - var result = basicTemplate({thing : 'This'}); - equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); - - var sansSemicolonTemplate = _.template("A <% this %> B"); - equals(sansSemicolonTemplate(), "A B"); - - var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); - equals(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); - - var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>'); - equals(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"}}); - equals(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"}); - equals(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" - } - }); - equals(result, "3 p3-thumbnail.gif
                                  "); - - var noInterpolateTemplate = _.template("

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

                                  "); - result = noInterpolateTemplate(); - equals(result, "

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

                                  "); - - var quoteTemplate = _.template("It's its, not it's"); - equals(quoteTemplate({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("<%\ - if(foo == 'bar'){ \ - %>Statement quotes and 'quotes'.<% } %>"); - equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); - equals(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); - - var template = _.template("<%- value %>"); - var result = template({value: " -``` - -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 - * 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/node_modules/load-grunt-tasks/node_modules/lodash/dist/lodash.compat.js b/node_modules/load-grunt-tasks/node_modules/lodash/dist/lodash.compat.js deleted file mode 100644 index e48344d..0000000 --- a/node_modules/load-grunt-tasks/node_modules/lodash/dist/lodash.compat.js +++ /dev/null @@ -1,6721 +0,0 @@ -/** - * @license - * Lo-Dash 2.2.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-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 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; - - // 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() || { - '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'; - } - - /** - * 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, - now = reNative.test(now = Date.now) && now || function() { return +new Date; }, - 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 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`, `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 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) { - 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 (deep) { - // 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 (!deep) { - 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, 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() { - // 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 - ); - } - - /** - * 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) { - 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') || 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 - (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); - } - } 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); - } - }; - - 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); - 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; - } - debounceOptions.leading = leading; - debounceOptions.maxWait = wait; - debounceOptions.trailing = trailing; - - var result = debounce(func, wait, debounceOptions); - 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); - if (value && typeof value == 'object' && value === result) { - return this; - } - result = new ctor(result); - result.__chain__ = this.__chain__; - 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; - } - - /** - * 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) - ? nativeMin(min + (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 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 * 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.2.1", - "dist": { - "shasum": "ca935fd14ab3c0c872abacf198b9cda501440867" - }, - "_from": "lodash@~2.2.1", - "_resolved": "https://registry.npmjs.org/lodash/-/lodash-2.2.1.tgz" -} diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/LICENSE b/node_modules/load-grunt-tasks/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/load-grunt-tasks/node_modules/minimatch/README.md b/node_modules/load-grunt-tasks/node_modules/minimatch/README.md deleted file mode 100644 index 6fd07d2..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# 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! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -### 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. **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 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. - - -## 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.) diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/minimatch.js b/node_modules/load-grunt-tasks/node_modules/minimatch/minimatch.js deleted file mode 100644 index 405746b..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1079 +0,0 @@ -;(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.monkeyPatch = monkeyPatch -function monkeyPatch () { - var desc = Object.getOwnPropertyDescriptor(String.prototype, "match") - var orig = desc.value - desc.value = function (p) { - if (p instanceof Minimatch) return p.match(this) - return orig.call(this, p) - } - Object.defineProperty(String.prototype, desc) -} - -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.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) console.error(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) - }) - - if (options.debug) console.error(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - if (options.debug) console.error(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - if (options.debug) console.error(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) !== "{") { - // console.error(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error(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) { - // console.error("no sets") - return [pattern] - } - - var tail = braceExpand(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) { - // console.error("numset", numset[1], numset[2]) - var suf = braceExpand(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 = "" - } - - // console.error("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - // console.error("", 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) { - // console.error("didn't close", pattern) - return braceExpand("\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - // console.error("set", set) - // console.error("suffix", pattern.substr(i)) - var suf = braceExpand(pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - // console.error("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand(p, options) - }) - // console.error("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}(?:$|\\\/))" - : "(?!\\.)" - - 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 - } - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - if (options.debug) { - console.error("%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 "!": - if (options.debug) { - console.error("%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) { - 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. - 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 === "!" ? "(?:(?!" : "(?:" - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - 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 - } - - 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 + "|" - }) - - // console.error("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) { - // console.error("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) - if (options.debug) { - console.error(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 - // console.error(this.pattern, "set", set) - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i] - var hit = this.matchOne(f, 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 - - if (options.debug) { - console.error("matchOne", - { "this": this - , file: file - , pattern: pattern }) - } - - if (options.matchBase && pattern.length === 1) { - file = path.basename(file.join("/")).split("/") - } - - if (options.debug) { - console.error("matchOne", file.length, pattern.length) - } - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - if (options.debug) { - console.error("matchOne loop") - } - var p = pattern[pi] - , f = file[fi] - - if (options.debug) { - console.error(pattern, p, f) - } - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - if (options.debug) - console.error('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) { - if (options.debug) - console.error('** 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] - - if (options.debug) { - console.error('\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)) { - if (options.debug) - console.error('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) === ".")) { - if (options.debug) - console.error("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - if (options.debug) - console.error('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 - // console.error("\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 - } - if (options.debug) { - console.error("string match", p, f, hit) - } - } else { - hit = f.match(p) - if (options.debug) { - console.error("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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/AUTHORS b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/AUTHORS deleted file mode 100644 index 016d7fb..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Carlos Brito Lage -Marko Mikulicic -Trent Mick -Kevin O'Hara -Marco Rogers -Jesse Dailey diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f9..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# 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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/bench.js b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/bench.js deleted file mode 100644 index 9111540..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/bench.js +++ /dev/null @@ -1,25 +0,0 @@ -var LRU = require('lru-cache'); - -var max = +process.argv[2] || 10240; -var more = 102400; - -var cache = LRU({ - max: max, maxAge: 86400e3 -}); - -// fill cache -for (var i = 0; i < max; ++i) { - cache.set(i, {}); -} - -var start = process.hrtime(); - -// adding more items -for ( ; i < max+more; ++i) { - cache.set(i, {}); -} - -var end = process.hrtime(start); -var msecs = end[0] * 1E3 + end[1] / 1E6; - -console.log('adding %d items took %d ms', more, msecs.toPrecision(5)); diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 49c1dc6..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,263 +0,0 @@ -;(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) - } - - var max - if (typeof options === 'number') { - max = options - options = { max: max } - } - - if (!options) options = {} - - max = options.max - - var lengthCalculator = options.length || naiveLength - - if (typeof lengthCalculator !== "function") { - lengthCalculator = naiveLength - } - - if (!max || !(typeof max === "number") || max <= 0 ) { - // a little bit silly. maybe this should throw? - max = Infinity - } - - var allowStale = options.stale || false - - var maxAge = options.maxAge || null - - var dispose = options.dispose - - var cache = Object.create(null) // hash of items by key - , lruList = Object.create(null) // list of items in order of use recency - , mru = 0 // most recently used - , lru = 0 // least recently used - , length = 0 // number of items in the list - , itemCount = 0 - - - // resize the cache when the max changes. - Object.defineProperty(this, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - max = mL - // if it gets above double max, trim right away. - // otherwise, do it whenever it's convenient. - if (length > max) trim() - } - , get : function () { return max } - , enumerable : true - }) - - // resize the cache when the lengthCalculator changes. - Object.defineProperty(this, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - lengthCalculator = naiveLength - length = itemCount - for (var key in cache) { - cache[key].length = 1 - } - } else { - lengthCalculator = lC - length = 0 - for (var key in cache) { - cache[key].length = lengthCalculator(cache[key].value) - length += cache[key].length - } - } - - if (length > max) trim() - } - , get : function () { return lengthCalculator } - , enumerable : true - }) - - Object.defineProperty(this, "length", - { get : function () { return length } - , enumerable : true - }) - - - Object.defineProperty(this, "itemCount", - { get : function () { return itemCount } - , enumerable : true - }) - - this.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - i++ - var hit = lruList[k] - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } - } - - this.keys = function () { - var keys = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - keys[i++] = hit.key - } - return keys - } - - this.values = function () { - var values = new Array(itemCount) - var i = 0 - for (var k = mru - 1; k >= 0 && i < itemCount; k--) if (lruList[k]) { - var hit = lruList[k] - values[i++] = hit.value - } - return values - } - - this.reset = function () { - if (dispose) { - for (var k in cache) { - dispose(k, cache[k].value) - } - } - cache = {} - lruList = {} - lru = 0 - mru = 0 - length = 0 - itemCount = 0 - } - - // Provided for debugging/dev purposes only. No promises whatsoever that - // this API stays stable. - this.dump = function () { - return cache - } - - this.dumpLru = function () { - return lruList - } - - this.set = function (key, value) { - if (hOP(cache, key)) { - // dispose of the old one before overwriting - if (dispose) dispose(key, cache[key].value) - if (maxAge) cache[key].now = Date.now() - cache[key].value = value - this.get(key) - return true - } - - var len = lengthCalculator(value) - var age = maxAge ? Date.now() : 0 - var hit = new Entry(key, value, mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > max) { - if (dispose) dispose(key, value) - return false - } - - length += hit.length - lruList[hit.lu] = cache[key] = hit - itemCount ++ - - if (length > max) trim() - return true - } - - this.has = function (key) { - if (!hOP(cache, key)) return false - var hit = cache[key] - if (maxAge && (Date.now() - hit.now > maxAge)) { - return false - } - return true - } - - this.get = function (key) { - return get(key, true) - } - - this.peek = function (key) { - return get(key, false) - } - - function get (key, doUse) { - var hit = cache[key] - if (hit) { - if (maxAge && (Date.now() - hit.now > maxAge)) { - del(hit) - if (!allowStale) hit = undefined - } else { - if (doUse) use(hit) - } - if (hit) hit = hit.value - } - return hit - } - - function use (hit) { - shiftLU(hit) - hit.lu = mru ++ - lruList[hit.lu] = hit - } - - this.del = function (key) { - del(cache[key]) - } - - function trim () { - while (lru < mru && length > max) - del(lruList[lru]) - } - - function shiftLU(hit) { - delete lruList[ hit.lu ] - while (lru < mru && !lruList[lru]) lru ++ - } - - function del(hit) { - if (hit) { - if (dispose) dispose(hit.key, hit.value) - length -= hit.length - itemCount -- - delete cache[ hit.key ] - shiftLU(hit) - } - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, mru, len, age) { - this.key = key - this.value = value - this.lu = mru - this.length = len - this.now = age -} - -})() diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 411acad..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.3.1", - "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" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Carlos Brito Lage", - "email": "carlos@carloslage.net" - }, - { - "name": "Marko Mikulicic", - "email": "marko.mikulicic@isti.cnr.it" - }, - { - "name": "Trent Mick", - "email": "trentm@gmail.com" - }, - { - "name": "Kevin O'Hara", - "email": "kevinohara80@gmail.com" - }, - { - "name": "Marco Rogers", - "email": "marco.rogers@gmail.com" - }, - { - "name": "Jesse Dailey", - "email": "jesse.dailey@gmail.com" - } - ], - "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" - }, - "_id": "lru-cache@2.3.1", - "_from": "lru-cache@2" -} diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index 70f3f8b..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,329 +0,0 @@ -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() -}) diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b0..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# 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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// 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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index ec8e2eb..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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" - }, - "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" -} diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -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/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -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/node_modules/load-grunt-tasks/node_modules/minimatch/package.json b/node_modules/load-grunt-tasks/node_modules/minimatch/package.json deleted file mode 100644 index a347405..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "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.12", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "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!\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### 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. **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 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\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", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "_id": "minimatch@0.2.12", - "_from": "minimatch@~0.2.11" -} diff --git a/node_modules/load-grunt-tasks/node_modules/minimatch/test/basic.js b/node_modules/load-grunt-tasks/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// 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/node_modules/load-grunt-tasks/node_modules/minimatch/test/brace-expand.js b/node_modules/load-grunt-tasks/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index 7ee278a..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,33 +0,0 @@ -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/node_modules/load-grunt-tasks/node_modules/minimatch/test/caching.js b/node_modules/load-grunt-tasks/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -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/node_modules/load-grunt-tasks/node_modules/minimatch/test/defaults.js b/node_modules/load-grunt-tasks/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 25f1f60..0000000 --- a/node_modules/load-grunt-tasks/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// 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/node_modules/load-grunt-tasks/package.json b/node_modules/load-grunt-tasks/package.json deleted file mode 100644 index 6a1b717..0000000 --- a/node_modules/load-grunt-tasks/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "load-grunt-tasks", - "version": "0.1.3", - "description": "Load multiple grunt tasks using globbing patterns", - "keywords": [ - "grunt", - "load", - "require", - "tasks", - "glob", - "pattern", - "match" - ], - "homepage": "https://github.com/sindresorhus/load-grunt-tasks", - "bugs": { - "url": "https://github.com/sindresorhus/load-grunt-tasks/issues" - }, - "license": "MIT", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "files": [ - "load-grunt-tasks.js" - ], - "main": "load-grunt-tasks", - "repository": { - "type": "git", - "url": "git://github.com/sindresorhus/load-grunt-tasks.git" - }, - "scripts": { - "test": "grunt" - }, - "dependencies": { - "minimatch": "~0.2.12", - "lodash": "~2.2.1" - }, - "devDependencies": { - "grunt": "~0.4.1", - "grunt-svgmin": "~0.2.0" - }, - "engines": { - "node": ">=0.8.0" - }, - "readme": "# load-grunt-tasks [![Build Status](https://secure.travis-ci.org/sindresorhus/load-grunt-tasks.png?branch=master)](http://travis-ci.org/sindresorhus/load-grunt-tasks)\n\n> Load multiple grunt tasks using globbing patterns\n\nUsually you would have to load each task one by one, which is unnecessarily cumbersome.\n\nThis module will read the `devDependencies` in your package.json and load the tasks that matches your patterns.\n\n\n#### Before\n\n```js\ngrunt.loadNpmTasks('grunt-shell');\ngrunt.loadNpmTasks('grunt-sass');\ngrunt.loadNpmTasks('grunt-recess');\ngrunt.loadNpmTasks('grunt-sizediff');\ngrunt.loadNpmTasks('grunt-svgmin');\ngrunt.loadNpmTasks('grunt-styl');\ngrunt.loadNpmTasks('grunt-php');\ngrunt.loadNpmTasks('grunt-eslint');\ngrunt.loadNpmTasks('grunt-concurrent');\ngrunt.loadNpmTasks('grunt-bower-requirejs');\n```\n\n#### After\n\n```js\nrequire('load-grunt-tasks')(grunt);\n```\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/load-grunt-tasks): `npm install --save-dev load-grunt-tasks`\n\n\n## Example\n\n```js\n// Gruntfile.js\nmodule.exports = function (grunt) {\n\t// load all grunt tasks matching the `grunt-*` pattern\n\trequire('load-grunt-tasks')(grunt);\n\n\tgrunt.initConfig();\n\tgrunt.registerTask('default', []);\n}\n```\n\nBy default `grunt-*` will be used as the [globbing pattern](https://github.com/isaacs/minimatch).\n\nYou can optionally specify a pattern or an array of patterns:\n\n```js\nrequire('load-grunt-tasks')(grunt, 'grunt-shell');\n```\n\n```js\nrequire('load-grunt-tasks')(grunt, 'grunt-contrib-*');\n```\n\n```js\nrequire('load-grunt-tasks')(grunt, ['grunt-contrib-*', 'grunt-shell']);\n```\n\nYou also have the option to specify the package.json as an object if it's not in the same folder as your Gruntfile:\n\n```js\nrequire('load-grunt-tasks')(grunt, 'grunt-shell', require('../package'));\n```\n\n\n## License\n\nMIT License • © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "_id": "load-grunt-tasks@0.1.3", - "dist": { - "shasum": "cdc9813d869f125388e933b20a50262ed9e99371" - }, - "_from": "load-grunt-tasks@~0.1.0", - "_resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-0.1.3.tgz" -} diff --git a/node_modules/load-grunt-tasks/readme.md b/node_modules/load-grunt-tasks/readme.md deleted file mode 100644 index 1c511a2..0000000 --- a/node_modules/load-grunt-tasks/readme.md +++ /dev/null @@ -1,75 +0,0 @@ -# load-grunt-tasks [![Build Status](https://secure.travis-ci.org/sindresorhus/load-grunt-tasks.png?branch=master)](http://travis-ci.org/sindresorhus/load-grunt-tasks) - -> Load multiple grunt tasks using globbing patterns - -Usually you would have to load each task one by one, which is unnecessarily cumbersome. - -This module will read the `devDependencies` in your package.json and load the tasks that matches your patterns. - - -#### Before - -```js -grunt.loadNpmTasks('grunt-shell'); -grunt.loadNpmTasks('grunt-sass'); -grunt.loadNpmTasks('grunt-recess'); -grunt.loadNpmTasks('grunt-sizediff'); -grunt.loadNpmTasks('grunt-svgmin'); -grunt.loadNpmTasks('grunt-styl'); -grunt.loadNpmTasks('grunt-php'); -grunt.loadNpmTasks('grunt-eslint'); -grunt.loadNpmTasks('grunt-concurrent'); -grunt.loadNpmTasks('grunt-bower-requirejs'); -``` - -#### After - -```js -require('load-grunt-tasks')(grunt); -``` - - -## Install - -Install with [npm](https://npmjs.org/package/load-grunt-tasks): `npm install --save-dev load-grunt-tasks` - - -## Example - -```js -// Gruntfile.js -module.exports = function (grunt) { - // load all grunt tasks matching the `grunt-*` pattern - require('load-grunt-tasks')(grunt); - - grunt.initConfig(); - grunt.registerTask('default', []); -} -``` - -By default `grunt-*` will be used as the [globbing pattern](https://github.com/isaacs/minimatch). - -You can optionally specify a pattern or an array of patterns: - -```js -require('load-grunt-tasks')(grunt, 'grunt-shell'); -``` - -```js -require('load-grunt-tasks')(grunt, 'grunt-contrib-*'); -``` - -```js -require('load-grunt-tasks')(grunt, ['grunt-contrib-*', 'grunt-shell']); -``` - -You also have the option to specify the package.json as an object if it's not in the same folder as your Gruntfile: - -```js -require('load-grunt-tasks')(grunt, 'grunt-shell', require('../package')); -``` - - -## License - -MIT License • © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/time-grunt/node_modules/chalk/chalk.js b/node_modules/time-grunt/node_modules/chalk/chalk.js deleted file mode 100644 index 17c6dba..0000000 --- a/node_modules/time-grunt/node_modules/chalk/chalk.js +++ /dev/null @@ -1,62 +0,0 @@ -'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/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js b/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js deleted file mode 100644 index 56a5d19..0000000 --- a/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/ansi-styles.js +++ /dev/null @@ -1,29 +0,0 @@ -'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/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index c2f556a..0000000 --- a/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "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/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/readme.md deleted file mode 100644 index 646837c..0000000 --- a/node_modules/time-grunt/node_modules/chalk/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,65 +0,0 @@ -# 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/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/has-color.js b/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/has-color.js deleted file mode 100644 index 4fb6efa..0000000 --- a/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/has-color.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -module.exports = (function () { - var term; - - 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; - } - - term = process.env.TERM; - - if (!term) { - return false; - } - - term = term.toLowerCase(); - - return term.indexOf('color') !== -1 || term === 'xterm' || term === 'linux'; -})(); diff --git a/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/package.json b/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/package.json deleted file mode 100644 index 612d573..0000000 --- a/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "has-color", - "version": "0.1.1", - "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\n*Used 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 can be overriden by the user with the flags `--color` and `--no-color`.\n\n\n## License\n\nMIT License • © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "_id": "has-color@0.1.1", - "_from": "has-color@~0.1.0" -} diff --git a/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/readme.md b/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/readme.md deleted file mode 100644 index 5718180..0000000 --- a/node_modules/time-grunt/node_modules/chalk/node_modules/has-color/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# 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 can be overriden by the user with the flags `--color` and `--no-color`. - - -## License - -MIT License • © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/time-grunt/node_modules/chalk/package.json b/node_modules/time-grunt/node_modules/chalk/package.json deleted file mode 100644 index fa15ac2..0000000 --- a/node_modules/time-grunt/node_modules/chalk/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "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.\\